Merge pull request #4548 from janisozaur/compilation-fixes

Compilation fixes
This commit is contained in:
Ted John 2016-10-06 23:42:59 +01:00 committed by GitHub
commit 5a77355377
25 changed files with 35 additions and 50 deletions

View File

@ -59,8 +59,6 @@ private:
GLuint _vbo;
GLuint _vboInstances;
GLuint _vao;
SDL_Color _palette[256];
public:
DrawImageShader();

View File

@ -1016,7 +1016,9 @@ void OpenGLDrawingContext::FlushImages()
void OpenGLDrawingContext::SetDPI(rct_drawpixelinfo * dpi)
{
rct_drawpixelinfo * screenDPI = _engine->GetDPI();
#ifndef NDEBUG
size_t bitsSize = (size_t)screenDPI->height * (size_t)(screenDPI->width + screenDPI->pitch);
#endif
size_t bitsOffset = (size_t)(dpi->bits - screenDPI->bits);
assert(bitsOffset < bitsSize);

View File

@ -35,9 +35,6 @@ extern "C"
struct WindowThemeDesc;
// Don't try to load theme files that exceed 64 MiB
constexpr uint64 MAX_THEME_SIZE = 64 * 1024 * 1024;
/**
* Represents a window theming style such as the colour scheme.
*/

View File

@ -179,7 +179,7 @@ void screenshot_giant()
int centreX = (mapSize / 2) * 32 + 16;
int centreY = (mapSize / 2) * 32 + 16;
int x, y;
int x = 0, y = 0;
int z = map_element_height(centreX, centreY) & 0xFFFF;
switch (rotation) {
case 0:
@ -254,7 +254,7 @@ int cmdline_for_screenshot(const char **argv, int argc)
bool customLocation = false;
bool centreMapX = false;
bool centreMapY = false;
int resolutionWidth, resolutionHeight, customX, customY, customZoom, customRotation;
int resolutionWidth, resolutionHeight, customX = 0, customY = 0, customZoom, customRotation;
const char *inputPath = argv[0];
const char *outputPath = argv[1];
@ -320,7 +320,7 @@ int cmdline_for_screenshot(const char **argv, int argc)
if (centreMapY)
customY = (mapSize / 2) * 32 + 16;
int x, y;
int x = 0, y = 0;
int z = map_element_height(customX, customY) & 0xFFFF;
switch (customRotation) {
case 0:

View File

@ -84,9 +84,6 @@ enum {
SERVER_EVENT_PLAYER_DISCONNECTED,
};
constexpr int MASTER_SERVER_REGISTER_TIME = 120 * 1000; // 2 minutes
constexpr int MASTER_SERVER_HEARTBEAT_TIME = 60 * 1000; // 1 minute
void network_chat_show_connected_message();
void network_chat_show_server_greeting();
static void network_get_keys_directory(utf8 *buffer, size_t bufferSize);

View File

@ -50,8 +50,10 @@
int gExitCode;
#if defined(USE_MMAP) && (defined(__unix__) || defined(__MACOSX__)) && !defined(NO_RCT2)
static int fdData = -1;
#endif
#if defined(__unix__) && !defined(NO_RCT2)
static int fdData;
static char * segments = (char *)(GOOD_PLACE_FOR_DATA_SEGMENT);
#endif

View File

@ -251,8 +251,8 @@ void fence_paint(uint8 direction, int height, rct_map_element * map_element)
}
uint32 imageOffset;
rct_xyz16 offset, bounds, boundsOffset;
uint32 imageOffset = 0;
rct_xyz16 offset = { 0, 0, 0 }, bounds = { 0, 0, 0 }, boundsOffset;
switch (direction) {
case 0:

View File

@ -104,7 +104,7 @@ static void blank_tiles_paint(int x, int y)
{
rct_drawpixelinfo *dpi = unk_140E9A8;
int dx;
int dx = 0;
switch (get_current_rotation()) {
case 0:
dx = x + y;

View File

@ -295,7 +295,7 @@ paint_struct * sub_98196C(
g_ps_F1AD28 = ps;
sint32 edi;
sint32 edi = 0;
switch (rotation) {
case 0:
edi = coord_3d.y + coord_3d.x;

View File

@ -9204,7 +9204,7 @@ static int guest_path_find_park_entrance(rct_peep* peep, rct_map_element *map_el
* param dist is not used.
*/
static void get_ride_queue_end(sint16 *x, sint16 *y, sint16 *z){
rct_xy16 result;
rct_xy16 result = { 0, 0 };
rct_map_element *mapElement = map_get_first_element_at(*x / 32, *y / 32);
bool found = false;
@ -9461,7 +9461,7 @@ static int guest_path_finding(rct_peep* peep)
* At the same time, count how many entrance stations there are and
* which stations are entrance stations. */
uint16 closestDist = 0xFFFF;
uint8 closestStationNum;
uint8 closestStationNum = 0;
int numEntranceStations = 0;
uint8 entranceStations = 0;

View File

@ -150,11 +150,11 @@ static std::wstring GetDumpDirectory()
return result;
}
#endif // USE_BREAKPAD
// Using non-null pipe name here lets breakpad try setting OOP crash handling
constexpr const wchar_t * PipeName = L"openrct2-bpad";
#endif // USE_BREAKPAD
extern "C" CExceptionHandler crash_init()
{
#ifdef USE_BREAKPAD

View File

@ -3267,7 +3267,7 @@ static void junior_rc_left_eighth_to_diag_paint_setup(uint8 rideIndex, uint8 tra
paint_util_push_tunnel_right(height, TUNNEL_0);
}
int blockedSegments;
int blockedSegments = 0;
switch (trackSequence) {
case 0: blockedSegments = SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC; break;
case 1: blockedSegments = SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_B8 | SEGMENT_C8 | SEGMENT_B4; break;
@ -3304,7 +3304,7 @@ static void junior_rc_right_eighth_to_diag_paint_setup(uint8 rideIndex, uint8 tr
paint_util_push_tunnel_right(height, TUNNEL_0);
}
int blockedSegments;
int blockedSegments = 0;
switch (trackSequence) {
case 0: blockedSegments = SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC; break;
case 1: blockedSegments = SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_C0 | SEGMENT_D4 | SEGMENT_BC; break;
@ -3438,7 +3438,7 @@ static void junior_rc_left_eighth_to_diag_bank_paint_setup(uint8 rideIndex, uint
paint_util_push_tunnel_right(height, TUNNEL_0);
}
int blockedSegments;
int blockedSegments = 0;
switch (trackSequence) {
case 0: blockedSegments = SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC; break;
case 1: blockedSegments = SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_B8 | SEGMENT_C8 | SEGMENT_B4; break;
@ -3556,7 +3556,7 @@ static void junior_rc_right_eighth_to_diag_bank_paint_setup(uint8 rideIndex, uin
paint_util_push_tunnel_right(height, TUNNEL_0);
}
int blockedSegments;
int blockedSegments = 0;
switch (trackSequence) {
case 0: blockedSegments = SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC; break;
case 1: blockedSegments = SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_C0 | SEGMENT_D4 | SEGMENT_BC; break;

View File

@ -441,7 +441,6 @@ static void wild_mouse_track_right_quarter_turn_3(uint8 rideIndex, uint8 trackSe
{ SPR_WILD_MOUSE_QUARTER_TURN_3_SE_NE_PART_2, { 0, 0, 0 }, { 0, 6, 0 }, { 32, 20, 3 } },
}
};
static uint8 supportType[] = { 4, 5, 2, 3 };
track_paint_util_right_quarter_turn_3_tiles_paint_3(height, direction, get_current_rotation(), trackSequence, gTrackColours[SCHEME_TRACK], imageIds);
track_paint_util_right_quarter_turn_3_tiles_tunnel(height, direction, trackSequence, TUNNEL_0);
@ -591,7 +590,6 @@ static void wild_mouse_track_left_quarter_turn_1(uint8 rideIndex, uint8 trackSeq
SPR_WILD_MOUSE_QUARTER_TURN_1_NE_SW,
SPR_WILD_MOUSE_QUARTER_TURN_1_SE_NW,
};
static uint8 supportType[] = { 5, 2, 3, 4 };
uint32 imageId = imageIds[direction] | gTrackColours[SCHEME_TRACK];
switch (direction) {

View File

@ -62,7 +62,7 @@ static void maze_paint_setup(uint8 rideIndex, uint8 trackSequence, uint8 directi
paint_util_set_segment_support_height(SEGMENTS_ALL & ~SEGMENT_C4, 0xFFFF, 0);
int base_image_id;
int base_image_id = 0;
switch (get_ride(rideIndex)->track_colour_supports[0]) {
case 0: base_image_id = SPR_MAZE_BASE_BRICK; break;
case 1: base_image_id = SPR_MAZE_BASE_HEDGE; break;

View File

@ -52,7 +52,7 @@ enum {
};
static void spiral_slide_paint_tile_right(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) {
uint32 image_id;
uint32 image_id = 0;
if (direction == 0) image_id = SPIRAL_SLIDE_RIGHT_R0 | gTrackColours[SCHEME_TRACK];
if (direction == 1) image_id = SPIRAL_SLIDE_RIGHT_R1 | gTrackColours[SCHEME_TRACK];
@ -64,7 +64,7 @@ static void spiral_slide_paint_tile_right(uint8 rideIndex, uint8 trackSequence,
}
static void spiral_slide_paint_tile_left(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) {
uint32 image_id;
uint32 image_id = 0;
if (direction == 0) image_id = SPIRAL_SLIDE_LEFT_R0 | gTrackColours[SCHEME_TRACK];
if (direction == 1) image_id = SPIRAL_SLIDE_LEFT_R1 | gTrackColours[SCHEME_TRACK];
@ -75,9 +75,7 @@ static void spiral_slide_paint_tile_left(uint8 rideIndex, uint8 trackSequence, u
}
static void spiral_slide_paint_tile_front(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) {
uint32 image_id;
uint32 image_id = 0;
rct_ride *ride = get_ride(rideIndex);

View File

@ -3434,7 +3434,7 @@ void ride_set_map_tooltip(rct_map_element *mapElement)
int ride_music_params_update(sint16 x, sint16 y, sint16 z, uint8 rideIndex, uint16 sampleRate, uint32 position, uint8 *tuneId)
{
if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !gGameSoundsOff && g_music_tracking_viewport != (rct_viewport*)-1) {
rct_xy16 rotatedCoords;
rct_xy16 rotatedCoords = { 0, 0 };
switch (get_current_rotation()) {
case 0:

View File

@ -529,7 +529,7 @@ static void ride_ratings_score_close_proximity(rct_map_element *inputMapElement)
proximity_score_increment(PROXIMITY_FOREIGN_TRACK_TOUCH_ABOVE);
}
if (inputMapElement->clearance_height + 2 == mapElement->base_height) {
if (inputMapElement->clearance_height + 10 >= mapElement->base_height) {
if ((uint8)(inputMapElement->clearance_height + 10) >= mapElement->base_height) {
proximity_score_increment(PROXIMITY_FOREIGN_TRACK_CLOSE_ABOVE);
}
}

View File

@ -209,7 +209,7 @@ bool gUseOriginalRidePaint = false;
bool track_paint_util_has_fence(enum edge edge, rct_xy16 position, rct_map_element * mapElement, rct_ride * ride, uint8 rotation)
{
rct_xy16 offset;
rct_xy16 offset = { 0, 0 };
switch (edge) {
case EDGE_NE:
offset = loc_7667AC[rotation];
@ -427,8 +427,8 @@ bool track_paint_util_draw_station_covers(enum edge edge, bool hasFence, const r
uint32 imageId;
uint32 baseImageId = entranceStyle->base_image_id;
int imageOffset;
rct_xyz16 offset, bounds, boundsOffset;
int imageOffset = 0;
rct_xyz16 offset, bounds = { 0, 0, 0 }, boundsOffset = { 0, 0, 0 };
offset = (rct_xyz16) {0, 0, height};
switch (edge) {

View File

@ -850,7 +850,7 @@ static void paint_monorail_track_left_eighth_to_diag(uint8 rideIndex, uint8 trac
paint_util_push_tunnel_right(height, TUNNEL_0);
}
int blockedSegments;
int blockedSegments = 0;
switch (trackSequence) {
case 0: blockedSegments = SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC; break;
case 1: blockedSegments = SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_B8 | SEGMENT_C8 | SEGMENT_B4; break;
@ -894,7 +894,7 @@ static void paint_monorail_track_right_eighth_to_diag(uint8 rideIndex, uint8 tra
paint_util_push_tunnel_right(height, TUNNEL_0);
}
int blockedSegments;
int blockedSegments = 0;
switch (trackSequence) {
case 0: blockedSegments = SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC; break;
case 1: blockedSegments = SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_C0 | SEGMENT_D4 | SEGMENT_BC; break;

View File

@ -187,8 +187,6 @@ static void paint_log_flume_track_flat(uint8 rideIndex, uint8 trackSequence, uin
static void paint_log_flume_track_station(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement)
{
rct_ride *ride = get_ride(rideIndex);
uint32 imageId = LogFlumeTrackFlatImageIds[direction][0] | gTrackColours[SCHEME_TRACK];
sub_98197C_rotated(direction, imageId, 0, 0, 32, 20, 1, height, 0, 6, height + 3);

View File

@ -25,6 +25,7 @@
#include "../../paint/supports.h"
#include "../../world/map.h"
#ifndef NO_VEHICLES
// 0x0099279E:
static const vehicle_boundbox _riverRapidsBoundbox[] = {
{ -13, -13, 1, 26, 26, 13 },
@ -37,6 +38,7 @@ static const vehicle_boundbox _riverRapidsBoundbox[] = {
{ -13, -13, 1, 26, 26, 13 },
{ -13, -13, 1, 26, 26, 13 }
};
#endif
enum
{

View File

@ -244,7 +244,7 @@ static bool browse(bool isSave, char *path)
desc.type = isSave ? FD_SAVE : FD_OPEN;
desc.default_filename = isSave ? path : NULL;
rct_string_id title;
rct_string_id title = STR_NONE;
switch (_type & 0x0E) {
case LOADSAVETYPE_GAME:
title = isSave ? STR_FILE_DIALOG_TITLE_SAVE_GAME : STR_FILE_DIALOG_TITLE_LOAD_GAME;

View File

@ -1230,7 +1230,7 @@ static void sub_666EEF(int x, int y, sint16 *mapX, sint16 *mapY, sint16 *mapZ, i
*/
static void window_map_place_park_entrance_tool_update(int x, int y)
{
sint16 mapX, mapY, mapZ;
sint16 mapX, mapY, mapZ = 0;
int direction, sideDirection;
map_invalidate_selection_rect();

View File

@ -367,7 +367,6 @@ static void printImageId(uint32 input, utf8string *out) {
uint32 image = input & 0x7FFFF;
uint32 palette = input & ~0x7FFFF;
bool allocated = false;
utf8string paletteName;
if (palette == DEFAULT_SCHEME_TRACK)paletteName = "SCHEME_TRACK";
else if (palette == DEFAULT_SCHEME_SUPPORTS)paletteName = "SCHEME_SUPPORTS";
@ -528,7 +527,6 @@ static bool testTrackElement(uint8 rideType, uint8 trackType, utf8string *error)
rct_drawpixelinfo dpi = {.zoom_level = 1};
unk_140E9A8 = &dpi;
rct_vehicle vehicle = { 0 };
rct_ride ride = { 0 };
rct_ride_entry rideEntry = { 0 };
@ -626,8 +624,6 @@ static bool testTrackElement(uint8 rideType, uint8 trackType, utf8string *error)
}
}
sprintf(*error + strlen(*error), "");
bool segmentSuccess = testSupportSegments(rideType, trackType);
if (!segmentSuccess) {
return false;

View File

@ -327,7 +327,6 @@ namespace Intercept2
dpi.zoom_level = 1;
unk_140E9A8 = &dpi;
rct_vehicle vehicle = {0};
rct_ride ride = {0};
rct_ride_entry rideEntry = {0};
@ -526,7 +525,6 @@ namespace Intercept2
dpi.zoom_level = 1;
unk_140E9A8 = &dpi;
rct_vehicle vehicle = {0};
rct_ride ride = {0};
rct_ride_entry rideEntry = {0};
@ -723,7 +721,6 @@ namespace Intercept2
dpi.zoom_level = 1;
unk_140E9A8 = &dpi;
rct_vehicle vehicle = {0};
rct_ride ride = {0};
rct_ride_entry rideEntry = {0};