1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2025-12-24 00:03:11 +01:00

add more map definitions

This commit is contained in:
IntelOrca
2014-04-10 04:02:06 +01:00
parent ea83736d5a
commit 9e9daaedfa
3 changed files with 126 additions and 30 deletions

View File

@@ -108,17 +108,6 @@ void game_logic_update()
if (RCT2_GLOBAL(0x009DEA66, sint16) == 0)
RCT2_GLOBAL(0x009DEA66, sint16)--;
{
int i;
rct_map_element *mapElement = RCT2_ADDRESS(RCT2_ADDRESS_MAP_ELEMENTS, rct_map_element);
for (i = 0; i < MAX_MAP_ELEMENTS; i++) {
if (mapElement->var_0 == 0) {
// mapElement->var_0 = 2;
}
mapElement++;
}
}
RCT2_CALLPROC_EBPSAFE(0x0068B089);
RCT2_CALLPROC_EBPSAFE(0x006C44B1); // update_objective
RCT2_CALLPROC_EBPSAFE(0x006C46B1); // update_climate

View File

@@ -43,14 +43,14 @@ void map_init()
for (i = 0; i < MAX_TILE_MAP_ELEMENT_POINTERS; i++) {
map_element = GET_MAP_ELEMENT(i);
map_element->var_0 = 0;
map_element->var_1 = 128;
map_element->var_2 = 14;
map_element->var_3 = 14;
map_element->var_4 = 0;
map_element->var_5 = 0;
map_element->var_6 = 1;
map_element->var_7 = 0;
map_element->type = 0;
map_element->flags = MAP_ELEMENT_FLAG_LAST_TILE;
map_element->base_height = 14;
map_element->clearance_height = 14;
map_element->properties.surface.slope = 0;
map_element->properties.surface.terrain = 0;
map_element->properties.surface.grass_length = 1;
map_element->properties.surface.ownership = 0;
}
RCT2_GLOBAL(0x013B0E70, sint16) = 0;
@@ -84,7 +84,7 @@ static void tiles_init()
for (x = 0; x < 256; x++) {
*tile++ = mapElement;
do {
lastTile = (mapElement->var_1 & 128);
lastTile = (mapElement->flags & MAP_ELEMENT_FLAG_LAST_TILE);
mapElement++;
} while (!lastTile);
}

127
src/map.h
View File

@@ -23,33 +23,140 @@
#include "rct2.h"
typedef struct {
uint8 slope;
uint8 terrain;
uint8 grass_length;
uint8 ownership;
} rct_map_element_surface_properties;
typedef struct {
uint8 type;
uint8 additions;
uint8 edges;
uint8 addition_status;
} rct_map_element_path_properties;
typedef struct {
uint8 type;
uint8 sequence;
uint8 colour;
uint8 ride_index;
} rct_map_element_track_properties;
typedef struct {
uint8 type;
uint8 age;
uint8 colour;
uint8 unused;
} rct_map_element_scenery_properties;
typedef struct {
uint8 type;
uint8 index;
uint8 path_type;
uint8 ride_index;
} rct_map_element_entrance_properties;
typedef struct {
uint8 slope;
uint8 item[3];
} rct_map_element_fence_properties;
typedef struct {
uint8 type;
uint8 index;
uint8 colour[2];
} rct_map_element_scenerymultiple_properties;
typedef struct {
uint8 index;
uint8 position;
uint8 flags;
uint8 unused;
} rct_map_element_banner_properties;
typedef union {
rct_map_element_surface_properties surface;
rct_map_element_path_properties path;
rct_map_element_track_properties track;
rct_map_element_scenery_properties scenery;
rct_map_element_entrance_properties entrance;
rct_map_element_fence_properties fence;
rct_map_element_scenerymultiple_properties scenerymultiple;
rct_map_element_banner_properties banner;
} rct_map_element_properties;
/**
* Map element structure
* size: 0x08
*/
typedef struct {
sint8 var_0;
sint8 var_1;
sint8 var_2;
sint8 var_3;
sint8 var_4;
sint8 var_5;
sint8 var_6;
sint8 var_7;
uint8 type;
uint8 flags;
uint8 base_height;
uint8 clearance_height;
rct_map_element_properties properties;
} rct_map_element;
enum {
MAP_ELEMENT_TYPE_UNKNOWN = (0 << 2),
MAP_ELEMENT_QUADRANT_SW,
MAP_ELEMENT_QUADRANT_NW,
MAP_ELEMENT_QUADRANT_NE,
MAP_ELEMENT_QUADRANT_SE
};
enum {
MAP_ELEMENT_TYPE_SURFACE = (0 << 2),
MAP_ELEMENT_TYPE_PATH = (1 << 2),
MAP_ELEMENT_TYPE_TRACK = (2 << 2),
MAP_ELEMENT_TYPE_SCENERY = (3 << 2),
MAP_ELEMENT_TYPE_ENTRANCE = (4 << 2),
MAP_ELEMENT_TYPE_FENCE = (5 << 2),
MAP_ELEMENT_TYPE_SCENERY_M = (6 << 2),
MAP_ELEMENT_TYPE_SCENERY_MULTIPLE = (6 << 2),
MAP_ELEMENT_TYPE_BANNER = (7 << 2)
};
enum {
MAP_ELEMENT_DIRECTION_WEST,
MAP_ELEMENT_DIRECTION_NORTH,
MAP_ELEMENT_DIRECTION_EAST,
MAP_ELEMENT_DIRECTION_SOUTH
};
enum {
MAP_ELEMENT_FLAG_LAST_TILE = (1 << 7)
};
enum {
TERRAIN_GRASS,
TERRAIN_SAND,
TERRAIN_DIRT,
TERRAIN_ROCK,
TERRAIN_MARTIAN,
TERRAIN_CHECKERBOARD,
TERRAIN_DIRTGRASS
};
enum {
PATH_QUEUE,
PATH_TARMAC,
PATH_DIRT,
PATH_CRAZY,
PATH_ROAD,
PATH_TILE
};
enum {
ENTRANCE_TYPE_RIDE_ENTRANCE,
ENTRANCE_TYPE_RIDE_EXIT,
ENTRANCE_TYPE_PARK_ENTRANCE
};
#define MAP_ELEMENT_QUADRANT_MASK 0xC0
#define MAP_ELEMENT_TYPE_MASK 0x3C
#define MAP_ELEMENT_DIRECTION_MASK 0x03
#define MAX_MAP_ELEMENTS 196608
#define MAX_TILE_MAP_ELEMENT_POINTERS (256 * 256)