forked from rosebudai/OpenRCT2-Web
Binpack function arguments together
Previously when the arguments of a function wouldn't fit on a single line, clang-format would put each argument on its own line instead. By enabling the binpack parameter setting, it tried to fit as many on one line as possible instead. Co-authored-by: Hielke Morsink <hielke.morsink@gmail.com>
This commit is contained in:
1 parent
95ce592579
commit
b02dfdbc93
240 files changed
+20249
-140534
No files matched your search
+2
-2
@@ -17,8 +17,8 @@ AlwaysBreakAfterDefinitionReturnType: None
|
||||
AlwaysBreakAfterReturnType: None
|
||||
AlwaysBreakBeforeMultilineStrings: false
|
||||
AlwaysBreakTemplateDeclarations: false
|
||||
BinPackArguments: false
|
||||
BinPackParameters: false
|
||||
BinPackArguments: true
|
||||
BinPackParameters: true
|
||||
BraceWrapping:
|
||||
AfterClass: true
|
||||
AfterControlStatement: true
|
||||
|
||||
@@ -98,12 +98,8 @@ SDL_Cursor* CursorRepository::Create(const CursorData* cursorInfo, uint8_t scale
|
||||
auto mask = scaleDataArray(cursorInfo->Mask, CURSOR_BIT_WIDTH, CURSOR_HEIGHT, static_cast<size_t>(integer_scale));
|
||||
|
||||
cursor = SDL_CreateCursor(
|
||||
data,
|
||||
mask,
|
||||
BASE_CURSOR_WIDTH * integer_scale,
|
||||
BASE_CURSOR_HEIGHT * integer_scale,
|
||||
cursorInfo->HotSpot.X * integer_scale,
|
||||
cursorInfo->HotSpot.Y * integer_scale);
|
||||
data, mask, BASE_CURSOR_WIDTH * integer_scale, BASE_CURSOR_HEIGHT * integer_scale,
|
||||
cursorInfo->HotSpot.X * integer_scale, cursorInfo->HotSpot.Y * integer_scale);
|
||||
|
||||
free(data);
|
||||
free(mask);
|
||||
|
||||
@@ -125,12 +125,8 @@ namespace OpenRCT2::Ui
|
||||
std::string action = (desc.Type == FILE_DIALOG_TYPE::OPEN) ? "--getopenfilename" : "--getsavefilename";
|
||||
std::string filter = GetKDialogFilterString(desc.Filters);
|
||||
std::string cmd = String::StdFormat(
|
||||
"%s --title '%s' %s '%s' '%s'",
|
||||
executablePath.c_str(),
|
||||
desc.Title.c_str(),
|
||||
action.c_str(),
|
||||
desc.InitialDirectory.c_str(),
|
||||
filter.c_str());
|
||||
"%s --title '%s' %s '%s' '%s'", executablePath.c_str(), desc.Title.c_str(), action.c_str(),
|
||||
desc.InitialDirectory.c_str(), filter.c_str());
|
||||
std::string output;
|
||||
if (Execute(cmd, &output) == 0)
|
||||
{
|
||||
@@ -148,13 +144,8 @@ namespace OpenRCT2::Ui
|
||||
}
|
||||
std::string filters = GetZenityFilterString(desc.Filters);
|
||||
std::string cmd = String::StdFormat(
|
||||
"%s %s --filename='%s/' %s --title='%s' / %s",
|
||||
executablePath.c_str(),
|
||||
action.c_str(),
|
||||
desc.InitialDirectory.c_str(),
|
||||
flags.c_str(),
|
||||
desc.Title.c_str(),
|
||||
filters.c_str());
|
||||
"%s %s --filename='%s/' %s --title='%s' / %s", executablePath.c_str(), action.c_str(),
|
||||
desc.InitialDirectory.c_str(), flags.c_str(), desc.Title.c_str(), filters.c_str());
|
||||
std::string output;
|
||||
if (Execute(cmd, &output) == 0)
|
||||
{
|
||||
|
||||
@@ -767,12 +767,7 @@ private:
|
||||
}
|
||||
|
||||
static void DrawRainWindow(
|
||||
IRainDrawer* rainDrawer,
|
||||
rct_window* original_w,
|
||||
int16_t left,
|
||||
int16_t right,
|
||||
int16_t top,
|
||||
int16_t bottom,
|
||||
IRainDrawer* rainDrawer, rct_window* original_w, int16_t left, int16_t right, int16_t top, int16_t bottom,
|
||||
DrawRainFunc drawFunc)
|
||||
{
|
||||
rct_window* w{};
|
||||
|
||||
@@ -272,12 +272,7 @@ namespace OpenRCT2::Audio
|
||||
if (streamformat != _format)
|
||||
{
|
||||
if (SDL_BuildAudioCVT(
|
||||
&cvt,
|
||||
streamformat.format,
|
||||
streamformat.channels,
|
||||
streamformat.freq,
|
||||
_format.format,
|
||||
_format.channels,
|
||||
&cvt, streamformat.format, streamformat.channels, streamformat.freq, _format.format, _format.channels,
|
||||
_format.freq)
|
||||
== -1)
|
||||
{
|
||||
@@ -345,11 +340,7 @@ namespace OpenRCT2::Audio
|
||||
* Assumes that srcBuffer is the same format as _format.
|
||||
*/
|
||||
size_t ApplyResample(
|
||||
ISDLAudioChannel* channel,
|
||||
const void* srcBuffer,
|
||||
int32_t srcSamples,
|
||||
int32_t dstSamples,
|
||||
int32_t inRate,
|
||||
ISDLAudioChannel* channel, const void* srcBuffer, int32_t srcSamples, int32_t dstSamples, int32_t inRate,
|
||||
int32_t outRate)
|
||||
{
|
||||
int32_t byteRate = _format.GetByteRate();
|
||||
|
||||
@@ -92,40 +92,16 @@ typedef void(APIENTRYP PFNGLPIXELSTOREIPROC)(GLenum pname, GLint param);
|
||||
typedef void(APIENTRYP PFNGLREADPIXELSPROC)(
|
||||
GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid* pixels);
|
||||
typedef void(APIENTRYP PFNGLTEXIMAGE2DPROC)(
|
||||
GLenum target,
|
||||
GLint level,
|
||||
GLint internalFormat,
|
||||
GLsizei width,
|
||||
GLsizei height,
|
||||
GLint border,
|
||||
GLenum format,
|
||||
GLenum type,
|
||||
GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type,
|
||||
const GLvoid* pixels);
|
||||
typedef void(APIENTRYP PFNGLTEXPARAMETERIPROC)(GLenum target, GLenum pname, GLint param);
|
||||
typedef void(APIENTRYP PFNGLVIEWPORTPROC)(GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
typedef void(APIENTRYP PFNGLTEXSUBIMAGE3DPROC)(
|
||||
GLenum target,
|
||||
GLint level,
|
||||
GLint xoffset,
|
||||
GLint yoffset,
|
||||
GLint zoffset,
|
||||
GLsizei width,
|
||||
GLsizei height,
|
||||
GLsizei depth,
|
||||
GLenum format,
|
||||
GLenum type,
|
||||
const GLvoid* data);
|
||||
GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth,
|
||||
GLenum format, GLenum type, const GLvoid* data);
|
||||
typedef void(APIENTRYP PFNGLTEXIMAGE3DPROC)(
|
||||
GLenum target,
|
||||
GLint level,
|
||||
GLint internalFormat,
|
||||
GLsizei width,
|
||||
GLsizei height,
|
||||
GLsizei depth,
|
||||
GLint border,
|
||||
GLenum format,
|
||||
GLenum type,
|
||||
const GLvoid* data);
|
||||
GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format,
|
||||
GLenum type, const GLvoid* data);
|
||||
typedef void(APIENTRYP PFNGLGETINTERGERVPROC)(GLenum pname, GLint* data);
|
||||
typedef void(APIENTRYP PFNGLGETTEXIMAGEPROC)(GLenum target, GLint level, GLenum format, GLenum type, GLvoid* img);
|
||||
|
||||
|
||||
@@ -33,11 +33,8 @@ void SwapFramebuffer::ApplyTransparency(ApplyTransparencyShader& shader, GLuint
|
||||
glDisable(GL_DEPTH_TEST);
|
||||
shader.Use();
|
||||
shader.SetTextures(
|
||||
_opaqueFramebuffer.GetTexture(),
|
||||
_opaqueFramebuffer.GetDepthTexture(),
|
||||
_transparentFramebuffer.GetTexture(),
|
||||
_transparentFramebuffer.GetDepthTexture(),
|
||||
paletteTex);
|
||||
_opaqueFramebuffer.GetTexture(), _opaqueFramebuffer.GetDepthTexture(), _transparentFramebuffer.GetTexture(),
|
||||
_transparentFramebuffer.GetDepthTexture(), paletteTex);
|
||||
shader.Draw();
|
||||
|
||||
_backDepth = _transparentFramebuffer.SwapDepthTexture(_backDepth);
|
||||
|
||||
@@ -178,30 +178,13 @@ void TextureCache::EnlargeAtlasesTexture(GLuint newEntries)
|
||||
|
||||
glBindTexture(GL_TEXTURE_2D_ARRAY, _atlasesTexture);
|
||||
glTexImage3D(
|
||||
GL_TEXTURE_2D_ARRAY,
|
||||
0,
|
||||
GL_R8UI,
|
||||
_atlasesTextureDimensions,
|
||||
_atlasesTextureDimensions,
|
||||
newIndices,
|
||||
0,
|
||||
GL_RED_INTEGER,
|
||||
GL_UNSIGNED_BYTE,
|
||||
nullptr);
|
||||
GL_TEXTURE_2D_ARRAY, 0, GL_R8UI, _atlasesTextureDimensions, _atlasesTextureDimensions, newIndices, 0, GL_RED_INTEGER,
|
||||
GL_UNSIGNED_BYTE, nullptr);
|
||||
|
||||
// Restore old data
|
||||
glTexSubImage3D(
|
||||
GL_TEXTURE_2D_ARRAY,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
_atlasesTextureDimensions,
|
||||
_atlasesTextureDimensions,
|
||||
_atlasesTextureIndices,
|
||||
GL_RED_INTEGER,
|
||||
GL_UNSIGNED_BYTE,
|
||||
oldPixels.data());
|
||||
GL_TEXTURE_2D_ARRAY, 0, 0, 0, 0, _atlasesTextureDimensions, _atlasesTextureDimensions, _atlasesTextureIndices,
|
||||
GL_RED_INTEGER, GL_UNSIGNED_BYTE, oldPixels.data());
|
||||
|
||||
_atlasesTextureIndices = newIndices;
|
||||
}
|
||||
@@ -215,17 +198,8 @@ AtlasTextureInfo TextureCache::LoadImageTexture(uint32_t image)
|
||||
|
||||
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);
|
||||
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);
|
||||
|
||||
DeleteDPI(dpi);
|
||||
|
||||
@@ -241,17 +215,8 @@ AtlasTextureInfo TextureCache::LoadGlyphTexture(uint32_t image, uint8_t* palette
|
||||
|
||||
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);
|
||||
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);
|
||||
|
||||
DeleteDPI(dpi);
|
||||
|
||||
|
||||
@@ -40,24 +40,11 @@ void dropdown_set_disabled(int32_t index, bool value);
|
||||
|
||||
void window_dropdown_show_text(int32_t x, int32_t y, int32_t extray, uint8_t colour, uint8_t flags, size_t num_items);
|
||||
void window_dropdown_show_text_custom_width(
|
||||
int32_t x,
|
||||
int32_t y,
|
||||
int32_t extray,
|
||||
uint8_t colour,
|
||||
uint8_t custom_height,
|
||||
uint8_t flags,
|
||||
size_t num_items,
|
||||
int32_t x, int32_t y, int32_t extray, uint8_t colour, uint8_t custom_height, uint8_t flags, size_t num_items,
|
||||
int32_t width);
|
||||
void window_dropdown_show_image(
|
||||
int32_t x,
|
||||
int32_t y,
|
||||
int32_t extray,
|
||||
uint8_t colour,
|
||||
uint8_t flags,
|
||||
int32_t numItems,
|
||||
int32_t itemWidth,
|
||||
int32_t itemHeight,
|
||||
int32_t numColumns);
|
||||
int32_t x, int32_t y, int32_t extray, uint8_t colour, uint8_t flags, int32_t numItems, int32_t itemWidth,
|
||||
int32_t itemHeight, int32_t numColumns);
|
||||
void window_dropdown_close();
|
||||
int32_t dropdown_index_from_point(int32_t x, int32_t y, rct_window* w);
|
||||
void window_dropdown_show_colour(rct_window* w, rct_widget* widget, uint8_t dropdownColour, uint8_t selectedColour);
|
||||
|
||||
@@ -127,12 +127,7 @@ static void graph_draw_months_money32(
|
||||
}
|
||||
|
||||
static void graph_draw_line_a_money32(
|
||||
rct_drawpixelinfo* dpi,
|
||||
const money32* history,
|
||||
int32_t count,
|
||||
int32_t baseX,
|
||||
int32_t baseY,
|
||||
int32_t modifier,
|
||||
rct_drawpixelinfo* dpi, const money32* history, int32_t count, int32_t baseX, int32_t baseY, int32_t modifier,
|
||||
int32_t offset)
|
||||
{
|
||||
int32_t i, x, y, lastX, lastY;
|
||||
@@ -161,12 +156,7 @@ static void graph_draw_line_a_money32(
|
||||
}
|
||||
|
||||
static void graph_draw_line_b_money32(
|
||||
rct_drawpixelinfo* dpi,
|
||||
const money32* history,
|
||||
int32_t count,
|
||||
int32_t baseX,
|
||||
int32_t baseY,
|
||||
int32_t modifier,
|
||||
rct_drawpixelinfo* dpi, const money32* history, int32_t count, int32_t baseX, int32_t baseY, int32_t modifier,
|
||||
int32_t offset)
|
||||
{
|
||||
int32_t i, x, y, lastX, lastY;
|
||||
|
||||
@@ -298,12 +298,7 @@ void InGameConsole::Draw(rct_drawpixelinfo* dpi) const
|
||||
gfx_fill_rect_inset(
|
||||
dpi, _consoleLeft, _consoleTop, _consoleRight, _consoleBottom, backgroundColour, INSET_RECT_FLAG_FILL_NONE);
|
||||
gfx_fill_rect_inset(
|
||||
dpi,
|
||||
_consoleLeft + 1,
|
||||
_consoleTop + 1,
|
||||
_consoleRight - 1,
|
||||
_consoleBottom - 1,
|
||||
backgroundColour,
|
||||
dpi, _consoleLeft + 1, _consoleTop + 1, _consoleRight - 1, _consoleBottom - 1, backgroundColour,
|
||||
INSET_RECT_FLAG_BORDER_INSET);
|
||||
|
||||
std::string lineBuffer;
|
||||
|
||||
@@ -99,14 +99,7 @@ void land_tool_show_surface_style_dropdown(rct_window* w, rct_widget* widget, ui
|
||||
}
|
||||
|
||||
window_dropdown_show_image(
|
||||
w->x + widget->left,
|
||||
w->y + widget->top,
|
||||
widget->bottom - widget->top,
|
||||
w->colours[2],
|
||||
0,
|
||||
TERRAIN_COUNT_REGULAR,
|
||||
47,
|
||||
36,
|
||||
w->x + widget->left, w->y + widget->top, widget->bottom - widget->top, w->colours[2], 0, TERRAIN_COUNT_REGULAR, 47, 36,
|
||||
gAppropriateImageDropdownItemsPerRow[TERRAIN_COUNT_REGULAR]);
|
||||
|
||||
gDropdownDefaultIndex = defaultIndex;
|
||||
@@ -127,14 +120,7 @@ void land_tool_show_edge_style_dropdown(rct_window* w, rct_widget* widget, uint8
|
||||
}
|
||||
|
||||
window_dropdown_show_image(
|
||||
w->x + widget->left,
|
||||
w->y + widget->top,
|
||||
widget->bottom - widget->top,
|
||||
w->colours[2],
|
||||
0,
|
||||
edgeCount,
|
||||
47,
|
||||
36,
|
||||
w->x + widget->left, w->y + widget->top, widget->bottom - widget->top, w->colours[2], 0, edgeCount, 47, 36,
|
||||
gAppropriateImageDropdownItemsPerRow[edgeCount]);
|
||||
|
||||
gDropdownDefaultIndex = defaultIndex;
|
||||
|
||||
@@ -61,14 +61,8 @@ int32_t viewport_interaction_get_item_left(int32_t x, int32_t y, viewport_intera
|
||||
|
||||
LocationXY16 mapCoord = {};
|
||||
get_map_coordinates_from_pos(
|
||||
x,
|
||||
y,
|
||||
VIEWPORT_INTERACTION_MASK_SPRITE & VIEWPORT_INTERACTION_MASK_RIDE & VIEWPORT_INTERACTION_MASK_PARK,
|
||||
&mapCoord.x,
|
||||
&mapCoord.y,
|
||||
&info->type,
|
||||
&info->tileElement,
|
||||
nullptr);
|
||||
x, y, VIEWPORT_INTERACTION_MASK_SPRITE & VIEWPORT_INTERACTION_MASK_RIDE & VIEWPORT_INTERACTION_MASK_PARK, &mapCoord.x,
|
||||
&mapCoord.y, &info->type, &info->tileElement, nullptr);
|
||||
info->x = mapCoord.x;
|
||||
info->y = mapCoord.y;
|
||||
tileElement = info->tileElement;
|
||||
@@ -164,13 +158,8 @@ int32_t viewport_interaction_left_click(int32_t x, int32_t y)
|
||||
{
|
||||
case SPRITE_MISC_BALLOON:
|
||||
game_do_command(
|
||||
info.sprite->balloon.sprite_index,
|
||||
GAME_COMMAND_FLAG_APPLY,
|
||||
0,
|
||||
0,
|
||||
GAME_COMMAND_BALLOON_PRESS,
|
||||
0,
|
||||
0);
|
||||
info.sprite->balloon.sprite_index, GAME_COMMAND_FLAG_APPLY, 0, 0,
|
||||
GAME_COMMAND_BALLOON_PRESS, 0, 0);
|
||||
break;
|
||||
case SPRITE_MISC_DUCK:
|
||||
duck_press(&info.sprite->duck);
|
||||
@@ -217,14 +206,8 @@ int32_t viewport_interaction_get_item_right(int32_t x, int32_t y, viewport_inter
|
||||
|
||||
LocationXY16 mapCoord = {};
|
||||
get_map_coordinates_from_pos(
|
||||
x,
|
||||
y,
|
||||
~(VIEWPORT_INTERACTION_MASK_TERRAIN & VIEWPORT_INTERACTION_MASK_WATER),
|
||||
&mapCoord.x,
|
||||
&mapCoord.y,
|
||||
&info->type,
|
||||
&info->tileElement,
|
||||
nullptr);
|
||||
x, y, ~(VIEWPORT_INTERACTION_MASK_TERRAIN & VIEWPORT_INTERACTION_MASK_WATER), &mapCoord.x, &mapCoord.y, &info->type,
|
||||
&info->tileElement, nullptr);
|
||||
info->x = mapCoord.x;
|
||||
info->y = mapCoord.y;
|
||||
tileElement = info->tileElement;
|
||||
@@ -480,13 +463,8 @@ static void viewport_interaction_remove_scenery(rct_tile_element* tileElement, i
|
||||
{
|
||||
gGameCommandErrorTitle = STR_CANT_REMOVE_THIS;
|
||||
game_do_command(
|
||||
x,
|
||||
(tileElement->type << 8) | 1,
|
||||
y,
|
||||
(tileElement->properties.scenery.type << 8) | tileElement->base_height,
|
||||
GAME_COMMAND_REMOVE_SCENERY,
|
||||
0,
|
||||
0);
|
||||
x, (tileElement->type << 8) | 1, y, (tileElement->properties.scenery.type << 8) | tileElement->base_height,
|
||||
GAME_COMMAND_REMOVE_SCENERY, 0, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -531,13 +509,8 @@ static void viewport_interaction_remove_footpath_item(rct_tile_element* tileElem
|
||||
|
||||
gGameCommandErrorTitle = STR_CANT_REMOVE_THIS;
|
||||
game_do_command(
|
||||
x,
|
||||
((tileElement->properties.path.type & 7) << 8) | 1,
|
||||
y,
|
||||
(type << 8) | tileElement->base_height,
|
||||
GAME_COMMAND_PLACE_PATH,
|
||||
0,
|
||||
0);
|
||||
x, ((tileElement->properties.path.type & 7) << 8) | 1, y, (type << 8) | tileElement->base_height,
|
||||
GAME_COMMAND_PLACE_PATH, 0, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -598,13 +571,8 @@ static void viewport_interaction_remove_large_scenery(rct_tile_element* tileElem
|
||||
{
|
||||
gGameCommandErrorTitle = STR_CANT_REMOVE_THIS;
|
||||
game_do_command(
|
||||
x,
|
||||
1 | (tile_element_get_direction(tileElement) << 8),
|
||||
y,
|
||||
tileElement->base_height | (scenery_large_get_sequence(tileElement) << 8),
|
||||
GAME_COMMAND_REMOVE_LARGE_SCENERY,
|
||||
0,
|
||||
0);
|
||||
x, 1 | (tile_element_get_direction(tileElement) << 8), y,
|
||||
tileElement->base_height | (scenery_large_get_sequence(tileElement) << 8), GAME_COMMAND_REMOVE_LARGE_SCENERY, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -660,14 +628,8 @@ void sub_68A15E(int32_t screenX, int32_t screenY, int16_t* x, int16_t* y, int32_
|
||||
rct_tile_element* myTileElement;
|
||||
rct_viewport* viewport;
|
||||
get_map_coordinates_from_pos(
|
||||
screenX,
|
||||
screenY,
|
||||
VIEWPORT_INTERACTION_MASK_TERRAIN & VIEWPORT_INTERACTION_MASK_WATER,
|
||||
&my_x,
|
||||
&my_y,
|
||||
&interactionType,
|
||||
&myTileElement,
|
||||
&viewport);
|
||||
screenX, screenY, VIEWPORT_INTERACTION_MASK_TERRAIN & VIEWPORT_INTERACTION_MASK_WATER, &my_x, &my_y, &interactionType,
|
||||
&myTileElement, &viewport);
|
||||
|
||||
if (interactionType == VIEWPORT_INTERACTION_ITEM_NONE)
|
||||
{
|
||||
|
||||
@@ -702,12 +702,7 @@ static void widget_hscrollbar_draw(
|
||||
|
||||
// Thumb
|
||||
gfx_fill_rect_inset(
|
||||
dpi,
|
||||
std::max(l + 10, l + scroll->h_thumb_left - 1),
|
||||
t,
|
||||
std::min(r - 10, l + scroll->h_thumb_right - 1),
|
||||
b,
|
||||
colour,
|
||||
dpi, std::max(l + 10, l + scroll->h_thumb_left - 1), t, std::min(r - 10, l + scroll->h_thumb_right - 1), b, colour,
|
||||
((scroll->flags & HSCROLLBAR_THUMB_PRESSED) ? INSET_RECT_FLAG_BORDER_INSET : 0));
|
||||
|
||||
// Right button
|
||||
@@ -735,12 +730,7 @@ static void widget_vscrollbar_draw(
|
||||
|
||||
// Thumb
|
||||
gfx_fill_rect_inset(
|
||||
dpi,
|
||||
l,
|
||||
std::max(t + 10, t + scroll->v_thumb_top - 1),
|
||||
r,
|
||||
std::min(b - 10, t + scroll->v_thumb_bottom - 1),
|
||||
colour,
|
||||
dpi, l, std::max(t + 10, t + scroll->v_thumb_top - 1), r, std::min(b - 10, t + scroll->v_thumb_bottom - 1), colour,
|
||||
((scroll->flags & VSCROLLBAR_THUMB_PRESSED) ? INSET_RECT_FLAG_BORDER_INSET : 0));
|
||||
|
||||
// Down button
|
||||
@@ -869,13 +859,7 @@ bool widget_is_active_tool(rct_window* w, rct_widgetindex widgetIndex)
|
||||
* edi: widget
|
||||
*/
|
||||
void widget_scroll_get_part(
|
||||
rct_window* w,
|
||||
rct_widget* widget,
|
||||
int32_t x,
|
||||
int32_t y,
|
||||
int32_t* output_x,
|
||||
int32_t* output_y,
|
||||
int32_t* output_scroll_area,
|
||||
rct_window* w, rct_widget* widget, int32_t x, int32_t y, int32_t* output_x, int32_t* output_y, int32_t* output_scroll_area,
|
||||
int32_t* scroll_id)
|
||||
{
|
||||
rct_widget* iterator = w->widgets;
|
||||
|
||||
@@ -85,12 +85,7 @@ static bool window_fits_on_screen(int32_t x, int32_t y, int32_t width, int32_t h
|
||||
}
|
||||
|
||||
rct_window* window_create(
|
||||
int32_t x,
|
||||
int32_t y,
|
||||
int32_t width,
|
||||
int32_t height,
|
||||
rct_window_event_list* event_handlers,
|
||||
rct_windowclass cls,
|
||||
int32_t x, int32_t y, int32_t width, int32_t height, rct_window_event_list* event_handlers, rct_windowclass cls,
|
||||
uint16_t flags)
|
||||
{
|
||||
// Check if there are any window slots left
|
||||
|
||||
@@ -152,17 +152,8 @@ rct_window* window_banner_open(rct_windownumber number)
|
||||
// Create viewport
|
||||
viewportWidget = &window_banner_widgets[WIDX_VIEWPORT];
|
||||
viewport_create(
|
||||
w,
|
||||
w->x + viewportWidget->left + 1,
|
||||
w->y + viewportWidget->top + 1,
|
||||
(viewportWidget->right - viewportWidget->left) - 2,
|
||||
(viewportWidget->bottom - viewportWidget->top) - 2,
|
||||
0,
|
||||
view_x,
|
||||
view_y,
|
||||
view_z,
|
||||
0,
|
||||
-1);
|
||||
w, w->x + viewportWidget->left + 1, w->y + viewportWidget->top + 1, (viewportWidget->right - viewportWidget->left) - 2,
|
||||
(viewportWidget->bottom - viewportWidget->top) - 2, 0, view_x, view_y, view_z, 0, -1);
|
||||
|
||||
w->viewport->flags = gConfigGeneral.always_show_gridlines ? VIEWPORT_FLAG_GRIDLINES : 0;
|
||||
window_invalidate(w);
|
||||
@@ -196,13 +187,8 @@ static void window_banner_mouseup(rct_window* w, rct_widgetindex widgetIndex)
|
||||
break;
|
||||
case WIDX_BANNER_DEMOLISH:
|
||||
game_do_command(
|
||||
x,
|
||||
1,
|
||||
y,
|
||||
tile_element->base_height | (tile_element->properties.banner.position << 8),
|
||||
GAME_COMMAND_REMOVE_BANNER,
|
||||
0,
|
||||
0);
|
||||
x, 1, y, tile_element->base_height | (tile_element->properties.banner.position << 8),
|
||||
GAME_COMMAND_REMOVE_BANNER, 0, 0);
|
||||
break;
|
||||
case WIDX_BANNER_TEXT:
|
||||
window_text_input_open(
|
||||
@@ -211,12 +197,7 @@ static void window_banner_mouseup(rct_window* w, rct_widgetindex widgetIndex)
|
||||
case WIDX_BANNER_NO_ENTRY:
|
||||
textinput_cancel();
|
||||
game_do_command(
|
||||
1,
|
||||
GAME_COMMAND_FLAG_APPLY,
|
||||
w->number,
|
||||
banner->colour,
|
||||
GAME_COMMAND_SET_BANNER_STYLE,
|
||||
banner->text_colour,
|
||||
1, GAME_COMMAND_FLAG_APPLY, w->number, banner->colour, GAME_COMMAND_SET_BANNER_STYLE, banner->text_colour,
|
||||
banner->flags ^ BANNER_FLAG_NO_ENTRY);
|
||||
break;
|
||||
}
|
||||
@@ -247,14 +228,8 @@ static void window_banner_mousedown(rct_window* w, rct_widgetindex widgetIndex,
|
||||
widget--;
|
||||
|
||||
window_dropdown_show_text_custom_width(
|
||||
widget->left + w->x,
|
||||
widget->top + w->y,
|
||||
widget->bottom - widget->top + 1,
|
||||
w->colours[1],
|
||||
0,
|
||||
DROPDOWN_FLAG_STAY_OPEN,
|
||||
13,
|
||||
widget->right - widget->left - 3);
|
||||
widget->left + w->x, widget->top + w->y, widget->bottom - widget->top + 1, w->colours[1], 0,
|
||||
DROPDOWN_FLAG_STAY_OPEN, 13, widget->right - widget->left - 3);
|
||||
|
||||
dropdown_set_checked(banner->text_colour - 1, true);
|
||||
break;
|
||||
@@ -276,12 +251,7 @@ static void window_banner_dropdown(rct_window* w, rct_widgetindex widgetIndex, i
|
||||
break;
|
||||
|
||||
game_do_command(
|
||||
1,
|
||||
GAME_COMMAND_FLAG_APPLY,
|
||||
w->number,
|
||||
dropdownIndex,
|
||||
GAME_COMMAND_SET_BANNER_STYLE,
|
||||
banner->text_colour,
|
||||
1, GAME_COMMAND_FLAG_APPLY, w->number, dropdownIndex, GAME_COMMAND_SET_BANNER_STYLE, banner->text_colour,
|
||||
banner->flags);
|
||||
break;
|
||||
case WIDX_TEXT_COLOUR_DROPDOWN_BUTTON:
|
||||
@@ -289,12 +259,7 @@ static void window_banner_dropdown(rct_window* w, rct_widgetindex widgetIndex, i
|
||||
break;
|
||||
|
||||
game_do_command(
|
||||
1,
|
||||
GAME_COMMAND_FLAG_APPLY,
|
||||
w->number,
|
||||
banner->colour,
|
||||
GAME_COMMAND_SET_BANNER_STYLE,
|
||||
dropdownIndex + 1,
|
||||
1, GAME_COMMAND_FLAG_APPLY, w->number, banner->colour, GAME_COMMAND_SET_BANNER_STYLE, dropdownIndex + 1,
|
||||
banner->flags);
|
||||
break;
|
||||
}
|
||||
@@ -379,17 +344,8 @@ static void window_banner_viewport_rotate(rct_window* w)
|
||||
// Create viewport
|
||||
rct_widget* viewportWidget = &window_banner_widgets[WIDX_VIEWPORT];
|
||||
viewport_create(
|
||||
w,
|
||||
w->x + viewportWidget->left + 1,
|
||||
w->y + viewportWidget->top + 1,
|
||||
(viewportWidget->right - viewportWidget->left) - 1,
|
||||
(viewportWidget->bottom - viewportWidget->top) - 1,
|
||||
0,
|
||||
view_x,
|
||||
view_y,
|
||||
view_z,
|
||||
0,
|
||||
-1);
|
||||
w, w->x + viewportWidget->left + 1, w->y + viewportWidget->top + 1, (viewportWidget->right - viewportWidget->left) - 1,
|
||||
(viewportWidget->bottom - viewportWidget->top) - 1, 0, view_x, view_y, view_z, 0, -1);
|
||||
|
||||
w->viewport->flags = gConfigGeneral.always_show_gridlines ? VIEWPORT_FLAG_GRIDLINES : 0;
|
||||
window_invalidate(w);
|
||||
|
||||
@@ -718,14 +718,8 @@ static void window_cheats_misc_mousedown(rct_window* w, rct_widgetindex widgetIn
|
||||
gDropdownItemsArgs[i] = WeatherTypes[i];
|
||||
}
|
||||
window_dropdown_show_text_custom_width(
|
||||
w->x + dropdownWidget->left,
|
||||
w->y + dropdownWidget->top,
|
||||
dropdownWidget->bottom - dropdownWidget->top + 1,
|
||||
w->colours[1],
|
||||
0,
|
||||
DROPDOWN_FLAG_STAY_OPEN,
|
||||
6,
|
||||
dropdownWidget->right - dropdownWidget->left - 3);
|
||||
w->x + dropdownWidget->left, w->y + dropdownWidget->top, dropdownWidget->bottom - dropdownWidget->top + 1,
|
||||
w->colours[1], 0, DROPDOWN_FLAG_STAY_OPEN, 6, dropdownWidget->right - dropdownWidget->left - 3);
|
||||
|
||||
currentWeather = gClimateCurrent.Weather;
|
||||
dropdown_set_checked(currentWeather, true);
|
||||
@@ -744,14 +738,8 @@ static void window_cheats_misc_mousedown(rct_window* w, rct_widgetindex widgetIn
|
||||
}
|
||||
|
||||
window_dropdown_show_text_custom_width(
|
||||
w->x + dropdownWidget->left,
|
||||
w->y + dropdownWidget->top,
|
||||
dropdownWidget->bottom - dropdownWidget->top + 1,
|
||||
w->colours[1],
|
||||
0,
|
||||
DROPDOWN_FLAG_STAY_OPEN,
|
||||
3,
|
||||
dropdownWidget->right - dropdownWidget->left - 3);
|
||||
w->x + dropdownWidget->left, w->y + dropdownWidget->top, dropdownWidget->bottom - dropdownWidget->top + 1,
|
||||
w->colours[1], 0, DROPDOWN_FLAG_STAY_OPEN, 3, dropdownWidget->right - dropdownWidget->left - 3);
|
||||
dropdown_set_checked(_selectedStaffSpeed, true);
|
||||
}
|
||||
}
|
||||
@@ -830,13 +818,8 @@ static void window_cheats_guests_mouseup(rct_window* w, rct_widgetindex widgetIn
|
||||
break;
|
||||
case WIDX_GUEST_HAPPINESS_MAX:
|
||||
game_do_command(
|
||||
0,
|
||||
GAME_COMMAND_FLAG_APPLY,
|
||||
CHEAT_SETGUESTPARAMETER,
|
||||
GUEST_PARAMETER_HAPPINESS,
|
||||
GAME_COMMAND_CHEAT,
|
||||
PEEP_MAX_HAPPINESS,
|
||||
0);
|
||||
0, GAME_COMMAND_FLAG_APPLY, CHEAT_SETGUESTPARAMETER, GUEST_PARAMETER_HAPPINESS, GAME_COMMAND_CHEAT,
|
||||
PEEP_MAX_HAPPINESS, 0);
|
||||
break;
|
||||
case WIDX_GUEST_HAPPINESS_MIN:
|
||||
game_do_command(
|
||||
@@ -844,23 +827,13 @@ static void window_cheats_guests_mouseup(rct_window* w, rct_widgetindex widgetIn
|
||||
break;
|
||||
case WIDX_GUEST_ENERGY_MAX:
|
||||
game_do_command(
|
||||
0,
|
||||
GAME_COMMAND_FLAG_APPLY,
|
||||
CHEAT_SETGUESTPARAMETER,
|
||||
GUEST_PARAMETER_ENERGY,
|
||||
GAME_COMMAND_CHEAT,
|
||||
PEEP_MAX_ENERGY,
|
||||
0);
|
||||
0, GAME_COMMAND_FLAG_APPLY, CHEAT_SETGUESTPARAMETER, GUEST_PARAMETER_ENERGY, GAME_COMMAND_CHEAT,
|
||||
PEEP_MAX_ENERGY, 0);
|
||||
break;
|
||||
case WIDX_GUEST_ENERGY_MIN:
|
||||
game_do_command(
|
||||
0,
|
||||
GAME_COMMAND_FLAG_APPLY,
|
||||
CHEAT_SETGUESTPARAMETER,
|
||||
GUEST_PARAMETER_ENERGY,
|
||||
GAME_COMMAND_CHEAT,
|
||||
PEEP_MIN_ENERGY,
|
||||
0);
|
||||
0, GAME_COMMAND_FLAG_APPLY, CHEAT_SETGUESTPARAMETER, GUEST_PARAMETER_ENERGY, GAME_COMMAND_CHEAT,
|
||||
PEEP_MIN_ENERGY, 0);
|
||||
break;
|
||||
case WIDX_GUEST_HUNGER_MAX:
|
||||
game_do_command(
|
||||
@@ -888,23 +861,13 @@ static void window_cheats_guests_mouseup(rct_window* w, rct_widgetindex widgetIn
|
||||
break;
|
||||
case WIDX_GUEST_NAUSEA_TOLERANCE_MAX:
|
||||
game_do_command(
|
||||
0,
|
||||
GAME_COMMAND_FLAG_APPLY,
|
||||
CHEAT_SETGUESTPARAMETER,
|
||||
GUEST_PARAMETER_NAUSEA_TOLERANCE,
|
||||
GAME_COMMAND_CHEAT,
|
||||
PEEP_NAUSEA_TOLERANCE_HIGH,
|
||||
0);
|
||||
0, GAME_COMMAND_FLAG_APPLY, CHEAT_SETGUESTPARAMETER, GUEST_PARAMETER_NAUSEA_TOLERANCE, GAME_COMMAND_CHEAT,
|
||||
PEEP_NAUSEA_TOLERANCE_HIGH, 0);
|
||||
break;
|
||||
case WIDX_GUEST_NAUSEA_TOLERANCE_MIN:
|
||||
game_do_command(
|
||||
0,
|
||||
GAME_COMMAND_FLAG_APPLY,
|
||||
CHEAT_SETGUESTPARAMETER,
|
||||
GUEST_PARAMETER_NAUSEA_TOLERANCE,
|
||||
GAME_COMMAND_CHEAT,
|
||||
PEEP_NAUSEA_TOLERANCE_NONE,
|
||||
0);
|
||||
0, GAME_COMMAND_FLAG_APPLY, CHEAT_SETGUESTPARAMETER, GUEST_PARAMETER_NAUSEA_TOLERANCE, GAME_COMMAND_CHEAT,
|
||||
PEEP_NAUSEA_TOLERANCE_NONE, 0);
|
||||
break;
|
||||
case WIDX_GUEST_BATHROOM_MAX:
|
||||
game_do_command(
|
||||
@@ -916,23 +879,13 @@ static void window_cheats_guests_mouseup(rct_window* w, rct_widgetindex widgetIn
|
||||
break;
|
||||
case WIDX_GUEST_RIDE_INTENSITY_MORE_THAN_1:
|
||||
game_do_command(
|
||||
0,
|
||||
GAME_COMMAND_FLAG_APPLY,
|
||||
CHEAT_SETGUESTPARAMETER,
|
||||
GUEST_PARAMETER_PREFERRED_RIDE_INTENSITY,
|
||||
GAME_COMMAND_CHEAT,
|
||||
1,
|
||||
0);
|
||||
0, GAME_COMMAND_FLAG_APPLY, CHEAT_SETGUESTPARAMETER, GUEST_PARAMETER_PREFERRED_RIDE_INTENSITY,
|
||||
GAME_COMMAND_CHEAT, 1, 0);
|
||||
break;
|
||||
case WIDX_GUEST_RIDE_INTENSITY_LESS_THAN_15:
|
||||
game_do_command(
|
||||
0,
|
||||
GAME_COMMAND_FLAG_APPLY,
|
||||
CHEAT_SETGUESTPARAMETER,
|
||||
GUEST_PARAMETER_PREFERRED_RIDE_INTENSITY,
|
||||
GAME_COMMAND_CHEAT,
|
||||
0,
|
||||
0);
|
||||
0, GAME_COMMAND_FLAG_APPLY, CHEAT_SETGUESTPARAMETER, GUEST_PARAMETER_PREFERRED_RIDE_INTENSITY,
|
||||
GAME_COMMAND_CHEAT, 0, 0);
|
||||
break;
|
||||
case WIDX_TRAM_GUESTS:
|
||||
game_do_command(0, GAME_COMMAND_FLAG_APPLY, CHEAT_GENERATEGUESTS, CHEATS_TRAM_INCREMENT, GAME_COMMAND_CHEAT, 0, 0);
|
||||
@@ -1091,12 +1044,7 @@ static void window_cheats_rides_mouseup(rct_window* w, rct_widgetindex widgetInd
|
||||
break;
|
||||
case WIDX_SHOW_ALL_OPERATING_MODES:
|
||||
game_do_command(
|
||||
0,
|
||||
GAME_COMMAND_FLAG_APPLY,
|
||||
CHEAT_SHOWALLOPERATINGMODES,
|
||||
!gCheatsShowAllOperatingModes,
|
||||
GAME_COMMAND_CHEAT,
|
||||
0,
|
||||
0, GAME_COMMAND_FLAG_APPLY, CHEAT_SHOWALLOPERATINGMODES, !gCheatsShowAllOperatingModes, GAME_COMMAND_CHEAT, 0,
|
||||
0);
|
||||
if (gCheatsShowAllOperatingModes)
|
||||
{
|
||||
@@ -1105,13 +1053,8 @@ static void window_cheats_rides_mouseup(rct_window* w, rct_widgetindex widgetInd
|
||||
break;
|
||||
case WIDX_SHOW_VEHICLES_FROM_OTHER_TRACK_TYPES:
|
||||
game_do_command(
|
||||
0,
|
||||
GAME_COMMAND_FLAG_APPLY,
|
||||
CHEAT_SHOWVEHICLESFROMOTHERTRACKTYPES,
|
||||
!gCheatsShowVehiclesFromOtherTrackTypes,
|
||||
GAME_COMMAND_CHEAT,
|
||||
0,
|
||||
0);
|
||||
0, GAME_COMMAND_FLAG_APPLY, CHEAT_SHOWVEHICLESFROMOTHERTRACKTYPES, !gCheatsShowVehiclesFromOtherTrackTypes,
|
||||
GAME_COMMAND_CHEAT, 0, 0);
|
||||
if (gCheatsShowVehiclesFromOtherTrackTypes)
|
||||
{
|
||||
context_show_error(STR_WARNING_IN_CAPS, STR_THIS_FEATURE_IS_CURRENTLY_UNSTABLE);
|
||||
@@ -1119,13 +1062,8 @@ static void window_cheats_rides_mouseup(rct_window* w, rct_widgetindex widgetInd
|
||||
break;
|
||||
case WIDX_DISABLE_TRAIN_LENGTH_LIMITS:
|
||||
game_do_command(
|
||||
0,
|
||||
GAME_COMMAND_FLAG_APPLY,
|
||||
CHEAT_DISABLETRAINLENGTHLIMIT,
|
||||
!gCheatsDisableTrainLengthLimit,
|
||||
GAME_COMMAND_CHEAT,
|
||||
0,
|
||||
0);
|
||||
0, GAME_COMMAND_FLAG_APPLY, CHEAT_DISABLETRAINLENGTHLIMIT, !gCheatsDisableTrainLengthLimit, GAME_COMMAND_CHEAT,
|
||||
0, 0);
|
||||
if (gCheatsDisableTrainLengthLimit)
|
||||
{
|
||||
context_show_error(STR_WARNING_IN_CAPS, STR_THIS_FEATURE_IS_CURRENTLY_UNSTABLE);
|
||||
@@ -1133,23 +1071,13 @@ static void window_cheats_rides_mouseup(rct_window* w, rct_widgetindex widgetInd
|
||||
break;
|
||||
case WIDX_ENABLE_CHAIN_LIFT_ON_ALL_TRACK:
|
||||
game_do_command(
|
||||
0,
|
||||
GAME_COMMAND_FLAG_APPLY,
|
||||
CHEAT_ENABLECHAINLIFTONALLTRACK,
|
||||
!gCheatsEnableChainLiftOnAllTrack,
|
||||
GAME_COMMAND_CHEAT,
|
||||
0,
|
||||
0);
|
||||
0, GAME_COMMAND_FLAG_APPLY, CHEAT_ENABLECHAINLIFTONALLTRACK, !gCheatsEnableChainLiftOnAllTrack,
|
||||
GAME_COMMAND_CHEAT, 0, 0);
|
||||
break;
|
||||
case WIDX_ENABLE_ARBITRARY_RIDE_TYPE_CHANGES:
|
||||
game_do_command(
|
||||
0,
|
||||
GAME_COMMAND_FLAG_APPLY,
|
||||
CHEAT_ALLOW_ARBITRARY_RIDE_TYPE_CHANGES,
|
||||
!gCheatsAllowArbitraryRideTypeChanges,
|
||||
GAME_COMMAND_CHEAT,
|
||||
0,
|
||||
0);
|
||||
0, GAME_COMMAND_FLAG_APPLY, CHEAT_ALLOW_ARBITRARY_RIDE_TYPE_CHANGES, !gCheatsAllowArbitraryRideTypeChanges,
|
||||
GAME_COMMAND_CHEAT, 0, 0);
|
||||
if (gCheatsAllowArbitraryRideTypeChanges)
|
||||
{
|
||||
context_show_error(STR_WARNING_IN_CAPS, STR_THIS_FEATURE_IS_CURRENTLY_UNSTABLE);
|
||||
@@ -1157,12 +1085,7 @@ static void window_cheats_rides_mouseup(rct_window* w, rct_widgetindex widgetInd
|
||||
break;
|
||||
case WIDX_DISABLE_RIDE_VALUE_AGING:
|
||||
game_do_command(
|
||||
0,
|
||||
GAME_COMMAND_FLAG_APPLY,
|
||||
CHEAT_DISABLERIDEVALUEAGING,
|
||||
!gCheatsDisableRideValueAging,
|
||||
GAME_COMMAND_CHEAT,
|
||||
0,
|
||||
0, GAME_COMMAND_FLAG_APPLY, CHEAT_DISABLERIDEVALUEAGING, !gCheatsDisableRideValueAging, GAME_COMMAND_CHEAT, 0,
|
||||
0);
|
||||
break;
|
||||
case WIDX_IGNORE_RESEARCH_STATUS:
|
||||
@@ -1171,13 +1094,8 @@ static void window_cheats_rides_mouseup(rct_window* w, rct_widgetindex widgetInd
|
||||
break;
|
||||
case WIDX_ENABLE_ALL_DRAWABLE_TRACK_PIECES:
|
||||
game_do_command(
|
||||
0,
|
||||
GAME_COMMAND_FLAG_APPLY,
|
||||
CHEAT_ENABLEALLDRAWABLETRACKPIECES,
|
||||
!gCheatsEnableAllDrawableTrackPieces,
|
||||
GAME_COMMAND_CHEAT,
|
||||
0,
|
||||
0);
|
||||
0, GAME_COMMAND_FLAG_APPLY, CHEAT_ENABLEALLDRAWABLETRACKPIECES, !gCheatsEnableAllDrawableTrackPieces,
|
||||
GAME_COMMAND_CHEAT, 0, 0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1314,11 +1232,7 @@ static void window_cheats_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
||||
gfx_draw_string_left(dpi, STR_CHEAT_STAFF_SPEED, nullptr, COLOUR_BLACK, w->x + XPL(0) + TXTO, w->y + YPL(17) + TXTO);
|
||||
gfx_draw_string_left(dpi, STR_FORCE_WEATHER, nullptr, COLOUR_BLACK, w->x + XPL(0) + TXTO, w->y + YPL(10) + TXTO);
|
||||
gfx_draw_string_right(
|
||||
dpi,
|
||||
STR_FORMAT_INTEGER,
|
||||
&park_rating_spinner_value,
|
||||
w->colours[1],
|
||||
w->x + WPL(1) - 34 - TXTO,
|
||||
dpi, STR_FORMAT_INTEGER, &park_rating_spinner_value, w->colours[1], w->x + WPL(1) - 34 - TXTO,
|
||||
w->y + YPL(5) + TXTO);
|
||||
}
|
||||
else if (w->page == WINDOW_CHEATS_PAGE_GUESTS)
|
||||
|
||||
@@ -138,14 +138,8 @@ static void custom_currency_window_mousedown(rct_window* w, rct_widgetindex widg
|
||||
gDropdownItemsArgs[1] = STR_SUFFIX;
|
||||
|
||||
window_dropdown_show_text_custom_width(
|
||||
w->x + widget->left,
|
||||
w->y + widget->top,
|
||||
widget->bottom - widget->top + 1,
|
||||
w->colours[1],
|
||||
0,
|
||||
DROPDOWN_FLAG_STAY_OPEN,
|
||||
2,
|
||||
widget->right - widget->left - 3);
|
||||
w->x + widget->left, w->y + widget->top, widget->bottom - widget->top + 1, w->colours[1], 0,
|
||||
DROPDOWN_FLAG_STAY_OPEN, 2, widget->right - widget->left - 3);
|
||||
|
||||
if (CurrencyDescriptors[CURRENCY_CUSTOM].affix_unicode == CURRENCY_PREFIX)
|
||||
{
|
||||
@@ -160,12 +154,8 @@ static void custom_currency_window_mousedown(rct_window* w, rct_widgetindex widg
|
||||
|
||||
case WIDX_SYMBOL_TEXT:
|
||||
window_text_input_raw_open(
|
||||
w,
|
||||
WIDX_SYMBOL_TEXT,
|
||||
STR_CUSTOM_CURRENCY_SYMBOL_INPUT_TITLE,
|
||||
STR_CUSTOM_CURRENCY_SYMBOL_INPUT_DESC,
|
||||
CurrencyDescriptors[CURRENCY_CUSTOM].symbol_unicode,
|
||||
CURRENCY_SYMBOL_MAX_SIZE);
|
||||
w, WIDX_SYMBOL_TEXT, STR_CUSTOM_CURRENCY_SYMBOL_INPUT_TITLE, STR_CUSTOM_CURRENCY_SYMBOL_INPUT_DESC,
|
||||
CurrencyDescriptors[CURRENCY_CUSTOM].symbol_unicode, CURRENCY_SYMBOL_MAX_SIZE);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -176,13 +166,8 @@ static void custom_currency_window_mouseup(rct_window* w, rct_widgetindex widget
|
||||
{
|
||||
case WIDX_RATE:
|
||||
window_text_input_open(
|
||||
w,
|
||||
WIDX_RATE,
|
||||
STR_RATE_INPUT_TITLE,
|
||||
STR_RATE_INPUT_DESC,
|
||||
STR_FORMAT_INTEGER,
|
||||
(uint32_t)CurrencyDescriptors[CURRENCY_CUSTOM].rate,
|
||||
CURRENCY_RATE_MAX_NUM_DIGITS);
|
||||
w, WIDX_RATE, STR_RATE_INPUT_TITLE, STR_RATE_INPUT_DESC, STR_FORMAT_INTEGER,
|
||||
(uint32_t)CurrencyDescriptors[CURRENCY_CUSTOM].rate, CURRENCY_RATE_MAX_NUM_DIGITS);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -224,8 +209,7 @@ static void custom_currency_window_text_input([[maybe_unused]] struct rct_window
|
||||
safe_strcpy(CurrencyDescriptors[CURRENCY_CUSTOM].symbol_unicode, text, CURRENCY_SYMBOL_MAX_SIZE);
|
||||
|
||||
safe_strcpy(
|
||||
gConfigGeneral.custom_currency_symbol,
|
||||
CurrencyDescriptors[CURRENCY_CUSTOM].symbol_unicode,
|
||||
gConfigGeneral.custom_currency_symbol, CurrencyDescriptors[CURRENCY_CUSTOM].symbol_unicode,
|
||||
CURRENCY_SYMBOL_MAX_SIZE);
|
||||
|
||||
config_save_default();
|
||||
@@ -267,30 +251,20 @@ static void custom_currency_window_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
||||
gfx_draw_string_left(dpi, STR_CURRENCY_SYMBOL_TEXT, nullptr, w->colours[1], x, y);
|
||||
|
||||
gfx_draw_string(
|
||||
dpi,
|
||||
CurrencyDescriptors[CURRENCY_CUSTOM].symbol_unicode,
|
||||
w->colours[1],
|
||||
dpi, CurrencyDescriptors[CURRENCY_CUSTOM].symbol_unicode, w->colours[1],
|
||||
w->x + window_custom_currency_widgets[WIDX_SYMBOL_TEXT].left + 1,
|
||||
w->y + window_custom_currency_widgets[WIDX_SYMBOL_TEXT].top);
|
||||
|
||||
if (CurrencyDescriptors[CURRENCY_CUSTOM].affix_unicode == CURRENCY_PREFIX)
|
||||
{
|
||||
gfx_draw_string_left(
|
||||
dpi,
|
||||
STR_PREFIX,
|
||||
w,
|
||||
w->colours[1],
|
||||
w->x + window_custom_currency_widgets[WIDX_AFFIX_DROPDOWN].left + 1,
|
||||
dpi, STR_PREFIX, w, w->colours[1], w->x + window_custom_currency_widgets[WIDX_AFFIX_DROPDOWN].left + 1,
|
||||
w->y + window_custom_currency_widgets[WIDX_AFFIX_DROPDOWN].top);
|
||||
}
|
||||
else
|
||||
{
|
||||
gfx_draw_string_left(
|
||||
dpi,
|
||||
STR_SUFFIX,
|
||||
w,
|
||||
w->colours[1],
|
||||
w->x + window_custom_currency_widgets[WIDX_AFFIX_DROPDOWN].left + 1,
|
||||
dpi, STR_SUFFIX, w, w->colours[1], w->x + window_custom_currency_widgets[WIDX_AFFIX_DROPDOWN].left + 1,
|
||||
w->y + window_custom_currency_widgets[WIDX_AFFIX_DROPDOWN].top);
|
||||
}
|
||||
}
|
||||
@@ -90,13 +90,8 @@ rct_window* window_debug_paint_open()
|
||||
return window;
|
||||
|
||||
window = window_create(
|
||||
16,
|
||||
context_get_height() - 16 - 33 - WINDOW_HEIGHT,
|
||||
WINDOW_WIDTH,
|
||||
WINDOW_HEIGHT,
|
||||
&window_debug_paint_events,
|
||||
WC_DEBUG_PAINT,
|
||||
WF_STICK_TO_FRONT | WF_TRANSPARENT);
|
||||
16, context_get_height() - 16 - 33 - WINDOW_HEIGHT, WINDOW_WIDTH, WINDOW_HEIGHT, &window_debug_paint_events,
|
||||
WC_DEBUG_PAINT, WF_STICK_TO_FRONT | WF_TRANSPARENT);
|
||||
|
||||
window->widgets = window_debug_paint_widgets;
|
||||
window->enabled_widgets = (1 << WIDX_TOGGLE_SHOW_WIDE_PATHS) | (1 << WIDX_TOGGLE_SHOW_BLOCKED_TILES)
|
||||
|
||||
@@ -207,13 +207,8 @@ void window_dropdown_show_text_custom_width(
|
||||
|
||||
// Create the window
|
||||
w = window_create(
|
||||
x,
|
||||
y + extray,
|
||||
window_dropdown_widgets[WIDX_BACKGROUND].right + 1,
|
||||
window_dropdown_widgets[WIDX_BACKGROUND].bottom + 1,
|
||||
&window_dropdown_events,
|
||||
WC_DROPDOWN,
|
||||
WF_STICK_TO_FRONT);
|
||||
x, y + extray, window_dropdown_widgets[WIDX_BACKGROUND].right + 1, window_dropdown_widgets[WIDX_BACKGROUND].bottom + 1,
|
||||
&window_dropdown_events, WC_DROPDOWN, WF_STICK_TO_FRONT);
|
||||
w->widgets = window_dropdown_widgets;
|
||||
if (colour & COLOUR_FLAG_TRANSLUCENT)
|
||||
w->flags |= WF_TRANSPARENT;
|
||||
@@ -243,15 +238,8 @@ void window_dropdown_show_text_custom_width(
|
||||
* @param numColumns (bl)
|
||||
*/
|
||||
void window_dropdown_show_image(
|
||||
int32_t x,
|
||||
int32_t y,
|
||||
int32_t extray,
|
||||
uint8_t colour,
|
||||
uint8_t flags,
|
||||
int32_t numItems,
|
||||
int32_t itemWidth,
|
||||
int32_t itemHeight,
|
||||
int32_t numColumns)
|
||||
int32_t x, int32_t y, int32_t extray, uint8_t colour, uint8_t flags, int32_t numItems, int32_t itemWidth,
|
||||
int32_t itemHeight, int32_t numColumns)
|
||||
{
|
||||
int32_t width, height;
|
||||
rct_window* w;
|
||||
@@ -299,13 +287,8 @@ void window_dropdown_show_image(
|
||||
|
||||
// Create the window
|
||||
w = window_create(
|
||||
x,
|
||||
y + extray,
|
||||
window_dropdown_widgets[WIDX_BACKGROUND].right + 1,
|
||||
window_dropdown_widgets[WIDX_BACKGROUND].bottom + 1,
|
||||
&window_dropdown_events,
|
||||
WC_DROPDOWN,
|
||||
WF_STICK_TO_FRONT);
|
||||
x, y + extray, window_dropdown_widgets[WIDX_BACKGROUND].right + 1, window_dropdown_widgets[WIDX_BACKGROUND].bottom + 1,
|
||||
&window_dropdown_events, WC_DROPDOWN, WF_STICK_TO_FRONT);
|
||||
w->widgets = window_dropdown_widgets;
|
||||
if (colour & COLOUR_FLAG_TRANSLUCENT)
|
||||
w->flags |= WF_TRANSPARENT;
|
||||
@@ -409,13 +392,8 @@ static void window_dropdown_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
||||
|
||||
// Draw item string
|
||||
gfx_draw_string_left_clipped(
|
||||
dpi,
|
||||
item,
|
||||
(void*)(&gDropdownItemsArgs[i]),
|
||||
colour,
|
||||
w->x + 2 + (cell_x * _dropdown_item_width),
|
||||
w->y + 2 + (cell_y * _dropdown_item_height),
|
||||
w->width - 5);
|
||||
dpi, item, (void*)(&gDropdownItemsArgs[i]), colour, w->x + 2 + (cell_x * _dropdown_item_width),
|
||||
w->y + 2 + (cell_y * _dropdown_item_height), w->width - 5);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -476,15 +454,8 @@ void window_dropdown_show_colour(rct_window* w, rct_widget* widget, uint8_t drop
|
||||
|
||||
// Show dropdown
|
||||
window_dropdown_show_image(
|
||||
w->x + widget->left,
|
||||
w->y + widget->top,
|
||||
widget->bottom - widget->top + 1,
|
||||
dropdownColour,
|
||||
DROPDOWN_FLAG_STAY_OPEN,
|
||||
COLOUR_COUNT,
|
||||
12,
|
||||
12,
|
||||
gAppropriateImageDropdownItemsPerRow[COLOUR_COUNT]);
|
||||
w->x + widget->left, w->y + widget->top, widget->bottom - widget->top + 1, dropdownColour, DROPDOWN_FLAG_STAY_OPEN,
|
||||
COLOUR_COUNT, 12, 12, gAppropriateImageDropdownItemsPerRow[COLOUR_COUNT]);
|
||||
|
||||
gDropdownIsColour = true;
|
||||
gDropdownLastColourHover = -1;
|
||||
|
||||
@@ -129,12 +129,7 @@ static constexpr const rct_string_id EditorStepNames[] = {
|
||||
rct_window* window_editor_bottom_toolbar_open()
|
||||
{
|
||||
rct_window* window = window_create(
|
||||
0,
|
||||
context_get_height() - 32,
|
||||
context_get_width(),
|
||||
32,
|
||||
&window_editor_bottom_toolbar_events,
|
||||
WC_BOTTOM_TOOLBAR,
|
||||
0, context_get_height() - 32, context_get_width(), 32, &window_editor_bottom_toolbar_events, WC_BOTTOM_TOOLBAR,
|
||||
WF_STICK_TO_FRONT | WF_TRANSPARENT | WF_NO_BACKGROUND);
|
||||
window->widgets = window_editor_bottom_toolbar_widgets;
|
||||
|
||||
@@ -424,23 +419,19 @@ void window_editor_bottom_toolbar_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
||||
if (drawPreviousButton)
|
||||
{
|
||||
gfx_filter_rect(
|
||||
dpi,
|
||||
window_editor_bottom_toolbar_widgets[WIDX_PREVIOUS_IMAGE].left + w->x,
|
||||
dpi, window_editor_bottom_toolbar_widgets[WIDX_PREVIOUS_IMAGE].left + w->x,
|
||||
window_editor_bottom_toolbar_widgets[WIDX_PREVIOUS_IMAGE].top + w->y,
|
||||
window_editor_bottom_toolbar_widgets[WIDX_PREVIOUS_IMAGE].right + w->x,
|
||||
window_editor_bottom_toolbar_widgets[WIDX_PREVIOUS_IMAGE].bottom + w->y,
|
||||
PALETTE_51);
|
||||
window_editor_bottom_toolbar_widgets[WIDX_PREVIOUS_IMAGE].bottom + w->y, PALETTE_51);
|
||||
}
|
||||
|
||||
if ((drawPreviousButton || drawNextButton) && gS6Info.editor_step != EDITOR_STEP_ROLLERCOASTER_DESIGNER)
|
||||
{
|
||||
gfx_filter_rect(
|
||||
dpi,
|
||||
window_editor_bottom_toolbar_widgets[WIDX_NEXT_IMAGE].left + w->x,
|
||||
dpi, window_editor_bottom_toolbar_widgets[WIDX_NEXT_IMAGE].left + w->x,
|
||||
window_editor_bottom_toolbar_widgets[WIDX_NEXT_IMAGE].top + w->y,
|
||||
window_editor_bottom_toolbar_widgets[WIDX_NEXT_IMAGE].right + w->x,
|
||||
window_editor_bottom_toolbar_widgets[WIDX_NEXT_IMAGE].bottom + w->y,
|
||||
PALETTE_51);
|
||||
window_editor_bottom_toolbar_widgets[WIDX_NEXT_IMAGE].bottom + w->y, PALETTE_51);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -451,25 +442,19 @@ void window_editor_bottom_toolbar_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
||||
if (drawPreviousButton)
|
||||
{
|
||||
gfx_fill_rect_inset(
|
||||
dpi,
|
||||
window_editor_bottom_toolbar_widgets[WIDX_PREVIOUS_IMAGE].left + 1 + w->x,
|
||||
dpi, window_editor_bottom_toolbar_widgets[WIDX_PREVIOUS_IMAGE].left + 1 + w->x,
|
||||
window_editor_bottom_toolbar_widgets[WIDX_PREVIOUS_IMAGE].top + 1 + w->y,
|
||||
window_editor_bottom_toolbar_widgets[WIDX_PREVIOUS_IMAGE].right - 1 + w->x,
|
||||
window_editor_bottom_toolbar_widgets[WIDX_PREVIOUS_IMAGE].bottom - 1 + w->y,
|
||||
w->colours[1],
|
||||
INSET_RECT_F_30);
|
||||
window_editor_bottom_toolbar_widgets[WIDX_PREVIOUS_IMAGE].bottom - 1 + w->y, w->colours[1], INSET_RECT_F_30);
|
||||
}
|
||||
|
||||
if ((drawPreviousButton || drawNextButton) && gS6Info.editor_step != EDITOR_STEP_ROLLERCOASTER_DESIGNER)
|
||||
{
|
||||
gfx_fill_rect_inset(
|
||||
dpi,
|
||||
window_editor_bottom_toolbar_widgets[WIDX_NEXT_IMAGE].left + 1 + w->x,
|
||||
dpi, window_editor_bottom_toolbar_widgets[WIDX_NEXT_IMAGE].left + 1 + w->x,
|
||||
window_editor_bottom_toolbar_widgets[WIDX_NEXT_IMAGE].top + 1 + w->y,
|
||||
window_editor_bottom_toolbar_widgets[WIDX_NEXT_IMAGE].right - 1 + w->x,
|
||||
window_editor_bottom_toolbar_widgets[WIDX_NEXT_IMAGE].bottom - 1 + w->y,
|
||||
w->colours[1],
|
||||
INSET_RECT_F_30);
|
||||
window_editor_bottom_toolbar_widgets[WIDX_NEXT_IMAGE].bottom - 1 + w->y, w->colours[1], INSET_RECT_F_30);
|
||||
}
|
||||
|
||||
int16_t stateX = (window_editor_bottom_toolbar_widgets[WIDX_PREVIOUS_IMAGE].right
|
||||
@@ -478,21 +463,14 @@ void window_editor_bottom_toolbar_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
||||
+ w->x;
|
||||
int16_t stateY = w->height - 0x0C + w->y;
|
||||
gfx_draw_string_centred(
|
||||
dpi,
|
||||
EditorStepNames[gS6Info.editor_step],
|
||||
stateX,
|
||||
stateY,
|
||||
NOT_TRANSLUCENT(w->colours[2]) | COLOUR_FLAG_OUTLINE,
|
||||
dpi, EditorStepNames[gS6Info.editor_step], stateX, stateY, NOT_TRANSLUCENT(w->colours[2]) | COLOUR_FLAG_OUTLINE,
|
||||
nullptr);
|
||||
|
||||
if (drawPreviousButton)
|
||||
{
|
||||
gfx_draw_sprite(
|
||||
dpi,
|
||||
SPR_PREVIOUS,
|
||||
window_editor_bottom_toolbar_widgets[WIDX_PREVIOUS_IMAGE].left + 6 + w->x,
|
||||
window_editor_bottom_toolbar_widgets[WIDX_PREVIOUS_IMAGE].top + 6 + w->y,
|
||||
0);
|
||||
dpi, SPR_PREVIOUS, window_editor_bottom_toolbar_widgets[WIDX_PREVIOUS_IMAGE].left + 6 + w->x,
|
||||
window_editor_bottom_toolbar_widgets[WIDX_PREVIOUS_IMAGE].top + 6 + w->y, 0);
|
||||
|
||||
int32_t textColour = NOT_TRANSLUCENT(w->colours[1]);
|
||||
if (gHoverWidget.window_classification == WC_BOTTOM_TOOLBAR
|
||||
@@ -518,11 +496,8 @@ void window_editor_bottom_toolbar_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
||||
if ((drawPreviousButton || drawNextButton) && gS6Info.editor_step != EDITOR_STEP_ROLLERCOASTER_DESIGNER)
|
||||
{
|
||||
gfx_draw_sprite(
|
||||
dpi,
|
||||
SPR_NEXT,
|
||||
window_editor_bottom_toolbar_widgets[WIDX_NEXT_IMAGE].right - 29 + w->x,
|
||||
window_editor_bottom_toolbar_widgets[WIDX_NEXT_IMAGE].top + 6 + w->y,
|
||||
0);
|
||||
dpi, SPR_NEXT, window_editor_bottom_toolbar_widgets[WIDX_NEXT_IMAGE].right - 29 + w->x,
|
||||
window_editor_bottom_toolbar_widgets[WIDX_NEXT_IMAGE].top + 6 + w->y, 0);
|
||||
|
||||
int32_t textColour = NOT_TRANSLUCENT(w->colours[1]);
|
||||
|
||||
|
||||
@@ -669,11 +669,7 @@ static void window_editor_inventions_list_paint(rct_window* w, rct_drawpixelinfo
|
||||
// Preview background
|
||||
widget = &w->widgets[WIDX_PREVIEW];
|
||||
gfx_fill_rect(
|
||||
dpi,
|
||||
w->x + widget->left + 1,
|
||||
w->y + widget->top + 1,
|
||||
w->x + widget->right - 1,
|
||||
w->y + widget->bottom - 1,
|
||||
dpi, w->x + widget->left + 1, w->y + widget->top + 1, w->x + widget->right - 1, w->y + widget->bottom - 1,
|
||||
ColourMapA[w->colours[1]].darkest);
|
||||
|
||||
researchItem = _editorInventionsListDraggedItem;
|
||||
@@ -875,13 +871,8 @@ static void window_editor_inventions_list_drag_open(rct_research_item* researchI
|
||||
window_editor_inventions_list_drag_widgets[0].right = stringWidth;
|
||||
|
||||
w = window_create(
|
||||
gTooltipCursorX - (stringWidth / 2),
|
||||
gTooltipCursorY - 7,
|
||||
stringWidth,
|
||||
14,
|
||||
&window_editor_inventions_list_drag_events,
|
||||
WC_EDITOR_INVENTION_LIST_DRAG,
|
||||
WF_STICK_TO_FRONT | WF_TRANSPARENT | WF_NO_SNAPPING);
|
||||
gTooltipCursorX - (stringWidth / 2), gTooltipCursorY - 7, stringWidth, 14, &window_editor_inventions_list_drag_events,
|
||||
WC_EDITOR_INVENTION_LIST_DRAG, WF_STICK_TO_FRONT | WF_TRANSPARENT | WF_NO_SNAPPING);
|
||||
w->widgets = window_editor_inventions_list_drag_widgets;
|
||||
w->colours[1] = COLOUR_WHITE;
|
||||
input_window_position_begin(w, 0, gTooltipCursorX, gTooltipCursorY);
|
||||
|
||||
@@ -61,13 +61,8 @@ rct_window* window_editor_main_open()
|
||||
window_editor_main_widgets[0].right = context_get_width();
|
||||
window_editor_main_widgets[0].bottom = context_get_height();
|
||||
rct_window* window = window_create(
|
||||
0,
|
||||
0,
|
||||
window_editor_main_widgets[0].right,
|
||||
window_editor_main_widgets[0].bottom,
|
||||
&window_editor_main_events,
|
||||
WC_MAIN_WINDOW,
|
||||
WF_STICK_TO_BACK);
|
||||
0, 0, window_editor_main_widgets[0].right, window_editor_main_widgets[0].bottom, &window_editor_main_events,
|
||||
WC_MAIN_WINDOW, WF_STICK_TO_BACK);
|
||||
window->widgets = window_editor_main_widgets;
|
||||
|
||||
viewport_create(window, window->x, window->y, window->width, window->height, 0, 0x0FFF, 0x0FFF, 0, 0x1, -1);
|
||||
|
||||
@@ -606,12 +606,8 @@ void window_editor_object_selection_mousedown(rct_window* w, rct_widgetindex wid
|
||||
}
|
||||
|
||||
window_dropdown_show_text(
|
||||
w->x + widget->left,
|
||||
w->y + widget->top,
|
||||
widget->bottom - widget->top + 1,
|
||||
w->colours[widget->colour],
|
||||
DROPDOWN_FLAG_STAY_OPEN,
|
||||
_numSourceGameItems + numSelectionItems);
|
||||
w->x + widget->left, w->y + widget->top, widget->bottom - widget->top + 1, w->colours[widget->colour],
|
||||
DROPDOWN_FLAG_STAY_OPEN, _numSourceGameItems + numSelectionItems);
|
||||
|
||||
for (int32_t i = 0; i < _numSourceGameItems; i++)
|
||||
{
|
||||
@@ -1005,11 +1001,7 @@ static void window_editor_object_selection_paint(rct_window* w, rct_drawpixelinf
|
||||
// Preview background
|
||||
widget = &w->widgets[WIDX_PREVIEW];
|
||||
gfx_fill_rect(
|
||||
dpi,
|
||||
w->x + widget->left + 1,
|
||||
w->y + widget->top + 1,
|
||||
w->x + widget->right - 1,
|
||||
w->y + widget->bottom - 1,
|
||||
dpi, w->x + widget->left + 1, w->y + widget->top + 1, w->x + widget->right - 1, w->y + widget->bottom - 1,
|
||||
ColourMapA[w->colours[1]].darkest);
|
||||
|
||||
// Draw number of selected items
|
||||
@@ -1034,12 +1026,7 @@ static void window_editor_object_selection_paint(rct_window* w, rct_drawpixelinf
|
||||
{
|
||||
stringId = _listSortType == RIDE_SORT_TYPE ? (_listSortDescending ? STR_DOWN : STR_UP) : STR_NONE;
|
||||
gfx_draw_string_left_clipped(
|
||||
dpi,
|
||||
STR_OBJECTS_SORT_TYPE,
|
||||
&stringId,
|
||||
w->colours[1],
|
||||
w->x + widget->left + 1,
|
||||
w->y + widget->top + 1,
|
||||
dpi, STR_OBJECTS_SORT_TYPE, &stringId, w->colours[1], w->x + widget->left + 1, w->y + widget->top + 1,
|
||||
widget->right - widget->left);
|
||||
}
|
||||
widget = &w->widgets[WIDX_LIST_SORT_RIDE];
|
||||
@@ -1047,12 +1034,7 @@ static void window_editor_object_selection_paint(rct_window* w, rct_drawpixelinf
|
||||
{
|
||||
stringId = _listSortType == RIDE_SORT_RIDE ? (_listSortDescending ? STR_DOWN : STR_UP) : STR_NONE;
|
||||
gfx_draw_string_left_clipped(
|
||||
dpi,
|
||||
STR_OBJECTS_SORT_RIDE,
|
||||
&stringId,
|
||||
w->colours[1],
|
||||
w->x + widget->left + 1,
|
||||
w->y + widget->top + 1,
|
||||
dpi, STR_OBJECTS_SORT_RIDE, &stringId, w->colours[1], w->x + widget->left + 1, w->y + widget->top + 1,
|
||||
widget->right - widget->left);
|
||||
}
|
||||
|
||||
|
||||
@@ -487,14 +487,8 @@ static void window_editor_objective_options_show_objective_dropdown(rct_window*
|
||||
numItems++;
|
||||
|
||||
window_dropdown_show_text_custom_width(
|
||||
w->x + dropdownWidget->left,
|
||||
w->y + dropdownWidget->top,
|
||||
dropdownWidget->bottom - dropdownWidget->top + 1,
|
||||
w->colours[1],
|
||||
0,
|
||||
DROPDOWN_FLAG_STAY_OPEN,
|
||||
numItems,
|
||||
dropdownWidget->right - dropdownWidget->left - 3);
|
||||
w->x + dropdownWidget->left, w->y + dropdownWidget->top, dropdownWidget->bottom - dropdownWidget->top + 1,
|
||||
w->colours[1], 0, DROPDOWN_FLAG_STAY_OPEN, numItems, dropdownWidget->right - dropdownWidget->left - 3);
|
||||
|
||||
objectiveType = gScenarioObjectiveType;
|
||||
for (int32_t j = 0; j < numItems; j++)
|
||||
@@ -520,14 +514,8 @@ static void window_editor_objective_options_show_climate_dropdown(rct_window* w)
|
||||
gDropdownItemsArgs[i] = ClimateNames[i];
|
||||
}
|
||||
window_dropdown_show_text_custom_width(
|
||||
w->x + dropdownWidget->left,
|
||||
w->y + dropdownWidget->top,
|
||||
dropdownWidget->bottom - dropdownWidget->top + 1,
|
||||
w->colours[1],
|
||||
0,
|
||||
DROPDOWN_FLAG_STAY_OPEN,
|
||||
4,
|
||||
dropdownWidget->right - dropdownWidget->left - 3);
|
||||
w->x + dropdownWidget->left, w->y + dropdownWidget->top, dropdownWidget->bottom - dropdownWidget->top + 1,
|
||||
w->colours[1], 0, DROPDOWN_FLAG_STAY_OPEN, 4, dropdownWidget->right - dropdownWidget->left - 3);
|
||||
dropdown_set_checked(gClimate, true);
|
||||
}
|
||||
|
||||
@@ -544,14 +532,8 @@ static void window_editor_objective_options_show_category_dropdown(rct_window* w
|
||||
gDropdownItemsArgs[i] = ScenarioCategoryStringIds[i];
|
||||
}
|
||||
window_dropdown_show_text_custom_width(
|
||||
w->x + dropdownWidget->left,
|
||||
w->y + dropdownWidget->top,
|
||||
dropdownWidget->bottom - dropdownWidget->top + 1,
|
||||
w->colours[1],
|
||||
0,
|
||||
DROPDOWN_FLAG_STAY_OPEN,
|
||||
5,
|
||||
dropdownWidget->right - dropdownWidget->left - 3);
|
||||
w->x + dropdownWidget->left, w->y + dropdownWidget->top, dropdownWidget->bottom - dropdownWidget->top + 1,
|
||||
w->colours[1], 0, DROPDOWN_FLAG_STAY_OPEN, 5, dropdownWidget->right - dropdownWidget->left - 3);
|
||||
dropdown_set_checked(gS6Info.category, true);
|
||||
}
|
||||
|
||||
|
||||
@@ -487,25 +487,15 @@ static void window_editor_scenario_options_financial_mouseup(rct_window* w, rct_
|
||||
}
|
||||
|
||||
game_do_command(
|
||||
0,
|
||||
GAME_COMMAND_FLAG_APPLY,
|
||||
EDIT_SCENARIOOPTIONS_SETNOMONEY,
|
||||
newMoneySetting,
|
||||
GAME_COMMAND_EDIT_SCENARIO_OPTIONS,
|
||||
0,
|
||||
0);
|
||||
0, GAME_COMMAND_FLAG_APPLY, EDIT_SCENARIOOPTIONS_SETNOMONEY, newMoneySetting,
|
||||
GAME_COMMAND_EDIT_SCENARIO_OPTIONS, 0, 0);
|
||||
window_invalidate(w);
|
||||
break;
|
||||
}
|
||||
case WIDX_FORBID_MARKETING:
|
||||
game_do_command(
|
||||
0,
|
||||
GAME_COMMAND_FLAG_APPLY,
|
||||
EDIT_SCENARIOOPTIONS_SETFORBIDMARKETINGCAMPAIGNS,
|
||||
gParkFlags & PARK_FLAGS_FORBID_MARKETING_CAMPAIGN ? 0 : 1,
|
||||
GAME_COMMAND_EDIT_SCENARIO_OPTIONS,
|
||||
0,
|
||||
0);
|
||||
0, GAME_COMMAND_FLAG_APPLY, EDIT_SCENARIOOPTIONS_SETFORBIDMARKETINGCAMPAIGNS,
|
||||
gParkFlags & PARK_FLAGS_FORBID_MARKETING_CAMPAIGN ? 0 : 1, GAME_COMMAND_EDIT_SCENARIO_OPTIONS, 0, 0);
|
||||
window_invalidate(w);
|
||||
break;
|
||||
}
|
||||
@@ -532,13 +522,8 @@ static void window_editor_scenario_options_financial_mousedown(rct_window* w, rc
|
||||
if (gInitialCash < MONEY(1000000, 00))
|
||||
{
|
||||
game_do_command(
|
||||
0,
|
||||
GAME_COMMAND_FLAG_APPLY,
|
||||
EDIT_SCENARIOOPTIONS_SETINITIALCASH,
|
||||
gInitialCash + MONEY(500, 00),
|
||||
GAME_COMMAND_EDIT_SCENARIO_OPTIONS,
|
||||
0,
|
||||
0);
|
||||
0, GAME_COMMAND_FLAG_APPLY, EDIT_SCENARIOOPTIONS_SETINITIALCASH, gInitialCash + MONEY(500, 00),
|
||||
GAME_COMMAND_EDIT_SCENARIO_OPTIONS, 0, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -550,13 +535,8 @@ static void window_editor_scenario_options_financial_mousedown(rct_window* w, rc
|
||||
if (gInitialCash > MONEY(0, 00))
|
||||
{
|
||||
game_do_command(
|
||||
0,
|
||||
GAME_COMMAND_FLAG_APPLY,
|
||||
EDIT_SCENARIOOPTIONS_SETINITIALCASH,
|
||||
gInitialCash - MONEY(500, 00),
|
||||
GAME_COMMAND_EDIT_SCENARIO_OPTIONS,
|
||||
0,
|
||||
0);
|
||||
0, GAME_COMMAND_FLAG_APPLY, EDIT_SCENARIOOPTIONS_SETINITIALCASH, gInitialCash - MONEY(500, 00),
|
||||
GAME_COMMAND_EDIT_SCENARIO_OPTIONS, 0, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -568,13 +548,8 @@ static void window_editor_scenario_options_financial_mousedown(rct_window* w, rc
|
||||
if (gBankLoan < MONEY(5000000, 00))
|
||||
{
|
||||
game_do_command(
|
||||
0,
|
||||
GAME_COMMAND_FLAG_APPLY,
|
||||
EDIT_SCENARIOOPTIONS_SETINITIALLOAN,
|
||||
gBankLoan + MONEY(1000, 00),
|
||||
GAME_COMMAND_EDIT_SCENARIO_OPTIONS,
|
||||
0,
|
||||
0);
|
||||
0, GAME_COMMAND_FLAG_APPLY, EDIT_SCENARIOOPTIONS_SETINITIALLOAN, gBankLoan + MONEY(1000, 00),
|
||||
GAME_COMMAND_EDIT_SCENARIO_OPTIONS, 0, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -586,13 +561,8 @@ static void window_editor_scenario_options_financial_mousedown(rct_window* w, rc
|
||||
if (gBankLoan > MONEY(0, 00))
|
||||
{
|
||||
game_do_command(
|
||||
0,
|
||||
GAME_COMMAND_FLAG_APPLY,
|
||||
EDIT_SCENARIOOPTIONS_SETINITIALLOAN,
|
||||
gBankLoan - MONEY(1000, 00),
|
||||
GAME_COMMAND_EDIT_SCENARIO_OPTIONS,
|
||||
0,
|
||||
0);
|
||||
0, GAME_COMMAND_FLAG_APPLY, EDIT_SCENARIOOPTIONS_SETINITIALLOAN, gBankLoan - MONEY(1000, 00),
|
||||
GAME_COMMAND_EDIT_SCENARIO_OPTIONS, 0, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -604,13 +574,8 @@ static void window_editor_scenario_options_financial_mousedown(rct_window* w, rc
|
||||
if (gMaxBankLoan < MONEY(5000000, 00))
|
||||
{
|
||||
game_do_command(
|
||||
0,
|
||||
GAME_COMMAND_FLAG_APPLY,
|
||||
EDIT_SCENARIOOPTIONS_SETMAXIMUMLOANSIZE,
|
||||
gMaxBankLoan + MONEY(1000, 00),
|
||||
GAME_COMMAND_EDIT_SCENARIO_OPTIONS,
|
||||
0,
|
||||
0);
|
||||
0, GAME_COMMAND_FLAG_APPLY, EDIT_SCENARIOOPTIONS_SETMAXIMUMLOANSIZE, gMaxBankLoan + MONEY(1000, 00),
|
||||
GAME_COMMAND_EDIT_SCENARIO_OPTIONS, 0, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -622,13 +587,8 @@ static void window_editor_scenario_options_financial_mousedown(rct_window* w, rc
|
||||
if (gMaxBankLoan > MONEY(0, 00))
|
||||
{
|
||||
game_do_command(
|
||||
0,
|
||||
GAME_COMMAND_FLAG_APPLY,
|
||||
EDIT_SCENARIOOPTIONS_SETMAXIMUMLOANSIZE,
|
||||
gMaxBankLoan - MONEY(1000, 00),
|
||||
GAME_COMMAND_EDIT_SCENARIO_OPTIONS,
|
||||
0,
|
||||
0);
|
||||
0, GAME_COMMAND_FLAG_APPLY, EDIT_SCENARIOOPTIONS_SETMAXIMUMLOANSIZE, gMaxBankLoan - MONEY(1000, 00),
|
||||
GAME_COMMAND_EDIT_SCENARIO_OPTIONS, 0, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -640,13 +600,8 @@ static void window_editor_scenario_options_financial_mousedown(rct_window* w, rc
|
||||
if (gBankLoanInterestRate < 80)
|
||||
{
|
||||
game_do_command(
|
||||
0,
|
||||
GAME_COMMAND_FLAG_APPLY,
|
||||
EDIT_SCENARIOOPTIONS_SETANNUALINTERESTRATE,
|
||||
gBankLoanInterestRate + 1,
|
||||
GAME_COMMAND_EDIT_SCENARIO_OPTIONS,
|
||||
0,
|
||||
0);
|
||||
0, GAME_COMMAND_FLAG_APPLY, EDIT_SCENARIOOPTIONS_SETANNUALINTERESTRATE, gBankLoanInterestRate + 1,
|
||||
GAME_COMMAND_EDIT_SCENARIO_OPTIONS, 0, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -660,24 +615,14 @@ static void window_editor_scenario_options_financial_mousedown(rct_window* w, rc
|
||||
if (gBankLoanInterestRate > 80)
|
||||
{
|
||||
game_do_command(
|
||||
0,
|
||||
GAME_COMMAND_FLAG_APPLY,
|
||||
EDIT_SCENARIOOPTIONS_SETANNUALINTERESTRATE,
|
||||
80,
|
||||
GAME_COMMAND_EDIT_SCENARIO_OPTIONS,
|
||||
0,
|
||||
0);
|
||||
0, GAME_COMMAND_FLAG_APPLY, EDIT_SCENARIOOPTIONS_SETANNUALINTERESTRATE, 80,
|
||||
GAME_COMMAND_EDIT_SCENARIO_OPTIONS, 0, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
game_do_command(
|
||||
0,
|
||||
GAME_COMMAND_FLAG_APPLY,
|
||||
EDIT_SCENARIOOPTIONS_SETANNUALINTERESTRATE,
|
||||
gBankLoanInterestRate - 1,
|
||||
GAME_COMMAND_EDIT_SCENARIO_OPTIONS,
|
||||
0,
|
||||
0);
|
||||
0, GAME_COMMAND_FLAG_APPLY, EDIT_SCENARIOOPTIONS_SETANNUALINTERESTRATE, gBankLoanInterestRate - 1,
|
||||
GAME_COMMAND_EDIT_SCENARIO_OPTIONS, 0, 0);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -836,24 +781,14 @@ static void window_editor_scenario_options_guests_mouseup(rct_window* w, rct_wid
|
||||
break;
|
||||
case WIDX_GUEST_PREFER_LESS_INTENSE_RIDES:
|
||||
game_do_command(
|
||||
0,
|
||||
GAME_COMMAND_FLAG_APPLY,
|
||||
EDIT_SCENARIOOPTIONS_SETGUESTSPREFERLESSINTENSERIDES,
|
||||
gParkFlags & PARK_FLAGS_PREF_LESS_INTENSE_RIDES ? 0 : 1,
|
||||
GAME_COMMAND_EDIT_SCENARIO_OPTIONS,
|
||||
0,
|
||||
0);
|
||||
0, GAME_COMMAND_FLAG_APPLY, EDIT_SCENARIOOPTIONS_SETGUESTSPREFERLESSINTENSERIDES,
|
||||
gParkFlags & PARK_FLAGS_PREF_LESS_INTENSE_RIDES ? 0 : 1, GAME_COMMAND_EDIT_SCENARIO_OPTIONS, 0, 0);
|
||||
window_invalidate(w);
|
||||
break;
|
||||
case WIDX_GUEST_PREFER_MORE_INTENSE_RIDES:
|
||||
game_do_command(
|
||||
0,
|
||||
GAME_COMMAND_FLAG_APPLY,
|
||||
EDIT_SCENARIOOPTIONS_SETGUESTSPREFERMOREINTENSERIDES,
|
||||
gParkFlags & PARK_FLAGS_PREF_MORE_INTENSE_RIDES ? 0 : 1,
|
||||
GAME_COMMAND_EDIT_SCENARIO_OPTIONS,
|
||||
0,
|
||||
0);
|
||||
0, GAME_COMMAND_FLAG_APPLY, EDIT_SCENARIOOPTIONS_SETGUESTSPREFERMOREINTENSERIDES,
|
||||
gParkFlags & PARK_FLAGS_PREF_MORE_INTENSE_RIDES ? 0 : 1, GAME_COMMAND_EDIT_SCENARIO_OPTIONS, 0, 0);
|
||||
window_invalidate(w);
|
||||
break;
|
||||
}
|
||||
@@ -880,13 +815,8 @@ static void window_editor_scenario_options_guests_mousedown(rct_window* w, rct_w
|
||||
if (gGuestInitialCash < MONEY(1000, 00))
|
||||
{
|
||||
game_do_command(
|
||||
0,
|
||||
GAME_COMMAND_FLAG_APPLY,
|
||||
EDIT_SCENARIOOPTIONS_SETAVERAGECASHPERGUEST,
|
||||
gGuestInitialCash + MONEY(1, 00),
|
||||
GAME_COMMAND_EDIT_SCENARIO_OPTIONS,
|
||||
0,
|
||||
0);
|
||||
0, GAME_COMMAND_FLAG_APPLY, EDIT_SCENARIOOPTIONS_SETAVERAGECASHPERGUEST, gGuestInitialCash + MONEY(1, 00),
|
||||
GAME_COMMAND_EDIT_SCENARIO_OPTIONS, 0, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -898,13 +828,8 @@ static void window_editor_scenario_options_guests_mousedown(rct_window* w, rct_w
|
||||
if (gGuestInitialCash > MONEY(0, 00))
|
||||
{
|
||||
game_do_command(
|
||||
0,
|
||||
GAME_COMMAND_FLAG_APPLY,
|
||||
EDIT_SCENARIOOPTIONS_SETAVERAGECASHPERGUEST,
|
||||
gGuestInitialCash - MONEY(1, 00),
|
||||
GAME_COMMAND_EDIT_SCENARIO_OPTIONS,
|
||||
0,
|
||||
0);
|
||||
0, GAME_COMMAND_FLAG_APPLY, EDIT_SCENARIOOPTIONS_SETAVERAGECASHPERGUEST, gGuestInitialCash - MONEY(1, 00),
|
||||
GAME_COMMAND_EDIT_SCENARIO_OPTIONS, 0, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -916,13 +841,8 @@ static void window_editor_scenario_options_guests_mousedown(rct_window* w, rct_w
|
||||
if (gGuestInitialHappiness < 250)
|
||||
{
|
||||
game_do_command(
|
||||
0,
|
||||
GAME_COMMAND_FLAG_APPLY,
|
||||
EDIT_SCENARIOOPTIONS_SETGUESTINITIALHAPPINESS,
|
||||
gGuestInitialHappiness + 4,
|
||||
GAME_COMMAND_EDIT_SCENARIO_OPTIONS,
|
||||
0,
|
||||
0);
|
||||
0, GAME_COMMAND_FLAG_APPLY, EDIT_SCENARIOOPTIONS_SETGUESTINITIALHAPPINESS, gGuestInitialHappiness + 4,
|
||||
GAME_COMMAND_EDIT_SCENARIO_OPTIONS, 0, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -934,13 +854,8 @@ static void window_editor_scenario_options_guests_mousedown(rct_window* w, rct_w
|
||||
if (gGuestInitialHappiness > 40)
|
||||
{
|
||||
game_do_command(
|
||||
0,
|
||||
GAME_COMMAND_FLAG_APPLY,
|
||||
EDIT_SCENARIOOPTIONS_SETGUESTINITIALHAPPINESS,
|
||||
gGuestInitialHappiness - 4,
|
||||
GAME_COMMAND_EDIT_SCENARIO_OPTIONS,
|
||||
0,
|
||||
0);
|
||||
0, GAME_COMMAND_FLAG_APPLY, EDIT_SCENARIOOPTIONS_SETGUESTINITIALHAPPINESS, gGuestInitialHappiness - 4,
|
||||
GAME_COMMAND_EDIT_SCENARIO_OPTIONS, 0, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -952,13 +867,8 @@ static void window_editor_scenario_options_guests_mousedown(rct_window* w, rct_w
|
||||
if (gGuestInitialHunger > 40)
|
||||
{
|
||||
game_do_command(
|
||||
0,
|
||||
GAME_COMMAND_FLAG_APPLY,
|
||||
EDIT_SCENARIOOPTIONS_SETGUESTINITIALHUNGER,
|
||||
gGuestInitialHunger - 4,
|
||||
GAME_COMMAND_EDIT_SCENARIO_OPTIONS,
|
||||
0,
|
||||
0);
|
||||
0, GAME_COMMAND_FLAG_APPLY, EDIT_SCENARIOOPTIONS_SETGUESTINITIALHUNGER, gGuestInitialHunger - 4,
|
||||
GAME_COMMAND_EDIT_SCENARIO_OPTIONS, 0, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -970,13 +880,8 @@ static void window_editor_scenario_options_guests_mousedown(rct_window* w, rct_w
|
||||
if (gGuestInitialHunger < 250)
|
||||
{
|
||||
game_do_command(
|
||||
0,
|
||||
GAME_COMMAND_FLAG_APPLY,
|
||||
EDIT_SCENARIOOPTIONS_SETGUESTINITIALHUNGER,
|
||||
gGuestInitialHunger + 4,
|
||||
GAME_COMMAND_EDIT_SCENARIO_OPTIONS,
|
||||
0,
|
||||
0);
|
||||
0, GAME_COMMAND_FLAG_APPLY, EDIT_SCENARIOOPTIONS_SETGUESTINITIALHUNGER, gGuestInitialHunger + 4,
|
||||
GAME_COMMAND_EDIT_SCENARIO_OPTIONS, 0, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -988,13 +893,8 @@ static void window_editor_scenario_options_guests_mousedown(rct_window* w, rct_w
|
||||
if (gGuestInitialThirst > 40)
|
||||
{
|
||||
game_do_command(
|
||||
0,
|
||||
GAME_COMMAND_FLAG_APPLY,
|
||||
EDIT_SCENARIOOPTIONS_SETGUESTINITIALTHIRST,
|
||||
gGuestInitialThirst - 4,
|
||||
GAME_COMMAND_EDIT_SCENARIO_OPTIONS,
|
||||
0,
|
||||
0);
|
||||
0, GAME_COMMAND_FLAG_APPLY, EDIT_SCENARIOOPTIONS_SETGUESTINITIALTHIRST, gGuestInitialThirst - 4,
|
||||
GAME_COMMAND_EDIT_SCENARIO_OPTIONS, 0, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1006,13 +906,8 @@ static void window_editor_scenario_options_guests_mousedown(rct_window* w, rct_w
|
||||
if (gGuestInitialThirst < 250)
|
||||
{
|
||||
game_do_command(
|
||||
0,
|
||||
GAME_COMMAND_FLAG_APPLY,
|
||||
EDIT_SCENARIOOPTIONS_SETGUESTINITIALTHIRST,
|
||||
gGuestInitialThirst + 4,
|
||||
GAME_COMMAND_EDIT_SCENARIO_OPTIONS,
|
||||
0,
|
||||
0);
|
||||
0, GAME_COMMAND_FLAG_APPLY, EDIT_SCENARIOOPTIONS_SETGUESTINITIALTHIRST, gGuestInitialThirst + 4,
|
||||
GAME_COMMAND_EDIT_SCENARIO_OPTIONS, 0, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1163,57 +1058,32 @@ static void window_editor_scenario_options_park_mouseup(rct_window* w, rct_widge
|
||||
break;
|
||||
case WIDX_FORBID_TREE_REMOVAL:
|
||||
game_do_command(
|
||||
0,
|
||||
GAME_COMMAND_FLAG_APPLY,
|
||||
EDIT_SCENARIOOPTIONS_SETFORBIDTREEREMOVAL,
|
||||
gParkFlags & PARK_FLAGS_FORBID_TREE_REMOVAL ? 0 : 1,
|
||||
GAME_COMMAND_EDIT_SCENARIO_OPTIONS,
|
||||
0,
|
||||
0);
|
||||
0, GAME_COMMAND_FLAG_APPLY, EDIT_SCENARIOOPTIONS_SETFORBIDTREEREMOVAL,
|
||||
gParkFlags & PARK_FLAGS_FORBID_TREE_REMOVAL ? 0 : 1, GAME_COMMAND_EDIT_SCENARIO_OPTIONS, 0, 0);
|
||||
window_invalidate(w);
|
||||
break;
|
||||
case WIDX_FORBID_LANDSCAPE_CHANGES:
|
||||
game_do_command(
|
||||
0,
|
||||
GAME_COMMAND_FLAG_APPLY,
|
||||
EDIT_SCENARIOOPTIONS_SETFORBIDLANDSCAPECHANGES,
|
||||
gParkFlags & PARK_FLAGS_FORBID_LANDSCAPE_CHANGES ? 0 : 1,
|
||||
GAME_COMMAND_EDIT_SCENARIO_OPTIONS,
|
||||
0,
|
||||
0);
|
||||
0, GAME_COMMAND_FLAG_APPLY, EDIT_SCENARIOOPTIONS_SETFORBIDLANDSCAPECHANGES,
|
||||
gParkFlags & PARK_FLAGS_FORBID_LANDSCAPE_CHANGES ? 0 : 1, GAME_COMMAND_EDIT_SCENARIO_OPTIONS, 0, 0);
|
||||
window_invalidate(w);
|
||||
break;
|
||||
case WIDX_FORBID_HIGH_CONSTRUCTION:
|
||||
game_do_command(
|
||||
0,
|
||||
GAME_COMMAND_FLAG_APPLY,
|
||||
EDIT_SCENARIOOPTIONS_SETFORBIDHIGHCONSTRUCTION,
|
||||
gParkFlags & PARK_FLAGS_FORBID_HIGH_CONSTRUCTION ? 0 : 1,
|
||||
GAME_COMMAND_EDIT_SCENARIO_OPTIONS,
|
||||
0,
|
||||
0);
|
||||
0, GAME_COMMAND_FLAG_APPLY, EDIT_SCENARIOOPTIONS_SETFORBIDHIGHCONSTRUCTION,
|
||||
gParkFlags & PARK_FLAGS_FORBID_HIGH_CONSTRUCTION ? 0 : 1, GAME_COMMAND_EDIT_SCENARIO_OPTIONS, 0, 0);
|
||||
window_invalidate(w);
|
||||
break;
|
||||
case WIDX_HARD_PARK_RATING:
|
||||
game_do_command(
|
||||
0,
|
||||
GAME_COMMAND_FLAG_APPLY,
|
||||
EDIT_SCENARIOOPTIONS_SETPARKRATINGHIGHERDIFFICULTLEVEL,
|
||||
gParkFlags & PARK_FLAGS_DIFFICULT_PARK_RATING ? 0 : 1,
|
||||
GAME_COMMAND_EDIT_SCENARIO_OPTIONS,
|
||||
0,
|
||||
0);
|
||||
0, GAME_COMMAND_FLAG_APPLY, EDIT_SCENARIOOPTIONS_SETPARKRATINGHIGHERDIFFICULTLEVEL,
|
||||
gParkFlags & PARK_FLAGS_DIFFICULT_PARK_RATING ? 0 : 1, GAME_COMMAND_EDIT_SCENARIO_OPTIONS, 0, 0);
|
||||
window_invalidate(w);
|
||||
break;
|
||||
case WIDX_HARD_GUEST_GENERATION:
|
||||
game_do_command(
|
||||
0,
|
||||
GAME_COMMAND_FLAG_APPLY,
|
||||
EDIT_SCENARIOOPTIONS_SETGUESTGENERATIONHIGHERDIFFICULTLEVEL,
|
||||
gParkFlags & PARK_FLAGS_DIFFICULT_GUEST_GENERATION ? 0 : 1,
|
||||
GAME_COMMAND_EDIT_SCENARIO_OPTIONS,
|
||||
0,
|
||||
0);
|
||||
0, GAME_COMMAND_FLAG_APPLY, EDIT_SCENARIOOPTIONS_SETGUESTGENERATIONHIGHERDIFFICULTLEVEL,
|
||||
gParkFlags & PARK_FLAGS_DIFFICULT_GUEST_GENERATION ? 0 : 1, GAME_COMMAND_EDIT_SCENARIO_OPTIONS, 0, 0);
|
||||
window_invalidate(w);
|
||||
break;
|
||||
}
|
||||
@@ -1242,13 +1112,8 @@ static void window_editor_scenario_options_park_mousedown(rct_window* w, rct_wid
|
||||
if (gLandPrice < MONEY(200, 00))
|
||||
{
|
||||
game_do_command(
|
||||
0,
|
||||
GAME_COMMAND_FLAG_APPLY,
|
||||
EDIT_SCENARIOOPTIONS_SETCOSTTOBUYLAND,
|
||||
gLandPrice + MONEY(1, 00),
|
||||
GAME_COMMAND_EDIT_SCENARIO_OPTIONS,
|
||||
0,
|
||||
0);
|
||||
0, GAME_COMMAND_FLAG_APPLY, EDIT_SCENARIOOPTIONS_SETCOSTTOBUYLAND, gLandPrice + MONEY(1, 00),
|
||||
GAME_COMMAND_EDIT_SCENARIO_OPTIONS, 0, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1260,13 +1125,8 @@ static void window_editor_scenario_options_park_mousedown(rct_window* w, rct_wid
|
||||
if (gLandPrice > MONEY(5, 00))
|
||||
{
|
||||
game_do_command(
|
||||
0,
|
||||
GAME_COMMAND_FLAG_APPLY,
|
||||
EDIT_SCENARIOOPTIONS_SETCOSTTOBUYLAND,
|
||||
gLandPrice - MONEY(1, 00),
|
||||
GAME_COMMAND_EDIT_SCENARIO_OPTIONS,
|
||||
0,
|
||||
0);
|
||||
0, GAME_COMMAND_FLAG_APPLY, EDIT_SCENARIOOPTIONS_SETCOSTTOBUYLAND, gLandPrice - MONEY(1, 00),
|
||||
GAME_COMMAND_EDIT_SCENARIO_OPTIONS, 0, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1278,13 +1138,8 @@ static void window_editor_scenario_options_park_mousedown(rct_window* w, rct_wid
|
||||
if (gConstructionRightsPrice < MONEY(200, 00))
|
||||
{
|
||||
game_do_command(
|
||||
0,
|
||||
GAME_COMMAND_FLAG_APPLY,
|
||||
EDIT_SCENARIOOPTIONS_SETCOSTTOBUYCONSTRUCTIONRIGHTS,
|
||||
gConstructionRightsPrice + MONEY(1, 00),
|
||||
GAME_COMMAND_EDIT_SCENARIO_OPTIONS,
|
||||
0,
|
||||
0);
|
||||
0, GAME_COMMAND_FLAG_APPLY, EDIT_SCENARIOOPTIONS_SETCOSTTOBUYCONSTRUCTIONRIGHTS,
|
||||
gConstructionRightsPrice + MONEY(1, 00), GAME_COMMAND_EDIT_SCENARIO_OPTIONS, 0, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1296,13 +1151,8 @@ static void window_editor_scenario_options_park_mousedown(rct_window* w, rct_wid
|
||||
if (gConstructionRightsPrice > MONEY(5, 00))
|
||||
{
|
||||
game_do_command(
|
||||
0,
|
||||
GAME_COMMAND_FLAG_APPLY,
|
||||
EDIT_SCENARIOOPTIONS_SETCOSTTOBUYCONSTRUCTIONRIGHTS,
|
||||
gConstructionRightsPrice - MONEY(1, 00),
|
||||
GAME_COMMAND_EDIT_SCENARIO_OPTIONS,
|
||||
0,
|
||||
0);
|
||||
0, GAME_COMMAND_FLAG_APPLY, EDIT_SCENARIOOPTIONS_SETCOSTTOBUYCONSTRUCTIONRIGHTS,
|
||||
gConstructionRightsPrice - MONEY(1, 00), GAME_COMMAND_EDIT_SCENARIO_OPTIONS, 0, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1314,13 +1164,8 @@ static void window_editor_scenario_options_park_mousedown(rct_window* w, rct_wid
|
||||
if (gParkEntranceFee < MAX_ENTRANCE_FEE)
|
||||
{
|
||||
game_do_command(
|
||||
0,
|
||||
GAME_COMMAND_FLAG_APPLY,
|
||||
EDIT_SCENARIOOPTIONS_SETPARKCHARGEENTRYFEE,
|
||||
gParkEntranceFee + MONEY(1, 00),
|
||||
GAME_COMMAND_EDIT_SCENARIO_OPTIONS,
|
||||
0,
|
||||
0);
|
||||
0, GAME_COMMAND_FLAG_APPLY, EDIT_SCENARIOOPTIONS_SETPARKCHARGEENTRYFEE, gParkEntranceFee + MONEY(1, 00),
|
||||
GAME_COMMAND_EDIT_SCENARIO_OPTIONS, 0, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1332,13 +1177,8 @@ static void window_editor_scenario_options_park_mousedown(rct_window* w, rct_wid
|
||||
if (gParkEntranceFee > MONEY(0, 00))
|
||||
{
|
||||
game_do_command(
|
||||
0,
|
||||
GAME_COMMAND_FLAG_APPLY,
|
||||
EDIT_SCENARIOOPTIONS_SETPARKCHARGEENTRYFEE,
|
||||
gParkEntranceFee - MONEY(1, 00),
|
||||
GAME_COMMAND_EDIT_SCENARIO_OPTIONS,
|
||||
0,
|
||||
0);
|
||||
0, GAME_COMMAND_FLAG_APPLY, EDIT_SCENARIOOPTIONS_SETPARKCHARGEENTRYFEE, gParkEntranceFee - MONEY(1, 00),
|
||||
GAME_COMMAND_EDIT_SCENARIO_OPTIONS, 0, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1357,14 +1197,8 @@ static void window_editor_scenario_options_park_mousedown(rct_window* w, rct_wid
|
||||
gDropdownItemsArgs[2] = STR_PAID_ENTRY_PAID_RIDES;
|
||||
|
||||
window_dropdown_show_text_custom_width(
|
||||
w->x + dropdownWidget->left,
|
||||
w->y + dropdownWidget->top,
|
||||
dropdownWidget->bottom - dropdownWidget->top - 1,
|
||||
w->colours[1],
|
||||
0,
|
||||
DROPDOWN_FLAG_STAY_OPEN,
|
||||
3,
|
||||
dropdownWidget->right - dropdownWidget->left - 3);
|
||||
w->x + dropdownWidget->left, w->y + dropdownWidget->top, dropdownWidget->bottom - dropdownWidget->top - 1,
|
||||
w->colours[1], 0, DROPDOWN_FLAG_STAY_OPEN, 3, dropdownWidget->right - dropdownWidget->left - 3);
|
||||
|
||||
if (gParkFlags & PARK_FLAGS_UNLOCK_ALL_PRICES)
|
||||
dropdown_set_checked(2, true);
|
||||
@@ -1386,13 +1220,8 @@ static void window_editor_scenario_options_park_dropdown(rct_window* w, rct_widg
|
||||
if (widgetIndex == WIDX_PAY_FOR_PARK_OR_RIDES_DROPDOWN && dropdownIndex != -1)
|
||||
{
|
||||
game_do_command(
|
||||
0,
|
||||
GAME_COMMAND_FLAG_APPLY,
|
||||
EDIT_SCENARIOOPTIONS_SETPARKCHARGEMETHOD,
|
||||
dropdownIndex,
|
||||
GAME_COMMAND_EDIT_SCENARIO_OPTIONS,
|
||||
0,
|
||||
0);
|
||||
0, GAME_COMMAND_FLAG_APPLY, EDIT_SCENARIOOPTIONS_SETPARKCHARGEMETHOD, dropdownIndex,
|
||||
GAME_COMMAND_EDIT_SCENARIO_OPTIONS, 0, 0);
|
||||
window_invalidate(w);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -705,11 +705,7 @@ static void window_finances_summary_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
||||
money32 lastMonthProfit = finance_get_last_month_shop_profit();
|
||||
set_format_arg(0, money32, lastMonthProfit);
|
||||
gfx_draw_string_left(
|
||||
dpi,
|
||||
STR_LAST_MONTH_PROFIT_FROM_FOOD_DRINK_MERCHANDISE_SALES_LABEL,
|
||||
gCommonFormatArgs,
|
||||
COLOUR_BLACK,
|
||||
w->x + 280,
|
||||
dpi, STR_LAST_MONTH_PROFIT_FROM_FOOD_DRINK_MERCHANDISE_SALES_LABEL, gCommonFormatArgs, COLOUR_BLACK, w->x + 280,
|
||||
w->y + 279);
|
||||
}
|
||||
else
|
||||
@@ -753,12 +749,8 @@ static void window_finances_summary_scrollpaint(rct_window* w, rct_drawpixelinfo
|
||||
set_format_arg(0, rct_string_id, STR_FINANCES_SUMMARY_MONTH_HEADING);
|
||||
set_format_arg(2, uint16_t, monthyear);
|
||||
draw_string_right_underline(
|
||||
dpi,
|
||||
monthyear == currentMonthYear ? STR_WINDOW_COLOUR_2_STRINGID : STR_BLACK_STRING,
|
||||
gCommonFormatArgs,
|
||||
COLOUR_BLACK,
|
||||
x + EXPENDITURE_COLUMN_WIDTH,
|
||||
y);
|
||||
dpi, monthyear == currentMonthYear ? STR_WINDOW_COLOUR_2_STRINGID : STR_BLACK_STRING, gCommonFormatArgs,
|
||||
COLOUR_BLACK, x + EXPENDITURE_COLUMN_WIDTH, y);
|
||||
y += 14;
|
||||
|
||||
// Month expenditures
|
||||
@@ -770,12 +762,8 @@ static void window_finances_summary_scrollpaint(rct_window* w, rct_drawpixelinfo
|
||||
{
|
||||
profit += expenditure;
|
||||
gfx_draw_string_right(
|
||||
dpi,
|
||||
expenditure >= 0 ? STR_FINANCES_SUMMARY_INCOME_VALUE : STR_FINANCES_SUMMARY_EXPENDITURE_VALUE,
|
||||
&expenditure,
|
||||
COLOUR_BLACK,
|
||||
x + EXPENDITURE_COLUMN_WIDTH,
|
||||
y);
|
||||
dpi, expenditure >= 0 ? STR_FINANCES_SUMMARY_INCOME_VALUE : STR_FINANCES_SUMMARY_EXPENDITURE_VALUE,
|
||||
&expenditure, COLOUR_BLACK, x + EXPENDITURE_COLUMN_WIDTH, y);
|
||||
}
|
||||
y += TABLE_CELL_HEIGHT;
|
||||
}
|
||||
@@ -783,12 +771,8 @@ static void window_finances_summary_scrollpaint(rct_window* w, rct_drawpixelinfo
|
||||
|
||||
// Month profit
|
||||
gfx_draw_string_right(
|
||||
dpi,
|
||||
profit >= 0 ? STR_FINANCES_SUMMARY_INCOME_VALUE : STR_FINANCES_SUMMARY_LOSS_VALUE,
|
||||
&profit,
|
||||
COLOUR_BLACK,
|
||||
x + EXPENDITURE_COLUMN_WIDTH,
|
||||
y);
|
||||
dpi, profit >= 0 ? STR_FINANCES_SUMMARY_INCOME_VALUE : STR_FINANCES_SUMMARY_LOSS_VALUE, &profit, COLOUR_BLACK,
|
||||
x + EXPENDITURE_COLUMN_WIDTH, y);
|
||||
gfx_fill_rect(dpi, x + 10, y - 2, x + EXPENDITURE_COLUMN_WIDTH, y - 2, PALETTE_INDEX_10);
|
||||
|
||||
x += EXPENDITURE_COLUMN_WIDTH;
|
||||
@@ -864,10 +848,7 @@ static void window_finances_financial_graph_paint(rct_window* w, rct_drawpixelin
|
||||
dpi,
|
||||
cashLessLoan >= 0 ? STR_FINANCES_FINANCIAL_GRAPH_CASH_LESS_LOAN_POSITIVE
|
||||
: STR_FINANCES_FINANCIAL_GRAPH_CASH_LESS_LOAN_NEGATIVE,
|
||||
&cashLessLoan,
|
||||
COLOUR_BLACK,
|
||||
graphLeft,
|
||||
graphTop - 11);
|
||||
&cashLessLoan, COLOUR_BLACK, graphLeft, graphTop - 11);
|
||||
|
||||
// Graph
|
||||
gfx_fill_rect_inset(dpi, graphLeft, graphTop, graphRight, graphBottom, w->colours[1], INSET_RECT_F_30);
|
||||
@@ -1070,12 +1051,8 @@ static void window_finances_profit_graph_paint(rct_window* w, rct_drawpixelinfo*
|
||||
// Weekly profit
|
||||
money32 weeklyPofit = gCurrentProfit;
|
||||
gfx_draw_string_left(
|
||||
dpi,
|
||||
weeklyPofit >= 0 ? STR_FINANCES_WEEKLY_PROFIT_POSITIVE : STR_FINANCES_WEEKLY_PROFIT_LOSS,
|
||||
&weeklyPofit,
|
||||
COLOUR_BLACK,
|
||||
graphLeft,
|
||||
graphTop - 11);
|
||||
dpi, weeklyPofit >= 0 ? STR_FINANCES_WEEKLY_PROFIT_POSITIVE : STR_FINANCES_WEEKLY_PROFIT_LOSS, &weeklyPofit,
|
||||
COLOUR_BLACK, graphLeft, graphTop - 11);
|
||||
|
||||
// Graph
|
||||
gfx_fill_rect_inset(dpi, graphLeft, graphTop, graphRight, graphBottom, w->colours[1], INSET_RECT_F_30);
|
||||
@@ -1329,14 +1306,8 @@ static void window_finances_research_mousedown(rct_window* w, rct_widgetindex wi
|
||||
gDropdownItemsArgs[i] = ResearchFundingLevelNames[i];
|
||||
}
|
||||
window_dropdown_show_text_custom_width(
|
||||
w->x + dropdownWidget->left,
|
||||
w->y + dropdownWidget->top,
|
||||
dropdownWidget->bottom - dropdownWidget->top + 1,
|
||||
w->colours[1],
|
||||
0,
|
||||
DROPDOWN_FLAG_STAY_OPEN,
|
||||
4,
|
||||
dropdownWidget->right - dropdownWidget->left - 3);
|
||||
w->x + dropdownWidget->left, w->y + dropdownWidget->top, dropdownWidget->bottom - dropdownWidget->top + 1,
|
||||
w->colours[1], 0, DROPDOWN_FLAG_STAY_OPEN, 4, dropdownWidget->right - dropdownWidget->left - 3);
|
||||
|
||||
int32_t currentResearchLevel = gResearchFundingLevel;
|
||||
dropdown_set_checked(currentResearchLevel, true);
|
||||
|
||||
@@ -680,14 +680,7 @@ static void window_footpath_show_footpath_types_dialog(rct_window* w, rct_widget
|
||||
}
|
||||
|
||||
window_dropdown_show_image(
|
||||
w->x + widget->left,
|
||||
w->y + widget->top,
|
||||
widget->bottom - widget->top + 1,
|
||||
w->colours[1],
|
||||
0,
|
||||
numPathTypes,
|
||||
47,
|
||||
36,
|
||||
w->x + widget->left, w->y + widget->top, widget->bottom - widget->top + 1, w->colours[1], 0, numPathTypes, 47, 36,
|
||||
gAppropriateImageDropdownItemsPerRow[numPathTypes]);
|
||||
}
|
||||
|
||||
@@ -728,14 +721,8 @@ static void window_footpath_set_provisional_path_at_point(int32_t x, int32_t y)
|
||||
rct_tile_element* tileElement;
|
||||
LocationXY16 mapCoord = {};
|
||||
get_map_coordinates_from_pos(
|
||||
x,
|
||||
y,
|
||||
VIEWPORT_INTERACTION_MASK_FOOTPATH & VIEWPORT_INTERACTION_MASK_TERRAIN,
|
||||
&mapCoord.x,
|
||||
&mapCoord.y,
|
||||
&interactionType,
|
||||
&tileElement,
|
||||
nullptr);
|
||||
x, y, VIEWPORT_INTERACTION_MASK_FOOTPATH & VIEWPORT_INTERACTION_MASK_TERRAIN, &mapCoord.x, &mapCoord.y,
|
||||
&interactionType, &tileElement, nullptr);
|
||||
x = mapCoord.x;
|
||||
y = mapCoord.y;
|
||||
|
||||
@@ -849,14 +836,8 @@ static void window_footpath_place_path_at_point(int32_t x, int32_t y)
|
||||
|
||||
LocationXY16 mapCoord = {};
|
||||
get_map_coordinates_from_pos(
|
||||
x,
|
||||
y,
|
||||
VIEWPORT_INTERACTION_MASK_FOOTPATH & VIEWPORT_INTERACTION_MASK_TERRAIN,
|
||||
&mapCoord.x,
|
||||
&mapCoord.y,
|
||||
&interactionType,
|
||||
&tileElement,
|
||||
nullptr);
|
||||
x, y, VIEWPORT_INTERACTION_MASK_FOOTPATH & VIEWPORT_INTERACTION_MASK_TERRAIN, &mapCoord.x, &mapCoord.y,
|
||||
&interactionType, &tileElement, nullptr);
|
||||
x = mapCoord.x;
|
||||
y = mapCoord.y;
|
||||
|
||||
@@ -976,9 +957,7 @@ static void window_footpath_construct()
|
||||
if (cost != MONEY32_UNDEFINED)
|
||||
{
|
||||
audio_play_sound_at_location(
|
||||
SOUND_PLACE_ITEM,
|
||||
gFootpathConstructFromPosition.x,
|
||||
gFootpathConstructFromPosition.y,
|
||||
SOUND_PLACE_ITEM, gFootpathConstructFromPosition.x, gFootpathConstructFromPosition.y,
|
||||
gFootpathConstructFromPosition.z);
|
||||
|
||||
if (gFootpathConstructSlope == 0)
|
||||
|
||||
@@ -134,12 +134,7 @@ rct_window* window_game_bottom_toolbar_open()
|
||||
uint32_t toolbar_height = line_height * 2 + 12;
|
||||
|
||||
rct_window* window = window_create(
|
||||
0,
|
||||
screenHeight - toolbar_height,
|
||||
screenWidth,
|
||||
toolbar_height,
|
||||
&window_game_bottom_toolbar_events,
|
||||
WC_BOTTOM_TOOLBAR,
|
||||
0, screenHeight - toolbar_height, screenWidth, toolbar_height, &window_game_bottom_toolbar_events, WC_BOTTOM_TOOLBAR,
|
||||
WF_STICK_TO_FRONT | WF_TRANSPARENT | WF_NO_BACKGROUND);
|
||||
window->widgets = window_game_bottom_toolbar_widgets;
|
||||
window->enabled_widgets |= (1 << WIDX_LEFT_OUTSET) | (1 << WIDX_MONEY) | (1 << WIDX_GUESTS) | (1 << WIDX_PARK_RATING)
|
||||
@@ -379,30 +374,24 @@ static void window_game_bottom_toolbar_paint(rct_window* w, rct_drawpixelinfo* d
|
||||
{
|
||||
// Draw panel grey backgrounds
|
||||
gfx_filter_rect(
|
||||
dpi,
|
||||
w->x + window_game_bottom_toolbar_widgets[WIDX_LEFT_OUTSET].left,
|
||||
dpi, w->x + window_game_bottom_toolbar_widgets[WIDX_LEFT_OUTSET].left,
|
||||
w->y + window_game_bottom_toolbar_widgets[WIDX_LEFT_OUTSET].top,
|
||||
w->x + window_game_bottom_toolbar_widgets[WIDX_LEFT_OUTSET].right,
|
||||
w->y + window_game_bottom_toolbar_widgets[WIDX_LEFT_OUTSET].bottom,
|
||||
PALETTE_51);
|
||||
w->y + window_game_bottom_toolbar_widgets[WIDX_LEFT_OUTSET].bottom, PALETTE_51);
|
||||
gfx_filter_rect(
|
||||
dpi,
|
||||
w->x + window_game_bottom_toolbar_widgets[WIDX_RIGHT_OUTSET].left,
|
||||
dpi, w->x + window_game_bottom_toolbar_widgets[WIDX_RIGHT_OUTSET].left,
|
||||
w->y + window_game_bottom_toolbar_widgets[WIDX_RIGHT_OUTSET].top,
|
||||
w->x + window_game_bottom_toolbar_widgets[WIDX_RIGHT_OUTSET].right,
|
||||
w->y + window_game_bottom_toolbar_widgets[WIDX_RIGHT_OUTSET].bottom,
|
||||
PALETTE_51);
|
||||
w->y + window_game_bottom_toolbar_widgets[WIDX_RIGHT_OUTSET].bottom, PALETTE_51);
|
||||
|
||||
if (theme_get_flags() & UITHEME_FLAG_USE_FULL_BOTTOM_TOOLBAR)
|
||||
{
|
||||
// Draw grey background
|
||||
gfx_filter_rect(
|
||||
dpi,
|
||||
w->x + window_game_bottom_toolbar_widgets[WIDX_MIDDLE_OUTSET].left,
|
||||
dpi, w->x + window_game_bottom_toolbar_widgets[WIDX_MIDDLE_OUTSET].left,
|
||||
w->y + window_game_bottom_toolbar_widgets[WIDX_MIDDLE_OUTSET].top,
|
||||
w->x + window_game_bottom_toolbar_widgets[WIDX_MIDDLE_OUTSET].right,
|
||||
w->y + window_game_bottom_toolbar_widgets[WIDX_MIDDLE_OUTSET].bottom,
|
||||
PALETTE_51);
|
||||
w->y + window_game_bottom_toolbar_widgets[WIDX_MIDDLE_OUTSET].bottom, PALETTE_51);
|
||||
}
|
||||
|
||||
window_draw_widgets(w, dpi);
|
||||
@@ -424,13 +413,10 @@ static void window_game_bottom_toolbar_draw_left_panel(rct_drawpixelinfo* dpi, r
|
||||
{
|
||||
// Draw green inset rectangle on panel
|
||||
gfx_fill_rect_inset(
|
||||
dpi,
|
||||
w->x + window_game_bottom_toolbar_widgets[WIDX_LEFT_OUTSET].left + 1,
|
||||
dpi, w->x + window_game_bottom_toolbar_widgets[WIDX_LEFT_OUTSET].left + 1,
|
||||
w->y + window_game_bottom_toolbar_widgets[WIDX_LEFT_OUTSET].top + 1,
|
||||
w->x + window_game_bottom_toolbar_widgets[WIDX_LEFT_OUTSET].right - 1,
|
||||
w->y + window_game_bottom_toolbar_widgets[WIDX_LEFT_OUTSET].bottom - 1,
|
||||
w->colours[1],
|
||||
INSET_RECT_F_30);
|
||||
w->y + window_game_bottom_toolbar_widgets[WIDX_LEFT_OUTSET].bottom - 1, w->colours[1], INSET_RECT_F_30);
|
||||
|
||||
// Figure out how much line height we have to work with.
|
||||
uint32_t line_height = font_get_line_height(FONT_SPRITE_BASE_MEDIUM);
|
||||
@@ -444,10 +430,7 @@ static void window_game_bottom_toolbar_draw_left_panel(rct_drawpixelinfo* dpi, r
|
||||
|
||||
set_format_arg(0, money32, gCash);
|
||||
gfx_draw_string_centred(
|
||||
dpi,
|
||||
(gCash < 0 ? STR_BOTTOM_TOOLBAR_CASH_NEGATIVE : STR_BOTTOM_TOOLBAR_CASH),
|
||||
x,
|
||||
y,
|
||||
dpi, (gCash < 0 ? STR_BOTTOM_TOOLBAR_CASH_NEGATIVE : STR_BOTTOM_TOOLBAR_CASH), x, y,
|
||||
(gHoverWidget.window_classification == WC_BOTTOM_TOOLBAR && gHoverWidget.widget_index == WIDX_MONEY
|
||||
? COLOUR_WHITE
|
||||
: NOT_TRANSLUCENT(w->colours[0])),
|
||||
@@ -475,8 +458,7 @@ static void window_game_bottom_toolbar_draw_left_panel(rct_drawpixelinfo* dpi, r
|
||||
gfx_draw_string_centred(
|
||||
dpi,
|
||||
gNumGuestsInPark == 1 ? guestCountFormatsSingular[gGuestChangeModifier] : guestCountFormats[gGuestChangeModifier],
|
||||
x,
|
||||
y,
|
||||
x, y,
|
||||
(gHoverWidget.window_classification == WC_BOTTOM_TOOLBAR && gHoverWidget.widget_index == WIDX_GUESTS
|
||||
? COLOUR_WHITE
|
||||
: NOT_TRANSLUCENT(w->colours[0])),
|
||||
@@ -519,13 +501,10 @@ static void window_game_bottom_toolbar_draw_right_panel(rct_drawpixelinfo* dpi,
|
||||
{
|
||||
// Draw green inset rectangle on panel
|
||||
gfx_fill_rect_inset(
|
||||
dpi,
|
||||
w->x + window_game_bottom_toolbar_widgets[WIDX_RIGHT_OUTSET].left + 1,
|
||||
dpi, w->x + window_game_bottom_toolbar_widgets[WIDX_RIGHT_OUTSET].left + 1,
|
||||
w->y + window_game_bottom_toolbar_widgets[WIDX_RIGHT_OUTSET].top + 1,
|
||||
w->x + window_game_bottom_toolbar_widgets[WIDX_RIGHT_OUTSET].right - 1,
|
||||
w->y + window_game_bottom_toolbar_widgets[WIDX_RIGHT_OUTSET].bottom - 1,
|
||||
w->colours[1],
|
||||
INSET_RECT_F_30);
|
||||
w->y + window_game_bottom_toolbar_widgets[WIDX_RIGHT_OUTSET].bottom - 1, w->colours[1], INSET_RECT_F_30);
|
||||
|
||||
int32_t x = (window_game_bottom_toolbar_widgets[WIDX_RIGHT_OUTSET].left
|
||||
+ window_game_bottom_toolbar_widgets[WIDX_RIGHT_OUTSET].right)
|
||||
@@ -543,10 +522,7 @@ static void window_game_bottom_toolbar_draw_right_panel(rct_drawpixelinfo* dpi,
|
||||
set_format_arg(2, int16_t, month);
|
||||
set_format_arg(4, int16_t, year);
|
||||
gfx_draw_string_centred(
|
||||
dpi,
|
||||
stringId,
|
||||
x,
|
||||
y,
|
||||
dpi, stringId, x, y,
|
||||
(gHoverWidget.window_classification == WC_BOTTOM_TOOLBAR && gHoverWidget.widget_index == WIDX_DATE
|
||||
? COLOUR_WHITE
|
||||
: NOT_TRANSLUCENT(w->colours[0])),
|
||||
@@ -601,13 +577,8 @@ static void window_game_bottom_toolbar_draw_news_item(rct_drawpixelinfo* dpi, rc
|
||||
|
||||
// Current news item
|
||||
gfx_fill_rect_inset(
|
||||
dpi,
|
||||
w->x + middleOutsetWidget->left + 1,
|
||||
w->y + middleOutsetWidget->top + 1,
|
||||
w->x + middleOutsetWidget->right - 1,
|
||||
w->y + middleOutsetWidget->bottom - 1,
|
||||
w->colours[2],
|
||||
INSET_RECT_F_30);
|
||||
dpi, w->x + middleOutsetWidget->left + 1, w->y + middleOutsetWidget->top + 1, w->x + middleOutsetWidget->right - 1,
|
||||
w->y + middleOutsetWidget->bottom - 1, w->colours[2], INSET_RECT_F_30);
|
||||
|
||||
// Text
|
||||
utf8* newsItemText = newsItem->Text;
|
||||
@@ -699,13 +670,8 @@ static void window_game_bottom_toolbar_draw_middle_panel(rct_drawpixelinfo* dpi,
|
||||
rct_widget* middleOutsetWidget = &window_game_bottom_toolbar_widgets[WIDX_MIDDLE_OUTSET];
|
||||
|
||||
gfx_fill_rect_inset(
|
||||
dpi,
|
||||
w->x + middleOutsetWidget->left + 1,
|
||||
w->y + middleOutsetWidget->top + 1,
|
||||
w->x + middleOutsetWidget->right - 1,
|
||||
w->y + middleOutsetWidget->bottom - 1,
|
||||
w->colours[1],
|
||||
INSET_RECT_F_30);
|
||||
dpi, w->x + middleOutsetWidget->left + 1, w->y + middleOutsetWidget->top + 1, w->x + middleOutsetWidget->right - 1,
|
||||
w->y + middleOutsetWidget->bottom - 1, w->colours[1], INSET_RECT_F_30);
|
||||
|
||||
// Figure out how much line height we have to work with.
|
||||
uint32_t line_height = font_get_line_height(FONT_SPRITE_BASE_MEDIUM);
|
||||
|
||||
@@ -799,17 +799,8 @@ void window_guest_viewport_init(rct_window* w)
|
||||
int32_t height = view_widget->bottom - view_widget->top - 1;
|
||||
|
||||
viewport_create(
|
||||
w,
|
||||
x,
|
||||
y,
|
||||
width,
|
||||
height,
|
||||
0,
|
||||
focus.coordinate.x,
|
||||
focus.coordinate.y,
|
||||
focus.coordinate.z,
|
||||
focus.sprite.type & VIEWPORT_FOCUS_TYPE_MASK,
|
||||
focus.sprite.sprite_id);
|
||||
w, x, y, width, height, 0, focus.coordinate.x, focus.coordinate.y, focus.coordinate.z,
|
||||
focus.sprite.type & VIEWPORT_FOCUS_TYPE_MASK, focus.sprite.sprite_id);
|
||||
w->flags |= WF_NO_SCROLLING;
|
||||
window_invalidate(w);
|
||||
}
|
||||
|
||||
@@ -334,13 +334,8 @@ static void window_guest_list_mouseup(rct_window* w, rct_widgetindex widgetIndex
|
||||
else
|
||||
{
|
||||
window_text_input_open(
|
||||
w,
|
||||
WIDX_FILTER_BY_NAME,
|
||||
STR_GUESTS_FILTER_BY_NAME,
|
||||
STR_GUESTS_ENTER_NAME_TO_SEARCH,
|
||||
STR_STRING,
|
||||
(uintptr_t)&_window_guest_list_filter_name,
|
||||
sizeof(_window_guest_list_filter_name));
|
||||
w, WIDX_FILTER_BY_NAME, STR_GUESTS_FILTER_BY_NAME, STR_GUESTS_ENTER_NAME_TO_SEARCH, STR_STRING,
|
||||
(uintptr_t)&_window_guest_list_filter_name, sizeof(_window_guest_list_filter_name));
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -401,14 +396,8 @@ static void window_guest_list_mousedown(rct_window* w, rct_widgetindex widgetInd
|
||||
widget = &w->widgets[widgetIndex - 1];
|
||||
|
||||
window_dropdown_show_text_custom_width(
|
||||
w->x + widget->left,
|
||||
w->y + widget->top,
|
||||
widget->bottom - widget->top + 1,
|
||||
w->colours[1],
|
||||
0,
|
||||
DROPDOWN_FLAG_STAY_OPEN,
|
||||
_window_guest_list_num_pages,
|
||||
widget->right - widget->left - 3);
|
||||
w->x + widget->left, w->y + widget->top, widget->bottom - widget->top + 1, w->colours[1], 0,
|
||||
DROPDOWN_FLAG_STAY_OPEN, _window_guest_list_num_pages, widget->right - widget->left - 3);
|
||||
|
||||
for (i = 0; i < _window_guest_list_num_pages; i++)
|
||||
{
|
||||
@@ -427,14 +416,8 @@ static void window_guest_list_mousedown(rct_window* w, rct_widgetindex widgetInd
|
||||
}
|
||||
|
||||
window_dropdown_show_text_custom_width(
|
||||
w->x + widget->left,
|
||||
w->y + widget->top,
|
||||
widget->bottom - widget->top + 1,
|
||||
w->colours[1],
|
||||
0,
|
||||
DROPDOWN_FLAG_STAY_OPEN,
|
||||
2,
|
||||
widget->right - widget->left - 3);
|
||||
w->x + widget->left, w->y + widget->top, widget->bottom - widget->top + 1, w->colours[1], 0,
|
||||
DROPDOWN_FLAG_STAY_OPEN, 2, widget->right - widget->left - 3);
|
||||
|
||||
dropdown_set_checked(_window_guest_list_selected_view, true);
|
||||
break;
|
||||
@@ -690,20 +673,14 @@ static void window_guest_list_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
||||
i += g_peep_animation_entries[PEEP_SPRITE_TYPE_NORMAL].sprite_animation->base_image + 1;
|
||||
i |= 0xA1600000;
|
||||
gfx_draw_sprite(
|
||||
dpi,
|
||||
i,
|
||||
(window_guest_list_widgets[WIDX_TAB_1].left + window_guest_list_widgets[WIDX_TAB_1].right) / 2 + w->x,
|
||||
window_guest_list_widgets[WIDX_TAB_1].bottom - 6 + w->y,
|
||||
0);
|
||||
dpi, i, (window_guest_list_widgets[WIDX_TAB_1].left + window_guest_list_widgets[WIDX_TAB_1].right) / 2 + w->x,
|
||||
window_guest_list_widgets[WIDX_TAB_1].bottom - 6 + w->y, 0);
|
||||
|
||||
// Tab 2 image
|
||||
i = (_window_guest_list_selected_tab == 1 ? w->list_information_type / 4 : 0);
|
||||
gfx_draw_sprite(
|
||||
dpi,
|
||||
SPR_TAB_GUESTS_0 + i,
|
||||
window_guest_list_widgets[WIDX_TAB_2].left + w->x,
|
||||
window_guest_list_widgets[WIDX_TAB_2].top + w->y,
|
||||
0);
|
||||
dpi, SPR_TAB_GUESTS_0 + i, window_guest_list_widgets[WIDX_TAB_2].left + w->x,
|
||||
window_guest_list_widgets[WIDX_TAB_2].top + w->y, 0);
|
||||
|
||||
// Filter description
|
||||
x = w->x + 6;
|
||||
@@ -739,12 +716,8 @@ static void window_guest_list_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
||||
y = w->y + window_guest_list_widgets[WIDX_GUEST_LIST].bottom + 2;
|
||||
set_format_arg(0, int16_t, w->var_492);
|
||||
gfx_draw_string_left(
|
||||
dpi,
|
||||
(w->var_492 == 1 ? STR_FORMAT_NUM_GUESTS_SINGULAR : STR_FORMAT_NUM_GUESTS_PLURAL),
|
||||
gCommonFormatArgs,
|
||||
COLOUR_BLACK,
|
||||
x,
|
||||
y);
|
||||
dpi, (w->var_492 == 1 ? STR_FORMAT_NUM_GUESTS_SINGULAR : STR_FORMAT_NUM_GUESTS_PLURAL), gCommonFormatArgs,
|
||||
COLOUR_BLACK, x, y);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -870,11 +843,8 @@ static void window_guest_list_scrollpaint(rct_window* w, rct_drawpixelinfo* dpi,
|
||||
numGuests = _window_guest_list_groups_num_guests[i];
|
||||
for (j = 0; j < 56 && j < numGuests; j++)
|
||||
gfx_draw_sprite(
|
||||
dpi,
|
||||
_window_guest_list_groups_guest_faces[i * 56 + j] + SPR_PEEP_SMALL_FACE_VERY_VERY_UNHAPPY,
|
||||
j * 8,
|
||||
y + 12,
|
||||
0);
|
||||
dpi, _window_guest_list_groups_guest_faces[i * 56 + j] + SPR_PEEP_SMALL_FACE_VERY_VERY_UNHAPPY,
|
||||
j * 8, y + 12, 0);
|
||||
|
||||
// Draw action
|
||||
set_format_arg(0, uint32_t, _window_guest_list_groups_argument_1[i]);
|
||||
@@ -1093,8 +1063,7 @@ static void window_guest_list_find_groups()
|
||||
memcpy(temp_faces, &(_window_guest_list_groups_guest_faces[groupIndex * 56]), 56);
|
||||
memcpy(
|
||||
&(_window_guest_list_groups_guest_faces[groupIndex * 56]),
|
||||
&(_window_guest_list_groups_guest_faces[swap_position * 56]),
|
||||
56);
|
||||
&(_window_guest_list_groups_guest_faces[swap_position * 56]), 56);
|
||||
memcpy(&(_window_guest_list_groups_guest_faces[swap_position * 56]), temp_faces, 56);
|
||||
|
||||
temp = _window_guest_list_group_index[swap_position];
|
||||
|
||||
@@ -437,12 +437,8 @@ static void window_install_track_design(rct_window* w)
|
||||
log_info("%s already exists, prompting user for a different track design name", destPath);
|
||||
context_show_error(STR_UNABLE_TO_INSTALL_THIS_TRACK_DESIGN, STR_NONE);
|
||||
window_text_input_raw_open(
|
||||
w,
|
||||
WIDX_INSTALL,
|
||||
STR_SELECT_NEW_NAME_FOR_TRACK_DESIGN,
|
||||
STR_AN_EXISTING_TRACK_DESIGN_ALREADY_HAS_THIS_NAME,
|
||||
_trackName.c_str(),
|
||||
255);
|
||||
w, WIDX_INSTALL, STR_SELECT_NEW_NAME_FOR_TRACK_DESIGN, STR_AN_EXISTING_TRACK_DESIGN_ALREADY_HAS_THIS_NAME,
|
||||
_trackName.c_str(), 255);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -365,14 +365,10 @@ static void window_land_rights_tool_update_land_rights(int16_t x, int16_t y)
|
||||
return;
|
||||
|
||||
_landRightsCost = game_do_command(
|
||||
gMapSelectPositionA.x,
|
||||
GAME_COMMAND_FLAG_2,
|
||||
gMapSelectPositionA.y,
|
||||
gMapSelectPositionA.x, GAME_COMMAND_FLAG_2, gMapSelectPositionA.y,
|
||||
(_landRightsMode == LAND_RIGHTS_MODE_BUY_LAND) ? BUY_LAND_RIGHTS_FLAG_BUY_LAND
|
||||
: BUY_LAND_RIGHTS_FLAG_BUY_CONSTRUCTION_RIGHTS,
|
||||
GAME_COMMAND_BUY_LAND_RIGHTS,
|
||||
gMapSelectPositionB.x,
|
||||
gMapSelectPositionB.y);
|
||||
GAME_COMMAND_BUY_LAND_RIGHTS, gMapSelectPositionB.x, gMapSelectPositionB.y);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -413,13 +409,8 @@ static void window_land_rights_tooldown(rct_window* w, rct_widgetindex widgetInd
|
||||
{
|
||||
gGameCommandErrorTitle = STR_CANT_BUY_LAND;
|
||||
game_do_command(
|
||||
gMapSelectPositionA.x,
|
||||
GAME_COMMAND_FLAG_APPLY,
|
||||
gMapSelectPositionA.y,
|
||||
BUY_LAND_RIGHTS_FLAG_BUY_LAND,
|
||||
GAME_COMMAND_BUY_LAND_RIGHTS,
|
||||
gMapSelectPositionB.x,
|
||||
gMapSelectPositionB.y);
|
||||
gMapSelectPositionA.x, GAME_COMMAND_FLAG_APPLY, gMapSelectPositionA.y, BUY_LAND_RIGHTS_FLAG_BUY_LAND,
|
||||
GAME_COMMAND_BUY_LAND_RIGHTS, gMapSelectPositionB.x, gMapSelectPositionB.y);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -428,12 +419,8 @@ static void window_land_rights_tooldown(rct_window* w, rct_widgetindex widgetInd
|
||||
{
|
||||
gGameCommandErrorTitle = STR_CANT_BUY_CONSTRUCTION_RIGHTS_HERE;
|
||||
game_do_command(
|
||||
gMapSelectPositionA.x,
|
||||
GAME_COMMAND_FLAG_APPLY,
|
||||
gMapSelectPositionA.y,
|
||||
BUY_LAND_RIGHTS_FLAG_BUY_CONSTRUCTION_RIGHTS,
|
||||
GAME_COMMAND_BUY_LAND_RIGHTS,
|
||||
gMapSelectPositionB.x,
|
||||
gMapSelectPositionA.x, GAME_COMMAND_FLAG_APPLY, gMapSelectPositionA.y,
|
||||
BUY_LAND_RIGHTS_FLAG_BUY_CONSTRUCTION_RIGHTS, GAME_COMMAND_BUY_LAND_RIGHTS, gMapSelectPositionB.x,
|
||||
gMapSelectPositionB.y);
|
||||
}
|
||||
}
|
||||
@@ -451,13 +438,8 @@ static void window_land_rights_tooldrag(rct_window* w, rct_widgetindex widgetInd
|
||||
{
|
||||
gGameCommandErrorTitle = STR_CANT_BUY_LAND;
|
||||
game_do_command(
|
||||
gMapSelectPositionA.x,
|
||||
GAME_COMMAND_FLAG_APPLY,
|
||||
gMapSelectPositionA.y,
|
||||
BUY_LAND_RIGHTS_FLAG_BUY_LAND,
|
||||
GAME_COMMAND_BUY_LAND_RIGHTS,
|
||||
gMapSelectPositionB.x,
|
||||
gMapSelectPositionB.y);
|
||||
gMapSelectPositionA.x, GAME_COMMAND_FLAG_APPLY, gMapSelectPositionA.y, BUY_LAND_RIGHTS_FLAG_BUY_LAND,
|
||||
GAME_COMMAND_BUY_LAND_RIGHTS, gMapSelectPositionB.x, gMapSelectPositionB.y);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -466,12 +448,8 @@ static void window_land_rights_tooldrag(rct_window* w, rct_widgetindex widgetInd
|
||||
{
|
||||
gGameCommandErrorTitle = STR_CANT_BUY_CONSTRUCTION_RIGHTS_HERE;
|
||||
game_do_command(
|
||||
gMapSelectPositionA.x,
|
||||
GAME_COMMAND_FLAG_APPLY,
|
||||
gMapSelectPositionA.y,
|
||||
BUY_LAND_RIGHTS_FLAG_BUY_CONSTRUCTION_RIGHTS,
|
||||
GAME_COMMAND_BUY_LAND_RIGHTS,
|
||||
gMapSelectPositionB.x,
|
||||
gMapSelectPositionA.x, GAME_COMMAND_FLAG_APPLY, gMapSelectPositionA.y,
|
||||
BUY_LAND_RIGHTS_FLAG_BUY_CONSTRUCTION_RIGHTS, GAME_COMMAND_BUY_LAND_RIGHTS, gMapSelectPositionB.x,
|
||||
gMapSelectPositionB.y);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1097,13 +1097,7 @@ static rct_widget window_overwrite_prompt_widgets[] = {
|
||||
{ WWT_CAPTION, 0, 1, OVERWRITE_WW - 2, 1, 14, STR_FILEBROWSER_OVERWRITE_TITLE, STR_WINDOW_TITLE_TIP },
|
||||
{ WWT_CLOSEBOX, 0, OVERWRITE_WW - 13, OVERWRITE_WW - 3, 2, 13, STR_CLOSE_X, STR_CLOSE_WINDOW_TIP },
|
||||
{ WWT_BUTTON, 0, 10, 94, OVERWRITE_WH - 20, OVERWRITE_WH - 9, STR_FILEBROWSER_OVERWRITE_TITLE, STR_NONE },
|
||||
{ WWT_BUTTON,
|
||||
0,
|
||||
OVERWRITE_WW - 95,
|
||||
OVERWRITE_WW - 11,
|
||||
OVERWRITE_WH - 20,
|
||||
OVERWRITE_WH - 9,
|
||||
STR_SAVE_PROMPT_CANCEL,
|
||||
{ WWT_BUTTON, 0, OVERWRITE_WW - 95, OVERWRITE_WW - 11, OVERWRITE_WH - 20, OVERWRITE_WH - 9, STR_SAVE_PROMPT_CANCEL,
|
||||
STR_NONE },
|
||||
{ WIDGETS_END }
|
||||
};
|
||||
|
||||
@@ -63,12 +63,7 @@ rct_window* window_main_open()
|
||||
window_main_widgets[0].right = context_get_width();
|
||||
window_main_widgets[0].bottom = context_get_height();
|
||||
rct_window* window = window_create(
|
||||
0,
|
||||
0,
|
||||
window_main_widgets[0].right,
|
||||
window_main_widgets[0].bottom,
|
||||
&window_main_events,
|
||||
WC_MAIN_WINDOW,
|
||||
0, 0, window_main_widgets[0].right, window_main_widgets[0].bottom, &window_main_events, WC_MAIN_WINDOW,
|
||||
WF_STICK_TO_BACK);
|
||||
window->widgets = window_main_widgets;
|
||||
|
||||
|
||||
@@ -508,13 +508,8 @@ static void window_map_tooldrag(rct_window* w, rct_widgetindex widgetIndex, int3
|
||||
{
|
||||
gGameCommandErrorTitle = 0;
|
||||
game_do_command(
|
||||
gMapSelectPositionA.x,
|
||||
GAME_COMMAND_FLAG_APPLY,
|
||||
gMapSelectPositionA.y,
|
||||
_activeTool,
|
||||
GAME_COMMAND_SET_LAND_OWNERSHIP,
|
||||
gMapSelectPositionB.x,
|
||||
gMapSelectPositionB.y);
|
||||
gMapSelectPositionA.x, GAME_COMMAND_FLAG_APPLY, gMapSelectPositionA.y, _activeTool,
|
||||
GAME_COMMAND_SET_LAND_OWNERSHIP, gMapSelectPositionB.x, gMapSelectPositionB.y);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -599,12 +594,8 @@ static void window_map_scrollmousedown(rct_window* w, int32_t scrollIndex, int32
|
||||
|
||||
gGameCommandErrorTitle = STR_CANT_CHANGE_LAND_TYPE;
|
||||
game_do_command(
|
||||
gMapSelectPositionA.x,
|
||||
GAME_COMMAND_FLAG_APPLY,
|
||||
gMapSelectPositionA.y,
|
||||
gLandToolTerrainSurface | (gLandToolTerrainEdge << 8),
|
||||
GAME_COMMAND_CHANGE_SURFACE_STYLE,
|
||||
gMapSelectPositionB.x,
|
||||
gMapSelectPositionA.x, GAME_COMMAND_FLAG_APPLY, gMapSelectPositionA.y,
|
||||
gLandToolTerrainSurface | (gLandToolTerrainEdge << 8), GAME_COMMAND_CHANGE_SURFACE_STYLE, gMapSelectPositionB.x,
|
||||
gMapSelectPositionB.y);
|
||||
}
|
||||
else if (widget_is_active_tool(w, WIDX_SET_LAND_RIGHTS))
|
||||
@@ -627,13 +618,8 @@ static void window_map_scrollmousedown(rct_window* w, int32_t scrollIndex, int32
|
||||
|
||||
gGameCommandErrorTitle = 0;
|
||||
game_do_command(
|
||||
gMapSelectPositionA.x,
|
||||
GAME_COMMAND_FLAG_APPLY,
|
||||
gMapSelectPositionA.y,
|
||||
_activeTool,
|
||||
GAME_COMMAND_SET_LAND_OWNERSHIP,
|
||||
gMapSelectPositionB.x,
|
||||
gMapSelectPositionB.y);
|
||||
gMapSelectPositionA.x, GAME_COMMAND_FLAG_APPLY, gMapSelectPositionA.y, _activeTool, GAME_COMMAND_SET_LAND_OWNERSHIP,
|
||||
gMapSelectPositionB.x, gMapSelectPositionB.y);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -850,11 +836,8 @@ static void window_map_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
||||
x = w->x + w->widgets[WIDX_PEOPLE_STARTING_POSITION].left + 12;
|
||||
y = w->y + w->widgets[WIDX_PEOPLE_STARTING_POSITION].top + 18;
|
||||
gfx_draw_sprite(
|
||||
dpi,
|
||||
IMAGE_TYPE_REMAP | IMAGE_TYPE_REMAP_2_PLUS | (COLOUR_LIGHT_BROWN << 24) | (COLOUR_BRIGHT_RED << 19) | SPR_6410,
|
||||
x,
|
||||
y,
|
||||
0);
|
||||
dpi, IMAGE_TYPE_REMAP | IMAGE_TYPE_REMAP_2_PLUS | (COLOUR_LIGHT_BROWN << 24) | (COLOUR_BRIGHT_RED << 19) | SPR_6410,
|
||||
x, y, 0);
|
||||
}
|
||||
|
||||
if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !gCheatsSandboxMode)
|
||||
|
||||
@@ -761,29 +761,17 @@ static void window_mapgen_base_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
||||
// The practical map size is 2 lower than the technical map size
|
||||
LocationXY16 mapSizeArgs = MakeXY16(_mapSize - 2, _mapSize - 2);
|
||||
gfx_draw_string_left(
|
||||
dpi,
|
||||
STR_RESOLUTION_X_BY_Y,
|
||||
&mapSizeArgs,
|
||||
w->colours[1],
|
||||
w->x + w->widgets[WIDX_MAP_SIZE].left + 1,
|
||||
dpi, STR_RESOLUTION_X_BY_Y, &mapSizeArgs, w->colours[1], w->x + w->widgets[WIDX_MAP_SIZE].left + 1,
|
||||
w->y + w->widgets[WIDX_MAP_SIZE].top + 1);
|
||||
|
||||
arg = (_baseHeight - 12) / 2;
|
||||
gfx_draw_string_left(
|
||||
dpi,
|
||||
STR_COMMA16,
|
||||
&arg,
|
||||
w->colours[1],
|
||||
w->x + w->widgets[WIDX_BASE_HEIGHT].left + 1,
|
||||
dpi, STR_COMMA16, &arg, w->colours[1], w->x + w->widgets[WIDX_BASE_HEIGHT].left + 1,
|
||||
w->y + w->widgets[WIDX_BASE_HEIGHT].top + 1);
|
||||
|
||||
arg = (_waterLevel - 12) / 2;
|
||||
gfx_draw_string_left(
|
||||
dpi,
|
||||
STR_COMMA16,
|
||||
&arg,
|
||||
w->colours[1],
|
||||
w->x + w->widgets[WIDX_WATER_LEVEL].left + 1,
|
||||
dpi, STR_COMMA16, &arg, w->colours[1], w->x + w->widgets[WIDX_WATER_LEVEL].left + 1,
|
||||
w->y + w->widgets[WIDX_WATER_LEVEL].top + 1);
|
||||
}
|
||||
|
||||
@@ -1062,11 +1050,7 @@ static void window_mapgen_simplex_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
||||
gfx_draw_string_left(
|
||||
dpi, STR_MAPGEN_SIMPLEX_NOISE_HIGH, nullptr, textColour, w->x + 5, w->y + w->widgets[WIDX_SIMPLEX_HIGH].top + 1);
|
||||
gfx_draw_string_left(
|
||||
dpi,
|
||||
STR_MAPGEN_SIMPLEX_NOISE_BASE_FREQUENCY,
|
||||
nullptr,
|
||||
textColour,
|
||||
w->x + 5,
|
||||
dpi, STR_MAPGEN_SIMPLEX_NOISE_BASE_FREQUENCY, nullptr, textColour, w->x + 5,
|
||||
w->y + w->widgets[WIDX_SIMPLEX_BASE_FREQ].top + 1);
|
||||
gfx_draw_string_left(
|
||||
dpi, STR_MAPGEN_SIMPLEX_NOISE_OCTAVES, nullptr, textColour, w->x + 5, w->y + w->widgets[WIDX_SIMPLEX_OCTAVES].top + 1);
|
||||
@@ -1075,60 +1059,32 @@ static void window_mapgen_simplex_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
||||
dpi, STR_WATER_LEVEL_LABEL, nullptr, textColour, w->x + 5, w->y + w->widgets[WIDX_SIMPLEX_WATER_LEVEL].top + 1);
|
||||
|
||||
gfx_draw_string_left(
|
||||
dpi,
|
||||
STR_COMMA16,
|
||||
&_simplex_low,
|
||||
textColour,
|
||||
w->x + w->widgets[WIDX_SIMPLEX_LOW].left + 1,
|
||||
dpi, STR_COMMA16, &_simplex_low, textColour, w->x + w->widgets[WIDX_SIMPLEX_LOW].left + 1,
|
||||
w->y + w->widgets[WIDX_SIMPLEX_LOW].top + 1);
|
||||
gfx_draw_string_left(
|
||||
dpi,
|
||||
STR_COMMA16,
|
||||
&_simplex_high,
|
||||
textColour,
|
||||
w->x + w->widgets[WIDX_SIMPLEX_HIGH].left + 1,
|
||||
dpi, STR_COMMA16, &_simplex_high, textColour, w->x + w->widgets[WIDX_SIMPLEX_HIGH].left + 1,
|
||||
w->y + w->widgets[WIDX_SIMPLEX_HIGH].top + 1);
|
||||
gfx_draw_string_left(
|
||||
dpi,
|
||||
STR_WINDOW_OBJECTIVE_VALUE_RATING,
|
||||
&_simplex_base_freq,
|
||||
textColour,
|
||||
w->x + w->widgets[WIDX_SIMPLEX_BASE_FREQ].left + 1,
|
||||
w->y + w->widgets[WIDX_SIMPLEX_BASE_FREQ].top + 1);
|
||||
dpi, STR_WINDOW_OBJECTIVE_VALUE_RATING, &_simplex_base_freq, textColour,
|
||||
w->x + w->widgets[WIDX_SIMPLEX_BASE_FREQ].left + 1, w->y + w->widgets[WIDX_SIMPLEX_BASE_FREQ].top + 1);
|
||||
gfx_draw_string_left(
|
||||
dpi,
|
||||
STR_COMMA16,
|
||||
&_simplex_octaves,
|
||||
textColour,
|
||||
w->x + w->widgets[WIDX_SIMPLEX_OCTAVES].left + 1,
|
||||
dpi, STR_COMMA16, &_simplex_octaves, textColour, w->x + w->widgets[WIDX_SIMPLEX_OCTAVES].left + 1,
|
||||
w->y + w->widgets[WIDX_SIMPLEX_OCTAVES].top + 1);
|
||||
gfx_draw_string_left(
|
||||
dpi, STR_TERRAIN_LABEL, nullptr, textColour, w->x + 5, w->y + w->widgets[WIDX_SIMPLEX_RANDOM_TERRAIN_CHECKBOX].top + 1);
|
||||
gfx_draw_string_left(
|
||||
dpi,
|
||||
STR_MAPGEN_OPTION_PLACE_TREES,
|
||||
nullptr,
|
||||
textColour,
|
||||
w->x + 5,
|
||||
dpi, STR_MAPGEN_OPTION_PLACE_TREES, nullptr, textColour, w->x + 5,
|
||||
w->y + w->widgets[WIDX_SIMPLEX_PLACE_TREES_CHECKBOX].top + 1);
|
||||
|
||||
// The practical map size is 2 lower than the technical map size
|
||||
LocationXY16 mapSizeArgs = MakeXY16(_mapSize - 2, _mapSize - 2);
|
||||
gfx_draw_string_left(
|
||||
dpi,
|
||||
STR_RESOLUTION_X_BY_Y,
|
||||
&mapSizeArgs,
|
||||
textColour,
|
||||
w->x + w->widgets[WIDX_SIMPLEX_MAP_SIZE].left + 1,
|
||||
dpi, STR_RESOLUTION_X_BY_Y, &mapSizeArgs, textColour, w->x + w->widgets[WIDX_SIMPLEX_MAP_SIZE].left + 1,
|
||||
w->y + w->widgets[WIDX_SIMPLEX_MAP_SIZE].top + 1);
|
||||
|
||||
arg = (_waterLevel - 12) / 2;
|
||||
gfx_draw_string_left(
|
||||
dpi,
|
||||
STR_COMMA16,
|
||||
&arg,
|
||||
textColour,
|
||||
w->x + w->widgets[WIDX_SIMPLEX_WATER_LEVEL].left + 1,
|
||||
dpi, STR_COMMA16, &arg, textColour, w->x + w->widgets[WIDX_SIMPLEX_WATER_LEVEL].left + 1,
|
||||
w->y + w->widgets[WIDX_SIMPLEX_WATER_LEVEL].top + 1);
|
||||
}
|
||||
|
||||
@@ -1286,11 +1242,7 @@ static void window_mapgen_heightmap_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
||||
gfx_draw_string_left(
|
||||
dpi, STR_MAPGEN_SMOOTH_STRENGTH, nullptr, strengthColour, w->x + 5, w->y + w->widgets[WIDX_HEIGHTMAP_STRENGTH].top + 1);
|
||||
gfx_draw_string_left(
|
||||
dpi,
|
||||
STR_COMMA16,
|
||||
&strength,
|
||||
strengthColour,
|
||||
w->x + w->widgets[WIDX_HEIGHTMAP_STRENGTH].left + 1,
|
||||
dpi, STR_COMMA16, &strength, strengthColour, w->x + w->widgets[WIDX_HEIGHTMAP_STRENGTH].left + 1,
|
||||
w->y + w->widgets[WIDX_HEIGHTMAP_STRENGTH].top + 1);
|
||||
|
||||
// Low label and value
|
||||
@@ -1299,11 +1251,7 @@ static void window_mapgen_heightmap_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
||||
gfx_draw_string_left(
|
||||
dpi, STR_MAPGEN_SIMPLEX_NOISE_LOW_, nullptr, labelColour, w->x + 5, w->y + w->widgets[WIDX_HEIGHTMAP_LOW].top + 1);
|
||||
gfx_draw_string_left(
|
||||
dpi,
|
||||
STR_COMMA16,
|
||||
&low,
|
||||
labelColour,
|
||||
w->x + w->widgets[WIDX_HEIGHTMAP_LOW].left + 1,
|
||||
dpi, STR_COMMA16, &low, labelColour, w->x + w->widgets[WIDX_HEIGHTMAP_LOW].left + 1,
|
||||
w->y + w->widgets[WIDX_HEIGHTMAP_LOW].top + 1);
|
||||
|
||||
// High label and value
|
||||
@@ -1311,11 +1259,7 @@ static void window_mapgen_heightmap_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
||||
gfx_draw_string_left(
|
||||
dpi, STR_MAPGEN_SIMPLEX_NOISE_HIGH, nullptr, labelColour, w->x + 5, w->y + w->widgets[WIDX_HEIGHTMAP_HIGH].top + 1);
|
||||
gfx_draw_string_left(
|
||||
dpi,
|
||||
STR_COMMA16,
|
||||
&high,
|
||||
labelColour,
|
||||
w->x + w->widgets[WIDX_HEIGHTMAP_HIGH].left + 1,
|
||||
dpi, STR_COMMA16, &high, labelColour, w->x + w->widgets[WIDX_HEIGHTMAP_HIGH].left + 1,
|
||||
w->y + w->widgets[WIDX_HEIGHTMAP_HIGH].top + 1);
|
||||
|
||||
// Water level label and value
|
||||
@@ -1323,11 +1267,7 @@ static void window_mapgen_heightmap_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
||||
gfx_draw_string_left(
|
||||
dpi, STR_WATER_LEVEL_LABEL, nullptr, labelColour, w->x + 5, w->y + w->widgets[WIDX_HEIGHTMAP_WATER_LEVEL].top + 1);
|
||||
gfx_draw_string_left(
|
||||
dpi,
|
||||
STR_COMMA16,
|
||||
&waterLevel,
|
||||
labelColour,
|
||||
w->x + w->widgets[WIDX_HEIGHTMAP_WATER_LEVEL].left + 1,
|
||||
dpi, STR_COMMA16, &waterLevel, labelColour, w->x + w->widgets[WIDX_HEIGHTMAP_WATER_LEVEL].left + 1,
|
||||
w->y + w->widgets[WIDX_HEIGHTMAP_WATER_LEVEL].top + 1);
|
||||
}
|
||||
|
||||
|
||||
@@ -128,12 +128,7 @@ static void window_map_tooltip_open()
|
||||
if (w == nullptr)
|
||||
{
|
||||
w = window_create(
|
||||
x,
|
||||
y,
|
||||
width,
|
||||
height,
|
||||
&window_map_tooltip_events,
|
||||
WC_MAP_TOOLTIP,
|
||||
x, y, width, height, &window_map_tooltip_events, WC_MAP_TOOLTIP,
|
||||
WF_STICK_TO_FRONT | WF_TRANSPARENT | WF_NO_BACKGROUND);
|
||||
w->widgets = window_map_tooltip_widgets;
|
||||
}
|
||||
@@ -170,11 +165,6 @@ static void window_map_tooltip_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
||||
}
|
||||
|
||||
gfx_draw_string_centred_wrapped(
|
||||
dpi,
|
||||
gMapTooltipFormatArgs,
|
||||
w->x + (w->width / 2),
|
||||
w->y + (w->height / 2),
|
||||
w->width,
|
||||
STR_MAP_TOOLTIP_STRINGID,
|
||||
dpi, gMapTooltipFormatArgs, w->x + (w->width / 2), w->y + (w->height / 2), w->width, STR_MAP_TOOLTIP_STRINGID,
|
||||
COLOUR_BLACK);
|
||||
}
|
||||
@@ -376,13 +376,8 @@ static void window_maze_construction_entrance_tooldown(int32_t x, int32_t y, rct
|
||||
}
|
||||
|
||||
money32 cost = game_do_command(
|
||||
x,
|
||||
GAME_COMMAND_FLAG_APPLY | ((direction ^ 2) << 8),
|
||||
y,
|
||||
rideIndex | (entranceExitType << 8),
|
||||
GAME_COMMAND_PLACE_RIDE_ENTRANCE_OR_EXIT,
|
||||
gRideEntranceExitPlaceStationIndex,
|
||||
0);
|
||||
x, GAME_COMMAND_FLAG_APPLY | ((direction ^ 2) << 8), y, rideIndex | (entranceExitType << 8),
|
||||
GAME_COMMAND_PLACE_RIDE_ENTRANCE_OR_EXIT, gRideEntranceExitPlaceStationIndex, 0);
|
||||
|
||||
if (cost == MONEY32_UNDEFINED)
|
||||
return;
|
||||
|
||||
@@ -365,14 +365,8 @@ static void window_multiplayer_groups_show_group_dropdown(rct_window* w, rct_wid
|
||||
numItems = network_get_num_groups();
|
||||
|
||||
window_dropdown_show_text_custom_width(
|
||||
w->x + dropdownWidget->left,
|
||||
w->y + dropdownWidget->top,
|
||||
dropdownWidget->bottom - dropdownWidget->top + 1,
|
||||
w->colours[1],
|
||||
0,
|
||||
0,
|
||||
numItems,
|
||||
widget->right - dropdownWidget->left);
|
||||
w->x + dropdownWidget->left, w->y + dropdownWidget->top, dropdownWidget->bottom - dropdownWidget->top + 1,
|
||||
w->colours[1], 0, 0, numItems, widget->right - dropdownWidget->left);
|
||||
|
||||
for (i = 0; i < network_get_num_groups(); i++)
|
||||
{
|
||||
@@ -766,12 +760,7 @@ static void window_multiplayer_groups_dropdown(rct_window* w, rct_widgetindex wi
|
||||
{
|
||||
case WIDX_DEFAULT_GROUP_DROPDOWN:
|
||||
game_do_command(
|
||||
4 | (network_get_group_id(dropdownIndex) << 8),
|
||||
GAME_COMMAND_FLAG_APPLY,
|
||||
0,
|
||||
0,
|
||||
GAME_COMMAND_MODIFY_GROUPS,
|
||||
0,
|
||||
4 | (network_get_group_id(dropdownIndex) << 8), GAME_COMMAND_FLAG_APPLY, 0, 0, GAME_COMMAND_MODIFY_GROUPS, 0,
|
||||
0);
|
||||
break;
|
||||
case WIDX_SELECTED_GROUP_DROPDOWN:
|
||||
@@ -844,29 +833,14 @@ static void window_multiplayer_groups_text_input(rct_window* w, rct_widgetindex
|
||||
return;
|
||||
|
||||
game_do_command(
|
||||
3 | (_selectedGroup << 8) | (1 << 16),
|
||||
GAME_COMMAND_FLAG_APPLY,
|
||||
w->number,
|
||||
*((int32_t*)(text + 0)),
|
||||
GAME_COMMAND_MODIFY_GROUPS,
|
||||
*((int32_t*)(text + 8)),
|
||||
*((int32_t*)(text + 4)));
|
||||
3 | (_selectedGroup << 8) | (1 << 16), GAME_COMMAND_FLAG_APPLY, w->number, *((int32_t*)(text + 0)),
|
||||
GAME_COMMAND_MODIFY_GROUPS, *((int32_t*)(text + 8)), *((int32_t*)(text + 4)));
|
||||
game_do_command(
|
||||
3 | (_selectedGroup << 8) | (2 << 16),
|
||||
GAME_COMMAND_FLAG_APPLY,
|
||||
w->number,
|
||||
*((int32_t*)(text + 12)),
|
||||
GAME_COMMAND_MODIFY_GROUPS,
|
||||
*((int32_t*)(text + 20)),
|
||||
*((int32_t*)(text + 16)));
|
||||
3 | (_selectedGroup << 8) | (2 << 16), GAME_COMMAND_FLAG_APPLY, w->number, *((int32_t*)(text + 12)),
|
||||
GAME_COMMAND_MODIFY_GROUPS, *((int32_t*)(text + 20)), *((int32_t*)(text + 16)));
|
||||
game_do_command(
|
||||
3 | (_selectedGroup << 8) | (0 << 16),
|
||||
GAME_COMMAND_FLAG_APPLY,
|
||||
w->number,
|
||||
*((int32_t*)(text + 24)),
|
||||
GAME_COMMAND_MODIFY_GROUPS,
|
||||
*((int32_t*)(text + 32)),
|
||||
*((int32_t*)(text + 28)));
|
||||
3 | (_selectedGroup << 8) | (0 << 16), GAME_COMMAND_FLAG_APPLY, w->number, *((int32_t*)(text + 24)),
|
||||
GAME_COMMAND_MODIFY_GROUPS, *((int32_t*)(text + 32)), *((int32_t*)(text + 28)));
|
||||
}
|
||||
|
||||
static void window_multiplayer_groups_invalidate(rct_window* w)
|
||||
@@ -900,13 +874,8 @@ static void window_multiplayer_groups_paint(rct_window* w, rct_drawpixelinfo* dp
|
||||
safe_strcpy(lineCh, network_get_group_name(group), sizeof(buffer) - (lineCh - buffer));
|
||||
set_format_arg(0, const char*, buffer);
|
||||
gfx_draw_string_centred_clipped(
|
||||
dpi,
|
||||
STR_STRING,
|
||||
gCommonFormatArgs,
|
||||
COLOUR_BLACK,
|
||||
w->x + (widget->left + widget->right - 11) / 2,
|
||||
w->y + widget->top,
|
||||
widget->right - widget->left - 8);
|
||||
dpi, STR_STRING, gCommonFormatArgs, COLOUR_BLACK, w->x + (widget->left + widget->right - 11) / 2,
|
||||
w->y + widget->top, widget->right - widget->left - 8);
|
||||
}
|
||||
|
||||
int32_t x = w->x + window_multiplayer_groups_widgets[WIDX_CONTENT_PANEL].left + 4;
|
||||
@@ -929,13 +898,8 @@ static void window_multiplayer_groups_paint(rct_window* w, rct_drawpixelinfo* dp
|
||||
safe_strcpy(lineCh, network_get_group_name(group), sizeof(buffer) - (lineCh - buffer));
|
||||
set_format_arg(0, const char*, buffer);
|
||||
gfx_draw_string_centred_clipped(
|
||||
dpi,
|
||||
STR_STRING,
|
||||
gCommonFormatArgs,
|
||||
COLOUR_BLACK,
|
||||
w->x + (widget->left + widget->right - 11) / 2,
|
||||
w->y + widget->top,
|
||||
widget->right - widget->left - 8);
|
||||
dpi, STR_STRING, gCommonFormatArgs, COLOUR_BLACK, w->x + (widget->left + widget->right - 11) / 2,
|
||||
w->y + widget->top, widget->right - widget->left - 8);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -276,13 +276,8 @@ static void window_new_campaign_mousedown(rct_window* w, rct_widgetindex widgetI
|
||||
}
|
||||
|
||||
window_dropdown_show_text_custom_width(
|
||||
w->x + dropdownWidget->left,
|
||||
w->y + dropdownWidget->top,
|
||||
dropdownWidget->bottom - dropdownWidget->top + 1,
|
||||
w->colours[1],
|
||||
0,
|
||||
DROPDOWN_FLAG_STAY_OPEN,
|
||||
numItems,
|
||||
w->x + dropdownWidget->left, w->y + dropdownWidget->top,
|
||||
dropdownWidget->bottom - dropdownWidget->top + 1, w->colours[1], 0, DROPDOWN_FLAG_STAY_OPEN, numItems,
|
||||
dropdownWidget->right - dropdownWidget->left - 3);
|
||||
}
|
||||
}
|
||||
@@ -301,14 +296,8 @@ static void window_new_campaign_mousedown(rct_window* w, rct_widgetindex widgetI
|
||||
}
|
||||
|
||||
window_dropdown_show_text_custom_width(
|
||||
w->x + dropdownWidget->left,
|
||||
w->y + dropdownWidget->top,
|
||||
dropdownWidget->bottom - dropdownWidget->top + 1,
|
||||
w->colours[1],
|
||||
0,
|
||||
DROPDOWN_FLAG_STAY_OPEN,
|
||||
numItems,
|
||||
dropdownWidget->right - dropdownWidget->left - 3);
|
||||
w->x + dropdownWidget->left, w->y + dropdownWidget->top, dropdownWidget->bottom - dropdownWidget->top + 1,
|
||||
w->colours[1], 0, DROPDOWN_FLAG_STAY_OPEN, numItems, dropdownWidget->right - dropdownWidget->left - 3);
|
||||
}
|
||||
break;
|
||||
// In RCT2, the maximum was 6 weeks
|
||||
@@ -406,12 +395,8 @@ static void window_new_campaign_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
||||
// Number of weeks
|
||||
rct_widget* spinnerWidget = &window_new_campaign_widgets[WIDX_WEEKS_SPINNER];
|
||||
gfx_draw_string_left(
|
||||
dpi,
|
||||
w->campaign.no_weeks == 1 ? STR_MARKETING_1_WEEK : STR_X_WEEKS,
|
||||
&w->campaign.no_weeks,
|
||||
w->colours[0],
|
||||
w->x + spinnerWidget->left + 1,
|
||||
w->y + spinnerWidget->top);
|
||||
dpi, w->campaign.no_weeks == 1 ? STR_MARKETING_1_WEEK : STR_X_WEEKS, &w->campaign.no_weeks, w->colours[0],
|
||||
w->x + spinnerWidget->left + 1, w->y + spinnerWidget->top);
|
||||
|
||||
x = w->x + 14;
|
||||
y = w->y + 60;
|
||||
|
||||
@@ -1248,14 +1248,8 @@ static void window_options_mousedown(rct_window* w, rct_widgetindex widgetIndex,
|
||||
}
|
||||
|
||||
window_dropdown_show_text_custom_width(
|
||||
w->x + widget->left,
|
||||
w->y + widget->top,
|
||||
widget->bottom - widget->top + 1,
|
||||
w->colours[1],
|
||||
0,
|
||||
DROPDOWN_FLAG_STAY_OPEN,
|
||||
num_items,
|
||||
widget->right - widget->left - 3);
|
||||
w->x + widget->left, w->y + widget->top, widget->bottom - widget->top + 1, w->colours[1], 0,
|
||||
DROPDOWN_FLAG_STAY_OPEN, num_items, widget->right - widget->left - 3);
|
||||
|
||||
dropdown_set_checked((int32_t)theme_manager_get_active_available_theme_index(), true);
|
||||
widget_invalidate(w, WIDX_THEMES_DROPDOWN);
|
||||
@@ -1275,12 +1269,8 @@ static void window_options_mousedown(rct_window* w, rct_widgetindex widgetIndex,
|
||||
}
|
||||
|
||||
window_dropdown_show_text(
|
||||
w->x + widget->left,
|
||||
w->y + widget->top,
|
||||
widget->bottom - widget->top + 1,
|
||||
w->colours[1],
|
||||
DROPDOWN_FLAG_STAY_OPEN,
|
||||
num_items);
|
||||
w->x + widget->left, w->y + widget->top, widget->bottom - widget->top + 1, w->colours[1],
|
||||
DROPDOWN_FLAG_STAY_OPEN, num_items);
|
||||
|
||||
dropdown_set_checked((int32_t)title_get_current_sequence(), true);
|
||||
break;
|
||||
@@ -1293,14 +1283,8 @@ static void window_options_mousedown(rct_window* w, rct_widgetindex widgetIndex,
|
||||
gDropdownItemsArgs[1] = STR_OPTIONS_SCENARIO_ORIGIN;
|
||||
|
||||
window_dropdown_show_text_custom_width(
|
||||
w->x + widget->left,
|
||||
w->y + widget->top,
|
||||
widget->bottom - widget->top + 1,
|
||||
w->colours[1],
|
||||
0,
|
||||
DROPDOWN_FLAG_STAY_OPEN,
|
||||
num_items,
|
||||
widget->right - widget->left - 3);
|
||||
w->x + widget->left, w->y + widget->top, widget->bottom - widget->top + 1, w->colours[1], 0,
|
||||
DROPDOWN_FLAG_STAY_OPEN, num_items, widget->right - widget->left - 3);
|
||||
|
||||
dropdown_set_checked(gConfigGeneral.scenario_select_mode, true);
|
||||
break;
|
||||
@@ -1699,8 +1683,7 @@ static void window_options_invalidate(rct_window* w)
|
||||
widget_set_checkbox_value(w, WIDX_SHOW_GUEST_PURCHASES_CHECKBOX, gConfigGeneral.show_guest_purchases);
|
||||
widget_set_checkbox_value(w, WIDX_UPPER_CASE_BANNERS_CHECKBOX, gConfigGeneral.upper_case_banners);
|
||||
|
||||
rct_string_id VirtualFloorStyleStrings[] = { STR_VIRTUAL_FLOOR_STYLE_DISABLED,
|
||||
STR_VIRTUAL_FLOOR_STYLE_TRANSPARENT,
|
||||
rct_string_id VirtualFloorStyleStrings[] = { STR_VIRTUAL_FLOOR_STYLE_DISABLED, STR_VIRTUAL_FLOOR_STYLE_TRANSPARENT,
|
||||
STR_VIRTUAL_FLOOR_STYLE_GLASSY };
|
||||
|
||||
window_options_rendering_widgets[WIDX_VIRTUAL_FLOOR].text = VirtualFloorStyleStrings[gConfigGeneral
|
||||
@@ -1718,8 +1701,7 @@ static void window_options_invalidate(rct_window* w)
|
||||
}
|
||||
|
||||
widget_set_checkbox_value(
|
||||
w,
|
||||
WIDX_RENDER_WEATHER_EFFECTS_CHECKBOX,
|
||||
w, WIDX_RENDER_WEATHER_EFFECTS_CHECKBOX,
|
||||
gConfigGeneral.render_weather_effects || gConfigGeneral.render_weather_gloom);
|
||||
widget_set_checkbox_value(w, WIDX_DISABLE_LIGHTNING_EFFECT_CHECKBOX, gConfigGeneral.disable_lightning_effect);
|
||||
if (!gConfigGeneral.render_weather_effects && !gConfigGeneral.render_weather_gloom)
|
||||
@@ -1957,11 +1939,7 @@ static void window_options_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
||||
case WINDOW_OPTIONS_PAGE_DISPLAY:
|
||||
{
|
||||
gfx_draw_string_left(
|
||||
dpi,
|
||||
STR_FULLSCREEN_MODE,
|
||||
w,
|
||||
w->colours[1],
|
||||
w->x + 10,
|
||||
dpi, STR_FULLSCREEN_MODE, w, w->colours[1], w->x + 10,
|
||||
w->y + window_options_display_widgets[WIDX_FULLSCREEN].top + 1);
|
||||
|
||||
// Disable resolution dropdown on "Windowed" and "Fullscreen (desktop)"
|
||||
@@ -1971,35 +1949,19 @@ static void window_options_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
||||
colour |= COLOUR_FLAG_INSET;
|
||||
}
|
||||
gfx_draw_string_left(
|
||||
dpi,
|
||||
STR_DISPLAY_RESOLUTION,
|
||||
w,
|
||||
colour,
|
||||
w->x + 10 + 15,
|
||||
dpi, STR_DISPLAY_RESOLUTION, w, colour, w->x + 10 + 15,
|
||||
w->y + window_options_display_widgets[WIDX_RESOLUTION].top + 1);
|
||||
|
||||
gfx_draw_string_left(
|
||||
dpi,
|
||||
STR_UI_SCALING_DESC,
|
||||
w,
|
||||
w->colours[1],
|
||||
w->x + 10,
|
||||
dpi, STR_UI_SCALING_DESC, w, w->colours[1], w->x + 10,
|
||||
w->y + window_options_display_widgets[WIDX_SCALE].top + 1);
|
||||
gfx_draw_string_left(
|
||||
dpi,
|
||||
STR_DRAWING_ENGINE,
|
||||
w,
|
||||
w->colours[1],
|
||||
w->x + 10,
|
||||
dpi, STR_DRAWING_ENGINE, w, w->colours[1], w->x + 10,
|
||||
w->y + window_options_display_widgets[WIDX_DRAWING_ENGINE].top + 1);
|
||||
|
||||
int32_t scale = (int32_t)(gConfigGeneral.window_scale * 100);
|
||||
gfx_draw_string_left(
|
||||
dpi,
|
||||
STR_WINDOW_OBJECTIVE_VALUE_RATING,
|
||||
&scale,
|
||||
w->colours[1],
|
||||
w->x + w->widgets[WIDX_SCALE].left + 1,
|
||||
dpi, STR_WINDOW_OBJECTIVE_VALUE_RATING, &scale, w->colours[1], w->x + w->widgets[WIDX_SCALE].left + 1,
|
||||
w->y + w->widgets[WIDX_SCALE].top + 1);
|
||||
|
||||
colour = w->colours[1];
|
||||
@@ -2009,70 +1971,38 @@ static void window_options_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
||||
colour |= COLOUR_FLAG_INSET;
|
||||
}
|
||||
gfx_draw_string_left(
|
||||
dpi,
|
||||
STR_SCALING_QUALITY,
|
||||
w,
|
||||
colour,
|
||||
w->x + 25,
|
||||
dpi, STR_SCALING_QUALITY, w, colour, w->x + 25,
|
||||
w->y + window_options_display_widgets[WIDX_SCALE_QUALITY].top + 1);
|
||||
break;
|
||||
}
|
||||
|
||||
case WINDOW_OPTIONS_PAGE_CULTURE:
|
||||
gfx_draw_string_left(
|
||||
dpi,
|
||||
STR_OPTIONS_LANGUAGE,
|
||||
w,
|
||||
w->colours[1],
|
||||
w->x + 10,
|
||||
dpi, STR_OPTIONS_LANGUAGE, w, w->colours[1], w->x + 10,
|
||||
w->y + window_options_culture_widgets[WIDX_LANGUAGE].top + 1);
|
||||
gfx_draw_string_left(
|
||||
dpi, STR_CURRENCY, w, w->colours[1], w->x + 10, w->y + window_options_culture_widgets[WIDX_CURRENCY].top + 1);
|
||||
gfx_draw_string_left(
|
||||
dpi,
|
||||
STR_DISTANCE_AND_SPEED,
|
||||
w,
|
||||
w->colours[1],
|
||||
w->x + 10,
|
||||
dpi, STR_DISTANCE_AND_SPEED, w, w->colours[1], w->x + 10,
|
||||
w->y + window_options_culture_widgets[WIDX_DISTANCE].top + 1);
|
||||
gfx_draw_string_left(
|
||||
dpi,
|
||||
STR_TEMPERATURE,
|
||||
w,
|
||||
w->colours[1],
|
||||
w->x + 10,
|
||||
dpi, STR_TEMPERATURE, w, w->colours[1], w->x + 10,
|
||||
w->y + window_options_culture_widgets[WIDX_TEMPERATURE].top + 1);
|
||||
gfx_draw_string_left(
|
||||
dpi,
|
||||
STR_HEIGHT_LABELS,
|
||||
w,
|
||||
w->colours[1],
|
||||
w->x + 10,
|
||||
dpi, STR_HEIGHT_LABELS, w, w->colours[1], w->x + 10,
|
||||
w->y + window_options_culture_widgets[WIDX_HEIGHT_LABELS].top + 1);
|
||||
gfx_draw_string_left(
|
||||
dpi,
|
||||
STR_DATE_FORMAT,
|
||||
w,
|
||||
w->colours[1],
|
||||
w->x + 10,
|
||||
dpi, STR_DATE_FORMAT, w, w->colours[1], w->x + 10,
|
||||
w->y + window_options_culture_widgets[WIDX_DATE_FORMAT].top + 1);
|
||||
break;
|
||||
|
||||
case WINDOW_OPTIONS_PAGE_CONTROLS_AND_INTERFACE:
|
||||
{
|
||||
gfx_draw_string_left(
|
||||
dpi,
|
||||
STR_SHOW_TOOLBAR_BUTTONS_FOR,
|
||||
w,
|
||||
w->colours[1],
|
||||
w->x + 10,
|
||||
dpi, STR_SHOW_TOOLBAR_BUTTONS_FOR, w, w->colours[1], w->x + 10,
|
||||
w->y + window_options_controls_and_interface_widgets[WIDX_TOOLBAR_BUTTONS_GROUP].top + 15);
|
||||
gfx_draw_string_left(
|
||||
dpi,
|
||||
STR_THEMES_LABEL_CURRENT_THEME,
|
||||
nullptr,
|
||||
w->colours[1],
|
||||
w->x + 10,
|
||||
dpi, STR_THEMES_LABEL_CURRENT_THEME, nullptr, w->colours[1], w->x + 10,
|
||||
w->y + window_options_controls_and_interface_widgets[WIDX_THEMES].top + 1);
|
||||
break;
|
||||
}
|
||||
@@ -2080,25 +2010,13 @@ static void window_options_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
||||
case WINDOW_OPTIONS_PAGE_MISC:
|
||||
{
|
||||
gfx_draw_string_left(
|
||||
dpi,
|
||||
STR_TITLE_SEQUENCE,
|
||||
w,
|
||||
w->colours[1],
|
||||
w->x + 10,
|
||||
dpi, STR_TITLE_SEQUENCE, w, w->colours[1], w->x + 10,
|
||||
w->y + window_options_misc_widgets[WIDX_TITLE_SEQUENCE].top + 1);
|
||||
gfx_draw_string_left(
|
||||
dpi,
|
||||
STR_OPTIONS_SCENARIO_GROUPING,
|
||||
nullptr,
|
||||
w->colours[1],
|
||||
w->x + 10,
|
||||
dpi, STR_OPTIONS_SCENARIO_GROUPING, nullptr, w->colours[1], w->x + 10,
|
||||
w->y + window_options_misc_widgets[WIDX_SCENARIO_GROUPING].top + 1);
|
||||
gfx_draw_string_left(
|
||||
dpi,
|
||||
STR_DEFAULT_INSPECTION_INTERVAL,
|
||||
w,
|
||||
w->colours[1],
|
||||
w->x + 10,
|
||||
dpi, STR_DEFAULT_INSPECTION_INTERVAL, w, w->colours[1], w->x + 10,
|
||||
w->y + window_options_misc_widgets[WIDX_DEFAULT_INSPECTION_INTERVAL].top + 1);
|
||||
break;
|
||||
}
|
||||
@@ -2106,17 +2024,10 @@ static void window_options_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
||||
case WINDOW_OPTIONS_PAGE_ADVANCED:
|
||||
{
|
||||
gfx_draw_string_left(
|
||||
dpi,
|
||||
STR_OPTIONS_AUTOSAVE_FREQUENCY_LABEL,
|
||||
w,
|
||||
w->colours[1],
|
||||
w->x + 24,
|
||||
dpi, STR_OPTIONS_AUTOSAVE_FREQUENCY_LABEL, w, w->colours[1], w->x + 24,
|
||||
w->y + window_options_advanced_widgets[WIDX_AUTOSAVE].top + 1);
|
||||
gfx_draw_string_left(
|
||||
dpi,
|
||||
window_options_autosave_names[gConfigGeneral.autosave_frequency],
|
||||
nullptr,
|
||||
w->colours[1],
|
||||
dpi, window_options_autosave_names[gConfigGeneral.autosave_frequency], nullptr, w->colours[1],
|
||||
w->x + window_options_advanced_widgets[WIDX_AUTOSAVE].left + 1,
|
||||
w->y + window_options_advanced_widgets[WIDX_AUTOSAVE].top);
|
||||
|
||||
@@ -2134,12 +2045,7 @@ static void window_options_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
||||
uint32_t padding = widgetHeight > lineHeight ? (widgetHeight - lineHeight) / 2 : 0;
|
||||
|
||||
gfx_draw_string_left_clipped(
|
||||
dpi,
|
||||
STR_STRING,
|
||||
gCommonFormatArgs,
|
||||
w->colours[1],
|
||||
w->x + pathWidget.left + 1,
|
||||
w->y + pathWidget.top + padding,
|
||||
dpi, STR_STRING, gCommonFormatArgs, w->colours[1], w->x + pathWidget.left + 1, w->y + pathWidget.top + padding,
|
||||
277);
|
||||
break;
|
||||
}
|
||||
@@ -2150,14 +2056,8 @@ static void window_options_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
||||
static void window_options_show_dropdown(rct_window* w, rct_widget* widget, int32_t num_items)
|
||||
{
|
||||
window_dropdown_show_text_custom_width(
|
||||
w->x + widget->left,
|
||||
w->y + widget->top,
|
||||
widget->bottom - widget->top + 1,
|
||||
w->colours[1],
|
||||
0,
|
||||
DROPDOWN_FLAG_STAY_OPEN,
|
||||
num_items,
|
||||
widget->right - widget->left - 3);
|
||||
w->x + widget->left, w->y + widget->top, widget->bottom - widget->top + 1, w->colours[1], 0, DROPDOWN_FLAG_STAY_OPEN,
|
||||
num_items, widget->right - widget->left - 3);
|
||||
}
|
||||
|
||||
static void window_options_update_height_markers()
|
||||
|
||||
@@ -861,13 +861,8 @@ static void window_park_entrance_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
||||
|
||||
labelWidget = &window_park_entrance_widgets[WIDX_STATUS];
|
||||
gfx_draw_string_centred_clipped(
|
||||
dpi,
|
||||
STR_BLACK_STRING,
|
||||
gCommonFormatArgs,
|
||||
COLOUR_BLACK,
|
||||
w->x + (labelWidget->left + labelWidget->right) / 2,
|
||||
w->y + labelWidget->top,
|
||||
labelWidget->right - labelWidget->left);
|
||||
dpi, STR_BLACK_STRING, gCommonFormatArgs, COLOUR_BLACK, w->x + (labelWidget->left + labelWidget->right) / 2,
|
||||
w->y + labelWidget->top, labelWidget->right - labelWidget->left);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -929,17 +924,9 @@ static void window_park_init_viewport(rct_window* w)
|
||||
{
|
||||
rct_widget* viewportWidget = &window_park_entrance_widgets[WIDX_VIEWPORT];
|
||||
viewport_create(
|
||||
w,
|
||||
w->x + viewportWidget->left + 1,
|
||||
w->y + viewportWidget->top + 1,
|
||||
(viewportWidget->right - viewportWidget->left) - 1,
|
||||
(viewportWidget->bottom - viewportWidget->top) - 1,
|
||||
0,
|
||||
x,
|
||||
y,
|
||||
z,
|
||||
w->viewport_focus_sprite.type & VIEWPORT_FOCUS_TYPE_MASK,
|
||||
-1);
|
||||
w, w->x + viewportWidget->left + 1, w->y + viewportWidget->top + 1,
|
||||
(viewportWidget->right - viewportWidget->left) - 1, (viewportWidget->bottom - viewportWidget->top) - 1, 0, x, y,
|
||||
z, w->viewport_focus_sprite.type & VIEWPORT_FOCUS_TYPE_MASK, -1);
|
||||
w->flags |= (1 << 2);
|
||||
window_invalidate(w);
|
||||
}
|
||||
@@ -1061,12 +1048,7 @@ static void window_park_rating_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
||||
|
||||
// Graph border
|
||||
gfx_fill_rect_inset(
|
||||
dpi,
|
||||
x + widget->left + 4,
|
||||
y + widget->top + 15,
|
||||
x + widget->right - 4,
|
||||
y + widget->bottom - 4,
|
||||
w->colours[1],
|
||||
dpi, x + widget->left + 4, y + widget->top + 15, x + widget->right - 4, y + widget->bottom - 4, w->colours[1],
|
||||
INSET_RECT_F_30);
|
||||
|
||||
// Graph
|
||||
@@ -1189,12 +1171,7 @@ static void window_park_guests_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
||||
|
||||
// Graph border
|
||||
gfx_fill_rect_inset(
|
||||
dpi,
|
||||
x + widget->left + 4,
|
||||
y + widget->top + 15,
|
||||
x + widget->right - 4,
|
||||
y + widget->bottom - 4,
|
||||
w->colours[1],
|
||||
dpi, x + widget->left + 4, y + widget->top + 15, x + widget->right - 4, y + widget->bottom - 4, w->colours[1],
|
||||
INSET_RECT_F_30);
|
||||
|
||||
// Graph
|
||||
@@ -1836,11 +1813,8 @@ static void window_park_draw_tab_images(rct_drawpixelinfo* dpi, rct_window* w)
|
||||
|
||||
sprite_idx |= 0xA9E00000;
|
||||
gfx_draw_sprite(
|
||||
dpi,
|
||||
sprite_idx,
|
||||
w->x + (w->widgets[WIDX_TAB_3].left + w->widgets[WIDX_TAB_3].right) / 2,
|
||||
w->y + w->widgets[WIDX_TAB_3].bottom - 9,
|
||||
0);
|
||||
dpi, sprite_idx, w->x + (w->widgets[WIDX_TAB_3].left + w->widgets[WIDX_TAB_3].right) / 2,
|
||||
w->y + w->widgets[WIDX_TAB_3].bottom - 9, 0);
|
||||
}
|
||||
|
||||
// Price tab
|
||||
|
||||
@@ -236,14 +236,8 @@ static void window_player_overview_show_group_dropdown(rct_window* w, rct_widget
|
||||
numItems = network_get_num_groups();
|
||||
|
||||
window_dropdown_show_text_custom_width(
|
||||
w->x + dropdownWidget->left,
|
||||
w->y + dropdownWidget->top,
|
||||
dropdownWidget->bottom - dropdownWidget->top + 1,
|
||||
w->colours[1],
|
||||
0,
|
||||
0,
|
||||
numItems,
|
||||
widget->right - dropdownWidget->left);
|
||||
w->x + dropdownWidget->left, w->y + dropdownWidget->top, dropdownWidget->bottom - dropdownWidget->top + 1,
|
||||
w->colours[1], 0, 0, numItems, widget->right - dropdownWidget->left);
|
||||
|
||||
for (i = 0; i < network_get_num_groups(); i++)
|
||||
{
|
||||
@@ -371,13 +365,8 @@ void window_player_overview_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
||||
set_format_arg(0, const char*, buffer);
|
||||
|
||||
gfx_draw_string_centred_clipped(
|
||||
dpi,
|
||||
STR_STRING,
|
||||
gCommonFormatArgs,
|
||||
COLOUR_BLACK,
|
||||
w->x + (widget->left + widget->right - 11) / 2,
|
||||
w->y + widget->top,
|
||||
widget->right - widget->left - 8);
|
||||
dpi, STR_STRING, gCommonFormatArgs, COLOUR_BLACK, w->x + (widget->left + widget->right - 11) / 2,
|
||||
w->y + widget->top, widget->right - widget->left - 8);
|
||||
}
|
||||
|
||||
// Draw ping
|
||||
|
||||
@@ -463,14 +463,8 @@ static void window_research_funding_mousedown(rct_window* w, rct_widgetindex wid
|
||||
gDropdownItemsArgs[i] = ResearchFundingLevelNames[i];
|
||||
}
|
||||
window_dropdown_show_text_custom_width(
|
||||
w->x + dropdownWidget->left,
|
||||
w->y + dropdownWidget->top,
|
||||
dropdownWidget->bottom - dropdownWidget->top + 1,
|
||||
w->colours[1],
|
||||
0,
|
||||
DROPDOWN_FLAG_STAY_OPEN,
|
||||
4,
|
||||
dropdownWidget->right - dropdownWidget->left - 3);
|
||||
w->x + dropdownWidget->left, w->y + dropdownWidget->top, dropdownWidget->bottom - dropdownWidget->top + 1,
|
||||
w->colours[1], 0, DROPDOWN_FLAG_STAY_OPEN, 4, dropdownWidget->right - dropdownWidget->left - 3);
|
||||
|
||||
int32_t currentResearchLevel = gResearchFundingLevel;
|
||||
dropdown_set_checked(currentResearchLevel, true);
|
||||
|
||||
@@ -1924,17 +1924,8 @@ static void window_ride_init_viewport(rct_window* w)
|
||||
int32_t width = view_widget->right - view_widget->left - 1;
|
||||
int32_t height = view_widget->bottom - view_widget->top - 1;
|
||||
viewport_create(
|
||||
w,
|
||||
x,
|
||||
y,
|
||||
width,
|
||||
height,
|
||||
focus.coordinate.zoom,
|
||||
focus.coordinate.x,
|
||||
focus.coordinate.y & VIEWPORT_FOCUS_Y_MASK,
|
||||
focus.coordinate.z,
|
||||
focus.sprite.type & VIEWPORT_FOCUS_TYPE_MASK,
|
||||
focus.sprite.sprite_id);
|
||||
w, x, y, width, height, focus.coordinate.zoom, focus.coordinate.x, focus.coordinate.y & VIEWPORT_FOCUS_Y_MASK,
|
||||
focus.coordinate.z, focus.sprite.type & VIEWPORT_FOCUS_TYPE_MASK, focus.sprite.sprite_id);
|
||||
|
||||
w->flags |= WF_NO_SCROLLING;
|
||||
window_invalidate(w);
|
||||
@@ -1957,12 +1948,7 @@ static void window_ride_rename(rct_window* w)
|
||||
ride = get_ride(w->number);
|
||||
set_format_arg(16, uint32_t, ride->name_arguments);
|
||||
window_text_input_open(
|
||||
w,
|
||||
WIDX_RENAME,
|
||||
STR_RIDE_ATTRACTION_NAME,
|
||||
STR_ENTER_NEW_NAME_FOR_THIS_RIDE_ATTRACTION,
|
||||
ride->name,
|
||||
ride->name_arguments,
|
||||
w, WIDX_RENAME, STR_RIDE_ATTRACTION_NAME, STR_ENTER_NEW_NAME_FOR_THIS_RIDE_ATTRACTION, ride->name, ride->name_arguments,
|
||||
32);
|
||||
}
|
||||
|
||||
@@ -2064,14 +2050,8 @@ static void window_ride_show_view_dropdown(rct_window* w, rct_widget* widget)
|
||||
}
|
||||
|
||||
window_dropdown_show_text_custom_width(
|
||||
w->x + dropdownWidget->left,
|
||||
w->y + dropdownWidget->top,
|
||||
dropdownWidget->bottom - dropdownWidget->top + 1,
|
||||
w->colours[1],
|
||||
0,
|
||||
0,
|
||||
numItems,
|
||||
widget->right - dropdownWidget->left);
|
||||
w->x + dropdownWidget->left, w->y + dropdownWidget->top, dropdownWidget->bottom - dropdownWidget->top + 1,
|
||||
w->colours[1], 0, 0, numItems, widget->right - dropdownWidget->left);
|
||||
|
||||
// First item
|
||||
gDropdownItemsFormat[0] = STR_DROPDOWN_MENU_LABEL;
|
||||
@@ -2219,12 +2199,8 @@ static void window_ride_show_ride_type_dropdown(rct_window* w, rct_widget* widge
|
||||
|
||||
rct_widget* dropdownWidget = widget - 1;
|
||||
window_dropdown_show_text(
|
||||
w->x + dropdownWidget->left,
|
||||
w->y + dropdownWidget->top,
|
||||
dropdownWidget->bottom - dropdownWidget->top + 1,
|
||||
w->colours[1],
|
||||
DROPDOWN_FLAG_STAY_OPEN,
|
||||
RIDE_TYPE_COUNT);
|
||||
w->x + dropdownWidget->left, w->y + dropdownWidget->top, dropdownWidget->bottom - dropdownWidget->top + 1,
|
||||
w->colours[1], DROPDOWN_FLAG_STAY_OPEN, RIDE_TYPE_COUNT);
|
||||
|
||||
// Find the current ride type in the ordered list.
|
||||
uint8_t pos = 0;
|
||||
@@ -2300,8 +2276,7 @@ static void populate_vehicle_type_dropdown(Ride* ride)
|
||||
continue;
|
||||
}
|
||||
|
||||
VehicleTypeLabel label = { rideEntryIndex,
|
||||
currentRideEntry->naming.name,
|
||||
VehicleTypeLabel label = { rideEntryIndex, currentRideEntry->naming.name,
|
||||
ls.GetString(currentRideEntry->naming.name) };
|
||||
VehicleDropdownData.push_back(label);
|
||||
}
|
||||
@@ -2331,14 +2306,8 @@ static void window_ride_show_vehicle_type_dropdown(rct_window* w, rct_widget* wi
|
||||
|
||||
rct_widget* dropdownWidget = widget - 1;
|
||||
window_dropdown_show_text_custom_width(
|
||||
w->x + dropdownWidget->left,
|
||||
w->y + dropdownWidget->top,
|
||||
dropdownWidget->bottom - dropdownWidget->top + 1,
|
||||
w->colours[1],
|
||||
0,
|
||||
DROPDOWN_FLAG_STAY_OPEN,
|
||||
numItems,
|
||||
widget->right - dropdownWidget->left);
|
||||
w->x + dropdownWidget->left, w->y + dropdownWidget->top, dropdownWidget->bottom - dropdownWidget->top + 1,
|
||||
w->colours[1], 0, DROPDOWN_FLAG_STAY_OPEN, numItems, widget->right - dropdownWidget->left);
|
||||
|
||||
// Find the current vehicle type in the ordered list.
|
||||
uint8_t pos = 0;
|
||||
@@ -2798,23 +2767,14 @@ static void window_ride_main_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
||||
|
||||
widget = &window_ride_main_widgets[WIDX_VIEW];
|
||||
gfx_draw_string_centred(
|
||||
dpi,
|
||||
STR_WINDOW_COLOUR_2_STRINGID,
|
||||
w->x + (widget->left + widget->right - 11) / 2,
|
||||
w->y + widget->top,
|
||||
COLOUR_BLACK,
|
||||
dpi, STR_WINDOW_COLOUR_2_STRINGID, w->x + (widget->left + widget->right - 11) / 2, w->y + widget->top, COLOUR_BLACK,
|
||||
gCommonFormatArgs);
|
||||
|
||||
// Status
|
||||
widget = &window_ride_main_widgets[WIDX_STATUS];
|
||||
gfx_draw_string_centred_clipped(
|
||||
dpi,
|
||||
window_ride_get_status(w, gCommonFormatArgs),
|
||||
gCommonFormatArgs,
|
||||
COLOUR_BLACK,
|
||||
w->x + (widget->left + widget->right) / 2,
|
||||
w->y + widget->top,
|
||||
widget->right - widget->left);
|
||||
dpi, window_ride_get_status(w, gCommonFormatArgs), gCommonFormatArgs, COLOUR_BLACK,
|
||||
w->x + (widget->left + widget->right) / 2, w->y + widget->top, widget->right - widget->left);
|
||||
}
|
||||
|
||||
#pragma endregion
|
||||
@@ -3281,14 +3241,8 @@ static void window_ride_mode_dropdown(rct_window* w, rct_widget* widget)
|
||||
gDropdownItemsArgs[i] = RideModeNames[availableModes[i]];
|
||||
}
|
||||
window_dropdown_show_text_custom_width(
|
||||
w->x + dropdownWidget->left,
|
||||
w->y + dropdownWidget->top,
|
||||
dropdownWidget->bottom - dropdownWidget->top + 1,
|
||||
w->colours[1],
|
||||
0,
|
||||
DROPDOWN_FLAG_STAY_OPEN,
|
||||
numAvailableModes,
|
||||
widget->right - dropdownWidget->left);
|
||||
w->x + dropdownWidget->left, w->y + dropdownWidget->top, dropdownWidget->bottom - dropdownWidget->top + 1,
|
||||
w->colours[1], 0, DROPDOWN_FLAG_STAY_OPEN, numAvailableModes, widget->right - dropdownWidget->left);
|
||||
|
||||
// Set checked item
|
||||
for (i = 0; i < numAvailableModes; i++)
|
||||
@@ -3318,14 +3272,8 @@ static void window_ride_load_dropdown(rct_window* w, rct_widget* widget)
|
||||
gDropdownItemsArgs[i] = VehicleLoadNames[i];
|
||||
}
|
||||
window_dropdown_show_text_custom_width(
|
||||
w->x + dropdownWidget->left,
|
||||
w->y + dropdownWidget->top,
|
||||
dropdownWidget->bottom - dropdownWidget->top + 1,
|
||||
w->colours[1],
|
||||
0,
|
||||
DROPDOWN_FLAG_STAY_OPEN,
|
||||
5,
|
||||
widget->right - dropdownWidget->left);
|
||||
w->x + dropdownWidget->left, w->y + dropdownWidget->top, dropdownWidget->bottom - dropdownWidget->top + 1,
|
||||
w->colours[1], 0, DROPDOWN_FLAG_STAY_OPEN, 5, widget->right - dropdownWidget->left);
|
||||
|
||||
dropdown_set_checked(ride->depart_flags & RIDE_DEPART_WAIT_FOR_LOAD_MASK, true);
|
||||
}
|
||||
@@ -3407,48 +3355,42 @@ static void window_ride_operating_mousedown(rct_window* w, rct_widgetindex widge
|
||||
upper_bound = gCheatsFastLiftHill ? 255 : RideLiftData[ride->type].maximum_speed;
|
||||
lower_bound = gCheatsFastLiftHill ? 0 : RideLiftData[ride->type].minimum_speed;
|
||||
set_operating_setting(
|
||||
w->number,
|
||||
RIDE_SETTING_LIFT_HILL_SPEED,
|
||||
w->number, RIDE_SETTING_LIFT_HILL_SPEED,
|
||||
Math::Clamp<int16_t>(lower_bound, ride->lift_hill_speed + 1, upper_bound));
|
||||
break;
|
||||
case WIDX_LIFT_HILL_SPEED_DECREASE:
|
||||
upper_bound = gCheatsFastLiftHill ? 255 : RideLiftData[ride->type].maximum_speed;
|
||||
lower_bound = gCheatsFastLiftHill ? 0 : RideLiftData[ride->type].minimum_speed;
|
||||
set_operating_setting(
|
||||
w->number,
|
||||
RIDE_SETTING_LIFT_HILL_SPEED,
|
||||
w->number, RIDE_SETTING_LIFT_HILL_SPEED,
|
||||
Math::Clamp<int16_t>(lower_bound, ride->lift_hill_speed - 1, upper_bound));
|
||||
break;
|
||||
case WIDX_MINIMUM_LENGTH_INCREASE:
|
||||
upper_bound = 250;
|
||||
lower_bound = 0;
|
||||
set_operating_setting(
|
||||
w->number,
|
||||
RIDE_SETTING_MIN_WAITING_TIME,
|
||||
w->number, RIDE_SETTING_MIN_WAITING_TIME,
|
||||
Math::Clamp<int16_t>(lower_bound, ride->min_waiting_time + 1, upper_bound));
|
||||
break;
|
||||
case WIDX_MINIMUM_LENGTH_DECREASE:
|
||||
upper_bound = 250;
|
||||
lower_bound = 0;
|
||||
set_operating_setting(
|
||||
w->number,
|
||||
RIDE_SETTING_MIN_WAITING_TIME,
|
||||
w->number, RIDE_SETTING_MIN_WAITING_TIME,
|
||||
Math::Clamp<int16_t>(lower_bound, ride->min_waiting_time - 1, upper_bound));
|
||||
break;
|
||||
case WIDX_MAXIMUM_LENGTH_INCREASE:
|
||||
upper_bound = 250;
|
||||
lower_bound = 0;
|
||||
set_operating_setting(
|
||||
w->number,
|
||||
RIDE_SETTING_MAX_WAITING_TIME,
|
||||
w->number, RIDE_SETTING_MAX_WAITING_TIME,
|
||||
Math::Clamp<int16_t>(lower_bound, ride->max_waiting_time + 1, upper_bound));
|
||||
break;
|
||||
case WIDX_MAXIMUM_LENGTH_DECREASE:
|
||||
upper_bound = 250;
|
||||
lower_bound = 0;
|
||||
set_operating_setting(
|
||||
w->number,
|
||||
RIDE_SETTING_MAX_WAITING_TIME,
|
||||
w->number, RIDE_SETTING_MAX_WAITING_TIME,
|
||||
Math::Clamp<int16_t>(lower_bound, ride->max_waiting_time - 1, upper_bound));
|
||||
break;
|
||||
case WIDX_MODE_DROPDOWN:
|
||||
@@ -3769,12 +3711,8 @@ static void window_ride_operating_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
||||
|
||||
// Horizontal rule between mode settings and depart settings
|
||||
gfx_fill_rect_inset(
|
||||
dpi,
|
||||
w->x + window_ride_operating_widgets[WIDX_PAGE_BACKGROUND].left + 4,
|
||||
w->y + 103,
|
||||
w->x + window_ride_operating_widgets[WIDX_PAGE_BACKGROUND].right - 5,
|
||||
w->y + 104,
|
||||
w->colours[1],
|
||||
dpi, w->x + window_ride_operating_widgets[WIDX_PAGE_BACKGROUND].left + 4, w->y + 103,
|
||||
w->x + window_ride_operating_widgets[WIDX_PAGE_BACKGROUND].right - 5, w->y + 104, w->colours[1],
|
||||
INSET_RECT_FLAG_BORDER_INSET);
|
||||
|
||||
// Number of block sections
|
||||
@@ -3782,11 +3720,7 @@ static void window_ride_operating_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
||||
{
|
||||
blockSections = ride->num_block_brakes + ride->num_stations;
|
||||
gfx_draw_string_left(
|
||||
dpi,
|
||||
STR_BLOCK_SECTIONS,
|
||||
&blockSections,
|
||||
COLOUR_BLACK,
|
||||
w->x + 21,
|
||||
dpi, STR_BLOCK_SECTIONS, &blockSections, COLOUR_BLACK, w->x + 21,
|
||||
ride->mode == RIDE_MODE_POWERED_LAUNCH_BLOCK_SECTIONED ? w->y + 89 : w->y + 61);
|
||||
}
|
||||
}
|
||||
@@ -3912,14 +3846,8 @@ static void window_ride_maintenance_mousedown(rct_window* w, rct_widgetindex wid
|
||||
gDropdownItemsArgs[i] = RideInspectionIntervalNames[i];
|
||||
}
|
||||
window_dropdown_show_text_custom_width(
|
||||
w->x + dropdownWidget->left,
|
||||
w->y + dropdownWidget->top,
|
||||
dropdownWidget->bottom - dropdownWidget->top + 1,
|
||||
w->colours[1],
|
||||
0,
|
||||
DROPDOWN_FLAG_STAY_OPEN,
|
||||
7,
|
||||
widget->right - dropdownWidget->left);
|
||||
w->x + dropdownWidget->left, w->y + dropdownWidget->top, dropdownWidget->bottom - dropdownWidget->top + 1,
|
||||
w->colours[1], 0, DROPDOWN_FLAG_STAY_OPEN, 7, widget->right - dropdownWidget->left);
|
||||
|
||||
dropdown_set_checked(ride->inspection_interval, true);
|
||||
break;
|
||||
@@ -3957,12 +3885,8 @@ static void window_ride_maintenance_mousedown(rct_window* w, rct_widgetindex wid
|
||||
else
|
||||
{
|
||||
window_dropdown_show_text(
|
||||
w->x + dropdownWidget->left,
|
||||
w->y + dropdownWidget->top,
|
||||
dropdownWidget->bottom - dropdownWidget->top + 1,
|
||||
w->colours[1],
|
||||
DROPDOWN_FLAG_STAY_OPEN,
|
||||
num_items);
|
||||
w->x + dropdownWidget->left, w->y + dropdownWidget->top, dropdownWidget->bottom - dropdownWidget->top + 1,
|
||||
w->colours[1], DROPDOWN_FLAG_STAY_OPEN, num_items);
|
||||
|
||||
num_items = 1;
|
||||
int32_t breakdownReason = ride->breakdown_reason_pending;
|
||||
@@ -4427,14 +4351,8 @@ static void window_ride_colour_mousedown(rct_window* w, rct_widgetindex widgetIn
|
||||
}
|
||||
|
||||
window_dropdown_show_text_custom_width(
|
||||
w->x + dropdownWidget->left,
|
||||
w->y + dropdownWidget->top,
|
||||
dropdownWidget->bottom - dropdownWidget->top + 1,
|
||||
w->colours[1],
|
||||
0,
|
||||
DROPDOWN_FLAG_STAY_OPEN,
|
||||
4,
|
||||
widget->right - dropdownWidget->left);
|
||||
w->x + dropdownWidget->left, w->y + dropdownWidget->top, dropdownWidget->bottom - dropdownWidget->top + 1,
|
||||
w->colours[1], 0, DROPDOWN_FLAG_STAY_OPEN, 4, widget->right - dropdownWidget->left);
|
||||
|
||||
dropdown_set_checked(colourSchemeIndex, true);
|
||||
break;
|
||||
@@ -4455,14 +4373,8 @@ static void window_ride_colour_mousedown(rct_window* w, rct_widgetindex widgetIn
|
||||
}
|
||||
|
||||
window_dropdown_show_text_custom_width(
|
||||
w->x + dropdownWidget->left,
|
||||
w->y + dropdownWidget->top,
|
||||
dropdownWidget->bottom - dropdownWidget->top + 1,
|
||||
w->colours[1],
|
||||
0,
|
||||
DROPDOWN_FLAG_STAY_OPEN,
|
||||
4,
|
||||
widget->right - dropdownWidget->left);
|
||||
w->x + dropdownWidget->left, w->y + dropdownWidget->top, dropdownWidget->bottom - dropdownWidget->top + 1,
|
||||
w->colours[1], 0, DROPDOWN_FLAG_STAY_OPEN, 4, widget->right - dropdownWidget->left);
|
||||
|
||||
dropdown_set_checked(ride->track_colour_supports[colourSchemeIndex], true);
|
||||
break;
|
||||
@@ -4480,13 +4392,8 @@ static void window_ride_colour_mousedown(rct_window* w, rct_widgetindex widgetIn
|
||||
}
|
||||
|
||||
window_dropdown_show_text_custom_width(
|
||||
w->x + dropdownWidget->left,
|
||||
w->y + dropdownWidget->top,
|
||||
dropdownWidget->bottom - dropdownWidget->top + 1,
|
||||
w->colours[1],
|
||||
0,
|
||||
DROPDOWN_FLAG_STAY_OPEN,
|
||||
Util::CountOf(window_ride_entrance_style_list),
|
||||
w->x + dropdownWidget->left, w->y + dropdownWidget->top, dropdownWidget->bottom - dropdownWidget->top + 1,
|
||||
w->colours[1], 0, DROPDOWN_FLAG_STAY_OPEN, Util::CountOf(window_ride_entrance_style_list),
|
||||
widget->right - dropdownWidget->left);
|
||||
|
||||
if (checkedIndex != -1)
|
||||
@@ -4503,13 +4410,8 @@ static void window_ride_colour_mousedown(rct_window* w, rct_widgetindex widgetIn
|
||||
}
|
||||
|
||||
window_dropdown_show_text_custom_width(
|
||||
w->x + dropdownWidget->left,
|
||||
w->y + dropdownWidget->top,
|
||||
dropdownWidget->bottom - dropdownWidget->top + 1,
|
||||
w->colours[1],
|
||||
0,
|
||||
DROPDOWN_FLAG_STAY_OPEN,
|
||||
rideEntry->max_cars_in_train > 1 ? 3 : 2,
|
||||
w->x + dropdownWidget->left, w->y + dropdownWidget->top, dropdownWidget->bottom - dropdownWidget->top + 1,
|
||||
w->colours[1], 0, DROPDOWN_FLAG_STAY_OPEN, rideEntry->max_cars_in_train > 1 ? 3 : 2,
|
||||
widget->right - dropdownWidget->left);
|
||||
|
||||
dropdown_set_checked(ride->colour_scheme_type & 3, true);
|
||||
@@ -4529,14 +4431,8 @@ static void window_ride_colour_mousedown(rct_window* w, rct_widgetindex widgetIn
|
||||
}
|
||||
|
||||
window_dropdown_show_text_custom_width(
|
||||
w->x + dropdownWidget->left,
|
||||
w->y + dropdownWidget->top,
|
||||
dropdownWidget->bottom - dropdownWidget->top + 1,
|
||||
w->colours[1],
|
||||
0,
|
||||
DROPDOWN_FLAG_STAY_OPEN,
|
||||
numItems,
|
||||
widget->right - dropdownWidget->left);
|
||||
w->x + dropdownWidget->left, w->y + dropdownWidget->top, dropdownWidget->bottom - dropdownWidget->top + 1,
|
||||
w->colours[1], 0, DROPDOWN_FLAG_STAY_OPEN, numItems, widget->right - dropdownWidget->left);
|
||||
|
||||
dropdown_set_checked(w->vehicleIndex, true);
|
||||
break;
|
||||
@@ -4588,13 +4484,8 @@ static void window_ride_colour_dropdown(rct_window* w, rct_widgetindex widgetInd
|
||||
break;
|
||||
case WIDX_ENTRANCE_STYLE_DROPDOWN:
|
||||
game_do_command(
|
||||
0,
|
||||
(6 << 8) | 1,
|
||||
0,
|
||||
(window_ride_entrance_style_list[dropdownIndex] << 8) | w->number,
|
||||
GAME_COMMAND_SET_RIDE_APPEARANCE,
|
||||
0,
|
||||
0);
|
||||
0, (6 << 8) | 1, 0, (window_ride_entrance_style_list[dropdownIndex] << 8) | w->number,
|
||||
GAME_COMMAND_SET_RIDE_APPEARANCE, 0, 0);
|
||||
break;
|
||||
case WIDX_VEHICLE_COLOUR_SCHEME_DROPDOWN:
|
||||
game_do_command(0, (5 << 8) | 1, 0, (dropdownIndex << 8) | w->number, GAME_COMMAND_SET_RIDE_APPEARANCE, 0, 0);
|
||||
@@ -4892,11 +4783,7 @@ static void window_ride_colour_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
||||
widget = &window_ride_colour_widgets[WIDX_TRACK_PREVIEW];
|
||||
if (widget->type != WWT_EMPTY)
|
||||
gfx_fill_rect(
|
||||
dpi,
|
||||
w->x + widget->left + 1,
|
||||
w->y + widget->top + 1,
|
||||
w->x + widget->right - 1,
|
||||
w->y + widget->bottom - 1,
|
||||
dpi, w->x + widget->left + 1, w->y + widget->top + 1, w->x + widget->right - 1, w->y + widget->bottom - 1,
|
||||
PALETTE_INDEX_12);
|
||||
|
||||
track_colour trackColour = ride_get_track_colour(ride, w->ride_colour);
|
||||
@@ -4950,11 +4837,7 @@ static void window_ride_colour_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
||||
if (widget->type != WWT_EMPTY)
|
||||
{
|
||||
if (clip_drawpixelinfo(
|
||||
&clippedDpi,
|
||||
dpi,
|
||||
w->x + widget->left + 1,
|
||||
w->y + widget->top + 1,
|
||||
widget->right - widget->left,
|
||||
&clippedDpi, dpi, w->x + widget->left + 1, w->y + widget->top + 1, widget->right - widget->left,
|
||||
widget->bottom - widget->top))
|
||||
{
|
||||
gfx_clear(&clippedDpi, PALETTE_INDEX_12);
|
||||
@@ -5135,14 +5018,8 @@ static void window_ride_music_mousedown(rct_window* w, rct_widgetindex widgetInd
|
||||
}
|
||||
|
||||
window_dropdown_show_text_custom_width(
|
||||
w->x + dropdownWidget->left,
|
||||
w->y + dropdownWidget->top,
|
||||
dropdownWidget->bottom - dropdownWidget->top + 1,
|
||||
w->colours[1],
|
||||
0,
|
||||
DROPDOWN_FLAG_STAY_OPEN,
|
||||
numItems,
|
||||
widget->right - dropdownWidget->left);
|
||||
w->x + dropdownWidget->left, w->y + dropdownWidget->top, dropdownWidget->bottom - dropdownWidget->top + 1,
|
||||
w->colours[1], 0, DROPDOWN_FLAG_STAY_OPEN, numItems, widget->right - dropdownWidget->left);
|
||||
|
||||
for (i = 0; i < numItems; i++)
|
||||
{
|
||||
|
||||
@@ -459,23 +459,11 @@ static void window_ride_construction_entrance_click(rct_window* w);
|
||||
static void window_ride_construction_exit_click(rct_window* w);
|
||||
|
||||
static void window_ride_construction_draw_track_piece(
|
||||
rct_window* w,
|
||||
rct_drawpixelinfo* dpi,
|
||||
int32_t rideIndex,
|
||||
int32_t trackType,
|
||||
int32_t trackDirection,
|
||||
int32_t unknown,
|
||||
int32_t width,
|
||||
int32_t height);
|
||||
rct_window* w, rct_drawpixelinfo* dpi, int32_t rideIndex, int32_t trackType, int32_t trackDirection, int32_t unknown,
|
||||
int32_t width, int32_t height);
|
||||
static void sub_6CBCE2(
|
||||
rct_drawpixelinfo* dpi,
|
||||
int32_t rideIndex,
|
||||
int32_t trackType,
|
||||
int32_t trackDirection,
|
||||
int32_t edx,
|
||||
int32_t originX,
|
||||
int32_t originY,
|
||||
int32_t originZ);
|
||||
rct_drawpixelinfo* dpi, int32_t rideIndex, int32_t trackType, int32_t trackDirection, int32_t edx, int32_t originX,
|
||||
int32_t originY, int32_t originZ);
|
||||
static void window_ride_construction_update_map_selection();
|
||||
static void window_ride_construction_update_possible_ride_configurations();
|
||||
static void window_ride_construction_update_widgets(rct_window* w);
|
||||
@@ -1693,12 +1681,8 @@ static void window_ride_construction_construct(rct_window* w)
|
||||
|
||||
gGameCommandErrorTitle = STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE;
|
||||
_trackPlaceCost = game_do_command(
|
||||
x,
|
||||
(GAME_COMMAND_FLAG_APPLY) | (trackDirection << 8),
|
||||
y,
|
||||
rideIndex | (trackType << 8) | (liftHillAndAlternativeState << 16),
|
||||
GAME_COMMAND_PLACE_TRACK,
|
||||
z | (properties << 16),
|
||||
x, (GAME_COMMAND_FLAG_APPLY) | (trackDirection << 8), y,
|
||||
rideIndex | (trackType << 8) | (liftHillAndAlternativeState << 16), GAME_COMMAND_PLACE_TRACK, z | (properties << 16),
|
||||
0);
|
||||
if (_trackPlaceCost == MONEY32_UNDEFINED)
|
||||
{
|
||||
@@ -1886,11 +1870,7 @@ static void window_ride_construction_mouseup_demolish(rct_window* w)
|
||||
}
|
||||
|
||||
money32 cost = ride_remove_track_piece(
|
||||
_currentTrackBeginX,
|
||||
_currentTrackBeginY,
|
||||
_currentTrackBeginZ,
|
||||
_currentTrackPieceDirection,
|
||||
_currentTrackPieceType,
|
||||
_currentTrackBeginX, _currentTrackBeginY, _currentTrackBeginZ, _currentTrackPieceDirection, _currentTrackPieceType,
|
||||
GAME_COMMAND_FLAG_APPLY);
|
||||
if (cost == MONEY32_UNDEFINED)
|
||||
{
|
||||
@@ -2258,14 +2238,8 @@ static void window_ride_construction_paint(rct_window* w, rct_drawpixelinfo* dpi
|
||||
}
|
||||
|
||||
static void window_ride_construction_draw_track_piece(
|
||||
rct_window* w,
|
||||
rct_drawpixelinfo* dpi,
|
||||
int32_t rideIndex,
|
||||
int32_t trackType,
|
||||
int32_t trackDirection,
|
||||
int32_t unknown,
|
||||
int32_t width,
|
||||
int32_t height)
|
||||
rct_window* w, rct_drawpixelinfo* dpi, int32_t rideIndex, int32_t trackType, int32_t trackDirection, int32_t unknown,
|
||||
int32_t width, int32_t height)
|
||||
{
|
||||
const rct_preview_track* trackBlock;
|
||||
Ride* ride;
|
||||
@@ -2340,14 +2314,8 @@ static rct_tile_element* _backupTileElementArrays[5];
|
||||
* dh: trackType
|
||||
*/
|
||||
static void sub_6CBCE2(
|
||||
rct_drawpixelinfo* dpi,
|
||||
int32_t rideIndex,
|
||||
int32_t trackType,
|
||||
int32_t trackDirection,
|
||||
int32_t edx,
|
||||
int32_t originX,
|
||||
int32_t originY,
|
||||
int32_t originZ)
|
||||
rct_drawpixelinfo* dpi, int32_t rideIndex, int32_t trackType, int32_t trackDirection, int32_t edx, int32_t originX,
|
||||
int32_t originY, int32_t originZ)
|
||||
{
|
||||
Ride* ride;
|
||||
const rct_preview_track* trackBlock;
|
||||
@@ -3391,14 +3359,8 @@ static void window_ride_construction_show_special_track_dropdown(rct_window* w,
|
||||
}
|
||||
|
||||
window_dropdown_show_text_custom_width(
|
||||
w->x + widget->left,
|
||||
w->y + widget->top,
|
||||
widget->bottom - widget->top + 1,
|
||||
w->colours[1],
|
||||
0,
|
||||
0,
|
||||
_numCurrentPossibleRideConfigurations,
|
||||
widget->right - widget->left);
|
||||
w->x + widget->left, w->y + widget->top, widget->bottom - widget->top + 1, w->colours[1], 0, 0,
|
||||
_numCurrentPossibleRideConfigurations, widget->right - widget->left);
|
||||
|
||||
for (int32_t i = 0; i < 32; i++)
|
||||
{
|
||||
@@ -3457,13 +3419,8 @@ static void ride_construction_set_brakes_speed(int32_t brakesSpeed)
|
||||
if (!sub_6C683D(&x, &y, &z, _currentTrackPieceDirection & 3, _currentTrackPieceType, 0, &tileElement, 0))
|
||||
{
|
||||
game_do_command(
|
||||
_currentTrackBeginX,
|
||||
GAME_COMMAND_FLAG_APPLY | ((brakesSpeed) << 8),
|
||||
_currentTrackBeginY,
|
||||
track_element_get_type(tileElement),
|
||||
GAME_COMMAND_SET_BRAKES_SPEED,
|
||||
_currentTrackBeginZ,
|
||||
0);
|
||||
_currentTrackBeginX, GAME_COMMAND_FLAG_APPLY | ((brakesSpeed) << 8), _currentTrackBeginY,
|
||||
track_element_get_type(tileElement), GAME_COMMAND_SET_BRAKES_SPEED, _currentTrackBeginZ, 0);
|
||||
}
|
||||
window_ride_construction_update_active_elements();
|
||||
}
|
||||
@@ -3818,14 +3775,8 @@ void ride_construction_tooldown_construct(int32_t screenX, int32_t screenY)
|
||||
gDisableErrorWindowSound = true;
|
||||
|
||||
_trackPlaceCost = maze_set_track(
|
||||
_currentTrackBeginX,
|
||||
_currentTrackBeginY,
|
||||
_currentTrackBeginZ,
|
||||
GAME_COMMAND_FLAG_APPLY,
|
||||
true,
|
||||
0,
|
||||
_currentRideIndex,
|
||||
GC_SET_MAZE_TRACK_BUILD);
|
||||
_currentTrackBeginX, _currentTrackBeginY, _currentTrackBeginZ, GAME_COMMAND_FLAG_APPLY, true, 0,
|
||||
_currentRideIndex, GC_SET_MAZE_TRACK_BUILD);
|
||||
|
||||
gDisableErrorWindowSound = false;
|
||||
|
||||
@@ -3968,13 +3919,9 @@ static void ride_construction_tooldown_entrance_exit(int32_t screenX, int32_t sc
|
||||
|
||||
game_command_callback = game_command_callback_place_ride_entrance_or_exit;
|
||||
game_do_command(
|
||||
_unkF44188.x,
|
||||
(GAME_COMMAND_FLAG_APPLY) | ((gRideEntranceExitPlaceDirection ^ 2) << 8),
|
||||
_unkF44188.y,
|
||||
gRideEntranceExitPlaceRideIndex | (gRideEntranceExitPlaceType << 8),
|
||||
GAME_COMMAND_PLACE_RIDE_ENTRANCE_OR_EXIT,
|
||||
gRideEntranceExitPlaceStationIndex,
|
||||
0);
|
||||
_unkF44188.x, (GAME_COMMAND_FLAG_APPLY) | ((gRideEntranceExitPlaceDirection ^ 2) << 8), _unkF44188.y,
|
||||
gRideEntranceExitPlaceRideIndex | (gRideEntranceExitPlaceType << 8), GAME_COMMAND_PLACE_RIDE_ENTRANCE_OR_EXIT,
|
||||
gRideEntranceExitPlaceStationIndex, 0);
|
||||
}
|
||||
|
||||
void window_ride_construction_keyboard_shortcut_turn_left()
|
||||
|
||||
@@ -354,14 +354,8 @@ static void window_ride_list_mousedown(rct_window* w, rct_widgetindex widgetInde
|
||||
}
|
||||
|
||||
window_dropdown_show_text_custom_width(
|
||||
w->x + widget->left,
|
||||
w->y + widget->top,
|
||||
widget->bottom - widget->top,
|
||||
w->colours[1],
|
||||
0,
|
||||
DROPDOWN_FLAG_STAY_OPEN,
|
||||
numItems,
|
||||
widget->right - widget->left - 3);
|
||||
w->x + widget->left, w->y + widget->top, widget->bottom - widget->top, w->colours[1], 0, DROPDOWN_FLAG_STAY_OPEN,
|
||||
numItems, widget->right - widget->left - 3);
|
||||
if (selectedIndex != -1)
|
||||
{
|
||||
dropdown_set_checked(selectedIndex, true);
|
||||
@@ -591,11 +585,7 @@ static void window_ride_list_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
||||
|
||||
// Draw number of attractions on bottom
|
||||
gfx_draw_string_left(
|
||||
dpi,
|
||||
ride_list_statusbar_count_strings[w->page],
|
||||
&w->no_list_items,
|
||||
COLOUR_BLACK,
|
||||
w->x + 4,
|
||||
dpi, ride_list_statusbar_count_strings[w->page], &w->no_list_items, COLOUR_BLACK, w->x + 4,
|
||||
w->widgets[WIDX_LIST].bottom + w->y + 2);
|
||||
}
|
||||
|
||||
|
||||
@@ -444,13 +444,8 @@ rct_window* window_scenery_open()
|
||||
window_scenery_init();
|
||||
|
||||
window = window_create(
|
||||
context_get_width() - WINDOW_SCENERY_WIDTH,
|
||||
0x1D,
|
||||
WINDOW_SCENERY_WIDTH,
|
||||
WINDOW_SCENERY_HEIGHT,
|
||||
&window_scenery_events,
|
||||
WC_SCENERY,
|
||||
WF_NO_SCROLLING);
|
||||
context_get_width() - WINDOW_SCENERY_WIDTH, 0x1D, WINDOW_SCENERY_WIDTH, WINDOW_SCENERY_HEIGHT, &window_scenery_events,
|
||||
WC_SCENERY, WF_NO_SCROLLING);
|
||||
window->widgets = window_scenery_widgets;
|
||||
|
||||
window->enabled_widgets = (1 << WIDX_SCENERY_CLOSE) | (1 << WIDX_SCENERY_ROTATE_OBJECTS_BUTTON) | (1 << WIDX_SCENERY_TAB_1)
|
||||
@@ -1119,10 +1114,7 @@ void window_scenery_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
||||
uint32_t imageId = ((w->colours[1] << 19) | window_scenery_widgets[selectedWidgetId].image) + 1ul;
|
||||
|
||||
gfx_draw_sprite(
|
||||
dpi,
|
||||
imageId,
|
||||
w->x + window_scenery_widgets[selectedWidgetId].left,
|
||||
w->y + window_scenery_widgets[selectedWidgetId].top,
|
||||
dpi, imageId, w->x + window_scenery_widgets[selectedWidgetId].left, w->y + window_scenery_widgets[selectedWidgetId].top,
|
||||
selectedWidgetId);
|
||||
|
||||
int16_t selectedSceneryEntryId = w->scenery.selected_scenery_id;
|
||||
@@ -1210,12 +1202,7 @@ void window_scenery_scrollpaint(rct_window* w, rct_drawpixelinfo* dpi, int32_t s
|
||||
if (w->scenery.selected_scenery_id == currentSceneryGlobalId)
|
||||
{
|
||||
gfx_fill_rect_inset(
|
||||
dpi,
|
||||
left,
|
||||
top,
|
||||
left + SCENERY_BUTTON_WIDTH - 1,
|
||||
top + SCENERY_BUTTON_HEIGHT - 1,
|
||||
w->colours[1],
|
||||
dpi, left, top, left + SCENERY_BUTTON_WIDTH - 1, top + SCENERY_BUTTON_HEIGHT - 1, w->colours[1],
|
||||
INSET_RECT_FLAG_FILL_MID_LIGHT);
|
||||
}
|
||||
}
|
||||
@@ -1224,23 +1211,13 @@ void window_scenery_scrollpaint(rct_window* w, rct_drawpixelinfo* dpi, int32_t s
|
||||
if (tabSelectedSceneryId == currentSceneryGlobalId)
|
||||
{
|
||||
gfx_fill_rect_inset(
|
||||
dpi,
|
||||
left,
|
||||
top,
|
||||
left + SCENERY_BUTTON_WIDTH - 1,
|
||||
top + SCENERY_BUTTON_HEIGHT - 1,
|
||||
w->colours[1],
|
||||
dpi, left, top, left + SCENERY_BUTTON_WIDTH - 1, top + SCENERY_BUTTON_HEIGHT - 1, w->colours[1],
|
||||
(INSET_RECT_FLAG_BORDER_INSET | INSET_RECT_FLAG_FILL_MID_LIGHT));
|
||||
}
|
||||
else if (w->scenery.selected_scenery_id == currentSceneryGlobalId)
|
||||
{
|
||||
gfx_fill_rect_inset(
|
||||
dpi,
|
||||
left,
|
||||
top,
|
||||
left + SCENERY_BUTTON_WIDTH - 1,
|
||||
top + SCENERY_BUTTON_HEIGHT - 1,
|
||||
w->colours[1],
|
||||
dpi, left, top, left + SCENERY_BUTTON_WIDTH - 1, top + SCENERY_BUTTON_HEIGHT - 1, w->colours[1],
|
||||
INSET_RECT_FLAG_FILL_MID_LIGHT);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -541,9 +541,8 @@ static void server_list_save_server_entries()
|
||||
// Save just favourite servers
|
||||
std::vector<server_entry> favouriteServers;
|
||||
std::copy_if(
|
||||
_serverEntries.begin(), _serverEntries.end(), std::back_inserter(favouriteServers), [](const server_entry& entry) {
|
||||
return entry.favourite;
|
||||
});
|
||||
_serverEntries.begin(), _serverEntries.end(), std::back_inserter(favouriteServers),
|
||||
[](const server_entry& entry) { return entry.favourite; });
|
||||
server_list_write(favouriteServers);
|
||||
}
|
||||
|
||||
|
||||
@@ -185,17 +185,8 @@ rct_window* window_sign_open(rct_windownumber number)
|
||||
// Create viewport
|
||||
viewportWidget = &window_sign_widgets[WIDX_VIEWPORT];
|
||||
viewport_create(
|
||||
w,
|
||||
w->x + viewportWidget->left + 1,
|
||||
w->y + viewportWidget->top + 1,
|
||||
(viewportWidget->right - viewportWidget->left) - 1,
|
||||
(viewportWidget->bottom - viewportWidget->top) - 1,
|
||||
0,
|
||||
view_x,
|
||||
view_y,
|
||||
view_z,
|
||||
0,
|
||||
-1);
|
||||
w, w->x + viewportWidget->left + 1, w->y + viewportWidget->top + 1, (viewportWidget->right - viewportWidget->left) - 1,
|
||||
(viewportWidget->bottom - viewportWidget->top) - 1, 0, view_x, view_y, view_z, 0, -1);
|
||||
|
||||
w->viewport->flags = gConfigGeneral.always_show_gridlines ? VIEWPORT_FLAG_GRIDLINES : 0;
|
||||
window_invalidate(w);
|
||||
@@ -238,13 +229,9 @@ static void window_sign_mouseup(rct_window* w, rct_widgetindex widgetIndex)
|
||||
tile_element++;
|
||||
}
|
||||
game_do_command(
|
||||
x,
|
||||
1 | (tile_element->GetDirection() << 8),
|
||||
y,
|
||||
tile_element->base_height | (scenery_large_get_sequence(tile_element) << 8),
|
||||
GAME_COMMAND_REMOVE_LARGE_SCENERY,
|
||||
0,
|
||||
0);
|
||||
x, 1 | (tile_element->GetDirection() << 8), y,
|
||||
tile_element->base_height | (scenery_large_get_sequence(tile_element) << 8), GAME_COMMAND_REMOVE_LARGE_SCENERY,
|
||||
0, 0);
|
||||
break;
|
||||
case WIDX_SIGN_TEXT:
|
||||
if (banner->flags & BANNER_FLAG_LINKED_TO_RIDE)
|
||||
@@ -382,17 +369,8 @@ static void window_sign_viewport_rotate(rct_window* w)
|
||||
// Create viewport
|
||||
rct_widget* viewportWidget = &window_sign_widgets[WIDX_VIEWPORT];
|
||||
viewport_create(
|
||||
w,
|
||||
w->x + viewportWidget->left + 1,
|
||||
w->y + viewportWidget->top + 1,
|
||||
(viewportWidget->right - viewportWidget->left) - 1,
|
||||
(viewportWidget->bottom - viewportWidget->top) - 1,
|
||||
0,
|
||||
view_x,
|
||||
view_y,
|
||||
view_z,
|
||||
0,
|
||||
-1);
|
||||
w, w->x + viewportWidget->left + 1, w->y + viewportWidget->top + 1, (viewportWidget->right - viewportWidget->left) - 1,
|
||||
(viewportWidget->bottom - viewportWidget->top) - 1, 0, view_x, view_y, view_z, 0, -1);
|
||||
|
||||
w->viewport->flags = gConfigGeneral.always_show_gridlines ? VIEWPORT_FLAG_GRIDLINES : 0;
|
||||
window_invalidate(w);
|
||||
@@ -455,17 +433,8 @@ rct_window* window_sign_small_open(rct_windownumber number)
|
||||
// Create viewport
|
||||
viewportWidget = &window_sign_widgets[WIDX_VIEWPORT];
|
||||
viewport_create(
|
||||
w,
|
||||
w->x + viewportWidget->left + 1,
|
||||
w->y + viewportWidget->top + 1,
|
||||
(viewportWidget->right - viewportWidget->left) - 1,
|
||||
(viewportWidget->bottom - viewportWidget->top) - 1,
|
||||
0,
|
||||
view_x,
|
||||
view_y,
|
||||
view_z,
|
||||
0,
|
||||
-1);
|
||||
w, w->x + viewportWidget->left + 1, w->y + viewportWidget->top + 1, (viewportWidget->right - viewportWidget->left) - 1,
|
||||
(viewportWidget->bottom - viewportWidget->top) - 1, 0, view_x, view_y, view_z, 0, -1);
|
||||
|
||||
w->viewport->flags = gConfigGeneral.always_show_gridlines ? VIEWPORT_FLAG_GRIDLINES : 0;
|
||||
w->flags |= WF_NO_SCROLLING;
|
||||
|
||||
@@ -465,12 +465,7 @@ void window_staff_overview_mouseup(rct_window* w, rct_widgetindex widgetIndex)
|
||||
}
|
||||
case WIDX_RENAME:
|
||||
window_text_input_open(
|
||||
w,
|
||||
widgetIndex,
|
||||
STR_STAFF_TITLE_STAFF_MEMBER_NAME,
|
||||
STR_STAFF_PROMPT_ENTER_NAME,
|
||||
peep->name_string_idx,
|
||||
peep->id,
|
||||
w, widgetIndex, STR_STAFF_TITLE_STAFF_MEMBER_NAME, STR_STAFF_PROMPT_ENTER_NAME, peep->name_string_idx, peep->id,
|
||||
32);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -571,48 +571,40 @@ void window_staff_list_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
||||
i += g_peep_animation_entries[PEEP_SPRITE_TYPE_HANDYMAN].sprite_animation->base_image + 1;
|
||||
i |= SPRITE_ID_PALETTE_COLOUR_1(gStaffHandymanColour);
|
||||
gfx_draw_sprite(
|
||||
dpi,
|
||||
i,
|
||||
dpi, i,
|
||||
(window_staff_list_widgets[WIDX_STAFF_LIST_HANDYMEN_TAB].left
|
||||
+ window_staff_list_widgets[WIDX_STAFF_LIST_HANDYMEN_TAB].right)
|
||||
/ 2
|
||||
+ w->x,
|
||||
window_staff_list_widgets[WIDX_STAFF_LIST_HANDYMEN_TAB].bottom - 6 + w->y,
|
||||
0);
|
||||
window_staff_list_widgets[WIDX_STAFF_LIST_HANDYMEN_TAB].bottom - 6 + w->y, 0);
|
||||
|
||||
// Mechanic tab image
|
||||
i = (selectedTab == 1 ? (w->list_information_type & ~3) : 0);
|
||||
i += g_peep_animation_entries[PEEP_SPRITE_TYPE_MECHANIC].sprite_animation->base_image + 1;
|
||||
i |= SPRITE_ID_PALETTE_COLOUR_1(gStaffMechanicColour);
|
||||
gfx_draw_sprite(
|
||||
dpi,
|
||||
i,
|
||||
dpi, i,
|
||||
(window_staff_list_widgets[WIDX_STAFF_LIST_MECHANICS_TAB].left
|
||||
+ window_staff_list_widgets[WIDX_STAFF_LIST_MECHANICS_TAB].right)
|
||||
/ 2
|
||||
+ w->x,
|
||||
window_staff_list_widgets[WIDX_STAFF_LIST_MECHANICS_TAB].bottom - 6 + w->y,
|
||||
0);
|
||||
window_staff_list_widgets[WIDX_STAFF_LIST_MECHANICS_TAB].bottom - 6 + w->y, 0);
|
||||
|
||||
// Security tab image
|
||||
i = (selectedTab == 2 ? (w->list_information_type & ~3) : 0);
|
||||
i += g_peep_animation_entries[PEEP_SPRITE_TYPE_SECURITY].sprite_animation->base_image + 1;
|
||||
i |= SPRITE_ID_PALETTE_COLOUR_1(gStaffSecurityColour);
|
||||
gfx_draw_sprite(
|
||||
dpi,
|
||||
i,
|
||||
dpi, i,
|
||||
(window_staff_list_widgets[WIDX_STAFF_LIST_SECURITY_TAB].left
|
||||
+ window_staff_list_widgets[WIDX_STAFF_LIST_SECURITY_TAB].right)
|
||||
/ 2
|
||||
+ w->x,
|
||||
window_staff_list_widgets[WIDX_STAFF_LIST_SECURITY_TAB].bottom - 6 + w->y,
|
||||
0);
|
||||
window_staff_list_widgets[WIDX_STAFF_LIST_SECURITY_TAB].bottom - 6 + w->y, 0);
|
||||
|
||||
rct_drawpixelinfo sprite_dpi;
|
||||
if (clip_drawpixelinfo(
|
||||
&sprite_dpi,
|
||||
dpi,
|
||||
window_staff_list_widgets[WIDX_STAFF_LIST_ENTERTAINERS_TAB].left + w->x + 1,
|
||||
&sprite_dpi, dpi, window_staff_list_widgets[WIDX_STAFF_LIST_ENTERTAINERS_TAB].left + w->x + 1,
|
||||
window_staff_list_widgets[WIDX_STAFF_LIST_ENTERTAINERS_TAB].top + w->y + 1,
|
||||
window_staff_list_widgets[WIDX_STAFF_LIST_ENTERTAINERS_TAB].right
|
||||
- window_staff_list_widgets[WIDX_STAFF_LIST_ENTERTAINERS_TAB].left - 1,
|
||||
@@ -634,11 +626,7 @@ void window_staff_list_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
||||
if (selectedTab < 3)
|
||||
{
|
||||
gfx_draw_string_left(
|
||||
dpi,
|
||||
STR_UNIFORM_COLOUR,
|
||||
w,
|
||||
COLOUR_BLACK,
|
||||
w->x + 6,
|
||||
dpi, STR_UNIFORM_COLOUR, w, COLOUR_BLACK, w->x + 6,
|
||||
window_staff_list_widgets[WIDX_STAFF_LIST_UNIFORM_COLOUR_PICKER].top + w->y + 1);
|
||||
}
|
||||
|
||||
@@ -653,11 +641,7 @@ void window_staff_list_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
||||
set_format_arg(2, rct_string_id, staffTypeStringId);
|
||||
|
||||
gfx_draw_string_left(
|
||||
dpi,
|
||||
STR_STAFF_LIST_COUNTER,
|
||||
gCommonFormatArgs,
|
||||
COLOUR_BLACK,
|
||||
w->x + 4,
|
||||
dpi, STR_STAFF_LIST_COUNTER, gCommonFormatArgs, COLOUR_BLACK, w->x + 4,
|
||||
window_staff_list_widgets[WIDX_STAFF_LIST_LIST].bottom + w->y + 2);
|
||||
}
|
||||
|
||||
|
||||
@@ -95,13 +95,8 @@ static int32_t calling_widget = 0;
|
||||
static int32_t _maxInputLength;
|
||||
|
||||
void window_text_input_open(
|
||||
rct_window* call_w,
|
||||
rct_widgetindex call_widget,
|
||||
rct_string_id title,
|
||||
rct_string_id description,
|
||||
rct_string_id existing_text,
|
||||
uintptr_t existing_args,
|
||||
int32_t maxLength)
|
||||
rct_window* call_w, rct_widgetindex call_widget, rct_string_id title, rct_string_id description,
|
||||
rct_string_id existing_text, uintptr_t existing_args, int32_t maxLength)
|
||||
{
|
||||
// Get the raw string
|
||||
utf8 buffer[Util::CountOf(text_input)]{};
|
||||
@@ -113,12 +108,8 @@ void window_text_input_open(
|
||||
}
|
||||
|
||||
void window_text_input_raw_open(
|
||||
rct_window* call_w,
|
||||
rct_widgetindex call_widget,
|
||||
rct_string_id title,
|
||||
rct_string_id description,
|
||||
const_utf8string existing_text,
|
||||
int32_t maxLength)
|
||||
rct_window* call_w, rct_widgetindex call_widget, rct_string_id title, rct_string_id description,
|
||||
const_utf8string existing_text, int32_t maxLength)
|
||||
{
|
||||
_maxInputLength = maxLength;
|
||||
|
||||
|
||||
@@ -316,11 +316,8 @@ static void window_themes_draw_tab_images(rct_drawpixelinfo* dpi, rct_window* w)
|
||||
if (_selected_tab == i)
|
||||
sprite_idx += w->frame_no / window_themes_tab_animation_divisor[_selected_tab];
|
||||
gfx_draw_sprite(
|
||||
dpi,
|
||||
sprite_idx,
|
||||
w->x + w->widgets[WIDX_THEMES_SETTINGS_TAB + i].left,
|
||||
w->y + w->widgets[WIDX_THEMES_SETTINGS_TAB + i].top,
|
||||
0);
|
||||
dpi, sprite_idx, w->x + w->widgets[WIDX_THEMES_SETTINGS_TAB + i].left,
|
||||
w->y + w->widgets[WIDX_THEMES_SETTINGS_TAB + i].top, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -371,13 +368,8 @@ static void window_themes_mouseup(rct_window* w, rct_widgetindex widgetIndex)
|
||||
activeAvailableThemeIndex = theme_manager_get_active_available_theme_index();
|
||||
activeThemeName = theme_manager_get_available_theme_name(activeAvailableThemeIndex);
|
||||
window_text_input_open(
|
||||
w,
|
||||
widgetIndex,
|
||||
STR_TITLE_EDITOR_ACTION_DUPLICATE,
|
||||
STR_THEMES_PROMPT_ENTER_THEME_NAME,
|
||||
STR_STRING,
|
||||
(uintptr_t)activeThemeName,
|
||||
64);
|
||||
w, widgetIndex, STR_TITLE_EDITOR_ACTION_DUPLICATE, STR_THEMES_PROMPT_ENTER_THEME_NAME, STR_STRING,
|
||||
(uintptr_t)activeThemeName, 64);
|
||||
break;
|
||||
case WIDX_THEMES_DELETE_BUTTON:
|
||||
if (theme_get_flags() & UITHEME_FLAG_PREDEFINED)
|
||||
@@ -399,13 +391,8 @@ static void window_themes_mouseup(rct_window* w, rct_widgetindex widgetIndex)
|
||||
activeAvailableThemeIndex = theme_manager_get_active_available_theme_index();
|
||||
activeThemeName = theme_manager_get_available_theme_name(activeAvailableThemeIndex);
|
||||
window_text_input_open(
|
||||
w,
|
||||
widgetIndex,
|
||||
STR_TRACK_MANAGE_RENAME,
|
||||
STR_THEMES_PROMPT_ENTER_THEME_NAME,
|
||||
STR_STRING,
|
||||
(uintptr_t)activeThemeName,
|
||||
64);
|
||||
w, widgetIndex, STR_TRACK_MANAGE_RENAME, STR_THEMES_PROMPT_ENTER_THEME_NAME, STR_STRING,
|
||||
(uintptr_t)activeThemeName, 64);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -536,14 +523,8 @@ static void window_themes_mousedown(rct_window* w, rct_widgetindex widgetIndex,
|
||||
}
|
||||
|
||||
window_dropdown_show_text_custom_width(
|
||||
w->x + widget->left,
|
||||
w->y + widget->top,
|
||||
widget->bottom - widget->top + 1,
|
||||
w->colours[1],
|
||||
0,
|
||||
DROPDOWN_FLAG_STAY_OPEN,
|
||||
num_items,
|
||||
widget->right - widget->left - 3);
|
||||
w->x + widget->left, w->y + widget->top, widget->bottom - widget->top + 1, w->colours[1], 0,
|
||||
DROPDOWN_FLAG_STAY_OPEN, num_items, widget->right - widget->left - 3);
|
||||
|
||||
dropdown_set_checked((int32_t)theme_manager_get_active_available_theme_index(), true);
|
||||
break;
|
||||
@@ -861,18 +842,10 @@ void window_themes_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
||||
const utf8* activeThemeName = theme_manager_get_available_theme_name(activeAvailableThemeIndex);
|
||||
set_format_arg(0, uintptr_t, (uintptr_t)activeThemeName);
|
||||
gfx_draw_string_left(
|
||||
dpi,
|
||||
STR_THEMES_LABEL_CURRENT_THEME,
|
||||
nullptr,
|
||||
w->colours[1],
|
||||
w->x + 10,
|
||||
dpi, STR_THEMES_LABEL_CURRENT_THEME, nullptr, w->colours[1], w->x + 10,
|
||||
w->y + window_themes_widgets[WIDX_THEMES_PRESETS].top + 1);
|
||||
gfx_draw_string_left_clipped(
|
||||
dpi,
|
||||
STR_STRING,
|
||||
gCommonFormatArgs,
|
||||
w->colours[1],
|
||||
w->x + window_themes_widgets[WIDX_THEMES_PRESETS].left + 1,
|
||||
dpi, STR_STRING, gCommonFormatArgs, w->colours[1], w->x + window_themes_widgets[WIDX_THEMES_PRESETS].left + 1,
|
||||
w->y + window_themes_widgets[WIDX_THEMES_PRESETS].top,
|
||||
w->x + window_themes_widgets[WIDX_THEMES_PRESETS_DROPDOWN].left - window_themes_widgets[WIDX_THEMES_PRESETS].left
|
||||
- 4);
|
||||
@@ -911,37 +884,21 @@ void window_themes_scrollpaint(rct_window* w, rct_drawpixelinfo* dpi, int32_t sc
|
||||
translucent_window_palette windowPalette = TranslucentWindowPalettes[BASE_COLOUR(colour)];
|
||||
|
||||
gfx_filter_rect(
|
||||
dpi,
|
||||
0,
|
||||
y + _row_height - 2,
|
||||
window_themes_widgets[WIDX_THEMES_LIST].right,
|
||||
y + _row_height - 2,
|
||||
dpi, 0, y + _row_height - 2, window_themes_widgets[WIDX_THEMES_LIST].right, y + _row_height - 2,
|
||||
windowPalette.highlight);
|
||||
gfx_filter_rect(
|
||||
dpi,
|
||||
0,
|
||||
y + _row_height - 1,
|
||||
window_themes_widgets[WIDX_THEMES_LIST].right,
|
||||
y + _row_height - 1,
|
||||
dpi, 0, y + _row_height - 1, window_themes_widgets[WIDX_THEMES_LIST].right, y + _row_height - 1,
|
||||
windowPalette.shadow);
|
||||
}
|
||||
else
|
||||
{
|
||||
colour = ColourMapA[w->colours[1]].mid_dark;
|
||||
gfx_fill_rect(
|
||||
dpi,
|
||||
0,
|
||||
y + _row_height - 2,
|
||||
window_themes_widgets[WIDX_THEMES_LIST].right,
|
||||
y + _row_height - 2,
|
||||
dpi, 0, y + _row_height - 2, window_themes_widgets[WIDX_THEMES_LIST].right, y + _row_height - 2,
|
||||
colour);
|
||||
colour = ColourMapA[w->colours[1]].lightest;
|
||||
gfx_fill_rect(
|
||||
dpi,
|
||||
0,
|
||||
y + _row_height - 1,
|
||||
window_themes_widgets[WIDX_THEMES_LIST].right,
|
||||
y + _row_height - 1,
|
||||
dpi, 0, y + _row_height - 1, window_themes_widgets[WIDX_THEMES_LIST].right, y + _row_height - 1,
|
||||
colour);
|
||||
}
|
||||
}
|
||||
@@ -963,13 +920,8 @@ void window_themes_scrollpaint(rct_window* w, rct_drawpixelinfo* dpi, int32_t sc
|
||||
gfx_draw_sprite(dpi, image, _button_offset_x + 12 * j, y + _button_offset_y, 0);
|
||||
|
||||
gfx_fill_rect_inset(
|
||||
dpi,
|
||||
_button_offset_x + 12 * j,
|
||||
y + _check_offset_y,
|
||||
_button_offset_x + 12 * j + 9,
|
||||
y + _check_offset_y + 10,
|
||||
w->colours[1],
|
||||
INSET_RECT_F_E0);
|
||||
dpi, _button_offset_x + 12 * j, y + _check_offset_y, _button_offset_x + 12 * j + 9,
|
||||
y + _check_offset_y + 10, w->colours[1], INSET_RECT_F_E0);
|
||||
if (colour & COLOUR_FLAG_TRANSLUCENT)
|
||||
{
|
||||
gCurrentFontSpriteBase = FONT_SPRITE_BASE_MEDIUM_DARK;
|
||||
|
||||
@@ -617,39 +617,24 @@ static void window_tile_inspector_insert_corrupt_element(int32_t elementIndex)
|
||||
{
|
||||
openrct2_assert(elementIndex >= 0 && elementIndex < windowTileInspectorElementCount, "elementIndex out of range");
|
||||
game_do_command(
|
||||
TILE_INSPECTOR_ANY_INSERT_CORRUPT,
|
||||
GAME_COMMAND_FLAG_APPLY,
|
||||
windowTileInspectorTileX | (windowTileInspectorTileY << 8),
|
||||
elementIndex,
|
||||
GAME_COMMAND_MODIFY_TILE,
|
||||
0,
|
||||
0);
|
||||
TILE_INSPECTOR_ANY_INSERT_CORRUPT, GAME_COMMAND_FLAG_APPLY, windowTileInspectorTileX | (windowTileInspectorTileY << 8),
|
||||
elementIndex, GAME_COMMAND_MODIFY_TILE, 0, 0);
|
||||
}
|
||||
|
||||
static void window_tile_inspector_remove_element(int32_t elementIndex)
|
||||
{
|
||||
openrct2_assert(elementIndex >= 0 && elementIndex < windowTileInspectorElementCount, "elementIndex out of range");
|
||||
game_do_command(
|
||||
TILE_INSPECTOR_ANY_REMOVE,
|
||||
GAME_COMMAND_FLAG_APPLY,
|
||||
windowTileInspectorTileX | (windowTileInspectorTileY << 8),
|
||||
elementIndex,
|
||||
GAME_COMMAND_MODIFY_TILE,
|
||||
0,
|
||||
0);
|
||||
TILE_INSPECTOR_ANY_REMOVE, GAME_COMMAND_FLAG_APPLY, windowTileInspectorTileX | (windowTileInspectorTileY << 8),
|
||||
elementIndex, GAME_COMMAND_MODIFY_TILE, 0, 0);
|
||||
}
|
||||
|
||||
static void window_tile_inspector_rotate_element(int32_t elementIndex)
|
||||
{
|
||||
openrct2_assert(elementIndex >= 0 && elementIndex < windowTileInspectorElementCount, "elementIndex out of range");
|
||||
game_do_command(
|
||||
TILE_INSPECTOR_ANY_ROTATE,
|
||||
GAME_COMMAND_FLAG_APPLY,
|
||||
windowTileInspectorTileX | (windowTileInspectorTileY << 8),
|
||||
elementIndex,
|
||||
GAME_COMMAND_MODIFY_TILE,
|
||||
0,
|
||||
0);
|
||||
TILE_INSPECTOR_ANY_ROTATE, GAME_COMMAND_FLAG_APPLY, windowTileInspectorTileX | (windowTileInspectorTileY << 8),
|
||||
elementIndex, GAME_COMMAND_MODIFY_TILE, 0, 0);
|
||||
}
|
||||
|
||||
// Swap element with its parent
|
||||
@@ -658,26 +643,16 @@ static void window_tile_inspector_swap_elements(int16_t first, int16_t second)
|
||||
openrct2_assert(first >= 0 && first < windowTileInspectorElementCount, "first out of range");
|
||||
openrct2_assert(second >= 0 && second < windowTileInspectorElementCount, "second out of range");
|
||||
game_do_command(
|
||||
TILE_INSPECTOR_ANY_SWAP,
|
||||
GAME_COMMAND_FLAG_APPLY,
|
||||
windowTileInspectorTileX | (windowTileInspectorTileY << 8),
|
||||
first,
|
||||
GAME_COMMAND_MODIFY_TILE,
|
||||
second,
|
||||
0);
|
||||
TILE_INSPECTOR_ANY_SWAP, GAME_COMMAND_FLAG_APPLY, windowTileInspectorTileX | (windowTileInspectorTileY << 8), first,
|
||||
GAME_COMMAND_MODIFY_TILE, second, 0);
|
||||
}
|
||||
|
||||
static void window_tile_inspector_sort_elements()
|
||||
{
|
||||
openrct2_assert(windowTileInspectorTileSelected, "No tile selected");
|
||||
game_do_command(
|
||||
TILE_INSPECTOR_ANY_SORT,
|
||||
GAME_COMMAND_FLAG_APPLY,
|
||||
windowTileInspectorTileX | (windowTileInspectorTileY << 8),
|
||||
0,
|
||||
GAME_COMMAND_MODIFY_TILE,
|
||||
0,
|
||||
0);
|
||||
TILE_INSPECTOR_ANY_SORT, GAME_COMMAND_FLAG_APPLY, windowTileInspectorTileX | (windowTileInspectorTileY << 8), 0,
|
||||
GAME_COMMAND_MODIFY_TILE, 0, 0);
|
||||
}
|
||||
|
||||
static void window_tile_inspector_copy_element(rct_window* w)
|
||||
@@ -696,73 +671,43 @@ static void window_tile_inspector_paste_element(rct_window* w)
|
||||
assert_struct_size(data, sizeof(tileInspectorCopiedElement));
|
||||
|
||||
game_do_command(
|
||||
TILE_INSPECTOR_ANY_PASTE,
|
||||
GAME_COMMAND_FLAG_APPLY,
|
||||
windowTileInspectorTileX | (windowTileInspectorTileY << 8),
|
||||
data[0],
|
||||
GAME_COMMAND_MODIFY_TILE,
|
||||
data[1],
|
||||
0);
|
||||
TILE_INSPECTOR_ANY_PASTE, GAME_COMMAND_FLAG_APPLY, windowTileInspectorTileX | (windowTileInspectorTileY << 8), data[0],
|
||||
GAME_COMMAND_MODIFY_TILE, data[1], 0);
|
||||
}
|
||||
|
||||
static void window_tile_inspector_base_height_offset(int16_t elementIndex, int8_t heightOffset)
|
||||
{
|
||||
game_do_command(
|
||||
TILE_INSPECTOR_ANY_BASE_HEIGHT_OFFSET,
|
||||
GAME_COMMAND_FLAG_APPLY,
|
||||
windowTileInspectorTileX | (windowTileInspectorTileY << 8),
|
||||
elementIndex,
|
||||
GAME_COMMAND_MODIFY_TILE,
|
||||
heightOffset,
|
||||
0);
|
||||
TILE_INSPECTOR_ANY_BASE_HEIGHT_OFFSET, GAME_COMMAND_FLAG_APPLY,
|
||||
windowTileInspectorTileX | (windowTileInspectorTileY << 8), elementIndex, GAME_COMMAND_MODIFY_TILE, heightOffset, 0);
|
||||
}
|
||||
|
||||
static void window_tile_inspector_surface_show_park_fences(bool showFences)
|
||||
{
|
||||
game_do_command(
|
||||
TILE_INSPECTOR_SURFACE_SHOW_PARK_FENCES,
|
||||
GAME_COMMAND_FLAG_APPLY,
|
||||
windowTileInspectorTileX | (windowTileInspectorTileY << 8),
|
||||
showFences,
|
||||
GAME_COMMAND_MODIFY_TILE,
|
||||
0,
|
||||
0);
|
||||
TILE_INSPECTOR_SURFACE_SHOW_PARK_FENCES, GAME_COMMAND_FLAG_APPLY,
|
||||
windowTileInspectorTileX | (windowTileInspectorTileY << 8), showFences, GAME_COMMAND_MODIFY_TILE, 0, 0);
|
||||
}
|
||||
|
||||
static void window_tile_inspector_surface_toggle_corner(int32_t cornerIndex)
|
||||
{
|
||||
game_do_command(
|
||||
TILE_INSPECTOR_SURFACE_TOGGLE_CORNER,
|
||||
GAME_COMMAND_FLAG_APPLY,
|
||||
windowTileInspectorTileX | (windowTileInspectorTileY << 8),
|
||||
cornerIndex,
|
||||
GAME_COMMAND_MODIFY_TILE,
|
||||
0,
|
||||
0);
|
||||
TILE_INSPECTOR_SURFACE_TOGGLE_CORNER, GAME_COMMAND_FLAG_APPLY,
|
||||
windowTileInspectorTileX | (windowTileInspectorTileY << 8), cornerIndex, GAME_COMMAND_MODIFY_TILE, 0, 0);
|
||||
}
|
||||
|
||||
static void window_tile_inspector_surface_toggle_diagonal()
|
||||
{
|
||||
game_do_command(
|
||||
TILE_INSPECTOR_SURFACE_TOGGLE_DIAGONAL,
|
||||
GAME_COMMAND_FLAG_APPLY,
|
||||
windowTileInspectorTileX | (windowTileInspectorTileY << 8),
|
||||
0,
|
||||
GAME_COMMAND_MODIFY_TILE,
|
||||
0,
|
||||
0);
|
||||
TILE_INSPECTOR_SURFACE_TOGGLE_DIAGONAL, GAME_COMMAND_FLAG_APPLY,
|
||||
windowTileInspectorTileX | (windowTileInspectorTileY << 8), 0, GAME_COMMAND_MODIFY_TILE, 0, 0);
|
||||
}
|
||||
|
||||
static void window_tile_inspector_path_set_sloped(int32_t elementIndex, bool sloped)
|
||||
{
|
||||
game_do_command(
|
||||
TILE_INSPECTOR_PATH_SET_SLOPE,
|
||||
GAME_COMMAND_FLAG_APPLY,
|
||||
windowTileInspectorTileX | (windowTileInspectorTileY << 8),
|
||||
elementIndex,
|
||||
GAME_COMMAND_MODIFY_TILE,
|
||||
sloped,
|
||||
0);
|
||||
TILE_INSPECTOR_PATH_SET_SLOPE, GAME_COMMAND_FLAG_APPLY, windowTileInspectorTileX | (windowTileInspectorTileY << 8),
|
||||
elementIndex, GAME_COMMAND_MODIFY_TILE, sloped, 0);
|
||||
}
|
||||
|
||||
static void window_tile_inspector_path_toggle_edge(int32_t elementIndex, int32_t cornerIndex)
|
||||
@@ -770,26 +715,16 @@ static void window_tile_inspector_path_toggle_edge(int32_t elementIndex, int32_t
|
||||
openrct2_assert(elementIndex >= 0 && elementIndex < windowTileInspectorElementCount, "elementIndex out of range");
|
||||
openrct2_assert(cornerIndex >= 0 && cornerIndex < 8, "cornerIndex out of range");
|
||||
game_do_command(
|
||||
TILE_INSPECTOR_PATH_TOGGLE_EDGE,
|
||||
GAME_COMMAND_FLAG_APPLY,
|
||||
windowTileInspectorTileX | (windowTileInspectorTileY << 8),
|
||||
elementIndex,
|
||||
GAME_COMMAND_MODIFY_TILE,
|
||||
cornerIndex,
|
||||
0);
|
||||
TILE_INSPECTOR_PATH_TOGGLE_EDGE, GAME_COMMAND_FLAG_APPLY, windowTileInspectorTileX | (windowTileInspectorTileY << 8),
|
||||
elementIndex, GAME_COMMAND_MODIFY_TILE, cornerIndex, 0);
|
||||
}
|
||||
|
||||
static void window_tile_inspector_entrance_make_usable(int32_t elementIndex)
|
||||
{
|
||||
Guard::ArgumentInRange(elementIndex, 0, windowTileInspectorElementCount - 1);
|
||||
game_do_command(
|
||||
TILE_INSPECTOR_ENTRANCE_MAKE_USABLE,
|
||||
GAME_COMMAND_FLAG_APPLY,
|
||||
windowTileInspectorTileX | (windowTileInspectorTileY << 8),
|
||||
elementIndex,
|
||||
GAME_COMMAND_MODIFY_TILE,
|
||||
0,
|
||||
0);
|
||||
TILE_INSPECTOR_ENTRANCE_MAKE_USABLE, GAME_COMMAND_FLAG_APPLY,
|
||||
windowTileInspectorTileX | (windowTileInspectorTileY << 8), elementIndex, GAME_COMMAND_MODIFY_TILE, 0, 0);
|
||||
}
|
||||
|
||||
static void window_tile_inspector_wall_set_slope(int32_t elementIndex, int32_t slopeValue)
|
||||
@@ -798,37 +733,22 @@ static void window_tile_inspector_wall_set_slope(int32_t elementIndex, int32_t s
|
||||
openrct2_assert((slopeValue & 0xC0) == slopeValue, "slopeValue doesn't match its mask");
|
||||
|
||||
game_do_command(
|
||||
TILE_INSPECTOR_WALL_SET_SLOPE,
|
||||
GAME_COMMAND_FLAG_APPLY,
|
||||
windowTileInspectorTileX | (windowTileInspectorTileY << 8),
|
||||
elementIndex,
|
||||
GAME_COMMAND_MODIFY_TILE,
|
||||
slopeValue,
|
||||
0);
|
||||
TILE_INSPECTOR_WALL_SET_SLOPE, GAME_COMMAND_FLAG_APPLY, windowTileInspectorTileX | (windowTileInspectorTileY << 8),
|
||||
elementIndex, GAME_COMMAND_MODIFY_TILE, slopeValue, 0);
|
||||
}
|
||||
|
||||
static void window_tile_inspector_track_block_height_offset(int32_t elementIndex, int8_t heightOffset)
|
||||
{
|
||||
game_do_command(
|
||||
TILE_INSPECTOR_TRACK_BASE_HEIGHT_OFFSET,
|
||||
GAME_COMMAND_FLAG_APPLY,
|
||||
windowTileInspectorTileX | (windowTileInspectorTileY << 8),
|
||||
elementIndex,
|
||||
GAME_COMMAND_MODIFY_TILE,
|
||||
heightOffset,
|
||||
0);
|
||||
TILE_INSPECTOR_TRACK_BASE_HEIGHT_OFFSET, GAME_COMMAND_FLAG_APPLY,
|
||||
windowTileInspectorTileX | (windowTileInspectorTileY << 8), elementIndex, GAME_COMMAND_MODIFY_TILE, heightOffset, 0);
|
||||
}
|
||||
|
||||
static void window_tile_inspector_track_block_set_lift(int32_t elementIndex, bool entireTrackBlock, bool chain)
|
||||
{
|
||||
game_do_command(
|
||||
TILE_INSPECTOR_TRACK_SET_CHAIN,
|
||||
GAME_COMMAND_FLAG_APPLY,
|
||||
windowTileInspectorTileX | (windowTileInspectorTileY << 8),
|
||||
elementIndex,
|
||||
GAME_COMMAND_MODIFY_TILE,
|
||||
entireTrackBlock,
|
||||
chain);
|
||||
TILE_INSPECTOR_TRACK_SET_CHAIN, GAME_COMMAND_FLAG_APPLY, windowTileInspectorTileX | (windowTileInspectorTileY << 8),
|
||||
elementIndex, GAME_COMMAND_MODIFY_TILE, entireTrackBlock, chain);
|
||||
}
|
||||
|
||||
static void window_tile_inspector_quarter_tile_set(int32_t elementIndex, const int32_t quarterIndex)
|
||||
@@ -837,25 +757,17 @@ static void window_tile_inspector_quarter_tile_set(int32_t elementIndex, const i
|
||||
openrct2_assert(quarterIndex >= 0 && quarterIndex < 4, "quarterIndex out of range");
|
||||
|
||||
game_do_command(
|
||||
TILE_INSPECTOR_SCENERY_SET_QUARTER_LOCATION,
|
||||
GAME_COMMAND_FLAG_APPLY,
|
||||
windowTileInspectorTileX | (windowTileInspectorTileY << 8),
|
||||
elementIndex,
|
||||
GAME_COMMAND_MODIFY_TILE,
|
||||
(quarterIndex - get_current_rotation()) & 3,
|
||||
0);
|
||||
TILE_INSPECTOR_SCENERY_SET_QUARTER_LOCATION, GAME_COMMAND_FLAG_APPLY,
|
||||
windowTileInspectorTileX | (windowTileInspectorTileY << 8), elementIndex, GAME_COMMAND_MODIFY_TILE,
|
||||
(quarterIndex - get_current_rotation()) & 3, 0);
|
||||
}
|
||||
|
||||
static void window_tile_inspector_toggle_quadrant_collosion(int32_t elementIndex, const int32_t quadrantIndex)
|
||||
{
|
||||
game_do_command(
|
||||
TILE_INSPECTOR_SCENERY_SET_QUARTER_COLLISION,
|
||||
GAME_COMMAND_FLAG_APPLY,
|
||||
windowTileInspectorTileX | (windowTileInspectorTileY << 8),
|
||||
elementIndex,
|
||||
GAME_COMMAND_MODIFY_TILE,
|
||||
(quadrantIndex + 2 - get_current_rotation()) & 3,
|
||||
0);
|
||||
TILE_INSPECTOR_SCENERY_SET_QUARTER_COLLISION, GAME_COMMAND_FLAG_APPLY,
|
||||
windowTileInspectorTileX | (windowTileInspectorTileY << 8), elementIndex, GAME_COMMAND_MODIFY_TILE,
|
||||
(quadrantIndex + 2 - get_current_rotation()) & 3, 0);
|
||||
}
|
||||
|
||||
static void window_tile_inspector_banner_toggle_block(int32_t elementIndex, int32_t edgeIndex)
|
||||
@@ -866,25 +778,15 @@ static void window_tile_inspector_banner_toggle_block(int32_t elementIndex, int3
|
||||
edgeIndex = (edgeIndex - get_current_rotation()) & 3;
|
||||
|
||||
game_do_command(
|
||||
TILE_INSPECTOR_BANNER_TOGGLE_BLOCKING_EDGE,
|
||||
GAME_COMMAND_FLAG_APPLY,
|
||||
windowTileInspectorTileX | (windowTileInspectorTileY << 8),
|
||||
elementIndex,
|
||||
GAME_COMMAND_MODIFY_TILE,
|
||||
edgeIndex,
|
||||
0);
|
||||
TILE_INSPECTOR_BANNER_TOGGLE_BLOCKING_EDGE, GAME_COMMAND_FLAG_APPLY,
|
||||
windowTileInspectorTileX | (windowTileInspectorTileY << 8), elementIndex, GAME_COMMAND_MODIFY_TILE, edgeIndex, 0);
|
||||
}
|
||||
|
||||
static void window_tile_inspector_clamp_corrupt(int32_t elementIndex)
|
||||
{
|
||||
game_do_command(
|
||||
TILE_INSPECTOR_CORRUPT_CLAMP,
|
||||
GAME_COMMAND_FLAG_APPLY,
|
||||
windowTileInspectorTileX | (windowTileInspectorTileY << 8),
|
||||
elementIndex,
|
||||
GAME_COMMAND_MODIFY_TILE,
|
||||
0,
|
||||
0);
|
||||
TILE_INSPECTOR_CORRUPT_CLAMP, GAME_COMMAND_FLAG_APPLY, windowTileInspectorTileX | (windowTileInspectorTileY << 8),
|
||||
elementIndex, GAME_COMMAND_MODIFY_TILE, 0, 0);
|
||||
}
|
||||
|
||||
static void window_tile_inspector_mouseup(rct_window* w, rct_widgetindex widgetIndex)
|
||||
@@ -1209,14 +1111,8 @@ static void window_tile_inspector_mousedown(rct_window* w, rct_widgetindex widge
|
||||
gDropdownItemsArgs[1] = STR_TILE_INSPECTOR_WALL_SLOPED_LEFT;
|
||||
gDropdownItemsArgs[2] = STR_TILE_INSPECTOR_WALL_SLOPED_RIGHT;
|
||||
window_dropdown_show_text_custom_width(
|
||||
w->x + widget->left,
|
||||
w->y + widget->top,
|
||||
widget->bottom - widget->top + 1,
|
||||
w->colours[1],
|
||||
0,
|
||||
DROPDOWN_FLAG_STAY_OPEN,
|
||||
3,
|
||||
widget->right - widget->left - 3);
|
||||
w->x + widget->left, w->y + widget->top, widget->bottom - widget->top + 1, w->colours[1], 0,
|
||||
DROPDOWN_FLAG_STAY_OPEN, 3, widget->right - widget->left - 3);
|
||||
|
||||
// Set current value as checked
|
||||
rct_tile_element* const tileElement = window_tile_inspector_get_selected_element(w);
|
||||
@@ -1495,13 +1391,11 @@ static void window_tile_inspector_invalidate(rct_window* w)
|
||||
|
||||
// X and Y spinners
|
||||
widget_set_enabled(
|
||||
w,
|
||||
WIDX_SPINNER_X_INCREASE,
|
||||
w, WIDX_SPINNER_X_INCREASE,
|
||||
(windowTileInspectorTileSelected && (windowTileInspectorTileX < MAXIMUM_MAP_SIZE_TECHNICAL - 1)));
|
||||
widget_set_enabled(w, WIDX_SPINNER_X_DECREASE, (windowTileInspectorTileSelected && (windowTileInspectorTileX > 0)));
|
||||
widget_set_enabled(
|
||||
w,
|
||||
WIDX_SPINNER_Y_INCREASE,
|
||||
w, WIDX_SPINNER_Y_INCREASE,
|
||||
(windowTileInspectorTileSelected && (windowTileInspectorTileY < MAXIMUM_MAP_SIZE_TECHNICAL - 1)));
|
||||
widget_set_enabled(w, WIDX_SPINNER_Y_DECREASE, (windowTileInspectorTileSelected && (windowTileInspectorTileY > 0)));
|
||||
|
||||
@@ -1514,8 +1408,7 @@ static void window_tile_inspector_invalidate(rct_window* w)
|
||||
|
||||
// Move Down button
|
||||
widget_set_enabled(
|
||||
w,
|
||||
WIDX_BUTTON_MOVE_DOWN,
|
||||
w, WIDX_BUTTON_MOVE_DOWN,
|
||||
(windowTileInspectorSelectedIndex != -1 && windowTileInspectorSelectedIndex < windowTileInspectorElementCount - 1));
|
||||
widget_invalidate(w, WIDX_BUTTON_MOVE_DOWN);
|
||||
|
||||
@@ -1582,20 +1475,16 @@ static void window_tile_inspector_invalidate(rct_window* w)
|
||||
w->widgets[WIDX_SURFACE_CHECK_DIAGONAL].top = GBBT(propertiesAnchor, 3) + 7 * 1;
|
||||
w->widgets[WIDX_SURFACE_CHECK_DIAGONAL].bottom = w->widgets[WIDX_SURFACE_CHECK_DIAGONAL].top + 13;
|
||||
widget_set_checkbox_value(
|
||||
w,
|
||||
WIDX_SURFACE_CHECK_CORNER_N,
|
||||
w, WIDX_SURFACE_CHECK_CORNER_N,
|
||||
tileElement->properties.surface.slope & (1 << ((2 - get_current_rotation()) & 3)));
|
||||
widget_set_checkbox_value(
|
||||
w,
|
||||
WIDX_SURFACE_CHECK_CORNER_E,
|
||||
w, WIDX_SURFACE_CHECK_CORNER_E,
|
||||
tileElement->properties.surface.slope & (1 << ((3 - get_current_rotation()) & 3)));
|
||||
widget_set_checkbox_value(
|
||||
w,
|
||||
WIDX_SURFACE_CHECK_CORNER_S,
|
||||
w, WIDX_SURFACE_CHECK_CORNER_S,
|
||||
tileElement->properties.surface.slope & (1 << ((0 - get_current_rotation()) & 3)));
|
||||
widget_set_checkbox_value(
|
||||
w,
|
||||
WIDX_SURFACE_CHECK_CORNER_W,
|
||||
w, WIDX_SURFACE_CHECK_CORNER_W,
|
||||
tileElement->properties.surface.slope & (1 << ((1 - get_current_rotation()) & 3)));
|
||||
widget_set_checkbox_value(
|
||||
w, WIDX_SURFACE_CHECK_DIAGONAL, tileElement->properties.surface.slope & TILE_ELEMENT_SLOPE_DOUBLE_HEIGHT);
|
||||
@@ -1635,20 +1524,16 @@ static void window_tile_inspector_invalidate(rct_window* w)
|
||||
widget_set_checkbox_value(
|
||||
w, WIDX_PATH_CHECK_EDGE_NW, tileElement->properties.path.edges & (1 << ((3 - get_current_rotation()) & 3)));
|
||||
widget_set_checkbox_value(
|
||||
w,
|
||||
WIDX_PATH_CHECK_EDGE_E,
|
||||
w, WIDX_PATH_CHECK_EDGE_E,
|
||||
tileElement->properties.path.edges & (1 << (4 + ((0 - get_current_rotation()) & 3))));
|
||||
widget_set_checkbox_value(
|
||||
w,
|
||||
WIDX_PATH_CHECK_EDGE_S,
|
||||
w, WIDX_PATH_CHECK_EDGE_S,
|
||||
tileElement->properties.path.edges & (1 << (4 + ((1 - get_current_rotation()) & 3))));
|
||||
widget_set_checkbox_value(
|
||||
w,
|
||||
WIDX_PATH_CHECK_EDGE_W,
|
||||
w, WIDX_PATH_CHECK_EDGE_W,
|
||||
tileElement->properties.path.edges & (1 << (4 + ((2 - get_current_rotation()) & 3))));
|
||||
widget_set_checkbox_value(
|
||||
w,
|
||||
WIDX_PATH_CHECK_EDGE_N,
|
||||
w, WIDX_PATH_CHECK_EDGE_N,
|
||||
tileElement->properties.path.edges & (1 << (4 + ((3 - get_current_rotation()) & 3))));
|
||||
break;
|
||||
case TILE_INSPECTOR_PAGE_TRACK:
|
||||
@@ -1772,20 +1657,16 @@ static void window_tile_inspector_invalidate(rct_window* w)
|
||||
w->widgets[WIDX_BANNER_CHECK_BLOCK_NW].top = GBBT(propertiesAnchor, 1);
|
||||
w->widgets[WIDX_BANNER_CHECK_BLOCK_NW].bottom = GBBB(propertiesAnchor, 1);
|
||||
widget_set_checkbox_value(
|
||||
w,
|
||||
WIDX_BANNER_CHECK_BLOCK_NE,
|
||||
w, WIDX_BANNER_CHECK_BLOCK_NE,
|
||||
!(tileElement->properties.banner.flags & (1 << ((0 - get_current_rotation()) & 3))));
|
||||
widget_set_checkbox_value(
|
||||
w,
|
||||
WIDX_BANNER_CHECK_BLOCK_SE,
|
||||
w, WIDX_BANNER_CHECK_BLOCK_SE,
|
||||
!(tileElement->properties.banner.flags & (1 << ((1 - get_current_rotation()) & 3))));
|
||||
widget_set_checkbox_value(
|
||||
w,
|
||||
WIDX_BANNER_CHECK_BLOCK_SW,
|
||||
w, WIDX_BANNER_CHECK_BLOCK_SW,
|
||||
!(tileElement->properties.banner.flags & (1 << ((2 - get_current_rotation()) & 3))));
|
||||
widget_set_checkbox_value(
|
||||
w,
|
||||
WIDX_BANNER_CHECK_BLOCK_NW,
|
||||
w, WIDX_BANNER_CHECK_BLOCK_NW,
|
||||
!(tileElement->properties.banner.flags & (1 << ((3 - get_current_rotation()) & 3))));
|
||||
break;
|
||||
case TILE_INSPECTOR_PAGE_CORRUPT:
|
||||
@@ -1813,68 +1694,38 @@ static void window_tile_inspector_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
||||
if ((widget = &w->widgets[WIDX_COLUMN_TYPE])->type != WWT_EMPTY)
|
||||
{
|
||||
gfx_draw_string_left_clipped(
|
||||
dpi,
|
||||
STR_TILE_INSPECTOR_ELEMENT_TYPE,
|
||||
gCommonFormatArgs,
|
||||
w->colours[1],
|
||||
w->x + widget->left + 1,
|
||||
w->y + widget->top + 1,
|
||||
widget->right - widget->left);
|
||||
dpi, STR_TILE_INSPECTOR_ELEMENT_TYPE, gCommonFormatArgs, w->colours[1], w->x + widget->left + 1,
|
||||
w->y + widget->top + 1, widget->right - widget->left);
|
||||
}
|
||||
if ((widget = &w->widgets[WIDX_COLUMN_BASEHEIGHT])->type != WWT_EMPTY)
|
||||
{
|
||||
gfx_draw_string_left_clipped(
|
||||
dpi,
|
||||
STR_TILE_INSPECTOR_BASE_HEIGHT_SHORT,
|
||||
gCommonFormatArgs,
|
||||
w->colours[1],
|
||||
w->x + widget->left + 1,
|
||||
w->y + widget->top + 1,
|
||||
widget->right - widget->left);
|
||||
dpi, STR_TILE_INSPECTOR_BASE_HEIGHT_SHORT, gCommonFormatArgs, w->colours[1], w->x + widget->left + 1,
|
||||
w->y + widget->top + 1, widget->right - widget->left);
|
||||
}
|
||||
if ((widget = &w->widgets[WIDX_COLUMN_CLEARANCEHEIGHT])->type != WWT_EMPTY)
|
||||
{
|
||||
gfx_draw_string_left_clipped(
|
||||
dpi,
|
||||
STR_TILE_INSPECTOR_CLEARANGE_HEIGHT_SHORT,
|
||||
gCommonFormatArgs,
|
||||
w->colours[1],
|
||||
w->x + widget->left + 1,
|
||||
w->y + widget->top + 1,
|
||||
widget->right - widget->left);
|
||||
dpi, STR_TILE_INSPECTOR_CLEARANGE_HEIGHT_SHORT, gCommonFormatArgs, w->colours[1], w->x + widget->left + 1,
|
||||
w->y + widget->top + 1, widget->right - widget->left);
|
||||
}
|
||||
if ((widget = &w->widgets[WIDX_COLUMN_GHOSTFLAG])->type != WWT_EMPTY)
|
||||
{
|
||||
gfx_draw_string_left_clipped(
|
||||
dpi,
|
||||
STR_TILE_INSPECTOR_FLAG_GHOST_SHORT,
|
||||
gCommonFormatArgs,
|
||||
w->colours[1],
|
||||
w->x + widget->left + 1,
|
||||
w->y + widget->top + 1,
|
||||
widget->right - widget->left);
|
||||
dpi, STR_TILE_INSPECTOR_FLAG_GHOST_SHORT, gCommonFormatArgs, w->colours[1], w->x + widget->left + 1,
|
||||
w->y + widget->top + 1, widget->right - widget->left);
|
||||
}
|
||||
if ((widget = &w->widgets[WIDX_COLUMN_BROKENFLAG])->type != WWT_EMPTY)
|
||||
{
|
||||
gfx_draw_string_left_clipped(
|
||||
dpi,
|
||||
STR_TILE_INSPECTOR_FLAG_BROKEN_SHORT,
|
||||
gCommonFormatArgs,
|
||||
w->colours[1],
|
||||
w->x + widget->left + 1,
|
||||
w->y + widget->top + 1,
|
||||
widget->right - widget->left);
|
||||
dpi, STR_TILE_INSPECTOR_FLAG_BROKEN_SHORT, gCommonFormatArgs, w->colours[1], w->x + widget->left + 1,
|
||||
w->y + widget->top + 1, widget->right - widget->left);
|
||||
}
|
||||
if ((widget = &w->widgets[WIDX_COLUMN_LASTFLAG])->type != WWT_EMPTY)
|
||||
{
|
||||
gfx_draw_string_left_clipped(
|
||||
dpi,
|
||||
STR_TILE_INSPECTOR_FLAG_LAST_SHORT,
|
||||
gCommonFormatArgs,
|
||||
w->colours[1],
|
||||
w->x + widget->left + 1,
|
||||
w->y + widget->top + 1,
|
||||
widget->right - widget->left);
|
||||
dpi, STR_TILE_INSPECTOR_FLAG_LAST_SHORT, gCommonFormatArgs, w->colours[1], w->x + widget->left + 1,
|
||||
w->y + widget->top + 1, widget->right - widget->left);
|
||||
}
|
||||
|
||||
// Draw coordinates
|
||||
@@ -1913,8 +1764,7 @@ static void window_tile_inspector_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
||||
int32_t idx = surface_get_terrain_edge(tileElement);
|
||||
openrct2_assert(
|
||||
(uint32_t)idx < Util::CountOf(TerrainEdgeTypeStringIds),
|
||||
"Tried accessing invalid entry %d in terrainEdgeTypeStringIds",
|
||||
idx);
|
||||
"Tried accessing invalid entry %d in terrainEdgeTypeStringIds", idx);
|
||||
rct_string_id terrainEdgeNameId = TerrainEdgeTypeStringIds[surface_get_terrain_edge(tileElement)];
|
||||
gfx_draw_string_left(dpi, STR_TILE_INSPECTOR_SURFACE_EDGE, &terrainEdgeNameId, COLOUR_DARK_GREEN, x, y + 11);
|
||||
|
||||
@@ -2136,12 +1986,8 @@ static void window_tile_inspector_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
||||
if (wallEntry.flags & WALL_SCENERY_IS_BANNER)
|
||||
{
|
||||
gfx_draw_string_left(
|
||||
dpi,
|
||||
STR_TILE_INSPECTOR_ENTRY_BANNER_TEXT,
|
||||
&gBanners[tileElement->properties.wall.banner_index].string_idx,
|
||||
COLOUR_DARK_GREEN,
|
||||
x,
|
||||
y + 11);
|
||||
dpi, STR_TILE_INSPECTOR_ENTRY_BANNER_TEXT,
|
||||
&gBanners[tileElement->properties.wall.banner_index].string_idx, COLOUR_DARK_GREEN, x, y + 11);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2301,10 +2147,7 @@ static void window_tile_inspector_scrollpaint(rct_window* w, rct_drawpixelinfo*
|
||||
break;
|
||||
case TILE_ELEMENT_TYPE_SMALL_SCENERY:
|
||||
snprintf(
|
||||
buffer,
|
||||
sizeof(buffer),
|
||||
"%s (%s)",
|
||||
language_get_string(STR_OBJECT_SELECTION_SMALL_SCENERY),
|
||||
buffer, sizeof(buffer), "%s (%s)", language_get_string(STR_OBJECT_SELECTION_SMALL_SCENERY),
|
||||
language_get_string(get_small_scenery_entry(tileElement->properties.scenery.type)->name));
|
||||
typeName = buffer;
|
||||
break;
|
||||
@@ -2313,10 +2156,7 @@ static void window_tile_inspector_scrollpaint(rct_window* w, rct_drawpixelinfo*
|
||||
break;
|
||||
case TILE_ELEMENT_TYPE_WALL:
|
||||
snprintf(
|
||||
buffer,
|
||||
sizeof(buffer),
|
||||
"%s (%s)",
|
||||
language_get_string(STR_TILE_INSPECTOR_WALL),
|
||||
buffer, sizeof(buffer), "%s (%s)", language_get_string(STR_TILE_INSPECTOR_WALL),
|
||||
language_get_string(get_wall_entry(tileElement->properties.scenery.type)->name));
|
||||
typeName = buffer;
|
||||
break;
|
||||
@@ -2325,10 +2165,7 @@ static void window_tile_inspector_scrollpaint(rct_window* w, rct_drawpixelinfo*
|
||||
break;
|
||||
case TILE_ELEMENT_TYPE_BANNER:
|
||||
snprintf(
|
||||
buffer,
|
||||
sizeof(buffer),
|
||||
"%s (%d)",
|
||||
language_get_string(STR_BANNER_WINDOW_TITLE),
|
||||
buffer, sizeof(buffer), "%s (%d)", language_get_string(STR_BANNER_WINDOW_TITLE),
|
||||
tileElement->properties.banner.index);
|
||||
typeName = buffer;
|
||||
break;
|
||||
|
||||
@@ -197,15 +197,8 @@ static LocationXY16 get_location()
|
||||
rct_tile_element* tileElement;
|
||||
|
||||
get_map_coordinates_from_pos_window(
|
||||
w,
|
||||
w->viewport->view_width / 2,
|
||||
w->viewport->view_height / 2,
|
||||
VIEWPORT_INTERACTION_MASK_TERRAIN,
|
||||
&mapCoord.x,
|
||||
&mapCoord.y,
|
||||
&interactionType,
|
||||
&tileElement,
|
||||
nullptr);
|
||||
w, w->viewport->view_width / 2, w->viewport->view_height / 2, VIEWPORT_INTERACTION_MASK_TERRAIN, &mapCoord.x,
|
||||
&mapCoord.y, &interactionType, &tileElement, nullptr);
|
||||
mapCoord.x -= 16;
|
||||
mapCoord.x /= 32;
|
||||
mapCoord.y -= 16;
|
||||
@@ -257,17 +250,8 @@ void window_title_command_editor_open(TitleSequence* sequence, int32_t index, bo
|
||||
|
||||
rct_widget* const viewportWidget = &window_title_command_editor_widgets[WIDX_VIEWPORT];
|
||||
viewport_create(
|
||||
window,
|
||||
window->x + viewportWidget->left + 1,
|
||||
window->y + viewportWidget->top + 1,
|
||||
viewportWidget->right - viewportWidget->left - 1,
|
||||
viewportWidget->bottom - viewportWidget->top - 1,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
-1);
|
||||
window, window->x + viewportWidget->left + 1, window->y + viewportWidget->top + 1,
|
||||
viewportWidget->right - viewportWidget->left - 1, viewportWidget->bottom - viewportWidget->top - 1, 0, 0, 0, 0, 0, -1);
|
||||
|
||||
_window_title_command_editor_index = index;
|
||||
_window_title_command_editor_insert = insert;
|
||||
@@ -410,14 +394,8 @@ static void window_title_command_editor_mousedown(rct_window* w, rct_widgetindex
|
||||
}
|
||||
|
||||
window_dropdown_show_text_custom_width(
|
||||
w->x + widget->left,
|
||||
w->y + widget->top,
|
||||
widget->bottom - widget->top + 1,
|
||||
w->colours[1],
|
||||
0,
|
||||
DROPDOWN_FLAG_STAY_OPEN,
|
||||
numItems,
|
||||
widget->right - widget->left - 3);
|
||||
w->x + widget->left, w->y + widget->top, widget->bottom - widget->top + 1, w->colours[1], 0,
|
||||
DROPDOWN_FLAG_STAY_OPEN, numItems, widget->right - widget->left - 3);
|
||||
|
||||
dropdown_set_checked(get_command_info_index(command.Type), true);
|
||||
break;
|
||||
@@ -433,14 +411,8 @@ static void window_title_command_editor_mousedown(rct_window* w, rct_widgetindex
|
||||
}
|
||||
|
||||
window_dropdown_show_text_custom_width(
|
||||
w->x + widget->left,
|
||||
w->y + widget->top,
|
||||
widget->bottom - widget->top + 1,
|
||||
w->colours[1],
|
||||
0,
|
||||
DROPDOWN_FLAG_STAY_OPEN,
|
||||
numItems,
|
||||
widget->right - widget->left - 3);
|
||||
w->x + widget->left, w->y + widget->top, widget->bottom - widget->top + 1, w->colours[1], 0,
|
||||
DROPDOWN_FLAG_STAY_OPEN, numItems, widget->right - widget->left - 3);
|
||||
|
||||
dropdown_set_checked(command.Speed - 1, true);
|
||||
}
|
||||
@@ -454,14 +426,8 @@ static void window_title_command_editor_mousedown(rct_window* w, rct_widgetindex
|
||||
}
|
||||
|
||||
window_dropdown_show_text_custom_width(
|
||||
w->x + widget->left,
|
||||
w->y + widget->top,
|
||||
widget->bottom - widget->top + 1,
|
||||
w->colours[1],
|
||||
0,
|
||||
DROPDOWN_FLAG_STAY_OPEN,
|
||||
numItems,
|
||||
widget->right - widget->left - 3);
|
||||
w->x + widget->left, w->y + widget->top, widget->bottom - widget->top + 1, w->colours[1], 0,
|
||||
DROPDOWN_FLAG_STAY_OPEN, numItems, widget->right - widget->left - 3);
|
||||
|
||||
dropdown_set_checked(command.SaveIndex, true);
|
||||
}
|
||||
@@ -772,13 +738,8 @@ static void window_title_command_editor_paint(rct_window* w, rct_drawpixelinfo*
|
||||
|
||||
// Command dropdown name
|
||||
gfx_draw_string_left_clipped(
|
||||
dpi,
|
||||
command_info.nameStringId,
|
||||
nullptr,
|
||||
w->colours[1],
|
||||
w->x + w->widgets[WIDX_COMMAND].left + 1,
|
||||
w->y + w->widgets[WIDX_COMMAND].top,
|
||||
w->widgets[WIDX_COMMAND_DROPDOWN].left - w->widgets[WIDX_COMMAND].left - 4);
|
||||
dpi, command_info.nameStringId, nullptr, w->colours[1], w->x + w->widgets[WIDX_COMMAND].left + 1,
|
||||
w->y + w->widgets[WIDX_COMMAND].top, w->widgets[WIDX_COMMAND_DROPDOWN].left - w->widgets[WIDX_COMMAND].left - 4);
|
||||
|
||||
// Label (e.g. "Location:")
|
||||
gfx_draw_string_left(dpi, command_info.descStringId, nullptr, w->colours[1], w->x + WS, w->y + BY2 - 14);
|
||||
@@ -786,13 +747,8 @@ static void window_title_command_editor_paint(rct_window* w, rct_drawpixelinfo*
|
||||
if (command.Type == TITLE_SCRIPT_SPEED)
|
||||
{
|
||||
gfx_draw_string_left_clipped(
|
||||
dpi,
|
||||
SpeedNames[command.Speed - 1],
|
||||
nullptr,
|
||||
w->colours[1],
|
||||
w->x + w->widgets[WIDX_INPUT].left + 1,
|
||||
w->y + w->widgets[WIDX_INPUT].top,
|
||||
w->widgets[WIDX_INPUT_DROPDOWN].left - w->widgets[WIDX_INPUT].left - 4);
|
||||
dpi, SpeedNames[command.Speed - 1], nullptr, w->colours[1], w->x + w->widgets[WIDX_INPUT].left + 1,
|
||||
w->y + w->widgets[WIDX_INPUT].top, w->widgets[WIDX_INPUT_DROPDOWN].left - w->widgets[WIDX_INPUT].left - 4);
|
||||
}
|
||||
if (command.Type == TITLE_SCRIPT_FOLLOW)
|
||||
{
|
||||
@@ -810,43 +766,26 @@ static void window_title_command_editor_paint(rct_window* w, rct_drawpixelinfo*
|
||||
}
|
||||
|
||||
gfx_set_dirty_blocks(
|
||||
w->x + w->widgets[WIDX_VIEWPORT].left,
|
||||
w->y + w->widgets[WIDX_VIEWPORT].top,
|
||||
w->x + w->widgets[WIDX_VIEWPORT].right,
|
||||
w->x + w->widgets[WIDX_VIEWPORT].left, w->y + w->widgets[WIDX_VIEWPORT].top, w->x + w->widgets[WIDX_VIEWPORT].right,
|
||||
w->y + w->widgets[WIDX_VIEWPORT].bottom);
|
||||
gfx_draw_string_left_clipped(
|
||||
dpi,
|
||||
spriteString,
|
||||
gCommonFormatArgs,
|
||||
colour,
|
||||
w->x + w->widgets[WIDX_VIEWPORT].left + 2,
|
||||
w->y + w->widgets[WIDX_VIEWPORT].top + 1,
|
||||
w->widgets[WIDX_VIEWPORT].right - w->widgets[WIDX_VIEWPORT].left - 2);
|
||||
dpi, spriteString, gCommonFormatArgs, colour, w->x + w->widgets[WIDX_VIEWPORT].left + 2,
|
||||
w->y + w->widgets[WIDX_VIEWPORT].top + 1, w->widgets[WIDX_VIEWPORT].right - w->widgets[WIDX_VIEWPORT].left - 2);
|
||||
}
|
||||
else if (command.Type == TITLE_SCRIPT_LOAD)
|
||||
{
|
||||
if (command.SaveIndex == SAVE_INDEX_INVALID)
|
||||
{
|
||||
gfx_draw_string_left_clipped(
|
||||
dpi,
|
||||
STR_TITLE_COMMAND_EDITOR_NO_SAVE_SELECTED,
|
||||
nullptr,
|
||||
w->colours[1],
|
||||
w->x + w->widgets[WIDX_INPUT].left + 1,
|
||||
w->y + w->widgets[WIDX_INPUT].top,
|
||||
w->widgets[WIDX_INPUT_DROPDOWN].left - w->widgets[WIDX_INPUT].left - 4);
|
||||
dpi, STR_TITLE_COMMAND_EDITOR_NO_SAVE_SELECTED, nullptr, w->colours[1], w->x + w->widgets[WIDX_INPUT].left + 1,
|
||||
w->y + w->widgets[WIDX_INPUT].top, w->widgets[WIDX_INPUT_DROPDOWN].left - w->widgets[WIDX_INPUT].left - 4);
|
||||
}
|
||||
else
|
||||
{
|
||||
set_format_arg(0, uintptr_t, (uintptr_t)_sequence->Saves[command.SaveIndex]);
|
||||
gfx_draw_string_left_clipped(
|
||||
dpi,
|
||||
STR_STRING,
|
||||
gCommonFormatArgs,
|
||||
w->colours[1],
|
||||
w->x + w->widgets[WIDX_INPUT].left + 1,
|
||||
w->y + w->widgets[WIDX_INPUT].top,
|
||||
w->widgets[WIDX_INPUT_DROPDOWN].left - w->widgets[WIDX_INPUT].left - 4);
|
||||
dpi, STR_STRING, gCommonFormatArgs, w->colours[1], w->x + w->widgets[WIDX_INPUT].left + 1,
|
||||
w->y + w->widgets[WIDX_INPUT].top, w->widgets[WIDX_INPUT_DROPDOWN].left - w->widgets[WIDX_INPUT].left - 4);
|
||||
}
|
||||
}
|
||||
else if (command.Type == TITLE_SCRIPT_LOADSC)
|
||||
@@ -854,12 +793,8 @@ static void window_title_command_editor_paint(rct_window* w, rct_drawpixelinfo*
|
||||
if (command.Scenario[0] == '\0')
|
||||
{
|
||||
gfx_draw_string_left_clipped(
|
||||
dpi,
|
||||
STR_TITLE_COMMAND_EDITOR_NO_SCENARIO_SELECTED,
|
||||
nullptr,
|
||||
w->colours[1],
|
||||
w->x + w->widgets[WIDX_INPUT].left + 1,
|
||||
w->y + w->widgets[WIDX_INPUT].top,
|
||||
dpi, STR_TITLE_COMMAND_EDITOR_NO_SCENARIO_SELECTED, nullptr, w->colours[1],
|
||||
w->x + w->widgets[WIDX_INPUT].left + 1, w->y + w->widgets[WIDX_INPUT].top,
|
||||
w->widgets[WIDX_INPUT_DROPDOWN].left - w->widgets[WIDX_INPUT].left - 4);
|
||||
}
|
||||
else
|
||||
@@ -877,13 +812,8 @@ static void window_title_command_editor_paint(rct_window* w, rct_drawpixelinfo*
|
||||
}
|
||||
set_format_arg(0, uintptr_t, name);
|
||||
gfx_draw_string_left_clipped(
|
||||
dpi,
|
||||
nameString,
|
||||
gCommonFormatArgs,
|
||||
w->colours[1],
|
||||
w->x + w->widgets[WIDX_INPUT].left + 1,
|
||||
w->y + w->widgets[WIDX_INPUT].top,
|
||||
w->widgets[WIDX_INPUT_DROPDOWN].left - w->widgets[WIDX_INPUT].left - 4);
|
||||
dpi, nameString, gCommonFormatArgs, w->colours[1], w->x + w->widgets[WIDX_INPUT].left + 1,
|
||||
w->y + w->widgets[WIDX_INPUT].top, w->widgets[WIDX_INPUT_DROPDOWN].left - w->widgets[WIDX_INPUT].left - 4);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -296,12 +296,7 @@ static void window_title_editor_mouseup(rct_window* w, rct_widgetindex widgetInd
|
||||
{
|
||||
// TODO: This should probably be 'NEW'
|
||||
window_text_input_open(
|
||||
w,
|
||||
widgetIndex,
|
||||
STR_TITLE_EDITOR_ACTION_DUPLICATE,
|
||||
STR_TITLE_EDITOR_ENTER_NAME_FOR_SEQUENCE,
|
||||
STR_NONE,
|
||||
0,
|
||||
w, widgetIndex, STR_TITLE_EDITOR_ACTION_DUPLICATE, STR_TITLE_EDITOR_ENTER_NAME_FOR_SEQUENCE, STR_NONE, 0,
|
||||
64);
|
||||
}
|
||||
break;
|
||||
@@ -309,13 +304,8 @@ static void window_title_editor_mouseup(rct_window* w, rct_widgetindex widgetInd
|
||||
if (!commandEditorOpen && _editingTitleSequence != nullptr)
|
||||
{
|
||||
window_text_input_open(
|
||||
w,
|
||||
widgetIndex,
|
||||
STR_TITLE_EDITOR_ACTION_DUPLICATE,
|
||||
STR_TITLE_EDITOR_ENTER_NAME_FOR_SEQUENCE,
|
||||
STR_STRING,
|
||||
(uintptr_t)_sequenceName,
|
||||
64);
|
||||
w, widgetIndex, STR_TITLE_EDITOR_ACTION_DUPLICATE, STR_TITLE_EDITOR_ENTER_NAME_FOR_SEQUENCE, STR_STRING,
|
||||
(uintptr_t)_sequenceName, 64);
|
||||
}
|
||||
break;
|
||||
case WIDX_TITLE_EDITOR_DELETE_BUTTON:
|
||||
@@ -329,13 +319,8 @@ static void window_title_editor_mouseup(rct_window* w, rct_widgetindex widgetInd
|
||||
if (window_title_editor_check_can_edit() && _editingTitleSequence != nullptr)
|
||||
{
|
||||
window_text_input_open(
|
||||
w,
|
||||
widgetIndex,
|
||||
STR_TRACK_MANAGE_RENAME,
|
||||
STR_TITLE_EDITOR_ENTER_NAME_FOR_SEQUENCE,
|
||||
STR_STRING,
|
||||
(uintptr_t)_sequenceName,
|
||||
64);
|
||||
w, widgetIndex, STR_TRACK_MANAGE_RENAME, STR_TITLE_EDITOR_ENTER_NAME_FOR_SEQUENCE, STR_STRING,
|
||||
(uintptr_t)_sequenceName, 64);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -370,13 +355,8 @@ static void window_title_editor_mouseup(rct_window* w, rct_widgetindex widgetInd
|
||||
if (w->selected_list_item != -1)
|
||||
{
|
||||
window_text_input_open(
|
||||
w,
|
||||
widgetIndex,
|
||||
STR_FILEBROWSER_RENAME_SAVE_TITLE,
|
||||
STR_TITLE_EDITOR_ENTER_NAME_FOR_SAVE,
|
||||
STR_STRING,
|
||||
(uintptr_t)_editingTitleSequence->Saves[w->selected_list_item],
|
||||
52 - 1);
|
||||
w, widgetIndex, STR_FILEBROWSER_RENAME_SAVE_TITLE, STR_TITLE_EDITOR_ENTER_NAME_FOR_SAVE, STR_STRING,
|
||||
(uintptr_t)_editingTitleSequence->Saves[w->selected_list_item], 52 - 1);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -572,14 +552,8 @@ static void window_title_editor_mousedown(rct_window* w, rct_widgetindex widgetI
|
||||
|
||||
widget--;
|
||||
window_dropdown_show_text_custom_width(
|
||||
w->x + widget->left,
|
||||
w->y + widget->top,
|
||||
widget->bottom - widget->top + 1,
|
||||
w->colours[1],
|
||||
0,
|
||||
DROPDOWN_FLAG_STAY_OPEN,
|
||||
numItems,
|
||||
widget->right - widget->left - 3);
|
||||
w->x + widget->left, w->y + widget->top, widget->bottom - widget->top + 1, w->colours[1], 0,
|
||||
DROPDOWN_FLAG_STAY_OPEN, numItems, widget->right - widget->left - 3);
|
||||
dropdown_set_checked((int32_t)_selectedTitleSequence, true);
|
||||
}
|
||||
break;
|
||||
@@ -855,17 +829,10 @@ static void window_title_editor_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
||||
case WINDOW_TITLE_EDITOR_TAB_PRESETS:
|
||||
set_format_arg(0, uintptr_t, _sequenceName);
|
||||
gfx_draw_string_left(
|
||||
dpi,
|
||||
STR_TITLE_SEQUENCE,
|
||||
nullptr,
|
||||
w->colours[1],
|
||||
w->x + 10,
|
||||
dpi, STR_TITLE_SEQUENCE, nullptr, w->colours[1], w->x + 10,
|
||||
w->y + window_title_editor_widgets[WIDX_TITLE_EDITOR_PRESETS].top + 1);
|
||||
gfx_draw_string_left_clipped(
|
||||
dpi,
|
||||
STR_STRING,
|
||||
gCommonFormatArgs,
|
||||
w->colours[1],
|
||||
dpi, STR_STRING, gCommonFormatArgs, w->colours[1],
|
||||
w->x + window_title_editor_widgets[WIDX_TITLE_EDITOR_PRESETS].left + 1,
|
||||
w->y + window_title_editor_widgets[WIDX_TITLE_EDITOR_PRESETS].top,
|
||||
w->x + window_title_editor_widgets[WIDX_TITLE_EDITOR_PRESETS_DROPDOWN].left
|
||||
@@ -921,11 +888,7 @@ static void window_title_editor_scrollpaint_saves(rct_window* w, rct_drawpixelin
|
||||
else if (i & 1)
|
||||
{
|
||||
gfx_fill_rect(
|
||||
dpi,
|
||||
x,
|
||||
y,
|
||||
x + SCROLL_WIDTH + 100,
|
||||
y + SCROLLABLE_ROW_HEIGHT - 1,
|
||||
dpi, x, y, x + SCROLL_WIDTH + 100, y + SCROLLABLE_ROW_HEIGHT - 1,
|
||||
ColourMapA[w->colours[1]].lighter | 0x1000000);
|
||||
}
|
||||
|
||||
@@ -975,11 +938,7 @@ static void window_title_editor_scrollpaint_commands(rct_window* w, rct_drawpixe
|
||||
else if (i & 1)
|
||||
{
|
||||
gfx_fill_rect(
|
||||
dpi,
|
||||
x,
|
||||
y,
|
||||
x + SCROLL_WIDTH + 100,
|
||||
y + SCROLLABLE_ROW_HEIGHT - 1,
|
||||
dpi, x, y, x + SCROLL_WIDTH + 100, y + SCROLLABLE_ROW_HEIGHT - 1,
|
||||
ColourMapA[w->colours[1]].lighter | 0x1000000);
|
||||
}
|
||||
|
||||
@@ -1107,11 +1066,8 @@ static void window_title_editor_draw_tab_images(rct_drawpixelinfo* dpi, rct_wind
|
||||
y = 1;
|
||||
}
|
||||
gfx_draw_sprite(
|
||||
dpi,
|
||||
spriteId,
|
||||
w->x + w->widgets[WIDX_TITLE_EDITOR_PRESETS_TAB + i].left + x,
|
||||
w->y + w->widgets[WIDX_TITLE_EDITOR_PRESETS_TAB + i].top + y,
|
||||
0);
|
||||
dpi, spriteId, w->x + w->widgets[WIDX_TITLE_EDITOR_PRESETS_TAB + i].left + x,
|
||||
w->y + w->widgets[WIDX_TITLE_EDITOR_PRESETS_TAB + i].top + y, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1186,13 +1142,8 @@ static void window_title_editor_add_park_callback(int32_t result, const utf8* pa
|
||||
// set_format_arg(0, intptr_t, (intptr_t)&_renameSavePath);
|
||||
rct_window* w = window_find_by_class(WC_TITLE_EDITOR);
|
||||
window_text_input_open(
|
||||
w,
|
||||
WIDX_TITLE_EDITOR_RENAME_SAVE,
|
||||
STR_FILEBROWSER_RENAME_SAVE_TITLE,
|
||||
STR_ERROR_EXISTING_NAME,
|
||||
STR_STRING,
|
||||
(uintptr_t)_renameSavePath,
|
||||
52 - 1);
|
||||
w, WIDX_TITLE_EDITOR_RENAME_SAVE, STR_FILEBROWSER_RENAME_SAVE_TITLE, STR_ERROR_EXISTING_NAME, STR_STRING,
|
||||
(uintptr_t)_renameSavePath, 52 - 1);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -69,12 +69,7 @@ rct_window* window_title_exit_open()
|
||||
rct_window* window;
|
||||
|
||||
window = window_create(
|
||||
context_get_width() - 40,
|
||||
context_get_height() - 64,
|
||||
40,
|
||||
64,
|
||||
&window_title_exit_events,
|
||||
WC_TITLE_EXIT,
|
||||
context_get_width() - 40, context_get_height() - 64, 40, 64, &window_title_exit_events, WC_TITLE_EXIT,
|
||||
WF_STICK_TO_BACK | WF_TRANSPARENT);
|
||||
window->widgets = window_title_exit_widgets;
|
||||
window->enabled_widgets |= (1ULL << WIDX_EXIT);
|
||||
|
||||
@@ -82,12 +82,7 @@ rct_window* window_title_menu_open()
|
||||
rct_window* window;
|
||||
|
||||
window = window_create(
|
||||
0,
|
||||
context_get_height() - 142,
|
||||
0,
|
||||
100,
|
||||
&window_title_menu_events,
|
||||
WC_TITLE_MENU,
|
||||
0, context_get_height() - 142, 0, 100, &window_title_menu_events, WC_TITLE_MENU,
|
||||
WF_STICK_TO_BACK | WF_TRANSPARENT | WF_NO_BACKGROUND);
|
||||
window->widgets = window_title_menu_widgets;
|
||||
window->enabled_widgets
|
||||
@@ -184,12 +179,8 @@ static void window_title_menu_mousedown(rct_window* w, rct_widgetindex widgetInd
|
||||
gDropdownItemsFormat[2] = STR_ROLLER_COASTER_DESIGNER;
|
||||
gDropdownItemsFormat[3] = STR_TRACK_DESIGNS_MANAGER;
|
||||
window_dropdown_show_text(
|
||||
w->x + widget->left,
|
||||
w->y + widget->top,
|
||||
widget->bottom - widget->top + 1,
|
||||
TRANSLUCENT(w->colours[0]),
|
||||
DROPDOWN_FLAG_STAY_OPEN,
|
||||
4);
|
||||
w->x + widget->left, w->y + widget->top, widget->bottom - widget->top + 1, TRANSLUCENT(w->colours[0]),
|
||||
DROPDOWN_FLAG_STAY_OPEN, 4);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -182,10 +182,7 @@ rct_window* window_scenarioselect_open(scenarioselect_callback callback, bool ti
|
||||
windowWidth = 733;
|
||||
|
||||
window = window_create_centred(
|
||||
windowWidth,
|
||||
windowHeight,
|
||||
&window_scenarioselect_events,
|
||||
WC_SCENARIO_SELECT,
|
||||
windowWidth, windowHeight, &window_scenarioselect_events, WC_SCENARIO_SELECT,
|
||||
WF_10 | (titleEditor ? WF_STICK_TO_FRONT : 0));
|
||||
window->widgets = window_scenarioselect_widgets;
|
||||
window->enabled_widgets = (1 << WIDX_CLOSE) | (1 << WIDX_TAB1) | (1 << WIDX_TAB2) | (1 << WIDX_TAB3) | (1 << WIDX_TAB4)
|
||||
|
||||
@@ -305,12 +305,7 @@ static colour_t _tertiaryColour;
|
||||
rct_window* window_top_toolbar_open()
|
||||
{
|
||||
rct_window* window = window_create(
|
||||
0,
|
||||
0,
|
||||
context_get_width(),
|
||||
TOP_TOOLBAR_HEIGHT + 1,
|
||||
&window_top_toolbar_events,
|
||||
WC_TOP_TOOLBAR,
|
||||
0, 0, context_get_width(), TOP_TOOLBAR_HEIGHT + 1, &window_top_toolbar_events, WC_TOP_TOOLBAR,
|
||||
WF_STICK_TO_FRONT | WF_TRANSPARENT | WF_NO_BACKGROUND);
|
||||
window->widgets = window_top_toolbar_widgets;
|
||||
|
||||
@@ -461,12 +456,8 @@ static void window_top_toolbar_mousedown(rct_window* w, rct_widgetindex widgetIn
|
||||
#endif
|
||||
}
|
||||
window_dropdown_show_text(
|
||||
w->x + widget->left,
|
||||
w->y + widget->top,
|
||||
widget->bottom - widget->top + 1,
|
||||
w->colours[0] | 0x80,
|
||||
DROPDOWN_FLAG_STAY_OPEN,
|
||||
numItems);
|
||||
w->x + widget->left, w->y + widget->top, widget->bottom - widget->top + 1, w->colours[0] | 0x80,
|
||||
DROPDOWN_FLAG_STAY_OPEN, numItems);
|
||||
|
||||
#ifndef DISABLE_TWITCH
|
||||
if (_menuDropdownIncludesTwitch && gTwitchEnable)
|
||||
@@ -633,23 +624,13 @@ static void window_top_toolbar_dropdown(rct_window* w, rct_widgetindex widgetInd
|
||||
break;
|
||||
case DDIDX_DISABLE_CLEARANCE_CHECKS:
|
||||
game_do_command(
|
||||
0,
|
||||
GAME_COMMAND_FLAG_APPLY,
|
||||
CHEAT_DISABLECLEARANCECHECKS,
|
||||
!gCheatsDisableClearanceChecks,
|
||||
GAME_COMMAND_CHEAT,
|
||||
0,
|
||||
0);
|
||||
0, GAME_COMMAND_FLAG_APPLY, CHEAT_DISABLECLEARANCECHECKS, !gCheatsDisableClearanceChecks,
|
||||
GAME_COMMAND_CHEAT, 0, 0);
|
||||
break;
|
||||
case DDIDX_DISABLE_SUPPORT_LIMITS:
|
||||
game_do_command(
|
||||
0,
|
||||
GAME_COMMAND_FLAG_APPLY,
|
||||
CHEAT_DISABLESUPPORTLIMITS,
|
||||
!gCheatsDisableSupportLimits,
|
||||
GAME_COMMAND_CHEAT,
|
||||
0,
|
||||
0);
|
||||
0, GAME_COMMAND_FLAG_APPLY, CHEAT_DISABLESUPPORTLIMITS, !gCheatsDisableSupportLimits,
|
||||
GAME_COMMAND_CHEAT, 0, 0);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
@@ -1012,12 +993,8 @@ static void repaint_scenery_tool_down(int16_t x, int16_t y, rct_widgetindex widg
|
||||
|
||||
gGameCommandErrorTitle = STR_CANT_REPAINT_THIS;
|
||||
game_do_command(
|
||||
grid_x,
|
||||
1 | (tile_element->type << 8),
|
||||
grid_y,
|
||||
tile_element->base_height | (tile_element->properties.scenery.type << 8),
|
||||
GAME_COMMAND_SET_SCENERY_COLOUR,
|
||||
0,
|
||||
grid_x, 1 | (tile_element->type << 8), grid_y,
|
||||
tile_element->base_height | (tile_element->properties.scenery.type << 8), GAME_COMMAND_SET_SCENERY_COLOUR, 0,
|
||||
gWindowSceneryPrimaryColour | (gWindowScenerySecondaryColour << 8));
|
||||
break;
|
||||
}
|
||||
@@ -1031,13 +1008,9 @@ static void repaint_scenery_tool_down(int16_t x, int16_t y, rct_widgetindex widg
|
||||
|
||||
gGameCommandErrorTitle = STR_CANT_REPAINT_THIS;
|
||||
game_do_command(
|
||||
grid_x,
|
||||
1 | (gWindowSceneryPrimaryColour << 8),
|
||||
grid_y,
|
||||
grid_x, 1 | (gWindowSceneryPrimaryColour << 8), grid_y,
|
||||
(tile_element->type & TILE_ELEMENT_DIRECTION_MASK) | (tile_element->base_height << 8),
|
||||
GAME_COMMAND_SET_WALL_COLOUR,
|
||||
0,
|
||||
gWindowScenerySecondaryColour | (gWindowSceneryTertiaryColour << 8));
|
||||
GAME_COMMAND_SET_WALL_COLOUR, 0, gWindowScenerySecondaryColour | (gWindowSceneryTertiaryColour << 8));
|
||||
break;
|
||||
}
|
||||
case VIEWPORT_INTERACTION_ITEM_LARGE_SCENERY:
|
||||
@@ -1050,13 +1023,9 @@ static void repaint_scenery_tool_down(int16_t x, int16_t y, rct_widgetindex widg
|
||||
|
||||
gGameCommandErrorTitle = STR_CANT_REPAINT_THIS;
|
||||
game_do_command(
|
||||
grid_x,
|
||||
1 | (tile_element->GetDirection() << 8),
|
||||
grid_y,
|
||||
grid_x, 1 | (tile_element->GetDirection() << 8), grid_y,
|
||||
tile_element->base_height | (scenery_large_get_sequence(tile_element) << 8),
|
||||
GAME_COMMAND_SET_LARGE_SCENERY_COLOUR,
|
||||
0,
|
||||
gWindowSceneryPrimaryColour | (gWindowScenerySecondaryColour << 8));
|
||||
GAME_COMMAND_SET_LARGE_SCENERY_COLOUR, 0, gWindowSceneryPrimaryColour | (gWindowScenerySecondaryColour << 8));
|
||||
break;
|
||||
}
|
||||
case VIEWPORT_INTERACTION_ITEM_BANNER:
|
||||
@@ -1067,13 +1036,8 @@ static void repaint_scenery_tool_down(int16_t x, int16_t y, rct_widgetindex widg
|
||||
{
|
||||
gGameCommandErrorTitle = STR_CANT_REPAINT_THIS;
|
||||
game_do_command(
|
||||
grid_x,
|
||||
1,
|
||||
grid_y,
|
||||
tile_element->base_height | ((tile_element->properties.banner.position & 0x3) << 8),
|
||||
GAME_COMMAND_SET_BANNER_COLOUR,
|
||||
0,
|
||||
gWindowSceneryPrimaryColour | (gWindowScenerySecondaryColour << 8));
|
||||
grid_x, 1, grid_y, tile_element->base_height | ((tile_element->properties.banner.position & 0x3) << 8),
|
||||
GAME_COMMAND_SET_BANNER_COLOUR, 0, gWindowSceneryPrimaryColour | (gWindowScenerySecondaryColour << 8));
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -1189,14 +1153,8 @@ static void scenery_eyedropper_tool_down(int16_t x, int16_t y, rct_widgetindex w
|
||||
* edi : parameter_3
|
||||
*/
|
||||
static void sub_6E1F34(
|
||||
int16_t x,
|
||||
int16_t y,
|
||||
uint16_t selected_scenery,
|
||||
int16_t* grid_x,
|
||||
int16_t* grid_y,
|
||||
uint32_t* parameter_1,
|
||||
uint32_t* parameter_2,
|
||||
uint32_t* parameter_3)
|
||||
int16_t x, int16_t y, uint16_t selected_scenery, int16_t* grid_x, int16_t* grid_y, uint32_t* parameter_1,
|
||||
uint32_t* parameter_2, uint32_t* parameter_3)
|
||||
{
|
||||
rct_window* w = window_find_by_class(WC_SCENERY);
|
||||
|
||||
@@ -1726,13 +1684,8 @@ static void window_top_toolbar_scenery_tool_down(int16_t x, int16_t y, rct_windo
|
||||
gDisableErrorWindowSound = true;
|
||||
gGameCommandErrorTitle = STR_CANT_POSITION_THIS_HERE;
|
||||
int32_t cost = game_do_command(
|
||||
cur_grid_x,
|
||||
flags,
|
||||
cur_grid_y,
|
||||
parameter_2,
|
||||
GAME_COMMAND_PLACE_SCENERY,
|
||||
gSceneryPlaceRotation | (parameter_3 & 0xFFFF0000),
|
||||
gSceneryPlaceZ);
|
||||
cur_grid_x, flags, cur_grid_y, parameter_2, GAME_COMMAND_PLACE_SCENERY,
|
||||
gSceneryPlaceRotation | (parameter_3 & 0xFFFF0000), gSceneryPlaceZ);
|
||||
gDisableErrorWindowSound = false;
|
||||
|
||||
if (cost != MONEY32_UNDEFINED)
|
||||
@@ -1804,12 +1757,7 @@ static void window_top_toolbar_scenery_tool_down(int16_t x, int16_t y, rct_windo
|
||||
gDisableErrorWindowSound = true;
|
||||
gGameCommandErrorTitle = STR_CANT_BUILD_PARK_ENTRANCE_HERE;
|
||||
int32_t cost = game_do_command(
|
||||
gridX,
|
||||
flags,
|
||||
gridY,
|
||||
parameter_2,
|
||||
GAME_COMMAND_PLACE_WALL,
|
||||
gSceneryPlaceZ,
|
||||
gridX, flags, gridY, parameter_2, GAME_COMMAND_PLACE_WALL, gSceneryPlaceZ,
|
||||
_secondaryColour | (_tertiaryColour << 8));
|
||||
gDisableErrorWindowSound = false;
|
||||
|
||||
@@ -2319,14 +2267,8 @@ static void top_toolbar_tool_update_water(int16_t x, int16_t y)
|
||||
LocationXY16 mapTile = {};
|
||||
int32_t interaction_type = 0;
|
||||
get_map_coordinates_from_pos(
|
||||
x,
|
||||
y,
|
||||
VIEWPORT_INTERACTION_MASK_TERRAIN & VIEWPORT_INTERACTION_MASK_WATER,
|
||||
&mapTile.x,
|
||||
&mapTile.y,
|
||||
&interaction_type,
|
||||
nullptr,
|
||||
nullptr);
|
||||
x, y, VIEWPORT_INTERACTION_MASK_TERRAIN & VIEWPORT_INTERACTION_MASK_WATER, &mapTile.x, &mapTile.y, &interaction_type,
|
||||
nullptr, nullptr);
|
||||
|
||||
if (interaction_type == VIEWPORT_INTERACTION_ITEM_NONE)
|
||||
{
|
||||
@@ -2431,12 +2373,7 @@ static money32 try_place_ghost_scenery(
|
||||
// Small Scenery
|
||||
// 6e252b
|
||||
cost = game_do_command(
|
||||
map_tile.x,
|
||||
parameter_1 | 0x69,
|
||||
map_tile.y,
|
||||
parameter_2,
|
||||
GAME_COMMAND_PLACE_SCENERY,
|
||||
parameter_3,
|
||||
map_tile.x, parameter_1 | 0x69, map_tile.y, parameter_2, GAME_COMMAND_PLACE_SCENERY, parameter_3,
|
||||
gSceneryPlaceZ);
|
||||
|
||||
if (cost == MONEY32_UNDEFINED)
|
||||
@@ -2471,11 +2408,7 @@ static money32 try_place_ghost_scenery(
|
||||
(parameter_1 & 0xFF00)
|
||||
| (GAME_COMMAND_FLAG_APPLY | GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED | GAME_COMMAND_FLAG_5
|
||||
| GAME_COMMAND_FLAG_GHOST | GAME_COMMAND_FLAG_PATH_SCENERY),
|
||||
map_tile.y,
|
||||
parameter_2,
|
||||
GAME_COMMAND_PLACE_PATH,
|
||||
parameter_3,
|
||||
0);
|
||||
map_tile.y, parameter_2, GAME_COMMAND_PLACE_PATH, parameter_3, 0);
|
||||
|
||||
if (cost == MONEY32_UNDEFINED)
|
||||
return cost;
|
||||
@@ -2493,12 +2426,7 @@ static money32 try_place_ghost_scenery(
|
||||
// Walls
|
||||
// 6e26b0
|
||||
cost = game_do_command(
|
||||
map_tile.x,
|
||||
parameter_1 | 0x69,
|
||||
map_tile.y,
|
||||
parameter_2,
|
||||
GAME_COMMAND_PLACE_WALL,
|
||||
gSceneryPlaceZ,
|
||||
map_tile.x, parameter_1 | 0x69, map_tile.y, parameter_2, GAME_COMMAND_PLACE_WALL, gSceneryPlaceZ,
|
||||
_secondaryColour | (_tertiaryColour << 8));
|
||||
|
||||
if (cost == MONEY32_UNDEFINED)
|
||||
@@ -2517,12 +2445,7 @@ static money32 try_place_ghost_scenery(
|
||||
// Large Scenery
|
||||
// 6e25a7
|
||||
cost = game_do_command(
|
||||
map_tile.x,
|
||||
parameter_1 | 0x69,
|
||||
map_tile.y,
|
||||
parameter_2,
|
||||
GAME_COMMAND_PLACE_LARGE_SCENERY,
|
||||
parameter_3,
|
||||
map_tile.x, parameter_1 | 0x69, map_tile.y, parameter_2, GAME_COMMAND_PLACE_LARGE_SCENERY, parameter_3,
|
||||
gSceneryPlaceZ);
|
||||
|
||||
if (cost == MONEY32_UNDEFINED)
|
||||
@@ -2862,13 +2785,9 @@ static void window_top_toolbar_tool_down(rct_window* w, rct_widgetindex widgetIn
|
||||
gGameCommandErrorTitle = STR_UNABLE_TO_REMOVE_ALL_SCENERY_FROM_HERE;
|
||||
|
||||
game_do_command(
|
||||
gMapSelectPositionA.x,
|
||||
1,
|
||||
gMapSelectPositionA.y,
|
||||
gMapSelectPositionA.x, 1, gMapSelectPositionA.y,
|
||||
((gClearSmallScenery ? 1 : 0) | (gClearLargeScenery ? 1 : 0) << 1 | (gClearFootpath ? 1 : 0) << 2),
|
||||
GAME_COMMAND_CLEAR_SCENERY,
|
||||
gMapSelectPositionB.x,
|
||||
gMapSelectPositionB.y);
|
||||
GAME_COMMAND_CLEAR_SCENERY, gMapSelectPositionB.x, gMapSelectPositionB.y);
|
||||
gCurrentToolId = TOOL_CROSSHAIR;
|
||||
break;
|
||||
case WIDX_LAND:
|
||||
@@ -2876,13 +2795,8 @@ static void window_top_toolbar_tool_down(rct_window* w, rct_widgetindex widgetIn
|
||||
{
|
||||
gGameCommandErrorTitle = STR_CANT_CHANGE_LAND_TYPE;
|
||||
game_do_command(
|
||||
gMapSelectPositionA.x,
|
||||
1,
|
||||
gMapSelectPositionA.y,
|
||||
gLandToolTerrainSurface | (gLandToolTerrainEdge << 8),
|
||||
GAME_COMMAND_CHANGE_SURFACE_STYLE,
|
||||
gMapSelectPositionB.x,
|
||||
gMapSelectPositionB.y);
|
||||
gMapSelectPositionA.x, 1, gMapSelectPositionA.y, gLandToolTerrainSurface | (gLandToolTerrainEdge << 8),
|
||||
GAME_COMMAND_CHANGE_SURFACE_STYLE, gMapSelectPositionB.x, gMapSelectPositionB.y);
|
||||
gCurrentToolId = TOOL_UP_DOWN_ARROW;
|
||||
}
|
||||
break;
|
||||
@@ -3023,12 +2937,7 @@ static void window_top_toolbar_water_tool_drag(int16_t x, int16_t y)
|
||||
gGameCommandErrorTitle = STR_CANT_RAISE_WATER_LEVEL_HERE;
|
||||
|
||||
game_do_command(
|
||||
gMapSelectPositionA.x,
|
||||
1,
|
||||
gMapSelectPositionA.y,
|
||||
dx,
|
||||
GAME_COMMAND_RAISE_WATER,
|
||||
gMapSelectPositionB.x,
|
||||
gMapSelectPositionA.x, 1, gMapSelectPositionA.y, dx, GAME_COMMAND_RAISE_WATER, gMapSelectPositionB.x,
|
||||
gMapSelectPositionB.y);
|
||||
gWaterToolRaiseCost = MONEY32_UNDEFINED;
|
||||
gWaterToolLowerCost = MONEY32_UNDEFINED;
|
||||
@@ -3045,12 +2954,7 @@ static void window_top_toolbar_water_tool_drag(int16_t x, int16_t y)
|
||||
gGameCommandErrorTitle = STR_CANT_LOWER_WATER_LEVEL_HERE;
|
||||
|
||||
game_do_command(
|
||||
gMapSelectPositionA.x,
|
||||
1,
|
||||
gMapSelectPositionA.y,
|
||||
dx,
|
||||
GAME_COMMAND_LOWER_WATER,
|
||||
gMapSelectPositionB.x,
|
||||
gMapSelectPositionA.x, 1, gMapSelectPositionA.y, dx, GAME_COMMAND_LOWER_WATER, gMapSelectPositionB.x,
|
||||
gMapSelectPositionB.y);
|
||||
gWaterToolRaiseCost = MONEY32_UNDEFINED;
|
||||
gWaterToolLowerCost = MONEY32_UNDEFINED;
|
||||
@@ -3077,13 +2981,9 @@ static void window_top_toolbar_tool_drag(rct_window* w, rct_widgetindex widgetIn
|
||||
gGameCommandErrorTitle = STR_UNABLE_TO_REMOVE_ALL_SCENERY_FROM_HERE;
|
||||
|
||||
game_do_command(
|
||||
gMapSelectPositionA.x,
|
||||
1,
|
||||
gMapSelectPositionA.y,
|
||||
gMapSelectPositionA.x, 1, gMapSelectPositionA.y,
|
||||
((gClearSmallScenery ? 1 : 0) | (gClearLargeScenery ? 1 : 0) << 1 | (gClearFootpath ? 1 : 0) << 2),
|
||||
GAME_COMMAND_CLEAR_SCENERY,
|
||||
gMapSelectPositionB.x,
|
||||
gMapSelectPositionB.y);
|
||||
GAME_COMMAND_CLEAR_SCENERY, gMapSelectPositionB.x, gMapSelectPositionB.y);
|
||||
gCurrentToolId = TOOL_CROSSHAIR;
|
||||
break;
|
||||
case WIDX_LAND:
|
||||
@@ -3094,13 +2994,8 @@ static void window_top_toolbar_tool_drag(rct_window* w, rct_widgetindex widgetIn
|
||||
{
|
||||
gGameCommandErrorTitle = STR_CANT_CHANGE_LAND_TYPE;
|
||||
game_do_command(
|
||||
gMapSelectPositionA.x,
|
||||
1,
|
||||
gMapSelectPositionA.y,
|
||||
gLandToolTerrainSurface | (gLandToolTerrainEdge << 8),
|
||||
GAME_COMMAND_CHANGE_SURFACE_STYLE,
|
||||
gMapSelectPositionB.x,
|
||||
gMapSelectPositionB.y);
|
||||
gMapSelectPositionA.x, 1, gMapSelectPositionA.y, gLandToolTerrainSurface | (gLandToolTerrainEdge << 8),
|
||||
GAME_COMMAND_CHANGE_SURFACE_STYLE, gMapSelectPositionB.x, gMapSelectPositionB.y);
|
||||
// The tool is set to 12 here instead of 3 so that the dragging cursor is not the elevation change cursor
|
||||
gCurrentToolId = TOOL_CROSSHAIR;
|
||||
}
|
||||
@@ -3271,12 +3166,8 @@ static void top_toolbar_init_debug_menu(rct_window* w, rct_widget* widget)
|
||||
gDropdownItemsArgs[DDIDX_DEBUG_PAINT] = STR_DEBUG_DROPDOWN_DEBUG_PAINT;
|
||||
|
||||
window_dropdown_show_text(
|
||||
w->x + widget->left,
|
||||
w->y + widget->top,
|
||||
widget->bottom - widget->top + 1,
|
||||
w->colours[0] | 0x80,
|
||||
DROPDOWN_FLAG_STAY_OPEN,
|
||||
TOP_TOOLBAR_DEBUG_COUNT);
|
||||
w->x + widget->left, w->y + widget->top, widget->bottom - widget->top + 1, w->colours[0] | 0x80,
|
||||
DROPDOWN_FLAG_STAY_OPEN, TOP_TOOLBAR_DEBUG_COUNT);
|
||||
|
||||
// Disable items that are not yet available in multiplayer
|
||||
if (network_get_mode() != NETWORK_MODE_NONE)
|
||||
@@ -3391,11 +3282,7 @@ static void top_toolbar_init_view_menu(rct_window* w, rct_widget* widget)
|
||||
gDropdownItemsArgs[DDIDX_HIGHLIGHT_PATH_ISSUES] = STR_HIGHLIGHT_PATH_ISSUES_MENU;
|
||||
|
||||
window_dropdown_show_text(
|
||||
w->x + widget->left,
|
||||
w->y + widget->top,
|
||||
widget->bottom - widget->top + 1,
|
||||
w->colours[1] | 0x80,
|
||||
0,
|
||||
w->x + widget->left, w->y + widget->top, widget->bottom - widget->top + 1, w->colours[1] | 0x80, 0,
|
||||
TOP_TOOLBAR_VIEW_MENU_COUNT);
|
||||
|
||||
// Set checkmarks
|
||||
|
||||
@@ -183,11 +183,7 @@ static void window_track_manage_mouseup(rct_window* w, rct_widgetindex widgetInd
|
||||
break;
|
||||
case WIDX_RENAME:
|
||||
window_text_input_raw_open(
|
||||
w,
|
||||
widgetIndex,
|
||||
STR_TRACK_DESIGN_RENAME_TITLE,
|
||||
STR_TRACK_DESIGN_RENAME_DESC,
|
||||
_trackDesignFileReference->name,
|
||||
w, widgetIndex, STR_TRACK_DESIGN_RENAME_TITLE, STR_TRACK_DESIGN_RENAME_DESC, _trackDesignFileReference->name,
|
||||
127);
|
||||
break;
|
||||
case WIDX_DELETE:
|
||||
@@ -252,13 +248,8 @@ static void window_track_delete_prompt_open()
|
||||
int32_t screenWidth = context_get_width();
|
||||
int32_t screenHeight = context_get_height();
|
||||
rct_window* w = window_create(
|
||||
std::max(TOP_TOOLBAR_HEIGHT + 1, (screenWidth - 250) / 2),
|
||||
(screenHeight - 44) / 2,
|
||||
250,
|
||||
74,
|
||||
&window_track_delete_prompt_events,
|
||||
WC_TRACK_DELETE_PROMPT,
|
||||
WF_STICK_TO_FRONT);
|
||||
std::max(TOP_TOOLBAR_HEIGHT + 1, (screenWidth - 250) / 2), (screenHeight - 44) / 2, 250, 74,
|
||||
&window_track_delete_prompt_events, WC_TRACK_DELETE_PROMPT, WF_STICK_TO_FRONT);
|
||||
w->widgets = window_track_delete_prompt_widgets;
|
||||
w->enabled_widgets = (1 << WIDX_CLOSE) | (1 << WIDX_RENAME) | (1 << WIDX_DELETE);
|
||||
window_init_scroll_widgets(w);
|
||||
@@ -301,13 +292,8 @@ static void window_track_delete_prompt_paint(rct_window* w, rct_drawpixelinfo* d
|
||||
window_draw_widgets(w, dpi);
|
||||
|
||||
gfx_draw_string_centred_wrapped(
|
||||
dpi,
|
||||
&_trackDesignFileReference->name,
|
||||
w->x + 125,
|
||||
w->y + 28,
|
||||
246,
|
||||
STR_ARE_YOU_SURE_YOU_WANT_TO_PERMANENTLY_DELETE_TRACK,
|
||||
COLOUR_BLACK);
|
||||
dpi, &_trackDesignFileReference->name, w->x + 125, w->y + 28, 246,
|
||||
STR_ARE_YOU_SURE_YOU_WANT_TO_PERMANENTLY_DELETE_TRACK, COLOUR_BLACK);
|
||||
}
|
||||
|
||||
static void window_track_design_list_reload_tracks()
|
||||
|
||||
@@ -401,13 +401,8 @@ static void window_track_place_clear_provisional()
|
||||
if (_window_track_place_last_was_valid)
|
||||
{
|
||||
place_virtual_track(
|
||||
_trackDesign,
|
||||
PTD_OPERATION_CLEAR_OUTLINES,
|
||||
true,
|
||||
_window_track_place_ride_index,
|
||||
_window_track_place_last_valid_x,
|
||||
_window_track_place_last_valid_y,
|
||||
_window_track_place_last_valid_z);
|
||||
_trackDesign, PTD_OPERATION_CLEAR_OUTLINES, true, _window_track_place_ride_index, _window_track_place_last_valid_x,
|
||||
_window_track_place_last_valid_y, _window_track_place_last_valid_z);
|
||||
_window_track_place_last_was_valid = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -427,11 +427,7 @@ static void window_view_clipping_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
||||
// Height label is Units.
|
||||
clipHeightValueInUnits = (fixed16_1dp)(FIXED_1DP(gClipHeight, 0) / 2 - FIXED_1DP(7, 0));
|
||||
gfx_draw_string_left(
|
||||
dpi,
|
||||
STR_UNIT1DP_NO_SUFFIX,
|
||||
&clipHeightValueInUnits,
|
||||
w->colours[0],
|
||||
x,
|
||||
dpi, STR_UNIT1DP_NO_SUFFIX, &clipHeightValueInUnits, w->colours[0], x,
|
||||
y); // Printing the value in Height Units.
|
||||
}
|
||||
else
|
||||
|
||||
@@ -150,13 +150,7 @@ static void window_viewport_mouseup(rct_window* w, rct_widgetindex widgetIndex)
|
||||
if (mainWindow != nullptr)
|
||||
{
|
||||
get_map_coordinates_from_pos(
|
||||
w->x + (w->width / 2),
|
||||
w->y + (w->height / 2),
|
||||
VIEWPORT_INTERACTION_MASK_NONE,
|
||||
&x,
|
||||
&y,
|
||||
nullptr,
|
||||
nullptr,
|
||||
w->x + (w->width / 2), w->y + (w->height / 2), VIEWPORT_INTERACTION_MASK_NONE, &x, &y, nullptr, nullptr,
|
||||
nullptr);
|
||||
window_scroll_to_location(mainWindow, x, y, tile_element_height(x, y));
|
||||
}
|
||||
|
||||
@@ -128,20 +128,11 @@ void window_network_status_close();
|
||||
|
||||
void window_text_input_key(rct_window* w, char keychar);
|
||||
void window_text_input_open(
|
||||
rct_window* call_w,
|
||||
rct_widgetindex call_widget,
|
||||
rct_string_id title,
|
||||
rct_string_id description,
|
||||
rct_string_id existing_text,
|
||||
uintptr_t existing_args,
|
||||
int32_t maxLength);
|
||||
rct_window* call_w, rct_widgetindex call_widget, rct_string_id title, rct_string_id description,
|
||||
rct_string_id existing_text, uintptr_t existing_args, int32_t maxLength);
|
||||
void window_text_input_raw_open(
|
||||
rct_window* call_w,
|
||||
rct_widgetindex call_widget,
|
||||
rct_string_id title,
|
||||
rct_string_id description,
|
||||
const_utf8string existing_text,
|
||||
int32_t maxLength);
|
||||
rct_window* call_w, rct_widgetindex call_widget, rct_string_id title, rct_string_id description,
|
||||
const_utf8string existing_text, int32_t maxLength);
|
||||
|
||||
rct_window* window_object_load_error_open(utf8* path, size_t numMissingObjects, const rct_object_entry* missingObjects);
|
||||
|
||||
|
||||
@@ -499,12 +499,7 @@ static void cheat_own_all_land()
|
||||
#pragma endregion
|
||||
|
||||
void game_command_cheat(
|
||||
[[maybe_unused]] int32_t* eax,
|
||||
int32_t* ebx,
|
||||
int32_t* ecx,
|
||||
int32_t* edx,
|
||||
[[maybe_unused]] int32_t* esi,
|
||||
int32_t* edi,
|
||||
[[maybe_unused]] int32_t* eax, int32_t* ebx, int32_t* ecx, int32_t* edx, [[maybe_unused]] int32_t* esi, int32_t* edi,
|
||||
[[maybe_unused]] int32_t* ebp)
|
||||
{
|
||||
int32_t cheat = *ecx;
|
||||
|
||||
@@ -239,27 +239,14 @@ static bool sprite_file_export(int32_t spriteIndex, const char* outPath)
|
||||
if (spriteHeader->flags & G1_FLAG_RLE_COMPRESSION)
|
||||
{
|
||||
gfx_rle_sprite_to_buffer(
|
||||
spriteHeader->offset,
|
||||
pixels,
|
||||
(uint8_t*)spriteFilePalette,
|
||||
&dpi,
|
||||
IMAGE_TYPE_DEFAULT,
|
||||
0,
|
||||
spriteHeader->height,
|
||||
0,
|
||||
spriteHeader->offset, pixels, (uint8_t*)spriteFilePalette, &dpi, IMAGE_TYPE_DEFAULT, 0, spriteHeader->height, 0,
|
||||
spriteHeader->width);
|
||||
}
|
||||
else
|
||||
{
|
||||
gfx_bmp_sprite_to_buffer(
|
||||
(uint8_t*)spriteFilePalette,
|
||||
spriteHeader->offset,
|
||||
pixels,
|
||||
spriteHeader,
|
||||
&dpi,
|
||||
spriteHeader->height,
|
||||
spriteHeader->width,
|
||||
IMAGE_TYPE_DEFAULT);
|
||||
(uint8_t*)spriteFilePalette, spriteHeader->offset, pixels, spriteHeader, &dpi, spriteHeader->height,
|
||||
spriteHeader->width, IMAGE_TYPE_DEFAULT);
|
||||
}
|
||||
|
||||
auto const pixels8 = dpi.bits;
|
||||
@@ -284,15 +271,8 @@ static bool sprite_file_export(int32_t spriteIndex, const char* outPath)
|
||||
}
|
||||
|
||||
static bool sprite_file_import(
|
||||
const char* path,
|
||||
int16_t x_offset,
|
||||
int16_t y_offset,
|
||||
bool keep_palette,
|
||||
bool forceBmp,
|
||||
rct_g1_element* outElement,
|
||||
uint8_t** outBuffer,
|
||||
int* outBufferLength,
|
||||
int32_t mode)
|
||||
const char* path, int16_t x_offset, int16_t y_offset, bool keep_palette, bool forceBmp, rct_g1_element* outElement,
|
||||
uint8_t** outBuffer, int* outBufferLength, int32_t mode)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -589,10 +569,7 @@ int32_t cmdline_for_sprite(const char** argv, int32_t argc)
|
||||
if (sprite_list == nullptr)
|
||||
{
|
||||
fprintf(
|
||||
stderr,
|
||||
"Error parsing sprite description file: %s at line %d column %d\n",
|
||||
error.text,
|
||||
error.line,
|
||||
stderr, "Error parsing sprite description file: %s at line %d column %d\n", error.text, error.line,
|
||||
error.column);
|
||||
return -1;
|
||||
}
|
||||
@@ -663,15 +640,9 @@ int32_t cmdline_for_sprite(const char** argv, int32_t argc)
|
||||
int bufferLength;
|
||||
|
||||
if (!sprite_file_import(
|
||||
imagePath,
|
||||
x_offset == nullptr ? 0 : json_integer_value(x_offset),
|
||||
y_offset == nullptr ? 0 : json_integer_value(y_offset),
|
||||
keep_palette,
|
||||
forceBmp,
|
||||
&spriteElement,
|
||||
&buffer,
|
||||
&bufferLength,
|
||||
gSpriteMode))
|
||||
imagePath, x_offset == nullptr ? 0 : json_integer_value(x_offset),
|
||||
y_offset == nullptr ? 0 : json_integer_value(y_offset), keep_palette, forceBmp, &spriteElement, &buffer,
|
||||
&bufferLength, gSpriteMode))
|
||||
{
|
||||
fprintf(stderr, "Could not import image file: %s\nCanceling\n", imagePath);
|
||||
json_decref(sprite_list);
|
||||
|
||||
@@ -124,8 +124,7 @@ namespace OpenRCT2
|
||||
|
||||
public:
|
||||
Context(
|
||||
const std::shared_ptr<IPlatformEnvironment>& env,
|
||||
const std::shared_ptr<IAudioContext>& audioContext,
|
||||
const std::shared_ptr<IPlatformEnvironment>& env, const std::shared_ptr<IAudioContext>& audioContext,
|
||||
const std::shared_ptr<IUiContext>& uiContext)
|
||||
: _env(env)
|
||||
, _audioContext(audioContext)
|
||||
@@ -794,9 +793,7 @@ namespace OpenRCT2
|
||||
auto ctx = reinterpret_cast<Context*>(vctx);
|
||||
ctx->RunFrame();
|
||||
},
|
||||
this,
|
||||
0,
|
||||
1);
|
||||
this, 0, 1);
|
||||
#endif // __EMSCRIPTEN__
|
||||
log_verbose("finish openrct2 loop");
|
||||
}
|
||||
@@ -1000,8 +997,7 @@ namespace OpenRCT2
|
||||
}
|
||||
|
||||
std::unique_ptr<IContext> CreateContext(
|
||||
const std::shared_ptr<IPlatformEnvironment>& env,
|
||||
const std::shared_ptr<Audio::IAudioContext>& audioContext,
|
||||
const std::shared_ptr<IPlatformEnvironment>& env, const std::shared_ptr<Audio::IAudioContext>& audioContext,
|
||||
const std::shared_ptr<IUiContext>& uiContext)
|
||||
{
|
||||
return std::make_unique<Context>(env, audioContext, uiContext);
|
||||
|
||||
@@ -125,8 +125,7 @@ namespace OpenRCT2
|
||||
|
||||
std::unique_ptr<IContext> CreateContext();
|
||||
std::unique_ptr<IContext> CreateContext(
|
||||
const std::shared_ptr<IPlatformEnvironment>& env,
|
||||
const std::shared_ptr<Audio::IAudioContext>& audioContext,
|
||||
const std::shared_ptr<IPlatformEnvironment>& env, const std::shared_ptr<Audio::IAudioContext>& audioContext,
|
||||
const std::shared_ptr<Ui::IUiContext>& uiContext);
|
||||
IContext* GetContext();
|
||||
} // namespace OpenRCT2
|
||||
|
||||
@@ -35,9 +35,8 @@ static FILE* diagnostic_get_stream(DIAGNOSTIC_LEVEL level)
|
||||
|
||||
#ifdef __ANDROID__
|
||||
|
||||
int _android_log_priority[DIAGNOSTIC_LEVEL_COUNT] = {
|
||||
ANDROID_LOG_FATAL, ANDROID_LOG_ERROR, ANDROID_LOG_WARN, ANDROID_LOG_VERBOSE, ANDROID_LOG_INFO
|
||||
};
|
||||
int _android_log_priority[DIAGNOSTIC_LEVEL_COUNT] = { ANDROID_LOG_FATAL, ANDROID_LOG_ERROR, ANDROID_LOG_WARN,
|
||||
ANDROID_LOG_VERBOSE, ANDROID_LOG_INFO };
|
||||
|
||||
void diagnostic_log(DIAGNOSTIC_LEVEL diagnosticLevel, const char* format, ...)
|
||||
{
|
||||
|
||||
@@ -533,13 +533,8 @@ namespace Editor
|
||||
}
|
||||
|
||||
void GameCommandEditScenarioOptions(
|
||||
[[maybe_unused]] int32_t* eax,
|
||||
int32_t* ebx,
|
||||
int32_t* ecx,
|
||||
int32_t* edx,
|
||||
[[maybe_unused]] int32_t* esi,
|
||||
[[maybe_unused]] int32_t* edi,
|
||||
[[maybe_unused]] int32_t* ebp)
|
||||
[[maybe_unused]] int32_t* eax, int32_t* ebx, int32_t* ecx, int32_t* edx, [[maybe_unused]] int32_t* esi,
|
||||
[[maybe_unused]] int32_t* edi, [[maybe_unused]] int32_t* ebp)
|
||||
{
|
||||
if (!(*ebx & GAME_COMMAND_FLAG_APPLY))
|
||||
{
|
||||
|
||||
+6
-24
@@ -839,13 +839,8 @@ bool game_is_not_paused()
|
||||
* rct2: 0x00667C15
|
||||
*/
|
||||
void game_pause_toggle(
|
||||
[[maybe_unused]] int32_t* eax,
|
||||
int32_t* ebx,
|
||||
[[maybe_unused]] int32_t* ecx,
|
||||
[[maybe_unused]] int32_t* edx,
|
||||
[[maybe_unused]] int32_t* esi,
|
||||
[[maybe_unused]] int32_t* edi,
|
||||
[[maybe_unused]] int32_t* ebp)
|
||||
[[maybe_unused]] int32_t* eax, int32_t* ebx, [[maybe_unused]] int32_t* ecx, [[maybe_unused]] int32_t* edx,
|
||||
[[maybe_unused]] int32_t* esi, [[maybe_unused]] int32_t* edi, [[maybe_unused]] int32_t* ebp)
|
||||
{
|
||||
if (*ebx & GAME_COMMAND_FLAG_APPLY)
|
||||
pause_toggle();
|
||||
@@ -858,13 +853,8 @@ void game_pause_toggle(
|
||||
* rct2: 0x0066DB5F
|
||||
*/
|
||||
static void game_load_or_quit(
|
||||
[[maybe_unused]] int32_t* eax,
|
||||
int32_t* ebx,
|
||||
[[maybe_unused]] int32_t* ecx,
|
||||
int32_t* edx,
|
||||
[[maybe_unused]] int32_t* esi,
|
||||
int32_t* edi,
|
||||
[[maybe_unused]] int32_t* ebp)
|
||||
[[maybe_unused]] int32_t* eax, int32_t* ebx, [[maybe_unused]] int32_t* ecx, int32_t* edx, [[maybe_unused]] int32_t* esi,
|
||||
int32_t* edi, [[maybe_unused]] int32_t* ebp)
|
||||
{
|
||||
if (*ebx & GAME_COMMAND_FLAG_APPLY)
|
||||
{
|
||||
@@ -1323,16 +1313,8 @@ void game_autosave()
|
||||
|
||||
utf8 timeName[44];
|
||||
snprintf(
|
||||
timeName,
|
||||
sizeof(timeName),
|
||||
"autosave_%04u-%02u-%02u_%02u-%02u-%02u%s",
|
||||
currentDate.year,
|
||||
currentDate.month,
|
||||
currentDate.day,
|
||||
currentTime.hour,
|
||||
currentTime.minute,
|
||||
currentTime.second,
|
||||
fileExtension);
|
||||
timeName, sizeof(timeName), "autosave_%04u-%02u-%02u_%02u-%02u-%02u%s", currentDate.year, currentDate.month,
|
||||
currentDate.day, currentTime.hour, currentTime.minute, currentTime.second, fileExtension);
|
||||
|
||||
limit_autosave_count(NUMBER_OF_AUTOSAVES_TO_KEEP, (gScreenFlags & SCREEN_FLAGS_EDITOR));
|
||||
|
||||
|
||||
@@ -178,12 +178,8 @@ void intro_draw(rct_drawpixelinfo* dpi)
|
||||
|
||||
// Draw a white rectangle for the logo background (gives a bit of white margin)
|
||||
gfx_fill_rect(
|
||||
dpi,
|
||||
(screenWidth / 2) - 320 + 50,
|
||||
_introStateCounter + 50,
|
||||
(screenWidth / 2) - 320 + 50 + 540,
|
||||
_introStateCounter + 50 + 425,
|
||||
BORDER_COLOUR_PUBLISHER);
|
||||
dpi, (screenWidth / 2) - 320 + 50, _introStateCounter + 50, (screenWidth / 2) - 320 + 50 + 540,
|
||||
_introStateCounter + 50 + 425, BORDER_COLOUR_PUBLISHER);
|
||||
|
||||
// Draw Infogrames logo
|
||||
gfx_draw_sprite(dpi, SPR_INTRO_INFOGRAMES_00, (screenWidth / 2) - 320 + 69, _introStateCounter + 69, 0);
|
||||
|
||||
@@ -40,13 +40,8 @@ money32 place_park_entrance(int16_t x, int16_t y, int16_t z, uint8_t direction)
|
||||
* rct2: 0x006666E7
|
||||
*/
|
||||
void game_command_place_park_entrance(
|
||||
[[maybe_unused]] int32_t* eax,
|
||||
[[maybe_unused]] int32_t* ebx,
|
||||
[[maybe_unused]] int32_t* ecx,
|
||||
[[maybe_unused]] int32_t* edx,
|
||||
[[maybe_unused]] int32_t* esi,
|
||||
[[maybe_unused]] int32_t* edi,
|
||||
[[maybe_unused]] int32_t* ebp)
|
||||
[[maybe_unused]] int32_t* eax, [[maybe_unused]] int32_t* ebx, [[maybe_unused]] int32_t* ecx, [[maybe_unused]] int32_t* edx,
|
||||
[[maybe_unused]] int32_t* esi, [[maybe_unused]] int32_t* edi, [[maybe_unused]] int32_t* ebp)
|
||||
{
|
||||
Guard::Assert(false, "GAME_COMMAND_PLACE_PARK_ENTRANCE DEPRECATED");
|
||||
}
|
||||
@@ -83,13 +78,8 @@ void park_set_entrance_fee(money32 fee)
|
||||
}
|
||||
|
||||
void game_command_set_park_entrance_fee(
|
||||
[[maybe_unused]] int* eax,
|
||||
[[maybe_unused]] int* ebx,
|
||||
[[maybe_unused]] int* ecx,
|
||||
[[maybe_unused]] int* edx,
|
||||
[[maybe_unused]] int* esi,
|
||||
int* edi,
|
||||
[[maybe_unused]] int* ebp)
|
||||
[[maybe_unused]] int* eax, [[maybe_unused]] int* ebx, [[maybe_unused]] int* ecx, [[maybe_unused]] int* edx,
|
||||
[[maybe_unused]] int* esi, int* edi, [[maybe_unused]] int* ebp)
|
||||
{
|
||||
money16 fee = (money16)(*edi & 0xFFFF);
|
||||
auto gameAction = SetParkEntranceFeeAction(fee);
|
||||
@@ -143,13 +133,8 @@ money32 ride_create_command(int32_t type, int32_t subType, int32_t flags, uint8_
|
||||
* rct2: 0x006B3F0F
|
||||
*/
|
||||
void game_command_create_ride(
|
||||
[[maybe_unused]] int32_t* eax,
|
||||
[[maybe_unused]] int32_t* ebx,
|
||||
[[maybe_unused]] int32_t* ecx,
|
||||
[[maybe_unused]] int32_t* edx,
|
||||
[[maybe_unused]] int32_t* esi,
|
||||
[[maybe_unused]] int32_t* edi,
|
||||
[[maybe_unused]] int32_t* ebp)
|
||||
[[maybe_unused]] int32_t* eax, [[maybe_unused]] int32_t* ebx, [[maybe_unused]] int32_t* ecx, [[maybe_unused]] int32_t* edx,
|
||||
[[maybe_unused]] int32_t* esi, [[maybe_unused]] int32_t* edi, [[maybe_unused]] int32_t* ebp)
|
||||
{
|
||||
Guard::Assert(false, "GAME_COMMAND_CREATE_RIDE DEPRECATED");
|
||||
}
|
||||
@@ -169,13 +154,8 @@ void ride_set_status(int32_t rideIndex, int32_t status)
|
||||
* rct2: 0x006B4EA6
|
||||
*/
|
||||
void game_command_set_ride_status(
|
||||
[[maybe_unused]] int32_t* eax,
|
||||
[[maybe_unused]] int32_t* ebx,
|
||||
[[maybe_unused]] int32_t* ecx,
|
||||
[[maybe_unused]] int32_t* edx,
|
||||
[[maybe_unused]] int32_t* esi,
|
||||
[[maybe_unused]] int32_t* edi,
|
||||
[[maybe_unused]] int32_t* ebp)
|
||||
[[maybe_unused]] int32_t* eax, [[maybe_unused]] int32_t* ebx, [[maybe_unused]] int32_t* ecx, [[maybe_unused]] int32_t* edx,
|
||||
[[maybe_unused]] int32_t* esi, [[maybe_unused]] int32_t* edi, [[maybe_unused]] int32_t* ebp)
|
||||
{
|
||||
Guard::Assert(false, "GAME_COMMAND_SET_RIDE_STATUS DEPRECATED");
|
||||
}
|
||||
@@ -194,13 +174,8 @@ void ride_set_name(int32_t rideIndex, const char* name)
|
||||
* rct2: 0x006B578B
|
||||
*/
|
||||
void game_command_set_ride_name(
|
||||
[[maybe_unused]] int32_t* eax,
|
||||
[[maybe_unused]] int32_t* ebx,
|
||||
[[maybe_unused]] int32_t* ecx,
|
||||
[[maybe_unused]] int32_t* edx,
|
||||
[[maybe_unused]] int32_t* esi,
|
||||
[[maybe_unused]] int32_t* edi,
|
||||
[[maybe_unused]] int32_t* ebp)
|
||||
[[maybe_unused]] int32_t* eax, [[maybe_unused]] int32_t* ebx, [[maybe_unused]] int32_t* ecx, [[maybe_unused]] int32_t* edx,
|
||||
[[maybe_unused]] int32_t* esi, [[maybe_unused]] int32_t* edi, [[maybe_unused]] int32_t* ebp)
|
||||
{
|
||||
Guard::Assert(false, "GAME_COMMAND_SET_RIDE_NAME DEPRECATED");
|
||||
}
|
||||
@@ -220,13 +195,8 @@ void ride_action_modify(int32_t rideIndex, int32_t modifyType, int32_t flags)
|
||||
* rct2: 0x006B49D9
|
||||
*/
|
||||
void game_command_demolish_ride(
|
||||
[[maybe_unused]] int32_t* eax,
|
||||
[[maybe_unused]] int32_t* ebx,
|
||||
[[maybe_unused]] int32_t* ecx,
|
||||
[[maybe_unused]] int32_t* edx,
|
||||
[[maybe_unused]] int32_t* esi,
|
||||
[[maybe_unused]] int32_t* edi,
|
||||
[[maybe_unused]] int32_t* ebp)
|
||||
[[maybe_unused]] int32_t* eax, [[maybe_unused]] int32_t* ebx, [[maybe_unused]] int32_t* ecx, [[maybe_unused]] int32_t* edx,
|
||||
[[maybe_unused]] int32_t* esi, [[maybe_unused]] int32_t* edi, [[maybe_unused]] int32_t* ebp)
|
||||
{
|
||||
Guard::Assert(false, "GAME_COMMAND_DEMOLISH_RIDE DEPRECATED");
|
||||
}
|
||||
@@ -245,13 +215,8 @@ void guest_set_name(uint16_t spriteIndex, const char* name)
|
||||
* rct2: 0x00698D6C
|
||||
*/
|
||||
void game_command_set_guest_name(
|
||||
[[maybe_unused]] int32_t* eax,
|
||||
[[maybe_unused]] int32_t* ebx,
|
||||
[[maybe_unused]] int32_t* ecx,
|
||||
[[maybe_unused]] int32_t* edx,
|
||||
[[maybe_unused]] int32_t* esi,
|
||||
[[maybe_unused]] int32_t* edi,
|
||||
[[maybe_unused]] int32_t* ebp)
|
||||
[[maybe_unused]] int32_t* eax, [[maybe_unused]] int32_t* ebx, [[maybe_unused]] int32_t* ecx, [[maybe_unused]] int32_t* edx,
|
||||
[[maybe_unused]] int32_t* esi, [[maybe_unused]] int32_t* edi, [[maybe_unused]] int32_t* ebp)
|
||||
{
|
||||
Guard::Assert(false, "GAME_COMMAND_SET_GUEST_NAME DEPRECATED");
|
||||
}
|
||||
@@ -267,13 +232,8 @@ void staff_set_name(uint16_t spriteIndex, const char* name)
|
||||
}
|
||||
|
||||
void game_command_set_staff_name(
|
||||
[[maybe_unused]] int32_t* eax,
|
||||
[[maybe_unused]] int32_t* ebx,
|
||||
[[maybe_unused]] int32_t* ecx,
|
||||
[[maybe_unused]] int32_t* edx,
|
||||
[[maybe_unused]] int32_t* esi,
|
||||
[[maybe_unused]] int32_t* edi,
|
||||
[[maybe_unused]] int32_t* ebp)
|
||||
[[maybe_unused]] int32_t* eax, [[maybe_unused]] int32_t* ebx, [[maybe_unused]] int32_t* ecx, [[maybe_unused]] int32_t* edx,
|
||||
[[maybe_unused]] int32_t* esi, [[maybe_unused]] int32_t* edi, [[maybe_unused]] int32_t* ebp)
|
||||
{
|
||||
Guard::Assert(false, "GAME_COMMAND_SET_STAFF_NAME DEPRECATED");
|
||||
}
|
||||
@@ -297,13 +257,7 @@ bool place_peep_spawn(CoordsXYZD location)
|
||||
|
||||
#pragma region MazeSetTrack
|
||||
money32 maze_set_track(
|
||||
uint16_t x,
|
||||
uint16_t y,
|
||||
uint16_t z,
|
||||
uint8_t flags,
|
||||
bool initialPlacement,
|
||||
uint8_t direction,
|
||||
uint8_t rideIndex,
|
||||
uint16_t x, uint16_t y, uint16_t z, uint8_t flags, bool initialPlacement, uint8_t direction, uint8_t rideIndex,
|
||||
uint8_t mode)
|
||||
{
|
||||
auto gameAction = MazeSetTrackAction(x, y, z, initialPlacement, direction, rideIndex, mode);
|
||||
@@ -334,13 +288,8 @@ money32 maze_set_track(
|
||||
* rct2: 0x006CD8CE
|
||||
*/
|
||||
void game_command_set_maze_track(
|
||||
[[maybe_unused]] int32_t* eax,
|
||||
[[maybe_unused]] int32_t* ebx,
|
||||
[[maybe_unused]] int32_t* ecx,
|
||||
[[maybe_unused]] int32_t* edx,
|
||||
[[maybe_unused]] int32_t* esi,
|
||||
[[maybe_unused]] int32_t* edi,
|
||||
[[maybe_unused]] int32_t* ebp)
|
||||
[[maybe_unused]] int32_t* eax, [[maybe_unused]] int32_t* ebx, [[maybe_unused]] int32_t* ecx, [[maybe_unused]] int32_t* edx,
|
||||
[[maybe_unused]] int32_t* esi, [[maybe_unused]] int32_t* edi, [[maybe_unused]] int32_t* ebp)
|
||||
{
|
||||
Guard::Assert(false, "GAME_COMMAND_SET_MAZE_TRACK DEPRECATED");
|
||||
}
|
||||
|
||||
@@ -67,8 +67,7 @@ public:
|
||||
if (ride->lifecycle_flags & RIDE_LIFECYCLE_INDESTRUCTIBLE && _modifyType == RIDE_MODIFY_DEMOLISH)
|
||||
{
|
||||
return std::make_unique<GameActionResult>(
|
||||
GA_ERROR::NO_CLEARANCE,
|
||||
STR_CANT_DEMOLISH_RIDE,
|
||||
GA_ERROR::NO_CLEARANCE, STR_CANT_DEMOLISH_RIDE,
|
||||
STR_LOCAL_AUTHORITY_FORBIDS_DEMOLITION_OR_MODIFICATIONS_TO_THIS_RIDE);
|
||||
}
|
||||
|
||||
@@ -305,13 +304,8 @@ private:
|
||||
if (type != TRACK_ELEM_INVERTED_90_DEG_UP_TO_FLAT_QUARTER_LOOP)
|
||||
{
|
||||
money32 removePrice = game_do_command(
|
||||
x,
|
||||
GAME_COMMAND_FLAG_5 | GAME_COMMAND_FLAG_APPLY | (rotation << 8),
|
||||
y,
|
||||
type | (tile_element_get_track_sequence(it.element) << 8),
|
||||
GAME_COMMAND_REMOVE_TRACK,
|
||||
z,
|
||||
0);
|
||||
x, GAME_COMMAND_FLAG_5 | GAME_COMMAND_FLAG_APPLY | (rotation << 8), y,
|
||||
type | (tile_element_get_track_sequence(it.element) << 8), GAME_COMMAND_REMOVE_TRACK, z, 0);
|
||||
|
||||
if (removePrice == MONEY32_UNDEFINED)
|
||||
tile_element_remove(it.element);
|
||||
|
||||
@@ -14,8 +14,7 @@ static exitcode_t HandleBenchGfx(CommandLineArgEnumerator* argEnumerator);
|
||||
|
||||
const CommandLineCommand CommandLine::BenchGfxCommands[]{
|
||||
// Main commands
|
||||
DefineCommand("", "<file> [iterations count]", nullptr, HandleBenchGfx),
|
||||
CommandTableEnd
|
||||
DefineCommand("", "<file> [iterations count]", nullptr, HandleBenchGfx), CommandTableEnd
|
||||
};
|
||||
|
||||
static exitcode_t HandleBenchGfx(CommandLineArgEnumerator* argEnumerator)
|
||||
|
||||
@@ -80,11 +80,7 @@ public:
|
||||
* @param paths A list of search directories.
|
||||
*/
|
||||
FileIndex(
|
||||
std::string name,
|
||||
uint32_t magicNumber,
|
||||
uint8_t version,
|
||||
std::string indexPath,
|
||||
std::string pattern,
|
||||
std::string name, uint32_t magicNumber, uint8_t version, std::string indexPath, std::string pattern,
|
||||
std::vector<std::string> paths)
|
||||
: _name(name)
|
||||
, _magicNumber(magicNumber)
|
||||
@@ -174,13 +170,8 @@ private:
|
||||
}
|
||||
|
||||
void BuildRange(
|
||||
int32_t language,
|
||||
const ScanResult& scanResult,
|
||||
size_t rangeStart,
|
||||
size_t rangeEnd,
|
||||
std::vector<TItem>& items,
|
||||
std::atomic<size_t>& processed,
|
||||
std::mutex& printLock) const
|
||||
int32_t language, const ScanResult& scanResult, size_t rangeStart, size_t rangeEnd, std::vector<TItem>& items,
|
||||
std::atomic<size_t>& processed, std::mutex& printLock) const
|
||||
{
|
||||
items.reserve(rangeEnd - rangeStart);
|
||||
for (size_t i = rangeStart; i < rangeEnd; i++)
|
||||
@@ -237,15 +228,8 @@ private:
|
||||
auto& items = containers.emplace_back();
|
||||
|
||||
jobPool.AddTask(std::bind(
|
||||
&FileIndex<TItem>::BuildRange,
|
||||
this,
|
||||
language,
|
||||
std::cref(scanResult),
|
||||
rangeStart,
|
||||
rangeStart + stepSize,
|
||||
std::ref(items),
|
||||
std::ref(processed),
|
||||
std::ref(printLock)));
|
||||
&FileIndex<TItem>::BuildRange, this, language, std::cref(scanResult), rangeStart, rangeStart + stepSize,
|
||||
std::ref(items), std::ref(processed), std::ref(printLock)));
|
||||
|
||||
reportProgress();
|
||||
}
|
||||
|
||||
@@ -219,14 +219,7 @@ namespace Imaging
|
||||
colourType = PNG_COLOR_TYPE_PALETTE;
|
||||
}
|
||||
png_set_IHDR(
|
||||
png_ptr,
|
||||
info_ptr,
|
||||
image.Width,
|
||||
image.Height,
|
||||
8,
|
||||
colourType,
|
||||
PNG_INTERLACE_NONE,
|
||||
PNG_COMPRESSION_TYPE_DEFAULT,
|
||||
png_ptr, info_ptr, image.Width, image.Height, 8, colourType, PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_DEFAULT,
|
||||
PNG_FILTER_TYPE_DEFAULT);
|
||||
png_write_info(png_ptr, info_ptr);
|
||||
|
||||
|
||||
@@ -709,30 +709,16 @@ namespace String
|
||||
|
||||
// Measure how long the destination needs to be
|
||||
auto requiredSize = LCMapStringEx(
|
||||
LOCALE_NAME_USER_DEFAULT,
|
||||
LCMAP_UPPERCASE | LCMAP_LINGUISTIC_CASING,
|
||||
srcW.c_str(),
|
||||
(int)srcW.length(),
|
||||
nullptr,
|
||||
0,
|
||||
nullptr,
|
||||
nullptr,
|
||||
0);
|
||||
LOCALE_NAME_USER_DEFAULT, LCMAP_UPPERCASE | LCMAP_LINGUISTIC_CASING, srcW.c_str(), (int)srcW.length(), nullptr, 0,
|
||||
nullptr, nullptr, 0);
|
||||
|
||||
auto dstW = std::wstring();
|
||||
dstW.resize(requiredSize);
|
||||
|
||||
// Transform the string
|
||||
auto result = LCMapStringEx(
|
||||
LOCALE_NAME_USER_DEFAULT,
|
||||
LCMAP_UPPERCASE | LCMAP_LINGUISTIC_CASING,
|
||||
srcW.c_str(),
|
||||
(int)srcW.length(),
|
||||
dstW.data(),
|
||||
(int)dstW.length(),
|
||||
nullptr,
|
||||
nullptr,
|
||||
0);
|
||||
LOCALE_NAME_USER_DEFAULT, LCMAP_UPPERCASE | LCMAP_LINGUISTIC_CASING, srcW.c_str(), (int)srcW.length(), dstW.data(),
|
||||
(int)dstW.length(), nullptr, nullptr, 0);
|
||||
if (result == 0)
|
||||
{
|
||||
// Check the error
|
||||
|
||||
@@ -16,14 +16,8 @@
|
||||
#include <immintrin.h>
|
||||
|
||||
void mask_avx2(
|
||||
int32_t width,
|
||||
int32_t height,
|
||||
const uint8_t* RESTRICT maskSrc,
|
||||
const uint8_t* RESTRICT colourSrc,
|
||||
uint8_t* RESTRICT dst,
|
||||
int32_t maskWrap,
|
||||
int32_t colourWrap,
|
||||
int32_t dstWrap)
|
||||
int32_t width, int32_t height, const uint8_t* RESTRICT maskSrc, const uint8_t* RESTRICT colourSrc, uint8_t* RESTRICT dst,
|
||||
int32_t maskWrap, int32_t colourWrap, int32_t dstWrap)
|
||||
{
|
||||
if (width == 32)
|
||||
{
|
||||
@@ -55,14 +49,8 @@ void mask_avx2(
|
||||
#endif
|
||||
|
||||
void mask_avx2(
|
||||
int32_t width,
|
||||
int32_t height,
|
||||
const uint8_t* RESTRICT maskSrc,
|
||||
const uint8_t* RESTRICT colourSrc,
|
||||
uint8_t* RESTRICT dst,
|
||||
int32_t maskWrap,
|
||||
int32_t colourWrap,
|
||||
int32_t dstWrap)
|
||||
int32_t width, int32_t height, const uint8_t* RESTRICT maskSrc, const uint8_t* RESTRICT colourSrc, uint8_t* RESTRICT dst,
|
||||
int32_t maskWrap, int32_t colourWrap, int32_t dstWrap)
|
||||
{
|
||||
openrct2_assert(false, "AVX2 function called on a CPU that doesn't support AVX2");
|
||||
}
|
||||
|
||||
@@ -169,14 +169,8 @@ static void read_and_convert_gxdat(IStream* stream, size_t count, bool is_rctc,
|
||||
}
|
||||
|
||||
void mask_scalar(
|
||||
int32_t width,
|
||||
int32_t height,
|
||||
const uint8_t* RESTRICT maskSrc,
|
||||
const uint8_t* RESTRICT colourSrc,
|
||||
uint8_t* RESTRICT dst,
|
||||
int32_t maskWrap,
|
||||
int32_t colourWrap,
|
||||
int32_t dstWrap)
|
||||
int32_t width, int32_t height, const uint8_t* RESTRICT maskSrc, const uint8_t* RESTRICT colourSrc, uint8_t* RESTRICT dst,
|
||||
int32_t maskWrap, int32_t colourWrap, int32_t dstWrap)
|
||||
{
|
||||
for (int32_t yy = 0; yy < height; yy++)
|
||||
{
|
||||
@@ -408,14 +402,8 @@ bool gfx_load_csg()
|
||||
* rct2: 0x0067A690
|
||||
*/
|
||||
void FASTCALL gfx_bmp_sprite_to_buffer(
|
||||
const uint8_t* palette_pointer,
|
||||
uint8_t* source_pointer,
|
||||
uint8_t* dest_pointer,
|
||||
const rct_g1_element* source_image,
|
||||
rct_drawpixelinfo* dest_dpi,
|
||||
int32_t height,
|
||||
int32_t width,
|
||||
int32_t image_type)
|
||||
const uint8_t* palette_pointer, uint8_t* source_pointer, uint8_t* dest_pointer, const rct_g1_element* source_image,
|
||||
rct_drawpixelinfo* dest_dpi, int32_t height, int32_t width, int32_t image_type)
|
||||
{
|
||||
uint16_t zoom_level = dest_dpi->zoom_level;
|
||||
uint8_t zoom_amount = 1 << zoom_level;
|
||||
|
||||
@@ -418,13 +418,7 @@ int32_t string_get_height_raw(char* buffer)
|
||||
* ticks : ebp >> 16
|
||||
*/
|
||||
void gfx_draw_string_centred_wrapped_partial(
|
||||
rct_drawpixelinfo* dpi,
|
||||
int32_t x,
|
||||
int32_t y,
|
||||
int32_t width,
|
||||
int32_t colour,
|
||||
rct_string_id format,
|
||||
void* args,
|
||||
rct_drawpixelinfo* dpi, int32_t x, int32_t y, int32_t width, int32_t colour, rct_string_id format, void* args,
|
||||
int32_t ticks)
|
||||
{
|
||||
int32_t numLines, fontSpriteBase, lineHeight, lineY;
|
||||
@@ -972,12 +966,7 @@ static int32_t ttf_get_string_width(const utf8* text)
|
||||
* rct2: 0x00682F28
|
||||
*/
|
||||
void gfx_draw_string_with_y_offsets(
|
||||
rct_drawpixelinfo* dpi,
|
||||
const utf8* text,
|
||||
int32_t colour,
|
||||
int32_t x,
|
||||
int32_t y,
|
||||
const int8_t* yOffsets,
|
||||
rct_drawpixelinfo* dpi, const utf8* text, int32_t colour, int32_t x, int32_t y, const int8_t* yOffsets,
|
||||
bool forceSpriteFont)
|
||||
{
|
||||
text_draw_info info;
|
||||
|
||||
@@ -466,14 +466,8 @@ const translucent_window_palette TranslucentWindowPalettes[COLOUR_COUNT] = {
|
||||
// clang-format on
|
||||
|
||||
void (*mask_fn)(
|
||||
int32_t width,
|
||||
int32_t height,
|
||||
const uint8_t* RESTRICT maskSrc,
|
||||
const uint8_t* RESTRICT colourSrc,
|
||||
uint8_t* RESTRICT dst,
|
||||
int32_t maskWrap,
|
||||
int32_t colourWrap,
|
||||
int32_t dstWrap)
|
||||
int32_t width, int32_t height, const uint8_t* RESTRICT maskSrc, const uint8_t* RESTRICT colourSrc, uint8_t* RESTRICT dst,
|
||||
int32_t maskWrap, int32_t colourWrap, int32_t dstWrap)
|
||||
= nullptr;
|
||||
|
||||
void mask_init()
|
||||
|
||||
@@ -304,23 +304,11 @@ uint32_t gfx_object_allocate_images(const rct_g1_element* images, uint32_t count
|
||||
void gfx_object_free_images(uint32_t baseImageId, uint32_t count);
|
||||
void gfx_object_check_all_images_freed();
|
||||
void FASTCALL gfx_bmp_sprite_to_buffer(
|
||||
const uint8_t* palette_pointer,
|
||||
uint8_t* source_pointer,
|
||||
uint8_t* dest_pointer,
|
||||
const rct_g1_element* source_image,
|
||||
rct_drawpixelinfo* dest_dpi,
|
||||
int32_t height,
|
||||
int32_t width,
|
||||
int32_t image_type);
|
||||
const uint8_t* palette_pointer, uint8_t* source_pointer, uint8_t* dest_pointer, const rct_g1_element* source_image,
|
||||
rct_drawpixelinfo* dest_dpi, int32_t height, int32_t width, int32_t image_type);
|
||||
void FASTCALL gfx_rle_sprite_to_buffer(
|
||||
const uint8_t* RESTRICT source_bits_pointer,
|
||||
uint8_t* RESTRICT dest_bits_pointer,
|
||||
const uint8_t* RESTRICT palette_pointer,
|
||||
const rct_drawpixelinfo* RESTRICT dpi,
|
||||
int32_t image_type,
|
||||
int32_t source_y_start,
|
||||
int32_t height,
|
||||
int32_t source_x_start,
|
||||
const uint8_t* RESTRICT source_bits_pointer, uint8_t* RESTRICT dest_bits_pointer, const uint8_t* RESTRICT palette_pointer,
|
||||
const rct_drawpixelinfo* RESTRICT dpi, int32_t image_type, int32_t source_y_start, int32_t height, int32_t source_x_start,
|
||||
int32_t width);
|
||||
void FASTCALL gfx_draw_sprite(rct_drawpixelinfo* dpi, int32_t image_id, int32_t x, int32_t y, uint32_t tertiary_colour);
|
||||
void FASTCALL gfx_draw_glpyh(rct_drawpixelinfo* dpi, int32_t image_id, int32_t x, int32_t y, uint8_t* palette);
|
||||
@@ -364,21 +352,10 @@ void gfx_draw_string_left_centred(
|
||||
rct_drawpixelinfo* dpi, rct_string_id format, void* args, int32_t colour, int32_t x, int32_t y);
|
||||
void draw_string_centred_raw(rct_drawpixelinfo* dpi, int32_t x, int32_t y, int32_t numLines, char* text);
|
||||
void gfx_draw_string_centred_wrapped_partial(
|
||||
rct_drawpixelinfo* dpi,
|
||||
int32_t x,
|
||||
int32_t y,
|
||||
int32_t width,
|
||||
int32_t colour,
|
||||
rct_string_id format,
|
||||
void* args,
|
||||
rct_drawpixelinfo* dpi, int32_t x, int32_t y, int32_t width, int32_t colour, rct_string_id format, void* args,
|
||||
int32_t ticks);
|
||||
void gfx_draw_string_with_y_offsets(
|
||||
rct_drawpixelinfo* dpi,
|
||||
const utf8* text,
|
||||
int32_t colour,
|
||||
int32_t x,
|
||||
int32_t y,
|
||||
const int8_t* yOffsets,
|
||||
rct_drawpixelinfo* dpi, const utf8* text, int32_t colour, int32_t x, int32_t y, const int8_t* yOffsets,
|
||||
bool forceSpriteFont);
|
||||
|
||||
int32_t gfx_wrap_string(char* buffer, int32_t width, int32_t* num_lines, int32_t* font_height);
|
||||
@@ -397,43 +374,19 @@ rct_size16 FASTCALL gfx_get_sprite_size(uint32_t image_id);
|
||||
size_t g1_calculate_data_size(const rct_g1_element* g1);
|
||||
|
||||
void mask_scalar(
|
||||
int32_t width,
|
||||
int32_t height,
|
||||
const uint8_t* RESTRICT maskSrc,
|
||||
const uint8_t* RESTRICT colourSrc,
|
||||
uint8_t* RESTRICT dst,
|
||||
int32_t maskWrap,
|
||||
int32_t colourWrap,
|
||||
int32_t dstWrap);
|
||||
int32_t width, int32_t height, const uint8_t* RESTRICT maskSrc, const uint8_t* RESTRICT colourSrc, uint8_t* RESTRICT dst,
|
||||
int32_t maskWrap, int32_t colourWrap, int32_t dstWrap);
|
||||
void mask_sse4_1(
|
||||
int32_t width,
|
||||
int32_t height,
|
||||
const uint8_t* RESTRICT maskSrc,
|
||||
const uint8_t* RESTRICT colourSrc,
|
||||
uint8_t* RESTRICT dst,
|
||||
int32_t maskWrap,
|
||||
int32_t colourWrap,
|
||||
int32_t dstWrap);
|
||||
int32_t width, int32_t height, const uint8_t* RESTRICT maskSrc, const uint8_t* RESTRICT colourSrc, uint8_t* RESTRICT dst,
|
||||
int32_t maskWrap, int32_t colourWrap, int32_t dstWrap);
|
||||
void mask_avx2(
|
||||
int32_t width,
|
||||
int32_t height,
|
||||
const uint8_t* RESTRICT maskSrc,
|
||||
const uint8_t* RESTRICT colourSrc,
|
||||
uint8_t* RESTRICT dst,
|
||||
int32_t maskWrap,
|
||||
int32_t colourWrap,
|
||||
int32_t dstWrap);
|
||||
int32_t width, int32_t height, const uint8_t* RESTRICT maskSrc, const uint8_t* RESTRICT colourSrc, uint8_t* RESTRICT dst,
|
||||
int32_t maskWrap, int32_t colourWrap, int32_t dstWrap);
|
||||
void mask_init();
|
||||
|
||||
extern void (*mask_fn)(
|
||||
int32_t width,
|
||||
int32_t height,
|
||||
const uint8_t* RESTRICT maskSrc,
|
||||
const uint8_t* RESTRICT colourSrc,
|
||||
uint8_t* RESTRICT dst,
|
||||
int32_t maskWrap,
|
||||
int32_t colourWrap,
|
||||
int32_t dstWrap);
|
||||
int32_t width, int32_t height, const uint8_t* RESTRICT maskSrc, const uint8_t* RESTRICT colourSrc, uint8_t* RESTRICT dst,
|
||||
int32_t maskWrap, int32_t colourWrap, int32_t dstWrap);
|
||||
|
||||
#include "NewDrawing.h"
|
||||
|
||||
|
||||
@@ -15,14 +15,8 @@
|
||||
|
||||
template<int32_t image_type, int32_t zoom_level>
|
||||
static void FASTCALL DrawRLESprite2(
|
||||
const uint8_t* RESTRICT source_bits_pointer,
|
||||
uint8_t* RESTRICT dest_bits_pointer,
|
||||
const uint8_t* RESTRICT palette_pointer,
|
||||
const rct_drawpixelinfo* RESTRICT dpi,
|
||||
int32_t source_y_start,
|
||||
int32_t height,
|
||||
int32_t source_x_start,
|
||||
int32_t width)
|
||||
const uint8_t* RESTRICT source_bits_pointer, uint8_t* RESTRICT dest_bits_pointer, const uint8_t* RESTRICT palette_pointer,
|
||||
const rct_drawpixelinfo* RESTRICT dpi, int32_t source_y_start, int32_t height, int32_t source_x_start, int32_t width)
|
||||
{
|
||||
// The distance between two samples in the source image.
|
||||
// We draw the image at 1 / (2^zoom_level) scale.
|
||||
@@ -149,14 +143,8 @@ static void FASTCALL DrawRLESprite2(
|
||||
|
||||
template<int32_t image_type>
|
||||
static void FASTCALL DrawRLESprite1(
|
||||
const uint8_t* source_bits_pointer,
|
||||
uint8_t* dest_bits_pointer,
|
||||
const uint8_t* palette_pointer,
|
||||
const rct_drawpixelinfo* dpi,
|
||||
int32_t source_y_start,
|
||||
int32_t height,
|
||||
int32_t source_x_start,
|
||||
int32_t width)
|
||||
const uint8_t* source_bits_pointer, uint8_t* dest_bits_pointer, const uint8_t* palette_pointer,
|
||||
const rct_drawpixelinfo* dpi, int32_t source_y_start, int32_t height, int32_t source_x_start, int32_t width)
|
||||
{
|
||||
int32_t zoom_level = dpi->zoom_level;
|
||||
switch (zoom_level)
|
||||
@@ -189,14 +177,8 @@ static void FASTCALL DrawRLESprite1(
|
||||
* rct2: 0x0067AA18
|
||||
*/
|
||||
void FASTCALL gfx_rle_sprite_to_buffer(
|
||||
const uint8_t* RESTRICT source_bits_pointer,
|
||||
uint8_t* RESTRICT dest_bits_pointer,
|
||||
const uint8_t* RESTRICT palette_pointer,
|
||||
const rct_drawpixelinfo* RESTRICT dpi,
|
||||
int32_t image_type,
|
||||
int32_t source_y_start,
|
||||
int32_t height,
|
||||
int32_t source_x_start,
|
||||
const uint8_t* RESTRICT source_bits_pointer, uint8_t* RESTRICT dest_bits_pointer, const uint8_t* RESTRICT palette_pointer,
|
||||
const rct_drawpixelinfo* RESTRICT dpi, int32_t image_type, int32_t source_y_start, int32_t height, int32_t source_x_start,
|
||||
int32_t width)
|
||||
{
|
||||
if (image_type & IMAGE_TYPE_REMAP)
|
||||
|
||||
@@ -45,10 +45,7 @@ namespace OpenRCT2::Drawing
|
||||
};
|
||||
|
||||
ImportResult Import(
|
||||
const Image& image,
|
||||
int32_t offsetX = 0,
|
||||
int32_t offsetY = 0,
|
||||
IMPORT_FLAGS flags = IMPORT_FLAGS::NONE,
|
||||
const Image& image, int32_t offsetX = 0, int32_t offsetY = 0, IMPORT_FLAGS flags = IMPORT_FLAGS::NONE,
|
||||
IMPORT_MODE mode = IMPORT_MODE::DEFAULT) const;
|
||||
|
||||
private:
|
||||
|
||||
@@ -791,32 +791,16 @@ void lightfx_add_lights_magic_vehicles()
|
||||
{
|
||||
case RIDE_TYPE_OBSERVATION_TOWER:
|
||||
lightfx_add_3d_light(
|
||||
vehicleID,
|
||||
0x0000 | LIGHTFX_LIGHT_QUALIFIER_SPRITE,
|
||||
vehicle->x,
|
||||
vehicle->y + 16,
|
||||
vehicle->z,
|
||||
vehicleID, 0x0000 | LIGHTFX_LIGHT_QUALIFIER_SPRITE, vehicle->x, vehicle->y + 16, vehicle->z,
|
||||
LIGHTFX_LIGHT_TYPE_SPOT_3);
|
||||
lightfx_add_3d_light(
|
||||
vehicleID,
|
||||
0x0100 | LIGHTFX_LIGHT_QUALIFIER_SPRITE,
|
||||
vehicle->x + 16,
|
||||
vehicle->y,
|
||||
vehicle->z,
|
||||
vehicleID, 0x0100 | LIGHTFX_LIGHT_QUALIFIER_SPRITE, vehicle->x + 16, vehicle->y, vehicle->z,
|
||||
LIGHTFX_LIGHT_TYPE_SPOT_3);
|
||||
lightfx_add_3d_light(
|
||||
vehicleID,
|
||||
0x0200 | LIGHTFX_LIGHT_QUALIFIER_SPRITE,
|
||||
vehicle->x - 16,
|
||||
vehicle->y,
|
||||
vehicle->z,
|
||||
vehicleID, 0x0200 | LIGHTFX_LIGHT_QUALIFIER_SPRITE, vehicle->x - 16, vehicle->y, vehicle->z,
|
||||
LIGHTFX_LIGHT_TYPE_SPOT_3);
|
||||
lightfx_add_3d_light(
|
||||
vehicleID,
|
||||
0x0300 | LIGHTFX_LIGHT_QUALIFIER_SPRITE,
|
||||
vehicle->x,
|
||||
vehicle->y - 16,
|
||||
vehicle->z,
|
||||
vehicleID, 0x0300 | LIGHTFX_LIGHT_QUALIFIER_SPRITE, vehicle->x, vehicle->y - 16, vehicle->z,
|
||||
LIGHTFX_LIGHT_TYPE_SPOT_3);
|
||||
break;
|
||||
case RIDE_TYPE_MINE_TRAIN_COASTER:
|
||||
@@ -826,21 +810,13 @@ void lightfx_add_lights_magic_vehicles()
|
||||
place_x -= offsetLookup[(vehicle->sprite_direction + 0) % 32] * 2;
|
||||
place_y -= offsetLookup[(vehicle->sprite_direction + 8) % 32] * 2;
|
||||
lightfx_add_3d_light(
|
||||
vehicleID,
|
||||
0x0000 | LIGHTFX_LIGHT_QUALIFIER_SPRITE,
|
||||
place_x,
|
||||
place_y,
|
||||
place_z,
|
||||
vehicleID, 0x0000 | LIGHTFX_LIGHT_QUALIFIER_SPRITE, place_x, place_y, place_z,
|
||||
LIGHTFX_LIGHT_TYPE_SPOT_3);
|
||||
}
|
||||
break;
|
||||
case RIDE_TYPE_CHAIRLIFT:
|
||||
lightfx_add_3d_light(
|
||||
vehicleID,
|
||||
0x0000 | LIGHTFX_LIGHT_QUALIFIER_SPRITE,
|
||||
place_x,
|
||||
place_y,
|
||||
place_z - 16,
|
||||
vehicleID, 0x0000 | LIGHTFX_LIGHT_QUALIFIER_SPRITE, place_x, place_y, place_z - 16,
|
||||
LIGHTFX_LIGHT_TYPE_LANTERN_2);
|
||||
break;
|
||||
case RIDE_TYPE_BOAT_HIRE:
|
||||
@@ -864,50 +840,30 @@ void lightfx_add_lights_magic_vehicles()
|
||||
place_x -= offsetLookup[(vehicle_draw->sprite_direction + 0) % 32];
|
||||
place_y -= offsetLookup[(vehicle_draw->sprite_direction + 8) % 32];
|
||||
lightfx_add_3d_light(
|
||||
vehicleID,
|
||||
0x0000 | LIGHTFX_LIGHT_QUALIFIER_SPRITE,
|
||||
place_x,
|
||||
place_y,
|
||||
place_z,
|
||||
vehicleID, 0x0000 | LIGHTFX_LIGHT_QUALIFIER_SPRITE, place_x, place_y, place_z,
|
||||
LIGHTFX_LIGHT_TYPE_SPOT_2);
|
||||
place_x -= offsetLookup[(vehicle_draw->sprite_direction + 0) % 32];
|
||||
place_y -= offsetLookup[(vehicle_draw->sprite_direction + 8) % 32];
|
||||
lightfx_add_3d_light(
|
||||
vehicleID,
|
||||
0x0100 | LIGHTFX_LIGHT_QUALIFIER_SPRITE,
|
||||
place_x,
|
||||
place_y,
|
||||
place_z,
|
||||
vehicleID, 0x0100 | LIGHTFX_LIGHT_QUALIFIER_SPRITE, place_x, place_y, place_z,
|
||||
LIGHTFX_LIGHT_TYPE_SPOT_2);
|
||||
break;
|
||||
}
|
||||
case RIDE_TYPE_MONORAIL:
|
||||
lightfx_add_3d_light(
|
||||
vehicleID,
|
||||
0x0000 | LIGHTFX_LIGHT_QUALIFIER_SPRITE,
|
||||
vehicle->x,
|
||||
vehicle->y,
|
||||
vehicle->z + 12,
|
||||
vehicleID, 0x0000 | LIGHTFX_LIGHT_QUALIFIER_SPRITE, vehicle->x, vehicle->y, vehicle->z + 12,
|
||||
LIGHTFX_LIGHT_TYPE_SPOT_2);
|
||||
if (vehicle == vehicle_get_head(vehicle))
|
||||
{
|
||||
place_x -= offsetLookup[(vehicle->sprite_direction + 0) % 32] * 2;
|
||||
place_y -= offsetLookup[(vehicle->sprite_direction + 8) % 32] * 2;
|
||||
lightfx_add_3d_light(
|
||||
vehicleID,
|
||||
0x0100 | LIGHTFX_LIGHT_QUALIFIER_SPRITE,
|
||||
place_x,
|
||||
place_y,
|
||||
place_z + 10,
|
||||
vehicleID, 0x0100 | LIGHTFX_LIGHT_QUALIFIER_SPRITE, place_x, place_y, place_z + 10,
|
||||
LIGHTFX_LIGHT_TYPE_LANTERN_3);
|
||||
place_x -= offsetLookup[(vehicle->sprite_direction + 0) % 32] * 3;
|
||||
place_y -= offsetLookup[(vehicle->sprite_direction + 8) % 32] * 3;
|
||||
lightfx_add_3d_light(
|
||||
vehicleID,
|
||||
0x0200 | LIGHTFX_LIGHT_QUALIFIER_SPRITE,
|
||||
place_x,
|
||||
place_y,
|
||||
place_z + 2,
|
||||
vehicleID, 0x0200 | LIGHTFX_LIGHT_QUALIFIER_SPRITE, place_x, place_y, place_z + 2,
|
||||
LIGHTFX_LIGHT_TYPE_LANTERN_3);
|
||||
}
|
||||
if (vehicle == vehicle_get_tail(vehicle))
|
||||
@@ -915,20 +871,12 @@ void lightfx_add_lights_magic_vehicles()
|
||||
place_x += offsetLookup[(vehicle->sprite_direction + 0) % 32] * 2;
|
||||
place_y += offsetLookup[(vehicle->sprite_direction + 8) % 32] * 2;
|
||||
lightfx_add_3d_light(
|
||||
vehicleID,
|
||||
0x0300 | LIGHTFX_LIGHT_QUALIFIER_SPRITE,
|
||||
place_x,
|
||||
place_y,
|
||||
place_z + 10,
|
||||
vehicleID, 0x0300 | LIGHTFX_LIGHT_QUALIFIER_SPRITE, place_x, place_y, place_z + 10,
|
||||
LIGHTFX_LIGHT_TYPE_LANTERN_3);
|
||||
place_x += offsetLookup[(vehicle->sprite_direction + 0) % 32] * 2;
|
||||
place_y += offsetLookup[(vehicle->sprite_direction + 8) % 32] * 2;
|
||||
lightfx_add_3d_light(
|
||||
vehicleID,
|
||||
0x0400 | LIGHTFX_LIGHT_QUALIFIER_SPRITE,
|
||||
place_x,
|
||||
place_y,
|
||||
place_z + 2,
|
||||
vehicleID, 0x0400 | LIGHTFX_LIGHT_QUALIFIER_SPRITE, place_x, place_y, place_z + 2,
|
||||
LIGHTFX_LIGHT_TYPE_LANTERN_3);
|
||||
}
|
||||
break;
|
||||
@@ -938,30 +886,18 @@ void lightfx_add_lights_magic_vehicles()
|
||||
place_x -= offsetLookup[(vehicle->sprite_direction + 0) % 32] * 2;
|
||||
place_y -= offsetLookup[(vehicle->sprite_direction + 8) % 32] * 2;
|
||||
lightfx_add_3d_light(
|
||||
vehicleID,
|
||||
0x0100 | LIGHTFX_LIGHT_QUALIFIER_SPRITE,
|
||||
place_x,
|
||||
place_y,
|
||||
place_z + 10,
|
||||
vehicleID, 0x0100 | LIGHTFX_LIGHT_QUALIFIER_SPRITE, place_x, place_y, place_z + 10,
|
||||
LIGHTFX_LIGHT_TYPE_LANTERN_3);
|
||||
place_x -= offsetLookup[(vehicle->sprite_direction + 0) % 32] * 2;
|
||||
place_y -= offsetLookup[(vehicle->sprite_direction + 8) % 32] * 2;
|
||||
lightfx_add_3d_light(
|
||||
vehicleID,
|
||||
0x0200 | LIGHTFX_LIGHT_QUALIFIER_SPRITE,
|
||||
place_x,
|
||||
place_y,
|
||||
place_z + 2,
|
||||
vehicleID, 0x0200 | LIGHTFX_LIGHT_QUALIFIER_SPRITE, place_x, place_y, place_z + 2,
|
||||
LIGHTFX_LIGHT_TYPE_LANTERN_3);
|
||||
}
|
||||
else
|
||||
{
|
||||
lightfx_add_3d_light(
|
||||
vehicleID,
|
||||
0x0000 | LIGHTFX_LIGHT_QUALIFIER_SPRITE,
|
||||
place_x,
|
||||
place_y,
|
||||
place_z + 10,
|
||||
vehicleID, 0x0000 | LIGHTFX_LIGHT_QUALIFIER_SPRITE, place_x, place_y, place_z + 10,
|
||||
LIGHTFX_LIGHT_TYPE_LANTERN_3);
|
||||
}
|
||||
break;
|
||||
@@ -1143,12 +1079,7 @@ static uint8_t mix_light(uint32_t a, uint32_t b, uint32_t intensity)
|
||||
}
|
||||
|
||||
void lightfx_render_to_texture(
|
||||
void* dstPixels,
|
||||
uint32_t dstPitch,
|
||||
uint8_t* bits,
|
||||
uint32_t width,
|
||||
uint32_t height,
|
||||
const uint32_t* palette,
|
||||
void* dstPixels, uint32_t dstPitch, uint8_t* bits, uint32_t width, uint32_t height, const uint32_t* palette,
|
||||
const uint32_t* lightPalette)
|
||||
{
|
||||
lightfx_update_viewport_settings();
|
||||
|
||||
@@ -68,12 +68,7 @@ uint32_t lightfx_get_light_polution();
|
||||
|
||||
void lightfx_apply_palette_filter(uint8_t i, uint8_t* r, uint8_t* g, uint8_t* b);
|
||||
void lightfx_render_to_texture(
|
||||
void* dstPixels,
|
||||
uint32_t dstPitch,
|
||||
uint8_t* bits,
|
||||
uint32_t width,
|
||||
uint32_t height,
|
||||
const uint32_t* palette,
|
||||
void* dstPixels, uint32_t dstPitch, uint8_t* bits, uint32_t width, uint32_t height, const uint32_t* palette,
|
||||
const uint32_t* lightPalette);
|
||||
|
||||
#endif // __ENABLE_LIGHTFX__
|
||||
|
||||
@@ -16,14 +16,8 @@
|
||||
#include <immintrin.h>
|
||||
|
||||
void mask_sse4_1(
|
||||
int32_t width,
|
||||
int32_t height,
|
||||
const uint8_t* RESTRICT maskSrc,
|
||||
const uint8_t* RESTRICT colourSrc,
|
||||
uint8_t* RESTRICT dst,
|
||||
int32_t maskWrap,
|
||||
int32_t colourWrap,
|
||||
int32_t dstWrap)
|
||||
int32_t width, int32_t height, const uint8_t* RESTRICT maskSrc, const uint8_t* RESTRICT colourSrc, uint8_t* RESTRICT dst,
|
||||
int32_t maskWrap, int32_t colourWrap, int32_t dstWrap)
|
||||
{
|
||||
if (width == 32)
|
||||
{
|
||||
@@ -69,14 +63,8 @@ void mask_sse4_1(
|
||||
#endif
|
||||
|
||||
void mask_sse4_1(
|
||||
int32_t width,
|
||||
int32_t height,
|
||||
const uint8_t* RESTRICT maskSrc,
|
||||
const uint8_t* RESTRICT colourSrc,
|
||||
uint8_t* RESTRICT dst,
|
||||
int32_t maskWrap,
|
||||
int32_t colourWrap,
|
||||
int32_t dstWrap)
|
||||
int32_t width, int32_t height, const uint8_t* RESTRICT maskSrc, const uint8_t* RESTRICT colourSrc, uint8_t* RESTRICT dst,
|
||||
int32_t maskWrap, int32_t colourWrap, int32_t dstWrap)
|
||||
{
|
||||
openrct2_assert(false, "SSE 4.1 function called on a CPU that doesn't support SSE 4.1");
|
||||
}
|
||||
|
||||
@@ -113,13 +113,7 @@ static void DrawText(rct_drawpixelinfo* dpi, int32_t x, int32_t y, TextPaint* pa
|
||||
}
|
||||
|
||||
static void DrawTextCompat(
|
||||
rct_drawpixelinfo* dpi,
|
||||
int32_t x,
|
||||
int32_t y,
|
||||
rct_string_id format,
|
||||
void* args,
|
||||
uint8_t colour,
|
||||
TextAlignment alignment,
|
||||
rct_drawpixelinfo* dpi, int32_t x, int32_t y, rct_string_id format, void* args, uint8_t colour, TextAlignment alignment,
|
||||
bool underline = false)
|
||||
{
|
||||
_legacyPaint.UnderlineText = underline;
|
||||
@@ -131,15 +125,8 @@ static void DrawTextCompat(
|
||||
}
|
||||
|
||||
static void DrawTextEllipsisedCompat(
|
||||
rct_drawpixelinfo* dpi,
|
||||
int32_t x,
|
||||
int32_t y,
|
||||
int32_t width,
|
||||
rct_string_id format,
|
||||
void* args,
|
||||
uint8_t colour,
|
||||
TextAlignment alignment,
|
||||
bool underline = false)
|
||||
rct_drawpixelinfo* dpi, int32_t x, int32_t y, int32_t width, rct_string_id format, void* args, uint8_t colour,
|
||||
TextAlignment alignment, bool underline = false)
|
||||
{
|
||||
_legacyPaint.UnderlineText = underline;
|
||||
_legacyPaint.Colour = colour;
|
||||
|
||||
@@ -130,20 +130,10 @@ void chat_draw(rct_drawpixelinfo* dpi, uint8_t chatBackgroundColor)
|
||||
gfx_fill_rect_inset(
|
||||
dpi, _chatLeft, _chatTop - 5, _chatRight, _chatBottom + 5, chatBackgroundColor, INSET_RECT_FLAG_FILL_NONE);
|
||||
gfx_fill_rect_inset(
|
||||
dpi,
|
||||
_chatLeft + 1,
|
||||
_chatTop - 4,
|
||||
_chatRight - 1,
|
||||
_chatBottom - inputLineHeight - 6,
|
||||
chatBackgroundColor,
|
||||
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,
|
||||
dpi, _chatLeft + 1, _chatBottom - inputLineHeight - 5, _chatRight - 1, _chatBottom + 4, chatBackgroundColor,
|
||||
INSET_RECT_FLAG_BORDER_INSET); // Textbox
|
||||
}
|
||||
|
||||
|
||||
@@ -109,30 +109,12 @@ static bool LoadFont(LocalisationService& localisationService, TTFFontSetDescrip
|
||||
static bool LoadCustomConfigFont(LocalisationService& localisationService)
|
||||
{
|
||||
static TTFFontSetDescriptor TTFFontCustom = { {
|
||||
{ gConfigFonts.file_name,
|
||||
gConfigFonts.font_name,
|
||||
gConfigFonts.size_tiny,
|
||||
gConfigFonts.x_offset,
|
||||
gConfigFonts.y_offset,
|
||||
gConfigFonts.height_tiny,
|
||||
gConfigFonts.hinting_threshold,
|
||||
nullptr },
|
||||
{ gConfigFonts.file_name,
|
||||
gConfigFonts.font_name,
|
||||
gConfigFonts.size_small,
|
||||
gConfigFonts.x_offset,
|
||||
gConfigFonts.y_offset,
|
||||
gConfigFonts.height_small,
|
||||
gConfigFonts.hinting_threshold,
|
||||
nullptr },
|
||||
{ gConfigFonts.file_name,
|
||||
gConfigFonts.font_name,
|
||||
gConfigFonts.size_medium,
|
||||
gConfigFonts.x_offset,
|
||||
gConfigFonts.y_offset,
|
||||
gConfigFonts.height_medium,
|
||||
gConfigFonts.hinting_threshold,
|
||||
nullptr },
|
||||
{ gConfigFonts.file_name, gConfigFonts.font_name, gConfigFonts.size_tiny, gConfigFonts.x_offset, gConfigFonts.y_offset,
|
||||
gConfigFonts.height_tiny, gConfigFonts.hinting_threshold, nullptr },
|
||||
{ gConfigFonts.file_name, gConfigFonts.font_name, gConfigFonts.size_small, gConfigFonts.x_offset, gConfigFonts.y_offset,
|
||||
gConfigFonts.height_small, gConfigFonts.hinting_threshold, nullptr },
|
||||
{ gConfigFonts.file_name, gConfigFonts.font_name, gConfigFonts.size_medium, gConfigFonts.x_offset,
|
||||
gConfigFonts.y_offset, gConfigFonts.height_medium, gConfigFonts.hinting_threshold, nullptr },
|
||||
} };
|
||||
|
||||
ttf_dispose();
|
||||
|
||||
@@ -127,12 +127,8 @@ static int32_t cc_rides(InteractiveConsole& console, const utf8** argv, int32_t
|
||||
char name[128];
|
||||
format_string(name, 128, ride->name, &ride->name_arguments);
|
||||
console.WriteFormatLine(
|
||||
"ride: %03d type: %02u subtype %03u operating mode: %02u name: %s",
|
||||
i,
|
||||
ride->type,
|
||||
ride->subtype,
|
||||
ride->mode,
|
||||
name);
|
||||
"ride: %03d type: %02u subtype %03u operating mode: %02u name: %s", i, ride->type, ride->subtype,
|
||||
ride->mode, name);
|
||||
}
|
||||
}
|
||||
else if (strcmp(argv[0], "set") == 0)
|
||||
@@ -592,14 +588,8 @@ static int32_t cc_get(InteractiveConsole& console, const utf8** argv, int32_t ar
|
||||
LocationXY16 mapCoord = {};
|
||||
rct_viewport* viewport = window_get_viewport(w);
|
||||
get_map_coordinates_from_pos(
|
||||
viewport->view_width / 2,
|
||||
viewport->view_height / 2,
|
||||
VIEWPORT_INTERACTION_MASK_TERRAIN,
|
||||
&mapCoord.x,
|
||||
&mapCoord.y,
|
||||
&interactionType,
|
||||
&tileElement,
|
||||
nullptr);
|
||||
viewport->view_width / 2, viewport->view_height / 2, VIEWPORT_INTERACTION_MASK_TERRAIN, &mapCoord.x,
|
||||
&mapCoord.y, &interactionType, &tileElement, nullptr);
|
||||
mapCoord.x -= 16;
|
||||
mapCoord.x /= 32;
|
||||
mapCoord.y -= 16;
|
||||
|
||||
@@ -140,16 +140,8 @@ static int32_t screenshot_get_next_path(char* path, size_t size)
|
||||
}
|
||||
const size_t leftBytes = size - strlen(path);
|
||||
snprintf(
|
||||
fileNameCh,
|
||||
leftBytes,
|
||||
"%s %d-%02d-%02d %02d-%02d-%02d.png",
|
||||
park_name,
|
||||
currentDate.year,
|
||||
currentDate.month,
|
||||
currentDate.day,
|
||||
currentTime.hour,
|
||||
currentTime.minute,
|
||||
currentTime.second);
|
||||
fileNameCh, leftBytes, "%s %d-%02d-%02d %02d-%02d-%02d.png", park_name, currentDate.year, currentDate.month,
|
||||
currentDate.day, currentTime.hour, currentTime.minute, currentTime.second);
|
||||
|
||||
if (!platform_file_exists(path))
|
||||
{
|
||||
@@ -167,17 +159,8 @@ static int32_t screenshot_get_next_path(char* path, size_t size)
|
||||
{
|
||||
// Glue together path and filename
|
||||
snprintf(
|
||||
fileNameCh,
|
||||
leftBytes,
|
||||
"%s %d-%02d-%02d %02d-%02d-%02d (%d).png",
|
||||
park_name,
|
||||
currentDate.year,
|
||||
currentDate.month,
|
||||
currentDate.day,
|
||||
currentTime.hour,
|
||||
currentTime.minute,
|
||||
currentTime.second,
|
||||
i);
|
||||
fileNameCh, leftBytes, "%s %d-%02d-%02d %02d-%02d-%02d (%d).png", park_name, currentDate.year, currentDate.month,
|
||||
currentDate.day, currentTime.hour, currentTime.minute, currentTime.second, i);
|
||||
|
||||
if (!platform_file_exists(path))
|
||||
{
|
||||
|
||||
@@ -146,17 +146,8 @@ void centre_2d_coordinates(int32_t x, int32_t y, int32_t z, int32_t* out_x, int3
|
||||
* w: esi
|
||||
*/
|
||||
void viewport_create(
|
||||
rct_window* w,
|
||||
int32_t x,
|
||||
int32_t y,
|
||||
int32_t width,
|
||||
int32_t height,
|
||||
int32_t zoom,
|
||||
int32_t centre_x,
|
||||
int32_t centre_y,
|
||||
int32_t centre_z,
|
||||
char flags,
|
||||
int16_t sprite)
|
||||
rct_window* w, int32_t x, int32_t y, int32_t width, int32_t height, int32_t zoom, int32_t centre_x, int32_t centre_y,
|
||||
int32_t centre_z, char flags, int16_t sprite)
|
||||
{
|
||||
rct_viewport* viewport = nullptr;
|
||||
for (int32_t i = 0; i < MAX_VIEWPORT_COUNT; i++)
|
||||
@@ -1614,29 +1605,16 @@ void sub_68862C(rct_drawpixelinfo* dpi, paint_struct* ps)
|
||||
* viewport: edi
|
||||
*/
|
||||
void get_map_coordinates_from_pos(
|
||||
int32_t screenX,
|
||||
int32_t screenY,
|
||||
int32_t flags,
|
||||
int16_t* x,
|
||||
int16_t* y,
|
||||
int32_t* interactionType,
|
||||
rct_tile_element** tileElement,
|
||||
rct_viewport** viewport)
|
||||
int32_t screenX, int32_t screenY, int32_t flags, int16_t* x, int16_t* y, int32_t* interactionType,
|
||||
rct_tile_element** tileElement, rct_viewport** viewport)
|
||||
{
|
||||
rct_window* window = window_find_from_point(screenX, screenY);
|
||||
get_map_coordinates_from_pos_window(window, screenX, screenY, flags, x, y, interactionType, tileElement, viewport);
|
||||
}
|
||||
|
||||
void get_map_coordinates_from_pos_window(
|
||||
rct_window* window,
|
||||
int32_t screenX,
|
||||
int32_t screenY,
|
||||
int32_t flags,
|
||||
int16_t* x,
|
||||
int16_t* y,
|
||||
int32_t* interactionType,
|
||||
rct_tile_element** tileElement,
|
||||
rct_viewport** viewport)
|
||||
rct_window* window, int32_t screenX, int32_t screenY, int32_t flags, int16_t* x, int16_t* y, int32_t* interactionType,
|
||||
rct_tile_element** tileElement, rct_viewport** viewport)
|
||||
{
|
||||
_unk9AC154 = flags & 0xFFFF;
|
||||
_interactionSpriteType = 0;
|
||||
|
||||
@@ -120,17 +120,8 @@ extern uint32_t gCurrentViewportFlags;
|
||||
void viewport_init_all();
|
||||
void centre_2d_coordinates(int32_t x, int32_t y, int32_t z, int32_t* out_x, int32_t* out_y, rct_viewport* viewport);
|
||||
void viewport_create(
|
||||
rct_window* w,
|
||||
int32_t x,
|
||||
int32_t y,
|
||||
int32_t width,
|
||||
int32_t height,
|
||||
int32_t zoom,
|
||||
int32_t centre_x,
|
||||
int32_t centre_y,
|
||||
int32_t centre_z,
|
||||
char flags,
|
||||
int16_t sprite);
|
||||
rct_window* w, int32_t x, int32_t y, int32_t width, int32_t height, int32_t zoom, int32_t centre_x, int32_t centre_y,
|
||||
int32_t centre_z, char flags, int16_t sprite);
|
||||
void viewport_update_position(rct_window* window);
|
||||
void viewport_update_sprite_follow(rct_window* window);
|
||||
void viewport_update_smart_sprite_follow(rct_window* window);
|
||||
@@ -155,24 +146,11 @@ void hide_construction_rights();
|
||||
void viewport_set_visibility(uint8_t mode);
|
||||
|
||||
void get_map_coordinates_from_pos(
|
||||
int32_t screenX,
|
||||
int32_t screenY,
|
||||
int32_t flags,
|
||||
int16_t* x,
|
||||
int16_t* y,
|
||||
int32_t* interactionType,
|
||||
rct_tile_element** tileElement,
|
||||
rct_viewport** viewport);
|
||||
int32_t screenX, int32_t screenY, int32_t flags, int16_t* x, int16_t* y, int32_t* interactionType,
|
||||
rct_tile_element** tileElement, rct_viewport** viewport);
|
||||
void get_map_coordinates_from_pos_window(
|
||||
rct_window* window,
|
||||
int32_t screenX,
|
||||
int32_t screenY,
|
||||
int32_t flags,
|
||||
int16_t* x,
|
||||
int16_t* y,
|
||||
int32_t* interactionType,
|
||||
rct_tile_element** tileElement,
|
||||
rct_viewport** viewport);
|
||||
rct_window* window, int32_t screenX, int32_t screenY, int32_t flags, int16_t* x, int16_t* y, int32_t* interactionType,
|
||||
rct_tile_element** tileElement, rct_viewport** viewport);
|
||||
|
||||
int32_t viewport_interaction_get_item_left(int32_t x, int32_t y, viewport_interaction_info* info);
|
||||
int32_t viewport_interaction_left_over(int32_t x, int32_t y);
|
||||
|
||||
@@ -67,13 +67,7 @@ bool widget_is_pressed(rct_window* w, rct_widgetindex widgetIndex);
|
||||
bool widget_is_highlighted(rct_window* w, rct_widgetindex widgetIndex);
|
||||
bool widget_is_active_tool(rct_window* w, rct_widgetindex widgetIndex);
|
||||
void widget_scroll_get_part(
|
||||
rct_window* w,
|
||||
rct_widget* widget,
|
||||
int32_t x,
|
||||
int32_t y,
|
||||
int32_t* output_x,
|
||||
int32_t* output_y,
|
||||
int32_t* output_scroll_area,
|
||||
rct_window* w, rct_widget* widget, int32_t x, int32_t y, int32_t* output_x, int32_t* output_y, int32_t* output_scroll_area,
|
||||
int32_t* scroll_id);
|
||||
|
||||
void widget_set_enabled(rct_window* w, rct_widgetindex widgetIndex, bool enabled);
|
||||
|
||||
@@ -575,12 +575,7 @@ void window_update_all();
|
||||
void window_set_window_limit(int32_t value);
|
||||
|
||||
rct_window* window_create(
|
||||
int32_t x,
|
||||
int32_t y,
|
||||
int32_t width,
|
||||
int32_t height,
|
||||
rct_window_event_list* event_handlers,
|
||||
rct_windowclass cls,
|
||||
int32_t x, int32_t y, int32_t width, int32_t height, rct_window_event_list* event_handlers, rct_windowclass cls,
|
||||
uint16_t flags);
|
||||
rct_window* window_create_auto_pos(
|
||||
int32_t width, int32_t height, rct_window_event_list* event_handlers, rct_windowclass cls, uint16_t flags);
|
||||
@@ -740,21 +735,10 @@ void window_follow_sprite(rct_window* w, size_t spriteIndex);
|
||||
void window_unfollow_sprite(rct_window* w);
|
||||
|
||||
bool window_ride_construction_update_state(
|
||||
int32_t* trackType,
|
||||
int32_t* trackDirection,
|
||||
int32_t* rideIndex,
|
||||
int32_t* _liftHillAndAlternativeState,
|
||||
int32_t* x,
|
||||
int32_t* y,
|
||||
int32_t* z,
|
||||
int32_t* properties);
|
||||
int32_t* trackType, int32_t* trackDirection, int32_t* rideIndex, int32_t* _liftHillAndAlternativeState, int32_t* x,
|
||||
int32_t* y, int32_t* z, int32_t* properties);
|
||||
money32 place_provisional_track_piece(
|
||||
int32_t rideIndex,
|
||||
int32_t trackType,
|
||||
int32_t trackDirection,
|
||||
int32_t liftHillAndAlternativeState,
|
||||
int32_t x,
|
||||
int32_t y,
|
||||
int32_t rideIndex, int32_t trackType, int32_t trackDirection, int32_t liftHillAndAlternativeState, int32_t x, int32_t y,
|
||||
int32_t z);
|
||||
|
||||
extern uint64_t _enabledRidePieces;
|
||||
|
||||
Loaded 100 of 240 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user