mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-22 06:23:04 +01:00
Added another reset function
This commit is contained in:
@@ -32,6 +32,7 @@
|
||||
#include "viewport.h"
|
||||
#include "finance.h"
|
||||
#include "audio.h"
|
||||
#include "sprite.h"
|
||||
#include "string_ids.h"
|
||||
|
||||
static void set_all_land_owned();
|
||||
@@ -53,7 +54,7 @@ void editor_load()
|
||||
RCT2_CALLPROC_EBPSAFE(0x006B9CB0);
|
||||
reset_park_entrances();
|
||||
reset_saved_strings();
|
||||
RCT2_CALLPROC_EBPSAFE(0x0069EB13); // sprites_init
|
||||
reset_sprite_list();
|
||||
ride_init_all();
|
||||
window_guest_list_init_vars_a();
|
||||
sub_6BD3A4();
|
||||
@@ -102,7 +103,7 @@ void trackdesigner_load()
|
||||
RCT2_CALLPROC_EBPSAFE(0x006B9CB0);
|
||||
reset_park_entrances();
|
||||
reset_saved_strings();
|
||||
RCT2_CALLPROC_EBPSAFE(0x0069EB13); // reset_sprites
|
||||
reset_sprite_list();
|
||||
ride_init_all();
|
||||
window_guest_list_init_vars_a();
|
||||
sub_6BD3A4();
|
||||
@@ -140,7 +141,7 @@ void trackmanager_load()
|
||||
RCT2_CALLPROC_EBPSAFE(0x006B9CB0);
|
||||
reset_park_entrances();
|
||||
reset_saved_strings();
|
||||
RCT2_CALLPROC_EBPSAFE(0x0069EB13); // reset_sprites
|
||||
reset_sprite_list();
|
||||
ride_init_all();
|
||||
window_guest_list_init_vars_a();
|
||||
sub_6BD3A4();
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
#include "sawyercoding.h"
|
||||
#include "scenario.h"
|
||||
#include "screenshot.h"
|
||||
#include "sprite.h"
|
||||
#include "string_ids.h"
|
||||
#include "title.h"
|
||||
#include "tutorial.h"
|
||||
@@ -1581,7 +1582,7 @@ int game_load_save()
|
||||
// The rest is the same as in scenario load and play
|
||||
RCT2_CALLPROC_EBPSAFE(0x006A9FC0);
|
||||
map_update_tile_pointers();
|
||||
RCT2_CALLPROC_EBPSAFE(0x0069EBE4);
|
||||
reset_0x69EBE4();// RCT2_CALLPROC_EBPSAFE(0x0069EBE4);
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) = SCREEN_FLAGS_PLAYING;
|
||||
viewport_init_all();
|
||||
game_create_windows();
|
||||
|
||||
@@ -169,7 +169,6 @@ void rct2_init()
|
||||
reset_park_entrances();
|
||||
reset_saved_strings();
|
||||
reset_sprite_list();
|
||||
//RCT2_CALLPROC_EBPSAFE(0x0069EB13); //Sprite list reset/load
|
||||
ride_init_all();
|
||||
window_guest_list_init_vars_a();
|
||||
RCT2_CALLPROC_EBPSAFE(0x006BD3A4); //Peep?
|
||||
|
||||
@@ -154,7 +154,7 @@ void scenario_load(const char *path)
|
||||
|
||||
RCT2_CALLPROC_EBPSAFE(0x006A9FC0);
|
||||
map_update_tile_pointers();
|
||||
RCT2_CALLPROC_EBPSAFE(0x0069EBE4);
|
||||
reset_0x69EBE4();// RCT2_CALLPROC_EBPSAFE(0x0069EBE4);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
38
src/sprite.c
38
src/sprite.c
@@ -37,7 +37,7 @@ void create_balloon(int x, int y, int z, int colour)
|
||||
*/
|
||||
void reset_sprite_list(){
|
||||
RCT2_GLOBAL(0x1388698, uint16) = 0;
|
||||
memset((uint32*)RCT2_ADDRESS_SPRITE_LIST, 0, 0x9C400);
|
||||
memset((rct_sprite*)RCT2_ADDRESS_SPRITE_LIST, 0, sizeof(rct_sprite)* 0x2710);
|
||||
|
||||
for (int i = 0; i < 6; ++i){
|
||||
RCT2_ADDRESS(RCT2_ADDRESS_SPRITES_NEXT_INDEX, uint16)[i] = -1;
|
||||
@@ -67,5 +67,39 @@ void reset_sprite_list(){
|
||||
|
||||
RCT2_GLOBAL(0x13573C8, uint16) = 0x2710;
|
||||
|
||||
RCT2_CALLPROC_EBPSAFE(0x0069EBE4);
|
||||
//RCT2_CALLPROC_EBPSAFE(0x0069EBE4);
|
||||
reset_0x69EBE4();
|
||||
}
|
||||
|
||||
/*
|
||||
*
|
||||
* rct: 0x0069EBE4
|
||||
* This function looks as though it sets some sort of order for sprites.
|
||||
* Sprites can share thier position if this is the case.
|
||||
*/
|
||||
void reset_0x69EBE4(){
|
||||
//RCT2_CALLPROC_EBPSAFE(0x0069EBE4);
|
||||
//return;
|
||||
memset((uint16*)0xF1EF60, -1, 0x10001*2);
|
||||
|
||||
rct_sprite* spr = RCT2_ADDRESS(RCT2_ADDRESS_SPRITE_LIST, rct_sprite);
|
||||
for (; spr < (rct_sprite*)RCT2_ADDRESS_SPRITES_NEXT_INDEX; spr++){
|
||||
|
||||
if (spr->unknown.sprite_identifier != 0xFF){
|
||||
uint32 edi = spr->unknown.x;
|
||||
if ((uint16)(spr->unknown.x) == SPRITE_LOCATION_NULL){
|
||||
edi = 0x10000;
|
||||
}
|
||||
else{
|
||||
int ecx = spr->unknown.y;
|
||||
ecx >>= 5;
|
||||
edi &= 0x1FE0;
|
||||
edi <<= 3;
|
||||
edi |= ecx;
|
||||
}
|
||||
uint16 ax = RCT2_ADDRESS(0xF1EF60,uint16)[edi];
|
||||
RCT2_ADDRESS(0xF1EF60,uint16)[edi] = spr->unknown.sprite_index;
|
||||
spr->unknown.var_02 = ax;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -32,7 +32,7 @@
|
||||
typedef struct {
|
||||
uint8 sprite_identifier; // 0x00
|
||||
uint8 pad_01;
|
||||
uint16 pad_02;
|
||||
uint16 var_02;
|
||||
uint16 next; // 0x04
|
||||
uint16 previous; // 0x06
|
||||
uint8 var_08;
|
||||
@@ -69,5 +69,6 @@ typedef union {
|
||||
|
||||
void create_balloon(int x, int y, int z, int colour);
|
||||
void reset_sprite_list();
|
||||
void reset_0x69EBE4();
|
||||
|
||||
#endif
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
#include "rct2.h"
|
||||
#include "ride.h"
|
||||
#include "scenario.h"
|
||||
#include "sprite.h"
|
||||
#include "string_ids.h"
|
||||
#include "viewport.h"
|
||||
#include "editor.h"
|
||||
@@ -95,7 +96,7 @@ void title_load()
|
||||
|
||||
reset_park_entrances();
|
||||
reset_saved_strings();
|
||||
RCT2_CALLPROC_EBPSAFE(0x0069EB13);
|
||||
reset_sprite_list();
|
||||
ride_init_all();
|
||||
window_guest_list_init_vars_a();
|
||||
RCT2_CALLPROC_EBPSAFE(0x006BD3A4);
|
||||
@@ -108,7 +109,7 @@ void title_load()
|
||||
window_guest_list_init_vars_b();
|
||||
window_staff_init_vars();
|
||||
RCT2_CALLPROC_EBPSAFE(0x0068AFFD);
|
||||
RCT2_CALLPROC_EBPSAFE(0x0069EBE4);
|
||||
reset_0x69EBE4();// RCT2_CALLPROC_EBPSAFE(0x0069EBE4);
|
||||
viewport_init_all();
|
||||
news_item_init_queue();
|
||||
title_create_windows();
|
||||
|
||||
Reference in New Issue
Block a user