mirror of https://github.com/OpenRCT2/OpenRCT2.git
commit
2e3500ee6b
|
@ -144,7 +144,7 @@ void load_palette(){
|
||||||
|
|
||||||
uint32 palette = 0x5FC;
|
uint32 palette = 0x5FC;
|
||||||
|
|
||||||
if ((uintptr_t)water_type != (uint32)-1){
|
if ((sint32)water_type != -1){
|
||||||
palette = water_type->image_id;
|
palette = water_type->image_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -24,9 +24,8 @@
|
||||||
#ifndef NO_RCT2
|
#ifndef NO_RCT2
|
||||||
#pragma pack(push, 1)
|
#pragma pack(push, 1)
|
||||||
#endif
|
#endif
|
||||||
|
// Size: 0x10
|
||||||
// Size: 0x10 or more
|
typedef struct rct_g1_element {
|
||||||
typedef struct {
|
|
||||||
uint8* offset; // 0x00
|
uint8* offset; // 0x00
|
||||||
sint16 width; // 0x04
|
sint16 width; // 0x04
|
||||||
sint16 height; // 0x06
|
sint16 height; // 0x06
|
||||||
|
@ -70,6 +69,7 @@ typedef struct rct_g1_element_32bit {
|
||||||
} rct_g1_element_32bit;
|
} rct_g1_element_32bit;
|
||||||
assert_struct_size(rct_g1_element_32bit, 0x10);
|
assert_struct_size(rct_g1_element_32bit, 0x10);
|
||||||
|
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
G1_FLAG_BMP = (1 << 0), //No invisible sections
|
G1_FLAG_BMP = (1 << 0), //No invisible sections
|
||||||
G1_FLAG_RLE_COMPRESSION = (1<<2),
|
G1_FLAG_RLE_COMPRESSION = (1<<2),
|
||||||
|
|
|
@ -71,6 +71,20 @@ int gfx_load_g1()
|
||||||
* pointers to however long our machine wants them.
|
* pointers to however long our machine wants them.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#pragma pack(push, 1)
|
||||||
|
// Size: 0x10
|
||||||
|
typedef struct {
|
||||||
|
uint32 offset; // 0x00 note: uint32 always!
|
||||||
|
sint16 width; // 0x04
|
||||||
|
sint16 height; // 0x06
|
||||||
|
sint16 x_offset; // 0x08
|
||||||
|
sint16 y_offset; // 0x0A
|
||||||
|
uint16 flags; // 0x0C
|
||||||
|
uint16 zoomed_offset; // 0x0E
|
||||||
|
} rct_g1_element_32bit;
|
||||||
|
assert_struct_size(rct_g1_element_32bit, 0x10);
|
||||||
|
#pragma pack(pop)
|
||||||
|
|
||||||
/* number of elements is stored in g1.dat, but because the entry
|
/* number of elements is stored in g1.dat, but because the entry
|
||||||
* headers are static, this can't be variable until made into a
|
* headers are static, this can't be variable until made into a
|
||||||
* dynamic array.
|
* dynamic array.
|
||||||
|
@ -91,9 +105,8 @@ int gfx_load_g1()
|
||||||
SDL_RWclose(file);
|
SDL_RWclose(file);
|
||||||
|
|
||||||
// Fix entry data offsets
|
// Fix entry data offsets
|
||||||
for (i = 0; i < header.num_entries; i++) {
|
for (i = 0; i < header.num_entries; i++)
|
||||||
g1Elements[i].offset += (uintptr_t)_g1Buffer;
|
g1Elements[i].offset += (uintptr_t)_g1Buffer;
|
||||||
}
|
|
||||||
|
|
||||||
// Successful
|
// Successful
|
||||||
return 1;
|
return 1;
|
||||||
|
|
1358
src/object.c
1358
src/object.c
File diff suppressed because it is too large
Load Diff
|
@ -140,11 +140,10 @@ char *object_get_name(rct_object_entry *entry);
|
||||||
|
|
||||||
rct_object_filters *get_object_filter(int index);
|
rct_object_filters *get_object_filter(int index);
|
||||||
|
|
||||||
uint8* object_load(int type, void *objectEntry, uint32 entryIndex, int *chunkSize);
|
bool object_load(int type, void *objectEntry, uint32 entryIndex);
|
||||||
void object_unload(int type, void *objectEntry);
|
void object_unload(int type, void *objectEntry);
|
||||||
bool object_test(int type, void *objectEntry);
|
bool object_test(int type, void *objectEntry);
|
||||||
void object_paint(int type, void *objectEntry, rct_drawpixelinfo *dpi, sint32 x, sint32 y);
|
void object_paint(int type, void *objectEntry, rct_drawpixelinfo *dpi, sint32 x, sint32 y);
|
||||||
rct_string_id object_desc(int type, void *objectEntry);
|
rct_string_id object_desc(int type, void *objectEntry);
|
||||||
void object_reset(int type, void *objectEntry, uint32 entryIndex);
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
#include "world/scenery.h"
|
#include "world/scenery.h"
|
||||||
#include "world/water.h"
|
#include "world/water.h"
|
||||||
|
|
||||||
#define PLUGIN_VERSION 5
|
#define PLUGIN_VERSION 4
|
||||||
#define FILTER_VERSION 1
|
#define FILTER_VERSION 1
|
||||||
|
|
||||||
typedef struct rct_plugin_header {
|
typedef struct rct_plugin_header {
|
||||||
|
@ -236,7 +236,7 @@ void reset_loaded_objects()
|
||||||
for (int j = 0; j < object_entry_group_counts[type]; j++){
|
for (int j = 0; j < object_entry_group_counts[type]; j++){
|
||||||
uint8* chunk = object_entry_groups[type].chunks[j];
|
uint8* chunk = object_entry_groups[type].chunks[j];
|
||||||
if (chunk != (uint8*)-1)
|
if (chunk != (uint8*)-1)
|
||||||
object_reset(type, chunk, j);
|
object_load(type, chunk, j);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -571,7 +571,7 @@ bool openrct2_setup_rct2_segment()
|
||||||
}
|
}
|
||||||
#endif // defined(__unix__)
|
#endif // defined(__unix__)
|
||||||
|
|
||||||
#if !defined(NO_RCT2) && !defined(__WINDOWS__)
|
#if !defined(NO_RCT2) || !defined(__WINDOWS__)
|
||||||
// Check that the expected data is at various addresses.
|
// Check that the expected data is at various addresses.
|
||||||
// Start at 0x9a6000, which is start of .data, to skip the region containing addresses to DLL
|
// Start at 0x9a6000, which is start of .data, to skip the region containing addresses to DLL
|
||||||
// calls, which can be changed by windows/wine loader.
|
// calls, which can be changed by windows/wine loader.
|
||||||
|
|
15
src/rct1.c
15
src/rct1.c
|
@ -78,11 +78,7 @@ bool rct1_read_sv4(const char *path, rct1_s4 *s4)
|
||||||
return success;
|
return success;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
bool rideTypeShouldLoseSeparateFlag(rct_ride_entry *rideEntry)
|
||||||
* Only to be used when loading 32 bit items from files, otherwise use
|
|
||||||
* rideTypeShouldLoseSeparateFlag.
|
|
||||||
*/
|
|
||||||
bool rideTypeShouldLoseSeparateFlagByRideType(uint8 ride_type[3])
|
|
||||||
{
|
{
|
||||||
if (!gConfigInterface.select_by_track_type) {
|
if (!gConfigInterface.select_by_track_type) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -90,21 +86,16 @@ bool rideTypeShouldLoseSeparateFlagByRideType(uint8 ride_type[3])
|
||||||
|
|
||||||
bool remove_flag = true;
|
bool remove_flag = true;
|
||||||
for (int j = 0; j < 3; j++) {
|
for (int j = 0; j < 3; j++) {
|
||||||
if (ride_type_has_flag(ride_type[j], RIDE_TYPE_FLAG_FLAT_RIDE)) {
|
if (ride_type_has_flag(rideEntry->ride_type[j], RIDE_TYPE_FLAG_FLAT_RIDE)) {
|
||||||
remove_flag = false;
|
remove_flag = false;
|
||||||
}
|
}
|
||||||
if (ride_type[j] == RIDE_TYPE_MAZE || ride_type[j] == RIDE_TYPE_MINI_GOLF) {
|
if (rideEntry->ride_type[j] == RIDE_TYPE_MAZE || rideEntry->ride_type[j] == RIDE_TYPE_MINI_GOLF) {
|
||||||
remove_flag = false;
|
remove_flag = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return remove_flag;
|
return remove_flag;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool rideTypeShouldLoseSeparateFlag(rct_ride_entry *rideEntry)
|
|
||||||
{
|
|
||||||
return rideTypeShouldLoseSeparateFlagByRideType(rideEntry->ride_type);
|
|
||||||
}
|
|
||||||
|
|
||||||
const uint8 gRideCategories[] = {
|
const uint8 gRideCategories[] = {
|
||||||
2, // Spiral Roller coaster
|
2, // Spiral Roller coaster
|
||||||
2, // Stand Up Coaster
|
2, // Stand Up Coaster
|
||||||
|
|
|
@ -746,7 +746,6 @@ void rct1_import_s4(rct1_s4 *s4);
|
||||||
void rct1_fix_landscape();
|
void rct1_fix_landscape();
|
||||||
int vehicle_preference_compare(uint8 rideType, const char * a, const char * b);
|
int vehicle_preference_compare(uint8 rideType, const char * a, const char * b);
|
||||||
bool rideTypeShouldLoseSeparateFlag(rct_ride_entry *rideEntry);
|
bool rideTypeShouldLoseSeparateFlag(rct_ride_entry *rideEntry);
|
||||||
bool rideTypeShouldLoseSeparateFlagByRideType(uint8 ride_type[3]);
|
|
||||||
|
|
||||||
bool rct1_load_saved_game(const char *path);
|
bool rct1_load_saved_game(const char *path);
|
||||||
bool rct1_load_scenario(const char *path);
|
bool rct1_load_scenario(const char *path);
|
||||||
|
|
|
@ -31,7 +31,6 @@
|
||||||
#include "../management/news_item.h"
|
#include "../management/news_item.h"
|
||||||
#include "../network/network.h"
|
#include "../network/network.h"
|
||||||
#include "../object_list.h"
|
#include "../object_list.h"
|
||||||
#include "../openrct2.h"
|
|
||||||
#include "../peep/peep.h"
|
#include "../peep/peep.h"
|
||||||
#include "../peep/staff.h"
|
#include "../peep/staff.h"
|
||||||
#include "../rct1.h"
|
#include "../rct1.h"
|
||||||
|
@ -6923,11 +6922,9 @@ void set_vehicle_type_image_max_sizes(rct_ride_entry_vehicle* vehicle_type, int
|
||||||
.zoom_level = 0
|
.zoom_level = 0
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!gOpenRCT2Headless) {
|
|
||||||
for (int i = 0; i < num_images; ++i){
|
for (int i = 0; i < num_images; ++i){
|
||||||
gfx_draw_sprite_software(&dpi, vehicle_type->base_image_id + i, 0, 0, 0);
|
gfx_draw_sprite_software(&dpi, vehicle_type->base_image_id + i, 0, 0, 0);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
int al = -1;
|
int al = -1;
|
||||||
for (int i = 99; i != 0; --i){
|
for (int i = 99; i != 0; --i){
|
||||||
for (int j = 0; j < 200; j++){
|
for (int j = 0; j < 200; j++){
|
||||||
|
|
|
@ -122,7 +122,9 @@ typedef struct rct_ride_entry {
|
||||||
uint8 shop_item; // 0x1C0
|
uint8 shop_item; // 0x1C0
|
||||||
uint8 shop_item_secondary; // 0x1C1
|
uint8 shop_item_secondary; // 0x1C1
|
||||||
} rct_ride_entry;
|
} rct_ride_entry;
|
||||||
// FIXME: unpack
|
#ifdef PLATFORM_32BIT
|
||||||
|
assert_struct_size(rct_ride_entry, 0x1c2);
|
||||||
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Ride structure.
|
* Ride structure.
|
||||||
|
|
|
@ -77,7 +77,9 @@ typedef struct rct_ride_entry_vehicle {
|
||||||
uint8 special_frames; // 0x60 , 0x7A
|
uint8 special_frames; // 0x60 , 0x7A
|
||||||
sint8* peep_loading_positions; // 0x61 , 0x7B
|
sint8* peep_loading_positions; // 0x61 , 0x7B
|
||||||
} rct_ride_entry_vehicle;
|
} rct_ride_entry_vehicle;
|
||||||
// FIXME: unpack
|
#ifdef PLATFORM_32BIT
|
||||||
|
assert_struct_size(rct_ride_entry_vehicle, 0x65);
|
||||||
|
#endif
|
||||||
|
|
||||||
typedef struct rct_vehicle {
|
typedef struct rct_vehicle {
|
||||||
uint8 sprite_identifier; // 0x00
|
uint8 sprite_identifier; // 0x00
|
||||||
|
|
|
@ -21,18 +21,20 @@
|
||||||
#include "../object.h"
|
#include "../object.h"
|
||||||
#include "../world/map.h"
|
#include "../world/map.h"
|
||||||
|
|
||||||
|
#pragma pack(push, 1)
|
||||||
typedef struct rct_small_scenery_entry {
|
typedef struct rct_small_scenery_entry {
|
||||||
uint32 flags; // 0x06
|
uint32 flags; // 0x06
|
||||||
uint8 height; // 0x0A
|
uint8 height; // 0x0A
|
||||||
uint8 tool_id; // 0x0B
|
uint8 tool_id; // 0x0B
|
||||||
sint16 price; // 0x0C
|
sint16 price; // 0x0C
|
||||||
sint16 removal_price; // 0x0E
|
sint16 removal_price; // 0x0E
|
||||||
uintptr_t var_10;
|
uint32 var_10;
|
||||||
uint16 var_14;
|
uint16 var_14;
|
||||||
uint16 var_16;
|
uint16 var_16;
|
||||||
uint16 var_18;
|
uint16 var_18;
|
||||||
uint8 scenery_tab_id; // 0x1A
|
uint8 scenery_tab_id; // 0x1A
|
||||||
} rct_small_scenery_entry;
|
} rct_small_scenery_entry;
|
||||||
|
assert_struct_size(rct_small_scenery_entry, 21);
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
SMALL_SCENERY_FLAG_FULL_TILE = (1 << 0), // 0x1
|
SMALL_SCENERY_FLAG_FULL_TILE = (1 << 0), // 0x1
|
||||||
|
@ -65,7 +67,6 @@ typedef enum {
|
||||||
SMALL_SCENERY_FLAG27 = (1 << 27), // 0x8000000
|
SMALL_SCENERY_FLAG27 = (1 << 27), // 0x8000000
|
||||||
} SMALL_SCENERY_FLAGS;
|
} SMALL_SCENERY_FLAGS;
|
||||||
|
|
||||||
#pragma pack(push, 1)
|
|
||||||
typedef struct rct_large_scenery_tile {
|
typedef struct rct_large_scenery_tile {
|
||||||
sint16 x_offset;
|
sint16 x_offset;
|
||||||
sint16 y_offset;
|
sint16 y_offset;
|
||||||
|
@ -103,7 +104,9 @@ typedef struct rct_large_scenery_entry {
|
||||||
rct_large_scenery_text* text; // 0x12
|
rct_large_scenery_text* text; // 0x12
|
||||||
uint32 text_image; // 0x16
|
uint32 text_image; // 0x16
|
||||||
} rct_large_scenery_entry;
|
} rct_large_scenery_entry;
|
||||||
// FIXME: unpack
|
#ifdef PLATFORM_32BIT
|
||||||
|
assert_struct_size(rct_large_scenery_entry, 20);
|
||||||
|
#endif
|
||||||
|
|
||||||
typedef struct rct_wall_scenery_entry {
|
typedef struct rct_wall_scenery_entry {
|
||||||
uint8 tool_id; // 0x06
|
uint8 tool_id; // 0x06
|
||||||
|
@ -159,7 +162,9 @@ typedef struct rct_scenery_entry {
|
||||||
rct_banner_scenery_entry banner;
|
rct_banner_scenery_entry banner;
|
||||||
};
|
};
|
||||||
} rct_scenery_entry;
|
} rct_scenery_entry;
|
||||||
// FIXME: unpack?
|
#ifdef PLATFORM_32BIT
|
||||||
|
assert_struct_size(rct_scenery_entry, 6 + 21);
|
||||||
|
#endif
|
||||||
|
|
||||||
typedef struct rct_scenery_set_entry {
|
typedef struct rct_scenery_set_entry {
|
||||||
rct_string_id name; // 0x00
|
rct_string_id name; // 0x00
|
||||||
|
|
Loading…
Reference in New Issue