1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-20 21:43:06 +01:00

Implement misc_paint

This commit is contained in:
Marijn van der Werf
2016-04-28 13:28:25 +02:00
parent 929ac48ccc
commit e3161d66d0
7 changed files with 220 additions and 51 deletions

View File

@@ -33,7 +33,7 @@ void create_balloon(int x, int y, int z, int colour, uint8 bl)
sprite->balloon.sprite_identifier = SPRITE_IDENTIFIER_MISC;
sprite_move(x, y, z, sprite);
sprite->balloon.misc_identifier = SPRITE_MISC_BALLOON;
sprite->balloon.var_26 = 0;
sprite->balloon.frame = 0;
sprite->balloon.colour = colour;
sprite->balloon.popped = bl;
}
@@ -42,7 +42,7 @@ void create_balloon(int x, int y, int z, int colour, uint8 bl)
void balloon_pop(rct_balloon *balloon)
{
balloon->popped = 1;
balloon->var_26 = 0;
balloon->frame = 0;
audio_play_sound_at_location(SOUND_BALLOON_POP, balloon->x, balloon->y, balloon->z);
}
@@ -54,8 +54,8 @@ void balloon_update(rct_balloon *balloon)
{
invalidate_sprite_2((rct_sprite*)balloon);
if (balloon->popped == 1) {
balloon->var_26 += 256;
if (balloon->var_26 >= 1280)
balloon->frame += 256;
if (balloon->frame >= 1280)
sprite_remove((rct_sprite*)balloon);
return;

View File

@@ -35,7 +35,7 @@ void crashed_vehicle_particle_create(rct_vehicle_colour colours, int x, int y, i
sprite_move(x, y, z, (rct_sprite*)sprite);
sprite->misc_identifier = SPRITE_MISC_CRASHED_VEHICLE_PARTICLE;
sprite->var_26 = (util_rand() & 0xFF) * 12;
sprite->frame = (util_rand() & 0xFF) * 12;
sprite->var_24 = (util_rand() & 0x7F) + 140;
sprite->var_2E = ((util_rand() & 0xFF) * 5) >> 8;
sprite->acceleration_x = ((sint16)(util_rand() & 0xFFFF)) * 4;
@@ -102,9 +102,9 @@ void crashed_vehicle_particle_update(rct_crashed_vehicle_particle *particle)
sprite_move(x, y, z, (rct_sprite*)particle);
invalidate_sprite_0((rct_sprite*)particle);
particle->var_26 += 85;
if (particle->var_26 >= 3072) {
particle->var_26 = 0;
particle->frame += 85;
if (particle->frame >= 3072) {
particle->frame = 0;
}
}
@@ -122,7 +122,7 @@ void crash_splash_create(int x, int y, int z)
sprite->sprite_identifier = SPRITE_IDENTIFIER_MISC;
sprite_move(x, y, z + 3, (rct_sprite*)sprite);
sprite->misc_identifier = SPRITE_MISC_CRASH_SPLASH;
sprite->var_26 = 0;
sprite->frame = 0;
}
}
@@ -133,8 +133,8 @@ void crash_splash_create(int x, int y, int z)
void crash_splash_update(rct_crash_splash *splash)
{
invalidate_sprite_2((rct_sprite*)splash);
splash->var_26 += 85;
if (splash->var_26 >= 7168) {
splash->frame += 85;
if (splash->frame >= 7168) {
sprite_remove((rct_sprite*)splash);
}
}

View File

@@ -288,8 +288,8 @@ static void sprite_steam_particle_update(rct_steam_particle *steam)
(rct_sprite*)steam
);
}
steam->var_26 += 64;
if (steam->var_26 >= (56 * 64)) {
steam->frame += 64;
if (steam->frame >= (56 * 64)) {
sprite_remove((rct_sprite*)steam);
}
}
@@ -298,7 +298,7 @@ static void sprite_steam_particle_update(rct_steam_particle *steam)
*
* rct2: 0x0067363D
*/
void sprite_misc_3_create(int x, int y, int z)
void sprite_misc_explosion_cloud_create(int x, int y, int z)
{
rct_unk_sprite *sprite = (rct_unk_sprite*)create_sprite(2);
if (sprite != NULL) {
@@ -307,8 +307,8 @@ void sprite_misc_3_create(int x, int y, int z)
sprite->sprite_height_positive = 34;
sprite->sprite_identifier = SPRITE_IDENTIFIER_MISC;
sprite_move(x, y, z + 4, (rct_sprite*)sprite);
sprite->misc_identifier = SPRITE_MISC_3;
sprite->var_26 = 0;
sprite->misc_identifier = SPRITE_MISC_EXPLOSION_CLOUD;
sprite->frame = 0;
}
}
@@ -316,11 +316,11 @@ void sprite_misc_3_create(int x, int y, int z)
*
* rct2: 0x00673385
*/
static void sprite_misc_3_update(rct_sprite *sprite)
static void sprite_misc_explosion_cloud_update(rct_sprite * sprite)
{
invalidate_sprite_2(sprite);
sprite->unknown.var_26 += 128;
if (sprite->unknown.var_26 >= (36 * 128)) {
sprite->unknown.frame += 128;
if (sprite->unknown.frame >= (36 * 128)) {
sprite_remove(sprite);
}
}
@@ -329,7 +329,7 @@ static void sprite_misc_3_update(rct_sprite *sprite)
*
* rct2: 0x0067366B
*/
void sprite_misc_5_create(int x, int y, int z)
void sprite_misc_explosion_flare_create(int x, int y, int z)
{
rct_unk_sprite *sprite = (rct_unk_sprite*)create_sprite(2);
if (sprite != NULL) {
@@ -338,8 +338,8 @@ void sprite_misc_5_create(int x, int y, int z)
sprite->sprite_height_positive = 8;
sprite->sprite_identifier = SPRITE_IDENTIFIER_MISC;
sprite_move(x, y, z + 4, (rct_sprite*)sprite);
sprite->misc_identifier = SPRITE_MISC_5;
sprite->var_26 = 0;
sprite->misc_identifier = SPRITE_MISC_EXPLOSION_FLARE;
sprite->frame = 0;
}
}
@@ -347,11 +347,11 @@ void sprite_misc_5_create(int x, int y, int z)
*
* rct2: 0x006733B4
*/
static void sprite_misc_5_update(rct_sprite *sprite)
static void sprite_misc_explosion_flare_update(rct_sprite * sprite)
{
invalidate_sprite_2(sprite);
sprite->unknown.var_26 += 64;
if (sprite->unknown.var_26 >= (124 * 64)) {
sprite->unknown.frame += 64;
if (sprite->unknown.frame >= (124 * 64)) {
sprite_remove(sprite);
}
}
@@ -372,14 +372,14 @@ void sprite_misc_update(rct_sprite *sprite)
case SPRITE_MISC_CRASHED_VEHICLE_PARTICLE:
crashed_vehicle_particle_update((rct_crashed_vehicle_particle*)sprite);
break;
case SPRITE_MISC_3:
sprite_misc_3_update(sprite);
case SPRITE_MISC_EXPLOSION_CLOUD:
sprite_misc_explosion_cloud_update(sprite);
break;
case SPRITE_MISC_CRASH_SPLASH:
crash_splash_update((rct_crash_splash*)sprite);
break;
case SPRITE_MISC_5:
sprite_misc_5_update(sprite);
case SPRITE_MISC_EXPLOSION_FLARE:
sprite_misc_explosion_flare_update(sprite);
break;
case SPRITE_MISC_JUMPING_FOUNTAIN_WATER:
case SPRITE_MISC_JUMPING_FOUNTAIN_SNOW:

View File

@@ -68,7 +68,7 @@ typedef struct {
uint8 pad_1F[3]; // 0x1f
uint16 name_string_idx; // 0x22
uint16 var_24;
uint16 var_26;
uint16 frame; // 0x26
uint8 var_28[3];
uint8 var_2B;
uint8 pad_2C[0x45];
@@ -114,7 +114,7 @@ typedef struct {
uint8 pad_16[0xE];
uint16 popped; // 0x24
union {
uint16 var_26;
uint16 frame; // 0x26
struct {
uint8 var_26a;
uint8 var_26b;
@@ -235,7 +235,7 @@ typedef struct {
uint8 pad_1F[3]; // 0x1f
uint16 name_string_idx; // 0x22
uint16 var_24;
uint16 var_26;
uint16 frame; // 0x26
uint8 var_28[3];
uint8 var_2B;
uint8 colour[2];
@@ -277,7 +277,7 @@ typedef struct {
uint8 pad_1F[3]; // 0x1f
uint16 name_string_idx; // 0x22
uint16 var_24;
uint16 var_26;
uint16 frame; // 0x26
} rct_crash_splash;
typedef struct {
@@ -306,7 +306,7 @@ typedef struct {
uint8 pad_1F[3]; // 0x1F
uint16 name_string_idx; // 0x22
uint16 var_24;
uint16 var_26;
uint16 frame; // 0x26
} rct_steam_particle;
/**
@@ -349,9 +349,9 @@ enum {
SPRITE_MISC_STEAM_PARTICLE,
SPRITE_MISC_MONEY_EFFECT,
SPRITE_MISC_CRASHED_VEHICLE_PARTICLE,
SPRITE_MISC_3, // (related to vehicle crash, probably crash particles)
SPRITE_MISC_EXPLOSION_CLOUD,
SPRITE_MISC_CRASH_SPLASH,
SPRITE_MISC_5, // (related to vehicle crash, probably crash particles)
SPRITE_MISC_EXPLOSION_FLARE,
SPRITE_MISC_JUMPING_FOUNTAIN_WATER,
SPRITE_MISC_BALLOON,
SPRITE_MISC_DUCK,
@@ -384,8 +384,8 @@ void invalidate_sprite_2(rct_sprite *sprite);
void sprite_remove(rct_sprite *sprite);
void litter_create(int x, int y, int z, int direction, int type);
void litter_remove_at(int x, int y, int z);
void sprite_misc_3_create(int x, int y, int z);
void sprite_misc_5_create(int x, int y, int z);
void sprite_misc_explosion_cloud_create(int x, int y, int z);
void sprite_misc_explosion_flare_create(int x, int y, int z);
uint16 sprite_get_first_in_quadrant(int x, int y);
///////////////////////////////////////////////////////////////