mirror of https://github.com/OpenRCT2/OpenRCT2.git
Remove trailing whitespace in sources
This commit is contained in:
parent
9fed68bf6f
commit
3f7fd56328
|
@ -343,7 +343,7 @@ namespace ScenarioSources
|
||||||
String::Set(buffer, bufferSize, name + 3);
|
String::Set(buffer, bufferSize, name + 3);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Trim (for the sake of the above and WW / TT scenarios
|
// Trim (for the sake of the above and WW / TT scenarios
|
||||||
String::TrimStart(buffer, bufferSize, name);
|
String::TrimStart(buffer, bufferSize, name);
|
||||||
|
|
||||||
|
|
|
@ -358,7 +358,7 @@ static void cheat_explode_guests()
|
||||||
rct_peep *peep;
|
rct_peep *peep;
|
||||||
|
|
||||||
FOR_ALL_GUESTS(sprite_index, peep) {
|
FOR_ALL_GUESTS(sprite_index, peep) {
|
||||||
// To prevent blowing up peeps that will break
|
// To prevent blowing up peeps that will break
|
||||||
// ride vehicle logic.
|
// ride vehicle logic.
|
||||||
if (peep->state == PEEP_STATE_ENTERING_RIDE ||
|
if (peep->state == PEEP_STATE_ENTERING_RIDE ||
|
||||||
peep->state == PEEP_STATE_QUEUING_FRONT ||
|
peep->state == PEEP_STATE_QUEUING_FRONT ||
|
||||||
|
|
|
@ -75,7 +75,7 @@ bool CommandLineArgEnumerator::TryPopInteger(sint32 * result)
|
||||||
*result = (sint32)atol(arg);
|
*result = (sint32)atol(arg);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -87,7 +87,7 @@ bool CommandLineArgEnumerator::TryPopReal(float * result)
|
||||||
*result = (float)atof(arg);
|
*result = (float)atof(arg);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -418,7 +418,7 @@ namespace CommandLine
|
||||||
Console::Error::WriteLine("Expected value for option: %s", optionName);
|
Console::Error::WriteLine("Expected value for option: %s", optionName);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!ParseOptionValue(option, valueString))
|
if (!ParseOptionValue(option, valueString))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
|
@ -484,7 +484,7 @@ namespace CommandLine
|
||||||
Console::Error::WriteLine("Expected value for option: %c", option->ShortName);
|
Console::Error::WriteLine("Expected value for option: %c", option->ShortName);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!ParseOptionValue(option, valueString))
|
if (!ParseOptionValue(option, valueString))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -236,7 +236,7 @@ exitcode_t HandleNoCommand(CommandLineArgEnumerator * enumerator)
|
||||||
gOpenRCT2StartupAction = STARTUP_ACTION_OPEN;
|
gOpenRCT2StartupAction = STARTUP_ACTION_OPEN;
|
||||||
}
|
}
|
||||||
|
|
||||||
return EXITCODE_CONTINUE;
|
return EXITCODE_CONTINUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
exitcode_t HandleCommandEdit(CommandLineArgEnumerator * enumerator)
|
exitcode_t HandleCommandEdit(CommandLineArgEnumerator * enumerator)
|
||||||
|
|
|
@ -434,7 +434,7 @@ void config_set_defaults()
|
||||||
destValue->value_string = _strdup(username);
|
destValue->value_string = _strdup(username);
|
||||||
} else {
|
} else {
|
||||||
destValue->value_string = _strdup(language_get_string(STR_MULTIPLAYER_DEFAULT_NAME));
|
destValue->value_string = _strdup(language_get_string(STR_MULTIPLAYER_DEFAULT_NAME));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// Use static default
|
// Use static default
|
||||||
|
@ -946,7 +946,7 @@ bool config_find_or_browse_install_directory()
|
||||||
|
|
||||||
SafeFree(gConfigGeneral.game_path);
|
SafeFree(gConfigGeneral.game_path);
|
||||||
gConfigGeneral.game_path = installPath;
|
gConfigGeneral.game_path = installPath;
|
||||||
|
|
||||||
if (platform_original_game_data_exists(installPath))
|
if (platform_original_game_data_exists(installPath))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
|
|
@ -61,7 +61,7 @@ namespace Path
|
||||||
IFileScanner * ScanDirectory(const utf8 * pattern, bool recurse);
|
IFileScanner * ScanDirectory(const utf8 * pattern, bool recurse);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Scans a directory and all sub directories
|
* Scans a directory and all sub directories
|
||||||
* @param result The query result to modify.
|
* @param result The query result to modify.
|
||||||
* @param pattern The path followed by a semi-colon delimited list of wildcard patterns.
|
* @param pattern The path followed by a semi-colon delimited list of wildcard patterns.
|
||||||
* @returns An aggregated result of all scanned files.
|
* @returns An aggregated result of all scanned files.
|
||||||
|
|
|
@ -183,12 +183,12 @@ static void FreeImageList(uint32 baseImageId, uint32 count)
|
||||||
|
|
||||||
for (auto it = _freeLists.begin(); it != _freeLists.end(); it++)
|
for (auto it = _freeLists.begin(); it != _freeLists.end(); it++)
|
||||||
{
|
{
|
||||||
if (it->BaseId + it->Count == baseImageId)
|
if (it->BaseId + it->Count == baseImageId)
|
||||||
{
|
{
|
||||||
it->Count += count;
|
it->Count += count;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (baseImageId + count == it->BaseId)
|
else if (baseImageId + count == it->BaseId)
|
||||||
{
|
{
|
||||||
it->BaseId = baseImageId;
|
it->BaseId = baseImageId;
|
||||||
it->Count += count;
|
it->Count += count;
|
||||||
|
|
|
@ -510,7 +510,7 @@ void gfx_transpose_palette(int pal, unsigned char product)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* rct2: 0x006837E3
|
* rct2: 0x006837E3
|
||||||
*/
|
*/
|
||||||
void load_palette(){
|
void load_palette(){
|
||||||
rct_water_type* water_type = (rct_water_type*)object_entry_groups[OBJECT_TYPE_WATER].chunks[0];
|
rct_water_type* water_type = (rct_water_type*)object_entry_groups[OBJECT_TYPE_WATER].chunks[0];
|
||||||
|
|
|
@ -93,15 +93,15 @@ public:
|
||||||
const uint8 * pattern = RainPattern;
|
const uint8 * pattern = RainPattern;
|
||||||
uint8 patternXSpace = *pattern++;
|
uint8 patternXSpace = *pattern++;
|
||||||
uint8 patternYSpace = *pattern++;
|
uint8 patternYSpace = *pattern++;
|
||||||
|
|
||||||
uint8 patternStartXOffset = xStart % patternXSpace;
|
uint8 patternStartXOffset = xStart % patternXSpace;
|
||||||
uint8 patternStartYOffset = yStart % patternYSpace;
|
uint8 patternStartYOffset = yStart % patternYSpace;
|
||||||
|
|
||||||
uint32 pixelOffset = (_screenDPI->pitch + _screenDPI->width) * y + x;
|
uint32 pixelOffset = (_screenDPI->pitch + _screenDPI->width) * y + x;
|
||||||
uint8 patternYPos = patternStartYOffset % patternYSpace;
|
uint8 patternYPos = patternStartYOffset % patternYSpace;
|
||||||
|
|
||||||
uint8 * screenBits = _screenDPI->bits;
|
uint8 * screenBits = _screenDPI->bits;
|
||||||
|
|
||||||
//Stores the colours of changed pixels
|
//Stores the colours of changed pixels
|
||||||
RainPixel * newPixels = &_rainPixels[_rainPixelsCount];
|
RainPixel * newPixels = &_rainPixels[_rainPixelsCount];
|
||||||
for (; height != 0; height--)
|
for (; height != 0; height--)
|
||||||
|
@ -149,7 +149,7 @@ public:
|
||||||
// Pixel out of bounds, bail
|
// Pixel out of bounds, bail
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
bits[rainPixel.Position] = rainPixel.Colour;
|
bits[rainPixel.Position] = rainPixel.Colour;
|
||||||
}
|
}
|
||||||
_rainPixelsCount = 0;
|
_rainPixelsCount = 0;
|
||||||
|
@ -417,7 +417,7 @@ public:
|
||||||
|
|
||||||
// Originally 0x00683359
|
// Originally 0x00683359
|
||||||
// Adjust for move off screen
|
// Adjust for move off screen
|
||||||
// NOTE: when zooming, there can be x, y, dx, dy combinations that go off the
|
// NOTE: when zooming, there can be x, y, dx, dy combinations that go off the
|
||||||
// screen; hence the checks. This code should ultimately not be called when
|
// screen; hence the checks. This code should ultimately not be called when
|
||||||
// zooming because this function is specific to updating the screen on move
|
// zooming because this function is specific to updating the screen on move
|
||||||
int lmargin = Math::Min(x - dx, 0);
|
int lmargin = Math::Min(x - dx, 0);
|
||||||
|
@ -962,29 +962,29 @@ void SoftwareDrawingContext::FillRect(uint32 colour, sint32 left, sint32 top, si
|
||||||
else if (colour & 0x4000000)
|
else if (colour & 0x4000000)
|
||||||
{
|
{
|
||||||
uint8 * dst = startY * (dpi->width + dpi->pitch) + startX + dpi->bits;
|
uint8 * dst = startY * (dpi->width + dpi->pitch) + startX + dpi->bits;
|
||||||
|
|
||||||
// The pattern loops every 15 lines this is which
|
// The pattern loops every 15 lines this is which
|
||||||
// part the pattern is on.
|
// part the pattern is on.
|
||||||
int patternY = (startY + dpi->y) % 16;
|
int patternY = (startY + dpi->y) % 16;
|
||||||
|
|
||||||
// The pattern loops every 15 pixels this is which
|
// The pattern loops every 15 pixels this is which
|
||||||
// part the pattern is on.
|
// part the pattern is on.
|
||||||
int startPatternX = (startX + dpi->x) % 16;
|
int startPatternX = (startX + dpi->x) % 16;
|
||||||
int patternX = startPatternX;
|
int patternX = startPatternX;
|
||||||
|
|
||||||
const uint16 * patternsrc = Patterns[colour >> 28]; // or possibly uint8)[esi*4] ?
|
const uint16 * patternsrc = Patterns[colour >> 28]; // or possibly uint8)[esi*4] ?
|
||||||
|
|
||||||
for (int numLines = height; numLines > 0; numLines--)
|
for (int numLines = height; numLines > 0; numLines--)
|
||||||
{
|
{
|
||||||
uint8 * nextdst = dst + dpi->width + dpi->pitch;
|
uint8 * nextdst = dst + dpi->width + dpi->pitch;
|
||||||
uint16 pattern = patternsrc[patternY];
|
uint16 pattern = patternsrc[patternY];
|
||||||
|
|
||||||
for (int numPixels = width; numPixels > 0; numPixels--)
|
for (int numPixels = width; numPixels > 0; numPixels--)
|
||||||
{
|
{
|
||||||
if (pattern & (1 << patternX))
|
if (pattern & (1 << patternX))
|
||||||
{
|
{
|
||||||
*dst = colour & 0xFF;
|
*dst = colour & 0xFF;
|
||||||
}
|
}
|
||||||
patternX = (patternX + 1) % 16;
|
patternX = (patternX + 1) % 16;
|
||||||
dst++;
|
dst++;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers
|
#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
* OpenRCT2, an open source clone of Roller Coaster Tycoon 2.
|
* OpenRCT2, an open source clone of Roller Coaster Tycoon 2.
|
||||||
*
|
*
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers
|
#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
* OpenRCT2, an open source clone of Roller Coaster Tycoon 2.
|
* OpenRCT2, an open source clone of Roller Coaster Tycoon 2.
|
||||||
*
|
*
|
||||||
|
|
|
@ -343,12 +343,12 @@ public:
|
||||||
window_update_all_viewports();
|
window_update_all_viewports();
|
||||||
window_draw_all(&_bitsDPI, 0, 0, _width, _height);
|
window_draw_all(&_bitsDPI, 0, 0, _width, _height);
|
||||||
window_update_all();
|
window_update_all();
|
||||||
|
|
||||||
gfx_draw_pickedup_peep(&_bitsDPI);
|
gfx_draw_pickedup_peep(&_bitsDPI);
|
||||||
|
|
||||||
_drawingContext->FlushCommandBuffers();
|
_drawingContext->FlushCommandBuffers();
|
||||||
_swapFramebuffer->SwapCopy();
|
_swapFramebuffer->SwapCopy();
|
||||||
|
|
||||||
rct2_draw(&_bitsDPI);
|
rct2_draw(&_bitsDPI);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -364,13 +364,13 @@ public:
|
||||||
CheckGLError();
|
CheckGLError();
|
||||||
Display();
|
Display();
|
||||||
}
|
}
|
||||||
|
|
||||||
sint32 Screenshot() override
|
sint32 Screenshot() override
|
||||||
{
|
{
|
||||||
const OpenGLFramebuffer * framebuffer = _swapFramebuffer->GetTargetFramebuffer();
|
const OpenGLFramebuffer * framebuffer = _swapFramebuffer->GetTargetFramebuffer();
|
||||||
framebuffer->Bind();
|
framebuffer->Bind();
|
||||||
void * pixels = framebuffer->GetPixels();
|
void * pixels = framebuffer->GetPixels();
|
||||||
|
|
||||||
int result = screenshot_dump_png_32bpp(_width, _height, pixels);
|
int result = screenshot_dump_png_32bpp(_width, _height, pixels);
|
||||||
Memory::Free(pixels);
|
Memory::Free(pixels);
|
||||||
return result;
|
return result;
|
||||||
|
@ -668,7 +668,7 @@ void OpenGLDrawingContext::DrawLine(uint32 colour, sint32 x1, sint32 y1, sint32
|
||||||
y2 += _offsetY;
|
y2 += _offsetY;
|
||||||
|
|
||||||
vec4f paletteColour = _engine->GLPalette[colour & 0xFF];
|
vec4f paletteColour = _engine->GLPalette[colour & 0xFF];
|
||||||
|
|
||||||
DrawLineCommand command = {};
|
DrawLineCommand command = {};
|
||||||
|
|
||||||
command.colour = paletteColour;
|
command.colour = paletteColour;
|
||||||
|
@ -1022,7 +1022,7 @@ void OpenGLDrawingContext::FlushImages()
|
||||||
if (_commandBuffers.images.size() == 0) return;
|
if (_commandBuffers.images.size() == 0) return;
|
||||||
|
|
||||||
OpenGLAPI::SetTexture(0, GL_TEXTURE_2D_ARRAY, _textureCache->GetAtlasesTexture());
|
OpenGLAPI::SetTexture(0, GL_TEXTURE_2D_ARRAY, _textureCache->GetAtlasesTexture());
|
||||||
|
|
||||||
std::vector<DrawImageInstance> instances;
|
std::vector<DrawImageInstance> instances;
|
||||||
instances.reserve(_commandBuffers.images.size());
|
instances.reserve(_commandBuffers.images.size());
|
||||||
|
|
||||||
|
@ -1054,7 +1054,7 @@ void OpenGLDrawingContext::FlushImages()
|
||||||
|
|
||||||
_drawImageShader->Use();
|
_drawImageShader->Use();
|
||||||
_drawImageShader->DrawInstances(instances);
|
_drawImageShader->DrawInstances(instances);
|
||||||
|
|
||||||
_commandBuffers.images.clear();
|
_commandBuffers.images.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers
|
#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
* OpenRCT2, an open source clone of Roller Coaster Tycoon 2.
|
* OpenRCT2, an open source clone of Roller Coaster Tycoon 2.
|
||||||
*
|
*
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers
|
#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
* OpenRCT2, an open source clone of Roller Coaster Tycoon 2.
|
* OpenRCT2, an open source clone of Roller Coaster Tycoon 2.
|
||||||
*
|
*
|
||||||
|
|
|
@ -70,7 +70,7 @@ CachedTextureInfo TextureCache::GetOrLoadPaletteTexture(uint32 image, uint32 ter
|
||||||
if ((image & (IMAGE_TYPE_REMAP | IMAGE_TYPE_REMAP_2_PLUS | IMAGE_TYPE_TRANSPARENT)) == 0)
|
if ((image & (IMAGE_TYPE_REMAP | IMAGE_TYPE_REMAP_2_PLUS | IMAGE_TYPE_TRANSPARENT)) == 0)
|
||||||
return CachedTextureInfo{ 0 };
|
return CachedTextureInfo{ 0 };
|
||||||
|
|
||||||
uint32 uniquePaletteId = image & (IMAGE_TYPE_REMAP | IMAGE_TYPE_REMAP_2_PLUS | IMAGE_TYPE_TRANSPARENT);
|
uint32 uniquePaletteId = image & (IMAGE_TYPE_REMAP | IMAGE_TYPE_REMAP_2_PLUS | IMAGE_TYPE_TRANSPARENT);
|
||||||
if (!(image & IMAGE_TYPE_REMAP_2_PLUS)) {
|
if (!(image & IMAGE_TYPE_REMAP_2_PLUS)) {
|
||||||
uniquePaletteId = (image >> 19) & 0xFF;
|
uniquePaletteId = (image >> 19) & 0xFF;
|
||||||
if (!(image & IMAGE_TYPE_TRANSPARENT)) {
|
if (!(image & IMAGE_TYPE_TRANSPARENT)) {
|
||||||
|
@ -78,7 +78,7 @@ CachedTextureInfo TextureCache::GetOrLoadPaletteTexture(uint32 image, uint32 ter
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
uniquePaletteId |= ((image >> 19) & 0x1F);
|
uniquePaletteId |= ((image >> 19) & 0x1F);
|
||||||
uniquePaletteId |= ((image >> 24) & 0x1F) << 8;
|
uniquePaletteId |= ((image >> 24) & 0x1F) << 8;
|
||||||
|
|
||||||
if (!(image & IMAGE_TYPE_REMAP)) {
|
if (!(image & IMAGE_TYPE_REMAP)) {
|
||||||
|
@ -157,14 +157,14 @@ void TextureCache::EnlargeAtlasesTexture(GLuint newEntries)
|
||||||
|
|
||||||
// Restore old data
|
// Restore old data
|
||||||
glTexSubImage3D(GL_TEXTURE_2D_ARRAY, 0, 0, 0, 0, _atlasesTextureDimensions, _atlasesTextureDimensions, _atlasesTextureIndices, GL_RED_INTEGER, GL_UNSIGNED_BYTE, oldPixels.data());
|
glTexSubImage3D(GL_TEXTURE_2D_ARRAY, 0, 0, 0, 0, _atlasesTextureDimensions, _atlasesTextureDimensions, _atlasesTextureIndices, GL_RED_INTEGER, GL_UNSIGNED_BYTE, oldPixels.data());
|
||||||
|
|
||||||
_atlasesTextureIndices = newIndices;
|
_atlasesTextureIndices = newIndices;
|
||||||
}
|
}
|
||||||
|
|
||||||
CachedTextureInfo TextureCache::LoadImageTexture(uint32 image)
|
CachedTextureInfo TextureCache::LoadImageTexture(uint32 image)
|
||||||
{
|
{
|
||||||
rct_drawpixelinfo * dpi = GetImageAsDPI(image, 0);
|
rct_drawpixelinfo * dpi = GetImageAsDPI(image, 0);
|
||||||
|
|
||||||
auto cacheInfo = AllocateImage(dpi->width, dpi->height);
|
auto cacheInfo = AllocateImage(dpi->width, dpi->height);
|
||||||
|
|
||||||
glBindTexture(GL_TEXTURE_2D_ARRAY, _atlasesTexture);
|
glBindTexture(GL_TEXTURE_2D_ARRAY, _atlasesTexture);
|
||||||
|
@ -182,10 +182,10 @@ CachedTextureInfo TextureCache::LoadPaletteTexture(uint32 image, uint32 tertiary
|
||||||
dpi.width = 256;
|
dpi.width = 256;
|
||||||
dpi.height = special ? 5 : 1;
|
dpi.height = special ? 5 : 1;
|
||||||
auto cacheInfo = AllocateImage(dpi.width, dpi.height);
|
auto cacheInfo = AllocateImage(dpi.width, dpi.height);
|
||||||
|
|
||||||
glBindTexture(GL_TEXTURE_2D_ARRAY, _atlasesTexture);
|
glBindTexture(GL_TEXTURE_2D_ARRAY, _atlasesTexture);
|
||||||
glTexSubImage3D(GL_TEXTURE_2D_ARRAY, 0, cacheInfo.bounds.x, cacheInfo.bounds.y, cacheInfo.index, dpi.width, dpi.height, 1, GL_RED_INTEGER, GL_UNSIGNED_BYTE, dpi.bits);
|
glTexSubImage3D(GL_TEXTURE_2D_ARRAY, 0, cacheInfo.bounds.x, cacheInfo.bounds.y, cacheInfo.index, dpi.width, dpi.height, 1, GL_RED_INTEGER, GL_UNSIGNED_BYTE, dpi.bits);
|
||||||
|
|
||||||
return cacheInfo;
|
return cacheInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -260,7 +260,7 @@ rct_drawpixelinfo * TextureCache::GetImageAsDPI(uint32 image, uint32 tertiaryCol
|
||||||
rct_g1_element * g1Element = gfx_get_g1_element(image & 0x7FFFF);
|
rct_g1_element * g1Element = gfx_get_g1_element(image & 0x7FFFF);
|
||||||
sint32 width = g1Element->width;
|
sint32 width = g1Element->width;
|
||||||
sint32 height = g1Element->height;
|
sint32 height = g1Element->height;
|
||||||
|
|
||||||
rct_drawpixelinfo * dpi = CreateDPI(width, height);
|
rct_drawpixelinfo * dpi = CreateDPI(width, height);
|
||||||
gfx_draw_sprite_software(dpi, image, -g1Element->x_offset, -g1Element->y_offset, tertiaryColour);
|
gfx_draw_sprite_software(dpi, image, -g1Element->x_offset, -g1Element->y_offset, tertiaryColour);
|
||||||
return dpi;
|
return dpi;
|
||||||
|
@ -287,7 +287,7 @@ rct_drawpixelinfo * TextureCache::GetGlyphAsDPI(uint32 image, uint8 * palette)
|
||||||
rct_g1_element * g1Element = gfx_get_g1_element(image & 0x7FFFF);
|
rct_g1_element * g1Element = gfx_get_g1_element(image & 0x7FFFF);
|
||||||
sint32 width = g1Element->width;
|
sint32 width = g1Element->width;
|
||||||
sint32 height = g1Element->height;
|
sint32 height = g1Element->height;
|
||||||
|
|
||||||
rct_drawpixelinfo * dpi = CreateDPI(width, height);
|
rct_drawpixelinfo * dpi = CreateDPI(width, height);
|
||||||
gfx_draw_sprite_palette_set_software(dpi, image, -g1Element->x_offset, -g1Element->y_offset, palette, nullptr);
|
gfx_draw_sprite_palette_set_software(dpi, image, -g1Element->x_offset, -g1Element->y_offset, palette, nullptr);
|
||||||
return dpi;
|
return dpi;
|
||||||
|
|
|
@ -42,7 +42,7 @@ struct GlyphId
|
||||||
return hash;
|
return hash;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
struct Equal
|
struct Equal
|
||||||
{
|
{
|
||||||
bool operator()(const GlyphId &lhs, const GlyphId &rhs) const
|
bool operator()(const GlyphId &lhs, const GlyphId &rhs) const
|
||||||
|
|
|
@ -147,7 +147,7 @@ void lightfx_init()
|
||||||
calc_rescale_light_half(_bakedLightTexture_spot_2, _bakedLightTexture_spot_3, 128, 128);
|
calc_rescale_light_half(_bakedLightTexture_spot_2, _bakedLightTexture_spot_3, 128, 128);
|
||||||
calc_rescale_light_half(_bakedLightTexture_spot_1, _bakedLightTexture_spot_2, 64, 64);
|
calc_rescale_light_half(_bakedLightTexture_spot_1, _bakedLightTexture_spot_2, 64, 64);
|
||||||
calc_rescale_light_half(_bakedLightTexture_spot_0, _bakedLightTexture_spot_1, 32, 32);
|
calc_rescale_light_half(_bakedLightTexture_spot_0, _bakedLightTexture_spot_1, 32, 32);
|
||||||
}
|
}
|
||||||
|
|
||||||
void lightfx_update_buffers(rct_drawpixelinfo *info)
|
void lightfx_update_buffers(rct_drawpixelinfo *info)
|
||||||
{
|
{
|
||||||
|
@ -194,7 +194,7 @@ void lightfx_prepare_light_list()
|
||||||
entry->lightType = LIGHTFX_LIGHT_TYPE_NONE;
|
entry->lightType = LIGHTFX_LIGHT_TYPE_NONE;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// entry->x >>= _current_view_zoom_front;
|
// entry->x >>= _current_view_zoom_front;
|
||||||
// entry->y >>= _current_view_zoom_front;
|
// entry->y >>= _current_view_zoom_front;
|
||||||
|
@ -319,7 +319,7 @@ void lightfx_prepare_light_list()
|
||||||
// sub_688217();
|
// sub_688217();
|
||||||
// sub_68862C();
|
// sub_68862C();
|
||||||
//}
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
sint32 minDist = 0;
|
sint32 minDist = 0;
|
||||||
sint32 baseHeight = -999;
|
sint32 baseHeight = -999;
|
||||||
|
@ -377,14 +377,14 @@ void lightfx_prepare_light_list()
|
||||||
totalSamplePoints -= startSamplePoint;
|
totalSamplePoints -= startSamplePoint;
|
||||||
|
|
||||||
// lightIntensityOccluded = totalSamplePoints * 100;
|
// lightIntensityOccluded = totalSamplePoints * 100;
|
||||||
|
|
||||||
// log_warning("sample-count: %i, occlusion: %i", totalSamplePoints, lightIntensityOccluded);
|
// log_warning("sample-count: %i, occlusion: %i", totalSamplePoints, lightIntensityOccluded);
|
||||||
|
|
||||||
if (lightIntensityOccluded == 0) {
|
if (lightIntensityOccluded == 0) {
|
||||||
entry->lightType = LIGHTFX_LIGHT_TYPE_NONE;
|
entry->lightType = LIGHTFX_LIGHT_TYPE_NONE;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// log_warning("sample-count: %i, occlusion: %i", totalSamplePoints, lightIntensityOccluded / totalSamplePoints);
|
// log_warning("sample-count: %i, occlusion: %i", totalSamplePoints, lightIntensityOccluded / totalSamplePoints);
|
||||||
|
|
||||||
entry->lightIntensity = min(0xFF, (entry->lightIntensity * lightIntensityOccluded) / (totalSamplePoints * 100));
|
entry->lightIntensity = min(0xFF, (entry->lightIntensity * lightIntensityOccluded) / (totalSamplePoints * 100));
|
||||||
|
|
|
@ -296,7 +296,7 @@ uint8* FASTCALL gfx_draw_sprite_get_palette(int image_id, uint32 tertiary_colour
|
||||||
int image_type = (image_id & 0xE0000000);
|
int image_type = (image_id & 0xE0000000);
|
||||||
if (image_type == 0)
|
if (image_type == 0)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if (!(image_type & IMAGE_TYPE_REMAP_2_PLUS)) {
|
if (!(image_type & IMAGE_TYPE_REMAP_2_PLUS)) {
|
||||||
uint8 palette_ref = (image_id >> 19) & 0xFF;
|
uint8 palette_ref = (image_id >> 19) & 0xFF;
|
||||||
if (!(image_type & IMAGE_TYPE_TRANSPARENT)) {
|
if (!(image_type & IMAGE_TYPE_TRANSPARENT)) {
|
||||||
|
@ -326,7 +326,7 @@ uint8* FASTCALL gfx_draw_sprite_get_palette(int image_id, uint32 tertiary_colour
|
||||||
|
|
||||||
memcpy(palette_pointer + 0xF3, &primary_palette->offset[0xF3], 12);
|
memcpy(palette_pointer + 0xF3, &primary_palette->offset[0xF3], 12);
|
||||||
memcpy(palette_pointer + 0xCA, &secondary_palette->offset[0xF3], 12);
|
memcpy(palette_pointer + 0xCA, &secondary_palette->offset[0xF3], 12);
|
||||||
|
|
||||||
return palette_pointer;
|
return palette_pointer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
34
src/game.c
34
src/game.c
|
@ -484,7 +484,7 @@ int game_do_command_p(int command, int *eax, int *ebx, int *ecx, int *edx, int *
|
||||||
gGameCommandErrorText = STR_NONE;
|
gGameCommandErrorText = STR_NONE;
|
||||||
gGameCommandIsNetworked = (flags & GAME_COMMAND_FLAG_NETWORKED) != 0;
|
gGameCommandIsNetworked = (flags & GAME_COMMAND_FLAG_NETWORKED) != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Increment nest count
|
// Increment nest count
|
||||||
gGameCommandNestLevel++;
|
gGameCommandNestLevel++;
|
||||||
|
|
||||||
|
@ -586,7 +586,7 @@ int game_do_command_p(int command, int *eax, int *ebx, int *ecx, int *edx, int *
|
||||||
|
|
||||||
// Decrement nest count
|
// Decrement nest count
|
||||||
gGameCommandNestLevel--;
|
gGameCommandNestLevel--;
|
||||||
|
|
||||||
// Clear the game command callback to prevent the next command triggering it
|
// Clear the game command callback to prevent the next command triggering it
|
||||||
game_command_callback = 0;
|
game_command_callback = 0;
|
||||||
|
|
||||||
|
@ -667,7 +667,7 @@ static void utf8_to_rct2_self(char *buffer, size_t length)
|
||||||
{
|
{
|
||||||
char tempBuffer[512];
|
char tempBuffer[512];
|
||||||
utf8_to_rct2(tempBuffer, buffer);
|
utf8_to_rct2(tempBuffer, buffer);
|
||||||
|
|
||||||
size_t i = 0;
|
size_t i = 0;
|
||||||
const char *src = tempBuffer;
|
const char *src = tempBuffer;
|
||||||
char *dst = buffer;
|
char *dst = buffer;
|
||||||
|
@ -968,35 +968,35 @@ static void limit_autosave_count(const size_t numberOfFilesToKeep)
|
||||||
size_t numAutosavesToDelete = 0;
|
size_t numAutosavesToDelete = 0;
|
||||||
|
|
||||||
file_info fileInfo;
|
file_info fileInfo;
|
||||||
|
|
||||||
utf8 filter[MAX_PATH];
|
utf8 filter[MAX_PATH];
|
||||||
|
|
||||||
utf8 **autosaveFiles = NULL;
|
utf8 **autosaveFiles = NULL;
|
||||||
|
|
||||||
size_t i=0;
|
size_t i=0;
|
||||||
|
|
||||||
platform_get_user_directory(filter, "save", sizeof(filter));
|
platform_get_user_directory(filter, "save", sizeof(filter));
|
||||||
safe_strcat_path(filter, "autosave_*.sv6", sizeof(filter));
|
safe_strcat_path(filter, "autosave_*.sv6", sizeof(filter));
|
||||||
|
|
||||||
// At first, count how many autosaves there are
|
// At first, count how many autosaves there are
|
||||||
fileEnumHandle = platform_enumerate_files_begin(filter);
|
fileEnumHandle = platform_enumerate_files_begin(filter);
|
||||||
while (platform_enumerate_files_next(fileEnumHandle, &fileInfo)) {
|
while (platform_enumerate_files_next(fileEnumHandle, &fileInfo)) {
|
||||||
autosavesCount++;
|
autosavesCount++;
|
||||||
}
|
}
|
||||||
platform_enumerate_files_end(fileEnumHandle);
|
platform_enumerate_files_end(fileEnumHandle);
|
||||||
|
|
||||||
// If there are fewer autosaves than the number of files to keep we don't need to delete anything
|
// If there are fewer autosaves than the number of files to keep we don't need to delete anything
|
||||||
if(autosavesCount <= numberOfFilesToKeep) {
|
if(autosavesCount <= numberOfFilesToKeep) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
autosaveFiles = (utf8**) malloc(sizeof(utf8*) * autosavesCount);
|
autosaveFiles = (utf8**) malloc(sizeof(utf8*) * autosavesCount);
|
||||||
|
|
||||||
fileEnumHandle = platform_enumerate_files_begin(filter);
|
fileEnumHandle = platform_enumerate_files_begin(filter);
|
||||||
for(i = 0; i < autosavesCount; i++) {
|
for(i = 0; i < autosavesCount; i++) {
|
||||||
autosaveFiles[i] = (utf8*)malloc(sizeof(utf8) * MAX_PATH);
|
autosaveFiles[i] = (utf8*)malloc(sizeof(utf8) * MAX_PATH);
|
||||||
memset(autosaveFiles[i], 0, sizeof(utf8) * MAX_PATH);
|
memset(autosaveFiles[i], 0, sizeof(utf8) * MAX_PATH);
|
||||||
|
|
||||||
if(platform_enumerate_files_next(fileEnumHandle, &fileInfo)) {
|
if(platform_enumerate_files_next(fileEnumHandle, &fileInfo)) {
|
||||||
platform_get_user_directory(autosaveFiles[i], "save", sizeof(utf8) * MAX_PATH);
|
platform_get_user_directory(autosaveFiles[i], "save", sizeof(utf8) * MAX_PATH);
|
||||||
safe_strcat_path(autosaveFiles[i], fileInfo.path, sizeof(utf8) * MAX_PATH);
|
safe_strcat_path(autosaveFiles[i], fileInfo.path, sizeof(utf8) * MAX_PATH);
|
||||||
|
@ -1008,20 +1008,20 @@ static void limit_autosave_count(const size_t numberOfFilesToKeep)
|
||||||
|
|
||||||
// calculate how many saves we need to delete.
|
// calculate how many saves we need to delete.
|
||||||
numAutosavesToDelete = autosavesCount - numberOfFilesToKeep;
|
numAutosavesToDelete = autosavesCount - numberOfFilesToKeep;
|
||||||
|
|
||||||
i=0;
|
i=0;
|
||||||
while (numAutosavesToDelete > 0) {
|
while (numAutosavesToDelete > 0) {
|
||||||
platform_file_delete(autosaveFiles[i]);
|
platform_file_delete(autosaveFiles[i]);
|
||||||
|
|
||||||
i++;
|
i++;
|
||||||
numAutosavesToDelete--;
|
numAutosavesToDelete--;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
for(i = 0; i < autosavesCount; i++) {
|
for(i = 0; i < autosavesCount; i++) {
|
||||||
free(autosaveFiles[i]);
|
free(autosaveFiles[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
free(autosaveFiles);
|
free(autosaveFiles);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -245,9 +245,9 @@ void addhook(int address, int newaddress, int stacksize, int registerargs[], int
|
||||||
{
|
{
|
||||||
perror("mprotect");
|
perror("mprotect");
|
||||||
}
|
}
|
||||||
|
|
||||||
memcpy((void *)address, data, i);
|
memcpy((void *)address, data, i);
|
||||||
|
|
||||||
err = mprotect((void *)0x401000, 0x8a4000 - 0x401000, PROT_READ | PROT_EXEC);
|
err = mprotect((void *)0x401000, 0x8a4000 - 0x401000, PROT_READ | PROT_EXEC);
|
||||||
if (err != 0)
|
if (err != 0)
|
||||||
{
|
{
|
||||||
|
|
|
@ -33,7 +33,7 @@ bool image_io_png_read(uint8 **pixels, uint32 *width, uint32 *height, const utf8
|
||||||
if (png_ptr == NULL) {
|
if (png_ptr == NULL) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
info_ptr = png_create_info_struct(png_ptr);
|
info_ptr = png_create_info_struct(png_ptr);
|
||||||
if (info_ptr == NULL) {
|
if (info_ptr == NULL) {
|
||||||
png_destroy_read_struct(&png_ptr, NULL, NULL);
|
png_destroy_read_struct(&png_ptr, NULL, NULL);
|
||||||
|
@ -52,14 +52,14 @@ bool image_io_png_read(uint8 **pixels, uint32 *width, uint32 *height, const utf8
|
||||||
SDL_RWclose(fp);
|
SDL_RWclose(fp);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Setup png reading
|
// Setup png reading
|
||||||
png_set_read_fn(png_ptr, fp, my_png_read_data);
|
png_set_read_fn(png_ptr, fp, my_png_read_data);
|
||||||
png_set_sig_bytes(png_ptr, sig_read);
|
png_set_sig_bytes(png_ptr, sig_read);
|
||||||
|
|
||||||
// To simplify the reading process, convert 4-16 bit data to 24-32 bit data
|
// To simplify the reading process, convert 4-16 bit data to 24-32 bit data
|
||||||
png_read_png(png_ptr, info_ptr, PNG_TRANSFORM_STRIP_16 | PNG_TRANSFORM_PACKING | PNG_TRANSFORM_EXPAND, NULL);
|
png_read_png(png_ptr, info_ptr, PNG_TRANSFORM_STRIP_16 | PNG_TRANSFORM_PACKING | PNG_TRANSFORM_EXPAND, NULL);
|
||||||
|
|
||||||
// Read header
|
// Read header
|
||||||
png_uint_32 pngWidth, pngHeight;
|
png_uint_32 pngWidth, pngHeight;
|
||||||
int bit_depth, colour_type, interlace_type;
|
int bit_depth, colour_type, interlace_type;
|
||||||
|
@ -90,7 +90,7 @@ bool image_io_png_read(uint8 **pixels, uint32 *width, uint32 *height, const utf8
|
||||||
dst += rowBytes;
|
dst += rowBytes;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Close the PNG
|
// Close the PNG
|
||||||
png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
|
png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
|
||||||
SDL_RWclose(fp);
|
SDL_RWclose(fp);
|
||||||
|
|
|
@ -238,7 +238,7 @@ static void input_scroll_drag_continue(int x, int y, rct_window* w)
|
||||||
|
|
||||||
int fixedCursorPositionX = (int) ceilf(gInputDragLastX * gConfigGeneral.window_scale);
|
int fixedCursorPositionX = (int) ceilf(gInputDragLastX * gConfigGeneral.window_scale);
|
||||||
int fixedCursorPositionY = (int) ceilf(gInputDragLastY * gConfigGeneral.window_scale);
|
int fixedCursorPositionY = (int) ceilf(gInputDragLastY * gConfigGeneral.window_scale);
|
||||||
|
|
||||||
platform_set_cursor_position(fixedCursorPositionX, fixedCursorPositionY);
|
platform_set_cursor_position(fixedCursorPositionX, fixedCursorPositionY);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -255,7 +255,7 @@ static void ThrowThemeLoadException()
|
||||||
json_t * UIThemeWindowEntry::ToJson() const
|
json_t * UIThemeWindowEntry::ToJson() const
|
||||||
{
|
{
|
||||||
const WindowThemeDesc * wtDesc = GetWindowThemeDescriptor(WindowClass);
|
const WindowThemeDesc * wtDesc = GetWindowThemeDescriptor(WindowClass);
|
||||||
|
|
||||||
json_t * jsonColours = json_array();
|
json_t * jsonColours = json_array();
|
||||||
for (uint8 i = 0; i < wtDesc->NumColours; i++) {
|
for (uint8 i = 0; i < wtDesc->NumColours; i++) {
|
||||||
colour_t colour = Theme.Colours[i];
|
colour_t colour = Theme.Colours[i];
|
||||||
|
@ -282,7 +282,7 @@ UIThemeWindowEntry UIThemeWindowEntry::FromJson(const WindowThemeDesc * wtDesc,
|
||||||
UIThemeWindowEntry result;
|
UIThemeWindowEntry result;
|
||||||
result.WindowClass = wtDesc->WindowClass;
|
result.WindowClass = wtDesc->WindowClass;
|
||||||
result.Theme = wtDesc->DefaultTheme;
|
result.Theme = wtDesc->DefaultTheme;
|
||||||
|
|
||||||
for (uint8 i = 0; i < numColours; i++)
|
for (uint8 i = 0; i < numColours; i++)
|
||||||
{
|
{
|
||||||
result.Theme.Colours[i] = (colour_t)json_integer_value(json_array_get(jsonColours, i));
|
result.Theme.Colours[i] = (colour_t)json_integer_value(json_array_get(jsonColours, i));
|
||||||
|
@ -536,7 +536,7 @@ namespace ThemeManager
|
||||||
AvailableTheme theme;
|
AvailableTheme theme;
|
||||||
Path::GetFileNameWithoutExtension(theme.Name, sizeof(theme.Name), fileInfo.path);
|
Path::GetFileNameWithoutExtension(theme.Name, sizeof(theme.Name), fileInfo.path);
|
||||||
GetThemeFileName(theme.Path, sizeof(theme.Path), theme.Name);
|
GetThemeFileName(theme.Path, sizeof(theme.Path), theme.Name);
|
||||||
|
|
||||||
outThemes->push_back(theme);
|
outThemes->push_back(theme);
|
||||||
|
|
||||||
if (Path::Equals(CurrentThemePath, fileInfo.path))
|
if (Path::Equals(CurrentThemePath, fileInfo.path))
|
||||||
|
@ -621,7 +621,7 @@ namespace ThemeManager
|
||||||
configValid = true;
|
configValid = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!configValid)
|
if (!configValid)
|
||||||
{
|
{
|
||||||
String::DiscardDuplicate(&gConfigInterface.current_theme_preset, theme_manager_get_available_theme_name(1));
|
String::DiscardDuplicate(&gConfigInterface.current_theme_preset, theme_manager_get_available_theme_name(1));
|
||||||
|
|
|
@ -123,7 +123,7 @@ void chat_draw(rct_drawpixelinfo * dpi)
|
||||||
gfx_fill_rect_inset(dpi, _chatLeft + 1, _chatTop - 4, _chatRight - 1, _chatBottom - inputLineHeight - 6, chatBackgroundColor, INSET_RECT_FLAG_BORDER_INSET);
|
gfx_fill_rect_inset(dpi, _chatLeft + 1, _chatTop - 4, _chatRight - 1, _chatBottom - inputLineHeight - 6, chatBackgroundColor, INSET_RECT_FLAG_BORDER_INSET);
|
||||||
gfx_fill_rect_inset(dpi, _chatLeft + 1, _chatBottom - inputLineHeight - 5, _chatRight - 1, _chatBottom + 4, chatBackgroundColor, INSET_RECT_FLAG_BORDER_INSET); //Textbox
|
gfx_fill_rect_inset(dpi, _chatLeft + 1, _chatBottom - inputLineHeight - 5, _chatRight - 1, _chatBottom + 4, chatBackgroundColor, INSET_RECT_FLAG_BORDER_INSET); //Textbox
|
||||||
}
|
}
|
||||||
|
|
||||||
int x = _chatLeft + 5;
|
int x = _chatLeft + 5;
|
||||||
int y = _chatBottom - inputLineHeight - 20;
|
int y = _chatBottom - inputLineHeight - 20;
|
||||||
int stringHeight = 0;
|
int stringHeight = 0;
|
||||||
|
@ -143,7 +143,7 @@ void chat_draw(rct_drawpixelinfo * dpi)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Draw current chat input
|
// Draw current chat input
|
||||||
if (gChatOpen) {
|
if (gChatOpen) {
|
||||||
lineCh = utf8_write_codepoint(lineCh, FORMAT_OUTLINE);
|
lineCh = utf8_write_codepoint(lineCh, FORMAT_OUTLINE);
|
||||||
|
@ -155,7 +155,7 @@ void chat_draw(rct_drawpixelinfo * dpi)
|
||||||
lineCh = lineBuffer;
|
lineCh = lineBuffer;
|
||||||
int inputLineHeight = gfx_draw_string_left_wrapped(dpi, (void*)&lineCh, x, y + 3, _chatWidth - 10, STR_STRING, 255);
|
int inputLineHeight = gfx_draw_string_left_wrapped(dpi, (void*)&lineCh, x, y + 3, _chatWidth - 10, STR_STRING, 255);
|
||||||
gfx_set_dirty_blocks(x, y, x + _chatWidth, y + inputLineHeight + 15);
|
gfx_set_dirty_blocks(x, y, x + _chatWidth, y + inputLineHeight + 15);
|
||||||
|
|
||||||
//TODO: Show caret if the input text have multiple lines
|
//TODO: Show caret if the input text have multiple lines
|
||||||
if (_chatCaretTicks < 15 && gfx_get_string_width(lineBuffer) < (_chatWidth - 10)) {
|
if (_chatCaretTicks < 15 && gfx_get_string_width(lineBuffer) < (_chatWidth - 10)) {
|
||||||
memcpy(lineBuffer, _chatCurrentLine, gTextInput.selection_offset);
|
memcpy(lineBuffer, _chatCurrentLine, gTextInput.selection_offset);
|
||||||
|
@ -215,7 +215,7 @@ static void chat_clear_input()
|
||||||
int chat_history_draw_string(rct_drawpixelinfo *dpi, void *args, int x, int y, int width)
|
int chat_history_draw_string(rct_drawpixelinfo *dpi, void *args, int x, int y, int width)
|
||||||
{
|
{
|
||||||
int fontSpriteBase, lineHeight, lineY, numLines;
|
int fontSpriteBase, lineHeight, lineY, numLines;
|
||||||
|
|
||||||
gCurrentFontSpriteBase = FONT_SPRITE_BASE_MEDIUM;
|
gCurrentFontSpriteBase = FONT_SPRITE_BASE_MEDIUM;
|
||||||
|
|
||||||
gfx_draw_string(dpi, "", 255, dpi->x, dpi->y);
|
gfx_draw_string(dpi, "", 255, dpi->x, dpi->y);
|
||||||
|
@ -256,7 +256,7 @@ int chat_string_wrapped_get_height(void *args, int width)
|
||||||
gCurrentFontSpriteBase = FONT_SPRITE_BASE_MEDIUM;
|
gCurrentFontSpriteBase = FONT_SPRITE_BASE_MEDIUM;
|
||||||
gfx_wrap_string(buffer, width, &numLines, &fontSpriteBase);
|
gfx_wrap_string(buffer, width, &numLines, &fontSpriteBase);
|
||||||
lineHeight = font_get_line_height(fontSpriteBase);
|
lineHeight = font_get_line_height(fontSpriteBase);
|
||||||
|
|
||||||
gCurrentFontFlags = 0;
|
gCurrentFontFlags = 0;
|
||||||
|
|
||||||
lineY = 0;
|
lineY = 0;
|
||||||
|
|
|
@ -477,7 +477,7 @@ static int cc_rides(const utf8 **argv, int argc)
|
||||||
bool int_valid[2] = { 0 };
|
bool int_valid[2] = { 0 };
|
||||||
int ride_index = console_parse_int(argv[2], &int_valid[0]);
|
int ride_index = console_parse_int(argv[2], &int_valid[0]);
|
||||||
int friction = console_parse_int(argv[3], &int_valid[1]);
|
int friction = console_parse_int(argv[3], &int_valid[1]);
|
||||||
|
|
||||||
if (ride_index < 0) {
|
if (ride_index < 0) {
|
||||||
console_printf("Ride index must not be negative");
|
console_printf("Ride index must not be negative");
|
||||||
} else if (!int_valid[0] || !int_valid[1]) {
|
} else if (!int_valid[0] || !int_valid[1]) {
|
||||||
|
@ -496,7 +496,7 @@ static int cc_rides(const utf8 **argv, int argc)
|
||||||
vehicle->friction=friction;
|
vehicle->friction=friction;
|
||||||
vehicle_index=vehicle->next_vehicle_on_train;
|
vehicle_index=vehicle->next_vehicle_on_train;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -528,7 +528,7 @@ static int cc_staff(const utf8 **argv, int argc)
|
||||||
bool int_valid[3] = { 0 };
|
bool int_valid[3] = { 0 };
|
||||||
int_val[0] = console_parse_int(argv[2], &int_valid[0]);
|
int_val[0] = console_parse_int(argv[2], &int_valid[0]);
|
||||||
int_val[1] = console_parse_int(argv[3], &int_valid[1]);
|
int_val[1] = console_parse_int(argv[3], &int_valid[1]);
|
||||||
|
|
||||||
if (int_valid[0] && int_valid[1] && ((GET_PEEP(int_val[0])) != NULL)) {
|
if (int_valid[0] && int_valid[1] && ((GET_PEEP(int_val[0])) != NULL)) {
|
||||||
rct_peep *peep = GET_PEEP(int_val[0]);
|
rct_peep *peep = GET_PEEP(int_val[0]);
|
||||||
|
|
||||||
|
|
|
@ -358,7 +358,7 @@ static void window_close_surplus(int cap, sint8 avoid_classification)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//difference between amount open and cap = amount to close
|
//difference between amount open and cap = amount to close
|
||||||
diff = count - WINDOW_LIMIT_RESERVED - cap;
|
diff = count - WINDOW_LIMIT_RESERVED - cap;
|
||||||
for (i = 0; i < diff; i++) {
|
for (i = 0; i < diff; i++) {
|
||||||
rct_window *w = NULL;
|
rct_window *w = NULL;
|
||||||
//iterates through the list until it finds the newest window, or a window that can be closed
|
//iterates through the list until it finds the newest window, or a window that can be closed
|
||||||
|
|
|
@ -163,7 +163,7 @@ void intro_update()
|
||||||
void intro_draw(rct_drawpixelinfo *dpi)
|
void intro_draw(rct_drawpixelinfo *dpi)
|
||||||
{
|
{
|
||||||
int screenWidth = gScreenWidth;
|
int screenWidth = gScreenWidth;
|
||||||
|
|
||||||
switch (gIntroState) {
|
switch (gIntroState) {
|
||||||
case INTRO_STATE_DISCLAIMER_1:
|
case INTRO_STATE_DISCLAIMER_1:
|
||||||
case INTRO_STATE_DISCLAIMER_2:
|
case INTRO_STATE_DISCLAIMER_2:
|
||||||
|
|
|
@ -89,7 +89,7 @@ public:
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
FileStream fs = FileStream(path, FILE_MODE_OPEN);
|
FileStream fs = FileStream(path, FILE_MODE_OPEN);
|
||||||
|
|
||||||
size_t fileLength = (size_t)fs.GetLength();
|
size_t fileLength = (size_t)fs.GetLength();
|
||||||
if (fileLength > MAX_LANGUAGE_SIZE)
|
if (fileLength > MAX_LANGUAGE_SIZE)
|
||||||
{
|
{
|
||||||
|
|
|
@ -348,7 +348,7 @@ rct_string_id language_allocate_object_string(const utf8 * target)
|
||||||
_availableObjectStringIds.push(stringId);
|
_availableObjectStringIds.push(stringId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
rct_string_id stringId = _availableObjectStringIds.top();
|
rct_string_id stringId = _availableObjectStringIds.top();
|
||||||
_availableObjectStringIds.pop();
|
_availableObjectStringIds.pop();
|
||||||
_languageCurrent->SetString(stringId, target);
|
_languageCurrent->SetString(stringId, target);
|
||||||
|
|
|
@ -539,49 +539,49 @@ static void format_integer(char **dest, size_t *size, long long value)
|
||||||
int digit;
|
int digit;
|
||||||
char *nbegin, *nend, *ncur;
|
char *nbegin, *nend, *ncur;
|
||||||
char tmp;
|
char tmp;
|
||||||
|
|
||||||
if ((*size) == 0) return;
|
if ((*size) == 0) return;
|
||||||
|
|
||||||
// Negative sign
|
// Negative sign
|
||||||
if (value < 0) {
|
if (value < 0) {
|
||||||
format_push_char('-');
|
format_push_char('-');
|
||||||
value = -value;
|
value = -value;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (value == 0) {
|
if (value == 0) {
|
||||||
format_push_char('0');
|
format_push_char('0');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
nbegin = (*dest);
|
nbegin = (*dest);
|
||||||
|
|
||||||
// Right to left
|
// Right to left
|
||||||
while (value > 0 && (*size) > 1) {
|
while (value > 0 && (*size) > 1) {
|
||||||
digit = value % 10;
|
digit = value % 10;
|
||||||
value /= 10;
|
value /= 10;
|
||||||
|
|
||||||
format_push_char_safe('0' + digit);
|
format_push_char_safe('0' + digit);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (value > 0) {
|
if (value > 0) {
|
||||||
ncur = nbegin;
|
ncur = nbegin;
|
||||||
|
|
||||||
while (value > 0) {
|
while (value > 0) {
|
||||||
digit = value % 10;
|
digit = value % 10;
|
||||||
value /= 10;
|
value /= 10;
|
||||||
|
|
||||||
format_push_wrap('0' + digit);
|
format_push_wrap('0' + digit);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reverse first half of string
|
// Reverse first half of string
|
||||||
nend = ncur - 1;
|
nend = ncur - 1;
|
||||||
reverse_string();
|
reverse_string();
|
||||||
|
|
||||||
// Reverse second half of string
|
// Reverse second half of string
|
||||||
nbegin = ncur;
|
nbegin = ncur;
|
||||||
nend = (*dest) - 1;
|
nend = (*dest) - 1;
|
||||||
reverse_string();
|
reverse_string();
|
||||||
|
|
||||||
format_push_char_safe('\0'); // truncate overflowed string
|
format_push_char_safe('\0'); // truncate overflowed string
|
||||||
} else {
|
} else {
|
||||||
// Reverse string
|
// Reverse string
|
||||||
|
@ -597,7 +597,7 @@ static void format_comma_separated_integer(char **dest, size_t *size, long long
|
||||||
char tmp;
|
char tmp;
|
||||||
const char *commaMark = language_get_string(STR_LOCALE_THOUSANDS_SEPARATOR);
|
const char *commaMark = language_get_string(STR_LOCALE_THOUSANDS_SEPARATOR);
|
||||||
const char *ch = NULL;
|
const char *ch = NULL;
|
||||||
|
|
||||||
if ((*size) == 0) return;
|
if ((*size) == 0) return;
|
||||||
|
|
||||||
// Negative sign
|
// Negative sign
|
||||||
|
@ -605,7 +605,7 @@ static void format_comma_separated_integer(char **dest, size_t *size, long long
|
||||||
format_push_char('-');
|
format_push_char('-');
|
||||||
value = -value;
|
value = -value;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (value == 0) {
|
if (value == 0) {
|
||||||
format_push_char('0');
|
format_push_char('0');
|
||||||
return;
|
return;
|
||||||
|
@ -621,14 +621,14 @@ static void format_comma_separated_integer(char **dest, size_t *size, long long
|
||||||
groupIndex = 0;
|
groupIndex = 0;
|
||||||
ch = commaMark;
|
ch = commaMark;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ch != NULL ) {
|
if (ch != NULL ) {
|
||||||
format_push_char_safe(*ch++);
|
format_push_char_safe(*ch++);
|
||||||
if (*ch == '\0') ch = NULL;
|
if (*ch == '\0') ch = NULL;
|
||||||
} else {
|
} else {
|
||||||
digit = value % 10;
|
digit = value % 10;
|
||||||
value /= 10;
|
value /= 10;
|
||||||
|
|
||||||
format_push_char_safe('0' + digit);
|
format_push_char_safe('0' + digit);
|
||||||
groupIndex++;
|
groupIndex++;
|
||||||
}
|
}
|
||||||
|
@ -636,35 +636,35 @@ static void format_comma_separated_integer(char **dest, size_t *size, long long
|
||||||
|
|
||||||
if (value > 0) {
|
if (value > 0) {
|
||||||
ncur = nbegin;
|
ncur = nbegin;
|
||||||
|
|
||||||
while (value > 0) {
|
while (value > 0) {
|
||||||
// Append group separator
|
// Append group separator
|
||||||
if (groupIndex == 3) {
|
if (groupIndex == 3) {
|
||||||
groupIndex = 0;
|
groupIndex = 0;
|
||||||
ch = commaMark;
|
ch = commaMark;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ch != NULL ) {
|
if (ch != NULL ) {
|
||||||
format_push_wrap(*ch++);
|
format_push_wrap(*ch++);
|
||||||
if (*ch == '\0') ch = NULL;
|
if (*ch == '\0') ch = NULL;
|
||||||
} else {
|
} else {
|
||||||
digit = value % 10;
|
digit = value % 10;
|
||||||
value /= 10;
|
value /= 10;
|
||||||
|
|
||||||
format_push_wrap('0' + digit);
|
format_push_wrap('0' + digit);
|
||||||
groupIndex++;
|
groupIndex++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reverse first half of string
|
// Reverse first half of string
|
||||||
nend = ncur - 1;
|
nend = ncur - 1;
|
||||||
reverse_string();
|
reverse_string();
|
||||||
|
|
||||||
// Reverse second half of string
|
// Reverse second half of string
|
||||||
nbegin = ncur;
|
nbegin = ncur;
|
||||||
nend = (*dest) - 1;
|
nend = (*dest) - 1;
|
||||||
reverse_string();
|
reverse_string();
|
||||||
|
|
||||||
format_push_char_safe('\0'); // truncate overflowed string
|
format_push_char_safe('\0'); // truncate overflowed string
|
||||||
} else {
|
} else {
|
||||||
// Reverse string
|
// Reverse string
|
||||||
|
@ -682,7 +682,7 @@ static void format_comma_separated_fixed_1dp(char **dest, size_t *size, long lon
|
||||||
const char *decimalMark = language_get_string(STR_LOCALE_DECIMAL_POINT);
|
const char *decimalMark = language_get_string(STR_LOCALE_DECIMAL_POINT);
|
||||||
const char *ch = NULL;
|
const char *ch = NULL;
|
||||||
int zeroNeeded = 1;
|
int zeroNeeded = 1;
|
||||||
|
|
||||||
if ((*size) == 0) return;
|
if ((*size) == 0) return;
|
||||||
|
|
||||||
// Negative sign
|
// Negative sign
|
||||||
|
@ -690,7 +690,7 @@ static void format_comma_separated_fixed_1dp(char **dest, size_t *size, long lon
|
||||||
format_push_char('-');
|
format_push_char('-');
|
||||||
value = -value;
|
value = -value;
|
||||||
}
|
}
|
||||||
|
|
||||||
nbegin = (*dest);
|
nbegin = (*dest);
|
||||||
|
|
||||||
// In the case of buffers this small,
|
// In the case of buffers this small,
|
||||||
|
@ -700,7 +700,7 @@ static void format_comma_separated_fixed_1dp(char **dest, size_t *size, long lon
|
||||||
// One decimal place
|
// One decimal place
|
||||||
digit = value % 10;
|
digit = value % 10;
|
||||||
format_push_char_safe('0' + digit);
|
format_push_char_safe('0' + digit);
|
||||||
|
|
||||||
ch = decimalMark;
|
ch = decimalMark;
|
||||||
}
|
}
|
||||||
value /= 10;
|
value /= 10;
|
||||||
|
@ -712,7 +712,7 @@ static void format_comma_separated_fixed_1dp(char **dest, size_t *size, long lon
|
||||||
groupIndex = 0;
|
groupIndex = 0;
|
||||||
ch = commaMark;
|
ch = commaMark;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ch != NULL ) {
|
if (ch != NULL ) {
|
||||||
format_push_char_safe(*ch++);
|
format_push_char_safe(*ch++);
|
||||||
if (*ch == '\0') ch = NULL;
|
if (*ch == '\0') ch = NULL;
|
||||||
|
@ -720,7 +720,7 @@ static void format_comma_separated_fixed_1dp(char **dest, size_t *size, long lon
|
||||||
zeroNeeded = 0;
|
zeroNeeded = 0;
|
||||||
digit = value % 10;
|
digit = value % 10;
|
||||||
value /= 10;
|
value /= 10;
|
||||||
|
|
||||||
format_push_char_safe('0' + digit);
|
format_push_char_safe('0' + digit);
|
||||||
groupIndex++;
|
groupIndex++;
|
||||||
}
|
}
|
||||||
|
@ -728,14 +728,14 @@ static void format_comma_separated_fixed_1dp(char **dest, size_t *size, long lon
|
||||||
|
|
||||||
if (zeroNeeded || value > 0) {
|
if (zeroNeeded || value > 0) {
|
||||||
ncur = nbegin;
|
ncur = nbegin;
|
||||||
|
|
||||||
while (zeroNeeded || value > 0) {
|
while (zeroNeeded || value > 0) {
|
||||||
// Append group separator
|
// Append group separator
|
||||||
if (groupIndex == 3) {
|
if (groupIndex == 3) {
|
||||||
groupIndex = 0;
|
groupIndex = 0;
|
||||||
ch = commaMark;
|
ch = commaMark;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ch != NULL ) {
|
if (ch != NULL ) {
|
||||||
format_push_wrap(*ch++);
|
format_push_wrap(*ch++);
|
||||||
if (*ch == '\0') ch = NULL;
|
if (*ch == '\0') ch = NULL;
|
||||||
|
@ -743,21 +743,21 @@ static void format_comma_separated_fixed_1dp(char **dest, size_t *size, long lon
|
||||||
zeroNeeded = 0;
|
zeroNeeded = 0;
|
||||||
digit = value % 10;
|
digit = value % 10;
|
||||||
value /= 10;
|
value /= 10;
|
||||||
|
|
||||||
format_push_wrap('0' + digit);
|
format_push_wrap('0' + digit);
|
||||||
groupIndex++;
|
groupIndex++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reverse first half of string
|
// Reverse first half of string
|
||||||
nend = ncur - 1;
|
nend = ncur - 1;
|
||||||
reverse_string();
|
reverse_string();
|
||||||
|
|
||||||
// Reverse second half of string
|
// Reverse second half of string
|
||||||
nbegin = ncur;
|
nbegin = ncur;
|
||||||
nend = (*dest) - 1;
|
nend = (*dest) - 1;
|
||||||
reverse_string();
|
reverse_string();
|
||||||
|
|
||||||
format_push_char_safe('\0'); // truncate overflowed string
|
format_push_char_safe('\0'); // truncate overflowed string
|
||||||
} else {
|
} else {
|
||||||
// Reverse string
|
// Reverse string
|
||||||
|
@ -775,7 +775,7 @@ static void format_comma_separated_fixed_2dp(char **dest, size_t *size, long lon
|
||||||
const char *decimalMark = language_get_string(STR_LOCALE_DECIMAL_POINT);
|
const char *decimalMark = language_get_string(STR_LOCALE_DECIMAL_POINT);
|
||||||
const char *ch = NULL;
|
const char *ch = NULL;
|
||||||
int zeroNeeded = 1;
|
int zeroNeeded = 1;
|
||||||
|
|
||||||
if ((*size) == 0) return;
|
if ((*size) == 0) return;
|
||||||
|
|
||||||
// Negative sign
|
// Negative sign
|
||||||
|
@ -796,11 +796,11 @@ static void format_comma_separated_fixed_2dp(char **dest, size_t *size, long lon
|
||||||
digit = value % 10;
|
digit = value % 10;
|
||||||
value /= 10;
|
value /= 10;
|
||||||
format_push_char_safe('0' + digit);
|
format_push_char_safe('0' + digit);
|
||||||
|
|
||||||
digit = value % 10;
|
digit = value % 10;
|
||||||
value /= 10;
|
value /= 10;
|
||||||
format_push_char_safe('0' + digit);
|
format_push_char_safe('0' + digit);
|
||||||
|
|
||||||
ch = decimalMark;
|
ch = decimalMark;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -811,7 +811,7 @@ static void format_comma_separated_fixed_2dp(char **dest, size_t *size, long lon
|
||||||
groupIndex = 0;
|
groupIndex = 0;
|
||||||
ch = commaMark;
|
ch = commaMark;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ch != NULL ) {
|
if (ch != NULL ) {
|
||||||
format_push_char_safe(*ch++);
|
format_push_char_safe(*ch++);
|
||||||
if (*ch == '\0') ch = NULL;
|
if (*ch == '\0') ch = NULL;
|
||||||
|
@ -819,22 +819,22 @@ static void format_comma_separated_fixed_2dp(char **dest, size_t *size, long lon
|
||||||
zeroNeeded = 0;
|
zeroNeeded = 0;
|
||||||
digit = value % 10;
|
digit = value % 10;
|
||||||
value /= 10;
|
value /= 10;
|
||||||
|
|
||||||
format_push_char_safe('0' + digit);
|
format_push_char_safe('0' + digit);
|
||||||
groupIndex++;
|
groupIndex++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (zeroNeeded || value > 0) {
|
if (zeroNeeded || value > 0) {
|
||||||
ncur = nbegin;
|
ncur = nbegin;
|
||||||
|
|
||||||
while (zeroNeeded || value > 0) {
|
while (zeroNeeded || value > 0) {
|
||||||
// Append group separator
|
// Append group separator
|
||||||
if (groupIndex == 3) {
|
if (groupIndex == 3) {
|
||||||
groupIndex = 0;
|
groupIndex = 0;
|
||||||
ch = commaMark;
|
ch = commaMark;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ch != NULL ) {
|
if (ch != NULL ) {
|
||||||
format_push_wrap(*ch++);
|
format_push_wrap(*ch++);
|
||||||
if (*ch == '\0') ch = NULL;
|
if (*ch == '\0') ch = NULL;
|
||||||
|
@ -842,21 +842,21 @@ static void format_comma_separated_fixed_2dp(char **dest, size_t *size, long lon
|
||||||
zeroNeeded = 0;
|
zeroNeeded = 0;
|
||||||
digit = value % 10;
|
digit = value % 10;
|
||||||
value /= 10;
|
value /= 10;
|
||||||
|
|
||||||
format_push_wrap('0' + digit);
|
format_push_wrap('0' + digit);
|
||||||
groupIndex++;
|
groupIndex++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reverse first half of string
|
// Reverse first half of string
|
||||||
nend = ncur - 1;
|
nend = ncur - 1;
|
||||||
reverse_string();
|
reverse_string();
|
||||||
|
|
||||||
// Reverse second half of string
|
// Reverse second half of string
|
||||||
nbegin = ncur;
|
nbegin = ncur;
|
||||||
nend = (*dest) - 1;
|
nend = (*dest) - 1;
|
||||||
reverse_string();
|
reverse_string();
|
||||||
|
|
||||||
format_push_char_safe('\0'); // truncate overflowed string
|
format_push_char_safe('\0'); // truncate overflowed string
|
||||||
} else {
|
} else {
|
||||||
// Reverse string
|
// Reverse string
|
||||||
|
@ -868,9 +868,9 @@ static void format_comma_separated_fixed_2dp(char **dest, size_t *size, long lon
|
||||||
static void format_currency(char **dest, size_t *size, long long value)
|
static void format_currency(char **dest, size_t *size, long long value)
|
||||||
{
|
{
|
||||||
if ((*size) == 0) return;
|
if ((*size) == 0) return;
|
||||||
|
|
||||||
const currency_descriptor *currencyDesc = &CurrencyDescriptors[gConfigGeneral.currency_format];
|
const currency_descriptor *currencyDesc = &CurrencyDescriptors[gConfigGeneral.currency_format];
|
||||||
|
|
||||||
value *= currencyDesc->rate;
|
value *= currencyDesc->rate;
|
||||||
|
|
||||||
// Negative sign
|
// Negative sign
|
||||||
|
@ -878,7 +878,7 @@ static void format_currency(char **dest, size_t *size, long long value)
|
||||||
format_push_char('-');
|
format_push_char('-');
|
||||||
value = -value;
|
value = -value;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Round the value away from zero
|
//Round the value away from zero
|
||||||
value = (value + 99) / 100;
|
value = (value + 99) / 100;
|
||||||
|
|
||||||
|
@ -906,7 +906,7 @@ static void format_currency(char **dest, size_t *size, long long value)
|
||||||
static void format_currency_2dp(char **dest, size_t *size, long long value)
|
static void format_currency_2dp(char **dest, size_t *size, long long value)
|
||||||
{
|
{
|
||||||
if ((*size) == 0) return;
|
if ((*size) == 0) return;
|
||||||
|
|
||||||
const currency_descriptor *currencyDesc = &CurrencyDescriptors[gConfigGeneral.currency_format];
|
const currency_descriptor *currencyDesc = &CurrencyDescriptors[gConfigGeneral.currency_format];
|
||||||
|
|
||||||
int rate = currencyDesc->rate;
|
int rate = currencyDesc->rate;
|
||||||
|
@ -1005,7 +1005,7 @@ static void format_duration(char **dest, size_t *size, uint16 value)
|
||||||
if (minutes != 1) {
|
if (minutes != 1) {
|
||||||
minuteIndex = 2;
|
minuteIndex = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
argsRef--;
|
argsRef--;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1015,7 +1015,7 @@ static void format_duration(char **dest, size_t *size, uint16 value)
|
||||||
}
|
}
|
||||||
|
|
||||||
rct_string_id stringId = DurationFormats[minuteIndex][secondsIndex];
|
rct_string_id stringId = DurationFormats[minuteIndex][secondsIndex];
|
||||||
|
|
||||||
format_string_part(dest, size, stringId, (char**)&argsRef);
|
format_string_part(dest, size, stringId, (char**)&argsRef);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1055,7 +1055,7 @@ static void format_realtime(char **dest, size_t *size, uint16 value)
|
||||||
static void format_string_code(unsigned int format_code, char **dest, size_t *size, char **args)
|
static void format_string_code(unsigned int format_code, char **dest, size_t *size, char **args)
|
||||||
{
|
{
|
||||||
intptr_t value;
|
intptr_t value;
|
||||||
|
|
||||||
if ((*size) == 0) return;
|
if ((*size) == 0) return;
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
|
|
|
@ -55,7 +55,7 @@ int NetworkConnection::ReadPacket()
|
||||||
{
|
{
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
InboundPacket.transferred += readBytes;
|
InboundPacket.transferred += readBytes;
|
||||||
if (InboundPacket.transferred == sizeof(InboundPacket.size))
|
if (InboundPacket.transferred == sizeof(InboundPacket.size))
|
||||||
{
|
{
|
||||||
|
|
|
@ -213,7 +213,7 @@ public:
|
||||||
sizeof(hostName),
|
sizeof(hostName),
|
||||||
nullptr,
|
nullptr,
|
||||||
0,
|
0,
|
||||||
NI_NUMERICHOST | NI_NUMERICSERV);
|
NI_NUMERICHOST | NI_NUMERICSERV);
|
||||||
SetTCPNoDelay(socket, true);
|
SetTCPNoDelay(socket, true);
|
||||||
tcpSocket = new TcpSocket(socket);
|
tcpSocket = new TcpSocket(socket);
|
||||||
if (rc == 0)
|
if (rc == 0)
|
||||||
|
@ -231,7 +231,7 @@ public:
|
||||||
{
|
{
|
||||||
throw Exception("Socket not closed.");
|
throw Exception("Socket not closed.");
|
||||||
}
|
}
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// Resolve address
|
// Resolve address
|
||||||
|
@ -420,7 +420,7 @@ public:
|
||||||
SDL_UnlockMutex(_connectMutex);
|
SDL_UnlockMutex(_connectMutex);
|
||||||
}
|
}
|
||||||
|
|
||||||
const char * GetHostName() const override
|
const char * GetHostName() const override
|
||||||
{
|
{
|
||||||
return _hostName.empty() ? nullptr : _hostName.c_str();
|
return _hostName.empty() ? nullptr : _hostName.c_str();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1722,7 +1722,7 @@ void Network::Server_Handle_GAMECMD(NetworkConnection& connection, NetworkPacket
|
||||||
int commandCommand = args[4];
|
int commandCommand = args[4];
|
||||||
|
|
||||||
int ticks = SDL_GetTicks(); //tick count is different by time last_action_time is set, keep same value.
|
int ticks = SDL_GetTicks(); //tick count is different by time last_action_time is set, keep same value.
|
||||||
|
|
||||||
// Check if player's group permission allows command to run
|
// Check if player's group permission allows command to run
|
||||||
NetworkGroup* group = GetGroupByID(connection.Player->group);
|
NetworkGroup* group = GetGroupByID(connection.Player->group);
|
||||||
if (!group || (group && !group->CanPerformCommand(commandCommand))) {
|
if (!group || (group && !group->CanPerformCommand(commandCommand))) {
|
||||||
|
@ -1730,7 +1730,7 @@ void Network::Server_Handle_GAMECMD(NetworkConnection& connection, NetworkPacket
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// In case someone modifies the code / memory to enable cluster build,
|
// In case someone modifies the code / memory to enable cluster build,
|
||||||
// require a small delay in between placing scenery to provide some security, as
|
// require a small delay in between placing scenery to provide some security, as
|
||||||
// cluster mode is a for loop that runs the place_scenery code multiple times.
|
// cluster mode is a for loop that runs the place_scenery code multiple times.
|
||||||
if (commandCommand == GAME_COMMAND_PLACE_SCENERY) {
|
if (commandCommand == GAME_COMMAND_PLACE_SCENERY) {
|
||||||
if ((ticks - connection.Player->last_action_time) < 20) {
|
if ((ticks - connection.Player->last_action_time) < 20) {
|
||||||
|
@ -2380,7 +2380,7 @@ int network_can_perform_action(unsigned int groupindex, unsigned int index)
|
||||||
return gNetwork.group_list[groupindex]->CanPerformAction(index);
|
return gNetwork.group_list[groupindex]->CanPerformAction(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
int network_can_perform_command(unsigned int groupindex, unsigned int index)
|
int network_can_perform_command(unsigned int groupindex, unsigned int index)
|
||||||
{
|
{
|
||||||
return gNetwork.group_list[groupindex]->CanPerformCommand(index);
|
return gNetwork.group_list[groupindex]->CanPerformCommand(index);
|
||||||
}
|
}
|
||||||
|
|
|
@ -530,9 +530,9 @@ namespace Twitch
|
||||||
for (ch = message, cmd = "news"; *cmd != '\0'; ++ch, ++cmd) {
|
for (ch = message, cmd = "news"; *cmd != '\0'; ++ch, ++cmd) {
|
||||||
if (*ch != *cmd) return;
|
if (*ch != *cmd) return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isspace(*ch)) return;
|
if (!isspace(*ch)) return;
|
||||||
|
|
||||||
ch = strskipwhitespace(ch);
|
ch = strskipwhitespace(ch);
|
||||||
DoChatMessageNews(ch);
|
DoChatMessageNews(ch);
|
||||||
}
|
}
|
||||||
|
|
|
@ -111,7 +111,7 @@ namespace ObjectFactory
|
||||||
log_error("Unable to allocate data buffer.");
|
log_error("Unable to allocate data buffer.");
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
bufferSize = sawyercoding_read_chunk_with_size(file, (uint8 *)buffer, bufferSize);
|
bufferSize = sawyercoding_read_chunk_with_size(file, (uint8 *)buffer, bufferSize);
|
||||||
if (bufferSize == SIZE_MAX)
|
if (bufferSize == SIZE_MAX)
|
||||||
{
|
{
|
||||||
|
|
|
@ -77,7 +77,7 @@ struct ObjectEntryHash
|
||||||
return hash;
|
return hash;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ObjectEntryEqual
|
struct ObjectEntryEqual
|
||||||
{
|
{
|
||||||
bool operator()(const rct_object_entry &lhs, const rct_object_entry &rhs) const
|
bool operator()(const rct_object_entry &lhs, const rct_object_entry &rhs) const
|
||||||
|
@ -114,7 +114,7 @@ public:
|
||||||
QueryDirectory(&_queryDirectoryResult, path);
|
QueryDirectory(&_queryDirectoryResult, path);
|
||||||
GetUserObjectPath(path, sizeof(path));
|
GetUserObjectPath(path, sizeof(path));
|
||||||
QueryDirectory(&_queryDirectoryResult, path);
|
QueryDirectory(&_queryDirectoryResult, path);
|
||||||
|
|
||||||
if (!Load())
|
if (!Load())
|
||||||
{
|
{
|
||||||
_languageId = gCurrentLanguage;
|
_languageId = gCurrentLanguage;
|
||||||
|
|
|
@ -85,7 +85,7 @@ void RideObject::ReadLegacy(IReadObjectContext * context, IStream * stream)
|
||||||
_presetColours.count = stream->ReadValue<uint8>();
|
_presetColours.count = stream->ReadValue<uint8>();
|
||||||
|
|
||||||
int coloursCount = _presetColours.count;
|
int coloursCount = _presetColours.count;
|
||||||
// To indicate a ride has different colours each train the count
|
// To indicate a ride has different colours each train the count
|
||||||
// is set to 255. There are only actually 32 colours though.
|
// is set to 255. There are only actually 32 colours though.
|
||||||
if (coloursCount == 255)
|
if (coloursCount == 255)
|
||||||
{
|
{
|
||||||
|
|
|
@ -151,13 +151,13 @@ static void path_bit_bins_paint(rct_scenery_entry* pathBitEntry, rct_map_element
|
||||||
|
|
||||||
if (!(mapElement->flags & MAP_ELEMENT_FLAG_BROKEN)) {
|
if (!(mapElement->flags & MAP_ELEMENT_FLAG_BROKEN)) {
|
||||||
imageId -= 4;
|
imageId -= 4;
|
||||||
|
|
||||||
// Edges have been rotated around the rotation to check addition status
|
// Edges have been rotated around the rotation to check addition status
|
||||||
// this will also need to be rotated.
|
// this will also need to be rotated.
|
||||||
if (!(mapElement->properties.path.addition_status & ror8(0x3,(2 * get_current_rotation()))))
|
if (!(mapElement->properties.path.addition_status & ror8(0x3,(2 * get_current_rotation()))))
|
||||||
imageId += 8;
|
imageId += 8;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
sub_98197C(imageId, 7, 16, 1, 1, 7, height, 7, 16, height + 2, get_current_rotation());
|
sub_98197C(imageId, 7, 16, 1, 1, 7, height, 7, 16, height + 2, get_current_rotation());
|
||||||
}
|
}
|
||||||
|
@ -169,12 +169,12 @@ static void path_bit_bins_paint(rct_scenery_entry* pathBitEntry, rct_map_element
|
||||||
if (!(mapElement->flags & MAP_ELEMENT_FLAG_BROKEN)) {
|
if (!(mapElement->flags & MAP_ELEMENT_FLAG_BROKEN)) {
|
||||||
imageId -= 4;
|
imageId -= 4;
|
||||||
|
|
||||||
// Edges have been rotated around the rotation to check addition status
|
// Edges have been rotated around the rotation to check addition status
|
||||||
// this will also need to be rotated.
|
// this will also need to be rotated.
|
||||||
if (!(mapElement->properties.path.addition_status & ror8(0xC, (2 * get_current_rotation()))))
|
if (!(mapElement->properties.path.addition_status & ror8(0xC, (2 * get_current_rotation()))))
|
||||||
imageId += 8;
|
imageId += 8;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
sub_98197C(imageId, 16, 25, 1, 1, 7, height, 16, 25, height + 2, get_current_rotation());
|
sub_98197C(imageId, 16, 25, 1, 1, 7, height, 16, 25, height + 2, get_current_rotation());
|
||||||
}
|
}
|
||||||
|
@ -186,13 +186,13 @@ static void path_bit_bins_paint(rct_scenery_entry* pathBitEntry, rct_map_element
|
||||||
|
|
||||||
if (!(mapElement->flags & MAP_ELEMENT_FLAG_BROKEN)) {
|
if (!(mapElement->flags & MAP_ELEMENT_FLAG_BROKEN)) {
|
||||||
imageId -= 4;
|
imageId -= 4;
|
||||||
|
|
||||||
// Edges have been rotated around the rotation to check addition status
|
// Edges have been rotated around the rotation to check addition status
|
||||||
// this will also need to be rotated.
|
// this will also need to be rotated.
|
||||||
if (!(mapElement->properties.path.addition_status & ror8(0x30, (2 * get_current_rotation()))))
|
if (!(mapElement->properties.path.addition_status & ror8(0x30, (2 * get_current_rotation()))))
|
||||||
imageId += 8;
|
imageId += 8;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
sub_98197C(imageId, 25, 16, 1, 1, 7, height, 25, 16, height + 2, get_current_rotation());
|
sub_98197C(imageId, 25, 16, 1, 1, 7, height, 25, 16, height + 2, get_current_rotation());
|
||||||
}
|
}
|
||||||
|
@ -205,12 +205,12 @@ static void path_bit_bins_paint(rct_scenery_entry* pathBitEntry, rct_map_element
|
||||||
if (!(mapElement->flags & MAP_ELEMENT_FLAG_BROKEN)) {
|
if (!(mapElement->flags & MAP_ELEMENT_FLAG_BROKEN)) {
|
||||||
imageId -= 4;
|
imageId -= 4;
|
||||||
|
|
||||||
// Edges have been rotated around the rotation to check addition status
|
// Edges have been rotated around the rotation to check addition status
|
||||||
// this will also need to be rotated.
|
// this will also need to be rotated.
|
||||||
if (!(mapElement->properties.path.addition_status & ror8(0xC0, (2 * get_current_rotation()))))
|
if (!(mapElement->properties.path.addition_status & ror8(0xC0, (2 * get_current_rotation()))))
|
||||||
imageId += 8;
|
imageId += 8;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
sub_98197C(imageId, 16, 7, 1, 1, 7, height, 16, 7, height + 2, get_current_rotation());
|
sub_98197C(imageId, 16, 7, 1, 1, 7, height, 16, 7, height + 2, get_current_rotation());
|
||||||
}
|
}
|
||||||
|
@ -381,7 +381,7 @@ static void sub_6A4101(rct_map_element * map_element, uint16 height, uint32 ebp,
|
||||||
};
|
};
|
||||||
|
|
||||||
uint32 imageId = (direction << 1) + base_image_id + 101;
|
uint32 imageId = (direction << 1) + base_image_id + 101;
|
||||||
|
|
||||||
sub_98197C(imageId, 0, 0, 1, 1, 21, height, boundBoxOffsets.x, boundBoxOffsets.y, boundBoxOffsets.z, get_current_rotation());
|
sub_98197C(imageId, 0, 0, 1, 1, 21, height, boundBoxOffsets.x, boundBoxOffsets.y, boundBoxOffsets.z, get_current_rotation());
|
||||||
|
|
||||||
boundBoxOffsets.x = BannerBoundBoxes[direction][1].x;
|
boundBoxOffsets.x = BannerBoundBoxes[direction][1].x;
|
||||||
|
@ -623,7 +623,7 @@ static void sub_6A3F61(rct_map_element * map_element, uint16 bp, uint16 height,
|
||||||
path_bit_jumping_fountains_paint(sceneryEntry, map_element, height, (uint8)bp, sceneryImageFlags, dpi);
|
path_bit_jumping_fountains_paint(sceneryEntry, map_element, height, (uint8)bp, sceneryImageFlags, dpi);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
gPaintInteractionType = VIEWPORT_INTERACTION_ITEM_FOOTPATH;
|
gPaintInteractionType = VIEWPORT_INTERACTION_ITEM_FOOTPATH;
|
||||||
|
|
||||||
if (sceneryImageFlags != 0) {
|
if (sceneryImageFlags != 0) {
|
||||||
|
@ -987,7 +987,7 @@ void loc_6A3B57(rct_map_element* mapElement, sint16 height, rct_footpath_entry*
|
||||||
}
|
}
|
||||||
|
|
||||||
paint_util_set_general_support_height(height, 0x20);
|
paint_util_set_general_support_height(height, 0x20);
|
||||||
|
|
||||||
if ((mapElement->type & 1)
|
if ((mapElement->type & 1)
|
||||||
|| (mapElement->properties.path.edges != 0xFF && hasFences)
|
|| (mapElement->properties.path.edges != 0xFF && hasFences)
|
||||||
) {
|
) {
|
||||||
|
|
|
@ -62,7 +62,7 @@ void scenery_paint(uint8 direction, int height, rct_map_element* mapElement) {
|
||||||
baseImageid = construction_markers[gConfigGeneral.construction_marker_colour];
|
baseImageid = construction_markers[gConfigGeneral.construction_marker_colour];
|
||||||
}
|
}
|
||||||
uint32 dword_F64EB0 = baseImageid;
|
uint32 dword_F64EB0 = baseImageid;
|
||||||
|
|
||||||
rct_scenery_entry *entry = get_small_scenery_entry(mapElement->properties.scenery.type);
|
rct_scenery_entry *entry = get_small_scenery_entry(mapElement->properties.scenery.type);
|
||||||
baseImageid = entry->image + direction;
|
baseImageid = entry->image + direction;
|
||||||
boxlength.x = 2;
|
boxlength.x = 2;
|
||||||
|
@ -186,7 +186,7 @@ void scenery_paint(uint8 direction, int height, rct_map_element* mapElement) {
|
||||||
if (image_id >= 48) {
|
if (image_id >= 48) {
|
||||||
image_id -= 48;
|
image_id -= 48;
|
||||||
}
|
}
|
||||||
|
|
||||||
image_id = image_id + entry->image + 68;
|
image_id = image_id + entry->image + 68;
|
||||||
if (dword_F64EB0 != 0) {
|
if (dword_F64EB0 != 0) {
|
||||||
image_id = (image_id & 0x7FFFF) | dword_F64EB0;
|
image_id = (image_id & 0x7FFFF) | dword_F64EB0;
|
||||||
|
|
|
@ -366,6 +366,6 @@ void scenery_multiple_paint(uint8 direction, uint16 height, rct_map_element *map
|
||||||
uint16 string_width = gfx_get_string_width(signString);
|
uint16 string_width = gfx_get_string_width(signString);
|
||||||
uint16 scroll = (gCurrentTicks / 2) % string_width;
|
uint16 scroll = (gCurrentTicks / 2) % string_width;
|
||||||
sub_98199C(scrolling_text_setup(stringId, scroll, scrollMode), 0, 0, 1, 1, 21, height + 25, boxoffset.x, boxoffset.y, boxoffset.z, get_current_rotation());
|
sub_98199C(scrolling_text_setup(stringId, scroll, scrollMode), 0, 0, 1, 1, 21, height + 25, boxoffset.x, boxoffset.y, boxoffset.z, get_current_rotation());
|
||||||
|
|
||||||
scenery_multiple_paint_supports(direction, height, mapElement, dword_F4387C, tile);
|
scenery_multiple_paint_supports(direction, height, mapElement, dword_F4387C, tile);
|
||||||
}
|
}
|
||||||
|
|
|
@ -644,7 +644,7 @@ static void viewport_surface_draw_land_side_bottom(enum edge edge, uint8 height,
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Tunnels
|
// Tunnels
|
||||||
uint8 tunnelType = tunnelArray[0].type;
|
uint8 tunnelType = tunnelArray[0].type;
|
||||||
uint8 tunnelHeight = stru_97B570[tunnelType][0];
|
uint8 tunnelHeight = stru_97B570[tunnelType][0];
|
||||||
|
|
|
@ -520,7 +520,7 @@ bool paint_attach_to_previous_attach(uint32 image_id, uint16 x, uint16 y)
|
||||||
if (g_aps_F1AD2C == NULL) {
|
if (g_aps_F1AD2C == NULL) {
|
||||||
return paint_attach_to_previous_ps(image_id, x, y);
|
return paint_attach_to_previous_ps(image_id, x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gNextFreePaintStruct >= gEndOfPaintStructArray) {
|
if (gNextFreePaintStruct >= gEndOfPaintStructArray) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -856,7 +856,7 @@ bool metal_a_supports_paint_setup(uint8 supportType, uint8 segment, int special,
|
||||||
|
|
||||||
height += z;
|
height += z;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
//int eax = special, ebx = 0, ecx = 0, edx = height, esi = 0, _edi = supportType, ebp = imageColourFlags;
|
//int eax = special, ebx = 0, ecx = 0, edx = height, esi = 0, _edi = supportType, ebp = imageColourFlags;
|
||||||
|
|
|
@ -1955,7 +1955,7 @@ bool peep_pickup_place(rct_peep* peep, int x, int y, int z, bool apply)
|
||||||
gGameCommandErrorTitle = STR_ERR_CANT_PLACE_PERSON_HERE;
|
gGameCommandErrorTitle = STR_ERR_CANT_PLACE_PERSON_HERE;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!map_can_construct_at(tile_x, tile_y, dest_z / 8, (dest_z / 8) + 1, 15)){
|
if (!map_can_construct_at(tile_x, tile_y, dest_z / 8, (dest_z / 8) + 1, 15)){
|
||||||
if (gGameCommandErrorText != STR_RAISE_OR_LOWER_LAND_FIRST) {
|
if (gGameCommandErrorText != STR_RAISE_OR_LOWER_LAND_FIRST) {
|
||||||
if (gGameCommandErrorText != STR_FOOTPATH_IN_THE_WAY) {
|
if (gGameCommandErrorText != STR_FOOTPATH_IN_THE_WAY) {
|
||||||
|
@ -4704,7 +4704,7 @@ static bool peep_update_fixing_sub_state_11(bool firstRun, rct_peep *peep, rct_r
|
||||||
peep->action_frame == 0x2B) {
|
peep->action_frame == 0x2B) {
|
||||||
audio_play_sound_at_location(SOUND_MECHANIC_FIX, peep->x, peep->y, peep->z);
|
audio_play_sound_at_location(SOUND_MECHANIC_FIX, peep->x, peep->y, peep->z);
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8698,7 +8698,7 @@ static uint8 footpath_element_next_in_direction(sint16 x, sint16 y, sint16 z, rc
|
||||||
* For return values 5, 6 & 8 the rideIndex is stored in outRideIndex.
|
* For return values 5, 6 & 8 the rideIndex is stored in outRideIndex.
|
||||||
*
|
*
|
||||||
* rct2: 0x006949B9
|
* rct2: 0x006949B9
|
||||||
*
|
*
|
||||||
* This is the recursive portion of footpath_element_destination_in_direction().
|
* This is the recursive portion of footpath_element_destination_in_direction().
|
||||||
*/
|
*/
|
||||||
static uint8 footpath_element_dest_in_dir(
|
static uint8 footpath_element_dest_in_dir(
|
||||||
|
@ -9410,7 +9410,7 @@ static void peep_pathfind_heuristic_search(sint16 x, sint16 y, uint8 z, rct_map_
|
||||||
/**
|
/**
|
||||||
* Returns:
|
* Returns:
|
||||||
* -1 - no direction chosen
|
* -1 - no direction chosen
|
||||||
* 0..3 - chosen direction
|
* 0..3 - chosen direction
|
||||||
*
|
*
|
||||||
* rct2: 0x0069A5F0
|
* rct2: 0x0069A5F0
|
||||||
*/
|
*/
|
||||||
|
@ -9752,7 +9752,7 @@ static int guest_path_find_leaving_park(rct_peep *peep, rct_map_element *map_ele
|
||||||
*/
|
*/
|
||||||
static int guest_path_find_park_entrance(rct_peep* peep, rct_map_element *map_element, uint8 edges){
|
static int guest_path_find_park_entrance(rct_peep* peep, rct_map_element *map_element, uint8 edges){
|
||||||
uint8 entranceNum;
|
uint8 entranceNum;
|
||||||
|
|
||||||
// Resolves already-corrupt guests (e.g. loaded from save)
|
// Resolves already-corrupt guests (e.g. loaded from save)
|
||||||
if (peep->peep_flags & PEEP_FLAGS_PARK_ENTRANCE_CHOSEN &&
|
if (peep->peep_flags & PEEP_FLAGS_PARK_ENTRANCE_CHOSEN &&
|
||||||
(peep->current_ride >= 4 || gParkEntranceX[peep->current_ride] == (sint16)0x8000)
|
(peep->current_ride >= 4 || gParkEntranceX[peep->current_ride] == (sint16)0x8000)
|
||||||
|
@ -10598,7 +10598,7 @@ static void peep_on_exit_ride(rct_peep *peep, int rideIndex)
|
||||||
peep->happiness = peep->happiness_growth_rate;
|
peep->happiness = peep->happiness_growth_rate;
|
||||||
peep->nausea = peep->nausea_growth_rate;
|
peep->nausea = peep->nausea_growth_rate;
|
||||||
peep->window_invalidate_flags |= PEEP_INVALIDATE_PEEP_STATS;
|
peep->window_invalidate_flags |= PEEP_INVALIDATE_PEEP_STATS;
|
||||||
|
|
||||||
if (peep->peep_flags & PEEP_FLAGS_LEAVING_PARK)
|
if (peep->peep_flags & PEEP_FLAGS_LEAVING_PARK)
|
||||||
peep->peep_flags &= ~(PEEP_FLAGS_PARK_ENTRANCE_CHOSEN);
|
peep->peep_flags &= ~(PEEP_FLAGS_PARK_ENTRANCE_CHOSEN);
|
||||||
|
|
||||||
|
|
|
@ -659,67 +659,67 @@ void staff_toggle_patrol_area(int staffIndex, int x, int y)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* rct2: 0x006BFBE8
|
* rct2: 0x006BFBE8
|
||||||
*
|
*
|
||||||
* Returns 0xFF when no nearby litter or unpathable litter
|
* Returns 0xFF when no nearby litter or unpathable litter
|
||||||
*/
|
*/
|
||||||
static uint8 staff_handyman_direction_to_nearest_litter(rct_peep* peep){
|
static uint8 staff_handyman_direction_to_nearest_litter(rct_peep* peep){
|
||||||
uint16 nearestLitterDist = (uint16)-1;
|
uint16 nearestLitterDist = (uint16)-1;
|
||||||
rct_litter* nearestLitter = NULL;
|
rct_litter* nearestLitter = NULL;
|
||||||
rct_litter* litter = NULL;
|
rct_litter* litter = NULL;
|
||||||
|
|
||||||
for (uint16 litterIndex = gSpriteListHead[SPRITE_LIST_LITTER]; litterIndex != 0xFFFF; litterIndex = litter->next){
|
for (uint16 litterIndex = gSpriteListHead[SPRITE_LIST_LITTER]; litterIndex != 0xFFFF; litterIndex = litter->next){
|
||||||
litter = &get_sprite(litterIndex)->litter;
|
litter = &get_sprite(litterIndex)->litter;
|
||||||
|
|
||||||
uint16 distance =
|
uint16 distance =
|
||||||
abs(litter->x - peep->x) +
|
abs(litter->x - peep->x) +
|
||||||
abs(litter->y - peep->y) +
|
abs(litter->y - peep->y) +
|
||||||
abs(litter->z - peep->z) * 4;
|
abs(litter->z - peep->z) * 4;
|
||||||
|
|
||||||
if (distance < nearestLitterDist){
|
if (distance < nearestLitterDist){
|
||||||
nearestLitterDist = distance;
|
nearestLitterDist = distance;
|
||||||
nearestLitter = litter;
|
nearestLitter = litter;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nearestLitterDist > 0x60){
|
if (nearestLitterDist > 0x60){
|
||||||
return 0xFF;
|
return 0xFF;
|
||||||
}
|
}
|
||||||
|
|
||||||
rct_xy16 litterTile = {
|
rct_xy16 litterTile = {
|
||||||
.x = nearestLitter->x & 0xFFE0,
|
.x = nearestLitter->x & 0xFFE0,
|
||||||
.y = nearestLitter->y & 0xFFE0
|
.y = nearestLitter->y & 0xFFE0
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!staff_is_location_in_patrol(peep, litterTile.x, litterTile.y)){
|
if (!staff_is_location_in_patrol(peep, litterTile.x, litterTile.y)){
|
||||||
return 0xFF;
|
return 0xFF;
|
||||||
}
|
}
|
||||||
|
|
||||||
litterTile.x += 16;
|
litterTile.x += 16;
|
||||||
litterTile.y += 16;
|
litterTile.y += 16;
|
||||||
|
|
||||||
sint16 x_diff = litterTile.x - peep->x;
|
sint16 x_diff = litterTile.x - peep->x;
|
||||||
sint16 y_diff = litterTile.y - peep->y;
|
sint16 y_diff = litterTile.y - peep->y;
|
||||||
|
|
||||||
uint8 nextDirection = 0;
|
uint8 nextDirection = 0;
|
||||||
|
|
||||||
if (abs(x_diff) <= abs(y_diff)){
|
if (abs(x_diff) <= abs(y_diff)){
|
||||||
nextDirection = y_diff < 0 ? 3 : 1;
|
nextDirection = y_diff < 0 ? 3 : 1;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
nextDirection = x_diff < 0 ? 0 : 2;
|
nextDirection = x_diff < 0 ? 0 : 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
rct_xy16 nextTile = {
|
rct_xy16 nextTile = {
|
||||||
.x = (nearestLitter->x & 0xFFE0) - TileDirectionDelta[nextDirection].x,
|
.x = (nearestLitter->x & 0xFFE0) - TileDirectionDelta[nextDirection].x,
|
||||||
.y = (nearestLitter->y & 0xFFE0) - TileDirectionDelta[nextDirection].y
|
.y = (nearestLitter->y & 0xFFE0) - TileDirectionDelta[nextDirection].y
|
||||||
};
|
};
|
||||||
|
|
||||||
sint16 nextZ = ((peep->z + 8) & 0xFFF0) / 8;
|
sint16 nextZ = ((peep->z + 8) & 0xFFF0) / 8;
|
||||||
|
|
||||||
rct_map_element* mapElement = map_get_first_element_at(nextTile.x / 32, nextTile.y / 32);
|
rct_map_element* mapElement = map_get_first_element_at(nextTile.x / 32, nextTile.y / 32);
|
||||||
|
|
||||||
do {
|
do {
|
||||||
if (mapElement->base_height != nextZ)
|
if (mapElement->base_height != nextZ)
|
||||||
continue;
|
continue;
|
||||||
|
@ -728,12 +728,12 @@ static uint8 staff_handyman_direction_to_nearest_litter(rct_peep* peep){
|
||||||
return 0xFF;
|
return 0xFF;
|
||||||
}
|
}
|
||||||
} while(!map_element_is_last_for_tile(mapElement++));
|
} while(!map_element_is_last_for_tile(mapElement++));
|
||||||
|
|
||||||
nextTile.x = (peep->x & 0xFFE0) + TileDirectionDelta[nextDirection].x;
|
nextTile.x = (peep->x & 0xFFE0) + TileDirectionDelta[nextDirection].x;
|
||||||
nextTile.y = (peep->y & 0xFFE0) + TileDirectionDelta[nextDirection].y;
|
nextTile.y = (peep->y & 0xFFE0) + TileDirectionDelta[nextDirection].y;
|
||||||
|
|
||||||
mapElement = map_get_first_element_at(nextTile.x / 32, nextTile.y / 32);
|
mapElement = map_get_first_element_at(nextTile.x / 32, nextTile.y / 32);
|
||||||
|
|
||||||
do {
|
do {
|
||||||
if (mapElement->base_height != nextZ)
|
if (mapElement->base_height != nextZ)
|
||||||
continue;
|
continue;
|
||||||
|
@ -742,7 +742,7 @@ static uint8 staff_handyman_direction_to_nearest_litter(rct_peep* peep){
|
||||||
return 0xFF;
|
return 0xFF;
|
||||||
}
|
}
|
||||||
} while(!map_element_is_last_for_tile(mapElement++));
|
} while(!map_element_is_last_for_tile(mapElement++));
|
||||||
|
|
||||||
return nextDirection;
|
return nextDirection;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -822,7 +822,7 @@ static int staff_handyman_direction_rand_surface(rct_peep* peep, uint8 validDire
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// If it tries all directions this is required
|
// If it tries all directions this is required
|
||||||
// to make it back to the first direction and
|
// to make it back to the first direction and
|
||||||
// override validDirections
|
// override validDirections
|
||||||
direction &= 3;
|
direction &= 3;
|
||||||
return direction;
|
return direction;
|
||||||
|
@ -843,9 +843,9 @@ static int staff_path_finding_handyman(rct_peep* peep)
|
||||||
((gCurrentTicks + peep->sprite_index) & 0xFFF) > 110) {
|
((gCurrentTicks + peep->sprite_index) & 0xFFF) > 110) {
|
||||||
litterDirection = staff_handyman_direction_to_nearest_litter(peep);
|
litterDirection = staff_handyman_direction_to_nearest_litter(peep);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8 direction = 0xFF;
|
uint8 direction = 0xFF;
|
||||||
if (litterDirection == 0xFF &&
|
if (litterDirection == 0xFF &&
|
||||||
(peep->staff_orders & STAFF_ORDERS_MOWING) &&
|
(peep->staff_orders & STAFF_ORDERS_MOWING) &&
|
||||||
peep->var_E2 >= 12
|
peep->var_E2 >= 12
|
||||||
) {
|
) {
|
||||||
|
@ -1005,7 +1005,7 @@ static uint8 staff_mechanic_direction_path_rand(rct_peep* peep, uint8 pathDirect
|
||||||
if (pathDirections & (1 << peep->direction))
|
if (pathDirections & (1 << peep->direction))
|
||||||
return peep->direction;
|
return peep->direction;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Modified from original to spam scenario_rand less
|
// Modified from original to spam scenario_rand less
|
||||||
uint8 direction = scenario_rand() & 3;
|
uint8 direction = scenario_rand() & 3;
|
||||||
for (int i = 0; i < 4; ++i, ++direction) {
|
for (int i = 0; i < 4; ++i, ++direction) {
|
||||||
|
@ -1163,7 +1163,7 @@ static int staff_path_finding_mechanic(rct_peep* peep) {
|
||||||
peep->destination_x = chosenTile.x + 16;
|
peep->destination_x = chosenTile.x + 16;
|
||||||
peep->destination_y = chosenTile.y + 16;
|
peep->destination_y = chosenTile.y + 16;
|
||||||
peep->destination_tolerence = (scenario_rand() & 7) + 2;
|
peep->destination_tolerence = (scenario_rand() & 7) + 2;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1292,9 +1292,9 @@ static int staff_path_finding_entertainer(rct_peep* peep) {
|
||||||
|
|
||||||
if (((scenario_rand() & 0xFFFF) <= 0x4000) &&
|
if (((scenario_rand() & 0xFFFF) <= 0x4000) &&
|
||||||
(peep->action == PEEP_ACTION_NONE_1 || peep->action == PEEP_ACTION_NONE_2)) {
|
(peep->action == PEEP_ACTION_NONE_1 || peep->action == PEEP_ACTION_NONE_2)) {
|
||||||
|
|
||||||
invalidate_sprite_2((rct_sprite*)peep);
|
invalidate_sprite_2((rct_sprite*)peep);
|
||||||
|
|
||||||
peep->action = scenario_rand() & 1 ? PEEP_ACTION_WAVE_2 : PEEP_ACTION_JOY;
|
peep->action = scenario_rand() & 1 ? PEEP_ACTION_WAVE_2 : PEEP_ACTION_JOY;
|
||||||
peep->action_frame = 0;
|
peep->action_frame = 0;
|
||||||
peep->action_sprite_image_offset = 0;
|
peep->action_sprite_image_offset = 0;
|
||||||
|
|
|
@ -63,7 +63,7 @@ void platform_posix_sub_user_data_path(char *buffer, size_t size, const char *ho
|
||||||
exit(-1);
|
exit(-1);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
safe_strcpy(buffer, homedir, size);
|
safe_strcpy(buffer, homedir, size);
|
||||||
safe_strcat_path(buffer, "Library", size);
|
safe_strcat_path(buffer, "Library", size);
|
||||||
safe_strcat_path(buffer, "Application Support", size);
|
safe_strcat_path(buffer, "Application Support", size);
|
||||||
|
@ -135,7 +135,7 @@ bool platform_open_common_file_dialog(utf8 *outFilename, file_dialog_desc *desc,
|
||||||
[extensions addObjectsFromArray:[fp componentsSeparatedByString:@";"]];
|
[extensions addObjectsFromArray:[fp componentsSeparatedByString:@";"]];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
NSString *directory;
|
NSString *directory;
|
||||||
NSSavePanel *panel;
|
NSSavePanel *panel;
|
||||||
if (desc->type == FD_SAVE)
|
if (desc->type == FD_SAVE)
|
||||||
|
@ -157,7 +157,7 @@ bool platform_open_common_file_dialog(utf8 *outFilename, file_dialog_desc *desc,
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
panel.title = [NSString stringWithUTF8String:desc->title];
|
panel.title = [NSString stringWithUTF8String:desc->title];
|
||||||
panel.allowedFileTypes = extensions;
|
panel.allowedFileTypes = extensions;
|
||||||
panel.directoryURL = [NSURL fileURLWithPath:directory];
|
panel.directoryURL = [NSURL fileURLWithPath:directory];
|
||||||
|
@ -196,17 +196,17 @@ bool platform_has_matching_language(NSString *preferredLocale, uint16* languageI
|
||||||
*languageIdentifier = LANGUAGE_ENGLISH_US;
|
*languageIdentifier = LANGUAGE_ENGLISH_US;
|
||||||
return YES;
|
return YES;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ([preferredLocale isEqualToString:@"zh-CN"]) {
|
if ([preferredLocale isEqualToString:@"zh-CN"]) {
|
||||||
*languageIdentifier = LANGUAGE_CHINESE_SIMPLIFIED;
|
*languageIdentifier = LANGUAGE_CHINESE_SIMPLIFIED;
|
||||||
return YES;
|
return YES;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ([preferredLocale isEqualToString:@"zh-TW"]) {
|
if ([preferredLocale isEqualToString:@"zh-TW"]) {
|
||||||
*languageIdentifier = LANGUAGE_CHINESE_TRADITIONAL;
|
*languageIdentifier = LANGUAGE_CHINESE_TRADITIONAL;
|
||||||
return YES;
|
return YES;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Find an exact match (language and region)
|
// Find an exact match (language and region)
|
||||||
for (int i = 1; i < LANGUAGE_COUNT; i++) {
|
for (int i = 1; i < LANGUAGE_COUNT; i++) {
|
||||||
if([preferredLocale isEqualToString:[NSString stringWithUTF8String:LanguagesDescriptors[i].locale]]) {
|
if([preferredLocale isEqualToString:[NSString stringWithUTF8String:LanguagesDescriptors[i].locale]]) {
|
||||||
|
@ -214,8 +214,8 @@ bool platform_has_matching_language(NSString *preferredLocale, uint16* languageI
|
||||||
return YES;
|
return YES;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Only check for a matching language
|
// Only check for a matching language
|
||||||
NSString *languageCode = [[preferredLocale componentsSeparatedByString:@"-"] firstObject];
|
NSString *languageCode = [[preferredLocale componentsSeparatedByString:@"-"] firstObject];
|
||||||
for (int i = 1; i < LANGUAGE_COUNT; i++) {
|
for (int i = 1; i < LANGUAGE_COUNT; i++) {
|
||||||
|
@ -225,7 +225,7 @@ bool platform_has_matching_language(NSString *preferredLocale, uint16* languageI
|
||||||
return YES;
|
return YES;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return NO;
|
return NO;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -241,7 +241,7 @@ uint16 platform_get_locale_language()
|
||||||
return languageIdentifier;
|
return languageIdentifier;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fallback
|
// Fallback
|
||||||
return LANGUAGE_ENGLISH_UK;
|
return LANGUAGE_ENGLISH_UK;
|
||||||
}
|
}
|
||||||
|
@ -265,7 +265,7 @@ uint8 platform_get_locale_measurement_format()
|
||||||
if (metricSystem.boolValue) {
|
if (metricSystem.boolValue) {
|
||||||
return MEASUREMENT_FORMAT_METRIC;
|
return MEASUREMENT_FORMAT_METRIC;
|
||||||
}
|
}
|
||||||
|
|
||||||
return MEASUREMENT_FORMAT_IMPERIAL;
|
return MEASUREMENT_FORMAT_IMPERIAL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,7 +52,7 @@ utf8 _openrctDataDirectoryPath[MAX_PATH] = { 0 };
|
||||||
int main(int argc, const char **argv)
|
int main(int argc, const char **argv)
|
||||||
{
|
{
|
||||||
core_init();
|
core_init();
|
||||||
|
|
||||||
int run_game = cmdline_run(argv, argc);
|
int run_game = cmdline_run(argv, argc);
|
||||||
if (run_game == 1)
|
if (run_game == 1)
|
||||||
{
|
{
|
||||||
|
|
|
@ -773,13 +773,13 @@ uint8 platform_get_currency_value(const char *currCode) {
|
||||||
if (currCode == NULL || strlen(currCode) < 3) {
|
if (currCode == NULL || strlen(currCode) < 3) {
|
||||||
return CURRENCY_POUNDS;
|
return CURRENCY_POUNDS;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int currency = 0; currency < CURRENCY_END; ++currency) {
|
for (int currency = 0; currency < CURRENCY_END; ++currency) {
|
||||||
if (strncmp(currCode, CurrencyDescriptors[currency].isoCode, 3) == 0) {
|
if (strncmp(currCode, CurrencyDescriptors[currency].isoCode, 3) == 0) {
|
||||||
return currency;
|
return currency;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return CURRENCY_POUNDS;
|
return CURRENCY_POUNDS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1098,7 +1098,7 @@ static bool windows_setup_file_association(
|
||||||
) {
|
) {
|
||||||
wchar_t exePathW[MAX_PATH];
|
wchar_t exePathW[MAX_PATH];
|
||||||
wchar_t dllPathW[MAX_PATH];
|
wchar_t dllPathW[MAX_PATH];
|
||||||
|
|
||||||
int printResult;
|
int printResult;
|
||||||
|
|
||||||
GetModuleFileNameW(NULL, exePathW, sizeof(exePathW));
|
GetModuleFileNameW(NULL, exePathW, sizeof(exePathW));
|
||||||
|
|
|
@ -297,7 +297,7 @@ private:
|
||||||
size_t maxTiles = 128 * 128;
|
size_t maxTiles = 128 * 128;
|
||||||
size_t tileIndex = 0;
|
size_t tileIndex = 0;
|
||||||
rct_map_element * mapElement = _s4.map_elements;
|
rct_map_element * mapElement = _s4.map_elements;
|
||||||
|
|
||||||
while (tileIndex < maxTiles)
|
while (tileIndex < maxTiles)
|
||||||
{
|
{
|
||||||
switch (map_element_get_type(mapElement)) {
|
switch (map_element_get_type(mapElement)) {
|
||||||
|
@ -607,7 +607,7 @@ private:
|
||||||
dst->operation_option = src->operation_option;
|
dst->operation_option = src->operation_option;
|
||||||
dst->num_circuits = 1;
|
dst->num_circuits = 1;
|
||||||
dst->min_max_cars_per_train = (rideEntry->min_cars_in_train << 4) | rideEntry->max_cars_in_train;
|
dst->min_max_cars_per_train = (rideEntry->min_cars_in_train << 4) | rideEntry->max_cars_in_train;
|
||||||
|
|
||||||
// RCT1 used 5mph / 8 km/h for every lift hill
|
// RCT1 used 5mph / 8 km/h for every lift hill
|
||||||
dst->lift_hill_speed = 5;
|
dst->lift_hill_speed = 5;
|
||||||
|
|
||||||
|
@ -1072,7 +1072,7 @@ private:
|
||||||
{
|
{
|
||||||
gCheatsUnlockAllPrices = true;
|
gCheatsUnlockAllPrices = true;
|
||||||
}
|
}
|
||||||
// RCT2 uses two flags for no money (for cheat detection). RCT1 used only one.
|
// RCT2 uses two flags for no money (for cheat detection). RCT1 used only one.
|
||||||
// Copy its value to make no money scenarios such as Arid Heights work properly.
|
// Copy its value to make no money scenarios such as Arid Heights work properly.
|
||||||
if (_s4.park_flags & RCT1_PARK_FLAGS_NO_MONEY)
|
if (_s4.park_flags & RCT1_PARK_FLAGS_NO_MONEY)
|
||||||
{
|
{
|
||||||
|
|
|
@ -341,7 +341,7 @@ static void rct2_draw_fps(rct_drawpixelinfo *dpi)
|
||||||
ch = utf8_write_codepoint(ch, FORMAT_MEDIUMFONT);
|
ch = utf8_write_codepoint(ch, FORMAT_MEDIUMFONT);
|
||||||
ch = utf8_write_codepoint(ch, FORMAT_OUTLINE);
|
ch = utf8_write_codepoint(ch, FORMAT_OUTLINE);
|
||||||
ch = utf8_write_codepoint(ch, FORMAT_WHITE);
|
ch = utf8_write_codepoint(ch, FORMAT_WHITE);
|
||||||
|
|
||||||
snprintf(ch, 64 - (ch - buffer), "%d", _currentFPS);
|
snprintf(ch, 64 - (ch - buffer), "%d", _currentFPS);
|
||||||
|
|
||||||
// Draw Text
|
// Draw Text
|
||||||
|
|
|
@ -103,7 +103,7 @@ void S6Exporter::Save(SDL_RWops * rw, bool isScenario)
|
||||||
log_error("Unable to allocate enough space for a write buffer.");
|
log_error("Unable to allocate enough space for a write buffer.");
|
||||||
throw Exception("Unable to allocate memory.");
|
throw Exception("Unable to allocate memory.");
|
||||||
}
|
}
|
||||||
|
|
||||||
sawyercoding_chunk_header chunkHeader;
|
sawyercoding_chunk_header chunkHeader;
|
||||||
size_t encodedLength;
|
size_t encodedLength;
|
||||||
|
|
||||||
|
@ -211,7 +211,7 @@ void S6Exporter::Save(SDL_RWops * rw, bool isScenario)
|
||||||
}
|
}
|
||||||
|
|
||||||
free(buffer);
|
free(buffer);
|
||||||
|
|
||||||
// Determine number of bytes written
|
// Determine number of bytes written
|
||||||
size_t fileSize = (size_t)SDL_RWtell(rw);
|
size_t fileSize = (size_t)SDL_RWtell(rw);
|
||||||
SDL_RWseek(rw, 0, RW_SEEK_SET);
|
SDL_RWseek(rw, 0, RW_SEEK_SET);
|
||||||
|
|
|
@ -36,7 +36,7 @@ interface ITrackDesignRepository
|
||||||
uint8 rideType,
|
uint8 rideType,
|
||||||
const utf8 * entry) const abstract;
|
const utf8 * entry) const abstract;
|
||||||
|
|
||||||
virtual void Scan() abstract;
|
virtual void Scan() abstract;
|
||||||
virtual bool Delete(const utf8 * path) abstract;
|
virtual bool Delete(const utf8 * path) abstract;
|
||||||
virtual const utf8 * Rename(const utf8 * path, const utf8 * newName) abstract;
|
virtual const utf8 * Rename(const utf8 * path, const utf8 * newName) abstract;
|
||||||
virtual const utf8 * Install(const utf8 * path) abstract;
|
virtual const utf8 * Install(const utf8 * path) abstract;
|
||||||
|
|
|
@ -1119,7 +1119,7 @@ static const uint32 junior_rc_track_pieces_right_quarter_turn_3_tiles_25_deg_up
|
||||||
};
|
};
|
||||||
|
|
||||||
static const uint32 junior_rc_track_pieces_right_quarter_turn_3_tiles_25_deg_down[2][4][2] = {
|
static const uint32 junior_rc_track_pieces_right_quarter_turn_3_tiles_25_deg_down[2][4][2] = {
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_3_TILES_25_DEG_DOWN_SW_SE_PART_0,
|
SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_3_TILES_25_DEG_DOWN_SW_SE_PART_0,
|
||||||
SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_3_TILES_25_DEG_DOWN_SW_SE_PART_1
|
SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_3_TILES_25_DEG_DOWN_SW_SE_PART_1
|
||||||
|
@ -1997,7 +1997,7 @@ static void junior_rc_flat_to_left_bank_paint_setup(uint8 rideIndex, uint8 track
|
||||||
|
|
||||||
paint_util_push_tunnel_left(height, 0);
|
paint_util_push_tunnel_left(height, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (junior_rc_track_pieces_flat_to_left_bank[direction][1] != 0) {
|
if (junior_rc_track_pieces_flat_to_left_bank[direction][1] != 0) {
|
||||||
image_id = junior_rc_track_pieces_flat_to_left_bank[direction][1] | gTrackColours[SCHEME_TRACK];
|
image_id = junior_rc_track_pieces_flat_to_left_bank[direction][1] | gTrackColours[SCHEME_TRACK];
|
||||||
|
|
||||||
|
@ -2037,7 +2037,7 @@ static void junior_rc_flat_to_right_bank_paint_setup(uint8 rideIndex, uint8 trac
|
||||||
|
|
||||||
paint_util_push_tunnel_left(height, 0);
|
paint_util_push_tunnel_left(height, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (junior_rc_track_pieces_flat_to_right_bank[direction][1] != 0) {
|
if (junior_rc_track_pieces_flat_to_right_bank[direction][1] != 0) {
|
||||||
image_id = junior_rc_track_pieces_flat_to_right_bank[direction][1] | gTrackColours[SCHEME_TRACK];
|
image_id = junior_rc_track_pieces_flat_to_right_bank[direction][1] | gTrackColours[SCHEME_TRACK];
|
||||||
|
|
||||||
|
@ -2205,7 +2205,7 @@ static void junior_rc_left_bank_to_25_deg_up_paint_setup(uint8 rideIndex, uint8
|
||||||
else {
|
else {
|
||||||
sub_98197C(image_id, 0, 0, 32, 20, 1, height, 0, 6, height, get_current_rotation());
|
sub_98197C(image_id, 0, 0, 32, 20, 1, height, 0, 6, height, get_current_rotation());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (junior_rc_track_pieces_left_banked_to_25_deg_up[direction][1] != 0) {
|
if (junior_rc_track_pieces_left_banked_to_25_deg_up[direction][1] != 0) {
|
||||||
image_id = junior_rc_track_pieces_left_banked_to_25_deg_up[direction][1] | gTrackColours[SCHEME_TRACK];
|
image_id = junior_rc_track_pieces_left_banked_to_25_deg_up[direction][1] | gTrackColours[SCHEME_TRACK];
|
||||||
|
|
||||||
|
@ -2248,7 +2248,7 @@ static void junior_rc_right_bank_to_25_deg_up_paint_setup(uint8 rideIndex, uint8
|
||||||
else {
|
else {
|
||||||
sub_98197C(image_id, 0, 0, 32, 20, 1, height, 0, 6, height, get_current_rotation());
|
sub_98197C(image_id, 0, 0, 32, 20, 1, height, 0, 6, height, get_current_rotation());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (junior_rc_track_pieces_right_banked_to_25_deg_up[direction][1] != 0) {
|
if (junior_rc_track_pieces_right_banked_to_25_deg_up[direction][1] != 0) {
|
||||||
image_id = junior_rc_track_pieces_right_banked_to_25_deg_up[direction][1] | gTrackColours[SCHEME_TRACK];
|
image_id = junior_rc_track_pieces_right_banked_to_25_deg_up[direction][1] | gTrackColours[SCHEME_TRACK];
|
||||||
|
|
||||||
|
@ -2283,7 +2283,7 @@ static void junior_rc_right_bank_to_25_deg_up_paint_setup(uint8 rideIndex, uint8
|
||||||
static void junior_rc_25_deg_up_to_left_bank_paint_setup(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement)
|
static void junior_rc_25_deg_up_to_left_bank_paint_setup(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement)
|
||||||
{
|
{
|
||||||
uint32 image_id;
|
uint32 image_id;
|
||||||
|
|
||||||
uint8 tunnelType;
|
uint8 tunnelType;
|
||||||
sint16 tunnelHeight;
|
sint16 tunnelHeight;
|
||||||
if (direction == 1 || direction == 2) {
|
if (direction == 1 || direction == 2) {
|
||||||
|
@ -2306,7 +2306,7 @@ static void junior_rc_25_deg_up_to_left_bank_paint_setup(uint8 rideIndex, uint8
|
||||||
|
|
||||||
paint_util_push_tunnel_left(tunnelHeight, tunnelType);
|
paint_util_push_tunnel_left(tunnelHeight, tunnelType);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (junior_rc_track_pieces_25_deg_up_to_left_bank[direction][1] != 0) {
|
if (junior_rc_track_pieces_25_deg_up_to_left_bank[direction][1] != 0) {
|
||||||
image_id = junior_rc_track_pieces_25_deg_up_to_left_bank[direction][1] | gTrackColours[SCHEME_TRACK];
|
image_id = junior_rc_track_pieces_25_deg_up_to_left_bank[direction][1] | gTrackColours[SCHEME_TRACK];
|
||||||
|
|
||||||
|
@ -2357,7 +2357,7 @@ static void junior_rc_25_deg_up_to_right_bank_paint_setup(uint8 rideIndex, uint8
|
||||||
|
|
||||||
paint_util_push_tunnel_left(tunnelHeight, tunnelType);
|
paint_util_push_tunnel_left(tunnelHeight, tunnelType);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (junior_rc_track_pieces_25_deg_up_to_right_bank[direction][1] != 0) {
|
if (junior_rc_track_pieces_25_deg_up_to_right_bank[direction][1] != 0) {
|
||||||
image_id = junior_rc_track_pieces_25_deg_up_to_right_bank[direction][1] | gTrackColours[SCHEME_TRACK];
|
image_id = junior_rc_track_pieces_25_deg_up_to_right_bank[direction][1] | gTrackColours[SCHEME_TRACK];
|
||||||
|
|
||||||
|
@ -2433,13 +2433,13 @@ static void junior_rc_left_bank_paint_setup(uint8 rideIndex, uint8 trackSequence
|
||||||
uint32 image_id;
|
uint32 image_id;
|
||||||
|
|
||||||
image_id = junior_rc_track_pieces_left_bank[direction] | gTrackColours[SCHEME_TRACK];
|
image_id = junior_rc_track_pieces_left_bank[direction] | gTrackColours[SCHEME_TRACK];
|
||||||
sub_98197C(image_id, 0, 0,
|
sub_98197C(image_id, 0, 0,
|
||||||
junior_rc_left_bank_bound_lengths[direction].x,
|
junior_rc_left_bank_bound_lengths[direction].x,
|
||||||
junior_rc_left_bank_bound_lengths[direction].y,
|
junior_rc_left_bank_bound_lengths[direction].y,
|
||||||
(sint8)junior_rc_left_bank_bound_lengths[direction].z,
|
(sint8)junior_rc_left_bank_bound_lengths[direction].z,
|
||||||
height,
|
height,
|
||||||
junior_rc_left_bank_bound_offsets[direction].x,
|
junior_rc_left_bank_bound_offsets[direction].x,
|
||||||
junior_rc_left_bank_bound_offsets[direction].y,
|
junior_rc_left_bank_bound_offsets[direction].y,
|
||||||
height, get_current_rotation());
|
height, get_current_rotation());
|
||||||
|
|
||||||
if (direction & 1) {
|
if (direction & 1) {
|
||||||
|
@ -2785,7 +2785,7 @@ const rct_xyz16 junior_rc_right_quarter_turn_3_tiles_bank_offsets[4][3] = {
|
||||||
/** rct2: 0x008AA0D0, 0x00523EA0, 0x005240CC, 0x0052430F, 0x00524500*/
|
/** rct2: 0x008AA0D0, 0x00523EA0, 0x005240CC, 0x0052430F, 0x00524500*/
|
||||||
static void junior_rc_right_quarter_turn_3_tiles_bank_paint_setup(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement)
|
static void junior_rc_right_quarter_turn_3_tiles_bank_paint_setup(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement)
|
||||||
{
|
{
|
||||||
uint8 thickness[4][4] = {
|
uint8 thickness[4][4] = {
|
||||||
{
|
{
|
||||||
1,
|
1,
|
||||||
1,
|
1,
|
||||||
|
@ -2811,7 +2811,7 @@ static void junior_rc_right_quarter_turn_3_tiles_bank_paint_setup(uint8 rideInde
|
||||||
1
|
1
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
track_paint_util_right_quarter_turn_3_tiles_paint(thickness[direction][trackSequence], height, direction, trackSequence, gTrackColours[SCHEME_TRACK], junior_rc_track_pieces_banked_quarter_turn_3_tiles, NULL, junior_rc_right_quarter_turn_3_tiles_bank_bound_lengths, junior_rc_right_quarter_turn_3_tiles_bank_offsets, get_current_rotation());
|
track_paint_util_right_quarter_turn_3_tiles_paint(thickness[direction][trackSequence], height, direction, trackSequence, gTrackColours[SCHEME_TRACK], junior_rc_track_pieces_banked_quarter_turn_3_tiles, NULL, junior_rc_right_quarter_turn_3_tiles_bank_bound_lengths, junior_rc_right_quarter_turn_3_tiles_bank_offsets, get_current_rotation());
|
||||||
track_paint_util_right_quarter_turn_3_tiles_tunnel(height, direction, trackSequence, TUNNEL_0);
|
track_paint_util_right_quarter_turn_3_tiles_tunnel(height, direction, trackSequence, TUNNEL_0);
|
||||||
|
|
||||||
|
@ -3801,7 +3801,7 @@ static void junior_rc_diag_flat_to_left_bank_paint_setup(uint8 rideIndex, uint8
|
||||||
|
|
||||||
if (direction == 0 && trackSequence == 1) {
|
if (direction == 0 && trackSequence == 1) {
|
||||||
uint32 imageId = SPR_JUNIOR_RC_DIAG_FLAT_TO_LEFT_BANK_W_E_PART_0_2 | gTrackColours[SCHEME_TRACK];
|
uint32 imageId = SPR_JUNIOR_RC_DIAG_FLAT_TO_LEFT_BANK_W_E_PART_0_2 | gTrackColours[SCHEME_TRACK];
|
||||||
|
|
||||||
sub_98197C(imageId, -16, -16, 32, 32, 0, height, -16, -16, height + 27, get_current_rotation());
|
sub_98197C(imageId, -16, -16, 32, 32, 0, height, -16, -16, height + 27, get_current_rotation());
|
||||||
}
|
}
|
||||||
if (trackSequence == 3) {
|
if (trackSequence == 3) {
|
||||||
|
@ -3820,7 +3820,7 @@ static void junior_rc_diag_flat_to_right_bank_paint_setup(uint8 rideIndex, uint8
|
||||||
|
|
||||||
if (direction == 2 && trackSequence == 2) {
|
if (direction == 2 && trackSequence == 2) {
|
||||||
uint32 imageId = SPR_JUNIOR_RC_DIAG_FLAT_TO_RIGHT_BANK_E_W_PART_0_2 | gTrackColours[SCHEME_TRACK];
|
uint32 imageId = SPR_JUNIOR_RC_DIAG_FLAT_TO_RIGHT_BANK_E_W_PART_0_2 | gTrackColours[SCHEME_TRACK];
|
||||||
|
|
||||||
sub_98197C(imageId, -16, -16, 32, 32, 0, height, -16, -16, height + 27, get_current_rotation());
|
sub_98197C(imageId, -16, -16, 32, 32, 0, height, -16, -16, height + 27, get_current_rotation());
|
||||||
}
|
}
|
||||||
if (trackSequence == 3) {
|
if (trackSequence == 3) {
|
||||||
|
@ -3858,7 +3858,7 @@ static void junior_rc_diag_right_bank_to_flat_paint_setup(uint8 rideIndex, uint8
|
||||||
|
|
||||||
if (direction == 2 && trackSequence == 2) {
|
if (direction == 2 && trackSequence == 2) {
|
||||||
uint32 imageId = SPR_JUNIOR_RC_DIAG_FLAT_TO_LEFT_BANK_W_E_PART_0_2 | gTrackColours[SCHEME_TRACK];
|
uint32 imageId = SPR_JUNIOR_RC_DIAG_FLAT_TO_LEFT_BANK_W_E_PART_0_2 | gTrackColours[SCHEME_TRACK];
|
||||||
|
|
||||||
sub_98197C(imageId, -16, -16, 32, 32, 0, height, -16, -16, height + 27, get_current_rotation());
|
sub_98197C(imageId, -16, -16, 32, 32, 0, height, -16, -16, height + 27, get_current_rotation());
|
||||||
}
|
}
|
||||||
if (trackSequence == 3) {
|
if (trackSequence == 3) {
|
||||||
|
@ -3896,7 +3896,7 @@ static void junior_rc_diag_right_bank_to_25_deg_up_paint_setup(uint8 rideIndex,
|
||||||
|
|
||||||
if (direction == 2 && trackSequence == 2) {
|
if (direction == 2 && trackSequence == 2) {
|
||||||
uint32 imageId = SPR_JUNIOR_RC_DIAG_RIGHT_BANK_TO_25_DEG_UP_E_W_PART_0_2 | gTrackColours[SCHEME_TRACK];
|
uint32 imageId = SPR_JUNIOR_RC_DIAG_RIGHT_BANK_TO_25_DEG_UP_E_W_PART_0_2 | gTrackColours[SCHEME_TRACK];
|
||||||
|
|
||||||
sub_98197C(imageId, -16, -16, 32, 32, 0, height, -16, -16, height + 35, get_current_rotation());
|
sub_98197C(imageId, -16, -16, 32, 32, 0, height, -16, -16, height + 35, get_current_rotation());
|
||||||
}
|
}
|
||||||
if (trackSequence == 3) {
|
if (trackSequence == 3) {
|
||||||
|
@ -3934,7 +3934,7 @@ static void junior_rc_diag_25_deg_up_to_right_bank_paint_setup(uint8 rideIndex,
|
||||||
|
|
||||||
if (direction == 2 && trackSequence == 2) {
|
if (direction == 2 && trackSequence == 2) {
|
||||||
uint32 imageId = SPR_JUNIOR_RC_DIAG_25_DEG_UP_TO_RIGHT_BANK_E_W_PART_0_2 | gTrackColours[SCHEME_TRACK];
|
uint32 imageId = SPR_JUNIOR_RC_DIAG_25_DEG_UP_TO_RIGHT_BANK_E_W_PART_0_2 | gTrackColours[SCHEME_TRACK];
|
||||||
|
|
||||||
sub_98197C(imageId, -16, -16, 32, 32, 0, height, -16, -16, height + 35, get_current_rotation());
|
sub_98197C(imageId, -16, -16, 32, 32, 0, height, -16, -16, height + 35, get_current_rotation());
|
||||||
}
|
}
|
||||||
if (trackSequence == 3) {
|
if (trackSequence == 3) {
|
||||||
|
@ -3972,7 +3972,7 @@ static void junior_rc_diag_right_bank_to_25_deg_down_paint_setup(uint8 rideIndex
|
||||||
|
|
||||||
if (direction == 2 && trackSequence == 2) {
|
if (direction == 2 && trackSequence == 2) {
|
||||||
uint32 imageId = SPR_JUNIOR_RC_DIAG_25_DEG_UP_TO_LEFT_BANK_W_E_PART_0_2 | gTrackColours[SCHEME_TRACK];
|
uint32 imageId = SPR_JUNIOR_RC_DIAG_25_DEG_UP_TO_LEFT_BANK_W_E_PART_0_2 | gTrackColours[SCHEME_TRACK];
|
||||||
|
|
||||||
sub_98197C(imageId, -16, -16, 32, 32, 0, height, -16, -16, height + 35, get_current_rotation());
|
sub_98197C(imageId, -16, -16, 32, 32, 0, height, -16, -16, height + 35, get_current_rotation());
|
||||||
}
|
}
|
||||||
if (trackSequence == 3) {
|
if (trackSequence == 3) {
|
||||||
|
@ -4010,7 +4010,7 @@ static void junior_rc_diag_25_deg_down_to_right_bank_paint_setup(uint8 rideIndex
|
||||||
|
|
||||||
if (direction == 2 && trackSequence == 2) {
|
if (direction == 2 && trackSequence == 2) {
|
||||||
uint32 imageId = SPR_JUNIOR_RC_DIAG_LEFT_BANK_TO_25_DEG_UP_W_E_PART_0_2 | gTrackColours[SCHEME_TRACK];
|
uint32 imageId = SPR_JUNIOR_RC_DIAG_LEFT_BANK_TO_25_DEG_UP_W_E_PART_0_2 | gTrackColours[SCHEME_TRACK];
|
||||||
|
|
||||||
sub_98197C(imageId, -16, -16, 32, 32, 0, height, -16, -16, height + 35, get_current_rotation());
|
sub_98197C(imageId, -16, -16, 32, 32, 0, height, -16, -16, height + 35, get_current_rotation());
|
||||||
}
|
}
|
||||||
if (trackSequence == 3) {
|
if (trackSequence == 3) {
|
||||||
|
@ -4456,10 +4456,10 @@ static const rct_xy16 junior_rc_flat_to_60_deg_up_bound_lengths[4][2] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
static const sint8 junior_rc_flat_to_60_deg_up_bound_thickness[4] = {
|
static const sint8 junior_rc_flat_to_60_deg_up_bound_thickness[4] = {
|
||||||
1,
|
1,
|
||||||
43,
|
43,
|
||||||
43,
|
43,
|
||||||
1
|
1
|
||||||
};
|
};
|
||||||
|
|
||||||
static const rct_xy16 junior_rc_flat_to_60_deg_up_bound_offsets[4][2] = {
|
static const rct_xy16 junior_rc_flat_to_60_deg_up_bound_offsets[4][2] = {
|
||||||
|
@ -4486,11 +4486,11 @@ static const rct_xy16 junior_rc_60_deg_up_to_flat_tile_offsets[4][2] = {
|
||||||
static void junior_rc_flat_to_60_deg_up_paint_setup(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element* mapElement)
|
static void junior_rc_flat_to_60_deg_up_paint_setup(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element* mapElement)
|
||||||
{
|
{
|
||||||
uint32 image_id = gTrackColours[SCHEME_TRACK];
|
uint32 image_id = gTrackColours[SCHEME_TRACK];
|
||||||
|
|
||||||
bool isChained = mapElement->type & (1 << 7);
|
bool isChained = mapElement->type & (1 << 7);
|
||||||
|
|
||||||
image_id |= junior_rc_track_pieces_flat_to_60_deg_up[isChained][direction][0];
|
image_id |= junior_rc_track_pieces_flat_to_60_deg_up[isChained][direction][0];
|
||||||
|
|
||||||
sub_98197C(image_id,
|
sub_98197C(image_id,
|
||||||
(sint8)junior_rc_flat_to_60_deg_up_tile_offsets[direction][0].x,
|
(sint8)junior_rc_flat_to_60_deg_up_tile_offsets[direction][0].x,
|
||||||
(sint8)junior_rc_flat_to_60_deg_up_tile_offsets[direction][0].y,
|
(sint8)junior_rc_flat_to_60_deg_up_tile_offsets[direction][0].y,
|
||||||
|
@ -4505,9 +4505,9 @@ static void junior_rc_flat_to_60_deg_up_paint_setup(uint8 rideIndex, uint8 track
|
||||||
|
|
||||||
if (junior_rc_track_pieces_flat_to_60_deg_up[isChained][direction][1] != 0) {
|
if (junior_rc_track_pieces_flat_to_60_deg_up[isChained][direction][1] != 0) {
|
||||||
image_id = gTrackColours[SCHEME_TRACK];
|
image_id = gTrackColours[SCHEME_TRACK];
|
||||||
|
|
||||||
image_id |= junior_rc_track_pieces_flat_to_60_deg_up[isChained][direction][1];
|
image_id |= junior_rc_track_pieces_flat_to_60_deg_up[isChained][direction][1];
|
||||||
|
|
||||||
sub_98197C(image_id,
|
sub_98197C(image_id,
|
||||||
(sint8)junior_rc_flat_to_60_deg_up_tile_offsets[direction][1].x,
|
(sint8)junior_rc_flat_to_60_deg_up_tile_offsets[direction][1].x,
|
||||||
(sint8)junior_rc_flat_to_60_deg_up_tile_offsets[direction][1].y,
|
(sint8)junior_rc_flat_to_60_deg_up_tile_offsets[direction][1].y,
|
||||||
|
@ -4574,9 +4574,9 @@ static void junior_rc_60_deg_up_to_flat_paint_setup(uint8 rideIndex, uint8 track
|
||||||
|
|
||||||
if (junior_rc_track_pieces_60_deg_up_to_flat[isChained][direction][1] != 0) {
|
if (junior_rc_track_pieces_60_deg_up_to_flat[isChained][direction][1] != 0) {
|
||||||
image_id = gTrackColours[SCHEME_TRACK];
|
image_id = gTrackColours[SCHEME_TRACK];
|
||||||
|
|
||||||
image_id |= junior_rc_track_pieces_60_deg_up_to_flat[isChained][direction][1];
|
image_id |= junior_rc_track_pieces_60_deg_up_to_flat[isChained][direction][1];
|
||||||
|
|
||||||
sub_98197C(image_id,
|
sub_98197C(image_id,
|
||||||
(sint8)junior_rc_60_deg_up_to_flat_tile_offsets[direction][1].x,
|
(sint8)junior_rc_60_deg_up_to_flat_tile_offsets[direction][1].x,
|
||||||
(sint8)junior_rc_60_deg_up_to_flat_tile_offsets[direction][1].y,
|
(sint8)junior_rc_60_deg_up_to_flat_tile_offsets[direction][1].y,
|
||||||
|
|
|
@ -102,7 +102,7 @@ static void multi_dimension_rc_track_station(uint8 rideIndex, uint8 trackSequenc
|
||||||
sub_98197C_rotated(direction, imageIds[direction][0] | gTrackColours[SCHEME_TRACK], 0, 0, 32, 26, 1, height, 0, 3, height + 3);
|
sub_98197C_rotated(direction, imageIds[direction][0] | gTrackColours[SCHEME_TRACK], 0, 0, 32, 26, 1, height, 0, 3, height + 3);
|
||||||
}
|
}
|
||||||
track_paint_util_draw_station_metal_supports_2(direction, height, gTrackColours[SCHEME_SUPPORTS], 11);
|
track_paint_util_draw_station_metal_supports_2(direction, height, gTrackColours[SCHEME_SUPPORTS], 11);
|
||||||
|
|
||||||
rct_ride * ride = get_ride(rideIndex);
|
rct_ride * ride = get_ride(rideIndex);
|
||||||
const rct_ride_entrance_definition * entranceStyle = &RideEntranceDefinitions[ride->entrance_style];
|
const rct_ride_entrance_definition * entranceStyle = &RideEntranceDefinitions[ride->entrance_style];
|
||||||
bool hasFence;
|
bool hasFence;
|
||||||
|
|
|
@ -84,7 +84,7 @@ static void twister_rc_track_station(uint8 rideIndex, uint8 trackSequence, uint8
|
||||||
}
|
}
|
||||||
sub_98196C_rotated(direction, imageIds[direction][2] | gTrackColours[SCHEME_MISC], 0, 0, 32, 32, 1, height);
|
sub_98196C_rotated(direction, imageIds[direction][2] | gTrackColours[SCHEME_MISC], 0, 0, 32, 32, 1, height);
|
||||||
track_paint_util_draw_station_metal_supports_2(direction, height, gTrackColours[SCHEME_SUPPORTS], 0);
|
track_paint_util_draw_station_metal_supports_2(direction, height, gTrackColours[SCHEME_SUPPORTS], 0);
|
||||||
|
|
||||||
rct_ride * ride = get_ride(rideIndex);
|
rct_ride * ride = get_ride(rideIndex);
|
||||||
track_paint_util_draw_station_platform(ride, direction, height, 9, mapElement);
|
track_paint_util_draw_station_platform(ride, direction, height, 9, mapElement);
|
||||||
|
|
||||||
|
|
|
@ -83,7 +83,7 @@ static void vertical_drop_rc_track_station(uint8 rideIndex, uint8 trackSequence,
|
||||||
}
|
}
|
||||||
sub_98196C_rotated(direction, imageIds[direction][2] | gTrackColours[SCHEME_MISC], 0, 0, 32, 32, 1, height);
|
sub_98196C_rotated(direction, imageIds[direction][2] | gTrackColours[SCHEME_MISC], 0, 0, 32, 32, 1, height);
|
||||||
track_paint_util_draw_station_metal_supports_2(direction, height, gTrackColours[SCHEME_SUPPORTS], 3);
|
track_paint_util_draw_station_metal_supports_2(direction, height, gTrackColours[SCHEME_SUPPORTS], 3);
|
||||||
|
|
||||||
rct_ride * ride = get_ride(rideIndex);
|
rct_ride * ride = get_ride(rideIndex);
|
||||||
track_paint_util_draw_station_platform(ride, direction, height, 9, mapElement);
|
track_paint_util_draw_station_platform(ride, direction, height, 9, mapElement);
|
||||||
|
|
||||||
|
|
|
@ -163,7 +163,7 @@ static void maze_paint_setup(uint8 rideIndex, uint8 trackSequence, uint8 directi
|
||||||
|
|
||||||
if (maze_entry & (1 << 9 | 1 << 10 | 1 << 12))
|
if (maze_entry & (1 << 9 | 1 << 10 | 1 << 12))
|
||||||
sub_98197C(base_image_id + SPR_MAZE_OFFSET_COLUMN_BOTTOM_LEFT, 30, 14, 1, 2, 9, height, 30, 15, height + 2, rotation);
|
sub_98197C(base_image_id + SPR_MAZE_OFFSET_COLUMN_BOTTOM_LEFT, 30, 14, 1, 2, 9, height, 30, 15, height + 2, rotation);
|
||||||
|
|
||||||
|
|
||||||
if (maze_entry & (1 << 2 | 1 << 6 | 1 << 10 | 1 << 14)) {
|
if (maze_entry & (1 << 2 | 1 << 6 | 1 << 10 | 1 << 14)) {
|
||||||
sub_98197C(base_image_id + SPR_MAZE_OFFSET_COLUMN_CENTER, 14, 14, 2, 2, 8, height, 15, 15, height + 2, rotation);
|
sub_98197C(base_image_id + SPR_MAZE_OFFSET_COLUMN_CENTER, 14, 14, 2, 2, 8, height, 15, 15, height + 2, rotation);
|
||||||
|
|
|
@ -2082,7 +2082,7 @@ static void ride_chairlift_update(rct_ride *ride)
|
||||||
|
|
||||||
if (!(ride->lifecycle_flags & RIDE_LIFECYCLE_ON_TRACK))
|
if (!(ride->lifecycle_flags & RIDE_LIFECYCLE_ON_TRACK))
|
||||||
return;
|
return;
|
||||||
if ((ride->lifecycle_flags & (RIDE_LIFECYCLE_BREAKDOWN_PENDING | RIDE_LIFECYCLE_BROKEN_DOWN | RIDE_LIFECYCLE_CRASHED)) &&
|
if ((ride->lifecycle_flags & (RIDE_LIFECYCLE_BREAKDOWN_PENDING | RIDE_LIFECYCLE_BROKEN_DOWN | RIDE_LIFECYCLE_CRASHED)) &&
|
||||||
ride->breakdown_reason_pending == 0)
|
ride->breakdown_reason_pending == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -3835,7 +3835,7 @@ static bool ride_is_valid_operation_option(rct_ride *ride, uint8 value)
|
||||||
minValue = 0;
|
minValue = 0;
|
||||||
maxValue = 255;
|
maxValue = 255;
|
||||||
}
|
}
|
||||||
|
|
||||||
return value >= minValue && value <= maxValue;
|
return value >= minValue && value <= maxValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4520,7 +4520,7 @@ static rct_vehicle *vehicle_create_car(
|
||||||
int vehicleIndex,
|
int vehicleIndex,
|
||||||
int x,
|
int x,
|
||||||
int y,
|
int y,
|
||||||
int z,
|
int z,
|
||||||
int *remainingDistance,
|
int *remainingDistance,
|
||||||
rct_map_element *mapElement
|
rct_map_element *mapElement
|
||||||
) {
|
) {
|
||||||
|
@ -4588,7 +4588,7 @@ static rct_vehicle *vehicle_create_car(
|
||||||
vehicle->track_y = y;
|
vehicle->track_y = y;
|
||||||
vehicle->track_z = z;
|
vehicle->track_z = z;
|
||||||
vehicle->current_station = map_get_station(mapElement);
|
vehicle->current_station = map_get_station(mapElement);
|
||||||
|
|
||||||
z += RideData5[ride->type].z_offset;
|
z += RideData5[ride->type].z_offset;
|
||||||
|
|
||||||
vehicle->track_type = mapElement->properties.track.type << 2;
|
vehicle->track_type = mapElement->properties.track.type << 2;
|
||||||
|
@ -4860,7 +4860,7 @@ static bool ride_create_vehicles(rct_ride *ride, int rideIndex, rct_xy_element *
|
||||||
int z = element->element->base_height;
|
int z = element->element->base_height;
|
||||||
int direction = mapElement->type & MAP_ELEMENT_DIRECTION_MASK;
|
int direction = mapElement->type & MAP_ELEMENT_DIRECTION_MASK;
|
||||||
|
|
||||||
//
|
//
|
||||||
if (ride->mode == RIDE_MODE_STATION_TO_STATION) {
|
if (ride->mode == RIDE_MODE_STATION_TO_STATION) {
|
||||||
x = element->x - TileDirectionDelta[direction].x;
|
x = element->x - TileDirectionDelta[direction].x;
|
||||||
y = element->y - TileDirectionDelta[direction].y;
|
y = element->y - TileDirectionDelta[direction].y;
|
||||||
|
@ -4886,7 +4886,7 @@ static bool ride_create_vehicles(rct_ride *ride, int rideIndex, rct_xy_element *
|
||||||
ride->station_depart[i] = (ride->station_depart[i] & 0x80) | 1;
|
ride->station_depart[i] = (ride->station_depart[i] & 0x80) | 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
if (ride->type != RIDE_TYPE_SPACE_RINGS && !ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_16)) {
|
if (ride->type != RIDE_TYPE_SPACE_RINGS && !ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_16)) {
|
||||||
if (ride_is_block_sectioned(ride)) {
|
if (ride_is_block_sectioned(ride)) {
|
||||||
rct_xy_element firstBlock;
|
rct_xy_element firstBlock;
|
||||||
|
@ -6709,7 +6709,7 @@ void game_command_set_ride_price(int *eax, int *ebx, int *ecx, int *edx, int *es
|
||||||
for (uint8 rideId = 0; rideId < 0xFF; rideId++, ride++) {
|
for (uint8 rideId = 0; rideId < 0xFF; rideId++, ride++) {
|
||||||
// Unplaced rides have a type of NULL
|
// Unplaced rides have a type of NULL
|
||||||
if (ride->type == RIDE_TYPE_NULL)
|
if (ride->type == RIDE_TYPE_NULL)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
rideEntry = get_ride_entry(ride->subtype);
|
rideEntry = get_ride_entry(ride->subtype);
|
||||||
|
|
||||||
|
@ -7700,7 +7700,7 @@ void ride_update_max_vehicles(int rideIndex)
|
||||||
numCarsPerTrain = rideEntry->max_cars_in_train;
|
numCarsPerTrain = rideEntry->max_cars_in_train;
|
||||||
maxNumTrains = rideEntry->cars_per_flat_ride;
|
maxNumTrains = rideEntry->cars_per_flat_ride;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gCheatsDisableTrainLengthLimit) {
|
if (gCheatsDisableTrainLengthLimit) {
|
||||||
maxNumTrains = 31;
|
maxNumTrains = 31;
|
||||||
}
|
}
|
||||||
|
@ -8202,7 +8202,7 @@ static money32 place_ride_entrance_or_exit(sint16 x, sint16 y, sint16 z, uint8 d
|
||||||
}
|
}
|
||||||
|
|
||||||
sint16 clear_z = z / 8 + (is_exit ? 5 : 7);
|
sint16 clear_z = z / 8 + (is_exit ? 5 : 7);
|
||||||
|
|
||||||
if (!gCheatsDisableClearanceChecks && !map_can_construct_with_clear_at(x, y, z / 8, clear_z, &map_place_non_scenery_clear_func, 0xF, flags, &cost)) {
|
if (!gCheatsDisableClearanceChecks && !map_can_construct_with_clear_at(x, y, z / 8, clear_z, &map_place_non_scenery_clear_func, 0xF, flags, &cost)) {
|
||||||
return MONEY32_UNDEFINED;
|
return MONEY32_UNDEFINED;
|
||||||
}
|
}
|
||||||
|
|
|
@ -299,7 +299,7 @@ typedef struct rct_ride {
|
||||||
uint8 downtime_history[8]; // 0x19C
|
uint8 downtime_history[8]; // 0x19C
|
||||||
uint32 no_primary_items_sold; // 0x1A4
|
uint32 no_primary_items_sold; // 0x1A4
|
||||||
uint32 no_secondary_items_sold; // 0x1A8
|
uint32 no_secondary_items_sold; // 0x1A8
|
||||||
uint8 breakdown_sound_modifier; // 0x1AC
|
uint8 breakdown_sound_modifier; // 0x1AC
|
||||||
// Used to oscilate the sound when ride breaks down.
|
// Used to oscilate the sound when ride breaks down.
|
||||||
// 0 = no change, 255 = max change
|
// 0 = no change, 255 = max change
|
||||||
uint8 not_fixed_timeout; // 0x1AD
|
uint8 not_fixed_timeout; // 0x1AD
|
||||||
|
|
|
@ -554,7 +554,7 @@ static void ride_ratings_score_close_proximity(rct_map_element *inputMapElement)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (inputMapElement->clearance_height == mapElement->base_height) {
|
if (inputMapElement->clearance_height == mapElement->base_height) {
|
||||||
proximity_score_increment(PROXIMITY_OWN_TRACK_TOUCH_ABOVE);
|
proximity_score_increment(PROXIMITY_OWN_TRACK_TOUCH_ABOVE);
|
||||||
if (isStation) {
|
if (isStation) {
|
||||||
|
|
|
@ -162,7 +162,7 @@ static void paint_magic_carpet_structure(rct_ride *ride, uint8 direction, sint8
|
||||||
swingImageId = vehicle->vehicle_sprite_type;
|
swingImageId = vehicle->vehicle_sprite_type;
|
||||||
gPaintInteractionType = VIEWPORT_INTERACTION_ITEM_SPRITE;
|
gPaintInteractionType = VIEWPORT_INTERACTION_ITEM_SPRITE;
|
||||||
}
|
}
|
||||||
|
|
||||||
bound_box bb = MagicCarpetBounds[direction];
|
bound_box bb = MagicCarpetBounds[direction];
|
||||||
rct_xyz16 offset, bbOffset, bbSize;
|
rct_xyz16 offset, bbOffset, bbSize;
|
||||||
offset.x = (direction & 1) ? 0 : axisOffset;
|
offset.x = (direction & 1) ? 0 : axisOffset;
|
||||||
|
|
|
@ -908,7 +908,7 @@ static bool track_remove_station_element(int x, int y, int z, int direction, int
|
||||||
finaliseStationDone = false;
|
finaliseStationDone = false;
|
||||||
}
|
}
|
||||||
} while (!finaliseStationDone);
|
} while (!finaliseStationDone);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -158,7 +158,7 @@ static rct_track_td6 * track_design_open_from_td4(uint8 *src, size_t srcLength)
|
||||||
SafeFree(td4);
|
SafeFree(td4);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
td6->type = rct1_get_ride_type(td4->type);
|
td6->type = rct1_get_ride_type(td4->type);
|
||||||
|
|
||||||
// All TD4s that use powered launch use the type that doesn't pass the station.
|
// All TD4s that use powered launch use the type that doesn't pass the station.
|
||||||
|
@ -1408,7 +1408,7 @@ static bool sub_6D2189(rct_track_td6 *td6, money32 *cost, uint8 *rideId, uint8 *
|
||||||
if (byte_F4414E & 4) {
|
if (byte_F4414E & 4) {
|
||||||
*flags |= 2;
|
*flags |= 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
z += 16 - word_F44129;
|
z += 16 - word_F44129;
|
||||||
|
|
||||||
int operation = PTD_OPERATION_GET_COST;
|
int operation = PTD_OPERATION_GET_COST;
|
||||||
|
@ -1520,13 +1520,13 @@ static money32 place_track_design(sint16 x, sint16 y, sint16 z, uint8 flags, uin
|
||||||
game_do_command(0, GAME_COMMAND_FLAG_APPLY | (td6->max_waiting_time << 8), 0, rideIndex | (3 << 8), GAME_COMMAND_SET_RIDE_SETTING, 0, 0);
|
game_do_command(0, GAME_COMMAND_FLAG_APPLY | (td6->max_waiting_time << 8), 0, rideIndex | (3 << 8), GAME_COMMAND_SET_RIDE_SETTING, 0, 0);
|
||||||
game_do_command(0, GAME_COMMAND_FLAG_APPLY | (td6->operation_setting << 8), 0, rideIndex | (4 << 8), GAME_COMMAND_SET_RIDE_SETTING, 0, 0);
|
game_do_command(0, GAME_COMMAND_FLAG_APPLY | (td6->operation_setting << 8), 0, rideIndex | (4 << 8), GAME_COMMAND_SET_RIDE_SETTING, 0, 0);
|
||||||
game_do_command(0, GAME_COMMAND_FLAG_APPLY | ((td6->lift_hill_speed_num_circuits & 0x1F) << 8), 0, rideIndex | (8 << 8), GAME_COMMAND_SET_RIDE_SETTING, 0, 0);
|
game_do_command(0, GAME_COMMAND_FLAG_APPLY | ((td6->lift_hill_speed_num_circuits & 0x1F) << 8), 0, rideIndex | (8 << 8), GAME_COMMAND_SET_RIDE_SETTING, 0, 0);
|
||||||
|
|
||||||
uint8 num_circuits = td6->lift_hill_speed_num_circuits >> 5;
|
uint8 num_circuits = td6->lift_hill_speed_num_circuits >> 5;
|
||||||
if (num_circuits == 0) {
|
if (num_circuits == 0) {
|
||||||
num_circuits = 1;
|
num_circuits = 1;
|
||||||
}
|
}
|
||||||
game_do_command(0, GAME_COMMAND_FLAG_APPLY | (num_circuits << 8), 0, rideIndex | (9 << 8), GAME_COMMAND_SET_RIDE_SETTING, 0, 0);
|
game_do_command(0, GAME_COMMAND_FLAG_APPLY | (num_circuits << 8), 0, rideIndex | (9 << 8), GAME_COMMAND_SET_RIDE_SETTING, 0, 0);
|
||||||
|
|
||||||
ride_set_to_default_inspection_interval(rideIndex);
|
ride_set_to_default_inspection_interval(rideIndex);
|
||||||
ride->lifecycle_flags |= RIDE_LIFECYCLE_NOT_CUSTOM_DESIGN;
|
ride->lifecycle_flags |= RIDE_LIFECYCLE_NOT_CUSTOM_DESIGN;
|
||||||
ride->colour_scheme_type = td6->version_and_colour_scheme & 3;
|
ride->colour_scheme_type = td6->version_and_colour_scheme & 3;
|
||||||
|
@ -1624,7 +1624,7 @@ static money32 place_maze_design(uint8 flags, uint8 rideIndex, uint16 mazeEntry,
|
||||||
}
|
}
|
||||||
|
|
||||||
rct_ride *ride = get_ride(rideIndex);
|
rct_ride *ride = get_ride(rideIndex);
|
||||||
|
|
||||||
// Calculate price
|
// Calculate price
|
||||||
money32 price = 0;
|
money32 price = 0;
|
||||||
if (!(gParkFlags & PARK_FLAGS_NO_MONEY)) {
|
if (!(gParkFlags & PARK_FLAGS_NO_MONEY)) {
|
||||||
|
|
|
@ -127,7 +127,7 @@ static void track_design_save_callback(int result) {
|
||||||
free(_trackDesign->entrance_elements);
|
free(_trackDesign->entrance_elements);
|
||||||
free(_trackDesign->scenery_elements);
|
free(_trackDesign->scenery_elements);
|
||||||
free(_trackDesign);
|
free(_trackDesign);
|
||||||
|
|
||||||
if (result == MODAL_RESULT_OK) {
|
if (result == MODAL_RESULT_OK) {
|
||||||
track_repository_scan();
|
track_repository_scan();
|
||||||
}
|
}
|
||||||
|
@ -174,7 +174,7 @@ bool track_design_save(uint8 rideIndex)
|
||||||
|
|
||||||
utf8 track_name[MAX_PATH];
|
utf8 track_name[MAX_PATH];
|
||||||
format_string(track_name, MAX_PATH, ride->name, &ride->name_arguments);
|
format_string(track_name, MAX_PATH, ride->name, &ride->name_arguments);
|
||||||
|
|
||||||
window_loadsave_open(LOADSAVETYPE_TRACK | LOADSAVETYPE_SAVE, track_name);
|
window_loadsave_open(LOADSAVETYPE_TRACK | LOADSAVETYPE_SAVE, track_name);
|
||||||
gLoadSaveCallback = track_design_save_callback;
|
gLoadSaveCallback = track_design_save_callback;
|
||||||
|
|
||||||
|
@ -1231,7 +1231,7 @@ static void auto_buffer_write(auto_buffer *buffer, const void *src, size_t len)
|
||||||
buffer->capacity = max(8, buffer->capacity * 2);
|
buffer->capacity = max(8, buffer->capacity * 2);
|
||||||
remainingSpace = buffer->capacity - buffer->length;
|
remainingSpace = buffer->capacity - buffer->length;
|
||||||
} while (remainingSpace < len);
|
} while (remainingSpace < len);
|
||||||
|
|
||||||
buffer->ptr = realloc(buffer->ptr, buffer->capacity);
|
buffer->ptr = realloc(buffer->ptr, buffer->capacity);
|
||||||
}
|
}
|
||||||
memcpy((void*)((uintptr_t)buffer->ptr + buffer->length), src, len);
|
memcpy((void*)((uintptr_t)buffer->ptr + buffer->length), src, len);
|
||||||
|
|
|
@ -1531,7 +1531,7 @@ void track_paint_util_left_quarter_turn_3_tiles_paint_with_height_offset(sint8 t
|
||||||
// if (sprite < 0) {
|
// if (sprite < 0) {
|
||||||
// return;
|
// return;
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// const sprite_bb *spriteBB = &sprites[direction][sprite];
|
// const sprite_bb *spriteBB = &sprites[direction][sprite];
|
||||||
// uint32 imageId = spriteBB->sprite_id | colourFlags;
|
// uint32 imageId = spriteBB->sprite_id | colourFlags;
|
||||||
// sub_98197C(imageId,
|
// sub_98197C(imageId,
|
||||||
|
|
|
@ -117,7 +117,7 @@ static rct_map_element * chairlift_paint_util_map_get_track_element_at_from_ride
|
||||||
if (mapElement == NULL) {
|
if (mapElement == NULL) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
do {
|
do {
|
||||||
if (map_element_get_type(mapElement) != MAP_ELEMENT_TYPE_TRACK) continue;
|
if (map_element_get_type(mapElement) != MAP_ELEMENT_TYPE_TRACK) continue;
|
||||||
if (mapElement->properties.track.ride_index != rideIndex) continue;
|
if (mapElement->properties.track.ride_index != rideIndex) continue;
|
||||||
|
|
|
@ -582,7 +582,7 @@ static void paint_miniature_railway_track_flat(uint8 rideIndex, uint8 trackSeque
|
||||||
imageId = miniature_railway_track_floor[direction] | gTrackColours[SCHEME_SUPPORTS];
|
imageId = miniature_railway_track_floor[direction] | gTrackColours[SCHEME_SUPPORTS];
|
||||||
sub_98197C_rotated(direction, imageId, 0, 0, 32, 20, 2, height, 0, 6, height);
|
sub_98197C_rotated(direction, imageId, 0, 0, 32, 20, 2, height, 0, 6, height);
|
||||||
|
|
||||||
imageId = miniature_railway_track_pieces_flat[direction] | gTrackColours[SCHEME_TRACK];
|
imageId = miniature_railway_track_pieces_flat[direction] | gTrackColours[SCHEME_TRACK];
|
||||||
sub_98199C_rotated(direction, imageId, 0, 6, 32, 20, 2, height, 0, 6, height);
|
sub_98199C_rotated(direction, imageId, 0, 6, 32, 20, 2, height, 0, 6, height);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -634,7 +634,7 @@ static void paint_miniature_railway_track_25_deg_up(uint8 rideIndex, uint8 track
|
||||||
}
|
}
|
||||||
|
|
||||||
wooden_a_supports_paint_setup(direction & 1, 45 + direction, height, gTrackColours[SCHEME_SUPPORTS], NULL);
|
wooden_a_supports_paint_setup(direction & 1, 45 + direction, height, gTrackColours[SCHEME_SUPPORTS], NULL);
|
||||||
|
|
||||||
paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0);
|
paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0);
|
||||||
paint_util_set_general_support_height(height + 56, 0x20);
|
paint_util_set_general_support_height(height + 56, 0x20);
|
||||||
}
|
}
|
||||||
|
@ -667,7 +667,7 @@ static void paint_miniature_railway_track_25_deg_up_to_flat(uint8 rideIndex, uin
|
||||||
uint32 imageId = miniature_railway_track_pieces_25_deg_up_to_flat[direction] | gTrackColours[SCHEME_TRACK];
|
uint32 imageId = miniature_railway_track_pieces_25_deg_up_to_flat[direction] | gTrackColours[SCHEME_TRACK];
|
||||||
|
|
||||||
sub_98197C_rotated(direction, imageId, 0, 2, 32, 25, 2, height, 0, 3, height);
|
sub_98197C_rotated(direction, imageId, 0, 2, 32, 25, 2, height, 0, 3, height);
|
||||||
|
|
||||||
switch (direction) {
|
switch (direction) {
|
||||||
case 0: paint_util_push_tunnel_left(height - 8, TUNNEL_6); break;
|
case 0: paint_util_push_tunnel_left(height - 8, TUNNEL_6); break;
|
||||||
case 1: paint_util_push_tunnel_right(height + 8, TUNNEL_14); break;
|
case 1: paint_util_push_tunnel_right(height + 8, TUNNEL_14); break;
|
||||||
|
@ -844,7 +844,7 @@ static void paint_miniature_railway_track_right_quarter_turn_5_tiles(uint8 rideI
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
track_paint_util_right_quarter_turn_5_tiles_paint(2, height, direction, trackSequence, gTrackColours[SCHEME_SUPPORTS], miniature_railway_right_quarter_turn_5_tiles_track_floor, NULL, miniature_railway_right_quarter_turn_5_tiles_bound_lengths, miniature_railway_right_quarter_turn_5_tiles_bound_offsets, get_current_rotation());
|
track_paint_util_right_quarter_turn_5_tiles_paint(2, height, direction, trackSequence, gTrackColours[SCHEME_SUPPORTS], miniature_railway_right_quarter_turn_5_tiles_track_floor, NULL, miniature_railway_right_quarter_turn_5_tiles_bound_lengths, miniature_railway_right_quarter_turn_5_tiles_bound_offsets, get_current_rotation());
|
||||||
|
|
||||||
int index = miniature_railway_right_quarter_turn_5_tiles_sprite_map[trackSequence];
|
int index = miniature_railway_right_quarter_turn_5_tiles_sprite_map[trackSequence];
|
||||||
uint32 imageId = miniature_railway_track_pieces_flat_quarter_turn_5_tiles[direction][index] | gTrackColours[SCHEME_TRACK];
|
uint32 imageId = miniature_railway_track_pieces_flat_quarter_turn_5_tiles[direction][index] | gTrackColours[SCHEME_TRACK];
|
||||||
rct_xy16 offset = miniature_railway_right_quarter_turn_5_tiles_offsets[direction][index];
|
rct_xy16 offset = miniature_railway_right_quarter_turn_5_tiles_offsets[direction][index];
|
||||||
|
@ -941,7 +941,7 @@ static void paint_miniature_railway_track_s_bend_left(uint8 rideIndex, uint8 tra
|
||||||
uint32 imageId = miniature_railway_track_pieces_s_bend_left[direction & 1][trackSequence] | gTrackColours[SCHEME_TRACK];
|
uint32 imageId = miniature_railway_track_pieces_s_bend_left[direction & 1][trackSequence] | gTrackColours[SCHEME_TRACK];
|
||||||
rct_xy16 offset = offsetList[trackSequence];
|
rct_xy16 offset = offsetList[trackSequence];
|
||||||
rct_xy16 bounds = boundsList[trackSequence];
|
rct_xy16 bounds = boundsList[trackSequence];
|
||||||
|
|
||||||
if (isSupported == false) {
|
if (isSupported == false) {
|
||||||
sub_98197C_rotated(direction, imageId, (sint8)offset.x, (sint8)offset.y, bounds.x, bounds.y, 2, height, offset.x, offset.y, height);
|
sub_98197C_rotated(direction, imageId, (sint8)offset.x, (sint8)offset.y, bounds.x, bounds.y, 2, height, offset.x, offset.y, height);
|
||||||
}
|
}
|
||||||
|
@ -1115,7 +1115,7 @@ static void paint_miniature_railway_track_right_quarter_turn_3_tiles(uint8 rideI
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
track_paint_util_right_quarter_turn_3_tiles_paint(3, height, direction, trackSequence, gTrackColours[SCHEME_SUPPORTS], miniature_railway_right_quarter_turn_3_tile_track_floor, NULL, defaultRightQuarterTurn3TilesBoundLengths, miniature_railway_right_quarter_turn_3_tile_bound_offsets, get_current_rotation());
|
track_paint_util_right_quarter_turn_3_tiles_paint(3, height, direction, trackSequence, gTrackColours[SCHEME_SUPPORTS], miniature_railway_right_quarter_turn_3_tile_track_floor, NULL, defaultRightQuarterTurn3TilesBoundLengths, miniature_railway_right_quarter_turn_3_tile_bound_offsets, get_current_rotation());
|
||||||
|
|
||||||
static const sint8 right_quarter_turn_3_tiles_sprite_map[] = {0, -1, 1, 2};
|
static const sint8 right_quarter_turn_3_tiles_sprite_map[] = {0, -1, 1, 2};
|
||||||
|
|
||||||
int index = right_quarter_turn_3_tiles_sprite_map[trackSequence];
|
int index = right_quarter_turn_3_tiles_sprite_map[trackSequence];
|
||||||
|
|
|
@ -5973,8 +5973,8 @@ static void vehicle_update_block_breaks_open_previous_section(rct_vehicle *vehic
|
||||||
if (!track_block_get_previous(x, y, mapElement, &trackBeginEnd)) {
|
if (!track_block_get_previous(x, y, mapElement, &trackBeginEnd)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (trackBeginEnd.begin_x == vehicle->track_x &&
|
if (trackBeginEnd.begin_x == vehicle->track_x &&
|
||||||
trackBeginEnd.begin_y == vehicle->track_y &&
|
trackBeginEnd.begin_y == vehicle->track_y &&
|
||||||
mapElement == trackBeginEnd.begin_element) {
|
mapElement == trackBeginEnd.begin_element) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -6755,9 +6755,9 @@ static void sub_6D63D4(rct_vehicle *vehicle)
|
||||||
} else {
|
} else {
|
||||||
vehicle->var_C8 += 0x3333;
|
vehicle->var_C8 += 0x3333;
|
||||||
|
|
||||||
if (vehicle->seat_rotation >= vehicle->target_seat_rotation)
|
if (vehicle->seat_rotation >= vehicle->target_seat_rotation)
|
||||||
vehicle->seat_rotation--;
|
vehicle->seat_rotation--;
|
||||||
|
|
||||||
else
|
else
|
||||||
vehicle->seat_rotation++;
|
vehicle->seat_rotation++;
|
||||||
|
|
||||||
|
|
|
@ -67,17 +67,17 @@ utf8 *path_get_directory(const utf8 *path)
|
||||||
{
|
{
|
||||||
// Find the last slash or backslash in the path
|
// Find the last slash or backslash in the path
|
||||||
char *filename = strrchr(path, *PATH_SEPARATOR);
|
char *filename = strrchr(path, *PATH_SEPARATOR);
|
||||||
|
|
||||||
// If the path is invalid (e.g. just a file name), return NULL
|
// If the path is invalid (e.g. just a file name), return NULL
|
||||||
if (filename == NULL)
|
if (filename == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
char *directory = _strdup(path);
|
char *directory = _strdup(path);
|
||||||
safe_strtrunc(directory, strlen(path) - strlen(filename) + 2);
|
safe_strtrunc(directory, strlen(path) - strlen(filename) + 2);
|
||||||
|
|
||||||
return directory;
|
return directory;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *path_get_filename(const utf8 *path)
|
const char *path_get_filename(const utf8 *path)
|
||||||
{
|
{
|
||||||
// Find last slash or backslash in the path
|
// Find last slash or backslash in the path
|
||||||
|
@ -145,7 +145,7 @@ void path_remove_extension(utf8 *path)
|
||||||
void path_end_with_separator(utf8 *path, size_t size) {
|
void path_end_with_separator(utf8 *path, size_t size) {
|
||||||
size_t length = strnlen(path, size);
|
size_t length = strnlen(path, size);
|
||||||
if (length >= size - 1) return;
|
if (length >= size - 1) return;
|
||||||
|
|
||||||
if (path[length - 1] != *PATH_SEPARATOR)
|
if (path[length - 1] != *PATH_SEPARATOR)
|
||||||
safe_strcat(path, PATH_SEPARATOR, size);
|
safe_strcat(path, PATH_SEPARATOR, size);
|
||||||
}
|
}
|
||||||
|
@ -241,7 +241,7 @@ static int bitcount_popcnt(uint32 source)
|
||||||
static int bitcount_lut(uint32 source)
|
static int bitcount_lut(uint32 source)
|
||||||
{
|
{
|
||||||
// https://graphics.stanford.edu/~seander/bithacks.html
|
// https://graphics.stanford.edu/~seander/bithacks.html
|
||||||
static const unsigned char BitsSetTable256[256] =
|
static const unsigned char BitsSetTable256[256] =
|
||||||
{
|
{
|
||||||
#define B2(n) n, n+1, n+1, n+2
|
#define B2(n) n, n+1, n+1, n+2
|
||||||
#define B4(n) B2(n), B2(n+1), B2(n+1), B2(n+2)
|
#define B4(n) B2(n), B2(n+1), B2(n+1), B2(n+2)
|
||||||
|
@ -319,7 +319,7 @@ utf8 * safe_strtrunc(utf8 * text, size_t size)
|
||||||
assert(text != NULL);
|
assert(text != NULL);
|
||||||
|
|
||||||
if (size == 0) return text;
|
if (size == 0) return text;
|
||||||
|
|
||||||
const char *sourceLimit = text + size - 1;
|
const char *sourceLimit = text + size - 1;
|
||||||
char *ch = text;
|
char *ch = text;
|
||||||
char *last = text;
|
char *last = text;
|
||||||
|
|
|
@ -569,7 +569,7 @@ void window_editor_inventions_list_open()
|
||||||
* rct2: 0x006853D2
|
* rct2: 0x006853D2
|
||||||
*/
|
*/
|
||||||
static void window_editor_inventions_list_close(rct_window *w)
|
static void window_editor_inventions_list_close(rct_window *w)
|
||||||
{
|
{
|
||||||
research_remove_flags();
|
research_remove_flags();
|
||||||
|
|
||||||
// When used in-game (as a cheat)
|
// When used in-game (as a cheat)
|
||||||
|
|
|
@ -409,7 +409,7 @@ static void window_loadsave_textinput(rct_window *w, int widgetIndex, char *text
|
||||||
|
|
||||||
safe_strcpy(path, _directory, sizeof(path));
|
safe_strcpy(path, _directory, sizeof(path));
|
||||||
safe_strcat_path(path, text, sizeof(path));
|
safe_strcat_path(path, text, sizeof(path));
|
||||||
|
|
||||||
if (!platform_ensure_directory_exists(path)) {
|
if (!platform_ensure_directory_exists(path)) {
|
||||||
window_error_open(STR_UNABLE_TO_CREATE_FOLDER, STR_NONE);
|
window_error_open(STR_UNABLE_TO_CREATE_FOLDER, STR_NONE);
|
||||||
return;
|
return;
|
||||||
|
@ -457,8 +457,8 @@ static void window_loadsave_textinput(rct_window *w, int widgetIndex, char *text
|
||||||
window_loadsave_select(w, path);
|
window_loadsave_select(w, path);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void window_loadsave_tooltip(rct_window* w, int widgetIndex, rct_string_id *stringId)
|
static void window_loadsave_tooltip(rct_window* w, int widgetIndex, rct_string_id *stringId)
|
||||||
|
@ -965,7 +965,7 @@ static void window_overwrite_prompt_invalidate(rct_window *w)
|
||||||
static void window_overwrite_prompt_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
static void window_overwrite_prompt_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
||||||
{
|
{
|
||||||
window_draw_widgets(w, dpi);
|
window_draw_widgets(w, dpi);
|
||||||
|
|
||||||
set_format_arg(0, rct_string_id, STR_STRING);
|
set_format_arg(0, rct_string_id, STR_STRING);
|
||||||
set_format_arg(2, char *, _window_overwrite_prompt_name);
|
set_format_arg(2, char *, _window_overwrite_prompt_name);
|
||||||
|
|
||||||
|
|
|
@ -375,12 +375,12 @@ static void window_map_mouseup(rct_window *w, int widgetIndex)
|
||||||
w->selected_tab = widgetIndex;
|
w->selected_tab = widgetIndex;
|
||||||
w->list_information_type = 0;
|
w->list_information_type = 0;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WIDX_MAP_GENERATOR:
|
case WIDX_MAP_GENERATOR:
|
||||||
window_mapgen_open();
|
window_mapgen_open();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -95,7 +95,7 @@ static rct_widget window_mapgen_base_widgets[] = {
|
||||||
{ WWT_TAB, 1, 65, 95, 17, 43, 0x20000000 | SPR_TAB, STR_NONE },
|
{ WWT_TAB, 1, 65, 95, 17, 43, 0x20000000 | SPR_TAB, STR_NONE },
|
||||||
|
|
||||||
{ WWT_DROPDOWN_BUTTON, 1, 104, 198, 52, 63, STR_MAPGEN_ACTION_GENERATE, STR_NONE },
|
{ WWT_DROPDOWN_BUTTON, 1, 104, 198, 52, 63, STR_MAPGEN_ACTION_GENERATE, STR_NONE },
|
||||||
|
|
||||||
{ WWT_SPINNER, 1, 104, 198, 52, 63, STR_NONE, STR_NONE },
|
{ WWT_SPINNER, 1, 104, 198, 52, 63, STR_NONE, STR_NONE },
|
||||||
{ WWT_DROPDOWN_BUTTON, 1, 187, 197, 53, 57, STR_NUMERIC_UP, STR_NONE },
|
{ WWT_DROPDOWN_BUTTON, 1, 187, 197, 53, 57, STR_NUMERIC_UP, STR_NONE },
|
||||||
{ WWT_DROPDOWN_BUTTON, 1, 187, 197, 58, 62, STR_NUMERIC_DOWN, STR_NONE },
|
{ WWT_DROPDOWN_BUTTON, 1, 187, 197, 58, 62, STR_NUMERIC_DOWN, STR_NONE },
|
||||||
|
@ -120,7 +120,7 @@ static rct_widget window_mapgen_random_widgets[] = {
|
||||||
{ WWT_TAB, 1, 65, 95, 17, 43, 0x20000000 | SPR_TAB, STR_NONE },
|
{ WWT_TAB, 1, 65, 95, 17, 43, 0x20000000 | SPR_TAB, STR_NONE },
|
||||||
|
|
||||||
{ WWT_DROPDOWN_BUTTON, 1, 104, 198, 52, 63, STR_MAPGEN_ACTION_GENERATE, STR_NONE },
|
{ WWT_DROPDOWN_BUTTON, 1, 104, 198, 52, 63, STR_MAPGEN_ACTION_GENERATE, STR_NONE },
|
||||||
|
|
||||||
{ WWT_CHECKBOX, 1, 4, 198, 52, 63, STR_MAPGEN_OPTION_RANDOM_TERRAIN, STR_NONE },
|
{ WWT_CHECKBOX, 1, 4, 198, 52, 63, STR_MAPGEN_OPTION_RANDOM_TERRAIN, STR_NONE },
|
||||||
{ WWT_CHECKBOX, 1, 4, 198, 70, 81, STR_MAPGEN_OPTION_PLACE_TREES, STR_NONE },
|
{ WWT_CHECKBOX, 1, 4, 198, 70, 81, STR_MAPGEN_OPTION_PLACE_TREES, STR_NONE },
|
||||||
{ WIDGETS_END },
|
{ WIDGETS_END },
|
||||||
|
@ -136,33 +136,33 @@ static rct_widget window_mapgen_simplex_widgets[] = {
|
||||||
{ WWT_TAB, 1, 65, 95, 17, 43, 0x20000000 | SPR_TAB, STR_NONE },
|
{ WWT_TAB, 1, 65, 95, 17, 43, 0x20000000 | SPR_TAB, STR_NONE },
|
||||||
|
|
||||||
{ WWT_DROPDOWN_BUTTON, 1, 104, 198, 52, 63, STR_MAPGEN_ACTION_GENERATE, STR_NONE },
|
{ WWT_DROPDOWN_BUTTON, 1, 104, 198, 52, 63, STR_MAPGEN_ACTION_GENERATE, STR_NONE },
|
||||||
|
|
||||||
{ WWT_12, 1, 4, 198, 52, 63, STR_MAPGEN_SIMPLEX_NOISE, STR_NONE },
|
{ WWT_12, 1, 4, 198, 52, 63, STR_MAPGEN_SIMPLEX_NOISE, STR_NONE },
|
||||||
|
|
||||||
{ WWT_SPINNER, 1, 104, 198, 70, 81, STR_NONE, STR_NONE },
|
{ WWT_SPINNER, 1, 104, 198, 70, 81, STR_NONE, STR_NONE },
|
||||||
{ WWT_DROPDOWN_BUTTON, 1, 187, 197, 71, 75, STR_NUMERIC_UP, STR_NONE },
|
{ WWT_DROPDOWN_BUTTON, 1, 187, 197, 71, 75, STR_NUMERIC_UP, STR_NONE },
|
||||||
{ WWT_DROPDOWN_BUTTON, 1, 187, 197, 76, 80, STR_NUMERIC_DOWN, STR_NONE },
|
{ WWT_DROPDOWN_BUTTON, 1, 187, 197, 76, 80, STR_NUMERIC_DOWN, STR_NONE },
|
||||||
|
|
||||||
{ WWT_SPINNER, 1, 104, 198, 88, 99, STR_NONE, STR_NONE },
|
{ WWT_SPINNER, 1, 104, 198, 88, 99, STR_NONE, STR_NONE },
|
||||||
{ WWT_DROPDOWN_BUTTON, 1, 187, 197, 89, 93, STR_NUMERIC_UP, STR_NONE },
|
{ WWT_DROPDOWN_BUTTON, 1, 187, 197, 89, 93, STR_NUMERIC_UP, STR_NONE },
|
||||||
{ WWT_DROPDOWN_BUTTON, 1, 187, 197, 94, 98, STR_NUMERIC_DOWN, STR_NONE },
|
{ WWT_DROPDOWN_BUTTON, 1, 187, 197, 94, 98, STR_NUMERIC_DOWN, STR_NONE },
|
||||||
|
|
||||||
{ WWT_SPINNER, 1, 104, 198, 106, 117, STR_NONE, STR_NONE },
|
{ WWT_SPINNER, 1, 104, 198, 106, 117, STR_NONE, STR_NONE },
|
||||||
{ WWT_DROPDOWN_BUTTON, 1, 187, 197, 107, 111, STR_NUMERIC_UP, STR_NONE },
|
{ WWT_DROPDOWN_BUTTON, 1, 187, 197, 107, 111, STR_NUMERIC_UP, STR_NONE },
|
||||||
{ WWT_DROPDOWN_BUTTON, 1, 187, 197, 112, 116, STR_NUMERIC_DOWN, STR_NONE },
|
{ WWT_DROPDOWN_BUTTON, 1, 187, 197, 112, 116, STR_NUMERIC_DOWN, STR_NONE },
|
||||||
|
|
||||||
{ WWT_SPINNER, 1, 104, 198, 124, 135, STR_NONE, STR_NONE },
|
{ WWT_SPINNER, 1, 104, 198, 124, 135, STR_NONE, STR_NONE },
|
||||||
{ WWT_DROPDOWN_BUTTON, 1, 187, 197, 125, 129, STR_NUMERIC_UP, STR_NONE },
|
{ WWT_DROPDOWN_BUTTON, 1, 187, 197, 125, 129, STR_NUMERIC_UP, STR_NONE },
|
||||||
{ WWT_DROPDOWN_BUTTON, 1, 187, 197, 130, 134, STR_NUMERIC_DOWN, STR_NONE },
|
{ WWT_DROPDOWN_BUTTON, 1, 187, 197, 130, 134, STR_NUMERIC_DOWN, STR_NONE },
|
||||||
|
|
||||||
{ WWT_SPINNER, 1, 104, 198, 148, 159, STR_NONE, STR_NONE },
|
{ WWT_SPINNER, 1, 104, 198, 148, 159, STR_NONE, STR_NONE },
|
||||||
{ WWT_DROPDOWN_BUTTON, 1, 187, 197, 149, 153, STR_NUMERIC_UP, STR_NONE },
|
{ WWT_DROPDOWN_BUTTON, 1, 187, 197, 149, 153, STR_NUMERIC_UP, STR_NONE },
|
||||||
{ WWT_DROPDOWN_BUTTON, 1, 187, 197, 154, 158, STR_NUMERIC_DOWN, STR_NONE },
|
{ WWT_DROPDOWN_BUTTON, 1, 187, 197, 154, 158, STR_NUMERIC_DOWN, STR_NONE },
|
||||||
|
|
||||||
{ WWT_SPINNER, 1, 104, 198, 166, 177, STR_NONE, STR_NONE },
|
{ WWT_SPINNER, 1, 104, 198, 166, 177, STR_NONE, STR_NONE },
|
||||||
{ WWT_DROPDOWN_BUTTON, 1, 187, 197, 167, 171, STR_NUMERIC_UP, STR_NONE },
|
{ WWT_DROPDOWN_BUTTON, 1, 187, 197, 167, 171, STR_NUMERIC_UP, STR_NONE },
|
||||||
{ WWT_DROPDOWN_BUTTON, 1, 187, 197, 172, 176, STR_NUMERIC_DOWN, STR_NONE },
|
{ WWT_DROPDOWN_BUTTON, 1, 187, 197, 172, 176, STR_NUMERIC_DOWN, STR_NONE },
|
||||||
|
|
||||||
{ WWT_FLATBTN, 1, 225, 271, 68, 103, 0xFFFFFFFF, STR_CHANGE_BASE_LAND_TIP },
|
{ WWT_FLATBTN, 1, 225, 271, 68, 103, 0xFFFFFFFF, STR_CHANGE_BASE_LAND_TIP },
|
||||||
{ WWT_FLATBTN, 1, 225, 271, 104, 139, 0xFFFFFFFF, STR_CHANGE_VERTICAL_LAND_TIP },
|
{ WWT_FLATBTN, 1, 225, 271, 104, 139, 0xFFFFFFFF, STR_CHANGE_VERTICAL_LAND_TIP },
|
||||||
|
|
||||||
|
|
|
@ -103,7 +103,7 @@ static rct_widget *window_multiplayer_page_widgets[] = {
|
||||||
window_multiplayer_groups_widgets,
|
window_multiplayer_groups_widgets,
|
||||||
window_multiplayer_options_widgets
|
window_multiplayer_options_widgets
|
||||||
};
|
};
|
||||||
|
|
||||||
const uint64 window_multiplayer_page_enabled_widgets[] = {
|
const uint64 window_multiplayer_page_enabled_widgets[] = {
|
||||||
(1 << WIDX_CLOSE) | (1 << WIDX_TAB1) | (1 << WIDX_TAB2) | (1 << WIDX_TAB3) | (1 << WIDX_TAB4),
|
(1 << WIDX_CLOSE) | (1 << WIDX_TAB1) | (1 << WIDX_TAB2) | (1 << WIDX_TAB3) | (1 << WIDX_TAB4),
|
||||||
(1 << WIDX_CLOSE) | (1 << WIDX_TAB1) | (1 << WIDX_TAB2) | (1 << WIDX_TAB3) | (1 << WIDX_TAB4),
|
(1 << WIDX_CLOSE) | (1 << WIDX_TAB1) | (1 << WIDX_TAB2) | (1 << WIDX_TAB3) | (1 << WIDX_TAB4),
|
||||||
|
|
|
@ -215,7 +215,7 @@ static void window_news_options_invalidate(rct_window *w)
|
||||||
for (int i = 0; i < countof(NewsItemOptionDefinitions); i++) {
|
for (int i = 0; i < countof(NewsItemOptionDefinitions); i++) {
|
||||||
const notification_def *ndef = &NewsItemOptionDefinitions[i];
|
const notification_def *ndef = &NewsItemOptionDefinitions[i];
|
||||||
if (ndef->category != w->page) continue;
|
if (ndef->category != w->page) continue;
|
||||||
|
|
||||||
w->enabled_widgets |= (1ULL << checkboxWidgetIndex);
|
w->enabled_widgets |= (1ULL << checkboxWidgetIndex);
|
||||||
|
|
||||||
checkboxWidget->type = WWT_CHECKBOX;
|
checkboxWidget->type = WWT_CHECKBOX;
|
||||||
|
@ -236,7 +236,7 @@ static void window_news_options_invalidate(rct_window *w)
|
||||||
// Remove unused checkboxes
|
// Remove unused checkboxes
|
||||||
while (checkboxWidget->type != WWT_LAST) {
|
while (checkboxWidget->type != WWT_LAST) {
|
||||||
w->enabled_widgets &= ~(1ULL << checkboxWidgetIndex);
|
w->enabled_widgets &= ~(1ULL << checkboxWidgetIndex);
|
||||||
|
|
||||||
checkboxWidget->type = WWT_EMPTY;
|
checkboxWidget->type = WWT_EMPTY;
|
||||||
checkboxWidgetIndex++;
|
checkboxWidgetIndex++;
|
||||||
checkboxWidget++;
|
checkboxWidget++;
|
||||||
|
|
|
@ -465,7 +465,7 @@ static uint32 window_options_page_enabled_widgets[] = {
|
||||||
(1 << WIDX_CONSTRUCTION_MARKER_DROPDOWN) |
|
(1 << WIDX_CONSTRUCTION_MARKER_DROPDOWN) |
|
||||||
(1 << WIDX_DAY_NIGHT_CHECKBOX) |
|
(1 << WIDX_DAY_NIGHT_CHECKBOX) |
|
||||||
(1 << WIDX_UPPER_CASE_BANNERS_CHECKBOX) |
|
(1 << WIDX_UPPER_CASE_BANNERS_CHECKBOX) |
|
||||||
(1 << WIDX_RENDER_WEATHER_EFFECTS_CHECKBOX) |
|
(1 << WIDX_RENDER_WEATHER_EFFECTS_CHECKBOX) |
|
||||||
(1 << WIDX_DISABLE_LIGHTNING_EFFECT_CHECKBOX),
|
(1 << WIDX_DISABLE_LIGHTNING_EFFECT_CHECKBOX),
|
||||||
|
|
||||||
MAIN_OPTIONS_ENABLED_WIDGETS |
|
MAIN_OPTIONS_ENABLED_WIDGETS |
|
||||||
|
@ -1604,7 +1604,7 @@ static void window_options_invalidate(rct_window *w)
|
||||||
w->disabled_widgets |= (1ULL << WIDX_REAL_NAME_CHECKBOX);
|
w->disabled_widgets |= (1ULL << WIDX_REAL_NAME_CHECKBOX);
|
||||||
|
|
||||||
w->hold_down_widgets |= (1 << WIDX_WINDOW_LIMIT_UP) | (1 << WIDX_WINDOW_LIMIT_DOWN);
|
w->hold_down_widgets |= (1 << WIDX_WINDOW_LIMIT_UP) | (1 << WIDX_WINDOW_LIMIT_DOWN);
|
||||||
|
|
||||||
// save plugin data checkbox: visible or not
|
// save plugin data checkbox: visible or not
|
||||||
window_options_misc_widgets[WIDX_SAVE_PLUGIN_DATA_CHECKBOX].type = WWT_CHECKBOX;
|
window_options_misc_widgets[WIDX_SAVE_PLUGIN_DATA_CHECKBOX].type = WWT_CHECKBOX;
|
||||||
|
|
||||||
|
|
|
@ -387,7 +387,7 @@ void window_player_overview_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
||||||
char ping[64];
|
char ping[64];
|
||||||
snprintf(ping, 64, "%d ms", network_get_player_ping(player));
|
snprintf(ping, 64, "%d ms", network_get_player_ping(player));
|
||||||
gfx_draw_string(dpi, ping, w->colours[2], x + 30, y);
|
gfx_draw_string(dpi, ping, w->colours[2], x + 30, y);
|
||||||
|
|
||||||
// Draw last action
|
// Draw last action
|
||||||
x = w->x + (w->width / 2);
|
x = w->x + (w->width / 2);
|
||||||
y = w->y + w->height - 13;
|
y = w->y + w->height - 13;
|
||||||
|
@ -533,7 +533,7 @@ void window_player_statistics_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
||||||
gfx_draw_string_left(dpi, STR_COMMANDS_RAN, gCommonFormatArgs, 0,x, y);
|
gfx_draw_string_left(dpi, STR_COMMANDS_RAN, gCommonFormatArgs, 0,x, y);
|
||||||
|
|
||||||
y += 10;
|
y += 10;
|
||||||
|
|
||||||
set_format_arg(0, uint32, network_get_player_money_spent(player));
|
set_format_arg(0, uint32, network_get_player_money_spent(player));
|
||||||
gfx_draw_string_left(dpi, STR_MONEY_SPENT, gCommonFormatArgs, 0,x, y);
|
gfx_draw_string_left(dpi, STR_MONEY_SPENT, gCommonFormatArgs, 0,x, y);
|
||||||
}
|
}
|
||||||
|
@ -634,7 +634,7 @@ static void window_player_update_viewport(rct_window *w, bool scroll)
|
||||||
}
|
}
|
||||||
widget_invalidate(w, WIDX_VIEWPORT);
|
widget_invalidate(w, WIDX_VIEWPORT);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Draw the viewport
|
// Draw the viewport
|
||||||
w->var_492 = 0;
|
w->var_492 = 0;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -4675,7 +4675,7 @@ static void window_ride_colour_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
||||||
widget = &w->widgets[WIDX_ENTRANCE_PREVIEW];
|
widget = &w->widgets[WIDX_ENTRANCE_PREVIEW];
|
||||||
if (widget->type != WWT_EMPTY) {
|
if (widget->type != WWT_EMPTY) {
|
||||||
if (clip_drawpixelinfo(
|
if (clip_drawpixelinfo(
|
||||||
&clippedDpi,
|
&clippedDpi,
|
||||||
dpi,
|
dpi,
|
||||||
w->x + widget->left + 1,
|
w->x + widget->left + 1,
|
||||||
w->y + widget->top + 1,
|
w->y + widget->top + 1,
|
||||||
|
|
|
@ -623,7 +623,7 @@ static void window_ride_construction_close(rct_window *w)
|
||||||
uint8 rideIndex = _currentRideIndex;
|
uint8 rideIndex = _currentRideIndex;
|
||||||
if (ride_try_get_origin_element(rideIndex, NULL)) {
|
if (ride_try_get_origin_element(rideIndex, NULL)) {
|
||||||
rct_ride *ride = get_ride(rideIndex);
|
rct_ride *ride = get_ride(rideIndex);
|
||||||
// Auto open shops if required.
|
// Auto open shops if required.
|
||||||
if (ride->mode == RIDE_MODE_SHOP_STALL && gConfigGeneral.auto_open_shops) {
|
if (ride->mode == RIDE_MODE_SHOP_STALL && gConfigGeneral.auto_open_shops) {
|
||||||
// HACK: Until we find a good a way to defer the game command for opening the shop, stop this
|
// HACK: Until we find a good a way to defer the game command for opening the shop, stop this
|
||||||
// from getting stuck in an infinite loop as opening the ride will try to close this window
|
// from getting stuck in an infinite loop as opening the ride will try to close this window
|
||||||
|
@ -1242,10 +1242,10 @@ static void window_ride_construction_resize(rct_window *w)
|
||||||
disabledWidgets &= ~(1ULL << WIDX_BANK_STRAIGHT);
|
disabledWidgets &= ~(1ULL << WIDX_BANK_STRAIGHT);
|
||||||
disabledWidgets &= ~(1ULL << WIDX_BANK_RIGHT);
|
disabledWidgets &= ~(1ULL << WIDX_BANK_RIGHT);
|
||||||
}
|
}
|
||||||
|
|
||||||
//If chain lift cheat is enabled then show the chain lift widget no matter what
|
//If chain lift cheat is enabled then show the chain lift widget no matter what
|
||||||
if(gCheatsEnableChainLiftOnAllTrack) {
|
if(gCheatsEnableChainLiftOnAllTrack) {
|
||||||
disabledWidgets &= ~(1ULL<<WIDX_CHAIN_LIFT);
|
disabledWidgets &= ~(1ULL<<WIDX_CHAIN_LIFT);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set and invalidate the changed widgets
|
// Set and invalidate the changed widgets
|
||||||
|
|
|
@ -521,7 +521,7 @@ typedef struct scenery_item {
|
||||||
} scenery_item;
|
} scenery_item;
|
||||||
|
|
||||||
static scenery_item window_scenery_count_rows_with_selected_item(int tabIndex)
|
static scenery_item window_scenery_count_rows_with_selected_item(int tabIndex)
|
||||||
{
|
{
|
||||||
scenery_item sceneryItem = { 0, 0, -1 };
|
scenery_item sceneryItem = { 0, 0, -1 };
|
||||||
int totalItems = 0;
|
int totalItems = 0;
|
||||||
sint16 id = 0;
|
sint16 id = 0;
|
||||||
|
@ -532,19 +532,19 @@ static scenery_item window_scenery_count_rows_with_selected_item(int tabIndex)
|
||||||
sceneryItem.selected_item = totalItems;
|
sceneryItem.selected_item = totalItems;
|
||||||
sceneryItem.sceneryId = sceneryId;
|
sceneryItem.sceneryId = sceneryId;
|
||||||
}
|
}
|
||||||
totalItems++;
|
totalItems++;
|
||||||
}
|
}
|
||||||
sceneryItem.allRows = count_rows(totalItems + 8);
|
sceneryItem.allRows = count_rows(totalItems + 8);
|
||||||
return sceneryItem;
|
return sceneryItem;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int window_scenery_count_rows()
|
static int window_scenery_count_rows()
|
||||||
{
|
{
|
||||||
int tabIndex = gWindowSceneryActiveTabIndex;
|
int tabIndex = gWindowSceneryActiveTabIndex;
|
||||||
int totalItems = 0;
|
int totalItems = 0;
|
||||||
|
|
||||||
while (window_scenery_tab_entries[tabIndex][totalItems] != -1){
|
while (window_scenery_tab_entries[tabIndex][totalItems] != -1){
|
||||||
totalItems++;
|
totalItems++;
|
||||||
}
|
}
|
||||||
|
|
||||||
int rows = count_rows(totalItems + 8);
|
int rows = count_rows(totalItems + 8);
|
||||||
|
|
|
@ -495,7 +495,7 @@ static void window_themes_mousedown(int widgetIndex, rct_window* w, rct_widget*
|
||||||
gDropdownItemsFormat[i] = STR_OPTIONS_DROPDOWN_ITEM;
|
gDropdownItemsFormat[i] = STR_OPTIONS_DROPDOWN_ITEM;
|
||||||
gDropdownItemsArgs[i] = (uintptr_t)theme_manager_get_available_theme_name(i);
|
gDropdownItemsArgs[i] = (uintptr_t)theme_manager_get_available_theme_name(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
window_dropdown_show_text_custom_width(
|
window_dropdown_show_text_custom_width(
|
||||||
w->x + widget->left,
|
w->x + widget->left,
|
||||||
w->y + widget->top,
|
w->y + widget->top,
|
||||||
|
|
|
@ -529,7 +529,7 @@ static void draw_category_heading(rct_window *w, rct_drawpixelinfo *dpi, int lef
|
||||||
// Draw string
|
// Draw string
|
||||||
int centreX = (left + right) / 2;
|
int centreX = (left + right) / 2;
|
||||||
gfx_draw_string_centred(dpi, stringId, centreX, y, baseColour, NULL);
|
gfx_draw_string_centred(dpi, stringId, centreX, y, baseColour, NULL);
|
||||||
|
|
||||||
// Get string dimensions
|
// Get string dimensions
|
||||||
utf8 *buffer = gCommonStringFormatBuffer;
|
utf8 *buffer = gCommonStringFormatBuffer;
|
||||||
format_string(buffer, 256, stringId, NULL);
|
format_string(buffer, 256, stringId, NULL);
|
||||||
|
|
|
@ -521,7 +521,7 @@ static void window_top_toolbar_dropdown(rct_window *w, int widgetIndex, int drop
|
||||||
// New game is only available in the normal game. Skip one position to avoid incorrect mappings in the menus of the other modes.
|
// New game is only available in the normal game. Skip one position to avoid incorrect mappings in the menus of the other modes.
|
||||||
if (gScreenFlags & (SCREEN_FLAGS_SCENARIO_EDITOR))
|
if (gScreenFlags & (SCREEN_FLAGS_SCENARIO_EDITOR))
|
||||||
dropdownIndex += 1;
|
dropdownIndex += 1;
|
||||||
|
|
||||||
// Quicksave is only available in the normal game. Skip one position to avoid incorrect mappings in the menus of the other modes.
|
// Quicksave is only available in the normal game. Skip one position to avoid incorrect mappings in the menus of the other modes.
|
||||||
if (gScreenFlags & (SCREEN_FLAGS_SCENARIO_EDITOR) && dropdownIndex > DDIDX_LOAD_GAME)
|
if (gScreenFlags & (SCREEN_FLAGS_SCENARIO_EDITOR) && dropdownIndex > DDIDX_LOAD_GAME)
|
||||||
dropdownIndex += 1;
|
dropdownIndex += 1;
|
||||||
|
|
|
@ -185,7 +185,7 @@ static void window_track_list_select(rct_window *w, int index)
|
||||||
// Displays a message if the ride can't load, fix #4080
|
// Displays a message if the ride can't load, fix #4080
|
||||||
if (_loadedTrackDesign == NULL) {
|
if (_loadedTrackDesign == NULL) {
|
||||||
window_error_open(STR_CANT_BUILD_PARK_ENTRANCE_HERE, STR_TRACK_LOAD_FAILED_ERROR);
|
window_error_open(STR_CANT_BUILD_PARK_ENTRANCE_HERE, STR_TRACK_LOAD_FAILED_ERROR);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
audio_play_sound_panned(SOUND_CLICK_1, w->x + (w->width / 2), 0, 0, 0);
|
audio_play_sound_panned(SOUND_CLICK_1, w->x + (w->width / 2), 0, 0, 0);
|
||||||
|
|
|
@ -171,7 +171,7 @@ void window_track_place_open(const track_design_file_ref *tdFileRef)
|
||||||
|
|
||||||
window_track_place_clear_mini_preview();
|
window_track_place_clear_mini_preview();
|
||||||
window_track_place_draw_mini_preview(td6);
|
window_track_place_draw_mini_preview(td6);
|
||||||
|
|
||||||
_trackDesign = td6;
|
_trackDesign = td6;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -432,7 +432,7 @@ static void window_track_place_attempt_placement(rct_track_td6 *td6, int x, int
|
||||||
ebx = bl;
|
ebx = bl;
|
||||||
ecx = y;
|
ecx = y;
|
||||||
edi = z;
|
edi = z;
|
||||||
|
|
||||||
gActiveTrackDesign = _trackDesign;
|
gActiveTrackDesign = _trackDesign;
|
||||||
result = game_do_command_p(GAME_COMMAND_PLACE_TRACK_DESIGN, &eax, &ebx, &ecx, &edx, &esi, &edi, &ebp);
|
result = game_do_command_p(GAME_COMMAND_PLACE_TRACK_DESIGN, &eax, &ebx, &ecx, &edx, &esi, &edi, &ebp);
|
||||||
gActiveTrackDesign = NULL;
|
gActiveTrackDesign = NULL;
|
||||||
|
|
|
@ -296,10 +296,10 @@ static void climate_update_thunder_sound()
|
||||||
|
|
||||||
static void climate_update_lightning()
|
static void climate_update_lightning()
|
||||||
{
|
{
|
||||||
if (_lightningTimer == 0 || gConfigGeneral.disable_lightning_effect ||
|
if (_lightningTimer == 0 || gConfigGeneral.disable_lightning_effect ||
|
||||||
(!gConfigGeneral.render_weather_effects && !gConfigGeneral.render_weather_gloom))
|
(!gConfigGeneral.render_weather_effects && !gConfigGeneral.render_weather_gloom))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
_lightningTimer--;
|
_lightningTimer--;
|
||||||
if (gClimateLightningFlash == 0)
|
if (gClimateLightningFlash == 0)
|
||||||
if ((util_rand() & 0xFFFF) <= 0x2000)
|
if ((util_rand() & 0xFFFF) <= 0x2000)
|
||||||
|
|
|
@ -1409,7 +1409,7 @@ void footpath_chain_ride_queue(int rideIndex, int entranceIndex, int x, int y, r
|
||||||
mapElement->properties.path.ride_index = rideIndex;
|
mapElement->properties.path.ride_index = rideIndex;
|
||||||
mapElement->properties.path.additions &= 0x8F;
|
mapElement->properties.path.additions &= 0x8F;
|
||||||
mapElement->properties.path.additions |= (entranceIndex & 7) << 4;
|
mapElement->properties.path.additions |= (entranceIndex & 7) << 4;
|
||||||
|
|
||||||
map_invalidate_element(x, y, mapElement);
|
map_invalidate_element(x, y, mapElement);
|
||||||
|
|
||||||
if (lastQueuePathElement == NULL) {
|
if (lastQueuePathElement == NULL) {
|
||||||
|
|
|
@ -4814,7 +4814,7 @@ rct_map_element *map_get_fence_element_at(int x, int y, int z, int direction)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
rct_map_element *map_get_park_entrance_element_at(int x, int y, int z, bool ghost)
|
rct_map_element *map_get_park_entrance_element_at(int x, int y, int z, bool ghost)
|
||||||
{
|
{
|
||||||
rct_map_element* mapElement = map_get_first_element_at(x >> 5, y >> 5);
|
rct_map_element* mapElement = map_get_first_element_at(x >> 5, y >> 5);
|
||||||
do {
|
do {
|
||||||
|
@ -4829,7 +4829,7 @@ rct_map_element *map_get_park_entrance_element_at(int x, int y, int z, bool ghos
|
||||||
|
|
||||||
if ((ghost == false) && (mapElement->flags & MAP_ELEMENT_FLAG_GHOST))
|
if ((ghost == false) && (mapElement->flags & MAP_ELEMENT_FLAG_GHOST))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
return mapElement;
|
return mapElement;
|
||||||
} while (!map_element_is_last_for_tile(mapElement++));
|
} while (!map_element_is_last_for_tile(mapElement++));
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -5213,7 +5213,7 @@ static money32 place_park_entrance(int flags, sint16 x, sint16 y, sint16 z, uint
|
||||||
|
|
||||||
if (!(flags & GAME_COMMAND_FLAG_APPLY))
|
if (!(flags & GAME_COMMAND_FLAG_APPLY))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (!(flags & GAME_COMMAND_FLAG_GHOST)) {
|
if (!(flags & GAME_COMMAND_FLAG_GHOST)) {
|
||||||
rct_map_element* surfaceElement = map_get_surface_element_at(x / 32, y / 32);
|
rct_map_element* surfaceElement = map_get_surface_element_at(x / 32, y / 32);
|
||||||
surfaceElement->properties.surface.ownership = 0;
|
surfaceElement->properties.surface.ownership = 0;
|
||||||
|
|
|
@ -37,7 +37,7 @@ colour_t gWindowScenerySecondaryColour;
|
||||||
colour_t gWindowSceneryTertiaryColour;
|
colour_t gWindowSceneryTertiaryColour;
|
||||||
|
|
||||||
rct_map_element *gSceneryMapElement;
|
rct_map_element *gSceneryMapElement;
|
||||||
uint8 gSceneryMapElementType;
|
uint8 gSceneryMapElementType;
|
||||||
|
|
||||||
money32 gSceneryPlaceCost;
|
money32 gSceneryPlaceCost;
|
||||||
sint16 gSceneryPlaceObject;
|
sint16 gSceneryPlaceObject;
|
||||||
|
|
|
@ -221,7 +221,7 @@ extern colour_t gWindowScenerySecondaryColour;
|
||||||
extern colour_t gWindowSceneryTertiaryColour;
|
extern colour_t gWindowSceneryTertiaryColour;
|
||||||
|
|
||||||
extern rct_map_element *gSceneryMapElement;
|
extern rct_map_element *gSceneryMapElement;
|
||||||
extern uint8 gSceneryMapElementType;
|
extern uint8 gSceneryMapElementType;
|
||||||
|
|
||||||
extern money32 gSceneryPlaceCost;
|
extern money32 gSceneryPlaceCost;
|
||||||
extern sint16 gSceneryPlaceObject;
|
extern sint16 gSceneryPlaceObject;
|
||||||
|
|
|
@ -256,7 +256,7 @@ BOOL APIENTRY DllMain(HANDLE hModule, DWORD dwReason, LPVOID lpReserved)
|
||||||
|
|
||||||
__declspec(dllexport) int StartOpenRCT(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
|
__declspec(dllexport) int StartOpenRCT(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (_dllModule == NULL) {
|
if (_dllModule == NULL) {
|
||||||
_dllModule = GetModuleHandleA(OPENRCT2_DLL_MODULE_NAME);
|
_dllModule = GetModuleHandleA(OPENRCT2_DLL_MODULE_NAME);
|
||||||
}
|
}
|
||||||
|
@ -271,7 +271,7 @@ __declspec(dllexport) int StartOpenRCT(HINSTANCE hInstance, HINSTANCE hPrevInsta
|
||||||
free(argv[i]);
|
free(argv[i]);
|
||||||
}
|
}
|
||||||
free(argv);
|
free(argv);
|
||||||
|
|
||||||
exit(gExitCode);
|
exit(gExitCode);
|
||||||
return gExitCode;
|
return gExitCode;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue