1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-02-01 19:25:12 +01:00

integrate variable: g1Elements

This commit is contained in:
Ted John
2016-04-24 12:10:48 +01:00
committed by Michał Janiszewski
parent d07b9535c2
commit b73861be99
3 changed files with 11 additions and 5 deletions

View File

@@ -201,7 +201,7 @@ void scrolling_text_set_bitmap_for_sprite(utf8 *text, int scroll, uint8 *bitmap,
// Set any change in colour
if (codepoint <= FORMAT_COLOUR_CODE_END && codepoint >= FORMAT_COLOUR_CODE_START){
codepoint -= FORMAT_COLOUR_CODE_START;
characterColour = RCT2_GLOBAL(0x009FF048, uint8*)[codepoint * 4];
characterColour = g1Elements[4914].offset[codepoint * 4];
continue;
}

View File

@@ -16,16 +16,20 @@
#include "../addresses.h"
#include "../common.h"
#include "../openrct2.h"
#include "../platform/platform.h"
#include "../sprites.h"
#include "drawing.h"
#include "../platform/platform.h"
#include "../openrct2.h"
void *_g1Buffer = NULL;
rct_gx g2;
rct_g1_element *g1Elements = (rct_g1_element*)RCT2_ADDRESS_G1_ELEMENTS;
#if NO_RCT2
rct_g1_element *g1Elements = NULL;
#else
rct_g1_element *g1Elements = (rct_g1_element*)RCT2_ADDRESS_G1_ELEMENTS;
#endif
/**
*
@@ -47,6 +51,7 @@ int gfx_load_g1()
header.num_entries = 29294;
// Read element headers
g1Elements = calloc(324206, sizeof(rct_g1_element));
SDL_RWread(file, g1Elements, header.num_entries * sizeof(rct_g1_element), 1);
// Read element data
@@ -73,6 +78,7 @@ int gfx_load_g1()
void gfx_unload_g1()
{
SafeFree(_g1Buffer);
SafeFree(g1Elements);
}
void gfx_unload_g2()

View File

@@ -905,7 +905,7 @@ rct_object_filters *get_object_filter(int index)
void object_list_init()
{
for (uint8 objectType = 0; objectType < OBJECT_ENTRY_GROUP_COUNT; objectType++) {
for (size_t i = 0; i < object_entry_group_counts[objectType]; i++) {
for (size_t i = 0; i < (size_t)object_entry_group_counts[objectType]; i++) {
object_entry_groups[objectType].chunks[i] = (void*)-1;
}
}