forked from rosebudai/OpenRCT2-Web
Merge remote-tracking branch 'upstream/master' into hire-staff-command
This commit is contained in:
commit
ff28ff7e1b
41 files changed
+3044
-819
No files matched your search
+478
-478
File diff suppressed because it is too large.
Load diff
@@ -27,6 +27,7 @@
|
||||
<ClInclude Include="..\src\finance.h" />
|
||||
<ClInclude Include="..\src\game.h" />
|
||||
<ClInclude Include="..\src\gfx.h" />
|
||||
<ClInclude Include="..\src\graph.h" />
|
||||
<ClInclude Include="..\src\intro.h" />
|
||||
<ClInclude Include="..\src\map.h" />
|
||||
<ClInclude Include="..\src\marketing.h" />
|
||||
@@ -70,6 +71,7 @@
|
||||
<ClCompile Include="..\src\finance.c" />
|
||||
<ClCompile Include="..\src\game.c" />
|
||||
<ClCompile Include="..\src\gfx.c" />
|
||||
<ClCompile Include="..\src\graph.c" />
|
||||
<ClCompile Include="..\src\intro.c" />
|
||||
<ClCompile Include="..\src\map.c" />
|
||||
<ClCompile Include="..\src\marketing.c" />
|
||||
@@ -106,6 +108,7 @@
|
||||
<ClCompile Include="..\src\window_dropdown.c" />
|
||||
<ClCompile Include="..\src\window_guest_list.c" />
|
||||
<ClCompile Include="..\src\window_land.c" />
|
||||
<ClCompile Include="..\src\window_new_campaign.c" />
|
||||
<ClCompile Include="..\src\window_news.c" />
|
||||
<ClCompile Include="..\src\window_park.c" />
|
||||
<ClCompile Include="..\src\window_finances.c" />
|
||||
@@ -211,6 +214,9 @@
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<AdditionalDependencies>winmm.lib;sdl2.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>xcopy /Y "$(ProjectDir)\..\Data\Language\*.*" "$(TargetDir)\Data\Language\"</Command>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
|
||||
@@ -150,6 +150,9 @@
|
||||
<ClInclude Include="..\src\cursors.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\src\graph.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\src\game.c">
|
||||
@@ -350,6 +353,12 @@
|
||||
<ClCompile Include="..\src\currency.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\graph.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\window_new_campaign.c">
|
||||
<Filter>Windows</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\openrct2.exe">
|
||||
|
||||
@@ -172,6 +172,8 @@
|
||||
//32bit (pixel_offset 24 bit)(pixel_colour 8 bit)
|
||||
#define RCT2_ADDRESS_RAIN_PIXEL_STORE 0x00EDF850
|
||||
|
||||
#define RCT2_ADDRESS_UNCOMPLETED_RESEARCH_TYPES 0x00EE787C
|
||||
|
||||
#define RCT2_ADDRESS_MAP_IMAGE_DATA 0x00F1AD68
|
||||
|
||||
#define RCT2_ADDRESS_PROVISIONAL_PATH_FLAGS 0x00F3EF92
|
||||
@@ -247,6 +249,8 @@
|
||||
#define RCT2_ADDRESS_MECHANIC_COLOUR 0x01357BCE
|
||||
#define RCT2_ADDRESS_SECURITY_COLOUR 0x01357BCF
|
||||
|
||||
#define RCT2_ADDRESS_ACTIVE_RESEARCH_TYPES 0x01357CF2
|
||||
|
||||
#define RCT2_ADDRESS_MAP_SIZE 0x01358834
|
||||
#define RCT2_ADDRESS_PARK_SIZE 0x013580EA
|
||||
|
||||
|
||||
@@ -32,6 +32,7 @@ enum {
|
||||
RCT_EXPENDITURE_TYPE_INTEREST = 13
|
||||
};
|
||||
|
||||
extern const money32 research_cost_table[4];
|
||||
|
||||
void finance_payment(money32 amount, rct_expenditure_type type);
|
||||
void finance_pay_wages();
|
||||
|
||||
+2
-2
@@ -429,7 +429,7 @@ void update_rain_animation()
|
||||
(rct_drawpixelinfo*)RCT2_ADDRESS_SCREEN_DPI,
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_PICKEDUP_PEEP_SPRITE, uint32),
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_PICKEDUP_PEEP_X, sint16),
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_PICKEDUP_PEEP_Y, sint16)
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_PICKEDUP_PEEP_Y, sint16), 0
|
||||
);
|
||||
}
|
||||
|
||||
@@ -2092,7 +2092,7 @@ static GAME_COMMAND_POINTER* new_game_command_table[58];
|
||||
*/
|
||||
int game_do_command(int eax, int ebx, int ecx, int edx, int esi, int edi, int ebp)
|
||||
{
|
||||
game_do_command_p(esi, &eax, &ebx, &ecx, &edx, &esi, &edi, &ebp);
|
||||
return game_do_command_p(esi, &eax, &ebx, &ecx, &edx, &esi, &edi, &ebp);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+3
-3
@@ -67,10 +67,10 @@ enum GAME_COMMAND {
|
||||
GAME_COMMAND_42,
|
||||
GAME_COMMAND_43,
|
||||
GAME_COMMAND_44,
|
||||
GAME_COMMAND_45,
|
||||
GAME_COMMAND_46,
|
||||
GAME_COMMAND_SET_CURRENT_LOAN, // 45
|
||||
GAME_COMMAND_SET_RESEARCH_FUNDING, // 46
|
||||
GAME_COMMAND_47,
|
||||
GAME_COMMAND_48,
|
||||
GAME_COMMAND_START_MARKETING_CAMPAIGN, // 48
|
||||
GAME_COMMAND_49,
|
||||
GAME_COMMAND_50,
|
||||
GAME_COMMAND_51,
|
||||
|
||||
@@ -189,7 +189,7 @@ void gfx_load_character_widths(){
|
||||
|
||||
for (int i = 0; i < 0xE0; ++i){
|
||||
memset(drawing_surface, 0, sizeof(drawing_surface));
|
||||
gfx_draw_sprite(&dpi, i + 0x10D5, -1, 0);
|
||||
gfx_draw_sprite(&dpi, i + 0x10D5, -1, 0, 0);
|
||||
|
||||
for (int x = 0; x < 8; ++x){
|
||||
uint8 val = 0;
|
||||
@@ -251,9 +251,8 @@ void gfx_draw_line_on_buffer(rct_drawpixelinfo *dpi, char colour, int y, int x,
|
||||
if (y < 0)return;
|
||||
if (y >= dpi->height)return;
|
||||
//Check to make sure we are drawing at least a pixel
|
||||
if (!no_pixels) return;
|
||||
if (!no_pixels) no_pixels++;
|
||||
|
||||
no_pixels++;
|
||||
x -= dpi->x;
|
||||
|
||||
//If x coord outside range leave
|
||||
@@ -701,7 +700,7 @@ void gfx_bmp_sprite_to_buffer(uint8* palette_pointer, uint8* unknown_pointer, ui
|
||||
for (; height > 0; height -= (1<<zoom_level)){
|
||||
uint8* next_source_pointer = source_pointer + (uint32)(source_image->width << zoom_level);
|
||||
uint8* next_unknown_pointer = unknown_pointer + (uint32)(source_image->width << zoom_level);
|
||||
uint8* next_dest_pointer = dest_pointer + dest_dpi->width + dest_dpi->pitch;
|
||||
uint8* next_dest_pointer = dest_pointer + (dest_dpi->width >> zoom_level) + dest_dpi->pitch;
|
||||
|
||||
for (int no_pixels = width; no_pixels > 0; no_pixels -= (1<<zoom_level), source_pointer+=(1<<zoom_level), unknown_pointer+=(1<<zoom_level), dest_pointer++){
|
||||
uint8 pixel = *source_pointer;
|
||||
@@ -721,7 +720,7 @@ void gfx_bmp_sprite_to_buffer(uint8* palette_pointer, uint8* unknown_pointer, ui
|
||||
//image colour adjusted?
|
||||
for (; height > 0; height -= (1<<zoom_level)){
|
||||
uint8* next_source_pointer = source_pointer + (uint32)(source_image->width<<zoom_level);
|
||||
uint8* next_dest_pointer = dest_pointer + dest_dpi->width + dest_dpi->pitch;
|
||||
uint8* next_dest_pointer = dest_pointer + (dest_dpi->width >> zoom_level) + dest_dpi->pitch;
|
||||
for (int no_pixels = width; no_pixels > 0; no_pixels -= (1<<zoom_level), source_pointer+= (1<<zoom_level), dest_pointer++){
|
||||
uint8 pixel = *source_pointer;
|
||||
pixel = palette_pointer[pixel];
|
||||
@@ -741,7 +740,7 @@ void gfx_bmp_sprite_to_buffer(uint8* palette_pointer, uint8* unknown_pointer, ui
|
||||
if (image_type & IMAGE_TYPE_MIX_BACKGROUND){//Not tested
|
||||
for (; height > 0; height -= (1<<zoom_level)){
|
||||
uint8* next_source_pointer = source_pointer + (uint32)(source_image->width << zoom_level);
|
||||
uint8* next_dest_pointer = dest_pointer + dest_dpi->width + dest_dpi->pitch;
|
||||
uint8* next_dest_pointer = dest_pointer + (dest_dpi->width >> zoom_level) + dest_dpi->pitch;
|
||||
|
||||
for (int no_pixels = width; no_pixels > 0; no_pixels -= (1<<zoom_level), source_pointer += (1<<zoom_level), dest_pointer++){
|
||||
uint8 pixel = *source_pointer;
|
||||
@@ -762,7 +761,7 @@ void gfx_bmp_sprite_to_buffer(uint8* palette_pointer, uint8* unknown_pointer, ui
|
||||
if (!(source_image->flags & G1_FLAG_BMP)){//Not tested
|
||||
for (; height > 0; height-=(1<<zoom_level)){
|
||||
uint8* next_source_pointer = source_pointer + (uint32)(source_image->width << zoom_level);
|
||||
uint8* next_dest_pointer = dest_pointer + dest_dpi->width + dest_dpi->pitch;
|
||||
uint8* next_dest_pointer = dest_pointer + (dest_dpi->width >> zoom_level) + dest_dpi->pitch;
|
||||
|
||||
for (int no_pixels = width; no_pixels > 0; no_pixels -= (1<<zoom_level), dest_pointer++, source_pointer += (1<<zoom_level)){
|
||||
*dest_pointer = *source_pointer;
|
||||
@@ -780,7 +779,7 @@ void gfx_bmp_sprite_to_buffer(uint8* palette_pointer, uint8* unknown_pointer, ui
|
||||
for (; height > 0; height -= (1<<zoom_level)){
|
||||
uint8* next_source_pointer = source_pointer + (uint32)(source_image->width << zoom_level);
|
||||
uint8* next_unknown_pointer = unknown_pointer + (uint32)(source_image->width << zoom_level);
|
||||
uint8* next_dest_pointer = dest_pointer + dest_dpi->width + dest_dpi->pitch;
|
||||
uint8* next_dest_pointer = dest_pointer + (dest_dpi->width >> zoom_level) + dest_dpi->pitch;
|
||||
|
||||
for (int no_pixels = width; no_pixels > 0; no_pixels -= (1<<zoom_level), dest_pointer++, source_pointer += (1<<zoom_level), unknown_pointer += (1<<zoom_level)){
|
||||
uint8 pixel = *source_pointer;
|
||||
@@ -798,7 +797,7 @@ void gfx_bmp_sprite_to_buffer(uint8* palette_pointer, uint8* unknown_pointer, ui
|
||||
//Basic bitmap with no draw pixels
|
||||
for (; height > 0; height -= (1<<zoom_level)){
|
||||
uint8* next_source_pointer = source_pointer + (uint32)(source_image->width << zoom_level);
|
||||
uint8* next_dest_pointer = dest_pointer + dest_dpi->width + dest_dpi->pitch;
|
||||
uint8* next_dest_pointer = dest_pointer + (dest_dpi->width >> zoom_level) + dest_dpi->pitch;
|
||||
|
||||
for (int no_pixels = width; no_pixels > 0; no_pixels -= (1<<zoom_level), dest_pointer++, source_pointer += (1<<zoom_level)){
|
||||
uint8 pixel = *source_pointer;
|
||||
@@ -819,7 +818,6 @@ void gfx_bmp_sprite_to_buffer(uint8* palette_pointer, uint8* unknown_pointer, ui
|
||||
*/
|
||||
void gfx_rle_sprite_to_buffer(uint8* source_bits_pointer, uint8* dest_bits_pointer, uint8* palette_pointer, rct_drawpixelinfo *dpi, int image_type, int source_y_start, int height, int source_x_start, int width){
|
||||
int zoom_level = dpi->zoom_level;
|
||||
|
||||
uint8* next_source_pointer;
|
||||
uint8* next_dest_pointer = dest_bits_pointer;
|
||||
|
||||
@@ -884,9 +882,9 @@ void gfx_rle_sprite_to_buffer(uint8* source_bits_pointer, uint8* dest_bits_point
|
||||
for (; no_pixels > 0; no_pixels -= (1<<zoom_level), source_pointer += (1<<zoom_level), dest_pointer++){
|
||||
uint8 al = *source_pointer;
|
||||
uint8 ah = *dest_pointer;
|
||||
if (image_type & IMAGE_TYPE_MIX_BACKGROUND)//Mix with background and image Not Tested
|
||||
al = palette_pointer[(al | ((int)ah) << 8) - 0x100];
|
||||
else //Adjust colours?
|
||||
if (image_type & IMAGE_TYPE_MIX_BACKGROUND)
|
||||
al = palette_pointer[(((uint16)al << 8) | ah) - 0x100];
|
||||
else
|
||||
al = palette_pointer[al];
|
||||
*dest_pointer = al;
|
||||
}
|
||||
@@ -894,6 +892,7 @@ void gfx_rle_sprite_to_buffer(uint8* source_bits_pointer, uint8* dest_bits_point
|
||||
else if (image_type & IMAGE_TYPE_MIX_BACKGROUND){//In the .exe these are all unraveled loops
|
||||
//Doesnt use source pointer ??? mix with background only?
|
||||
//Not Tested
|
||||
|
||||
for (; no_pixels > 0; no_pixels -= (1<<zoom_level), dest_pointer++){
|
||||
uint8 pixel = *dest_pointer;
|
||||
pixel = palette_pointer[pixel];
|
||||
@@ -909,102 +908,78 @@ void gfx_rle_sprite_to_buffer(uint8* source_bits_pointer, uint8* dest_bits_point
|
||||
}
|
||||
|
||||
//Add a line to the drawing surface pointer
|
||||
next_dest_pointer += (int)dpi->width + (int)dpi->pitch;
|
||||
next_dest_pointer += (int)(dpi->width >> zoom_level) + (int)dpi->pitch;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void gfx_draw_sprite_palette_set(rct_drawpixelinfo *dpi, int image_id, int x, int y, uint8* palette_pointer, uint8* unknown_pointer);
|
||||
/**
|
||||
*
|
||||
* rct2: 0x0067A28E
|
||||
* image_id (ebx)
|
||||
* image_id (ebx)
|
||||
* image_id as below
|
||||
* 0b_111X_XXXX_XXXX_XXXX_XXXX_XXXX_XXXX_XXXX image_type
|
||||
* 0b_XXX1_11XX_XXXX_XXXX_XXXX_XXXX_XXXX_XXXX image_sub_type (unknown pointer)
|
||||
* 0b_XXX1_1111_XXXX_XXXX_XXXX_XXXX_XXXX_XXXX secondary_colour
|
||||
* 0b_XXXX_XXXX_1111_1XXX_XXXX_XXXX_XXXX_XXXX primary_colour
|
||||
* 0b_XXXX_X111_1111_1XXX_XXXX_XXXX_XXXX_XXXX palette_ref
|
||||
* 0b_XXXX_XXXX_XXXX_X111_1111_1111_1111_1111 image_id (offset to g1)
|
||||
* x (cx)
|
||||
* y (dx)
|
||||
* dpi (esi)
|
||||
* tertiary_colour (ebp)
|
||||
*/
|
||||
void gfx_draw_sprite(rct_drawpixelinfo *dpi, int image_id, int x, int y)
|
||||
void gfx_draw_sprite(rct_drawpixelinfo *dpi, int image_id, int x, int y, uint32 tertiary_colour)
|
||||
{
|
||||
//RCT2_CALLPROC_X(0x0067A28E, 0, image_id, x, y, 0, (int)dpi, tertiary_colour);
|
||||
//return;
|
||||
|
||||
int eax = 0, ebx = image_id, ecx = x, edx = y, esi = 0, edi = (int)dpi, ebp = 0;
|
||||
int image_type = (image_id & 0xE0000000) >> 28;
|
||||
int image_sub_type = (image_id & 0x1C000000) >> 26;
|
||||
|
||||
uint8* palette_pointer = NULL;
|
||||
uint8 palette[0x100];
|
||||
|
||||
RCT2_GLOBAL(0x00EDF81C, uint32) = image_id & 0xE0000000;
|
||||
eax = (image_id >> 26) & 0x7;
|
||||
|
||||
uint8* unknown_pointer = (uint8*)(RCT2_ADDRESS(0x9E3CE4, uint32*)[image_sub_type]);
|
||||
RCT2_GLOBAL(0x009E3CDC, uint32) = RCT2_GLOBAL(0x009E3CE4 + eax * 4, uint32);
|
||||
RCT2_GLOBAL(0x009E3CDC, uint32) = (uint32)unknown_pointer;
|
||||
|
||||
if (image_type && !(image_type & IMAGE_TYPE_UNKNOWN)) {
|
||||
|
||||
uint8 palette_ref = (image_id >> 19) & 0xFF;
|
||||
if (!(image_type & IMAGE_TYPE_MIX_BACKGROUND)){
|
||||
eax = image_id;
|
||||
eax >>= 19;
|
||||
eax &= 0xFF;
|
||||
unknown_pointer = NULL;
|
||||
RCT2_GLOBAL(0x009E3CDC, uint32) = 0;
|
||||
}
|
||||
else{
|
||||
eax = image_id;
|
||||
eax >>= 19;
|
||||
eax &= 0x7F;
|
||||
palette_ref &= 0x7F;
|
||||
}
|
||||
eax = palette_to_g1_offset[eax];// RCT2_GLOBAL(eax * 4 + 0x97FCBC, uint32);
|
||||
|
||||
palette_pointer = ((rct_g1_element*)RCT2_ADDRESS_G1_ELEMENTS)[eax].offset;
|
||||
uint16 palette_offset = palette_to_g1_offset[palette_ref];
|
||||
palette_pointer = RCT2_ADDRESS(RCT2_ADDRESS_G1_ELEMENTS, rct_g1_element)[palette_offset].offset;
|
||||
RCT2_GLOBAL(0x9ABDA4, uint32) = (uint32)palette_pointer;
|
||||
}
|
||||
else if (image_type && !(image_type & IMAGE_TYPE_USE_PALETTE)){
|
||||
//Has not been tested
|
||||
RCT2_GLOBAL(0x9E3CDC, uint32) = 0;
|
||||
unknown_pointer = NULL;
|
||||
|
||||
eax = image_id;
|
||||
eax >>= 19;
|
||||
//push edx/y
|
||||
eax &= 0x1F;
|
||||
ebp = palette_to_g1_offset[ebp]; //RCT2_GLOBAL(ebp * 4 + 0x97FCBC, uint32); //ebp has not been set to anything before this! ??
|
||||
//Possibly another variable input?!
|
||||
eax = palette_to_g1_offset[eax]; //RCT2_GLOBAL(eax * 4 + 0x97FCBC, uint32);
|
||||
ebp <<= 0x4;
|
||||
eax <<= 0x4;
|
||||
ebp = RCT2_GLOBAL(ebp + RCT2_ADDRESS_G1_ELEMENTS, uint32);
|
||||
eax = RCT2_GLOBAL(eax + RCT2_ADDRESS_G1_ELEMENTS, uint32);
|
||||
edx = *((uint32*)(eax + 0xF3));
|
||||
esi = *((uint32*)(eax + 0xF7));
|
||||
RCT2_GLOBAL(0x9ABFFF, uint32) = edx;
|
||||
RCT2_GLOBAL(0x9AC003, uint32) = esi;
|
||||
edx = *((uint32*)(ebp + 0xF3));
|
||||
esi = *((uint32*)(ebp + 0xF7));
|
||||
esi = *((uint32*)(eax + 0xF7));
|
||||
uint32 primary_offset = palette_to_g1_offset[(image_id >> 19) & 0x1F];
|
||||
uint32 secondary_offset = palette_to_g1_offset[(image_id >> 24) & 0x1F];
|
||||
uint32 tertiary_offset = palette_to_g1_offset[tertiary_colour];
|
||||
|
||||
edx = *((uint32*)(eax + 0xFB));
|
||||
esi = *((uint32*)(ebp + 0xFB));
|
||||
rct_g1_element* primary_colour = &RCT2_ADDRESS(RCT2_ADDRESS_G1_ELEMENTS, rct_g1_element)[primary_offset];
|
||||
rct_g1_element* secondary_colour = &RCT2_ADDRESS(RCT2_ADDRESS_G1_ELEMENTS, rct_g1_element)[secondary_offset];
|
||||
rct_g1_element* tertiary_colour = &RCT2_ADDRESS(RCT2_ADDRESS_G1_ELEMENTS, rct_g1_element)[tertiary_offset];
|
||||
|
||||
eax = image_id;
|
||||
RCT2_GLOBAL(0x9AC007, uint32) = edx;
|
||||
eax >>= 24;
|
||||
RCT2_GLOBAL(0x9ABF42, uint32) = esi;
|
||||
eax &= 0x1F;
|
||||
memcpy((uint8*)0x9ABFFF, &primary_colour->offset[0xF3], 12);
|
||||
memcpy((uint8*)0x9ABFD6, &secondary_colour->offset[0xF3], 12);
|
||||
memcpy((uint8*)0x9ABF3A, &tertiary_colour->offset[0xF3], 12);
|
||||
|
||||
//image_id
|
||||
RCT2_GLOBAL(0xEDF81C, uint32) |= 0x20000000;
|
||||
image_id |= IMAGE_TYPE_USE_PALETTE;
|
||||
image_id |= IMAGE_TYPE_USE_PALETTE << 28;
|
||||
|
||||
eax = palette_to_g1_offset[eax]; //RCT2_GLOBAL(eax * 4 + 0x97FCBC, uint32);
|
||||
eax <<= 4;
|
||||
eax = RCT2_GLOBAL(eax + RCT2_ADDRESS_G1_ELEMENTS, uint32);
|
||||
edx = *((uint32*)(eax + 0xF3));
|
||||
esi = *((uint32*)(eax + 0xF7));
|
||||
RCT2_GLOBAL(0x9ABFD6, uint32) = edx;
|
||||
RCT2_GLOBAL(0x9ABFDA, uint32) = esi;
|
||||
edx = *((uint32*)(eax + 0xFB));
|
||||
RCT2_GLOBAL(0x9ABDA4, uint32) = 0x9ABF0C;
|
||||
palette_pointer = (uint8*)0x9ABF0C;
|
||||
RCT2_GLOBAL(0x9ABFDE, uint32) = edx;
|
||||
edx = y;
|
||||
|
||||
}
|
||||
else if (image_type){
|
||||
RCT2_GLOBAL(0x9E3CDC, uint32) = 0;
|
||||
@@ -1046,25 +1021,8 @@ void gfx_draw_sprite_palette_set(rct_drawpixelinfo *dpi, int image_id, int x, in
|
||||
int image_type = (image_id & 0xE0000000) >> 28;
|
||||
|
||||
rct_g1_element* g1_source = &(RCT2_ADDRESS(RCT2_ADDRESS_G1_ELEMENTS, rct_g1_element)[image_element]);
|
||||
|
||||
if ( dpi->zoom_level && (g1_source->flags & (1<<4)) ){
|
||||
rct_drawpixelinfo zoomed_dpi = {
|
||||
.bits = dpi->bits,
|
||||
.x = dpi->x >> 1,
|
||||
.y = dpi->y >> 1,
|
||||
.height = dpi->height>>1,
|
||||
.width = dpi->width>>1,
|
||||
.pitch = (dpi->width+dpi->pitch)-(dpi->width>>1),//In the actual code this is dpi->pitch but that doesn't seem correct.
|
||||
.zoom_level = dpi->zoom_level - 1
|
||||
};
|
||||
gfx_draw_sprite_palette_set(&zoomed_dpi, (image_type << 28) | (image_element - g1_source->zoomed_offset), x >> 1, y >> 1, palette_pointer, unknown_pointer);
|
||||
return;
|
||||
}
|
||||
|
||||
if ( dpi->zoom_level && (g1_source->flags & (1<<5)) ){
|
||||
return;
|
||||
}
|
||||
//Zooming code has been integrated into main code.
|
||||
//Zooming code has been integrated into main code but is not working.
|
||||
//if (dpi->zoom_level >= 1){ //These have not been tested
|
||||
// //something to do with zooming
|
||||
// if (dpi->zoom_level == 1){
|
||||
@@ -1078,13 +1036,30 @@ void gfx_draw_sprite_palette_set(rct_drawpixelinfo *dpi, int image_id, int x, in
|
||||
// RCT2_CALLPROC_X(0x0067FAAE, 0, (int)g1_source, x, y, 0, (int)dpi, 0);
|
||||
// return;
|
||||
//}
|
||||
if ( dpi->zoom_level && (g1_source->flags & (1<<4)) ){
|
||||
rct_drawpixelinfo zoomed_dpi = {
|
||||
.bits = dpi->bits,
|
||||
.x = dpi->x >> 1,
|
||||
.y = dpi->y >> 1,
|
||||
.height = dpi->height>>1,
|
||||
.width = dpi->width>>1,
|
||||
.pitch = dpi->pitch,
|
||||
.zoom_level = dpi->zoom_level - 1
|
||||
};
|
||||
gfx_draw_sprite_palette_set(&zoomed_dpi, (image_type << 28) | (image_element - g1_source->zoomed_offset), x >> 1, y >> 1, palette_pointer, unknown_pointer);
|
||||
return;
|
||||
}
|
||||
|
||||
if ( dpi->zoom_level && (g1_source->flags & (1<<5)) ){
|
||||
return;
|
||||
}
|
||||
//Its used super often so we will define it to a seperate variable.
|
||||
int zoom_level = dpi->zoom_level;
|
||||
uint16 zoom_mask = 0xFFFF << zoom_level;
|
||||
//This will be the height of the drawn image
|
||||
int height = g1_source->height >> zoom_level;
|
||||
//This is the start y coordinate on the destination
|
||||
int dest_start_y = y - dpi->y + g1_source->y_offset;
|
||||
sint16 dest_start_y = ((sint16)y + g1_source->y_offset - dpi->y) >> zoom_level;
|
||||
//This is the start y coordinate on the source
|
||||
int source_start_y = 0;
|
||||
|
||||
@@ -1106,20 +1081,20 @@ void gfx_draw_sprite_palette_set(rct_drawpixelinfo *dpi, int image_id, int x, in
|
||||
|
||||
int dest_end_y = dest_start_y + height;
|
||||
|
||||
if (dest_end_y > dpi->height){
|
||||
if (dest_end_y > (dpi->height >> zoom_level)){
|
||||
//If the destination y is outside of the drawing
|
||||
//image reduce the height of the image
|
||||
height -= dest_end_y - dpi->height;
|
||||
//If the image no longer has anything to draw
|
||||
if (height <= 0)return;
|
||||
height -= dest_end_y - (dpi->height >> zoom_level);
|
||||
}
|
||||
|
||||
//If the image no longer has anything to draw
|
||||
if (height <= 0)return;
|
||||
|
||||
//This will be the width of the drawn image
|
||||
int width = g1_source->width >> zoom_level;
|
||||
//This is the source start x coordinate
|
||||
int source_start_x = 0;
|
||||
//This is the destination start x coordinate
|
||||
int dest_start_x = x - dpi->x + g1_source->x_offset;
|
||||
sint16 dest_start_x = ((sint16)x + g1_source->x_offset - dpi->x) >> zoom_level;
|
||||
|
||||
if (dest_start_x < 0){
|
||||
//If the destination is negative reduce the width
|
||||
@@ -1137,10 +1112,10 @@ void gfx_draw_sprite_palette_set(rct_drawpixelinfo *dpi, int image_id, int x, in
|
||||
|
||||
int dest_end_x = dest_start_x + width;
|
||||
|
||||
if (dest_end_x > dpi->width){
|
||||
if (dest_end_x > (dpi->width>>zoom_level)){
|
||||
//If the destination x is outside of the drawing area
|
||||
//reduce the image width.
|
||||
width -= dest_end_x - dpi->width;
|
||||
width -= dest_end_x - (dpi->width >> zoom_level);
|
||||
//If there is no image to draw.
|
||||
if (width <= 0)return;
|
||||
}
|
||||
@@ -1148,7 +1123,7 @@ void gfx_draw_sprite_palette_set(rct_drawpixelinfo *dpi, int image_id, int x, in
|
||||
|
||||
uint8* dest_pointer = (uint8*)dpi->bits;
|
||||
//Move the pointer to the start point of the destination
|
||||
dest_pointer += (dpi->width + dpi->pitch)*dest_start_y + dest_start_x;
|
||||
dest_pointer += ((dpi->width >> zoom_level) + dpi->pitch)*dest_start_y + dest_start_x;
|
||||
|
||||
height <<= zoom_level;
|
||||
width <<= zoom_level;
|
||||
@@ -2217,7 +2192,7 @@ void gfx_draw_string(rct_drawpixelinfo *dpi, char *buffer, int colour, int x, in
|
||||
eax = ebx & 0x7FFFF;
|
||||
g1_element = &(RCT2_ADDRESS(RCT2_ADDRESS_G1_ELEMENTS, rct_g1_element)[eax]);
|
||||
|
||||
gfx_draw_sprite(dpi, ebx, max_x, max_y);
|
||||
gfx_draw_sprite(dpi, ebx, max_x, max_y, 0);
|
||||
|
||||
max_x = max_x + g1_element->width;
|
||||
break;
|
||||
@@ -2379,4 +2354,33 @@ void gfx_draw_rain(int left, int top, int width, int height, uint32 x_start, uin
|
||||
pattern_y_pos++;
|
||||
pattern_y_pos %= pattern_y_space;
|
||||
}
|
||||
}
|
||||
|
||||
void draw_string_left_underline(rct_drawpixelinfo *dpi, int format, void *args, int colour, int x, int y)
|
||||
{
|
||||
char buffer[128];
|
||||
int width;
|
||||
|
||||
format_string(buffer, format, args);
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_FONT_SPRITE_BASE, uint16) = 224;
|
||||
width = gfx_get_string_width(buffer);
|
||||
gfx_draw_string(dpi, buffer, colour, x, y);
|
||||
gfx_fill_rect(dpi, x, y + 11, x + width, y + 11, text_palette[1]);
|
||||
if (text_palette[2] != 0)
|
||||
gfx_fill_rect(dpi, x + 1, y + 12, x + width + 1, y + 12, text_palette[2]);
|
||||
}
|
||||
|
||||
void draw_string_right_underline(rct_drawpixelinfo *dpi, int format, void *args, int colour, int x, int y)
|
||||
{
|
||||
char buffer[128];
|
||||
int width;
|
||||
|
||||
format_string(buffer, format, args);
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_FONT_SPRITE_BASE, uint16) = 224;
|
||||
width = gfx_get_string_width(buffer);
|
||||
x -= width;
|
||||
gfx_draw_string(dpi, buffer, colour, x, y);
|
||||
gfx_fill_rect(dpi, x, y + 11, x + width, y + 11, text_palette[1]);
|
||||
if (text_palette[2] != 0)
|
||||
gfx_fill_rect(dpi, x + 1, y + 12, x + width + 1, y + 12, text_palette[2]);
|
||||
}
|
||||
@@ -43,7 +43,7 @@ typedef struct {
|
||||
sint16 x_offset; // 0x08
|
||||
sint16 y_offset; // 0x0A
|
||||
uint16 flags; // 0x0C
|
||||
sint16 zoomed_offset; // 0x0E
|
||||
uint16 zoomed_offset; // 0x0E
|
||||
} rct_g1_element;
|
||||
|
||||
enum{
|
||||
@@ -70,9 +70,9 @@ void gfx_draw_pixel(rct_drawpixelinfo *dpi, int x, int y, int colour);
|
||||
void gfx_draw_line(rct_drawpixelinfo *dpi, int x1, int y1, int x2, int y2, int colour);
|
||||
void gfx_fill_rect(rct_drawpixelinfo *dpi, int left, int top, int right, int bottom, int colour);
|
||||
void gfx_fill_rect_inset(rct_drawpixelinfo* dpi, short left, short top, short right, short bottom, int colour, short _si);
|
||||
void gfx_draw_sprite(rct_drawpixelinfo *dpi, int image_id, int x, int y);
|
||||
void gfx_draw_sprite(rct_drawpixelinfo *dpi, int image_id, int x, int y, uint32 tertiary_colour);
|
||||
void gfx_draw_sprite_palette_set(rct_drawpixelinfo *dpi, int image_id, int x, int y, uint8* palette_pointer, uint8* unknown_pointer);
|
||||
void gfx_draw_string(rct_drawpixelinfo *dpi, char *format, int colour, int x, int y);
|
||||
void gfx_draw_string(rct_drawpixelinfo *dpi, char *buffer, int colour, int x, int y);
|
||||
void gfx_transpose_palette(int pal, unsigned char product);
|
||||
|
||||
void gfx_draw_string_left(rct_drawpixelinfo *dpi, int format, void *args, int colour, int x, int y);
|
||||
@@ -96,4 +96,7 @@ void gfx_draw_rain(int left, int top, int width, int height, uint32 x_start, uin
|
||||
|
||||
rct_drawpixelinfo* clip_drawpixelinfo(rct_drawpixelinfo* dpi, int left, int width, int top, int height);
|
||||
|
||||
void draw_string_left_underline(rct_drawpixelinfo *dpi, int format, void *args, int colour, int x, int y);
|
||||
void draw_string_right_underline(rct_drawpixelinfo *dpi, int format, void *args, int colour, int x, int y);
|
||||
|
||||
#endif
|
||||
+176
@@ -0,0 +1,176 @@
|
||||
/*****************************************************************************
|
||||
* Copyright (c) 2014 Ted John, Peter Hill, Duncan Frost
|
||||
* OpenRCT2, an open source clone of Roller Coaster Tycoon 2.
|
||||
*
|
||||
* This file is part of OpenRCT2.
|
||||
*
|
||||
* OpenRCT2 is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*****************************************************************************/
|
||||
|
||||
#include "addresses.h"
|
||||
#include "date.h"
|
||||
#include "graph.h"
|
||||
#include "string_ids.h"
|
||||
|
||||
static void graph_draw_months_uint8(rct_drawpixelinfo *dpi, uint8 *history, int count, int baseX, int baseY)
|
||||
{
|
||||
int i, x, y, yearOver32, currentMonth, currentDay;
|
||||
|
||||
currentMonth = date_get_month(RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_MONTH_YEAR, uint16));
|
||||
currentDay = RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_MONTH_TICKS, uint16);
|
||||
yearOver32 = (currentMonth * 4) + (currentDay >> 14) - 31;
|
||||
x = baseX;
|
||||
y = baseY;
|
||||
for (i = count - 1; i >= 0; i--) {
|
||||
if (history[i] != 0 && history[i] != 255 && yearOver32 % 4 == 0) {
|
||||
// Draw month text
|
||||
RCT2_GLOBAL(0x013CE952, uint32) = ((yearOver32 / 4) + 8) % 8 + STR_MONTH_SHORT_MAR;
|
||||
gfx_draw_string_centred(dpi, 2222, x, y - 10, 0, (void*)0x013CE952);
|
||||
|
||||
// Draw month mark
|
||||
gfx_fill_rect(dpi, x, y, x, y + 3, 10);
|
||||
}
|
||||
|
||||
yearOver32 = (yearOver32 + 1) % 32;
|
||||
x += 6;
|
||||
}
|
||||
}
|
||||
|
||||
static void graph_draw_line_a_uint8(rct_drawpixelinfo *dpi, uint8 *history, int count, int baseX, int baseY)
|
||||
{
|
||||
int i, x, y, lastX, lastY;
|
||||
lastX = -1;
|
||||
x = baseX;
|
||||
for (i = count - 1; i >= 0; i--) {
|
||||
if (history[i] != 0 && history[i] != 255) {
|
||||
y = baseY + (history[i] * 100) / 256;
|
||||
|
||||
if (lastX != -1) {
|
||||
gfx_draw_line(dpi, lastX + 1, lastY + 1, x + 1, y + 1, 10);
|
||||
gfx_draw_line(dpi, lastX, lastY + 1, x, y + 1, 10);
|
||||
}
|
||||
if (i == 0)
|
||||
gfx_fill_rect(dpi, x, y, x + 2, y + 2, 10);
|
||||
|
||||
lastX = x;
|
||||
lastY = y;
|
||||
}
|
||||
x += 6;
|
||||
}
|
||||
}
|
||||
|
||||
static void graph_draw_line_b_uint8(rct_drawpixelinfo *dpi, uint8 *history, int count, int baseX, int baseY)
|
||||
{
|
||||
int i, x, y, lastX, lastY;
|
||||
|
||||
lastX = -1;
|
||||
x = baseX;
|
||||
for (i = count - 1; i >= 0; i--) {
|
||||
if (history[i] != 0 && history[i] != 255) {
|
||||
y = baseY + (history[i] * 100) / 256;
|
||||
|
||||
if (lastX != -1)
|
||||
gfx_draw_line(dpi, lastX, lastY, x, y, 21);
|
||||
if (i == 0)
|
||||
gfx_fill_rect(dpi, x - 1, y - 1, x + 1, y + 1, 21);
|
||||
|
||||
lastX = x;
|
||||
lastY = y;
|
||||
}
|
||||
x += 6;
|
||||
}
|
||||
}
|
||||
|
||||
void graph_draw_uint8(rct_drawpixelinfo *dpi, uint8 *history, int count, int baseX, int baseY)
|
||||
{
|
||||
graph_draw_months_uint8(dpi, history, count, baseX, baseY);
|
||||
graph_draw_line_a_uint8(dpi, history, count, baseX, baseY);
|
||||
graph_draw_line_b_uint8(dpi, history, count, baseX, baseY);
|
||||
}
|
||||
|
||||
static void graph_draw_months_money32(rct_drawpixelinfo *dpi, money32 *history, int count, int baseX, int baseY)
|
||||
{
|
||||
int i, x, y, yearOver32, currentMonth, currentDay;
|
||||
|
||||
currentMonth = date_get_month(RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_MONTH_YEAR, uint16));
|
||||
currentDay = RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_MONTH_TICKS, uint16);
|
||||
yearOver32 = (currentMonth * 4) + (currentDay >> 14) - 31;
|
||||
x = baseX;
|
||||
y = baseY;
|
||||
for (i = count - 1; i >= 0; i--) {
|
||||
if (history[i] != 0x80000000 && yearOver32 % 4 == 0) {
|
||||
// Draw month text
|
||||
sint32 monthFormat = ((yearOver32 / 4) + 8) % 8 + STR_MONTH_SHORT_MAR;
|
||||
gfx_draw_string_centred(dpi, 2222, x, y - 10, 0, &monthFormat);
|
||||
|
||||
// Draw month mark
|
||||
gfx_fill_rect(dpi, x, y, x, y + 3, 10);
|
||||
}
|
||||
|
||||
yearOver32 = (yearOver32 + 1) % 32;
|
||||
x += 6;
|
||||
}
|
||||
}
|
||||
|
||||
static void graph_draw_line_a_money32(rct_drawpixelinfo *dpi, money32 *history, int count, int baseX, int baseY, int modifier, int offset)
|
||||
{
|
||||
int i, x, y, lastX, lastY;
|
||||
lastX = -1;
|
||||
x = baseX;
|
||||
for (i = count - 1; i >= 0; i--) {
|
||||
if (history[i] != 0x80000000) {
|
||||
y = baseY + 170 - 6 - ((((history[i] >> modifier) + offset) * 170) / 256);
|
||||
|
||||
if (lastX != -1) {
|
||||
gfx_draw_line(dpi, lastX + 1, lastY + 1, x + 1, y + 1, 10);
|
||||
gfx_draw_line(dpi, lastX, lastY + 1, x, y + 1, 10);
|
||||
}
|
||||
if (i == 0)
|
||||
gfx_fill_rect(dpi, x, y, x + 2, y + 2, 10);
|
||||
|
||||
lastX = x;
|
||||
lastY = y;
|
||||
}
|
||||
x += 6;
|
||||
}
|
||||
}
|
||||
|
||||
static void graph_draw_line_b_money32(rct_drawpixelinfo *dpi, money32 *history, int count, int baseX, int baseY, int modifier, int offset)
|
||||
{
|
||||
int i, x, y, lastX, lastY;
|
||||
|
||||
lastX = -1;
|
||||
x = baseX;
|
||||
for (i = count - 1; i >= 0; i--) {
|
||||
if (history[i] != 0x80000000) {
|
||||
y = baseY + 170 - 6 - ((((history[i] >> modifier) + offset) * 170) / 256);
|
||||
|
||||
if (lastX != -1)
|
||||
gfx_draw_line(dpi, lastX, lastY, x, y, 21);
|
||||
if (i == 0)
|
||||
gfx_fill_rect(dpi, x - 1, y - 1, x + 1, y + 1, 21);
|
||||
|
||||
lastX = x;
|
||||
lastY = y;
|
||||
}
|
||||
x += 6;
|
||||
}
|
||||
}
|
||||
|
||||
void graph_draw_money32(rct_drawpixelinfo *dpi, money32 *history, int count, int baseX, int baseY, int modifier, int offset)
|
||||
{
|
||||
graph_draw_months_money32(dpi, history, count, baseX, baseY);
|
||||
graph_draw_line_a_money32(dpi, history, count, baseX, baseY, modifier, offset);
|
||||
graph_draw_line_b_money32(dpi, history, count, baseX, baseY, modifier, offset);
|
||||
}
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
/*****************************************************************************
|
||||
* Copyright (c) 2014 Ted John, Peter Hill, Duncan Frost
|
||||
* OpenRCT2, an open source clone of Roller Coaster Tycoon 2.
|
||||
*
|
||||
* This file is part of OpenRCT2.
|
||||
*
|
||||
* OpenRCT2 is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef _GRAPH_H_
|
||||
#define _GRAPH_H_
|
||||
|
||||
#include "gfx.h"
|
||||
#include "rct2.h"
|
||||
|
||||
void graph_draw_uint8(rct_drawpixelinfo *dpi, uint8 *history, int count, int baseX, int baseY);
|
||||
void graph_draw_money32(rct_drawpixelinfo *dpi, money32 *history, int count, int baseX, int baseY, int modifier, int offset);
|
||||
|
||||
#endif
|
||||
+12
-12
@@ -104,10 +104,10 @@ void intro_update()
|
||||
129);
|
||||
|
||||
// Draw the logo
|
||||
gfx_draw_sprite(screenDPI, SPR_INTRO_INFOGRAMES_00, (screenWidth / 2) - 320 + 69, _tick_counter + 69);
|
||||
gfx_draw_sprite(screenDPI, SPR_INTRO_INFOGRAMES_10, (screenWidth / 2) - 320 + 319, _tick_counter + 69);
|
||||
gfx_draw_sprite(screenDPI, SPR_INTRO_INFOGRAMES_01, (screenWidth / 2) - 320 + 69, _tick_counter + 319);
|
||||
gfx_draw_sprite(screenDPI, SPR_INTRO_INFOGRAMES_11, (screenWidth / 2) - 320 + 319, _tick_counter + 319);
|
||||
gfx_draw_sprite(screenDPI, SPR_INTRO_INFOGRAMES_00, (screenWidth / 2) - 320 + 69, _tick_counter + 69, 0);
|
||||
gfx_draw_sprite(screenDPI, SPR_INTRO_INFOGRAMES_10, (screenWidth / 2) - 320 + 319, _tick_counter + 69, 0);
|
||||
gfx_draw_sprite(screenDPI, SPR_INTRO_INFOGRAMES_01, (screenWidth / 2) - 320 + 69, _tick_counter + 319, 0);
|
||||
gfx_draw_sprite(screenDPI, SPR_INTRO_INFOGRAMES_11, (screenWidth / 2) - 320 + 319, _tick_counter + 319, 0);
|
||||
|
||||
// Check if logo is off the screen .ish
|
||||
if (_tick_counter > 520) {
|
||||
@@ -145,8 +145,8 @@ void intro_update()
|
||||
gfx_clear(screenDPI, 10);
|
||||
|
||||
// Draw Chris Sawyer logo
|
||||
gfx_draw_sprite(screenDPI, SPR_INTRO_CHRIS_SAWYER_00, (screenWidth / 2) - 320 + 70, _tick_counter);
|
||||
gfx_draw_sprite(screenDPI, SPR_INTRO_CHRIS_SAWYER_10, (screenWidth / 2) - 320 + 320, _tick_counter);
|
||||
gfx_draw_sprite(screenDPI, SPR_INTRO_CHRIS_SAWYER_00, (screenWidth / 2) - 320 + 70, _tick_counter, 0);
|
||||
gfx_draw_sprite(screenDPI, SPR_INTRO_CHRIS_SAWYER_10, (screenWidth / 2) - 320 + 320, _tick_counter, 0);
|
||||
|
||||
// Check if logo is at 259 pixels
|
||||
if (_tick_counter == 259) {
|
||||
@@ -171,12 +171,12 @@ void intro_update()
|
||||
gfx_clear(screenDPI, 245);
|
||||
|
||||
// Draw RollerCoaster Tycoon 2 logo
|
||||
gfx_draw_sprite(screenDPI, SPR_INTRO_LOGO_00, (screenWidth / 2) - 320 + 0, 0);
|
||||
gfx_draw_sprite(screenDPI, SPR_INTRO_LOGO_10, (screenWidth / 2) - 320 + 220, 0);
|
||||
gfx_draw_sprite(screenDPI, SPR_INTRO_LOGO_20, (screenWidth / 2) - 320 + 440, 0);
|
||||
gfx_draw_sprite(screenDPI, SPR_INTRO_LOGO_01, (screenWidth / 2) - 320 + 0, 240);
|
||||
gfx_draw_sprite(screenDPI, SPR_INTRO_LOGO_11, (screenWidth / 2) - 320 + 220, 240);
|
||||
gfx_draw_sprite(screenDPI, SPR_INTRO_LOGO_21, (screenWidth / 2) - 320 + 440, 240);
|
||||
gfx_draw_sprite(screenDPI, SPR_INTRO_LOGO_00, (screenWidth / 2) - 320 + 0, 0, 0);
|
||||
gfx_draw_sprite(screenDPI, SPR_INTRO_LOGO_10, (screenWidth / 2) - 320 + 220, 0, 0);
|
||||
gfx_draw_sprite(screenDPI, SPR_INTRO_LOGO_20, (screenWidth / 2) - 320 + 440, 0, 0);
|
||||
gfx_draw_sprite(screenDPI, SPR_INTRO_LOGO_01, (screenWidth / 2) - 320 + 0, 240, 0);
|
||||
gfx_draw_sprite(screenDPI, SPR_INTRO_LOGO_11, (screenWidth / 2) - 320 + 220, 240, 0);
|
||||
gfx_draw_sprite(screenDPI, SPR_INTRO_LOGO_21, (screenWidth / 2) - 320 + 440, 240, 0);
|
||||
|
||||
// Set palette thing
|
||||
gfx_transpose_palette(23224, 0);
|
||||
|
||||
@@ -26,6 +26,15 @@
|
||||
#include "string_ids.h"
|
||||
#include "window.h"
|
||||
|
||||
const money16 AdvertisingCampaignPricePerWeek[] = {
|
||||
MONEY(50,00), // PARK_ENTRY_FREE,
|
||||
MONEY(50,00), // RIDE_FREE,
|
||||
MONEY(50,00), // PARK_ENTRY_HALF_PRICE,
|
||||
MONEY(50,00), // FOOD_OR_DRINK_FREE,
|
||||
MONEY(350,00), // PARK,
|
||||
MONEY(200,00) // RIDE,
|
||||
};
|
||||
|
||||
const int advertisingCampaignGuestGenerationProbabilities[] = { 400, 300, 200, 200, 250, 200 };
|
||||
|
||||
int marketing_get_campaign_guest_generation_probability(int campaign)
|
||||
|
||||
@@ -33,6 +33,8 @@ enum {
|
||||
ADVERTISING_CAMPAIGN_COUNT
|
||||
};
|
||||
|
||||
extern const money16 AdvertisingCampaignPricePerWeek[6];
|
||||
|
||||
int marketing_get_campaign_guest_generation_probability(int campaign);
|
||||
void marketing_update();
|
||||
void marketing_set_guest_campaign(rct_peep *peep, int campaign);
|
||||
|
||||
+1
-1
@@ -475,7 +475,7 @@ static rct_peep *park_generate_new_guest()
|
||||
spawn.direction ^= 2;
|
||||
peep = peep_generate(spawn.x, spawn.y, spawn.z * 16);
|
||||
if (peep != NULL) {
|
||||
peep->var_1E = spawn.direction << 3;
|
||||
peep->sprite_direction = spawn.direction << 3;
|
||||
|
||||
// Get the centre point of the tile the peep is on
|
||||
peep->var_32 = (peep->x & 0xFFE0) + 16;
|
||||
|
||||
+1
-1
@@ -330,7 +330,7 @@ typedef struct {
|
||||
sint16 var_18;
|
||||
sint16 var_1A;
|
||||
sint16 var_1C;
|
||||
uint8 var_1E;
|
||||
uint8 sprite_direction;
|
||||
uint8 pad_1F[3];
|
||||
uint16 name_string_idx; // 0x22
|
||||
uint16 next_x; // 0x24
|
||||
|
||||
+16
-1
@@ -29,6 +29,13 @@
|
||||
#include "peep.h"
|
||||
#include "vehicle.h"
|
||||
|
||||
enum SPRITE_IDENTIFIER{
|
||||
SPRITE_IDENTIFIER_VEHICLE = 0,
|
||||
SPRITE_IDENTIFIER_PEEP = 1,
|
||||
SPRITE_IDENTIFIER_FLOATING_TEXT = 2,
|
||||
SPRITE_IDENTIFIER_LITTER = 3,
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
uint8 sprite_identifier; // 0x00
|
||||
uint8 pad_01;
|
||||
@@ -42,10 +49,18 @@ typedef struct {
|
||||
sint16 x; // 0x0E
|
||||
sint16 y; // 0x10
|
||||
sint16 z; // 0x12
|
||||
uint16 pad_14;
|
||||
sint16 var_16; //x related
|
||||
sint16 var_18; //y related
|
||||
sint16 var_1A; //x related
|
||||
sint16 var_1C; //y related
|
||||
uint8 sprite_direction; //direction of sprite?
|
||||
} rct_unk_sprite;
|
||||
|
||||
typedef struct {
|
||||
uint32 pad_00;
|
||||
uint8 sprite_identifier; // 0x00
|
||||
uint8 var_01; // 0x01
|
||||
uint16 var_02; // 0x02
|
||||
uint16 next; // 0x04
|
||||
uint16 previous; // 0x06
|
||||
uint8 var_08;
|
||||
|
||||
@@ -87,6 +87,15 @@ enum {
|
||||
SPR_TAB_ADMISSION_6 = SPR_TAB_ADMISSION_0 + 6,
|
||||
SPR_TAB_ADMISSION_7 = SPR_TAB_ADMISSION_0 + 7,
|
||||
|
||||
SPR_TAB_FINANCES_SUMMARY_0 = 5261,
|
||||
SPR_TAB_FINANCES_SUMMARY_1 = SPR_TAB_FINANCES_SUMMARY_0 + 1,
|
||||
SPR_TAB_FINANCES_SUMMARY_2 = SPR_TAB_FINANCES_SUMMARY_0 + 2,
|
||||
SPR_TAB_FINANCES_SUMMARY_3 = SPR_TAB_FINANCES_SUMMARY_0 + 3,
|
||||
SPR_TAB_FINANCES_SUMMARY_4 = SPR_TAB_FINANCES_SUMMARY_0 + 4,
|
||||
SPR_TAB_FINANCES_SUMMARY_5 = SPR_TAB_FINANCES_SUMMARY_0 + 5,
|
||||
SPR_TAB_FINANCES_SUMMARY_6 = SPR_TAB_FINANCES_SUMMARY_0 + 6,
|
||||
SPR_TAB_FINANCES_SUMMARY_7 = SPR_TAB_FINANCES_SUMMARY_0 + 7,
|
||||
|
||||
SPR_TAB_STATS_0 = 5277,
|
||||
SPR_TAB_STATS_1 = SPR_TAB_STATS_0 + 1,
|
||||
SPR_TAB_STATS_2 = SPR_TAB_STATS_0 + 2,
|
||||
@@ -111,6 +120,8 @@ enum {
|
||||
|
||||
SPR_PEEP_LARGE_FACE_ANGRY = 5314,
|
||||
|
||||
SPR_TAB_FINANCES_RESEARCH_0 = 5327,
|
||||
|
||||
SPR_TAB_SHOPS_AND_STALLS_0 = 5351,
|
||||
SPR_TAB_SHOPS_AND_STALLS_1 = SPR_TAB_SHOPS_AND_STALLS_0 + 1,
|
||||
SPR_TAB_SHOPS_AND_STALLS_2 = SPR_TAB_SHOPS_AND_STALLS_0 + 2,
|
||||
@@ -137,6 +148,14 @@ enum {
|
||||
SPR_TAB_KIOSKS_AND_FACILITIES_6 = SPR_TAB_KIOSKS_AND_FACILITIES_0 + 6,
|
||||
SPR_TAB_KIOSKS_AND_FACILITIES_7 = SPR_TAB_KIOSKS_AND_FACILITIES_0 + 7,
|
||||
|
||||
SPR_TAB_FINANCES_FINANCIAL_GRAPH_0 = 5375,
|
||||
|
||||
SPR_TAB_FINANCES_PROFIT_GRAPH_0 = 5391,
|
||||
|
||||
SPR_TAB_FINANCES_VALUE_GRAPH_0 = 5407,
|
||||
|
||||
SPR_TAB_FINANCES_MARKETING_0 = 5423,
|
||||
|
||||
SPR_TAB_RIDE_0 = 5442,
|
||||
SPR_TAB_RIDE_1 = SPR_TAB_RIDE_0 + 1,
|
||||
SPR_TAB_RIDE_2 = SPR_TAB_RIDE_0 + 2,
|
||||
|
||||
+8
-11
@@ -1089,7 +1089,6 @@ format_code_token format_code_tokens[] = {
|
||||
{ FORMAT_NEWLINE_X_Y, "NEWLINE_X_Y" },
|
||||
{ FORMAT_INLINE_SPRITE, "INLINE_SPRITE" },
|
||||
{ FORMAT_ENDQUOTES, "ENDQUOTES" },
|
||||
{ FORMAT_ARGUMENT_CODE_START, "ARGUMENT_CODE_START" },
|
||||
{ FORMAT_COMMA32, "COMMA32" },
|
||||
{ FORMAT_INT32, "INT32" },
|
||||
{ FORMAT_COMMA2DP32, "COMMA2DP32" },
|
||||
@@ -1109,7 +1108,6 @@ format_code_token format_code_tokens[] = {
|
||||
{ FORMAT_REALTIME, "REALTIME" },
|
||||
{ FORMAT_LENGTH, "LENGTH" },
|
||||
{ FORMAT_SPRITE, "SPRITE" },
|
||||
{ FORMAT_COLOUR_CODE_START, "COLOUR_CODE_START" },
|
||||
{ FORMAT_BLACK, "BLACK" },
|
||||
{ FORMAT_GREY, "GREY" },
|
||||
{ FORMAT_WHITE, "WHITE" },
|
||||
@@ -1124,7 +1122,6 @@ format_code_token format_code_tokens[] = {
|
||||
{ FORMAT_LIGHTPINK, "LIGHTPINK" },
|
||||
{ FORMAT_PEARLAQUA, "PEARLAQUA" },
|
||||
{ FORMAT_PALESILVER, "PALESILVER" },
|
||||
{ FORMAT_COLOUR_CODE_END, "COLOUR_CODE_END" },
|
||||
{ FORMAT_AMINUSCULE, "AMINUSCULE" },
|
||||
{ FORMAT_UP, "UP" },
|
||||
{ FORMAT_POUND, "POUND" },
|
||||
@@ -1153,7 +1150,7 @@ char format_get_code(const char *token)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < countof(format_code_tokens); i++)
|
||||
if (strcmpi(token, format_code_tokens[i].token) == 0)
|
||||
if (_strcmpi(token, format_code_tokens[i].token) == 0)
|
||||
return format_code_tokens[i].code;
|
||||
return 0;
|
||||
}
|
||||
@@ -1172,7 +1169,7 @@ const char *format_get_token(char code)
|
||||
void format_string_part_from_raw(char **dest, const char *src, char **args);
|
||||
void format_string_part(char **dest, rct_string_id format, char **args);
|
||||
|
||||
void format_integer(char **dest, int value)
|
||||
void format_integer(char **dest, long long value)
|
||||
{
|
||||
int digit;
|
||||
char *dst = *dest;
|
||||
@@ -1212,7 +1209,7 @@ void format_integer(char **dest, int value)
|
||||
*dest = finish;
|
||||
}
|
||||
|
||||
void format_comma_separated_integer(char **dest, int value)
|
||||
void format_comma_separated_integer(char **dest, long long value)
|
||||
{
|
||||
int digit, groupIndex;
|
||||
char *dst = *dest;
|
||||
@@ -1260,7 +1257,7 @@ void format_comma_separated_integer(char **dest, int value)
|
||||
*dest = finish;
|
||||
}
|
||||
|
||||
void format_comma_separated_fixed_2dp(char **dest, int value)
|
||||
void format_comma_separated_fixed_2dp(char **dest, long long value)
|
||||
{
|
||||
int digit, groupIndex;
|
||||
char *dst = *dest;
|
||||
@@ -1317,9 +1314,9 @@ void format_comma_separated_fixed_2dp(char **dest, int value)
|
||||
*dest = finish;
|
||||
}
|
||||
|
||||
void format_currency(char **dest, int value)
|
||||
void format_currency(char **dest, long long value)
|
||||
{
|
||||
rct_currency_spec *currencySpec = &g_currency_specs[gGeneral_config.currency_format];
|
||||
const rct_currency_spec *currencySpec = &g_currency_specs[gGeneral_config.currency_format];
|
||||
|
||||
int rate = currencySpec->rate;
|
||||
value *= rate;
|
||||
@@ -1349,9 +1346,9 @@ void format_currency(char **dest, int value)
|
||||
}
|
||||
}
|
||||
|
||||
void format_currency_2dp(char **dest, int value)
|
||||
void format_currency_2dp(char **dest, long long value)
|
||||
{
|
||||
rct_currency_spec *currencySpec = &g_currency_specs[gGeneral_config.currency_format];
|
||||
const rct_currency_spec *currencySpec = &g_currency_specs[gGeneral_config.currency_format];
|
||||
|
||||
int rate = currencySpec->rate;
|
||||
value *= rate;
|
||||
|
||||
@@ -280,6 +280,7 @@ enum {
|
||||
STR_CONSTRUCT_THE_SELECTED_FOOTPATH_SECTION_TIP = 1189,
|
||||
STR_REMOVE_PREVIOUS_FOOTPATH_SECTION_TIP = 1190,
|
||||
STR_COST = 1191,
|
||||
STR_LOSS = 1192,
|
||||
|
||||
STR_CLOSED = 1194,
|
||||
STR_TEST_RUN = 1195,
|
||||
@@ -415,6 +416,32 @@ enum {
|
||||
STR_INSPECTING_RIDE = 1886,
|
||||
|
||||
STR_BUILD_RIDE_TIP = 1895,
|
||||
STR_FINANCES_SUMMARY_EXPENDITURE_INCOME = 1896,
|
||||
STR_FINANCES_SUMMARY_RIDE_CONSTRUCTION = 1897,
|
||||
STR_FINANCES_SUMMARY_RIDE_RUNNING_COSTS = 1898,
|
||||
STR_FINANCES_SUMMARY_LAND_PURCHASE = 1899,
|
||||
STR_FINANCES_SUMMARY_LANDSCAPING = 1900,
|
||||
STR_FINANCES_SUMMARY_PARK_ENTRANCE_TICKETS = 1901,
|
||||
STR_FINANCES_SUMMARY_RIDE_TICKETS = 1902,
|
||||
STR_FINANCES_SUMMARY_SHOP_SALES = 1903,
|
||||
STR_FINANCES_SUMMARY_SHOP_STOCK = 1904,
|
||||
STR_FINANCES_SUMMARY_FOOD_DRINK_SALES = 1905,
|
||||
STR_FINANCES_SUMMARY_FOOD_DRINK_STOCK = 1906,
|
||||
STR_FINANCES_SUMMARY_STAFF_WAGES = 1907,
|
||||
STR_FINANCES_SUMMARY_MARKETING = 1908,
|
||||
STR_FINANCES_SUMMARY_RESEARCH = 1909,
|
||||
STR_FINANCES_SUMMARY_LOAN_INTEREST = 1910,
|
||||
|
||||
STR_FINANCES_SUMMARY_AT_X_PER_YEAR = 1911,
|
||||
STR_FINANCES_SUMMARY_MONTH_HEADING = 1912,
|
||||
STR_FINANCES_SUMMARY_INCOME_VALUE = 1913,
|
||||
STR_FINANCES_SUMMARY_EXPENDITURE_VALUE = 1914,
|
||||
STR_FINANCES_SUMMARY_LOSS_VALUE = 1915,
|
||||
STR_FINANCES_SUMMARY_LOAN = 1916,
|
||||
|
||||
STR_CANT_BORROW_ANY_MORE_MONEY = 1918,
|
||||
STR_NOT_ENOUGH_CASH_AVAILABLE = 1919,
|
||||
STR_CANT_PAY_BACK_LOAN = 1920,
|
||||
|
||||
STR_START_NEW_GAME_TIP = 1921,
|
||||
STR_CONTINUE_SAVED_GAME_TIP = 1922,
|
||||
@@ -449,6 +476,11 @@ enum {
|
||||
STR_PARK_RATING_TIP = 2221,
|
||||
|
||||
STR_GUESTS_IN_PARK_LABEL = 2223,
|
||||
STR_CASH_LABEL = 2224,
|
||||
STR_CASH_NEGATIVE_LABEL = 2225,
|
||||
STR_PARK_VALUE_LABEL = 2226,
|
||||
STR_COMPANY_VALUE_LABEL = 2227,
|
||||
STR_LAST_MONTH_PROFIT_FROM_FOOD_DRINK_MERCHANDISE_SALES_LABEL = 2228,
|
||||
|
||||
STR_PARK_INFORMATION_TIP = 2233,
|
||||
STR_RECENT_MESSAGES = 2234,
|
||||
@@ -474,7 +506,13 @@ enum {
|
||||
STR_RESEARCH_SHOPS_AND_STALLS = 2258,
|
||||
STR_RESEARCH_SCENERY_AND_THEMING = 2259,
|
||||
|
||||
STR_NO_FUNDING = 2260,
|
||||
STR_MINIMUM_FUNDING = 2261,
|
||||
STR_NORMAL_FUNDING = 2262,
|
||||
STR_MAXIMUM_FUNDING = 2263,
|
||||
|
||||
STR_RESEARCH_FUNDING_ = 2264,
|
||||
STR_RESEARCH_COST_PER_MONTH = 2265,
|
||||
STR_RESEARCH_PRIORITIES = 2266,
|
||||
|
||||
STR_FINANCES_RESEARCH = 2275,
|
||||
@@ -554,8 +592,40 @@ enum {
|
||||
STR_OBJECTIVE_MONTHLY_FOOD_INCOME = STR_OBJECTIVE_NONE + 11,
|
||||
|
||||
STR_MARKETING_CAMPAIGNS_IN_OPERATION = 2409,
|
||||
STR_MARKETING_CAMPAGINS_NONE = 2410,
|
||||
STR_MARKETING_CAMPAIGNS_AVAILABLE = 2411,
|
||||
STR_START_THIS_MARKETING_CAMPAIGN = 2412,
|
||||
STR_MARKETING_PER_WEEK = 2413,
|
||||
STR_MARKETING_NOT_SELECTED = 2414,
|
||||
STR_MARKETING_RIDE = 2415,
|
||||
STR_MARKETING_ITEM = 2416,
|
||||
|
||||
STR_LENGTH_OF_TIME = 2417,
|
||||
|
||||
STR_MARKETING_VOUCHERS_FOR_FREE_ENTRY_TO_THE_PARK = 2424,
|
||||
STR_MARKETING_VOUCHERS_FOR_FREE_RIDES_ON_A_PARTICULAR_RIDE = 2425,
|
||||
STR_MARKETING_VOUCHERS_FOR_HALF_PRICE_ENTRY_TO_THE_PARK = 2426,
|
||||
STR_MARKETING_VOUCHERS_FOR_FREE_FOOD_OR_DRINK = 2427,
|
||||
STR_MARKETING_ADVERTISING_CAMPAIGN_FOR_THE_PARK = 2428,
|
||||
STR_MARKETING_ADVERTISING_CAMPAIGN_FOR_A_PARTICULAR_RIDE = 2429,
|
||||
|
||||
STR_VOUCHERS_FOR_FREE_ENTRY_TO = 2430,
|
||||
STR_VOUCHERS_FOR_FREE_RIDE_ON = 2431,
|
||||
STR_VOUCHERS_FOR_HALF_PRICE_ENTRY_TO = 2432,
|
||||
STR_VOUCHERS_FOR_FREE = 2433,
|
||||
STR_ADVERTISING_CAMPAIGN_FOR_1 = 2434,
|
||||
STR_ADVERTISING_CAMPAIGN_FOR_2 = 2435,
|
||||
|
||||
STR_MARKETING_1_WEEK = 2436,
|
||||
STR_MARKETING_2_WEEKS = 2437,
|
||||
STR_MARKETING_3_WEEKS = 2438,
|
||||
STR_MARKETING_4_WEEKS = 2439,
|
||||
STR_MARKETING_5_WEEKS = 2440,
|
||||
STR_MARKETING_6_WEEKS = 2441,
|
||||
STR_MARKETING_WEEKS_REMAINING = 2442,
|
||||
STR_MARKETING_COST_PER_WEEK = 2443,
|
||||
STR_MARKETING_TOTAL_COST = 2444,
|
||||
STR_MARKETING_START_THIS_MARKETING_CAMPAIGN = 2445,
|
||||
|
||||
STR_MARKETING_FINISHED_BASE = 2446,
|
||||
STR_MARKETING_FINISHED_FREE_ENTRY = 2446,
|
||||
@@ -565,6 +635,12 @@ enum {
|
||||
STR_MARKETING_FINISHED_PARK_ADS = 2450,
|
||||
STR_MARKETING_FINISHED_RIDE_ADS = 2451,
|
||||
|
||||
STR_FINANCES_FINANCIAL_GRAPH_CASH_LESS_LOAN_POSITIVE = 2452,
|
||||
STR_FINANCES_FINANCIAL_GRAPH_CASH_LESS_LOAN_NEGATIVE = 2453,
|
||||
STR_FINANCES_FINANCIAL_GRAPH_CASH_VALUE = 2454,
|
||||
STR_FINANCES_FINANCIAL_GRAPH_CASH_VALUE_POSITIVE = 2455,
|
||||
STR_FINANCES_FINANCIAL_GRAPH_CASH_VALUE_NEGATIVE = 2456,
|
||||
|
||||
STR_FINANCES_SHOW_SUMMARY_TAB_TIP = 2457,
|
||||
STR_FINANCES_SHOW_CASH_TAB_TIP = 2458,
|
||||
STR_FINANCES_SHOW_PARK_VALUE_TAB_TIP = 2459,
|
||||
@@ -589,6 +665,8 @@ enum {
|
||||
STR_RESEARCH_NEW_SCENERY_AND_THEMING = 2476,
|
||||
|
||||
STR_PROFIT_PER_WEEK_AND_PARK_VALUE_TIP = 2482,
|
||||
STR_FINANCES_WEEKLY_PROFIT_POSITIVE = 2483,
|
||||
STR_FINANCES_WEEKLY_PROFIT_LOSS = 2484,
|
||||
|
||||
STR_CONTROLS = 2485,
|
||||
STR_GENERAL = 2486,
|
||||
@@ -596,6 +674,8 @@ enum {
|
||||
STR_REAL_NAME_TIP = 2488,
|
||||
STR_HOTKEY = 2489,
|
||||
|
||||
STR_FINACNES_PARK_VALUE = 2787,
|
||||
|
||||
STR_ENTER_NAME_INTO_SCENARIO_CHART = 2790,
|
||||
|
||||
STR_COMPLETED_BY_WITH_COMPANY_VALUE = 2794,
|
||||
@@ -667,6 +747,7 @@ enum {
|
||||
|
||||
STR_TUTORIAL = 2856,
|
||||
STR_PRESS_KEY_OR_MOUSE_BUTTON_FOR_CONTROL = 2857,
|
||||
STR_CANT_START_MARKETING_CAMPAIGN = 2858,
|
||||
|
||||
STR_INFOGRAMES_INTERACTIVE_CREDITS = 2860,
|
||||
STR_LICENSED_TO_INFOGRAMES_INTERACTIVE_INC = 2861,
|
||||
|
||||
+265
-20
@@ -33,6 +33,28 @@
|
||||
|
||||
rct_viewport* g_viewport_list = RCT2_ADDRESS(RCT2_ADDRESS_VIEWPORT_LIST, rct_viewport);
|
||||
|
||||
typedef struct paint_struct paint_struct;
|
||||
|
||||
struct paint_struct{
|
||||
uint32 image_id; // 0x00
|
||||
uint32 var_04;
|
||||
uint16 attached_x; // 0x08
|
||||
uint16 attached_y; // 0x0A
|
||||
uint8 var_0C;
|
||||
uint8 pad_0D;
|
||||
paint_struct* next_attached_ps; //0x0E
|
||||
uint8 pad_12[2];
|
||||
uint16 x; // 0x14
|
||||
uint16 y; // 0x16
|
||||
uint8 pad_18[2];
|
||||
uint8 var_1A;
|
||||
uint8 pad_1B;
|
||||
paint_struct* attached_ps; //0x1C
|
||||
paint_struct* var_20;
|
||||
paint_struct* var_24;
|
||||
uint8 sprite_type; //0x28
|
||||
};
|
||||
|
||||
/**
|
||||
* This is not a viewport function. It is used to setup many variables for
|
||||
* multiple things.
|
||||
@@ -267,10 +289,232 @@ void sub_0x68615B(int ebp){
|
||||
RCT2_GLOBAL(0xF1AD24, uint32) = 0;
|
||||
}
|
||||
|
||||
/***
|
||||
*
|
||||
* rct2: 0x00688596
|
||||
* Part of 0x688485
|
||||
*/
|
||||
void paint_attached_ps(paint_struct* ps, paint_struct* attached_ps, rct_drawpixelinfo* dpi){
|
||||
for (; attached_ps; attached_ps = attached_ps->next_attached_ps){
|
||||
sint16 x = attached_ps->attached_x + ps->x;
|
||||
sint16 y = attached_ps->attached_y + ps->y;
|
||||
|
||||
int image_id = attached_ps->image_id;
|
||||
if (RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_VIEWPORT_FLAGS, uint16) & VIEWPORT_FLAG_SEETHROUGH_RIDES){
|
||||
if (ps->sprite_type == 3){
|
||||
if (image_id & 0x40000000){
|
||||
image_id &= 0x7FFFF;
|
||||
image_id |= 0x41880000;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_VIEWPORT_FLAGS, uint16) & VIEWPORT_FLAG_SEETHROUGH_SCENERY){
|
||||
if (ps->sprite_type == 5){
|
||||
if (image_id & 0x40000000){
|
||||
image_id &= 0x7FFFF;
|
||||
image_id |= 0x41880000;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!(attached_ps->var_0C & 1)){
|
||||
gfx_draw_sprite(dpi, image_id, x, y, ps->var_04);
|
||||
}
|
||||
else{
|
||||
RCT2_CALLPROC_X(0x00681DE2, 0, image_id, x, y, 0, (int)dpi, attached_ps->var_04);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sub_688485(){
|
||||
//RCT2_CALLPROC_EBPSAFE(0x688485);
|
||||
//return;
|
||||
rct_drawpixelinfo* dpi = RCT2_GLOBAL(0x140E9A8, rct_drawpixelinfo*);
|
||||
paint_struct* ps = RCT2_GLOBAL(0xEE7884, paint_struct*);
|
||||
paint_struct* previous_ps = ps->var_24;
|
||||
|
||||
for (ps = ps->var_24; ps;){
|
||||
sint16 x = ps->x;
|
||||
sint16 y = ps->y;
|
||||
if (ps->sprite_type == 2){
|
||||
if (dpi->zoom_level >= 1){
|
||||
x &= 0xFFFE;
|
||||
y &= 0xFFFE;
|
||||
if (dpi->zoom_level >= 2){
|
||||
x &= 0xFFFC;
|
||||
y &= 0xFFFC;
|
||||
}
|
||||
}
|
||||
}
|
||||
int image_id = ps->image_id;
|
||||
if (RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_VIEWPORT_FLAGS, uint16) & VIEWPORT_FLAG_SEETHROUGH_RIDES){
|
||||
if (ps->sprite_type == 3){
|
||||
if (!(image_id & 0x40000000)){
|
||||
image_id &= 0x7FFFF;
|
||||
image_id |= 0x41880000;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_VIEWPORT_FLAGS, uint16) & VIEWPORT_FLAG_UNDERGROUND_INSIDE){
|
||||
if (ps->sprite_type == 9){
|
||||
if (!(image_id & 0x40000000)){
|
||||
image_id &= 0x7FFFF;
|
||||
image_id |= 0x41880000;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_VIEWPORT_FLAGS, uint16) & VIEWPORT_FLAG_SEETHROUGH_SCENERY){
|
||||
if (ps->sprite_type == 10 || ps->sprite_type == 12 || ps->sprite_type == 9 || ps->sprite_type == 5){
|
||||
if (!(image_id & 0x40000000)){
|
||||
image_id &= 0x7FFFF;
|
||||
image_id |= 0x41880000;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!(ps->var_1A & 1))
|
||||
gfx_draw_sprite(dpi, image_id, x, y, ps->var_04);
|
||||
else
|
||||
RCT2_CALLPROC_X(0x00681DE2, 0, image_id, x, y, 0, (int)dpi, ps->var_04);
|
||||
|
||||
if (ps->var_20 != 0){
|
||||
ps = ps->var_20;
|
||||
continue;
|
||||
}
|
||||
|
||||
paint_attached_ps(ps, ps->attached_ps, dpi);
|
||||
ps = previous_ps->var_24;
|
||||
previous_ps = ps;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
int sub_0x686806(rct_sprite* sprite, int eax, int ecx, int edx){
|
||||
int ebp = (eax >> 8) & 0xFF;
|
||||
edx <<= 16;
|
||||
ebp += RCT2_GLOBAL(0x9DEA56, uint16);
|
||||
RCT2_GLOBAL(0xF1AD28, uint32) = 0;
|
||||
RCT2_GLOBAL(0xF1AD2C, uint32) = 0;
|
||||
edx = (edx >> 16) | (ebp << 16);
|
||||
ebp = RCT2_GLOBAL(0xEE7888, uint32);
|
||||
if ((uint32)ebp >= RCT2_GLOBAL(0xEE7880, uint32)) return 1;
|
||||
//686840 not finished
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Litter Paint Setup??
|
||||
* rct2: 0x006736FC
|
||||
*/
|
||||
void sub_0x6736FC(rct_litter* litter, int ebx, int edx){
|
||||
rct_drawpixelinfo* dpi;
|
||||
|
||||
dpi = RCT2_GLOBAL(0x140E9A8, rct_drawpixelinfo*);
|
||||
if (dpi->zoom_level != 0)return; //If zoomed at all no litter drawn
|
||||
|
||||
int ebp = litter->var_01;
|
||||
//push litter
|
||||
ebx >>= 3;
|
||||
ebx &= RCT2_ADDRESS(0x97EF6C, uint32)[ebp * 2 + 1];
|
||||
ebx += RCT2_ADDRESS(0x97EF6C, uint32)[ebp * 2];
|
||||
int ecx = 0;
|
||||
int edi = 4;
|
||||
int esi = 4;
|
||||
int eax = 0xFF00;
|
||||
RCT2_GLOBAL(0x9DEA52, uint16) = 0xFFFC;
|
||||
RCT2_GLOBAL(0x9DEA54, uint16) = 0xFFFC;
|
||||
RCT2_GLOBAL(0x9DEA56, uint16) = edx + 2;
|
||||
|
||||
switch (RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_ROTATION,uint32)){
|
||||
case 0:
|
||||
//0x686806
|
||||
break;
|
||||
case 1:
|
||||
//0x6869b2
|
||||
break;
|
||||
case 2:
|
||||
//0x686b6f
|
||||
break;
|
||||
case 3:
|
||||
//0x686d31
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Paint Quadrant
|
||||
* rct2: 0x0069E8B0
|
||||
*/
|
||||
void sub_0x69E8B0(uint32 eax, uint32 ecx){
|
||||
uint32 _eax = eax, _ecx = ecx;
|
||||
rct_drawpixelinfo* dpi;
|
||||
|
||||
|
||||
if (RCT2_GLOBAL(0x9DEA6F,uint8) & 1) return;
|
||||
|
||||
dpi = RCT2_GLOBAL(0x140E9A8,rct_drawpixelinfo*);
|
||||
|
||||
if (RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_VIEWPORT_FLAGS, uint16) & 0x4000)return;
|
||||
|
||||
if (dpi->zoom_level > 2) return;
|
||||
|
||||
if (eax > 0x2000)return;
|
||||
if (ecx > 0x2000)return;
|
||||
|
||||
//push eax, ecx
|
||||
eax = (eax&0x1FE0)<<3 | (ecx>>5);
|
||||
int sprite_idx = RCT2_ADDRESS(0xF1EF60, uint16)[eax];
|
||||
if (sprite_idx == SPRITE_INDEX_NULL) return;
|
||||
|
||||
for (rct_sprite* spr = &g_sprite_list[sprite_idx]; sprite_idx != SPRITE_INDEX_NULL; sprite_idx = spr->unknown.var_02){
|
||||
spr = &g_sprite_list[sprite_idx];
|
||||
dpi = RCT2_GLOBAL(0x140E9A8, rct_drawpixelinfo*);
|
||||
|
||||
if (dpi->y + dpi->height <= spr->unknown.var_18) continue;
|
||||
if (spr->unknown.var_1C <= dpi->y)continue;
|
||||
if (dpi->x + dpi->width <= spr->unknown.var_16)continue;
|
||||
if (spr->unknown.var_1A <= dpi->x)continue;
|
||||
|
||||
int ebx = RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_ROTATION, uint32);
|
||||
RCT2_GLOBAL(0x9DE578, uint32) = (uint32)spr;
|
||||
int ebp = spr->unknown.sprite_identifier;
|
||||
ebx <<= 3;
|
||||
eax = spr->unknown.x;
|
||||
ebx += spr->unknown.sprite_direction;
|
||||
ecx = spr->unknown.y;
|
||||
ebx &= 0x1F;
|
||||
RCT2_GLOBAL(0x9DE568, uint16) = spr->unknown.x;
|
||||
RCT2_GLOBAL(0x9DE570, uint8) = 2;
|
||||
RCT2_GLOBAL(0x9DE56C, uint16) = spr->unknown.y;
|
||||
int edx = spr->unknown.z;
|
||||
switch (spr->unknown.sprite_identifier){
|
||||
case SPRITE_IDENTIFIER_VEHICLE:
|
||||
RCT2_CALLPROC_X(0x6D4244, eax, ebx, ecx, edx, (int)spr, (int)dpi, ebp);
|
||||
break;
|
||||
case SPRITE_IDENTIFIER_PEEP:
|
||||
RCT2_CALLPROC_X(0x68F0FB, eax, ebx, ecx, edx, (int)spr, (int)dpi, ebp);
|
||||
break;
|
||||
case SPRITE_IDENTIFIER_FLOATING_TEXT:
|
||||
RCT2_CALLPROC_X(0x672AC9, eax, ebx, ecx, edx, (int)spr, (int)dpi, ebp);
|
||||
break;
|
||||
case SPRITE_IDENTIFIER_LITTER:
|
||||
RCT2_CALLPROC_X(0x6736FC, eax, ebx, ecx, edx, (int)spr, (int)dpi, ebp);
|
||||
break;
|
||||
//I am pretty sure there are no other sprite identifier types
|
||||
}
|
||||
//RCT2_CALLPROC_X(RCT2_ADDRESS(0x98BC40,uint32)[spr->unknown.sprite_identifier], eax, ebx, ecx, edx, (int)spr, (int)dpi, ebp);
|
||||
}
|
||||
|
||||
//RCT2_CALLPROC_X(0x69E8B0, _eax, 0, _ecx, 0, 0, 0, 0);
|
||||
//return;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* rct2: 0x0068615B
|
||||
* ebp: ebp
|
||||
* rct2: 0x0068B6C2
|
||||
*/
|
||||
void sub_0x68B6C2(){
|
||||
rct_drawpixelinfo* dpi = RCT2_GLOBAL(0x140E9A8, rct_drawpixelinfo*);
|
||||
@@ -294,16 +538,16 @@ void sub_0x68B6C2(){
|
||||
dx >>= 5;
|
||||
for (int i = dx; i > 0; --i){
|
||||
RCT2_CALLPROC_X(0x68B35F, ax, 0, cx, 0, 0, 0, 0);
|
||||
RCT2_CALLPROC_X(0x69E8B0, ax, 0, cx, 0, 0, 0, 0);
|
||||
sub_0x69E8B0(ax, cx);
|
||||
cx += 0x20;
|
||||
ax -= 0x20;
|
||||
RCT2_CALLPROC_X(0x69E8B0, ax, 0, cx, 0, 0, 0, 0);
|
||||
sub_0x69E8B0(ax, cx);
|
||||
ax += 0x20;
|
||||
RCT2_CALLPROC_X(0x68B35F, ax, 0, cx, 0, 0, 0, 0);
|
||||
RCT2_CALLPROC_X(0x69E8B0, ax, 0, cx, 0, 0, 0, 0);
|
||||
sub_0x69E8B0(ax, cx);
|
||||
ax += 0x20;
|
||||
cx -= 0x20;
|
||||
RCT2_CALLPROC_X(0x69E8B0, ax, 0, cx, 0, 0, 0, 0);
|
||||
sub_0x69E8B0(ax, cx);
|
||||
cx += 0x20;
|
||||
}
|
||||
break;
|
||||
@@ -326,16 +570,16 @@ void sub_0x68B6C2(){
|
||||
dx >>= 5;
|
||||
for (int i = dx; i > 0; i--){
|
||||
RCT2_CALLPROC_X(0x68B35F, ax, 0, cx, 0, 0, 0, 0);
|
||||
RCT2_CALLPROC_X(0x69E8B0, ax, 0, cx, 0, 0, 0, 0);
|
||||
sub_0x69E8B0(ax, cx);
|
||||
ax -= 0x20;
|
||||
cx -= 0x20;
|
||||
RCT2_CALLPROC_X(0x69E8B0, ax, 0, cx, 0, 0, 0, 0);
|
||||
sub_0x69E8B0(ax, cx);
|
||||
cx += 0x20;
|
||||
RCT2_CALLPROC_X(0x68B35F, ax, 0, cx, 0, 0, 0, 0);
|
||||
RCT2_CALLPROC_X(0x69E8B0, ax, 0, cx, 0, 0, 0, 0);
|
||||
sub_0x69E8B0(ax, cx);
|
||||
ax += 0x20;
|
||||
cx += 0x20;
|
||||
RCT2_CALLPROC_X(0x69E8B0, ax, 0, cx, 0, 0, 0, 0);
|
||||
sub_0x69E8B0(ax, cx);
|
||||
ax -= 0x20;
|
||||
}
|
||||
break;
|
||||
@@ -357,16 +601,16 @@ void sub_0x68B6C2(){
|
||||
dx >>= 5;
|
||||
for (int i = dx; i > 0; i--){
|
||||
RCT2_CALLPROC_X(0x68B35F, ax, 0, cx, 0, 0, 0, 0);
|
||||
RCT2_CALLPROC_X(0x69E8B0, ax, 0, cx, 0, 0, 0, 0);
|
||||
sub_0x69E8B0(ax, cx);
|
||||
ax += 0x20;
|
||||
cx -= 0x20;
|
||||
RCT2_CALLPROC_X(0x69E8B0, ax, 0, cx, 0, 0, 0, 0);
|
||||
sub_0x69E8B0(ax, cx);
|
||||
ax -= 0x20;
|
||||
RCT2_CALLPROC_X(0x68B35F, ax, 0, cx, 0, 0, 0, 0);
|
||||
RCT2_CALLPROC_X(0x69E8B0, ax, 0, cx, 0, 0, 0, 0);
|
||||
sub_0x69E8B0(ax, cx);
|
||||
ax -= 0x20;
|
||||
cx += 0x20;
|
||||
RCT2_CALLPROC_X(0x69E8B0, ax, 0, cx, 0, 0, 0, 0);
|
||||
sub_0x69E8B0(ax, cx);
|
||||
cx -= 0x20;
|
||||
}
|
||||
break;
|
||||
@@ -389,16 +633,16 @@ void sub_0x68B6C2(){
|
||||
dx >>= 5;
|
||||
for (int i = dx; i > 0; i--){
|
||||
RCT2_CALLPROC_X(0x68B35F, ax, 0, cx, 0, 0, 0, 0);
|
||||
RCT2_CALLPROC_X(0x69E8B0, ax, 0, cx, 0, 0, 0, 0);
|
||||
sub_0x69E8B0(ax, cx);
|
||||
ax += 0x20;
|
||||
cx += 0x20;
|
||||
RCT2_CALLPROC_X(0x69E8B0, ax, 0, cx, 0, 0, 0, 0);
|
||||
sub_0x69E8B0(ax, cx);
|
||||
cx -= 0x20;
|
||||
RCT2_CALLPROC_X(0x68B35F, ax, 0, cx, 0, 0, 0, 0);
|
||||
RCT2_CALLPROC_X(0x69E8B0, ax, 0, cx, 0, 0, 0, 0);
|
||||
sub_0x69E8B0(ax, cx);
|
||||
ax -= 0x20;
|
||||
cx -= 0x20;
|
||||
RCT2_CALLPROC_X(0x69E8B0, ax, 0, cx, 0, 0, 0, 0);
|
||||
sub_0x69E8B0(ax, cx);
|
||||
ax += 0x20;
|
||||
}
|
||||
break;
|
||||
@@ -498,8 +742,9 @@ void viewport_paint(rct_viewport* viewport, rct_drawpixelinfo* dpi, int left, in
|
||||
sub_0x68615B(0xEE788C); //Memory copy
|
||||
sub_0x68B6C2();
|
||||
//RCT2_CALLPROC_X(0x68B6C2, 0, 0, 0, 0, 0, 0, 0); //Big function call 4 rotation versions
|
||||
RCT2_CALLFUNC_X(0x688217, &start_x, &ebx, &ecx, (int*)&bits_pointer, &esi, (int*)&dpi2, &ebp); //Move memory
|
||||
RCT2_CALLFUNC_X(0x688485, &start_x, &ebx, &ecx, (int*)&bits_pointer, &esi, (int*)&dpi2, &ebp); //Big function call
|
||||
RCT2_CALLPROC_X(0x688217, start_x, ebx, ecx, (int)bits_pointer, esi, (int)dpi2, ebp); //Move memory
|
||||
sub_688485();
|
||||
//RCT2_CALLPROC_EBPSAFE(0x688485); //Big function call
|
||||
|
||||
int weather_colour = RCT2_ADDRESS(0x98195C, uint32)[RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_WEATHER_GLOOM, uint8)];
|
||||
if ((weather_colour != -1) && (RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_VIEWPORT_FLAGS, uint16) & 0x4000) && (RCT2_GLOBAL(0x9DEA6F, uint8) & 1)){
|
||||
|
||||
@@ -42,6 +42,7 @@ enum {
|
||||
VIEWPORT_FLAG_15 = (1 << 15)
|
||||
};
|
||||
|
||||
|
||||
// rct2: 0x014234BC
|
||||
extern rct_viewport* g_viewport_list;
|
||||
|
||||
|
||||
+10
-12
@@ -157,8 +157,6 @@ void widget_draw(rct_drawpixelinfo *dpi, rct_window *w, int widgetIndex)
|
||||
widget_scroll_draw(dpi, w, widgetIndex);
|
||||
break;
|
||||
case WWT_CHECKBOX:
|
||||
widget_checkbox_draw(dpi, w, widgetIndex);
|
||||
break;
|
||||
case WWT_24:
|
||||
widget_checkbox_draw(dpi, w, widgetIndex);
|
||||
break;
|
||||
@@ -204,7 +202,7 @@ static void widget_frame_draw(rct_drawpixelinfo *dpi, rct_window *w, int widgetI
|
||||
// Draw the resize sprite at the bottom right corner
|
||||
l = w->x + widget->right - 18;
|
||||
t = w->y + widget->bottom - 18;
|
||||
gfx_draw_sprite(dpi, SPR_RESIZE | 0x20000000 | (colour << 19), l, t);
|
||||
gfx_draw_sprite(dpi, SPR_RESIZE | 0x20000000 | (colour << 19), l, t, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -241,7 +239,7 @@ static void widget_resize_draw(rct_drawpixelinfo *dpi, rct_window *w, int widget
|
||||
// Draw the resize sprite at the bottom right corner
|
||||
l = w->x + widget->right - 18;
|
||||
t = w->y + widget->bottom - 18;
|
||||
gfx_draw_sprite(dpi, SPR_RESIZE | 0x20000000 | (colour << 19), l, t);
|
||||
gfx_draw_sprite(dpi, SPR_RESIZE | 0x20000000 | (colour << 19), l, t, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -324,7 +322,7 @@ static void widget_tab_draw(rct_drawpixelinfo *dpi, rct_window *w, int widgetInd
|
||||
image = widget->image + 2;
|
||||
|
||||
// Draw coloured image
|
||||
gfx_draw_sprite(dpi, image | colour, l, t);
|
||||
gfx_draw_sprite(dpi, image | colour, l, t, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -414,9 +412,9 @@ static void widget_text_unknown(rct_drawpixelinfo *dpi, rct_window *w, int widge
|
||||
widget = &w->widgets[widgetIndex];
|
||||
|
||||
// Get the colour
|
||||
// colour = w->colours[widget->colour];
|
||||
colour = w->colours[widget->colour];
|
||||
// do not use widget color as this is already used as background for the text_button
|
||||
colour = 2;
|
||||
// colour = 2;
|
||||
|
||||
// Resolve the absolute ltrb
|
||||
l = w->x + widget->left;
|
||||
@@ -631,13 +629,13 @@ static void widget_caption_draw(rct_drawpixelinfo *dpi, rct_window *w, int widge
|
||||
|
||||
//
|
||||
if (w->var_4B8 != -1) {
|
||||
gfx_draw_sprite(dpi, *((char*)(0x013CA742 + w->var_4B8)) << 19, l + 1, t + 1);
|
||||
gfx_draw_sprite(dpi, *((char*)(0x013CA742 + w->var_4B8)) << 19, l + 1, t + 1, 0);
|
||||
if (w->width > 638)
|
||||
gfx_draw_sprite(dpi, *((char*)(0x013CA742 + w->var_4B8)) << 19, l + 1 + 638, t + 1);
|
||||
gfx_draw_sprite(dpi, *((char*)(0x013CA742 + w->var_4B8)) << 19, l + 1 + 638, t + 1, 0);
|
||||
if (w->var_4B9 != -1) {
|
||||
gfx_draw_sprite(dpi, *((char*)(0x013CA742 + w->var_4B9)) << 19, l + 1, t + 1);
|
||||
gfx_draw_sprite(dpi, *((char*)(0x013CA742 + w->var_4B9)) << 19, l + 1, t + 1, 0);
|
||||
if (w->width > 638)
|
||||
gfx_draw_sprite(dpi, *((char*)(0x013CA742 + w->var_4B9)) << 19, l + 1 + 638, t + 1);
|
||||
gfx_draw_sprite(dpi, *((char*)(0x013CA742 + w->var_4B9)) << 19, l + 1 + 638, t + 1, 0);
|
||||
}
|
||||
|
||||
//
|
||||
@@ -942,7 +940,7 @@ static void widget_draw_image(rct_drawpixelinfo *dpi, rct_window *w, int widgetI
|
||||
else
|
||||
image |= colour << 19;
|
||||
|
||||
gfx_draw_sprite(dpi, image, l, t);
|
||||
gfx_draw_sprite(dpi, image, l, t, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+76
-4
@@ -909,7 +909,22 @@ void window_rotate_camera(rct_window *w)
|
||||
*/
|
||||
void window_zoom_in(rct_window *w)
|
||||
{
|
||||
RCT2_CALLPROC_X(0x006887A6, 0, 0, 0, 0, (int)w, 0, 0);
|
||||
rct_viewport* v = w->viewport;
|
||||
|
||||
// Prevent zooming more than possible.
|
||||
if (v->zoom <= 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
v->zoom--;
|
||||
|
||||
v->view_width /= 2;
|
||||
v->view_height /= 2;
|
||||
|
||||
w->saved_view_x += v->view_width >> 1;
|
||||
w->saved_view_y += v->view_height >> 1;
|
||||
|
||||
RCT2_CALLPROC_X(0x006EB13A, 0, 0, 0, 0, (int)w, 0, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -918,7 +933,25 @@ void window_zoom_in(rct_window *w)
|
||||
*/
|
||||
void window_zoom_out(rct_window *w)
|
||||
{
|
||||
RCT2_CALLPROC_X(0x006887E0, 0, 0, 0, 0, (int)w, 0, 0);
|
||||
rct_viewport* v = w->viewport;
|
||||
|
||||
// Prevent zooming more than possible.
|
||||
if (v->zoom >= 3) {
|
||||
return;
|
||||
}
|
||||
|
||||
v->zoom++;
|
||||
|
||||
int width = v->view_width;
|
||||
int height = v->view_height;
|
||||
|
||||
v->view_width *= 2;
|
||||
v->view_height *= 2;
|
||||
|
||||
w->saved_view_x -= width / 2;
|
||||
w->saved_view_y -= height >> 1;
|
||||
|
||||
RCT2_CALLPROC_X(0x006EB13A, 0, 0, 0, 0, (int)w, 0, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1310,8 +1343,8 @@ void window_bubble_list_item(rct_window* w, int item_position){
|
||||
void window_resize_gui(int width, int height)
|
||||
{
|
||||
if (RCT2_GLOBAL(0x9DEA68, uint8) & 0xE){
|
||||
//Scenario editor version
|
||||
RCT2_CALLPROC_EBPSAFE(0x66F0DD);
|
||||
window_resize_gui_scenario_editor(width, height);
|
||||
return;
|
||||
}
|
||||
rct_window* mainWind = window_get_main();
|
||||
if (mainWind){
|
||||
@@ -1363,3 +1396,42 @@ void window_resize_gui(int width, int height)
|
||||
exitWind->y = height - 64;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* rct2: 0x0066F0DD
|
||||
*/
|
||||
void window_resize_gui_scenario_editor(int width, int height)
|
||||
{
|
||||
rct_window* mainWind = window_get_main();
|
||||
if (mainWind) {
|
||||
rct_viewport* viewport = mainWind->viewport;
|
||||
mainWind->width = width;
|
||||
mainWind->height = height;
|
||||
RCT2_GLOBAL(0x9A9834, uint16) = width - 1;
|
||||
RCT2_GLOBAL(0x9A9838, uint16) = height - 1;
|
||||
viewport->width = width;
|
||||
viewport->height = height;
|
||||
viewport->view_width = width << viewport->zoom;
|
||||
viewport->view_height = height << viewport->zoom;
|
||||
if (mainWind->widgets != NULL && mainWind->widgets[0].type == WWT_VIEWPORT){
|
||||
mainWind->widgets[0].right = width;
|
||||
mainWind->widgets[0].bottom = height;
|
||||
}
|
||||
}
|
||||
|
||||
rct_window* topWind = window_find_by_id(WC_TOP_TOOLBAR, 0);
|
||||
if (topWind){
|
||||
topWind->width = max(640, width);
|
||||
}
|
||||
|
||||
rct_window* bottomWind = window_find_by_id(WC_BOTTOM_TOOLBAR, 0);
|
||||
if (bottomWind){
|
||||
bottomWind->y = height - 32;
|
||||
bottomWind->width = max(640, width);
|
||||
RCT2_GLOBAL(0x9A997C, uint16) = bottomWind->width - 1;
|
||||
RCT2_GLOBAL(0x9A997A, uint16) = bottomWind->width - 200;
|
||||
RCT2_GLOBAL(0x9A998A, uint16) = bottomWind->width - 198;
|
||||
RCT2_GLOBAL(0x9A998C, uint16) = bottomWind->width - 3;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -346,6 +346,7 @@ void tool_cancel();
|
||||
// Open window functions
|
||||
void window_main_open();
|
||||
void window_resize_gui(int width, int height);
|
||||
void window_resize_gui_scenario_editor(int width, int height);
|
||||
void window_game_top_toolbar_open();
|
||||
void window_game_bottom_toolbar_open();
|
||||
void window_about_open();
|
||||
@@ -371,6 +372,7 @@ void window_park_guests_open();
|
||||
void window_park_objective_open();
|
||||
void window_park_rating_open();
|
||||
void window_finances_open();
|
||||
void window_new_campaign_open(int campaignType);
|
||||
void window_ride_list_open();
|
||||
void window_banner_open();
|
||||
void window_cheats_open();
|
||||
@@ -385,4 +387,38 @@ void window_staff_init_vars();
|
||||
|
||||
void window_event_helper(rct_window* w, short widgetIndex, WINDOW_EVENTS event);
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#define window_get_register(w) \
|
||||
__asm mov w, esi
|
||||
|
||||
#define window_mouse_up_get_registers(w, widgetIndex) \
|
||||
__asm mov widgetIndex, dx \
|
||||
__asm mov w, esi
|
||||
|
||||
#define window_dropdown_get_registers(w, widgetIndex, dropdownIndex) \
|
||||
__asm mov dropdownIndex, ax \
|
||||
__asm mov widgetIndex, dx \
|
||||
__asm mov w, esi
|
||||
|
||||
#define window_paint_get_registers(w, dpi) \
|
||||
__asm mov w, esi \
|
||||
__asm mov dpi, edi
|
||||
#else
|
||||
#define window_get_register(w) \
|
||||
__asm__ ( "mov %[w], esi " : [w] "+m" (w) );
|
||||
|
||||
#define window_mouse_up_get_registers(w, widgetIndex) \
|
||||
__asm__ ( "mov %[widgetIndex], dx " : [widgetIndex] "+m" (widgetIndex) ); \
|
||||
__asm__ ( "mov %[w], esi " : [w] "+m" (w) );
|
||||
|
||||
#define window_dropdown_get_registers(w, widgetIndex, dropdownIndex) \
|
||||
__asm__ ( "mov %[dropdownIndex], ax " : [dropdownIndex] "+m" (dropdownIndex) ); \
|
||||
__asm__ ( "mov %[widgetIndex], dx " : [widgetIndex] "+m" (widgetIndex) ); \
|
||||
__asm__ ( "mov %[w], esi " : [w] "+m" (w) );
|
||||
|
||||
#define window_paint_get_registers(w, dpi) \
|
||||
__asm__ ( "mov %[w], esi " : [w] "+m" (w) ); \
|
||||
__asm__ ( "mov %[dpi], edi " : [dpi] "+m" (dpi) );
|
||||
#endif
|
||||
|
||||
#endif
|
||||
+2
-2
@@ -200,8 +200,8 @@ static void window_about_paint()
|
||||
gfx_draw_string_centred(dpi, STR_CREDIT_SPARE_7, x, y, 0, (void*)0x009E2D28);
|
||||
|
||||
// Images
|
||||
gfx_draw_sprite(dpi, SPR_CREDITS_CHRIS_SAWYER_SMALL, w->x + 92, w->y + 40);
|
||||
gfx_draw_sprite(dpi, SPR_CREDITS_INFOGRAMES, w->x + 50, w->y + 247);
|
||||
gfx_draw_sprite(dpi, SPR_CREDITS_CHRIS_SAWYER_SMALL, w->x + 92, w->y + 40, 0);
|
||||
gfx_draw_sprite(dpi, SPR_CREDITS_INFOGRAMES, w->x + 50, w->y + 247, 0);
|
||||
|
||||
// Licence
|
||||
gfx_draw_string_left(dpi, STR_LICENSED_TO_INFOGRAMES_INTERACTIVE_INC, 0, 0, w->x + 157, w->y + 257);
|
||||
|
||||
+3
-3
@@ -508,7 +508,7 @@ static void window_cheats_draw_tab_images(rct_drawpixelinfo *dpi, rct_window *w)
|
||||
sprite_idx = 5261;
|
||||
if (w->page == WINDOW_CHEATS_PAGE_MONEY)
|
||||
sprite_idx += (w->frame_no / 2) % 8;
|
||||
gfx_draw_sprite(dpi, sprite_idx, w->x + w->widgets[WIDX_TAB_1].left, w->y + w->widgets[WIDX_TAB_1].top);
|
||||
gfx_draw_sprite(dpi, sprite_idx, w->x + w->widgets[WIDX_TAB_1].left, w->y + w->widgets[WIDX_TAB_1].top, 0);
|
||||
}
|
||||
|
||||
// Guests tab
|
||||
@@ -516,13 +516,13 @@ static void window_cheats_draw_tab_images(rct_drawpixelinfo *dpi, rct_window *w)
|
||||
sprite_idx = 5568;
|
||||
if (w->page == WINDOW_CHEATS_PAGE_GUESTS)
|
||||
sprite_idx += (w->frame_no / 3) % 8;
|
||||
gfx_draw_sprite(dpi, sprite_idx, w->x + w->widgets[WIDX_TAB_2].left, w->y + w->widgets[WIDX_TAB_2].top);
|
||||
gfx_draw_sprite(dpi, sprite_idx, w->x + w->widgets[WIDX_TAB_2].left, w->y + w->widgets[WIDX_TAB_2].top, 0);
|
||||
}
|
||||
|
||||
// Misc tab
|
||||
if (!(w->disabled_widgets & (1 << WIDX_TAB_3))) {
|
||||
sprite_idx = SPR_TAB_QUESTION;
|
||||
gfx_draw_sprite(dpi, sprite_idx, w->x + w->widgets[WIDX_TAB_3].left, w->y + w->widgets[WIDX_TAB_3].top);
|
||||
gfx_draw_sprite(dpi, sprite_idx, w->x + w->widgets[WIDX_TAB_3].left, w->y + w->widgets[WIDX_TAB_3].top, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -330,7 +330,7 @@ static void window_dropdown_paint()
|
||||
dpi,
|
||||
image,
|
||||
w->x + 2 + (cell_x * _dropdown_item_width),
|
||||
w->y + 2 + (cell_y * _dropdown_item_height)
|
||||
w->y + 2 + (cell_y * _dropdown_item_height), 0
|
||||
);
|
||||
} else {
|
||||
// Text item
|
||||
|
||||
+1139
-29
File diff suppressed because it is too large.
Load diff
@@ -687,7 +687,7 @@ static void window_footpath_paint()
|
||||
// Draw construction image
|
||||
x = w->x + (window_footpath_widgets[WIDX_CONSTRUCT].left + window_footpath_widgets[WIDX_CONSTRUCT].right) / 2;
|
||||
y = w->y + window_footpath_widgets[WIDX_CONSTRUCT].bottom - 60;
|
||||
gfx_draw_sprite(dpi, image, x, y);
|
||||
gfx_draw_sprite(dpi, image, x, y, 0);
|
||||
|
||||
// Draw build this... label
|
||||
x = w->x + (window_footpath_widgets[WIDX_CONSTRUCT].left + window_footpath_widgets[WIDX_CONSTRUCT].right) / 2;
|
||||
|
||||
@@ -474,8 +474,8 @@ static void window_game_bottom_toolbar_draw_park_rating(rct_drawpixelinfo *dpi,
|
||||
}
|
||||
|
||||
// Draw thumbs on the sides
|
||||
gfx_draw_sprite(dpi, SPR_RATING_LOW, x - 14, y);
|
||||
gfx_draw_sprite(dpi, SPR_RATING_HIGH, x + 92, y);
|
||||
gfx_draw_sprite(dpi, SPR_RATING_LOW, x - 14, y, 0);
|
||||
gfx_draw_sprite(dpi, SPR_RATING_HIGH, x + 92, y, 0);
|
||||
}
|
||||
|
||||
static void window_game_bottom_toolbar_draw_right_panel(rct_drawpixelinfo *dpi, rct_window *w)
|
||||
@@ -532,13 +532,13 @@ static void window_game_bottom_toolbar_draw_right_panel(rct_drawpixelinfo *dpi,
|
||||
x += 30;
|
||||
|
||||
// Current weather
|
||||
gfx_draw_sprite(dpi, climate_weather_data[RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_WEATHER, sint8)].sprite_id, x, y);
|
||||
gfx_draw_sprite(dpi, climate_weather_data[RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_WEATHER, sint8)].sprite_id, x, y, 0);
|
||||
|
||||
// Next weather
|
||||
if (climate_weather_data[RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_WEATHER, sint8)].sprite_id != climate_weather_data[gClimateNextWeather].sprite_id) {
|
||||
if (RCT2_GLOBAL(RCT2_ADDRESS_CLIMATE_UPDATE_TIMER, sint16) < 960) {
|
||||
gfx_draw_sprite(dpi, SPR_NEXT_WEATHER, x + 27, y + 5);
|
||||
gfx_draw_sprite(dpi, climate_weather_data[gClimateNextWeather].sprite_id, x + 40, y);
|
||||
gfx_draw_sprite(dpi, SPR_NEXT_WEATHER, x + 27, y + 5, 0);
|
||||
gfx_draw_sprite(dpi, climate_weather_data[gClimateNextWeather].sprite_id, x + 40, y, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -582,7 +582,7 @@ static void window_game_bottom_toolbar_draw_news_item(rct_drawpixelinfo *dpi, rc
|
||||
y = w->y + window_game_bottom_toolbar_widgets[WIDX_NEWS_SUBJECT].top;
|
||||
switch (newsItem->type) {
|
||||
case NEWS_ITEM_RIDE:
|
||||
gfx_draw_sprite(dpi, SPR_RIDE, x, y);
|
||||
gfx_draw_sprite(dpi, SPR_RIDE, x, y, 0);
|
||||
break;
|
||||
case NEWS_ITEM_PEEP_ON_RIDE:
|
||||
case NEWS_ITEM_PEEP:
|
||||
@@ -680,16 +680,16 @@ static void window_game_bottom_toolbar_draw_news_item(rct_drawpixelinfo *dpi, rc
|
||||
|
||||
break;
|
||||
case NEWS_ITEM_MONEY:
|
||||
gfx_draw_sprite(dpi, SPR_FINANCE, x, y);
|
||||
gfx_draw_sprite(dpi, SPR_FINANCE, x, y, 0);
|
||||
case NEWS_ITEM_RESEARCH:
|
||||
gfx_draw_sprite(dpi, (newsItem->assoc < 0x10000 ? SPR_NEW_RIDE : SPR_SCENERY), x, y);
|
||||
gfx_draw_sprite(dpi, (newsItem->assoc < 0x10000 ? SPR_NEW_RIDE : SPR_SCENERY), x, y, 0);
|
||||
break;
|
||||
case NEWS_ITEM_PEEPS:
|
||||
gfx_draw_sprite(dpi, SPR_GUESTS, x, y);
|
||||
gfx_draw_sprite(dpi, SPR_GUESTS, x, y, 0);
|
||||
case NEWS_ITEM_AWARD:
|
||||
gfx_draw_sprite(dpi, SPR_AWARD, x, y);
|
||||
gfx_draw_sprite(dpi, SPR_AWARD, x, y, 0);
|
||||
case NEWS_ITEM_GRAPH:
|
||||
gfx_draw_sprite(dpi, SPR_GRAPH, x, y);
|
||||
gfx_draw_sprite(dpi, SPR_GRAPH, x, y, 0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,6 +51,28 @@ enum {
|
||||
WIDX_FASTFORWARD
|
||||
};
|
||||
|
||||
typedef enum {
|
||||
DDIDX_LOAD_GAME = 0,
|
||||
DDIDX_SAVE_GAME = 1,
|
||||
DDIDX_ABOUT = 3,
|
||||
DDIDX_OPTIONS = 4,
|
||||
DDIDX_SCREENSHOT = 5,
|
||||
DDIDX_QUIT_GAME = 7,
|
||||
} FILE_MENU_DDIDX;
|
||||
|
||||
typedef enum {
|
||||
DDIDX_UNDERGROUND_INSIDE = 0,
|
||||
DDIDX_HIDE_BASE = 1,
|
||||
DDIDX_HIDE_VERTICAL = 2,
|
||||
DDIDX_SEETHROUGH_RIDES = 4,
|
||||
DDIDX_SEETHROUGH_SCENARY = 5,
|
||||
DDIDX_INVISIBLE_SUPPORTS = 6,
|
||||
DDIDX_INVISIBLE_PEEPS = 7,
|
||||
DDIDX_LAND_HEIGHTS = 9,
|
||||
DDIDX_TRACK_HEIGHTS = 10,
|
||||
DDIDX_PATH_HEIGHTS = 11,
|
||||
} VIEW_MENU_DDIDX;
|
||||
|
||||
static rct_widget window_game_top_toolbar_widgets[] = {
|
||||
{ WWT_TRNBTN, 0, 0x0000, 0x001D, 0, 27, 0x20000000 | SPR_TOOLBAR_PAUSE, STR_PAUSE_GAME_TIP }, // Pause
|
||||
{ WWT_TRNBTN, 0, 0x001E + 30, 0x003B + 30, 0, 27, 0x20000000 | SPR_TOOLBAR_FILE, STR_DISC_AND_GAME_OPTIONS_TIP }, // File menu
|
||||
@@ -337,6 +359,8 @@ static void window_game_top_toolbar_mousedown(int widgetIndex, rct_window*w, rct
|
||||
gDropdownItemsChecked |= (1 << 10);
|
||||
if (mainViewport->flags & VIEWPORT_FLAG_PATH_HEIGHTS)
|
||||
gDropdownItemsChecked |= (1 << 11);
|
||||
|
||||
RCT2_GLOBAL(0x9DEBA2, uint16) = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -347,6 +371,7 @@ static void window_game_top_toolbar_mousedown(int widgetIndex, rct_window*w, rct
|
||||
static void window_game_top_toolbar_dropdown()
|
||||
{
|
||||
short widgetIndex, dropdownIndex;
|
||||
rct_window* w;
|
||||
|
||||
#ifdef _MSC_VER
|
||||
__asm mov widgetIndex, dx
|
||||
@@ -363,29 +388,67 @@ static void window_game_top_toolbar_dropdown()
|
||||
|
||||
if (widgetIndex == WIDX_FILE_MENU) {
|
||||
switch (dropdownIndex) {
|
||||
case 0: // load game
|
||||
case DDIDX_LOAD_GAME: // load game
|
||||
game_do_command(0, 1, 0, 0, GAME_COMMAND_LOAD_OR_QUIT, 0, 0);
|
||||
break;
|
||||
case 1: // save game
|
||||
case DDIDX_SAVE_GAME: // save game
|
||||
tool_cancel();
|
||||
save_game();
|
||||
break;
|
||||
case 3: // about
|
||||
case DDIDX_ABOUT: // about
|
||||
window_about_open();
|
||||
break;
|
||||
case 4: // options
|
||||
case DDIDX_OPTIONS: // options
|
||||
window_options_open();
|
||||
//RCT2_CALLPROC_EBPSAFE(0x006BAC5B);
|
||||
break;
|
||||
case 5: // screenshot
|
||||
case DDIDX_SCREENSHOT: // screenshot
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_SCREENSHOT_COUNTDOWN, sint8) = 10;
|
||||
break;
|
||||
case 7: // quit game
|
||||
case DDIDX_QUIT_GAME: // quit game
|
||||
game_do_command(0, 1, 0, 0, GAME_COMMAND_LOAD_OR_QUIT, 1, 0);
|
||||
break;
|
||||
}
|
||||
} else if (widgetIndex == WIDX_VIEW_MENU) {
|
||||
RCT2_CALLPROC_X(0x0066CF8A, dropdownIndex, 0, 0, 0, 0, 0, 0);
|
||||
if (dropdownIndex == -1) dropdownIndex = RCT2_GLOBAL(0x9DEBA2, uint16);
|
||||
w = window_get_main();
|
||||
if (w){
|
||||
switch (dropdownIndex){
|
||||
case DDIDX_UNDERGROUND_INSIDE:
|
||||
w->viewport->flags ^= VIEWPORT_FLAG_UNDERGROUND_INSIDE;
|
||||
break;
|
||||
case DDIDX_HIDE_BASE:
|
||||
w->viewport->flags ^= VIEWPORT_FLAG_HIDE_BASE;
|
||||
break;
|
||||
case DDIDX_HIDE_VERTICAL:
|
||||
w->viewport->flags ^= VIEWPORT_FLAG_HIDE_VERTICAL;
|
||||
break;
|
||||
case DDIDX_SEETHROUGH_RIDES:
|
||||
w->viewport->flags ^= VIEWPORT_FLAG_SEETHROUGH_RIDES;
|
||||
break;
|
||||
case DDIDX_SEETHROUGH_SCENARY:
|
||||
w->viewport->flags ^= VIEWPORT_FLAG_SEETHROUGH_SCENERY;
|
||||
break;
|
||||
case DDIDX_INVISIBLE_SUPPORTS:
|
||||
w->viewport->flags ^= VIEWPORT_FLAG_INVISIBLE_SUPPORTS;
|
||||
break;
|
||||
case DDIDX_INVISIBLE_PEEPS:
|
||||
w->viewport->flags ^= VIEWPORT_FLAG_INVISIBLE_PEEPS;
|
||||
break;
|
||||
case DDIDX_LAND_HEIGHTS:
|
||||
w->viewport->flags ^= VIEWPORT_FLAG_LAND_HEIGHTS;
|
||||
break;
|
||||
case DDIDX_TRACK_HEIGHTS:
|
||||
w->viewport->flags ^= VIEWPORT_FLAG_TRACK_HEIGHTS;
|
||||
break;
|
||||
case DDIDX_PATH_HEIGHTS:
|
||||
w->viewport->flags ^= VIEWPORT_FLAG_PATH_HEIGHTS;
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
RCT2_CALLPROC_X(0x6EB13A, 0, 0, 0, 0, (int)w, 0, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -495,5 +558,5 @@ static void window_game_top_toolbar_paint()
|
||||
if (widget_is_pressed(w, WIDX_STAFF))
|
||||
imgId++;
|
||||
imgId |= (RCT2_GLOBAL(RCT2_ADDRESS_HANDYMAN_COLOUR, uint8) << 19) | 0xA0000000 | (RCT2_GLOBAL(RCT2_ADDRESS_MECHANIC_COLOUR, uint8) << 24);
|
||||
gfx_draw_sprite(dpi, imgId, x, y);
|
||||
gfx_draw_sprite(dpi, imgId, x, y, 0);
|
||||
}
|
||||
@@ -608,7 +608,7 @@ static void window_guest_list_paint()
|
||||
dpi,
|
||||
i,
|
||||
(window_guest_list_widgets[WIDX_TAB_1].left + window_guest_list_widgets[WIDX_TAB_1].right) / 2 + w->x,
|
||||
window_guest_list_widgets[WIDX_TAB_1].bottom - 6 + w->y
|
||||
window_guest_list_widgets[WIDX_TAB_1].bottom - 6 + w->y, 0
|
||||
);
|
||||
|
||||
// Tab 2 image
|
||||
@@ -617,7 +617,7 @@ static void window_guest_list_paint()
|
||||
dpi,
|
||||
5568 + i,
|
||||
window_guest_list_widgets[WIDX_TAB_2].left + w->x,
|
||||
window_guest_list_widgets[WIDX_TAB_2].top + w->y
|
||||
window_guest_list_widgets[WIDX_TAB_2].top + w->y, 0
|
||||
);
|
||||
|
||||
// Filter description
|
||||
@@ -713,11 +713,11 @@ static void window_guest_list_scrollpaint()
|
||||
switch (_window_guest_list_selected_view) {
|
||||
case VIEW_ACTIONS:
|
||||
// Guest face
|
||||
gfx_draw_sprite(dpi, get_guest_face_sprite_small(peep), 118, y);
|
||||
gfx_draw_sprite(dpi, get_guest_face_sprite_small(peep), 118, y, 0);
|
||||
|
||||
// Tracking icon
|
||||
if (peep->flags & PEEP_FLAGS_TRACKING)
|
||||
gfx_draw_sprite(dpi, 5129, 112, y);
|
||||
gfx_draw_sprite(dpi, 5129, 112, y, 0);
|
||||
|
||||
// Action
|
||||
|
||||
@@ -775,7 +775,7 @@ static void window_guest_list_scrollpaint()
|
||||
// Draw guest faces
|
||||
numGuests = _window_guest_list_groups_num_guests[i];
|
||||
for (j = 0; j < 56 && j < numGuests; j++)
|
||||
gfx_draw_sprite(dpi, _window_guest_list_groups_guest_faces[i * 56 + j] + 5486, j * 8, y + 9);
|
||||
gfx_draw_sprite(dpi, _window_guest_list_groups_guest_faces[i * 56 + j] + 5486, j * 8, y + 9, 0);
|
||||
|
||||
// Draw action
|
||||
RCT2_GLOBAL(0x013CE952, uint32) = _window_guest_list_groups_argument_1[i];
|
||||
|
||||
+4
-4
@@ -427,7 +427,7 @@ static void window_map_paint()
|
||||
|
||||
gfx_draw_sprite(dpi, image_id,
|
||||
w->x + w->widgets[WIDX_PEOPLE_TAB].left,
|
||||
w->y + w->widgets[WIDX_PEOPLE_TAB].top);
|
||||
w->y + w->widgets[WIDX_PEOPLE_TAB].top, 0);
|
||||
|
||||
// ride/stall tab image (animated)
|
||||
image_id = SPR_TAB_RIDE_0;
|
||||
@@ -436,13 +436,13 @@ static void window_map_paint()
|
||||
|
||||
gfx_draw_sprite(dpi, image_id,
|
||||
w->x + w->widgets[WIDX_RIDES_TAB].left,
|
||||
w->y + w->widgets[WIDX_RIDES_TAB].top);
|
||||
w->y + w->widgets[WIDX_RIDES_TAB].top, 0);
|
||||
|
||||
// people starting position (scenario editor only)
|
||||
if (w->widgets[WIDX_PEOPLE_STARTING_POSITION].type != 0) {
|
||||
gfx_draw_sprite(dpi, 0x0B6E0190A,
|
||||
w->x + w->widgets[WIDX_PEOPLE_STARTING_POSITION].left + 12,
|
||||
w->y + w->widgets[WIDX_PEOPLE_STARTING_POSITION].top + 18);
|
||||
w->y + w->widgets[WIDX_PEOPLE_STARTING_POSITION].top + 18, 0);
|
||||
}
|
||||
|
||||
if (!(RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & SCREEN_FLAGS_SCENARIO_EDITOR)) {
|
||||
@@ -507,7 +507,7 @@ static void window_map_scrollpaint()
|
||||
g1_element->y_offset = 0xFFF8;
|
||||
g1_element->flags = 0;
|
||||
|
||||
gfx_draw_sprite(dpi, 0, 0, 0);
|
||||
gfx_draw_sprite(dpi, 0, 0, 0, 0);
|
||||
|
||||
*g1_element = pushed_g1_element;
|
||||
|
||||
|
||||
@@ -0,0 +1,419 @@
|
||||
/*****************************************************************************
|
||||
* Copyright (c) 2014 Ted John, Peter Hill, Duncan Frost
|
||||
* OpenRCT2, an open source clone of Roller Coaster Tycoon 2.
|
||||
*
|
||||
* This file is part of OpenRCT2.
|
||||
*
|
||||
* OpenRCT2 is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*****************************************************************************/
|
||||
|
||||
#include <string.h>
|
||||
#include "addresses.h"
|
||||
#include "game.h"
|
||||
#include "marketing.h"
|
||||
#include "ride.h"
|
||||
#include "string_ids.h"
|
||||
#include "widget.h"
|
||||
#include "window.h"
|
||||
#include "window_dropdown.h"
|
||||
|
||||
#define SELECTED_RIDE_UNDEFINED ((sint16)0xFFFF)
|
||||
|
||||
enum WINDOW_NEW_CAMPAIGN_WIDGET_IDX {
|
||||
WIDX_BACKGROUND,
|
||||
WIDX_TITLE,
|
||||
WIDX_CLOSE,
|
||||
WIDX_RIDE_LABEL,
|
||||
WIDX_RIDE_DROPDOWN,
|
||||
WIDX_RIDE_DROPDOWN_BUTTON,
|
||||
WIDX_WEEKS_LABEL,
|
||||
WIDX_WEEKS_SPINNER,
|
||||
WIDX_WEEKS_INCREASE_BUTTON,
|
||||
WIDX_WEEKS_DECREASE_BUTTON,
|
||||
WIDX_START_BUTTON
|
||||
};
|
||||
|
||||
static rct_widget window_new_campaign_widgets[] = {
|
||||
{ WWT_FRAME, 0, 0, 349, 0, 106, 0xFFFFFFFF, STR_NONE }, // panel / background
|
||||
{ WWT_CAPTION, 0, 1, 348, 1, 14, 0, STR_WINDOW_TITLE_TIP }, // title bar
|
||||
{ WWT_CLOSEBOX, 0, 337, 347, 2, 13, STR_CLOSE_X, STR_CLOSE_WINDOW_TIP }, // close x button
|
||||
{ WWT_24, 0, 0, 139, 24, 35, 0, STR_NONE }, // ride label
|
||||
{ WWT_DROPDOWN, 0, 100, 341, 24, 35, 0, STR_NONE }, // ride dropdown
|
||||
{ WWT_DROPDOWN_BUTTON, 0, 330, 340, 25, 34, 876, STR_NONE }, // ride dropdown button
|
||||
{ WWT_24, 0, 0, 139, 41, 52, STR_LENGTH_OF_TIME, STR_NONE }, // weeks label
|
||||
{ WWT_SPINNER, 0, 120, 219, 41, 52, 0, STR_NONE }, // weeks
|
||||
{ WWT_DROPDOWN_BUTTON, 0, 208, 218, 42, 46, STR_NUMERIC_UP, STR_NONE }, // weeks +
|
||||
{ WWT_DROPDOWN_BUTTON, 0, 208, 218, 47, 51, STR_NUMERIC_DOWN, STR_NONE }, // weeks -
|
||||
{ WWT_DROPDOWN_BUTTON, 0, 14, 335, 89, 100, STR_MARKETING_START_THIS_MARKETING_CAMPAIGN, STR_NONE }, // start button
|
||||
{ WIDGETS_END }
|
||||
};
|
||||
|
||||
|
||||
static void window_new_campaign_emptysub() { }
|
||||
static void window_new_campaign_mouseup();
|
||||
static void window_new_campaign_mousedown(int widgetIndex, rct_window*w, rct_widget* widget);
|
||||
static void window_new_campaign_dropdown();
|
||||
static void window_new_campaign_invalidate();
|
||||
static void window_new_campaign_paint();
|
||||
|
||||
static void* window_new_campaign_events[] = {
|
||||
window_new_campaign_emptysub,
|
||||
window_new_campaign_mouseup,
|
||||
window_new_campaign_emptysub,
|
||||
window_new_campaign_mousedown,
|
||||
window_new_campaign_dropdown,
|
||||
window_new_campaign_emptysub,
|
||||
window_new_campaign_emptysub,
|
||||
window_new_campaign_emptysub,
|
||||
window_new_campaign_emptysub,
|
||||
window_new_campaign_emptysub,
|
||||
window_new_campaign_emptysub,
|
||||
window_new_campaign_emptysub,
|
||||
window_new_campaign_emptysub,
|
||||
window_new_campaign_emptysub,
|
||||
window_new_campaign_emptysub,
|
||||
window_new_campaign_emptysub,
|
||||
window_new_campaign_emptysub,
|
||||
window_new_campaign_emptysub,
|
||||
window_new_campaign_emptysub,
|
||||
window_new_campaign_emptysub,
|
||||
window_new_campaign_emptysub,
|
||||
window_new_campaign_emptysub,
|
||||
window_new_campaign_emptysub,
|
||||
window_new_campaign_emptysub,
|
||||
window_new_campaign_emptysub,
|
||||
window_new_campaign_invalidate,
|
||||
window_new_campaign_paint,
|
||||
window_new_campaign_emptysub
|
||||
};
|
||||
|
||||
uint8 window_new_campaign_rides[MAX_RIDES];
|
||||
uint8 window_new_campaign_shop_items[64];
|
||||
|
||||
int ride_reliability_compare(const void *a, const void *b)
|
||||
{
|
||||
rct_ride *rideA, *rideB;
|
||||
|
||||
rideA = GET_RIDE(*((uint8*)a));
|
||||
rideB = GET_RIDE(*((uint8*)b));
|
||||
return rideB->reliability - rideA->reliability;
|
||||
}
|
||||
|
||||
int ride_name_compare(const void *a, const void *b)
|
||||
{
|
||||
char rideAName[256], rideBName[256];
|
||||
rct_ride *rideA, *rideB;
|
||||
|
||||
rideA = GET_RIDE(*((uint8*)a));
|
||||
rideB = GET_RIDE(*((uint8*)b));
|
||||
|
||||
format_string(rideAName, rideA->var_04A, &rideA->var_04C);
|
||||
format_string(rideBName, rideB->var_04A, &rideB->var_04C);
|
||||
|
||||
return _strcmpi(rideAName, rideBName);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* rct2: 0x0069E16F
|
||||
*/
|
||||
void window_new_campaign_open(int campaignType)
|
||||
{
|
||||
// RCT2_CALLPROC_X(0x0069E16F, campaignType, 0, 0, 0, 0, 0, 0);
|
||||
|
||||
rct_window *w;
|
||||
rct_ride *ride;
|
||||
int i, numApplicableRides;
|
||||
|
||||
w = window_bring_to_front_by_id(WC_NEW_CAMPAIGN, 0);
|
||||
if (w != NULL) {
|
||||
if (w->var_480 == campaignType)
|
||||
return;
|
||||
|
||||
window_close(w);
|
||||
}
|
||||
|
||||
w = window_create_auto_pos(350, 107, (uint32*)window_new_campaign_events, WC_NEW_CAMPAIGN, 0);
|
||||
w->widgets = window_new_campaign_widgets;
|
||||
w->enabled_widgets =
|
||||
(1 << WIDX_CLOSE) |
|
||||
(1 << WIDX_RIDE_DROPDOWN) |
|
||||
(1 << WIDX_RIDE_DROPDOWN_BUTTON) |
|
||||
(1 << WIDX_WEEKS_INCREASE_BUTTON) |
|
||||
(1 << WIDX_WEEKS_DECREASE_BUTTON) |
|
||||
(1 << WIDX_START_BUTTON);
|
||||
w->var_020 = 0x300;
|
||||
window_init_scroll_widgets(w);
|
||||
w->colours[0] = 19;
|
||||
w->colours[1] = 19;
|
||||
w->colours[2] = 19;
|
||||
|
||||
window_new_campaign_widgets[WIDX_TITLE].image = STR_MARKETING_VOUCHERS_FOR_FREE_ENTRY_TO_THE_PARK + campaignType;
|
||||
|
||||
// Campaign type
|
||||
w->var_480 = campaignType;
|
||||
|
||||
// Number of weeks
|
||||
w->var_482 = 2;
|
||||
|
||||
// Currently selected ride
|
||||
w->var_484 = SELECTED_RIDE_UNDEFINED;
|
||||
|
||||
// Get all applicable rides
|
||||
numApplicableRides = 0;
|
||||
window_new_campaign_rides[0] = 255;
|
||||
FOR_ALL_RIDES(i, ride) {
|
||||
if (!(RCT2_GLOBAL(0x0097CF40 + (ride->type * 8), uint32) & 0x03820000))
|
||||
window_new_campaign_rides[numApplicableRides++] = i;
|
||||
}
|
||||
window_new_campaign_rides[numApplicableRides] = 255;
|
||||
|
||||
// Take top 40 most reliable rides
|
||||
if (numApplicableRides > 40) {
|
||||
qsort(window_new_campaign_rides, countof(window_new_campaign_rides), sizeof(uint8), ride_reliability_compare);
|
||||
numApplicableRides = 40;
|
||||
}
|
||||
|
||||
// Sort rides by name
|
||||
qsort(window_new_campaign_rides, numApplicableRides, sizeof(uint8), ride_name_compare);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* rct2: 0x0069E320
|
||||
*/
|
||||
static void window_new_campaign_get_shop_items()
|
||||
{
|
||||
int i, numItems;
|
||||
rct_ride *ride;
|
||||
|
||||
uint64 items = 0;
|
||||
FOR_ALL_RIDES(i, ride) {
|
||||
uint8 *rideTypeInfo = RCT2_ADDRESS(0x009ACFA4, void*)[ride->subtype];
|
||||
uint8 itemType = RCT2_GLOBAL(rideTypeInfo + 0x1C0, uint8);
|
||||
if (itemType != 255)
|
||||
items |= 1LL << itemType;
|
||||
}
|
||||
|
||||
// Remove certain items?
|
||||
items &= 0x0011FF78036BA3E0;
|
||||
|
||||
//
|
||||
numItems = 0;
|
||||
for (i = 0; i < 64; i++)
|
||||
if (items & (1LL << i))
|
||||
window_new_campaign_shop_items[numItems++] = i;
|
||||
window_new_campaign_shop_items[numItems] = 255;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* rct2: 0x0069E50B
|
||||
*/
|
||||
static void window_new_campaign_mouseup()
|
||||
{
|
||||
rct_window *w;
|
||||
short widgetIndex;
|
||||
|
||||
window_mouse_up_get_registers(w, widgetIndex);
|
||||
|
||||
switch (widgetIndex) {
|
||||
case WIDX_CLOSE:
|
||||
window_close(w);
|
||||
break;
|
||||
case WIDX_START_BUTTON:
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_GAME_COMMAND_ERROR_TITLE, uint16) = STR_CANT_START_MARKETING_CAMPAIGN;
|
||||
game_do_command(0, (w->var_482 << 8) | 1, 0, (w->var_484 << 8) | w->var_480, GAME_COMMAND_START_MARKETING_CAMPAIGN, 0, 0);
|
||||
window_close(w);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* rct2: 0x0069E51C
|
||||
*/
|
||||
static void window_new_campaign_mousedown(int widgetIndex, rct_window *w, rct_widget* widget)
|
||||
{
|
||||
rct_widget *dropdownWidget;
|
||||
|
||||
switch (widgetIndex) {
|
||||
case WIDX_RIDE_DROPDOWN_BUTTON:
|
||||
dropdownWidget = widget - 1;
|
||||
|
||||
if (w->var_480 == ADVERTISING_CAMPAIGN_FOOD_OR_DRINK_FREE) {
|
||||
window_new_campaign_get_shop_items();
|
||||
if (window_new_campaign_shop_items[0] != 255) {
|
||||
int numItems = 0;
|
||||
for (int i = 0; i < 40; i++) {
|
||||
if (window_new_campaign_shop_items[i] == 255)
|
||||
break;
|
||||
|
||||
rct_string_id itemStringId = window_new_campaign_shop_items[i] + 2016;
|
||||
if (itemStringId >= 2048)
|
||||
itemStringId += 96;
|
||||
|
||||
gDropdownItemsFormat[i] = 1142;
|
||||
gDropdownItemsArgs[i] = itemStringId;
|
||||
numItems++;
|
||||
}
|
||||
|
||||
window_dropdown_show_text_custom_width(
|
||||
w->x + dropdownWidget->left,
|
||||
w->y + dropdownWidget->top,
|
||||
dropdownWidget->bottom - dropdownWidget->top + 1,
|
||||
w->colours[1],
|
||||
0x80,
|
||||
numItems,
|
||||
dropdownWidget->right - dropdownWidget->left - 3
|
||||
);
|
||||
}
|
||||
} else {
|
||||
if (window_new_campaign_rides[0] != 255) {
|
||||
int numItems = 0;
|
||||
for (int i = 0; i < 40; i++) {
|
||||
if (window_new_campaign_rides[i] == 255)
|
||||
break;
|
||||
|
||||
rct_ride *ride = GET_RIDE(window_new_campaign_rides[i]);
|
||||
gDropdownItemsFormat[i] = 1142;
|
||||
gDropdownItemsArgs[i] = (ride->var_04C << 16) | ride->var_04A;
|
||||
numItems++;
|
||||
}
|
||||
|
||||
window_dropdown_show_text_custom_width(
|
||||
w->x + dropdownWidget->left,
|
||||
w->y + dropdownWidget->top,
|
||||
dropdownWidget->bottom - dropdownWidget->top + 1,
|
||||
w->colours[1],
|
||||
0x80,
|
||||
numItems,
|
||||
dropdownWidget->right - dropdownWidget->left - 3
|
||||
);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case WIDX_WEEKS_INCREASE_BUTTON:
|
||||
w->var_482 = min(w->var_482 + 1, 6);
|
||||
window_invalidate(w);
|
||||
break;
|
||||
case WIDX_WEEKS_DECREASE_BUTTON:
|
||||
w->var_482 = max(w->var_482 - 1, 2);
|
||||
window_invalidate(w);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* rct2: 0x0069E537
|
||||
*/
|
||||
static void window_new_campaign_dropdown()
|
||||
{
|
||||
rct_window *w;
|
||||
short widgetIndex, dropdownIndex;
|
||||
|
||||
window_dropdown_get_registers(w, widgetIndex, dropdownIndex);
|
||||
|
||||
if (widgetIndex != WIDX_RIDE_DROPDOWN_BUTTON)
|
||||
return;
|
||||
|
||||
if (w->var_480 == ADVERTISING_CAMPAIGN_FOOD_OR_DRINK_FREE) {
|
||||
rct_string_id itemStringId = (uint16)gDropdownItemsArgs[dropdownIndex] - 2016;
|
||||
if (itemStringId >= 32)
|
||||
itemStringId -= 96;
|
||||
w->var_484 = itemStringId;
|
||||
} else {
|
||||
w->var_484 = window_new_campaign_rides[dropdownIndex];
|
||||
}
|
||||
|
||||
window_invalidate(w);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* rct2: 0x0069E397
|
||||
*/
|
||||
static void window_new_campaign_invalidate()
|
||||
{
|
||||
rct_window *w;
|
||||
|
||||
window_get_register(w);
|
||||
|
||||
window_new_campaign_widgets[WIDX_RIDE_LABEL].type = WWT_EMPTY;
|
||||
window_new_campaign_widgets[WIDX_RIDE_DROPDOWN].type = WWT_EMPTY;
|
||||
window_new_campaign_widgets[WIDX_RIDE_DROPDOWN_BUTTON].type = WWT_EMPTY;
|
||||
window_new_campaign_widgets[WIDX_RIDE_DROPDOWN].image = STR_MARKETING_NOT_SELECTED;
|
||||
switch (w->var_480) {
|
||||
case ADVERTISING_CAMPAIGN_RIDE_FREE:
|
||||
case ADVERTISING_CAMPAIGN_RIDE:
|
||||
window_new_campaign_widgets[WIDX_RIDE_LABEL].type = WWT_24;
|
||||
window_new_campaign_widgets[WIDX_RIDE_DROPDOWN].type = WWT_DROPDOWN;
|
||||
window_new_campaign_widgets[WIDX_RIDE_DROPDOWN_BUTTON].type = WWT_DROPDOWN_BUTTON;
|
||||
window_new_campaign_widgets[WIDX_RIDE_LABEL].image = STR_MARKETING_RIDE;
|
||||
if (w->var_484 != SELECTED_RIDE_UNDEFINED) {
|
||||
rct_ride *ride = GET_RIDE(w->var_484);
|
||||
window_new_campaign_widgets[WIDX_RIDE_DROPDOWN].image = ride->var_04A;
|
||||
RCT2_GLOBAL(0x013CE952, uint32) = ride->var_04C;
|
||||
}
|
||||
break;
|
||||
case ADVERTISING_CAMPAIGN_FOOD_OR_DRINK_FREE:
|
||||
window_new_campaign_widgets[WIDX_RIDE_LABEL].type = WWT_24;
|
||||
window_new_campaign_widgets[WIDX_RIDE_DROPDOWN].type = WWT_DROPDOWN;
|
||||
window_new_campaign_widgets[WIDX_RIDE_DROPDOWN_BUTTON].type = WWT_DROPDOWN_BUTTON;
|
||||
window_new_campaign_widgets[WIDX_RIDE_LABEL].image = STR_MARKETING_ITEM;
|
||||
if (w->var_484 != SELECTED_RIDE_UNDEFINED) {
|
||||
rct_string_id itemStringId = w->var_484 + 2016;
|
||||
if (itemStringId >= 2048)
|
||||
itemStringId += 96;
|
||||
window_new_campaign_widgets[WIDX_RIDE_DROPDOWN].image = itemStringId;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
// Set current number of weeks spinner
|
||||
window_new_campaign_widgets[WIDX_WEEKS_SPINNER].image = (STR_MARKETING_1_WEEK - 1) + w->var_482;
|
||||
|
||||
// Enable / disable start button based on ride dropdown
|
||||
w->disabled_widgets &= ~(1 << WIDX_START_BUTTON);
|
||||
if (window_new_campaign_widgets[WIDX_RIDE_DROPDOWN].type == WWT_DROPDOWN && w->var_484 == SELECTED_RIDE_UNDEFINED)
|
||||
w->disabled_widgets |= 1 << WIDX_START_BUTTON;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* rct2: 0x0069E493
|
||||
*/
|
||||
static void window_new_campaign_paint()
|
||||
{
|
||||
rct_window *w;
|
||||
rct_drawpixelinfo *dpi;
|
||||
int x, y;
|
||||
|
||||
window_paint_get_registers(w, dpi);
|
||||
|
||||
window_draw_widgets(w, dpi);
|
||||
|
||||
x = w->x + 14;
|
||||
y = w->y + 60;
|
||||
|
||||
// Price per week
|
||||
money32 pricePerWeek = AdvertisingCampaignPricePerWeek[w->var_480];
|
||||
gfx_draw_string_left(dpi, STR_MARKETING_COST_PER_WEEK, &pricePerWeek, 0, x, y);
|
||||
y += 13;
|
||||
|
||||
// Total price
|
||||
money32 totalPrice = AdvertisingCampaignPricePerWeek[w->var_480] * w->var_482;
|
||||
gfx_draw_string_left(dpi, STR_MARKETING_TOTAL_COST, &totalPrice, 0, x, y);
|
||||
}
|
||||
+7
-7
@@ -385,7 +385,7 @@ static void window_news_scrollpaint()
|
||||
|
||||
switch (newsItem->type) {
|
||||
case NEWS_ITEM_RIDE:
|
||||
gfx_draw_sprite(dpi, SPR_RIDE, x, yy);
|
||||
gfx_draw_sprite(dpi, SPR_RIDE, x, yy, 0);
|
||||
break;
|
||||
case NEWS_ITEM_PEEP_ON_RIDE:
|
||||
// TODO
|
||||
@@ -394,19 +394,19 @@ static void window_news_scrollpaint()
|
||||
// TODO
|
||||
break;
|
||||
case NEWS_ITEM_MONEY:
|
||||
gfx_draw_sprite(dpi, SPR_FINANCE, x, yy);
|
||||
gfx_draw_sprite(dpi, SPR_FINANCE, x, yy, 0);
|
||||
break;
|
||||
case NEWS_ITEM_RESEARCH:
|
||||
gfx_draw_sprite(dpi, newsItem->assoc < 0x10000 ? SPR_NEW_RIDE : SPR_SCENERY, x, yy);
|
||||
gfx_draw_sprite(dpi, newsItem->assoc < 0x10000 ? SPR_NEW_RIDE : SPR_SCENERY, x, yy, 0);
|
||||
break;
|
||||
case NEWS_ITEM_PEEPS:
|
||||
gfx_draw_sprite(dpi, SPR_GUESTS, x, yy);
|
||||
gfx_draw_sprite(dpi, SPR_GUESTS, x, yy, 0);
|
||||
break;
|
||||
case NEWS_ITEM_AWARD:
|
||||
gfx_draw_sprite(dpi, SPR_AWARD, x, yy);
|
||||
gfx_draw_sprite(dpi, SPR_AWARD, x, yy, 0);
|
||||
break;
|
||||
case NEWS_ITEM_GRAPH:
|
||||
gfx_draw_sprite(dpi, SPR_GRAPH, x, yy);
|
||||
gfx_draw_sprite(dpi, SPR_GRAPH, x, yy, 0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -423,7 +423,7 @@ static void window_news_scrollpaint()
|
||||
press = 0x20;
|
||||
}
|
||||
gfx_fill_rect_inset(dpi, x, yy, x + 23, yy + 23, w->colours[2], press);
|
||||
gfx_draw_sprite(dpi, SPR_LOCATE, x, yy);
|
||||
gfx_draw_sprite(dpi, SPR_LOCATE, x, yy, 0);
|
||||
}
|
||||
|
||||
y += 42;
|
||||
|
||||
+15
-90
@@ -24,6 +24,7 @@
|
||||
#include "config.h"
|
||||
#include "date.h"
|
||||
#include "game.h"
|
||||
#include "graph.h"
|
||||
#include "park.h"
|
||||
#include "peep.h"
|
||||
#include "ride.h"
|
||||
@@ -579,9 +580,6 @@ static void window_park_anchor_border_widgets(rct_window *w);
|
||||
static void window_park_align_tabs(rct_window *w);
|
||||
static void window_park_set_pressed_tab(rct_window *w);
|
||||
static void window_park_draw_tab_images(rct_drawpixelinfo *dpi, rct_window *w);
|
||||
static void window_park_graph_draw_months(rct_drawpixelinfo *dpi, uint8 *history, int baseX, int baseY);
|
||||
static void window_park_graph_draw_line_a(rct_drawpixelinfo *dpi, uint8 *history, int baseX, int baseY);
|
||||
static void window_park_graph_draw_line_b(rct_drawpixelinfo *dpi, uint8 *history, int baseX, int baseY);
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -1090,7 +1088,7 @@ static void window_park_entrance_paint()
|
||||
if (w->viewport != NULL) {
|
||||
window_draw_viewport(dpi, w);
|
||||
if (w->viewport->flags & VIEWPORT_FLAG_SOUND_ON)
|
||||
gfx_draw_sprite(dpi, SPR_HEARING_VIEWPORT, w->x + 2, w->y + 2);
|
||||
gfx_draw_sprite(dpi, SPR_HEARING_VIEWPORT, w->x + 2, w->y + 2, 0);
|
||||
}
|
||||
|
||||
// Draw park closed / open label
|
||||
@@ -1369,9 +1367,7 @@ static void window_park_rating_paint()
|
||||
y += widget->top + 26;
|
||||
|
||||
history = RCT2_ADDRESS(RCT2_ADDRESS_PARK_RATING_HISTORY, uint8);
|
||||
window_park_graph_draw_months(dpi, history, x, y);
|
||||
window_park_graph_draw_line_a(dpi, history, x, y);
|
||||
window_park_graph_draw_line_b(dpi, history, x, y);
|
||||
graph_draw_uint8(dpi, history, 32, x, y);
|
||||
}
|
||||
|
||||
#pragma endregion
|
||||
@@ -1538,9 +1534,7 @@ static void window_park_guests_paint()
|
||||
y += widget->top + 26;
|
||||
|
||||
history = RCT2_ADDRESS(RCT2_ADDRESS_GUESTS_IN_PARK_HISTORY, uint8);
|
||||
window_park_graph_draw_months(dpi, history, x, y);
|
||||
window_park_graph_draw_line_a(dpi, history, x, y);
|
||||
window_park_graph_draw_line_b(dpi, history, x, y);
|
||||
graph_draw_uint8(dpi, history, 32, x, y);
|
||||
}
|
||||
|
||||
#pragma endregion
|
||||
@@ -2229,7 +2223,7 @@ static void window_park_awards_paint()
|
||||
if (award->time == 0)
|
||||
continue;
|
||||
|
||||
gfx_draw_sprite(dpi, SPR_AWARD_MOST_UNTIDY + award->type, x, y);
|
||||
gfx_draw_sprite(dpi, SPR_AWARD_MOST_UNTIDY + award->type, x, y, 0);
|
||||
gfx_draw_string_left_wrapped(dpi, NULL, x + 34, y + 6, 180, STR_AWARD_MOST_UNTIDY + award->type, 0);
|
||||
|
||||
y += 32;
|
||||
@@ -2322,16 +2316,16 @@ static void window_park_draw_tab_images(rct_drawpixelinfo *dpi, rct_window *w)
|
||||
|
||||
// Entrance tab
|
||||
if (!(w->disabled_widgets & (1 << WIDX_TAB_1)))
|
||||
gfx_draw_sprite(dpi, 5200, w->x + w->widgets[WIDX_TAB_1].left, w->y + w->widgets[WIDX_TAB_1].top);
|
||||
gfx_draw_sprite(dpi, 5200, w->x + w->widgets[WIDX_TAB_1].left, w->y + w->widgets[WIDX_TAB_1].top, 0);
|
||||
|
||||
// Rating tab
|
||||
if (!(w->disabled_widgets & (1 << WIDX_TAB_2))) {
|
||||
sprite_idx = SPR_TAB_GRAPH_0;
|
||||
if (w->page == WINDOW_PARK_PAGE_RATING)
|
||||
sprite_idx += (w->frame_no / 8) % 8;
|
||||
gfx_draw_sprite(dpi, sprite_idx, w->x + w->widgets[WIDX_TAB_2].left, w->y + w->widgets[WIDX_TAB_2].top);
|
||||
gfx_draw_sprite(dpi, SPR_RATING_HIGH, w->x + w->widgets[WIDX_TAB_2].left + 7, w->y + w->widgets[WIDX_TAB_2].top + 1);
|
||||
gfx_draw_sprite(dpi, SPR_RATING_LOW, w->x + w->widgets[WIDX_TAB_2].left + 16, w->y + w->widgets[WIDX_TAB_2].top + 12);
|
||||
gfx_draw_sprite(dpi, sprite_idx, w->x + w->widgets[WIDX_TAB_2].left, w->y + w->widgets[WIDX_TAB_2].top, 0);
|
||||
gfx_draw_sprite(dpi, SPR_RATING_HIGH, w->x + w->widgets[WIDX_TAB_2].left + 7, w->y + w->widgets[WIDX_TAB_2].top + 1, 0);
|
||||
gfx_draw_sprite(dpi, SPR_RATING_LOW, w->x + w->widgets[WIDX_TAB_2].left + 16, w->y + w->widgets[WIDX_TAB_2].top + 12, 0);
|
||||
}
|
||||
|
||||
// Guests tab
|
||||
@@ -2339,7 +2333,7 @@ static void window_park_draw_tab_images(rct_drawpixelinfo *dpi, rct_window *w)
|
||||
sprite_idx = SPR_TAB_GRAPH_0;
|
||||
if (w->page == WINDOW_PARK_PAGE_GUESTS)
|
||||
sprite_idx += (w->frame_no / 8) % 8;
|
||||
gfx_draw_sprite(dpi, sprite_idx, w->x + w->widgets[WIDX_TAB_3].left, w->y + w->widgets[WIDX_TAB_3].top);
|
||||
gfx_draw_sprite(dpi, sprite_idx, w->x + w->widgets[WIDX_TAB_3].left, w->y + w->widgets[WIDX_TAB_3].top, 0);
|
||||
|
||||
sprite_idx = *RCT2_GLOBAL(0x00982708, sint32*) + 1;
|
||||
if (w->page == WINDOW_PARK_PAGE_GUESTS)
|
||||
@@ -2350,7 +2344,7 @@ static void window_park_draw_tab_images(rct_drawpixelinfo *dpi, rct_window *w)
|
||||
dpi,
|
||||
sprite_idx,
|
||||
w->x + (w->widgets[WIDX_TAB_3].left + w->widgets[WIDX_TAB_3].right) / 2,
|
||||
w->y + w->widgets[WIDX_TAB_3].bottom - 9
|
||||
w->y + w->widgets[WIDX_TAB_3].bottom - 9, 0
|
||||
);
|
||||
}
|
||||
|
||||
@@ -2359,7 +2353,7 @@ static void window_park_draw_tab_images(rct_drawpixelinfo *dpi, rct_window *w)
|
||||
sprite_idx = SPR_TAB_ADMISSION_0;
|
||||
if (w->page == WINDOW_PARK_PAGE_PRICE)
|
||||
sprite_idx += (w->frame_no / 2) % 8;
|
||||
gfx_draw_sprite(dpi, sprite_idx, w->x + w->widgets[WIDX_TAB_4].left, w->y + w->widgets[WIDX_TAB_4].top);
|
||||
gfx_draw_sprite(dpi, sprite_idx, w->x + w->widgets[WIDX_TAB_4].left, w->y + w->widgets[WIDX_TAB_4].top, 0);
|
||||
}
|
||||
|
||||
// Statistics tab
|
||||
@@ -2367,7 +2361,7 @@ static void window_park_draw_tab_images(rct_drawpixelinfo *dpi, rct_window *w)
|
||||
sprite_idx = SPR_TAB_STATS_0;
|
||||
if (w->page == WINDOW_PARK_PAGE_STATS)
|
||||
sprite_idx += (w->frame_no / 4) % 7;
|
||||
gfx_draw_sprite(dpi, sprite_idx, w->x + w->widgets[WIDX_TAB_5].left, w->y + w->widgets[WIDX_TAB_5].top);
|
||||
gfx_draw_sprite(dpi, sprite_idx, w->x + w->widgets[WIDX_TAB_5].left, w->y + w->widgets[WIDX_TAB_5].top, 0);
|
||||
}
|
||||
|
||||
// Objective tab
|
||||
@@ -2375,81 +2369,12 @@ static void window_park_draw_tab_images(rct_drawpixelinfo *dpi, rct_window *w)
|
||||
sprite_idx = SPR_TAB_OBJECTIVE_0;
|
||||
if (w->page == WINDOW_PARK_PAGE_OBJECTIVE)
|
||||
sprite_idx += (w->frame_no / 4) % 16;
|
||||
gfx_draw_sprite(dpi, sprite_idx, w->x + w->widgets[WIDX_TAB_6].left, w->y + w->widgets[WIDX_TAB_6].top);
|
||||
gfx_draw_sprite(dpi, sprite_idx, w->x + w->widgets[WIDX_TAB_6].left, w->y + w->widgets[WIDX_TAB_6].top, 0);
|
||||
}
|
||||
|
||||
// Awards tab
|
||||
if (!(w->disabled_widgets & (1 << WIDX_TAB_7)))
|
||||
gfx_draw_sprite(dpi, SPR_TAB_AWARDS, w->x + w->widgets[WIDX_TAB_7].left, w->y + w->widgets[WIDX_TAB_7].top);
|
||||
}
|
||||
|
||||
static void window_park_graph_draw_months(rct_drawpixelinfo *dpi, uint8 *history, int baseX, int baseY)
|
||||
{
|
||||
int i, x, y, yearOver32, currentMonth, currentDay;
|
||||
|
||||
currentMonth = date_get_month(RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_MONTH_YEAR, uint16));
|
||||
currentDay = RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_MONTH_TICKS, uint16);
|
||||
yearOver32 = (currentMonth * 4) + (currentDay >> 14) - 31;
|
||||
x = baseX;
|
||||
y = baseY;
|
||||
for (i = 31; i >= 0; i--) {
|
||||
if (history[i] != 0 && history[i] != 255 && yearOver32 % 4 == 0) {
|
||||
// Draw month text
|
||||
RCT2_GLOBAL(0x013CE952, uint32) = ((yearOver32 / 4) + 8) % 8 + STR_MONTH_SHORT_MAR;
|
||||
gfx_draw_string_centred(dpi, 2222, x, y - 10, 0, (void*)0x013CE952);
|
||||
|
||||
// Draw month mark
|
||||
gfx_fill_rect(dpi, x, y, x, y + 3, 10);
|
||||
}
|
||||
|
||||
yearOver32 = (yearOver32 + 1) % 32;
|
||||
x += 6;
|
||||
}
|
||||
}
|
||||
|
||||
static void window_park_graph_draw_line_a(rct_drawpixelinfo *dpi, uint8 *history, int baseX, int baseY)
|
||||
{
|
||||
int i, x, y, lastX, lastY;
|
||||
lastX = -1;
|
||||
x = baseX;
|
||||
for (i = 31; i >= 0; i--) {
|
||||
if (history[i] != 0 && history[i] != 255) {
|
||||
y = baseY + (history[i] * 100) / 256;
|
||||
|
||||
if (lastX != -1) {
|
||||
gfx_draw_line(dpi, lastX + 1, lastY + 1, x + 1, y + 1, 10);
|
||||
gfx_draw_line(dpi, lastX, lastY + 1, x, y + 1, 10);
|
||||
}
|
||||
if (i == 0)
|
||||
gfx_fill_rect(dpi, x, y, x + 2, y + 2, 10);
|
||||
|
||||
lastX = x;
|
||||
lastY = y;
|
||||
}
|
||||
x += 6;
|
||||
}
|
||||
}
|
||||
|
||||
static void window_park_graph_draw_line_b(rct_drawpixelinfo *dpi, uint8 *history, int baseX, int baseY)
|
||||
{
|
||||
int i, x, y, lastX, lastY;
|
||||
|
||||
lastX = -1;
|
||||
x = baseX;
|
||||
for (i = 31; i >= 0; i--) {
|
||||
if (history[i] != 0 && history[i] != 255) {
|
||||
y = baseY + (history[i] * 100) / 256;
|
||||
|
||||
if (lastX != -1)
|
||||
gfx_draw_line(dpi, lastX, lastY, x, y, 21);
|
||||
if (i == 0)
|
||||
gfx_fill_rect(dpi, x - 1, y - 1, x + 1, y + 1, 21);
|
||||
|
||||
lastX = x;
|
||||
lastY = y;
|
||||
}
|
||||
x += 6;
|
||||
}
|
||||
gfx_draw_sprite(dpi, SPR_TAB_AWARDS, w->x + w->widgets[WIDX_TAB_7].left, w->y + w->widgets[WIDX_TAB_7].top, 0);
|
||||
}
|
||||
|
||||
#pragma endregion
|
||||
@@ -647,19 +647,19 @@ static void window_ride_list_draw_tab_images(rct_drawpixelinfo *dpi, rct_window
|
||||
sprite_idx = SPR_TAB_RIDE_0;
|
||||
if (w->page == PAGE_RIDES)
|
||||
sprite_idx += w->frame_no / 4;
|
||||
gfx_draw_sprite(dpi, sprite_idx, w->x + w->widgets[WIDX_TAB_1].left, w->y + w->widgets[WIDX_TAB_1].top);
|
||||
gfx_draw_sprite(dpi, sprite_idx, w->x + w->widgets[WIDX_TAB_1].left, w->y + w->widgets[WIDX_TAB_1].top, 0);
|
||||
|
||||
// Shops and stalls tab
|
||||
sprite_idx = SPR_TAB_SHOPS_AND_STALLS_0;
|
||||
if (w->page == PAGE_SHOPS_AND_STALLS)
|
||||
sprite_idx += w->frame_no / 4;
|
||||
gfx_draw_sprite(dpi, sprite_idx, w->x + w->widgets[WIDX_TAB_2].left, w->y + w->widgets[WIDX_TAB_2].top);
|
||||
gfx_draw_sprite(dpi, sprite_idx, w->x + w->widgets[WIDX_TAB_2].left, w->y + w->widgets[WIDX_TAB_2].top, 0);
|
||||
|
||||
// Information kiosks and facilities tab
|
||||
sprite_idx = SPR_TAB_KIOSKS_AND_FACILITIES_0;
|
||||
if (w->page == PAGE_KIOSKS_AND_FACILITIES)
|
||||
sprite_idx += (w->frame_no / 4) % 8;
|
||||
gfx_draw_sprite(dpi, sprite_idx, w->x + w->widgets[WIDX_TAB_3].left, w->y + w->widgets[WIDX_TAB_3].top);
|
||||
gfx_draw_sprite(dpi, sprite_idx, w->x + w->widgets[WIDX_TAB_3].left, w->y + w->widgets[WIDX_TAB_3].top, 0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
+7
-7
@@ -613,7 +613,7 @@ void window_staff_paint() {
|
||||
dpi,
|
||||
i,
|
||||
(window_staff_widgets[WIDX_STAFF_HANDYMEN_TAB].left + window_staff_widgets[WIDX_STAFF_HANDYMEN_TAB].right) / 2 + w->x,
|
||||
window_staff_widgets[WIDX_STAFF_HANDYMEN_TAB].bottom - 6 + w->y
|
||||
window_staff_widgets[WIDX_STAFF_HANDYMEN_TAB].bottom - 6 + w->y, 0
|
||||
);
|
||||
|
||||
// Handymen tab image
|
||||
@@ -625,7 +625,7 @@ void window_staff_paint() {
|
||||
dpi,
|
||||
i,
|
||||
(window_staff_widgets[WIDX_STAFF_MECHANICS_TAB].left + window_staff_widgets[WIDX_STAFF_MECHANICS_TAB].right) / 2 + w->x,
|
||||
window_staff_widgets[WIDX_STAFF_MECHANICS_TAB].bottom - 6 + w->y
|
||||
window_staff_widgets[WIDX_STAFF_MECHANICS_TAB].bottom - 6 + w->y, 0
|
||||
);
|
||||
|
||||
// Security tab image
|
||||
@@ -637,7 +637,7 @@ void window_staff_paint() {
|
||||
dpi,
|
||||
i,
|
||||
(window_staff_widgets[WIDX_STAFF_SECURITY_TAB].left + window_staff_widgets[WIDX_STAFF_SECURITY_TAB].right) / 2 + w->x,
|
||||
window_staff_widgets[WIDX_STAFF_SECURITY_TAB].bottom - 6 + w->y
|
||||
window_staff_widgets[WIDX_STAFF_SECURITY_TAB].bottom - 6 + w->y, 0
|
||||
);
|
||||
|
||||
rct_drawpixelinfo* sprite_dpi = clip_drawpixelinfo(
|
||||
@@ -658,7 +658,7 @@ void window_staff_paint() {
|
||||
sprite_dpi,
|
||||
i,
|
||||
0x0F,
|
||||
0x17
|
||||
0x17, 0
|
||||
);
|
||||
rct2_free(sprite_dpi);
|
||||
}
|
||||
@@ -739,7 +739,7 @@ void window_staff_scrollpaint()
|
||||
|
||||
// True if a patrol path is set for the worker
|
||||
if (RCT2_ADDRESS(0x013CA672, uint8)[peep->var_C5] & 2) {
|
||||
gfx_draw_sprite(dpi, 0x13FD, 110, y - 1);
|
||||
gfx_draw_sprite(dpi, 0x13FD, 110, y - 1, 0);
|
||||
}
|
||||
|
||||
staffOrderIcon_x = 0x7D;
|
||||
@@ -749,14 +749,14 @@ void window_staff_scrollpaint()
|
||||
|
||||
while (staffOrders != 0) {
|
||||
if (staffOrders & 1) {
|
||||
gfx_draw_sprite(dpi, staffOrderSprite, staffOrderIcon_x, y - 1);
|
||||
gfx_draw_sprite(dpi, staffOrderSprite, staffOrderIcon_x, y - 1, 0);
|
||||
}
|
||||
staffOrders = staffOrders >> 1;
|
||||
staffOrderIcon_x += 9;
|
||||
staffOrderSprite++;
|
||||
}
|
||||
} else {
|
||||
gfx_draw_sprite(dpi, peep->sprite_type - 4 + 0x13FE, staffOrderIcon_x, y - 1);
|
||||
gfx_draw_sprite(dpi, peep->sprite_type - 4 + 0x13FE, staffOrderIcon_x, y - 1, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -112,7 +112,7 @@ static void window_title_logo_paint()
|
||||
#endif
|
||||
|
||||
|
||||
gfx_draw_sprite(dpi, SPR_MENU_LOGO, w->x, w->y);
|
||||
gfx_draw_sprite(dpi, SPR_MENU_LOGO, w->x, w->y, 0);
|
||||
|
||||
x = 0;
|
||||
y = 105;
|
||||
|
||||
@@ -386,7 +386,7 @@ static void window_scenarioselect_paint()
|
||||
|
||||
// Draw SixFlags image
|
||||
if (scenario->flags & SCENARIO_FLAGS_SIXFLAGS)
|
||||
gfx_draw_sprite(dpi, SPR_SIX_FLAGS, w->x + w->width - 55, w->y + w->height - 75);
|
||||
gfx_draw_sprite(dpi, SPR_SIX_FLAGS, w->x + w->width - 55, w->y + w->height - 75, 0);
|
||||
|
||||
// Scenario name
|
||||
x = w->x + window_scenarioselect_widgets[WIDX_SCENARIOLIST].right + 4;
|
||||
@@ -466,7 +466,7 @@ static void window_scenarioselect_scrollpaint()
|
||||
// Check if scenario is completed
|
||||
if (scenario->flags & SCENARIO_FLAGS_COMPLETED) {
|
||||
// Draw completion tick
|
||||
gfx_draw_sprite(dpi, 0x5A9F, 395, y + 1);
|
||||
gfx_draw_sprite(dpi, 0x5A9F, 395, y + 1, 0);
|
||||
|
||||
// Draw completion score
|
||||
strcpy((char*)0x009BC677, scenario->completed_by);
|
||||
|
||||
Reference in new issue
Block a user