mirror of https://github.com/OpenRCT2/OpenRCT2.git
Added sprite list reset function. Identified more fields.
This commit is contained in:
parent
15dfd49509
commit
e46abd0f4c
|
@ -316,10 +316,10 @@ typedef struct {
|
|||
uint8 pad_01;
|
||||
uint16 pad_02;
|
||||
uint16 next; // 0x04
|
||||
uint16 pad_06;
|
||||
uint16 previous; // 0x06
|
||||
uint8 var_08;
|
||||
uint8 pad_09;
|
||||
sint16 var_0A;
|
||||
uint16 sprite_index; // 0x0A
|
||||
uint16 var_0C;
|
||||
sint16 x; // 0x0E
|
||||
sint16 y; // 0x10
|
||||
|
|
|
@ -47,6 +47,7 @@
|
|||
#include "title.h"
|
||||
#include "track.h"
|
||||
#include "viewport.h"
|
||||
#include "sprite.h"
|
||||
|
||||
typedef struct tm tm_t;
|
||||
|
||||
|
@ -167,7 +168,8 @@ void rct2_init()
|
|||
get_local_time();
|
||||
reset_park_entrances();
|
||||
reset_saved_strings();
|
||||
RCT2_CALLPROC_EBPSAFE(0x0069EB13); //Sprite list reset/load
|
||||
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?
|
||||
|
|
40
src/sprite.c
40
src/sprite.c
|
@ -19,6 +19,7 @@
|
|||
*****************************************************************************/
|
||||
|
||||
#include "addresses.h"
|
||||
#include <string.h>
|
||||
#include "sprite.h"
|
||||
|
||||
/**
|
||||
|
@ -28,4 +29,43 @@
|
|||
void create_balloon(int x, int y, int z, int colour)
|
||||
{
|
||||
RCT2_CALLPROC_X(0x006736C7, x, colour << 8, y, z, 0, 0, 0);
|
||||
}
|
||||
|
||||
/*
|
||||
*
|
||||
* rct2: 0x0069EB13
|
||||
*/
|
||||
void reset_sprite_list(){
|
||||
RCT2_GLOBAL(0x1388698, uint16) = 0;
|
||||
memset((uint32*)RCT2_ADDRESS_SPRITE_LIST, 0, 0x9C400);
|
||||
|
||||
for (int i = 0; i < 6; ++i){
|
||||
RCT2_ADDRESS(RCT2_ADDRESS_SPRITES_NEXT_INDEX, uint16)[i] = -1;
|
||||
RCT2_ADDRESS(0x13573C8, uint16)[i] = 0;
|
||||
}
|
||||
|
||||
rct_sprite* previous_spr = (rct_sprite*)SPRITE_INDEX_NULL;
|
||||
|
||||
rct_sprite* spr = RCT2_ADDRESS(RCT2_ADDRESS_SPRITE_LIST, rct_sprite);
|
||||
for (int i = 0; i < 0x2710; ++i){
|
||||
spr->unknown.sprite_identifier = 0xFF;
|
||||
spr->unknown.sprite_index = i;
|
||||
spr->unknown.next = SPRITE_INDEX_NULL;
|
||||
spr->unknown.var_08 = 0;
|
||||
|
||||
if (previous_spr != (rct_sprite*)SPRITE_INDEX_NULL){
|
||||
spr->unknown.previous = previous_spr->unknown.sprite_index;
|
||||
previous_spr->unknown.next = i;
|
||||
}
|
||||
else{
|
||||
spr->unknown.previous = SPRITE_INDEX_NULL;
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_SPRITES_NEXT_INDEX, uint16) = i;
|
||||
}
|
||||
previous_spr = spr;
|
||||
spr++;
|
||||
}
|
||||
|
||||
RCT2_GLOBAL(0x13573C8, uint16) = 0x2710;
|
||||
|
||||
RCT2_CALLPROC_EBPSAFE(0x0069EBE4);
|
||||
}
|
13
src/sprite.h
13
src/sprite.h
|
@ -34,7 +34,11 @@ typedef struct {
|
|||
uint8 pad_01;
|
||||
uint16 pad_02;
|
||||
uint16 next; // 0x04
|
||||
uint8 pad_06[0x08];
|
||||
uint16 previous; // 0x06
|
||||
uint8 var_08;
|
||||
uint8 pad_09;
|
||||
uint16 sprite_index; // 0x0A
|
||||
uint8 pad_0C[2];
|
||||
sint16 x; // 0x0E
|
||||
sint16 y; // 0x10
|
||||
sint16 z; // 0x12
|
||||
|
@ -43,7 +47,11 @@ typedef struct {
|
|||
typedef struct {
|
||||
uint32 pad_00;
|
||||
uint16 next; // 0x04
|
||||
uint8 pad_06[0x1E];
|
||||
uint16 previous; // 0x06
|
||||
uint8 var_08;
|
||||
uint8 pad_09;
|
||||
uint16 sprite_index; // 0x0A
|
||||
uint8 pad_0B[0x19];
|
||||
uint32 var_24;
|
||||
} rct_litter;
|
||||
|
||||
|
@ -60,5 +68,6 @@ typedef union {
|
|||
} rct_sprite;
|
||||
|
||||
void create_balloon(int x, int y, int z, int colour);
|
||||
void reset_sprite_list();
|
||||
|
||||
#endif
|
||||
|
|
|
@ -27,7 +27,11 @@ typedef struct {
|
|||
uint8 sprite_identifier; // 0x00
|
||||
uint8 pad_01[0x03];
|
||||
uint16 next; // 0x04
|
||||
uint8 pad_06[0x08];
|
||||
uint16 previous; // 0x06
|
||||
uint8 var_08;
|
||||
uint8 pad_09;
|
||||
uint16 sprite_index; // 0x0A
|
||||
uint8 pad_0C[2];
|
||||
sint16 x; // 0x0E
|
||||
sint16 y; // 0x10
|
||||
sint16 z; // 0x12
|
||||
|
|
|
@ -715,7 +715,7 @@ static void window_guest_list_scrollpaint()
|
|||
gfx_draw_sprite(dpi, 5129, 112, y);
|
||||
|
||||
// Action
|
||||
eax = peep->var_0A;
|
||||
eax = peep->sprite_index;
|
||||
RCT2_CALLFUNC_X(0x00698B0D, &eax, &ebx, &ecx, &edx, &esi, &edi, &ebp);
|
||||
ebx &= 0xFFFF;
|
||||
ecx &= 0xFFFF;
|
||||
|
@ -829,7 +829,7 @@ static int sub_69B7EA(rct_peep *peep, int *outEAX)
|
|||
|
||||
switch (_window_guest_list_selected_view) {
|
||||
case VIEW_ACTIONS:
|
||||
eax = peep->var_0A;
|
||||
eax = peep->sprite_index;
|
||||
RCT2_CALLFUNC_X(0x00698B0D, &eax, &ebx, &ecx, &edx, &esi, &edi, &ebp);
|
||||
RCT2_GLOBAL(0x013CE952, uint16) = ecx & 0xFFFF;
|
||||
RCT2_GLOBAL(0x013CE952 + 2, uint32) = edx;
|
||||
|
@ -894,7 +894,7 @@ static void window_guest_list_find_groups()
|
|||
if (groupIndex >= 240)
|
||||
break;
|
||||
|
||||
int ax = peep->var_0A;
|
||||
int ax = peep->sprite_index;
|
||||
_window_guest_list_num_groups++;
|
||||
_window_guest_list_groups_num_guests[groupIndex] = 1;
|
||||
peep->var_0C &= ~(1 << 8);
|
||||
|
|
Loading…
Reference in New Issue