mirror of https://github.com/OpenRCT2/OpenRCT2.git
implement money_effect_create
This commit is contained in:
parent
bbbf928f50
commit
b1d6c34a00
|
@ -453,7 +453,7 @@ int game_do_command_p(int command, int *eax, int *ebx, int *ecx, int *edx, int *
|
|||
if (RCT2_GLOBAL(0x0141F568, uint8) == RCT2_GLOBAL(0x013CA740, uint8)) {
|
||||
// Create a +/- money text effect
|
||||
if (cost != 0)
|
||||
RCT2_CALLPROC_X(0x0069C5D0, 0, cost, 0, 0, 0, 0, 0);
|
||||
money_effect_create(cost);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -669,7 +669,7 @@ int game_load_save(const char *path)
|
|||
// The rest is the same as in scenario load and play
|
||||
reset_loaded_objects();
|
||||
map_update_tile_pointers();
|
||||
reset_0x69EBE4();// RCT2_CALLPROC_EBPSAFE(0x0069EBE4);
|
||||
reset_0x69EBE4();
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) = SCREEN_FLAGS_PLAYING;
|
||||
viewport_init_all();
|
||||
game_create_windows();
|
||||
|
|
|
@ -95,7 +95,7 @@ int rct2_init()
|
|||
gfx_load_g1();
|
||||
gfx_load_character_widths();
|
||||
platform_init();
|
||||
audio_init1();//RCT2_CALLPROC_EBPSAFE(0x006BA8E0); // init_audio();
|
||||
audio_init1();
|
||||
viewport_init_all();
|
||||
news_item_init_queue();
|
||||
get_local_time();
|
||||
|
@ -104,10 +104,10 @@ int rct2_init()
|
|||
reset_sprite_list();
|
||||
ride_init_all();
|
||||
window_guest_list_init_vars_a();
|
||||
sub_6BD3A4();// RCT2_CALLPROC_EBPSAFE(0x006BD3A4); //Peep?
|
||||
sub_6BD3A4();
|
||||
map_init(150);
|
||||
park_init();
|
||||
RCT2_CALLPROC_EBPSAFE(0x0066B5C0); // 0x0066B5C0 (part of 0x0066B3E8) screen_game_create_windows()
|
||||
window_title_menu_open();
|
||||
date_reset();
|
||||
climate_reset(CLIMATE_COOL_AND_WET);
|
||||
scenery_set_default_placement_configuration();
|
||||
|
|
|
@ -176,7 +176,7 @@ int scenario_load(const char *path)
|
|||
|
||||
reset_loaded_objects();
|
||||
map_update_tile_pointers();
|
||||
reset_0x69EBE4();// RCT2_CALLPROC_EBPSAFE(0x0069EBE4);
|
||||
reset_0x69EBE4();
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
#include "../audio/audio.h"
|
||||
#include "../interface/viewport.h"
|
||||
#include "../localisation/date.h"
|
||||
#include "../localisation/localisation.h"
|
||||
#include "../scenario.h"
|
||||
#include "fountain.h"
|
||||
#include "sprite.h"
|
||||
|
@ -421,6 +422,77 @@ static const rct_xy16 _moneyEffectMoveOffset[] = {
|
|||
{ -1, -1 }
|
||||
};
|
||||
|
||||
/**
|
||||
*
|
||||
* rct: 0x0067351F
|
||||
*/
|
||||
void money_effect_create_at(money32 value, int x, int y, int z)
|
||||
{
|
||||
rct_money_effect *moneyEffect;
|
||||
rct_string_id stringId;
|
||||
char buffer[128];
|
||||
|
||||
moneyEffect = (rct_money_effect*)create_sprite(2);
|
||||
if (moneyEffect == NULL)
|
||||
return;
|
||||
|
||||
moneyEffect->value = value;
|
||||
moneyEffect->var_14 = 64;
|
||||
moneyEffect->var_09 = 20;
|
||||
moneyEffect->var_15 = 30;
|
||||
moneyEffect->sprite_identifier = SPRITE_IDENTIFIER_MISC;
|
||||
sprite_move(x, y, z, (rct_sprite*)moneyEffect);
|
||||
moneyEffect->misc_identifier = SPRITE_MISC_MONEY_EFFECT;
|
||||
moneyEffect->num_movements = 0;
|
||||
moneyEffect->move_delay = 0;
|
||||
|
||||
stringId = 1388;
|
||||
if (value < 0) {
|
||||
value *= -1;
|
||||
stringId = 1399;
|
||||
}
|
||||
format_string(buffer, stringId, &value);
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_FONT_SPRITE_BASE, uint16) = 224;
|
||||
moneyEffect->offset_x = -(gfx_get_string_width(buffer) / 2);
|
||||
moneyEffect->wiggle = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* rct: 0x0069C5D0
|
||||
*/
|
||||
void money_effect_create(money32 value)
|
||||
{
|
||||
rct_window *mainWindow;
|
||||
rct_viewport *mainViewport;
|
||||
rct_xyz16 mapPosition;
|
||||
|
||||
mapPosition.x = RCT2_GLOBAL(0x009DEA5E, uint16);
|
||||
mapPosition.y = RCT2_GLOBAL(0x009DEA60, uint16);
|
||||
mapPosition.z = RCT2_GLOBAL(0x009DEA62, uint16);
|
||||
if (mapPosition.x == (sint16)0x8000) {
|
||||
mainWindow = window_get_main();
|
||||
if (mainWindow == NULL)
|
||||
return;
|
||||
|
||||
mainViewport = mainWindow->viewport;
|
||||
mapPosition.x = mainViewport->x + (mainViewport->width / 2);
|
||||
mapPosition.y = mainViewport->y + (mainViewport->height / 2);
|
||||
|
||||
int eax = mapPosition.x, ebx = mapPosition.y, ecx, edx, esi, edi, ebp;
|
||||
RCT2_CALLFUNC_X(0x00688972, &eax, &ebx, &ecx, &edx, &esi, &edi, &ebp);
|
||||
mapPosition.x = eax;
|
||||
mapPosition.y = ebx;
|
||||
|
||||
if (mapPosition.x == (sint16)0x8000)
|
||||
return;
|
||||
|
||||
mapPosition.z = map_element_height(mapPosition.x, mapPosition.y) & 0xFFFF;
|
||||
}
|
||||
mapPosition.z += 10;
|
||||
money_effect_create_at(-value, mapPosition.x, mapPosition.y, mapPosition.z);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* rct: 0x00673232
|
||||
|
|
|
@ -191,10 +191,14 @@ typedef struct {
|
|||
sint16 x; // 0x0E
|
||||
sint16 y; // 0x10
|
||||
sint16 z; // 0x12
|
||||
uint8 pad_14[0x10];
|
||||
uint8 var_14;
|
||||
uint8 var_15;
|
||||
uint8 pad_16[0xE];
|
||||
uint16 move_delay; // 0x24
|
||||
uint16 num_movements; // 0x26
|
||||
uint8 pad_28[0x1E];
|
||||
money32 value; // 0x28
|
||||
uint8 pad_2C[0x18];
|
||||
sint16 offset_x; // 0x44
|
||||
uint16 wiggle; // 0x46
|
||||
} rct_money_effect;
|
||||
|
||||
|
@ -235,6 +239,7 @@ void balloon_press(rct_balloon *balloon);
|
|||
void create_duck(int targetX, int targetY);
|
||||
void duck_press(rct_duck *duck);
|
||||
void duck_remove_all();
|
||||
void money_effect_create(money32 value);
|
||||
rct_sprite *create_sprite(uint8 bl);
|
||||
void reset_sprite_list();
|
||||
void reset_0x69EBE4();
|
||||
|
|
Loading…
Reference in New Issue