mirror of https://github.com/OpenRCT2/OpenRCT2.git
Replace our own integer types with standard ones
This commit is contained in:
parent
ec3a1e575e
commit
1b08fb4e69
|
@ -27,7 +27,7 @@ CursorRepository::~CursorRepository()
|
|||
|
||||
void CursorRepository::LoadCursors()
|
||||
{
|
||||
SetCursorScale(static_cast<uint8>(round(gConfigGeneral.window_scale)));
|
||||
SetCursorScale(static_cast<uint8_t>(round(gConfigGeneral.window_scale)));
|
||||
SetCurrentCursor(CURSOR_ARROW);
|
||||
}
|
||||
|
||||
|
@ -46,19 +46,19 @@ void CursorRepository::SetCurrentCursor(CURSOR_ID cursorId)
|
|||
}
|
||||
}
|
||||
|
||||
static bool getBit(const uint8 * data, size_t x, size_t y, size_t width)
|
||||
static bool getBit(const uint8_t * data, size_t x, size_t y, size_t width)
|
||||
{
|
||||
size_t position = y * width + x;
|
||||
return (data[position / 8] & (1 << (7 - (x % 8)))) != 0;
|
||||
}
|
||||
|
||||
static void setBit(uint8 * data, size_t x, size_t y, size_t width)
|
||||
static void setBit(uint8_t * data, size_t x, size_t y, size_t width)
|
||||
{
|
||||
size_t position = y * width + x;
|
||||
data[position / 8] |= (1 << (7 - (position % 8)));
|
||||
}
|
||||
|
||||
static void drawRect(uint8 * data, size_t x, size_t y, size_t width, size_t scale)
|
||||
static void drawRect(uint8_t * data, size_t x, size_t y, size_t width, size_t scale)
|
||||
{
|
||||
for (size_t outY = (y * scale); outY < ((1 + y) * scale); outY++)
|
||||
{
|
||||
|
@ -69,10 +69,10 @@ static void drawRect(uint8 * data, size_t x, size_t y, size_t width, size_t scal
|
|||
}
|
||||
}
|
||||
|
||||
static uint8 * scaleDataArray(const uint8 data[], size_t width, size_t height, size_t scale)
|
||||
static uint8_t * scaleDataArray(const uint8_t data[], size_t width, size_t height, size_t scale)
|
||||
{
|
||||
size_t length = width * height;
|
||||
auto * ret = static_cast<uint8 *>(calloc(sizeof(uint8), length * scale * scale));
|
||||
auto * ret = static_cast<uint8_t *>(calloc(sizeof(uint8_t), length * scale * scale));
|
||||
|
||||
for (size_t y = 0; y < height * 8; y++)
|
||||
{
|
||||
|
@ -88,7 +88,7 @@ static uint8 * scaleDataArray(const uint8 data[], size_t width, size_t height, s
|
|||
return ret;
|
||||
}
|
||||
|
||||
SDL_Cursor * CursorRepository::Create(const CursorData * cursorInfo, uint8 scale)
|
||||
SDL_Cursor * CursorRepository::Create(const CursorData * cursorInfo, uint8_t scale)
|
||||
{
|
||||
SDL_Cursor * cursor;
|
||||
|
||||
|
@ -112,7 +112,7 @@ SDL_Cursor * CursorRepository::Create(const CursorData * cursorInfo, uint8 scale
|
|||
return cursor;
|
||||
}
|
||||
|
||||
void CursorRepository::SetCursorScale(uint8 cursorScale)
|
||||
void CursorRepository::SetCursorScale(uint8_t cursorScale)
|
||||
{
|
||||
if (cursorScale > 0.0)
|
||||
{
|
||||
|
@ -121,7 +121,7 @@ void CursorRepository::SetCursorScale(uint8 cursorScale)
|
|||
}
|
||||
}
|
||||
|
||||
void CursorRepository::GenerateScaledCursorSetHolder(uint8 scale)
|
||||
void CursorRepository::GenerateScaledCursorSetHolder(uint8_t scale)
|
||||
{
|
||||
if (_scaledCursors.find(scale) == _scaledCursors.end())
|
||||
{
|
||||
|
|
|
@ -50,24 +50,24 @@ namespace OpenRCT2::Ui
|
|||
}
|
||||
};
|
||||
|
||||
constexpr static sint32 BASE_CURSOR_WIDTH = 32;
|
||||
constexpr static sint32 BASE_CURSOR_HEIGHT = 32;
|
||||
constexpr static int32_t BASE_CURSOR_WIDTH = 32;
|
||||
constexpr static int32_t BASE_CURSOR_HEIGHT = 32;
|
||||
|
||||
CURSOR_ID _currentCursor = CURSOR_UNDEFINED;
|
||||
uint8 _currentCursorScale = 1;
|
||||
uint8_t _currentCursorScale = 1;
|
||||
|
||||
std::map<uint8, CursorSetHolder> _scaledCursors;
|
||||
std::map<uint8_t, CursorSetHolder> _scaledCursors;
|
||||
|
||||
public:
|
||||
~CursorRepository();
|
||||
void LoadCursors();
|
||||
CURSOR_ID GetCurrentCursor();
|
||||
void SetCurrentCursor(CURSOR_ID cursorId);
|
||||
void SetCursorScale(uint8 cursorScale);
|
||||
void SetCursorScale(uint8_t cursorScale);
|
||||
|
||||
private:
|
||||
SDL_Cursor * Create(const CursorData * cursorInfo, uint8 scale);
|
||||
void GenerateScaledCursorSetHolder(uint8 scale);
|
||||
SDL_Cursor * Create(const CursorData * cursorInfo, uint8_t scale);
|
||||
void GenerateScaledCursorSetHolder(uint8_t scale);
|
||||
static const CursorData * GetCursorData(CURSOR_ID cursorId);
|
||||
};
|
||||
}
|
||||
|
|
|
@ -101,7 +101,7 @@ void TextComposition::HandleMessage(const SDL_Event * e)
|
|||
break;
|
||||
}
|
||||
|
||||
uint16 modifier = e->key.keysym.mod;
|
||||
uint16_t modifier = e->key.keysym.mod;
|
||||
SDL_Keycode key = e->key.keysym.sym;
|
||||
if (key == SDLK_KP_ENTER)
|
||||
{
|
||||
|
@ -241,7 +241,7 @@ void TextComposition::CursorRight()
|
|||
void TextComposition::Insert(const utf8 * text)
|
||||
{
|
||||
const utf8 * ch = text;
|
||||
uint32 codepoint;
|
||||
uint32_t codepoint;
|
||||
while ((codepoint = utf8_get_next(ch, &ch)) != 0)
|
||||
{
|
||||
InsertCodepoint(codepoint);
|
||||
|
|
|
@ -26,8 +26,8 @@ namespace OpenRCT2::Ui
|
|||
TextInputSession _session = {};
|
||||
|
||||
bool _imeActive = false;
|
||||
sint32 _imeStart = 0;
|
||||
sint32 _imeLength = 0;
|
||||
int32_t _imeStart = 0;
|
||||
int32_t _imeLength = 0;
|
||||
utf8 _imeBuffer[32] = {};
|
||||
|
||||
public:
|
||||
|
|
|
@ -255,7 +255,7 @@ namespace OpenRCT2::Ui
|
|||
return DIALOG_TYPE::NONE;
|
||||
}
|
||||
|
||||
static sint32 Execute(const std::string &command, std::string * output = nullptr)
|
||||
static int32_t Execute(const std::string &command, std::string * output = nullptr)
|
||||
{
|
||||
#ifndef __EMSCRIPTEN__
|
||||
log_verbose("executing \"%s\"...\n", command.c_str());
|
||||
|
|
|
@ -130,10 +130,10 @@ namespace OpenRCT2::Ui
|
|||
std::string resultExtension = Path::GetExtension(resultFilename);
|
||||
if (resultExtension.empty())
|
||||
{
|
||||
sint32 filterIndex = openFileName.nFilterIndex - 1;
|
||||
int32_t filterIndex = openFileName.nFilterIndex - 1;
|
||||
|
||||
assert(filterIndex >= 0);
|
||||
assert(filterIndex < (sint32)desc.Filters.size());
|
||||
assert(filterIndex < (int32_t)desc.Filters.size());
|
||||
|
||||
std::string pattern = desc.Filters[filterIndex].Pattern;
|
||||
std::string patternExtension = Path::GetExtension(pattern);
|
||||
|
|
|
@ -59,7 +59,7 @@ using namespace OpenRCT2::Ui;
|
|||
class UiContext final : public IUiContext
|
||||
{
|
||||
private:
|
||||
constexpr static uint32 TOUCH_DOUBLE_TIMEOUT = 300;
|
||||
constexpr static uint32_t TOUCH_DOUBLE_TIMEOUT = 300;
|
||||
|
||||
IPlatformUiContext * const _platformUiContext;
|
||||
IWindowManager * const _windowManager;
|
||||
|
@ -67,9 +67,9 @@ private:
|
|||
CursorRepository _cursorRepository;
|
||||
|
||||
SDL_Window * _window = nullptr;
|
||||
sint32 _width = 0;
|
||||
sint32 _height = 0;
|
||||
sint32 _scaleQuality = 0;
|
||||
int32_t _width = 0;
|
||||
int32_t _height = 0;
|
||||
int32_t _scaleQuality = 0;
|
||||
|
||||
bool _resolutionsAllowAnyAspectRatio = false;
|
||||
std::vector<Resolution> _fsResolutions;
|
||||
|
@ -80,10 +80,10 @@ private:
|
|||
KeyboardShortcuts _keyboardShortcuts;
|
||||
TextComposition _textComposition;
|
||||
CursorState _cursorState = {};
|
||||
uint32 _lastKeyPressed = 0;
|
||||
const uint8 * _keysState = nullptr;
|
||||
uint8 _keysPressed[256] = {};
|
||||
uint32 _lastGestureTimestamp = 0;
|
||||
uint32_t _lastKeyPressed = 0;
|
||||
const uint8_t * _keysState = nullptr;
|
||||
uint8_t _keysPressed[256] = {};
|
||||
uint32_t _lastGestureTimestamp = 0;
|
||||
float _gestureRadius = 0;
|
||||
|
||||
InGameConsole _inGameConsole;
|
||||
|
@ -132,25 +132,25 @@ public:
|
|||
return _window;
|
||||
}
|
||||
|
||||
sint32 GetWidth() override
|
||||
int32_t GetWidth() override
|
||||
{
|
||||
return _width;
|
||||
}
|
||||
|
||||
sint32 GetHeight() override
|
||||
int32_t GetHeight() override
|
||||
{
|
||||
return _height;
|
||||
}
|
||||
|
||||
sint32 GetScaleQuality() override
|
||||
int32_t GetScaleQuality() override
|
||||
{
|
||||
return _scaleQuality;
|
||||
}
|
||||
|
||||
void SetFullscreenMode(FULLSCREEN_MODE mode) override
|
||||
{
|
||||
static constexpr const sint32 SDLFSFlags[] = { 0, SDL_WINDOW_FULLSCREEN, SDL_WINDOW_FULLSCREEN_DESKTOP };
|
||||
uint32 windowFlags = SDLFSFlags[(sint32)mode];
|
||||
static constexpr const int32_t SDLFSFlags[] = { 0, SDL_WINDOW_FULLSCREEN, SDL_WINDOW_FULLSCREEN_DESKTOP };
|
||||
uint32_t windowFlags = SDLFSFlags[(int32_t)mode];
|
||||
|
||||
// HACK Changing window size when in fullscreen usually has no effect
|
||||
if (mode == FULLSCREEN_MODE::FULLSCREEN)
|
||||
|
@ -187,13 +187,13 @@ public:
|
|||
|
||||
bool HasFocus() override
|
||||
{
|
||||
uint32 windowFlags = GetWindowFlags();
|
||||
uint32_t windowFlags = GetWindowFlags();
|
||||
return (windowFlags & SDL_WINDOW_INPUT_FOCUS) != 0;
|
||||
}
|
||||
|
||||
bool IsMinimised() override
|
||||
{
|
||||
uint32 windowFlags = GetWindowFlags();
|
||||
uint32_t windowFlags = GetWindowFlags();
|
||||
return (windowFlags & SDL_WINDOW_MINIMIZED) ||
|
||||
(windowFlags & SDL_WINDOW_HIDDEN);
|
||||
}
|
||||
|
@ -209,12 +209,12 @@ public:
|
|||
return &_cursorState;
|
||||
}
|
||||
|
||||
const uint8 * GetKeysState() override
|
||||
const uint8_t * GetKeysState() override
|
||||
{
|
||||
return _keysState;
|
||||
}
|
||||
|
||||
const uint8 * GetKeysPressed() override
|
||||
const uint8_t * GetKeysPressed() override
|
||||
{
|
||||
return _keysPressed;
|
||||
}
|
||||
|
@ -229,7 +229,7 @@ public:
|
|||
_cursorRepository.SetCurrentCursor(cursor);
|
||||
}
|
||||
|
||||
void SetCursorScale(uint8 scale) override
|
||||
void SetCursorScale(uint8_t scale) override
|
||||
{
|
||||
_cursorRepository.SetCursorScale(scale);
|
||||
}
|
||||
|
@ -239,12 +239,12 @@ public:
|
|||
SDL_ShowCursor(value ? SDL_ENABLE : SDL_DISABLE);
|
||||
}
|
||||
|
||||
void GetCursorPosition(sint32 * x, sint32 * y) override
|
||||
void GetCursorPosition(int32_t * x, int32_t * y) override
|
||||
{
|
||||
SDL_GetMouseState(x, y);
|
||||
}
|
||||
|
||||
void SetCursorPosition(sint32 x, sint32 y) override
|
||||
void SetCursorPosition(int32_t x, int32_t y) override
|
||||
{
|
||||
SDL_WarpMouseInWindow(nullptr, x, y);
|
||||
}
|
||||
|
@ -254,7 +254,7 @@ public:
|
|||
SDL_SetWindowGrab(_window, value ? SDL_TRUE : SDL_FALSE);
|
||||
}
|
||||
|
||||
void SetKeysPressed(uint32 keysym, uint8 scancode) override
|
||||
void SetKeysPressed(uint32_t keysym, uint8_t scancode) override
|
||||
{
|
||||
_lastKeyPressed = keysym;
|
||||
_keysPressed[scancode] = 1;
|
||||
|
@ -268,10 +268,10 @@ public:
|
|||
|
||||
void DrawRainAnimation(IRainDrawer* rainDrawer, rct_drawpixelinfo* dpi, DrawRainFunc drawFunc) override
|
||||
{
|
||||
sint32 left = dpi->x;
|
||||
sint32 right = left + dpi->width;
|
||||
sint32 top = dpi->y;
|
||||
sint32 bottom = top + dpi->height;
|
||||
int32_t left = dpi->x;
|
||||
int32_t right = left + dpi->width;
|
||||
int32_t top = dpi->y;
|
||||
int32_t bottom = top + dpi->height;
|
||||
|
||||
for (auto& w : g_window_list)
|
||||
{
|
||||
|
@ -341,7 +341,7 @@ public:
|
|||
case SDL_WINDOWEVENT_RESTORED:
|
||||
{
|
||||
// Update default display index
|
||||
sint32 displayIndex = SDL_GetWindowDisplayIndex(_window);
|
||||
int32_t displayIndex = SDL_GetWindowDisplayIndex(_window);
|
||||
if (displayIndex != gConfigGeneral.default_display)
|
||||
{
|
||||
gConfigGeneral.default_display = displayIndex;
|
||||
|
@ -364,8 +364,8 @@ public:
|
|||
}
|
||||
break;
|
||||
case SDL_MOUSEMOTION:
|
||||
_cursorState.x = (sint32)(e.motion.x / gConfigGeneral.window_scale);
|
||||
_cursorState.y = (sint32)(e.motion.y / gConfigGeneral.window_scale);
|
||||
_cursorState.x = (int32_t)(e.motion.x / gConfigGeneral.window_scale);
|
||||
_cursorState.y = (int32_t)(e.motion.y / gConfigGeneral.window_scale);
|
||||
break;
|
||||
case SDL_MOUSEWHEEL:
|
||||
if (_inGameConsole.IsOpen())
|
||||
|
@ -377,8 +377,8 @@ public:
|
|||
break;
|
||||
case SDL_MOUSEBUTTONDOWN:
|
||||
{
|
||||
sint32 x = (sint32)(e.button.x / gConfigGeneral.window_scale);
|
||||
sint32 y = (sint32)(e.button.y / gConfigGeneral.window_scale);
|
||||
int32_t x = (int32_t)(e.button.x / gConfigGeneral.window_scale);
|
||||
int32_t y = (int32_t)(e.button.y / gConfigGeneral.window_scale);
|
||||
switch (e.button.button) {
|
||||
case SDL_BUTTON_LEFT:
|
||||
store_mouse_input(MOUSE_STATE_LEFT_PRESS, x, y);
|
||||
|
@ -398,8 +398,8 @@ public:
|
|||
}
|
||||
case SDL_MOUSEBUTTONUP:
|
||||
{
|
||||
sint32 x = (sint32)(e.button.x / gConfigGeneral.window_scale);
|
||||
sint32 y = (sint32)(e.button.y / gConfigGeneral.window_scale);
|
||||
int32_t x = (int32_t)(e.button.x / gConfigGeneral.window_scale);
|
||||
int32_t y = (int32_t)(e.button.y / gConfigGeneral.window_scale);
|
||||
switch (e.button.button) {
|
||||
case SDL_BUTTON_LEFT:
|
||||
store_mouse_input(MOUSE_STATE_LEFT_RELEASE, x, y);
|
||||
|
@ -420,13 +420,13 @@ public:
|
|||
// Apple sends touchscreen events for trackpads, so ignore these events on macOS
|
||||
#ifndef __MACOSX__
|
||||
case SDL_FINGERMOTION:
|
||||
_cursorState.x = (sint32)(e.tfinger.x * _width);
|
||||
_cursorState.y = (sint32)(e.tfinger.y * _height);
|
||||
_cursorState.x = (int32_t)(e.tfinger.x * _width);
|
||||
_cursorState.y = (int32_t)(e.tfinger.y * _height);
|
||||
break;
|
||||
case SDL_FINGERDOWN:
|
||||
{
|
||||
sint32 x = (sint32)(e.tfinger.x * _width);
|
||||
sint32 y = (sint32)(e.tfinger.y * _height);
|
||||
int32_t x = (int32_t)(e.tfinger.x * _width);
|
||||
int32_t y = (int32_t)(e.tfinger.y * _height);
|
||||
|
||||
_cursorState.touchIsDouble = (!_cursorState.touchIsDouble &&
|
||||
e.tfinger.timestamp - _cursorState.touchDownTimestamp < TOUCH_DOUBLE_TIMEOUT);
|
||||
|
@ -449,8 +449,8 @@ public:
|
|||
}
|
||||
case SDL_FINGERUP:
|
||||
{
|
||||
sint32 x = (sint32)(e.tfinger.x * _width);
|
||||
sint32 y = (sint32)(e.tfinger.y * _height);
|
||||
int32_t x = (int32_t)(e.tfinger.x * _width);
|
||||
int32_t y = (int32_t)(e.tfinger.y * _height);
|
||||
|
||||
if (_cursorState.touchIsDouble)
|
||||
{
|
||||
|
@ -481,8 +481,8 @@ public:
|
|||
_gestureRadius += e.mgesture.dDist;
|
||||
|
||||
// Zoom gesture
|
||||
constexpr sint32 tolerance = 128;
|
||||
sint32 gesturePixels = (sint32)(_gestureRadius * _width);
|
||||
constexpr int32_t tolerance = 128;
|
||||
int32_t gesturePixels = (int32_t)(_gestureRadius * _width);
|
||||
if (abs(gesturePixels) > tolerance)
|
||||
{
|
||||
_gestureRadius = 0;
|
||||
|
@ -504,7 +504,7 @@ public:
|
|||
_cursorState.any = _cursorState.left | _cursorState.middle | _cursorState.right;
|
||||
|
||||
// Updates the state of the keys
|
||||
sint32 numKeys = 256;
|
||||
int32_t numKeys = 256;
|
||||
_keysState = SDL_GetKeyboardState(&numKeys);
|
||||
}
|
||||
|
||||
|
@ -521,7 +521,7 @@ public:
|
|||
_scaleQuality = SCALE_QUALITY_NN;
|
||||
}
|
||||
|
||||
sint32 scaleQuality = _scaleQuality;
|
||||
int32_t scaleQuality = _scaleQuality;
|
||||
if (_scaleQuality == SCALE_QUALITY_SMOOTH_NN)
|
||||
{
|
||||
scaleQuality = SCALE_QUALITY_LINEAR;
|
||||
|
@ -529,7 +529,7 @@ public:
|
|||
snprintf(scaleQualityBuffer, sizeof(scaleQualityBuffer), "%u", scaleQuality);
|
||||
SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, scaleQualityBuffer);
|
||||
|
||||
sint32 width, height;
|
||||
int32_t width, height;
|
||||
SDL_GetWindowSize(_window, &width, &height);
|
||||
OnResize(width, height);
|
||||
}
|
||||
|
@ -539,9 +539,9 @@ public:
|
|||
SDL_SetHint(SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS, gConfigGeneral.minimize_fullscreen_focus_loss ? "1" : "0");
|
||||
|
||||
// Set window position to default display
|
||||
sint32 defaultDisplay = Math::Clamp(0, gConfigGeneral.default_display, 0xFFFF);
|
||||
sint32 x = SDL_WINDOWPOS_UNDEFINED_DISPLAY(defaultDisplay);
|
||||
sint32 y = SDL_WINDOWPOS_UNDEFINED_DISPLAY(defaultDisplay);
|
||||
int32_t defaultDisplay = Math::Clamp(0, gConfigGeneral.default_display, 0xFFFF);
|
||||
int32_t x = SDL_WINDOWPOS_UNDEFINED_DISPLAY(defaultDisplay);
|
||||
int32_t y = SDL_WINDOWPOS_UNDEFINED_DISPLAY(defaultDisplay);
|
||||
|
||||
CreateWindow(x, y);
|
||||
|
||||
|
@ -562,7 +562,7 @@ public:
|
|||
void RecreateWindow() override
|
||||
{
|
||||
// Use the position of the current window for the new window
|
||||
sint32 x, y;
|
||||
int32_t x, y;
|
||||
SDL_SetWindowFullscreen(_window, 0);
|
||||
SDL_GetWindowPosition(_window, &x, &y);
|
||||
|
||||
|
@ -608,16 +608,16 @@ public:
|
|||
}
|
||||
|
||||
private:
|
||||
void CreateWindow(sint32 x, sint32 y)
|
||||
void CreateWindow(int32_t x, int32_t y)
|
||||
{
|
||||
// Get saved window size
|
||||
sint32 width = gConfigGeneral.window_width;
|
||||
sint32 height = gConfigGeneral.window_height;
|
||||
int32_t width = gConfigGeneral.window_width;
|
||||
int32_t height = gConfigGeneral.window_height;
|
||||
if (width <= 0) width = 640;
|
||||
if (height <= 0) height = 480;
|
||||
|
||||
// Create window in window first rather than fullscreen so we have the display the window is on first
|
||||
uint32 flags = SDL_WINDOW_RESIZABLE;
|
||||
uint32_t flags = SDL_WINDOW_RESIZABLE;
|
||||
if (gConfigGeneral.drawing_engine == DRAWING_ENGINE_OPENGL)
|
||||
{
|
||||
flags |= SDL_WINDOW_OPENGL;
|
||||
|
@ -643,15 +643,15 @@ private:
|
|||
TriggerResize();
|
||||
}
|
||||
|
||||
void OnResize(sint32 width, sint32 height)
|
||||
void OnResize(int32_t width, int32_t height)
|
||||
{
|
||||
// Scale the native window size to the game's canvas size
|
||||
_width = (sint32)(width / gConfigGeneral.window_scale);
|
||||
_height = (sint32)(height / gConfigGeneral.window_scale);
|
||||
_width = (int32_t)(width / gConfigGeneral.window_scale);
|
||||
_height = (int32_t)(height / gConfigGeneral.window_scale);
|
||||
|
||||
drawing_engine_resize();
|
||||
|
||||
uint32 flags = SDL_GetWindowFlags(_window);
|
||||
uint32_t flags = SDL_GetWindowFlags(_window);
|
||||
if ((flags & SDL_WINDOW_MINIMIZED) == 0)
|
||||
{
|
||||
window_resize_gui(_width, _height);
|
||||
|
@ -661,7 +661,7 @@ private:
|
|||
gfx_invalidate_screen();
|
||||
|
||||
// Check if the window has been resized in windowed mode and update the config file accordingly
|
||||
sint32 nonWindowFlags =
|
||||
int32_t nonWindowFlags =
|
||||
#ifndef __MACOSX__
|
||||
SDL_WINDOW_MAXIMIZED |
|
||||
#endif
|
||||
|
@ -683,8 +683,8 @@ private:
|
|||
void UpdateFullscreenResolutions()
|
||||
{
|
||||
// Query number of display modes
|
||||
sint32 displayIndex = SDL_GetWindowDisplayIndex(_window);
|
||||
sint32 numDisplayModes = SDL_GetNumDisplayModes(displayIndex);
|
||||
int32_t displayIndex = SDL_GetWindowDisplayIndex(_window);
|
||||
int32_t numDisplayModes = SDL_GetNumDisplayModes(displayIndex);
|
||||
|
||||
// Get desktop aspect ratio
|
||||
SDL_DisplayMode mode;
|
||||
|
@ -693,7 +693,7 @@ private:
|
|||
// Get resolutions
|
||||
auto resolutions = std::vector<Resolution>();
|
||||
float desktopAspectRatio = (float)mode.w / mode.h;
|
||||
for (sint32 i = 0; i < numDisplayModes; i++)
|
||||
for (int32_t i = 0; i < numDisplayModes; i++)
|
||||
{
|
||||
SDL_GetDisplayMode(displayIndex, i, &mode);
|
||||
if (mode.w > 0 && mode.h > 0)
|
||||
|
@ -710,8 +710,8 @@ private:
|
|||
std::sort(resolutions.begin(), resolutions.end(),
|
||||
[](const Resolution &a, const Resolution &b) -> bool
|
||||
{
|
||||
sint32 areaA = a.Width * a.Height;
|
||||
sint32 areaB = b.Width * b.Height;
|
||||
int32_t areaA = a.Width * a.Height;
|
||||
int32_t areaB = b.Width * b.Height;
|
||||
return areaA < areaB;
|
||||
});
|
||||
|
||||
|
@ -733,11 +733,11 @@ private:
|
|||
_fsResolutions = resolutions;
|
||||
}
|
||||
|
||||
Resolution GetClosestResolution(sint32 inWidth, sint32 inHeight)
|
||||
Resolution GetClosestResolution(int32_t inWidth, int32_t inHeight)
|
||||
{
|
||||
Resolution result = { 640, 480 };
|
||||
sint32 closestAreaDiff = -1;
|
||||
sint32 destinationArea = inWidth * inHeight;
|
||||
int32_t closestAreaDiff = -1;
|
||||
int32_t destinationArea = inWidth * inHeight;
|
||||
for (const Resolution &resolution : _fsResolutions)
|
||||
{
|
||||
// Check if exact match
|
||||
|
@ -748,7 +748,7 @@ private:
|
|||
}
|
||||
|
||||
// Check if area is closer to best match
|
||||
sint32 areaDiff = std::abs((resolution.Width * resolution.Height) - destinationArea);
|
||||
int32_t areaDiff = std::abs((resolution.Width * resolution.Height) - destinationArea);
|
||||
if (closestAreaDiff == -1 || areaDiff < closestAreaDiff)
|
||||
{
|
||||
closestAreaDiff = areaDiff;
|
||||
|
@ -758,7 +758,7 @@ private:
|
|||
return result;
|
||||
}
|
||||
|
||||
uint32 GetWindowFlags()
|
||||
uint32_t GetWindowFlags()
|
||||
{
|
||||
return SDL_GetWindowFlags(_window);
|
||||
}
|
||||
|
@ -766,10 +766,10 @@ private:
|
|||
static void DrawRainWindow(
|
||||
IRainDrawer * rainDrawer,
|
||||
rct_window * original_w,
|
||||
sint16 left,
|
||||
sint16 right,
|
||||
sint16 top,
|
||||
sint16 bottom,
|
||||
int16_t left,
|
||||
int16_t right,
|
||||
int16_t top,
|
||||
int16_t bottom,
|
||||
DrawRainFunc drawFunc)
|
||||
{
|
||||
rct_window * w{};
|
||||
|
@ -781,10 +781,10 @@ private:
|
|||
auto vp = original_w->viewport;
|
||||
if (vp != nullptr)
|
||||
{
|
||||
left = std::max<sint16>(left, vp->x);
|
||||
right = std::min<sint16>(right, vp->x + vp->width);
|
||||
top = std::max<sint16>(top, vp->y);
|
||||
bottom = std::min<sint16>(bottom, vp->y + vp->height);
|
||||
left = std::max<int16_t>(left, vp->x);
|
||||
right = std::min<int16_t>(right, vp->x + vp->width);
|
||||
top = std::max<int16_t>(top, vp->y);
|
||||
bottom = std::min<int16_t>(bottom, vp->y + vp->height);
|
||||
if (left < right && top < bottom)
|
||||
{
|
||||
auto width = right - left;
|
||||
|
@ -818,7 +818,7 @@ private:
|
|||
return;
|
||||
}
|
||||
|
||||
sint16 w_right = RCT_WINDOW_RIGHT(w);
|
||||
int16_t w_right = RCT_WINDOW_RIGHT(w);
|
||||
if (right > w_right) {
|
||||
DrawRainWindow(rainDrawer, original_w, left, w_right, top, bottom, drawFunc);
|
||||
|
||||
|
@ -835,7 +835,7 @@ private:
|
|||
return;
|
||||
}
|
||||
|
||||
sint16 w_bottom = RCT_WINDOW_BOTTOM(w);
|
||||
int16_t w_bottom = RCT_WINDOW_BOTTOM(w);
|
||||
if (bottom > w_bottom)
|
||||
{
|
||||
DrawRainWindow(rainDrawer, original_w, left, right, top, w_bottom, drawFunc);
|
||||
|
|
|
@ -124,7 +124,7 @@ namespace OpenRCT2::Ui
|
|||
}
|
||||
|
||||
private:
|
||||
static sint32 Execute(const std::string &command, std::string * output = nullptr)
|
||||
static int32_t Execute(const std::string &command, std::string * output = nullptr)
|
||||
{
|
||||
log_verbose("executing \"%s\"...\n", command.c_str());
|
||||
FILE * fpipe = popen(command.c_str(), "r");
|
||||
|
|
|
@ -132,7 +132,7 @@ public:
|
|||
}
|
||||
}
|
||||
|
||||
rct_window * OpenView(uint8 view) override
|
||||
rct_window * OpenView(uint8_t view) override
|
||||
{
|
||||
switch (view)
|
||||
{
|
||||
|
@ -168,7 +168,7 @@ public:
|
|||
}
|
||||
}
|
||||
|
||||
rct_window * OpenDetails(uint8 type, sint32 id) override
|
||||
rct_window * OpenDetails(uint8_t type, int32_t id) override
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
|
@ -212,7 +212,7 @@ public:
|
|||
return window_guest_list_open_with_filter(intent->GetSIntExtra(INTENT_EXTRA_GUEST_LIST_FILTER), intent->GetSIntExtra(INTENT_EXTRA_RIDE_ID));
|
||||
case WC_LOADSAVE:
|
||||
{
|
||||
uint32 type = intent->GetUIntExtra(INTENT_EXTRA_LOADSAVE_TYPE);
|
||||
uint32_t type = intent->GetUIntExtra(INTENT_EXTRA_LOADSAVE_TYPE);
|
||||
std::string defaultName = intent->GetStringExtra(INTENT_EXTRA_PATH);
|
||||
loadsave_callback callback = (loadsave_callback) intent->GetPointerExtra(INTENT_EXTRA_CALLBACK);
|
||||
rct_window *w = window_loadsave_open(type, defaultName.c_str());
|
||||
|
@ -363,7 +363,7 @@ public:
|
|||
case INTENT_ACTION_INVALIDATE_VEHICLE_WINDOW:
|
||||
{
|
||||
rct_vehicle * vehicle = static_cast<rct_vehicle *>(intent.GetPointerExtra(INTENT_EXTRA_VEHICLE));
|
||||
sint32 viewVehicleIndex;
|
||||
int32_t viewVehicleIndex;
|
||||
Ride * ride;
|
||||
rct_window * w;
|
||||
|
||||
|
@ -418,7 +418,7 @@ public:
|
|||
|
||||
case INTENT_ACTION_UPDATE_BANNER:
|
||||
{
|
||||
uint8 bannerIndex = static_cast<uint8>(intent.GetUIntExtra(INTENT_EXTRA_BANNER_INDEX));
|
||||
uint8_t bannerIndex = static_cast<uint8_t>(intent.GetUIntExtra(INTENT_EXTRA_BANNER_INDEX));
|
||||
|
||||
rct_window * w = window_find_by_number(WC_BANNER, bannerIndex);
|
||||
if (w != nullptr)
|
||||
|
@ -462,14 +462,14 @@ public:
|
|||
input_handle_keyboard(isTitle);
|
||||
}
|
||||
|
||||
std::string GetKeyboardShortcutString(sint32 shortcut) override
|
||||
std::string GetKeyboardShortcutString(int32_t shortcut) override
|
||||
{
|
||||
utf8 buffer[256];
|
||||
keyboard_shortcuts_format_string(buffer, sizeof(buffer), shortcut);
|
||||
return std::string(buffer);
|
||||
}
|
||||
|
||||
void SetMainView(sint32 x, sint32 y, sint32 zoom, sint32 rotation) override
|
||||
void SetMainView(int32_t x, int32_t y, int32_t zoom, int32_t rotation) override
|
||||
{
|
||||
auto mainWindow = window_get_main();
|
||||
if (mainWindow != nullptr)
|
||||
|
|
|
@ -25,17 +25,17 @@ namespace OpenRCT2::Audio
|
|||
ISDLAudioSource * _source = nullptr;
|
||||
SpeexResamplerState * _resampler = nullptr;
|
||||
|
||||
sint32 _group = MIXER_GROUP_SOUND;
|
||||
int32_t _group = MIXER_GROUP_SOUND;
|
||||
double _rate = 0;
|
||||
uint64 _offset = 0;
|
||||
sint32 _loop = 0;
|
||||
uint64_t _offset = 0;
|
||||
int32_t _loop = 0;
|
||||
|
||||
sint32 _volume = 1;
|
||||
int32_t _volume = 1;
|
||||
float _volume_l = 0.f;
|
||||
float _volume_r = 0.f;
|
||||
float _oldvolume_l = 0.f;
|
||||
float _oldvolume_r = 0.f;
|
||||
sint32 _oldvolume = 0;
|
||||
int32_t _oldvolume = 0;
|
||||
float _pan = 0;
|
||||
|
||||
bool _stopping = false;
|
||||
|
@ -79,12 +79,12 @@ namespace OpenRCT2::Audio
|
|||
_resampler = value;
|
||||
}
|
||||
|
||||
sint32 GetGroup() const override
|
||||
int32_t GetGroup() const override
|
||||
{
|
||||
return _group;
|
||||
}
|
||||
|
||||
void SetGroup(sint32 group) override
|
||||
void SetGroup(int32_t group) override
|
||||
{
|
||||
_group = group;
|
||||
}
|
||||
|
@ -99,34 +99,34 @@ namespace OpenRCT2::Audio
|
|||
_rate = std::max(0.001, rate);
|
||||
}
|
||||
|
||||
uint64 GetOffset() const override
|
||||
uint64_t GetOffset() const override
|
||||
{
|
||||
return _offset;
|
||||
}
|
||||
|
||||
bool SetOffset(uint64 offset) override
|
||||
bool SetOffset(uint64_t offset) override
|
||||
{
|
||||
if (_source != nullptr && offset < _source->GetLength())
|
||||
{
|
||||
AudioFormat format = _source->GetFormat();
|
||||
sint32 samplesize = format.channels * format.BytesPerSample();
|
||||
int32_t samplesize = format.channels * format.BytesPerSample();
|
||||
_offset = (offset / samplesize) * samplesize;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
virtual sint32 GetLoop() const override
|
||||
virtual int32_t GetLoop() const override
|
||||
{
|
||||
return _loop;
|
||||
}
|
||||
|
||||
virtual void SetLoop(sint32 value) override
|
||||
virtual void SetLoop(int32_t value) override
|
||||
{
|
||||
_loop = value;
|
||||
}
|
||||
|
||||
sint32 GetVolume() const override
|
||||
int32_t GetVolume() const override
|
||||
{
|
||||
return _volume;
|
||||
}
|
||||
|
@ -151,12 +151,12 @@ namespace OpenRCT2::Audio
|
|||
return _oldvolume_r;
|
||||
}
|
||||
|
||||
sint32 GetOldVolume() const override
|
||||
int32_t GetOldVolume() const override
|
||||
{
|
||||
return _oldvolume;
|
||||
}
|
||||
|
||||
void SetVolume(sint32 volume) override
|
||||
void SetVolume(int32_t volume) override
|
||||
{
|
||||
_volume = Math::Clamp(0, volume, MIXER_VOLUME_MAX);
|
||||
}
|
||||
|
@ -223,7 +223,7 @@ namespace OpenRCT2::Audio
|
|||
return !_done;
|
||||
}
|
||||
|
||||
void Play(IAudioSource * source, sint32 loop) override
|
||||
void Play(IAudioSource * source, int32_t loop) override
|
||||
{
|
||||
_source = static_cast<ISDLAudioSource *>(source);
|
||||
_loop = loop;
|
||||
|
|
|
@ -45,8 +45,8 @@ namespace OpenRCT2::Audio
|
|||
std::vector<std::string> GetOutputDevices() override
|
||||
{
|
||||
std::vector<std::string> devices;
|
||||
sint32 numDevices = SDL_GetNumAudioDevices(SDL_FALSE);
|
||||
for (sint32 i = 0; i < numDevices; i++)
|
||||
int32_t numDevices = SDL_GetNumAudioDevices(SDL_FALSE);
|
||||
for (int32_t i = 0; i < numDevices; i++)
|
||||
{
|
||||
std::string deviceName = String::ToStd(SDL_GetAudioDeviceName(i, SDL_FALSE));
|
||||
devices.push_back(deviceName);
|
||||
|
@ -71,9 +71,9 @@ namespace OpenRCT2::Audio
|
|||
|
||||
void StartTitleMusic() override { }
|
||||
|
||||
IAudioChannel * PlaySound(sint32 soundId, sint32 volume, sint32 pan) override { return nullptr; }
|
||||
IAudioChannel * PlaySoundAtLocation(sint32 soundId, sint16 x, sint16 y, sint16 z) override { return nullptr; }
|
||||
IAudioChannel * PlaySoundPanned(sint32 soundId, sint32 pan, sint16 x, sint16 y, sint16 z) override { return nullptr; }
|
||||
IAudioChannel * PlaySound(int32_t soundId, int32_t volume, int32_t pan) override { return nullptr; }
|
||||
IAudioChannel * PlaySoundAtLocation(int32_t soundId, int16_t x, int16_t y, int16_t z) override { return nullptr; }
|
||||
IAudioChannel * PlaySoundPanned(int32_t soundId, int32_t pan, int16_t x, int16_t y, int16_t z) override { return nullptr; }
|
||||
|
||||
void ToggleAllSounds() override { }
|
||||
void PauseSounds() override { }
|
||||
|
|
|
@ -26,24 +26,24 @@ namespace OpenRCT2::Audio
|
|||
#pragma pack(push, 1)
|
||||
struct WaveFormat
|
||||
{
|
||||
uint16 encoding;
|
||||
uint16 channels;
|
||||
uint32 frequency;
|
||||
uint32 byterate;
|
||||
uint16 blockalign;
|
||||
uint16 bitspersample;
|
||||
uint16_t encoding;
|
||||
uint16_t channels;
|
||||
uint32_t frequency;
|
||||
uint32_t byterate;
|
||||
uint16_t blockalign;
|
||||
uint16_t bitspersample;
|
||||
};
|
||||
assert_struct_size(WaveFormat, 16);
|
||||
|
||||
struct WaveFormatEx
|
||||
{
|
||||
uint16 encoding;
|
||||
uint16 channels;
|
||||
uint32 frequency;
|
||||
uint32 byterate;
|
||||
uint16 blockalign;
|
||||
uint16 bitspersample;
|
||||
uint16 extrasize;
|
||||
uint16_t encoding;
|
||||
uint16_t channels;
|
||||
uint32_t frequency;
|
||||
uint32_t byterate;
|
||||
uint16_t blockalign;
|
||||
uint16_t bitspersample;
|
||||
uint16_t extrasize;
|
||||
};
|
||||
assert_struct_size(WaveFormatEx, 18);
|
||||
#pragma pack(pop)
|
||||
|
|
|
@ -20,16 +20,16 @@ namespace OpenRCT2::Audio
|
|||
*/
|
||||
struct AudioFormat
|
||||
{
|
||||
sint32 freq;
|
||||
int32_t freq;
|
||||
SDL_AudioFormat format;
|
||||
sint32 channels;
|
||||
int32_t channels;
|
||||
|
||||
sint32 BytesPerSample() const
|
||||
int32_t BytesPerSample() const
|
||||
{
|
||||
return (SDL_AUDIO_BITSIZE(format)) / 8;
|
||||
}
|
||||
|
||||
sint32 GetByteRate() const
|
||||
int32_t GetByteRate() const
|
||||
{
|
||||
return BytesPerSample() * channels;
|
||||
}
|
||||
|
|
|
@ -42,15 +42,15 @@ namespace OpenRCT2::Audio
|
|||
float _volume = 1.0f;
|
||||
float _adjustSoundVolume = 0.0f;
|
||||
float _adjustMusicVolume = 0.0f;
|
||||
uint8 _settingSoundVolume = 0xFF;
|
||||
uint8 _settingMusicVolume = 0xFF;
|
||||
uint8_t _settingSoundVolume = 0xFF;
|
||||
uint8_t _settingMusicVolume = 0xFF;
|
||||
|
||||
IAudioSource * _css1Sources[SOUND_MAXID] = { nullptr };
|
||||
IAudioSource * _musicSources[PATH_ID_END] = { nullptr };
|
||||
|
||||
std::vector<uint8> _channelBuffer;
|
||||
std::vector<uint8> _convertBuffer;
|
||||
std::vector<uint8> _effectBuffer;
|
||||
std::vector<uint8_t> _channelBuffer;
|
||||
std::vector<uint8_t> _convertBuffer;
|
||||
std::vector<uint8_t> _effectBuffer;
|
||||
|
||||
public:
|
||||
AudioMixerImpl()
|
||||
|
@ -73,7 +73,7 @@ namespace OpenRCT2::Audio
|
|||
want.format = AUDIO_S16SYS;
|
||||
want.channels = 2;
|
||||
want.samples = 2048;
|
||||
want.callback = [](void * arg, uint8 * dst, sint32 length) -> void
|
||||
want.callback = [](void * arg, uint8_t * dst, int32_t length) -> void
|
||||
{
|
||||
auto mixer = static_cast<AudioMixerImpl *>(arg);
|
||||
mixer->GetNextAudioChunk(dst, (size_t)length);
|
||||
|
@ -139,7 +139,7 @@ namespace OpenRCT2::Audio
|
|||
SDL_UnlockAudioDevice(_deviceId);
|
||||
}
|
||||
|
||||
IAudioChannel * Play(IAudioSource * source, sint32 loop, bool deleteondone, bool deletesourceondone) override
|
||||
IAudioChannel * Play(IAudioSource * source, int32_t loop, bool deleteondone, bool deletesourceondone) override
|
||||
{
|
||||
Lock();
|
||||
ISDLAudioChannel * channel = AudioChannel::Create();
|
||||
|
@ -169,7 +169,7 @@ namespace OpenRCT2::Audio
|
|||
IAudioSource * source = _musicSources[pathId];
|
||||
if (source == nullptr)
|
||||
{
|
||||
const utf8 * path = context_get_path_legacy((sint32)pathId);
|
||||
const utf8 * path = context_get_path_legacy((int32_t)pathId);
|
||||
source = AudioSource::CreateMemoryFromWAV(path, &_format);
|
||||
if (source == nullptr)
|
||||
{
|
||||
|
@ -187,12 +187,12 @@ namespace OpenRCT2::Audio
|
|||
_volume = volume;
|
||||
}
|
||||
|
||||
IAudioSource * GetSoundSource(sint32 id) override
|
||||
IAudioSource * GetSoundSource(int32_t id) override
|
||||
{
|
||||
return _css1Sources[id];
|
||||
}
|
||||
|
||||
IAudioSource * GetMusicSource(sint32 id) override
|
||||
IAudioSource * GetMusicSource(int32_t id) override
|
||||
{
|
||||
return _musicSources[id];
|
||||
}
|
||||
|
@ -212,7 +212,7 @@ namespace OpenRCT2::Audio
|
|||
}
|
||||
}
|
||||
|
||||
void GetNextAudioChunk(uint8 * dst, size_t length)
|
||||
void GetNextAudioChunk(uint8_t * dst, size_t length)
|
||||
{
|
||||
UpdateAdjustedSound();
|
||||
|
||||
|
@ -224,7 +224,7 @@ namespace OpenRCT2::Audio
|
|||
while (it != _channels.end())
|
||||
{
|
||||
auto channel = *it;
|
||||
sint32 group = channel->GetGroup();
|
||||
int32_t group = channel->GetGroup();
|
||||
if (group != MIXER_GROUP_SOUND || gConfigSound.sound_enabled)
|
||||
{
|
||||
MixChannel(channel, dst, length);
|
||||
|
@ -256,10 +256,10 @@ namespace OpenRCT2::Audio
|
|||
}
|
||||
}
|
||||
|
||||
void MixChannel(ISDLAudioChannel * channel, uint8 * data, size_t length)
|
||||
void MixChannel(ISDLAudioChannel * channel, uint8_t * data, size_t length)
|
||||
{
|
||||
sint32 byteRate = _format.GetByteRate();
|
||||
sint32 numSamples = (sint32)(length / byteRate);
|
||||
int32_t byteRate = _format.GetByteRate();
|
||||
int32_t numSamples = (int32_t)(length / byteRate);
|
||||
double rate = 1;
|
||||
if (_format.format == AUDIO_S16SYS)
|
||||
{
|
||||
|
@ -281,7 +281,7 @@ namespace OpenRCT2::Audio
|
|||
}
|
||||
|
||||
// Read raw PCM from channel
|
||||
sint32 readSamples = (sint32)(numSamples * rate);
|
||||
int32_t readSamples = (int32_t)(numSamples * rate);
|
||||
size_t readLength = (size_t)(readSamples / cvt.len_ratio) * byteRate;
|
||||
_channelBuffer.resize(readLength);
|
||||
size_t bytesRead = channel->Read(_channelBuffer.data(), readLength);
|
||||
|
@ -310,25 +310,25 @@ namespace OpenRCT2::Audio
|
|||
// Apply effects
|
||||
if (rate != 1)
|
||||
{
|
||||
sint32 inRate = (sint32)(bufferLen / byteRate);
|
||||
sint32 outRate = numSamples;
|
||||
int32_t inRate = (int32_t)(bufferLen / byteRate);
|
||||
int32_t outRate = numSamples;
|
||||
if (bytesRead != readLength)
|
||||
{
|
||||
inRate = _format.freq;
|
||||
outRate = _format.freq * (1 / rate);
|
||||
}
|
||||
_effectBuffer.resize(length);
|
||||
bufferLen = ApplyResample(channel, buffer, (sint32)(bufferLen / byteRate), numSamples, inRate, outRate);
|
||||
bufferLen = ApplyResample(channel, buffer, (int32_t)(bufferLen / byteRate), numSamples, inRate, outRate);
|
||||
buffer = _effectBuffer.data();
|
||||
}
|
||||
|
||||
// Apply panning and volume
|
||||
ApplyPan(channel, buffer, bufferLen, byteRate);
|
||||
sint32 mixVolume = ApplyVolume(channel, buffer, bufferLen);
|
||||
int32_t mixVolume = ApplyVolume(channel, buffer, bufferLen);
|
||||
|
||||
// Finally mix on to destination buffer
|
||||
size_t dstLength = std::min(length, bufferLen);
|
||||
SDL_MixAudioFormat(data, (const uint8 *)buffer, _format.format, (uint32)dstLength, mixVolume);
|
||||
SDL_MixAudioFormat(data, (const uint8_t *)buffer, _format.format, (uint32_t)dstLength, mixVolume);
|
||||
|
||||
channel->UpdateOldVolume();
|
||||
}
|
||||
|
@ -337,9 +337,9 @@ namespace OpenRCT2::Audio
|
|||
* Resample the given buffer into _effectBuffer.
|
||||
* Assumes that srcBuffer is the same format as _format.
|
||||
*/
|
||||
size_t ApplyResample(ISDLAudioChannel * channel, const void * srcBuffer, sint32 srcSamples, sint32 dstSamples, sint32 inRate, sint32 outRate)
|
||||
size_t ApplyResample(ISDLAudioChannel * channel, const void * srcBuffer, int32_t srcSamples, int32_t dstSamples, int32_t inRate, int32_t outRate)
|
||||
{
|
||||
sint32 byteRate = _format.GetByteRate();
|
||||
int32_t byteRate = _format.GetByteRate();
|
||||
|
||||
// Create resampler
|
||||
SpeexResamplerState * resampler = channel->GetResampler();
|
||||
|
@ -350,8 +350,8 @@ namespace OpenRCT2::Audio
|
|||
}
|
||||
speex_resampler_set_rate(resampler, inRate, outRate);
|
||||
|
||||
uint32 inLen = srcSamples;
|
||||
uint32 outLen = dstSamples;
|
||||
uint32_t inLen = srcSamples;
|
||||
uint32_t outLen = dstSamples;
|
||||
speex_resampler_process_interleaved_int(
|
||||
resampler,
|
||||
(const spx_int16_t *)srcBuffer,
|
||||
|
@ -368,16 +368,16 @@ namespace OpenRCT2::Audio
|
|||
{
|
||||
switch (_format.format) {
|
||||
case AUDIO_S16SYS:
|
||||
EffectPanS16(channel, (sint16 *)buffer, (sint32)(len / sampleSize));
|
||||
EffectPanS16(channel, (int16_t *)buffer, (int32_t)(len / sampleSize));
|
||||
break;
|
||||
case AUDIO_U8:
|
||||
EffectPanU8(channel, (uint8 *)buffer, (sint32)(len / sampleSize));
|
||||
EffectPanU8(channel, (uint8_t *)buffer, (int32_t)(len / sampleSize));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sint32 ApplyVolume(const IAudioChannel * channel, void * buffer, size_t len)
|
||||
int32_t ApplyVolume(const IAudioChannel * channel, void * buffer, size_t len)
|
||||
{
|
||||
float volumeAdjust = _volume;
|
||||
volumeAdjust *= (gConfigSound.master_volume / 100.0f);
|
||||
|
@ -396,34 +396,34 @@ namespace OpenRCT2::Audio
|
|||
break;
|
||||
}
|
||||
|
||||
sint32 startVolume = (sint32)(channel->GetOldVolume() * volumeAdjust);
|
||||
sint32 endVolume = (sint32)(channel->GetVolume() * volumeAdjust);
|
||||
int32_t startVolume = (int32_t)(channel->GetOldVolume() * volumeAdjust);
|
||||
int32_t endVolume = (int32_t)(channel->GetVolume() * volumeAdjust);
|
||||
if (channel->IsStopping())
|
||||
{
|
||||
endVolume = 0;
|
||||
}
|
||||
|
||||
sint32 mixVolume = (sint32)(channel->GetVolume() * volumeAdjust);
|
||||
int32_t mixVolume = (int32_t)(channel->GetVolume() * volumeAdjust);
|
||||
if (startVolume != endVolume)
|
||||
{
|
||||
// Set to max since we are adjusting the volume ourselves
|
||||
mixVolume = MIXER_VOLUME_MAX;
|
||||
|
||||
// Fade between volume levels to smooth out sound and minimize clicks from sudden volume changes
|
||||
sint32 fadeLength = (sint32)len / _format.BytesPerSample();
|
||||
int32_t fadeLength = (int32_t)len / _format.BytesPerSample();
|
||||
switch (_format.format) {
|
||||
case AUDIO_S16SYS:
|
||||
EffectFadeS16((sint16 *)buffer, fadeLength, startVolume, endVolume);
|
||||
EffectFadeS16((int16_t *)buffer, fadeLength, startVolume, endVolume);
|
||||
break;
|
||||
case AUDIO_U8:
|
||||
EffectFadeU8((uint8 *)buffer, fadeLength, startVolume, endVolume);
|
||||
EffectFadeU8((uint8_t *)buffer, fadeLength, startVolume, endVolume);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return mixVolume;
|
||||
}
|
||||
|
||||
static void EffectPanS16(const IAudioChannel * channel, sint16 * data, sint32 length)
|
||||
static void EffectPanS16(const IAudioChannel * channel, int16_t * data, int32_t length)
|
||||
{
|
||||
const float dt = 1.0f / (length * 2);
|
||||
float volumeL = channel->GetOldVolumeL();
|
||||
|
@ -431,53 +431,53 @@ namespace OpenRCT2::Audio
|
|||
const float d_left = dt * (channel->GetVolumeL() - channel->GetOldVolumeL());
|
||||
const float d_right = dt * (channel->GetVolumeR() - channel->GetOldVolumeR());
|
||||
|
||||
for (sint32 i = 0; i < length * 2; i += 2)
|
||||
for (int32_t i = 0; i < length * 2; i += 2)
|
||||
{
|
||||
data[i] = (sint16)(data[i] * volumeL);
|
||||
data[i + 1] = (sint16)(data[i + 1] * volumeR);
|
||||
data[i] = (int16_t)(data[i] * volumeL);
|
||||
data[i + 1] = (int16_t)(data[i + 1] * volumeR);
|
||||
volumeL += d_left;
|
||||
volumeR += d_right;
|
||||
}
|
||||
}
|
||||
|
||||
static void EffectPanU8(const IAudioChannel * channel, uint8 * data, sint32 length)
|
||||
static void EffectPanU8(const IAudioChannel * channel, uint8_t * data, int32_t length)
|
||||
{
|
||||
float volumeL = channel->GetVolumeL();
|
||||
float volumeR = channel->GetVolumeR();
|
||||
float oldVolumeL = channel->GetOldVolumeL();
|
||||
float oldVolumeR = channel->GetOldVolumeR();
|
||||
|
||||
for (sint32 i = 0; i < length * 2; i += 2)
|
||||
for (int32_t i = 0; i < length * 2; i += 2)
|
||||
{
|
||||
float t = (float)i / (length * 2);
|
||||
data[i] = (uint8)(data[i] * ((1.0 - t) * oldVolumeL + t * volumeL));
|
||||
data[i + 1] = (uint8)(data[i + 1] * ((1.0 - t) * oldVolumeR + t * volumeR));
|
||||
data[i] = (uint8_t)(data[i] * ((1.0 - t) * oldVolumeL + t * volumeL));
|
||||
data[i + 1] = (uint8_t)(data[i + 1] * ((1.0 - t) * oldVolumeR + t * volumeR));
|
||||
}
|
||||
}
|
||||
|
||||
static void EffectFadeS16(sint16 * data, sint32 length, sint32 startvolume, sint32 endvolume)
|
||||
static void EffectFadeS16(int16_t * data, int32_t length, int32_t startvolume, int32_t endvolume)
|
||||
{
|
||||
static_assert(SDL_MIX_MAXVOLUME == MIXER_VOLUME_MAX, "Max volume differs between OpenRCT2 and SDL2");
|
||||
|
||||
float startvolume_f = (float)startvolume / SDL_MIX_MAXVOLUME;
|
||||
float endvolume_f = (float)endvolume / SDL_MIX_MAXVOLUME;
|
||||
for (sint32 i = 0; i < length; i++)
|
||||
for (int32_t i = 0; i < length; i++)
|
||||
{
|
||||
float t = (float)i / length;
|
||||
data[i] = (sint16)(data[i] * ((1 - t) * startvolume_f + t * endvolume_f));
|
||||
data[i] = (int16_t)(data[i] * ((1 - t) * startvolume_f + t * endvolume_f));
|
||||
}
|
||||
}
|
||||
|
||||
static void EffectFadeU8(uint8* data, sint32 length, sint32 startvolume, sint32 endvolume)
|
||||
static void EffectFadeU8(uint8_t* data, int32_t length, int32_t startvolume, int32_t endvolume)
|
||||
{
|
||||
static_assert(SDL_MIX_MAXVOLUME == MIXER_VOLUME_MAX, "Max volume differs between OpenRCT2 and SDL2");
|
||||
|
||||
float startvolume_f = (float)startvolume / SDL_MIX_MAXVOLUME;
|
||||
float endvolume_f = (float)endvolume / SDL_MIX_MAXVOLUME;
|
||||
for (sint32 i = 0; i < length; i++)
|
||||
for (int32_t i = 0; i < length; i++)
|
||||
{
|
||||
float t = (float)i / length;
|
||||
data[i] = (uint8)(data[i] * ((1 - t) * startvolume_f + t * endvolume_f));
|
||||
data[i] = (uint8_t)(data[i] * ((1 - t) * startvolume_f + t * endvolume_f));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -489,10 +489,10 @@ namespace OpenRCT2::Audio
|
|||
{
|
||||
size_t reqConvertBufferCapacity = len * cvt->len_mult;
|
||||
_convertBuffer.resize(reqConvertBufferCapacity);
|
||||
std::copy_n((const uint8 *)src, len, _convertBuffer.data());
|
||||
std::copy_n((const uint8_t *)src, len, _convertBuffer.data());
|
||||
|
||||
cvt->len = (sint32)len;
|
||||
cvt->buf = (uint8 *)_convertBuffer.data();
|
||||
cvt->len = (int32_t)len;
|
||||
cvt->buf = (uint8_t *)_convertBuffer.data();
|
||||
if (SDL_ConvertAudio(cvt) >= 0)
|
||||
{
|
||||
result = true;
|
||||
|
|
|
@ -25,8 +25,8 @@ namespace OpenRCT2::Audio
|
|||
private:
|
||||
AudioFormat _format = {};
|
||||
SDL_RWops * _rw = nullptr;
|
||||
uint64 _dataBegin = 0;
|
||||
uint64 _dataLength = 0;
|
||||
uint64_t _dataBegin = 0;
|
||||
uint64_t _dataLength = 0;
|
||||
|
||||
public:
|
||||
~FileAudioSource()
|
||||
|
@ -34,7 +34,7 @@ namespace OpenRCT2::Audio
|
|||
Unload();
|
||||
}
|
||||
|
||||
uint64 GetLength() const override
|
||||
uint64_t GetLength() const override
|
||||
{
|
||||
return _dataLength;
|
||||
}
|
||||
|
@ -44,17 +44,17 @@ namespace OpenRCT2::Audio
|
|||
return _format;
|
||||
}
|
||||
|
||||
size_t Read(void * dst, uint64 offset, size_t len) override
|
||||
size_t Read(void * dst, uint64_t offset, size_t len) override
|
||||
{
|
||||
size_t bytesRead = 0;
|
||||
sint64 currentPosition = SDL_RWtell(_rw);
|
||||
int64_t currentPosition = SDL_RWtell(_rw);
|
||||
if (currentPosition != -1)
|
||||
{
|
||||
size_t bytesToRead = (size_t)std::min<uint64>(len, _dataLength - offset);
|
||||
sint64 dataOffset = _dataBegin + offset;
|
||||
size_t bytesToRead = (size_t)std::min<uint64_t>(len, _dataLength - offset);
|
||||
int64_t dataOffset = _dataBegin + offset;
|
||||
if (currentPosition != dataOffset)
|
||||
{
|
||||
sint64 newPosition = SDL_RWseek(_rw, dataOffset, SEEK_SET);
|
||||
int64_t newPosition = SDL_RWseek(_rw, dataOffset, SEEK_SET);
|
||||
if (newPosition == -1)
|
||||
{
|
||||
return 0;
|
||||
|
@ -67,11 +67,11 @@ namespace OpenRCT2::Audio
|
|||
|
||||
bool LoadWAV(SDL_RWops * rw)
|
||||
{
|
||||
const uint32 DATA = 0x61746164;
|
||||
const uint32 FMT = 0x20746D66;
|
||||
const uint32 RIFF = 0x46464952;
|
||||
const uint32 WAVE = 0x45564157;
|
||||
const uint16 pcmformat = 0x0001;
|
||||
const uint32_t DATA = 0x61746164;
|
||||
const uint32_t FMT = 0x20746D66;
|
||||
const uint32_t RIFF = 0x46464952;
|
||||
const uint32_t WAVE = 0x45564157;
|
||||
const uint16_t pcmformat = 0x0001;
|
||||
|
||||
Unload();
|
||||
|
||||
|
@ -81,7 +81,7 @@ namespace OpenRCT2::Audio
|
|||
}
|
||||
_rw = rw;
|
||||
|
||||
uint32 chunkId = SDL_ReadLE32(rw);
|
||||
uint32_t chunkId = SDL_ReadLE32(rw);
|
||||
if (chunkId != RIFF)
|
||||
{
|
||||
log_verbose("Not a WAV file");
|
||||
|
@ -90,21 +90,21 @@ namespace OpenRCT2::Audio
|
|||
|
||||
// Read and discard chunk size
|
||||
SDL_ReadLE32(rw);
|
||||
uint32 chunkFormat = SDL_ReadLE32(rw);
|
||||
uint32_t chunkFormat = SDL_ReadLE32(rw);
|
||||
if (chunkFormat != WAVE)
|
||||
{
|
||||
log_verbose("Not in WAVE format");
|
||||
return false;
|
||||
}
|
||||
|
||||
uint32 fmtChunkSize = FindChunk(rw, FMT);
|
||||
uint32_t fmtChunkSize = FindChunk(rw, FMT);
|
||||
if (!fmtChunkSize)
|
||||
{
|
||||
log_verbose("Could not find FMT chunk");
|
||||
return false;
|
||||
}
|
||||
|
||||
uint64 chunkStart = SDL_RWtell(rw);
|
||||
uint64_t chunkStart = SDL_RWtell(rw);
|
||||
|
||||
WaveFormat waveFormat;
|
||||
SDL_RWread(rw, &waveFormat, sizeof(waveFormat), 1);
|
||||
|
@ -128,7 +128,7 @@ namespace OpenRCT2::Audio
|
|||
}
|
||||
_format.channels = waveFormat.channels;
|
||||
|
||||
uint32 dataChunkSize = FindChunk(rw, DATA);
|
||||
uint32_t dataChunkSize = FindChunk(rw, DATA);
|
||||
if (dataChunkSize == 0)
|
||||
{
|
||||
log_verbose("Could not find DATA chunk");
|
||||
|
@ -141,18 +141,18 @@ namespace OpenRCT2::Audio
|
|||
}
|
||||
|
||||
private:
|
||||
uint32 FindChunk(SDL_RWops * rw, uint32 wantedId)
|
||||
uint32_t FindChunk(SDL_RWops * rw, uint32_t wantedId)
|
||||
{
|
||||
uint32 subchunkId = SDL_ReadLE32(rw);
|
||||
uint32 subchunkSize = SDL_ReadLE32(rw);
|
||||
uint32_t subchunkId = SDL_ReadLE32(rw);
|
||||
uint32_t subchunkSize = SDL_ReadLE32(rw);
|
||||
if (subchunkId == wantedId)
|
||||
{
|
||||
return subchunkSize;
|
||||
}
|
||||
const uint32 FACT = 0x74636166;
|
||||
const uint32 LIST = 0x5453494c;
|
||||
const uint32 BEXT = 0x74786562;
|
||||
const uint32 JUNK = 0x4B4E554A;
|
||||
const uint32_t FACT = 0x74636166;
|
||||
const uint32_t LIST = 0x5453494c;
|
||||
const uint32_t BEXT = 0x74786562;
|
||||
const uint32_t JUNK = 0x4B4E554A;
|
||||
while (subchunkId == FACT || subchunkId == LIST || subchunkId == BEXT || subchunkId == JUNK)
|
||||
{
|
||||
SDL_RWseek(rw, subchunkSize, RW_SEEK_CUR);
|
||||
|
|
|
@ -27,11 +27,11 @@ namespace OpenRCT2::Audio
|
|||
{
|
||||
private:
|
||||
AudioFormat _format = {};
|
||||
std::vector<uint8> _data;
|
||||
uint8 * _dataSDL = nullptr;
|
||||
std::vector<uint8_t> _data;
|
||||
uint8_t * _dataSDL = nullptr;
|
||||
size_t _length = 0;
|
||||
|
||||
const uint8 * GetData()
|
||||
const uint8_t * GetData()
|
||||
{
|
||||
return _dataSDL != nullptr ? _dataSDL : _data.data();
|
||||
}
|
||||
|
@ -42,7 +42,7 @@ namespace OpenRCT2::Audio
|
|||
Unload();
|
||||
}
|
||||
|
||||
uint64 GetLength() const override
|
||||
uint64_t GetLength() const override
|
||||
{
|
||||
return _length;
|
||||
}
|
||||
|
@ -52,17 +52,17 @@ namespace OpenRCT2::Audio
|
|||
return _format;
|
||||
}
|
||||
|
||||
size_t Read(void * dst, uint64 offset, size_t len) override
|
||||
size_t Read(void * dst, uint64_t offset, size_t len) override
|
||||
{
|
||||
size_t bytesToRead = 0;
|
||||
if (offset < _length)
|
||||
{
|
||||
bytesToRead = (size_t)std::min<uint64>(len, _length - offset);
|
||||
bytesToRead = (size_t)std::min<uint64_t>(len, _length - offset);
|
||||
|
||||
auto src = GetData();
|
||||
if (src != nullptr)
|
||||
{
|
||||
std::copy_n(src + offset, bytesToRead, (uint8 *)dst);
|
||||
std::copy_n(src + offset, bytesToRead, (uint8_t *)dst);
|
||||
}
|
||||
}
|
||||
return bytesToRead;
|
||||
|
@ -79,7 +79,7 @@ namespace OpenRCT2::Audio
|
|||
if (rw != nullptr)
|
||||
{
|
||||
SDL_AudioSpec audiospec = {};
|
||||
uint32 audioLen;
|
||||
uint32_t audioLen;
|
||||
SDL_AudioSpec * spec = SDL_LoadWAV_RW(rw, false, &audiospec, &_dataSDL, &audioLen);
|
||||
if (spec != nullptr)
|
||||
{
|
||||
|
@ -112,17 +112,17 @@ namespace OpenRCT2::Audio
|
|||
SDL_RWops * rw = SDL_RWFromFile(path, "rb");
|
||||
if (rw != nullptr)
|
||||
{
|
||||
uint32 numSounds;
|
||||
uint32_t numSounds;
|
||||
SDL_RWread(rw, &numSounds, sizeof(numSounds), 1);
|
||||
if (index < numSounds)
|
||||
{
|
||||
SDL_RWseek(rw, index * 4, RW_SEEK_CUR);
|
||||
|
||||
uint32 pcmOffset;
|
||||
uint32_t pcmOffset;
|
||||
SDL_RWread(rw, &pcmOffset, sizeof(pcmOffset), 1);
|
||||
SDL_RWseek(rw, pcmOffset, RW_SEEK_SET);
|
||||
|
||||
uint32 pcmSize;
|
||||
uint32_t pcmSize;
|
||||
SDL_RWread(rw, &pcmSize, sizeof(pcmSize), 1);
|
||||
_length = pcmSize;
|
||||
|
||||
|
@ -160,9 +160,9 @@ namespace OpenRCT2::Audio
|
|||
if (SDL_BuildAudioCVT(&cvt, _format.format, _format.channels, _format.freq, format->format, format->channels, format->freq) >= 0)
|
||||
{
|
||||
auto src = GetData();
|
||||
auto cvtBuffer = std::vector<uint8>(_length * cvt.len_mult);
|
||||
auto cvtBuffer = std::vector<uint8_t>(_length * cvt.len_mult);
|
||||
std::copy_n(src, _length, cvtBuffer.data());
|
||||
cvt.len = (sint32)_length;
|
||||
cvt.len = (int32_t)_length;
|
||||
cvt.buf = cvtBuffer.data();
|
||||
if (SDL_ConvertAudio(&cvt) >= 0)
|
||||
{
|
||||
|
|
|
@ -14,9 +14,9 @@
|
|||
#include <openrct2/core/Imaging.h>
|
||||
#include "BitmapReader.h"
|
||||
|
||||
static std::vector<uint8> ReadToVector(std::istream &stream)
|
||||
static std::vector<uint8_t> ReadToVector(std::istream &stream)
|
||||
{
|
||||
std::vector<uint8> result;
|
||||
std::vector<uint8_t> result;
|
||||
if (!stream.eof() && !stream.fail())
|
||||
{
|
||||
stream.seekg(0, std::ios_base::end);
|
||||
|
@ -58,11 +58,11 @@ static Image ReadBitmap(std::istream &istream, IMAGE_FORMAT format)
|
|||
std::fill(image.Pixels.begin(), image.Pixels.end(), 0xFF);
|
||||
|
||||
// Copy pixels over
|
||||
auto src = (const uint8 *)bitmap->pixels;
|
||||
auto src = (const uint8_t *)bitmap->pixels;
|
||||
auto dst = image.Pixels.data();
|
||||
if (numChannels == 4)
|
||||
{
|
||||
for (sint32 y = 0; y < bitmap->h; y++)
|
||||
for (int32_t y = 0; y < bitmap->h; y++)
|
||||
{
|
||||
std::memcpy(dst, src, bitmap->w);
|
||||
src += bitmap->pitch;
|
||||
|
@ -71,9 +71,9 @@ static Image ReadBitmap(std::istream &istream, IMAGE_FORMAT format)
|
|||
}
|
||||
else
|
||||
{
|
||||
for (sint32 y = 0; y < bitmap->h; y++)
|
||||
for (int32_t y = 0; y < bitmap->h; y++)
|
||||
{
|
||||
for (sint32 x = 0; x < bitmap->w; x++)
|
||||
for (int32_t x = 0; x < bitmap->w; x++)
|
||||
{
|
||||
std::memcpy(dst, src, 3);
|
||||
src += 3;
|
||||
|
|
|
@ -32,7 +32,7 @@ namespace OpenRCT2
|
|||
public:
|
||||
std::unique_ptr<IDrawingEngine> Create(DRAWING_ENGINE_TYPE type, const std::shared_ptr<IUiContext>& uiContext) override
|
||||
{
|
||||
switch ((sint32)type) {
|
||||
switch ((int32_t)type) {
|
||||
case DRAWING_ENGINE_SOFTWARE:
|
||||
return CreateSoftwareDrawingEngine(uiContext);
|
||||
case DRAWING_ENGINE_SOFTWARE_WITH_HARDWARE_DISPLAY:
|
||||
|
|
|
@ -28,7 +28,7 @@ using namespace OpenRCT2::Ui;
|
|||
class HardwareDisplayDrawingEngine final : public X8DrawingEngine
|
||||
{
|
||||
private:
|
||||
constexpr static uint32 DIRTY_VISUAL_TIME = 32;
|
||||
constexpr static uint32_t DIRTY_VISUAL_TIME = 32;
|
||||
|
||||
std::shared_ptr<IUiContext> const _uiContext;
|
||||
SDL_Window * _window = nullptr;
|
||||
|
@ -36,19 +36,19 @@ private:
|
|||
SDL_Texture * _screenTexture = nullptr;
|
||||
SDL_Texture * _scaledScreenTexture = nullptr;
|
||||
SDL_PixelFormat * _screenTextureFormat = nullptr;
|
||||
uint32 _paletteHWMapped[256] = { 0 };
|
||||
uint32_t _paletteHWMapped[256] = { 0 };
|
||||
#ifdef __ENABLE_LIGHTFX__
|
||||
uint32 _lightPaletteHWMapped[256] = { 0 };
|
||||
uint32_t _lightPaletteHWMapped[256] = { 0 };
|
||||
#endif
|
||||
|
||||
// Steam overlay checking
|
||||
uint32 _pixelBeforeOverlay = 0;
|
||||
uint32 _pixelAfterOverlay = 0;
|
||||
uint32_t _pixelBeforeOverlay = 0;
|
||||
uint32_t _pixelAfterOverlay = 0;
|
||||
bool _overlayActive = false;
|
||||
bool _pausedBeforeOverlay = false;
|
||||
bool _useVsync = true;
|
||||
|
||||
std::vector<uint32> _dirtyVisualsTime;
|
||||
std::vector<uint32_t> _dirtyVisualsTime;
|
||||
|
||||
bool smoothNN = false;
|
||||
|
||||
|
@ -90,7 +90,7 @@ public:
|
|||
}
|
||||
}
|
||||
|
||||
void Resize(uint32 width, uint32 height) override
|
||||
void Resize(uint32_t width, uint32_t height) override
|
||||
{
|
||||
if (_screenTexture != nullptr)
|
||||
{
|
||||
|
@ -99,16 +99,16 @@ public:
|
|||
SDL_FreeFormat(_screenTextureFormat);
|
||||
|
||||
SDL_RendererInfo rendererInfo = {};
|
||||
sint32 result = SDL_GetRendererInfo(_sdlRenderer, &rendererInfo);
|
||||
int32_t result = SDL_GetRendererInfo(_sdlRenderer, &rendererInfo);
|
||||
if (result < 0)
|
||||
{
|
||||
log_warning("HWDisplayDrawingEngine::Resize error: %s", SDL_GetError());
|
||||
return;
|
||||
}
|
||||
uint32 pixelFormat = SDL_PIXELFORMAT_UNKNOWN;
|
||||
for (uint32 i = 0; i < rendererInfo.num_texture_formats; i++)
|
||||
uint32_t pixelFormat = SDL_PIXELFORMAT_UNKNOWN;
|
||||
for (uint32_t i = 0; i < rendererInfo.num_texture_formats; i++)
|
||||
{
|
||||
uint32 format = rendererInfo.texture_formats[i];
|
||||
uint32_t format = rendererInfo.texture_formats[i];
|
||||
if (!SDL_ISPIXELFORMAT_FOURCC(format) &&
|
||||
!SDL_ISPIXELFORMAT_INDEXED(format) &&
|
||||
(pixelFormat == SDL_PIXELFORMAT_UNKNOWN || SDL_BYTESPERPIXEL(format) < SDL_BYTESPERPIXEL(pixelFormat)))
|
||||
|
@ -117,7 +117,7 @@ public:
|
|||
}
|
||||
}
|
||||
|
||||
sint32 scaleQuality = GetContext()->GetUiContext()->GetScaleQuality();
|
||||
int32_t scaleQuality = GetContext()->GetUiContext()->GetScaleQuality();
|
||||
if (scaleQuality == SCALE_QUALITY_SMOOTH_NN)
|
||||
{
|
||||
scaleQuality = SCALE_QUALITY_LINEAR;
|
||||
|
@ -141,7 +141,7 @@ public:
|
|||
_screenTexture = SDL_CreateTexture(_sdlRenderer, pixelFormat, SDL_TEXTUREACCESS_STREAMING, width, height);
|
||||
SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, scaleQualityBuffer);
|
||||
|
||||
uint32 scale = std::ceil(gConfigGeneral.window_scale);
|
||||
uint32_t scale = std::ceil(gConfigGeneral.window_scale);
|
||||
_scaledScreenTexture = SDL_CreateTexture(_sdlRenderer, pixelFormat, SDL_TEXTUREACCESS_TARGET,
|
||||
width * scale, height * scale);
|
||||
}
|
||||
|
@ -150,7 +150,7 @@ public:
|
|||
_screenTexture = SDL_CreateTexture(_sdlRenderer, pixelFormat, SDL_TEXTUREACCESS_STREAMING,width, height);
|
||||
}
|
||||
|
||||
uint32 format;
|
||||
uint32_t format;
|
||||
SDL_QueryTexture(_screenTexture, &format, nullptr, nullptr, nullptr);
|
||||
_screenTextureFormat = SDL_AllocFormat(format);
|
||||
|
||||
|
@ -161,7 +161,7 @@ public:
|
|||
{
|
||||
if (_screenTextureFormat != nullptr)
|
||||
{
|
||||
for (sint32 i = 0; i < 256; i++)
|
||||
for (int32_t i = 0; i < 256; i++)
|
||||
{
|
||||
_paletteHWMapped[i] = SDL_MapRGB(_screenTextureFormat, palette[i].red, palette[i].green, palette[i].blue);
|
||||
}
|
||||
|
@ -170,7 +170,7 @@ public:
|
|||
if (gConfigGeneral.enable_light_fx)
|
||||
{
|
||||
auto lightPalette = lightfx_get_palette();
|
||||
for (sint32 i = 0; i < 256; i++)
|
||||
for (int32_t i = 0; i < 256; i++)
|
||||
{
|
||||
auto src = &lightPalette->entries[i];
|
||||
_lightPaletteHWMapped[i] = SDL_MapRGBA(_screenTextureFormat, src->red, src->green, src->blue, src->alpha);
|
||||
|
@ -190,15 +190,15 @@ public:
|
|||
}
|
||||
|
||||
protected:
|
||||
void OnDrawDirtyBlock(uint32 left, uint32 top, uint32 columns, uint32 rows) override
|
||||
void OnDrawDirtyBlock(uint32_t left, uint32_t top, uint32_t columns, uint32_t rows) override
|
||||
{
|
||||
if (gShowDirtyVisuals)
|
||||
{
|
||||
uint32 right = left + columns;
|
||||
uint32 bottom = top + rows;
|
||||
for (uint32 x = left; x < right; x++)
|
||||
uint32_t right = left + columns;
|
||||
uint32_t bottom = top + rows;
|
||||
for (uint32_t x = left; x < right; x++)
|
||||
{
|
||||
for (uint32 y = top; y < bottom; y++)
|
||||
for (uint32_t y = top; y < bottom; y++)
|
||||
{
|
||||
SetDirtyVisualTime(x, y, DIRTY_VISUAL_TIME);
|
||||
}
|
||||
|
@ -213,7 +213,7 @@ private:
|
|||
if (gConfigGeneral.enable_light_fx)
|
||||
{
|
||||
void * pixels;
|
||||
sint32 pitch;
|
||||
int32_t pitch;
|
||||
if (SDL_LockTexture(_screenTexture, nullptr, &pixels, &pitch) == 0)
|
||||
{
|
||||
lightfx_render_to_texture(pixels, pitch, _bits, _width, _height, _paletteHWMapped, _lightPaletteHWMapped);
|
||||
|
@ -223,7 +223,7 @@ private:
|
|||
else
|
||||
#endif
|
||||
{
|
||||
CopyBitsToTexture(_screenTexture, _bits, (sint32)_width, (sint32)_height, _paletteHWMapped);
|
||||
CopyBitsToTexture(_screenTexture, _bits, (int32_t)_width, (int32_t)_height, _paletteHWMapped);
|
||||
}
|
||||
if (smoothNN)
|
||||
{
|
||||
|
@ -257,17 +257,17 @@ private:
|
|||
}
|
||||
}
|
||||
|
||||
void CopyBitsToTexture(SDL_Texture * texture, uint8 * src, sint32 width, sint32 height, const uint32 * palette)
|
||||
void CopyBitsToTexture(SDL_Texture * texture, uint8_t * src, int32_t width, int32_t height, const uint32_t * palette)
|
||||
{
|
||||
void * pixels;
|
||||
sint32 pitch;
|
||||
int32_t pitch;
|
||||
if (SDL_LockTexture(texture, nullptr, &pixels, &pitch) == 0)
|
||||
{
|
||||
sint32 padding = pitch - (width * 4);
|
||||
int32_t padding = pitch - (width * 4);
|
||||
if (pitch == width * 4)
|
||||
{
|
||||
uint32 * dst = (uint32 *)pixels;
|
||||
for (sint32 i = width * height; i > 0; i--)
|
||||
uint32_t * dst = (uint32_t *)pixels;
|
||||
for (int32_t i = width * height; i > 0; i--)
|
||||
{
|
||||
*dst++ = palette[*src++];
|
||||
}
|
||||
|
@ -276,26 +276,26 @@ private:
|
|||
{
|
||||
if (pitch == (width * 2) + padding)
|
||||
{
|
||||
uint16 * dst = (uint16 *)pixels;
|
||||
for (sint32 y = height; y > 0; y--)
|
||||
uint16_t * dst = (uint16_t *)pixels;
|
||||
for (int32_t y = height; y > 0; y--)
|
||||
{
|
||||
for (sint32 x = width; x > 0; x--)
|
||||
for (int32_t x = width; x > 0; x--)
|
||||
{
|
||||
const uint8 lower = *(uint8 *)(&palette[*src++]);
|
||||
const uint8 upper = *(uint8 *)(&palette[*src++]);
|
||||
const uint8_t lower = *(uint8_t *)(&palette[*src++]);
|
||||
const uint8_t upper = *(uint8_t *)(&palette[*src++]);
|
||||
*dst++ = (lower << 8) | upper;
|
||||
}
|
||||
dst = (uint16*)(((uint8 *)dst) + padding);
|
||||
dst = (uint16_t*)(((uint8_t *)dst) + padding);
|
||||
}
|
||||
}
|
||||
else if (pitch == width + padding)
|
||||
{
|
||||
uint8 * dst = (uint8 *)pixels;
|
||||
for (sint32 y = height; y > 0; y--)
|
||||
uint8_t * dst = (uint8_t *)pixels;
|
||||
for (int32_t y = height; y > 0; y--)
|
||||
{
|
||||
for (sint32 x = width; x > 0; x--)
|
||||
for (int32_t x = width; x > 0; x--)
|
||||
{
|
||||
*dst++ = *(uint8 *)(&palette[*src++]);
|
||||
*dst++ = *(uint8_t *)(&palette[*src++]);
|
||||
}
|
||||
dst += padding;
|
||||
}
|
||||
|
@ -305,10 +305,10 @@ private:
|
|||
}
|
||||
}
|
||||
|
||||
uint32 GetDirtyVisualTime(uint32 x, uint32 y)
|
||||
uint32_t GetDirtyVisualTime(uint32_t x, uint32_t y)
|
||||
{
|
||||
uint32 result = 0;
|
||||
uint32 i = y * _dirtyGrid.BlockColumns + x;
|
||||
uint32_t result = 0;
|
||||
uint32_t i = y * _dirtyGrid.BlockColumns + x;
|
||||
if (_dirtyVisualsTime.size() > i)
|
||||
{
|
||||
result = _dirtyVisualsTime[i];
|
||||
|
@ -316,9 +316,9 @@ private:
|
|||
return result;
|
||||
}
|
||||
|
||||
void SetDirtyVisualTime(uint32 x, uint32 y, uint32 value)
|
||||
void SetDirtyVisualTime(uint32_t x, uint32_t y, uint32_t value)
|
||||
{
|
||||
uint32 i = y * _dirtyGrid.BlockColumns + x;
|
||||
uint32_t i = y * _dirtyGrid.BlockColumns + x;
|
||||
if (_dirtyVisualsTime.size() > i)
|
||||
{
|
||||
_dirtyVisualsTime[i] = value;
|
||||
|
@ -328,9 +328,9 @@ private:
|
|||
void UpdateDirtyVisuals()
|
||||
{
|
||||
_dirtyVisualsTime.resize(_dirtyGrid.BlockRows * _dirtyGrid.BlockColumns);
|
||||
for (uint32 y = 0; y < _dirtyGrid.BlockRows; y++)
|
||||
for (uint32_t y = 0; y < _dirtyGrid.BlockRows; y++)
|
||||
{
|
||||
for (uint32 x = 0; x < _dirtyGrid.BlockColumns; x++)
|
||||
for (uint32_t x = 0; x < _dirtyGrid.BlockColumns; x++)
|
||||
{
|
||||
auto timeLeft = GetDirtyVisualTime(x, y);
|
||||
if (timeLeft > 0)
|
||||
|
@ -347,20 +347,20 @@ private:
|
|||
float scaleY = gConfigGeneral.window_scale;
|
||||
|
||||
SDL_SetRenderDrawBlendMode(_sdlRenderer, SDL_BLENDMODE_BLEND);
|
||||
for (uint32 y = 0; y < _dirtyGrid.BlockRows; y++)
|
||||
for (uint32_t y = 0; y < _dirtyGrid.BlockRows; y++)
|
||||
{
|
||||
for (uint32 x = 0; x < _dirtyGrid.BlockColumns; x++)
|
||||
for (uint32_t x = 0; x < _dirtyGrid.BlockColumns; x++)
|
||||
{
|
||||
auto timeLeft = GetDirtyVisualTime(x, y);
|
||||
if (timeLeft > 0)
|
||||
{
|
||||
uint8 alpha = (uint8)(timeLeft * 5 / 2);
|
||||
uint8_t alpha = (uint8_t)(timeLeft * 5 / 2);
|
||||
|
||||
SDL_Rect ddRect;
|
||||
ddRect.x = (sint32)(x * _dirtyGrid.BlockWidth * scaleX);
|
||||
ddRect.y = (sint32)(y * _dirtyGrid.BlockHeight * scaleY);
|
||||
ddRect.w = (sint32)(_dirtyGrid.BlockWidth * scaleX);
|
||||
ddRect.h = (sint32)(_dirtyGrid.BlockHeight * scaleY);
|
||||
ddRect.x = (int32_t)(x * _dirtyGrid.BlockWidth * scaleX);
|
||||
ddRect.y = (int32_t)(y * _dirtyGrid.BlockHeight * scaleY);
|
||||
ddRect.w = (int32_t)(_dirtyGrid.BlockWidth * scaleX);
|
||||
ddRect.h = (int32_t)(_dirtyGrid.BlockHeight * scaleY);
|
||||
|
||||
SDL_SetRenderDrawColor(_sdlRenderer, 255, 255, 255, alpha);
|
||||
SDL_RenderFillRect(_sdlRenderer, &ddRect);
|
||||
|
@ -369,10 +369,10 @@ private:
|
|||
}
|
||||
}
|
||||
|
||||
void ReadCentrePixel(uint32 * pixel)
|
||||
void ReadCentrePixel(uint32_t * pixel)
|
||||
{
|
||||
SDL_Rect centrePixelRegion = { (sint32)(_width / 2), (sint32)(_height / 2), 1, 1 };
|
||||
SDL_RenderReadPixels(_sdlRenderer, ¢rePixelRegion, SDL_PIXELFORMAT_RGBA8888, pixel, sizeof(uint32));
|
||||
SDL_Rect centrePixelRegion = { (int32_t)(_width / 2), (int32_t)(_height / 2), 1, 1 };
|
||||
SDL_RenderReadPixels(_sdlRenderer, ¢rePixelRegion, SDL_PIXELFORMAT_RGBA8888, pixel, sizeof(uint32_t));
|
||||
}
|
||||
|
||||
// Should be called before SDL_RenderPresent to capture frame buffer before Steam overlay is drawn.
|
||||
|
|
|
@ -50,7 +50,7 @@ public:
|
|||
{
|
||||
}
|
||||
|
||||
void Resize(uint32 width, uint32 height) override
|
||||
void Resize(uint32_t width, uint32_t height) override
|
||||
{
|
||||
SDL_FreeSurface(_surface);
|
||||
SDL_FreeSurface(_RGBASurface);
|
||||
|
@ -84,7 +84,7 @@ public:
|
|||
if (windowSurface != nullptr && _palette != nullptr)
|
||||
{
|
||||
SDL_Colour colours[256];
|
||||
for (sint32 i = 0; i < 256; i++) {
|
||||
for (int32_t i = 0; i < 256; i++) {
|
||||
colours[i].r = palette[i].red;
|
||||
colours[i].g = palette[i].green;
|
||||
colours[i].b = palette[i].blue;
|
||||
|
@ -113,7 +113,7 @@ private:
|
|||
}
|
||||
|
||||
// Copy pixels from the virtual screen buffer to the surface
|
||||
std::copy_n(_bits, _surface->pitch * _surface->h, (uint8 *)_surface->pixels);
|
||||
std::copy_n(_bits, _surface->pitch * _surface->h, (uint8_t *)_surface->pixels);
|
||||
|
||||
// Unlock the surface
|
||||
if (SDL_MUSTLOCK(_surface))
|
||||
|
|
|
@ -85,7 +85,7 @@ void DrawLineShader::GetLocations()
|
|||
vVertMat = GetAttributeLocation("vVertMat");
|
||||
}
|
||||
|
||||
void DrawLineShader::SetScreenSize(sint32 width, sint32 height)
|
||||
void DrawLineShader::SetScreenSize(int32_t width, int32_t height)
|
||||
{
|
||||
glUniform2i(uScreenSize, width, height);
|
||||
}
|
||||
|
|
|
@ -33,7 +33,7 @@ public:
|
|||
DrawLineShader();
|
||||
~DrawLineShader() override;
|
||||
|
||||
void SetScreenSize(sint32 width, sint32 height);
|
||||
void SetScreenSize(int32_t width, int32_t height);
|
||||
void DrawInstances(const LineCommandBatch& instances);
|
||||
|
||||
private:
|
||||
|
|
|
@ -126,7 +126,7 @@ void DrawRectShader::GetLocations()
|
|||
vVertVec = GetAttributeLocation("vVertVec");
|
||||
}
|
||||
|
||||
void DrawRectShader::SetScreenSize(sint32 width, sint32 height)
|
||||
void DrawRectShader::SetScreenSize(int32_t width, int32_t height)
|
||||
{
|
||||
glUniform2i(uScreenSize, width, height);
|
||||
}
|
||||
|
|
|
@ -49,7 +49,7 @@ public:
|
|||
DrawRectShader();
|
||||
~DrawRectShader() override;
|
||||
|
||||
void SetScreenSize(sint32 width, sint32 height);
|
||||
void SetScreenSize(int32_t width, int32_t height);
|
||||
void EnablePeeling(GLuint peelingTex);
|
||||
void DisablePeeling();
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@ static const char * TryLoadAllProcAddresses()
|
|||
|
||||
namespace OpenGLState
|
||||
{
|
||||
uint16 ActiveTexture;
|
||||
uint16_t ActiveTexture;
|
||||
GLuint CurrentProgram;
|
||||
|
||||
void Reset()
|
||||
|
@ -51,7 +51,7 @@ namespace OpenGLState
|
|||
}
|
||||
}
|
||||
|
||||
void OpenGLAPI::SetTexture(uint16 index, GLenum type, GLuint texture)
|
||||
void OpenGLAPI::SetTexture(uint16_t index, GLenum type, GLuint texture)
|
||||
{
|
||||
if (OpenGLState::ActiveTexture != index)
|
||||
{
|
||||
|
|
|
@ -115,12 +115,12 @@ inline void CheckGLError()
|
|||
namespace OpenGLAPI
|
||||
{
|
||||
bool Initialise();
|
||||
void SetTexture(uint16 index, GLenum type, GLuint texture);
|
||||
void SetTexture(uint16_t index, GLenum type, GLuint texture);
|
||||
}
|
||||
|
||||
namespace OpenGLState
|
||||
{
|
||||
extern uint16 ActiveTexture;
|
||||
extern uint16_t ActiveTexture;
|
||||
extern GLuint CurrentProgram;
|
||||
|
||||
void Reset();
|
||||
|
|
|
@ -63,14 +63,14 @@ private:
|
|||
|
||||
TextureCache * _textureCache = nullptr;
|
||||
|
||||
sint32 _offsetX = 0;
|
||||
sint32 _offsetY = 0;
|
||||
sint32 _clipLeft = 0;
|
||||
sint32 _clipTop = 0;
|
||||
sint32 _clipRight = 0;
|
||||
sint32 _clipBottom = 0;
|
||||
int32_t _offsetX = 0;
|
||||
int32_t _offsetY = 0;
|
||||
int32_t _clipLeft = 0;
|
||||
int32_t _clipTop = 0;
|
||||
int32_t _clipRight = 0;
|
||||
int32_t _clipBottom = 0;
|
||||
|
||||
sint32 _drawCount = 0;
|
||||
int32_t _drawCount = 0;
|
||||
|
||||
struct
|
||||
{
|
||||
|
@ -89,18 +89,18 @@ public:
|
|||
const OpenGLFramebuffer & GetFinalFramebuffer() const { return _swapFramebuffer->GetFinalFramebuffer(); }
|
||||
|
||||
void Initialise();
|
||||
void Resize(sint32 width, sint32 height);
|
||||
void Resize(int32_t width, int32_t height);
|
||||
void ResetPalette();
|
||||
void StartNewDraw();
|
||||
|
||||
void Clear(uint8 paletteIndex) override;
|
||||
void FillRect(uint32 colour, sint32 x, sint32 y, sint32 w, sint32 h) override;
|
||||
void FilterRect(FILTER_PALETTE_ID palette, sint32 left, sint32 top, sint32 right, sint32 bottom) override;
|
||||
void DrawLine(uint32 colour, sint32 x1, sint32 y1, sint32 x2, sint32 y2) override;
|
||||
void DrawSprite(uint32 image, sint32 x, sint32 y, uint32 tertiaryColour) override;
|
||||
void DrawSpriteRawMasked(sint32 x, sint32 y, uint32 maskImage, uint32 colourImage) override;
|
||||
void DrawSpriteSolid(uint32 image, sint32 x, sint32 y, uint8 colour) override;
|
||||
void DrawGlyph(uint32 image, sint32 x, sint32 y, uint8 * palette) override;
|
||||
void Clear(uint8_t paletteIndex) override;
|
||||
void FillRect(uint32_t colour, int32_t x, int32_t y, int32_t w, int32_t h) override;
|
||||
void FilterRect(FILTER_PALETTE_ID palette, int32_t left, int32_t top, int32_t right, int32_t bottom) override;
|
||||
void DrawLine(uint32_t colour, int32_t x1, int32_t y1, int32_t x2, int32_t y2) override;
|
||||
void DrawSprite(uint32_t image, int32_t x, int32_t y, uint32_t tertiaryColour) override;
|
||||
void DrawSpriteRawMasked(int32_t x, int32_t y, uint32_t maskImage, uint32_t colourImage) override;
|
||||
void DrawSpriteSolid(uint32_t image, int32_t x, int32_t y, uint8_t colour) override;
|
||||
void DrawGlyph(uint32_t image, int32_t x, int32_t y, uint8_t * palette) override;
|
||||
|
||||
void FlushCommandBuffers();
|
||||
|
||||
|
@ -118,11 +118,11 @@ private:
|
|||
SDL_Window * _window = nullptr;
|
||||
SDL_GLContext _context = nullptr;
|
||||
|
||||
uint32 _width = 0;
|
||||
uint32 _height = 0;
|
||||
uint32 _pitch = 0;
|
||||
uint32_t _width = 0;
|
||||
uint32_t _height = 0;
|
||||
uint32_t _pitch = 0;
|
||||
size_t _bitsSize = 0;
|
||||
uint8 * _bits = nullptr;
|
||||
uint8_t * _bits = nullptr;
|
||||
|
||||
rct_drawpixelinfo _bitsDPI = {};
|
||||
|
||||
|
@ -184,7 +184,7 @@ public:
|
|||
_applyPaletteShader = new ApplyPaletteShader();
|
||||
}
|
||||
|
||||
void Resize(uint32 width, uint32 height) override
|
||||
void Resize(uint32_t width, uint32_t height) override
|
||||
{
|
||||
ConfigureBits(width, height, width);
|
||||
ConfigureCanvas();
|
||||
|
@ -193,7 +193,7 @@ public:
|
|||
|
||||
void SetPalette(const rct_palette_entry * palette) override
|
||||
{
|
||||
for (sint32 i = 0; i < 256; i++)
|
||||
for (int32_t i = 0; i < 256; i++)
|
||||
{
|
||||
SDL_Color colour;
|
||||
colour.r = palette[i].red;
|
||||
|
@ -218,7 +218,7 @@ public:
|
|||
SDL_GL_SetSwapInterval(vsync);
|
||||
}
|
||||
|
||||
void Invalidate(sint32 left, sint32 top, sint32 right, sint32 bottom) override
|
||||
void Invalidate(int32_t left, int32_t top, int32_t right, int32_t bottom) override
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -276,16 +276,16 @@ public:
|
|||
// Not implemented
|
||||
}
|
||||
|
||||
sint32 Screenshot() override
|
||||
int32_t Screenshot() override
|
||||
{
|
||||
const OpenGLFramebuffer & framebuffer = _drawingContext->GetFinalFramebuffer();
|
||||
framebuffer.Bind();
|
||||
framebuffer.GetPixels(_bitsDPI);
|
||||
sint32 result = screenshot_dump_png(&_bitsDPI);
|
||||
int32_t result = screenshot_dump_png(&_bitsDPI);
|
||||
return result;
|
||||
}
|
||||
|
||||
void CopyRect(sint32 x, sint32 y, sint32 width, sint32 height, sint32 dx, sint32 dy) override
|
||||
void CopyRect(int32_t x, int32_t y, int32_t width, int32_t height, int32_t dx, int32_t dy) override
|
||||
{
|
||||
// Not applicable for this engine
|
||||
}
|
||||
|
@ -306,7 +306,7 @@ public:
|
|||
return DEF_NONE;
|
||||
}
|
||||
|
||||
void InvalidateImage(uint32 image) override
|
||||
void InvalidateImage(uint32_t image) override
|
||||
{
|
||||
_drawingContext->GetTextureCache()
|
||||
->InvalidateImage(image);
|
||||
|
@ -329,10 +329,10 @@ private:
|
|||
return version;
|
||||
}
|
||||
|
||||
void ConfigureBits(uint32 width, uint32 height, uint32 pitch)
|
||||
void ConfigureBits(uint32_t width, uint32_t height, uint32_t pitch)
|
||||
{
|
||||
size_t newBitsSize = pitch * height;
|
||||
uint8 * newBits = new uint8[newBitsSize];
|
||||
uint8_t * newBits = new uint8_t[newBitsSize];
|
||||
if (_bits == nullptr)
|
||||
{
|
||||
std::fill_n(newBits, newBitsSize, 0);
|
||||
|
@ -345,12 +345,12 @@ private:
|
|||
}
|
||||
else
|
||||
{
|
||||
uint8 * src = _bits;
|
||||
uint8 * dst = newBits;
|
||||
uint8_t * src = _bits;
|
||||
uint8_t * dst = newBits;
|
||||
|
||||
uint32 minWidth = std::min(_width, width);
|
||||
uint32 minHeight = std::min(_height, height);
|
||||
for (uint32 y = 0; y < minHeight; y++)
|
||||
uint32_t minWidth = std::min(_width, width);
|
||||
uint32_t minHeight = std::min(_height, height);
|
||||
for (uint32_t y = 0; y < minHeight; y++)
|
||||
{
|
||||
std::copy_n(src, minWidth, dst);
|
||||
if (pitch - minWidth > 0)
|
||||
|
@ -401,7 +401,7 @@ private:
|
|||
}
|
||||
if (GetContext()->GetUiContext()->GetScaleQuality() == SCALE_QUALITY_SMOOTH_NN)
|
||||
{
|
||||
uint32 scale = std::ceil(gConfigGeneral.window_scale);
|
||||
uint32_t scale = std::ceil(gConfigGeneral.window_scale);
|
||||
_smoothScaleFramebuffer = new OpenGLFramebuffer(_width * scale, _height * scale, false, false);
|
||||
}
|
||||
}
|
||||
|
@ -445,7 +445,7 @@ void OpenGLDrawingContext::Initialise()
|
|||
_drawLineShader = new DrawLineShader();
|
||||
}
|
||||
|
||||
void OpenGLDrawingContext::Resize(sint32 width, sint32 height)
|
||||
void OpenGLDrawingContext::Resize(int32_t width, int32_t height)
|
||||
{
|
||||
_commandBuffers.lines.clear();
|
||||
_commandBuffers.rects.clear();
|
||||
|
@ -471,12 +471,12 @@ void OpenGLDrawingContext::StartNewDraw()
|
|||
_swapFramebuffer->Clear();
|
||||
}
|
||||
|
||||
void OpenGLDrawingContext::Clear(uint8 paletteIndex)
|
||||
void OpenGLDrawingContext::Clear(uint8_t paletteIndex)
|
||||
{
|
||||
FillRect(paletteIndex, _clipLeft - _offsetX, _clipTop - _offsetY, _clipRight - _offsetX, _clipBottom - _offsetY);
|
||||
}
|
||||
|
||||
void OpenGLDrawingContext::FillRect(uint32 colour, sint32 left, sint32 top, sint32 right, sint32 bottom)
|
||||
void OpenGLDrawingContext::FillRect(uint32_t colour, int32_t left, int32_t top, int32_t right, int32_t bottom)
|
||||
{
|
||||
left += _offsetX;
|
||||
top += _offsetY;
|
||||
|
@ -508,7 +508,7 @@ void OpenGLDrawingContext::FillRect(uint32 colour, sint32 left, sint32 top, sint
|
|||
}
|
||||
}
|
||||
|
||||
void OpenGLDrawingContext::FilterRect(FILTER_PALETTE_ID palette, sint32 left, sint32 top, sint32 right, sint32 bottom)
|
||||
void OpenGLDrawingContext::FilterRect(FILTER_PALETTE_ID palette, int32_t left, int32_t top, int32_t right, int32_t bottom)
|
||||
{
|
||||
left += _offsetX;
|
||||
top += _offsetY;
|
||||
|
@ -529,7 +529,7 @@ void OpenGLDrawingContext::FilterRect(FILTER_PALETTE_ID palette, sint32 left, si
|
|||
command.depth = _drawCount++;
|
||||
}
|
||||
|
||||
void OpenGLDrawingContext::DrawLine(uint32 colour, sint32 x1, sint32 y1, sint32 x2, sint32 y2)
|
||||
void OpenGLDrawingContext::DrawLine(uint32_t colour, int32_t x1, int32_t y1, int32_t x2, int32_t y2)
|
||||
{
|
||||
x1 += _offsetX;
|
||||
y1 += _offsetY;
|
||||
|
@ -544,9 +544,9 @@ void OpenGLDrawingContext::DrawLine(uint32 colour, sint32 x1, sint32 y1, sint32
|
|||
command.depth = _drawCount++;
|
||||
}
|
||||
|
||||
void OpenGLDrawingContext::DrawSprite(uint32 image, sint32 x, sint32 y, uint32 tertiaryColour)
|
||||
void OpenGLDrawingContext::DrawSprite(uint32_t image, int32_t x, int32_t y, uint32_t tertiaryColour)
|
||||
{
|
||||
sint32 g1Id = image & 0x7FFFF;
|
||||
int32_t g1Id = image & 0x7FFFF;
|
||||
auto g1Element = gfx_get_g1_element(g1Id);
|
||||
if (g1Element == nullptr)
|
||||
{
|
||||
|
@ -575,12 +575,12 @@ void OpenGLDrawingContext::DrawSprite(uint32 image, sint32 x, sint32 y, uint32 t
|
|||
}
|
||||
}
|
||||
|
||||
uint8 zoomLevel = (1 << _dpi->zoom_level);
|
||||
uint8_t zoomLevel = (1 << _dpi->zoom_level);
|
||||
|
||||
sint32 left = x + g1Element->x_offset;
|
||||
sint32 top = y + g1Element->y_offset;
|
||||
int32_t left = x + g1Element->x_offset;
|
||||
int32_t top = y + g1Element->y_offset;
|
||||
|
||||
sint32 zoom_mask = 0xFFFFFFFF << _dpi->zoom_level;
|
||||
int32_t zoom_mask = 0xFFFFFFFF << _dpi->zoom_level;
|
||||
if (_dpi->zoom_level && g1Element->flags & G1_FLAG_RLE_COMPRESSION){
|
||||
top -= ~zoom_mask;
|
||||
}
|
||||
|
@ -592,8 +592,8 @@ void OpenGLDrawingContext::DrawSprite(uint32 image, sint32 x, sint32 y, uint32 t
|
|||
|
||||
left &= zoom_mask;
|
||||
|
||||
sint32 right = left + g1Element->width;
|
||||
sint32 bottom = top + g1Element->height;
|
||||
int32_t right = left + g1Element->width;
|
||||
int32_t bottom = top + g1Element->height;
|
||||
|
||||
if (_dpi->zoom_level && g1Element->flags & G1_FLAG_RLE_COMPRESSION) {
|
||||
bottom += top & ~zoom_mask;
|
||||
|
@ -645,7 +645,7 @@ void OpenGLDrawingContext::DrawSprite(uint32 image, sint32 x, sint32 y, uint32 t
|
|||
else if ((image & IMAGE_TYPE_REMAP) || (image & IMAGE_TYPE_TRANSPARENT))
|
||||
{
|
||||
paletteCount = 1;
|
||||
uint32 palette = (image >> 19) & 0xFF;
|
||||
uint32_t palette = (image >> 19) & 0xFF;
|
||||
palettes.x = TextureCache::PaletteToY(palette);
|
||||
if (palette == PALETTE_WATER)
|
||||
{
|
||||
|
@ -689,7 +689,7 @@ void OpenGLDrawingContext::DrawSprite(uint32 image, sint32 x, sint32 y, uint32 t
|
|||
}
|
||||
}
|
||||
|
||||
void OpenGLDrawingContext::DrawSpriteRawMasked(sint32 x, sint32 y, uint32 maskImage, uint32 colourImage)
|
||||
void OpenGLDrawingContext::DrawSpriteRawMasked(int32_t x, int32_t y, uint32_t maskImage, uint32_t colourImage)
|
||||
{
|
||||
auto g1ElementMask = gfx_get_g1_element(maskImage & 0x7FFFF);
|
||||
auto g1ElementColour = gfx_get_g1_element(colourImage & 0x7FFFF);
|
||||
|
@ -701,17 +701,17 @@ void OpenGLDrawingContext::DrawSpriteRawMasked(sint32 x, sint32 y, uint32 maskIm
|
|||
const auto textureMask = _textureCache->GetOrLoadImageTexture(maskImage);
|
||||
const auto textureColour = _textureCache->GetOrLoadImageTexture(colourImage);
|
||||
|
||||
uint8 zoomLevel = (1 << _dpi->zoom_level);
|
||||
uint8_t zoomLevel = (1 << _dpi->zoom_level);
|
||||
|
||||
sint32 drawOffsetX = g1ElementMask->x_offset;
|
||||
sint32 drawOffsetY = g1ElementMask->y_offset;
|
||||
sint32 drawWidth = std::min(g1ElementMask->width, g1ElementColour->width);
|
||||
sint32 drawHeight = std::min(g1ElementMask->height, g1ElementColour->height);
|
||||
int32_t drawOffsetX = g1ElementMask->x_offset;
|
||||
int32_t drawOffsetY = g1ElementMask->y_offset;
|
||||
int32_t drawWidth = std::min(g1ElementMask->width, g1ElementColour->width);
|
||||
int32_t drawHeight = std::min(g1ElementMask->height, g1ElementColour->height);
|
||||
|
||||
sint32 left = x + drawOffsetX;
|
||||
sint32 top = y + drawOffsetY;
|
||||
sint32 right = left + drawWidth;
|
||||
sint32 bottom = top + drawHeight;
|
||||
int32_t left = x + drawOffsetX;
|
||||
int32_t top = y + drawOffsetY;
|
||||
int32_t right = left + drawWidth;
|
||||
int32_t bottom = top + drawHeight;
|
||||
|
||||
if (left > right)
|
||||
{
|
||||
|
@ -751,11 +751,11 @@ void OpenGLDrawingContext::DrawSpriteRawMasked(sint32 x, sint32 y, uint32 maskIm
|
|||
command.depth = _drawCount++;
|
||||
}
|
||||
|
||||
void OpenGLDrawingContext::DrawSpriteSolid(uint32 image, sint32 x, sint32 y, uint8 colour)
|
||||
void OpenGLDrawingContext::DrawSpriteSolid(uint32_t image, int32_t x, int32_t y, uint8_t colour)
|
||||
{
|
||||
assert((colour & 0xFF) > 0u);
|
||||
|
||||
sint32 g1Id = image & 0x7FFFF;
|
||||
int32_t g1Id = image & 0x7FFFF;
|
||||
auto g1Element = gfx_get_g1_element(g1Id);
|
||||
if (g1Element == nullptr)
|
||||
{
|
||||
|
@ -764,15 +764,15 @@ void OpenGLDrawingContext::DrawSpriteSolid(uint32 image, sint32 x, sint32 y, uin
|
|||
|
||||
const auto texture = _textureCache->GetOrLoadImageTexture(image);
|
||||
|
||||
sint32 drawOffsetX = g1Element->x_offset;
|
||||
sint32 drawOffsetY = g1Element->y_offset;
|
||||
sint32 drawWidth = (uint16)g1Element->width;
|
||||
sint32 drawHeight = (uint16)g1Element->height;
|
||||
int32_t drawOffsetX = g1Element->x_offset;
|
||||
int32_t drawOffsetY = g1Element->y_offset;
|
||||
int32_t drawWidth = (uint16_t)g1Element->width;
|
||||
int32_t drawHeight = (uint16_t)g1Element->height;
|
||||
|
||||
sint32 left = x + drawOffsetX;
|
||||
sint32 top = y + drawOffsetY;
|
||||
sint32 right = left + drawWidth;
|
||||
sint32 bottom = top + drawHeight;
|
||||
int32_t left = x + drawOffsetX;
|
||||
int32_t top = y + drawOffsetY;
|
||||
int32_t right = left + drawWidth;
|
||||
int32_t bottom = top + drawHeight;
|
||||
|
||||
if (left > right)
|
||||
{
|
||||
|
@ -802,7 +802,7 @@ void OpenGLDrawingContext::DrawSpriteSolid(uint32 image, sint32 x, sint32 y, uin
|
|||
command.depth = _drawCount++;
|
||||
}
|
||||
|
||||
void OpenGLDrawingContext::DrawGlyph(uint32 image, sint32 x, sint32 y, uint8 * palette)
|
||||
void OpenGLDrawingContext::DrawGlyph(uint32_t image, int32_t x, int32_t y, uint8_t * palette)
|
||||
{
|
||||
auto g1Element = gfx_get_g1_element(image & 0x7FFFF);
|
||||
if (g1Element == nullptr)
|
||||
|
@ -812,15 +812,15 @@ void OpenGLDrawingContext::DrawGlyph(uint32 image, sint32 x, sint32 y, uint8 * p
|
|||
|
||||
const auto texture = _textureCache->GetOrLoadGlyphTexture(image, palette);
|
||||
|
||||
sint32 drawOffsetX = g1Element->x_offset;
|
||||
sint32 drawOffsetY = g1Element->y_offset;
|
||||
sint32 drawWidth = (uint16)g1Element->width;
|
||||
sint32 drawHeight = (uint16)g1Element->height;
|
||||
int32_t drawOffsetX = g1Element->x_offset;
|
||||
int32_t drawOffsetY = g1Element->y_offset;
|
||||
int32_t drawWidth = (uint16_t)g1Element->width;
|
||||
int32_t drawHeight = (uint16_t)g1Element->height;
|
||||
|
||||
sint32 left = x + drawOffsetX;
|
||||
sint32 top = y + drawOffsetY;
|
||||
sint32 right = left + drawWidth;
|
||||
sint32 bottom = top + drawHeight;
|
||||
int32_t left = x + drawOffsetX;
|
||||
int32_t top = y + drawOffsetY;
|
||||
int32_t right = left + drawWidth;
|
||||
int32_t bottom = top + drawHeight;
|
||||
|
||||
if (left > right)
|
||||
{
|
||||
|
@ -899,8 +899,8 @@ void OpenGLDrawingContext::HandleTransparency()
|
|||
_drawRectShader->Use();
|
||||
_drawRectShader->SetInstances(_commandBuffers.transparent);
|
||||
|
||||
sint32 max_depth = MaxTransparencyDepth(_commandBuffers.transparent);
|
||||
for (sint32 i=0; i < max_depth; ++i)
|
||||
int32_t max_depth = MaxTransparencyDepth(_commandBuffers.transparent);
|
||||
for (int32_t i=0; i < max_depth; ++i)
|
||||
{
|
||||
_swapFramebuffer->BindTransparent();
|
||||
|
||||
|
@ -934,8 +934,8 @@ void OpenGLDrawingContext::SetDPI(rct_drawpixelinfo * dpi)
|
|||
|
||||
assert(bitsOffset < bitsSize);
|
||||
|
||||
_clipLeft = (sint32)(bitsOffset % (screenDPI->width + screenDPI->pitch));
|
||||
_clipTop = (sint32)(bitsOffset / (screenDPI->width + screenDPI->pitch));
|
||||
_clipLeft = (int32_t)(bitsOffset % (screenDPI->width + screenDPI->pitch));
|
||||
_clipTop = (int32_t)(bitsOffset / (screenDPI->width + screenDPI->pitch));
|
||||
|
||||
_clipRight = _clipLeft + (dpi->width >> dpi->zoom_level);
|
||||
_clipBottom = _clipTop + (dpi->height >> dpi->zoom_level);
|
||||
|
|
|
@ -25,7 +25,7 @@ OpenGLFramebuffer::OpenGLFramebuffer(SDL_Window * window)
|
|||
SDL_GetWindowSize(window, &_width, &_height);
|
||||
}
|
||||
|
||||
OpenGLFramebuffer::OpenGLFramebuffer(sint32 width, sint32 height, bool depth, bool integer)
|
||||
OpenGLFramebuffer::OpenGLFramebuffer(int32_t width, int32_t height, bool depth, bool integer)
|
||||
{
|
||||
_width = width;
|
||||
_height = height;
|
||||
|
@ -88,15 +88,15 @@ void OpenGLFramebuffer::GetPixels(rct_drawpixelinfo &dpi) const
|
|||
{
|
||||
assert(dpi.width == _width && dpi.height == _height);
|
||||
|
||||
auto pixels = std::make_unique<uint8[]>(_width * _height);
|
||||
auto pixels = std::make_unique<uint8_t[]>(_width * _height);
|
||||
glBindTexture(GL_TEXTURE_2D, _texture);
|
||||
glPixelStorei(GL_PACK_ALIGNMENT, 1);
|
||||
glGetTexImage(GL_TEXTURE_2D, 0, GL_RED_INTEGER, GL_UNSIGNED_BYTE, pixels.get());
|
||||
|
||||
// Flip pixels vertically on copy
|
||||
uint8 * src = pixels.get() + ((_height - 1) * _width);
|
||||
uint8 * dst = dpi.bits;
|
||||
for (sint32 y = 0; y < _height; y++)
|
||||
uint8_t * src = pixels.get() + ((_height - 1) * _width);
|
||||
uint8_t * dst = dpi.bits;
|
||||
for (int32_t y = 0; y < _height; y++)
|
||||
{
|
||||
std::copy_n(src, _width, dst);
|
||||
src -= _width;
|
||||
|
@ -136,7 +136,7 @@ void OpenGLFramebuffer::Copy(OpenGLFramebuffer &src, GLenum filter)
|
|||
Bind();
|
||||
}
|
||||
|
||||
GLuint OpenGLFramebuffer::CreateDepthTexture(sint32 width, sint32 height)
|
||||
GLuint OpenGLFramebuffer::CreateDepthTexture(int32_t width, int32_t height)
|
||||
{
|
||||
GLuint depth;
|
||||
glGenTextures(1, &depth);
|
||||
|
|
|
@ -23,12 +23,12 @@ private:
|
|||
GLuint _id;
|
||||
GLuint _texture;
|
||||
GLuint _depth;
|
||||
sint32 _width;
|
||||
sint32 _height;
|
||||
int32_t _width;
|
||||
int32_t _height;
|
||||
|
||||
public:
|
||||
explicit OpenGLFramebuffer(SDL_Window * window);
|
||||
OpenGLFramebuffer(sint32 width, sint32 height, bool depth = true, bool integer = true);
|
||||
OpenGLFramebuffer(int32_t width, int32_t height, bool depth = true, bool integer = true);
|
||||
~OpenGLFramebuffer();
|
||||
|
||||
OpenGLFramebuffer(const OpenGLFramebuffer &) = delete;
|
||||
|
@ -48,5 +48,5 @@ public:
|
|||
GLuint SwapDepthTexture(GLuint depth);
|
||||
void Copy(OpenGLFramebuffer &src, GLenum filter);
|
||||
|
||||
static GLuint CreateDepthTexture(sint32 width, sint32 height);
|
||||
static GLuint CreateDepthTexture(int32_t width, int32_t height);
|
||||
};
|
||||
|
|
|
@ -76,7 +76,7 @@ std::string OpenGLShader::ReadSourceCode(const std::string &path)
|
|||
{
|
||||
auto fs = FileStream(path, FILE_MODE_OPEN);
|
||||
|
||||
uint64 fileLength = fs.GetLength();
|
||||
uint64_t fileLength = fs.GetLength();
|
||||
if (fileLength > MaxSourceSize)
|
||||
{
|
||||
throw IOException("Shader source too large.");
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
class OpenGLShader final
|
||||
{
|
||||
private:
|
||||
static constexpr uint64 MaxSourceSize = 8 * 1024 * 1024; // 8 MiB
|
||||
static constexpr uint64_t MaxSourceSize = 8 * 1024 * 1024; // 8 MiB
|
||||
|
||||
GLenum _type;
|
||||
GLuint _id = 0;
|
||||
|
|
|
@ -16,7 +16,7 @@ constexpr GLfloat depthValue[1] = { 1.0f };
|
|||
constexpr GLfloat depthValueTransparent[1] = { 0.0f };
|
||||
constexpr GLuint indexValue[4] = { 0, 0, 0, 0 };
|
||||
|
||||
SwapFramebuffer::SwapFramebuffer(sint32 width, sint32 height) :
|
||||
SwapFramebuffer::SwapFramebuffer(int32_t width, int32_t height) :
|
||||
_opaqueFramebuffer(width, height), _transparentFramebuffer(width, height),
|
||||
_mixFramebuffer(width, height, false), _backDepth(OpenGLFramebuffer::CreateDepthTexture(width, height))
|
||||
{
|
||||
|
|
|
@ -31,7 +31,7 @@ private:
|
|||
GLuint _backDepth;
|
||||
|
||||
public:
|
||||
SwapFramebuffer(sint32 width, sint32 height);
|
||||
SwapFramebuffer(int32_t width, int32_t height);
|
||||
|
||||
const OpenGLFramebuffer &GetFinalFramebuffer() const { return _opaqueFramebuffer; }
|
||||
GLuint GetBackDepthTexture() const { return _backDepth; }
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
#include <openrct2/drawing/Drawing.h>
|
||||
#include "TextureCache.h"
|
||||
|
||||
constexpr uint32 UNUSED_INDEX = 0xFFFFFFFF;
|
||||
constexpr uint32_t UNUSED_INDEX = 0xFFFFFFFF;
|
||||
|
||||
TextureCache::TextureCache()
|
||||
{
|
||||
|
@ -27,9 +27,9 @@ TextureCache::~TextureCache()
|
|||
FreeTextures();
|
||||
}
|
||||
|
||||
void TextureCache::InvalidateImage(uint32 image)
|
||||
void TextureCache::InvalidateImage(uint32_t image)
|
||||
{
|
||||
uint32 index = _indexMap[image];
|
||||
uint32_t index = _indexMap[image];
|
||||
if (index == UNUSED_INDEX)
|
||||
return;
|
||||
|
||||
|
@ -58,11 +58,11 @@ void TextureCache::InvalidateImage(uint32 image)
|
|||
}
|
||||
}
|
||||
|
||||
BasicTextureInfo TextureCache::GetOrLoadImageTexture(uint32 image)
|
||||
BasicTextureInfo TextureCache::GetOrLoadImageTexture(uint32_t image)
|
||||
{
|
||||
image &= 0x7FFFF;
|
||||
|
||||
uint32 index = _indexMap[image];
|
||||
uint32_t index = _indexMap[image];
|
||||
if (index != UNUSED_INDEX)
|
||||
{
|
||||
const auto& info = _textureCache[index];
|
||||
|
@ -73,7 +73,7 @@ BasicTextureInfo TextureCache::GetOrLoadImageTexture(uint32 image)
|
|||
};
|
||||
}
|
||||
|
||||
index = (uint32)_textureCache.size();
|
||||
index = (uint32_t)_textureCache.size();
|
||||
|
||||
AtlasTextureInfo info = LoadImageTexture(image);
|
||||
|
||||
|
@ -83,11 +83,11 @@ BasicTextureInfo TextureCache::GetOrLoadImageTexture(uint32 image)
|
|||
return info;
|
||||
}
|
||||
|
||||
BasicTextureInfo TextureCache::GetOrLoadGlyphTexture(uint32 image, uint8 * palette)
|
||||
BasicTextureInfo TextureCache::GetOrLoadGlyphTexture(uint32_t image, uint8_t * palette)
|
||||
{
|
||||
GlyphId glyphId;
|
||||
glyphId.Image = image;
|
||||
std::copy_n(palette, sizeof(glyphId.Palette), (uint8 *)&glyphId.Palette);
|
||||
std::copy_n(palette, sizeof(glyphId.Palette), (uint8_t *)&glyphId.Palette);
|
||||
|
||||
auto kvp = _glyphTextureMap.find(glyphId);
|
||||
if (kvp != _glyphTextureMap.end())
|
||||
|
@ -151,7 +151,7 @@ void TextureCache::GeneratePaletteTexture()
|
|||
for (int i=0; i < PALETTE_TO_G1_OFFSET_COUNT; ++i)
|
||||
{
|
||||
GLint y = PaletteToY(i);
|
||||
uint16 image = palette_to_g1_offset[i];
|
||||
uint16_t image = palette_to_g1_offset[i];
|
||||
auto element = gfx_get_g1_element(image);
|
||||
gfx_draw_sprite_software(&dpi, image, -element->x_offset, y - element->y_offset, 0);
|
||||
}
|
||||
|
@ -183,7 +183,7 @@ void TextureCache::EnlargeAtlasesTexture(GLuint newEntries)
|
|||
_atlasesTextureIndices = newIndices;
|
||||
}
|
||||
|
||||
AtlasTextureInfo TextureCache::LoadImageTexture(uint32 image)
|
||||
AtlasTextureInfo TextureCache::LoadImageTexture(uint32_t image)
|
||||
{
|
||||
rct_drawpixelinfo dpi = GetImageAsDPI(image, 0);
|
||||
|
||||
|
@ -198,7 +198,7 @@ AtlasTextureInfo TextureCache::LoadImageTexture(uint32 image)
|
|||
return cacheInfo;
|
||||
}
|
||||
|
||||
AtlasTextureInfo TextureCache::LoadGlyphTexture(uint32 image, uint8 * palette)
|
||||
AtlasTextureInfo TextureCache::LoadGlyphTexture(uint32_t image, uint8_t * palette)
|
||||
{
|
||||
rct_drawpixelinfo dpi = GetGlyphAsDPI(image, palette);
|
||||
|
||||
|
@ -213,7 +213,7 @@ AtlasTextureInfo TextureCache::LoadGlyphTexture(uint32 image, uint8 * palette)
|
|||
return cacheInfo;
|
||||
}
|
||||
|
||||
AtlasTextureInfo TextureCache::AllocateImage(sint32 imageWidth, sint32 imageHeight)
|
||||
AtlasTextureInfo TextureCache::AllocateImage(int32_t imageWidth, int32_t imageHeight)
|
||||
{
|
||||
CreateTextures();
|
||||
|
||||
|
@ -227,13 +227,13 @@ AtlasTextureInfo TextureCache::AllocateImage(sint32 imageWidth, sint32 imageHeig
|
|||
}
|
||||
|
||||
// If there is no such atlas, then create a new one
|
||||
if ((sint32) _atlases.size() >= _atlasesTextureIndicesLimit)
|
||||
if ((int32_t) _atlases.size() >= _atlasesTextureIndicesLimit)
|
||||
{
|
||||
throw std::runtime_error("more texture atlases required, but device limit reached!");
|
||||
}
|
||||
|
||||
sint32 atlasIndex = (sint32) _atlases.size();
|
||||
sint32 atlasSize = (sint32) powf(2, (float) Atlas::CalculateImageSizeOrder(imageWidth, imageHeight));
|
||||
int32_t atlasIndex = (int32_t) _atlases.size();
|
||||
int32_t atlasSize = (int32_t) powf(2, (float) Atlas::CalculateImageSizeOrder(imageWidth, imageHeight));
|
||||
|
||||
#ifdef DEBUG
|
||||
log_verbose("new texture atlas #%d (size %d) allocated\n", atlasIndex, atlasSize);
|
||||
|
@ -249,22 +249,22 @@ AtlasTextureInfo TextureCache::AllocateImage(sint32 imageWidth, sint32 imageHeig
|
|||
return _atlases.back().Allocate(imageWidth, imageHeight);
|
||||
}
|
||||
|
||||
rct_drawpixelinfo TextureCache::GetImageAsDPI(uint32 image, uint32 tertiaryColour)
|
||||
rct_drawpixelinfo TextureCache::GetImageAsDPI(uint32_t image, uint32_t tertiaryColour)
|
||||
{
|
||||
auto g1Element = gfx_get_g1_element(image & 0x7FFFF);
|
||||
sint32 width = g1Element->width;
|
||||
sint32 height = g1Element->height;
|
||||
int32_t width = g1Element->width;
|
||||
int32_t height = g1Element->height;
|
||||
|
||||
rct_drawpixelinfo dpi = CreateDPI(width, height);
|
||||
gfx_draw_sprite_software(&dpi, image, -g1Element->x_offset, -g1Element->y_offset, tertiaryColour);
|
||||
return dpi;
|
||||
}
|
||||
|
||||
rct_drawpixelinfo TextureCache::GetGlyphAsDPI(uint32 image, uint8 * palette)
|
||||
rct_drawpixelinfo TextureCache::GetGlyphAsDPI(uint32_t image, uint8_t * palette)
|
||||
{
|
||||
auto g1Element = gfx_get_g1_element(image & 0x7FFFF);
|
||||
sint32 width = g1Element->width;
|
||||
sint32 height = g1Element->height;
|
||||
int32_t width = g1Element->width;
|
||||
int32_t height = g1Element->height;
|
||||
|
||||
rct_drawpixelinfo dpi = CreateDPI(width, height);
|
||||
gfx_draw_sprite_palette_set_software(&dpi, image, -g1Element->x_offset, -g1Element->y_offset, palette, nullptr);
|
||||
|
@ -279,10 +279,10 @@ void TextureCache::FreeTextures()
|
|||
std::fill(_indexMap.begin(), _indexMap.end(), UNUSED_INDEX);
|
||||
}
|
||||
|
||||
rct_drawpixelinfo TextureCache::CreateDPI(sint32 width, sint32 height)
|
||||
rct_drawpixelinfo TextureCache::CreateDPI(int32_t width, int32_t height)
|
||||
{
|
||||
size_t numPixels = width * height;
|
||||
auto pixels8 = new uint8[numPixels];
|
||||
auto pixels8 = new uint8_t[numPixels];
|
||||
std::fill_n(pixels8, numPixels, 0);
|
||||
|
||||
rct_drawpixelinfo dpi;
|
||||
|
@ -311,7 +311,7 @@ GLuint TextureCache::GetPaletteTexture()
|
|||
return _paletteTexture;
|
||||
}
|
||||
|
||||
GLint TextureCache::PaletteToY(uint32 palette)
|
||||
GLint TextureCache::PaletteToY(uint32_t palette)
|
||||
{
|
||||
return palette > PALETTE_WATER ? palette + 5 : palette + 1;
|
||||
}
|
||||
|
|
|
@ -21,8 +21,8 @@ struct rct_drawpixelinfo;
|
|||
|
||||
struct GlyphId
|
||||
{
|
||||
uint32 Image;
|
||||
uint64 Palette;
|
||||
uint32_t Image;
|
||||
uint64_t Palette;
|
||||
|
||||
struct Hash
|
||||
{
|
||||
|
@ -47,11 +47,11 @@ struct GlyphId
|
|||
|
||||
// This is the maximum width and height of each atlas, basically the
|
||||
// granularity at which new atlases are allocated (2048 -> 4 MB of VRAM)
|
||||
constexpr sint32 TEXTURE_CACHE_MAX_ATLAS_SIZE = 2048;
|
||||
constexpr int32_t TEXTURE_CACHE_MAX_ATLAS_SIZE = 2048;
|
||||
|
||||
// Pixel dimensions of smallest supported slots in texture atlases
|
||||
// Must be a power of 2!
|
||||
constexpr sint32 TEXTURE_CACHE_SMALLEST_SLOT = 32;
|
||||
constexpr int32_t TEXTURE_CACHE_SMALLEST_SLOT = 32;
|
||||
|
||||
struct BasicTextureInfo
|
||||
{
|
||||
|
@ -64,7 +64,7 @@ struct AtlasTextureInfo : public BasicTextureInfo
|
|||
{
|
||||
GLuint slot;
|
||||
ivec4 bounds;
|
||||
uint32 image;
|
||||
uint32_t image;
|
||||
};
|
||||
|
||||
// Represents a texture atlas that images of a given maximum size can be allocated from
|
||||
|
@ -74,22 +74,22 @@ class Atlas final
|
|||
{
|
||||
private:
|
||||
GLuint _index = 0;
|
||||
sint32 _imageSize = 0;
|
||||
sint32 _atlasWidth = 0;
|
||||
sint32 _atlasHeight = 0;
|
||||
int32_t _imageSize = 0;
|
||||
int32_t _atlasWidth = 0;
|
||||
int32_t _atlasHeight = 0;
|
||||
std::vector<GLuint> _freeSlots;
|
||||
|
||||
sint32 _cols = 0;
|
||||
sint32 _rows = 0;
|
||||
int32_t _cols = 0;
|
||||
int32_t _rows = 0;
|
||||
|
||||
public:
|
||||
Atlas(GLuint index, sint32 imageSize)
|
||||
Atlas(GLuint index, int32_t imageSize)
|
||||
{
|
||||
_index = index;
|
||||
_imageSize = imageSize;
|
||||
}
|
||||
|
||||
void Initialise(sint32 atlasWidth, sint32 atlasHeight)
|
||||
void Initialise(int32_t atlasWidth, int32_t atlasHeight)
|
||||
{
|
||||
_atlasWidth = atlasWidth;
|
||||
_atlasHeight = atlasHeight;
|
||||
|
@ -104,7 +104,7 @@ public:
|
|||
}
|
||||
}
|
||||
|
||||
AtlasTextureInfo Allocate(sint32 actualWidth, sint32 actualHeight)
|
||||
AtlasTextureInfo Allocate(int32_t actualWidth, int32_t actualHeight)
|
||||
{
|
||||
assert(_freeSlots.size() > 0);
|
||||
|
||||
|
@ -131,35 +131,35 @@ public:
|
|||
|
||||
// Checks if specified image would be tightly packed in this atlas
|
||||
// by checking if it is within the right power of 2 range
|
||||
bool IsImageSuitable(sint32 actualWidth, sint32 actualHeight) const
|
||||
bool IsImageSuitable(int32_t actualWidth, int32_t actualHeight) const
|
||||
{
|
||||
sint32 imageOrder = CalculateImageSizeOrder(actualWidth, actualHeight);
|
||||
sint32 atlasOrder = (sint32) log2(_imageSize);
|
||||
int32_t imageOrder = CalculateImageSizeOrder(actualWidth, actualHeight);
|
||||
int32_t atlasOrder = (int32_t) log2(_imageSize);
|
||||
|
||||
return imageOrder == atlasOrder;
|
||||
}
|
||||
|
||||
sint32 GetFreeSlots() const
|
||||
int32_t GetFreeSlots() const
|
||||
{
|
||||
return (sint32) _freeSlots.size();
|
||||
return (int32_t) _freeSlots.size();
|
||||
}
|
||||
|
||||
static sint32 CalculateImageSizeOrder(sint32 actualWidth, sint32 actualHeight)
|
||||
static int32_t CalculateImageSizeOrder(int32_t actualWidth, int32_t actualHeight)
|
||||
{
|
||||
sint32 actualSize = std::max(actualWidth, actualHeight);
|
||||
int32_t actualSize = std::max(actualWidth, actualHeight);
|
||||
|
||||
if (actualSize < TEXTURE_CACHE_SMALLEST_SLOT) {
|
||||
actualSize = TEXTURE_CACHE_SMALLEST_SLOT;
|
||||
}
|
||||
|
||||
return (sint32) ceil(log2f((float) actualSize));
|
||||
return (int32_t) ceil(log2f((float) actualSize));
|
||||
}
|
||||
|
||||
private:
|
||||
ivec4 GetSlotCoordinates(GLuint slot, sint32 actualWidth, sint32 actualHeight) const
|
||||
ivec4 GetSlotCoordinates(GLuint slot, int32_t actualWidth, int32_t actualHeight) const
|
||||
{
|
||||
sint32 row = slot / _cols;
|
||||
sint32 col = slot % _cols;
|
||||
int32_t row = slot / _cols;
|
||||
int32_t col = slot % _cols;
|
||||
|
||||
return ivec4
|
||||
{
|
||||
|
@ -194,32 +194,32 @@ private:
|
|||
std::vector<Atlas> _atlases;
|
||||
std::unordered_map<GlyphId, AtlasTextureInfo, GlyphId::Hash, GlyphId::Equal> _glyphTextureMap;
|
||||
std::vector<AtlasTextureInfo> _textureCache;
|
||||
std::array<uint32, 0x7FFFF> _indexMap;
|
||||
std::array<uint32_t, 0x7FFFF> _indexMap;
|
||||
|
||||
GLuint _paletteTexture = 0;
|
||||
|
||||
public:
|
||||
TextureCache();
|
||||
~TextureCache();
|
||||
void InvalidateImage(uint32 image);
|
||||
BasicTextureInfo GetOrLoadImageTexture(uint32 image);
|
||||
BasicTextureInfo GetOrLoadGlyphTexture(uint32 image, uint8 * palette);
|
||||
void InvalidateImage(uint32_t image);
|
||||
BasicTextureInfo GetOrLoadImageTexture(uint32_t image);
|
||||
BasicTextureInfo GetOrLoadGlyphTexture(uint32_t image, uint8_t * palette);
|
||||
|
||||
GLuint GetAtlasesTexture();
|
||||
GLuint GetPaletteTexture();
|
||||
static GLint PaletteToY(uint32 palette);
|
||||
static GLint PaletteToY(uint32_t palette);
|
||||
|
||||
private:
|
||||
void CreateTextures();
|
||||
void GeneratePaletteTexture();
|
||||
void EnlargeAtlasesTexture(GLuint newEntries);
|
||||
AtlasTextureInfo LoadImageTexture(uint32 image);
|
||||
AtlasTextureInfo LoadGlyphTexture(uint32 image, uint8 * palette);
|
||||
AtlasTextureInfo AllocateImage(sint32 imageWidth, sint32 imageHeight);
|
||||
rct_drawpixelinfo GetImageAsDPI(uint32 image, uint32 tertiaryColour);
|
||||
rct_drawpixelinfo GetGlyphAsDPI(uint32 image, uint8 * palette);
|
||||
AtlasTextureInfo LoadImageTexture(uint32_t image);
|
||||
AtlasTextureInfo LoadGlyphTexture(uint32_t image, uint8_t * palette);
|
||||
AtlasTextureInfo AllocateImage(int32_t imageWidth, int32_t imageHeight);
|
||||
rct_drawpixelinfo GetImageAsDPI(uint32_t image, uint32_t tertiaryColour);
|
||||
rct_drawpixelinfo GetGlyphAsDPI(uint32_t image, uint8_t * palette);
|
||||
void FreeTextures();
|
||||
|
||||
static rct_drawpixelinfo CreateDPI(sint32 width, sint32 height);
|
||||
static rct_drawpixelinfo CreateDPI(int32_t width, int32_t height);
|
||||
static void DeleteDPI(rct_drawpixelinfo dpi);
|
||||
};
|
||||
|
|
|
@ -20,9 +20,9 @@
|
|||
*/
|
||||
struct XData
|
||||
{
|
||||
sint32 xposition;
|
||||
int32_t xposition;
|
||||
bool begin;
|
||||
sint32 top, bottom;
|
||||
int32_t top, bottom;
|
||||
};
|
||||
typedef std::vector<XData> SweepLine;
|
||||
|
||||
|
@ -38,10 +38,10 @@ static inline SweepLine CreateXList(const RectCommandBatch &transparent)
|
|||
|
||||
for (const DrawRectCommand &command : transparent)
|
||||
{
|
||||
sint32 left = std::min(std::max(command.bounds.x, command.clip.x), command.clip.z);
|
||||
sint32 top = std::min(std::max(command.bounds.y, command.clip.y), command.clip.w);
|
||||
sint32 right = std::min(std::max(command.bounds.z, command.clip.x), command.clip.z);
|
||||
sint32 bottom = std::min(std::max(command.bounds.w, command.clip.y), command.clip.w);
|
||||
int32_t left = std::min(std::max(command.bounds.x, command.clip.x), command.clip.z);
|
||||
int32_t top = std::min(std::max(command.bounds.y, command.clip.y), command.clip.w);
|
||||
int32_t right = std::min(std::max(command.bounds.z, command.clip.x), command.clip.z);
|
||||
int32_t bottom = std::min(std::max(command.bounds.w, command.clip.y), command.clip.w);
|
||||
|
||||
assert(left <= right);
|
||||
assert(top <= bottom);
|
||||
|
@ -70,15 +70,15 @@ static inline SweepLine CreateXList(const RectCommandBatch &transparent)
|
|||
*/
|
||||
struct YData
|
||||
{
|
||||
sint32 count, depth;
|
||||
int32_t count, depth;
|
||||
};
|
||||
typedef std::map<sint32, YData> IntervalTree;
|
||||
typedef std::map<int32_t, YData> IntervalTree;
|
||||
|
||||
/*
|
||||
* Inserts the interval's top endpoint into the interval tree. If the endpoint
|
||||
* already exists in the interval tree, it stacks the endpoints.
|
||||
*/
|
||||
static inline IntervalTree::iterator InsertTopEndpoint(IntervalTree &y_intersect, sint32 top)
|
||||
static inline IntervalTree::iterator InsertTopEndpoint(IntervalTree &y_intersect, int32_t top)
|
||||
{
|
||||
auto top_in = y_intersect.insert({top, {1, 0}});
|
||||
IntervalTree::iterator top_it = top_in.first;
|
||||
|
@ -102,7 +102,7 @@ static inline IntervalTree::iterator InsertTopEndpoint(IntervalTree &y_intersect
|
|||
* endpoint already exists in the interval tree, it stacks the endpoint.
|
||||
* This function can produce a new maximum depth.
|
||||
*/
|
||||
static inline IntervalTree::iterator InsertBottomEndpoint(IntervalTree &y_intersect, sint32 bottom)
|
||||
static inline IntervalTree::iterator InsertBottomEndpoint(IntervalTree &y_intersect, int32_t bottom)
|
||||
{
|
||||
auto bottom_in = y_intersect.insert({bottom, {1, 1}});
|
||||
IntervalTree::iterator bottom_it = bottom_in.first;
|
||||
|
@ -158,9 +158,9 @@ static inline void RemoveBottomEndpoint(IntervalTree &y_intersect, IntervalTree:
|
|||
* to render the command batch. It will never underestimate the number of
|
||||
* iterations, but it can overestimate, usually by no more than +2.
|
||||
*/
|
||||
sint32 MaxTransparencyDepth(const RectCommandBatch &transparent)
|
||||
int32_t MaxTransparencyDepth(const RectCommandBatch &transparent)
|
||||
{
|
||||
sint32 max_depth = 1;
|
||||
int32_t max_depth = 1;
|
||||
SweepLine x_sweep = CreateXList(transparent);
|
||||
IntervalTree y_intersect{};
|
||||
|
||||
|
|
|
@ -17,4 +17,4 @@
|
|||
* to render the command batch. It will never underestimate the number of
|
||||
* iterations, but it can overestimate, usually by no more than +2.
|
||||
*/
|
||||
sint32 MaxTransparencyDepth(const RectCommandBatch &transparent);
|
||||
int32_t MaxTransparencyDepth(const RectCommandBatch &transparent);
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
using namespace OpenRCT2::Ui;
|
||||
|
||||
static void input_handle_console(sint32 key)
|
||||
static void input_handle_console(int32_t key)
|
||||
{
|
||||
CONSOLE_INPUT input = CONSOLE_INPUT_NONE;
|
||||
switch (key)
|
||||
|
@ -56,7 +56,7 @@ static void input_handle_console(sint32 key)
|
|||
}
|
||||
}
|
||||
|
||||
static void input_handle_chat(sint32 key)
|
||||
static void input_handle_chat(int32_t key)
|
||||
{
|
||||
CHAT_INPUT input = CHAT_INPUT_NONE;
|
||||
switch (key)
|
||||
|
@ -77,7 +77,7 @@ static void input_handle_chat(sint32 key)
|
|||
static void game_handle_key_scroll()
|
||||
{
|
||||
rct_window * mainWindow;
|
||||
sint32 scrollX, scrollY;
|
||||
int32_t scrollX, scrollY;
|
||||
|
||||
mainWindow = window_get_main();
|
||||
if (mainWindow == nullptr)
|
||||
|
@ -97,7 +97,7 @@ static void game_handle_key_scroll()
|
|||
|
||||
scrollX = 0;
|
||||
scrollY = 0;
|
||||
const uint8 * keysState = context_get_keys_state();
|
||||
const uint8_t * keysState = context_get_keys_state();
|
||||
get_keyboard_map_scroll(keysState, &scrollX, &scrollY);
|
||||
|
||||
if (scrollX != 0 || scrollY != 0)
|
||||
|
@ -107,7 +107,7 @@ static void game_handle_key_scroll()
|
|||
input_scroll_viewport(scrollX, scrollY);
|
||||
}
|
||||
|
||||
static sint32 input_scancode_to_rct_keycode(sint32 sdl_key)
|
||||
static int32_t input_scancode_to_rct_keycode(int32_t sdl_key)
|
||||
{
|
||||
char keycode = (char)SDL_GetKeyFromScancode((SDL_Scancode)sdl_key);
|
||||
|
||||
|
@ -144,7 +144,7 @@ void input_handle_keyboard(bool isTitle)
|
|||
|
||||
// Handle modifier keys and key scrolling
|
||||
gInputPlaceObjectModifier = PLACE_OBJECT_MODIFIER_NONE;
|
||||
const uint8 * keysState = context_get_keys_state();
|
||||
const uint8_t * keysState = context_get_keys_state();
|
||||
if (keysState[SDL_SCANCODE_LSHIFT] || keysState[SDL_SCANCODE_RSHIFT])
|
||||
{
|
||||
gInputPlaceObjectModifier |= PLACE_OBJECT_MODIFIER_SHIFT_Z;
|
||||
|
@ -178,7 +178,7 @@ void input_handle_keyboard(bool isTitle)
|
|||
}
|
||||
|
||||
// Handle key input
|
||||
sint32 key;
|
||||
int32_t key;
|
||||
while (!gOpenRCT2Headless && (key = get_next_key()) != 0)
|
||||
{
|
||||
if (key == 255)
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
#include <openrct2/world/Park.h>
|
||||
#include "KeyboardShortcuts.h"
|
||||
|
||||
uint8 gKeyboardShortcutChangeId;
|
||||
uint8_t gKeyboardShortcutChangeId;
|
||||
|
||||
using shortcut_action = void (*)();
|
||||
|
||||
|
@ -45,18 +45,18 @@ namespace
|
|||
*
|
||||
* rct2: 0x006E3E68
|
||||
*/
|
||||
void keyboard_shortcut_handle(sint32 key)
|
||||
void keyboard_shortcut_handle(int32_t key)
|
||||
{
|
||||
sint32 shortcut = keyboard_shortcuts_get_from_key(key);
|
||||
int32_t shortcut = keyboard_shortcuts_get_from_key(key);
|
||||
if (shortcut != -1)
|
||||
{
|
||||
keyboard_shortcut_handle_command(shortcut);
|
||||
}
|
||||
}
|
||||
|
||||
void keyboard_shortcut_handle_command(sint32 shortcutIndex)
|
||||
void keyboard_shortcut_handle_command(int32_t shortcutIndex)
|
||||
{
|
||||
if (shortcutIndex >= 0 && static_cast<uint32>(shortcutIndex) < Util::CountOf(shortcut_table))
|
||||
if (shortcutIndex >= 0 && static_cast<uint32_t>(shortcutIndex) < Util::CountOf(shortcut_table))
|
||||
{
|
||||
shortcut_action action = shortcut_table[shortcutIndex];
|
||||
if (action != nullptr)
|
||||
|
@ -68,7 +68,7 @@ void keyboard_shortcut_handle_command(sint32 shortcutIndex)
|
|||
|
||||
#pragma region Shortcut Commands
|
||||
|
||||
static void toggle_view_flag(sint32 viewportFlag)
|
||||
static void toggle_view_flag(int32_t viewportFlag)
|
||||
{
|
||||
rct_window * window;
|
||||
|
||||
|
|
|
@ -54,14 +54,14 @@ bool KeyboardShortcuts::Load()
|
|||
if (File::Exists(path))
|
||||
{
|
||||
auto fs = FileStream(path, FILE_MODE_OPEN);
|
||||
uint16 version = fs.ReadValue<uint16>();
|
||||
uint16_t version = fs.ReadValue<uint16_t>();
|
||||
if (version == KeyboardShortcuts::CURRENT_FILE_VERSION)
|
||||
{
|
||||
sint32 numShortcutsInFile = (fs.GetLength() - sizeof(uint16)) / sizeof(uint16);
|
||||
sint32 numShortcutsToRead = std::min<sint32>(SHORTCUT_COUNT, numShortcutsInFile);
|
||||
for (sint32 i = 0; i < numShortcutsToRead; i++)
|
||||
int32_t numShortcutsInFile = (fs.GetLength() - sizeof(uint16_t)) / sizeof(uint16_t);
|
||||
int32_t numShortcutsToRead = std::min<int32_t>(SHORTCUT_COUNT, numShortcutsInFile);
|
||||
for (int32_t i = 0; i < numShortcutsToRead; i++)
|
||||
{
|
||||
_keys[i] = fs.ReadValue<uint16>();
|
||||
_keys[i] = fs.ReadValue<uint16_t>();
|
||||
}
|
||||
result = true;
|
||||
}
|
||||
|
@ -81,10 +81,10 @@ bool KeyboardShortcuts::Save()
|
|||
{
|
||||
std::string path = _env->GetFilePath(PATHID::CONFIG_KEYBOARD);
|
||||
auto fs = FileStream(path, FILE_MODE_WRITE);
|
||||
fs.WriteValue<uint16>(KeyboardShortcuts::CURRENT_FILE_VERSION);
|
||||
for (sint32 i = 0; i < SHORTCUT_COUNT; i++)
|
||||
fs.WriteValue<uint16_t>(KeyboardShortcuts::CURRENT_FILE_VERSION);
|
||||
for (int32_t i = 0; i < SHORTCUT_COUNT; i++)
|
||||
{
|
||||
fs.WriteValue<uint16>(_keys[i]);
|
||||
fs.WriteValue<uint16_t>(_keys[i]);
|
||||
}
|
||||
result = true;
|
||||
}
|
||||
|
@ -95,10 +95,10 @@ bool KeyboardShortcuts::Save()
|
|||
return result;
|
||||
}
|
||||
|
||||
void KeyboardShortcuts::Set(sint32 key)
|
||||
void KeyboardShortcuts::Set(int32_t key)
|
||||
{
|
||||
// Unmap shortcut that already uses this key
|
||||
sint32 shortcut = GetFromKey(key);
|
||||
int32_t shortcut = GetFromKey(key);
|
||||
if (shortcut != SHORTCUT_UNDEFINED)
|
||||
{
|
||||
_keys[shortcut] = SHORTCUT_UNDEFINED;
|
||||
|
@ -109,9 +109,9 @@ void KeyboardShortcuts::Set(sint32 key)
|
|||
Save();
|
||||
}
|
||||
|
||||
sint32 KeyboardShortcuts::GetFromKey(sint32 key)
|
||||
int32_t KeyboardShortcuts::GetFromKey(int32_t key)
|
||||
{
|
||||
for (sint32 i = 0; i < SHORTCUT_COUNT; i++)
|
||||
for (int32_t i = 0; i < SHORTCUT_COUNT; i++)
|
||||
{
|
||||
if (key == _keys[i])
|
||||
{
|
||||
|
@ -121,11 +121,11 @@ sint32 KeyboardShortcuts::GetFromKey(sint32 key)
|
|||
return SHORTCUT_UNDEFINED;
|
||||
}
|
||||
|
||||
std::string KeyboardShortcuts::GetShortcutString(sint32 shortcut) const
|
||||
std::string KeyboardShortcuts::GetShortcutString(int32_t shortcut) const
|
||||
{
|
||||
utf8 buffer[256] = { 0 };
|
||||
utf8 formatBuffer[256] = { 0 };
|
||||
uint16 shortcutKey = _keys[shortcut];
|
||||
uint16_t shortcutKey = _keys[shortcut];
|
||||
if (shortcutKey == SHORTCUT_UNDEFINED) return std::string();
|
||||
if (shortcutKey & SHIFT)
|
||||
{
|
||||
|
@ -155,12 +155,12 @@ std::string KeyboardShortcuts::GetShortcutString(sint32 shortcut) const
|
|||
return std::string(buffer);
|
||||
}
|
||||
|
||||
void KeyboardShortcuts::GetKeyboardMapScroll(const uint8 * keysState, sint32 * x, sint32 * y) const
|
||||
void KeyboardShortcuts::GetKeyboardMapScroll(const uint8_t * keysState, int32_t * x, int32_t * y) const
|
||||
{
|
||||
for (sint32 shortcutId = SHORTCUT_SCROLL_MAP_UP; shortcutId <= SHORTCUT_SCROLL_MAP_RIGHT; shortcutId++)
|
||||
for (int32_t shortcutId = SHORTCUT_SCROLL_MAP_UP; shortcutId <= SHORTCUT_SCROLL_MAP_RIGHT; shortcutId++)
|
||||
{
|
||||
uint16 shortcutKey = _keys[shortcutId];
|
||||
uint8 scancode = shortcutKey & 0xFF;
|
||||
uint16_t shortcutKey = _keys[shortcutId];
|
||||
uint8_t scancode = shortcutKey & 0xFF;
|
||||
|
||||
if (shortcutKey == 0xFFFF) continue;
|
||||
if (!keysState[scancode]) continue;
|
||||
|
@ -213,30 +213,30 @@ bool keyboard_shortcuts_save()
|
|||
return _instance->Save();
|
||||
}
|
||||
|
||||
void keyboard_shortcuts_set(sint32 key)
|
||||
void keyboard_shortcuts_set(int32_t key)
|
||||
{
|
||||
return _instance->Set(key);
|
||||
}
|
||||
|
||||
sint32 keyboard_shortcuts_get_from_key(sint32 key)
|
||||
int32_t keyboard_shortcuts_get_from_key(int32_t key)
|
||||
{
|
||||
return _instance->GetFromKey(key);
|
||||
}
|
||||
|
||||
void keyboard_shortcuts_format_string(char * buffer, size_t bufferSize, sint32 shortcut)
|
||||
void keyboard_shortcuts_format_string(char * buffer, size_t bufferSize, int32_t shortcut)
|
||||
{
|
||||
auto str = _instance->GetShortcutString(shortcut);
|
||||
String::Set(buffer, bufferSize, str.c_str());
|
||||
}
|
||||
|
||||
void get_keyboard_map_scroll(const uint8 * keysState, sint32 * x, sint32 * y)
|
||||
void get_keyboard_map_scroll(const uint8_t * keysState, int32_t * x, int32_t * y)
|
||||
{
|
||||
_instance->GetKeyboardMapScroll(keysState, x, y);
|
||||
}
|
||||
|
||||
|
||||
// Default keyboard shortcuts
|
||||
const uint16 KeyboardShortcuts::DefaultKeys[SHORTCUT_COUNT] =
|
||||
const uint16_t KeyboardShortcuts::DefaultKeys[SHORTCUT_COUNT] =
|
||||
{
|
||||
SDL_SCANCODE_BACKSPACE, // SHORTCUT_CLOSE_TOP_MOST_WINDOW
|
||||
SHIFT | SDL_SCANCODE_BACKSPACE, // SHORTCUT_CLOSE_ALL_FLOATING_WINDOWS
|
||||
|
|
|
@ -110,11 +110,11 @@ namespace OpenRCT2
|
|||
class KeyboardShortcuts
|
||||
{
|
||||
private:
|
||||
constexpr static sint32 CURRENT_FILE_VERSION = 1;
|
||||
static const uint16 DefaultKeys[SHORTCUT_COUNT];
|
||||
constexpr static int32_t CURRENT_FILE_VERSION = 1;
|
||||
static const uint16_t DefaultKeys[SHORTCUT_COUNT];
|
||||
|
||||
std::shared_ptr<IPlatformEnvironment> const _env;
|
||||
uint16 _keys[SHORTCUT_COUNT];
|
||||
uint16_t _keys[SHORTCUT_COUNT];
|
||||
|
||||
public:
|
||||
KeyboardShortcuts(const std::shared_ptr<IPlatformEnvironment>& env);
|
||||
|
@ -124,28 +124,28 @@ namespace OpenRCT2
|
|||
bool Load();
|
||||
bool Save();
|
||||
|
||||
std::string GetShortcutString(sint32 shortcut) const;
|
||||
std::string GetShortcutString(int32_t shortcut) const;
|
||||
|
||||
void Set(sint32 key);
|
||||
sint32 GetFromKey(sint32 key);
|
||||
void GetKeyboardMapScroll(const uint8 * keysState, sint32 * x, sint32 * y) const;
|
||||
void Set(int32_t key);
|
||||
int32_t GetFromKey(int32_t key);
|
||||
void GetKeyboardMapScroll(const uint8_t * keysState, int32_t * x, int32_t * y) const;
|
||||
};
|
||||
} // namespace Input
|
||||
} // namespace OpenRCT2
|
||||
|
||||
/** The current shortcut being changed. */
|
||||
extern uint8 gKeyboardShortcutChangeId;
|
||||
extern uint8_t gKeyboardShortcutChangeId;
|
||||
extern const rct_string_id ShortcutStringIds[SHORTCUT_COUNT];
|
||||
|
||||
void keyboard_shortcuts_reset();
|
||||
bool keyboard_shortcuts_load();
|
||||
bool keyboard_shortcuts_save();
|
||||
void keyboard_shortcuts_set(sint32 key);
|
||||
sint32 keyboard_shortcuts_get_from_key(sint32 key);
|
||||
void keyboard_shortcuts_format_string(char * buffer, size_t bufferSize, sint32 shortcut);
|
||||
void keyboard_shortcuts_set(int32_t key);
|
||||
int32_t keyboard_shortcuts_get_from_key(int32_t key);
|
||||
void keyboard_shortcuts_format_string(char * buffer, size_t bufferSize, int32_t shortcut);
|
||||
|
||||
void keyboard_shortcut_handle(sint32 key);
|
||||
void keyboard_shortcut_handle_command(sint32 shortcutIndex);
|
||||
void keyboard_shortcut_format_string(char *buffer, size_t size, uint16 shortcutKey);
|
||||
void keyboard_shortcut_handle(int32_t key);
|
||||
void keyboard_shortcut_handle_command(int32_t shortcutIndex);
|
||||
void keyboard_shortcut_format_string(char *buffer, size_t size, uint16_t shortcutKey);
|
||||
|
||||
void get_keyboard_map_scroll(const uint8 * keysState, sint32 * x, sint32 * y);
|
||||
void get_keyboard_map_scroll(const uint8_t * keysState, int32_t * x, int32_t * y);
|
||||
|
|
|
@ -36,67 +36,67 @@
|
|||
|
||||
struct rct_mouse_data
|
||||
{
|
||||
uint32 x;
|
||||
uint32 y;
|
||||
uint32 state;
|
||||
uint32_t x;
|
||||
uint32_t y;
|
||||
uint32_t state;
|
||||
};
|
||||
|
||||
static rct_mouse_data _mouseInputQueue[64];
|
||||
static uint8 _mouseInputQueueReadIndex = 0;
|
||||
static uint8 _mouseInputQueueWriteIndex = 0;
|
||||
static uint8_t _mouseInputQueueReadIndex = 0;
|
||||
static uint8_t _mouseInputQueueWriteIndex = 0;
|
||||
|
||||
static uint32 _ticksSinceDragStart;
|
||||
static uint32_t _ticksSinceDragStart;
|
||||
static widget_ref _dragWidget;
|
||||
static uint8 _dragScrollIndex;
|
||||
static sint32 _originalWindowWidth;
|
||||
static sint32 _originalWindowHeight;
|
||||
static uint8_t _dragScrollIndex;
|
||||
static int32_t _originalWindowWidth;
|
||||
static int32_t _originalWindowHeight;
|
||||
|
||||
static uint8 _currentScrollIndex;
|
||||
static uint8 _currentScrollArea;
|
||||
static uint8_t _currentScrollIndex;
|
||||
static uint8_t _currentScrollArea;
|
||||
|
||||
sint32 gInputDragLastX;
|
||||
sint32 gInputDragLastY;
|
||||
int32_t gInputDragLastX;
|
||||
int32_t gInputDragLastY;
|
||||
|
||||
uint16 gTooltipTimeout;
|
||||
uint16_t gTooltipTimeout;
|
||||
widget_ref gTooltipWidget;
|
||||
sint32 gTooltipCursorX;
|
||||
sint32 gTooltipCursorY;
|
||||
int32_t gTooltipCursorX;
|
||||
int32_t gTooltipCursorY;
|
||||
|
||||
static sint16 _clickRepeatTicks;
|
||||
static int16_t _clickRepeatTicks;
|
||||
|
||||
static sint32 game_get_next_input(sint32 * x, sint32 * y);
|
||||
static void input_widget_over(sint32 x, sint32 y, rct_window * w, rct_widgetindex widgetIndex);
|
||||
static int32_t game_get_next_input(int32_t * x, int32_t * y);
|
||||
static void input_widget_over(int32_t x, int32_t y, rct_window * w, rct_widgetindex widgetIndex);
|
||||
static void input_widget_over_change_check(rct_windowclass windowClass, rct_windownumber windowNumber,
|
||||
rct_widgetindex widgetIndex);
|
||||
static void input_widget_over_flatbutton_invalidate();
|
||||
void process_mouse_over(sint32 x, sint32 y);
|
||||
void process_mouse_tool(sint32 x, sint32 y);
|
||||
void process_mouse_over(int32_t x, int32_t y);
|
||||
void process_mouse_tool(int32_t x, int32_t y);
|
||||
void invalidate_scroll();
|
||||
static rct_mouse_data * get_mouse_input();
|
||||
void tile_element_right_click(sint32 type, rct_tile_element * tileElement, sint32 x, sint32 y);
|
||||
static void game_handle_input_mouse(sint32 x, sint32 y, sint32 state);
|
||||
static void input_widget_left(sint32 x, sint32 y, rct_window * w, rct_widgetindex widgetIndex);
|
||||
void input_state_widget_pressed(sint32 x, sint32 y, sint32 state, rct_widgetindex widgetIndex, rct_window * w,
|
||||
void tile_element_right_click(int32_t type, rct_tile_element * tileElement, int32_t x, int32_t y);
|
||||
static void game_handle_input_mouse(int32_t x, int32_t y, int32_t state);
|
||||
static void input_widget_left(int32_t x, int32_t y, rct_window * w, rct_widgetindex widgetIndex);
|
||||
void input_state_widget_pressed(int32_t x, int32_t y, int32_t state, rct_widgetindex widgetIndex, rct_window * w,
|
||||
rct_widget * widget);
|
||||
void set_cursor(uint8 cursor_id);
|
||||
static void input_window_position_continue(rct_window * w, sint32 lastX, sint32 lastY, sint32 newX, sint32 newY);
|
||||
static void input_window_position_end(rct_window * w, sint32 x, sint32 y);
|
||||
static void input_window_resize_begin(rct_window * w, rct_widgetindex widgetIndex, sint32 x, sint32 y);
|
||||
static void input_window_resize_continue(rct_window * w, sint32 x, sint32 y);
|
||||
void set_cursor(uint8_t cursor_id);
|
||||
static void input_window_position_continue(rct_window * w, int32_t lastX, int32_t lastY, int32_t newX, int32_t newY);
|
||||
static void input_window_position_end(rct_window * w, int32_t x, int32_t y);
|
||||
static void input_window_resize_begin(rct_window * w, rct_widgetindex widgetIndex, int32_t x, int32_t y);
|
||||
static void input_window_resize_continue(rct_window * w, int32_t x, int32_t y);
|
||||
static void input_window_resize_end();
|
||||
static void input_viewport_drag_begin(rct_window * w);
|
||||
static void input_viewport_drag_continue();
|
||||
static void input_viewport_drag_end();
|
||||
static void input_scroll_begin(rct_window * w, rct_widgetindex widgetIndex, sint32 x, sint32 y);
|
||||
static void input_scroll_continue(rct_window * w, rct_widgetindex widgetIndex, sint32 x, sint32 y);
|
||||
static void input_scroll_begin(rct_window * w, rct_widgetindex widgetIndex, int32_t x, int32_t y);
|
||||
static void input_scroll_continue(rct_window * w, rct_widgetindex widgetIndex, int32_t x, int32_t y);
|
||||
static void input_scroll_end();
|
||||
static void input_scroll_part_update_hthumb(rct_window * w, rct_widgetindex widgetIndex, sint32 x, sint32 scroll_id);
|
||||
static void input_scroll_part_update_hleft(rct_window * w, rct_widgetindex widgetIndex, sint32 scroll_id);
|
||||
static void input_scroll_part_update_hright(rct_window * w, rct_widgetindex widgetIndex, sint32 scroll_id);
|
||||
static void input_scroll_part_update_vthumb(rct_window * w, rct_widgetindex widgetIndex, sint32 y, sint32 scroll_id);
|
||||
static void input_scroll_part_update_vtop(rct_window * w, rct_widgetindex widgetIndex, sint32 scroll_id);
|
||||
static void input_scroll_part_update_vbottom(rct_window * w, rct_widgetindex widgetIndex, sint32 scroll_id);
|
||||
static void input_update_tooltip(rct_window * w, rct_widgetindex widgetIndex, sint32 x, sint32 y);
|
||||
static void input_scroll_part_update_hthumb(rct_window * w, rct_widgetindex widgetIndex, int32_t x, int32_t scroll_id);
|
||||
static void input_scroll_part_update_hleft(rct_window * w, rct_widgetindex widgetIndex, int32_t scroll_id);
|
||||
static void input_scroll_part_update_hright(rct_window * w, rct_widgetindex widgetIndex, int32_t scroll_id);
|
||||
static void input_scroll_part_update_vthumb(rct_window * w, rct_widgetindex widgetIndex, int32_t y, int32_t scroll_id);
|
||||
static void input_scroll_part_update_vtop(rct_window * w, rct_widgetindex widgetIndex, int32_t scroll_id);
|
||||
static void input_scroll_part_update_vbottom(rct_window * w, rct_widgetindex widgetIndex, int32_t scroll_id);
|
||||
static void input_update_tooltip(rct_window * w, rct_widgetindex widgetIndex, int32_t x, int32_t y);
|
||||
|
||||
#pragma region Mouse input
|
||||
|
||||
|
@ -113,7 +113,7 @@ void game_handle_input()
|
|||
|
||||
invalidate_all_windows_after_input();
|
||||
|
||||
sint32 x, y, state;
|
||||
int32_t x, y, state;
|
||||
while ((state = game_get_next_input(&x, &y)) != MOUSE_STATE_RELEASED)
|
||||
{
|
||||
game_handle_input_mouse(x, y, state & 0xFF);
|
||||
|
@ -125,8 +125,8 @@ void game_handle_input()
|
|||
}
|
||||
else if (x != MONEY32_UNDEFINED)
|
||||
{
|
||||
sint32 screenWidth = context_get_width();
|
||||
sint32 screenHeight = context_get_height();
|
||||
int32_t screenWidth = context_get_width();
|
||||
int32_t screenHeight = context_get_height();
|
||||
x = Math::Clamp(0, x, screenWidth - 1);
|
||||
y = Math::Clamp(0, y, screenHeight - 1);
|
||||
|
||||
|
@ -145,7 +145,7 @@ void game_handle_input()
|
|||
*
|
||||
* rct2: 0x006E83C7
|
||||
*/
|
||||
static sint32 game_get_next_input(sint32 * x, sint32 * y)
|
||||
static int32_t game_get_next_input(int32_t * x, int32_t * y)
|
||||
{
|
||||
rct_mouse_data * input = get_mouse_input();
|
||||
if (input == nullptr)
|
||||
|
@ -186,7 +186,7 @@ static rct_mouse_data * get_mouse_input()
|
|||
*
|
||||
* rct2: 0x006E957F
|
||||
*/
|
||||
static void input_scroll_drag_begin(sint32 x, sint32 y, rct_window * w, rct_widgetindex widgetIndex)
|
||||
static void input_scroll_drag_begin(int32_t x, int32_t y, rct_window * w, rct_widgetindex widgetIndex)
|
||||
{
|
||||
_inputState = INPUT_STATE_SCROLL_RIGHT;
|
||||
gInputDragLastX = x;
|
||||
|
@ -204,41 +204,41 @@ static void input_scroll_drag_begin(sint32 x, sint32 y, rct_window * w, rct_widg
|
|||
* Based on (heavily changed)
|
||||
* rct2: 0x006E9E0E, 0x006E9ED0
|
||||
*/
|
||||
static void input_scroll_drag_continue(sint32 x, sint32 y, rct_window * w)
|
||||
static void input_scroll_drag_continue(int32_t x, int32_t y, rct_window * w)
|
||||
{
|
||||
rct_widgetindex widgetIndex = _dragWidget.widget_index;
|
||||
uint8 scrollIndex = _dragScrollIndex;
|
||||
uint8_t scrollIndex = _dragScrollIndex;
|
||||
|
||||
rct_widget * widget = &w->widgets[widgetIndex];
|
||||
rct_scroll * scroll = &w->scrolls[scrollIndex];
|
||||
|
||||
sint32 dx, dy;
|
||||
int32_t dx, dy;
|
||||
dx = x - gInputDragLastX;
|
||||
dy = y - gInputDragLastY;
|
||||
|
||||
if (scroll->flags & HSCROLLBAR_VISIBLE)
|
||||
{
|
||||
sint16 size = widget->right - widget->left - 1;
|
||||
int16_t size = widget->right - widget->left - 1;
|
||||
if (scroll->flags & VSCROLLBAR_VISIBLE)
|
||||
size -= 11;
|
||||
size = std::max(0, scroll->h_right - size);
|
||||
scroll->h_left = std::min<uint16>(std::max(0, scroll->h_left + dx), size);
|
||||
scroll->h_left = std::min<uint16_t>(std::max(0, scroll->h_left + dx), size);
|
||||
}
|
||||
|
||||
if (scroll->flags & VSCROLLBAR_VISIBLE)
|
||||
{
|
||||
sint16 size = widget->bottom - widget->top - 1;
|
||||
int16_t size = widget->bottom - widget->top - 1;
|
||||
if (scroll->flags & HSCROLLBAR_VISIBLE)
|
||||
size -= 11;
|
||||
size = std::max(0, scroll->v_bottom - size);
|
||||
scroll->v_top = std::min<uint16>(std::max(0, scroll->v_top + dy), size);
|
||||
scroll->v_top = std::min<uint16_t>(std::max(0, scroll->v_top + dy), size);
|
||||
}
|
||||
|
||||
widget_scroll_update_thumbs(w, widgetIndex);
|
||||
window_invalidate_by_number(w->classification, w->number);
|
||||
|
||||
sint32 fixedCursorPositionX = (sint32)std::ceil(gInputDragLastX * gConfigGeneral.window_scale);
|
||||
sint32 fixedCursorPositionY = (sint32)std::ceil(gInputDragLastY * gConfigGeneral.window_scale);
|
||||
int32_t fixedCursorPositionX = (int32_t)std::ceil(gInputDragLastX * gConfigGeneral.window_scale);
|
||||
int32_t fixedCursorPositionY = (int32_t)std::ceil(gInputDragLastY * gConfigGeneral.window_scale);
|
||||
|
||||
context_set_cursor_position(fixedCursorPositionX, fixedCursorPositionY);
|
||||
}
|
||||
|
@ -247,7 +247,7 @@ static void input_scroll_drag_continue(sint32 x, sint32 y, rct_window * w)
|
|||
*
|
||||
* rct2: 0x006E8ACB
|
||||
*/
|
||||
static void input_scroll_right(sint32 x, sint32 y, sint32 state)
|
||||
static void input_scroll_right(int32_t x, int32_t y, int32_t state)
|
||||
{
|
||||
rct_window * w = window_find_by_number(_dragWidget.window_classification, _dragWidget.window_number);
|
||||
if (w == nullptr)
|
||||
|
@ -278,7 +278,7 @@ static void input_scroll_right(sint32 x, sint32 y, sint32 state)
|
|||
*
|
||||
* rct2: 0x006E8655
|
||||
*/
|
||||
static void game_handle_input_mouse(sint32 x, sint32 y, sint32 state)
|
||||
static void game_handle_input_mouse(int32_t x, int32_t y, int32_t state)
|
||||
{
|
||||
rct_window * w;
|
||||
rct_widget * widget;
|
||||
|
@ -453,7 +453,7 @@ static void game_handle_input_mouse(sint32 x, sint32 y, sint32 state)
|
|||
|
||||
#pragma region Window positioning / resizing
|
||||
|
||||
void input_window_position_begin(rct_window * w, rct_widgetindex widgetIndex, sint32 x, sint32 y)
|
||||
void input_window_position_begin(rct_window * w, rct_widgetindex widgetIndex, int32_t x, int32_t y)
|
||||
{
|
||||
_inputState = INPUT_STATE_POSITIONING_WINDOW;
|
||||
gInputDragLastX = x - w->x;
|
||||
|
@ -463,15 +463,15 @@ void input_window_position_begin(rct_window * w, rct_widgetindex widgetIndex, si
|
|||
_dragWidget.widget_index = widgetIndex;
|
||||
}
|
||||
|
||||
static void input_window_position_continue(rct_window * w, sint32 lastX, sint32 lastY, sint32 newX, sint32 newY)
|
||||
static void input_window_position_continue(rct_window * w, int32_t lastX, int32_t lastY, int32_t newX, int32_t newY)
|
||||
{
|
||||
sint32 snapProximity;
|
||||
int32_t snapProximity;
|
||||
|
||||
snapProximity = (w->flags & WF_NO_SNAPPING) ? 0 : gConfigGeneral.window_snap_proximity;
|
||||
window_move_and_snap(w, newX - lastX, newY - lastY, snapProximity);
|
||||
}
|
||||
|
||||
static void input_window_position_end(rct_window * w, sint32 x, sint32 y)
|
||||
static void input_window_position_end(rct_window * w, int32_t x, int32_t y)
|
||||
{
|
||||
_inputState = INPUT_STATE_NORMAL;
|
||||
gTooltipTimeout = 0;
|
||||
|
@ -479,7 +479,7 @@ static void input_window_position_end(rct_window * w, sint32 x, sint32 y)
|
|||
window_event_moved_call(w, x, y);
|
||||
}
|
||||
|
||||
static void input_window_resize_begin(rct_window * w, rct_widgetindex widgetIndex, sint32 x, sint32 y)
|
||||
static void input_window_resize_begin(rct_window * w, rct_widgetindex widgetIndex, int32_t x, int32_t y)
|
||||
{
|
||||
_inputState = INPUT_STATE_RESIZING;
|
||||
gInputDragLastX = x;
|
||||
|
@ -491,11 +491,11 @@ static void input_window_resize_begin(rct_window * w, rct_widgetindex widgetInde
|
|||
_originalWindowHeight = w->height;
|
||||
}
|
||||
|
||||
static void input_window_resize_continue(rct_window * w, sint32 x, sint32 y)
|
||||
static void input_window_resize_continue(rct_window * w, int32_t x, int32_t y)
|
||||
{
|
||||
if (y < (sint32)context_get_height() - 2)
|
||||
if (y < (int32_t)context_get_height() - 2)
|
||||
{
|
||||
sint32 dx, dy, targetWidth, targetHeight;
|
||||
int32_t dx, dy, targetWidth, targetHeight;
|
||||
dx = x - gInputDragLastX;
|
||||
dy = y - gInputDragLastY;
|
||||
targetWidth = _originalWindowWidth + dx;
|
||||
|
@ -532,7 +532,7 @@ static void input_viewport_drag_begin(rct_window * w)
|
|||
|
||||
static void input_viewport_drag_continue()
|
||||
{
|
||||
sint32 dx, dy, newDragX, newDragY;
|
||||
int32_t dx, dy, newDragX, newDragY;
|
||||
rct_window * w;
|
||||
rct_viewport * viewport;
|
||||
|
||||
|
@ -595,7 +595,7 @@ static void input_viewport_drag_end()
|
|||
|
||||
#pragma region Scroll bars
|
||||
|
||||
static void input_scroll_begin(rct_window * w, rct_widgetindex widgetIndex, sint32 x, sint32 y)
|
||||
static void input_scroll_begin(rct_window * w, rct_widgetindex widgetIndex, int32_t x, int32_t y)
|
||||
{
|
||||
rct_widget * widget;
|
||||
|
||||
|
@ -608,7 +608,7 @@ static void input_scroll_begin(rct_window * w, rct_widgetindex widgetIndex, sint
|
|||
gTooltipCursorX = x;
|
||||
gTooltipCursorY = y;
|
||||
|
||||
sint32 eax, ebx, scroll_area, scroll_id;
|
||||
int32_t eax, ebx, scroll_area, scroll_id;
|
||||
scroll_id = 0; // safety
|
||||
widget_scroll_get_part(w, widget, x, y, &eax, &ebx, &scroll_area, &scroll_id);
|
||||
|
||||
|
@ -624,15 +624,15 @@ static void input_scroll_begin(rct_window * w, rct_widgetindex widgetIndex, sint
|
|||
rct_widget * widg = &w->widgets[widgetIndex];
|
||||
rct_scroll * scroll = &w->scrolls[scroll_id];
|
||||
|
||||
sint32 widget_width = widg->right - widg->left - 1;
|
||||
int32_t widget_width = widg->right - widg->left - 1;
|
||||
if (scroll->flags & VSCROLLBAR_VISIBLE)
|
||||
widget_width -= 11;
|
||||
sint32 widget_content_width = std::max(scroll->h_right - widget_width, 0);
|
||||
int32_t widget_content_width = std::max(scroll->h_right - widget_width, 0);
|
||||
|
||||
sint32 widget_height = widg->bottom - widg->top - 1;
|
||||
int32_t widget_height = widg->bottom - widg->top - 1;
|
||||
if (scroll->flags & HSCROLLBAR_VISIBLE)
|
||||
widget_height -= 11;
|
||||
sint32 widget_content_height = std::max(scroll->v_bottom - widget_height, 0);
|
||||
int32_t widget_content_height = std::max(scroll->v_bottom - widget_height, 0);
|
||||
|
||||
switch (scroll_area)
|
||||
{
|
||||
|
@ -667,11 +667,11 @@ static void input_scroll_begin(rct_window * w, rct_widgetindex widgetIndex, sint
|
|||
window_invalidate_by_number(widgetIndex, w->classification);
|
||||
}
|
||||
|
||||
static void input_scroll_continue(rct_window * w, rct_widgetindex widgetIndex, sint32 x, sint32 y)
|
||||
static void input_scroll_continue(rct_window * w, rct_widgetindex widgetIndex, int32_t x, int32_t y)
|
||||
{
|
||||
rct_widget * widget;
|
||||
sint32 scroll_part, scroll_id;
|
||||
sint32 x2, y2;
|
||||
int32_t scroll_part, scroll_id;
|
||||
int32_t x2, y2;
|
||||
|
||||
assert(w != nullptr);
|
||||
|
||||
|
@ -687,7 +687,7 @@ static void input_scroll_continue(rct_window * w, rct_widgetindex widgetIndex, s
|
|||
|
||||
if (_currentScrollArea == SCROLL_PART_HSCROLLBAR_THUMB)
|
||||
{
|
||||
sint32 originalTooltipCursorX = gTooltipCursorX;
|
||||
int32_t originalTooltipCursorX = gTooltipCursorX;
|
||||
gTooltipCursorX = x;
|
||||
input_scroll_part_update_hthumb(w, widgetIndex, x - originalTooltipCursorX, scroll_id);
|
||||
return;
|
||||
|
@ -695,7 +695,7 @@ static void input_scroll_continue(rct_window * w, rct_widgetindex widgetIndex, s
|
|||
|
||||
if (_currentScrollArea == SCROLL_PART_VSCROLLBAR_THUMB)
|
||||
{
|
||||
sint32 originalTooltipCursorY = gTooltipCursorY;
|
||||
int32_t originalTooltipCursorY = gTooltipCursorY;
|
||||
gTooltipCursorY = y;
|
||||
input_scroll_part_update_vthumb(w, widgetIndex, y - originalTooltipCursorY, scroll_id);
|
||||
return;
|
||||
|
@ -740,13 +740,13 @@ static void input_scroll_end()
|
|||
*
|
||||
* rct2: 0x006E98F2
|
||||
*/
|
||||
static void input_scroll_part_update_hthumb(rct_window * w, rct_widgetindex widgetIndex, sint32 x, sint32 scroll_id)
|
||||
static void input_scroll_part_update_hthumb(rct_window * w, rct_widgetindex widgetIndex, int32_t x, int32_t scroll_id)
|
||||
{
|
||||
rct_widget * widget = &w->widgets[widgetIndex];
|
||||
|
||||
if (window_find_by_number(w->classification, w->number))
|
||||
{
|
||||
sint32 newLeft;
|
||||
int32_t newLeft;
|
||||
newLeft = w->scrolls[scroll_id].h_right;
|
||||
newLeft *= x;
|
||||
x = widget->right - widget->left - 21;
|
||||
|
@ -778,14 +778,14 @@ static void input_scroll_part_update_hthumb(rct_window * w, rct_widgetindex widg
|
|||
*
|
||||
* rct2: 0x006E99A9
|
||||
*/
|
||||
static void input_scroll_part_update_vthumb(rct_window * w, rct_widgetindex widgetIndex, sint32 y, sint32 scroll_id)
|
||||
static void input_scroll_part_update_vthumb(rct_window * w, rct_widgetindex widgetIndex, int32_t y, int32_t scroll_id)
|
||||
{
|
||||
assert(w != nullptr);
|
||||
rct_widget * widget = &w->widgets[widgetIndex];
|
||||
|
||||
if (window_find_by_number(w->classification, w->number))
|
||||
{
|
||||
sint32 newTop;
|
||||
int32_t newTop;
|
||||
newTop = w->scrolls[scroll_id].v_bottom;
|
||||
newTop *= y;
|
||||
y = widget->bottom - widget->top - 21;
|
||||
|
@ -817,7 +817,7 @@ static void input_scroll_part_update_vthumb(rct_window * w, rct_widgetindex widg
|
|||
*
|
||||
* rct2: 0x006E9A60
|
||||
*/
|
||||
static void input_scroll_part_update_hleft(rct_window * w, rct_widgetindex widgetIndex, sint32 scroll_id)
|
||||
static void input_scroll_part_update_hleft(rct_window * w, rct_widgetindex widgetIndex, int32_t scroll_id)
|
||||
{
|
||||
assert(w != nullptr);
|
||||
if (window_find_by_number(w->classification, w->number))
|
||||
|
@ -834,7 +834,7 @@ static void input_scroll_part_update_hleft(rct_window * w, rct_widgetindex widge
|
|||
*
|
||||
* rct2: 0x006E9ABF
|
||||
*/
|
||||
static void input_scroll_part_update_hright(rct_window * w, rct_widgetindex widgetIndex, sint32 scroll_id)
|
||||
static void input_scroll_part_update_hright(rct_window * w, rct_widgetindex widgetIndex, int32_t scroll_id)
|
||||
{
|
||||
assert(w != nullptr);
|
||||
rct_widget * widget = &w->widgets[widgetIndex];
|
||||
|
@ -842,7 +842,7 @@ static void input_scroll_part_update_hright(rct_window * w, rct_widgetindex widg
|
|||
{
|
||||
w->scrolls[scroll_id].flags |= HSCROLLBAR_RIGHT_PRESSED;
|
||||
w->scrolls[scroll_id].h_left += 3;
|
||||
sint32 newLeft = widget->right - widget->left - 1;
|
||||
int32_t newLeft = widget->right - widget->left - 1;
|
||||
if (w->scrolls[scroll_id].flags & VSCROLLBAR_VISIBLE)
|
||||
newLeft -= 11;
|
||||
newLeft *= -1;
|
||||
|
@ -860,7 +860,7 @@ static void input_scroll_part_update_hright(rct_window * w, rct_widgetindex widg
|
|||
*
|
||||
* rct2: 0x006E9C37
|
||||
*/
|
||||
static void input_scroll_part_update_vtop(rct_window * w, rct_widgetindex widgetIndex, sint32 scroll_id)
|
||||
static void input_scroll_part_update_vtop(rct_window * w, rct_widgetindex widgetIndex, int32_t scroll_id)
|
||||
{
|
||||
assert(w != nullptr);
|
||||
if (window_find_by_number(w->classification, w->number))
|
||||
|
@ -877,7 +877,7 @@ static void input_scroll_part_update_vtop(rct_window * w, rct_widgetindex widget
|
|||
*
|
||||
* rct2: 0x006E9C96
|
||||
*/
|
||||
static void input_scroll_part_update_vbottom(rct_window * w, rct_widgetindex widgetIndex, sint32 scroll_id)
|
||||
static void input_scroll_part_update_vbottom(rct_window * w, rct_widgetindex widgetIndex, int32_t scroll_id)
|
||||
{
|
||||
assert(w != nullptr);
|
||||
rct_widget * widget = &w->widgets[widgetIndex];
|
||||
|
@ -885,7 +885,7 @@ static void input_scroll_part_update_vbottom(rct_window * w, rct_widgetindex wid
|
|||
{
|
||||
w->scrolls[scroll_id].flags |= VSCROLLBAR_DOWN_PRESSED;
|
||||
w->scrolls[scroll_id].v_top += 3;
|
||||
sint32 newTop = widget->bottom - widget->top - 1;
|
||||
int32_t newTop = widget->bottom - widget->top - 1;
|
||||
if (w->scrolls[scroll_id].flags & HSCROLLBAR_VISIBLE)
|
||||
newTop -= 11;
|
||||
newTop *= -1;
|
||||
|
@ -907,7 +907,7 @@ static void input_scroll_part_update_vbottom(rct_window * w, rct_widgetindex wid
|
|||
*
|
||||
* rct2: 0x006E9253
|
||||
*/
|
||||
static void input_widget_over(sint32 x, sint32 y, rct_window * w, rct_widgetindex widgetIndex)
|
||||
static void input_widget_over(int32_t x, int32_t y, rct_window * w, rct_widgetindex widgetIndex)
|
||||
{
|
||||
rct_windowclass windowClass = WC_NULL;
|
||||
rct_windownumber windowNumber = 0;
|
||||
|
@ -924,7 +924,7 @@ static void input_widget_over(sint32 x, sint32 y, rct_window * w, rct_widgetinde
|
|||
|
||||
if (w != nullptr && widgetIndex != -1 && widget->type == WWT_SCROLL)
|
||||
{
|
||||
sint32 eax, ebx, scroll_part, edx;
|
||||
int32_t eax, ebx, scroll_part, edx;
|
||||
widget_scroll_get_part(w, widget, x, y, &eax, &ebx, &scroll_part, &edx);
|
||||
|
||||
if (scroll_part != SCROLL_PART_VIEW)
|
||||
|
@ -996,7 +996,7 @@ static void input_widget_over_flatbutton_invalidate()
|
|||
*
|
||||
* rct2: 0x006E95F9
|
||||
*/
|
||||
static void input_widget_left(sint32 x, sint32 y, rct_window * w, rct_widgetindex widgetIndex)
|
||||
static void input_widget_left(int32_t x, int32_t y, rct_window * w, rct_widgetindex widgetIndex)
|
||||
{
|
||||
rct_windowclass windowClass = WC_NULL;
|
||||
rct_windownumber windowNumber = 0;
|
||||
|
@ -1083,11 +1083,11 @@ static void input_widget_left(sint32 x, sint32 y, rct_window * w, rct_widgetinde
|
|||
*
|
||||
* rct2: 0x006ED833
|
||||
*/
|
||||
void process_mouse_over(sint32 x, sint32 y)
|
||||
void process_mouse_over(int32_t x, int32_t y)
|
||||
{
|
||||
rct_window * window;
|
||||
|
||||
sint32 cursorId;
|
||||
int32_t cursorId;
|
||||
|
||||
cursorId = CURSOR_ARROW;
|
||||
set_map_tooltip_format_arg(0, rct_string_id, STR_NONE);
|
||||
|
@ -1095,7 +1095,7 @@ void process_mouse_over(sint32 x, sint32 y)
|
|||
|
||||
if (window != nullptr)
|
||||
{
|
||||
sint32 ebx, edi;
|
||||
int32_t ebx, edi;
|
||||
rct_window * subWindow;
|
||||
rct_widgetindex widgetId = window_find_widget_from_point(window, x, y);
|
||||
if (widgetId != -1)
|
||||
|
@ -1149,8 +1149,8 @@ void process_mouse_over(sint32 x, sint32 y)
|
|||
|
||||
case WWT_SCROLL:
|
||||
{
|
||||
sint32 output_scroll_area, scroll_id;
|
||||
sint32 scroll_x, scroll_y;
|
||||
int32_t output_scroll_area, scroll_id;
|
||||
int32_t scroll_x, scroll_y;
|
||||
widget_scroll_get_part(window, &window->widgets[widgetId], x, y, &scroll_x, &scroll_y, &output_scroll_area,
|
||||
&scroll_id);
|
||||
cursorId = scroll_id;
|
||||
|
@ -1182,7 +1182,7 @@ void process_mouse_over(sint32 x, sint32 y)
|
|||
*
|
||||
* rct2: 0x006ED801
|
||||
*/
|
||||
void process_mouse_tool(sint32 x, sint32 y)
|
||||
void process_mouse_tool(int32_t x, int32_t y)
|
||||
{
|
||||
if (_inputFlags & INPUT_FLAG_TOOL_ACTIVE)
|
||||
{
|
||||
|
@ -1199,7 +1199,7 @@ void process_mouse_tool(sint32 x, sint32 y)
|
|||
*
|
||||
* rct2: 0x006E8DA7
|
||||
*/
|
||||
void input_state_widget_pressed(sint32 x, sint32 y, sint32 state, rct_widgetindex widgetIndex, rct_window * w,
|
||||
void input_state_widget_pressed(int32_t x, int32_t y, int32_t state, rct_widgetindex widgetIndex, rct_window * w,
|
||||
rct_widget * widget)
|
||||
{
|
||||
rct_windowclass cursor_w_class;
|
||||
|
@ -1257,7 +1257,7 @@ void input_state_widget_pressed(sint32 x, sint32 y, sint32 state, rct_widgetinde
|
|||
{
|
||||
if (w)
|
||||
{
|
||||
sint32 dropdown_index = 0;
|
||||
int32_t dropdown_index = 0;
|
||||
|
||||
if (w->classification == WC_DROPDOWN)
|
||||
{
|
||||
|
@ -1337,7 +1337,7 @@ void input_state_widget_pressed(sint32 x, sint32 y, sint32 state, rct_widgetinde
|
|||
break;
|
||||
|
||||
{
|
||||
sint32 mid_point_x = (widget->left + widget->right) / 2 + w->x;
|
||||
int32_t mid_point_x = (widget->left + widget->right) / 2 + w->x;
|
||||
audio_play_sound(SOUND_CLICK_2, 0, mid_point_x);
|
||||
}
|
||||
if (cursor_w_class != w->classification || cursor_w_number != w->number || widgetIndex != cursor_widgetIndex)
|
||||
|
@ -1373,7 +1373,7 @@ void input_state_widget_pressed(sint32 x, sint32 y, sint32 state, rct_widgetinde
|
|||
|
||||
if (w->classification == WC_DROPDOWN)
|
||||
{
|
||||
sint32 dropdown_index = dropdown_index_from_point(x, y, w);
|
||||
int32_t dropdown_index = dropdown_index_from_point(x, y, w);
|
||||
if (dropdown_index == -1)
|
||||
{
|
||||
return;
|
||||
|
@ -1442,7 +1442,7 @@ void input_state_widget_pressed(sint32 x, sint32 y, sint32 state, rct_widgetinde
|
|||
}
|
||||
}
|
||||
|
||||
static void input_update_tooltip(rct_window * w, rct_widgetindex widgetIndex, sint32 x, sint32 y)
|
||||
static void input_update_tooltip(rct_window * w, rct_widgetindex widgetIndex, int32_t x, int32_t y)
|
||||
{
|
||||
if (gTooltipWidget.window_classification == 255)
|
||||
{
|
||||
|
@ -1482,10 +1482,10 @@ static void input_update_tooltip(rct_window * w, rct_widgetindex widgetIndex, si
|
|||
*
|
||||
* rct2: 0x00406CD2
|
||||
*/
|
||||
sint32 get_next_key()
|
||||
int32_t get_next_key()
|
||||
{
|
||||
uint8 * keysPressed = (uint8 *)context_get_keys_pressed();
|
||||
for (sint32 i = 0; i < 221; i++)
|
||||
uint8_t * keysPressed = (uint8_t *)context_get_keys_pressed();
|
||||
for (int32_t i = 0; i < 221; i++)
|
||||
{
|
||||
if (keysPressed[i])
|
||||
{
|
||||
|
@ -1503,7 +1503,7 @@ sint32 get_next_key()
|
|||
*
|
||||
* rct2: 0x006ED990
|
||||
*/
|
||||
void set_cursor(uint8 cursor_id)
|
||||
void set_cursor(uint8_t cursor_id)
|
||||
{
|
||||
if (_inputState == INPUT_STATE_RESIZING)
|
||||
{
|
||||
|
@ -1530,10 +1530,10 @@ void invalidate_scroll()
|
|||
/**
|
||||
* rct2: 0x00406C96
|
||||
*/
|
||||
void store_mouse_input(sint32 state, sint32 x, sint32 y)
|
||||
void store_mouse_input(int32_t state, int32_t x, int32_t y)
|
||||
{
|
||||
uint32 writeIndex = _mouseInputQueueWriteIndex;
|
||||
uint32 nextWriteIndex = (writeIndex + 1) % Util::CountOf(_mouseInputQueue);
|
||||
uint32_t writeIndex = _mouseInputQueueWriteIndex;
|
||||
uint32_t nextWriteIndex = (writeIndex + 1) % Util::CountOf(_mouseInputQueue);
|
||||
|
||||
// Check if the queue is full
|
||||
if (nextWriteIndex != _mouseInputQueueReadIndex)
|
||||
|
@ -1550,7 +1550,7 @@ void store_mouse_input(sint32 state, sint32 x, sint32 y)
|
|||
void game_handle_edge_scroll()
|
||||
{
|
||||
rct_window * mainWindow;
|
||||
sint32 scrollX, scrollY;
|
||||
int32_t scrollX, scrollY;
|
||||
|
||||
mainWindow = window_get_main();
|
||||
if (mainWindow == nullptr)
|
||||
|
@ -1586,23 +1586,23 @@ bool input_test_place_object_modifier(PLACE_OBJECT_MODIFIER modifier)
|
|||
return gInputPlaceObjectModifier & modifier;
|
||||
}
|
||||
|
||||
void input_scroll_viewport(sint32 scrollX, sint32 scrollY)
|
||||
void input_scroll_viewport(int32_t scrollX, int32_t scrollY)
|
||||
{
|
||||
rct_window * mainWindow = window_get_main();
|
||||
rct_viewport * viewport = mainWindow->viewport;
|
||||
|
||||
const sint32 speed = gConfigGeneral.edge_scrolling_speed;
|
||||
const int32_t speed = gConfigGeneral.edge_scrolling_speed;
|
||||
|
||||
sint32 dx = scrollX * (speed << viewport->zoom);
|
||||
sint32 dy = scrollY * (speed << viewport->zoom);
|
||||
int32_t dx = scrollX * (speed << viewport->zoom);
|
||||
int32_t dy = scrollY * (speed << viewport->zoom);
|
||||
|
||||
if (scrollX != 0)
|
||||
{
|
||||
// Speed up scrolling horizontally when at the edge of the map
|
||||
// so that the speed is consistent with vertical edge scrolling.
|
||||
sint32 x = mainWindow->saved_view_x + viewport->view_width / 2 + dx;
|
||||
sint32 y = mainWindow->saved_view_y + viewport->view_height / 2;
|
||||
sint32 y_dy = mainWindow->saved_view_y + viewport->view_height / 2 + dy;
|
||||
int32_t x = mainWindow->saved_view_x + viewport->view_width / 2 + dx;
|
||||
int32_t y = mainWindow->saved_view_y + viewport->view_height / 2;
|
||||
int32_t y_dy = mainWindow->saved_view_y + viewport->view_height / 2 + dy;
|
||||
LocationXY16 mapCoord, mapCoord_dy;
|
||||
|
||||
mapCoord = viewport_coord_to_map_coord(x, y, 0);
|
||||
|
@ -1610,8 +1610,8 @@ void input_scroll_viewport(sint32 scrollX, sint32 scrollY)
|
|||
|
||||
// Check if we're crossing the boundary
|
||||
// Clamp to the map minimum value
|
||||
sint32 at_map_edge = 0;
|
||||
sint32 at_map_edge_dy = 0;
|
||||
int32_t at_map_edge = 0;
|
||||
int32_t at_map_edge_dy = 0;
|
||||
if (mapCoord.x < MAP_MINIMUM_X_Y || mapCoord.y < MAP_MINIMUM_X_Y)
|
||||
{
|
||||
at_map_edge = 1;
|
||||
|
|
|
@ -23,25 +23,25 @@ enum
|
|||
DROPDOWN_FLAG_STAY_OPEN = (1 << 7)
|
||||
};
|
||||
|
||||
extern sint32 gAppropriateImageDropdownItemsPerRow[];
|
||||
extern int32_t gAppropriateImageDropdownItemsPerRow[];
|
||||
|
||||
extern sint32 gDropdownNumItems;
|
||||
extern int32_t gDropdownNumItems;
|
||||
extern rct_string_id gDropdownItemsFormat[DROPDOWN_ITEMS_MAX_SIZE];
|
||||
extern sint64 gDropdownItemsArgs[DROPDOWN_ITEMS_MAX_SIZE];
|
||||
extern int64_t gDropdownItemsArgs[DROPDOWN_ITEMS_MAX_SIZE];
|
||||
extern bool gDropdownIsColour;
|
||||
extern sint32 gDropdownLastColourHover;
|
||||
extern sint32 gDropdownHighlightedIndex;
|
||||
extern sint32 gDropdownDefaultIndex;
|
||||
extern int32_t gDropdownLastColourHover;
|
||||
extern int32_t gDropdownHighlightedIndex;
|
||||
extern int32_t gDropdownDefaultIndex;
|
||||
|
||||
bool dropdown_is_checked(sint32 index);
|
||||
bool dropdown_is_disabled(sint32 index);
|
||||
void dropdown_set_checked(sint32 index, bool value);
|
||||
void dropdown_set_disabled(sint32 index, bool value);
|
||||
bool dropdown_is_checked(int32_t index);
|
||||
bool dropdown_is_disabled(int32_t index);
|
||||
void dropdown_set_checked(int32_t index, bool value);
|
||||
void dropdown_set_disabled(int32_t index, bool value);
|
||||
|
||||
void window_dropdown_show_text(sint32 x, sint32 y, sint32 extray, uint8 colour, uint8 flags, size_t num_items);
|
||||
void window_dropdown_show_text_custom_width(sint32 x, sint32 y, sint32 extray, uint8 colour, uint8 custom_height, uint8 flags, size_t num_items, sint32 width);
|
||||
void window_dropdown_show_image(sint32 x, sint32 y, sint32 extray, uint8 colour, uint8 flags, sint32 numItems, sint32 itemWidth, sint32 itemHeight, sint32 numColumns);
|
||||
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 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);
|
||||
void window_dropdown_close();
|
||||
sint32 dropdown_index_from_point(sint32 x, sint32 y, rct_window* w);
|
||||
void window_dropdown_show_colour(rct_window *w, rct_widget *widget, uint8 dropdownColour, uint8 selectedColour);
|
||||
void window_dropdown_show_colour_available(rct_window *w, rct_widget *widget, uint8 dropdownColour, uint8 selectedColour, uint32 availableColours);
|
||||
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);
|
||||
void window_dropdown_show_colour_available(rct_window *w, rct_widget *widget, uint8_t dropdownColour, uint8_t selectedColour, uint32_t availableColours);
|
||||
|
|
|
@ -11,9 +11,9 @@
|
|||
#include <openrct2/localisation/Localisation.h>
|
||||
#include <openrct2-ui/interface/Graph.h>
|
||||
|
||||
static void graph_draw_months_uint8(rct_drawpixelinfo * dpi, const uint8 * history, sint32 count, sint32 baseX, sint32 baseY)
|
||||
static void graph_draw_months_uint8_t(rct_drawpixelinfo * dpi, const uint8_t * history, int32_t count, int32_t baseX, int32_t baseY)
|
||||
{
|
||||
sint32 i, x, y, yearOver32, currentMonth, currentDay;
|
||||
int32_t i, x, y, yearOver32, currentMonth, currentDay;
|
||||
|
||||
currentMonth = date_get_month(gDateMonthsElapsed);
|
||||
currentDay = gDateMonthTicks;
|
||||
|
@ -25,7 +25,7 @@ static void graph_draw_months_uint8(rct_drawpixelinfo * dpi, const uint8 * histo
|
|||
if (history[i] != 255 && yearOver32 % 4 == 0)
|
||||
{
|
||||
// Draw month text
|
||||
set_format_arg(0, uint32, DateGameShortMonthNames[date_get_month((yearOver32 / 4) + MONTH_COUNT)]);
|
||||
set_format_arg(0, uint32_t, DateGameShortMonthNames[date_get_month((yearOver32 / 4) + MONTH_COUNT)]);
|
||||
gfx_draw_string_centred(dpi, STR_GRAPH_LABEL, x, y - 10, COLOUR_BLACK, gCommonFormatArgs);
|
||||
|
||||
// Draw month mark
|
||||
|
@ -37,9 +37,9 @@ static void graph_draw_months_uint8(rct_drawpixelinfo * dpi, const uint8 * histo
|
|||
}
|
||||
}
|
||||
|
||||
static void graph_draw_line_a_uint8(rct_drawpixelinfo * dpi, const uint8 * history, sint32 count, sint32 baseX, sint32 baseY)
|
||||
static void graph_draw_line_a_uint8_t(rct_drawpixelinfo * dpi, const uint8_t * history, int32_t count, int32_t baseX, int32_t baseY)
|
||||
{
|
||||
sint32 i, x, y, lastX, lastY;
|
||||
int32_t i, x, y, lastX, lastY;
|
||||
lastX = -1;
|
||||
lastY = -1;
|
||||
x = baseX;
|
||||
|
@ -64,9 +64,9 @@ static void graph_draw_line_a_uint8(rct_drawpixelinfo * dpi, const uint8 * histo
|
|||
}
|
||||
}
|
||||
|
||||
static void graph_draw_line_b_uint8(rct_drawpixelinfo * dpi, const uint8 * history, sint32 count, sint32 baseX, sint32 baseY)
|
||||
static void graph_draw_line_b_uint8_t(rct_drawpixelinfo * dpi, const uint8_t * history, int32_t count, int32_t baseX, int32_t baseY)
|
||||
{
|
||||
sint32 i, x, y, lastX, lastY;
|
||||
int32_t i, x, y, lastX, lastY;
|
||||
|
||||
lastX = -1;
|
||||
lastY = -1;
|
||||
|
@ -89,16 +89,16 @@ static void graph_draw_line_b_uint8(rct_drawpixelinfo * dpi, const uint8 * histo
|
|||
}
|
||||
}
|
||||
|
||||
void graph_draw_uint8(rct_drawpixelinfo * dpi, uint8 * history, sint32 count, sint32 baseX, sint32 baseY)
|
||||
void graph_draw_uint8_t(rct_drawpixelinfo * dpi, uint8_t * history, int32_t count, int32_t baseX, int32_t baseY)
|
||||
{
|
||||
graph_draw_months_uint8(dpi, history, count, baseX, baseY);
|
||||
graph_draw_line_a_uint8(dpi, history, count, baseX, baseY);
|
||||
graph_draw_line_b_uint8(dpi, history, count, baseX, baseY);
|
||||
graph_draw_months_uint8_t(dpi, history, count, baseX, baseY);
|
||||
graph_draw_line_a_uint8_t(dpi, history, count, baseX, baseY);
|
||||
graph_draw_line_b_uint8_t(dpi, history, count, baseX, baseY);
|
||||
}
|
||||
|
||||
static void graph_draw_months_money32(rct_drawpixelinfo *dpi, const money32 *history, sint32 count, sint32 baseX, sint32 baseY)
|
||||
static void graph_draw_months_money32(rct_drawpixelinfo *dpi, const money32 *history, int32_t count, int32_t baseX, int32_t baseY)
|
||||
{
|
||||
sint32 i, x, y, yearOver32, currentMonth, currentDay;
|
||||
int32_t i, x, y, yearOver32, currentMonth, currentDay;
|
||||
|
||||
currentMonth = date_get_month(gDateMonthsElapsed);
|
||||
currentDay = gDateMonthTicks;
|
||||
|
@ -108,7 +108,7 @@ static void graph_draw_months_money32(rct_drawpixelinfo *dpi, const money32 *his
|
|||
for (i = count - 1; i >= 0; i--) {
|
||||
if (history[i] != MONEY32_UNDEFINED && yearOver32 % 4 == 0) {
|
||||
// Draw month text
|
||||
sint32 monthFormat = DateGameShortMonthNames[date_get_month((yearOver32 / 4) + MONTH_COUNT)];
|
||||
int32_t monthFormat = DateGameShortMonthNames[date_get_month((yearOver32 / 4) + MONTH_COUNT)];
|
||||
gfx_draw_string_centred(dpi, STR_GRAPH_LABEL, x, y - 10, COLOUR_BLACK, &monthFormat);
|
||||
|
||||
// Draw month mark
|
||||
|
@ -120,9 +120,9 @@ static void graph_draw_months_money32(rct_drawpixelinfo *dpi, const money32 *his
|
|||
}
|
||||
}
|
||||
|
||||
static void graph_draw_line_a_money32(rct_drawpixelinfo *dpi, const money32 *history, sint32 count, sint32 baseX, sint32 baseY, sint32 modifier, sint32 offset)
|
||||
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, int32_t offset)
|
||||
{
|
||||
sint32 i, x, y, lastX, lastY;
|
||||
int32_t i, x, y, lastX, lastY;
|
||||
lastX = -1;
|
||||
lastY = -1;
|
||||
x = baseX;
|
||||
|
@ -144,9 +144,9 @@ static void graph_draw_line_a_money32(rct_drawpixelinfo *dpi, const money32 *his
|
|||
}
|
||||
}
|
||||
|
||||
static void graph_draw_line_b_money32(rct_drawpixelinfo *dpi, const money32 *history, sint32 count, sint32 baseX, sint32 baseY, sint32 modifier, sint32 offset)
|
||||
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, int32_t offset)
|
||||
{
|
||||
sint32 i, x, y, lastX, lastY;
|
||||
int32_t i, x, y, lastX, lastY;
|
||||
|
||||
lastX = -1;
|
||||
lastY = -1;
|
||||
|
@ -167,7 +167,7 @@ static void graph_draw_line_b_money32(rct_drawpixelinfo *dpi, const money32 *his
|
|||
}
|
||||
}
|
||||
|
||||
void graph_draw_money32(rct_drawpixelinfo *dpi, money32 *history, sint32 count, sint32 baseX, sint32 baseY, sint32 modifier, sint32 offset)
|
||||
void graph_draw_money32(rct_drawpixelinfo *dpi, money32 *history, int32_t count, int32_t baseX, int32_t baseY, int32_t modifier, int32_t offset)
|
||||
{
|
||||
graph_draw_months_money32(dpi, history, count, baseX, baseY);
|
||||
graph_draw_line_a_money32(dpi, history, count, baseX, baseY, modifier, offset);
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
#include <openrct2/common.h>
|
||||
#include <openrct2/drawing/Drawing.h>
|
||||
|
||||
void graph_draw_uint8(rct_drawpixelinfo *dpi, uint8 *history, sint32 count, sint32 baseX, sint32 baseY);
|
||||
void graph_draw_money32(rct_drawpixelinfo *dpi, money32 *history, sint32 count, sint32 baseX, sint32 baseY, sint32 modifier, sint32 offset);
|
||||
void graph_draw_uint8_t(rct_drawpixelinfo *dpi, uint8_t *history, int32_t count, int32_t baseX, int32_t baseY);
|
||||
void graph_draw_money32(rct_drawpixelinfo *dpi, money32 *history, int32_t count, int32_t baseX, int32_t baseY, int32_t modifier, int32_t offset);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -82,13 +82,13 @@ void InGameConsole::Input(CONSOLE_INPUT input)
|
|||
break;
|
||||
case CONSOLE_INPUT_SCROLL_PREVIOUS:
|
||||
{
|
||||
sint32 scrollAmt = GetNumVisibleLines() - 1;
|
||||
int32_t scrollAmt = GetNumVisibleLines() - 1;
|
||||
Scroll(scrollAmt);
|
||||
break;
|
||||
}
|
||||
case CONSOLE_INPUT_SCROLL_NEXT:
|
||||
{
|
||||
sint32 scrollAmt = GetNumVisibleLines() - 1;
|
||||
int32_t scrollAmt = GetNumVisibleLines() - 1;
|
||||
Scroll(-scrollAmt);
|
||||
break;
|
||||
}
|
||||
|
@ -108,7 +108,7 @@ void InGameConsole::ClearInput()
|
|||
void InGameConsole::HistoryAdd(const utf8 * src)
|
||||
{
|
||||
if (_consoleHistoryCount >= CONSOLE_HISTORY_SIZE) {
|
||||
for (sint32 i = 0; i < _consoleHistoryCount - 1; i++)
|
||||
for (int32_t i = 0; i < _consoleHistoryCount - 1; i++)
|
||||
memcpy(_consoleHistory[i], _consoleHistory[i + 1], CONSOLE_INPUT_SIZE);
|
||||
_consoleHistoryCount--;
|
||||
}
|
||||
|
@ -118,7 +118,7 @@ void InGameConsole::HistoryAdd(const utf8 * src)
|
|||
|
||||
void InGameConsole::ScrollToEnd()
|
||||
{
|
||||
_consoleScrollPos = std::max<sint32>(0, (sint32)_consoleLines.size() - GetNumVisibleLines());
|
||||
_consoleScrollPos = std::max<int32_t>(0, (int32_t)_consoleLines.size() - GetNumVisibleLines());
|
||||
}
|
||||
|
||||
void InGameConsole::RefreshCaret()
|
||||
|
@ -126,14 +126,14 @@ void InGameConsole::RefreshCaret()
|
|||
_consoleCaretTicks = 0;
|
||||
}
|
||||
|
||||
void InGameConsole::Scroll(sint32 linesToScroll)
|
||||
void InGameConsole::Scroll(int32_t linesToScroll)
|
||||
{
|
||||
const sint32 maxVisibleLines = GetNumVisibleLines();
|
||||
const sint32 numLines = (sint32)_consoleLines.size();
|
||||
const int32_t maxVisibleLines = GetNumVisibleLines();
|
||||
const int32_t numLines = (int32_t)_consoleLines.size();
|
||||
if (numLines > maxVisibleLines)
|
||||
{
|
||||
sint32 maxScrollValue = numLines - maxVisibleLines;
|
||||
_consoleScrollPos = Math::Clamp<sint32>(0, _consoleScrollPos - linesToScroll, maxScrollValue);
|
||||
int32_t maxScrollValue = numLines - maxVisibleLines;
|
||||
_consoleScrollPos = Math::Clamp<int32_t>(0, _consoleScrollPos - linesToScroll, maxScrollValue);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -182,7 +182,7 @@ void InGameConsole::Toggle()
|
|||
}
|
||||
}
|
||||
|
||||
void InGameConsole::WriteLine(const std::string &input, uint32 colourFormat)
|
||||
void InGameConsole::WriteLine(const std::string &input, uint32_t colourFormat)
|
||||
{
|
||||
// Include text colour format only for special cases
|
||||
// The draw function handles the default text colour differently
|
||||
|
@ -251,9 +251,9 @@ void InGameConsole::Draw(rct_drawpixelinfo * dpi) const
|
|||
// Set font
|
||||
gCurrentFontSpriteBase = (gConfigInterface.console_small_font ? FONT_SPRITE_BASE_SMALL : FONT_SPRITE_BASE_MEDIUM);
|
||||
gCurrentFontFlags = 0;
|
||||
uint8 textColour = NOT_TRANSLUCENT(theme_get_colour(WC_CONSOLE, 1));
|
||||
const sint32 lineHeight = font_get_line_height(gCurrentFontSpriteBase);
|
||||
const sint32 maxLines = GetNumVisibleLines();
|
||||
uint8_t textColour = NOT_TRANSLUCENT(theme_get_colour(WC_CONSOLE, 1));
|
||||
const int32_t lineHeight = font_get_line_height(gCurrentFontSpriteBase);
|
||||
const int32_t maxLines = GetNumVisibleLines();
|
||||
|
||||
// This is something of a hack to ensure the text is actually black
|
||||
// as opposed to a desaturated grey
|
||||
|
@ -280,13 +280,13 @@ void InGameConsole::Draw(rct_drawpixelinfo * dpi) const
|
|||
gfx_filter_rect(dpi, _consoleLeft, _consoleBottom - lineHeight - 10, _consoleRight, _consoleBottom - 1, PALETTE_51);
|
||||
|
||||
// Paint background colour.
|
||||
uint8 backgroundColour = theme_get_colour(WC_CONSOLE, 0);
|
||||
uint8_t backgroundColour = theme_get_colour(WC_CONSOLE, 0);
|
||||
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, INSET_RECT_FLAG_BORDER_INSET);
|
||||
|
||||
std::string lineBuffer;
|
||||
sint32 x = _consoleLeft + CONSOLE_EDGE_PADDING;
|
||||
sint32 y = _consoleTop + CONSOLE_EDGE_PADDING;
|
||||
int32_t x = _consoleLeft + CONSOLE_EDGE_PADDING;
|
||||
int32_t y = _consoleTop + CONSOLE_EDGE_PADDING;
|
||||
|
||||
// Draw text inside console
|
||||
for (std::size_t i = 0; i < _consoleLines.size() && i < (size_t)maxLines; i++) {
|
||||
|
@ -304,16 +304,16 @@ void InGameConsole::Draw(rct_drawpixelinfo * dpi) const
|
|||
|
||||
// Draw caret
|
||||
if (_consoleCaretTicks < CONSOLE_CARET_FLASH_THRESHOLD) {
|
||||
sint32 caretX = x + gfx_get_string_width(_consoleCurrentLine);
|
||||
sint32 caretY = y + lineHeight;
|
||||
int32_t caretX = x + gfx_get_string_width(_consoleCurrentLine);
|
||||
int32_t caretY = y + lineHeight;
|
||||
|
||||
uint8 caretColour = ColourMapA[BASE_COLOUR(textColour)].lightest;
|
||||
uint8_t caretColour = ColourMapA[BASE_COLOUR(textColour)].lightest;
|
||||
gfx_fill_rect(dpi, caretX, caretY, caretX + CONSOLE_CARET_WIDTH, caretY, caretColour);
|
||||
}
|
||||
|
||||
// What about border colours?
|
||||
uint8 borderColour1 = ColourMapA[BASE_COLOUR(backgroundColour)].light;
|
||||
uint8 borderColour2 = ColourMapA[BASE_COLOUR(backgroundColour)].mid_dark;
|
||||
uint8_t borderColour1 = ColourMapA[BASE_COLOUR(backgroundColour)].light;
|
||||
uint8_t borderColour2 = ColourMapA[BASE_COLOUR(backgroundColour)].mid_dark;
|
||||
|
||||
// Input area top border
|
||||
gfx_fill_rect(dpi, _consoleLeft, _consoleBottom - lineHeight - 11, _consoleRight, _consoleBottom - lineHeight - 11, borderColour1);
|
||||
|
@ -325,10 +325,10 @@ void InGameConsole::Draw(rct_drawpixelinfo * dpi) const
|
|||
}
|
||||
|
||||
// Calculates the amount of visible lines, based on the console size, excluding the input line.
|
||||
sint32 InGameConsole::GetNumVisibleLines() const
|
||||
int32_t InGameConsole::GetNumVisibleLines() const
|
||||
{
|
||||
const sint32 lineHeight = font_get_line_height(gCurrentFontSpriteBase);
|
||||
const sint32 consoleHeight = _consoleBottom - _consoleTop;
|
||||
const sint32 drawableHeight = consoleHeight - 2 * lineHeight - 4; // input line, separator - padding
|
||||
const int32_t lineHeight = font_get_line_height(gCurrentFontSpriteBase);
|
||||
const int32_t consoleHeight = _consoleBottom - _consoleTop;
|
||||
const int32_t drawableHeight = consoleHeight - 2 * lineHeight - 4; // input line, separator - padding
|
||||
return drawableHeight / lineHeight;
|
||||
}
|
||||
|
|
|
@ -16,24 +16,24 @@ namespace OpenRCT2::Ui
|
|||
class InGameConsole final : public InteractiveConsole
|
||||
{
|
||||
private:
|
||||
static constexpr sint32 CONSOLE_MAX_LINES = 300;
|
||||
static constexpr sint32 CONSOLE_HISTORY_SIZE = 64;
|
||||
static constexpr sint32 CONSOLE_INPUT_SIZE = 256;
|
||||
static constexpr sint32 CONSOLE_CARET_FLASH_THRESHOLD = 15;
|
||||
static constexpr sint32 CONSOLE_EDGE_PADDING = 4;
|
||||
static constexpr sint32 CONSOLE_CARET_WIDTH = 6;
|
||||
static constexpr int32_t CONSOLE_MAX_LINES = 300;
|
||||
static constexpr int32_t CONSOLE_HISTORY_SIZE = 64;
|
||||
static constexpr int32_t CONSOLE_INPUT_SIZE = 256;
|
||||
static constexpr int32_t CONSOLE_CARET_FLASH_THRESHOLD = 15;
|
||||
static constexpr int32_t CONSOLE_EDGE_PADDING = 4;
|
||||
static constexpr int32_t CONSOLE_CARET_WIDTH = 6;
|
||||
|
||||
bool _isOpen = false;
|
||||
sint32 _consoleLeft, _consoleTop, _consoleRight, _consoleBottom;
|
||||
sint32 _lastMainViewportX, _lastMainViewportY;
|
||||
int32_t _consoleLeft, _consoleTop, _consoleRight, _consoleBottom;
|
||||
int32_t _lastMainViewportX, _lastMainViewportY;
|
||||
std::deque<std::string> _consoleLines;
|
||||
utf8 _consoleCurrentLine[CONSOLE_INPUT_SIZE] = {};
|
||||
sint32 _consoleCaretTicks;
|
||||
sint32 _consoleScrollPos = 0;
|
||||
int32_t _consoleCaretTicks;
|
||||
int32_t _consoleScrollPos = 0;
|
||||
TextInputSession * _consoleTextInputSession;
|
||||
utf8 _consoleHistory[CONSOLE_HISTORY_SIZE][CONSOLE_INPUT_SIZE];
|
||||
sint32 _consoleHistoryIndex = 0;
|
||||
sint32 _consoleHistoryCount = 0;
|
||||
int32_t _consoleHistoryIndex = 0;
|
||||
int32_t _consoleHistoryCount = 0;
|
||||
|
||||
public:
|
||||
InGameConsole();
|
||||
|
@ -46,11 +46,11 @@ namespace OpenRCT2::Ui
|
|||
void Close() override;
|
||||
void Hide() override;
|
||||
void Toggle();
|
||||
void WriteLine(const std::string &s, uint32 colourFormat) override;
|
||||
void WriteLine(const std::string &s, uint32_t colourFormat) override;
|
||||
|
||||
void Input(CONSOLE_INPUT input);
|
||||
void RefreshCaret();
|
||||
void Scroll(sint32 linesToScroll);
|
||||
void Scroll(int32_t linesToScroll);
|
||||
|
||||
void Update();
|
||||
void Draw(rct_drawpixelinfo * dpi) const;
|
||||
|
@ -62,6 +62,6 @@ namespace OpenRCT2::Ui
|
|||
void WritePrompt();
|
||||
void ScrollToEnd();
|
||||
void Invalidate() const;
|
||||
sint32 GetNumVisibleLines() const;
|
||||
int32_t GetNumVisibleLines() const;
|
||||
};
|
||||
} // namespace OpenRCT2::Ui
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
#include <openrct2/drawing/Drawing.h>
|
||||
|
||||
// clang-format off
|
||||
static uint16 toolSizeSpriteIndices[] =
|
||||
static uint16_t toolSizeSpriteIndices[] =
|
||||
{
|
||||
SPR_LAND_TOOL_SIZE_0,
|
||||
SPR_LAND_TOOL_SIZE_1,
|
||||
|
@ -29,14 +29,14 @@ static uint16 toolSizeSpriteIndices[] =
|
|||
SPR_LAND_TOOL_SIZE_7,
|
||||
};
|
||||
|
||||
static uint32 FloorTextureOrder[] =
|
||||
static uint32_t FloorTextureOrder[] =
|
||||
{
|
||||
TERRAIN_SAND_DARK, TERRAIN_SAND_LIGHT, TERRAIN_DIRT, TERRAIN_GRASS_CLUMPS, TERRAIN_GRASS,
|
||||
TERRAIN_ROCK, TERRAIN_SAND, TERRAIN_MARTIAN, TERRAIN_CHECKERBOARD, TERRAIN_ICE,
|
||||
TERRAIN_GRID_RED, TERRAIN_GRID_YELLOW, TERRAIN_GRID_BLUE, TERRAIN_GRID_GREEN
|
||||
};
|
||||
|
||||
uint32 WallTextureOrder[] =
|
||||
uint32_t WallTextureOrder[] =
|
||||
{
|
||||
TERRAIN_EDGE_ROCK, TERRAIN_EDGE_WOOD_RED, TERRAIN_EDGE_WOOD_BLACK, TERRAIN_EDGE_ICE, TERRAIN_EDGE_BRICK,
|
||||
TERRAIN_EDGE_GREY, TERRAIN_EDGE_YELLOW, TERRAIN_EDGE_RED, TERRAIN_EDGE_PURPLE, TERRAIN_EDGE_GREEN,
|
||||
|
@ -44,7 +44,7 @@ uint32 WallTextureOrder[] =
|
|||
0, 0
|
||||
};
|
||||
|
||||
uint32 WallTexturePreviews[] =
|
||||
uint32_t WallTexturePreviews[] =
|
||||
{
|
||||
SPR_WALL_TEXTURE_ROCK,
|
||||
SPR_WALL_TEXTURE_WOOD_RED,
|
||||
|
@ -64,15 +64,15 @@ uint32 WallTexturePreviews[] =
|
|||
};
|
||||
// clang-format on
|
||||
|
||||
uint16 gLandToolSize;
|
||||
uint16_t gLandToolSize;
|
||||
money32 gLandToolRaiseCost;
|
||||
money32 gLandToolLowerCost;
|
||||
uint8 gLandToolTerrainSurface;
|
||||
uint8 gLandToolTerrainEdge;
|
||||
uint8_t gLandToolTerrainSurface;
|
||||
uint8_t gLandToolTerrainEdge;
|
||||
money32 gWaterToolRaiseCost;
|
||||
money32 gWaterToolLowerCost;
|
||||
|
||||
uint32 land_tool_size_to_sprite_index(uint16 size)
|
||||
uint32_t land_tool_size_to_sprite_index(uint16_t size)
|
||||
{
|
||||
if (size <= MAX_TOOL_SIZE_WITH_SPRITE)
|
||||
{
|
||||
|
@ -84,11 +84,11 @@ uint32 land_tool_size_to_sprite_index(uint16 size)
|
|||
}
|
||||
}
|
||||
|
||||
void land_tool_show_surface_style_dropdown(rct_window * w, rct_widget * widget, uint8 currentSurfaceType)
|
||||
void land_tool_show_surface_style_dropdown(rct_window * w, rct_widget * widget, uint8_t currentSurfaceType)
|
||||
{
|
||||
uint8 defaultIndex = 0;
|
||||
uint8_t defaultIndex = 0;
|
||||
|
||||
for (uint8 i = 0; i < TERRAIN_COUNT_REGULAR; i++)
|
||||
for (uint8_t i = 0; i < TERRAIN_COUNT_REGULAR; i++)
|
||||
{
|
||||
gDropdownItemsFormat[i] = DROPDOWN_FORMAT_LAND_PICKER;
|
||||
gDropdownItemsArgs[i] = SPR_FLOOR_TEXTURE_GRASS + FloorTextureOrder[i];
|
||||
|
@ -111,13 +111,13 @@ void land_tool_show_surface_style_dropdown(rct_window * w, rct_widget * widget,
|
|||
gDropdownDefaultIndex = defaultIndex;
|
||||
}
|
||||
|
||||
void land_tool_show_edge_style_dropdown(rct_window * w, rct_widget * widget, uint8 currentEdgeType)
|
||||
void land_tool_show_edge_style_dropdown(rct_window * w, rct_widget * widget, uint8_t currentEdgeType)
|
||||
{
|
||||
uint8 defaultIndex = 0;
|
||||
uint8_t defaultIndex = 0;
|
||||
// Do not show RCT1 edge styles if the player does not have RCT1.
|
||||
const uint8 edgeCount = is_csg_loaded() ? TERRAIN_EDGE_COUNT : TERRAIN_EDGE_RCT2_COUNT;
|
||||
const uint8_t edgeCount = is_csg_loaded() ? TERRAIN_EDGE_COUNT : TERRAIN_EDGE_RCT2_COUNT;
|
||||
|
||||
for (uint8 i = 0; i < edgeCount; i++) {
|
||||
for (uint8_t i = 0; i < edgeCount; i++) {
|
||||
gDropdownItemsFormat[i] = DROPDOWN_FORMAT_LAND_PICKER;
|
||||
gDropdownItemsArgs[i] = WallTexturePreviews[WallTextureOrder[i]];
|
||||
if (WallTextureOrder[i] == currentEdgeType)
|
||||
|
|
|
@ -18,17 +18,17 @@
|
|||
// The highest tool size to have a sprite. Bigger tool sizes simply display a number.
|
||||
#define MAX_TOOL_SIZE_WITH_SPRITE 7
|
||||
|
||||
extern uint16 gLandToolSize;
|
||||
extern uint16_t gLandToolSize;
|
||||
extern money32 gLandToolRaiseCost;
|
||||
extern money32 gLandToolLowerCost;
|
||||
extern uint8 gLandToolTerrainSurface;
|
||||
extern uint8 gLandToolTerrainEdge;
|
||||
extern uint8_t gLandToolTerrainSurface;
|
||||
extern uint8_t gLandToolTerrainEdge;
|
||||
extern money32 gWaterToolRaiseCost;
|
||||
extern money32 gWaterToolLowerCost;
|
||||
|
||||
extern uint32 WallTextureOrder[];
|
||||
extern uint32 WallTexturePreviews[];
|
||||
extern uint32_t WallTextureOrder[];
|
||||
extern uint32_t WallTexturePreviews[];
|
||||
|
||||
uint32 land_tool_size_to_sprite_index(uint16 size);
|
||||
void land_tool_show_surface_style_dropdown(rct_window * w, rct_widget * widget, uint8 currentSurfaceType);
|
||||
void land_tool_show_edge_style_dropdown(rct_window * w, rct_widget * widget, uint8 currentEdgeType);
|
||||
uint32_t land_tool_size_to_sprite_index(uint16_t size);
|
||||
void land_tool_show_surface_style_dropdown(rct_window * w, rct_widget * widget, uint8_t currentSurfaceType);
|
||||
void land_tool_show_edge_style_dropdown(rct_window * w, rct_widget * widget, uint8_t currentEdgeType);
|
||||
|
|
|
@ -65,7 +65,7 @@ class UITheme
|
|||
public:
|
||||
std::string Name;
|
||||
std::vector<UIThemeWindowEntry> Entries;
|
||||
uint8 Flags = 0;
|
||||
uint8_t Flags = 0;
|
||||
|
||||
explicit UITheme(const std::string &name)
|
||||
: Name(name)
|
||||
|
@ -81,7 +81,7 @@ public:
|
|||
|
||||
static UITheme * FromJson(const json_t * json);
|
||||
static UITheme * FromFile(const std::string &path);
|
||||
static UITheme CreatePredefined(const std::string &name, const UIThemeWindowEntry * entries, uint8 flags);
|
||||
static UITheme CreatePredefined(const std::string &name, const UIThemeWindowEntry * entries, uint8_t flags);
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -92,7 +92,7 @@ struct WindowThemeDesc
|
|||
rct_windowclass WindowClass;
|
||||
const utf8 * WindowClassSZ;
|
||||
rct_string_id WindowName;
|
||||
uint8 NumColours;
|
||||
uint8_t NumColours;
|
||||
WindowTheme DefaultTheme;
|
||||
};
|
||||
|
||||
|
@ -274,7 +274,7 @@ json_t * UIThemeWindowEntry::ToJson() const
|
|||
}
|
||||
|
||||
json_t * jsonColours = json_array();
|
||||
for (uint8 i = 0; i < wtDesc->NumColours; i++) {
|
||||
for (uint8_t i = 0; i < wtDesc->NumColours; i++) {
|
||||
colour_t colour = Theme.Colours[i];
|
||||
json_array_append_new(jsonColours, json_integer(colour));
|
||||
}
|
||||
|
@ -293,14 +293,14 @@ UIThemeWindowEntry UIThemeWindowEntry::FromJson(const WindowThemeDesc * wtDesc,
|
|||
ThrowThemeLoadException();
|
||||
}
|
||||
|
||||
uint8 numColours = (uint8)json_array_size(jsonColours);
|
||||
uint8_t numColours = (uint8_t)json_array_size(jsonColours);
|
||||
numColours = std::min(numColours, wtDesc->NumColours);
|
||||
|
||||
UIThemeWindowEntry result { };
|
||||
result.WindowClass = wtDesc->WindowClass;
|
||||
result.Theme = wtDesc->DefaultTheme;
|
||||
|
||||
for (uint8 i = 0; i < numColours; i++)
|
||||
for (uint8_t i = 0; i < numColours; i++)
|
||||
{
|
||||
result.Theme.Colours[i] = (colour_t)json_integer_value(json_array_get(jsonColours, i));
|
||||
}
|
||||
|
@ -472,7 +472,7 @@ UITheme * UITheme::FromFile(const std::string &path)
|
|||
return result;
|
||||
}
|
||||
|
||||
UITheme UITheme::CreatePredefined(const std::string &name, const UIThemeWindowEntry * entries, uint8 flags)
|
||||
UITheme UITheme::CreatePredefined(const std::string &name, const UIThemeWindowEntry * entries, uint8_t flags)
|
||||
{
|
||||
auto theme = UITheme(name);
|
||||
theme.Flags = flags | UITHEME_FLAG_PREDEFINED;
|
||||
|
@ -719,7 +719,7 @@ size_t theme_get_index_for_name(const utf8 * name)
|
|||
return SIZE_MAX;
|
||||
}
|
||||
|
||||
uint8 theme_get_colour(rct_windowclass wc, uint8 index)
|
||||
uint8_t theme_get_colour(rct_windowclass wc, uint8_t index)
|
||||
{
|
||||
const UIThemeWindowEntry * entry = ThemeManager::CurrentTheme->GetEntry(wc);
|
||||
if (entry == nullptr)
|
||||
|
@ -737,7 +737,7 @@ uint8 theme_get_colour(rct_windowclass wc, uint8 index)
|
|||
}
|
||||
}
|
||||
|
||||
void theme_set_colour(rct_windowclass wc, uint8 index, colour_t colour)
|
||||
void theme_set_colour(rct_windowclass wc, uint8_t index, colour_t colour)
|
||||
{
|
||||
UIThemeWindowEntry entry { };
|
||||
entry.WindowClass = wc;
|
||||
|
@ -763,12 +763,12 @@ void theme_set_colour(rct_windowclass wc, uint8 index, colour_t colour)
|
|||
theme_save();
|
||||
}
|
||||
|
||||
uint8 theme_get_flags()
|
||||
uint8_t theme_get_flags()
|
||||
{
|
||||
return ThemeManager::CurrentTheme->Flags;
|
||||
}
|
||||
|
||||
void theme_set_flags(uint8 flags)
|
||||
void theme_set_flags(uint8_t flags)
|
||||
{
|
||||
ThemeManager::CurrentTheme->Flags = flags;
|
||||
theme_save();
|
||||
|
@ -843,7 +843,7 @@ void theme_manager_initialise()
|
|||
ThemeManager::Initialise();
|
||||
}
|
||||
|
||||
uint8 theme_desc_get_num_colours(rct_windowclass wc)
|
||||
uint8_t theme_desc_get_num_colours(rct_windowclass wc)
|
||||
{
|
||||
const WindowThemeDesc * desc = GetWindowThemeDescriptor(wc);
|
||||
if (desc == nullptr)
|
||||
|
@ -897,7 +897,7 @@ void colour_scheme_update_by_class(rct_window * window, rct_windowclass classifi
|
|||
windowTheme = &desc->DefaultTheme;
|
||||
}
|
||||
|
||||
for (sint32 i = 0; i < 6; i++) {
|
||||
for (int32_t i = 0; i < 6; i++) {
|
||||
window->colours[i] = windowTheme->Colours[i];
|
||||
}
|
||||
// Some windows need to be transparent even if the colours aren't.
|
||||
|
|
|
@ -34,14 +34,14 @@ size_t theme_manager_get_active_available_theme_index();
|
|||
void theme_manager_set_active_available_theme(size_t index);
|
||||
size_t theme_get_index_for_name(const utf8 * name);
|
||||
|
||||
colour_t theme_get_colour(rct_windowclass wc, uint8 index);
|
||||
void theme_set_colour(rct_windowclass wc, uint8 index, colour_t colour);
|
||||
uint8 theme_get_flags();
|
||||
void theme_set_flags(uint8 flags);
|
||||
colour_t theme_get_colour(rct_windowclass wc, uint8_t index);
|
||||
void theme_set_colour(rct_windowclass wc, uint8_t index, colour_t colour);
|
||||
uint8_t theme_get_flags();
|
||||
void theme_set_flags(uint8_t flags);
|
||||
void theme_save();
|
||||
void theme_rename(const utf8 * name);
|
||||
void theme_duplicate(const utf8 * name);
|
||||
void theme_delete();
|
||||
|
||||
uint8 theme_desc_get_num_colours(rct_windowclass wc);
|
||||
uint8_t theme_desc_get_num_colours(rct_windowclass wc);
|
||||
rct_string_id theme_desc_get_name(rct_windowclass wc);
|
||||
|
|
|
@ -32,19 +32,19 @@
|
|||
#include "Viewport.h"
|
||||
#include "Window.h"
|
||||
|
||||
static void viewport_interaction_remove_scenery(rct_tile_element *tileElement, sint32 x, sint32 y);
|
||||
static void viewport_interaction_remove_footpath(rct_tile_element *tileElement, sint32 x, sint32 y);
|
||||
static void viewport_interaction_remove_footpath_item(rct_tile_element *tileElement, sint32 x, sint32 y);
|
||||
static void viewport_interaction_remove_park_wall(rct_tile_element *tileElement, sint32 x, sint32 y);
|
||||
static void viewport_interaction_remove_large_scenery(rct_tile_element *tileElement, sint32 x, sint32 y);
|
||||
static void viewport_interaction_remove_park_entrance(rct_tile_element *tileElement, sint32 x, sint32 y);
|
||||
static rct_peep *viewport_interaction_get_closest_peep(sint32 x, sint32 y, sint32 maxDistance);
|
||||
static void viewport_interaction_remove_scenery(rct_tile_element *tileElement, int32_t x, int32_t y);
|
||||
static void viewport_interaction_remove_footpath(rct_tile_element *tileElement, int32_t x, int32_t y);
|
||||
static void viewport_interaction_remove_footpath_item(rct_tile_element *tileElement, int32_t x, int32_t y);
|
||||
static void viewport_interaction_remove_park_wall(rct_tile_element *tileElement, int32_t x, int32_t y);
|
||||
static void viewport_interaction_remove_large_scenery(rct_tile_element *tileElement, int32_t x, int32_t y);
|
||||
static void viewport_interaction_remove_park_entrance(rct_tile_element *tileElement, int32_t x, int32_t y);
|
||||
static rct_peep *viewport_interaction_get_closest_peep(int32_t x, int32_t y, int32_t maxDistance);
|
||||
|
||||
/**
|
||||
*
|
||||
* rct2: 0x006ED9D0
|
||||
*/
|
||||
sint32 viewport_interaction_get_item_left(sint32 x, sint32 y, viewport_interaction_info *info)
|
||||
int32_t viewport_interaction_get_item_left(int32_t x, int32_t y, viewport_interaction_info *info)
|
||||
{
|
||||
rct_tile_element *tileElement;
|
||||
rct_sprite *sprite;
|
||||
|
@ -85,7 +85,7 @@ sint32 viewport_interaction_get_item_left(sint32 x, sint32 y, viewport_interacti
|
|||
break;
|
||||
case VIEWPORT_INTERACTION_ITEM_PARK:
|
||||
set_map_tooltip_format_arg(0, rct_string_id, gParkName);
|
||||
set_map_tooltip_format_arg(2, uint32, gParkNameArgs);
|
||||
set_map_tooltip_format_arg(2, uint32_t, gParkNameArgs);
|
||||
break;
|
||||
default:
|
||||
info->type = VIEWPORT_INTERACTION_ITEM_NONE;
|
||||
|
@ -107,7 +107,7 @@ sint32 viewport_interaction_get_item_left(sint32 x, sint32 y, viewport_interacti
|
|||
return info->type;
|
||||
}
|
||||
|
||||
sint32 viewport_interaction_left_over(sint32 x, sint32 y)
|
||||
int32_t viewport_interaction_left_over(int32_t x, int32_t y)
|
||||
{
|
||||
viewport_interaction_info info;
|
||||
|
||||
|
@ -121,7 +121,7 @@ sint32 viewport_interaction_left_over(sint32 x, sint32 y)
|
|||
}
|
||||
}
|
||||
|
||||
sint32 viewport_interaction_left_click(sint32 x, sint32 y)
|
||||
int32_t viewport_interaction_left_click(int32_t x, int32_t y)
|
||||
{
|
||||
viewport_interaction_info info;
|
||||
|
||||
|
@ -175,13 +175,13 @@ sint32 viewport_interaction_left_click(sint32 x, sint32 y)
|
|||
*
|
||||
* rct2: 0x006EDE88
|
||||
*/
|
||||
sint32 viewport_interaction_get_item_right(sint32 x, sint32 y, viewport_interaction_info *info)
|
||||
int32_t viewport_interaction_get_item_right(int32_t x, int32_t y, viewport_interaction_info *info)
|
||||
{
|
||||
rct_tile_element *tileElement;
|
||||
rct_scenery_entry *sceneryEntry;
|
||||
rct_banner *banner;
|
||||
Ride *ride;
|
||||
sint32 i, stationIndex;
|
||||
int32_t i, stationIndex;
|
||||
|
||||
// No click input for title screen or track manager
|
||||
if (gScreenFlags & (SCREEN_FLAGS_TITLE_DEMO | SCREEN_FLAGS_TRACK_MANAGER))
|
||||
|
@ -207,7 +207,7 @@ sint32 viewport_interaction_get_item_right(sint32 x, sint32 y, viewport_interact
|
|||
if (ride->status == RIDE_STATUS_CLOSED) {
|
||||
set_map_tooltip_format_arg(0, rct_string_id, STR_MAP_TOOLTIP_STRINGID_CLICK_TO_MODIFY);
|
||||
set_map_tooltip_format_arg(2, rct_string_id, ride->name);
|
||||
set_map_tooltip_format_arg(4, uint32, ride->name_arguments);
|
||||
set_map_tooltip_format_arg(4, uint32_t, ride->name_arguments);
|
||||
}
|
||||
return info->type;
|
||||
|
||||
|
@ -253,12 +253,12 @@ sint32 viewport_interaction_get_item_right(sint32 x, sint32 y, viewport_interact
|
|||
}
|
||||
|
||||
set_map_tooltip_format_arg(2, rct_string_id, ride->name);
|
||||
set_map_tooltip_format_arg(4, uint32, ride->name_arguments);
|
||||
set_map_tooltip_format_arg(4, uint32_t, ride->name_arguments);
|
||||
return info->type;
|
||||
}
|
||||
|
||||
set_map_tooltip_format_arg(4, rct_string_id, ride->name);
|
||||
set_map_tooltip_format_arg(6, uint32, ride->name_arguments);
|
||||
set_map_tooltip_format_arg(6, uint32_t, ride->name_arguments);
|
||||
set_map_tooltip_format_arg(10, rct_string_id, RideComponentNames[RideNameConvention[ride->type].station].capitalised);
|
||||
|
||||
stationIndex = tile_element_get_station(tileElement);
|
||||
|
@ -266,7 +266,7 @@ sint32 viewport_interaction_get_item_right(sint32 x, sint32 y, viewport_interact
|
|||
if (ride->station_starts[i].xy == RCT_XY8_UNDEFINED)
|
||||
stationIndex--;
|
||||
stationIndex++;
|
||||
set_map_tooltip_format_arg(12, uint16, stationIndex);
|
||||
set_map_tooltip_format_arg(12, uint16_t, stationIndex);
|
||||
return info->type;
|
||||
|
||||
case VIEWPORT_INTERACTION_ITEM_WALL:
|
||||
|
@ -354,7 +354,7 @@ sint32 viewport_interaction_get_item_right(sint32 x, sint32 y, viewport_interact
|
|||
return info->type = VIEWPORT_INTERACTION_ITEM_NONE;
|
||||
}
|
||||
|
||||
sint32 viewport_interaction_right_over(sint32 x, sint32 y)
|
||||
int32_t viewport_interaction_right_over(int32_t x, int32_t y)
|
||||
{
|
||||
viewport_interaction_info info;
|
||||
|
||||
|
@ -365,7 +365,7 @@ sint32 viewport_interaction_right_over(sint32 x, sint32 y)
|
|||
*
|
||||
* rct2: 0x006E8A62
|
||||
*/
|
||||
sint32 viewport_interaction_right_click(sint32 x, sint32 y)
|
||||
int32_t viewport_interaction_right_click(int32_t x, int32_t y)
|
||||
{
|
||||
CoordsXYE tileElement;
|
||||
viewport_interaction_info info;
|
||||
|
@ -414,7 +414,7 @@ sint32 viewport_interaction_right_click(sint32 x, sint32 y)
|
|||
*
|
||||
* rct2: 0x006E08D2
|
||||
*/
|
||||
static void viewport_interaction_remove_scenery(rct_tile_element *tileElement, sint32 x, sint32 y)
|
||||
static void viewport_interaction_remove_scenery(rct_tile_element *tileElement, int32_t x, int32_t y)
|
||||
{
|
||||
gGameCommandErrorTitle = STR_CANT_REMOVE_THIS;
|
||||
game_do_command(
|
||||
|
@ -432,9 +432,9 @@ static void viewport_interaction_remove_scenery(rct_tile_element *tileElement, s
|
|||
*
|
||||
* rct2: 0x006A614A
|
||||
*/
|
||||
static void viewport_interaction_remove_footpath(rct_tile_element *tileElement, sint32 x, sint32 y)
|
||||
static void viewport_interaction_remove_footpath(rct_tile_element *tileElement, int32_t x, int32_t y)
|
||||
{
|
||||
sint32 z;
|
||||
int32_t z;
|
||||
rct_window *w;
|
||||
rct_tile_element *tileElement2;
|
||||
|
||||
|
@ -458,9 +458,9 @@ static void viewport_interaction_remove_footpath(rct_tile_element *tileElement,
|
|||
*
|
||||
* rct2: 0x006A61AB
|
||||
*/
|
||||
static void viewport_interaction_remove_footpath_item(rct_tile_element *tileElement, sint32 x, sint32 y)
|
||||
static void viewport_interaction_remove_footpath_item(rct_tile_element *tileElement, int32_t x, int32_t y)
|
||||
{
|
||||
sint32 type;
|
||||
int32_t type;
|
||||
|
||||
type = footpath_element_get_type(tileElement);
|
||||
if (footpath_element_is_queue(tileElement))
|
||||
|
@ -482,9 +482,9 @@ static void viewport_interaction_remove_footpath_item(rct_tile_element *tileElem
|
|||
*
|
||||
* rct2: 0x00666C0E
|
||||
*/
|
||||
void viewport_interaction_remove_park_entrance(rct_tile_element *tileElement, sint32 x, sint32 y)
|
||||
void viewport_interaction_remove_park_entrance(rct_tile_element *tileElement, int32_t x, int32_t y)
|
||||
{
|
||||
sint32 rotation = tile_element_get_direction_with_offset(tileElement, 1);
|
||||
int32_t rotation = tile_element_get_direction_with_offset(tileElement, 1);
|
||||
switch (tileElement->properties.entrance.index & 0x0F) {
|
||||
case 1:
|
||||
x += CoordsDirectionDelta[rotation].x;
|
||||
|
@ -503,7 +503,7 @@ void viewport_interaction_remove_park_entrance(rct_tile_element *tileElement, si
|
|||
*
|
||||
* rct2: 0x006E57A9
|
||||
*/
|
||||
static void viewport_interaction_remove_park_wall(rct_tile_element *tileElement, sint32 x, sint32 y)
|
||||
static void viewport_interaction_remove_park_wall(rct_tile_element *tileElement, int32_t x, int32_t y)
|
||||
{
|
||||
rct_scenery_entry *sceneryEntry = get_wall_entry(tileElement->properties.wall.type);
|
||||
if (sceneryEntry->wall.scrolling_mode != 0xFF)
|
||||
|
@ -522,7 +522,7 @@ static void viewport_interaction_remove_park_wall(rct_tile_element *tileElement,
|
|||
*
|
||||
* rct2: 0x006B88DC
|
||||
*/
|
||||
static void viewport_interaction_remove_large_scenery(rct_tile_element *tileElement, sint32 x, sint32 y)
|
||||
static void viewport_interaction_remove_large_scenery(rct_tile_element *tileElement, int32_t x, int32_t y)
|
||||
{
|
||||
rct_scenery_entry *sceneryEntry = get_large_scenery_entry(scenery_large_get_type(tileElement));
|
||||
|
||||
|
@ -544,10 +544,10 @@ static void viewport_interaction_remove_large_scenery(rct_tile_element *tileElem
|
|||
}
|
||||
}
|
||||
|
||||
static rct_peep *viewport_interaction_get_closest_peep(sint32 x, sint32 y, sint32 maxDistance)
|
||||
static rct_peep *viewport_interaction_get_closest_peep(int32_t x, int32_t y, int32_t maxDistance)
|
||||
{
|
||||
sint32 distance, closestDistance;
|
||||
uint16 spriteIndex;
|
||||
int32_t distance, closestDistance;
|
||||
uint16_t spriteIndex;
|
||||
rct_window *w;
|
||||
rct_viewport *viewport;
|
||||
rct_peep *peep, *closestPeep;
|
||||
|
@ -588,10 +588,10 @@ static rct_peep *viewport_interaction_get_closest_peep(sint32 x, sint32 y, sint3
|
|||
*
|
||||
* rct2: 0x0068A15E
|
||||
*/
|
||||
void sub_68A15E(sint32 screenX, sint32 screenY, sint16 *x, sint16 *y, sint32 *direction, rct_tile_element **tileElement)
|
||||
void sub_68A15E(int32_t screenX, int32_t screenY, int16_t *x, int16_t *y, int32_t *direction, rct_tile_element **tileElement)
|
||||
{
|
||||
sint16 my_x, my_y;
|
||||
sint32 interactionType;
|
||||
int16_t my_x, my_y;
|
||||
int32_t interactionType;
|
||||
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);
|
||||
|
@ -601,28 +601,28 @@ void sub_68A15E(sint32 screenX, sint32 screenY, sint16 *x, sint16 *y, sint32 *di
|
|||
return;
|
||||
}
|
||||
|
||||
sint16 originalZ = 0;
|
||||
int16_t originalZ = 0;
|
||||
if (interactionType == VIEWPORT_INTERACTION_ITEM_WATER) {
|
||||
originalZ = surface_get_water_height(myTileElement) << 4;
|
||||
}
|
||||
|
||||
LocationXY16 start_vp_pos = screen_coord_to_viewport_coord(viewport, screenX, screenY);
|
||||
LocationXY16 map_pos = { (sint16)(my_x + 16), (sint16)(my_y + 16) };
|
||||
LocationXY16 map_pos = { (int16_t)(my_x + 16), (int16_t)(my_y + 16) };
|
||||
|
||||
for (sint32 i = 0; i < 5; i++) {
|
||||
sint16 z = originalZ;
|
||||
for (int32_t i = 0; i < 5; i++) {
|
||||
int16_t z = originalZ;
|
||||
if (interactionType != VIEWPORT_INTERACTION_ITEM_WATER) {
|
||||
z = tile_element_height(map_pos.x, map_pos.y);
|
||||
}
|
||||
map_pos = viewport_coord_to_map_coord(start_vp_pos.x, start_vp_pos.y, z);
|
||||
map_pos.x = Math::Clamp<sint16>(map_pos.x, my_x, my_x + 31);
|
||||
map_pos.y = Math::Clamp<sint16>(map_pos.y, my_y, my_y + 31);
|
||||
map_pos.x = Math::Clamp<int16_t>(map_pos.x, my_x, my_x + 31);
|
||||
map_pos.y = Math::Clamp<int16_t>(map_pos.y, my_y, my_y + 31);
|
||||
}
|
||||
|
||||
// Determine to which edge the cursor is closest
|
||||
sint32 myDirection;
|
||||
sint32 mod_x = map_pos.x & 0x1F;
|
||||
sint32 mod_y = map_pos.y & 0x1F;
|
||||
int32_t myDirection;
|
||||
int32_t mod_x = map_pos.x & 0x1F;
|
||||
int32_t mod_y = map_pos.y & 0x1F;
|
||||
if (mod_x < mod_y) {
|
||||
if (mod_x + mod_y < 32) {
|
||||
myDirection = 0;
|
||||
|
|
|
@ -33,8 +33,8 @@ static void widget_caption_draw(rct_drawpixelinfo *dpi, rct_window *w, rct_widge
|
|||
static void widget_checkbox_draw(rct_drawpixelinfo *dpi, rct_window *w, rct_widgetindex widgetIndex);
|
||||
static void widget_closebox_draw(rct_drawpixelinfo *dpi, rct_window *w, rct_widgetindex widgetIndex);
|
||||
static void widget_scroll_draw(rct_drawpixelinfo *dpi, rct_window *w, rct_widgetindex widgetIndex);
|
||||
static void widget_hscrollbar_draw(rct_drawpixelinfo *dpi, rct_scroll *scroll, sint32 l, sint32 t, sint32 r, sint32 b, sint32 colour);
|
||||
static void widget_vscrollbar_draw(rct_drawpixelinfo *dpi, rct_scroll *scroll, sint32 l, sint32 t, sint32 r, sint32 b, sint32 colour);
|
||||
static void widget_hscrollbar_draw(rct_drawpixelinfo *dpi, rct_scroll *scroll, int32_t l, int32_t t, int32_t r, int32_t b, int32_t colour);
|
||||
static void widget_vscrollbar_draw(rct_drawpixelinfo *dpi, rct_scroll *scroll, int32_t l, int32_t t, int32_t r, int32_t b, int32_t colour);
|
||||
static void widget_draw_image(rct_drawpixelinfo *dpi, rct_window *w, rct_widgetindex widgetIndex);
|
||||
|
||||
/**
|
||||
|
@ -111,16 +111,16 @@ static void widget_frame_draw(rct_drawpixelinfo *dpi, rct_window *w, rct_widgeti
|
|||
rct_widget *widget = &w->widgets[widgetIndex];
|
||||
|
||||
// Resolve the absolute ltrb
|
||||
sint32 l = w->x + widget->left;
|
||||
sint32 t = w->y + widget->top;
|
||||
sint32 r = w->x + widget->right;
|
||||
sint32 b = w->y + widget->bottom;
|
||||
int32_t l = w->x + widget->left;
|
||||
int32_t t = w->y + widget->top;
|
||||
int32_t r = w->x + widget->right;
|
||||
int32_t b = w->y + widget->bottom;
|
||||
|
||||
//
|
||||
uint8 press = ((w->flags & WF_10) ? INSET_RECT_FLAG_FILL_MID_LIGHT : 0);
|
||||
uint8_t press = ((w->flags & WF_10) ? INSET_RECT_FLAG_FILL_MID_LIGHT : 0);
|
||||
|
||||
// Get the colour
|
||||
uint8 colour = w->colours[widget->colour];
|
||||
uint8_t colour = w->colours[widget->colour];
|
||||
|
||||
// Draw the frame
|
||||
gfx_fill_rect_inset(dpi, l, t, r, b, colour, press);
|
||||
|
@ -147,13 +147,13 @@ static void widget_resize_draw(rct_drawpixelinfo *dpi, rct_window *w, rct_widget
|
|||
rct_widget *widget = &w->widgets[widgetIndex];
|
||||
|
||||
// Resolve the absolute ltrb
|
||||
sint32 l = w->x + widget->left;
|
||||
sint32 t = w->y + widget->top;
|
||||
sint32 r = w->x + widget->right;
|
||||
sint32 b = w->y + widget->bottom;
|
||||
int32_t l = w->x + widget->left;
|
||||
int32_t t = w->y + widget->top;
|
||||
int32_t r = w->x + widget->right;
|
||||
int32_t b = w->y + widget->bottom;
|
||||
|
||||
// Get the colour
|
||||
uint8 colour = w->colours[widget->colour];
|
||||
uint8_t colour = w->colours[widget->colour];
|
||||
|
||||
// Draw the panel
|
||||
gfx_fill_rect_inset(dpi, l, t, r, b, colour, 0);
|
||||
|
@ -180,18 +180,18 @@ static void widget_button_draw(rct_drawpixelinfo *dpi, rct_window *w, rct_widget
|
|||
rct_widget *widget = &w->widgets[widgetIndex];
|
||||
|
||||
// Resolve the absolute ltrb
|
||||
sint32 l = w->x + widget->left;
|
||||
sint32 t = w->y + widget->top;
|
||||
sint32 r = w->x + widget->right;
|
||||
sint32 b = w->y + widget->bottom;
|
||||
int32_t l = w->x + widget->left;
|
||||
int32_t t = w->y + widget->top;
|
||||
int32_t r = w->x + widget->right;
|
||||
int32_t b = w->y + widget->bottom;
|
||||
|
||||
// Check if the button is pressed down
|
||||
uint8 press = widget_is_pressed(w, widgetIndex) || widget_is_active_tool(w, widgetIndex) ? INSET_RECT_FLAG_BORDER_INSET : 0;
|
||||
uint8_t press = widget_is_pressed(w, widgetIndex) || widget_is_active_tool(w, widgetIndex) ? INSET_RECT_FLAG_BORDER_INSET : 0;
|
||||
|
||||
// Get the colour
|
||||
uint8 colour = w->colours[widget->colour];
|
||||
uint8_t colour = w->colours[widget->colour];
|
||||
|
||||
if ((sint32)widget->image == -2) {
|
||||
if ((int32_t)widget->image == -2) {
|
||||
// Draw border with no fill
|
||||
gfx_fill_rect_inset(dpi, l, t, r, b, colour, press | INSET_RECT_FLAG_FILL_NONE);
|
||||
return;
|
||||
|
@ -212,7 +212,7 @@ static void widget_tab_draw(rct_drawpixelinfo *dpi, rct_window *w, rct_widgetind
|
|||
// Get the widget
|
||||
rct_widget *widget = &w->widgets[widgetIndex];
|
||||
|
||||
if ((sint32)widget->image == -1)
|
||||
if ((int32_t)widget->image == -1)
|
||||
return;
|
||||
|
||||
// Draw widgets that aren't explicitly disabled.
|
||||
|
@ -231,12 +231,12 @@ static void widget_tab_draw(rct_drawpixelinfo *dpi, rct_window *w, rct_widgetind
|
|||
}
|
||||
|
||||
// Resolve the absolute ltrb
|
||||
sint32 l = w->x + widget->left;
|
||||
sint32 t = w->y + widget->top;
|
||||
int32_t l = w->x + widget->left;
|
||||
int32_t t = w->y + widget->top;
|
||||
|
||||
// Get the colour and disabled image
|
||||
uint8 colour = w->colours[widget->colour] & 0x7F;
|
||||
uint32 image = widget->image + 2;
|
||||
uint8_t colour = w->colours[widget->colour] & 0x7F;
|
||||
uint32_t image = widget->image + 2;
|
||||
|
||||
// Draw disabled image
|
||||
gfx_draw_sprite(dpi, image | (colour << 19), l, t, 0);
|
||||
|
@ -257,17 +257,17 @@ static void widget_flat_button_draw(rct_drawpixelinfo *dpi, rct_window *w, rct_w
|
|||
rct_widget *widget = &w->widgets[widgetIndex];
|
||||
|
||||
// Resolve the absolute ltrb
|
||||
sint32 l = w->x + widget->left;
|
||||
sint32 t = w->y + widget->top;
|
||||
sint32 r = w->x + widget->right;
|
||||
sint32 b = w->y + widget->bottom;
|
||||
int32_t l = w->x + widget->left;
|
||||
int32_t t = w->y + widget->top;
|
||||
int32_t r = w->x + widget->right;
|
||||
int32_t b = w->y + widget->bottom;
|
||||
|
||||
// Get the colour
|
||||
uint8 colour = w->colours[widget->colour];
|
||||
uint8_t colour = w->colours[widget->colour];
|
||||
|
||||
// Check if the button is pressed down
|
||||
if (widget_is_pressed(w, widgetIndex) || widget_is_active_tool(w, widgetIndex)) {
|
||||
if ((sint32)widget->image == -2) {
|
||||
if ((int32_t)widget->image == -2) {
|
||||
// Draw border with no fill
|
||||
gfx_fill_rect_inset(dpi, l, t, r, b, colour, INSET_RECT_FLAG_BORDER_INSET | INSET_RECT_FLAG_FILL_NONE);
|
||||
return;
|
||||
|
@ -291,16 +291,16 @@ static void widget_text_button(rct_drawpixelinfo *dpi, rct_window *w, rct_widget
|
|||
rct_widget *widget = &w->widgets[widgetIndex];
|
||||
|
||||
// Resolve the absolute ltrb
|
||||
sint32 l = w->x + widget->left;
|
||||
sint32 t = w->y + widget->top;
|
||||
sint32 r = w->x + widget->right;
|
||||
sint32 b = w->y + widget->bottom;
|
||||
int32_t l = w->x + widget->left;
|
||||
int32_t t = w->y + widget->top;
|
||||
int32_t r = w->x + widget->right;
|
||||
int32_t b = w->y + widget->bottom;
|
||||
|
||||
// Get the colour
|
||||
uint8 colour = w->colours[widget->colour];
|
||||
uint8_t colour = w->colours[widget->colour];
|
||||
|
||||
// Border
|
||||
uint8 press = widget_is_pressed(w, widgetIndex) || widget_is_active_tool(w, widgetIndex) ? INSET_RECT_FLAG_BORDER_INSET : 0;
|
||||
uint8_t press = widget_is_pressed(w, widgetIndex) || widget_is_active_tool(w, widgetIndex) ? INSET_RECT_FLAG_BORDER_INSET : 0;
|
||||
gfx_fill_rect_inset(dpi, l, t, r, b, colour, press);
|
||||
|
||||
// Button caption
|
||||
|
@ -327,21 +327,21 @@ static void widget_text_centred(rct_drawpixelinfo *dpi, rct_window *w, rct_widge
|
|||
return;
|
||||
|
||||
// Get the colour
|
||||
uint8 colour = w->colours[widget->colour];
|
||||
uint8_t colour = w->colours[widget->colour];
|
||||
colour &= ~(COLOUR_FLAG_TRANSLUCENT);
|
||||
if (widget_is_disabled(w, widgetIndex))
|
||||
colour |= COLOUR_FLAG_INSET;
|
||||
|
||||
// Resolve the absolute ltrb
|
||||
sint32 l = w->x + widget->left;
|
||||
sint32 r = w->x + widget->right;
|
||||
sint32 t;
|
||||
int32_t l = w->x + widget->left;
|
||||
int32_t r = w->x + widget->right;
|
||||
int32_t t;
|
||||
|
||||
if (widget->type == WWT_BUTTON || widget->type == WWT_TABLE_HEADER)
|
||||
{
|
||||
sint32 height = (widget->bottom - widget->top);
|
||||
int32_t height = (widget->bottom - widget->top);
|
||||
if (height >= 10)
|
||||
t = w->y + std::max<sint32>(widget->top, widget->top + (height / 2) - 5);
|
||||
t = w->y + std::max<int32_t>(widget->top, widget->top + (height / 2) - 5);
|
||||
else
|
||||
t = w->y + widget->top - 1;
|
||||
}
|
||||
|
@ -372,20 +372,20 @@ static void widget_text(rct_drawpixelinfo *dpi, rct_window *w, rct_widgetindex w
|
|||
return;
|
||||
|
||||
// Get the colour
|
||||
uint8 colour = w->colours[widget->colour];
|
||||
uint8_t colour = w->colours[widget->colour];
|
||||
if (widget_is_disabled(w, widgetIndex))
|
||||
colour |= COLOUR_FLAG_INSET;
|
||||
|
||||
// Resolve the absolute ltrb
|
||||
sint32 l = w->x + widget->left;
|
||||
sint32 r = w->x + widget->right;
|
||||
sint32 t;
|
||||
int32_t l = w->x + widget->left;
|
||||
int32_t r = w->x + widget->right;
|
||||
int32_t t;
|
||||
|
||||
if (widget->type == WWT_BUTTON || widget->type == WWT_TABLE_HEADER)
|
||||
{
|
||||
sint32 height = (widget->bottom - widget->top);
|
||||
int32_t height = (widget->bottom - widget->top);
|
||||
if (height >= 10)
|
||||
t = w->y + std::max<sint32>(widget->top, widget->top + (height / 2) - 5);
|
||||
t = w->y + std::max<int32_t>(widget->top, widget->top + (height / 2) - 5);
|
||||
else
|
||||
t = w->y + widget->top - 1;
|
||||
}
|
||||
|
@ -405,13 +405,13 @@ static void widget_text_inset(rct_drawpixelinfo *dpi, rct_window *w, rct_widgeti
|
|||
rct_widget *widget = &w->widgets[widgetIndex];
|
||||
|
||||
// Resolve the absolute ltrb
|
||||
sint32 l = w->x + widget->left;
|
||||
sint32 t = w->y + widget->top;
|
||||
sint32 r = w->x + widget->right;
|
||||
sint32 b = w->y + widget->bottom;
|
||||
int32_t l = w->x + widget->left;
|
||||
int32_t t = w->y + widget->top;
|
||||
int32_t r = w->x + widget->right;
|
||||
int32_t b = w->y + widget->bottom;
|
||||
|
||||
// Get the colour
|
||||
uint8 colour = w->colours[widget->colour];
|
||||
uint8_t colour = w->colours[widget->colour];
|
||||
|
||||
gfx_fill_rect_inset(dpi, l, t, r, b, colour, INSET_RECT_F_60);
|
||||
widget_text(dpi, w, widgetIndex);
|
||||
|
@ -427,20 +427,20 @@ static void widget_groupbox_draw(rct_drawpixelinfo *dpi, rct_window *w, rct_widg
|
|||
rct_widget *widget = &w->widgets[widgetIndex];
|
||||
|
||||
// Resolve the absolute ltrb
|
||||
sint32 l = w->x + widget->left + 5;
|
||||
sint32 t = w->y + widget->top;
|
||||
sint32 r = w->x + widget->right;
|
||||
sint32 b = w->y + widget->bottom;
|
||||
sint32 textRight = l;
|
||||
int32_t l = w->x + widget->left + 5;
|
||||
int32_t t = w->y + widget->top;
|
||||
int32_t r = w->x + widget->right;
|
||||
int32_t b = w->y + widget->bottom;
|
||||
int32_t textRight = l;
|
||||
|
||||
// Text
|
||||
if (widget->text != STR_NONE) {
|
||||
uint8 colour = w->colours[widget->colour] & 0x7F;
|
||||
uint8_t colour = w->colours[widget->colour] & 0x7F;
|
||||
if (widget_is_disabled(w, widgetIndex))
|
||||
colour |= COLOUR_FLAG_INSET;
|
||||
|
||||
utf8 buffer[512] = { 0 };
|
||||
uint8 args[sizeof(uintptr_t)] = { 0 };
|
||||
uint8_t args[sizeof(uintptr_t)] = { 0 };
|
||||
format_string(buffer, sizeof(buffer), widget->text, gCommonFormatArgs);
|
||||
set_format_arg_on(args, 0, uintptr_t, buffer);
|
||||
gfx_draw_string_left(dpi, STR_STRING, args, colour, l, t);
|
||||
|
@ -455,7 +455,7 @@ static void widget_groupbox_draw(rct_drawpixelinfo *dpi, rct_window *w, rct_widg
|
|||
b = w->y + widget->bottom;
|
||||
|
||||
// Get the colour
|
||||
uint8 colour = w->colours[widget->colour] & 0x7F;
|
||||
uint8_t colour = w->colours[widget->colour] & 0x7F;
|
||||
|
||||
// Border left of text
|
||||
gfx_fill_rect(dpi, l, t, l + 4, t, ColourMapA[colour].mid_dark);
|
||||
|
@ -488,15 +488,15 @@ static void widget_caption_draw(rct_drawpixelinfo *dpi, rct_window *w, rct_widge
|
|||
rct_widget *widget = &w->widgets[widgetIndex];
|
||||
|
||||
// Resolve the absolute ltrb
|
||||
sint32 l = w->x + widget->left;
|
||||
sint32 t = w->y + widget->top;
|
||||
sint32 r = w->x + widget->right;
|
||||
sint32 b = w->y + widget->bottom;
|
||||
int32_t l = w->x + widget->left;
|
||||
int32_t t = w->y + widget->top;
|
||||
int32_t r = w->x + widget->right;
|
||||
int32_t b = w->y + widget->bottom;
|
||||
|
||||
// Get the colour
|
||||
uint8 colour = w->colours[widget->colour];
|
||||
uint8_t colour = w->colours[widget->colour];
|
||||
|
||||
uint8 press = INSET_RECT_F_60;
|
||||
uint8_t press = INSET_RECT_F_60;
|
||||
if (w->flags & WF_10)
|
||||
press |= INSET_RECT_FLAG_FILL_MID_LIGHT;
|
||||
|
||||
|
@ -514,7 +514,7 @@ static void widget_caption_draw(rct_drawpixelinfo *dpi, rct_window *w, rct_widge
|
|||
|
||||
l = widget->left + w->x + 2;
|
||||
t = widget->top + w->y + 1;
|
||||
sint32 width = widget->right - widget->left - 4;
|
||||
int32_t width = widget->right - widget->left - 4;
|
||||
if ((widget + 1)->type == WWT_CLOSEBOX) {
|
||||
width -= 10;
|
||||
if ((widget + 2)->type == WWT_CLOSEBOX)
|
||||
|
@ -534,20 +534,20 @@ static void widget_closebox_draw(rct_drawpixelinfo *dpi, rct_window *w, rct_widg
|
|||
rct_widget *widget = &w->widgets[widgetIndex];
|
||||
|
||||
// Resolve the absolute ltrb
|
||||
sint32 l = w->x + widget->left;
|
||||
sint32 t = w->y + widget->top;
|
||||
sint32 r = w->x + widget->right;
|
||||
sint32 b = w->y + widget->bottom;
|
||||
int32_t l = w->x + widget->left;
|
||||
int32_t t = w->y + widget->top;
|
||||
int32_t r = w->x + widget->right;
|
||||
int32_t b = w->y + widget->bottom;
|
||||
|
||||
// Check if the button is pressed down
|
||||
uint8 press = 0;
|
||||
uint8_t press = 0;
|
||||
if (w->flags & WF_10)
|
||||
press |= INSET_RECT_FLAG_FILL_MID_LIGHT;
|
||||
if (widget_is_pressed(w, widgetIndex) || widget_is_active_tool(w, widgetIndex))
|
||||
press |= INSET_RECT_FLAG_BORDER_INSET;
|
||||
|
||||
// Get the colour
|
||||
uint8 colour = w->colours[widget->colour];
|
||||
uint8_t colour = w->colours[widget->colour];
|
||||
|
||||
// Draw the button
|
||||
gfx_fill_rect_inset(dpi, l, t, r, b, colour, press);
|
||||
|
@ -556,7 +556,7 @@ static void widget_closebox_draw(rct_drawpixelinfo *dpi, rct_window *w, rct_widg
|
|||
return;
|
||||
|
||||
l = w->x + (widget->left + widget->right) / 2 - 1;
|
||||
t = w->y + std::max<sint32>(widget->top, (widget->top + widget->bottom) / 2 - 5);
|
||||
t = w->y + std::max<int32_t>(widget->top, (widget->top + widget->bottom) / 2 - 5);
|
||||
|
||||
if (widget_is_disabled(w, widgetIndex))
|
||||
colour |= COLOUR_FLAG_INSET;
|
||||
|
@ -574,13 +574,13 @@ static void widget_checkbox_draw(rct_drawpixelinfo *dpi, rct_window *w, rct_widg
|
|||
rct_widget *widget = &w->widgets[widgetIndex];
|
||||
|
||||
// Resolve the absolute ltb
|
||||
sint32 l = w->x + widget->left;
|
||||
sint32 t = w->y + widget->top;
|
||||
sint32 b = w->y + widget->bottom;
|
||||
sint32 yMid = (b + t) / 2;
|
||||
int32_t l = w->x + widget->left;
|
||||
int32_t t = w->y + widget->top;
|
||||
int32_t b = w->y + widget->bottom;
|
||||
int32_t yMid = (b + t) / 2;
|
||||
|
||||
// Get the colour
|
||||
uint8 colour = w->colours[widget->colour];
|
||||
uint8_t colour = w->colours[widget->colour];
|
||||
|
||||
// checkbox
|
||||
gfx_fill_rect_inset(dpi, l, yMid - 5, l + 9, yMid + 4, colour, INSET_RECT_F_60);
|
||||
|
@ -609,18 +609,18 @@ static void widget_checkbox_draw(rct_drawpixelinfo *dpi, rct_window *w, rct_widg
|
|||
static void widget_scroll_draw(rct_drawpixelinfo *dpi, rct_window *w, rct_widgetindex widgetIndex)
|
||||
{
|
||||
// Get the widget
|
||||
sint32 scrollIndex = window_get_scroll_data_index(w, widgetIndex);
|
||||
int32_t scrollIndex = window_get_scroll_data_index(w, widgetIndex);
|
||||
rct_widget *widget = &w->widgets[widgetIndex];
|
||||
rct_scroll* scroll = &w->scrolls[scrollIndex];
|
||||
|
||||
// Resolve the absolute ltrb
|
||||
sint32 l = w->x + widget->left;
|
||||
sint32 t = w->y + widget->top;
|
||||
sint32 r = w->x + widget->right;
|
||||
sint32 b = w->y + widget->bottom;
|
||||
int32_t l = w->x + widget->left;
|
||||
int32_t t = w->y + widget->top;
|
||||
int32_t r = w->x + widget->right;
|
||||
int32_t b = w->y + widget->bottom;
|
||||
|
||||
// Get the colour
|
||||
uint8 colour = w->colours[widget->colour];
|
||||
uint8_t colour = w->colours[widget->colour];
|
||||
|
||||
// Draw the border
|
||||
gfx_fill_rect_inset(dpi, l, t, r, b, colour, INSET_RECT_F_60);
|
||||
|
@ -654,10 +654,10 @@ static void widget_scroll_draw(rct_drawpixelinfo *dpi, rct_window *w, rct_widget
|
|||
rct_drawpixelinfo scroll_dpi = *dpi;
|
||||
|
||||
// Clip the scroll dpi against the outer dpi
|
||||
sint32 cl = std::max<sint32>(dpi->x, l);
|
||||
sint32 ct = std::max<sint32>(dpi->y, t);
|
||||
sint32 cr = std::min<sint32>(dpi->x + dpi->width, r);
|
||||
sint32 cb = std::min<sint32>(dpi->y + dpi->height, b);
|
||||
int32_t cl = std::max<int32_t>(dpi->x, l);
|
||||
int32_t ct = std::max<int32_t>(dpi->y, t);
|
||||
int32_t cr = std::min<int32_t>(dpi->x + dpi->width, r);
|
||||
int32_t cb = std::min<int32_t>(dpi->y + dpi->height, b);
|
||||
|
||||
// Set the respective dpi attributes
|
||||
scroll_dpi.x = cl - l + scroll->h_left;
|
||||
|
@ -673,7 +673,7 @@ static void widget_scroll_draw(rct_drawpixelinfo *dpi, rct_window *w, rct_widget
|
|||
window_event_scroll_paint_call(w, &scroll_dpi, scrollIndex);
|
||||
}
|
||||
|
||||
static void widget_hscrollbar_draw(rct_drawpixelinfo *dpi, rct_scroll *scroll, sint32 l, sint32 t, sint32 r, sint32 b, sint32 colour)
|
||||
static void widget_hscrollbar_draw(rct_drawpixelinfo *dpi, rct_scroll *scroll, int32_t l, int32_t t, int32_t r, int32_t b, int32_t colour)
|
||||
{
|
||||
colour &= 0x7F;
|
||||
// Trough
|
||||
|
@ -699,7 +699,7 @@ static void widget_hscrollbar_draw(rct_drawpixelinfo *dpi, rct_scroll *scroll, s
|
|||
gfx_draw_string(dpi, (char*)BlackRightArrowString, COLOUR_BLACK, r - 6, t);
|
||||
}
|
||||
|
||||
static void widget_vscrollbar_draw(rct_drawpixelinfo *dpi, rct_scroll *scroll, sint32 l, sint32 t, sint32 r, sint32 b, sint32 colour)
|
||||
static void widget_vscrollbar_draw(rct_drawpixelinfo *dpi, rct_scroll *scroll, int32_t l, int32_t t, int32_t r, int32_t b, int32_t colour)
|
||||
{
|
||||
colour &= 0x7F;
|
||||
// Trough
|
||||
|
@ -735,16 +735,16 @@ static void widget_draw_image(rct_drawpixelinfo *dpi, rct_window *w, rct_widgeti
|
|||
rct_widget *widget = &w->widgets[widgetIndex];
|
||||
|
||||
// Get the image
|
||||
sint32 image = widget->image;
|
||||
int32_t image = widget->image;
|
||||
if (image == SPR_NONE)
|
||||
return;
|
||||
|
||||
// Resolve the absolute ltrb
|
||||
sint32 l = w->x + widget->left;
|
||||
sint32 t = w->y + widget->top;
|
||||
int32_t l = w->x + widget->left;
|
||||
int32_t t = w->y + widget->top;
|
||||
|
||||
// Get the colour
|
||||
uint8 colour = NOT_TRANSLUCENT(w->colours[widget->colour]);
|
||||
uint8_t colour = NOT_TRANSLUCENT(w->colours[widget->colour]);
|
||||
|
||||
if (widget->type == WWT_COLOURBTN || widget->type == WWT_TRNBTN || widget->type == WWT_TAB)
|
||||
if (widget_is_pressed(w, widgetIndex) || widget_is_active_tool(w, widgetIndex))
|
||||
|
@ -831,7 +831,7 @@ bool widget_is_active_tool(rct_window *w, rct_widgetindex widgetIndex)
|
|||
* esi: w
|
||||
* edi: widget
|
||||
*/
|
||||
void widget_scroll_get_part(rct_window *w, rct_widget *widget, sint32 x, sint32 y, sint32 *output_x, sint32 *output_y, sint32 *output_scroll_area, sint32 *scroll_id)
|
||||
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, int32_t *scroll_id)
|
||||
{
|
||||
rct_widget* iterator = w->widgets;
|
||||
*scroll_id = 0;
|
||||
|
@ -847,9 +847,9 @@ void widget_scroll_get_part(rct_window *w, rct_widget *widget, sint32 x, sint32
|
|||
if ((w->scrolls[*scroll_id].flags & HSCROLLBAR_VISIBLE) && y >= (w->y + widget->bottom - 11))
|
||||
{
|
||||
// horizontal scrollbar
|
||||
sint32 rightOffset = 0;
|
||||
sint32 iteratorLeft = widget->left + w->x + 10;
|
||||
sint32 iteratorRight = widget->right + w->x - 10;
|
||||
int32_t rightOffset = 0;
|
||||
int32_t iteratorLeft = widget->left + w->x + 10;
|
||||
int32_t iteratorRight = widget->right + w->x - 10;
|
||||
if (!(w->scrolls[*scroll_id].flags & VSCROLLBAR_VISIBLE))
|
||||
{
|
||||
rightOffset = 11;
|
||||
|
@ -883,9 +883,9 @@ void widget_scroll_get_part(rct_window *w, rct_widget *widget, sint32 x, sint32
|
|||
else if ((w->scrolls[*scroll_id].flags & VSCROLLBAR_VISIBLE) && (x >= w->x + widget->right - 11))
|
||||
{
|
||||
// vertical scrollbar
|
||||
sint32 bottomOffset = 0;
|
||||
sint32 iteratorTop = widget->top + w->y + 10;
|
||||
sint32 iteratorBottom = widget->bottom + w->y;
|
||||
int32_t bottomOffset = 0;
|
||||
int32_t iteratorTop = widget->top + w->y + 10;
|
||||
int32_t iteratorBottom = widget->bottom + w->y;
|
||||
if (w->scrolls[*scroll_id].flags & HSCROLLBAR_VISIBLE)
|
||||
{
|
||||
bottomOffset = 11;
|
||||
|
@ -948,7 +948,7 @@ void widget_set_enabled(rct_window *w, rct_widgetindex widgetIndex, bool enabled
|
|||
}
|
||||
}
|
||||
|
||||
void widget_set_checkbox_value(rct_window *w, rct_widgetindex widgetIndex, sint32 value)
|
||||
void widget_set_checkbox_value(rct_window *w, rct_widgetindex widgetIndex, int32_t value)
|
||||
{
|
||||
if (value)
|
||||
w->pressed_widgets |= (1ULL << widgetIndex);
|
||||
|
@ -958,21 +958,21 @@ void widget_set_checkbox_value(rct_window *w, rct_widgetindex widgetIndex, sint3
|
|||
|
||||
static void widget_text_box_draw(rct_drawpixelinfo *dpi, rct_window *w, rct_widgetindex widgetIndex)
|
||||
{
|
||||
sint32 no_lines = 0;
|
||||
sint32 font_height = 0;
|
||||
int32_t no_lines = 0;
|
||||
int32_t font_height = 0;
|
||||
char wrapped_string[TEXT_INPUT_SIZE];
|
||||
|
||||
// Get the widget
|
||||
rct_widget *widget = &w->widgets[widgetIndex];
|
||||
|
||||
// Resolve the absolute ltrb
|
||||
sint32 l = w->x + widget->left;
|
||||
sint32 t = w->y + widget->top;
|
||||
sint32 r = w->x + widget->right;
|
||||
sint32 b = w->y + widget->bottom;
|
||||
int32_t l = w->x + widget->left;
|
||||
int32_t t = w->y + widget->top;
|
||||
int32_t r = w->x + widget->right;
|
||||
int32_t b = w->y + widget->bottom;
|
||||
|
||||
// Get the colour
|
||||
uint8 colour = w->colours[widget->colour];
|
||||
uint8_t colour = w->colours[widget->colour];
|
||||
|
||||
bool active = w->classification == gCurrentTextBox.window.classification &&
|
||||
w->number == gCurrentTextBox.window.number &&
|
||||
|
@ -1010,10 +1010,10 @@ static void widget_text_box_draw(rct_drawpixelinfo *dpi, rct_window *w, rct_widg
|
|||
// Make a copy of the string for measuring the width.
|
||||
char temp_string[TEXT_INPUT_SIZE] = { 0 };
|
||||
memcpy(temp_string, wrapped_string, std::min(string_length, gTextInput->SelectionStart));
|
||||
sint32 cur_x = l + gfx_get_string_width(temp_string) + 3;
|
||||
int32_t cur_x = l + gfx_get_string_width(temp_string) + 3;
|
||||
|
||||
sint32 width = 6;
|
||||
if ((uint32)gTextInput->SelectionStart < strlen(gTextBoxInput)){
|
||||
int32_t width = 6;
|
||||
if ((uint32_t)gTextInput->SelectionStart < strlen(gTextBoxInput)){
|
||||
// Make a new 1 character wide string for measuring the width
|
||||
// of the character that the cursor is under.
|
||||
temp_string[1] = '\0';
|
||||
|
|
|
@ -24,11 +24,11 @@
|
|||
using namespace OpenRCT2;
|
||||
|
||||
// The amount of pixels to scroll per wheel click
|
||||
constexpr sint32 WINDOW_SCROLL_PIXELS = 17;
|
||||
constexpr int32_t WINDOW_SCROLL_PIXELS = 17;
|
||||
|
||||
static sint32 _previousAbsoluteWheel = 0;
|
||||
static int32_t _previousAbsoluteWheel = 0;
|
||||
|
||||
static bool window_fits_between_others(sint32 x, sint32 y, sint32 width, sint32 height)
|
||||
static bool window_fits_between_others(int32_t x, int32_t y, int32_t width, int32_t height)
|
||||
{
|
||||
for (auto& w : g_window_list)
|
||||
{
|
||||
|
@ -45,7 +45,7 @@ static bool window_fits_between_others(sint32 x, sint32 y, sint32 width, sint32
|
|||
return true;
|
||||
}
|
||||
|
||||
static bool window_fits_within_space(sint32 x, sint32 y, sint32 width, sint32 height)
|
||||
static bool window_fits_within_space(int32_t x, int32_t y, int32_t width, int32_t height)
|
||||
{
|
||||
if (x < 0) return false;
|
||||
if (y <= TOP_TOOLBAR_HEIGHT && !(gScreenFlags & SCREEN_FLAGS_TITLE_DEMO)) return false;
|
||||
|
@ -54,11 +54,11 @@ static bool window_fits_within_space(sint32 x, sint32 y, sint32 width, sint32 he
|
|||
return window_fits_between_others(x, y, width, height);
|
||||
}
|
||||
|
||||
static bool window_fits_on_screen(sint32 x, sint32 y, sint32 width, sint32 height)
|
||||
static bool window_fits_on_screen(int32_t x, int32_t y, int32_t width, int32_t height)
|
||||
{
|
||||
uint16 screenWidth = context_get_width();
|
||||
uint16 screenHeight = context_get_height();
|
||||
sint32 unk;
|
||||
uint16_t screenWidth = context_get_width();
|
||||
uint16_t screenHeight = context_get_height();
|
||||
int32_t unk;
|
||||
|
||||
unk = -(width / 4);
|
||||
if (x < unk) return false;
|
||||
|
@ -70,7 +70,7 @@ static bool window_fits_on_screen(sint32 x, sint32 y, sint32 width, sint32 heigh
|
|||
return window_fits_between_others(x, y, width, height);
|
||||
}
|
||||
|
||||
rct_window *window_create(sint32 x, sint32 y, sint32 width, sint32 height, rct_window_event_list *event_handlers, rct_windowclass cls, uint16 flags)
|
||||
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, uint16_t flags)
|
||||
{
|
||||
// Check if there are any window slots left
|
||||
// include WINDOW_LIMIT_RESERVED for items such as the main viewport and toolbars to not appear to be counted.
|
||||
|
@ -156,7 +156,7 @@ rct_window *window_create(sint32 x, sint32 y, sint32 width, sint32 height, rct_w
|
|||
return w;
|
||||
}
|
||||
|
||||
rct_window *window_create_auto_pos(sint32 width, sint32 height, rct_window_event_list *event_handlers, rct_windowclass cls, uint16 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)
|
||||
{
|
||||
auto uiContext = GetContext()->GetUiContext();
|
||||
auto screenWidth = uiContext->GetWidth();
|
||||
|
@ -171,10 +171,10 @@ rct_window *window_create_auto_pos(sint32 width, sint32 height, rct_window_event
|
|||
// if (w != nullptr) {
|
||||
// if (w->x > -60 && w->x < screenWidth - 20) {
|
||||
// if (w->y < screenHeight - 20) {
|
||||
// sint32 x = w->x;
|
||||
// int32_t x = w->x;
|
||||
// if (w->x + width > screenWidth)
|
||||
// x = screenWidth - 20 - width;
|
||||
// sint32 y = w->y;
|
||||
// int32_t y = w->y;
|
||||
// return window_create(x + 10, y + 10, width, height, event_handlers, cls, flags);
|
||||
// }
|
||||
// }
|
||||
|
@ -182,8 +182,8 @@ rct_window *window_create_auto_pos(sint32 width, sint32 height, rct_window_event
|
|||
// }
|
||||
|
||||
// Place window in an empty corner of the screen
|
||||
sint32 x = 0;
|
||||
sint32 y = 30;
|
||||
int32_t x = 0;
|
||||
int32_t y = 30;
|
||||
if (window_fits_within_space(x, y, width, height)) goto foundSpace;
|
||||
|
||||
x = screenWidth - width;
|
||||
|
@ -282,32 +282,32 @@ foundSpace:
|
|||
return window_create(x, y, width, height, event_handlers, cls, flags);
|
||||
}
|
||||
|
||||
rct_window * window_create_centred(sint32 width, sint32 height, rct_window_event_list *event_handlers, rct_windowclass cls, uint16 flags)
|
||||
rct_window * window_create_centred(int32_t width, int32_t height, rct_window_event_list *event_handlers, rct_windowclass cls, uint16_t flags)
|
||||
{
|
||||
auto uiContext = GetContext()->GetUiContext();
|
||||
auto screenWidth = uiContext->GetWidth();
|
||||
auto screenHeight = uiContext->GetHeight();
|
||||
|
||||
sint32 x = (screenWidth - width) / 2;
|
||||
sint32 y = std::max(TOP_TOOLBAR_HEIGHT + 1, (screenHeight - height) / 2);
|
||||
int32_t x = (screenWidth - width) / 2;
|
||||
int32_t y = std::max(TOP_TOOLBAR_HEIGHT + 1, (screenHeight - height) / 2);
|
||||
return window_create(x, y, width, height, event_handlers, cls, flags);
|
||||
}
|
||||
|
||||
static sint32 window_get_widget_index(rct_window *w, rct_widget *widget)
|
||||
static int32_t window_get_widget_index(rct_window *w, rct_widget *widget)
|
||||
{
|
||||
sint32 i = 0;
|
||||
int32_t i = 0;
|
||||
for (rct_widget *widget2 = w->widgets; widget2->type != WWT_LAST; widget2++, i++)
|
||||
if (widget == widget2)
|
||||
return i;
|
||||
return -1;
|
||||
}
|
||||
|
||||
static sint32 window_get_scroll_index(rct_window *w, sint32 targetWidgetIndex)
|
||||
static int32_t window_get_scroll_index(rct_window *w, int32_t targetWidgetIndex)
|
||||
{
|
||||
if (w->widgets[targetWidgetIndex].type != WWT_SCROLL)
|
||||
return -1;
|
||||
|
||||
sint32 scrollIndex = 0;
|
||||
int32_t scrollIndex = 0;
|
||||
rct_widgetindex widgetIndex = 0;
|
||||
for (rct_widget *widget = w->widgets; widget->type != WWT_LAST; widget++, widgetIndex++) {
|
||||
if (widgetIndex == targetWidgetIndex)
|
||||
|
@ -319,7 +319,7 @@ static sint32 window_get_scroll_index(rct_window *w, sint32 targetWidgetIndex)
|
|||
return scrollIndex;
|
||||
}
|
||||
|
||||
static rct_widget *window_get_scroll_widget(rct_window *w, sint32 scrollIndex)
|
||||
static rct_widget *window_get_scroll_widget(rct_window *w, int32_t scrollIndex)
|
||||
{
|
||||
for (rct_widget *widget = w->widgets; widget->type != WWT_LAST; widget++) {
|
||||
if (widget->type != WWT_SCROLL)
|
||||
|
@ -337,20 +337,20 @@ static rct_widget *window_get_scroll_widget(rct_window *w, sint32 scrollIndex)
|
|||
*
|
||||
* rct2: 0x006E78E3
|
||||
*/
|
||||
static void window_scroll_wheel_input(rct_window *w, sint32 scrollIndex, sint32 wheel)
|
||||
static void window_scroll_wheel_input(rct_window *w, int32_t scrollIndex, int32_t wheel)
|
||||
{
|
||||
rct_scroll *scroll = &w->scrolls[scrollIndex];
|
||||
rct_widget *widget = window_get_scroll_widget(w, scrollIndex);
|
||||
rct_widgetindex widgetIndex = window_get_widget_index(w, widget);
|
||||
|
||||
if (scroll->flags & VSCROLLBAR_VISIBLE) {
|
||||
sint32 size = widget->bottom - widget->top - 1;
|
||||
int32_t size = widget->bottom - widget->top - 1;
|
||||
if (scroll->flags & HSCROLLBAR_VISIBLE)
|
||||
size -= 11;
|
||||
size = std::max(0, scroll->v_bottom - size);
|
||||
scroll->v_top = std::min(std::max(0, scroll->v_top + wheel), size);
|
||||
} else {
|
||||
sint32 size = widget->right - widget->left - 1;
|
||||
int32_t size = widget->right - widget->left - 1;
|
||||
if (scroll->flags & VSCROLLBAR_VISIBLE)
|
||||
size -= 11;
|
||||
size = std::max(0, scroll->h_right - size);
|
||||
|
@ -365,9 +365,9 @@ static void window_scroll_wheel_input(rct_window *w, sint32 scrollIndex, sint32
|
|||
*
|
||||
* rct2: 0x006E793B
|
||||
*/
|
||||
static sint32 window_wheel_input(rct_window *w, sint32 wheel)
|
||||
static int32_t window_wheel_input(rct_window *w, int32_t wheel)
|
||||
{
|
||||
sint32 i = 0;
|
||||
int32_t i = 0;
|
||||
for (rct_widget *widget = w->widgets; widget->type != WWT_LAST; widget++) {
|
||||
if (widget->type != WWT_SCROLL)
|
||||
continue;
|
||||
|
@ -388,7 +388,7 @@ static sint32 window_wheel_input(rct_window *w, sint32 wheel)
|
|||
*
|
||||
* rct2: 0x006E79FB
|
||||
*/
|
||||
static void window_viewport_wheel_input(rct_window *w, sint32 wheel)
|
||||
static void window_viewport_wheel_input(rct_window *w, int32_t wheel)
|
||||
{
|
||||
if (gScreenFlags & (SCREEN_FLAGS_TRACK_MANAGER | SCREEN_FLAGS_TITLE_DEMO))
|
||||
return;
|
||||
|
@ -399,7 +399,7 @@ static void window_viewport_wheel_input(rct_window *w, sint32 wheel)
|
|||
window_zoom_out(w, true);
|
||||
}
|
||||
|
||||
static bool window_other_wheel_input(rct_window* w, rct_widgetindex widgetIndex, sint32 wheel)
|
||||
static bool window_other_wheel_input(rct_window* w, rct_widgetindex widgetIndex, int32_t wheel)
|
||||
{
|
||||
// HACK: Until we have a new window system that allows us to add new events like mouse wheel easily,
|
||||
// this selective approach will have to do.
|
||||
|
@ -408,7 +408,7 @@ static bool window_other_wheel_input(rct_window* w, rct_widgetindex widgetIndex,
|
|||
auto widgetType = w->widgets[widgetIndex].type;
|
||||
|
||||
// Lower widgetIndex once or twice we got a type that matches, to allow scrolling on the increase/decrease buttons too
|
||||
sint32 attempts = 0;
|
||||
int32_t attempts = 0;
|
||||
while (widgetType != WWT_IMGBTN && widgetType != WWT_SPINNER && widgetIndex > 0)
|
||||
{
|
||||
switch (widgetType)
|
||||
|
@ -444,8 +444,8 @@ static bool window_other_wheel_input(rct_window* w, rct_widgetindex widgetIndex,
|
|||
}
|
||||
|
||||
rct_widgetindex buttonWidgetIndex;
|
||||
uint16 expectedType;
|
||||
uint32 expectedContent[2];
|
||||
uint16_t expectedType;
|
||||
uint32_t expectedContent[2];
|
||||
switch (widgetType)
|
||||
{
|
||||
case WWT_IMGBTN:
|
||||
|
@ -490,9 +490,9 @@ void window_all_wheel_input()
|
|||
{
|
||||
// Get wheel value
|
||||
CursorState * cursorState = (CursorState *)context_get_cursor_state();
|
||||
sint32 absolute_wheel = cursorState->wheel;
|
||||
sint32 relative_wheel = absolute_wheel - _previousAbsoluteWheel;
|
||||
sint32 pixel_scroll = relative_wheel * WINDOW_SCROLL_PIXELS;
|
||||
int32_t absolute_wheel = cursorState->wheel;
|
||||
int32_t relative_wheel = absolute_wheel - _previousAbsoluteWheel;
|
||||
int32_t pixel_scroll = relative_wheel * WINDOW_SCROLL_PIXELS;
|
||||
_previousAbsoluteWheel = absolute_wheel;
|
||||
|
||||
if (relative_wheel == 0)
|
||||
|
@ -513,7 +513,7 @@ void window_all_wheel_input()
|
|||
if (widgetIndex != -1) {
|
||||
rct_widget *widget = &w->widgets[widgetIndex];
|
||||
if (widget->type == WWT_SCROLL) {
|
||||
sint32 scrollIndex = window_get_scroll_index(w, widgetIndex);
|
||||
int32_t scrollIndex = window_get_scroll_index(w, widgetIndex);
|
||||
rct_scroll *scroll = &w->scrolls[scrollIndex];
|
||||
if (scroll->flags & (HSCROLLBAR_VISIBLE | VSCROLLBAR_VISIBLE)) {
|
||||
window_scroll_wheel_input(w, window_get_scroll_index(w, widgetIndex), pixel_scroll);
|
||||
|
@ -541,8 +541,8 @@ void window_init_scroll_widgets(rct_window *w)
|
|||
{
|
||||
rct_widget* widget;
|
||||
rct_scroll* scroll;
|
||||
sint32 widget_index, scroll_index;
|
||||
sint32 width, height;
|
||||
int32_t widget_index, scroll_index;
|
||||
int32_t width, height;
|
||||
|
||||
widget_index = 0;
|
||||
scroll_index = 0;
|
||||
|
|
|
@ -50,11 +50,11 @@ private:
|
|||
|
||||
size_t _sequenceId = 0;
|
||||
TitleSequence * _sequence = nullptr;
|
||||
sint32 _position = 0;
|
||||
sint32 _waitCounter = 0;
|
||||
int32_t _position = 0;
|
||||
int32_t _waitCounter = 0;
|
||||
|
||||
sint32 _lastScreenWidth = 0;
|
||||
sint32 _lastScreenHeight = 0;
|
||||
int32_t _lastScreenWidth = 0;
|
||||
int32_t _lastScreenHeight = 0;
|
||||
CoordsXY _viewCentreLocation = {};
|
||||
|
||||
public:
|
||||
|
@ -69,7 +69,7 @@ public:
|
|||
Eject();
|
||||
}
|
||||
|
||||
sint32 GetCurrentPosition() const override
|
||||
int32_t GetCurrentPosition() const override
|
||||
{
|
||||
return _position;
|
||||
}
|
||||
|
@ -105,7 +105,7 @@ public:
|
|||
|
||||
bool Update() override
|
||||
{
|
||||
sint32 entryPosition = _position;
|
||||
int32_t entryPosition = _position;
|
||||
FixViewLocation();
|
||||
|
||||
if (_sequence == nullptr)
|
||||
|
@ -115,7 +115,7 @@ public:
|
|||
}
|
||||
|
||||
// Check that position is valid
|
||||
if (_position >= (sint32)_sequence->NumCommands)
|
||||
if (_position >= (int32_t)_sequence->NumCommands)
|
||||
{
|
||||
_position = 0;
|
||||
return false;
|
||||
|
@ -175,9 +175,9 @@ public:
|
|||
_waitCounter = 0;
|
||||
}
|
||||
|
||||
void Seek(sint32 targetPosition) override
|
||||
void Seek(int32_t targetPosition) override
|
||||
{
|
||||
if (targetPosition < 0 || targetPosition >= (sint32)_sequence->NumCommands)
|
||||
if (targetPosition < 0 || targetPosition >= (int32_t)_sequence->NumCommands)
|
||||
{
|
||||
throw std::runtime_error("Invalid position.");
|
||||
}
|
||||
|
@ -191,7 +191,7 @@ public:
|
|||
targetPosition = 0;
|
||||
}
|
||||
// Set position to the last LOAD command before target position
|
||||
for (sint32 i = targetPosition; i >= 0; i--)
|
||||
for (int32_t i = targetPosition; i >= 0; i--)
|
||||
{
|
||||
const TitleCommand * command = &_sequence->Commands[i];
|
||||
if ((_position == i && _position != targetPosition) || TitleSequenceIsLoadCommand(command))
|
||||
|
@ -226,7 +226,7 @@ private:
|
|||
void IncrementPosition()
|
||||
{
|
||||
_position++;
|
||||
if (_position >= (sint32)_sequence->NumCommands)
|
||||
if (_position >= (int32_t)_sequence->NumCommands)
|
||||
{
|
||||
_position = 0;
|
||||
}
|
||||
|
@ -234,7 +234,7 @@ private:
|
|||
|
||||
bool SkipToNextLoadCommand()
|
||||
{
|
||||
sint32 entryPosition = _position;
|
||||
int32_t entryPosition = _position;
|
||||
const TitleCommand * command;
|
||||
do
|
||||
{
|
||||
|
@ -253,7 +253,7 @@ private:
|
|||
break;
|
||||
case TITLE_SCRIPT_WAIT:
|
||||
// The waitCounter is measured in 25-ms game ticks. Previously it was seconds * 40 ticks/second, now it is ms / 25 ms/tick
|
||||
_waitCounter = std::max<sint32>(1, command->Milliseconds / (uint32)GAME_UPDATE_TIME_MS);
|
||||
_waitCounter = std::max<int32_t>(1, command->Milliseconds / (uint32_t)GAME_UPDATE_TIME_MS);
|
||||
break;
|
||||
case TITLE_SCRIPT_LOADMM:
|
||||
{
|
||||
|
@ -274,8 +274,8 @@ private:
|
|||
}
|
||||
case TITLE_SCRIPT_LOCATION:
|
||||
{
|
||||
sint32 x = command->X * 32 + 16;
|
||||
sint32 y = command->Y * 32 + 16;
|
||||
int32_t x = command->X * 32 + 16;
|
||||
int32_t y = command->Y * 32 + 16;
|
||||
SetViewLocation(x, y);
|
||||
break;
|
||||
}
|
||||
|
@ -286,7 +286,7 @@ private:
|
|||
SetViewZoom(command->Zoom);
|
||||
break;
|
||||
case TITLE_SCRIPT_SPEED:
|
||||
gGameSpeed = Math::Clamp<uint8>(1, command->Speed, 4);
|
||||
gGameSpeed = Math::Clamp<uint8_t>(1, command->Speed, 4);
|
||||
break;
|
||||
case TITLE_SCRIPT_FOLLOW:
|
||||
FollowSprite(command->SpriteIndex);
|
||||
|
@ -297,7 +297,7 @@ private:
|
|||
case TITLE_SCRIPT_LOAD:
|
||||
{
|
||||
bool loadSuccess = false;
|
||||
uint8 saveIndex = command->SaveIndex;
|
||||
uint8_t saveIndex = command->SaveIndex;
|
||||
TitleSequenceParkHandle * parkHandle = TitleSequenceGetParkHandle(_sequence, saveIndex);
|
||||
if (parkHandle != nullptr)
|
||||
{
|
||||
|
@ -360,7 +360,7 @@ private:
|
|||
return true;
|
||||
}
|
||||
|
||||
void SetViewZoom(const uint32 &zoom)
|
||||
void SetViewZoom(const uint32_t &zoom)
|
||||
{
|
||||
rct_window * w = window_get_main();
|
||||
if (w != nullptr && w->viewport != nullptr)
|
||||
|
@ -369,19 +369,19 @@ private:
|
|||
}
|
||||
}
|
||||
|
||||
void RotateView(uint32 count)
|
||||
void RotateView(uint32_t count)
|
||||
{
|
||||
rct_window * w = window_get_main();
|
||||
if (w != nullptr)
|
||||
{
|
||||
for (uint32 i = 0; i < count; i++)
|
||||
for (uint32_t i = 0; i < count; i++)
|
||||
{
|
||||
window_rotate_camera(w, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void FollowSprite(uint16 spriteIndex)
|
||||
void FollowSprite(uint16_t spriteIndex)
|
||||
{
|
||||
rct_window * w = window_get_main();
|
||||
if (w != nullptr)
|
||||
|
@ -515,13 +515,13 @@ private:
|
|||
* @param x X position in map tiles.
|
||||
* @param y Y position in map tiles.
|
||||
*/
|
||||
void SetViewLocation(sint32 x, sint32 y)
|
||||
void SetViewLocation(int32_t x, int32_t y)
|
||||
{
|
||||
// Update viewport
|
||||
rct_window * w = window_get_main();
|
||||
if (w != nullptr)
|
||||
{
|
||||
sint32 z = tile_element_height(x, y);
|
||||
int32_t z = tile_element_height(x, y);
|
||||
|
||||
// Prevent scroll adjustment due to window placement when in-game
|
||||
auto oldScreenFlags = gScreenFlags;
|
||||
|
|
|
@ -73,7 +73,7 @@ static rct_widget *window_about_page_widgets[] = {
|
|||
#define DEFAULT_ENABLED_WIDGETS \
|
||||
(1ULL << WIDX_CLOSE) | (1ULL << WIDX_TAB_ABOUT_OPENRCT2) | (1ULL << WIDX_TAB_ABOUT_RCT2)
|
||||
|
||||
static uint64 window_about_page_enabled_widgets[] = {
|
||||
static uint64_t window_about_page_enabled_widgets[] = {
|
||||
DEFAULT_ENABLED_WIDGETS | (1ULL << WIDX_CHANGELOG),
|
||||
DEFAULT_ENABLED_WIDGETS | (1ULL << WIDX_MUSIC_CREDITS),
|
||||
};
|
||||
|
@ -153,7 +153,7 @@ static rct_window_event_list *window_about_page_events[] = {
|
|||
};
|
||||
// clang-format on
|
||||
|
||||
static void window_about_set_page(rct_window *w, sint32 page);
|
||||
static void window_about_set_page(rct_window *w, int32_t page);
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -208,7 +208,7 @@ static void window_about_openrct2_common_paint(rct_window * w, rct_drawpixelinfo
|
|||
{
|
||||
window_draw_widgets(w, dpi);
|
||||
|
||||
sint32 x1, x2, y;
|
||||
int32_t x1, x2, y;
|
||||
|
||||
x1 = w->x + (&w->widgets[WIDX_TAB_ABOUT_OPENRCT2])->left + 45;
|
||||
x2 = w->x + (&w->widgets[WIDX_TAB_ABOUT_RCT2])->left + 45;
|
||||
|
@ -225,10 +225,10 @@ static void window_about_openrct2_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
|||
{
|
||||
window_about_openrct2_common_paint(w, dpi);
|
||||
|
||||
sint32 x, y, width;
|
||||
int32_t x, y, width;
|
||||
rct_size16 logoSize;
|
||||
|
||||
sint32 lineHeight = font_get_line_height(gCurrentFontSpriteBase);
|
||||
int32_t lineHeight = font_get_line_height(gCurrentFontSpriteBase);
|
||||
|
||||
x = w->x + (w->width / 2);
|
||||
y = w->y + w->widgets[WIDX_PAGE_BACKGROUND].top + lineHeight;
|
||||
|
@ -287,7 +287,7 @@ static void window_about_rct2_mouseup(rct_window *w, rct_widgetindex widgetIndex
|
|||
*/
|
||||
static void window_about_rct2_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
||||
{
|
||||
sint32 x, y, yPage;
|
||||
int32_t x, y, yPage;
|
||||
|
||||
window_about_openrct2_common_paint(w, dpi);
|
||||
|
||||
|
@ -296,7 +296,7 @@ static void window_about_rct2_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
|||
x = w->x + 200;
|
||||
y = yPage + 5;
|
||||
|
||||
sint32 lineHeight = font_get_line_height(gCurrentFontSpriteBase);
|
||||
int32_t lineHeight = font_get_line_height(gCurrentFontSpriteBase);
|
||||
|
||||
// Credits
|
||||
gfx_draw_string_centred(dpi, STR_COPYRIGHT_CS, x, y, COLOUR_BLACK, nullptr);
|
||||
|
@ -325,7 +325,7 @@ static void window_about_rct2_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
|||
|
||||
#pragma endregion RCT2
|
||||
|
||||
static void window_about_set_page(rct_window *w, sint32 page)
|
||||
static void window_about_set_page(rct_window *w, int32_t page)
|
||||
{
|
||||
w->page = page;
|
||||
w->frame_no = 0;
|
||||
|
|
|
@ -70,7 +70,7 @@ static rct_widget window_banner_widgets[] = {
|
|||
|
||||
static void window_banner_mouseup(rct_window *w, rct_widgetindex widgetIndex);
|
||||
static void window_banner_mousedown(rct_window *w, rct_widgetindex widgetIndex, rct_widget* widget);
|
||||
static void window_banner_dropdown(rct_window *w, rct_widgetindex widgetIndex, sint32 dropdownIndex);
|
||||
static void window_banner_dropdown(rct_window *w, rct_widgetindex widgetIndex, int32_t dropdownIndex);
|
||||
static void window_banner_textinput(rct_window *w, rct_widgetindex widgetIndex, char *text);
|
||||
static void window_banner_viewport_rotate(rct_window *w);
|
||||
static void window_banner_invalidate(rct_window *w);
|
||||
|
@ -137,8 +137,8 @@ rct_window * window_banner_open(rct_windownumber number)
|
|||
w->number = number;
|
||||
window_init_scroll_widgets(w);
|
||||
|
||||
sint32 view_x = gBanners[w->number].x << 5;
|
||||
sint32 view_y = gBanners[w->number].y << 5;
|
||||
int32_t view_x = gBanners[w->number].x << 5;
|
||||
int32_t view_y = gBanners[w->number].y << 5;
|
||||
|
||||
rct_tile_element* tile_element = map_get_first_element_at(view_x / 32, view_y / 32);
|
||||
while(1) {
|
||||
|
@ -152,7 +152,7 @@ rct_window * window_banner_open(rct_windownumber number)
|
|||
tile_element++;
|
||||
}
|
||||
|
||||
sint32 view_z = tile_element->base_height<<3;
|
||||
int32_t view_z = tile_element->base_height<<3;
|
||||
w->frame_no = view_z;
|
||||
|
||||
view_x += 16;
|
||||
|
@ -187,8 +187,8 @@ rct_window * window_banner_open(rct_windownumber number)
|
|||
static void window_banner_mouseup(rct_window *w, rct_widgetindex widgetIndex)
|
||||
{
|
||||
rct_banner* banner = &gBanners[w->number];
|
||||
sint32 x = banner->x << 5;
|
||||
sint32 y = banner->y << 5;
|
||||
int32_t x = banner->x << 5;
|
||||
int32_t y = banner->y << 5;
|
||||
|
||||
rct_tile_element* tile_element = map_get_first_element_at(x / 32, y / 32);
|
||||
|
||||
|
@ -229,7 +229,7 @@ static void window_banner_mousedown(rct_window *w, rct_widgetindex widgetIndex,
|
|||
break;
|
||||
case WIDX_TEXT_COLOUR_DROPDOWN_BUTTON:
|
||||
|
||||
for( sint32 i = 0; i < 13; ++i){
|
||||
for( int32_t i = 0; i < 13; ++i){
|
||||
gDropdownItemsFormat[i] = STR_DROPDOWN_MENU_LABEL;
|
||||
gDropdownItemsArgs[i] = BannerColouredTextFormats[i + 1];
|
||||
}
|
||||
|
@ -256,7 +256,7 @@ static void window_banner_mousedown(rct_window *w, rct_widgetindex widgetIndex,
|
|||
*
|
||||
* rct2: 0x6ba517
|
||||
*/
|
||||
static void window_banner_dropdown(rct_window *w, rct_widgetindex widgetIndex, sint32 dropdownIndex)
|
||||
static void window_banner_dropdown(rct_window *w, rct_widgetindex widgetIndex, int32_t dropdownIndex)
|
||||
{
|
||||
rct_banner* banner = &gBanners[w->number];
|
||||
|
||||
|
@ -350,9 +350,9 @@ static void window_banner_viewport_rotate(rct_window *w)
|
|||
|
||||
rct_banner* banner = &gBanners[w->number];
|
||||
|
||||
sint32 view_x = (banner->x << 5) + 16;
|
||||
sint32 view_y = (banner->y << 5) + 16;
|
||||
sint32 view_z = w->frame_no;
|
||||
int32_t view_x = (banner->x << 5) + 16;
|
||||
int32_t view_y = (banner->y << 5) + 16;
|
||||
int32_t view_z = w->frame_no;
|
||||
|
||||
// Create viewport
|
||||
rct_widget* viewportWidget = &window_banner_widgets[WIDX_VIEWPORT];
|
||||
|
|
|
@ -49,10 +49,10 @@ static rct_widget window_changelog_widgets[] = {
|
|||
static void window_changelog_close(rct_window *w);
|
||||
static void window_changelog_mouseup(rct_window *w, rct_widgetindex widgetIndex);
|
||||
static void window_changelog_resize(rct_window *w);
|
||||
static void window_changelog_scrollgetsize(rct_window *w, sint32 scrollIndex, sint32 *width, sint32 *height);
|
||||
static void window_changelog_scrollgetsize(rct_window *w, int32_t scrollIndex, int32_t *width, int32_t *height);
|
||||
static void window_changelog_invalidate(rct_window *w);
|
||||
static void window_changelog_paint(rct_window *w, rct_drawpixelinfo *dpi);
|
||||
static void window_changelog_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, sint32 scrollIndex);
|
||||
static void window_changelog_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, int32_t scrollIndex);
|
||||
|
||||
static rct_window_event_list window_changelog_events = {
|
||||
window_changelog_close,
|
||||
|
@ -91,7 +91,7 @@ static void window_changelog_dispose_file();
|
|||
|
||||
static std::string _changelogText;
|
||||
static std::vector<const char *> _changelogLines;
|
||||
static sint32 _changelogLongestLineWidth = 0;
|
||||
static int32_t _changelogLongestLineWidth = 0;
|
||||
|
||||
rct_window * window_changelog_open()
|
||||
{
|
||||
|
@ -104,8 +104,8 @@ rct_window * window_changelog_open()
|
|||
if (!window_changelog_read_file())
|
||||
return nullptr;
|
||||
|
||||
sint32 screenWidth = context_get_width();
|
||||
sint32 screenHeight = context_get_height();
|
||||
int32_t screenWidth = context_get_width();
|
||||
int32_t screenHeight = context_get_height();
|
||||
|
||||
window = window_create_centred(
|
||||
screenWidth * 4 / 5,
|
||||
|
@ -141,8 +141,8 @@ static void window_changelog_mouseup(rct_window *w, rct_widgetindex widgetIndex)
|
|||
|
||||
static void window_changelog_resize(rct_window *w)
|
||||
{
|
||||
sint32 screenWidth = context_get_width();
|
||||
sint32 screenHeight = context_get_height();
|
||||
int32_t screenWidth = context_get_width();
|
||||
int32_t screenHeight = context_get_height();
|
||||
|
||||
w->max_width = (screenWidth * 4) / 5;
|
||||
w->max_height = (screenHeight * 4) / 5;
|
||||
|
@ -160,12 +160,12 @@ static void window_changelog_resize(rct_window *w)
|
|||
}
|
||||
|
||||
static void window_changelog_scrollgetsize(
|
||||
[[maybe_unused]] rct_window * w, [[maybe_unused]] sint32 scrollIndex, sint32 * width, sint32 * height)
|
||||
[[maybe_unused]] rct_window * w, [[maybe_unused]] int32_t scrollIndex, int32_t * width, int32_t * height)
|
||||
{
|
||||
*width = _changelogLongestLineWidth + 4;
|
||||
|
||||
const sint32 lineHeight = font_get_line_height(gCurrentFontSpriteBase);
|
||||
*height = (sint32)(_changelogLines.size() * lineHeight);
|
||||
const int32_t lineHeight = font_get_line_height(gCurrentFontSpriteBase);
|
||||
*height = (int32_t)(_changelogLines.size() * lineHeight);
|
||||
}
|
||||
|
||||
static void window_changelog_invalidate(rct_window *w)
|
||||
|
@ -186,15 +186,15 @@ static void window_changelog_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
|||
window_draw_widgets(w, dpi);
|
||||
}
|
||||
|
||||
static void window_changelog_scrollpaint(rct_window * w, rct_drawpixelinfo * dpi, [[maybe_unused]] sint32 scrollIndex)
|
||||
static void window_changelog_scrollpaint(rct_window * w, rct_drawpixelinfo * dpi, [[maybe_unused]] int32_t scrollIndex)
|
||||
{
|
||||
gCurrentFontFlags = 0;
|
||||
gCurrentFontSpriteBase = FONT_SPRITE_BASE_MEDIUM;
|
||||
|
||||
const sint32 lineHeight = font_get_line_height(gCurrentFontSpriteBase);
|
||||
const int32_t lineHeight = font_get_line_height(gCurrentFontSpriteBase);
|
||||
|
||||
sint32 x = 3;
|
||||
sint32 y = 3 - lineHeight;
|
||||
int32_t x = 3;
|
||||
int32_t y = 3 - lineHeight;
|
||||
for (auto line : _changelogLines)
|
||||
{
|
||||
y += lineHeight;
|
||||
|
@ -256,7 +256,7 @@ static bool window_changelog_read_file()
|
|||
auto ch = start;
|
||||
while (*ch != '\0')
|
||||
{
|
||||
uint8 c = *ch;
|
||||
uint8_t c = *ch;
|
||||
if (c == '\n')
|
||||
{
|
||||
*ch++ = 0;
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
#define CHEATS_MONEY_INCREMENT_DIV MONEY(5000,00)
|
||||
static utf8 _moneySpinnerText[MONEY_STRING_MAXLENGTH];
|
||||
static money32 _moneySpinnerValue = CHEATS_MONEY_DEFAULT;
|
||||
static sint32 _selectedStaffSpeed = 1;
|
||||
static int32_t _selectedStaffSpeed = 1;
|
||||
|
||||
// clang-format off
|
||||
enum
|
||||
|
@ -181,17 +181,17 @@ enum WINDOW_CHEATS_WIDGET_IDX
|
|||
#define OPTH 10 // Option (checkbox) height (two columns)
|
||||
#define GROUP_SPACE 6
|
||||
|
||||
#define YPL(ROW) ((sint16)(YOS + ((BTNH + YSPA) * ROW)))
|
||||
#define HPL(ROW) ((sint16)(YPL(ROW) + BTNH))
|
||||
#define OHPL(ROW) ((sint16)(YPL(ROW) + OPTH))
|
||||
#define XPL(COL) ((sint16)(XOS + ((BTNW + XSPA) * COL)))
|
||||
#define WPL(COL) ((sint16)(XPL(COL) + BTNW))
|
||||
#define OWPL ((sint16)(XPL(0) + OPTW))
|
||||
#define YPL(ROW) ((int16_t)(YOS + ((BTNH + YSPA) * ROW)))
|
||||
#define HPL(ROW) ((int16_t)(YPL(ROW) + BTNH))
|
||||
#define OHPL(ROW) ((int16_t)(YPL(ROW) + OPTH))
|
||||
#define XPL(COL) ((int16_t)(XOS + ((BTNW + XSPA) * COL)))
|
||||
#define WPL(COL) ((int16_t)(XPL(COL) + BTNW))
|
||||
#define OWPL ((int16_t)(XPL(0) + OPTW))
|
||||
|
||||
#define MIN_BTN_LEFT ((sint16)(XPL(1)))
|
||||
#define MIN_BTN_RIGHT ((sint16)(WPL(1) - (BTNW / 2)))
|
||||
#define MAX_BTN_LEFT ((sint16)(XPL(1.5)))
|
||||
#define MAX_BTN_RIGHT ((sint16)(WPL(1)))
|
||||
#define MIN_BTN_LEFT ((int16_t)(XPL(1)))
|
||||
#define MIN_BTN_RIGHT ((int16_t)(WPL(1) - (BTNW / 2)))
|
||||
#define MAX_BTN_LEFT ((int16_t)(XPL(1.5)))
|
||||
#define MAX_BTN_RIGHT ((int16_t)(WPL(1)))
|
||||
|
||||
#define TXTO 3 // Text horizontal offset from button left (for button text)
|
||||
#pragma endregion
|
||||
|
@ -326,14 +326,14 @@ static rct_widget *window_cheats_page_widgets[] =
|
|||
static void window_cheats_money_mouseup(rct_window *w, rct_widgetindex widgetIndex);
|
||||
static void window_cheats_money_mousedown(rct_window *w, rct_widgetindex widgetIndex, rct_widget* widget);
|
||||
static void window_cheats_misc_mousedown(rct_window *w, rct_widgetindex widgetIndex, rct_widget* widget);
|
||||
static void window_cheats_misc_dropdown(rct_window *w, rct_widgetindex widgetIndex, sint32 dropdownIndex);
|
||||
static void window_cheats_misc_dropdown(rct_window *w, rct_widgetindex widgetIndex, int32_t dropdownIndex);
|
||||
static void window_cheats_guests_mouseup(rct_window *w, rct_widgetindex widgetIndex);
|
||||
static void window_cheats_misc_mouseup(rct_window *w, rct_widgetindex widgetIndex);
|
||||
static void window_cheats_rides_mouseup(rct_window *w, rct_widgetindex widgetIndex);
|
||||
static void window_cheats_update(rct_window *w);
|
||||
static void window_cheats_invalidate(rct_window *w);
|
||||
static void window_cheats_paint(rct_window *w, rct_drawpixelinfo *dpi);
|
||||
static void window_cheats_set_page(rct_window *w, sint32 page);
|
||||
static void window_cheats_set_page(rct_window *w, int32_t page);
|
||||
static void window_cheats_text_input(rct_window *w, rct_widgetindex widgetIndex, char *text);
|
||||
|
||||
static rct_window_event_list window_cheats_money_events =
|
||||
|
@ -475,7 +475,7 @@ static rct_window_event_list *window_cheats_page_events[] =
|
|||
|
||||
#define MAIN_CHEAT_ENABLED_WIDGETS (1ULL << WIDX_CLOSE) | (1ULL << WIDX_TAB_1) | (1ULL << WIDX_TAB_2) | (1ULL << WIDX_TAB_3) | (1ULL << WIDX_TAB_4)
|
||||
|
||||
static uint64 window_cheats_page_enabled_widgets[] = {
|
||||
static uint64_t window_cheats_page_enabled_widgets[] = {
|
||||
MAIN_CHEAT_ENABLED_WIDGETS |
|
||||
(1ULL << WIDX_NO_MONEY) |
|
||||
(1ULL << WIDX_ADD_SET_MONEY_GROUP) |
|
||||
|
@ -573,7 +573,7 @@ static uint64 window_cheats_page_enabled_widgets[] = {
|
|||
(1ULL << WIDX_ENABLE_ALL_DRAWABLE_TRACK_PIECES)
|
||||
};
|
||||
|
||||
static uint64 window_cheats_page_hold_down_widgets[] = {
|
||||
static uint64_t window_cheats_page_hold_down_widgets[] = {
|
||||
(1ULL << WIDX_MONEY_SPINNER_INCREMENT) |
|
||||
(1ULL << WIDX_MONEY_SPINNER_DECREMENT) |
|
||||
(1ULL << WIDX_ADD_MONEY) |
|
||||
|
@ -754,7 +754,7 @@ static void window_cheats_misc_mousedown(rct_window *w, rct_widgetindex widgetIn
|
|||
}
|
||||
}
|
||||
|
||||
static void window_cheats_misc_dropdown([[maybe_unused]] rct_window * w, rct_widgetindex widgetIndex, sint32 dropdownIndex)
|
||||
static void window_cheats_misc_dropdown([[maybe_unused]] rct_window * w, rct_widgetindex widgetIndex, int32_t dropdownIndex)
|
||||
{
|
||||
if (dropdownIndex == -1)
|
||||
{
|
||||
|
@ -767,7 +767,7 @@ static void window_cheats_misc_dropdown([[maybe_unused]] rct_window * w, rct_wid
|
|||
}
|
||||
else if (widgetIndex == WIDX_STAFF_SPEED_DROPDOWN_BUTTON)
|
||||
{
|
||||
sint32 speed = CHEATS_STAFF_FAST_SPEED;
|
||||
int32_t speed = CHEATS_STAFF_FAST_SPEED;
|
||||
switch (dropdownIndex)
|
||||
{
|
||||
case 0:
|
||||
|
@ -1083,7 +1083,7 @@ static void window_cheats_update(rct_window *w)
|
|||
|
||||
static void window_cheats_invalidate(rct_window *w)
|
||||
{
|
||||
sint32 i;
|
||||
int32_t i;
|
||||
|
||||
rct_widget *widgets = window_cheats_page_widgets[w->page];
|
||||
if (w->widgets != widgets)
|
||||
|
@ -1108,7 +1108,7 @@ static void window_cheats_invalidate(rct_window *w)
|
|||
case WINDOW_CHEATS_PAGE_MONEY:{
|
||||
widget_set_checkbox_value(w, WIDX_NO_MONEY, gParkFlags & PARK_FLAGS_NO_MONEY);
|
||||
|
||||
uint64 money_widgets = (1 << WIDX_ADD_SET_MONEY_GROUP) | (1 << WIDX_MONEY_SPINNER) | (1 << WIDX_MONEY_SPINNER_INCREMENT) |
|
||||
uint64_t money_widgets = (1 << WIDX_ADD_SET_MONEY_GROUP) | (1 << WIDX_MONEY_SPINNER) | (1 << WIDX_MONEY_SPINNER_INCREMENT) |
|
||||
(1 << WIDX_MONEY_SPINNER_DECREMENT) | (1 << WIDX_ADD_MONEY) | (1 << WIDX_SET_MONEY) | (1 << WIDX_CLEAR_LOAN);
|
||||
if (gParkFlags & PARK_FLAGS_NO_MONEY)
|
||||
{
|
||||
|
@ -1120,7 +1120,7 @@ static void window_cheats_invalidate(rct_window *w)
|
|||
}
|
||||
}break;
|
||||
case WINDOW_CHEATS_PAGE_GUESTS:
|
||||
set_format_arg(0, sint32, 10000);
|
||||
set_format_arg(0, int32_t, 10000);
|
||||
widget_set_checkbox_value(w, WIDX_GUEST_IGNORE_RIDE_INTENSITY, gCheatsIgnoreRideIntensity);
|
||||
widget_set_checkbox_value(w, WIDX_DISABLE_VANDALISM, gCheatsDisableVandalism);
|
||||
widget_set_checkbox_value(w, WIDX_DISABLE_LITTERING, gCheatsDisableLittering);
|
||||
|
@ -1134,7 +1134,7 @@ static void window_cheats_invalidate(rct_window *w)
|
|||
widget_set_checkbox_value(w, WIDX_DISABLE_PLANT_AGING, gCheatsDisablePlantAging);
|
||||
break;
|
||||
case WINDOW_CHEATS_PAGE_RIDES:
|
||||
set_format_arg(0, uint16, 255);
|
||||
set_format_arg(0, uint16_t, 255);
|
||||
widget_set_checkbox_value(w, WIDX_FAST_LIFT_HILL, gCheatsFastLiftHill);
|
||||
widget_set_checkbox_value(w, WIDX_DISABLE_BRAKES_FAILURE, gCheatsDisableBrakesFailure);
|
||||
widget_set_checkbox_value(w, WIDX_DISABLE_ALL_BREAKDOWNS, gCheatsDisableAllBreakdowns);
|
||||
|
@ -1163,13 +1163,13 @@ static void window_cheats_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
|||
|
||||
if (w->page == WINDOW_CHEATS_PAGE_MONEY)
|
||||
{
|
||||
uint8 colour = w->colours[1];
|
||||
uint8_t colour = w->colours[1];
|
||||
set_format_arg(0, money32, _moneySpinnerValue);
|
||||
if (widget_is_disabled(w, WIDX_MONEY_SPINNER))
|
||||
{
|
||||
colour |= COLOUR_FLAG_INSET;
|
||||
}
|
||||
sint32 actual_month = month_spinner_value - 1;
|
||||
int32_t actual_month = month_spinner_value - 1;
|
||||
gfx_draw_string_left(dpi, STR_BOTTOM_TOOLBAR_CASH, gCommonFormatArgs, colour, w->x + XPL(0) + TXTO, w->y + YPL(2) + TXTO);
|
||||
gfx_draw_string_left(dpi, STR_YEAR, nullptr, COLOUR_BLACK, w->x + XPL(0) + TXTO, w->y + YPL(7) + TXTO);
|
||||
gfx_draw_string_left(dpi, STR_MONTH, nullptr, COLOUR_BLACK, w->x + XPL(0) + TXTO, w->y + YPL(8) + TXTO);
|
||||
|
@ -1199,7 +1199,7 @@ static void window_cheats_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
|||
|
||||
static void window_cheats_draw_tab_images(rct_drawpixelinfo *dpi, rct_window *w)
|
||||
{
|
||||
sint32 sprite_idx;
|
||||
int32_t sprite_idx;
|
||||
|
||||
// Money tab
|
||||
if (!(w->disabled_widgets & (1 << WIDX_TAB_1)))
|
||||
|
@ -1236,7 +1236,7 @@ static void window_cheats_draw_tab_images(rct_drawpixelinfo *dpi, rct_window *w)
|
|||
}
|
||||
}
|
||||
|
||||
static void window_cheats_set_page(rct_window *w, sint32 page)
|
||||
static void window_cheats_set_page(rct_window *w, int32_t page)
|
||||
{
|
||||
w->page = page;
|
||||
w->frame_no = 0;
|
||||
|
@ -1248,11 +1248,11 @@ static void window_cheats_set_page(rct_window *w, sint32 page)
|
|||
w->event_handlers = window_cheats_page_events[page];
|
||||
w->widgets = window_cheats_page_widgets[page];
|
||||
|
||||
sint32 maxY = 0;
|
||||
int32_t maxY = 0;
|
||||
rct_widget *widget = &w->widgets[WIDX_TAB_CONTENT];
|
||||
while (widget->type != WWT_LAST)
|
||||
{
|
||||
maxY = std::max(maxY, (sint32) widget->bottom);
|
||||
maxY = std::max(maxY, (int32_t) widget->bottom);
|
||||
widget++;
|
||||
}
|
||||
maxY += 6;
|
||||
|
|
|
@ -175,7 +175,7 @@ static void window_clear_scenery_mousedown(rct_window * w, rct_widgetindex widge
|
|||
|
||||
static void window_clear_scenery_textinput(rct_window *w, rct_widgetindex widgetIndex, char *text)
|
||||
{
|
||||
sint32 size;
|
||||
int32_t size;
|
||||
char* end;
|
||||
|
||||
if (widgetIndex != WIDX_PREVIEW || text == nullptr)
|
||||
|
@ -231,7 +231,7 @@ static void window_clear_scenery_invalidate(rct_window *w)
|
|||
*/
|
||||
static void window_clear_scenery_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
||||
{
|
||||
sint32 x, y;
|
||||
int32_t x, y;
|
||||
|
||||
window_draw_widgets(w, dpi);
|
||||
|
||||
|
|
|
@ -44,7 +44,7 @@ static rct_widget window_custom_currency_widgets[] = {
|
|||
|
||||
static void custom_currency_window_mousedown(rct_window *w, rct_widgetindex widgetIndex, rct_widget *widget);
|
||||
static void custom_currency_window_mouseup(rct_window *w, rct_widgetindex widgetIndex);
|
||||
static void custom_currency_window_dropdown(rct_window *w, rct_widgetindex widgetIndex, sint32 dropdownIndex);
|
||||
static void custom_currency_window_dropdown(rct_window *w, rct_widgetindex widgetIndex, int32_t dropdownIndex);
|
||||
static void custom_currency_window_text_input(struct rct_window *w, rct_widgetindex widgetIndex, char *text);
|
||||
static void custom_currency_window_paint(rct_window *w, rct_drawpixelinfo *dpi);
|
||||
|
||||
|
@ -195,14 +195,14 @@ static void custom_currency_window_mouseup(rct_window *w, rct_widgetindex widget
|
|||
STR_RATE_INPUT_TITLE,
|
||||
STR_RATE_INPUT_DESC,
|
||||
STR_FORMAT_INTEGER,
|
||||
(uint32)CurrencyDescriptors[CURRENCY_CUSTOM].rate,
|
||||
(uint32_t)CurrencyDescriptors[CURRENCY_CUSTOM].rate,
|
||||
CURRENCY_RATE_MAX_NUM_DIGITS
|
||||
);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void custom_currency_window_dropdown([[maybe_unused]] rct_window * w, rct_widgetindex widgetIndex, sint32 dropdownIndex)
|
||||
static void custom_currency_window_dropdown([[maybe_unused]] rct_window * w, rct_widgetindex widgetIndex, int32_t dropdownIndex)
|
||||
{
|
||||
if(dropdownIndex == -1)
|
||||
return;
|
||||
|
@ -230,7 +230,7 @@ static void custom_currency_window_text_input([[maybe_unused]] struct rct_window
|
|||
{
|
||||
if (text == nullptr)
|
||||
return;
|
||||
sint32 rate;
|
||||
int32_t rate;
|
||||
char* end;
|
||||
switch(widgetIndex){
|
||||
case WIDX_SYMBOL_TEXT:
|
||||
|
@ -265,9 +265,9 @@ static void custom_currency_window_text_input([[maybe_unused]] struct rct_window
|
|||
|
||||
static void custom_currency_window_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
||||
{
|
||||
sint32 x, y;
|
||||
int32_t x, y;
|
||||
|
||||
set_format_arg(0, sint32, 100);
|
||||
set_format_arg(0, int32_t, 100);
|
||||
|
||||
window_draw_widgets(w, dpi);
|
||||
|
||||
|
@ -276,8 +276,8 @@ static void custom_currency_window_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
|||
|
||||
gfx_draw_string_left(dpi, STR_RATE, nullptr, w->colours[1], x, y);
|
||||
|
||||
sint32 baseExchange = CurrencyDescriptors[CURRENCY_POUNDS].rate;
|
||||
set_format_arg(0, sint32, baseExchange);
|
||||
int32_t baseExchange = CurrencyDescriptors[CURRENCY_POUNDS].rate;
|
||||
set_format_arg(0, int32_t, baseExchange);
|
||||
gfx_draw_string_left(dpi, STR_CUSTOM_CURRENCY_EQUIVALENCY, gCommonFormatArgs, w->colours[1], x + 200, y);
|
||||
|
||||
y += 20;
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
#include <openrct2/paint/tile_element/Paint.TileElement.h>
|
||||
#include <openrct2/ride/TrackPaint.h>
|
||||
|
||||
static sint32 ResizeLanguage = LANGUAGE_UNDEFINED;
|
||||
static int32_t ResizeLanguage = LANGUAGE_UNDEFINED;
|
||||
|
||||
// clang-format off
|
||||
enum WINDOW_DEBUG_PAINT_WIDGET_IDX
|
||||
|
@ -156,14 +156,14 @@ static void window_debug_paint_invalidate(rct_window * w)
|
|||
window_invalidate(w);
|
||||
|
||||
// Find the width of the longest string
|
||||
sint16 newWidth = 0;
|
||||
int16_t newWidth = 0;
|
||||
for (size_t widgetIndex = WIDX_TOGGLE_SHOW_WIDE_PATHS; widgetIndex <= WIDX_TOGGLE_SHOW_DIRTY_VISUALS; widgetIndex++)
|
||||
{
|
||||
auto stringIdx = w->widgets[widgetIndex].text;
|
||||
auto string = ls.GetString(stringIdx);
|
||||
Guard::ArgumentNotNull(string);
|
||||
auto width = gfx_get_string_width(string);
|
||||
newWidth = std::max<sint16>(width, newWidth);
|
||||
newWidth = std::max<int16_t>(width, newWidth);
|
||||
}
|
||||
|
||||
// Add padding for both sides (8) and the offset for the text after the checkbox (15)
|
||||
|
|
|
@ -120,7 +120,7 @@ static rct_window_event_list window_ride_refurbish_events = {
|
|||
};
|
||||
|
||||
/** Based off of rct2: 0x006B486A */
|
||||
rct_window * window_ride_demolish_prompt_open(sint32 rideIndex)
|
||||
rct_window * window_ride_demolish_prompt_open(int32_t rideIndex)
|
||||
{
|
||||
rct_window *w;
|
||||
|
||||
|
@ -146,7 +146,7 @@ rct_window * window_ride_demolish_prompt_open(sint32 rideIndex)
|
|||
return w;
|
||||
}
|
||||
|
||||
rct_window * window_ride_refurbish_prompt_open(sint32 rideIndex)
|
||||
rct_window * window_ride_refurbish_prompt_open(int32_t rideIndex)
|
||||
{
|
||||
rct_window *w;
|
||||
|
||||
|
@ -217,11 +217,11 @@ static void window_ride_demolish_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
|||
Ride* ride = get_ride(w->number);
|
||||
|
||||
set_format_arg(0, rct_string_id, ride->name);
|
||||
set_format_arg(2, uint32, ride->name_arguments);
|
||||
set_format_arg(2, uint32_t, ride->name_arguments);
|
||||
set_format_arg(6, money32, _demolishRideCost);
|
||||
|
||||
sint32 x = w->x + WW / 2;
|
||||
sint32 y = w->y + (WH / 2) - 3;
|
||||
int32_t x = w->x + WW / 2;
|
||||
int32_t y = w->y + (WH / 2) - 3;
|
||||
|
||||
if (gParkFlags & PARK_FLAGS_NO_MONEY)
|
||||
{
|
||||
|
@ -240,11 +240,11 @@ static void window_ride_refurbish_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
|||
Ride* ride = get_ride(w->number);
|
||||
|
||||
set_format_arg(0, rct_string_id, ride->name);
|
||||
set_format_arg(2, uint32, ride->name_arguments);
|
||||
set_format_arg(2, uint32_t, ride->name_arguments);
|
||||
set_format_arg(6, money32, _demolishRideCost / 2);
|
||||
|
||||
sint32 x = w->x + WW / 2;
|
||||
sint32 y = w->y + (WH / 2) - 3;
|
||||
int32_t x = w->x + WW / 2;
|
||||
int32_t y = w->y + (WH / 2) - 3;
|
||||
|
||||
if (gParkFlags & PARK_FLAGS_NO_MONEY)
|
||||
{
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
#define DROPDOWN_ITEM_HEIGHT 12
|
||||
|
||||
sint32 gAppropriateImageDropdownItemsPerRow[] = {
|
||||
int32_t gAppropriateImageDropdownItemsPerRow[] = {
|
||||
1, 1, 1, 1, 2, 2, 3, 3, 4,
|
||||
3, 5, 4, 4, 5, 5, 5, 4, 5,
|
||||
6, 5, 5, 7, 4, 5, 6, 5, 6,
|
||||
|
@ -34,56 +34,56 @@ enum {
|
|||
};
|
||||
|
||||
static rct_widget window_dropdown_widgets[] = {
|
||||
{ WWT_IMGBTN, 0, 0, 0, 0, 0, (uint32) SPR_NONE, STR_NONE },
|
||||
{ WWT_IMGBTN, 0, 0, 0, 0, 0, (uint32_t) SPR_NONE, STR_NONE },
|
||||
{ WIDGETS_END },
|
||||
};
|
||||
|
||||
static sint32 _dropdown_num_columns;
|
||||
static sint32 _dropdown_num_rows;
|
||||
static sint32 _dropdown_item_width;
|
||||
static sint32 _dropdown_item_height;
|
||||
static int32_t _dropdown_num_columns;
|
||||
static int32_t _dropdown_num_rows;
|
||||
static int32_t _dropdown_item_width;
|
||||
static int32_t _dropdown_item_height;
|
||||
static bool _dropdown_list_vertically;
|
||||
|
||||
sint32 gDropdownNumItems;
|
||||
int32_t gDropdownNumItems;
|
||||
rct_string_id gDropdownItemsFormat[DROPDOWN_ITEMS_MAX_SIZE];
|
||||
sint64 gDropdownItemsArgs[DROPDOWN_ITEMS_MAX_SIZE];
|
||||
int64_t gDropdownItemsArgs[DROPDOWN_ITEMS_MAX_SIZE];
|
||||
static bool _dropdownItemsChecked[DROPDOWN_ITEMS_MAX_SIZE];
|
||||
static bool _dropdownItemsDisabled[DROPDOWN_ITEMS_MAX_SIZE];
|
||||
bool gDropdownIsColour;
|
||||
sint32 gDropdownLastColourHover;
|
||||
sint32 gDropdownHighlightedIndex;
|
||||
sint32 gDropdownDefaultIndex;
|
||||
int32_t gDropdownLastColourHover;
|
||||
int32_t gDropdownHighlightedIndex;
|
||||
int32_t gDropdownDefaultIndex;
|
||||
|
||||
bool dropdown_is_checked(sint32 index)
|
||||
bool dropdown_is_checked(int32_t index)
|
||||
{
|
||||
if (index < 0 || index >= (sint32)Util::CountOf(_dropdownItemsDisabled))
|
||||
if (index < 0 || index >= (int32_t)Util::CountOf(_dropdownItemsDisabled))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return _dropdownItemsChecked[index];
|
||||
}
|
||||
|
||||
bool dropdown_is_disabled(sint32 index)
|
||||
bool dropdown_is_disabled(int32_t index)
|
||||
{
|
||||
if (index < 0 || index >= (sint32)Util::CountOf(_dropdownItemsDisabled))
|
||||
if (index < 0 || index >= (int32_t)Util::CountOf(_dropdownItemsDisabled))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return _dropdownItemsDisabled[index];
|
||||
}
|
||||
|
||||
void dropdown_set_checked(sint32 index, bool value)
|
||||
void dropdown_set_checked(int32_t index, bool value)
|
||||
{
|
||||
if (index < 0 || index >= (sint32)Util::CountOf(_dropdownItemsDisabled))
|
||||
if (index < 0 || index >= (int32_t)Util::CountOf(_dropdownItemsDisabled))
|
||||
{
|
||||
return;
|
||||
}
|
||||
_dropdownItemsChecked[index] = value;
|
||||
}
|
||||
|
||||
void dropdown_set_disabled(sint32 index, bool value)
|
||||
void dropdown_set_disabled(int32_t index, bool value)
|
||||
{
|
||||
if (index < 0 || index >= (sint32)Util::CountOf(_dropdownItemsDisabled))
|
||||
if (index < 0 || index >= (int32_t)Util::CountOf(_dropdownItemsDisabled))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -136,9 +136,9 @@ static rct_window_event_list window_dropdown_events = {
|
|||
* @param num_items (bx)
|
||||
* @param colour (al)
|
||||
*/
|
||||
void window_dropdown_show_text(sint32 x, sint32 y, sint32 extray, uint8 colour, uint8 flags, size_t num_items)
|
||||
void window_dropdown_show_text(int32_t x, int32_t y, int32_t extray, uint8_t colour, uint8_t flags, size_t num_items)
|
||||
{
|
||||
sint32 string_width, max_string_width;
|
||||
int32_t string_width, max_string_width;
|
||||
char buffer[256];
|
||||
|
||||
// Calculate the longest string width
|
||||
|
@ -165,7 +165,7 @@ void window_dropdown_show_text(sint32 x, sint32 y, sint32 extray, uint8 colour,
|
|||
* @param colour (al)
|
||||
* @param custom_height (ah) requires flag set as well
|
||||
*/
|
||||
void window_dropdown_show_text_custom_width(sint32 x, sint32 y, sint32 extray, uint8 colour, uint8 custom_height, uint8 flags, size_t num_items, sint32 width)
|
||||
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 width)
|
||||
{
|
||||
rct_window* w;
|
||||
|
||||
|
@ -178,7 +178,7 @@ void window_dropdown_show_text_custom_width(sint32 x, sint32 y, sint32 extray, u
|
|||
// Set and calculate num items, rows and columns
|
||||
_dropdown_item_width = width;
|
||||
_dropdown_item_height = (flags & DROPDOWN_FLAG_CUSTOM_HEIGHT) ? custom_height : DROPDOWN_ITEM_HEIGHT;
|
||||
gDropdownNumItems = (sint32)num_items;
|
||||
gDropdownNumItems = (int32_t)num_items;
|
||||
// There must always be at least one column to prevent dividing by zero
|
||||
if (gDropdownNumItems == 0)
|
||||
{
|
||||
|
@ -195,9 +195,9 @@ void window_dropdown_show_text_custom_width(sint32 x, sint32 y, sint32 extray, u
|
|||
_dropdown_list_vertically = true;
|
||||
|
||||
width = _dropdown_item_width * _dropdown_num_columns + 3;
|
||||
sint32 height = _dropdown_item_height * _dropdown_num_rows + 3;
|
||||
sint32 screenWidth = context_get_width();
|
||||
sint32 screenHeight = context_get_height();
|
||||
int32_t height = _dropdown_item_height * _dropdown_num_rows + 3;
|
||||
int32_t screenWidth = context_get_width();
|
||||
int32_t screenHeight = context_get_height();
|
||||
if (x + width > screenWidth)
|
||||
x = std::max(0, screenWidth - width);
|
||||
if (y + height > screenHeight)
|
||||
|
@ -243,9 +243,9 @@ void window_dropdown_show_text_custom_width(sint32 x, sint32 y, sint32 extray, u
|
|||
* @param itemHeight (ah)
|
||||
* @param numColumns (bl)
|
||||
*/
|
||||
void window_dropdown_show_image(sint32 x, sint32 y, sint32 extray, uint8 colour, uint8 flags, sint32 numItems, sint32 itemWidth, sint32 itemHeight, sint32 numColumns)
|
||||
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)
|
||||
{
|
||||
sint32 width, height;
|
||||
int32_t width, height;
|
||||
rct_window* w;
|
||||
|
||||
input_set_flag((INPUT_FLAGS) (INPUT_FLAG_DROPDOWN_STAY_OPEN | INPUT_FLAG_DROPDOWN_MOUSE_UP), false);
|
||||
|
@ -280,8 +280,8 @@ void window_dropdown_show_image(sint32 x, sint32 y, sint32 extray, uint8 colour,
|
|||
width = _dropdown_item_width * _dropdown_num_columns + 3;
|
||||
height = _dropdown_item_height * _dropdown_num_rows + 3;
|
||||
|
||||
sint32 screenWidth = context_get_width();
|
||||
sint32 screenHeight = context_get_height();
|
||||
int32_t screenWidth = context_get_width();
|
||||
int32_t screenHeight = context_get_height();
|
||||
if (x + width > screenWidth)
|
||||
x = std::max(0, screenWidth - width);
|
||||
if (y + height > screenHeight)
|
||||
|
@ -319,12 +319,12 @@ void window_dropdown_close()
|
|||
|
||||
static void window_dropdown_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
||||
{
|
||||
sint32 cell_x, cell_y, l, t, r, b, item, image, colour;
|
||||
int32_t cell_x, cell_y, l, t, r, b, item, image, colour;
|
||||
|
||||
window_draw_widgets(w, dpi);
|
||||
|
||||
sint32 highlightedIndex = gDropdownHighlightedIndex;
|
||||
for (sint32 i = 0; i < gDropdownNumItems; i++) {
|
||||
int32_t highlightedIndex = gDropdownHighlightedIndex;
|
||||
for (int32_t i = 0; i < gDropdownNumItems; i++) {
|
||||
if (_dropdown_list_vertically) {
|
||||
cell_x = i / _dropdown_num_rows;
|
||||
cell_y = i % _dropdown_num_rows;
|
||||
|
@ -362,7 +362,7 @@ static void window_dropdown_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
|||
item = gDropdownItemsFormat[i];
|
||||
if (item == DROPDOWN_FORMAT_LAND_PICKER || item == DROPDOWN_FORMAT_COLOUR_PICKER) {
|
||||
// Image item
|
||||
image = (uint32)gDropdownItemsArgs[i];
|
||||
image = (uint32_t)gDropdownItemsArgs[i];
|
||||
if (item == DROPDOWN_FORMAT_COLOUR_PICKER && highlightedIndex == i)
|
||||
image++;
|
||||
|
||||
|
@ -406,23 +406,23 @@ static void window_dropdown_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
|||
* New function based on 6e914e
|
||||
* returns -1 if index is invalid
|
||||
*/
|
||||
sint32 dropdown_index_from_point(sint32 x, sint32 y, rct_window *w)
|
||||
int32_t dropdown_index_from_point(int32_t x, int32_t y, rct_window *w)
|
||||
{
|
||||
sint32 top = y - w->y - 2;
|
||||
int32_t top = y - w->y - 2;
|
||||
if (top < 0) return -1;
|
||||
|
||||
sint32 left = x - w->x;
|
||||
int32_t left = x - w->x;
|
||||
if (left >= w->width) return -1;
|
||||
left -= 2;
|
||||
if (left < 0) return -1;
|
||||
|
||||
sint32 column_no = left / _dropdown_item_width;
|
||||
int32_t column_no = left / _dropdown_item_width;
|
||||
if (column_no >= _dropdown_num_columns) return -1;
|
||||
|
||||
sint32 row_no = top / _dropdown_item_height;
|
||||
int32_t row_no = top / _dropdown_item_height;
|
||||
if (row_no >= _dropdown_num_rows) return -1;
|
||||
|
||||
sint32 dropdown_index;
|
||||
int32_t dropdown_index;
|
||||
if (_dropdown_list_vertically)
|
||||
dropdown_index = column_no * _dropdown_num_rows + row_no;
|
||||
else
|
||||
|
@ -436,11 +436,11 @@ sint32 dropdown_index_from_point(sint32 x, sint32 y, rct_window *w)
|
|||
/**
|
||||
* rct2: 0x006ED43D
|
||||
*/
|
||||
void window_dropdown_show_colour(rct_window *w, rct_widget *widget, uint8 dropdownColour, uint8 selectedColour)
|
||||
void window_dropdown_show_colour(rct_window *w, rct_widget *widget, uint8_t dropdownColour, uint8_t selectedColour)
|
||||
{
|
||||
sint32 defaultIndex = -1;
|
||||
int32_t defaultIndex = -1;
|
||||
// Set items
|
||||
for (uint64 i = 0; i < COLOUR_COUNT; i++)
|
||||
for (uint64_t i = 0; i < COLOUR_COUNT; i++)
|
||||
{
|
||||
if (selectedColour == i)
|
||||
defaultIndex = i;
|
||||
|
|
|
@ -200,7 +200,7 @@ static bool window_editor_bottom_toolbar_check_object_selection()
|
|||
{
|
||||
rct_window *w;
|
||||
|
||||
sint32 missingObjectType = Editor::CheckObjectSelection();
|
||||
int32_t missingObjectType = Editor::CheckObjectSelection();
|
||||
if (missingObjectType < 0) {
|
||||
window_close_by_class(WC_EDITOR_OBJECT_SELECTION);
|
||||
return true;
|
||||
|
@ -336,7 +336,7 @@ void window_editor_bottom_toolbar_invalidate(rct_window *w)
|
|||
{
|
||||
colour_scheme_update_by_class(w, (gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) ? WC_EDITOR_SCENARIO_BOTTOM_TOOLBAR : WC_EDITOR_TRACK_BOTTOM_TOOLBAR);
|
||||
|
||||
uint16 screenWidth = context_get_width();
|
||||
uint16_t screenWidth = context_get_width();
|
||||
window_editor_bottom_toolbar_widgets[WIDX_NEXT_IMAGE].left = screenWidth - 200;
|
||||
window_editor_bottom_toolbar_widgets[WIDX_NEXT_IMAGE].right = screenWidth - 1;
|
||||
window_editor_bottom_toolbar_widgets[WIDX_NEXT_STEP_BUTTON].left = screenWidth - 198;
|
||||
|
@ -429,10 +429,10 @@ void window_editor_bottom_toolbar_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
|||
w->colours[1], INSET_RECT_F_30);
|
||||
}
|
||||
|
||||
sint16 stateX =
|
||||
int16_t stateX =
|
||||
(window_editor_bottom_toolbar_widgets[WIDX_PREVIOUS_IMAGE].right +
|
||||
window_editor_bottom_toolbar_widgets[WIDX_NEXT_IMAGE].left) / 2 + w->x;
|
||||
sint16 stateY = w->height - 0x0C + w->y;
|
||||
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, nullptr);
|
||||
|
||||
|
@ -441,16 +441,16 @@ void window_editor_bottom_toolbar_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
|||
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);
|
||||
|
||||
sint32 textColour = NOT_TRANSLUCENT(w->colours[1]);
|
||||
int32_t textColour = NOT_TRANSLUCENT(w->colours[1]);
|
||||
if (gHoverWidget.window_classification == WC_BOTTOM_TOOLBAR &&
|
||||
gHoverWidget.widget_index == WIDX_PREVIOUS_STEP_BUTTON
|
||||
) {
|
||||
textColour = COLOUR_WHITE;
|
||||
}
|
||||
|
||||
sint16 textX = (window_editor_bottom_toolbar_widgets[WIDX_PREVIOUS_IMAGE].left + 30 +
|
||||
int16_t textX = (window_editor_bottom_toolbar_widgets[WIDX_PREVIOUS_IMAGE].left + 30 +
|
||||
window_editor_bottom_toolbar_widgets[WIDX_PREVIOUS_IMAGE].right) / 2 + w->x;
|
||||
sint16 textY = window_editor_bottom_toolbar_widgets[WIDX_PREVIOUS_IMAGE].top + 6 + w->y;
|
||||
int16_t textY = window_editor_bottom_toolbar_widgets[WIDX_PREVIOUS_IMAGE].top + 6 + w->y;
|
||||
|
||||
rct_string_id stringId = EditorStepNames[gS6Info.editor_step - 1];
|
||||
if (gScreenFlags & SCREEN_FLAGS_TRACK_DESIGNER)
|
||||
|
@ -465,7 +465,7 @@ void window_editor_bottom_toolbar_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
|||
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);
|
||||
|
||||
sint32 textColour = NOT_TRANSLUCENT(w->colours[1]);
|
||||
int32_t textColour = NOT_TRANSLUCENT(w->colours[1]);
|
||||
|
||||
if (gHoverWidget.window_classification == WC_BOTTOM_TOOLBAR &&
|
||||
gHoverWidget.widget_index == WIDX_NEXT_STEP_BUTTON
|
||||
|
@ -473,9 +473,9 @@ void window_editor_bottom_toolbar_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
|||
textColour = COLOUR_WHITE;
|
||||
}
|
||||
|
||||
sint16 textX = (window_editor_bottom_toolbar_widgets[WIDX_NEXT_IMAGE].left +
|
||||
int16_t textX = (window_editor_bottom_toolbar_widgets[WIDX_NEXT_IMAGE].left +
|
||||
window_editor_bottom_toolbar_widgets[WIDX_NEXT_IMAGE].right - 30) / 2 + w->x;
|
||||
sint16 textY = window_editor_bottom_toolbar_widgets[WIDX_NEXT_IMAGE].top + 6 + w->y;
|
||||
int16_t textY = window_editor_bottom_toolbar_widgets[WIDX_NEXT_IMAGE].top + 6 + w->y;
|
||||
|
||||
rct_string_id stringId = EditorStepNames[gS6Info.editor_step + 1];
|
||||
if (gScreenFlags & SCREEN_FLAGS_TRACK_DESIGNER)
|
||||
|
|
|
@ -73,17 +73,17 @@ static void window_editor_inventions_list_close(rct_window *w);
|
|||
static void window_editor_inventions_list_mouseup(rct_window *w, rct_widgetindex widgetIndex);
|
||||
static void window_editor_inventions_list_resize(rct_window *w);
|
||||
static void window_editor_inventions_list_update(rct_window *w);
|
||||
static void window_editor_inventions_list_scrollgetheight(rct_window *w, sint32 scrollIndex, sint32 *width, sint32 *height);
|
||||
static void window_editor_inventions_list_scrollmousedown(rct_window *w, sint32 scrollIndex, sint32 x, sint32 y);
|
||||
static void window_editor_inventions_list_scrollmouseover(rct_window *w, sint32 scrollIndex, sint32 x, sint32 y);
|
||||
static void window_editor_inventions_list_scrollgetheight(rct_window *w, int32_t scrollIndex, int32_t *width, int32_t *height);
|
||||
static void window_editor_inventions_list_scrollmousedown(rct_window *w, int32_t scrollIndex, int32_t x, int32_t y);
|
||||
static void window_editor_inventions_list_scrollmouseover(rct_window *w, int32_t scrollIndex, int32_t x, int32_t y);
|
||||
static void window_editor_inventions_list_tooltip(rct_window* w, rct_widgetindex widgetIndex, rct_string_id *stringId);
|
||||
static void window_editor_inventions_list_cursor(rct_window *w, rct_widgetindex widgetIndex, sint32 x, sint32 y, sint32 *cursorId);
|
||||
static void window_editor_inventions_list_cursor(rct_window *w, rct_widgetindex widgetIndex, int32_t x, int32_t y, int32_t *cursorId);
|
||||
static void window_editor_inventions_list_invalidate(rct_window *w);
|
||||
static void window_editor_inventions_list_paint(rct_window *w, rct_drawpixelinfo *dpi);
|
||||
static void window_editor_inventions_list_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, sint32 scrollIndex);
|
||||
static void window_editor_inventions_list_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, int32_t scrollIndex);
|
||||
|
||||
static void window_editor_inventions_list_drag_cursor(rct_window *w, rct_widgetindex widgetIndex, sint32 x, sint32 y, sint32 *cursorId);
|
||||
static void window_editor_inventions_list_drag_moved(rct_window* w, sint32 x, sint32 y);
|
||||
static void window_editor_inventions_list_drag_cursor(rct_window *w, rct_widgetindex widgetIndex, int32_t x, int32_t y, int32_t *cursorId);
|
||||
static void window_editor_inventions_list_drag_moved(rct_window* w, int32_t x, int32_t y);
|
||||
static void window_editor_inventions_list_drag_paint(rct_window *w, rct_drawpixelinfo *dpi);
|
||||
|
||||
static rct_string_id window_editor_inventions_list_prepare_name(const rct_research_item * researchItem, bool withGap);
|
||||
|
@ -178,17 +178,17 @@ static void move_research_item(rct_research_item *beforeItem);
|
|||
static void research_rides_setup()
|
||||
{
|
||||
// Reset all objects to not required
|
||||
for (uint8 objectType = OBJECT_TYPE_RIDE; objectType < OBJECT_TYPE_COUNT; objectType++)
|
||||
for (uint8_t objectType = OBJECT_TYPE_RIDE; objectType < OBJECT_TYPE_COUNT; objectType++)
|
||||
{
|
||||
auto maxObjects = object_entry_group_counts[objectType];
|
||||
for (sint32 i = 0; i < maxObjects; i++)
|
||||
for (int32_t i = 0; i < maxObjects; i++)
|
||||
{
|
||||
Editor::ClearSelectedObject(objectType, i, OBJECT_SELECTION_FLAG_ALL);
|
||||
}
|
||||
}
|
||||
|
||||
// Set research required for rides in use
|
||||
for (uint16 rideIndex = 0; rideIndex < MAX_RIDES; rideIndex++)
|
||||
for (uint16_t rideIndex = 0; rideIndex < MAX_RIDES; rideIndex++)
|
||||
{
|
||||
auto ride = get_ride(rideIndex);
|
||||
if (ride->type != RIDE_TYPE_NULL)
|
||||
|
@ -208,7 +208,7 @@ static void research_scenery_groups_setup()
|
|||
for (size_t i = 0; i < Util::CountOf(RequiredSelectedObjects); i++) {
|
||||
const rct_object_entry * object = &RequiredSelectedObjects[i];
|
||||
|
||||
uint8 entry_type, entryIndex;
|
||||
uint8_t entry_type, entryIndex;
|
||||
if (!find_object_in_entry_group(object, &entry_type, &entryIndex))
|
||||
continue;
|
||||
|
||||
|
@ -286,7 +286,7 @@ static void move_research_item(rct_research_item *beforeItem)
|
|||
*
|
||||
* rct2: 0x0068558E
|
||||
*/
|
||||
static rct_research_item *window_editor_inventions_list_get_item_from_scroll_y(sint32 scrollIndex, sint32 y)
|
||||
static rct_research_item *window_editor_inventions_list_get_item_from_scroll_y(int32_t scrollIndex, int32_t y)
|
||||
{
|
||||
rct_research_item *researchItem;
|
||||
|
||||
|
@ -314,7 +314,7 @@ static rct_research_item *window_editor_inventions_list_get_item_from_scroll_y(s
|
|||
*
|
||||
* rct2: 0x006855BB
|
||||
*/
|
||||
static rct_research_item *window_editor_inventions_list_get_item_from_scroll_y_include_seps(sint32 scrollIndex, sint32 y)
|
||||
static rct_research_item *window_editor_inventions_list_get_item_from_scroll_y_include_seps(int32_t scrollIndex, int32_t y)
|
||||
{
|
||||
rct_research_item *researchItem;
|
||||
|
||||
|
@ -338,7 +338,7 @@ static rct_research_item *window_editor_inventions_list_get_item_from_scroll_y_i
|
|||
return researchItem;
|
||||
}
|
||||
|
||||
static rct_research_item *get_research_item_at(sint32 x, sint32 y)
|
||||
static rct_research_item *get_research_item_at(int32_t x, int32_t y)
|
||||
{
|
||||
rct_window *w = window_find_by_class(WC_EDITOR_INVENTION_LIST);
|
||||
if (w != nullptr && w->x <= x && w->y < y && w->x + w->width > x && w->y + w->height > y) {
|
||||
|
@ -346,12 +346,12 @@ static rct_research_item *get_research_item_at(sint32 x, sint32 y)
|
|||
rct_widget *widget = &w->widgets[widgetIndex];
|
||||
if (widgetIndex == WIDX_PRE_RESEARCHED_SCROLL || widgetIndex == WIDX_RESEARCH_ORDER_SCROLL) {
|
||||
gPressedWidget.widget_index = widgetIndex;
|
||||
sint32 outX, outY, outScrollArea, outScrollId;
|
||||
int32_t outX, outY, outScrollArea, outScrollId;
|
||||
widget_scroll_get_part(w, widget, x, y, &outX, &outY, &outScrollArea, &outScrollId);
|
||||
if (outScrollArea == SCROLL_PART_VIEW) {
|
||||
outScrollId = outScrollId == 0 ? 0 : 1;
|
||||
|
||||
sint32 scrollY = y - (w->y + widget->top) + w->scrolls[outScrollId].v_top + 5;
|
||||
int32_t scrollY = y - (w->y + widget->top) + w->scrolls[outScrollId].v_top + 5;
|
||||
return window_editor_inventions_list_get_item_from_scroll_y_include_seps(outScrollId, scrollY);
|
||||
}
|
||||
}
|
||||
|
@ -484,7 +484,7 @@ static void window_editor_inventions_list_update(rct_window *w)
|
|||
*
|
||||
* rct2: 0x00685239
|
||||
*/
|
||||
static void window_editor_inventions_list_scrollgetheight(rct_window *w, sint32 scrollIndex, sint32 *width, sint32 *height)
|
||||
static void window_editor_inventions_list_scrollgetheight(rct_window *w, int32_t scrollIndex, int32_t *width, int32_t *height)
|
||||
{
|
||||
rct_research_item *researchItem;
|
||||
|
||||
|
@ -508,7 +508,7 @@ static void window_editor_inventions_list_scrollgetheight(rct_window *w, sint32
|
|||
*
|
||||
* rct2: 0x006852D4
|
||||
*/
|
||||
static void window_editor_inventions_list_scrollmousedown(rct_window *w, sint32 scrollIndex, sint32 x, sint32 y)
|
||||
static void window_editor_inventions_list_scrollmousedown(rct_window *w, int32_t scrollIndex, int32_t x, int32_t y)
|
||||
{
|
||||
rct_research_item *researchItem;
|
||||
|
||||
|
@ -528,7 +528,7 @@ static void window_editor_inventions_list_scrollmousedown(rct_window *w, sint32
|
|||
*
|
||||
* rct2: 0x00685275
|
||||
*/
|
||||
static void window_editor_inventions_list_scrollmouseover(rct_window *w, sint32 scrollIndex, sint32 x, sint32 y)
|
||||
static void window_editor_inventions_list_scrollmouseover(rct_window *w, int32_t scrollIndex, int32_t x, int32_t y)
|
||||
{
|
||||
rct_research_item *researchItem;
|
||||
|
||||
|
@ -559,10 +559,10 @@ static void window_editor_inventions_list_tooltip(rct_window* w, rct_widgetindex
|
|||
*
|
||||
* rct2: 0x00685291
|
||||
*/
|
||||
static void window_editor_inventions_list_cursor(rct_window *w, rct_widgetindex widgetIndex, sint32 x, sint32 y, sint32 *cursorId)
|
||||
static void window_editor_inventions_list_cursor(rct_window *w, rct_widgetindex widgetIndex, int32_t x, int32_t y, int32_t *cursorId)
|
||||
{
|
||||
rct_research_item *researchItem;
|
||||
sint32 scrollIndex;
|
||||
int32_t scrollIndex;
|
||||
|
||||
switch (widgetIndex) {
|
||||
case WIDX_PRE_RESEARCHED_SCROLL:
|
||||
|
@ -604,7 +604,7 @@ static void window_editor_inventions_list_invalidate(rct_window *w)
|
|||
w->widgets[WIDX_RESIZE].right = w->width - 1;
|
||||
w->widgets[WIDX_RESIZE].bottom = w->height - 1;
|
||||
|
||||
sint16 scroll_list_height = (w->height - 88) / 2;
|
||||
int16_t scroll_list_height = (w->height - 88) / 2;
|
||||
|
||||
w->widgets[WIDX_PRE_RESEARCHED_SCROLL].bottom = 60 + scroll_list_height;
|
||||
w->widgets[WIDX_PRE_RESEARCHED_SCROLL].right = w->width - 229;
|
||||
|
@ -641,7 +641,7 @@ static void window_editor_inventions_list_paint(rct_window *w, rct_drawpixelinfo
|
|||
rct_widget *widget;
|
||||
rct_research_item *researchItem;
|
||||
rct_string_id stringId;
|
||||
sint32 x, y, width;
|
||||
int32_t x, y, width;
|
||||
|
||||
window_draw_widgets(w, dpi);
|
||||
|
||||
|
@ -679,7 +679,7 @@ static void window_editor_inventions_list_paint(rct_window *w, rct_drawpixelinfo
|
|||
return;
|
||||
|
||||
// Preview image
|
||||
sint32 objectEntryType = OBJECT_TYPE_SCENERY_GROUP;
|
||||
int32_t objectEntryType = OBJECT_TYPE_SCENERY_GROUP;
|
||||
if (researchItem->type == RESEARCH_ENTRY_TYPE_RIDE)
|
||||
objectEntryType = OBJECT_TYPE_RIDE;
|
||||
|
||||
|
@ -698,7 +698,7 @@ static void window_editor_inventions_list_paint(rct_window *w, rct_drawpixelinfo
|
|||
x = w->x + widget->left + 1;
|
||||
y = w->y + widget->top + 1;
|
||||
width = widget->right - widget->left - 1;
|
||||
sint32 height = widget->bottom - widget->top - 1;
|
||||
int32_t height = widget->bottom - widget->top - 1;
|
||||
if (clip_drawpixelinfo(&clipDPI, dpi, x, y, width, height)) {
|
||||
object_draw_preview(object, &clipDPI, width, height);
|
||||
}
|
||||
|
@ -723,14 +723,14 @@ static void window_editor_inventions_list_paint(rct_window *w, rct_drawpixelinfo
|
|||
*
|
||||
* rct2: 0x006850BD
|
||||
*/
|
||||
static void window_editor_inventions_list_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, sint32 scrollIndex)
|
||||
static void window_editor_inventions_list_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, int32_t scrollIndex)
|
||||
{
|
||||
// Draw background
|
||||
uint8 paletteIndex = ColourMapA[w->colours[1]].mid_light;
|
||||
uint8_t paletteIndex = ColourMapA[w->colours[1]].mid_light;
|
||||
gfx_clear(dpi, paletteIndex);
|
||||
|
||||
rct_research_item* researchItem = gResearchItems;
|
||||
sint32 researchItemEndMarker;
|
||||
int32_t researchItemEndMarker;
|
||||
|
||||
if (scrollIndex == 1)
|
||||
{
|
||||
|
@ -744,9 +744,9 @@ static void window_editor_inventions_list_scrollpaint(rct_window *w, rct_drawpix
|
|||
researchItemEndMarker = RESEARCHED_ITEMS_SEPARATOR;
|
||||
}
|
||||
|
||||
sint16 boxWidth = (w->widgets[WIDX_RESEARCH_ORDER_SCROLL].right - w->widgets[WIDX_RESEARCH_ORDER_SCROLL].left);
|
||||
sint16 columnSplitOffset = boxWidth / 2;
|
||||
sint32 itemY = -SCROLLABLE_ROW_HEIGHT;
|
||||
int16_t boxWidth = (w->widgets[WIDX_RESEARCH_ORDER_SCROLL].right - w->widgets[WIDX_RESEARCH_ORDER_SCROLL].left);
|
||||
int16_t columnSplitOffset = boxWidth / 2;
|
||||
int32_t itemY = -SCROLLABLE_ROW_HEIGHT;
|
||||
do
|
||||
{
|
||||
itemY += SCROLLABLE_ROW_HEIGHT;
|
||||
|
@ -755,7 +755,7 @@ static void window_editor_inventions_list_scrollpaint(rct_window *w, rct_drawpix
|
|||
|
||||
if (w->research_item == researchItem)
|
||||
{
|
||||
sint32 top, bottom;
|
||||
int32_t top, bottom;
|
||||
if (_editorInventionsListDraggedItem == nullptr)
|
||||
{
|
||||
// Highlight
|
||||
|
@ -782,7 +782,7 @@ static void window_editor_inventions_list_scrollpaint(rct_window *w, rct_drawpix
|
|||
utf8* groupNamePtr = groupNameBuffer;
|
||||
utf8* vehicleNamePtr = vehicleNameBuffer;
|
||||
|
||||
uint8 colour;
|
||||
uint8_t colour;
|
||||
if (research_item_is_always_researched(researchItem))
|
||||
{
|
||||
if (w->research_item == researchItem && _editorInventionsListDraggedItem == nullptr)
|
||||
|
@ -838,7 +838,7 @@ static void window_editor_inventions_list_scrollpaint(rct_window *w, rct_drawpix
|
|||
static void window_editor_inventions_list_drag_open(rct_research_item *researchItem)
|
||||
{
|
||||
char buffer[256], *ptr;
|
||||
sint32 stringWidth;
|
||||
int32_t stringWidth;
|
||||
rct_window *w;
|
||||
|
||||
window_close_by_class(WC_EDITOR_INVENTION_LIST_DRAG);
|
||||
|
@ -881,7 +881,7 @@ static void window_editor_inventions_list_drag_open(rct_research_item *researchI
|
|||
*
|
||||
* rct2: 0x0068549C
|
||||
*/
|
||||
static void window_editor_inventions_list_drag_cursor(rct_window *w, rct_widgetindex widgetIndex, sint32 x, sint32 y, sint32 *cursorId)
|
||||
static void window_editor_inventions_list_drag_cursor(rct_window *w, rct_widgetindex widgetIndex, int32_t x, int32_t y, int32_t *cursorId)
|
||||
{
|
||||
rct_window *inventionListWindow = window_find_by_class(WC_EDITOR_INVENTION_LIST);
|
||||
if (inventionListWindow != nullptr) {
|
||||
|
@ -898,7 +898,7 @@ static void window_editor_inventions_list_drag_cursor(rct_window *w, rct_widgeti
|
|||
*
|
||||
* rct2: 0x00685412
|
||||
*/
|
||||
static void window_editor_inventions_list_drag_moved(rct_window* w, sint32 x, sint32 y)
|
||||
static void window_editor_inventions_list_drag_moved(rct_window* w, int32_t x, int32_t y)
|
||||
{
|
||||
rct_research_item *researchItem;
|
||||
|
||||
|
@ -924,7 +924,7 @@ static void window_editor_inventions_list_drag_moved(rct_window* w, sint32 x, si
|
|||
static void window_editor_inventions_list_drag_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
||||
{
|
||||
rct_string_id drawString;
|
||||
sint32 x, y;
|
||||
int32_t x, y;
|
||||
|
||||
x = w->x;
|
||||
y = w->y + 2;
|
||||
|
|
|
@ -60,10 +60,10 @@ enum
|
|||
FILTER_ALL = FILTER_RIDES | FILTER_RCT1 | FILTER_AA | FILTER_LL | FILTER_RCT2 | FILTER_WW | FILTER_TT | FILTER_OO | FILTER_CUSTOM | FILTER_SELECTED | FILTER_NONSELECTED,
|
||||
};
|
||||
|
||||
static constexpr uint8 _numSourceGameItems = 8;
|
||||
static constexpr uint8_t _numSourceGameItems = 8;
|
||||
|
||||
static uint32 _filter_flags;
|
||||
static uint16 _filter_object_counts[OBJECT_TYPE_COUNT];
|
||||
static uint32_t _filter_flags;
|
||||
static uint16_t _filter_object_counts[OBJECT_TYPE_COUNT];
|
||||
|
||||
static char _filter_string[MAX_PATH];
|
||||
|
||||
|
@ -82,7 +82,7 @@ static char _filter_string[MAX_PATH];
|
|||
struct ObjectPageDesc
|
||||
{
|
||||
rct_string_id Caption;
|
||||
uint32 Image;
|
||||
uint32_t Image;
|
||||
bool IsAdvanced;
|
||||
};
|
||||
|
||||
|
@ -167,15 +167,15 @@ static void window_editor_object_selection_close(rct_window *w);
|
|||
static void window_editor_object_selection_mouseup(rct_window *w, rct_widgetindex widgetIndex);
|
||||
static void window_editor_object_selection_resize(rct_window *w);
|
||||
static void window_editor_object_selection_mousedown(rct_window *w, rct_widgetindex widgetIndex, rct_widget* widget);
|
||||
static void window_editor_object_selection_dropdown(rct_window *w, rct_widgetindex widgetIndex, sint32 dropdownIndex);
|
||||
static void window_editor_object_selection_dropdown(rct_window *w, rct_widgetindex widgetIndex, int32_t dropdownIndex);
|
||||
static void window_editor_object_selection_update(rct_window *w);
|
||||
static void window_editor_object_selection_scrollgetsize(rct_window *w, sint32 scrollIndex, sint32 *width, sint32 *height);
|
||||
static void window_editor_object_selection_scroll_mousedown(rct_window *w, sint32 scrollIndex, sint32 x, sint32 y);
|
||||
static void window_editor_object_selection_scroll_mouseover(rct_window *w, sint32 scrollIndex, sint32 x, sint32 y);
|
||||
static void window_editor_object_selection_scrollgetsize(rct_window *w, int32_t scrollIndex, int32_t *width, int32_t *height);
|
||||
static void window_editor_object_selection_scroll_mousedown(rct_window *w, int32_t scrollIndex, int32_t x, int32_t y);
|
||||
static void window_editor_object_selection_scroll_mouseover(rct_window *w, int32_t scrollIndex, int32_t x, int32_t y);
|
||||
static void window_editor_object_selection_tooltip(rct_window* w, rct_widgetindex widgetIndex, rct_string_id *stringId);
|
||||
static void window_editor_object_selection_invalidate(rct_window *w);
|
||||
static void window_editor_object_selection_paint(rct_window *w, rct_drawpixelinfo *dpi);
|
||||
static void window_editor_object_selection_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, sint32 scrollIndex);
|
||||
static void window_editor_object_selection_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, int32_t scrollIndex);
|
||||
static void window_editor_object_selection_textinput(rct_window *w, rct_widgetindex widgetIndex, char *text);
|
||||
|
||||
static rct_window_event_list window_editor_object_selection_events = {
|
||||
|
@ -212,22 +212,22 @@ static rct_window_event_list window_editor_object_selection_events = {
|
|||
|
||||
#pragma endregion
|
||||
|
||||
static constexpr const sint32 window_editor_object_selection_animation_loops[] = { 20, 32, 10, 72, 24, 28, 16 };
|
||||
static constexpr const sint32 window_editor_object_selection_animation_divisor[] = { 4, 8, 2, 4, 4, 4, 2 };
|
||||
static constexpr const int32_t window_editor_object_selection_animation_loops[] = { 20, 32, 10, 72, 24, 28, 16 };
|
||||
static constexpr const int32_t window_editor_object_selection_animation_divisor[] = { 4, 8, 2, 4, 4, 4, 2 };
|
||||
|
||||
static void window_editor_object_set_page(rct_window *w, sint32 page);
|
||||
static void window_editor_object_set_page(rct_window *w, int32_t page);
|
||||
static void window_editor_object_selection_set_pressed_tab(rct_window *w);
|
||||
static sint32 get_object_from_object_selection(uint8 object_type, sint32 y);
|
||||
static int32_t get_object_from_object_selection(uint8_t object_type, int32_t y);
|
||||
static void window_editor_object_selection_manage_tracks();
|
||||
static void editor_load_selected_objects();
|
||||
static bool filter_selected(uint8 objectFlags);
|
||||
static bool filter_selected(uint8_t objectFlags);
|
||||
static bool filter_string(const ObjectRepositoryItem * item);
|
||||
static bool filter_source(const ObjectRepositoryItem * item);
|
||||
static bool filter_chunks(const ObjectRepositoryItem * item);
|
||||
static void filter_update_counts();
|
||||
|
||||
static std::string object_get_description(const void * object);
|
||||
static sint32 get_selected_object_type(rct_window * w);
|
||||
static int32_t get_selected_object_type(rct_window * w);
|
||||
|
||||
enum {
|
||||
RIDE_SORT_TYPE,
|
||||
|
@ -252,7 +252,7 @@ struct list_item {
|
|||
const ObjectRepositoryItem * repositoryItem;
|
||||
rct_object_entry *entry;
|
||||
rct_object_filters *filter;
|
||||
uint8 *flags;
|
||||
uint8_t *flags;
|
||||
};
|
||||
|
||||
static rct_string_id get_ride_type_string_id(const ObjectRepositoryItem * item);
|
||||
|
@ -260,7 +260,7 @@ static rct_string_id get_ride_type_string_id(const ObjectRepositoryItem * item);
|
|||
using sortFunc_t = bool (*)(const list_item &, const list_item &);
|
||||
|
||||
static std::vector<list_item> _listItems;
|
||||
static sint32 _listSortType = RIDE_SORT_TYPE;
|
||||
static int32_t _listSortType = RIDE_SORT_TYPE;
|
||||
static bool _listSortDescending = false;
|
||||
static void * _loadedObject = nullptr;
|
||||
|
||||
|
@ -281,7 +281,7 @@ static bool visible_list_sort_ride_type(const list_item &a, const list_item &b)
|
|||
{
|
||||
auto rideTypeA = language_get_string(get_ride_type_string_id(a.repositoryItem));
|
||||
auto rideTypeB = language_get_string(get_ride_type_string_id(b.repositoryItem));
|
||||
sint32 result = String::Compare(rideTypeA, rideTypeB);
|
||||
int32_t result = String::Compare(rideTypeA, rideTypeB);
|
||||
return result != 0 ?
|
||||
result < 0 :
|
||||
visible_list_sort_ride_name(a, b);
|
||||
|
@ -289,16 +289,16 @@ static bool visible_list_sort_ride_type(const list_item &a, const list_item &b)
|
|||
|
||||
static void visible_list_refresh(rct_window *w)
|
||||
{
|
||||
sint32 numObjects = (sint32)object_repository_get_items_count();
|
||||
int32_t numObjects = (int32_t)object_repository_get_items_count();
|
||||
|
||||
visible_list_dispose();
|
||||
w->selected_list_item = -1;
|
||||
|
||||
const ObjectRepositoryItem *items = object_repository_get_items();
|
||||
for (sint32 i = 0; i < numObjects; i++) {
|
||||
uint8 selectionFlags = _objectSelectionFlags[i];
|
||||
for (int32_t i = 0; i < numObjects; i++) {
|
||||
uint8_t selectionFlags = _objectSelectionFlags[i];
|
||||
const ObjectRepositoryItem * item = &items[i];
|
||||
uint8 objectType = item->ObjectEntry.flags & 0x0F;
|
||||
uint8_t objectType = item->ObjectEntry.flags & 0x0F;
|
||||
if (objectType == get_selected_object_type(w) && !(selectionFlags & OBJECT_SELECTION_FLAG_6) &&
|
||||
filter_source(item) &&
|
||||
filter_string(item) &&
|
||||
|
@ -357,7 +357,7 @@ static void window_editor_object_selection_init_widgets()
|
|||
{
|
||||
_window_editor_object_selection_widgets_initialised = true;
|
||||
auto tabWidget = widgets[widgets.size() - 2];
|
||||
for (sint32 i = 1; i < OBJECT_TYPE_COUNT; i++)
|
||||
for (int32_t i = 1; i < OBJECT_TYPE_COUNT; i++)
|
||||
{
|
||||
widgets.insert(widgets.end() - 1, tabWidget);
|
||||
}
|
||||
|
@ -397,12 +397,12 @@ rct_window * window_editor_object_selection_open()
|
|||
(1 << WIDX_FILTER_CLEAR_BUTTON) |
|
||||
(1 << WIDX_CLOSE) |
|
||||
(1 << WIDX_LIST_SORT_TYPE) |
|
||||
(((uint32)1) << WIDX_LIST_SORT_RIDE);
|
||||
(((uint32_t)1) << WIDX_LIST_SORT_RIDE);
|
||||
|
||||
_filter_flags = gConfigInterface.object_selection_filter_flags;
|
||||
memset(_filter_string, 0, sizeof(_filter_string));
|
||||
|
||||
for (sint32 i = WIDX_TAB_1; i < WIDX_TAB_1 + OBJECT_TYPE_COUNT; i++)
|
||||
for (int32_t i = WIDX_TAB_1; i < WIDX_TAB_1 + OBJECT_TYPE_COUNT; i++)
|
||||
{
|
||||
window->enabled_widgets |= (1LL << i);
|
||||
}
|
||||
|
@ -570,7 +570,7 @@ static void window_editor_object_selection_resize(rct_window *w)
|
|||
|
||||
void window_editor_object_selection_mousedown(rct_window *w, rct_widgetindex widgetIndex, rct_widget* widget)
|
||||
{
|
||||
sint32 numSelectionItems = 0;
|
||||
int32_t numSelectionItems = 0;
|
||||
|
||||
switch (widgetIndex) {
|
||||
case WIDX_FILTER_DROPDOWN:
|
||||
|
@ -614,7 +614,7 @@ void window_editor_object_selection_mousedown(rct_window *w, rct_widgetindex wid
|
|||
_numSourceGameItems + numSelectionItems
|
||||
);
|
||||
|
||||
for (sint32 i = 0; i < _numSourceGameItems; i++)
|
||||
for (int32_t i = 0; i < _numSourceGameItems; i++)
|
||||
{
|
||||
if (_filter_flags & (1 << i))
|
||||
{
|
||||
|
@ -631,7 +631,7 @@ void window_editor_object_selection_mousedown(rct_window *w, rct_widgetindex wid
|
|||
}
|
||||
}
|
||||
|
||||
static void window_editor_object_selection_dropdown(rct_window *w, rct_widgetindex widgetIndex, sint32 dropdownIndex)
|
||||
static void window_editor_object_selection_dropdown(rct_window *w, rct_widgetindex widgetIndex, int32_t dropdownIndex)
|
||||
{
|
||||
if (dropdownIndex == -1)
|
||||
return;
|
||||
|
@ -665,27 +665,27 @@ static void window_editor_object_selection_dropdown(rct_window *w, rct_widgetind
|
|||
*
|
||||
* rct2: 0x006AB031
|
||||
*/
|
||||
static void window_editor_object_selection_scrollgetsize(rct_window *w, sint32 scrollIndex, sint32 *width, sint32 *height)
|
||||
static void window_editor_object_selection_scrollgetsize(rct_window *w, int32_t scrollIndex, int32_t *width, int32_t *height)
|
||||
{
|
||||
*height = (sint32)(_listItems.size() * 12);
|
||||
*height = (int32_t)(_listItems.size() * 12);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* rct2: 0x006AB0B6
|
||||
*/
|
||||
static void window_editor_object_selection_scroll_mousedown(rct_window *w, sint32 scrollIndex, sint32 x, sint32 y)
|
||||
static void window_editor_object_selection_scroll_mousedown(rct_window *w, int32_t scrollIndex, int32_t x, int32_t y)
|
||||
{
|
||||
// Used for in-game object selection cheat to prevent crashing the game
|
||||
// when windows attempt to draw objects that don't exist any more
|
||||
window_close_all_except_class(WC_EDITOR_OBJECT_SELECTION);
|
||||
|
||||
sint32 selected_object = get_object_from_object_selection(get_selected_object_type(w), y);
|
||||
int32_t selected_object = get_object_from_object_selection(get_selected_object_type(w), y);
|
||||
if (selected_object == -1)
|
||||
return;
|
||||
|
||||
list_item * listItem = &_listItems[selected_object];
|
||||
uint8 object_selection_flags = *listItem->flags;
|
||||
uint8_t object_selection_flags = *listItem->flags;
|
||||
if (object_selection_flags & OBJECT_SELECTION_FLAG_6)
|
||||
return;
|
||||
|
||||
|
@ -708,7 +708,7 @@ static void window_editor_object_selection_scroll_mousedown(rct_window *w, sint3
|
|||
return;
|
||||
}
|
||||
|
||||
sint32 ebx = 6;
|
||||
int32_t ebx = 6;
|
||||
// If already selected
|
||||
if (!(object_selection_flags & OBJECT_SELECTION_FLAG_SELECTED))
|
||||
ebx = 7;
|
||||
|
@ -738,12 +738,12 @@ static void window_editor_object_selection_scroll_mousedown(rct_window *w, sint3
|
|||
*
|
||||
* rct2: 0x006AB079
|
||||
*/
|
||||
static void window_editor_object_selection_scroll_mouseover(rct_window *w, sint32 scrollIndex, sint32 x, sint32 y)
|
||||
static void window_editor_object_selection_scroll_mouseover(rct_window *w, int32_t scrollIndex, int32_t x, int32_t y)
|
||||
{
|
||||
sint32 selectedObject = get_object_from_object_selection(get_selected_object_type(w), y);
|
||||
int32_t selectedObject = get_object_from_object_selection(get_selected_object_type(w), y);
|
||||
if (selectedObject != -1) {
|
||||
list_item * listItem = &_listItems[selectedObject];
|
||||
uint8 objectSelectionFlags = *listItem->flags;
|
||||
uint8_t objectSelectionFlags = *listItem->flags;
|
||||
if (objectSelectionFlags & OBJECT_SELECTION_FLAG_6) {
|
||||
selectedObject = -1;
|
||||
}
|
||||
|
@ -830,8 +830,8 @@ static void window_editor_object_selection_invalidate(rct_window *w)
|
|||
|
||||
// Align tabs, hide advanced ones
|
||||
bool advancedMode = (w->list_information_type & 1) != 0;
|
||||
sint32 x = 3;
|
||||
for (sint32 i = 0; i < OBJECT_TYPE_COUNT; i++)
|
||||
int32_t x = 3;
|
||||
for (int32_t i = 0; i < OBJECT_TYPE_COUNT; i++)
|
||||
{
|
||||
auto widget = &w->widgets[WIDX_TAB_1 + i];
|
||||
if ((!advancedMode && ObjectSelectionPages[i].IsAdvanced) ||
|
||||
|
@ -850,7 +850,7 @@ static void window_editor_object_selection_invalidate(rct_window *w)
|
|||
|
||||
if (gScreenFlags & (SCREEN_FLAGS_TRACK_MANAGER | SCREEN_FLAGS_TRACK_DESIGNER)) {
|
||||
w->widgets[WIDX_ADVANCED].type = WWT_EMPTY;
|
||||
for (sint32 i = 1; i < OBJECT_TYPE_COUNT; i++)
|
||||
for (int32_t i = 1; i < OBJECT_TYPE_COUNT; i++)
|
||||
{
|
||||
w->widgets[WIDX_TAB_1 + i].type = WWT_EMPTY;
|
||||
}
|
||||
|
@ -882,25 +882,25 @@ static void window_editor_object_selection_invalidate(rct_window *w)
|
|||
(1 << WIDX_FILTER_RIDE_TAB_GENTLE) | (1 << WIDX_FILTER_RIDE_TAB_COASTER) | (1 << WIDX_FILTER_RIDE_TAB_THRILL) |
|
||||
(1 << WIDX_FILTER_RIDE_TAB_WATER) | (1 << WIDX_FILTER_RIDE_TAB_STALL);
|
||||
|
||||
for (sint32 i = 0; i < 7; i++)
|
||||
for (int32_t i = 0; i < 7; i++)
|
||||
w->pressed_widgets &= ~(1 << (WIDX_FILTER_RIDE_TAB_ALL + i));
|
||||
|
||||
if ((_filter_flags & FILTER_RIDES) == FILTER_RIDES)
|
||||
w->pressed_widgets |= (1 << WIDX_FILTER_RIDE_TAB_ALL);
|
||||
else
|
||||
{
|
||||
for (sint32 i = 0; i < 6; i++)
|
||||
for (int32_t i = 0; i < 6; i++)
|
||||
{
|
||||
if (_filter_flags & (1 << (_numSourceGameItems + i)))
|
||||
w->pressed_widgets |= (uint64)(1ULL << (WIDX_FILTER_RIDE_TAB_TRANSPORT + i));
|
||||
w->pressed_widgets |= (uint64_t)(1ULL << (WIDX_FILTER_RIDE_TAB_TRANSPORT + i));
|
||||
}
|
||||
}
|
||||
|
||||
w->widgets[WIDX_FILTER_RIDE_TAB_FRAME].type = WWT_IMGBTN;
|
||||
for (sint32 i = WIDX_FILTER_RIDE_TAB_ALL; i <= WIDX_FILTER_RIDE_TAB_STALL; i++)
|
||||
for (int32_t i = WIDX_FILTER_RIDE_TAB_ALL; i <= WIDX_FILTER_RIDE_TAB_STALL; i++)
|
||||
w->widgets[i].type = WWT_TAB;
|
||||
|
||||
sint32 width_limit = (w->widgets[WIDX_LIST].right - w->widgets[WIDX_LIST].left - 15) / 2;
|
||||
int32_t width_limit = (w->widgets[WIDX_LIST].right - w->widgets[WIDX_LIST].left - 15) / 2;
|
||||
|
||||
w->widgets[WIDX_LIST_SORT_TYPE].type = WWT_TABLE_HEADER;
|
||||
w->widgets[WIDX_LIST_SORT_TYPE].top = w->widgets[WIDX_FILTER_STRING_BUTTON].bottom + 3;
|
||||
|
@ -921,7 +921,7 @@ static void window_editor_object_selection_invalidate(rct_window *w)
|
|||
w->enabled_widgets &= ~((1 << WIDX_FILTER_RIDE_TAB_ALL) | (1 << WIDX_FILTER_RIDE_TAB_TRANSPORT) |
|
||||
(1 << WIDX_FILTER_RIDE_TAB_GENTLE) | (1 << WIDX_FILTER_RIDE_TAB_COASTER) | (1 << WIDX_FILTER_RIDE_TAB_THRILL) |
|
||||
(1 << WIDX_FILTER_RIDE_TAB_WATER) | (1 << WIDX_FILTER_RIDE_TAB_STALL));
|
||||
for (sint32 i = WIDX_FILTER_RIDE_TAB_FRAME; i <= WIDX_FILTER_RIDE_TAB_STALL; i++)
|
||||
for (int32_t i = WIDX_FILTER_RIDE_TAB_FRAME; i <= WIDX_FILTER_RIDE_TAB_STALL; i++)
|
||||
w->widgets[i].type = WWT_EMPTY;
|
||||
|
||||
w->widgets[WIDX_LIST_SORT_TYPE].type = WWT_EMPTY;
|
||||
|
@ -935,7 +935,7 @@ static void window_editor_object_selection_invalidate(rct_window *w)
|
|||
*/
|
||||
static void window_editor_object_selection_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
||||
{
|
||||
sint32 i, x, y, width;
|
||||
int32_t i, x, y, width;
|
||||
rct_widget *widget;
|
||||
rct_object_entry *highlightedEntry;
|
||||
rct_string_id stringId;
|
||||
|
@ -955,8 +955,8 @@ static void window_editor_object_selection_paint(rct_window *w, rct_drawpixelinf
|
|||
}
|
||||
}
|
||||
|
||||
const sint32 ride_tabs[] = { SPR_TAB_RIDE_16, IMAGE_TYPE_REMAP | SPR_TAB_RIDES_TRANSPORT_0, SPR_TAB_RIDES_GENTLE_0, IMAGE_TYPE_REMAP | SPR_TAB_RIDES_ROLLER_COASTERS_0, SPR_TAB_RIDES_THRILL_0, SPR_TAB_RIDES_WATER_0, SPR_TAB_RIDES_SHOP_0, SPR_TAB_FINANCES_RESEARCH_0 };
|
||||
const sint32 ThrillRidesTabAnimationSequence[] = {
|
||||
const int32_t ride_tabs[] = { SPR_TAB_RIDE_16, IMAGE_TYPE_REMAP | SPR_TAB_RIDES_TRANSPORT_0, SPR_TAB_RIDES_GENTLE_0, IMAGE_TYPE_REMAP | SPR_TAB_RIDES_ROLLER_COASTERS_0, SPR_TAB_RIDES_THRILL_0, SPR_TAB_RIDES_WATER_0, SPR_TAB_RIDES_SHOP_0, SPR_TAB_FINANCES_RESEARCH_0 };
|
||||
const int32_t ThrillRidesTabAnimationSequence[] = {
|
||||
5, 6, 5, 4, 3, 2, 1, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 0, 0, 0
|
||||
};
|
||||
|
||||
|
@ -968,8 +968,8 @@ static void window_editor_object_selection_paint(rct_window *w, rct_drawpixelinf
|
|||
if (widget->type == WWT_EMPTY)
|
||||
continue;
|
||||
|
||||
sint32 spriteIndex = ride_tabs[i];
|
||||
sint32 frame = 0;
|
||||
int32_t spriteIndex = ride_tabs[i];
|
||||
int32_t frame = 0;
|
||||
if (i != 0 && w->pressed_widgets & (1ULL << (WIDX_FILTER_RIDE_TAB_ALL + i))) {
|
||||
frame = w->frame_no / window_editor_object_selection_animation_divisor[i - 1];
|
||||
}
|
||||
|
@ -998,13 +998,13 @@ static void window_editor_object_selection_paint(rct_window *w, rct_drawpixelinf
|
|||
x = w->x + 3;
|
||||
y = w->y + w->height - 13;
|
||||
|
||||
sint32 numSelected = _numSelectedObjectsForType[get_selected_object_type(w)];
|
||||
sint32 totalSelectable = object_entry_group_counts[get_selected_object_type(w)];
|
||||
int32_t numSelected = _numSelectedObjectsForType[get_selected_object_type(w)];
|
||||
int32_t totalSelectable = object_entry_group_counts[get_selected_object_type(w)];
|
||||
if (gScreenFlags & SCREEN_FLAGS_TRACK_DESIGNER)
|
||||
totalSelectable = 4;
|
||||
|
||||
set_format_arg(0, uint16, numSelected);
|
||||
set_format_arg(2, uint16, totalSelectable);
|
||||
set_format_arg(0, uint16_t, numSelected);
|
||||
set_format_arg(2, uint16_t, totalSelectable);
|
||||
gfx_draw_string_left(dpi, STR_OBJECT_SELECTION_SELECTION_SIZE, gCommonFormatArgs, COLOUR_BLACK, x, y);
|
||||
}
|
||||
|
||||
|
@ -1034,7 +1034,7 @@ static void window_editor_object_selection_paint(rct_window *w, rct_drawpixelinf
|
|||
x = w->x + widget->left + 1;
|
||||
y = w->y + widget->top + 1;
|
||||
width = widget->right - widget->left - 1;
|
||||
sint32 height = widget->bottom - widget->top - 1;
|
||||
int32_t height = widget->bottom - widget->top - 1;
|
||||
if (clip_drawpixelinfo(&clipDPI, dpi, x, y, width, height)) {
|
||||
object_draw_preview(_loadedObject, &clipDPI, width, height);
|
||||
}
|
||||
|
@ -1088,13 +1088,13 @@ static void window_editor_object_selection_paint(rct_window *w, rct_drawpixelinf
|
|||
*
|
||||
* rct2: 0x006AADA3
|
||||
*/
|
||||
static void window_editor_object_selection_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, sint32 scrollIndex)
|
||||
static void window_editor_object_selection_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, int32_t scrollIndex)
|
||||
{
|
||||
sint32 x, y, colour, colour2;
|
||||
int32_t x, y, colour, colour2;
|
||||
|
||||
bool ridePage = (get_selected_object_type(w) == OBJECT_TYPE_RIDE);
|
||||
|
||||
uint8 paletteIndex = ColourMapA[w->colours[1]].mid_light;
|
||||
uint8_t paletteIndex = ColourMapA[w->colours[1]].mid_light;
|
||||
gfx_clear(dpi, paletteIndex);
|
||||
|
||||
y = 0;
|
||||
|
@ -1136,7 +1136,7 @@ static void window_editor_object_selection_scrollpaint(rct_window *w, rct_drawpi
|
|||
gCurrentFontSpriteBase = FONT_SPRITE_BASE_MEDIUM;
|
||||
}
|
||||
|
||||
sint32 width_limit = (w->widgets[WIDX_LIST].right - w->widgets[WIDX_LIST].left - x) / 2;
|
||||
int32_t width_limit = (w->widgets[WIDX_LIST].right - w->widgets[WIDX_LIST].left - x) / 2;
|
||||
|
||||
if (ridePage) {
|
||||
// Draw ride type
|
||||
|
@ -1160,7 +1160,7 @@ static void window_editor_object_selection_scrollpaint(rct_window *w, rct_drawpi
|
|||
}
|
||||
}
|
||||
|
||||
static void window_editor_object_set_page(rct_window *w, sint32 page)
|
||||
static void window_editor_object_set_page(rct_window *w, int32_t page)
|
||||
{
|
||||
if (w->selected_tab == page)
|
||||
return;
|
||||
|
@ -1185,7 +1185,7 @@ static void window_editor_object_set_page(rct_window *w, sint32 page)
|
|||
|
||||
static void window_editor_object_selection_set_pressed_tab(rct_window *w)
|
||||
{
|
||||
for (sint32 i = 0; i < OBJECT_TYPE_COUNT; i++)
|
||||
for (int32_t i = 0; i < OBJECT_TYPE_COUNT; i++)
|
||||
{
|
||||
w->pressed_widgets &= ~(1 << (WIDX_TAB_1 + i));
|
||||
}
|
||||
|
@ -1200,9 +1200,9 @@ static void window_editor_object_selection_set_pressed_tab(rct_window *w)
|
|||
*
|
||||
* rct2: 0x006AA703
|
||||
*/
|
||||
static sint32 get_object_from_object_selection(uint8 object_type, sint32 y)
|
||||
static int32_t get_object_from_object_selection(uint8_t object_type, int32_t y)
|
||||
{
|
||||
sint32 listItemIndex = y / 12;
|
||||
int32_t listItemIndex = y / 12;
|
||||
if (listItemIndex < 0 || (size_t)listItemIndex >= _listItems.size())
|
||||
return -1;
|
||||
|
||||
|
@ -1220,11 +1220,11 @@ static void window_editor_object_selection_manage_tracks()
|
|||
|
||||
gS6Info.editor_step = EDITOR_STEP_TRACK_DESIGNS_MANAGER;
|
||||
|
||||
sint32 entry_index = 0;
|
||||
int32_t entry_index = 0;
|
||||
for (; object_entry_get_chunk(OBJECT_TYPE_RIDE, entry_index) == nullptr; entry_index++);
|
||||
|
||||
rct_ride_entry* ride_entry = get_ride_entry(entry_index);
|
||||
uint8 ride_type = ride_entry_get_first_non_null_ride_type(ride_entry);
|
||||
uint8_t ride_type = ride_entry_get_first_non_null_ride_type(ride_entry);
|
||||
|
||||
auto intent = Intent(WC_TRACK_DESIGN_LIST);
|
||||
intent.putExtra(INTENT_EXTRA_RIDE_TYPE, ride_type);
|
||||
|
@ -1238,9 +1238,9 @@ static void window_editor_object_selection_manage_tracks()
|
|||
*/
|
||||
static void editor_load_selected_objects()
|
||||
{
|
||||
sint32 numItems = (sint32)object_repository_get_items_count();
|
||||
int32_t numItems = (int32_t)object_repository_get_items_count();
|
||||
const ObjectRepositoryItem * items = object_repository_get_items();
|
||||
for (sint32 i = 0; i < numItems; i++) {
|
||||
for (int32_t i = 0; i < numItems; i++) {
|
||||
if (_objectSelectionFlags[i] & OBJECT_SELECTION_FLAG_SELECTED) {
|
||||
const ObjectRepositoryItem * item = &items[i];
|
||||
const rct_object_entry * entry = &item->ObjectEntry;
|
||||
|
@ -1252,11 +1252,11 @@ static void editor_load_selected_objects()
|
|||
}
|
||||
else if (!(gScreenFlags & SCREEN_FLAGS_EDITOR)) {
|
||||
// Defaults selected items to researched (if in-game)
|
||||
uint8 objectType = object_entry_get_type(entry);
|
||||
uint8 entryIndex = object_manager_get_loaded_object_entry_index(loadedObject);
|
||||
uint8_t objectType = object_entry_get_type(entry);
|
||||
uint8_t entryIndex = object_manager_get_loaded_object_entry_index(loadedObject);
|
||||
if (objectType == OBJECT_TYPE_RIDE) {
|
||||
rct_ride_entry *rideEntry = get_ride_entry(entryIndex);
|
||||
uint8 rideType = ride_entry_get_first_non_null_ride_type(rideEntry);
|
||||
uint8_t rideType = ride_entry_get_first_non_null_ride_type(rideEntry);
|
||||
research_insert(1, RESEARCH_ENTRY_RIDE_MASK | (rideType << 8) | entryIndex, rideEntry->category[0]);
|
||||
}
|
||||
else if (objectType == OBJECT_TYPE_SCENERY_GROUP) {
|
||||
|
@ -1307,7 +1307,7 @@ static void window_editor_object_selection_textinput(rct_window *w, rct_widgetin
|
|||
window_invalidate(w);
|
||||
}
|
||||
|
||||
static bool filter_selected(uint8 objectFlag)
|
||||
static bool filter_selected(uint8_t objectFlag)
|
||||
{
|
||||
if (_FILTER_SELECTED == _FILTER_NONSELECTED) {
|
||||
return true;
|
||||
|
@ -1347,13 +1347,13 @@ static bool filter_string(const ObjectRepositoryItem * item)
|
|||
safe_strcpy(filter_lower, _filter_string, sizeof(_filter_string));
|
||||
|
||||
// Make use of lowercase characters only
|
||||
for (sint32 i = 0; name_lower[i] != '\0'; i++)
|
||||
for (int32_t i = 0; name_lower[i] != '\0'; i++)
|
||||
name_lower[i] = (char)tolower(name_lower[i]);
|
||||
for (sint32 i = 0; type_lower[i] != '\0'; i++)
|
||||
for (int32_t i = 0; type_lower[i] != '\0'; i++)
|
||||
type_lower[i] = (char)tolower(type_lower[i]);
|
||||
for (sint32 i = 0; object_path[i] != '\0'; i++)
|
||||
for (int32_t i = 0; object_path[i] != '\0'; i++)
|
||||
object_path[i] = (char)tolower(object_path[i]);
|
||||
for (sint32 i = 0; filter_lower[i] != '\0'; i++)
|
||||
for (int32_t i = 0; filter_lower[i] != '\0'; i++)
|
||||
filter_lower[i] = (char)tolower(filter_lower[i]);
|
||||
|
||||
// Check if the searched string exists in the name, ride type, or filename
|
||||
|
@ -1369,7 +1369,7 @@ static bool filter_source(const ObjectRepositoryItem * item)
|
|||
if (_FILTER_ALL)
|
||||
return true;
|
||||
|
||||
uint8 source = object_entry_get_source_game(&item->ObjectEntry);
|
||||
uint8_t source = object_entry_get_source_game(&item->ObjectEntry);
|
||||
return (_FILTER_RCT1 && source == OBJECT_SOURCE_RCT1) ||
|
||||
(_FILTER_AA && source == OBJECT_SOURCE_ADDED_ATTRACTIONS) ||
|
||||
(_FILTER_LL && source == OBJECT_SOURCE_LOOPY_LANDSCAPES) ||
|
||||
|
@ -1392,8 +1392,8 @@ static bool filter_chunks(const ObjectRepositoryItem * item)
|
|||
switch (item->ObjectEntry.flags & 0x0F) {
|
||||
case OBJECT_TYPE_RIDE:
|
||||
|
||||
uint8 rideType = 0;
|
||||
for (sint32 i = 0; i < MAX_RIDE_TYPES_PER_RIDE_ENTRY; i++)
|
||||
uint8_t rideType = 0;
|
||||
for (int32_t i = 0; i < MAX_RIDE_TYPES_PER_RIDE_ENTRY; i++)
|
||||
{
|
||||
if (item->RideInfo.RideType[i] != RIDE_TYPE_NULL)
|
||||
{
|
||||
|
@ -1413,7 +1413,7 @@ static void filter_update_counts()
|
|||
{
|
||||
if (!_FILTER_ALL || strlen(_filter_string) > 0) {
|
||||
const auto &selectionFlags = _objectSelectionFlags;
|
||||
for (sint32 i = 0; i < 11; i++) {
|
||||
for (int32_t i = 0; i < 11; i++) {
|
||||
_filter_object_counts[i] = 0;
|
||||
}
|
||||
|
||||
|
@ -1426,7 +1426,7 @@ static void filter_update_counts()
|
|||
filter_chunks(item) &&
|
||||
filter_selected(selectionFlags[i])
|
||||
) {
|
||||
uint8 objectType = item->ObjectEntry.flags & 0xF;
|
||||
uint8_t objectType = item->ObjectEntry.flags & 0xF;
|
||||
_filter_object_counts[objectType]++;
|
||||
}
|
||||
}
|
||||
|
@ -1436,9 +1436,9 @@ static void filter_update_counts()
|
|||
static rct_string_id get_ride_type_string_id(const ObjectRepositoryItem * item)
|
||||
{
|
||||
rct_string_id result = STR_NONE;
|
||||
for (sint32 i = 0; i < MAX_RIDE_TYPES_PER_RIDE_ENTRY; i++)
|
||||
for (int32_t i = 0; i < MAX_RIDE_TYPES_PER_RIDE_ENTRY; i++)
|
||||
{
|
||||
uint8 rideType = item->RideInfo.RideType[i];
|
||||
uint8_t rideType = item->RideInfo.RideType[i];
|
||||
if (rideType != RIDE_TYPE_NULL)
|
||||
{
|
||||
if (RideGroupManager::RideTypeHasRideGroups(rideType))
|
||||
|
@ -1471,7 +1471,7 @@ static std::string object_get_description(const void * object)
|
|||
}
|
||||
}
|
||||
|
||||
static sint32 get_selected_object_type(rct_window * w)
|
||||
static int32_t get_selected_object_type(rct_window * w)
|
||||
{
|
||||
return w->selected_tab;
|
||||
}
|
||||
|
|
|
@ -124,7 +124,7 @@ static rct_widget *window_editor_objective_options_widgets[] = {
|
|||
static void window_editor_objective_options_main_mouseup(rct_window *w, rct_widgetindex widgetIndex);
|
||||
static void window_editor_objective_options_main_resize(rct_window *w);
|
||||
static void window_editor_objective_options_main_mousedown(rct_window *w, rct_widgetindex widgetIndex, rct_widget* widget);
|
||||
static void window_editor_objective_options_main_dropdown(rct_window *w, rct_widgetindex widgetIndex, sint32 dropdownIndex);
|
||||
static void window_editor_objective_options_main_dropdown(rct_window *w, rct_widgetindex widgetIndex, int32_t dropdownIndex);
|
||||
static void window_editor_objective_options_main_update(rct_window *w);
|
||||
static void window_editor_objective_options_main_textinput(rct_window *w, rct_widgetindex widgetIndex, char *text);
|
||||
static void window_editor_objective_options_main_invalidate(rct_window *w);
|
||||
|
@ -133,12 +133,12 @@ static void window_editor_objective_options_main_paint(rct_window *w, rct_drawpi
|
|||
static void window_editor_objective_options_rides_mouseup(rct_window *w, rct_widgetindex widgetIndex);
|
||||
static void window_editor_objective_options_rides_resize(rct_window *w);
|
||||
static void window_editor_objective_options_rides_update(rct_window *w);
|
||||
static void window_editor_objective_options_rides_scrollgetheight(rct_window *w, sint32 scrollIndex, sint32 *width, sint32 *height);
|
||||
static void window_editor_objective_options_rides_scrollmousedown(rct_window *w, sint32 scrollIndex, sint32 x, sint32 y);
|
||||
static void window_editor_objective_options_rides_scrollmouseover(rct_window *w, sint32 scrollIndex, sint32 x, sint32 y);
|
||||
static void window_editor_objective_options_rides_scrollgetheight(rct_window *w, int32_t scrollIndex, int32_t *width, int32_t *height);
|
||||
static void window_editor_objective_options_rides_scrollmousedown(rct_window *w, int32_t scrollIndex, int32_t x, int32_t y);
|
||||
static void window_editor_objective_options_rides_scrollmouseover(rct_window *w, int32_t scrollIndex, int32_t x, int32_t y);
|
||||
static void window_editor_objective_options_rides_invalidate(rct_window *w);
|
||||
static void window_editor_objective_options_rides_paint(rct_window *w, rct_drawpixelinfo *dpi);
|
||||
static void window_editor_objective_options_rides_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, sint32 scrollIndex);
|
||||
static void window_editor_objective_options_rides_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, int32_t scrollIndex);
|
||||
|
||||
// 0x009A9DF4
|
||||
static rct_window_event_list window_objective_options_main_events = {
|
||||
|
@ -213,7 +213,7 @@ static rct_window_event_list *window_editor_objective_options_page_events[] = {
|
|||
|
||||
#pragma region Enabled widgets
|
||||
|
||||
static uint64 window_editor_objective_options_page_enabled_widgets[] = {
|
||||
static uint64_t window_editor_objective_options_page_enabled_widgets[] = {
|
||||
(1 << WIDX_CLOSE) |
|
||||
(1 << WIDX_TAB_1) |
|
||||
(1 << WIDX_TAB_2) |
|
||||
|
@ -236,7 +236,7 @@ static uint64 window_editor_objective_options_page_enabled_widgets[] = {
|
|||
(1 << WIDX_TAB_2)
|
||||
};
|
||||
|
||||
static uint64 window_editor_objective_options_page_hold_down_widgets[] = {
|
||||
static uint64_t window_editor_objective_options_page_hold_down_widgets[] = {
|
||||
(1 << WIDX_OBJECTIVE_ARG_1_INCREASE) |
|
||||
(1 << WIDX_OBJECTIVE_ARG_1_DECREASE) |
|
||||
(1 << WIDX_OBJECTIVE_ARG_2_INCREASE) |
|
||||
|
@ -285,7 +285,7 @@ rct_window * window_editor_objective_options_open()
|
|||
|
||||
static void window_editor_objective_options_set_pressed_tab(rct_window *w)
|
||||
{
|
||||
sint32 i;
|
||||
int32_t i;
|
||||
for (i = 0; i < 2; i++)
|
||||
w->pressed_widgets &= ~(1 << (WIDX_TAB_1 + i));
|
||||
w->pressed_widgets |= 1LL << (WIDX_TAB_1 + w->page);
|
||||
|
@ -305,7 +305,7 @@ static void window_editor_objective_options_anchor_border_widgets(rct_window *w)
|
|||
static void window_editor_objective_options_draw_tab_images(rct_window *w, rct_drawpixelinfo *dpi)
|
||||
{
|
||||
rct_widget *widget;
|
||||
sint32 spriteIndex;
|
||||
int32_t spriteIndex;
|
||||
|
||||
// Tab 1
|
||||
widget = &w->widgets[WIDX_TAB_1];
|
||||
|
@ -331,7 +331,7 @@ static void window_editor_objective_options_draw_tab_images(rct_window *w, rct_d
|
|||
*
|
||||
* rct2: 0x00668496
|
||||
*/
|
||||
static void window_editor_objective_options_set_page(rct_window *w, sint32 page)
|
||||
static void window_editor_objective_options_set_page(rct_window *w, int32_t page)
|
||||
{
|
||||
if (w->page == page)
|
||||
return;
|
||||
|
@ -357,7 +357,7 @@ static void window_editor_objective_options_set_page(rct_window *w, sint32 page)
|
|||
*
|
||||
* rct2: 0x0067201D
|
||||
*/
|
||||
static void window_editor_objective_options_set_objective(rct_window *w, sint32 objective)
|
||||
static void window_editor_objective_options_set_objective(rct_window *w, int32_t objective)
|
||||
{
|
||||
gScenarioObjectiveType = objective;
|
||||
window_invalidate(w);
|
||||
|
@ -413,7 +413,7 @@ static void window_editor_objective_options_main_mouseup(rct_window *w, rct_widg
|
|||
window_editor_objective_options_set_page(w, widgetIndex - WIDX_TAB_1);
|
||||
break;
|
||||
case WIDX_PARK_NAME:
|
||||
set_format_arg(16, uint32, gParkNameArgs);
|
||||
set_format_arg(16, uint32_t, gParkNameArgs);
|
||||
window_text_input_open(w, WIDX_PARK_NAME, STR_PARK_NAME, STR_ENTER_PARK_NAME, gParkName, 0, 32);
|
||||
break;
|
||||
case WIDX_SCENARIO_NAME:
|
||||
|
@ -436,9 +436,9 @@ static void window_editor_objective_options_main_resize(rct_window *w)
|
|||
|
||||
static void window_editor_objective_options_show_objective_dropdown(rct_window *w)
|
||||
{
|
||||
sint32 numItems = 0, objectiveType;
|
||||
int32_t numItems = 0, objectiveType;
|
||||
rct_widget *dropdownWidget;
|
||||
uint32 parkFlags;
|
||||
uint32_t parkFlags;
|
||||
|
||||
dropdownWidget = &w->widgets[WIDX_OBJECTIVE];
|
||||
parkFlags = gParkFlags;
|
||||
|
@ -501,7 +501,7 @@ static void window_editor_objective_options_show_objective_dropdown(rct_window *
|
|||
);
|
||||
|
||||
objectiveType = gScenarioObjectiveType;
|
||||
for (sint32 j = 0; j < numItems; j++)
|
||||
for (int32_t j = 0; j < numItems; j++)
|
||||
{
|
||||
if (gDropdownItemsArgs[j] - STR_OBJECTIVE_DROPDOWN_NONE == objectiveType)
|
||||
{
|
||||
|
@ -513,7 +513,7 @@ static void window_editor_objective_options_show_objective_dropdown(rct_window *
|
|||
|
||||
static void window_editor_objective_options_show_climate_dropdown(rct_window *w)
|
||||
{
|
||||
sint32 i;
|
||||
int32_t i;
|
||||
rct_widget *dropdownWidget;
|
||||
|
||||
dropdownWidget = &w->widgets[WIDX_CLIMATE];
|
||||
|
@ -537,7 +537,7 @@ static void window_editor_objective_options_show_climate_dropdown(rct_window *w)
|
|||
|
||||
static void window_editor_objective_options_show_category_dropdown(rct_window *w)
|
||||
{
|
||||
sint32 i;
|
||||
int32_t i;
|
||||
rct_widget *dropdownWidget;
|
||||
|
||||
dropdownWidget = &w->widgets[WIDX_CATEGORY];
|
||||
|
@ -710,9 +710,9 @@ static void window_editor_objective_options_main_mousedown(rct_window *w, rct_wi
|
|||
*
|
||||
* rct2: 0x00671A54
|
||||
*/
|
||||
static void window_editor_objective_options_main_dropdown(rct_window *w, rct_widgetindex widgetIndex, sint32 dropdownIndex)
|
||||
static void window_editor_objective_options_main_dropdown(rct_window *w, rct_widgetindex widgetIndex, int32_t dropdownIndex)
|
||||
{
|
||||
uint8 newObjectiveType;
|
||||
uint8_t newObjectiveType;
|
||||
|
||||
if (dropdownIndex == -1)
|
||||
return;
|
||||
|
@ -720,19 +720,19 @@ static void window_editor_objective_options_main_dropdown(rct_window *w, rct_wid
|
|||
switch (widgetIndex) {
|
||||
case WIDX_OBJECTIVE_DROPDOWN:
|
||||
// TODO: Don't rely on string ID order
|
||||
newObjectiveType = (uint8)(gDropdownItemsArgs[dropdownIndex] - STR_OBJECTIVE_DROPDOWN_NONE);
|
||||
newObjectiveType = (uint8_t)(gDropdownItemsArgs[dropdownIndex] - STR_OBJECTIVE_DROPDOWN_NONE);
|
||||
if (gScenarioObjectiveType != newObjectiveType)
|
||||
window_editor_objective_options_set_objective(w, newObjectiveType);
|
||||
break;
|
||||
case WIDX_CLIMATE_DROPDOWN:
|
||||
if (gClimate != (uint8)dropdownIndex) {
|
||||
gClimate = (uint8)dropdownIndex;
|
||||
if (gClimate != (uint8_t)dropdownIndex) {
|
||||
gClimate = (uint8_t)dropdownIndex;
|
||||
window_invalidate(w);
|
||||
}
|
||||
break;
|
||||
case WIDX_CATEGORY_DROPDOWN:
|
||||
if (gS6Info.category != (uint8)dropdownIndex) {
|
||||
gS6Info.category = (uint8)dropdownIndex;
|
||||
if (gS6Info.category != (uint8_t)dropdownIndex) {
|
||||
gS6Info.category = (uint8_t)dropdownIndex;
|
||||
window_invalidate(w);
|
||||
}
|
||||
break;
|
||||
|
@ -745,8 +745,8 @@ static void window_editor_objective_options_main_dropdown(rct_window *w, rct_wid
|
|||
*/
|
||||
static void window_editor_objective_options_main_update(rct_window *w)
|
||||
{
|
||||
uint32 parkFlags;
|
||||
uint8 objectiveType;
|
||||
uint32_t parkFlags;
|
||||
uint8_t objectiveType;
|
||||
|
||||
w->frame_no++;
|
||||
window_event_invalidate_call(w);
|
||||
|
@ -870,9 +870,9 @@ static void window_editor_objective_options_main_invalidate(rct_window *w)
|
|||
*/
|
||||
static void window_editor_objective_options_main_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
||||
{
|
||||
sint32 x, y, width;
|
||||
int32_t x, y, width;
|
||||
rct_string_id stringId;
|
||||
uint32 arg;
|
||||
uint32_t arg;
|
||||
|
||||
window_draw_widgets(w, dpi);
|
||||
window_editor_objective_options_draw_tab_images(w, dpi);
|
||||
|
@ -979,7 +979,7 @@ static void window_editor_objective_options_main_paint(rct_window *w, rct_drawpi
|
|||
} else {
|
||||
set_format_arg(0, rct_string_id, gParkName);
|
||||
}
|
||||
set_format_arg(2, uint32, gParkNameArgs);
|
||||
set_format_arg(2, uint32_t, gParkNameArgs);
|
||||
gfx_draw_string_left_clipped(dpi, STR_WINDOW_PARK_NAME, gCommonFormatArgs, COLOUR_BLACK, x, y, width);
|
||||
|
||||
// Scenario name
|
||||
|
@ -989,7 +989,7 @@ static void window_editor_objective_options_main_paint(rct_window *w, rct_drawpi
|
|||
|
||||
if (stex != nullptr) {
|
||||
set_format_arg(0, rct_string_id, stex->scenario_name);
|
||||
set_format_arg(2, uint32, gParkNameArgs);
|
||||
set_format_arg(2, uint32_t, gParkNameArgs);
|
||||
} else {
|
||||
set_format_arg(0, rct_string_id, STR_STRING);
|
||||
set_format_arg(2, const char *, gS6Info.name);
|
||||
|
@ -1009,7 +1009,7 @@ static void window_editor_objective_options_main_paint(rct_window *w, rct_drawpi
|
|||
|
||||
if (stex != nullptr) {
|
||||
set_format_arg(0, rct_string_id, stex->details);
|
||||
set_format_arg(2, uint32, gParkNameArgs);
|
||||
set_format_arg(2, uint32_t, gParkNameArgs);
|
||||
} else {
|
||||
set_format_arg(0, rct_string_id, STR_STRING);
|
||||
set_format_arg(2, const char *, gS6Info.details);
|
||||
|
@ -1060,7 +1060,7 @@ static void window_editor_objective_options_rides_resize(rct_window *w)
|
|||
*/
|
||||
static void window_editor_objective_options_rides_update(rct_window *w)
|
||||
{
|
||||
sint32 i, numItems;
|
||||
int32_t i, numItems;
|
||||
Ride *ride;
|
||||
|
||||
w->frame_no++;
|
||||
|
@ -1086,7 +1086,7 @@ static void window_editor_objective_options_rides_update(rct_window *w)
|
|||
*
|
||||
* rct2: 0x006724BF
|
||||
*/
|
||||
static void window_editor_objective_options_rides_scrollgetheight(rct_window *w, sint32 scrollIndex, sint32 *width, sint32 *height)
|
||||
static void window_editor_objective_options_rides_scrollgetheight(rct_window *w, int32_t scrollIndex, int32_t *width, int32_t *height)
|
||||
{
|
||||
*height = w->no_list_items * 12;
|
||||
}
|
||||
|
@ -1095,10 +1095,10 @@ static void window_editor_objective_options_rides_scrollgetheight(rct_window *w,
|
|||
*
|
||||
* rct2: 0x006724FC
|
||||
*/
|
||||
static void window_editor_objective_options_rides_scrollmousedown(rct_window *w, sint32 scrollIndex, sint32 x, sint32 y)
|
||||
static void window_editor_objective_options_rides_scrollmousedown(rct_window *w, int32_t scrollIndex, int32_t x, int32_t y)
|
||||
{
|
||||
Ride *ride;
|
||||
sint32 i;
|
||||
int32_t i;
|
||||
|
||||
i = y / 12;
|
||||
if (i < 0 || i >= w->no_list_items)
|
||||
|
@ -1113,9 +1113,9 @@ static void window_editor_objective_options_rides_scrollmousedown(rct_window *w,
|
|||
*
|
||||
* rct2: 0x006724CC
|
||||
*/
|
||||
static void window_editor_objective_options_rides_scrollmouseover(rct_window *w, sint32 scrollIndex, sint32 x, sint32 y)
|
||||
static void window_editor_objective_options_rides_scrollmouseover(rct_window *w, int32_t scrollIndex, int32_t x, int32_t y)
|
||||
{
|
||||
sint32 i;
|
||||
int32_t i;
|
||||
|
||||
i = y / 12;
|
||||
if (i < 0 || i >= w->no_list_items)
|
||||
|
@ -1164,16 +1164,16 @@ static void window_editor_objective_options_rides_paint(rct_window *w, rct_drawp
|
|||
*
|
||||
* rct2: 0x0067236F
|
||||
*/
|
||||
static void window_editor_objective_options_rides_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, sint32 scrollIndex)
|
||||
static void window_editor_objective_options_rides_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, int32_t scrollIndex)
|
||||
{
|
||||
rct_string_id stringId;
|
||||
Ride *ride;
|
||||
|
||||
sint32 colour = ColourMapA[w->colours[1]].mid_light;
|
||||
int32_t colour = ColourMapA[w->colours[1]].mid_light;
|
||||
gfx_fill_rect(dpi, dpi->x, dpi->y, dpi->x + dpi->width - 1, dpi->y + dpi->height - 1, colour);
|
||||
|
||||
for (sint32 i = 0; i < w->no_list_items; i++) {
|
||||
sint32 y = i * 12;
|
||||
for (int32_t i = 0; i < w->no_list_items; i++) {
|
||||
int32_t y = i * 12;
|
||||
|
||||
if (y + 12 < dpi->y || y >= dpi->y + dpi->height)
|
||||
continue;
|
||||
|
@ -1208,7 +1208,7 @@ static void window_editor_objective_options_rides_scrollpaint(rct_window *w, rct
|
|||
static void window_editor_objective_options_update_disabled_widgets(rct_window *w)
|
||||
{
|
||||
Ride *ride;
|
||||
sint32 i, numRides;
|
||||
int32_t i, numRides;
|
||||
|
||||
// Check if there are any rides (not shops or facilities)
|
||||
numRides = 0;
|
||||
|
|
|
@ -175,7 +175,7 @@ static void window_editor_scenario_options_guests_paint(rct_window *w, rct_drawp
|
|||
static void window_editor_scenario_options_park_mouseup(rct_window *w, rct_widgetindex widgetIndex);
|
||||
static void window_editor_scenario_options_park_resize(rct_window *w);
|
||||
static void window_editor_scenario_options_park_mousedown(rct_window *w, rct_widgetindex widgetIndex, rct_widget *widget);
|
||||
static void window_editor_scenario_options_park_dropdown(rct_window *w, rct_widgetindex widgetIndex, sint32 dropdownIndex);
|
||||
static void window_editor_scenario_options_park_dropdown(rct_window *w, rct_widgetindex widgetIndex, int32_t dropdownIndex);
|
||||
static void window_editor_scenario_options_park_update(rct_window *w);
|
||||
static void window_editor_scenario_options_park_invalidate(rct_window *w);
|
||||
static void window_editor_scenario_options_park_paint(rct_window *w, rct_drawpixelinfo *dpi);
|
||||
|
@ -292,7 +292,7 @@ static rct_window_event_list *window_editor_scenario_options_page_events[] = {
|
|||
(1ULL << WIDX_TAB_2) |\
|
||||
(1ULL << WIDX_TAB_3)
|
||||
|
||||
static uint64 window_editor_scenario_options_page_enabled_widgets[] = {
|
||||
static uint64_t window_editor_scenario_options_page_enabled_widgets[] = {
|
||||
ALWAYS_ENABLED_WIDGETS |
|
||||
(1ULL << WIDX_NO_MONEY) |
|
||||
(1ULL << WIDX_INITIAL_CASH_INCREASE) |
|
||||
|
@ -331,7 +331,7 @@ static uint64 window_editor_scenario_options_page_enabled_widgets[] = {
|
|||
(1ULL << WIDX_HARD_GUEST_GENERATION)
|
||||
};
|
||||
|
||||
static uint32 window_editor_scenario_options_page_hold_down_widgets[] = {
|
||||
static uint32_t window_editor_scenario_options_page_hold_down_widgets[] = {
|
||||
(1ULL << WIDX_INITIAL_CASH_INCREASE) |
|
||||
(1ULL << WIDX_INITIAL_CASH_DECREASE) |
|
||||
(1ULL << WIDX_INITIAL_LOAN_INCREASE) |
|
||||
|
@ -390,7 +390,7 @@ rct_window * window_editor_scenario_options_open()
|
|||
|
||||
static void window_editor_scenario_options_set_pressed_tab(rct_window *w)
|
||||
{
|
||||
sint32 i;
|
||||
int32_t i;
|
||||
for (i = 0; i < WINDOW_EDITOR_SCENARIO_OPTIONS_PAGE_COUNT; i++)
|
||||
w->pressed_widgets &= ~(1 << (WIDX_TAB_1 + i));
|
||||
w->pressed_widgets |= 1LL << (WIDX_TAB_1 + w->page);
|
||||
|
@ -414,7 +414,7 @@ static void window_editor_scenario_options_anchor_border_widgets(rct_window *w)
|
|||
static void window_editor_scenario_options_draw_tab_images(rct_window *w, rct_drawpixelinfo *dpi)
|
||||
{
|
||||
rct_widget *widget;
|
||||
sint32 spriteIndex;
|
||||
int32_t spriteIndex;
|
||||
|
||||
// Tab 1
|
||||
widget = &w->widgets[WIDX_TAB_1];
|
||||
|
@ -442,7 +442,7 @@ static void window_editor_scenario_options_draw_tab_images(rct_window *w, rct_dr
|
|||
*
|
||||
* rct2: 0x00668496
|
||||
*/
|
||||
static void window_editor_scenario_options_set_page(rct_window *w, sint32 page)
|
||||
static void window_editor_scenario_options_set_page(rct_window *w, int32_t page)
|
||||
{
|
||||
if (w->page == page)
|
||||
return;
|
||||
|
@ -480,7 +480,7 @@ static void window_editor_scenario_options_financial_mouseup(rct_window *w, rct_
|
|||
break;
|
||||
case WIDX_NO_MONEY:
|
||||
{
|
||||
sint32 newMoneySetting;
|
||||
int32_t newMoneySetting;
|
||||
|
||||
if (gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR)
|
||||
{
|
||||
|
@ -710,7 +710,7 @@ static void window_editor_scenario_options_financial_invalidate(rct_window *w)
|
|||
if (((gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && (gParkFlags & PARK_FLAGS_NO_MONEY_SCENARIO)) ||
|
||||
(!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && (gParkFlags & PARK_FLAGS_NO_MONEY))) {
|
||||
w->pressed_widgets |= (1 << WIDX_NO_MONEY);
|
||||
for (sint32 i = WIDX_INITIAL_CASH; i <= WIDX_FORBID_MARKETING; i++)
|
||||
for (int32_t i = WIDX_INITIAL_CASH; i <= WIDX_FORBID_MARKETING; i++)
|
||||
w->widgets[i].type = WWT_EMPTY;
|
||||
} else {
|
||||
w->pressed_widgets &= ~(1 << WIDX_NO_MONEY);
|
||||
|
@ -745,7 +745,7 @@ static void window_editor_scenario_options_financial_invalidate(rct_window *w)
|
|||
*/
|
||||
static void window_editor_scenario_options_financial_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
||||
{
|
||||
sint32 x, y;
|
||||
int32_t x, y;
|
||||
|
||||
window_draw_widgets(w, dpi);
|
||||
window_editor_scenario_options_draw_tab_images(w, dpi);
|
||||
|
@ -788,7 +788,7 @@ static void window_editor_scenario_options_financial_paint(rct_window *w, rct_dr
|
|||
x = w->x + w->widgets[WIDX_INTEREST_RATE].left + 1;
|
||||
y = w->y + w->widgets[WIDX_INTEREST_RATE].top;
|
||||
|
||||
sint16 interestRate = Math::Clamp<sint16>(INT16_MIN, (sint16)gBankLoanInterestRate, INT16_MAX);
|
||||
int16_t interestRate = Math::Clamp<int16_t>(INT16_MIN, (int16_t)gBankLoanInterestRate, INT16_MAX);
|
||||
gfx_draw_string_left(dpi, STR_PERCENT_FORMAT_LABEL, &interestRate, COLOUR_BLACK, x, y);
|
||||
}
|
||||
}
|
||||
|
@ -1047,7 +1047,7 @@ static void window_editor_scenario_options_guests_invalidate(rct_window *w)
|
|||
*/
|
||||
static void window_editor_scenario_options_guests_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
||||
{
|
||||
sint32 x, y, arg;
|
||||
int32_t x, y, arg;
|
||||
|
||||
window_draw_widgets(w, dpi);
|
||||
window_editor_scenario_options_draw_tab_images(w, dpi);
|
||||
|
@ -1331,7 +1331,7 @@ static void window_editor_scenario_options_park_mousedown(rct_window *w, rct_wid
|
|||
*
|
||||
* rct2: 0x00671060
|
||||
*/
|
||||
static void window_editor_scenario_options_park_dropdown(rct_window *w, rct_widgetindex widgetIndex, sint32 dropdownIndex)
|
||||
static void window_editor_scenario_options_park_dropdown(rct_window *w, rct_widgetindex widgetIndex, int32_t dropdownIndex)
|
||||
{
|
||||
if (widgetIndex == WIDX_PAY_FOR_PARK_OR_RIDES_DROPDOWN && dropdownIndex != -1) {
|
||||
game_do_command(
|
||||
|
@ -1364,7 +1364,7 @@ static void window_editor_scenario_options_park_update(rct_window *w)
|
|||
*/
|
||||
static void window_editor_scenario_options_park_invalidate(rct_window *w)
|
||||
{
|
||||
uint64 pressedWidgets;
|
||||
uint64_t pressedWidgets;
|
||||
|
||||
rct_widget *widgets = window_editor_scenario_options_widgets[w->page];
|
||||
if (w->widgets != widgets) {
|
||||
|
@ -1376,7 +1376,7 @@ static void window_editor_scenario_options_park_invalidate(rct_window *w)
|
|||
|
||||
if (((gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && (gParkFlags & PARK_FLAGS_NO_MONEY_SCENARIO)) ||
|
||||
(!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && (gParkFlags & PARK_FLAGS_NO_MONEY))) {
|
||||
for (sint32 i = WIDX_LAND_COST; i <= WIDX_ENTRY_PRICE_DECREASE; i++)
|
||||
for (int32_t i = WIDX_LAND_COST; i <= WIDX_ENTRY_PRICE_DECREASE; i++)
|
||||
w->widgets[i].type = WWT_EMPTY;
|
||||
}
|
||||
else
|
||||
|
@ -1436,7 +1436,7 @@ static void window_editor_scenario_options_park_invalidate(rct_window *w)
|
|||
*/
|
||||
static void window_editor_scenario_options_park_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
||||
{
|
||||
sint32 x, y, arg;
|
||||
int32_t x, y, arg;
|
||||
rct_string_id stringId;
|
||||
|
||||
window_draw_widgets(w, dpi);
|
||||
|
|
|
@ -64,7 +64,7 @@ static rct_window_event_list window_error_events = {
|
|||
// clang-format on
|
||||
|
||||
static char _window_error_text[512];
|
||||
static uint16 _window_error_num_lines;
|
||||
static uint16_t _window_error_num_lines;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -76,7 +76,7 @@ static uint16 _window_error_num_lines;
|
|||
rct_window * window_error_open(rct_string_id title, rct_string_id message)
|
||||
{
|
||||
utf8 *dst;
|
||||
sint32 numLines, fontHeight, x, y, width, height, maxY;
|
||||
int32_t numLines, fontHeight, x, y, width, height, maxY;
|
||||
rct_window *w;
|
||||
|
||||
window_close_by_class(WC_ERROR);
|
||||
|
@ -121,8 +121,8 @@ rct_window * window_error_open(rct_string_id title, rct_string_id message)
|
|||
window_error_widgets[WIDX_BACKGROUND].right = width;
|
||||
window_error_widgets[WIDX_BACKGROUND].bottom = height;
|
||||
|
||||
sint32 screenWidth = context_get_width();
|
||||
sint32 screenHeight = context_get_height();
|
||||
int32_t screenWidth = context_get_width();
|
||||
int32_t screenHeight = context_get_height();
|
||||
const CursorState * state = context_get_cursor_state();
|
||||
x = state->x - (width / 2);
|
||||
x = Math::Clamp(0, x, screenWidth);
|
||||
|
@ -162,7 +162,7 @@ static void window_error_unknown5(rct_window *w)
|
|||
*/
|
||||
static void window_error_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
||||
{
|
||||
sint32 t, l, r, b;
|
||||
int32_t t, l, r, b;
|
||||
|
||||
l = w->x;
|
||||
t = w->y;
|
||||
|
|
|
@ -183,12 +183,12 @@ static rct_widget *_windowFinancesPageWidgets[] =
|
|||
|
||||
static void window_finances_summary_mouseup(rct_window *w, rct_widgetindex widgetIndex);
|
||||
static void window_finances_summary_mousedown(rct_window *w, rct_widgetindex widgetIndex, rct_widget* widget);
|
||||
static void window_finances_summary_scrollgetsize(rct_window *w, sint32 scrollIndex, sint32 *width, sint32 *height);
|
||||
static void window_finances_summary_scrollgetsize(rct_window *w, int32_t scrollIndex, int32_t *width, int32_t *height);
|
||||
static void window_finances_summary_invertscroll(rct_window *w);
|
||||
static void window_finances_summary_update(rct_window *w);
|
||||
static void window_finances_summary_invalidate(rct_window *w);
|
||||
static void window_finances_summary_paint(rct_window *w, rct_drawpixelinfo *dpi);
|
||||
static void window_finances_summary_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, sint32 scrollIndex);
|
||||
static void window_finances_summary_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, int32_t scrollIndex);
|
||||
|
||||
static void window_finances_financial_graph_mouseup(rct_window *w, rct_widgetindex widgetIndex);
|
||||
static void window_finances_financial_graph_update(rct_window *w);
|
||||
|
@ -212,7 +212,7 @@ static void window_finances_marketing_paint(rct_window *w, rct_drawpixelinfo *dp
|
|||
|
||||
static void window_finances_research_mouseup(rct_window *w, rct_widgetindex widgetIndex);
|
||||
static void window_finances_research_mousedown(rct_window *w, rct_widgetindex widgetIndex, rct_widget* widget);
|
||||
static void window_finances_research_dropdown(rct_window *w, rct_widgetindex widgetIndex, sint32 dropdownIndex);
|
||||
static void window_finances_research_dropdown(rct_window *w, rct_widgetindex widgetIndex, int32_t dropdownIndex);
|
||||
static void window_finances_research_update(rct_window *w);
|
||||
static void window_finances_research_invalidate(rct_window *w);
|
||||
static void window_finances_research_paint(rct_window *w, rct_drawpixelinfo *dpi);
|
||||
|
@ -438,7 +438,7 @@ static rct_window_event_list *const _windowFinancesPageEvents[] =
|
|||
(1ULL << WIDX_TAB_5) | \
|
||||
(1ULL << WIDX_TAB_6))
|
||||
|
||||
static constexpr const uint32 WindowFinancesPageEnabledWidgets[] =
|
||||
static constexpr const uint32_t WindowFinancesPageEnabledWidgets[] =
|
||||
{
|
||||
ALWAYS_ENABLED_WIDGETS |
|
||||
(1ULL << WIDX_SUMMARY_SCROLL) |
|
||||
|
@ -471,7 +471,7 @@ static constexpr const uint32 WindowFinancesPageEnabledWidgets[] =
|
|||
(1ULL << WIDX_SCENERY_AND_THEMING)
|
||||
};
|
||||
|
||||
static constexpr const uint32 WindowFinancesPageHoldDownWidgets[] =
|
||||
static constexpr const uint32_t WindowFinancesPageHoldDownWidgets[] =
|
||||
{
|
||||
(1ULL << WIDX_LOAN_INCREASE) |
|
||||
(1ULL << WIDX_LOAN_DECREASE),
|
||||
|
@ -485,14 +485,14 @@ static constexpr const uint32 WindowFinancesPageHoldDownWidgets[] =
|
|||
|
||||
#pragma endregion
|
||||
|
||||
static constexpr const sint32 WindowFinancesTabAnimationLoops[] =
|
||||
static constexpr const int32_t WindowFinancesTabAnimationLoops[] =
|
||||
{
|
||||
16, 32, 32, 32, 38, 16
|
||||
};
|
||||
|
||||
static constexpr const sint32 EXPENDITURE_COLUMN_WIDTH = 80;
|
||||
static constexpr const int32_t EXPENDITURE_COLUMN_WIDTH = 80;
|
||||
|
||||
static sint32 _lastPaintedMonth;
|
||||
static int32_t _lastPaintedMonth;
|
||||
|
||||
static constexpr const rct_string_id window_finances_summary_row_labels[RCT_EXPENDITURE_TYPE_COUNT] = {
|
||||
STR_FINANCES_SUMMARY_RIDE_CONSTRUCTION,
|
||||
|
@ -512,7 +512,7 @@ static constexpr const rct_string_id window_finances_summary_row_labels[RCT_EXPE
|
|||
};
|
||||
// clang-format on
|
||||
|
||||
static void window_finances_set_page(rct_window *w, sint32 page);
|
||||
static void window_finances_set_page(rct_window *w, int32_t page);
|
||||
static void window_finances_set_pressed_tab(rct_window *w);
|
||||
static void window_finances_draw_tab_images(rct_drawpixelinfo *dpi, rct_window *w);
|
||||
|
||||
|
@ -610,12 +610,12 @@ static void window_finances_summary_mousedown(rct_window *w, rct_widgetindex wid
|
|||
}
|
||||
}
|
||||
|
||||
static uint16 summary_num_months_available()
|
||||
static uint16_t summary_num_months_available()
|
||||
{
|
||||
return std::min<uint16>(gDateMonthsElapsed, EXPENDITURE_TABLE_MONTH_COUNT);
|
||||
return std::min<uint16_t>(gDateMonthsElapsed, EXPENDITURE_TABLE_MONTH_COUNT);
|
||||
}
|
||||
|
||||
static void window_finances_summary_scrollgetsize(rct_window *w, sint32 scrollIndex, sint32 *width, sint32 *height)
|
||||
static void window_finances_summary_scrollgetsize(rct_window *w, int32_t scrollIndex, int32_t *width, int32_t *height)
|
||||
{
|
||||
*width = EXPENDITURE_COLUMN_WIDTH * (summary_num_months_available() + 1);
|
||||
}
|
||||
|
@ -667,15 +667,15 @@ static void window_finances_summary_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
|||
window_draw_widgets(w, dpi);
|
||||
window_finances_draw_tab_images(dpi, w);
|
||||
|
||||
sint32 x = w->x + 8;
|
||||
sint32 y = w->y + 51;
|
||||
int32_t x = w->x + 8;
|
||||
int32_t y = w->y + 51;
|
||||
|
||||
// Expenditure / Income heading
|
||||
draw_string_left_underline(dpi, STR_FINANCES_SUMMARY_EXPENDITURE_INCOME, nullptr, COLOUR_BLACK, x, y);
|
||||
y += 14;
|
||||
|
||||
// Expenditure / Income row labels
|
||||
for (sint32 i = 0; i < RCT_EXPENDITURE_TYPE_COUNT; i++)
|
||||
for (int32_t i = 0; i < RCT_EXPENDITURE_TYPE_COUNT; i++)
|
||||
{
|
||||
// Darken every even row
|
||||
if (i % 2 == 0)
|
||||
|
@ -690,7 +690,7 @@ static void window_finances_summary_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
|||
|
||||
// Loan and interest rate
|
||||
gfx_draw_string_left(dpi, STR_FINANCES_SUMMARY_LOAN, nullptr, COLOUR_BLACK, w->x + 8, w->y + 279);
|
||||
set_format_arg(0, uint16, gBankLoanInterestRate);
|
||||
set_format_arg(0, uint16_t, gBankLoanInterestRate);
|
||||
gfx_draw_string_left(dpi, STR_FINANCES_SUMMARY_AT_X_PER_YEAR, gCommonFormatArgs, COLOUR_BLACK, w->x + 167, w->y + 279);
|
||||
|
||||
// Current cash
|
||||
|
@ -709,16 +709,16 @@ static void window_finances_summary_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
|||
}
|
||||
}
|
||||
|
||||
static void window_finances_summary_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, sint32 scrollIndex)
|
||||
static void window_finances_summary_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, int32_t scrollIndex)
|
||||
{
|
||||
sint32 x = 0;
|
||||
sint32 y = TABLE_CELL_HEIGHT + 2;
|
||||
int32_t x = 0;
|
||||
int32_t y = TABLE_CELL_HEIGHT + 2;
|
||||
|
||||
rct_widget self = w->widgets[WIDX_SUMMARY_SCROLL];
|
||||
sint32 row_width = std::max<uint16>(w->scrolls[0].h_right, self.right - self.left);
|
||||
int32_t row_width = std::max<uint16_t>(w->scrolls[0].h_right, self.right - self.left);
|
||||
|
||||
// Expenditure / Income row labels
|
||||
for (sint32 i = 0; i < RCT_EXPENDITURE_TYPE_COUNT; i++)
|
||||
for (int32_t i = 0; i < RCT_EXPENDITURE_TYPE_COUNT; i++)
|
||||
{
|
||||
// Darken every even row
|
||||
if (i % 2 == 0)
|
||||
|
@ -728,18 +728,18 @@ static void window_finances_summary_scrollpaint(rct_window *w, rct_drawpixelinfo
|
|||
}
|
||||
|
||||
// Expenditure / Income values for each month
|
||||
sint16 currentMonthYear = gDateMonthsElapsed;
|
||||
for (sint32 i = summary_num_months_available(); i >= 0; i--)
|
||||
int16_t currentMonthYear = gDateMonthsElapsed;
|
||||
for (int32_t i = summary_num_months_available(); i >= 0; i--)
|
||||
{
|
||||
y = 0;
|
||||
|
||||
sint16 monthyear = currentMonthYear - i;
|
||||
int16_t monthyear = currentMonthYear - i;
|
||||
if (monthyear < 0)
|
||||
continue;
|
||||
|
||||
// Month heading
|
||||
set_format_arg(0, rct_string_id, STR_FINANCES_SUMMARY_MONTH_HEADING);
|
||||
set_format_arg(2, uint16, monthyear);
|
||||
set_format_arg(2, uint16_t, monthyear);
|
||||
draw_string_right_underline(
|
||||
dpi,
|
||||
monthyear == currentMonthYear ? STR_WINDOW_COLOUR_2_STRINGID : STR_BLACK_STRING,
|
||||
|
@ -752,7 +752,7 @@ static void window_finances_summary_scrollpaint(rct_window *w, rct_drawpixelinfo
|
|||
|
||||
// Month expenditures
|
||||
money32 profit = 0;
|
||||
for (sint32 j = 0; j < RCT_EXPENDITURE_TYPE_COUNT; j++)
|
||||
for (int32_t j = 0; j < RCT_EXPENDITURE_TYPE_COUNT; j++)
|
||||
{
|
||||
money32 expenditure = gExpenditureTable[i][j];
|
||||
if (expenditure != 0)
|
||||
|
@ -836,7 +836,7 @@ static void window_finances_financial_graph_invalidate(rct_window *w)
|
|||
*/
|
||||
static void window_finances_financial_graph_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
||||
{
|
||||
sint32 i, x, y, graphLeft, graphTop, graphRight, graphBottom;
|
||||
int32_t i, x, y, graphLeft, graphTop, graphRight, graphBottom;
|
||||
|
||||
window_draw_widgets(w, dpi);
|
||||
window_finances_draw_tab_images(dpi, w);
|
||||
|
@ -864,7 +864,7 @@ static void window_finances_financial_graph_paint(rct_window *w, rct_drawpixelin
|
|||
gfx_fill_rect_inset(dpi, graphLeft, graphTop, graphRight, graphBottom, w->colours[1], INSET_RECT_F_30);
|
||||
|
||||
// Calculate the Y axis scale (log2 of highest [+/-]balance)
|
||||
sint32 yAxisScale = 0;
|
||||
int32_t yAxisScale = 0;
|
||||
for (i = 0; i < 64; i++) {
|
||||
money32 balance = gCashHistory[i];
|
||||
if (balance == MONEY32_UNDEFINED)
|
||||
|
@ -942,7 +942,7 @@ static void window_finances_park_value_graph_invalidate(rct_window *w)
|
|||
*/
|
||||
static void window_finances_park_value_graph_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
||||
{
|
||||
sint32 i, x, y, graphLeft, graphTop, graphRight, graphBottom;
|
||||
int32_t i, x, y, graphLeft, graphTop, graphRight, graphBottom;
|
||||
|
||||
window_draw_widgets(w, dpi);
|
||||
window_finances_draw_tab_images(dpi, w);
|
||||
|
@ -968,7 +968,7 @@ static void window_finances_park_value_graph_paint(rct_window *w, rct_drawpixeli
|
|||
gfx_fill_rect_inset(dpi, graphLeft, graphTop, graphRight, graphBottom, w->colours[1], INSET_RECT_F_30);
|
||||
|
||||
// Calculate the Y axis scale (log2 of highest [+/-]balance)
|
||||
sint32 yAxisScale = 0;
|
||||
int32_t yAxisScale = 0;
|
||||
for (i = 0; i < 64; i++) {
|
||||
money32 balance = gParkValueHistory[i];
|
||||
if (balance == MONEY32_UNDEFINED)
|
||||
|
@ -1046,7 +1046,7 @@ static void window_finances_profit_graph_invalidate(rct_window *w)
|
|||
*/
|
||||
static void window_finances_profit_graph_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
||||
{
|
||||
sint32 i, x, y, graphLeft, graphTop, graphRight, graphBottom;
|
||||
int32_t i, x, y, graphLeft, graphTop, graphRight, graphBottom;
|
||||
|
||||
window_draw_widgets(w, dpi);
|
||||
window_finances_draw_tab_images(dpi, w);
|
||||
|
@ -1072,7 +1072,7 @@ static void window_finances_profit_graph_paint(rct_window *w, rct_drawpixelinfo
|
|||
gfx_fill_rect_inset(dpi, graphLeft, graphTop, graphRight, graphBottom, w->colours[1], INSET_RECT_F_30);
|
||||
|
||||
// Calculate the Y axis scale (log2 of highest [+/-]balance)
|
||||
sint32 yAxisScale = 0;
|
||||
int32_t yAxisScale = 0;
|
||||
for (i = 0; i < 64; i++) {
|
||||
money32 balance = gWeeklyProfitHistory[i];
|
||||
if (balance == MONEY32_UNDEFINED)
|
||||
|
@ -1139,7 +1139,7 @@ static void window_finances_marketing_update(rct_window *w)
|
|||
*/
|
||||
static void window_finances_marketing_invalidate(rct_window *w)
|
||||
{
|
||||
sint32 i;
|
||||
int32_t i;
|
||||
|
||||
if (w->widgets != _windowFinancesPageWidgets[WINDOW_FINANCES_PAGE_MARKETING]) {
|
||||
w->widgets = _windowFinancesPageWidgets[WINDOW_FINANCES_PAGE_MARKETING];
|
||||
|
@ -1149,12 +1149,12 @@ static void window_finances_marketing_invalidate(rct_window *w)
|
|||
window_finances_set_pressed_tab(w);
|
||||
|
||||
// Count number of active campaigns
|
||||
sint32 numActiveCampaigns = 0;
|
||||
int32_t numActiveCampaigns = 0;
|
||||
for (i = 0; i < ADVERTISING_CAMPAIGN_COUNT; i++)
|
||||
if (gMarketingCampaignDaysLeft[i] != 0)
|
||||
numActiveCampaigns++;
|
||||
|
||||
sint32 y = std::max(1, numActiveCampaigns) * LIST_ROW_HEIGHT + 92;
|
||||
int32_t y = std::max(1, numActiveCampaigns) * LIST_ROW_HEIGHT + 92;
|
||||
|
||||
// Update group box positions
|
||||
_windowFinancesMarketingWidgets[WIDX_ACTIVE_CAMPAIGNS_GROUP].bottom = y - 22;
|
||||
|
@ -1186,7 +1186,7 @@ static void window_finances_marketing_invalidate(rct_window *w)
|
|||
*/
|
||||
static void window_finances_marketing_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
||||
{
|
||||
sint32 i, x, y, weeksRemaining;
|
||||
int32_t i, x, y, weeksRemaining;
|
||||
Ride *ride;
|
||||
|
||||
window_draw_widgets(w, dpi);
|
||||
|
@ -1195,14 +1195,14 @@ static void window_finances_marketing_paint(rct_window *w, rct_drawpixelinfo *dp
|
|||
x = w->x + 8;
|
||||
y = w->y + 62;
|
||||
|
||||
sint32 noCampaignsActive = 1;
|
||||
int32_t noCampaignsActive = 1;
|
||||
for (i = 0; i < ADVERTISING_CAMPAIGN_COUNT; i++) {
|
||||
if (gMarketingCampaignDaysLeft[i] == 0)
|
||||
continue;
|
||||
|
||||
noCampaignsActive = 0;
|
||||
set_format_arg(0, rct_string_id, gParkName);
|
||||
set_format_arg(2, uint32, gParkNameArgs);
|
||||
set_format_arg(2, uint32_t, gParkNameArgs);
|
||||
|
||||
// Set special parameters
|
||||
switch (i) {
|
||||
|
@ -1210,7 +1210,7 @@ static void window_finances_marketing_paint(rct_window *w, rct_drawpixelinfo *dp
|
|||
case ADVERTISING_CAMPAIGN_RIDE:
|
||||
ride = get_ride(gMarketingCampaignRideIndex[i]);
|
||||
set_format_arg(0, rct_string_id, ride->name);
|
||||
set_format_arg(2, uint32, ride->name_arguments);
|
||||
set_format_arg(2, uint32_t, ride->name_arguments);
|
||||
break;
|
||||
case ADVERTISING_CAMPAIGN_FOOD_OR_DRINK_FREE:
|
||||
set_format_arg(0, rct_string_id, ShopItemStringIds[gMarketingCampaignRideIndex[i]].plural);
|
||||
|
@ -1297,7 +1297,7 @@ static void window_finances_research_mouseup(rct_window *w, rct_widgetindex widg
|
|||
static void window_finances_research_mousedown(rct_window *w, rct_widgetindex widgetIndex, rct_widget* widget)
|
||||
{
|
||||
rct_widget *dropdownWidget;
|
||||
sint32 i;
|
||||
int32_t i;
|
||||
|
||||
if (widgetIndex != WIDX_RESEARCH_FUNDING_DROPDOWN_BUTTON)
|
||||
return;
|
||||
|
@ -1319,7 +1319,7 @@ static void window_finances_research_mousedown(rct_window *w, rct_widgetindex wi
|
|||
dropdownWidget->right - dropdownWidget->left - 3
|
||||
);
|
||||
|
||||
sint32 currentResearchLevel = gResearchFundingLevel;
|
||||
int32_t currentResearchLevel = gResearchFundingLevel;
|
||||
dropdown_set_checked(currentResearchLevel, true);
|
||||
}
|
||||
|
||||
|
@ -1327,7 +1327,7 @@ static void window_finances_research_mousedown(rct_window *w, rct_widgetindex wi
|
|||
*
|
||||
* rct2: 0x0069DB6D
|
||||
*/
|
||||
static void window_finances_research_dropdown(rct_window *w, rct_widgetindex widgetIndex, sint32 dropdownIndex)
|
||||
static void window_finances_research_dropdown(rct_window *w, rct_widgetindex widgetIndex, int32_t dropdownIndex)
|
||||
{
|
||||
if (widgetIndex != WIDX_RESEARCH_FUNDING_DROPDOWN_BUTTON || dropdownIndex == -1)
|
||||
return;
|
||||
|
@ -1364,17 +1364,17 @@ static void window_finances_research_invalidate(rct_window *w)
|
|||
_windowFinancesResearchWidgets[WIDX_RESEARCH_FUNDING].type = WWT_EMPTY;
|
||||
_windowFinancesResearchWidgets[WIDX_RESEARCH_FUNDING_DROPDOWN_BUTTON].type = WWT_EMPTY;
|
||||
}
|
||||
sint32 currentResearchLevel = gResearchFundingLevel;
|
||||
int32_t currentResearchLevel = gResearchFundingLevel;
|
||||
|
||||
// Current funding
|
||||
_windowFinancesResearchWidgets[WIDX_RESEARCH_FUNDING].text = ResearchFundingLevelNames[currentResearchLevel];
|
||||
|
||||
// Checkboxes
|
||||
uint8 activeResearchTypes = gResearchPriorities;
|
||||
sint32 uncompletedResearchTypes = gResearchUncompletedCategories;
|
||||
for (sint32 i = 0; i < 7; i++) {
|
||||
sint32 mask = 1 << i;
|
||||
sint32 widgetMask = 1ULL << (i + WIDX_TRANSPORT_RIDES);
|
||||
uint8_t activeResearchTypes = gResearchPriorities;
|
||||
int32_t uncompletedResearchTypes = gResearchUncompletedCategories;
|
||||
for (int32_t i = 0; i < 7; i++) {
|
||||
int32_t mask = 1 << i;
|
||||
int32_t widgetMask = 1ULL << (i + WIDX_TRANSPORT_RIDES);
|
||||
|
||||
// Set checkbox disabled if research type is complete
|
||||
if (uncompletedResearchTypes & mask) {
|
||||
|
@ -1412,7 +1412,7 @@ static void window_finances_research_paint(rct_window *w, rct_drawpixelinfo *dpi
|
|||
*
|
||||
* rct2: 0x0069CAC5
|
||||
*/
|
||||
static void window_finances_set_page(rct_window *w, sint32 page)
|
||||
static void window_finances_set_page(rct_window *w, int32_t page)
|
||||
{
|
||||
w->page = page;
|
||||
w->frame_no = 0;
|
||||
|
@ -1452,19 +1452,19 @@ static void window_finances_set_page(rct_window *w, sint32 page)
|
|||
|
||||
static void window_finances_set_pressed_tab(rct_window *w)
|
||||
{
|
||||
sint32 i;
|
||||
int32_t i;
|
||||
for (i = 0; i < WINDOW_FINANCES_PAGE_COUNT; i++)
|
||||
w->pressed_widgets &= ~(1ULL << (WIDX_TAB_1 + i));
|
||||
w->pressed_widgets |= 1LL << (WIDX_TAB_1 + w->page);
|
||||
}
|
||||
|
||||
static void window_finances_draw_tab_image(rct_drawpixelinfo *dpi, rct_window *w, sint32 page, sint32 spriteIndex)
|
||||
static void window_finances_draw_tab_image(rct_drawpixelinfo *dpi, rct_window *w, int32_t page, int32_t spriteIndex)
|
||||
{
|
||||
rct_widgetindex widgetIndex = WIDX_TAB_1 + page;
|
||||
|
||||
if (!(w->disabled_widgets & (1LL << widgetIndex))) {
|
||||
if (w->page == page) {
|
||||
sint32 frame = w->frame_no / 2;
|
||||
int32_t frame = w->frame_no / 2;
|
||||
if (page == WINDOW_FINANCES_PAGE_SUMMARY)
|
||||
frame %= 8;
|
||||
spriteIndex += frame;
|
||||
|
|
|
@ -100,12 +100,12 @@ static rct_widget window_footpath_widgets[] = {
|
|||
static void window_footpath_close(rct_window * w);
|
||||
static void window_footpath_mouseup(rct_window * w, rct_widgetindex widgetIndex);
|
||||
static void window_footpath_mousedown(rct_window * w, rct_widgetindex widgetIndex, rct_widget * widget);
|
||||
static void window_footpath_dropdown(rct_window * w, rct_widgetindex widgetIndex, sint32 dropdownIndex);
|
||||
static void window_footpath_dropdown(rct_window * w, rct_widgetindex widgetIndex, int32_t dropdownIndex);
|
||||
static void window_footpath_update(rct_window * w);
|
||||
static void window_footpath_toolupdate(rct_window * w, rct_widgetindex widgetIndex, sint32 x, sint32 y);
|
||||
static void window_footpath_tooldown(rct_window * w, rct_widgetindex widgetIndex, sint32 x, sint32 y);
|
||||
static void window_footpath_tooldrag(rct_window * w, rct_widgetindex widgetIndex, sint32 x, sint32 y);
|
||||
static void window_footpath_toolup(rct_window * w, rct_widgetindex widgetIndex, sint32 x, sint32 y);
|
||||
static void window_footpath_toolupdate(rct_window * w, rct_widgetindex widgetIndex, int32_t x, int32_t y);
|
||||
static void window_footpath_tooldown(rct_window * w, rct_widgetindex widgetIndex, int32_t x, int32_t y);
|
||||
static void window_footpath_tooldrag(rct_window * w, rct_widgetindex widgetIndex, int32_t x, int32_t y);
|
||||
static void window_footpath_toolup(rct_window * w, rct_widgetindex widgetIndex, int32_t x, int32_t y);
|
||||
static void window_footpath_invalidate(rct_window * w);
|
||||
static void window_footpath_paint(rct_window * w, rct_drawpixelinfo * dpi);
|
||||
|
||||
|
@ -142,12 +142,12 @@ static rct_window_event_list window_footpath_events = {
|
|||
// clang-format on
|
||||
|
||||
static money32 _window_footpath_cost;
|
||||
static sint8 _window_footpath_provisional_path_arrow_timer;
|
||||
static uint8 _lastUpdatedCameraRotation = UINT8_MAX;
|
||||
static int8_t _window_footpath_provisional_path_arrow_timer;
|
||||
static uint8_t _lastUpdatedCameraRotation = UINT8_MAX;
|
||||
static bool _footpathErrorOccured;
|
||||
|
||||
/** rct2: 0x0098D8B4 */
|
||||
static constexpr const uint8 DefaultPathSlope[] = {
|
||||
static constexpr const uint8_t DefaultPathSlope[] = {
|
||||
0,
|
||||
SLOPE_IS_IRREGULAR_FLAG,
|
||||
SLOPE_IS_IRREGULAR_FLAG,
|
||||
|
@ -167,23 +167,23 @@ static constexpr const uint8 DefaultPathSlope[] = {
|
|||
};
|
||||
|
||||
/** rct2: 0x0098D7E0 */
|
||||
static constexpr const uint8 ConstructionPreviewImages[][4] = {
|
||||
static constexpr const uint8_t ConstructionPreviewImages[][4] = {
|
||||
{5, 10, 5, 10}, // Flat
|
||||
{16, 17, 18, 19}, // Upwards
|
||||
{18, 19, 16, 17}, // Downwards
|
||||
};
|
||||
|
||||
static void window_footpath_mousedown_direction(sint32 direction);
|
||||
static void window_footpath_mousedown_slope(sint32 slope);
|
||||
static void window_footpath_mousedown_direction(int32_t direction);
|
||||
static void window_footpath_mousedown_slope(int32_t slope);
|
||||
static void window_footpath_show_footpath_types_dialog(rct_window * w, rct_widget * widget, bool showQueues);
|
||||
static void window_footpath_set_provisional_path_at_point(sint32 x, sint32 y);
|
||||
static void window_footpath_set_selection_start_bridge_at_point(sint32 screenX, sint32 screenY);
|
||||
static void window_footpath_place_path_at_point(sint32 x, sint32 y);
|
||||
static void window_footpath_start_bridge_at_point(sint32 screenX, sint32 screenY);
|
||||
static void window_footpath_set_provisional_path_at_point(int32_t x, int32_t y);
|
||||
static void window_footpath_set_selection_start_bridge_at_point(int32_t screenX, int32_t screenY);
|
||||
static void window_footpath_place_path_at_point(int32_t x, int32_t y);
|
||||
static void window_footpath_start_bridge_at_point(int32_t screenX, int32_t screenY);
|
||||
static void window_footpath_construct();
|
||||
static void window_footpath_remove();
|
||||
static void window_footpath_set_enabled_and_pressed_widgets();
|
||||
static void footpath_get_next_path_info(sint32 * type, sint32 * x, sint32 * y, sint32 * z, sint32 * slope);
|
||||
static void footpath_get_next_path_info(int32_t * type, int32_t * x, int32_t * y, int32_t * z, int32_t * slope);
|
||||
static bool footpath_select_default();
|
||||
|
||||
/**
|
||||
|
@ -367,7 +367,7 @@ static void window_footpath_mousedown(rct_window * w, rct_widgetindex widgetInde
|
|||
*
|
||||
* rct2: 0x006A7F18
|
||||
*/
|
||||
static void window_footpath_dropdown(rct_window * w, rct_widgetindex widgetIndex, sint32 dropdownIndex)
|
||||
static void window_footpath_dropdown(rct_window * w, rct_widgetindex widgetIndex, int32_t dropdownIndex)
|
||||
{
|
||||
if (widgetIndex == WIDX_FOOTPATH_TYPE)
|
||||
{
|
||||
|
@ -383,7 +383,7 @@ static void window_footpath_dropdown(rct_window * w, rct_widgetindex widgetIndex
|
|||
}
|
||||
|
||||
// Get path id
|
||||
sint32 pathId = dropdownIndex;
|
||||
int32_t pathId = dropdownIndex;
|
||||
if (pathId == -1)
|
||||
{
|
||||
pathId = gFootpathSelectedId;
|
||||
|
@ -392,7 +392,7 @@ static void window_footpath_dropdown(rct_window * w, rct_widgetindex widgetIndex
|
|||
{
|
||||
bool showEditorPaths = ((gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || gCheatsSandboxMode);
|
||||
|
||||
sint32 i = 0, j = 0;
|
||||
int32_t i = 0, j = 0;
|
||||
for (; i < MAX_PATH_OBJECTS; i++)
|
||||
{
|
||||
rct_footpath_entry * pathType = get_footpath_entry(i);
|
||||
|
@ -425,7 +425,7 @@ static void window_footpath_dropdown(rct_window * w, rct_widgetindex widgetIndex
|
|||
*
|
||||
* rct2: 0x006A8032
|
||||
*/
|
||||
static void window_footpath_toolupdate(rct_window * w, rct_widgetindex widgetIndex, sint32 x, sint32 y)
|
||||
static void window_footpath_toolupdate(rct_window * w, rct_widgetindex widgetIndex, int32_t x, int32_t y)
|
||||
{
|
||||
if (widgetIndex == WIDX_CONSTRUCT_ON_LAND)
|
||||
{
|
||||
|
@ -441,7 +441,7 @@ static void window_footpath_toolupdate(rct_window * w, rct_widgetindex widgetInd
|
|||
*
|
||||
* rct2: 0x006A8047
|
||||
*/
|
||||
static void window_footpath_tooldown(rct_window * w, rct_widgetindex widgetIndex, sint32 x, sint32 y)
|
||||
static void window_footpath_tooldown(rct_window * w, rct_widgetindex widgetIndex, int32_t x, int32_t y)
|
||||
{
|
||||
if (widgetIndex == WIDX_CONSTRUCT_ON_LAND)
|
||||
{
|
||||
|
@ -457,7 +457,7 @@ static void window_footpath_tooldown(rct_window * w, rct_widgetindex widgetIndex
|
|||
*
|
||||
* rct2: 0x006A8067
|
||||
*/
|
||||
static void window_footpath_tooldrag(rct_window * w, rct_widgetindex widgetIndex, sint32 x, sint32 y)
|
||||
static void window_footpath_tooldrag(rct_window * w, rct_widgetindex widgetIndex, int32_t x, int32_t y)
|
||||
{
|
||||
if (widgetIndex == WIDX_CONSTRUCT_ON_LAND)
|
||||
{
|
||||
|
@ -469,7 +469,7 @@ static void window_footpath_tooldrag(rct_window * w, rct_widgetindex widgetIndex
|
|||
*
|
||||
* rct2: 0x006A8066
|
||||
*/
|
||||
static void window_footpath_toolup(rct_window * w, rct_widgetindex widgetIndex, sint32 x, sint32 y)
|
||||
static void window_footpath_toolup(rct_window * w, rct_widgetindex widgetIndex, int32_t x, int32_t y)
|
||||
{
|
||||
if (widgetIndex == WIDX_CONSTRUCT_ON_LAND)
|
||||
{
|
||||
|
@ -483,7 +483,7 @@ static void window_footpath_toolup(rct_window * w, rct_widgetindex widgetIndex,
|
|||
*/
|
||||
static void window_footpath_update_provisional_path_for_bridge_mode(rct_window * w)
|
||||
{
|
||||
sint32 type, x, y, z, slope;
|
||||
int32_t type, x, y, z, slope;
|
||||
|
||||
if (gFootpathConstructionMode != PATH_CONSTRUCTION_MODE_BRIDGE_OR_TUNNEL)
|
||||
{
|
||||
|
@ -537,7 +537,7 @@ static void window_footpath_update(rct_window * w)
|
|||
window_footpath_update_provisional_path_for_bridge_mode(w);
|
||||
|
||||
// #2502: The camera might have changed rotation, so we need to update which directional buttons are pressed
|
||||
uint8 currentRotation = get_current_rotation();
|
||||
uint8_t currentRotation = get_current_rotation();
|
||||
if (_lastUpdatedCameraRotation != currentRotation)
|
||||
{
|
||||
_lastUpdatedCameraRotation = currentRotation;
|
||||
|
@ -583,7 +583,7 @@ static void window_footpath_update(rct_window * w)
|
|||
*/
|
||||
static void window_footpath_invalidate(rct_window * w)
|
||||
{
|
||||
sint32 selectedPath;
|
||||
int32_t selectedPath;
|
||||
rct_footpath_entry * pathType;
|
||||
|
||||
// Press / unpress footpath and queue type buttons
|
||||
|
@ -603,9 +603,9 @@ static void window_footpath_invalidate(rct_window * w)
|
|||
pathType = get_footpath_entry(selectedPath);
|
||||
|
||||
// TODO: Should probably add constants for object sprites
|
||||
sint32 pathImage = 71 + pathType->image;
|
||||
int32_t pathImage = 71 + pathType->image;
|
||||
// Editor-only paths might lack a queue image
|
||||
sint32 queueImage = (pathType->flags & FOOTPATH_ENTRY_FLAG_SHOW_ONLY_IN_SCENARIO_EDITOR) ? pathImage : pathImage + 1;
|
||||
int32_t queueImage = (pathType->flags & FOOTPATH_ENTRY_FLAG_SHOW_ONLY_IN_SCENARIO_EDITOR) ? pathImage : pathImage + 1;
|
||||
window_footpath_widgets[WIDX_FOOTPATH_TYPE].image = pathImage;
|
||||
window_footpath_widgets[WIDX_QUEUELINE_TYPE].image = queueImage;
|
||||
}
|
||||
|
@ -621,8 +621,8 @@ static void window_footpath_paint(rct_window * w, rct_drawpixelinfo * dpi)
|
|||
if (!(w->disabled_widgets & (1 << WIDX_CONSTRUCT)))
|
||||
{
|
||||
// Get construction image
|
||||
uint8 direction = (gFootpathConstructDirection + get_current_rotation()) % 4;
|
||||
uint8 slope = 0;
|
||||
uint8_t direction = (gFootpathConstructDirection + get_current_rotation()) % 4;
|
||||
uint8_t slope = 0;
|
||||
if (gFootpathConstructSlope == 2)
|
||||
{
|
||||
slope = TILE_ELEMENT_SLOPE_N_CORNER_UP;
|
||||
|
@ -631,9 +631,9 @@ static void window_footpath_paint(rct_window * w, rct_drawpixelinfo * dpi)
|
|||
{
|
||||
slope = TILE_ELEMENT_SLOPE_E_CORNER_UP;
|
||||
}
|
||||
sint32 image = ConstructionPreviewImages[slope][direction];
|
||||
int32_t image = ConstructionPreviewImages[slope][direction];
|
||||
|
||||
sint32 selectedPath = gFootpathSelectedId;
|
||||
int32_t selectedPath = gFootpathSelectedId;
|
||||
rct_footpath_entry * pathType = get_footpath_entry(selectedPath);
|
||||
image += pathType->image;
|
||||
if (gFootpathSelectedType != SELECTED_PATH_TYPE_NORMAL)
|
||||
|
@ -642,9 +642,9 @@ static void window_footpath_paint(rct_window * w, rct_drawpixelinfo * dpi)
|
|||
}
|
||||
|
||||
// Draw construction image
|
||||
sint32 x = w->x +
|
||||
int32_t x = w->x +
|
||||
(window_footpath_widgets[WIDX_CONSTRUCT].left + window_footpath_widgets[WIDX_CONSTRUCT].right) / 2;
|
||||
sint32 y = w->y + window_footpath_widgets[WIDX_CONSTRUCT].bottom - 60;
|
||||
int32_t y = w->y + window_footpath_widgets[WIDX_CONSTRUCT].bottom - 60;
|
||||
gfx_draw_sprite(dpi, image, x, y, 0);
|
||||
|
||||
// Draw build this... label
|
||||
|
@ -654,9 +654,9 @@ static void window_footpath_paint(rct_window * w, rct_drawpixelinfo * dpi)
|
|||
}
|
||||
|
||||
// Draw cost
|
||||
sint32 x = w->x +
|
||||
int32_t x = w->x +
|
||||
(window_footpath_widgets[WIDX_CONSTRUCT].left + window_footpath_widgets[WIDX_CONSTRUCT].right) / 2;
|
||||
sint32 y = w->y + window_footpath_widgets[WIDX_CONSTRUCT].bottom - 12;
|
||||
int32_t y = w->y + window_footpath_widgets[WIDX_CONSTRUCT].bottom - 12;
|
||||
if (_window_footpath_cost != MONEY32_UNDEFINED)
|
||||
{
|
||||
if (!(gParkFlags & PARK_FLAGS_NO_MONEY))
|
||||
|
@ -672,7 +672,7 @@ static void window_footpath_paint(rct_window * w, rct_drawpixelinfo * dpi)
|
|||
*/
|
||||
static void window_footpath_show_footpath_types_dialog(rct_window * w, rct_widget * widget, bool showQueues)
|
||||
{
|
||||
sint32 i, numPathTypes, image;
|
||||
int32_t i, numPathTypes, image;
|
||||
rct_footpath_entry * pathType;
|
||||
|
||||
numPathTypes = 0;
|
||||
|
@ -718,7 +718,7 @@ static void window_footpath_show_footpath_types_dialog(rct_window * w, rct_widge
|
|||
*
|
||||
* rct2: 0x006A8111 0x006A8135 0x006A815C 0x006A8183
|
||||
*/
|
||||
static void window_footpath_mousedown_direction(sint32 direction)
|
||||
static void window_footpath_mousedown_direction(int32_t direction)
|
||||
{
|
||||
footpath_provisional_update();
|
||||
gFootpathConstructDirection = (direction - get_current_rotation()) & 3;
|
||||
|
@ -730,7 +730,7 @@ static void window_footpath_mousedown_direction(sint32 direction)
|
|||
*
|
||||
* rct2: 0x006A81AA 0x006A81C5 0x006A81E0
|
||||
*/
|
||||
static void window_footpath_mousedown_slope(sint32 slope)
|
||||
static void window_footpath_mousedown_slope(int32_t slope)
|
||||
{
|
||||
footpath_provisional_update();
|
||||
gFootpathConstructSlope = slope;
|
||||
|
@ -742,12 +742,12 @@ static void window_footpath_mousedown_slope(sint32 slope)
|
|||
*
|
||||
* rct2: 0x006A81FB
|
||||
*/
|
||||
static void window_footpath_set_provisional_path_at_point(sint32 x, sint32 y)
|
||||
static void window_footpath_set_provisional_path_at_point(int32_t x, int32_t y)
|
||||
{
|
||||
map_invalidate_selection_rect();
|
||||
gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW;
|
||||
|
||||
sint32 interactionType;
|
||||
int32_t interactionType;
|
||||
rct_tile_element * tileElement;
|
||||
LocationXY16 mapCoord = {};
|
||||
get_map_coordinates_from_pos(x, y, VIEWPORT_INTERACTION_MASK_FOOTPATH & VIEWPORT_INTERACTION_MASK_TERRAIN,
|
||||
|
@ -784,7 +784,7 @@ static void window_footpath_set_provisional_path_at_point(sint32 x, sint32 y)
|
|||
footpath_provisional_update();
|
||||
|
||||
// Set provisional path
|
||||
sint32 slope = 0;
|
||||
int32_t slope = 0;
|
||||
switch (interactionType)
|
||||
{
|
||||
case VIEWPORT_INTERACTION_ITEM_TERRAIN:
|
||||
|
@ -794,7 +794,7 @@ static void window_footpath_set_provisional_path_at_point(sint32 x, sint32 y)
|
|||
slope = tileElement->properties.path.type & (FOOTPATH_PROPERTIES_FLAG_IS_SLOPED | FOOTPATH_PROPERTIES_SLOPE_DIRECTION_MASK);
|
||||
break;
|
||||
}
|
||||
sint32 pathType = (gFootpathSelectedType << 7) + (gFootpathSelectedId & 0xFF);
|
||||
int32_t pathType = (gFootpathSelectedType << 7) + (gFootpathSelectedId & 0xFF);
|
||||
|
||||
_window_footpath_cost = footpath_provisional_set(pathType, x, y, tileElement->base_height, slope);
|
||||
window_invalidate_by_class(WC_FOOTPATH);
|
||||
|
@ -805,9 +805,9 @@ static void window_footpath_set_provisional_path_at_point(sint32 x, sint32 y)
|
|||
*
|
||||
* rct2: 0x006A8388
|
||||
*/
|
||||
static void window_footpath_set_selection_start_bridge_at_point(sint32 screenX, sint32 screenY)
|
||||
static void window_footpath_set_selection_start_bridge_at_point(int32_t screenX, int32_t screenY)
|
||||
{
|
||||
sint32 x, y, direction;
|
||||
int32_t x, y, direction;
|
||||
rct_tile_element * tileElement;
|
||||
|
||||
map_invalidate_selection_rect();
|
||||
|
@ -832,11 +832,11 @@ static void window_footpath_set_selection_start_bridge_at_point(sint32 screenX,
|
|||
gMapSelectArrowPosition.x = x;
|
||||
gMapSelectArrowPosition.y = y;
|
||||
|
||||
sint32 z = tileElement->base_height;
|
||||
int32_t z = tileElement->base_height;
|
||||
|
||||
if (tileElement->GetType() == TILE_ELEMENT_TYPE_SURFACE)
|
||||
{
|
||||
uint8 slope = tileElement->properties.surface.slope;
|
||||
uint8_t slope = tileElement->properties.surface.slope;
|
||||
if (slope & TILE_ELEMENT_SLOPE_ALL_CORNERS_UP)
|
||||
{
|
||||
z += 2;
|
||||
|
@ -854,9 +854,9 @@ static void window_footpath_set_selection_start_bridge_at_point(sint32 screenX,
|
|||
*
|
||||
* rct2: 0x006A82C5
|
||||
*/
|
||||
static void window_footpath_place_path_at_point(sint32 x, sint32 y)
|
||||
static void window_footpath_place_path_at_point(int32_t x, int32_t y)
|
||||
{
|
||||
sint32 interactionType, presentType, selectedType, z, cost;
|
||||
int32_t interactionType, presentType, selectedType, z, cost;
|
||||
rct_tile_element * tileElement;
|
||||
|
||||
if (_footpathErrorOccured)
|
||||
|
@ -912,9 +912,9 @@ static void window_footpath_place_path_at_point(sint32 x, sint32 y)
|
|||
*
|
||||
* rct2: 0x006A840F
|
||||
*/
|
||||
static void window_footpath_start_bridge_at_point(sint32 screenX, sint32 screenY)
|
||||
static void window_footpath_start_bridge_at_point(int32_t screenX, int32_t screenY)
|
||||
{
|
||||
sint32 x, y, z, direction;
|
||||
int32_t x, y, z, direction;
|
||||
rct_tile_element * tileElement;
|
||||
|
||||
footpath_bridge_get_info_from_pos(screenX, screenY, &x, &y, &direction, &tileElement);
|
||||
|
@ -927,7 +927,7 @@ static void window_footpath_start_bridge_at_point(sint32 screenX, sint32 screenY
|
|||
{
|
||||
// If we start the path on a slope, the arrow is slightly raised, so we
|
||||
// expect the path to be slightly raised as well.
|
||||
uint8 slope = tileElement->properties.surface.slope;
|
||||
uint8_t slope = tileElement->properties.surface.slope;
|
||||
z = tileElement->base_height;
|
||||
if (slope & TILE_ELEMENT_SLOPE_DOUBLE_HEIGHT)
|
||||
{
|
||||
|
@ -977,7 +977,7 @@ static void window_footpath_construct()
|
|||
_window_footpath_cost = MONEY32_UNDEFINED;
|
||||
footpath_provisional_update();
|
||||
|
||||
sint32 type, x, y, z, slope;
|
||||
int32_t type, x, y, z, slope;
|
||||
footpath_get_next_path_info(&type, &x, &y, &z, &slope);
|
||||
|
||||
gGameCommandErrorTitle = STR_CANT_BUILD_FOOTPATH_HERE;
|
||||
|
@ -1029,10 +1029,10 @@ static void window_footpath_construct()
|
|||
*/
|
||||
static void footpath_remove_tile_element(rct_tile_element * tileElement)
|
||||
{
|
||||
sint32 x, y, z;
|
||||
int32_t x, y, z;
|
||||
|
||||
z = tileElement->base_height;
|
||||
sint32 pathType = tileElement->properties.path.type;
|
||||
int32_t pathType = tileElement->properties.path.type;
|
||||
if (pathType & 4)
|
||||
{
|
||||
pathType &= 3;
|
||||
|
@ -1044,7 +1044,7 @@ static void footpath_remove_tile_element(rct_tile_element * tileElement)
|
|||
}
|
||||
|
||||
// Find a connected edge
|
||||
sint32 edge = gFootpathConstructDirection ^2;
|
||||
int32_t edge = gFootpathConstructDirection ^2;
|
||||
if (!(tileElement->properties.path.edges & (1 << edge)))
|
||||
{
|
||||
edge = (edge + 1) & 3;
|
||||
|
@ -1089,7 +1089,7 @@ static void footpath_remove_tile_element(rct_tile_element * tileElement)
|
|||
static rct_tile_element * footpath_get_tile_element_to_remove()
|
||||
{
|
||||
rct_tile_element * tileElement;
|
||||
sint32 x, y, z, zLow;
|
||||
int32_t x, y, z, zLow;
|
||||
|
||||
x = gFootpathConstructFromPosition.x / 32;
|
||||
y = gFootpathConstructFromPosition.y / 32;
|
||||
|
@ -1175,14 +1175,14 @@ static void window_footpath_set_enabled_and_pressed_widgets()
|
|||
gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE_CONSTRUCT;
|
||||
gMapSelectFlags |= MAP_SELECT_FLAG_GREEN;
|
||||
|
||||
sint32 direction = gFootpathConstructDirection;
|
||||
int32_t direction = gFootpathConstructDirection;
|
||||
gMapSelectionTiles[0].x = gFootpathConstructFromPosition.x + CoordsDirectionDelta[direction].x;
|
||||
gMapSelectionTiles[0].y = gFootpathConstructFromPosition.y + CoordsDirectionDelta[direction].y;
|
||||
gMapSelectionTiles[1].x = -1;
|
||||
map_invalidate_map_selection_tiles();
|
||||
}
|
||||
|
||||
uint64 pressedWidgets = w->pressed_widgets & ~(
|
||||
uint64_t pressedWidgets = w->pressed_widgets & ~(
|
||||
(1LL << WIDX_DIRECTION_NW) |
|
||||
(1LL << WIDX_DIRECTION_NE) |
|
||||
(1LL << WIDX_DIRECTION_SW) |
|
||||
|
@ -1191,16 +1191,16 @@ static void window_footpath_set_enabled_and_pressed_widgets()
|
|||
(1LL << WIDX_LEVEL) |
|
||||
(1LL << WIDX_SLOPEUP)
|
||||
);
|
||||
uint64 disabledWidgets = 0;
|
||||
sint32 currentRotation = get_current_rotation();
|
||||
uint64_t disabledWidgets = 0;
|
||||
int32_t currentRotation = get_current_rotation();
|
||||
if (gFootpathConstructionMode >= PATH_CONSTRUCTION_MODE_BRIDGE_OR_TUNNEL)
|
||||
{
|
||||
// Set pressed directional widget
|
||||
sint32 direction = (gFootpathConstructDirection + currentRotation) & 3;
|
||||
int32_t direction = (gFootpathConstructDirection + currentRotation) & 3;
|
||||
pressedWidgets |= (1LL << (WIDX_DIRECTION_NW + direction));
|
||||
|
||||
// Set pressed slope widget
|
||||
sint32 slope = gFootpathConstructSlope;
|
||||
int32_t slope = gFootpathConstructSlope;
|
||||
if (slope == TILE_ELEMENT_SLOPE_SE_SIDE_UP)
|
||||
{
|
||||
pressedWidgets |= (1 << WIDX_SLOPEDOWN);
|
||||
|
@ -1254,9 +1254,9 @@ static void window_footpath_set_enabled_and_pressed_widgets()
|
|||
*
|
||||
* rct2: 0x006A7B20
|
||||
*/
|
||||
static void footpath_get_next_path_info(sint32 * type, sint32 * x, sint32 * y, sint32 * z, sint32 * slope)
|
||||
static void footpath_get_next_path_info(int32_t * type, int32_t * x, int32_t * y, int32_t * z, int32_t * slope)
|
||||
{
|
||||
sint32 direction;
|
||||
int32_t direction;
|
||||
|
||||
direction = gFootpathConstructDirection;
|
||||
*x = gFootpathConstructFromPosition.x + CoordsDirectionDelta[direction].x;
|
||||
|
@ -1278,8 +1278,8 @@ static void footpath_get_next_path_info(sint32 * type, sint32 * x, sint32 * y, s
|
|||
static bool footpath_select_default()
|
||||
{
|
||||
// Select first available footpath
|
||||
sint32 footpathId = -1;
|
||||
for (sint32 i = 0; i < object_entry_group_counts[OBJECT_TYPE_PATHS]; i++)
|
||||
int32_t footpathId = -1;
|
||||
for (int32_t i = 0; i < object_entry_group_counts[OBJECT_TYPE_PATHS]; i++)
|
||||
{
|
||||
rct_footpath_entry * pathEntry = get_footpath_entry(i);
|
||||
if (pathEntry != nullptr)
|
||||
|
|
|
@ -65,18 +65,18 @@ static rct_widget window_game_bottom_toolbar_widgets[] =
|
|||
{ WIDGETS_END },
|
||||
};
|
||||
|
||||
uint8 gToolbarDirtyFlags;
|
||||
uint8_t gToolbarDirtyFlags;
|
||||
|
||||
static void window_game_bottom_toolbar_mouseup(rct_window *w, rct_widgetindex widgetIndex);
|
||||
static void window_game_bottom_toolbar_tooltip(rct_window* w, rct_widgetindex widgetIndex, rct_string_id *stringId);
|
||||
static void window_game_bottom_toolbar_invalidate(rct_window *w);
|
||||
static void window_game_bottom_toolbar_paint(rct_window *w, rct_drawpixelinfo *dpi);
|
||||
static void window_game_bottom_toolbar_update(rct_window* w);
|
||||
static void window_game_bottom_toolbar_cursor(rct_window *w, rct_widgetindex widgetIndex, sint32 x, sint32 y, sint32 *cursorId);
|
||||
static void window_game_bottom_toolbar_cursor(rct_window *w, rct_widgetindex widgetIndex, int32_t x, int32_t y, int32_t *cursorId);
|
||||
static void window_game_bottom_toolbar_unknown05(rct_window *w);
|
||||
|
||||
static void window_game_bottom_toolbar_draw_left_panel(rct_drawpixelinfo *dpi, rct_window *w);
|
||||
static void window_game_bottom_toolbar_draw_park_rating(rct_drawpixelinfo *dpi, rct_window *w, sint32 colour, sint32 x, sint32 y, uint8 factor);
|
||||
static void window_game_bottom_toolbar_draw_park_rating(rct_drawpixelinfo *dpi, rct_window *w, int32_t colour, int32_t x, int32_t y, uint8_t factor);
|
||||
static void window_game_bottom_toolbar_draw_right_panel(rct_drawpixelinfo *dpi, rct_window *w);
|
||||
static void window_game_bottom_toolbar_draw_news_item(rct_drawpixelinfo *dpi, rct_window *w);
|
||||
static void window_game_bottom_toolbar_draw_middle_panel(rct_drawpixelinfo *dpi, rct_window *w);
|
||||
|
@ -126,12 +126,12 @@ static void window_game_bottom_toolbar_invalidate_dirty_widgets(rct_window *w);
|
|||
*/
|
||||
rct_window * window_game_bottom_toolbar_open()
|
||||
{
|
||||
sint32 screenWidth = context_get_width();
|
||||
sint32 screenHeight = context_get_height();
|
||||
int32_t screenWidth = context_get_width();
|
||||
int32_t screenHeight = context_get_height();
|
||||
|
||||
// Figure out how much line height we have to work with.
|
||||
uint32 line_height = font_get_line_height(FONT_SPRITE_BASE_MEDIUM);
|
||||
uint32 toolbar_height = line_height * 2 + 12;
|
||||
uint32_t line_height = font_get_line_height(FONT_SPRITE_BASE_MEDIUM);
|
||||
uint32_t toolbar_height = line_height * 2 + 12;
|
||||
|
||||
rct_window * window = window_create(
|
||||
0,
|
||||
|
@ -206,8 +206,8 @@ static void window_game_bottom_toolbar_mouseup(rct_window *w, rct_widgetindex wi
|
|||
|
||||
{
|
||||
newsItem = news_item_get(0);
|
||||
sint32 x, y, z;
|
||||
sint32 subject = newsItem->Assoc;
|
||||
int32_t x, y, z;
|
||||
int32_t subject = newsItem->Assoc;
|
||||
|
||||
news_item_get_subject_location(newsItem->Type, subject, &x, &y, &z);
|
||||
|
||||
|
@ -228,16 +228,16 @@ static void window_game_bottom_toolbar_mouseup(rct_window *w, rct_widgetindex wi
|
|||
|
||||
static void window_game_bottom_toolbar_tooltip(rct_window* w, rct_widgetindex widgetIndex, rct_string_id *stringId)
|
||||
{
|
||||
sint32 month, day;
|
||||
int32_t month, day;
|
||||
|
||||
switch (widgetIndex)
|
||||
{
|
||||
case WIDX_MONEY:
|
||||
set_format_arg(0, sint32, gCurrentProfit);
|
||||
set_format_arg(4, sint32, gParkValue);
|
||||
set_format_arg(0, int32_t, gCurrentProfit);
|
||||
set_format_arg(4, int32_t, gParkValue);
|
||||
break;
|
||||
case WIDX_PARK_RATING:
|
||||
set_format_arg(0, sint16, gParkRating);
|
||||
set_format_arg(0, int16_t, gParkRating);
|
||||
break;
|
||||
case WIDX_DATE:
|
||||
month = date_get_month(gDateMonthsElapsed);
|
||||
|
@ -256,7 +256,7 @@ static void window_game_bottom_toolbar_tooltip(rct_window* w, rct_widgetindex wi
|
|||
static void window_game_bottom_toolbar_invalidate(rct_window *w)
|
||||
{
|
||||
// Figure out how much line height we have to work with.
|
||||
uint32 line_height = font_get_line_height(FONT_SPRITE_BASE_MEDIUM);
|
||||
uint32_t line_height = font_get_line_height(FONT_SPRITE_BASE_MEDIUM);
|
||||
|
||||
// Reset dimensions as appropriate -- in case we're switching languages.
|
||||
w->height = line_height * 2 + 12;
|
||||
|
@ -289,7 +289,7 @@ static void window_game_bottom_toolbar_invalidate(rct_window *w)
|
|||
w->widgets[WIDX_DATE].bottom = line_height + 1;
|
||||
|
||||
// Anchor the middle and right panel to the right
|
||||
sint32 x = context_get_width();
|
||||
int32_t x = context_get_width();
|
||||
w->width = x;
|
||||
x--;
|
||||
window_game_bottom_toolbar_widgets[WIDX_RIGHT_OUTSET].right = x;
|
||||
|
@ -345,8 +345,8 @@ static void window_game_bottom_toolbar_invalidate(rct_window *w)
|
|||
w->disabled_widgets &= ~(1 << WIDX_NEWS_LOCATE);
|
||||
|
||||
// Find out if the news item is no longer valid
|
||||
sint32 y, z;
|
||||
sint32 subject = newsItem->Assoc;
|
||||
int32_t y, z;
|
||||
int32_t subject = newsItem->Assoc;
|
||||
news_item_get_subject_location(newsItem->Type, subject, &x, &y, &z);
|
||||
|
||||
if (x == LOCATION_NULL)
|
||||
|
@ -444,14 +444,14 @@ static void window_game_bottom_toolbar_draw_left_panel(rct_drawpixelinfo *dpi, r
|
|||
);
|
||||
|
||||
// Figure out how much line height we have to work with.
|
||||
uint32 line_height = font_get_line_height(FONT_SPRITE_BASE_MEDIUM);
|
||||
uint32_t line_height = font_get_line_height(FONT_SPRITE_BASE_MEDIUM);
|
||||
|
||||
// Draw money
|
||||
if (!(gParkFlags & PARK_FLAGS_NO_MONEY))
|
||||
{
|
||||
rct_widget widget = window_game_bottom_toolbar_widgets[WIDX_MONEY];
|
||||
sint32 x = w->x + (widget.left + widget.right) / 2;
|
||||
sint32 y = w->y + (widget.top + widget.bottom) / 2 - (line_height == 10 ? 5 : 6);
|
||||
int32_t x = w->x + (widget.left + widget.right) / 2;
|
||||
int32_t y = w->y + (widget.top + widget.bottom) / 2 - (line_height == 10 ? 5 : 6);
|
||||
|
||||
set_format_arg(0, money32, gCash);
|
||||
gfx_draw_string_centred(
|
||||
|
@ -481,8 +481,8 @@ static void window_game_bottom_toolbar_draw_left_panel(rct_drawpixelinfo *dpi, r
|
|||
// Draw guests
|
||||
{
|
||||
rct_widget widget = window_game_bottom_toolbar_widgets[WIDX_GUESTS];
|
||||
sint32 x = w->x + (widget.left + widget.right) / 2;
|
||||
sint32 y = w->y + (widget.top + widget.bottom) / 2 - 6;
|
||||
int32_t x = w->x + (widget.left + widget.right) / 2;
|
||||
int32_t y = w->y + (widget.top + widget.bottom) / 2 - 6;
|
||||
|
||||
gfx_draw_string_centred(
|
||||
dpi,
|
||||
|
@ -497,8 +497,8 @@ static void window_game_bottom_toolbar_draw_left_panel(rct_drawpixelinfo *dpi, r
|
|||
// Draw park rating
|
||||
{
|
||||
rct_widget widget = window_game_bottom_toolbar_widgets[WIDX_PARK_RATING];
|
||||
sint32 x = w->x + widget.left + 11;
|
||||
sint32 y = w->y + (widget.top + widget.bottom) / 2 - 5;
|
||||
int32_t x = w->x + widget.left + 11;
|
||||
int32_t y = w->y + (widget.top + widget.bottom) / 2 - 5;
|
||||
|
||||
window_game_bottom_toolbar_draw_park_rating(
|
||||
dpi,
|
||||
|
@ -515,9 +515,9 @@ static void window_game_bottom_toolbar_draw_left_panel(rct_drawpixelinfo *dpi, r
|
|||
*
|
||||
* rct2: 0x0066C76C
|
||||
*/
|
||||
static void window_game_bottom_toolbar_draw_park_rating(rct_drawpixelinfo *dpi, rct_window *w, sint32 colour, sint32 x, sint32 y, uint8 factor)
|
||||
static void window_game_bottom_toolbar_draw_park_rating(rct_drawpixelinfo *dpi, rct_window *w, int32_t colour, int32_t x, int32_t y, uint8_t factor)
|
||||
{
|
||||
sint16 bar_width;
|
||||
int16_t bar_width;
|
||||
|
||||
bar_width = (factor * 114) / 255;
|
||||
gfx_fill_rect_inset(dpi, x + 1, y + 1, x + 114, y + 9, w->colours[1], INSET_RECT_F_30);
|
||||
|
@ -545,18 +545,18 @@ static void window_game_bottom_toolbar_draw_right_panel(rct_drawpixelinfo *dpi,
|
|||
INSET_RECT_F_30
|
||||
);
|
||||
|
||||
sint32 x = (window_game_bottom_toolbar_widgets[WIDX_RIGHT_OUTSET].left + window_game_bottom_toolbar_widgets[WIDX_RIGHT_OUTSET].right) / 2 + w->x;
|
||||
sint32 y = window_game_bottom_toolbar_widgets[WIDX_RIGHT_OUTSET].top + w->y + 2;
|
||||
int32_t x = (window_game_bottom_toolbar_widgets[WIDX_RIGHT_OUTSET].left + window_game_bottom_toolbar_widgets[WIDX_RIGHT_OUTSET].right) / 2 + w->x;
|
||||
int32_t y = window_game_bottom_toolbar_widgets[WIDX_RIGHT_OUTSET].top + w->y + 2;
|
||||
|
||||
// Date
|
||||
sint32 year = date_get_year(gDateMonthsElapsed) + 1;
|
||||
sint32 month = date_get_month(gDateMonthsElapsed);
|
||||
sint32 day = ((gDateMonthTicks * days_in_month[month]) >> 16) & 0xFF;
|
||||
int32_t year = date_get_year(gDateMonthsElapsed) + 1;
|
||||
int32_t month = date_get_month(gDateMonthsElapsed);
|
||||
int32_t day = ((gDateMonthTicks * days_in_month[month]) >> 16) & 0xFF;
|
||||
|
||||
rct_string_id stringId = DateFormatStringFormatIds[gConfigGeneral.date_format];
|
||||
set_format_arg(0, rct_string_id, DateDayNames[day]);
|
||||
set_format_arg(2, sint16, month);
|
||||
set_format_arg(4, sint16, year);
|
||||
set_format_arg(2, int16_t, month);
|
||||
set_format_arg(4, int16_t, year);
|
||||
gfx_draw_string_centred(
|
||||
dpi,
|
||||
stringId,
|
||||
|
@ -567,20 +567,20 @@ static void window_game_bottom_toolbar_draw_right_panel(rct_drawpixelinfo *dpi,
|
|||
);
|
||||
|
||||
// Figure out how much line height we have to work with.
|
||||
uint32 line_height = font_get_line_height(FONT_SPRITE_BASE_MEDIUM);
|
||||
uint32_t line_height = font_get_line_height(FONT_SPRITE_BASE_MEDIUM);
|
||||
|
||||
// Temperature
|
||||
x = w->x + window_game_bottom_toolbar_widgets[WIDX_RIGHT_OUTSET].left + 15;
|
||||
y += line_height + 1;
|
||||
|
||||
sint32 temperature = gClimateCurrent.Temperature;
|
||||
int32_t temperature = gClimateCurrent.Temperature;
|
||||
rct_string_id format = STR_CELSIUS_VALUE;
|
||||
if (gConfigGeneral.temperature_format == TEMPERATURE_FORMAT_F)
|
||||
{
|
||||
temperature = climate_celsius_to_fahrenheit(temperature);
|
||||
format = STR_FAHRENHEIT_VALUE;
|
||||
}
|
||||
set_format_arg(0, sint16, temperature);
|
||||
set_format_arg(0, int16_t, temperature);
|
||||
gfx_draw_string_left(dpi, format, gCommonFormatArgs, COLOUR_BLACK, x, y + 6);
|
||||
x += 30;
|
||||
|
||||
|
@ -606,7 +606,7 @@ static void window_game_bottom_toolbar_draw_right_panel(rct_drawpixelinfo *dpi,
|
|||
*/
|
||||
static void window_game_bottom_toolbar_draw_news_item(rct_drawpixelinfo *dpi, rct_window *w)
|
||||
{
|
||||
sint32 x, y, width;
|
||||
int32_t x, y, width;
|
||||
NewsItem *newsItem;
|
||||
rct_widget *middleOutsetWidget;
|
||||
|
||||
|
@ -650,18 +650,18 @@ static void window_game_bottom_toolbar_draw_news_item(rct_drawpixelinfo *dpi, rc
|
|||
}
|
||||
|
||||
rct_peep* peep = GET_PEEP(newsItem->Assoc);
|
||||
sint32 clip_x = 10, clip_y = 19;
|
||||
int32_t clip_x = 10, clip_y = 19;
|
||||
|
||||
if (peep->type == PEEP_TYPE_STAFF && peep->staff_type == STAFF_TYPE_ENTERTAINER)
|
||||
{
|
||||
clip_y += 3;
|
||||
}
|
||||
|
||||
uint32 image_id_base = g_peep_animation_entries[peep->sprite_type].sprite_animation->base_image;
|
||||
uint32_t image_id_base = g_peep_animation_entries[peep->sprite_type].sprite_animation->base_image;
|
||||
image_id_base += w->frame_no & 0xFFFFFFFC;
|
||||
image_id_base++;
|
||||
|
||||
uint32 image_id = image_id_base;
|
||||
uint32_t image_id = image_id_base;
|
||||
image_id |= SPRITE_ID_PALETTE_COLOUR_2(peep->tshirt_colour, peep->trousers_colour);
|
||||
|
||||
gfx_draw_sprite(&cliped_dpi, image_id, clip_x, clip_y, 0);
|
||||
|
@ -722,11 +722,11 @@ static void window_game_bottom_toolbar_draw_middle_panel(rct_drawpixelinfo *dpi,
|
|||
);
|
||||
|
||||
// Figure out how much line height we have to work with.
|
||||
uint32 line_height = font_get_line_height(FONT_SPRITE_BASE_MEDIUM);
|
||||
uint32_t line_height = font_get_line_height(FONT_SPRITE_BASE_MEDIUM);
|
||||
|
||||
sint32 x = w->x + (middleOutsetWidget->left + middleOutsetWidget->right) / 2;
|
||||
sint32 y = w->y + middleOutsetWidget->top + line_height + 1;
|
||||
sint32 width = middleOutsetWidget->right - middleOutsetWidget->left - 62;
|
||||
int32_t x = w->x + (middleOutsetWidget->left + middleOutsetWidget->right) / 2;
|
||||
int32_t y = w->y + middleOutsetWidget->top + line_height + 1;
|
||||
int32_t width = middleOutsetWidget->right - middleOutsetWidget->left - 62;
|
||||
|
||||
// Check if there is a map tooltip to draw
|
||||
rct_string_id stringId;
|
||||
|
@ -759,7 +759,7 @@ static void window_game_bottom_toolbar_update(rct_window* w){
|
|||
*
|
||||
* rct2: 0x0066C644
|
||||
*/
|
||||
static void window_game_bottom_toolbar_cursor(rct_window *w, rct_widgetindex widgetIndex, sint32 x, sint32 y, sint32 *cursorId)
|
||||
static void window_game_bottom_toolbar_cursor(rct_window *w, rct_widgetindex widgetIndex, int32_t x, int32_t y, int32_t *cursorId)
|
||||
{
|
||||
switch (widgetIndex)
|
||||
{
|
||||
|
|
|
@ -167,7 +167,7 @@ static rct_widget *window_guest_page_widgets[] = {
|
|||
window_guest_inventory_widgets
|
||||
};
|
||||
|
||||
static void window_guest_set_page(rct_window* w, sint32 page);
|
||||
static void window_guest_set_page(rct_window* w, int32_t page);
|
||||
static void window_guest_disable_widgets(rct_window* w);
|
||||
static void window_guest_viewport_init(rct_window* w);
|
||||
|
||||
|
@ -179,8 +179,8 @@ static void window_guest_overview_invalidate(rct_window *w);
|
|||
static void window_guest_overview_viewport_rotate(rct_window *w);
|
||||
static void window_guest_overview_update(rct_window* w);
|
||||
static void window_guest_overview_text_input(rct_window *w, rct_widgetindex widgetIndex, char *text);
|
||||
static void window_guest_overview_tool_update(rct_window* w, rct_widgetindex widgetIndex, sint32 x, sint32 y);
|
||||
static void window_guest_overview_tool_down(rct_window* w, rct_widgetindex widgetIndex, sint32 x, sint32 y);
|
||||
static void window_guest_overview_tool_update(rct_window* w, rct_widgetindex widgetIndex, int32_t x, int32_t y);
|
||||
static void window_guest_overview_tool_down(rct_window* w, rct_widgetindex widgetIndex, int32_t x, int32_t y);
|
||||
static void window_guest_overview_tool_abort(rct_window *w, rct_widgetindex widgetIndex);
|
||||
|
||||
static void window_guest_mouse_up(rct_window *w, rct_widgetindex widgetIndex);
|
||||
|
@ -194,12 +194,12 @@ static void window_guest_stats_paint(rct_window *w, rct_drawpixelinfo *dpi);
|
|||
static void window_guest_rides_resize(rct_window *w);
|
||||
static void window_guest_rides_update(rct_window *w);
|
||||
static void window_guest_rides_tooltip(rct_window* w, rct_widgetindex widgetIndex, rct_string_id *stringId);
|
||||
static void window_guest_rides_scroll_get_size(rct_window *w, sint32 scrollIndex, sint32 *width, sint32 *height);
|
||||
static void window_guest_rides_scroll_mouse_down(rct_window *w, sint32 scrollIndex, sint32 x, sint32 y);
|
||||
static void window_guest_rides_scroll_mouse_over(rct_window *w, sint32 scrollIndex, sint32 x, sint32 y);
|
||||
static void window_guest_rides_scroll_get_size(rct_window *w, int32_t scrollIndex, int32_t *width, int32_t *height);
|
||||
static void window_guest_rides_scroll_mouse_down(rct_window *w, int32_t scrollIndex, int32_t x, int32_t y);
|
||||
static void window_guest_rides_scroll_mouse_over(rct_window *w, int32_t scrollIndex, int32_t x, int32_t y);
|
||||
static void window_guest_rides_invalidate(rct_window *w);
|
||||
static void window_guest_rides_paint(rct_window *w, rct_drawpixelinfo *dpi);
|
||||
static void window_guest_rides_scroll_paint(rct_window *w, rct_drawpixelinfo *dpi, sint32 scrollIndex);
|
||||
static void window_guest_rides_scroll_paint(rct_window *w, rct_drawpixelinfo *dpi, int32_t scrollIndex);
|
||||
|
||||
static void window_guest_finance_resize(rct_window *w);
|
||||
static void window_guest_finance_update(rct_window *w);
|
||||
|
@ -415,7 +415,7 @@ static rct_window_event_list *window_guest_page_events[] = {
|
|||
void window_guest_set_colours();
|
||||
|
||||
// 0x981D3C
|
||||
static constexpr const uint32 window_guest_page_enabled_widgets[] = {
|
||||
static constexpr const uint32_t window_guest_page_enabled_widgets[] = {
|
||||
(1 << WIDX_CLOSE) |
|
||||
(1 << WIDX_TAB_1) |
|
||||
(1 << WIDX_TAB_2) |
|
||||
|
@ -530,7 +530,7 @@ rct_window * window_guest_open(rct_peep* peep){
|
|||
*/
|
||||
void window_guest_disable_widgets(rct_window* w){
|
||||
rct_peep* peep = &get_sprite(w->number)->peep;
|
||||
uint64 disabled_widgets = 0;
|
||||
uint64_t disabled_widgets = 0;
|
||||
|
||||
if (peep_can_be_picked_up(peep)){
|
||||
if (w->disabled_widgets & (1 << WIDX_PICKUP))
|
||||
|
@ -581,7 +581,7 @@ void window_guest_overview_resize(rct_window *w){
|
|||
return;
|
||||
}
|
||||
}
|
||||
uint8 zoom_amount = 1 << view->zoom;
|
||||
uint8_t zoom_amount = 1 << view->zoom;
|
||||
view->width = w->width - 30;
|
||||
view->height = w->height - 72;
|
||||
view->view_width = view->width / zoom_amount;
|
||||
|
@ -634,7 +634,7 @@ void window_guest_overview_mouse_up(rct_window *w, rct_widgetindex widgetIndex)
|
|||
*
|
||||
* rct2: 0x696AA0
|
||||
*/
|
||||
void window_guest_set_page(rct_window* w, sint32 page){
|
||||
void window_guest_set_page(rct_window* w, int32_t page){
|
||||
if (input_test_flag(INPUT_FLAG_TOOL_ACTIVE))
|
||||
{
|
||||
if(w->number == gCurrentToolWidget.window_number &&
|
||||
|
@ -642,7 +642,7 @@ void window_guest_set_page(rct_window* w, sint32 page){
|
|||
tool_cancel();
|
||||
|
||||
}
|
||||
sint32 listen = 0;
|
||||
int32_t listen = 0;
|
||||
if ( page == WINDOW_GUEST_OVERVIEW && w->page==WINDOW_GUEST_OVERVIEW && w->viewport){
|
||||
if(!(w->viewport->flags & VIEWPORT_FLAG_SOUND_ON))
|
||||
listen = 1;
|
||||
|
@ -700,7 +700,7 @@ void window_guest_viewport_init(rct_window* w){
|
|||
focus.sprite.sprite_id = SPRITE_INDEX_NULL;
|
||||
}
|
||||
else{
|
||||
uint8 final_check = 1;
|
||||
uint8_t final_check = 1;
|
||||
if (peep->state == PEEP_STATE_ON_RIDE
|
||||
|| peep->state == PEEP_STATE_ENTERING_RIDE
|
||||
|| (peep->state == PEEP_STATE_LEAVING_RIDE && peep->x == LOCATION_NULL)){
|
||||
|
@ -708,7 +708,7 @@ void window_guest_viewport_init(rct_window* w){
|
|||
Ride *ride = get_ride(peep->current_ride);
|
||||
if (ride->lifecycle_flags & RIDE_LIFECYCLE_ON_TRACK){
|
||||
rct_vehicle* train = GET_VEHICLE(ride->vehicles[peep->current_train]);
|
||||
sint32 car = peep->current_car;
|
||||
int32_t car = peep->current_car;
|
||||
|
||||
for (; car != 0; car--){
|
||||
train = GET_VEHICLE(train->next_vehicle_on_train);
|
||||
|
@ -720,9 +720,9 @@ void window_guest_viewport_init(rct_window* w){
|
|||
}
|
||||
if (peep->x == LOCATION_NULL && final_check){
|
||||
Ride *ride = get_ride(peep->current_ride);
|
||||
sint32 x = ride->overall_view.x * 32 + 16;
|
||||
sint32 y = ride->overall_view.y * 32 + 16;
|
||||
sint32 height = tile_element_height(x, y);
|
||||
int32_t x = ride->overall_view.x * 32 + 16;
|
||||
int32_t y = ride->overall_view.y * 32 + 16;
|
||||
int32_t height = tile_element_height(x, y);
|
||||
height += 32;
|
||||
focus.coordinate.x = x;
|
||||
focus.coordinate.y = y;
|
||||
|
@ -736,7 +736,7 @@ void window_guest_viewport_init(rct_window* w){
|
|||
focus.coordinate.rotation = get_current_rotation();
|
||||
}
|
||||
|
||||
uint16 viewport_flags;
|
||||
uint16_t viewport_flags;
|
||||
|
||||
if (w->viewport){
|
||||
// Check all combos, for now skipping y and rot
|
||||
|
@ -768,10 +768,10 @@ void window_guest_viewport_init(rct_window* w){
|
|||
if (!(w->viewport)){
|
||||
rct_widget* view_widget = &w->widgets[WIDX_VIEWPORT];
|
||||
|
||||
sint32 x = view_widget->left + 1 + w->x;
|
||||
sint32 y = view_widget->top + 1 + w->y;
|
||||
sint32 width = view_widget->right - view_widget->left - 1;
|
||||
sint32 height = view_widget->bottom - view_widget->top - 1;
|
||||
int32_t x = view_widget->left + 1 + w->x;
|
||||
int32_t y = view_widget->top + 1 + w->y;
|
||||
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, 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;
|
||||
|
@ -794,10 +794,10 @@ static void window_guest_overview_tab_paint(rct_window* w, rct_drawpixelinfo* dp
|
|||
return;
|
||||
|
||||
rct_widget* widget = &w->widgets[WIDX_TAB_1];
|
||||
sint32 width = widget->right - widget->left - 1;
|
||||
sint32 height = widget->bottom - widget->top - 1;
|
||||
sint32 x = widget->left + 1 + w->x;
|
||||
sint32 y = widget->top + 1 + w->y;
|
||||
int32_t width = widget->right - widget->left - 1;
|
||||
int32_t height = widget->bottom - widget->top - 1;
|
||||
int32_t x = widget->left + 1 + w->x;
|
||||
int32_t y = widget->top + 1 + w->y;
|
||||
if (w->page == WINDOW_GUEST_OVERVIEW) height++;
|
||||
|
||||
rct_drawpixelinfo clip_dpi;
|
||||
|
@ -813,9 +813,9 @@ static void window_guest_overview_tab_paint(rct_window* w, rct_drawpixelinfo* dp
|
|||
if (peep->type == PEEP_TYPE_STAFF && peep->staff_type == STAFF_TYPE_ENTERTAINER)
|
||||
y++;
|
||||
|
||||
sint32 ebx = g_peep_animation_entries[peep->sprite_type].sprite_animation->base_image + 1;
|
||||
int32_t ebx = g_peep_animation_entries[peep->sprite_type].sprite_animation->base_image + 1;
|
||||
|
||||
sint32 eax = 0;
|
||||
int32_t eax = 0;
|
||||
|
||||
if (w->page == WINDOW_GUEST_OVERVIEW){
|
||||
eax = w->var_496;
|
||||
|
@ -823,7 +823,7 @@ static void window_guest_overview_tab_paint(rct_window* w, rct_drawpixelinfo* dp
|
|||
}
|
||||
ebx += eax;
|
||||
|
||||
sint32 sprite_id = ebx | SPRITE_ID_PALETTE_COLOUR_2(peep->tshirt_colour, peep->trousers_colour);
|
||||
int32_t sprite_id = ebx | SPRITE_ID_PALETTE_COLOUR_2(peep->tshirt_colour, peep->trousers_colour);
|
||||
gfx_draw_sprite(&clip_dpi, sprite_id, x, y, 0);
|
||||
|
||||
// If holding a balloon
|
||||
|
@ -857,11 +857,11 @@ static void window_guest_stats_tab_paint(rct_window* w, rct_drawpixelinfo* dpi){
|
|||
return;
|
||||
|
||||
rct_widget* widget = &w->widgets[WIDX_TAB_2];
|
||||
sint32 x = widget->left + w->x;
|
||||
sint32 y = widget->top + w->y;
|
||||
int32_t x = widget->left + w->x;
|
||||
int32_t y = widget->top + w->y;
|
||||
|
||||
rct_peep* peep = GET_PEEP(w->number);
|
||||
sint32 image_id = get_peep_face_sprite_large(peep);
|
||||
int32_t image_id = get_peep_face_sprite_large(peep);
|
||||
if (w->page == WINDOW_GUEST_STATS){
|
||||
// If currently viewing this tab animate tab
|
||||
// if it is very sick or angry.
|
||||
|
@ -888,10 +888,10 @@ static void window_guest_rides_tab_paint(rct_window* w, rct_drawpixelinfo* dpi){
|
|||
if (w->disabled_widgets & (1 << WIDX_TAB_3)) return;
|
||||
|
||||
rct_widget* widget = &w->widgets[WIDX_TAB_3];
|
||||
sint32 x = widget->left + w->x;
|
||||
sint32 y = widget->top + w->y;
|
||||
int32_t x = widget->left + w->x;
|
||||
int32_t y = widget->top + w->y;
|
||||
|
||||
sint32 image_id = SPR_TAB_RIDE_0;
|
||||
int32_t image_id = SPR_TAB_RIDE_0;
|
||||
|
||||
if ( w->page == WINDOW_GUEST_RIDES ){
|
||||
image_id += (w->frame_no / 4) & 0xF;
|
||||
|
@ -908,10 +908,10 @@ static void window_guest_finance_tab_paint(rct_window* w, rct_drawpixelinfo* dpi
|
|||
if (w->disabled_widgets & (1 << WIDX_TAB_4)) return;
|
||||
|
||||
rct_widget* widget = &w->widgets[WIDX_TAB_4];
|
||||
sint32 x = widget->left + w->x;
|
||||
sint32 y = widget->top + w->y;
|
||||
int32_t x = widget->left + w->x;
|
||||
int32_t y = widget->top + w->y;
|
||||
|
||||
sint32 image_id = SPR_TAB_FINANCES_SUMMARY_0;
|
||||
int32_t image_id = SPR_TAB_FINANCES_SUMMARY_0;
|
||||
|
||||
if ( w->page == WINDOW_GUEST_FINANCE ){
|
||||
image_id += (w->frame_no / 2) & 0x7;
|
||||
|
@ -928,10 +928,10 @@ static void window_guest_thoughts_tab_paint(rct_window* w, rct_drawpixelinfo* dp
|
|||
if (w->disabled_widgets & (1 << WIDX_TAB_5)) return;
|
||||
|
||||
rct_widget* widget = &w->widgets[WIDX_TAB_5];
|
||||
sint32 x = widget->left + w->x;
|
||||
sint32 y = widget->top + w->y;
|
||||
int32_t x = widget->left + w->x;
|
||||
int32_t y = widget->top + w->y;
|
||||
|
||||
sint32 image_id = SPR_TAB_THOUGHTS_0;
|
||||
int32_t image_id = SPR_TAB_THOUGHTS_0;
|
||||
|
||||
if ( w->page == WINDOW_GUEST_THOUGHTS ){
|
||||
image_id += (w->frame_no / 2) & 0x7;
|
||||
|
@ -948,10 +948,10 @@ static void window_guest_inventory_tab_paint(rct_window* w, rct_drawpixelinfo* d
|
|||
if (w->disabled_widgets & (1 << WIDX_TAB_6)) return;
|
||||
|
||||
rct_widget* widget = &w->widgets[WIDX_TAB_6];
|
||||
sint32 x = widget->left + w->x;
|
||||
sint32 y = widget->top + w->y;
|
||||
int32_t x = widget->left + w->x;
|
||||
int32_t y = widget->top + w->y;
|
||||
|
||||
sint32 image_id = SPR_TAB_GUEST_INVENTORY;
|
||||
int32_t image_id = SPR_TAB_GUEST_INVENTORY;
|
||||
|
||||
gfx_draw_sprite(dpi, image_id, x, y, 0);
|
||||
}
|
||||
|
@ -980,29 +980,29 @@ void window_guest_overview_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
|||
}
|
||||
|
||||
// Draw the centred label
|
||||
uint32 argument1, argument2;
|
||||
uint32_t argument1, argument2;
|
||||
rct_peep* peep = GET_PEEP(w->number);
|
||||
get_arguments_from_action(peep, &argument1, &argument2);
|
||||
set_format_arg(0, uint32, argument1);
|
||||
set_format_arg(4, uint32, argument2);
|
||||
set_format_arg(0, uint32_t, argument1);
|
||||
set_format_arg(4, uint32_t, argument2);
|
||||
rct_widget* widget = &w->widgets[WIDX_ACTION_LBL];
|
||||
sint32 x = (widget->left + widget->right) / 2 + w->x;
|
||||
sint32 y = w->y + widget->top - 1;
|
||||
sint32 width = widget->right - widget->left;
|
||||
int32_t x = (widget->left + widget->right) / 2 + w->x;
|
||||
int32_t y = w->y + widget->top - 1;
|
||||
int32_t width = widget->right - widget->left;
|
||||
gfx_draw_string_centred_clipped(dpi, STR_BLACK_STRING, gCommonFormatArgs, COLOUR_BLACK, x, y, width);
|
||||
|
||||
// Draw the marquee thought
|
||||
widget = &w->widgets[WIDX_MARQUEE];
|
||||
width = widget->right - widget->left - 3;
|
||||
sint32 left = widget->left + 2 + w->x;
|
||||
sint32 top = widget->top + w->y;
|
||||
sint32 height = widget->bottom - widget->top;
|
||||
int32_t left = widget->left + 2 + w->x;
|
||||
int32_t top = widget->top + w->y;
|
||||
int32_t height = widget->bottom - widget->top;
|
||||
rct_drawpixelinfo dpi_marquee;
|
||||
if (!clip_drawpixelinfo(&dpi_marquee, dpi, left, top, width, height)) {
|
||||
return;
|
||||
}
|
||||
|
||||
sint32 i = 0;
|
||||
int32_t i = 0;
|
||||
for (; i < PEEP_MAX_THOUGHTS; ++i){
|
||||
if (peep->thoughts[i].type == PEEP_THOUGHT_TYPE_NONE){
|
||||
w->list_information_type = 0;
|
||||
|
@ -1045,7 +1045,7 @@ void window_guest_overview_invalidate(rct_window *w)
|
|||
|
||||
rct_peep* peep = GET_PEEP(w->number);
|
||||
set_format_arg(0, rct_string_id, peep->name_string_idx);
|
||||
set_format_arg(2, uint32, peep->id);
|
||||
set_format_arg(2, uint32_t, peep->id);
|
||||
|
||||
w->pressed_widgets &= ~(1<<WIDX_TRACK);
|
||||
if (peep->peep_flags & PEEP_FLAGS_TRACKING){
|
||||
|
@ -1090,7 +1090,7 @@ void window_guest_overview_invalidate(rct_window *w)
|
|||
* rct2: 0x696F45
|
||||
*/
|
||||
void window_guest_overview_update(rct_window* w){
|
||||
sint32 var_496 = w->var_496;
|
||||
int32_t var_496 = w->var_496;
|
||||
var_496++;
|
||||
var_496 %= 24;
|
||||
w->var_496 = var_496;
|
||||
|
@ -1110,7 +1110,7 @@ void window_guest_overview_update(rct_window* w){
|
|||
// Create the "I have the strangest feeling I am being watched thought"
|
||||
if ((w->highlighted_item & 0xFFFF) >= 3840) {
|
||||
if (!(w->highlighted_item & 0x3FF)) {
|
||||
sint32 random = util_rand() & 0xFFFF;
|
||||
int32_t random = util_rand() & 0xFFFF;
|
||||
if (random <= 0x2AAA) {
|
||||
rct_peep* peep = GET_PEEP(w->number);
|
||||
peep_insert_new_thought(peep, PEEP_THOUGHT_TYPE_WATCHED, PEEP_THOUGHT_ITEM_NONE);
|
||||
|
@ -1135,7 +1135,7 @@ void window_guest_overview_text_input(rct_window *w, rct_widgetindex widgetIndex
|
|||
*
|
||||
* rct2: 0x696A5F
|
||||
*/
|
||||
void window_guest_overview_tool_update(rct_window* w, rct_widgetindex widgetIndex, sint32 x, sint32 y)
|
||||
void window_guest_overview_tool_update(rct_window* w, rct_widgetindex widgetIndex, int32_t x, int32_t y)
|
||||
{
|
||||
if (widgetIndex != WIDX_PICKUP)
|
||||
return;
|
||||
|
@ -1144,7 +1144,7 @@ void window_guest_overview_tool_update(rct_window* w, rct_widgetindex widgetInde
|
|||
|
||||
gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE;
|
||||
|
||||
sint32 map_x, map_y;
|
||||
int32_t map_x, map_y;
|
||||
footpath_get_coordinates_from_pos(x, y + 16, &map_x, &map_y, nullptr, nullptr);
|
||||
if (map_x != LOCATION_NULL) {
|
||||
gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE;
|
||||
|
@ -1158,7 +1158,7 @@ void window_guest_overview_tool_update(rct_window* w, rct_widgetindex widgetInde
|
|||
|
||||
gPickupPeepImage = UINT32_MAX;
|
||||
|
||||
sint32 interactionType;
|
||||
int32_t interactionType;
|
||||
get_map_coordinates_from_pos(x, y, VIEWPORT_INTERACTION_MASK_NONE, nullptr, nullptr, &interactionType, nullptr, nullptr);
|
||||
if (interactionType == VIEWPORT_INTERACTION_ITEM_NONE)
|
||||
return;
|
||||
|
@ -1175,7 +1175,7 @@ void window_guest_overview_tool_update(rct_window* w, rct_widgetindex widgetInde
|
|||
rct_peep* peep;
|
||||
peep = GET_PEEP(w->number);
|
||||
|
||||
uint32 imageId = g_peep_animation_entries[peep->sprite_type].sprite_animation[PEEP_ACTION_SPRITE_TYPE_UI].base_image;
|
||||
uint32_t imageId = g_peep_animation_entries[peep->sprite_type].sprite_animation[PEEP_ACTION_SPRITE_TYPE_UI].base_image;
|
||||
imageId += w->picked_peep_frame >> 2;
|
||||
|
||||
imageId |= (peep->tshirt_colour << 19) | (peep->trousers_colour << 24) | IMAGE_TYPE_REMAP | IMAGE_TYPE_REMAP_2_PLUS;
|
||||
|
@ -1186,12 +1186,12 @@ void window_guest_overview_tool_update(rct_window* w, rct_widgetindex widgetInde
|
|||
*
|
||||
* rct2: 0x696A54
|
||||
*/
|
||||
void window_guest_overview_tool_down(rct_window* w, rct_widgetindex widgetIndex, sint32 x, sint32 y)
|
||||
void window_guest_overview_tool_down(rct_window* w, rct_widgetindex widgetIndex, int32_t x, int32_t y)
|
||||
{
|
||||
if (widgetIndex != WIDX_PICKUP)
|
||||
return;
|
||||
|
||||
sint32 dest_x, dest_y;
|
||||
int32_t dest_x, dest_y;
|
||||
rct_tile_element* tileElement;
|
||||
footpath_get_coordinates_from_pos(x, y + 16, &dest_x, &dest_y, nullptr, &tileElement);
|
||||
|
||||
|
@ -1281,7 +1281,7 @@ void window_guest_stats_invalidate(rct_window *w)
|
|||
|
||||
rct_peep* peep = GET_PEEP(w->number);
|
||||
set_format_arg(0, rct_string_id, peep->name_string_idx);
|
||||
set_format_arg(2, uint32, peep->id);
|
||||
set_format_arg(2, uint32_t, peep->id);
|
||||
|
||||
window_guest_stats_widgets[WIDX_BACKGROUND].right = w->width - 1;
|
||||
window_guest_stats_widgets[WIDX_BACKGROUND].bottom = w->height - 1;
|
||||
|
@ -1303,7 +1303,7 @@ void window_guest_stats_invalidate(rct_window *w)
|
|||
*
|
||||
* ebp: colour, contains flag BAR_BLINK for blinking
|
||||
*/
|
||||
static void window_guest_stats_bars_paint(sint32 value, sint32 x, sint32 y, rct_window *w, rct_drawpixelinfo *dpi, sint32 colour)
|
||||
static void window_guest_stats_bars_paint(int32_t value, int32_t x, int32_t y, rct_window *w, rct_drawpixelinfo *dpi, int32_t colour)
|
||||
{
|
||||
if (font_get_line_height(gCurrentFontSpriteBase) > 10)
|
||||
{
|
||||
|
@ -1312,7 +1312,7 @@ static void window_guest_stats_bars_paint(sint32 value, sint32 x, sint32 y, rct_
|
|||
|
||||
gfx_fill_rect_inset(dpi, x + 61, y + 1, x + 61 + 121, y + 9, w->colours[1], INSET_RECT_F_30);
|
||||
|
||||
sint32 blink_flag = colour & BAR_BLINK;
|
||||
int32_t blink_flag = colour & BAR_BLINK;
|
||||
colour &= ~BAR_BLINK;
|
||||
|
||||
if (!blink_flag || game_is_paused() || (gCurrentTicks & 8) == 0)
|
||||
|
@ -1346,16 +1346,16 @@ void window_guest_stats_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
|||
|
||||
// Not sure why this is not stats widgets
|
||||
// cx
|
||||
sint32 x = w->x + window_guest_rides_widgets[WIDX_PAGE_BACKGROUND].left + 4;
|
||||
int32_t x = w->x + window_guest_rides_widgets[WIDX_PAGE_BACKGROUND].left + 4;
|
||||
// dx
|
||||
sint32 y = w->y + window_guest_rides_widgets[WIDX_PAGE_BACKGROUND].top + 4;
|
||||
int32_t y = w->y + window_guest_rides_widgets[WIDX_PAGE_BACKGROUND].top + 4;
|
||||
|
||||
// Happiness
|
||||
gfx_draw_string_left(dpi, STR_GUEST_STAT_HAPPINESS_LABEL, gCommonFormatArgs, COLOUR_BLACK, x, y);
|
||||
|
||||
sint32 happiness = peep->happiness;
|
||||
int32_t happiness = peep->happiness;
|
||||
if (happiness < 10)happiness = 10;
|
||||
sint32 ebp = COLOUR_BRIGHT_GREEN;
|
||||
int32_t ebp = COLOUR_BRIGHT_GREEN;
|
||||
if (happiness < 50){
|
||||
ebp |= BAR_BLINK;
|
||||
}
|
||||
|
@ -1365,7 +1365,7 @@ void window_guest_stats_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
|||
y += LIST_ROW_HEIGHT;
|
||||
gfx_draw_string_left(dpi, STR_GUEST_STAT_ENERGY_LABEL, gCommonFormatArgs, COLOUR_BLACK, x, y);
|
||||
|
||||
sint32 energy = ((peep->energy - PEEP_MIN_ENERGY) * 255) / (PEEP_MAX_ENERGY - PEEP_MIN_ENERGY);
|
||||
int32_t energy = ((peep->energy - PEEP_MIN_ENERGY) * 255) / (PEEP_MAX_ENERGY - PEEP_MIN_ENERGY);
|
||||
ebp = COLOUR_BRIGHT_GREEN;
|
||||
if (energy < 50){
|
||||
ebp |= BAR_BLINK;
|
||||
|
@ -1377,7 +1377,7 @@ void window_guest_stats_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
|||
y += LIST_ROW_HEIGHT;
|
||||
gfx_draw_string_left(dpi, STR_GUEST_STAT_HUNGER_LABEL, gCommonFormatArgs, COLOUR_BLACK, x, y);
|
||||
|
||||
sint32 hunger = peep->hunger;
|
||||
int32_t hunger = peep->hunger;
|
||||
if (hunger > 190) hunger = 190;
|
||||
|
||||
hunger -= 32;
|
||||
|
@ -1396,7 +1396,7 @@ void window_guest_stats_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
|||
y += LIST_ROW_HEIGHT;
|
||||
gfx_draw_string_left(dpi, STR_GUEST_STAT_THIRST_LABEL, gCommonFormatArgs, COLOUR_BLACK, x, y);
|
||||
|
||||
sint32 thirst = peep->thirst;
|
||||
int32_t thirst = peep->thirst;
|
||||
if (thirst > 190) thirst = 190;
|
||||
|
||||
thirst -= 32;
|
||||
|
@ -1415,7 +1415,7 @@ void window_guest_stats_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
|||
y += LIST_ROW_HEIGHT;
|
||||
gfx_draw_string_left(dpi, STR_GUEST_STAT_NAUSEA_LABEL, gCommonFormatArgs, COLOUR_BLACK, x, y);
|
||||
|
||||
sint32 nausea = peep->nausea - 32;
|
||||
int32_t nausea = peep->nausea - 32;
|
||||
|
||||
if (nausea < 0) nausea = 0;
|
||||
nausea *= 36;
|
||||
|
@ -1431,7 +1431,7 @@ void window_guest_stats_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
|||
y += LIST_ROW_HEIGHT;
|
||||
gfx_draw_string_left(dpi, STR_GUEST_STAT_TOILET_LABEL, gCommonFormatArgs, COLOUR_BLACK, x, y);
|
||||
|
||||
sint32 toilet = peep->toilet - 32;
|
||||
int32_t toilet = peep->toilet - 32;
|
||||
if (toilet > 210) toilet = 210;
|
||||
|
||||
toilet -= 32;
|
||||
|
@ -1448,10 +1448,10 @@ void window_guest_stats_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
|||
// Time in park
|
||||
y += LIST_ROW_HEIGHT + 1;
|
||||
if (peep->time_in_park != -1){
|
||||
sint32 eax = gScenarioTicks;
|
||||
int32_t eax = gScenarioTicks;
|
||||
eax -= peep->time_in_park;
|
||||
eax >>= 11;
|
||||
set_format_arg(0, uint16, eax & 0xFFFF);
|
||||
set_format_arg(0, uint16_t, eax & 0xFFFF);
|
||||
gfx_draw_string_left(dpi, STR_GUEST_STAT_TIME_IN_PARK, gCommonFormatArgs, COLOUR_BLACK, x, y);
|
||||
}
|
||||
|
||||
|
@ -1463,12 +1463,12 @@ void window_guest_stats_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
|||
y += LIST_ROW_HEIGHT;
|
||||
|
||||
// Intensity
|
||||
sint32 intensity = peep->intensity / 16;
|
||||
set_format_arg(0, uint16, intensity);
|
||||
sint32 string_id = STR_GUEST_STAT_PREFERRED_INTESITY_BELOW;
|
||||
int32_t intensity = peep->intensity / 16;
|
||||
set_format_arg(0, uint16_t, intensity);
|
||||
int32_t string_id = STR_GUEST_STAT_PREFERRED_INTESITY_BELOW;
|
||||
if (peep->intensity & 0xF){
|
||||
set_format_arg(0, uint16, peep->intensity & 0xF);
|
||||
set_format_arg(2, uint16, intensity);
|
||||
set_format_arg(0, uint16_t, peep->intensity & 0xF);
|
||||
set_format_arg(2, uint16_t, intensity);
|
||||
string_id = STR_GUEST_STAT_PREFERRED_INTESITY_BETWEEN;
|
||||
if (intensity == 15) string_id = STR_GUEST_STAT_PREFERRED_INTESITY_ABOVE;
|
||||
}
|
||||
|
@ -1483,7 +1483,7 @@ void window_guest_stats_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
|||
STR_PEEP_STAT_NAUSEA_TOLERANCE_HIGH,
|
||||
};
|
||||
y += LIST_ROW_HEIGHT;
|
||||
sint32 nausea_tolerance = peep->nausea_tolerance & 0x3;
|
||||
int32_t nausea_tolerance = peep->nausea_tolerance & 0x3;
|
||||
set_format_arg(0, rct_string_id, nauseaTolerances[nausea_tolerance]);
|
||||
gfx_draw_string_left(dpi, STR_GUEST_STAT_NAUSEA_TOLERANCE, gCommonFormatArgs, COLOUR_BLACK, x, y);
|
||||
}
|
||||
|
@ -1511,14 +1511,14 @@ void window_guest_rides_update(rct_window *w)
|
|||
rct_peep* peep = GET_PEEP(w->number);
|
||||
|
||||
// Every 2048 ticks do a full window_invalidate
|
||||
sint32 number_of_ticks = gScenarioTicks - peep->time_in_park;
|
||||
int32_t number_of_ticks = gScenarioTicks - peep->time_in_park;
|
||||
if (!(number_of_ticks & 0x7FF)) window_invalidate(w);
|
||||
|
||||
uint8 curr_list_position = 0;
|
||||
for (uint8 ride_id = 0; ride_id < 255; ++ride_id){
|
||||
uint8_t curr_list_position = 0;
|
||||
for (uint8_t ride_id = 0; ride_id < 255; ++ride_id){
|
||||
// Offset to the ride_id bit in peep_rides_been_on
|
||||
uint8 ride_id_bit = ride_id % 8;
|
||||
uint8 ride_id_offset = ride_id / 8;
|
||||
uint8_t ride_id_bit = ride_id % 8;
|
||||
uint8_t ride_id_offset = ride_id / 8;
|
||||
if (peep->rides_been_on[ride_id_offset] & (1 << ride_id_bit)){
|
||||
Ride* ride = get_ride(ride_id);
|
||||
if (gRideClassifications[ride->type] == RIDE_CLASS_RIDE){
|
||||
|
@ -1547,7 +1547,7 @@ void window_guest_rides_tooltip(rct_window* w, rct_widgetindex widgetIndex, rct_
|
|||
*
|
||||
* rct2: 0x69784E
|
||||
*/
|
||||
void window_guest_rides_scroll_get_size(rct_window *w, sint32 scrollIndex, sint32 *width, sint32 *height)
|
||||
void window_guest_rides_scroll_get_size(rct_window *w, int32_t scrollIndex, int32_t *width, int32_t *height)
|
||||
{
|
||||
*height = w->no_list_items * 10;
|
||||
|
||||
|
@ -1556,7 +1556,7 @@ void window_guest_rides_scroll_get_size(rct_window *w, sint32 scrollIndex, sint3
|
|||
window_invalidate(w);
|
||||
}
|
||||
|
||||
sint32 visable_height = *height
|
||||
int32_t visable_height = *height
|
||||
- window_guest_rides_widgets[WIDX_RIDE_SCROLL].bottom
|
||||
+ window_guest_rides_widgets[WIDX_RIDE_SCROLL].top
|
||||
+ 21;
|
||||
|
@ -1573,9 +1573,9 @@ void window_guest_rides_scroll_get_size(rct_window *w, sint32 scrollIndex, sint3
|
|||
*
|
||||
* rct2: 0x006978CC
|
||||
*/
|
||||
void window_guest_rides_scroll_mouse_down(rct_window *w, sint32 scrollIndex, sint32 x, sint32 y)
|
||||
void window_guest_rides_scroll_mouse_down(rct_window *w, int32_t scrollIndex, int32_t x, int32_t y)
|
||||
{
|
||||
sint32 index;
|
||||
int32_t index;
|
||||
|
||||
index = y / 10;
|
||||
if (index >= w->no_list_items) return;
|
||||
|
@ -1589,9 +1589,9 @@ void window_guest_rides_scroll_mouse_down(rct_window *w, sint32 scrollIndex, sin
|
|||
*
|
||||
* rct2: 0x0069789C
|
||||
*/
|
||||
void window_guest_rides_scroll_mouse_over(rct_window *w, sint32 scrollIndex, sint32 x, sint32 y)
|
||||
void window_guest_rides_scroll_mouse_over(rct_window *w, int32_t scrollIndex, int32_t x, int32_t y)
|
||||
{
|
||||
sint32 index;
|
||||
int32_t index;
|
||||
|
||||
index = y / 10;
|
||||
if (index >= w->no_list_items)return;
|
||||
|
@ -1616,8 +1616,8 @@ void window_guest_rides_invalidate(rct_window *w)
|
|||
w->pressed_widgets |= 1ULL << (w->page + WIDX_TAB_1);
|
||||
|
||||
rct_peep* peep = GET_PEEP(w->number);
|
||||
set_format_arg(0, uint16, peep->name_string_idx);
|
||||
set_format_arg(2, uint32, peep->id);
|
||||
set_format_arg(0, uint16_t, peep->name_string_idx);
|
||||
set_format_arg(2, uint32_t, peep->id);
|
||||
|
||||
window_guest_rides_widgets[WIDX_BACKGROUND].right = w->width - 1;
|
||||
window_guest_rides_widgets[WIDX_BACKGROUND].bottom = w->height - 1;
|
||||
|
@ -1653,16 +1653,16 @@ void window_guest_rides_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
|||
rct_peep* peep = GET_PEEP(w->number);
|
||||
|
||||
// cx
|
||||
sint32 x = w->x + window_guest_rides_widgets[WIDX_PAGE_BACKGROUND].left + 2;
|
||||
int32_t x = w->x + window_guest_rides_widgets[WIDX_PAGE_BACKGROUND].left + 2;
|
||||
// dx
|
||||
sint32 y = w->y + window_guest_rides_widgets[WIDX_PAGE_BACKGROUND].top + 2;
|
||||
int32_t y = w->y + window_guest_rides_widgets[WIDX_PAGE_BACKGROUND].top + 2;
|
||||
|
||||
gfx_draw_string_left(dpi, STR_GUEST_LABEL_RIDES_BEEN_ON, nullptr, COLOUR_BLACK, x, y);
|
||||
|
||||
y = w->y + window_guest_rides_widgets[WIDX_PAGE_BACKGROUND].bottom - 12;
|
||||
|
||||
rct_string_id ride_string_id = STR_PEEP_FAVOURITE_RIDE_NOT_AVAILABLE;
|
||||
uint32 ride_string_arguments = 0;
|
||||
uint32_t ride_string_arguments = 0;
|
||||
if (peep->favourite_ride != 0xFF)
|
||||
{
|
||||
auto ride = get_ride(peep->favourite_ride);
|
||||
|
@ -1673,7 +1673,7 @@ void window_guest_rides_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
|||
}
|
||||
}
|
||||
set_format_arg(0, rct_string_id, ride_string_id);
|
||||
set_format_arg(2, uint32, ride_string_arguments);
|
||||
set_format_arg(2, uint32_t, ride_string_arguments);
|
||||
|
||||
gfx_draw_string_left_clipped(dpi, STR_FAVOURITE_RIDE, gCommonFormatArgs, COLOUR_BLACK, x, y, w->width - 14);
|
||||
}
|
||||
|
@ -1682,17 +1682,17 @@ void window_guest_rides_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
|||
*
|
||||
* rct2: 0x006976FC
|
||||
*/
|
||||
void window_guest_rides_scroll_paint(rct_window *w, rct_drawpixelinfo *dpi, sint32 scrollIndex)
|
||||
void window_guest_rides_scroll_paint(rct_window *w, rct_drawpixelinfo *dpi, int32_t scrollIndex)
|
||||
{
|
||||
sint32 left = dpi->x;
|
||||
sint32 right = dpi->x + dpi->width - 1;
|
||||
sint32 top = dpi->y;
|
||||
sint32 bottom = dpi->y + dpi->height - 1;
|
||||
int32_t left = dpi->x;
|
||||
int32_t right = dpi->x + dpi->width - 1;
|
||||
int32_t top = dpi->y;
|
||||
int32_t bottom = dpi->y + dpi->height - 1;
|
||||
|
||||
auto colour = ColourMapA[w->colours[1]].mid_light;
|
||||
gfx_fill_rect(dpi, left, top, right, bottom, colour);
|
||||
|
||||
for (sint32 list_index = 0; list_index < w->no_list_items; list_index++)
|
||||
for (int32_t list_index = 0; list_index < w->no_list_items; list_index++)
|
||||
{
|
||||
auto y = list_index * 10;
|
||||
rct_string_id stringId = STR_BLACK_STRING;
|
||||
|
@ -1706,7 +1706,7 @@ void window_guest_rides_scroll_paint(rct_window *w, rct_drawpixelinfo *dpi, sint
|
|||
if (ride != nullptr)
|
||||
{
|
||||
set_format_arg(0, rct_string_id, ride->name);
|
||||
set_format_arg(2, uint32, ride->name_arguments);
|
||||
set_format_arg(2, uint32_t, ride->name_arguments);
|
||||
gfx_draw_string_left(dpi, stringId, gCommonFormatArgs, COLOUR_BLACK, 0, y - 1);
|
||||
}
|
||||
}
|
||||
|
@ -1749,7 +1749,7 @@ void window_guest_finance_invalidate(rct_window *w)
|
|||
rct_peep* peep = GET_PEEP(w->number);
|
||||
|
||||
set_format_arg(0, rct_string_id, peep->name_string_idx);
|
||||
set_format_arg(2, uint32, peep->id);
|
||||
set_format_arg(2, uint32_t, peep->id);
|
||||
|
||||
window_guest_finance_widgets[WIDX_BACKGROUND].right = w->width - 1;
|
||||
window_guest_finance_widgets[WIDX_BACKGROUND].bottom = w->height - 1;
|
||||
|
@ -1782,9 +1782,9 @@ void window_guest_finance_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
|||
rct_peep* peep = GET_PEEP(w->number);
|
||||
|
||||
// cx
|
||||
sint32 x = w->x + window_guest_finance_widgets[WIDX_PAGE_BACKGROUND].left + 4;
|
||||
int32_t x = w->x + window_guest_finance_widgets[WIDX_PAGE_BACKGROUND].left + 4;
|
||||
// dx
|
||||
sint32 y = w->y + window_guest_finance_widgets[WIDX_PAGE_BACKGROUND].top + 4;
|
||||
int32_t y = w->y + window_guest_finance_widgets[WIDX_PAGE_BACKGROUND].top + 4;
|
||||
|
||||
// Cash in pocket
|
||||
set_format_arg(0, money32, peep->cash_in_pocket);
|
||||
|
@ -1805,7 +1805,7 @@ void window_guest_finance_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
|||
// Paid on rides
|
||||
y += LIST_ROW_HEIGHT;
|
||||
set_format_arg(0, money32, peep->paid_on_rides);
|
||||
set_format_arg(4, uint16, peep->no_of_rides);
|
||||
set_format_arg(4, uint16_t, peep->no_of_rides);
|
||||
if (peep->no_of_rides != 1){
|
||||
gfx_draw_string_left(dpi, STR_GUEST_EXPENSES_RIDE_PLURAL, gCommonFormatArgs, COLOUR_BLACK, x, y);
|
||||
}
|
||||
|
@ -1816,7 +1816,7 @@ void window_guest_finance_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
|||
// Paid on food
|
||||
y += LIST_ROW_HEIGHT;
|
||||
set_format_arg(0, money32, peep->paid_on_food);
|
||||
set_format_arg(4, uint16, peep->no_of_food);
|
||||
set_format_arg(4, uint16_t, peep->no_of_food);
|
||||
if (peep->no_of_food != 1){
|
||||
gfx_draw_string_left(dpi, STR_GUEST_EXPENSES_FOOD_PLURAL, gCommonFormatArgs, COLOUR_BLACK, x, y);
|
||||
}
|
||||
|
@ -1827,7 +1827,7 @@ void window_guest_finance_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
|||
// Paid on drinks
|
||||
y += LIST_ROW_HEIGHT;
|
||||
set_format_arg(0, money32, peep->paid_on_drink);
|
||||
set_format_arg(4, uint16, peep->no_of_drinks);
|
||||
set_format_arg(4, uint16_t, peep->no_of_drinks);
|
||||
if (peep->no_of_drinks != 1){
|
||||
gfx_draw_string_left(dpi, STR_GUEST_EXPENSES_DRINK_PLURAL, gCommonFormatArgs, COLOUR_BLACK, x, y);
|
||||
}
|
||||
|
@ -1838,7 +1838,7 @@ void window_guest_finance_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
|||
// Paid on souvenirs
|
||||
y += LIST_ROW_HEIGHT;
|
||||
set_format_arg(0, money32, peep->paid_on_souvenirs);
|
||||
set_format_arg(4, uint16, peep->no_of_souvenirs);
|
||||
set_format_arg(4, uint16_t, peep->no_of_souvenirs);
|
||||
if (peep->no_of_souvenirs != 1){
|
||||
gfx_draw_string_left(dpi, STR_GUEST_EXPENSES_SOUVENIR_PLURAL, gCommonFormatArgs, COLOUR_BLACK, x, y);
|
||||
}
|
||||
|
@ -1890,7 +1890,7 @@ void window_guest_thoughts_invalidate(rct_window *w)
|
|||
rct_peep* peep = GET_PEEP(w->number);
|
||||
|
||||
set_format_arg(0, rct_string_id, peep->name_string_idx);
|
||||
set_format_arg(2, uint32, peep->id);
|
||||
set_format_arg(2, uint32_t, peep->id);
|
||||
|
||||
window_guest_thoughts_widgets[WIDX_BACKGROUND].right = w->width - 1;
|
||||
window_guest_thoughts_widgets[WIDX_BACKGROUND].bottom = w->height - 1;
|
||||
|
@ -1923,9 +1923,9 @@ void window_guest_thoughts_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
|||
rct_peep* peep = GET_PEEP(w->number);
|
||||
|
||||
// cx
|
||||
sint32 x = w->x + window_guest_thoughts_widgets[WIDX_PAGE_BACKGROUND].left + 4;
|
||||
int32_t x = w->x + window_guest_thoughts_widgets[WIDX_PAGE_BACKGROUND].left + 4;
|
||||
// dx
|
||||
sint32 y = w->y + window_guest_thoughts_widgets[WIDX_PAGE_BACKGROUND].top + 4;
|
||||
int32_t y = w->y + window_guest_thoughts_widgets[WIDX_PAGE_BACKGROUND].top + 4;
|
||||
|
||||
gfx_draw_string_left(dpi, STR_GUEST_RECENT_THOUGHTS_LABEL, nullptr, COLOUR_BLACK, x, y);
|
||||
|
||||
|
@ -1934,7 +1934,7 @@ void window_guest_thoughts_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
|||
if (thought->type == PEEP_THOUGHT_TYPE_NONE) return;
|
||||
if (thought->freshness == 0) continue;
|
||||
|
||||
sint32 width = window_guest_thoughts_widgets[WIDX_PAGE_BACKGROUND].right
|
||||
int32_t width = window_guest_thoughts_widgets[WIDX_PAGE_BACKGROUND].right
|
||||
- window_guest_thoughts_widgets[WIDX_PAGE_BACKGROUND].left
|
||||
- 8;
|
||||
|
||||
|
@ -1990,7 +1990,7 @@ void window_guest_inventory_invalidate(rct_window *w)
|
|||
rct_peep* peep = GET_PEEP(w->number);
|
||||
|
||||
set_format_arg(0, rct_string_id, peep->name_string_idx);
|
||||
set_format_arg(2, uint32, peep->id);
|
||||
set_format_arg(2, uint32_t, peep->id);
|
||||
|
||||
window_guest_inventory_widgets[WIDX_BACKGROUND].right = w->width - 1;
|
||||
window_guest_inventory_widgets[WIDX_BACKGROUND].bottom = w->height - 1;
|
||||
|
@ -2006,46 +2006,46 @@ void window_guest_inventory_invalidate(rct_window *w)
|
|||
window_align_tabs(w, WIDX_TAB_1, WIDX_TAB_6);
|
||||
}
|
||||
|
||||
static rct_string_id window_guest_inventory_format_item(rct_peep *peep, sint32 item)
|
||||
static rct_string_id window_guest_inventory_format_item(rct_peep *peep, int32_t item)
|
||||
{
|
||||
Ride *ride;
|
||||
|
||||
// Default arguments
|
||||
set_format_arg(0, uint32, ShopItemImage[item]);
|
||||
set_format_arg(0, uint32_t, ShopItemImage[item]);
|
||||
set_format_arg(4, rct_string_id, ShopItemStringIds[item].display);
|
||||
set_format_arg(6, rct_string_id, gParkName);
|
||||
set_format_arg(8, uint32, gParkNameArgs);
|
||||
set_format_arg(8, uint32_t, gParkNameArgs);
|
||||
|
||||
// Special overrides
|
||||
switch (item) {
|
||||
case SHOP_ITEM_BALLOON:
|
||||
set_format_arg(0, uint32, SPRITE_ID_PALETTE_COLOUR_1(peep->balloon_colour) | ShopItemImage[item]);
|
||||
set_format_arg(0, uint32_t, SPRITE_ID_PALETTE_COLOUR_1(peep->balloon_colour) | ShopItemImage[item]);
|
||||
break;
|
||||
case SHOP_ITEM_PHOTO:
|
||||
ride = get_ride(peep->photo1_ride_ref);
|
||||
set_format_arg(6, rct_string_id, ride->name);
|
||||
set_format_arg(8, uint32, ride->name_arguments);
|
||||
set_format_arg(8, uint32_t, ride->name_arguments);
|
||||
break;
|
||||
case SHOP_ITEM_UMBRELLA:
|
||||
set_format_arg(0, uint32, SPRITE_ID_PALETTE_COLOUR_1(peep->umbrella_colour) | ShopItemImage[item]);
|
||||
set_format_arg(0, uint32_t, SPRITE_ID_PALETTE_COLOUR_1(peep->umbrella_colour) | ShopItemImage[item]);
|
||||
break;
|
||||
case SHOP_ITEM_VOUCHER:
|
||||
switch (peep->voucher_type) {
|
||||
case VOUCHER_TYPE_PARK_ENTRY_FREE:
|
||||
set_format_arg(6, rct_string_id, STR_PEEP_INVENTORY_VOUCHER_PARK_ENTRY_FREE);
|
||||
set_format_arg(8, rct_string_id, gParkName);
|
||||
set_format_arg(10, uint32, gParkNameArgs);
|
||||
set_format_arg(10, uint32_t, gParkNameArgs);
|
||||
break;
|
||||
case VOUCHER_TYPE_RIDE_FREE:
|
||||
ride = get_ride(peep->voucher_arguments);
|
||||
set_format_arg(6, rct_string_id, STR_PEEP_INVENTORY_VOUCHER_RIDE_FREE);
|
||||
set_format_arg(8, rct_string_id, ride->name);
|
||||
set_format_arg(10, uint32, ride->name_arguments);
|
||||
set_format_arg(10, uint32_t, ride->name_arguments);
|
||||
break;
|
||||
case VOUCHER_TYPE_PARK_ENTRY_HALF_PRICE:
|
||||
set_format_arg(6, rct_string_id, STR_PEEP_INVENTORY_VOUCHER_PARK_ENTRY_HALF_PRICE);
|
||||
set_format_arg(8, rct_string_id, gParkName);
|
||||
set_format_arg(10, uint32, gParkNameArgs);
|
||||
set_format_arg(10, uint32_t, gParkNameArgs);
|
||||
break;
|
||||
case VOUCHER_TYPE_FOOD_OR_DRINK_FREE:
|
||||
set_format_arg(6, rct_string_id, STR_PEEP_INVENTORY_VOUCHER_FOOD_OR_DRINK_FREE);
|
||||
|
@ -2054,25 +2054,25 @@ static rct_string_id window_guest_inventory_format_item(rct_peep *peep, sint32 i
|
|||
}
|
||||
break;
|
||||
case SHOP_ITEM_HAT:
|
||||
set_format_arg(0, uint32, SPRITE_ID_PALETTE_COLOUR_1(peep->hat_colour) | ShopItemImage[item]);
|
||||
set_format_arg(0, uint32_t, SPRITE_ID_PALETTE_COLOUR_1(peep->hat_colour) | ShopItemImage[item]);
|
||||
break;
|
||||
case SHOP_ITEM_TSHIRT:
|
||||
set_format_arg(0, uint32, SPRITE_ID_PALETTE_COLOUR_1(peep->tshirt_colour) | ShopItemImage[item]);
|
||||
set_format_arg(0, uint32_t, SPRITE_ID_PALETTE_COLOUR_1(peep->tshirt_colour) | ShopItemImage[item]);
|
||||
break;
|
||||
case SHOP_ITEM_PHOTO2:
|
||||
ride = get_ride(peep->photo2_ride_ref);
|
||||
set_format_arg(6, rct_string_id, ride->name);
|
||||
set_format_arg(8, uint32, ride->name_arguments);
|
||||
set_format_arg(8, uint32_t, ride->name_arguments);
|
||||
break;
|
||||
case SHOP_ITEM_PHOTO3:
|
||||
ride = get_ride(peep->photo3_ride_ref);
|
||||
set_format_arg(6, rct_string_id, ride->name);
|
||||
set_format_arg(8, uint32, ride->name_arguments);
|
||||
set_format_arg(8, uint32_t, ride->name_arguments);
|
||||
break;
|
||||
case SHOP_ITEM_PHOTO4:
|
||||
ride = get_ride(peep->photo4_ride_ref);
|
||||
set_format_arg(6, rct_string_id, ride->name);
|
||||
set_format_arg(8, uint32, ride->name_arguments);
|
||||
set_format_arg(8, uint32_t, ride->name_arguments);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -2096,17 +2096,17 @@ void window_guest_inventory_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
|||
rct_peep *peep = GET_PEEP(w->number);
|
||||
|
||||
rct_widget *pageBackgroundWidget = &window_guest_inventory_widgets[WIDX_PAGE_BACKGROUND];
|
||||
sint32 x = w->x + pageBackgroundWidget->left + 4;
|
||||
sint32 y = w->y + pageBackgroundWidget->top + 2;
|
||||
sint32 itemNameWidth = pageBackgroundWidget->right - pageBackgroundWidget->left - 8;
|
||||
int32_t x = w->x + pageBackgroundWidget->left + 4;
|
||||
int32_t y = w->y + pageBackgroundWidget->top + 2;
|
||||
int32_t itemNameWidth = pageBackgroundWidget->right - pageBackgroundWidget->left - 8;
|
||||
|
||||
sint32 maxY = w->y + w->height - 22;
|
||||
sint32 numItems = 0;
|
||||
int32_t maxY = w->y + w->height - 22;
|
||||
int32_t numItems = 0;
|
||||
|
||||
gfx_draw_string_left(dpi, STR_CARRYING, nullptr, COLOUR_BLACK, x, y);
|
||||
y += 10;
|
||||
|
||||
for (sint32 item = 0; item < SHOP_ITEM_COUNT; item++) {
|
||||
for (int32_t item = 0; item < SHOP_ITEM_COUNT; item++) {
|
||||
if (y >= maxY) break;
|
||||
if (!peep->HasItem(item)) continue;
|
||||
|
||||
|
|
|
@ -89,20 +89,20 @@ static rct_widget window_guest_list_widgets[] = {
|
|||
{ WIDGETS_END },
|
||||
};
|
||||
|
||||
static constexpr const uint8 SUMMARISED_GUEST_ROW_HEIGHT = SCROLLABLE_ROW_HEIGHT + 11;
|
||||
static constexpr const uint8_t SUMMARISED_GUEST_ROW_HEIGHT = SCROLLABLE_ROW_HEIGHT + 11;
|
||||
|
||||
static void window_guest_list_mouseup(rct_window *w, rct_widgetindex widgetIndex);
|
||||
static void window_guest_list_resize(rct_window *w);
|
||||
static void window_guest_list_mousedown(rct_window *w, rct_widgetindex widgetIndex, rct_widget* widget);
|
||||
static void window_guest_list_dropdown(rct_window *w, rct_widgetindex widgetIndex, sint32 dropdownIndex);
|
||||
static void window_guest_list_dropdown(rct_window *w, rct_widgetindex widgetIndex, int32_t dropdownIndex);
|
||||
static void window_guest_list_update(rct_window *w);
|
||||
static void window_guest_list_scrollgetsize(rct_window *w, sint32 scrollIndex, sint32 *width, sint32 *height);
|
||||
static void window_guest_list_scrollmousedown(rct_window *w, sint32 scrollIndex, sint32 x, sint32 y);
|
||||
static void window_guest_list_scrollmouseover(rct_window *w, sint32 scrollIndex, sint32 x, sint32 y);
|
||||
static void window_guest_list_scrollgetsize(rct_window *w, int32_t scrollIndex, int32_t *width, int32_t *height);
|
||||
static void window_guest_list_scrollmousedown(rct_window *w, int32_t scrollIndex, int32_t x, int32_t y);
|
||||
static void window_guest_list_scrollmouseover(rct_window *w, int32_t scrollIndex, int32_t x, int32_t y);
|
||||
static void window_guest_list_tooltip(rct_window* w, rct_widgetindex widgetIndex, rct_string_id *stringId);
|
||||
static void window_guest_list_invalidate(rct_window *w);
|
||||
static void window_guest_list_paint(rct_window *w, rct_drawpixelinfo *dpi);
|
||||
static void window_guest_list_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, sint32 scrollIndex);
|
||||
static void window_guest_list_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, int32_t scrollIndex);
|
||||
static void window_guest_list_textinput(rct_window *w, rct_widgetindex widgetIndex, char *text);
|
||||
|
||||
static rct_window_event_list window_guest_list_events = {
|
||||
|
@ -137,32 +137,32 @@ static rct_window_event_list window_guest_list_events = {
|
|||
};
|
||||
// clang-format on
|
||||
|
||||
static uint32 _window_guest_list_last_find_groups_tick;
|
||||
static uint32 _window_guest_list_last_find_groups_selected_view;
|
||||
static uint32 _window_guest_list_last_find_groups_wait;
|
||||
static uint32_t _window_guest_list_last_find_groups_tick;
|
||||
static uint32_t _window_guest_list_last_find_groups_selected_view;
|
||||
static uint32_t _window_guest_list_last_find_groups_wait;
|
||||
|
||||
static sint32 _window_guest_list_highlighted_index; // 0x00F1EE10
|
||||
static sint32 _window_guest_list_selected_tab; // 0x00F1EE12
|
||||
static sint32 _window_guest_list_selected_filter; // 0x00F1EE06
|
||||
static sint32 _window_guest_list_selected_page; // 0x00F1EE07
|
||||
static uint32 _window_guest_list_selected_view; // 0x00F1EE13
|
||||
static sint32 _window_guest_list_num_pages; // 0x00F1EE08
|
||||
static sint32 _window_guest_list_num_groups; // 0x00F1AF22
|
||||
static int32_t _window_guest_list_highlighted_index; // 0x00F1EE10
|
||||
static int32_t _window_guest_list_selected_tab; // 0x00F1EE12
|
||||
static int32_t _window_guest_list_selected_filter; // 0x00F1EE06
|
||||
static int32_t _window_guest_list_selected_page; // 0x00F1EE07
|
||||
static uint32_t _window_guest_list_selected_view; // 0x00F1EE13
|
||||
static int32_t _window_guest_list_num_pages; // 0x00F1EE08
|
||||
static int32_t _window_guest_list_num_groups; // 0x00F1AF22
|
||||
static bool _window_guest_list_tracking_only;
|
||||
static uint16 _window_guest_list_filter_arguments[4];
|
||||
static uint16_t _window_guest_list_filter_arguments[4];
|
||||
|
||||
static uint16 _window_guest_list_groups_num_guests[240];
|
||||
static uint32 _window_guest_list_groups_argument_1[240];
|
||||
static uint32 _window_guest_list_groups_argument_2[240];
|
||||
static uint8 _window_guest_list_groups_guest_faces[240 * 58];
|
||||
static uint8 _window_guest_list_group_index[240];
|
||||
static uint16_t _window_guest_list_groups_num_guests[240];
|
||||
static uint32_t _window_guest_list_groups_argument_1[240];
|
||||
static uint32_t _window_guest_list_groups_argument_2[240];
|
||||
static uint8_t _window_guest_list_groups_guest_faces[240 * 58];
|
||||
static uint8_t _window_guest_list_group_index[240];
|
||||
|
||||
static char _window_guest_list_filter_name[32];
|
||||
|
||||
static sint32 window_guest_list_is_peep_in_filter(rct_peep* peep);
|
||||
static int32_t window_guest_list_is_peep_in_filter(rct_peep* peep);
|
||||
static void window_guest_list_find_groups();
|
||||
|
||||
static void get_arguments_from_peep(rct_peep *peep, uint32 *argument_1, uint32* argument_2);
|
||||
static void get_arguments_from_peep(rct_peep *peep, uint32_t *argument_1, uint32_t* argument_2);
|
||||
|
||||
static bool guest_should_be_visible(rct_peep *peep);
|
||||
|
||||
|
@ -237,7 +237,7 @@ void window_guest_list_refresh_list()
|
|||
*
|
||||
* @param index The number of the ride or index of the thought
|
||||
*/
|
||||
rct_window * window_guest_list_open_with_filter(sint32 type, sint32 index)
|
||||
rct_window * window_guest_list_open_with_filter(int32_t type, int32_t index)
|
||||
{
|
||||
rct_window * w = window_guest_list_open();
|
||||
|
||||
|
@ -377,7 +377,7 @@ static void window_guest_list_resize(rct_window *w)
|
|||
*/
|
||||
static void window_guest_list_mousedown(rct_window *w, rct_widgetindex widgetIndex, rct_widget* widget)
|
||||
{
|
||||
sint32 i;
|
||||
int32_t i;
|
||||
switch (widgetIndex) {
|
||||
case WIDX_TAB_1:
|
||||
case WIDX_TAB_2:
|
||||
|
@ -449,7 +449,7 @@ static void window_guest_list_mousedown(rct_window *w, rct_widgetindex widgetInd
|
|||
*
|
||||
* rct2: 0x00699AE1
|
||||
*/
|
||||
static void window_guest_list_dropdown(rct_window *w, rct_widgetindex widgetIndex, sint32 dropdownIndex)
|
||||
static void window_guest_list_dropdown(rct_window *w, rct_widgetindex widgetIndex, int32_t dropdownIndex)
|
||||
{
|
||||
switch (widgetIndex) {
|
||||
case WIDX_PAGE_DROPDOWN_BUTTON:
|
||||
|
@ -486,9 +486,9 @@ static void window_guest_list_update(rct_window *w)
|
|||
*
|
||||
* rct2: 0x00699C55
|
||||
*/
|
||||
static void window_guest_list_scrollgetsize(rct_window *w, sint32 scrollIndex, sint32 *width, sint32 *height)
|
||||
static void window_guest_list_scrollgetsize(rct_window *w, int32_t scrollIndex, int32_t *width, int32_t *height)
|
||||
{
|
||||
sint32 i, y, numGuests, spriteIndex;
|
||||
int32_t i, y, numGuests, spriteIndex;
|
||||
rct_peep *peep;
|
||||
|
||||
switch (_window_guest_list_selected_tab) {
|
||||
|
@ -508,7 +508,7 @@ static void window_guest_list_scrollgetsize(rct_window *w, sint32 scrollIndex, s
|
|||
}
|
||||
w->var_492 = numGuests;
|
||||
y = numGuests * SCROLLABLE_ROW_HEIGHT;
|
||||
_window_guest_list_num_pages = (sint32) std::ceil((float)numGuests / 3173);
|
||||
_window_guest_list_num_pages = (int32_t) std::ceil((float)numGuests / 3173);
|
||||
if (_window_guest_list_num_pages == 0)
|
||||
_window_guest_list_selected_page = 0;
|
||||
else if (_window_guest_list_selected_page >= _window_guest_list_num_pages)
|
||||
|
@ -553,9 +553,9 @@ static void window_guest_list_scrollgetsize(rct_window *w, sint32 scrollIndex, s
|
|||
*
|
||||
* rct2: 0x00699D7D
|
||||
*/
|
||||
static void window_guest_list_scrollmousedown(rct_window *w, sint32 scrollIndex, sint32 x, sint32 y)
|
||||
static void window_guest_list_scrollmousedown(rct_window *w, int32_t scrollIndex, int32_t x, int32_t y)
|
||||
{
|
||||
sint32 i, spriteIndex;
|
||||
int32_t i, spriteIndex;
|
||||
rct_peep *peep;
|
||||
|
||||
switch (_window_guest_list_selected_tab) {
|
||||
|
@ -600,9 +600,9 @@ static void window_guest_list_scrollmousedown(rct_window *w, sint32 scrollIndex,
|
|||
*
|
||||
* rct2: 0x00699D3B
|
||||
*/
|
||||
static void window_guest_list_scrollmouseover(rct_window *w, sint32 scrollIndex, sint32 x, sint32 y)
|
||||
static void window_guest_list_scrollmouseover(rct_window *w, int32_t scrollIndex, int32_t x, int32_t y)
|
||||
{
|
||||
sint32 i;
|
||||
int32_t i;
|
||||
|
||||
i = y / (_window_guest_list_selected_tab == PAGE_INDIVIDUAL ? SCROLLABLE_ROW_HEIGHT : SUMMARISED_GUEST_ROW_HEIGHT);
|
||||
i += _window_guest_list_selected_page * 3173;
|
||||
|
@ -668,7 +668,7 @@ static void window_guest_list_invalidate(rct_window *w)
|
|||
*/
|
||||
static void window_guest_list_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
||||
{
|
||||
sint32 i, x, y;
|
||||
int32_t i, x, y;
|
||||
rct_string_id format;
|
||||
|
||||
// Widgets
|
||||
|
@ -715,7 +715,7 @@ static void window_guest_list_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
|||
if (_window_guest_list_selected_tab == PAGE_INDIVIDUAL) {
|
||||
x = w->x + 4;
|
||||
y = w->y + window_guest_list_widgets[WIDX_GUEST_LIST].bottom + 2;
|
||||
set_format_arg(0, sint16, w->var_492);
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
@ -724,13 +724,13 @@ static void window_guest_list_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
|||
*
|
||||
* rct2: 0x00699701
|
||||
*/
|
||||
static void window_guest_list_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, sint32 scrollIndex)
|
||||
static void window_guest_list_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, int32_t scrollIndex)
|
||||
{
|
||||
sint32 spriteIndex, numGuests, i, j, y;
|
||||
int32_t spriteIndex, numGuests, i, j, y;
|
||||
rct_string_id format;
|
||||
rct_peep *peep;
|
||||
rct_peep_thought *thought;
|
||||
uint32 argument_1, argument_2;
|
||||
uint32_t argument_1, argument_2;
|
||||
|
||||
// Background fill
|
||||
gfx_fill_rect(dpi, dpi->x, dpi->y, dpi->x + dpi->width - 1, dpi->y + dpi->height - 1, ColourMapA[w->colours[1]].mid_light);
|
||||
|
@ -769,7 +769,7 @@ static void window_guest_list_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi,
|
|||
|
||||
// Guest name
|
||||
set_format_arg(0, rct_string_id, peep->name_string_idx);
|
||||
set_format_arg(2, uint32, peep->id);
|
||||
set_format_arg(2, uint32_t, peep->id);
|
||||
gfx_draw_string_left_clipped(dpi, format, gCommonFormatArgs, COLOUR_BLACK, 0, y, 113);
|
||||
|
||||
switch (_window_guest_list_selected_view) {
|
||||
|
@ -785,8 +785,8 @@ static void window_guest_list_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi,
|
|||
|
||||
get_arguments_from_action(peep, &argument_1, &argument_2);
|
||||
|
||||
set_format_arg(0, uint32, argument_1);
|
||||
set_format_arg(4, uint32, argument_2);
|
||||
set_format_arg(0, uint32_t, argument_1);
|
||||
set_format_arg(4, uint32_t, argument_2);
|
||||
gfx_draw_string_left_clipped(dpi, format, gCommonFormatArgs, COLOUR_BLACK, 133, y, 314);
|
||||
break;
|
||||
case VIEW_THOUGHTS:
|
||||
|
@ -837,9 +837,9 @@ static void window_guest_list_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi,
|
|||
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);
|
||||
|
||||
// Draw action
|
||||
set_format_arg(0, uint32, _window_guest_list_groups_argument_1[i]);
|
||||
set_format_arg(4, uint32, _window_guest_list_groups_argument_2[i]);
|
||||
set_format_arg(10, uint32, numGuests);
|
||||
set_format_arg(0, uint32_t, _window_guest_list_groups_argument_1[i]);
|
||||
set_format_arg(4, uint32_t, _window_guest_list_groups_argument_2[i]);
|
||||
set_format_arg(10, uint32_t, numGuests);
|
||||
gfx_draw_string_left_clipped(dpi, format, gCommonFormatArgs, COLOUR_BLACK, 0, y, 414);
|
||||
|
||||
// Draw guest count
|
||||
|
@ -865,13 +865,13 @@ static void window_guest_list_textinput(rct_window *w, rct_widgetindex widgetInd
|
|||
* returns 0 for in filter and 1 for not in filter
|
||||
* rct2: 0x0069B865
|
||||
*/
|
||||
static sint32 window_guest_list_is_peep_in_filter(rct_peep* peep)
|
||||
static int32_t window_guest_list_is_peep_in_filter(rct_peep* peep)
|
||||
{
|
||||
char temp;
|
||||
|
||||
temp = _window_guest_list_selected_view;
|
||||
_window_guest_list_selected_view = _window_guest_list_selected_filter;
|
||||
uint32 argument1, argument2;
|
||||
uint32_t argument1, argument2;
|
||||
get_arguments_from_peep(peep, &argument1, &argument2);
|
||||
|
||||
_window_guest_list_selected_view = temp;
|
||||
|
@ -879,8 +879,8 @@ static sint32 window_guest_list_is_peep_in_filter(rct_peep* peep)
|
|||
if (_window_guest_list_filter_arguments[0] == 0xFFFF && _window_guest_list_selected_filter == 1)
|
||||
argument1 |= 0xFFFF;
|
||||
|
||||
uint32 check1 = _window_guest_list_filter_arguments[0] | (_window_guest_list_filter_arguments[1] << 16);
|
||||
uint32 check2 = _window_guest_list_filter_arguments[2] | (_window_guest_list_filter_arguments[3] << 16);
|
||||
uint32_t check1 = _window_guest_list_filter_arguments[0] | (_window_guest_list_filter_arguments[1] << 16);
|
||||
uint32_t check2 = _window_guest_list_filter_arguments[2] | (_window_guest_list_filter_arguments[3] << 16);
|
||||
if (argument1 == check1 && argument2 == check2) {
|
||||
return 0;
|
||||
}
|
||||
|
@ -894,7 +894,7 @@ static sint32 window_guest_list_is_peep_in_filter(rct_peep* peep)
|
|||
* argument_1 (0x013CE952) gCommonFormatArgs
|
||||
* argument_2 (0x013CE954) gCommonFormatArgs + 2
|
||||
*/
|
||||
static void get_arguments_from_peep(rct_peep *peep, uint32 *argument_1, uint32* argument_2)
|
||||
static void get_arguments_from_peep(rct_peep *peep, uint32_t *argument_1, uint32_t* argument_2)
|
||||
{
|
||||
switch (_window_guest_list_selected_view) {
|
||||
case VIEW_ACTIONS:
|
||||
|
@ -905,7 +905,7 @@ static void get_arguments_from_peep(rct_peep *peep, uint32 *argument_1, uint32*
|
|||
rct_peep_thought *thought = &peep->thoughts[0];
|
||||
if (thought->freshness <= 5 && thought->type != PEEP_THOUGHT_TYPE_NONE) {
|
||||
// HACK The out arguments here are used to draw the group text so we just return
|
||||
// gCommonFormatArgs as two uint32s.
|
||||
// gCommonFormatArgs as two uint32_ts.
|
||||
memset(gCommonFormatArgs, 0, sizeof(*argument_1) + sizeof(*argument_2));
|
||||
peep_thought_set_format_args(thought);
|
||||
memcpy(argument_1, gCommonFormatArgs, sizeof(*argument_1));
|
||||
|
@ -929,10 +929,10 @@ static void get_arguments_from_peep(rct_peep *peep, uint32 *argument_1, uint32*
|
|||
*/
|
||||
static void window_guest_list_find_groups()
|
||||
{
|
||||
sint32 spriteIndex, spriteIndex2, groupIndex, faceIndex;
|
||||
int32_t spriteIndex, spriteIndex2, groupIndex, faceIndex;
|
||||
rct_peep *peep, *peep2;
|
||||
|
||||
uint32 tick256 = floor2(gScenarioTicks, 256);
|
||||
uint32_t tick256 = floor2(gScenarioTicks, 256);
|
||||
if (_window_guest_list_selected_view == _window_guest_list_last_find_groups_selected_view) {
|
||||
if (_window_guest_list_last_find_groups_wait != 0 ||
|
||||
_window_guest_list_last_find_groups_tick == tick256
|
||||
|
@ -978,7 +978,7 @@ static void window_guest_list_find_groups()
|
|||
if (peep2->outside_of_park != 0 || !(peep2->flags & SPRITE_FLAGS_PEEP_VISIBLE))
|
||||
continue;
|
||||
|
||||
uint32 argument1, argument2;
|
||||
uint32_t argument1, argument2;
|
||||
// Get and check if in same group
|
||||
get_arguments_from_peep(peep2, &argument1, &argument2);
|
||||
if (argument1 != _window_guest_list_groups_argument_1[groupIndex] || argument2 != _window_guest_list_groups_argument_2[groupIndex] )
|
||||
|
@ -999,8 +999,8 @@ static void window_guest_list_find_groups()
|
|||
continue;
|
||||
}
|
||||
|
||||
sint32 curr_num_guests = _window_guest_list_groups_num_guests[groupIndex];
|
||||
sint32 swap_position = 0;
|
||||
int32_t curr_num_guests = _window_guest_list_groups_num_guests[groupIndex];
|
||||
int32_t swap_position = 0;
|
||||
//This section places the groups in size order.
|
||||
bool gotoNextPeep = false;
|
||||
while (1) {
|
||||
|
@ -1016,12 +1016,12 @@ static void window_guest_list_find_groups()
|
|||
continue;
|
||||
}
|
||||
|
||||
sint32 argument_1 = _window_guest_list_groups_argument_1[groupIndex];
|
||||
sint32 argument_2 = _window_guest_list_groups_argument_2[groupIndex];
|
||||
sint32 bl = _window_guest_list_group_index[groupIndex];
|
||||
int32_t argument_1 = _window_guest_list_groups_argument_1[groupIndex];
|
||||
int32_t argument_2 = _window_guest_list_groups_argument_2[groupIndex];
|
||||
int32_t bl = _window_guest_list_group_index[groupIndex];
|
||||
|
||||
do {
|
||||
sint32 temp = curr_num_guests;
|
||||
int32_t temp = curr_num_guests;
|
||||
curr_num_guests = _window_guest_list_groups_num_guests[swap_position];
|
||||
_window_guest_list_groups_num_guests[swap_position] = temp;
|
||||
|
||||
|
@ -1033,7 +1033,7 @@ static void window_guest_list_find_groups()
|
|||
argument_2 = _window_guest_list_groups_argument_2[swap_position];
|
||||
_window_guest_list_groups_argument_2[swap_position] = temp;
|
||||
|
||||
uint8 temp_faces[56];
|
||||
uint8_t temp_faces[56];
|
||||
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);
|
||||
memcpy(&(_window_guest_list_groups_guest_faces[swap_position * 56]), temp_faces, 56);
|
||||
|
@ -1055,7 +1055,7 @@ static bool guest_should_be_visible(rct_peep *peep)
|
|||
char formatted[256];
|
||||
|
||||
set_format_arg(0, rct_string_id, peep->name_string_idx);
|
||||
set_format_arg(2, uint32, peep->id);
|
||||
set_format_arg(2, uint32_t, peep->id);
|
||||
format_string(formatted, sizeof(formatted), peep->name_string_idx, gCommonFormatArgs);
|
||||
|
||||
if (strcasestr(formatted, _window_guest_list_filter_name) == nullptr)
|
||||
|
|
|
@ -95,7 +95,7 @@ static rct_window_event_list window_install_track_events = {
|
|||
static rct_track_td6 * _trackDesign;
|
||||
static std::string _trackPath;
|
||||
static std::string _trackName;
|
||||
static std::vector<uint8> _trackDesignPreviewPixels;
|
||||
static std::vector<uint8_t> _trackDesignPreviewPixels;
|
||||
|
||||
static void window_install_track_update_preview();
|
||||
static void window_install_track_design(rct_window *w);
|
||||
|
@ -128,10 +128,10 @@ rct_window * window_install_track_open(const utf8 *path)
|
|||
gTrackDesignSceneryToggle = false;
|
||||
_currentTrackPieceDirection = 2;
|
||||
|
||||
sint32 screenWidth = context_get_width();
|
||||
sint32 screenHeight = context_get_height();
|
||||
sint32 x = screenWidth / 2 - 201;
|
||||
sint32 y = std::max(TOP_TOOLBAR_HEIGHT + 1, screenHeight / 2 - 200);
|
||||
int32_t screenWidth = context_get_width();
|
||||
int32_t screenHeight = context_get_height();
|
||||
int32_t x = screenWidth / 2 - 201;
|
||||
int32_t y = std::max(TOP_TOOLBAR_HEIGHT + 1, screenHeight / 2 - 200);
|
||||
|
||||
rct_window *w = window_create(x, y, WW, WH, &window_install_track_events, WC_INSTALL_TRACK, 0);
|
||||
w->widgets = window_install_track_widgets;
|
||||
|
@ -222,9 +222,9 @@ static void window_install_track_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
|||
|
||||
// Track preview
|
||||
rct_widget *widget = &window_install_track_widgets[WIDX_TRACK_PREVIEW];
|
||||
sint32 x = w->x + widget->left + 1;
|
||||
sint32 y = w->y + widget->top + 1;
|
||||
sint32 colour = ColourMapA[w->colours[0]].darkest;
|
||||
int32_t x = w->x + widget->left + 1;
|
||||
int32_t y = w->y + widget->top + 1;
|
||||
int32_t colour = ColourMapA[w->colours[0]].darkest;
|
||||
gfx_fill_rect(dpi, x, y, x + 369, y + 216, colour);
|
||||
|
||||
rct_g1_element g1temp = {};
|
||||
|
@ -265,7 +265,7 @@ static void window_install_track_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
|||
void * objectEntry = object_manager_load_object(&td6->vehicle_object);
|
||||
if (objectEntry != nullptr)
|
||||
{
|
||||
sint32 groupIndex = object_manager_get_loaded_object_entry_index(objectEntry);
|
||||
int32_t groupIndex = object_manager_get_loaded_object_entry_index(objectEntry);
|
||||
rideName = get_ride_naming(td6->type, get_ride_entry(groupIndex));
|
||||
friendlyTrackName = rideName.name;
|
||||
}
|
||||
|
@ -296,14 +296,14 @@ static void window_install_track_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
|||
if (td6->type == RIDE_TYPE_MINI_GOLF)
|
||||
{
|
||||
// Holes
|
||||
uint16 holes = td6->holes & 0x1F;
|
||||
uint16_t holes = td6->holes & 0x1F;
|
||||
gfx_draw_string_left(dpi, STR_HOLES, &holes, COLOUR_BLACK, x, y);
|
||||
y += LIST_ROW_HEIGHT;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Maximum speed
|
||||
uint16 speed = ((td6->max_speed << 16) * 9) >> 18;
|
||||
uint16_t speed = ((td6->max_speed << 16) * 9) >> 18;
|
||||
gfx_draw_string_left(dpi, STR_MAX_SPEED, &speed, COLOUR_BLACK, x, y);
|
||||
y += LIST_ROW_HEIGHT;
|
||||
|
||||
|
@ -315,7 +315,7 @@ static void window_install_track_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
|||
|
||||
// Ride length
|
||||
set_format_arg(0, rct_string_id, STR_RIDE_LENGTH_ENTRY);
|
||||
set_format_arg(2, uint16, td6->ride_length);
|
||||
set_format_arg(2, uint16_t, td6->ride_length);
|
||||
gfx_draw_string_left_clipped(dpi, STR_TRACK_LIST_RIDE_LENGTH, gCommonFormatArgs, COLOUR_BLACK, x, y, 214);
|
||||
y += LIST_ROW_HEIGHT;
|
||||
}
|
||||
|
@ -323,7 +323,7 @@ static void window_install_track_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
|||
if (ride_type_has_flag(td6->type, RIDE_TYPE_FLAG_HAS_G_FORCES))
|
||||
{
|
||||
// Maximum positive vertical Gs
|
||||
sint32 gForces = td6->max_positive_vertical_g * 32;
|
||||
int32_t gForces = td6->max_positive_vertical_g * 32;
|
||||
gfx_draw_string_left(dpi, STR_MAX_POSITIVE_VERTICAL_G, &gForces, COLOUR_BLACK, x, y);
|
||||
y += LIST_ROW_HEIGHT;
|
||||
|
||||
|
@ -343,7 +343,7 @@ static void window_install_track_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
|||
if (td6->total_air_time != 0)
|
||||
{
|
||||
// Total air time
|
||||
sint32 airTime = td6->total_air_time * 25;
|
||||
int32_t airTime = td6->total_air_time * 25;
|
||||
gfx_draw_string_left(dpi, STR_TOTAL_AIR_TIME, &airTime, COLOUR_BLACK, x, y);
|
||||
y += LIST_ROW_HEIGHT;
|
||||
}
|
||||
|
@ -353,7 +353,7 @@ static void window_install_track_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
|||
if (ride_type_has_flag(td6->type, RIDE_TYPE_FLAG_HAS_DROPS))
|
||||
{
|
||||
// Drops
|
||||
uint16 drops = td6->drops & 0x3F;
|
||||
uint16_t drops = td6->drops & 0x3F;
|
||||
gfx_draw_string_left(dpi, STR_DROPS, &drops, COLOUR_BLACK, x, y);
|
||||
y += LIST_ROW_HEIGHT;
|
||||
|
||||
|
@ -364,7 +364,7 @@ static void window_install_track_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
|||
|
||||
if (td6->type != RIDE_TYPE_MINI_GOLF)
|
||||
{
|
||||
uint16 inversions = td6->inversions & 0x1F;
|
||||
uint16_t inversions = td6->inversions & 0x1F;
|
||||
if (inversions != 0)
|
||||
{
|
||||
// Inversions
|
||||
|
@ -377,8 +377,8 @@ static void window_install_track_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
|||
if (td6->space_required_x != 0xFF)
|
||||
{
|
||||
// Space required
|
||||
set_format_arg(0, uint16, td6->space_required_x);
|
||||
set_format_arg(2, uint16, td6->space_required_y);
|
||||
set_format_arg(0, uint16_t, td6->space_required_x);
|
||||
set_format_arg(2, uint16_t, td6->space_required_y);
|
||||
gfx_draw_string_left(dpi, STR_TRACK_LIST_SPACE_REQUIRED, gCommonFormatArgs, COLOUR_BLACK, x, y);
|
||||
y += LIST_ROW_HEIGHT;
|
||||
}
|
||||
|
|
|
@ -53,7 +53,7 @@ static rct_widget window_land_widgets[] = {
|
|||
static void window_land_close(rct_window *w);
|
||||
static void window_land_mouseup(rct_window *w, rct_widgetindex widgetIndex);
|
||||
static void window_land_mousedown(rct_window *w, rct_widgetindex widgetIndex, rct_widget* widget);
|
||||
static void window_land_dropdown(rct_window *w, rct_widgetindex widgetIndex, sint32 dropdownIndex);
|
||||
static void window_land_dropdown(rct_window *w, rct_widgetindex widgetIndex, int32_t dropdownIndex);
|
||||
static void window_land_update(rct_window *w);
|
||||
static void window_land_invalidate(rct_window *w);
|
||||
static void window_land_paint(rct_window *w, rct_drawpixelinfo *dpi);
|
||||
|
@ -92,8 +92,8 @@ static rct_window_event_list window_land_events = {
|
|||
};
|
||||
// clang-format on
|
||||
|
||||
static sint32 _selectedFloorTexture;
|
||||
static sint32 _selectedWallTexture;
|
||||
static int32_t _selectedFloorTexture;
|
||||
static int32_t _selectedWallTexture;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -210,9 +210,9 @@ static void window_land_mousedown(rct_window *w, rct_widgetindex widgetIndex, rc
|
|||
*
|
||||
* rct2: 0x00664090
|
||||
*/
|
||||
static void window_land_dropdown(rct_window *w, rct_widgetindex widgetIndex, sint32 dropdownIndex)
|
||||
static void window_land_dropdown(rct_window *w, rct_widgetindex widgetIndex, int32_t dropdownIndex)
|
||||
{
|
||||
sint32 type;
|
||||
int32_t type;
|
||||
|
||||
switch (widgetIndex) {
|
||||
case WIDX_FLOOR:
|
||||
|
@ -221,7 +221,7 @@ static void window_land_dropdown(rct_window *w, rct_widgetindex widgetIndex, sin
|
|||
|
||||
type = (dropdownIndex == -1) ?
|
||||
_selectedFloorTexture :
|
||||
(uint32)gDropdownItemsArgs[dropdownIndex] - SPR_FLOOR_TEXTURE_GRASS;
|
||||
(uint32_t)gDropdownItemsArgs[dropdownIndex] - SPR_FLOOR_TEXTURE_GRASS;
|
||||
|
||||
if (gLandToolTerrainSurface == type) {
|
||||
gLandToolTerrainSurface = 255;
|
||||
|
@ -250,7 +250,7 @@ static void window_land_dropdown(rct_window *w, rct_widgetindex widgetIndex, sin
|
|||
|
||||
static void window_land_textinput(rct_window *w, rct_widgetindex widgetIndex, char *text)
|
||||
{
|
||||
sint32 size;
|
||||
int32_t size;
|
||||
char* end;
|
||||
|
||||
if (widgetIndex != WIDX_PREVIEW || text == nullptr)
|
||||
|
@ -311,7 +311,7 @@ static void window_land_invalidate(rct_window *w)
|
|||
*/
|
||||
static void window_land_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
||||
{
|
||||
sint32 x, y, numTiles;
|
||||
int32_t x, y, numTiles;
|
||||
money32 price;
|
||||
rct_widget *previewWidget = &window_land_widgets[WIDX_PREVIEW];
|
||||
|
||||
|
|
|
@ -52,9 +52,9 @@ static void window_land_rights_invalidate(rct_window *w);
|
|||
static void window_land_rights_paint(rct_window *w, rct_drawpixelinfo *dpi);
|
||||
static void window_land_rights_textinput(rct_window *w, rct_widgetindex widgetIndex, char *text);
|
||||
static void window_land_rights_inputsize(rct_window *w);
|
||||
static void window_land_rights_toolupdate(rct_window* w, rct_widgetindex widgetIndex, sint32 x, sint32 y);
|
||||
static void window_land_rights_tooldown(rct_window* w, rct_widgetindex widgetIndex, sint32 x, sint32 y);
|
||||
static void window_land_rights_tooldrag(rct_window* w, rct_widgetindex widgetIndex, sint32 x, sint32 y);
|
||||
static void window_land_rights_toolupdate(rct_window* w, rct_widgetindex widgetIndex, int32_t x, int32_t y);
|
||||
static void window_land_rights_tooldown(rct_window* w, rct_widgetindex widgetIndex, int32_t x, int32_t y);
|
||||
static void window_land_rights_tooldrag(rct_window* w, rct_widgetindex widgetIndex, int32_t x, int32_t y);
|
||||
static void window_land_rights_toolabort(rct_window *w, rct_widgetindex widgetIndex);
|
||||
static bool land_rights_tool_is_active();
|
||||
|
||||
|
@ -94,7 +94,7 @@ static rct_window_event_list window_land_rights_events = {
|
|||
#define LAND_RIGHTS_MODE_BUY_CONSTRUCTION_RIGHTS 0
|
||||
#define LAND_RIGHTS_MODE_BUY_LAND 1
|
||||
|
||||
static uint8 _landRightsMode;
|
||||
static uint8_t _landRightsMode;
|
||||
static money32 _landRightsCost;
|
||||
|
||||
rct_window * window_land_rights_open()
|
||||
|
@ -195,7 +195,7 @@ static void window_land_rights_mousedown(rct_window *w, rct_widgetindex widgetIn
|
|||
|
||||
static void window_land_rights_textinput(rct_window *w, rct_widgetindex widgetIndex, char *text)
|
||||
{
|
||||
sint32 size;
|
||||
int32_t size;
|
||||
char* end;
|
||||
|
||||
if (widgetIndex != WIDX_PREVIEW || text == nullptr)
|
||||
|
@ -254,7 +254,7 @@ static void window_land_rights_invalidate(rct_window *w)
|
|||
|
||||
static void window_land_rights_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
||||
{
|
||||
sint32 x, y;
|
||||
int32_t x, y;
|
||||
|
||||
x = w->x + (window_land_rights_widgets[WIDX_PREVIEW].left + window_land_rights_widgets[WIDX_PREVIEW].right) / 2;
|
||||
y = w->y + (window_land_rights_widgets[WIDX_PREVIEW].top + window_land_rights_widgets[WIDX_PREVIEW].bottom) / 2;
|
||||
|
@ -275,7 +275,7 @@ static void window_land_rights_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
|||
}
|
||||
}
|
||||
|
||||
static void window_land_rights_tool_update_land_rights(sint16 x, sint16 y)
|
||||
static void window_land_rights_tool_update_land_rights(int16_t x, int16_t y)
|
||||
{
|
||||
map_invalidate_selection_rect();
|
||||
gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE;
|
||||
|
@ -291,7 +291,7 @@ static void window_land_rights_tool_update_land_rights(sint16 x, sint16 y)
|
|||
return;
|
||||
}
|
||||
|
||||
uint8 state_changed = 0;
|
||||
uint8_t state_changed = 0;
|
||||
|
||||
if (!(gMapSelectFlags & MAP_SELECT_FLAG_ENABLE)) {
|
||||
gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE;
|
||||
|
@ -303,11 +303,11 @@ static void window_land_rights_tool_update_land_rights(sint16 x, sint16 y)
|
|||
state_changed++;
|
||||
}
|
||||
|
||||
sint16 tool_size = gLandToolSize;
|
||||
int16_t tool_size = gLandToolSize;
|
||||
if (tool_size == 0)
|
||||
tool_size = 1;
|
||||
|
||||
sint16 tool_length = (tool_size - 1) * 32;
|
||||
int16_t tool_length = (tool_size - 1) * 32;
|
||||
|
||||
// Move to tool bottom left
|
||||
mapTile.x -= (tool_size - 1) * 16;
|
||||
|
@ -373,7 +373,7 @@ static void window_land_rights_toolabort(rct_window *w, rct_widgetindex widgetIn
|
|||
*
|
||||
* rct2: 0x006681D1
|
||||
*/
|
||||
static void window_land_rights_toolupdate(rct_window* w, rct_widgetindex widgetIndex, sint32 x, sint32 y)
|
||||
static void window_land_rights_toolupdate(rct_window* w, rct_widgetindex widgetIndex, int32_t x, int32_t y)
|
||||
{
|
||||
window_land_rights_tool_update_land_rights(x, y);
|
||||
}
|
||||
|
@ -382,7 +382,7 @@ static void window_land_rights_toolupdate(rct_window* w, rct_widgetindex widgetI
|
|||
*
|
||||
* rct2: 0x006681E6
|
||||
*/
|
||||
static void window_land_rights_tooldown(rct_window* w, rct_widgetindex widgetIndex, sint32 x, sint32 y)
|
||||
static void window_land_rights_tooldown(rct_window* w, rct_widgetindex widgetIndex, int32_t x, int32_t y)
|
||||
{
|
||||
if (_landRightsMode == LAND_RIGHTS_MODE_BUY_LAND)
|
||||
{
|
||||
|
@ -420,7 +420,7 @@ static void window_land_rights_tooldown(rct_window* w, rct_widgetindex widgetInd
|
|||
*
|
||||
* rct2: 0x006681FB
|
||||
*/
|
||||
static void window_land_rights_tooldrag(rct_window* w, rct_widgetindex widgetIndex, sint32 x, sint32 y)
|
||||
static void window_land_rights_tooldrag(rct_window* w, rct_widgetindex widgetIndex, int32_t x, int32_t y)
|
||||
{
|
||||
if (_landRightsMode == LAND_RIGHTS_MODE_BUY_LAND) {
|
||||
if (x != LOCATION_NULL)
|
||||
|
|
|
@ -81,15 +81,15 @@ static rct_widget window_loadsave_widgets[] =
|
|||
static void window_loadsave_close(rct_window *w);
|
||||
static void window_loadsave_mouseup(rct_window *w, rct_widgetindex widgetIndex);
|
||||
static void window_loadsave_resize(rct_window *w);
|
||||
static void window_loadsave_scrollgetsize(rct_window *w, sint32 scrollIndex, sint32 *width, sint32 *height);
|
||||
static void window_loadsave_scrollmousedown(rct_window *w, sint32 scrollIndex, sint32 x, sint32 y);
|
||||
static void window_loadsave_scrollmouseover(rct_window *w, sint32 scrollIndex, sint32 x, sint32 y);
|
||||
static void window_loadsave_scrollgetsize(rct_window *w, int32_t scrollIndex, int32_t *width, int32_t *height);
|
||||
static void window_loadsave_scrollmousedown(rct_window *w, int32_t scrollIndex, int32_t x, int32_t y);
|
||||
static void window_loadsave_scrollmouseover(rct_window *w, int32_t scrollIndex, int32_t x, int32_t y);
|
||||
static void window_loadsave_textinput(rct_window *w, rct_widgetindex widgetIndex, char *text);
|
||||
static void window_loadsave_tooltip(rct_window* w, rct_widgetindex widgetIndex, rct_string_id *stringId);
|
||||
static void window_loadsave_compute_max_date_width();
|
||||
static void window_loadsave_invalidate(rct_window *w);
|
||||
static void window_loadsave_paint(rct_window *w, rct_drawpixelinfo *dpi);
|
||||
static void window_loadsave_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, sint32 scrollIndex);
|
||||
static void window_loadsave_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, int32_t scrollIndex);
|
||||
|
||||
static rct_window_event_list window_loadsave_events =
|
||||
{
|
||||
|
@ -139,7 +139,7 @@ struct LoadSaveListItem
|
|||
time_t date_modified;
|
||||
std::string date_formatted;
|
||||
std::string time_formatted;
|
||||
uint8 type;
|
||||
uint8_t type;
|
||||
bool loaded;
|
||||
};
|
||||
|
||||
|
@ -151,12 +151,12 @@ static char _shortenedDirectory[MAX_PATH];
|
|||
static char _parentDirectory[MAX_PATH];
|
||||
static char _extension[32];
|
||||
static char _defaultName[MAX_PATH];
|
||||
static sint32 _type;
|
||||
static int32_t _type;
|
||||
|
||||
static sint32 maxDateWidth = 0;
|
||||
static sint32 maxTimeWidth = 0;
|
||||
static int32_t maxDateWidth = 0;
|
||||
static int32_t maxTimeWidth = 0;
|
||||
|
||||
static void window_loadsave_populate_list(rct_window *w, sint32 includeNewItem, const char *directory, const char *extension);
|
||||
static void window_loadsave_populate_list(rct_window *w, int32_t includeNewItem, const char *directory, const char *extension);
|
||||
static void window_loadsave_select(rct_window *w, const char *path);
|
||||
static void window_loadsave_sort_list();
|
||||
|
||||
|
@ -167,7 +167,7 @@ void window_loadsave_set_loadsave_callback(loadsave_callback cb)
|
|||
_loadSaveCallback = cb;
|
||||
}
|
||||
|
||||
static sint32 window_loadsave_get_dir(utf8 *last_save, char *path, const char *subdir, size_t pathSize)
|
||||
static int32_t window_loadsave_get_dir(utf8 *last_save, char *path, const char *subdir, size_t pathSize)
|
||||
{
|
||||
if (last_save && platform_ensure_directory_exists(last_save))
|
||||
safe_strcpy(path, last_save, pathSize);
|
||||
|
@ -183,7 +183,7 @@ static sint32 window_loadsave_get_dir(utf8 *last_save, char *path, const char *s
|
|||
return 1;
|
||||
}
|
||||
|
||||
rct_window *window_loadsave_open(sint32 type, const char *defaultName)
|
||||
rct_window *window_loadsave_open(int32_t type, const char *defaultName)
|
||||
{
|
||||
_loadSaveCallback = nullptr;
|
||||
_type = type;
|
||||
|
@ -280,7 +280,7 @@ rct_window *window_loadsave_open(sint32 type, const char *defaultName)
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
w->no_list_items = static_cast<uint16>(_listItems.size());
|
||||
w->no_list_items = static_cast<uint16_t>(_listItems.size());
|
||||
window_init_scroll_widgets(w);
|
||||
window_loadsave_compute_max_date_width();
|
||||
|
||||
|
@ -311,7 +311,7 @@ static bool browse(bool isSave, char *path, size_t pathSize)
|
|||
{
|
||||
file_dialog_desc desc = {};
|
||||
const utf8 * extension = "";
|
||||
uint32 fileType = FILE_EXTENSION_UNKNOWN;
|
||||
uint32_t fileType = FILE_EXTENSION_UNKNOWN;
|
||||
rct_string_id title = STR_NONE;
|
||||
switch (_type & 0x0E)
|
||||
{
|
||||
|
@ -413,7 +413,7 @@ static void window_loadsave_mouseup(rct_window *w, rct_widgetindex widgetIndex)
|
|||
safe_strcpy(path, _parentDirectory, sizeof(path));
|
||||
window_loadsave_populate_list(w, isSave, path, _extension);
|
||||
window_init_scroll_widgets(w);
|
||||
w->no_list_items = static_cast<uint16>(_listItems.size());
|
||||
w->no_list_items = static_cast<uint16_t>(_listItems.size());
|
||||
break;
|
||||
|
||||
case WIDX_NEW_FILE:
|
||||
|
@ -435,7 +435,7 @@ static void window_loadsave_mouseup(rct_window *w, rct_widgetindex widgetIndex)
|
|||
safe_strcpy(path, _directory, sizeof(path));
|
||||
window_loadsave_populate_list(w, isSave, path, _extension);
|
||||
window_init_scroll_widgets(w);
|
||||
w->no_list_items = static_cast<uint16>(_listItems.size());
|
||||
w->no_list_items = static_cast<uint16_t>(_listItems.size());
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -486,19 +486,19 @@ static void window_loadsave_mouseup(rct_window *w, rct_widgetindex widgetIndex)
|
|||
|
||||
window_loadsave_populate_list(w, isSave, path, _extension);
|
||||
window_init_scroll_widgets(w);
|
||||
w->no_list_items = static_cast<uint16>(_listItems.size());
|
||||
w->no_list_items = static_cast<uint16_t>(_listItems.size());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void window_loadsave_scrollgetsize(rct_window *w, sint32 scrollIndex, sint32 *width, sint32 *height)
|
||||
static void window_loadsave_scrollgetsize(rct_window *w, int32_t scrollIndex, int32_t *width, int32_t *height)
|
||||
{
|
||||
*height = w->no_list_items * SCROLLABLE_ROW_HEIGHT;
|
||||
}
|
||||
|
||||
static void window_loadsave_scrollmousedown(rct_window *w, sint32 scrollIndex, sint32 x, sint32 y)
|
||||
static void window_loadsave_scrollmousedown(rct_window *w, int32_t scrollIndex, int32_t x, int32_t y)
|
||||
{
|
||||
sint32 selectedItem;
|
||||
int32_t selectedItem;
|
||||
|
||||
selectedItem = y / SCROLLABLE_ROW_HEIGHT;
|
||||
if (selectedItem >= w->no_list_items)
|
||||
|
@ -507,7 +507,7 @@ static void window_loadsave_scrollmousedown(rct_window *w, sint32 scrollIndex, s
|
|||
if (_listItems[selectedItem].type == TYPE_DIRECTORY)
|
||||
{
|
||||
// The selected item is a folder
|
||||
sint32 includeNewItem;
|
||||
int32_t includeNewItem;
|
||||
|
||||
w->no_list_items = 0;
|
||||
w->selected_list_item = -1;
|
||||
|
@ -519,7 +519,7 @@ static void window_loadsave_scrollmousedown(rct_window *w, sint32 scrollIndex, s
|
|||
window_loadsave_populate_list(w, includeNewItem, directory, _extension);
|
||||
window_init_scroll_widgets(w);
|
||||
|
||||
w->no_list_items = static_cast<uint16>(_listItems.size());
|
||||
w->no_list_items = static_cast<uint16_t>(_listItems.size());
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -532,9 +532,9 @@ static void window_loadsave_scrollmousedown(rct_window *w, sint32 scrollIndex, s
|
|||
}
|
||||
}
|
||||
|
||||
static void window_loadsave_scrollmouseover(rct_window *w, sint32 scrollIndex, sint32 x, sint32 y)
|
||||
static void window_loadsave_scrollmouseover(rct_window *w, int32_t scrollIndex, int32_t x, int32_t y)
|
||||
{
|
||||
sint32 selectedItem;
|
||||
int32_t selectedItem;
|
||||
|
||||
selectedItem = y / SCROLLABLE_ROW_HEIGHT;
|
||||
if (selectedItem >= w->no_list_items)
|
||||
|
@ -577,7 +577,7 @@ static void window_loadsave_textinput(rct_window *w, rct_widgetindex widgetIndex
|
|||
window_loadsave_populate_list(w, (_type & 1) == LOADSAVETYPE_SAVE, path, _extension);
|
||||
window_init_scroll_widgets(w);
|
||||
|
||||
w->no_list_items = static_cast<uint16>(_listItems.size());
|
||||
w->no_list_items = static_cast<uint16_t>(_listItems.size());
|
||||
window_invalidate(w);
|
||||
break;
|
||||
|
||||
|
@ -707,14 +707,14 @@ static void window_loadsave_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
|||
w->y + sort_date_widget.top + 1);
|
||||
}
|
||||
|
||||
static void window_loadsave_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, sint32 scrollIndex)
|
||||
static void window_loadsave_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, int32_t scrollIndex)
|
||||
{
|
||||
gfx_fill_rect(dpi, dpi->x, dpi->y, dpi->x + dpi->width - 1, dpi->y + dpi->height - 1, ColourMapA[w->colours[1]].mid_light);
|
||||
const sint32 listWidth = w->widgets[WIDX_SCROLL].right - w->widgets[WIDX_SCROLL].left;
|
||||
const int32_t listWidth = w->widgets[WIDX_SCROLL].right - w->widgets[WIDX_SCROLL].left;
|
||||
|
||||
for (sint32 i = 0; i < w->no_list_items; i++)
|
||||
for (int32_t i = 0; i < w->no_list_items; i++)
|
||||
{
|
||||
sint32 y = i * SCROLLABLE_ROW_HEIGHT;
|
||||
int32_t y = i * SCROLLABLE_ROW_HEIGHT;
|
||||
if (y > dpi->y + dpi->height)
|
||||
break;
|
||||
|
||||
|
@ -739,13 +739,13 @@ static void window_loadsave_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, s
|
|||
// Print filename
|
||||
set_format_arg(0, rct_string_id, STR_STRING);
|
||||
set_format_arg(2, char*, _listItems[i].name.c_str());
|
||||
sint32 max_file_width = w->widgets[WIDX_SORT_NAME].right - w->widgets[WIDX_SORT_NAME].left - 10;
|
||||
int32_t max_file_width = w->widgets[WIDX_SORT_NAME].right - w->widgets[WIDX_SORT_NAME].left - 10;
|
||||
gfx_draw_string_left_clipped(dpi, stringId, gCommonFormatArgs, COLOUR_BLACK, 10, y, max_file_width);
|
||||
|
||||
// Print formatted modified date, if this is a file
|
||||
if (_listItems[i].type == TYPE_FILE)
|
||||
{
|
||||
sint32 offset = w->widgets[WIDX_SORT_DATE].left + maxDateWidth;
|
||||
int32_t offset = w->widgets[WIDX_SORT_DATE].left + maxDateWidth;
|
||||
|
||||
set_format_arg(0, rct_string_id, STR_STRING);
|
||||
set_format_arg(2, char*, _listItems[i].date_formatted.c_str());
|
||||
|
@ -782,7 +782,7 @@ static void window_loadsave_sort_list()
|
|||
std::sort(_listItems.begin(), _listItems.end(), list_item_sort);
|
||||
}
|
||||
|
||||
static void window_loadsave_populate_list(rct_window *w, sint32 includeNewItem, const char *directory, const char *extension)
|
||||
static void window_loadsave_populate_list(rct_window *w, int32_t includeNewItem, const char *directory, const char *extension)
|
||||
{
|
||||
utf8 absoluteDirectory[MAX_PATH];
|
||||
Path::GetAbsolute(absoluteDirectory, Util::CountOf(absoluteDirectory), directory);
|
||||
|
@ -800,12 +800,12 @@ static void window_loadsave_populate_list(rct_window *w, sint32 includeNewItem,
|
|||
window_loadsave_widgets[WIDX_NEW_FILE].type = includeNewItem ? WWT_BUTTON : WWT_EMPTY;
|
||||
window_loadsave_widgets[WIDX_NEW_FOLDER].type = includeNewItem ? WWT_BUTTON : WWT_EMPTY;
|
||||
|
||||
sint32 drives = platform_get_drives();
|
||||
int32_t drives = platform_get_drives();
|
||||
if (str_is_null_or_empty(directory) && drives)
|
||||
{
|
||||
// List Windows drives
|
||||
w->disabled_widgets |= (1 << WIDX_NEW_FILE) | (1 << WIDX_NEW_FOLDER) | (1 << WIDX_UP);
|
||||
for (sint32 x = 0; x < 26; x++)
|
||||
for (int32_t x = 0; x < 26; x++)
|
||||
{
|
||||
if (drives & (1 << x))
|
||||
{
|
||||
|
@ -922,7 +922,7 @@ static void window_loadsave_populate_list(rct_window *w, sint32 includeNewItem,
|
|||
window_invalidate(w);
|
||||
}
|
||||
|
||||
static void window_loadsave_invoke_callback(sint32 result, const utf8 * path)
|
||||
static void window_loadsave_invoke_callback(int32_t result, const utf8 * path)
|
||||
{
|
||||
if (_loadSaveCallback != nullptr)
|
||||
{
|
||||
|
@ -1025,11 +1025,11 @@ static void window_loadsave_select(rct_window *w, const char *path)
|
|||
case (LOADSAVETYPE_SAVE | LOADSAVETYPE_SCENARIO):
|
||||
{
|
||||
save_path(&gConfigGeneral.last_save_scenario_directory, pathBuffer);
|
||||
sint32 parkFlagsBackup = gParkFlags;
|
||||
int32_t parkFlagsBackup = gParkFlags;
|
||||
gParkFlags &= ~PARK_FLAGS_SPRITES_INITIALISED;
|
||||
gS6Info.editor_step = 255;
|
||||
safe_strcpy(gScenarioFileName, pathBuffer, sizeof(gScenarioFileName));
|
||||
sint32 success = scenario_save(pathBuffer, gConfigGeneral.save_plugin_data ? 3 : 2);
|
||||
int32_t success = scenario_save(pathBuffer, gConfigGeneral.save_plugin_data ? 3 : 2);
|
||||
gParkFlags = parkFlagsBackup;
|
||||
|
||||
if (success)
|
||||
|
@ -1061,7 +1061,7 @@ static void window_loadsave_select(rct_window *w, const char *path)
|
|||
case (LOADSAVETYPE_SAVE | LOADSAVETYPE_TRACK):
|
||||
{
|
||||
path_set_extension(pathBuffer, "td6", sizeof(pathBuffer));
|
||||
sint32 success = track_design_save_to_file(pathBuffer);
|
||||
int32_t success = track_design_save_to_file(pathBuffer);
|
||||
|
||||
if (success)
|
||||
{
|
||||
|
@ -1198,8 +1198,8 @@ static void window_overwrite_prompt_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
|||
set_format_arg(0, rct_string_id, STR_STRING);
|
||||
set_format_arg(2, char *, _window_overwrite_prompt_name);
|
||||
|
||||
sint32 x = w->x + w->width / 2;
|
||||
sint32 y = w->y + (w->height / 2) - 3;
|
||||
int32_t x = w->x + w->width / 2;
|
||||
int32_t y = w->y + (w->height / 2) - 3;
|
||||
gfx_draw_string_centred_wrapped(dpi, gCommonFormatArgs, x, y, w->width - 4, STR_FILEBROWSER_OVERWRITE_PROMPT, COLOUR_BLACK);
|
||||
}
|
||||
|
||||
|
|
|
@ -83,7 +83,7 @@ static rct_widget window_map_widgets[] = {
|
|||
SPINNER_WIDGETS (1, 104, 198, 229, 240, STR_MAP_SIZE_VALUE, STR_NONE), // NB: 3 widgets
|
||||
{ WWT_FLATBTN, 1, 4, 27, 1, 24, SPR_BUY_LAND_RIGHTS, STR_SELECT_PARK_OWNED_LAND_TIP },
|
||||
{ WWT_FLATBTN, 1, 4, 27, 1, 24, SPR_PARK_ENTRANCE, STR_BUILD_PARK_ENTRANCE_TIP },
|
||||
{ WWT_FLATBTN, 1, 28, 51, 1, 24, (uint32) SPR_NONE, STR_SET_STARTING_POSITIONS_TIP },
|
||||
{ WWT_FLATBTN, 1, 28, 51, 1, 24, (uint32_t) SPR_NONE, STR_SET_STARTING_POSITIONS_TIP },
|
||||
{ WWT_IMGBTN, 1, 4, 47, 17, 48, SPR_LAND_TOOL_SIZE_0, STR_NONE },
|
||||
{ WWT_TRNBTN, 1, 5, 20, 18, 33, IMAGE_TYPE_REMAP | SPR_LAND_TOOL_DECREASE, STR_ADJUST_SMALLER_LAND_TIP },
|
||||
{ WWT_TRNBTN, 1, 31, 46, 32, 47, IMAGE_TYPE_REMAP | SPR_LAND_TOOL_INCREASE, STR_ADJUST_LARGER_LAND_TIP },
|
||||
|
@ -106,7 +106,7 @@ static constexpr const LocationXY16 MiniMapOffsets[] = {
|
|||
};
|
||||
|
||||
/** rct2: 0x00981BCC */
|
||||
static constexpr const uint16 RideKeyColours[] = {
|
||||
static constexpr const uint16_t RideKeyColours[] = {
|
||||
MAP_COLOUR(PALETTE_INDEX_61), // COLOUR_KEY_RIDE
|
||||
MAP_COLOUR(PALETTE_INDEX_42), // COLOUR_KEY_FOOD
|
||||
MAP_COLOUR(PALETTE_INDEX_20), // COLOUR_KEY_DRINK
|
||||
|
@ -122,17 +122,17 @@ static void window_map_resize(rct_window *w);
|
|||
static void window_map_mouseup(rct_window *w, rct_widgetindex widgetIndex);
|
||||
static void window_map_mousedown(rct_window *w, rct_widgetindex widgetIndex, rct_widget* widget);
|
||||
static void window_map_update(rct_window *w);
|
||||
static void window_map_toolupdate(rct_window* w, rct_widgetindex widgetIndex, sint32 x, sint32 y);
|
||||
static void window_map_tooldown(rct_window* w, rct_widgetindex widgetIndex, sint32 x, sint32 y);
|
||||
static void window_map_tooldrag(rct_window* w, rct_widgetindex widgetIndex, sint32 x, sint32 y);
|
||||
static void window_map_toolupdate(rct_window* w, rct_widgetindex widgetIndex, int32_t x, int32_t y);
|
||||
static void window_map_tooldown(rct_window* w, rct_widgetindex widgetIndex, int32_t x, int32_t y);
|
||||
static void window_map_tooldrag(rct_window* w, rct_widgetindex widgetIndex, int32_t x, int32_t y);
|
||||
static void window_map_toolabort(rct_window *w, rct_widgetindex widgetIndex);
|
||||
static void window_map_scrollgetsize(rct_window *w, sint32 scrollIndex, sint32 *width, sint32 *height);
|
||||
static void window_map_scrollmousedown(rct_window *w, sint32 scrollIndex, sint32 x, sint32 y);
|
||||
static void window_map_scrollgetsize(rct_window *w, int32_t scrollIndex, int32_t *width, int32_t *height);
|
||||
static void window_map_scrollmousedown(rct_window *w, int32_t scrollIndex, int32_t x, int32_t y);
|
||||
static void window_map_textinput(rct_window *w, rct_widgetindex widgetIndex, char *text);
|
||||
static void window_map_tooltip(rct_window* w, rct_widgetindex widgetIndex, rct_string_id *stringId);
|
||||
static void window_map_invalidate(rct_window *w);
|
||||
static void window_map_paint(rct_window *w, rct_drawpixelinfo *dpi);
|
||||
static void window_map_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, sint32 scrollIndex);
|
||||
static void window_map_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, int32_t scrollIndex);
|
||||
|
||||
static rct_window_event_list window_map_events = {
|
||||
window_map_close,
|
||||
|
@ -167,15 +167,15 @@ static rct_window_event_list window_map_events = {
|
|||
// clang-format on
|
||||
|
||||
/** rct2: 0x00F1AD61 */
|
||||
static uint8 _activeTool;
|
||||
static uint8_t _activeTool;
|
||||
|
||||
/** rct2: 0x00F1AD6C */
|
||||
static uint32 _currentLine;
|
||||
static uint32_t _currentLine;
|
||||
|
||||
/** rct2: 0x00F1AD68 */
|
||||
static std::vector<uint8> _mapImageData;
|
||||
static std::vector<uint8_t> _mapImageData;
|
||||
|
||||
static uint16 _landRightsToolSize;
|
||||
static uint16_t _landRightsToolSize;
|
||||
|
||||
static void window_map_init_map();
|
||||
static void window_map_centre_on_view_point();
|
||||
|
@ -187,16 +187,16 @@ static void window_map_paint_hud_rectangle(rct_drawpixelinfo *dpi);
|
|||
static void window_map_inputsize_land(rct_window *w);
|
||||
static void window_map_inputsize_map(rct_window *w);
|
||||
|
||||
static void window_map_set_land_rights_tool_update(sint32 x, sint32 y);
|
||||
static void window_map_place_park_entrance_tool_update(sint32 x, sint32 y);
|
||||
static void window_map_set_peep_spawn_tool_update(sint32 x, sint32 y);
|
||||
static void window_map_place_park_entrance_tool_down(sint32 x, sint32 y);
|
||||
static void window_map_set_peep_spawn_tool_down(sint32 x, sint32 y);
|
||||
static void window_map_set_land_rights_tool_update(int32_t x, int32_t y);
|
||||
static void window_map_place_park_entrance_tool_update(int32_t x, int32_t y);
|
||||
static void window_map_set_peep_spawn_tool_update(int32_t x, int32_t y);
|
||||
static void window_map_place_park_entrance_tool_down(int32_t x, int32_t y);
|
||||
static void window_map_set_peep_spawn_tool_down(int32_t x, int32_t y);
|
||||
static void map_window_increase_map_size();
|
||||
static void map_window_decrease_map_size();
|
||||
static void map_window_set_pixels(rct_window *w);
|
||||
|
||||
static CoordsXY map_window_screen_to_map(sint32 screenX, sint32 screenY);
|
||||
static CoordsXY map_window_screen_to_map(int32_t screenX, int32_t screenY);
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -310,7 +310,7 @@ static void window_map_mouseup(rct_window *w, rct_widgetindex widgetIndex)
|
|||
break;
|
||||
_activeTool = 2;
|
||||
// Prevent mountain tool size.
|
||||
_landRightsToolSize = std::max<uint16>(MINIMUM_TOOL_SIZE, _landRightsToolSize);
|
||||
_landRightsToolSize = std::max<uint16_t>(MINIMUM_TOOL_SIZE, _landRightsToolSize);
|
||||
show_gridlines();
|
||||
show_land_rights();
|
||||
show_construction_rights();
|
||||
|
@ -444,7 +444,7 @@ static void window_map_update(rct_window *w)
|
|||
window_map_centre_on_view_point();
|
||||
}
|
||||
|
||||
for (sint32 i = 0; i < 16; i++)
|
||||
for (int32_t i = 0; i < 16; i++)
|
||||
map_window_set_pixels(w);
|
||||
|
||||
window_invalidate(w);
|
||||
|
@ -469,7 +469,7 @@ static void window_map_update(rct_window *w)
|
|||
*
|
||||
* rct2: 0x0068D093
|
||||
*/
|
||||
static void window_map_toolupdate(rct_window* w, rct_widgetindex widgetIndex, sint32 x, sint32 y)
|
||||
static void window_map_toolupdate(rct_window* w, rct_widgetindex widgetIndex, int32_t x, int32_t y)
|
||||
{
|
||||
switch (widgetIndex) {
|
||||
case WIDX_SET_LAND_RIGHTS:
|
||||
|
@ -488,7 +488,7 @@ static void window_map_toolupdate(rct_window* w, rct_widgetindex widgetIndex, si
|
|||
*
|
||||
* rct2: 0x0068D074
|
||||
*/
|
||||
static void window_map_tooldown(rct_window* w, rct_widgetindex widgetIndex, sint32 x, sint32 y)
|
||||
static void window_map_tooldown(rct_window* w, rct_widgetindex widgetIndex, int32_t x, int32_t y)
|
||||
{
|
||||
switch (widgetIndex) {
|
||||
case WIDX_BUILD_PARK_ENTRANCE:
|
||||
|
@ -504,7 +504,7 @@ static void window_map_tooldown(rct_window* w, rct_widgetindex widgetIndex, sint
|
|||
*
|
||||
* rct2: 0x0068D088
|
||||
*/
|
||||
static void window_map_tooldrag(rct_window* w, rct_widgetindex widgetIndex, sint32 x, sint32 y)
|
||||
static void window_map_tooldrag(rct_window* w, rct_widgetindex widgetIndex, int32_t x, int32_t y)
|
||||
{
|
||||
switch (widgetIndex) {
|
||||
case WIDX_SET_LAND_RIGHTS:
|
||||
|
@ -557,7 +557,7 @@ static void window_map_toolabort(rct_window *w, rct_widgetindex widgetIndex)
|
|||
*
|
||||
* rct2: 0x0068D7CC
|
||||
*/
|
||||
static void window_map_scrollgetsize(rct_window *w, sint32 scrollIndex, sint32 *width, sint32 *height)
|
||||
static void window_map_scrollgetsize(rct_window *w, int32_t scrollIndex, int32_t *width, int32_t *height)
|
||||
{
|
||||
window_map_invalidate(w);
|
||||
|
||||
|
@ -569,12 +569,12 @@ static void window_map_scrollgetsize(rct_window *w, sint32 scrollIndex, sint32 *
|
|||
*
|
||||
* rct2: 0x0068D726
|
||||
*/
|
||||
static void window_map_scrollmousedown(rct_window *w, sint32 scrollIndex, sint32 x, sint32 y)
|
||||
static void window_map_scrollmousedown(rct_window *w, int32_t scrollIndex, int32_t x, int32_t y)
|
||||
{
|
||||
CoordsXY c = map_window_screen_to_map(x, y);
|
||||
sint32 mapX = Math::Clamp(0, c.x, MAXIMUM_MAP_SIZE_TECHNICAL * 32 - 1);
|
||||
sint32 mapY = Math::Clamp(0, c.y, MAXIMUM_MAP_SIZE_TECHNICAL * 32 - 1);
|
||||
sint32 mapZ = tile_element_height(x, y);
|
||||
int32_t mapX = Math::Clamp(0, c.x, MAXIMUM_MAP_SIZE_TECHNICAL * 32 - 1);
|
||||
int32_t mapY = Math::Clamp(0, c.y, MAXIMUM_MAP_SIZE_TECHNICAL * 32 - 1);
|
||||
int32_t mapZ = tile_element_height(x, y);
|
||||
|
||||
rct_window * mainWindow = window_get_main();
|
||||
if (mainWindow != nullptr) {
|
||||
|
@ -583,9 +583,9 @@ static void window_map_scrollmousedown(rct_window *w, sint32 scrollIndex, sint32
|
|||
|
||||
if (land_tool_is_active()) {
|
||||
// Set land terrain
|
||||
sint32 landToolSize = std::max<sint32>(1, gLandToolSize);
|
||||
sint32 size = (landToolSize * 32) - 32;
|
||||
sint32 radius = (landToolSize * 16) - 16;
|
||||
int32_t landToolSize = std::max<int32_t>(1, gLandToolSize);
|
||||
int32_t size = (landToolSize * 32) - 32;
|
||||
int32_t radius = (landToolSize * 16) - 16;
|
||||
mapX = (mapX - radius) & 0xFFE0;
|
||||
mapY = (mapY - radius) & 0xFFE0;
|
||||
|
||||
|
@ -610,9 +610,9 @@ static void window_map_scrollmousedown(rct_window *w, sint32 scrollIndex, sint32
|
|||
);
|
||||
} else if (widget_is_active_tool(w, WIDX_SET_LAND_RIGHTS)) {
|
||||
// Set land rights
|
||||
sint32 landRightsToolSize = std::max<sint32>(1, _landRightsToolSize);
|
||||
sint32 size = (landRightsToolSize * 32) - 32;
|
||||
sint32 radius = (landRightsToolSize * 16) - 16;
|
||||
int32_t landRightsToolSize = std::max<int32_t>(1, _landRightsToolSize);
|
||||
int32_t size = (landRightsToolSize * 32) - 32;
|
||||
int32_t radius = (landRightsToolSize * 16) - 16;
|
||||
mapX = (mapX - radius) & 0xFFE0;
|
||||
mapY = (mapY - radius) & 0xFFE0;
|
||||
|
||||
|
@ -640,7 +640,7 @@ static void window_map_scrollmousedown(rct_window *w, sint32 scrollIndex, sint32
|
|||
|
||||
static void window_map_textinput(rct_window *w, rct_widgetindex widgetIndex, char *text)
|
||||
{
|
||||
sint32 size;
|
||||
int32_t size;
|
||||
char* end;
|
||||
|
||||
if (text == nullptr)
|
||||
|
@ -662,7 +662,7 @@ static void window_map_textinput(rct_window *w, rct_widgetindex widgetIndex, cha
|
|||
size += 2;
|
||||
size = Math::Clamp(MINIMUM_MAP_SIZE_TECHNICAL, size, MAXIMUM_MAP_SIZE_TECHNICAL);
|
||||
|
||||
sint32 currentSize = gMapSize;
|
||||
int32_t currentSize = gMapSize;
|
||||
while (size < currentSize) {
|
||||
map_window_decrease_map_size();
|
||||
currentSize--;
|
||||
|
@ -692,8 +692,8 @@ static void window_map_tooltip(rct_window* w, rct_widgetindex widgetIndex, rct_s
|
|||
*/
|
||||
static void window_map_invalidate(rct_window *w)
|
||||
{
|
||||
uint64 pressedWidgets;
|
||||
sint32 i, height;
|
||||
uint64_t pressedWidgets;
|
||||
int32_t i, height;
|
||||
|
||||
// Set the pressed widgets
|
||||
pressedWidgets = w->pressed_widgets;
|
||||
|
@ -826,8 +826,8 @@ static void window_map_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
|||
window_draw_widgets(w, dpi);
|
||||
window_map_draw_tab_images(w, dpi);
|
||||
|
||||
sint32 x = w->x + (window_map_widgets[WIDX_LAND_TOOL].left + window_map_widgets[WIDX_LAND_TOOL].right) / 2;
|
||||
sint32 y = w->y + (window_map_widgets[WIDX_LAND_TOOL].top + window_map_widgets[WIDX_LAND_TOOL].bottom) / 2;
|
||||
int32_t x = w->x + (window_map_widgets[WIDX_LAND_TOOL].left + window_map_widgets[WIDX_LAND_TOOL].right) / 2;
|
||||
int32_t y = w->y + (window_map_widgets[WIDX_LAND_TOOL].top + window_map_widgets[WIDX_LAND_TOOL].bottom) / 2;
|
||||
|
||||
// Draw land tool size
|
||||
if (widget_is_active_tool(w, WIDX_SET_LAND_RIGHTS) && _landRightsToolSize > MAX_TOOL_SIZE_WITH_SPRITE) {
|
||||
|
@ -862,7 +862,7 @@ static void window_map_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
|||
STR_MAP_TOILET,
|
||||
};
|
||||
|
||||
for (uint32 i = 0; i < Util::CountOf(RideKeyColours); i++)
|
||||
for (uint32_t i = 0; i < Util::CountOf(RideKeyColours); i++)
|
||||
{
|
||||
gfx_fill_rect(dpi, x, y + 2, x + 6, y + 8, RideKeyColours[i]);
|
||||
gfx_draw_string_left(dpi, mapLabels[i], w, COLOUR_BLACK, x + LIST_ROW_HEIGHT, y);
|
||||
|
@ -883,7 +883,7 @@ static void window_map_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
|||
*
|
||||
* rct2: 0x0068CF23
|
||||
*/
|
||||
static void window_map_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, sint32 scrollIndex)
|
||||
static void window_map_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, int32_t scrollIndex)
|
||||
{
|
||||
gfx_clear(dpi, PALETTE_INDEX_10);
|
||||
|
||||
|
@ -925,8 +925,8 @@ static void window_map_centre_on_view_point()
|
|||
{
|
||||
rct_window *w = window_get_main();
|
||||
rct_window *w_map;
|
||||
sint16 ax, bx, cx, dx;
|
||||
sint16 bp, di;
|
||||
int16_t ax, bx, cx, dx;
|
||||
int16_t bp, di;
|
||||
|
||||
if (w == nullptr || w->viewport == nullptr)
|
||||
return;
|
||||
|
@ -985,7 +985,7 @@ static void window_map_show_default_scenario_editor_buttons(rct_window *w) {
|
|||
if (gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR)
|
||||
w->widgets[WIDX_MAP_GENERATOR].type = WWT_BUTTON;
|
||||
|
||||
set_format_arg(2, uint16, gMapSize - 2);
|
||||
set_format_arg(2, uint16_t, gMapSize - 2);
|
||||
}
|
||||
|
||||
static void window_map_inputsize_land(rct_window *w)
|
||||
|
@ -1004,7 +1004,7 @@ static void window_map_inputsize_map(rct_window *w)
|
|||
|
||||
static void window_map_draw_tab_images(rct_window *w, rct_drawpixelinfo *dpi)
|
||||
{
|
||||
uint32 image;
|
||||
uint32_t image;
|
||||
|
||||
// Guest tab image (animated)
|
||||
image = SPR_TAB_GUESTS_0;
|
||||
|
@ -1027,7 +1027,7 @@ static void window_map_draw_tab_images(rct_window *w, rct_drawpixelinfo *dpi)
|
|||
*/
|
||||
static MapCoordsXY window_map_transform_to_map_coords(CoordsXY c)
|
||||
{
|
||||
sint32 x = c.x, y = c.y;
|
||||
int32_t x = c.x, y = c.y;
|
||||
|
||||
switch (get_current_rotation()) {
|
||||
case 3:
|
||||
|
@ -1058,20 +1058,20 @@ static MapCoordsXY window_map_transform_to_map_coords(CoordsXY c)
|
|||
static void window_map_paint_peep_overlay(rct_drawpixelinfo *dpi)
|
||||
{
|
||||
rct_peep *peep;
|
||||
uint16 spriteIndex;
|
||||
uint16_t spriteIndex;
|
||||
|
||||
FOR_ALL_PEEPS(spriteIndex, peep) {
|
||||
if (peep->x == LOCATION_NULL)
|
||||
continue;
|
||||
|
||||
MapCoordsXY c = window_map_transform_to_map_coords({peep->x, peep->y});
|
||||
sint16 left = c.x;
|
||||
sint16 top = c.y;
|
||||
int16_t left = c.x;
|
||||
int16_t top = c.y;
|
||||
|
||||
sint16 right = left;
|
||||
sint16 bottom = top;
|
||||
int16_t right = left;
|
||||
int16_t bottom = top;
|
||||
|
||||
sint16 colour = PALETTE_INDEX_20;
|
||||
int16_t colour = PALETTE_INDEX_20;
|
||||
|
||||
if (sprite_get_flashing((rct_sprite*)peep)) {
|
||||
if (peep->type == PEEP_TYPE_STAFF) {
|
||||
|
@ -1101,7 +1101,7 @@ static void window_map_paint_peep_overlay(rct_drawpixelinfo *dpi)
|
|||
static void window_map_paint_train_overlay(rct_drawpixelinfo *dpi)
|
||||
{
|
||||
rct_vehicle *train, *vehicle;
|
||||
uint16 train_index, vehicle_index;
|
||||
uint16_t train_index, vehicle_index;
|
||||
|
||||
for (train_index = gSpriteListHead[SPRITE_LIST_TRAIN]; train_index != SPRITE_INDEX_NULL; train_index = train->next) {
|
||||
train = GET_VEHICLE(train_index);
|
||||
|
@ -1134,10 +1134,10 @@ static void window_map_paint_hud_rectangle(rct_drawpixelinfo *dpi)
|
|||
return;
|
||||
|
||||
LocationXY16 offset = MiniMapOffsets[get_current_rotation()];
|
||||
sint16 left = (viewport->view_x >> 5) + offset.x;
|
||||
sint16 right = ((viewport->view_x + viewport->view_width) >> 5) + offset.x;
|
||||
sint16 top = (viewport->view_y >> 4) + offset.y;
|
||||
sint16 bottom = ((viewport->view_y + viewport->view_height) >> 4) + offset.y;
|
||||
int16_t left = (viewport->view_x >> 5) + offset.x;
|
||||
int16_t right = ((viewport->view_x + viewport->view_width) >> 5) + offset.x;
|
||||
int16_t top = (viewport->view_y >> 4) + offset.y;
|
||||
int16_t bottom = ((viewport->view_y + viewport->view_height) >> 4) + offset.y;
|
||||
|
||||
// top horizontal lines
|
||||
gfx_fill_rect(dpi, left, top, left + 3, top, PALETTE_INDEX_56);
|
||||
|
@ -1160,9 +1160,9 @@ static void window_map_paint_hud_rectangle(rct_drawpixelinfo *dpi)
|
|||
*
|
||||
* rct2: 0x0068D24E
|
||||
*/
|
||||
static void window_map_set_land_rights_tool_update(sint32 x, sint32 y)
|
||||
static void window_map_set_land_rights_tool_update(int32_t x, int32_t y)
|
||||
{
|
||||
sint16 mapX, mapY;
|
||||
int16_t mapX, mapY;
|
||||
rct_viewport *viewport;
|
||||
|
||||
map_invalidate_selection_rect();
|
||||
|
@ -1174,12 +1174,12 @@ static void window_map_set_land_rights_tool_update(sint32 x, sint32 y)
|
|||
gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE;
|
||||
gMapSelectType = MAP_SELECT_TYPE_FULL;
|
||||
|
||||
sint32 landRightsToolSize = _landRightsToolSize;
|
||||
int32_t landRightsToolSize = _landRightsToolSize;
|
||||
if (landRightsToolSize == 0)
|
||||
landRightsToolSize = 1;
|
||||
|
||||
sint32 size = (landRightsToolSize * 32) - 32;
|
||||
sint32 radius = (landRightsToolSize * 16) - 16;
|
||||
int32_t size = (landRightsToolSize * 32) - 32;
|
||||
int32_t radius = (landRightsToolSize * 16) - 16;
|
||||
mapX = (mapX - radius) & 0xFFE0;
|
||||
mapY = (mapY - radius) & 0xFFE0;
|
||||
gMapSelectPositionA.x = mapX;
|
||||
|
@ -1193,7 +1193,7 @@ static void window_map_set_land_rights_tool_update(sint32 x, sint32 y)
|
|||
*
|
||||
* rct2: 0x00666EEF
|
||||
*/
|
||||
static void place_park_entrance_get_map_position(sint32 x, sint32 y, sint16 *mapX, sint16 *mapY, sint16 *mapZ, sint32 *direction)
|
||||
static void place_park_entrance_get_map_position(int32_t x, int32_t y, int16_t *mapX, int16_t *mapY, int16_t *mapZ, int32_t *direction)
|
||||
{
|
||||
rct_tile_element *tileElement;
|
||||
|
||||
|
@ -1219,10 +1219,10 @@ static void place_park_entrance_get_map_position(sint32 x, sint32 y, sint16 *map
|
|||
*
|
||||
* rct2: 0x00666FD0
|
||||
*/
|
||||
static void window_map_place_park_entrance_tool_update(sint32 x, sint32 y)
|
||||
static void window_map_place_park_entrance_tool_update(int32_t x, int32_t y)
|
||||
{
|
||||
sint16 mapX, mapY, mapZ = 0;
|
||||
sint32 direction = 0, sideDirection;
|
||||
int16_t mapX, mapY, mapZ = 0;
|
||||
int32_t direction = 0, sideDirection;
|
||||
|
||||
map_invalidate_selection_rect();
|
||||
map_invalidate_map_selection_tiles();
|
||||
|
@ -1230,7 +1230,7 @@ static void window_map_place_park_entrance_tool_update(sint32 x, sint32 y)
|
|||
gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW;
|
||||
gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_CONSTRUCT;
|
||||
place_park_entrance_get_map_position(x, y, &mapX, &mapY, &mapZ, &direction);
|
||||
if (mapX == (sint16)-1) {
|
||||
if (mapX == (int16_t)-1) {
|
||||
park_entrance_remove_ghost();
|
||||
return;
|
||||
}
|
||||
|
@ -1269,9 +1269,9 @@ static void window_map_place_park_entrance_tool_update(sint32 x, sint32 y)
|
|||
*
|
||||
* rct2: 0x0068D4E9
|
||||
*/
|
||||
static void window_map_set_peep_spawn_tool_update(sint32 x, sint32 y)
|
||||
static void window_map_set_peep_spawn_tool_update(int32_t x, int32_t y)
|
||||
{
|
||||
sint32 mapX, mapY, mapZ, direction;
|
||||
int32_t mapX, mapY, mapZ, direction;
|
||||
rct_tile_element *tileElement;
|
||||
|
||||
map_invalidate_selection_rect();
|
||||
|
@ -1307,12 +1307,12 @@ static void window_map_set_peep_spawn_tool_update(sint32 x, sint32 y)
|
|||
*
|
||||
* rct2: 0x006670A4
|
||||
*/
|
||||
static void window_map_place_park_entrance_tool_down(sint32 x, sint32 y)
|
||||
static void window_map_place_park_entrance_tool_down(int32_t x, int32_t y)
|
||||
{
|
||||
park_entrance_remove_ghost();
|
||||
|
||||
sint16 mapX, mapY, mapZ;
|
||||
sint32 direction;
|
||||
int16_t mapX, mapY, mapZ;
|
||||
int32_t direction;
|
||||
place_park_entrance_get_map_position(x, y, &mapX, &mapY, &mapZ, &direction);
|
||||
if (mapX != LOCATION_NULL)
|
||||
{
|
||||
|
@ -1333,10 +1333,10 @@ static void window_map_place_park_entrance_tool_down(sint32 x, sint32 y)
|
|||
*
|
||||
* rct2: 0x0068D573
|
||||
*/
|
||||
static void window_map_set_peep_spawn_tool_down(sint32 x, sint32 y)
|
||||
static void window_map_set_peep_spawn_tool_down(int32_t x, int32_t y)
|
||||
{
|
||||
rct_tile_element *tileElement;
|
||||
sint32 mapX, mapY, mapZ, direction;
|
||||
int32_t mapX, mapY, mapZ, direction;
|
||||
|
||||
// Verify footpath exists at location, and retrieve coordinates
|
||||
footpath_get_coordinates_from_pos(x, y, &mapX, &mapY, &direction, &tileElement);
|
||||
|
@ -1345,7 +1345,7 @@ static void window_map_set_peep_spawn_tool_down(sint32 x, sint32 y)
|
|||
|
||||
mapZ = tileElement->base_height * 8;
|
||||
|
||||
bool result = place_peep_spawn({mapX, mapY, mapZ, (uint8)direction});
|
||||
bool result = place_peep_spawn({mapX, mapY, mapZ, (uint8_t)direction});
|
||||
if (result) {
|
||||
audio_play_sound_at_location(
|
||||
SOUND_PLACE_ITEM,
|
||||
|
@ -1398,8 +1398,8 @@ static void map_window_decrease_map_size()
|
|||
gfx_invalidate_screen();
|
||||
}
|
||||
|
||||
static constexpr const uint16 WaterColour = MAP_COLOUR(PALETTE_INDEX_195);
|
||||
static constexpr const uint16 TerrainColour[] = {
|
||||
static constexpr const uint16_t WaterColour = MAP_COLOUR(PALETTE_INDEX_195);
|
||||
static constexpr const uint16_t TerrainColour[] = {
|
||||
MAP_COLOUR(PALETTE_INDEX_73), // TERRAIN_GRASS
|
||||
MAP_COLOUR(PALETTE_INDEX_40), // TERRAIN_SAND
|
||||
MAP_COLOUR(PALETTE_INDEX_108), // TERRAIN_DIRT
|
||||
|
@ -1416,7 +1416,7 @@ static constexpr const uint16 TerrainColour[] = {
|
|||
MAP_COLOUR(PALETTE_INDEX_222), // TERRAIN_SAND_LIGHT
|
||||
};
|
||||
|
||||
static constexpr const uint16 ElementTypeMaskColour[] = {
|
||||
static constexpr const uint16_t ElementTypeMaskColour[] = {
|
||||
0xFFFF, // TILE_ELEMENT_TYPE_SURFACE
|
||||
0x0000, // TILE_ELEMENT_TYPE_PATH
|
||||
0x00FF, // TILE_ELEMENT_TYPE_TRACK
|
||||
|
@ -1428,7 +1428,7 @@ static constexpr const uint16 ElementTypeMaskColour[] = {
|
|||
0x0000, // TILE_ELEMENT_TYPE_CORRUPT
|
||||
};
|
||||
|
||||
static constexpr const uint16 ElementTypeAddColour[] = {
|
||||
static constexpr const uint16_t ElementTypeAddColour[] = {
|
||||
MAP_COLOUR(PALETTE_INDEX_0), // TILE_ELEMENT_TYPE_SURFACE
|
||||
MAP_COLOUR(PALETTE_INDEX_17), // TILE_ELEMENT_TYPE_PATH
|
||||
MAP_COLOUR_2(PALETTE_INDEX_183, PALETTE_INDEX_0), // TILE_ELEMENT_TYPE_TRACK
|
||||
|
@ -1451,7 +1451,7 @@ enum {
|
|||
COLOUR_KEY_TOILETS
|
||||
};
|
||||
|
||||
static constexpr const uint8 RideColourKey[] = {
|
||||
static constexpr const uint8_t RideColourKey[] = {
|
||||
COLOUR_KEY_RIDE, // RIDE_TYPE_SPIRAL_ROLLER_COASTER
|
||||
COLOUR_KEY_RIDE, // RIDE_TYPE_STAND_UP_ROLLER_COASTER
|
||||
COLOUR_KEY_RIDE, // RIDE_TYPE_SUSPENDED_SWINGING_COASTER
|
||||
|
@ -1548,20 +1548,20 @@ static constexpr const uint8 RideColourKey[] = {
|
|||
COLOUR_KEY_RIDE, //
|
||||
};
|
||||
|
||||
static uint16 map_window_get_pixel_colour_peep(CoordsXY c)
|
||||
static uint16_t map_window_get_pixel_colour_peep(CoordsXY c)
|
||||
{
|
||||
rct_tile_element * tileElement = map_get_surface_element_at(c);
|
||||
uint16 colour = TerrainColour[surface_get_terrain(tileElement)];
|
||||
uint16_t colour = TerrainColour[surface_get_terrain(tileElement)];
|
||||
if (surface_get_water_height(tileElement) > 0)
|
||||
colour = WaterColour;
|
||||
|
||||
if (!(tileElement->properties.surface.ownership & OWNERSHIP_OWNED))
|
||||
colour = MAP_COLOUR_UNOWNED(colour);
|
||||
|
||||
const sint32 maxSupportedTileElementType = (sint32)Util::CountOf(ElementTypeAddColour);
|
||||
const int32_t maxSupportedTileElementType = (int32_t)Util::CountOf(ElementTypeAddColour);
|
||||
while (!(tileElement++)->IsLastForTile())
|
||||
{
|
||||
sint32 tileElementType = tileElement->GetType() >> 2;
|
||||
int32_t tileElementType = tileElement->GetType() >> 2;
|
||||
if (tileElementType >= maxSupportedTileElementType) {
|
||||
tileElementType = TILE_ELEMENT_TYPE_CORRUPT >> 2;
|
||||
}
|
||||
|
@ -1572,11 +1572,11 @@ static uint16 map_window_get_pixel_colour_peep(CoordsXY c)
|
|||
return colour;
|
||||
}
|
||||
|
||||
static uint16 map_window_get_pixel_colour_ride(CoordsXY c)
|
||||
static uint16_t map_window_get_pixel_colour_ride(CoordsXY c)
|
||||
{
|
||||
Ride *ride;
|
||||
uint16 colourA = 0; // highlight colour
|
||||
uint16 colourB = MAP_COLOUR(PALETTE_INDEX_13); // surface colour (dark grey)
|
||||
uint16_t colourA = 0; // highlight colour
|
||||
uint16_t colourB = MAP_COLOUR(PALETTE_INDEX_13); // surface colour (dark grey)
|
||||
|
||||
// as an improvement we could use first_element to show underground stuff?
|
||||
rct_tile_element * tileElement = map_get_surface_element_at(c);
|
||||
|
@ -1611,10 +1611,10 @@ static uint16 map_window_get_pixel_colour_ride(CoordsXY c)
|
|||
|
||||
static void map_window_set_pixels(rct_window *w)
|
||||
{
|
||||
uint16 colour = 0;
|
||||
sint32 x = 0, y = 0, dx = 0, dy = 0;
|
||||
uint16_t colour = 0;
|
||||
int32_t x = 0, y = 0, dx = 0, dy = 0;
|
||||
|
||||
sint32 pos = (_currentLine * (MAP_WINDOW_MAP_SIZE - 1)) + MAXIMUM_MAP_SIZE_TECHNICAL - 1;
|
||||
int32_t pos = (_currentLine * (MAP_WINDOW_MAP_SIZE - 1)) + MAXIMUM_MAP_SIZE_TECHNICAL - 1;
|
||||
LocationXY16 destinationPosition = MakeXY16(pos % MAP_WINDOW_MAP_SIZE, pos / MAP_WINDOW_MAP_SIZE);
|
||||
auto destination = _mapImageData.data() + (destinationPosition.y * MAP_WINDOW_MAP_SIZE) + destinationPosition.x;
|
||||
switch (get_current_rotation()) {
|
||||
|
@ -1644,7 +1644,7 @@ static void map_window_set_pixels(rct_window *w)
|
|||
break;
|
||||
}
|
||||
|
||||
for (sint32 i = 0; i < MAXIMUM_MAP_SIZE_TECHNICAL; i++) {
|
||||
for (int32_t i = 0; i < MAXIMUM_MAP_SIZE_TECHNICAL; i++) {
|
||||
if (
|
||||
x > 0 &&
|
||||
y > 0 &&
|
||||
|
@ -1674,12 +1674,12 @@ static void map_window_set_pixels(rct_window *w)
|
|||
_currentLine = 0;
|
||||
}
|
||||
|
||||
static CoordsXY map_window_screen_to_map(sint32 screenX, sint32 screenY)
|
||||
static CoordsXY map_window_screen_to_map(int32_t screenX, int32_t screenY)
|
||||
{
|
||||
screenX = ((screenX + 8) - MAXIMUM_MAP_SIZE_TECHNICAL) / 2;
|
||||
screenY = ((screenY + 8)) / 2;
|
||||
sint32 x = (screenY - screenX) * 32;
|
||||
sint32 y = (screenX + screenY) * 32;
|
||||
int32_t x = (screenY - screenX) * 32;
|
||||
int32_t y = (screenX + screenY) * 32;
|
||||
|
||||
switch (get_current_rotation()) {
|
||||
case 0: return {x, y};
|
||||
|
|
|
@ -184,7 +184,7 @@ static void window_mapgen_shared_mouseup(rct_window *w, rct_widgetindex widgetIn
|
|||
|
||||
static void window_mapgen_base_mouseup(rct_window *w, rct_widgetindex widgetIndex);
|
||||
static void window_mapgen_base_mousedown(rct_window *w, rct_widgetindex widgetIndex, rct_widget* widget);
|
||||
static void window_mapgen_base_dropdown(rct_window *w, rct_widgetindex widgetIndex, sint32 dropdownIndex);
|
||||
static void window_mapgen_base_dropdown(rct_window *w, rct_widgetindex widgetIndex, int32_t dropdownIndex);
|
||||
static void window_mapgen_base_update(rct_window *w);
|
||||
static void window_mapgen_textinput(rct_window *w, rct_widgetindex widgetIndex, char *text);
|
||||
static void window_mapgen_base_invalidate(rct_window *w);
|
||||
|
@ -198,7 +198,7 @@ static void window_mapgen_random_paint(rct_window *w, rct_drawpixelinfo *dpi);
|
|||
|
||||
static void window_mapgen_simplex_mouseup(rct_window *w, rct_widgetindex widgetIndex);
|
||||
static void window_mapgen_simplex_mousedown(rct_window *w, rct_widgetindex widgetIndex, rct_widget* widget);
|
||||
static void window_mapgen_simplex_dropdown(rct_window *w, rct_widgetindex widgetIndex, sint32 dropdownIndex);
|
||||
static void window_mapgen_simplex_dropdown(rct_window *w, rct_widgetindex widgetIndex, int32_t dropdownIndex);
|
||||
static void window_mapgen_simplex_update(rct_window *w);
|
||||
static void window_mapgen_simplex_invalidate(rct_window *w);
|
||||
static void window_mapgen_simplex_paint(rct_window *w, rct_drawpixelinfo *dpi);
|
||||
|
@ -343,7 +343,7 @@ static rct_window_event_list *PageEvents[] = {
|
|||
|
||||
#pragma region Enabled widgets
|
||||
|
||||
static uint64 PageEnabledWidgets[WINDOW_MAPGEN_PAGE_COUNT] = {
|
||||
static uint64_t PageEnabledWidgets[WINDOW_MAPGEN_PAGE_COUNT] = {
|
||||
(1ULL << WIDX_CLOSE) |
|
||||
(1ULL << WIDX_TAB_1) |
|
||||
(1ULL << WIDX_TAB_2) |
|
||||
|
@ -409,7 +409,7 @@ static uint64 PageEnabledWidgets[WINDOW_MAPGEN_PAGE_COUNT] = {
|
|||
(1ULL << WIDX_HEIGHTMAP_SELECT)
|
||||
};
|
||||
|
||||
static uint64 PageDisabledWidgets[WINDOW_MAPGEN_PAGE_COUNT] = {
|
||||
static uint64_t PageDisabledWidgets[WINDOW_MAPGEN_PAGE_COUNT] = {
|
||||
0,
|
||||
|
||||
0,
|
||||
|
@ -433,7 +433,7 @@ static uint64 PageDisabledWidgets[WINDOW_MAPGEN_PAGE_COUNT] = {
|
|||
(1ULL << WIDX_HEIGHTMAP_WATER_LEVEL_DOWN)
|
||||
};
|
||||
|
||||
static uint64 HoldDownWidgets[WINDOW_MAPGEN_PAGE_COUNT] = {
|
||||
static uint64_t HoldDownWidgets[WINDOW_MAPGEN_PAGE_COUNT] = {
|
||||
(1ULL << WIDX_MAP_SIZE_UP) |
|
||||
(1ULL << WIDX_MAP_SIZE_DOWN) |
|
||||
(1ULL << WIDX_BASE_HEIGHT_UP) |
|
||||
|
@ -466,7 +466,7 @@ static uint64 HoldDownWidgets[WINDOW_MAPGEN_PAGE_COUNT] = {
|
|||
(1ULL << WIDX_HEIGHTMAP_WATER_LEVEL_DOWN)
|
||||
};
|
||||
|
||||
static uint64 PressedWidgets[WINDOW_MAPGEN_PAGE_COUNT] = {
|
||||
static uint64_t PressedWidgets[WINDOW_MAPGEN_PAGE_COUNT] = {
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
|
@ -475,13 +475,13 @@ static uint64 PressedWidgets[WINDOW_MAPGEN_PAGE_COUNT] = {
|
|||
|
||||
#pragma endregion
|
||||
|
||||
static constexpr const sint32 TabAnimationDivisor[WINDOW_MAPGEN_PAGE_COUNT] = {
|
||||
static constexpr const int32_t TabAnimationDivisor[WINDOW_MAPGEN_PAGE_COUNT] = {
|
||||
1, 1, 1, 1
|
||||
};
|
||||
static constexpr const sint32 TabAnimationFrames[WINDOW_MAPGEN_PAGE_COUNT] = {
|
||||
static constexpr const int32_t TabAnimationFrames[WINDOW_MAPGEN_PAGE_COUNT] = {
|
||||
1, 1, 1, 1
|
||||
};
|
||||
static constexpr const sint32 TabAnimationLoops[WINDOW_MAPGEN_PAGE_COUNT] = {
|
||||
static constexpr const int32_t TabAnimationLoops[WINDOW_MAPGEN_PAGE_COUNT] = {
|
||||
16, 16, 16, 0
|
||||
};
|
||||
// clang-format on
|
||||
|
@ -492,30 +492,30 @@ static constexpr const sint32 TabAnimationLoops[WINDOW_MAPGEN_PAGE_COUNT] = {
|
|||
#define WATERLEVEL_MAX 54
|
||||
#define MAX_SMOOTH_ITERATIONS 20
|
||||
|
||||
static void window_mapgen_set_page(rct_window *w, sint32 page);
|
||||
static void window_mapgen_set_page(rct_window *w, int32_t page);
|
||||
static void window_mapgen_set_pressed_tab(rct_window *w);
|
||||
static void window_mapgen_draw_tab_images(rct_drawpixelinfo *dpi, rct_window *w);
|
||||
|
||||
static sint32 _mapSize = 150;
|
||||
static sint32 _baseHeight = 12;
|
||||
static sint32 _waterLevel = 6;
|
||||
static sint32 _floorTexture = TERRAIN_GRASS;
|
||||
static sint32 _wallTexture = TERRAIN_EDGE_ROCK;
|
||||
static int32_t _mapSize = 150;
|
||||
static int32_t _baseHeight = 12;
|
||||
static int32_t _waterLevel = 6;
|
||||
static int32_t _floorTexture = TERRAIN_GRASS;
|
||||
static int32_t _wallTexture = TERRAIN_EDGE_ROCK;
|
||||
static bool _randomTerrain = true;
|
||||
static sint32 _placeTrees = 1;
|
||||
static int32_t _placeTrees = 1;
|
||||
|
||||
static sint32 _simplex_low = 6;
|
||||
static sint32 _simplex_high = 10;
|
||||
static sint32 _simplex_base_freq = 60;
|
||||
static sint32 _simplex_octaves = 4;
|
||||
static int32_t _simplex_low = 6;
|
||||
static int32_t _simplex_high = 10;
|
||||
static int32_t _simplex_base_freq = 60;
|
||||
static int32_t _simplex_octaves = 4;
|
||||
|
||||
static bool _heightmapLoaded = false;
|
||||
static bool _heightmapSmoothMap = false;
|
||||
static sint32 _heightmapSmoothStrength = 1;
|
||||
static int32_t _heightmapSmoothStrength = 1;
|
||||
static bool _heightmapNormalize = false;
|
||||
static bool _heightmapSmoothTiles = true;
|
||||
static sint32 _heightmapLow = 2;
|
||||
static sint32 _heightmapHigh = 70;
|
||||
static int32_t _heightmapLow = 2;
|
||||
static int32_t _heightmapHigh = 70;
|
||||
|
||||
rct_window *window_mapgen_open()
|
||||
{
|
||||
|
@ -596,13 +596,13 @@ static void window_mapgen_base_mouseup(rct_window *w, rct_widgetindex widgetInde
|
|||
window_text_input_open(w, WIDX_MAP_SIZE, STR_MAP_SIZE_2, STR_ENTER_MAP_SIZE, STR_FORMAT_INTEGER, _mapSize - 2, 4);
|
||||
break;
|
||||
case WIDX_BASE_HEIGHT:
|
||||
TextInputDescriptionArgs[0] = (uint16)((BASESIZE_MIN - 12) / 2);
|
||||
TextInputDescriptionArgs[1] = (uint16)((BASESIZE_MAX - 12) / 2);
|
||||
TextInputDescriptionArgs[0] = (uint16_t)((BASESIZE_MIN - 12) / 2);
|
||||
TextInputDescriptionArgs[1] = (uint16_t)((BASESIZE_MAX - 12) / 2);
|
||||
window_text_input_open(w, WIDX_BASE_HEIGHT, STR_BASE_HEIGHT, STR_ENTER_BASE_HEIGHT, STR_FORMAT_INTEGER, (_baseHeight - 12) / 2, 3);
|
||||
break;
|
||||
case WIDX_WATER_LEVEL:
|
||||
TextInputDescriptionArgs[0] = (uint16)((WATERLEVEL_MIN - 12) / 2);
|
||||
TextInputDescriptionArgs[1] = (uint16)((WATERLEVEL_MAX - 12) / 2);
|
||||
TextInputDescriptionArgs[0] = (uint16_t)((WATERLEVEL_MIN - 12) / 2);
|
||||
TextInputDescriptionArgs[1] = (uint16_t)((WATERLEVEL_MAX - 12) / 2);
|
||||
window_text_input_open(w, WIDX_WATER_LEVEL, STR_WATER_LEVEL, STR_ENTER_WATER_LEVEL, STR_FORMAT_INTEGER, (_waterLevel - 12) / 2, 3);
|
||||
break;
|
||||
}
|
||||
|
@ -644,9 +644,9 @@ static void window_mapgen_base_mousedown(rct_window *w, rct_widgetindex widgetIn
|
|||
}
|
||||
}
|
||||
|
||||
static void window_mapgen_base_dropdown(rct_window *w, rct_widgetindex widgetIndex, sint32 dropdownIndex)
|
||||
static void window_mapgen_base_dropdown(rct_window *w, rct_widgetindex widgetIndex, int32_t dropdownIndex)
|
||||
{
|
||||
sint32 type;
|
||||
int32_t type;
|
||||
|
||||
switch (widgetIndex) {
|
||||
case WIDX_FLOOR_TEXTURE:
|
||||
|
@ -655,7 +655,7 @@ static void window_mapgen_base_dropdown(rct_window *w, rct_widgetindex widgetInd
|
|||
|
||||
type = (dropdownIndex == -1) ?
|
||||
_floorTexture :
|
||||
(uint32)gDropdownItemsArgs[dropdownIndex] - SPR_FLOOR_TEXTURE_GRASS;
|
||||
(uint32_t)gDropdownItemsArgs[dropdownIndex] - SPR_FLOOR_TEXTURE_GRASS;
|
||||
|
||||
if (gLandToolTerrainSurface == type) {
|
||||
gLandToolTerrainSurface = 255;
|
||||
|
@ -692,7 +692,7 @@ static void window_mapgen_base_update(rct_window *w)
|
|||
|
||||
static void window_mapgen_textinput(rct_window *w, rct_widgetindex widgetIndex, char *text)
|
||||
{
|
||||
sint32 value;
|
||||
int32_t value;
|
||||
char* end;
|
||||
|
||||
if (text == nullptr)
|
||||
|
@ -738,12 +738,12 @@ static void window_mapgen_base_invalidate(rct_window *w)
|
|||
|
||||
static void window_mapgen_base_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
||||
{
|
||||
uint16 arg;
|
||||
uint16_t arg;
|
||||
|
||||
window_draw_widgets(w, dpi);
|
||||
window_mapgen_draw_tab_images(dpi, w);
|
||||
|
||||
const uint8 textColour = w->colours[1];
|
||||
const uint8_t textColour = w->colours[1];
|
||||
|
||||
gfx_draw_string_left(dpi, STR_MAP_SIZE, nullptr, textColour, w->x + 4, w->y + w->widgets[WIDX_MAP_SIZE].top + 1);
|
||||
gfx_draw_string_left(dpi, STR_BASE_HEIGHT_LABEL, nullptr, textColour, w->x + 4, w->y + w->widgets[WIDX_BASE_HEIGHT].top + 1);
|
||||
|
@ -937,9 +937,9 @@ static void window_mapgen_simplex_mousedown(rct_window *w, rct_widgetindex widge
|
|||
}
|
||||
}
|
||||
|
||||
static void window_mapgen_simplex_dropdown(rct_window *w, rct_widgetindex widgetIndex, sint32 dropdownIndex)
|
||||
static void window_mapgen_simplex_dropdown(rct_window *w, rct_widgetindex widgetIndex, int32_t dropdownIndex)
|
||||
{
|
||||
sint32 type;
|
||||
int32_t type;
|
||||
|
||||
switch (widgetIndex) {
|
||||
case WIDX_SIMPLEX_FLOOR_TEXTURE:
|
||||
|
@ -948,7 +948,7 @@ static void window_mapgen_simplex_dropdown(rct_window *w, rct_widgetindex widget
|
|||
|
||||
type = (dropdownIndex == -1) ?
|
||||
_floorTexture :
|
||||
(uint32)gDropdownItemsArgs[dropdownIndex] - SPR_FLOOR_TEXTURE_GRASS;
|
||||
(uint32_t)gDropdownItemsArgs[dropdownIndex] - SPR_FLOOR_TEXTURE_GRASS;
|
||||
|
||||
if (gLandToolTerrainSurface == type) {
|
||||
gLandToolTerrainSurface = 255;
|
||||
|
@ -1013,12 +1013,12 @@ static void window_mapgen_simplex_invalidate(rct_window *w)
|
|||
|
||||
static void window_mapgen_simplex_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
||||
{
|
||||
uint16 arg;
|
||||
uint16_t arg;
|
||||
|
||||
window_draw_widgets(w, dpi);
|
||||
window_mapgen_draw_tab_images(dpi, w);
|
||||
|
||||
const uint8 textColour = w->colours[1];
|
||||
const uint8_t textColour = w->colours[1];
|
||||
|
||||
gfx_draw_string_left(dpi, STR_MAPGEN_SIMPLEX_NOISE_LOW_, nullptr, textColour, w->x + 5, w->y + w->widgets[WIDX_SIMPLEX_LOW].top + 1);
|
||||
gfx_draw_string_left(dpi, STR_MAPGEN_SIMPLEX_NOISE_HIGH, nullptr, textColour, w->x + 5, w->y + w->widgets[WIDX_SIMPLEX_HIGH].top + 1);
|
||||
|
@ -1101,7 +1101,7 @@ static void window_mapgen_heightmap_generate_map()
|
|||
gfx_invalidate_screen();
|
||||
}
|
||||
|
||||
static void window_mapgen_heightmap_loadsave_callback(sint32 result, const utf8 *path)
|
||||
static void window_mapgen_heightmap_loadsave_callback(int32_t result, const utf8 *path)
|
||||
{
|
||||
if (result == MODAL_RESULT_OK) {
|
||||
if (!mapgen_load_heightmap(path)) {
|
||||
|
@ -1185,28 +1185,28 @@ static void window_mapgen_heightmap_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
|||
window_draw_widgets(w, dpi);
|
||||
window_mapgen_draw_tab_images(dpi, w);
|
||||
|
||||
const uint8 enabledColour = w->colours[1];
|
||||
const uint8 disabledColour = enabledColour | COLOUR_FLAG_INSET;
|
||||
const uint8_t enabledColour = w->colours[1];
|
||||
const uint8_t disabledColour = enabledColour | COLOUR_FLAG_INSET;
|
||||
|
||||
// Smooth strength label and value
|
||||
const uint8 strengthColour = _heightmapSmoothMap ? enabledColour : disabledColour;
|
||||
sint16 strength = _heightmapSmoothStrength;
|
||||
const uint8_t strengthColour = _heightmapSmoothMap ? enabledColour : disabledColour;
|
||||
int16_t strength = _heightmapSmoothStrength;
|
||||
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, w->y + w->widgets[WIDX_HEIGHTMAP_STRENGTH].top + 1);
|
||||
|
||||
// Low label and value
|
||||
const uint8 labelColour = _heightmapLoaded ? enabledColour : disabledColour;
|
||||
sint16 low = _heightmapLow;
|
||||
const uint8_t labelColour = _heightmapLoaded ? enabledColour : disabledColour;
|
||||
int16_t low = _heightmapLow;
|
||||
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, w->y + w->widgets[WIDX_HEIGHTMAP_LOW].top + 1);
|
||||
|
||||
// High label and value
|
||||
sint16 high = _heightmapHigh;
|
||||
int16_t high = _heightmapHigh;
|
||||
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, w->y + w->widgets[WIDX_HEIGHTMAP_HIGH].top + 1);
|
||||
|
||||
// Water level label and value
|
||||
sint16 waterLevel = _waterLevel;
|
||||
int16_t waterLevel = _waterLevel;
|
||||
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, w->y + w->widgets[WIDX_HEIGHTMAP_WATER_LEVEL].top + 1);
|
||||
}
|
||||
|
@ -1215,7 +1215,7 @@ static void window_mapgen_heightmap_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
|||
|
||||
#pragma region Common
|
||||
|
||||
static void window_mapgen_set_page(rct_window *w, sint32 page)
|
||||
static void window_mapgen_set_page(rct_window *w, int32_t page)
|
||||
{
|
||||
w->page = page;
|
||||
w->frame_no = 0;
|
||||
|
@ -1257,19 +1257,19 @@ static void window_mapgen_set_page(rct_window *w, sint32 page)
|
|||
|
||||
static void window_mapgen_set_pressed_tab(rct_window *w)
|
||||
{
|
||||
sint32 i;
|
||||
int32_t i;
|
||||
for (i = 0; i < WINDOW_MAPGEN_PAGE_COUNT; i++)
|
||||
w->pressed_widgets &= ~(1 << (WIDX_TAB_1 + i));
|
||||
w->pressed_widgets |= 1LL << (WIDX_TAB_1 + w->page);
|
||||
}
|
||||
|
||||
static void window_mapgen_draw_tab_image(rct_drawpixelinfo *dpi, rct_window *w, sint32 page, sint32 spriteIndex)
|
||||
static void window_mapgen_draw_tab_image(rct_drawpixelinfo *dpi, rct_window *w, int32_t page, int32_t spriteIndex)
|
||||
{
|
||||
rct_widgetindex widgetIndex = WIDX_TAB_1 + page;
|
||||
|
||||
if (!(w->disabled_widgets & (1LL << widgetIndex))) {
|
||||
if (w->page == page) {
|
||||
sint32 frame = w->frame_no / TabAnimationDivisor[w->page];
|
||||
int32_t frame = w->frame_no / TabAnimationDivisor[w->page];
|
||||
spriteIndex += (frame % TabAnimationFrames[w->page]);
|
||||
}
|
||||
|
||||
|
|
|
@ -59,9 +59,9 @@ static rct_window_event_list window_map_tooltip_events = {
|
|||
|
||||
#define MAP_TOOLTIP_ARGS
|
||||
|
||||
static sint32 _lastCursorX;
|
||||
static sint32 _lastCursorY;
|
||||
static sint32 _cursorHoldDuration;
|
||||
static int32_t _lastCursorX;
|
||||
static int32_t _lastCursorY;
|
||||
static int32_t _cursorHoldDuration;
|
||||
|
||||
static void window_map_tooltip_open();
|
||||
|
||||
|
@ -78,7 +78,7 @@ void window_map_tooltip_update_visibility()
|
|||
return;
|
||||
}
|
||||
|
||||
sint32 cursorX, cursorY;
|
||||
int32_t cursorX, cursorY;
|
||||
|
||||
const CursorState * state = context_get_cursor_state();
|
||||
cursorX = state->x;
|
||||
|
@ -114,7 +114,7 @@ void window_map_tooltip_update_visibility()
|
|||
static void window_map_tooltip_open()
|
||||
{
|
||||
rct_window* w;
|
||||
sint32 x, y, width, height;
|
||||
int32_t x, y, width, height;
|
||||
|
||||
width = 200;
|
||||
height = 44;
|
||||
|
|
|
@ -87,8 +87,8 @@ static void window_maze_construction_mouseup(rct_window *w, rct_widgetindex widg
|
|||
static void window_maze_construction_resize(rct_window *w);
|
||||
static void window_maze_construction_mousedown(rct_window *w, rct_widgetindex widgetIndex, rct_widget *widget);
|
||||
static void window_maze_construction_update(rct_window *w);
|
||||
static void window_maze_construction_toolupdate(rct_window* w, rct_widgetindex widgetIndex, sint32 x, sint32 y);
|
||||
static void window_maze_construction_tooldown(rct_window* w, rct_widgetindex widgetIndex, sint32 x, sint32 y);
|
||||
static void window_maze_construction_toolupdate(rct_window* w, rct_widgetindex widgetIndex, int32_t x, int32_t y);
|
||||
static void window_maze_construction_tooldown(rct_window* w, rct_widgetindex widgetIndex, int32_t x, int32_t y);
|
||||
static void window_maze_construction_invalidate(rct_window *w);
|
||||
static void window_maze_construction_paint(rct_window *w, rct_drawpixelinfo *dpi);
|
||||
|
||||
|
@ -127,7 +127,7 @@ static rct_window_event_list window_maze_construction_events = {
|
|||
|
||||
#pragma endregion
|
||||
|
||||
static void window_maze_construction_construct(sint32 direction);
|
||||
static void window_maze_construction_construct(int32_t direction);
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -175,10 +175,10 @@ static void window_maze_construction_close(rct_window *w)
|
|||
|
||||
hide_gridlines();
|
||||
|
||||
uint8 rideIndex = _currentRideIndex;
|
||||
uint8_t rideIndex = _currentRideIndex;
|
||||
Ride* ride = get_ride(rideIndex);
|
||||
if (ride->overall_view.xy == RCT_XY8_UNDEFINED) {
|
||||
sint32 savedPausedState = gGamePaused;
|
||||
int32_t savedPausedState = gGamePaused;
|
||||
gGamePaused = 0;
|
||||
ride_action_modify(rideIndex, RIDE_MODIFY_DEMOLISH, GAME_COMMAND_FLAG_APPLY | GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED);
|
||||
gGamePaused = savedPausedState;
|
||||
|
@ -194,14 +194,14 @@ static void window_maze_construction_entrance_mouseup(rct_window *w, rct_widgeti
|
|||
return;
|
||||
|
||||
gRideEntranceExitPlaceType = widgetIndex == WIDX_MAZE_ENTRANCE ? ENTRANCE_TYPE_RIDE_ENTRANCE : ENTRANCE_TYPE_RIDE_EXIT;
|
||||
gRideEntranceExitPlaceRideIndex = (uint8)w->number;
|
||||
gRideEntranceExitPlaceRideIndex = (uint8_t)w->number;
|
||||
gRideEntranceExitPlaceStationIndex = 0;
|
||||
input_set_flag(INPUT_FLAG_6, true);
|
||||
|
||||
ride_construction_invalidate_current_track();
|
||||
|
||||
// ???
|
||||
uint8 old_state = _rideConstructionState;
|
||||
uint8_t old_state = _rideConstructionState;
|
||||
_rideConstructionState = RIDE_CONSTRUCTION_STATE_ENTRANCE_EXIT;
|
||||
if (old_state != RIDE_CONSTRUCTION_STATE_ENTRANCE_EXIT)
|
||||
_rideConstructionState = old_state;
|
||||
|
@ -239,7 +239,7 @@ static void window_maze_construction_mouseup(rct_window *w, rct_widgetindex widg
|
|||
*/
|
||||
static void window_maze_construction_resize(rct_window *w)
|
||||
{
|
||||
uint64 disabledWidgets = 0;
|
||||
uint64_t disabledWidgets = 0;
|
||||
if (_rideConstructionState == RIDE_CONSTRUCTION_STATE_PLACE) {
|
||||
disabledWidgets |= (
|
||||
(1ULL << WIDX_MAZE_BUILD_MODE) |
|
||||
|
@ -253,7 +253,7 @@ static void window_maze_construction_resize(rct_window *w)
|
|||
}
|
||||
|
||||
// Set and invalidate the changed widgets
|
||||
uint64 currentDisabledWidgets = w->disabled_widgets;
|
||||
uint64_t currentDisabledWidgets = w->disabled_widgets;
|
||||
if (currentDisabledWidgets == disabledWidgets)
|
||||
return;
|
||||
|
||||
|
@ -333,7 +333,7 @@ static void window_maze_construction_update(rct_window *w)
|
|||
*
|
||||
* rct2: 0x006CD63E
|
||||
*/
|
||||
static void window_maze_construction_toolupdate(rct_window* w, rct_widgetindex widgetIndex, sint32 x, sint32 y)
|
||||
static void window_maze_construction_toolupdate(rct_window* w, rct_widgetindex widgetIndex, int32_t x, int32_t y)
|
||||
{
|
||||
switch (widgetIndex){
|
||||
case WIDX_MAZE_DIRECTION_GROUPBOX:
|
||||
|
@ -350,7 +350,7 @@ static void window_maze_construction_toolupdate(rct_window* w, rct_widgetindex w
|
|||
*
|
||||
* rct2: 0x006C825F
|
||||
*/
|
||||
static void window_maze_construction_entrance_tooldown(sint32 x, sint32 y, rct_window* w){
|
||||
static void window_maze_construction_entrance_tooldown(int32_t x, int32_t y, rct_window* w){
|
||||
ride_construction_invalidate_current_track();
|
||||
|
||||
map_invalidate_selection_rect();
|
||||
|
@ -358,14 +358,14 @@ static void window_maze_construction_entrance_tooldown(sint32 x, sint32 y, rct_w
|
|||
gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE;
|
||||
gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW;
|
||||
|
||||
sint32 direction = 0;
|
||||
int32_t direction = 0;
|
||||
ride_get_entrance_or_exit_position_from_screen_position(x, y, &x, &y, &direction);
|
||||
|
||||
if (gRideEntranceExitPlaceDirection == 0xFF)
|
||||
return;
|
||||
|
||||
uint8 rideIndex = gRideEntranceExitPlaceRideIndex;
|
||||
uint8 entranceExitType = gRideEntranceExitPlaceType;
|
||||
uint8_t rideIndex = gRideEntranceExitPlaceRideIndex;
|
||||
uint8_t entranceExitType = gRideEntranceExitPlaceType;
|
||||
if (entranceExitType == ENTRANCE_TYPE_RIDE_ENTRANCE) {
|
||||
gGameCommandErrorTitle = STR_CANT_BUILD_MOVE_ENTRANCE_FOR_THIS_RIDE_ATTRACTION;
|
||||
} else {
|
||||
|
@ -407,7 +407,7 @@ static void window_maze_construction_entrance_tooldown(sint32 x, sint32 y, rct_w
|
|||
*
|
||||
* rct2: 0x006CD65D
|
||||
*/
|
||||
static void window_maze_construction_tooldown(rct_window* w, rct_widgetindex widgetIndex, sint32 x, sint32 y)
|
||||
static void window_maze_construction_tooldown(rct_window* w, rct_widgetindex widgetIndex, int32_t x, int32_t y)
|
||||
{
|
||||
switch (widgetIndex){
|
||||
case WIDX_MAZE_DIRECTION_GROUPBOX:
|
||||
|
@ -430,7 +430,7 @@ static void window_maze_construction_invalidate(rct_window *w)
|
|||
|
||||
// Set window title arguments
|
||||
set_format_arg(4, rct_string_id, ride->name);
|
||||
set_format_arg(6, uint32, ride->name_arguments);
|
||||
set_format_arg(6, uint32_t, ride->name_arguments);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -454,7 +454,7 @@ void window_maze_construction_update_pressed_widgets()
|
|||
if (w == nullptr)
|
||||
return;
|
||||
|
||||
uint64 pressedWidgets = w->pressed_widgets;
|
||||
uint64_t pressedWidgets = w->pressed_widgets;
|
||||
pressedWidgets &= ~(1ULL << WIDX_MAZE_BUILD_MODE);
|
||||
pressedWidgets &= ~(1ULL << WIDX_MAZE_MOVE_MODE);
|
||||
pressedWidgets &= ~(1ULL << WIDX_MAZE_FILL_MODE);
|
||||
|
@ -479,9 +479,9 @@ void window_maze_construction_update_pressed_widgets()
|
|||
*
|
||||
* rct2: 0x006CD4AB
|
||||
*/
|
||||
static void window_maze_construction_construct(sint32 direction)
|
||||
static void window_maze_construction_construct(int32_t direction)
|
||||
{
|
||||
sint32 x, y, z, flags, mode;
|
||||
int32_t x, y, z, flags, mode;
|
||||
|
||||
ride_construction_invalidate_current_track();
|
||||
|
||||
|
|
|
@ -109,7 +109,7 @@ static rct_widget *window_multiplayer_page_widgets[] = {
|
|||
window_multiplayer_options_widgets
|
||||
};
|
||||
|
||||
static constexpr const uint64 window_multiplayer_page_enabled_widgets[] = {
|
||||
static constexpr const uint64_t window_multiplayer_page_enabled_widgets[] = {
|
||||
(1 << WIDX_CLOSE) | (1 << WIDX_TAB1) | (1 << WIDX_TAB2) | (1 << WIDX_TAB3) | (1 << WIDX_TAB4),
|
||||
(1 << WIDX_CLOSE) | (1 << WIDX_TAB1) | (1 << WIDX_TAB2) | (1 << WIDX_TAB3) | (1 << WIDX_TAB4),
|
||||
(1 << WIDX_CLOSE) | (1 << WIDX_TAB1) | (1 << WIDX_TAB2) | (1 << WIDX_TAB3) | (1 << WIDX_TAB4) | (1 << WIDX_DEFAULT_GROUP) | (1 << WIDX_DEFAULT_GROUP_DROPDOWN) | (1 << WIDX_ADD_GROUP) | (1 << WIDX_REMOVE_GROUP) | (1 << WIDX_RENAME_GROUP) | (1 << WIDX_SELECTED_GROUP) | (1 << WIDX_SELECTED_GROUP_DROPDOWN),
|
||||
|
@ -123,7 +123,7 @@ static constexpr rct_string_id WindowMultiplayerPageTitles[] = {
|
|||
STR_MULTIPLAYER_OPTIONS_TITLE,
|
||||
};
|
||||
|
||||
static uint8 _selectedGroup = 0;
|
||||
static uint8_t _selectedGroup = 0;
|
||||
|
||||
static void window_multiplayer_information_mouseup(rct_window *w, rct_widgetindex widgetIndex);
|
||||
static void window_multiplayer_information_resize(rct_window *w);
|
||||
|
@ -134,25 +134,25 @@ static void window_multiplayer_information_paint(rct_window *w, rct_drawpixelinf
|
|||
static void window_multiplayer_players_mouseup(rct_window *w, rct_widgetindex widgetIndex);
|
||||
static void window_multiplayer_players_resize(rct_window *w);
|
||||
static void window_multiplayer_players_update(rct_window *w);
|
||||
static void window_multiplayer_players_scrollgetsize(rct_window *w, sint32 scrollIndex, sint32 *width, sint32 *height);
|
||||
static void window_multiplayer_players_scrollmousedown(rct_window *w, sint32 scrollIndex, sint32 x, sint32 y);
|
||||
static void window_multiplayer_players_scrollmouseover(rct_window *w, sint32 scrollIndex, sint32 x, sint32 y);
|
||||
static void window_multiplayer_players_scrollgetsize(rct_window *w, int32_t scrollIndex, int32_t *width, int32_t *height);
|
||||
static void window_multiplayer_players_scrollmousedown(rct_window *w, int32_t scrollIndex, int32_t x, int32_t y);
|
||||
static void window_multiplayer_players_scrollmouseover(rct_window *w, int32_t scrollIndex, int32_t x, int32_t y);
|
||||
static void window_multiplayer_players_invalidate(rct_window *w);
|
||||
static void window_multiplayer_players_paint(rct_window *w, rct_drawpixelinfo *dpi);
|
||||
static void window_multiplayer_players_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, sint32 scrollIndex);
|
||||
static void window_multiplayer_players_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, int32_t scrollIndex);
|
||||
|
||||
static void window_multiplayer_groups_mouseup(rct_window *w, rct_widgetindex widgetIndex);
|
||||
static void window_multiplayer_groups_resize(rct_window *w);
|
||||
static void window_multiplayer_groups_mousedown(rct_window *w, rct_widgetindex widgetIndex, rct_widget* widget);
|
||||
static void window_multiplayer_groups_dropdown(rct_window *w, rct_widgetindex widgetIndex, sint32 dropdownIndex);
|
||||
static void window_multiplayer_groups_dropdown(rct_window *w, rct_widgetindex widgetIndex, int32_t dropdownIndex);
|
||||
static void window_multiplayer_groups_update(rct_window *w);
|
||||
static void window_multiplayer_groups_scrollgetsize(rct_window *w, sint32 scrollIndex, sint32 *width, sint32 *height);
|
||||
static void window_multiplayer_groups_scrollmousedown(rct_window *w, sint32 scrollIndex, sint32 x, sint32 y);
|
||||
static void window_multiplayer_groups_scrollmouseover(rct_window *w, sint32 scrollIndex, sint32 x, sint32 y);
|
||||
static void window_multiplayer_groups_scrollgetsize(rct_window *w, int32_t scrollIndex, int32_t *width, int32_t *height);
|
||||
static void window_multiplayer_groups_scrollmousedown(rct_window *w, int32_t scrollIndex, int32_t x, int32_t y);
|
||||
static void window_multiplayer_groups_scrollmouseover(rct_window *w, int32_t scrollIndex, int32_t x, int32_t y);
|
||||
static void window_multiplayer_groups_text_input(rct_window *w, rct_widgetindex widgetIndex, char *text);
|
||||
static void window_multiplayer_groups_invalidate(rct_window *w);
|
||||
static void window_multiplayer_groups_paint(rct_window *w, rct_drawpixelinfo *dpi);
|
||||
static void window_multiplayer_groups_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, sint32 scrollIndex);
|
||||
static void window_multiplayer_groups_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, int32_t scrollIndex);
|
||||
|
||||
static void window_multiplayer_options_mouseup(rct_window *w, rct_widgetindex widgetIndex);
|
||||
static void window_multiplayer_options_resize(rct_window *w);
|
||||
|
@ -292,11 +292,11 @@ static rct_window_event_list *window_multiplayer_page_events[] = {
|
|||
};
|
||||
// clang-format on
|
||||
|
||||
static constexpr const sint32 window_multiplayer_animation_divisor[] = { 4, 4, 2, 2 };
|
||||
static constexpr const sint32 window_multiplayer_animation_frames[] = { 8, 8, 7, 4 };
|
||||
static constexpr const int32_t window_multiplayer_animation_divisor[] = { 4, 4, 2, 2 };
|
||||
static constexpr const int32_t window_multiplayer_animation_frames[] = { 8, 8, 7, 4 };
|
||||
|
||||
static void window_multiplayer_draw_tab_images(rct_window *w, rct_drawpixelinfo *dpi);
|
||||
static void window_multiplayer_set_page(rct_window* w, sint32 page);
|
||||
static void window_multiplayer_set_page(rct_window* w, int32_t page);
|
||||
|
||||
static bool _windowInformationSizeDirty;
|
||||
static LocationXY16 _windowInformationSize;
|
||||
|
@ -313,7 +313,7 @@ rct_window * window_multiplayer_open()
|
|||
return window;
|
||||
}
|
||||
|
||||
static void window_multiplayer_set_page(rct_window* w, sint32 page)
|
||||
static void window_multiplayer_set_page(rct_window* w, int32_t page)
|
||||
{
|
||||
_windowInformationSizeDirty = true;
|
||||
|
||||
|
@ -348,7 +348,7 @@ static void window_multiplayer_anchor_border_widgets(rct_window *w)
|
|||
|
||||
static void window_multiplayer_set_pressed_tab(rct_window *w)
|
||||
{
|
||||
for (sint32 i = 0; i < 2; i++) {
|
||||
for (int32_t i = 0; i < 2; i++) {
|
||||
w->pressed_widgets &= ~(1 << (WIDX_TAB1 + i));
|
||||
}
|
||||
w->pressed_widgets |= 1LL << (WIDX_TAB1 + w->page);
|
||||
|
@ -357,7 +357,7 @@ static void window_multiplayer_set_pressed_tab(rct_window *w)
|
|||
static void window_multiplayer_groups_show_group_dropdown(rct_window *w, rct_widget *widget)
|
||||
{
|
||||
rct_widget *dropdownWidget;
|
||||
sint32 numItems, i;
|
||||
int32_t numItems, i;
|
||||
|
||||
dropdownWidget = widget - 1;
|
||||
|
||||
|
@ -411,21 +411,21 @@ static LocationXY16 window_multiplayer_information_get_size()
|
|||
return _windowInformationSize;
|
||||
}
|
||||
|
||||
sint32 width = 450;
|
||||
sint32 height = 60;
|
||||
sint32 minNumLines = 5;
|
||||
sint32 descNumLines, fontSpriteBase;
|
||||
int32_t width = 450;
|
||||
int32_t height = 60;
|
||||
int32_t minNumLines = 5;
|
||||
int32_t descNumLines, fontSpriteBase;
|
||||
|
||||
gCurrentFontSpriteBase = FONT_SPRITE_BASE_MEDIUM;
|
||||
utf8 * buffer = _strdup(network_get_server_description());
|
||||
gfx_wrap_string(buffer, width, &descNumLines, &fontSpriteBase);
|
||||
free(buffer);
|
||||
|
||||
sint32 lineHeight = font_get_line_height(fontSpriteBase);
|
||||
int32_t lineHeight = font_get_line_height(fontSpriteBase);
|
||||
height += (minNumLines + descNumLines) * lineHeight;
|
||||
|
||||
_windowInformationSizeDirty = false;
|
||||
_windowInformationSize = { (sint16)width, (sint16)height };
|
||||
_windowInformationSize = { (int16_t)width, (int16_t)height };
|
||||
return _windowInformationSize;
|
||||
}
|
||||
|
||||
|
@ -457,9 +457,9 @@ static void window_multiplayer_information_paint(rct_window *w, rct_drawpixelinf
|
|||
if (clip_drawpixelinfo(&clippedDPI, dpi, w->x, w->y, w->width, w->height)) {
|
||||
dpi = &clippedDPI;
|
||||
|
||||
sint32 x = 3;
|
||||
sint32 y = 50;
|
||||
sint32 width = w->width - 6;
|
||||
int32_t x = 3;
|
||||
int32_t y = 50;
|
||||
int32_t width = w->width - 6;
|
||||
|
||||
const utf8 * name = network_get_server_name();
|
||||
{
|
||||
|
@ -533,9 +533,9 @@ static void window_multiplayer_players_update(rct_window *w)
|
|||
widget_invalidate(w, WIDX_TAB1 + w->page);
|
||||
}
|
||||
|
||||
static void window_multiplayer_players_scrollgetsize(rct_window *w, sint32 scrollIndex, sint32 *width, sint32 *height)
|
||||
static void window_multiplayer_players_scrollgetsize(rct_window *w, int32_t scrollIndex, int32_t *width, int32_t *height)
|
||||
{
|
||||
sint32 i;
|
||||
int32_t i;
|
||||
|
||||
if (w->selected_list_item != -1) {
|
||||
w->selected_list_item = -1;
|
||||
|
@ -552,9 +552,9 @@ static void window_multiplayer_players_scrollgetsize(rct_window *w, sint32 scrol
|
|||
}
|
||||
}
|
||||
|
||||
static void window_multiplayer_players_scrollmousedown(rct_window *w, sint32 scrollIndex, sint32 x, sint32 y)
|
||||
static void window_multiplayer_players_scrollmousedown(rct_window *w, int32_t scrollIndex, int32_t x, int32_t y)
|
||||
{
|
||||
sint32 index;
|
||||
int32_t index;
|
||||
|
||||
index = y / SCROLLABLE_ROW_HEIGHT;
|
||||
if (index >= w->no_list_items)
|
||||
|
@ -566,9 +566,9 @@ static void window_multiplayer_players_scrollmousedown(rct_window *w, sint32 scr
|
|||
window_player_open(network_get_player_id(index));
|
||||
}
|
||||
|
||||
static void window_multiplayer_players_scrollmouseover(rct_window *w, sint32 scrollIndex, sint32 x, sint32 y)
|
||||
static void window_multiplayer_players_scrollmouseover(rct_window *w, int32_t scrollIndex, int32_t x, int32_t y)
|
||||
{
|
||||
sint32 index;
|
||||
int32_t index;
|
||||
|
||||
index = y / SCROLLABLE_ROW_HEIGHT;
|
||||
if (index >= w->no_list_items)
|
||||
|
@ -590,7 +590,7 @@ static void window_multiplayer_players_invalidate(rct_window *w)
|
|||
static void window_multiplayer_players_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
||||
{
|
||||
rct_string_id stringId;
|
||||
sint32 x, y;
|
||||
int32_t x, y;
|
||||
|
||||
window_draw_widgets(w, dpi);
|
||||
window_multiplayer_draw_tab_images(w, dpi);
|
||||
|
@ -602,10 +602,10 @@ static void window_multiplayer_players_paint(rct_window *w, rct_drawpixelinfo *d
|
|||
gfx_draw_string_left(dpi, stringId, &w->no_list_items, w->colours[2], x, y);
|
||||
}
|
||||
|
||||
static void window_multiplayer_players_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, sint32 scrollIndex)
|
||||
static void window_multiplayer_players_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, int32_t scrollIndex)
|
||||
{
|
||||
sint32 y = 0;
|
||||
for (sint32 i = 0; i < network_get_num_players(); i++) {
|
||||
int32_t y = 0;
|
||||
for (int32_t i = 0; i < network_get_num_players(); i++) {
|
||||
if (y > dpi->y + dpi->height) {
|
||||
break;
|
||||
}
|
||||
|
@ -616,7 +616,7 @@ static void window_multiplayer_players_scrollpaint(rct_window *w, rct_drawpixeli
|
|||
|
||||
// Draw player name
|
||||
char* lineCh = buffer;
|
||||
sint32 colour = COLOUR_BLACK;
|
||||
int32_t colour = COLOUR_BLACK;
|
||||
if (i == w->selected_list_item)
|
||||
{
|
||||
gfx_filter_rect(dpi, 0, y, 800, y + SCROLLABLE_ROW_HEIGHT - 1, PALETTE_DARKEN_1);
|
||||
|
@ -637,7 +637,7 @@ static void window_multiplayer_players_scrollpaint(rct_window *w, rct_drawpixeli
|
|||
|
||||
// Draw group name
|
||||
lineCh = buffer;
|
||||
sint32 group = network_get_group_index(network_get_player_group(i));
|
||||
int32_t group = network_get_group_index(network_get_player_group(i));
|
||||
if (group != -1) {
|
||||
lineCh = utf8_write_codepoint(lineCh, FORMAT_BLACK);
|
||||
safe_strcpy(lineCh, network_get_group_name(group), sizeof(buffer) - (lineCh - buffer));
|
||||
|
@ -646,7 +646,7 @@ static void window_multiplayer_players_scrollpaint(rct_window *w, rct_drawpixeli
|
|||
}
|
||||
|
||||
// Draw last action
|
||||
sint32 action = network_get_player_last_action(i, 2000);
|
||||
int32_t action = network_get_player_last_action(i, 2000);
|
||||
set_format_arg(0, rct_string_id, STR_ACTION_NA);
|
||||
if (action != -999) {
|
||||
set_format_arg(0, rct_string_id, network_get_action_name_string_id(action));
|
||||
|
@ -655,7 +655,7 @@ static void window_multiplayer_players_scrollpaint(rct_window *w, rct_drawpixeli
|
|||
|
||||
// Draw ping
|
||||
lineCh = buffer;
|
||||
sint32 ping = network_get_player_ping(i);
|
||||
int32_t ping = network_get_player_ping(i);
|
||||
if (ping <= 100) {
|
||||
lineCh = utf8_write_codepoint(lineCh, FORMAT_GREEN);
|
||||
} else
|
||||
|
@ -696,7 +696,7 @@ static void window_multiplayer_groups_mouseup(rct_window *w, rct_widgetindex wid
|
|||
game_do_command(1 | (_selectedGroup << 8), GAME_COMMAND_FLAG_APPLY, 0, 0, GAME_COMMAND_MODIFY_GROUPS, 0, 0);
|
||||
break;
|
||||
case WIDX_RENAME_GROUP:;
|
||||
sint32 groupIndex = network_get_group_index(_selectedGroup);
|
||||
int32_t groupIndex = network_get_group_index(_selectedGroup);
|
||||
const utf8 *groupName = network_get_group_name(groupIndex);
|
||||
window_text_input_raw_open(w, widgetIndex, STR_GROUP_NAME, STR_ENTER_NEW_NAME_FOR_THIS_GROUP, (utf8*)groupName, 32);
|
||||
break;
|
||||
|
@ -726,7 +726,7 @@ static void window_multiplayer_groups_mousedown(rct_window *w, rct_widgetindex w
|
|||
}
|
||||
}
|
||||
|
||||
static void window_multiplayer_groups_dropdown(rct_window *w, rct_widgetindex widgetIndex, sint32 dropdownIndex)
|
||||
static void window_multiplayer_groups_dropdown(rct_window *w, rct_widgetindex widgetIndex, int32_t dropdownIndex)
|
||||
{
|
||||
if (dropdownIndex == -1) {
|
||||
return;
|
||||
|
@ -750,9 +750,9 @@ static void window_multiplayer_groups_update(rct_window *w)
|
|||
widget_invalidate(w, WIDX_TAB1 + w->page);
|
||||
}
|
||||
|
||||
static void window_multiplayer_groups_scrollgetsize(rct_window *w, sint32 scrollIndex, sint32 *width, sint32 *height)
|
||||
static void window_multiplayer_groups_scrollgetsize(rct_window *w, int32_t scrollIndex, int32_t *width, int32_t *height)
|
||||
{
|
||||
sint32 i;
|
||||
int32_t i;
|
||||
|
||||
if (w->selected_list_item != -1) {
|
||||
w->selected_list_item = -1;
|
||||
|
@ -769,9 +769,9 @@ static void window_multiplayer_groups_scrollgetsize(rct_window *w, sint32 scroll
|
|||
}
|
||||
}
|
||||
|
||||
static void window_multiplayer_groups_scrollmousedown(rct_window *w, sint32 scrollIndex, sint32 x, sint32 y)
|
||||
static void window_multiplayer_groups_scrollmousedown(rct_window *w, int32_t scrollIndex, int32_t x, int32_t y)
|
||||
{
|
||||
sint32 index;
|
||||
int32_t index;
|
||||
|
||||
index = y / SCROLLABLE_ROW_HEIGHT;
|
||||
if (index >= w->no_list_items)
|
||||
|
@ -783,9 +783,9 @@ static void window_multiplayer_groups_scrollmousedown(rct_window *w, sint32 scro
|
|||
game_do_command(2 | (_selectedGroup << 8), GAME_COMMAND_FLAG_APPLY, index, 0, GAME_COMMAND_MODIFY_GROUPS, 0, 0);
|
||||
}
|
||||
|
||||
static void window_multiplayer_groups_scrollmouseover(rct_window *w, sint32 scrollIndex, sint32 x, sint32 y)
|
||||
static void window_multiplayer_groups_scrollmouseover(rct_window *w, int32_t scrollIndex, int32_t x, int32_t y)
|
||||
{
|
||||
sint32 index;
|
||||
int32_t index;
|
||||
|
||||
index = y / SCROLLABLE_ROW_HEIGHT;
|
||||
if (index >= w->no_list_items)
|
||||
|
@ -803,9 +803,9 @@ static void window_multiplayer_groups_text_input(rct_window *w, rct_widgetindex
|
|||
if (text == nullptr)
|
||||
return;
|
||||
|
||||
game_do_command(3 | (_selectedGroup << 8) | (1 << 16), GAME_COMMAND_FLAG_APPLY, w->number, *((sint32*)(text + 0)), GAME_COMMAND_MODIFY_GROUPS, *((sint32*)(text + 8)), *((sint32*)(text + 4)));
|
||||
game_do_command(3 | (_selectedGroup << 8) | (2 << 16), GAME_COMMAND_FLAG_APPLY, w->number, *((sint32*)(text + 12)), GAME_COMMAND_MODIFY_GROUPS, *((sint32*)(text + 20)), *((sint32*)(text + 16)));
|
||||
game_do_command(3 | (_selectedGroup << 8) | (0 << 16), GAME_COMMAND_FLAG_APPLY, w->number, *((sint32*)(text + 24)), GAME_COMMAND_MODIFY_GROUPS, *((sint32*)(text + 32)), *((sint32*)(text + 28)));
|
||||
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)));
|
||||
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)));
|
||||
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)));
|
||||
}
|
||||
|
||||
static void window_multiplayer_groups_invalidate(rct_window *w)
|
||||
|
@ -828,7 +828,7 @@ static void window_multiplayer_groups_paint(rct_window *w, rct_drawpixelinfo *dp
|
|||
window_multiplayer_draw_tab_images(w, dpi);
|
||||
|
||||
rct_widget* widget = &window_multiplayer_groups_widgets[WIDX_DEFAULT_GROUP];
|
||||
sint32 group = network_get_group_index(network_get_default_group());
|
||||
int32_t group = network_get_group_index(network_get_default_group());
|
||||
if (group != -1) {
|
||||
char buffer[300];
|
||||
char* lineCh;
|
||||
|
@ -847,8 +847,8 @@ static void window_multiplayer_groups_paint(rct_window *w, rct_drawpixelinfo *dp
|
|||
);
|
||||
}
|
||||
|
||||
sint32 x = w->x + window_multiplayer_groups_widgets[WIDX_CONTENT_PANEL].left + 4;
|
||||
sint32 y = w->y + window_multiplayer_groups_widgets[WIDX_CONTENT_PANEL].top + 4;
|
||||
int32_t x = w->x + window_multiplayer_groups_widgets[WIDX_CONTENT_PANEL].left + 4;
|
||||
int32_t y = w->y + window_multiplayer_groups_widgets[WIDX_CONTENT_PANEL].top + 4;
|
||||
|
||||
gfx_draw_string_left(dpi, STR_DEFAULT_GROUP, nullptr, w->colours[2], x, y);
|
||||
|
||||
|
@ -877,13 +877,13 @@ static void window_multiplayer_groups_paint(rct_window *w, rct_drawpixelinfo *dp
|
|||
}
|
||||
}
|
||||
|
||||
static void window_multiplayer_groups_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, sint32 scrollIndex)
|
||||
static void window_multiplayer_groups_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, int32_t scrollIndex)
|
||||
{
|
||||
sint32 y = 0;
|
||||
int32_t y = 0;
|
||||
|
||||
gfx_fill_rect(dpi, dpi->x, dpi->y, dpi->x + dpi->width - 1, dpi->y + dpi->height - 1, ColourMapA[w->colours[1]].mid_light);
|
||||
|
||||
for (sint32 i = 0; i < network_get_num_actions(); i++) {
|
||||
for (int32_t i = 0; i < network_get_num_actions(); i++) {
|
||||
if (i == w->selected_list_item) {
|
||||
gfx_filter_rect(dpi, 0, y, 800, y + SCROLLABLE_ROW_HEIGHT - 1, PALETTE_DARKEN_1);
|
||||
}
|
||||
|
@ -894,7 +894,7 @@ static void window_multiplayer_groups_scrollpaint(rct_window *w, rct_drawpixelin
|
|||
if (y + SCROLLABLE_ROW_HEIGHT + 1 >= dpi->y)
|
||||
{
|
||||
char buffer[300] = {0};
|
||||
sint32 groupindex = network_get_group_index(_selectedGroup);
|
||||
int32_t groupindex = network_get_group_index(_selectedGroup);
|
||||
if (groupindex != -1){
|
||||
if (network_can_perform_action(groupindex, i)) {
|
||||
char* lineCh = buffer;
|
||||
|
@ -905,7 +905,7 @@ static void window_multiplayer_groups_scrollpaint(rct_window *w, rct_drawpixelin
|
|||
}
|
||||
|
||||
// Draw action name
|
||||
set_format_arg(0, uint16, network_get_action_name_string_id(i));
|
||||
set_format_arg(0, uint16_t, network_get_action_name_string_id(i));
|
||||
gfx_draw_string_left(dpi, STR_WINDOW_COLOUR_2_STRINGID, gCommonFormatArgs, COLOUR_BLACK, 10, y);
|
||||
}
|
||||
y += SCROLLABLE_ROW_HEIGHT;
|
||||
|
@ -979,15 +979,15 @@ static void window_multiplayer_options_paint(rct_window *w, rct_drawpixelinfo *d
|
|||
|
||||
#pragma endregion
|
||||
|
||||
static void window_multiplayer_draw_tab_image(rct_window *w, rct_drawpixelinfo *dpi, sint32 page, sint32 spriteIndex)
|
||||
static void window_multiplayer_draw_tab_image(rct_window *w, rct_drawpixelinfo *dpi, int32_t page, int32_t spriteIndex)
|
||||
{
|
||||
rct_widgetindex widgetIndex = WIDX_TAB1 + page;
|
||||
|
||||
if (!widget_is_disabled(w, widgetIndex)) {
|
||||
if (w->page == page) {
|
||||
sint32 numFrames = window_multiplayer_animation_frames[w->page];
|
||||
int32_t numFrames = window_multiplayer_animation_frames[w->page];
|
||||
if (numFrames > 1) {
|
||||
sint32 frame = w->frame_no / window_multiplayer_animation_divisor[w->page];
|
||||
int32_t frame = w->frame_no / window_multiplayer_animation_divisor[w->page];
|
||||
spriteIndex += (frame % numFrames);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -80,9 +80,9 @@ static constexpr const rct_string_id music_credits_rct2[] = {
|
|||
};
|
||||
|
||||
static void window_music_credits_mouseup(rct_window *w, rct_widgetindex widgetIndex);
|
||||
static void window_music_credits_scrollgetsize(rct_window *w, sint32 scrollIndex, sint32 *width, sint32 *height);
|
||||
static void window_music_credits_scrollgetsize(rct_window *w, int32_t scrollIndex, int32_t *width, int32_t *height);
|
||||
static void window_music_credits_paint(rct_window *w, rct_drawpixelinfo *dpi);
|
||||
static void window_music_credits_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, sint32 scrollIndex);
|
||||
static void window_music_credits_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, int32_t scrollIndex);
|
||||
|
||||
static rct_window_event_list window_music_credits_events = {
|
||||
nullptr,
|
||||
|
@ -165,10 +165,10 @@ static void window_music_credits_mouseup(rct_window *w, rct_widgetindex widgetIn
|
|||
*
|
||||
* rct2: 0x0066DB37
|
||||
*/
|
||||
static void window_music_credits_scrollgetsize(rct_window *w, sint32 scrollIndex, sint32 *width, sint32 *height)
|
||||
static void window_music_credits_scrollgetsize(rct_window *w, int32_t scrollIndex, int32_t *width, int32_t *height)
|
||||
{
|
||||
sint32 lineHeight = font_get_line_height(gCurrentFontSpriteBase);
|
||||
*height = static_cast<sint32>(Util::CountOf(music_credits) + Util::CountOf(music_credits_rct2)) * lineHeight + 12;
|
||||
int32_t lineHeight = font_get_line_height(gCurrentFontSpriteBase);
|
||||
*height = static_cast<int32_t>(Util::CountOf(music_credits) + Util::CountOf(music_credits_rct2)) * lineHeight + 12;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -184,12 +184,12 @@ static void window_music_credits_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
|||
*
|
||||
* rct2: 0x0066D7BF
|
||||
*/
|
||||
static void window_music_credits_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, sint32 scrollIndex)
|
||||
static void window_music_credits_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, int32_t scrollIndex)
|
||||
{
|
||||
sint32 lineHeight = font_get_line_height(gCurrentFontSpriteBase);
|
||||
int32_t lineHeight = font_get_line_height(gCurrentFontSpriteBase);
|
||||
|
||||
sint32 x = 245;
|
||||
sint32 y = 2;
|
||||
int32_t x = 245;
|
||||
int32_t y = 2;
|
||||
|
||||
for (size_t i = 0; i < Util::CountOf(music_credits); i++) {
|
||||
gfx_draw_string_centred(dpi, music_credits[i], x, y, COLOUR_BLACK, nullptr);
|
||||
|
|
|
@ -177,8 +177,8 @@ static void window_network_status_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
|||
lineCh = utf8_write_codepoint(lineCh, FORMAT_BLACK);
|
||||
safe_strcpy(lineCh, window_network_status_text, sizeof(buffer) - (lineCh - buffer));
|
||||
gfx_clip_string(buffer, w->widgets[WIDX_BACKGROUND].right - 50);
|
||||
sint32 x = w->x + (w->width / 2);
|
||||
sint32 y = w->y + (w->height / 2);
|
||||
int32_t x = w->x + (w->width / 2);
|
||||
int32_t y = w->y + (w->height / 2);
|
||||
x -= gfx_get_string_width(buffer) / 2;
|
||||
gfx_draw_string(dpi, buffer, COLOUR_BLACK, x, y);
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
#include <openrct2-ui/interface/Widget.h>
|
||||
#include <openrct2-ui/windows/Window.h>
|
||||
|
||||
#define SELECTED_RIDE_UNDEFINED ((uint16)0xFFFF)
|
||||
#define SELECTED_RIDE_UNDEFINED ((uint16_t)0xFFFF)
|
||||
|
||||
// clang-format off
|
||||
enum WINDOW_NEW_CAMPAIGN_WIDGET_IDX {
|
||||
|
@ -53,7 +53,7 @@ static rct_widget window_new_campaign_widgets[] = {
|
|||
|
||||
static void window_new_campaign_mouseup(rct_window *w, rct_widgetindex widgetIndex);
|
||||
static void window_new_campaign_mousedown(rct_window *w, rct_widgetindex widgetIndex, rct_widget* widget);
|
||||
static void window_new_campaign_dropdown(rct_window *w, rct_widgetindex widgetIndex, sint32 dropdownIndex);
|
||||
static void window_new_campaign_dropdown(rct_window *w, rct_widgetindex widgetIndex, int32_t dropdownIndex);
|
||||
static void window_new_campaign_invalidate(rct_window *w);
|
||||
static void window_new_campaign_paint(rct_window *w, rct_drawpixelinfo *dpi);
|
||||
|
||||
|
@ -89,25 +89,25 @@ static rct_window_event_list window_new_campaign_events = {
|
|||
};
|
||||
// clang-format on
|
||||
|
||||
static uint8 window_new_campaign_rides[MAX_RIDES];
|
||||
static uint8 window_new_campaign_shop_items[64];
|
||||
static uint8_t window_new_campaign_rides[MAX_RIDES];
|
||||
static uint8_t window_new_campaign_shop_items[64];
|
||||
|
||||
static sint32 ride_value_compare(const void *a, const void *b)
|
||||
static int32_t ride_value_compare(const void *a, const void *b)
|
||||
{
|
||||
Ride *rideA, *rideB;
|
||||
|
||||
rideA = get_ride(*((uint8*)a));
|
||||
rideB = get_ride(*((uint8*)b));
|
||||
rideA = get_ride(*((uint8_t*)a));
|
||||
rideB = get_ride(*((uint8_t*)b));
|
||||
return rideB->value - rideA->value;
|
||||
}
|
||||
|
||||
static sint32 ride_name_compare(const void *a, const void *b)
|
||||
static int32_t ride_name_compare(const void *a, const void *b)
|
||||
{
|
||||
char rideAName[256], rideBName[256];
|
||||
Ride *rideA, *rideB;
|
||||
|
||||
rideA = get_ride(*((uint8*)a));
|
||||
rideB = get_ride(*((uint8*)b));
|
||||
rideA = get_ride(*((uint8_t*)a));
|
||||
rideB = get_ride(*((uint8_t*)b));
|
||||
|
||||
format_string(rideAName, 256, rideA->name, &rideA->name_arguments);
|
||||
format_string(rideBName, 256, rideB->name, &rideB->name_arguments);
|
||||
|
@ -119,11 +119,11 @@ static sint32 ride_name_compare(const void *a, const void *b)
|
|||
*
|
||||
* rct2: 0x0069E16F
|
||||
*/
|
||||
rct_window * window_new_campaign_open(sint16 campaignType)
|
||||
rct_window * window_new_campaign_open(int16_t campaignType)
|
||||
{
|
||||
rct_window *w;
|
||||
Ride *ride;
|
||||
sint32 i, numApplicableRides;
|
||||
int32_t i, numApplicableRides;
|
||||
|
||||
w = window_bring_to_front_by_class(WC_NEW_CAMPAIGN);
|
||||
if (w != nullptr) {
|
||||
|
@ -178,12 +178,12 @@ rct_window * window_new_campaign_open(sint16 campaignType)
|
|||
// Take top 128 most valuable rides
|
||||
if (numApplicableRides > DROPDOWN_ITEMS_MAX_SIZE)
|
||||
{
|
||||
qsort(window_new_campaign_rides, numApplicableRides, sizeof(uint8), ride_value_compare);
|
||||
qsort(window_new_campaign_rides, numApplicableRides, sizeof(uint8_t), ride_value_compare);
|
||||
numApplicableRides = DROPDOWN_ITEMS_MAX_SIZE;
|
||||
}
|
||||
|
||||
// Sort rides by name
|
||||
qsort(window_new_campaign_rides, numApplicableRides, sizeof(uint8), ride_name_compare);
|
||||
qsort(window_new_campaign_rides, numApplicableRides, sizeof(uint8_t), ride_name_compare);
|
||||
|
||||
window_new_campaign_rides[numApplicableRides] = 255;
|
||||
|
||||
|
@ -196,10 +196,10 @@ rct_window * window_new_campaign_open(sint16 campaignType)
|
|||
*/
|
||||
static void window_new_campaign_get_shop_items()
|
||||
{
|
||||
sint32 i, numItems;
|
||||
int32_t i, numItems;
|
||||
Ride * ride;
|
||||
|
||||
uint64 items = 0;
|
||||
uint64_t items = 0;
|
||||
FOR_ALL_RIDES(i, ride)
|
||||
{
|
||||
rct_ride_entry * rideEntry = get_ride_entry(ride->subtype);
|
||||
|
@ -207,7 +207,7 @@ static void window_new_campaign_get_shop_items()
|
|||
{
|
||||
continue;
|
||||
}
|
||||
uint8 itemType = rideEntry->shop_item;
|
||||
uint8_t itemType = rideEntry->shop_item;
|
||||
if (itemType != SHOP_ITEM_NONE && shop_item_is_food_or_drink(itemType))
|
||||
items |= 1ULL << itemType;
|
||||
}
|
||||
|
@ -267,8 +267,8 @@ static void window_new_campaign_mousedown(rct_window *w, rct_widgetindex widgetI
|
|||
if (w->campaign.campaign_type == ADVERTISING_CAMPAIGN_FOOD_OR_DRINK_FREE) {
|
||||
window_new_campaign_get_shop_items();
|
||||
if (window_new_campaign_shop_items[0] != 255) {
|
||||
sint32 numItems = 0;
|
||||
for (sint32 i = 0; i < DROPDOWN_ITEMS_MAX_SIZE; i++) {
|
||||
int32_t numItems = 0;
|
||||
for (int32_t i = 0; i < DROPDOWN_ITEMS_MAX_SIZE; i++) {
|
||||
if (window_new_campaign_shop_items[i] == 255)
|
||||
break;
|
||||
|
||||
|
@ -289,15 +289,15 @@ static void window_new_campaign_mousedown(rct_window *w, rct_widgetindex widgetI
|
|||
);
|
||||
}
|
||||
} else {
|
||||
sint32 numItems = 0;
|
||||
for (sint32 i = 0; i < DROPDOWN_ITEMS_MAX_SIZE; i++)
|
||||
int32_t numItems = 0;
|
||||
for (int32_t i = 0; i < DROPDOWN_ITEMS_MAX_SIZE; i++)
|
||||
{
|
||||
if (window_new_campaign_rides[i] == 255)
|
||||
break;
|
||||
|
||||
Ride * ride = get_ride(window_new_campaign_rides[i]);
|
||||
gDropdownItemsFormat[i] = STR_DROPDOWN_MENU_LABEL;
|
||||
gDropdownItemsArgs[i] = ((uint64)ride->name_arguments << 16ULL) | ride->name;
|
||||
gDropdownItemsArgs[i] = ((uint64_t)ride->name_arguments << 16ULL) | ride->name;
|
||||
numItems++;
|
||||
}
|
||||
|
||||
|
@ -329,7 +329,7 @@ static void window_new_campaign_mousedown(rct_window *w, rct_widgetindex widgetI
|
|||
*
|
||||
* rct2: 0x0069E537
|
||||
*/
|
||||
static void window_new_campaign_dropdown(rct_window *w, rct_widgetindex widgetIndex, sint32 dropdownIndex)
|
||||
static void window_new_campaign_dropdown(rct_window *w, rct_widgetindex widgetIndex, int32_t dropdownIndex)
|
||||
{
|
||||
if (widgetIndex != WIDX_RIDE_DROPDOWN_BUTTON)
|
||||
return;
|
||||
|
@ -366,7 +366,7 @@ static void window_new_campaign_invalidate(rct_window *w)
|
|||
if (w->campaign.ride_id != SELECTED_RIDE_UNDEFINED) {
|
||||
Ride *ride = get_ride(w->campaign.ride_id);
|
||||
window_new_campaign_widgets[WIDX_RIDE_DROPDOWN].text = ride->name;
|
||||
set_format_arg(0, uint32, ride->name_arguments);
|
||||
set_format_arg(0, uint32_t, ride->name_arguments);
|
||||
}
|
||||
break;
|
||||
case ADVERTISING_CAMPAIGN_FOOD_OR_DRINK_FREE:
|
||||
|
@ -395,7 +395,7 @@ static void window_new_campaign_invalidate(rct_window *w)
|
|||
*/
|
||||
static void window_new_campaign_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
||||
{
|
||||
sint32 x, y;
|
||||
int32_t x, y;
|
||||
|
||||
window_draw_widgets(w, dpi);
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
#define WH 382
|
||||
#define WW 601
|
||||
|
||||
static uint8 _windowNewRideCurrentTab;
|
||||
static uint8_t _windowNewRideCurrentTab;
|
||||
static ride_list_item _windowNewRideHighlightedItem[6];
|
||||
static ride_list_item _windowNewRideListItems[384];
|
||||
|
||||
|
@ -207,14 +207,14 @@ static rct_widget window_new_ride_widgets[] = {
|
|||
static void window_new_ride_mouseup(rct_window *w, rct_widgetindex widgetIndex);
|
||||
static void window_new_ride_mousedown(rct_window *w, rct_widgetindex widgetIndex, rct_widget *widget);
|
||||
static void window_new_ride_update(rct_window *w);
|
||||
static void window_new_ride_scrollgetsize(rct_window *w, sint32 scrollIndex, sint32 *width, sint32 *height);
|
||||
static void window_new_ride_scrollmousedown(rct_window *w, sint32 scrollIndex, sint32 x, sint32 y);
|
||||
static void window_new_ride_scrollmouseover(rct_window *w, sint32 scrollIndex, sint32 x, sint32 y);
|
||||
static void window_new_ride_scrollgetsize(rct_window *w, int32_t scrollIndex, int32_t *width, int32_t *height);
|
||||
static void window_new_ride_scrollmousedown(rct_window *w, int32_t scrollIndex, int32_t x, int32_t y);
|
||||
static void window_new_ride_scrollmouseover(rct_window *w, int32_t scrollIndex, int32_t x, int32_t y);
|
||||
static void window_new_ride_tooltip(rct_window* w, rct_widgetindex widgetIndex, rct_string_id *stringId);
|
||||
static void window_new_ride_invalidate(rct_window *w);
|
||||
static void window_new_ride_paint(rct_window *w, rct_drawpixelinfo *dpi);
|
||||
static void window_new_ride_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, sint32 scrollIndex);
|
||||
static void window_new_ride_list_vehicles_for(const uint8 rideType, const rct_ride_entry * rideEntry, char * out);
|
||||
static void window_new_ride_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, int32_t scrollIndex);
|
||||
static void window_new_ride_list_vehicles_for(const uint8_t rideType, const rct_ride_entry * rideEntry, char * out);
|
||||
|
||||
// 0x0098E354
|
||||
static rct_window_event_list window_new_ride_events = {
|
||||
|
@ -260,19 +260,19 @@ static constexpr const rct_string_id window_new_ride_titles[WINDOW_NEW_RIDE_PAGE
|
|||
STR_RESEARCH_AND_DEVELOPMENT,
|
||||
};
|
||||
|
||||
static constexpr const sint32 window_new_ride_tab_animation_loops[] = { 20, 32, 10, 72, 24, 28, 16 };
|
||||
static constexpr const sint32 window_new_ride_tab_animation_divisor[] = { 4, 8, 2, 4, 4, 4, 2 };
|
||||
static constexpr const int32_t window_new_ride_tab_animation_loops[] = { 20, 32, 10, 72, 24, 28, 16 };
|
||||
static constexpr const int32_t window_new_ride_tab_animation_divisor[] = { 4, 8, 2, 4, 4, 4, 2 };
|
||||
// clang-format on
|
||||
|
||||
static void window_new_ride_set_page(rct_window *w, sint32 page);
|
||||
static void window_new_ride_set_page(rct_window *w, int32_t page);
|
||||
static void window_new_ride_refresh_widget_sizing(rct_window *w);
|
||||
static ride_list_item window_new_ride_scroll_get_ride_list_item_at(rct_window *w, sint32 x, sint32 y);
|
||||
static void window_new_ride_paint_ride_information(rct_window *w, rct_drawpixelinfo *dpi, ride_list_item item, sint32 x, sint32 y, sint32 width);
|
||||
static ride_list_item window_new_ride_scroll_get_ride_list_item_at(rct_window *w, int32_t x, int32_t y);
|
||||
static void window_new_ride_paint_ride_information(rct_window *w, rct_drawpixelinfo *dpi, ride_list_item item, int32_t x, int32_t y, int32_t width);
|
||||
static void window_new_ride_select(rct_window *w);
|
||||
static ride_list_item * window_new_ride_iterate_over_ride_group(uint8 rideType, uint8 rideGroupIndex, ride_list_item * nextListItem);
|
||||
static ride_list_item * window_new_ride_iterate_over_ride_group(uint8_t rideType, uint8_t rideGroupIndex, ride_list_item * nextListItem);
|
||||
|
||||
static ride_list_item _lastTrackDesignCountRideType;
|
||||
static sint32 _lastTrackDesignCount;
|
||||
static int32_t _lastTrackDesignCount;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -287,7 +287,7 @@ void window_new_ride_init_vars()
|
|||
_windowNewRideCurrentTab = WINDOW_NEW_RIDE_PAGE_TRANSPORT;
|
||||
}
|
||||
|
||||
for (sint16 i = 0; i < 6; i++) {
|
||||
for (int16_t i = 0; i < 6; i++) {
|
||||
/*
|
||||
Reset what is highlighted in each tab.
|
||||
Each 16bit number represents the item in its respective tab.
|
||||
|
@ -303,12 +303,12 @@ void window_new_ride_init_vars()
|
|||
*/
|
||||
static void window_new_ride_populate_list()
|
||||
{
|
||||
uint8 currentCategory = _windowNewRideCurrentTab;
|
||||
uint8_t currentCategory = _windowNewRideCurrentTab;
|
||||
ride_list_item *nextListItem = _windowNewRideListItems;
|
||||
|
||||
// For each ride type in the view order list
|
||||
for (sint32 i = 0; i < (sint32)Util::CountOf(RideTypeViewOrder); i++) {
|
||||
uint8 rideType = RideTypeViewOrder[i];
|
||||
for (int32_t i = 0; i < (int32_t)Util::CountOf(RideTypeViewOrder); i++) {
|
||||
uint8_t rideType = RideTypeViewOrder[i];
|
||||
if (rideType == RIDE_TYPE_NULL)
|
||||
continue;
|
||||
|
||||
|
@ -321,7 +321,7 @@ static void window_new_ride_populate_list()
|
|||
nextListItem = window_new_ride_iterate_over_ride_group(rideType, 0, nextListItem);
|
||||
}
|
||||
else {
|
||||
for (uint8 j = 0; j < MAX_RIDE_GROUPS_PER_RIDE_TYPE; j++) {
|
||||
for (uint8_t j = 0; j < MAX_RIDE_GROUPS_PER_RIDE_TYPE; j++) {
|
||||
nextListItem = window_new_ride_iterate_over_ride_group(rideType, j, nextListItem);
|
||||
}
|
||||
}
|
||||
|
@ -332,11 +332,11 @@ static void window_new_ride_populate_list()
|
|||
nextListItem->entry_index = RIDE_ENTRY_INDEX_NULL;
|
||||
}
|
||||
|
||||
static ride_list_item * window_new_ride_iterate_over_ride_group(uint8 rideType, uint8 rideGroupIndex, ride_list_item * nextListItem)
|
||||
static ride_list_item * window_new_ride_iterate_over_ride_group(uint8_t rideType, uint8_t rideGroupIndex, ride_list_item * nextListItem)
|
||||
{
|
||||
bool buttonForRideTypeCreated = false;
|
||||
bool allowDrawingOverLastButton = false;
|
||||
uint8 *rideEntryIndexPtr = get_ride_entry_indices_for_ride_type(rideType);
|
||||
uint8_t *rideEntryIndexPtr = get_ride_entry_indices_for_ride_type(rideType);
|
||||
|
||||
char preferredVehicleName[DAT_NAME_LENGTH + 1];
|
||||
safe_strcpy(preferredVehicleName, " ", sizeof(preferredVehicleName));
|
||||
|
@ -344,7 +344,7 @@ static ride_list_item * window_new_ride_iterate_over_ride_group(uint8 rideType,
|
|||
// For each ride entry for this ride type
|
||||
while (*rideEntryIndexPtr != RIDE_ENTRY_INDEX_NULL)
|
||||
{
|
||||
uint8 rideEntryIndex = *rideEntryIndexPtr++;
|
||||
uint8_t rideEntryIndex = *rideEntryIndexPtr++;
|
||||
char rideEntryName[DAT_NAME_LENGTH + 1];
|
||||
memcpy(rideEntryName, object_entry_get_entry(OBJECT_TYPE_RIDE, rideEntryIndex)->name, 8);
|
||||
rideEntryName[DAT_NAME_LENGTH] = 0;
|
||||
|
@ -421,15 +421,15 @@ static ride_list_item * window_new_ride_iterate_over_ride_group(uint8 rideType,
|
|||
*/
|
||||
static void window_new_ride_scroll_to_focused_ride(rct_window *w)
|
||||
{
|
||||
sint32 scrollWidth = 0;
|
||||
sint32 scrollHeight = 0;
|
||||
int32_t scrollWidth = 0;
|
||||
int32_t scrollHeight = 0;
|
||||
window_get_scroll_size(w, 0, &scrollWidth, &scrollHeight);
|
||||
|
||||
// Find row index of the focused ride type
|
||||
rct_widget *listWidget = &window_new_ride_widgets[WIDX_RIDE_LIST];
|
||||
assert(_windowNewRideCurrentTab < Util::CountOf(_windowNewRideHighlightedItem));
|
||||
sint32 focusRideType = _windowNewRideHighlightedItem[_windowNewRideCurrentTab].ride_type_and_entry;
|
||||
sint32 count = 0, row = 0;
|
||||
int32_t focusRideType = _windowNewRideHighlightedItem[_windowNewRideCurrentTab].ride_type_and_entry;
|
||||
int32_t count = 0, row = 0;
|
||||
ride_list_item *listItem = _windowNewRideListItems;
|
||||
while (listItem->type != RIDE_TYPE_NULL || listItem->entry_index != 255) {
|
||||
if (listItem->type == focusRideType) {
|
||||
|
@ -442,7 +442,7 @@ static void window_new_ride_scroll_to_focused_ride(rct_window *w)
|
|||
};
|
||||
|
||||
// Update the Y scroll position
|
||||
sint32 listWidgetHeight = listWidget->bottom - listWidget->top - 1;
|
||||
int32_t listWidgetHeight = listWidget->bottom - listWidget->top - 1;
|
||||
scrollHeight = std::max(0, scrollHeight - listWidgetHeight);
|
||||
w->scrolls[0].v_top = std::min(row * 116, scrollHeight);
|
||||
widget_scroll_update_thumbs(w, WIDX_RIDE_LIST);
|
||||
|
@ -523,7 +523,7 @@ void window_new_ride_focus(ride_list_item rideItem)
|
|||
return;
|
||||
|
||||
rideEntry = get_ride_entry(rideItem.entry_index);
|
||||
uint8 rideTypeIndex = ride_entry_get_first_non_null_ride_type(rideEntry);
|
||||
uint8_t rideTypeIndex = ride_entry_get_first_non_null_ride_type(rideEntry);
|
||||
|
||||
window_new_ride_set_page(w, gRideCategories[rideTypeIndex]);
|
||||
|
||||
|
@ -560,12 +560,12 @@ void window_new_ride_focus(ride_list_item rideItem)
|
|||
}
|
||||
}
|
||||
|
||||
static void window_new_ride_set_page(rct_window *w, sint32 page)
|
||||
static void window_new_ride_set_page(rct_window *w, int32_t page)
|
||||
{
|
||||
_windowNewRideCurrentTab = page;
|
||||
w->frame_no = 0;
|
||||
w->new_ride.highlighted_ride_id = -1;
|
||||
w->new_ride.selected_ride_countdown = std::numeric_limits<uint16>::max();
|
||||
w->new_ride.selected_ride_countdown = std::numeric_limits<uint16_t>::max();
|
||||
window_new_ride_populate_list();
|
||||
if (page < WINDOW_NEW_RIDE_PAGE_RESEARCH) {
|
||||
w->new_ride.highlighted_ride_id = _windowNewRideHighlightedItem[page].ride_type_and_entry;
|
||||
|
@ -587,7 +587,7 @@ static void window_new_ride_set_page(rct_window *w, sint32 page)
|
|||
*/
|
||||
static void window_new_ride_refresh_widget_sizing(rct_window *w)
|
||||
{
|
||||
sint32 width, height;
|
||||
int32_t width, height;
|
||||
|
||||
// Show or hide unrelated widgets
|
||||
if (_windowNewRideCurrentTab != WINDOW_NEW_RIDE_PAGE_RESEARCH) {
|
||||
|
@ -634,22 +634,22 @@ static void window_new_ride_refresh_widget_sizing(rct_window *w)
|
|||
|
||||
static void window_new_ride_set_pressed_tab(rct_window *w)
|
||||
{
|
||||
sint32 i;
|
||||
int32_t i;
|
||||
for (i = 0; i < WINDOW_NEW_RIDE_PAGE_COUNT; i++)
|
||||
w->pressed_widgets &= ~(1 << (WIDX_TAB_1 + i));
|
||||
w->pressed_widgets |= 1LL << (WIDX_TAB_1 + _windowNewRideCurrentTab);
|
||||
}
|
||||
|
||||
static constexpr const sint32 ThrillRidesTabAnimationSequence[] = {
|
||||
static constexpr const int32_t ThrillRidesTabAnimationSequence[] = {
|
||||
5, 6, 5, 4, 3, 2, 1, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 0, 0, 0
|
||||
};
|
||||
|
||||
static void window_new_ride_draw_tab_image(rct_drawpixelinfo *dpi, rct_window *w, sint32 page, sint32 spriteIndex)
|
||||
static void window_new_ride_draw_tab_image(rct_drawpixelinfo *dpi, rct_window *w, int32_t page, int32_t spriteIndex)
|
||||
{
|
||||
rct_widgetindex widgetIndex = WIDX_TAB_1 + page;
|
||||
|
||||
if (w->widgets[widgetIndex].type != WWT_EMPTY && !(w->disabled_widgets & (1LL << widgetIndex))) {
|
||||
sint32 frame = 0;
|
||||
int32_t frame = 0;
|
||||
if (_windowNewRideCurrentTab == page)
|
||||
frame = w->frame_no / window_new_ride_tab_animation_divisor[page];
|
||||
|
||||
|
@ -725,11 +725,11 @@ static void window_new_ride_update(rct_window *w)
|
|||
*
|
||||
* rct2: 0x006B6BC9
|
||||
*/
|
||||
static void window_new_ride_scrollgetsize(rct_window *w, sint32 scrollIndex, sint32 *width, sint32 *height)
|
||||
static void window_new_ride_scrollgetsize(rct_window *w, int32_t scrollIndex, int32_t *width, int32_t *height)
|
||||
{
|
||||
ride_list_item *listItem = _windowNewRideListItems;
|
||||
|
||||
sint32 count = 0;
|
||||
int32_t count = 0;
|
||||
while (listItem->type != RIDE_TYPE_NULL || listItem->entry_index != 255) {
|
||||
count++;
|
||||
listItem++;
|
||||
|
@ -741,7 +741,7 @@ static void window_new_ride_scrollgetsize(rct_window *w, sint32 scrollIndex, sin
|
|||
*
|
||||
* rct2: 0x006B6C89
|
||||
*/
|
||||
static void window_new_ride_scrollmousedown(rct_window *w, sint32 scrollIndex, sint32 x, sint32 y)
|
||||
static void window_new_ride_scrollmousedown(rct_window *w, int32_t scrollIndex, int32_t x, int32_t y)
|
||||
{
|
||||
ride_list_item item;
|
||||
|
||||
|
@ -761,7 +761,7 @@ static void window_new_ride_scrollmousedown(rct_window *w, sint32 scrollIndex, s
|
|||
*
|
||||
* rct2: 0x006B6C51
|
||||
*/
|
||||
static void window_new_ride_scrollmouseover(rct_window *w, sint32 scrollIndex, sint32 x, sint32 y)
|
||||
static void window_new_ride_scrollmouseover(rct_window *w, int32_t scrollIndex, int32_t x, int32_t y)
|
||||
{
|
||||
ride_list_item item;
|
||||
|
||||
|
@ -804,7 +804,7 @@ static void window_new_ride_invalidate(rct_window *w)
|
|||
window_new_ride_widgets[WIDX_LAST_DEVELOPMENT_BUTTON].type = WWT_EMPTY;
|
||||
if (gResearchLastItem.rawValue != RESEARCHED_ITEMS_SEPARATOR)
|
||||
{
|
||||
uint8 type = gResearchLastItem.type;
|
||||
uint8_t type = gResearchLastItem.type;
|
||||
window_new_ride_widgets[WIDX_LAST_DEVELOPMENT_BUTTON].type = WWT_FLATBTN;
|
||||
window_new_ride_widgets[WIDX_LAST_DEVELOPMENT_BUTTON].image =
|
||||
(type == RESEARCH_ENTRY_TYPE_RIDE) ? SPR_NEW_RIDE : SPR_NEW_SCENERY;
|
||||
|
@ -823,7 +823,7 @@ static void window_new_ride_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
|||
|
||||
if (_windowNewRideCurrentTab != WINDOW_NEW_RIDE_PAGE_RESEARCH) {
|
||||
ride_list_item item;
|
||||
item.ride_type_and_entry = static_cast<uint16>(w->new_ride.highlighted_ride_id);
|
||||
item.ride_type_and_entry = static_cast<uint16_t>(w->new_ride.highlighted_ride_id);
|
||||
if (item.type != RIDE_TYPE_NULL || item.entry_index != 255)
|
||||
window_new_ride_paint_ride_information(w, dpi, item, w->x + 3, w->y + w->height - 64, w->width - 6);
|
||||
} else {
|
||||
|
@ -835,28 +835,28 @@ static void window_new_ride_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
|||
*
|
||||
* rct2: 0x006B6ABF
|
||||
*/
|
||||
static void window_new_ride_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, sint32 scrollIndex)
|
||||
static void window_new_ride_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, int32_t scrollIndex)
|
||||
{
|
||||
if (_windowNewRideCurrentTab == WINDOW_NEW_RIDE_PAGE_RESEARCH)
|
||||
return;
|
||||
|
||||
gfx_clear(dpi, ColourMapA[w->colours[1]].mid_light);
|
||||
|
||||
sint32 x = 1;
|
||||
sint32 y = 1;
|
||||
int32_t x = 1;
|
||||
int32_t y = 1;
|
||||
ride_list_item *listItem = _windowNewRideListItems;
|
||||
while (listItem->type != RIDE_TYPE_NULL || listItem->entry_index != 255) {
|
||||
rct_ride_entry *rideEntry;
|
||||
// Draw flat button rectangle
|
||||
sint32 flags = 0;
|
||||
if (w->new_ride.selected_ride_id == *((sint16*)listItem))
|
||||
int32_t flags = 0;
|
||||
if (w->new_ride.selected_ride_id == *((int16_t*)listItem))
|
||||
flags |= INSET_RECT_FLAG_BORDER_INSET;
|
||||
if (w->new_ride.highlighted_ride_id == *((sint16*)listItem) || flags != 0)
|
||||
if (w->new_ride.highlighted_ride_id == *((int16_t*)listItem) || flags != 0)
|
||||
gfx_fill_rect_inset(dpi, x, y, x + 115, y + 115, w->colours[1], INSET_RECT_FLAG_FILL_MID_LIGHT | flags);
|
||||
|
||||
// Draw ride image with feathered border
|
||||
rideEntry = get_ride_entry(listItem->entry_index);
|
||||
sint32 imageId = rideEntry->images_offset;
|
||||
int32_t imageId = rideEntry->images_offset;
|
||||
|
||||
for (size_t i = 0; i < MAX_RIDE_TYPES_PER_RIDE_ENTRY; i++)
|
||||
{
|
||||
|
@ -884,7 +884,7 @@ static void window_new_ride_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, s
|
|||
*
|
||||
* rct2: 0x006B6D3C
|
||||
*/
|
||||
static ride_list_item window_new_ride_scroll_get_ride_list_item_at(rct_window *w, sint32 x, sint32 y)
|
||||
static ride_list_item window_new_ride_scroll_get_ride_list_item_at(rct_window *w, int32_t x, int32_t y)
|
||||
{
|
||||
ride_list_item result;
|
||||
result.type = RIDE_TYPE_NULL;
|
||||
|
@ -893,12 +893,12 @@ static ride_list_item window_new_ride_scroll_get_ride_list_item_at(rct_window *w
|
|||
if (--x < 0 || --y < 0)
|
||||
return result;
|
||||
|
||||
sint32 column = x / 116;
|
||||
sint32 row = y / 116;
|
||||
int32_t column = x / 116;
|
||||
int32_t row = y / 116;
|
||||
if (column >= 5)
|
||||
return result;
|
||||
|
||||
sint32 index = column + (row * 5);
|
||||
int32_t index = column + (row * 5);
|
||||
|
||||
ride_list_item *listItem = _windowNewRideListItems;
|
||||
while (listItem->type != RIDE_TYPE_NULL || listItem->entry_index != 255) {
|
||||
|
@ -910,7 +910,7 @@ static ride_list_item window_new_ride_scroll_get_ride_list_item_at(rct_window *w
|
|||
return result;
|
||||
}
|
||||
|
||||
static sint32 get_num_track_designs(ride_list_item item)
|
||||
static int32_t get_num_track_designs(ride_list_item item)
|
||||
{
|
||||
char entry[DAT_NAME_LENGTH + 1];
|
||||
const char * entryPtr = nullptr;
|
||||
|
@ -931,11 +931,11 @@ static sint32 get_num_track_designs(ride_list_item item)
|
|||
if (rideEntry != nullptr && RideGroupManager::RideTypeHasRideGroups(item.type))
|
||||
{
|
||||
const RideGroup * rideGroup = RideGroupManager::GetRideGroup(item.type, rideEntry);
|
||||
return (sint32)repo->GetCountForRideGroup(item.type, rideGroup);
|
||||
return (int32_t)repo->GetCountForRideGroup(item.type, rideGroup);
|
||||
}
|
||||
else
|
||||
{
|
||||
return (sint32)repo->GetCountForObjectEntry(item.type, String::ToStd(entryPtr));
|
||||
return (int32_t)repo->GetCountForObjectEntry(item.type, String::ToStd(entryPtr));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -943,7 +943,7 @@ static sint32 get_num_track_designs(ride_list_item item)
|
|||
*
|
||||
* rct2: 0x006B701C
|
||||
*/
|
||||
static void window_new_ride_paint_ride_information(rct_window *w, rct_drawpixelinfo *dpi, ride_list_item item, sint32 x, sint32 y, sint32 width)
|
||||
static void window_new_ride_paint_ride_information(rct_window *w, rct_drawpixelinfo *dpi, ride_list_item item, int32_t x, int32_t y, int32_t width)
|
||||
{
|
||||
rct_ride_entry *rideEntry = get_ride_entry(item.entry_index);
|
||||
rct_ride_name rideNaming;
|
||||
|
@ -990,7 +990,7 @@ static void window_new_ride_paint_ride_information(rct_window *w, rct_drawpixeli
|
|||
// Price
|
||||
if (!(gParkFlags & PARK_FLAGS_NO_MONEY)) {
|
||||
// Get price of ride
|
||||
sint32 unk2 = RideConstructionDefaultTrackType[item.type];
|
||||
int32_t unk2 = RideConstructionDefaultTrackType[item.type];
|
||||
money32 price = RideTrackCosts[item.type].track_price;
|
||||
if (ride_type_has_flag(item.type, RIDE_TYPE_FLAG_FLAT_RIDE)) {
|
||||
price *= FlatRideTrackPricing[unk2];
|
||||
|
@ -1015,7 +1015,7 @@ static void window_new_ride_paint_ride_information(rct_window *w, rct_drawpixeli
|
|||
static void window_new_ride_select(rct_window *w)
|
||||
{
|
||||
ride_list_item item;
|
||||
item.ride_type_and_entry = static_cast<uint16>(w->new_ride.selected_ride_id);
|
||||
item.ride_type_and_entry = static_cast<uint16_t>(w->new_ride.selected_ride_id);
|
||||
if (item.type == RIDE_TYPE_NULL)
|
||||
return;
|
||||
|
||||
|
@ -1043,11 +1043,11 @@ static void window_new_ride_select(rct_window *w)
|
|||
ride_construct_new(item);
|
||||
}
|
||||
|
||||
static void window_new_ride_list_vehicles_for(const uint8 rideType, const rct_ride_entry * rideEntry, char * out)
|
||||
static void window_new_ride_list_vehicles_for(const uint8_t rideType, const rct_ride_entry * rideEntry, char * out)
|
||||
{
|
||||
rct_ride_entry * currentRideEntry;
|
||||
const RideGroup * rideGroup, * currentRideGroup;
|
||||
sint32 rideEntryIndex;
|
||||
int32_t rideEntryIndex;
|
||||
|
||||
if (RideGroupManager::RideTypeIsIndependent(rideType))
|
||||
{
|
||||
|
@ -1057,9 +1057,9 @@ static void window_new_ride_list_vehicles_for(const uint8 rideType, const rct_ri
|
|||
|
||||
memset(out, 0, AVAILABILITY_STRING_SIZE);
|
||||
|
||||
uint8 * rideEntryIndexPtr = get_ride_entry_indices_for_ride_type(rideType);
|
||||
uint8_t * rideEntryIndexPtr = get_ride_entry_indices_for_ride_type(rideType);
|
||||
|
||||
for (uint8 *currentRideEntryIndex = rideEntryIndexPtr, numItems = 0; *currentRideEntryIndex != RIDE_ENTRY_INDEX_NULL; currentRideEntryIndex++)
|
||||
for (uint8_t *currentRideEntryIndex = rideEntryIndexPtr, numItems = 0; *currentRideEntryIndex != RIDE_ENTRY_INDEX_NULL; currentRideEntryIndex++)
|
||||
{
|
||||
rideEntryIndex = *currentRideEntryIndex;
|
||||
currentRideEntry = get_ride_entry(rideEntryIndex);
|
||||
|
|
|
@ -40,11 +40,11 @@ static rct_widget window_news_widgets[] = {
|
|||
|
||||
static void window_news_mouseup(rct_window *w, rct_widgetindex widgetIndex);
|
||||
static void window_news_update(rct_window *w);
|
||||
static void window_news_scrollgetsize(rct_window *w, sint32 scrollIndex, sint32 *width, sint32 *height);
|
||||
static void window_news_scrollmousedown(rct_window *w, sint32 scrollIndex, sint32 x, sint32 y);
|
||||
static void window_news_scrollgetsize(rct_window *w, int32_t scrollIndex, int32_t *width, int32_t *height);
|
||||
static void window_news_scrollmousedown(rct_window *w, int32_t scrollIndex, int32_t x, int32_t y);
|
||||
static void window_news_tooltip(rct_window* w, rct_widgetindex widgetIndex, rct_string_id *stringId);
|
||||
static void window_news_paint(rct_window *w, rct_drawpixelinfo *dpi);
|
||||
static void window_news_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, sint32 scrollIndex);
|
||||
static void window_news_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, int32_t scrollIndex);
|
||||
|
||||
static rct_window_event_list window_news_events = {
|
||||
nullptr,
|
||||
|
@ -105,8 +105,8 @@ rct_window * window_news_open()
|
|||
// sub_66E4BA:
|
||||
rct_widget *widget;
|
||||
|
||||
sint32 width = 0;
|
||||
sint32 height = 0;
|
||||
int32_t width = 0;
|
||||
int32_t height = 0;
|
||||
window_get_scroll_size(window, 0, &width, &height);
|
||||
widget = &window_news_widgets[WIDX_SCROLL];
|
||||
window->scrolls[0].v_top = std::max(0, height - (widget->bottom - widget->top - 1));
|
||||
|
@ -115,7 +115,7 @@ rct_window * window_news_open()
|
|||
return window;
|
||||
}
|
||||
|
||||
static sint32 window_news_get_item_height()
|
||||
static int32_t window_news_get_item_height()
|
||||
{
|
||||
return 4 * font_get_line_height(gCurrentFontSpriteBase) + 2;
|
||||
}
|
||||
|
@ -143,7 +143,7 @@ static void window_news_mouseup(rct_window *w, rct_widgetindex widgetIndex)
|
|||
*/
|
||||
static void window_news_update(rct_window *w)
|
||||
{
|
||||
sint32 i, j, x, y, z;
|
||||
int32_t i, j, x, y, z;
|
||||
|
||||
if (w->news.var_480 == -1 ||
|
||||
--w->news.var_484 != 0)
|
||||
|
@ -189,12 +189,12 @@ static void window_news_update(rct_window *w)
|
|||
*
|
||||
* rct2: 0x0066EA3C
|
||||
*/
|
||||
static void window_news_scrollgetsize(rct_window *w, sint32 scrollIndex, sint32 *width, sint32 *height)
|
||||
static void window_news_scrollgetsize(rct_window *w, int32_t scrollIndex, int32_t *width, int32_t *height)
|
||||
{
|
||||
sint32 itemHeight = window_news_get_item_height();
|
||||
int32_t itemHeight = window_news_get_item_height();
|
||||
|
||||
*height = 0;
|
||||
for (sint32 i = 11; i < 61; i++)
|
||||
for (int32_t i = 11; i < 61; i++)
|
||||
{
|
||||
if (news_item_is_empty(i))
|
||||
break;
|
||||
|
@ -207,10 +207,10 @@ static void window_news_scrollgetsize(rct_window *w, sint32 scrollIndex, sint32
|
|||
*
|
||||
* rct2: 0x0066EA5C
|
||||
*/
|
||||
static void window_news_scrollmousedown(rct_window *w, sint32 scrollIndex, sint32 x, sint32 y)
|
||||
static void window_news_scrollmousedown(rct_window *w, int32_t scrollIndex, int32_t x, int32_t y)
|
||||
{
|
||||
sint32 itemHeight = window_news_get_item_height();
|
||||
sint32 i, buttonIndex;
|
||||
int32_t itemHeight = window_news_get_item_height();
|
||||
int32_t i, buttonIndex;
|
||||
|
||||
buttonIndex = 0;
|
||||
for (i = 11; i < 61; i++)
|
||||
|
@ -274,11 +274,11 @@ static void window_news_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
|||
*
|
||||
* rct2: 0x0066E4EE
|
||||
*/
|
||||
static void window_news_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, sint32 scrollIndex)
|
||||
static void window_news_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, int32_t scrollIndex)
|
||||
{
|
||||
sint32 lineHeight = font_get_line_height(gCurrentFontSpriteBase);
|
||||
sint32 itemHeight = window_news_get_item_height();
|
||||
sint32 i, x, y, yy, press;
|
||||
int32_t lineHeight = font_get_line_height(gCurrentFontSpriteBase);
|
||||
int32_t itemHeight = window_news_get_item_height();
|
||||
int32_t i, x, y, yy, press;
|
||||
|
||||
y = 0;
|
||||
for (i = 11; i < 61; i++)
|
||||
|
@ -314,7 +314,7 @@ static void window_news_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, sint3
|
|||
|
||||
press = 0;
|
||||
if (w->news.var_480 != -1) {
|
||||
const uint8 idx = 11 + w->news.var_480;
|
||||
const uint8_t idx = 11 + w->news.var_480;
|
||||
news_item_is_valid_idx(idx);
|
||||
if (i == idx && w->news.var_482 == 1)
|
||||
press = INSET_RECT_FLAG_BORDER_INSET;
|
||||
|
@ -334,11 +334,11 @@ static void window_news_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, sint3
|
|||
}
|
||||
|
||||
rct_peep* peep = GET_PEEP(newsItem->Assoc);
|
||||
sint32 clip_x = 10, clip_y = 19;
|
||||
int32_t clip_x = 10, clip_y = 19;
|
||||
|
||||
// If normal peep set sprite to normal (no food)
|
||||
// If staff set sprite to staff sprite
|
||||
sint32 sprite_type = 0;
|
||||
int32_t sprite_type = 0;
|
||||
if (peep->type == PEEP_TYPE_STAFF){
|
||||
sprite_type = peep->sprite_type;
|
||||
if (peep->staff_type == STAFF_TYPE_ENTERTAINER){
|
||||
|
@ -346,7 +346,7 @@ static void window_news_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, sint3
|
|||
}
|
||||
}
|
||||
|
||||
uint32 image_id = g_peep_animation_entries[sprite_type].sprite_animation->base_image;
|
||||
uint32_t image_id = g_peep_animation_entries[sprite_type].sprite_animation->base_image;
|
||||
image_id += 0xA0000001;
|
||||
image_id |= (peep->tshirt_colour << 19) | (peep->trousers_colour << 24);
|
||||
|
||||
|
@ -379,7 +379,7 @@ static void window_news_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, sint3
|
|||
|
||||
press = 0;
|
||||
if (w->news.var_480 != -1) {
|
||||
const uint8 idx = 11 + w->news.var_480;
|
||||
const uint8_t idx = 11 + w->news.var_480;
|
||||
news_item_is_valid_idx(idx);
|
||||
if (i == idx && w->news.var_482 == 2)
|
||||
press = 0x20;
|
||||
|
|
|
@ -26,7 +26,7 @@ enum {
|
|||
};
|
||||
|
||||
struct notification_def {
|
||||
uint8 category;
|
||||
uint8_t category;
|
||||
rct_string_id caption;
|
||||
size_t config_offset;
|
||||
};
|
||||
|
@ -121,7 +121,7 @@ static rct_window_event_list window_news_options_events = {
|
|||
};
|
||||
// clang-format on
|
||||
|
||||
static void window_news_options_set_page(rct_window *w, sint32 page);
|
||||
static void window_news_options_set_page(rct_window *w, int32_t page);
|
||||
static void window_news_options_draw_tab_images(rct_window *w, rct_drawpixelinfo *dpi);
|
||||
static bool *get_notification_value_ptr(const notification_def *ndef);
|
||||
|
||||
|
@ -167,9 +167,9 @@ static void window_news_options_mouseup(rct_window *w, rct_widgetindex widgetInd
|
|||
break;
|
||||
default:
|
||||
{
|
||||
sint32 checkBoxIndex = widgetIndex - WIDX_CHECKBOX_0;
|
||||
int32_t checkBoxIndex = widgetIndex - WIDX_CHECKBOX_0;
|
||||
if (checkBoxIndex >= 0) {
|
||||
sint32 matchIndex = 0;
|
||||
int32_t matchIndex = 0;
|
||||
for (size_t i = 0; i < Util::CountOf(NewsItemOptionDefinitions); i++) {
|
||||
const notification_def *ndef = &NewsItemOptionDefinitions[i];
|
||||
if (ndef->category != w->page) continue;
|
||||
|
@ -208,9 +208,9 @@ static void window_news_options_invalidate(rct_window *w)
|
|||
|
||||
// Set checkboxes
|
||||
rct_widget *baseCheckBox = &w->widgets[WIDX_CHECKBOX_0];
|
||||
sint32 y = baseCheckBox->top;
|
||||
int32_t y = baseCheckBox->top;
|
||||
|
||||
sint32 checkboxWidgetIndex = WIDX_CHECKBOX_0;
|
||||
int32_t checkboxWidgetIndex = WIDX_CHECKBOX_0;
|
||||
rct_widget *checkboxWidget = &w->widgets[checkboxWidgetIndex];
|
||||
for (size_t i = 0; i < Util::CountOf(NewsItemOptionDefinitions); i++) {
|
||||
const notification_def *ndef = &NewsItemOptionDefinitions[i];
|
||||
|
@ -260,7 +260,7 @@ static void window_news_options_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
|||
window_news_options_draw_tab_images(w, dpi);
|
||||
}
|
||||
|
||||
static void window_news_options_set_page(rct_window *w, sint32 page)
|
||||
static void window_news_options_set_page(rct_window *w, int32_t page)
|
||||
{
|
||||
if (w->page != page) {
|
||||
w->page = page;
|
||||
|
@ -269,18 +269,18 @@ static void window_news_options_set_page(rct_window *w, sint32 page)
|
|||
}
|
||||
}
|
||||
|
||||
const sint32 window_news_option_tab_animation_divisor[] = { 1, 4, 4 };
|
||||
const sint32 window_news_option_tab_animation_frames[] = { 1, 16, 8 };
|
||||
const int32_t window_news_option_tab_animation_divisor[] = { 1, 4, 4 };
|
||||
const int32_t window_news_option_tab_animation_frames[] = { 1, 16, 8 };
|
||||
|
||||
static void window_news_options_draw_tab_image(rct_window *w, rct_drawpixelinfo *dpi, sint32 page, sint32 spriteIndex)
|
||||
static void window_news_options_draw_tab_image(rct_window *w, rct_drawpixelinfo *dpi, int32_t page, int32_t spriteIndex)
|
||||
{
|
||||
rct_widgetindex widgetIndex = WIDX_TAB_PARK + page;
|
||||
|
||||
if (!(w->disabled_widgets & (1LL << widgetIndex))) {
|
||||
if (w->page == page) {
|
||||
sint32 numFrames = window_news_option_tab_animation_frames[w->page];
|
||||
int32_t numFrames = window_news_option_tab_animation_frames[w->page];
|
||||
if (numFrames > 1) {
|
||||
sint32 frame = w->frame_no / window_news_option_tab_animation_divisor[w->page];
|
||||
int32_t frame = w->frame_no / window_news_option_tab_animation_divisor[w->page];
|
||||
spriteIndex += (frame % numFrames);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -54,11 +54,11 @@ static rct_string_id get_object_type_string(const rct_object_entry *entry);
|
|||
static void window_object_load_error_close(rct_window *w);
|
||||
static void window_object_load_error_update(rct_window *w);
|
||||
static void window_object_load_error_mouseup(rct_window *w, rct_widgetindex widgetIndex);
|
||||
static void window_object_load_error_scrollgetsize(rct_window *w, sint32 scrollIndex, sint32 *width, sint32 *height);
|
||||
static void window_object_load_error_scrollmouseover(rct_window *w, sint32 scrollIndex, sint32 x, sint32 y);
|
||||
static void window_object_load_error_scrollmousedown(rct_window *w, sint32 scrollIndex, sint32 x, sint32 y);
|
||||
static void window_object_load_error_scrollgetsize(rct_window *w, int32_t scrollIndex, int32_t *width, int32_t *height);
|
||||
static void window_object_load_error_scrollmouseover(rct_window *w, int32_t scrollIndex, int32_t x, int32_t y);
|
||||
static void window_object_load_error_scrollmousedown(rct_window *w, int32_t scrollIndex, int32_t x, int32_t y);
|
||||
static void window_object_load_error_paint(rct_window *w, rct_drawpixelinfo *dpi);
|
||||
static void window_object_load_error_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, sint32 scrollIndex);
|
||||
static void window_object_load_error_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, int32_t scrollIndex);
|
||||
|
||||
static rct_window_event_list window_object_load_error_events = {
|
||||
window_object_load_error_close,
|
||||
|
@ -93,7 +93,7 @@ static rct_window_event_list window_object_load_error_events = {
|
|||
// clang-format on
|
||||
|
||||
static std::vector<rct_object_entry> _invalid_entries;
|
||||
static sint32 highlighted_index = -1;
|
||||
static int32_t highlighted_index = -1;
|
||||
static std::string file_path;
|
||||
|
||||
/**
|
||||
|
@ -105,7 +105,7 @@ static std::string file_path;
|
|||
static rct_string_id get_object_type_string(const rct_object_entry *entry)
|
||||
{
|
||||
rct_string_id result;
|
||||
uint8 objectType = object_entry_get_type(entry);
|
||||
uint8_t objectType = object_entry_get_type(entry);
|
||||
switch (objectType) {
|
||||
case OBJECT_TYPE_RIDE:
|
||||
result = STR_OBJECT_SELECTION_RIDE_VEHICLES_ATTRACTIONS;
|
||||
|
@ -162,11 +162,11 @@ static void copy_object_names_to_clipboard(rct_window *w)
|
|||
utf8 * buffer = new utf8[buffer_len]{};
|
||||
|
||||
size_t cur_len = 0;
|
||||
for (uint16 i = 0; i < w->no_list_items; i++) {
|
||||
for (uint16_t i = 0; i < w->no_list_items; i++) {
|
||||
cur_len += (8 + line_sep_len);
|
||||
assert(cur_len < buffer_len);
|
||||
|
||||
uint16 nameLength = 8;
|
||||
uint16_t nameLength = 8;
|
||||
for (; nameLength > 0; nameLength--)
|
||||
{
|
||||
if (_invalid_entries[i].name[nameLength - 1] != ' ')
|
||||
|
@ -206,7 +206,7 @@ rct_window * window_object_load_error_open(utf8 * path, size_t numMissingObjects
|
|||
}
|
||||
|
||||
// Refresh list items and path
|
||||
window->no_list_items = (uint16)numMissingObjects;
|
||||
window->no_list_items = (uint16_t)numMissingObjects;
|
||||
file_path = path;
|
||||
|
||||
window_invalidate(window);
|
||||
|
@ -252,10 +252,10 @@ static void window_object_load_error_mouseup(rct_window *w, rct_widgetindex widg
|
|||
}
|
||||
}
|
||||
|
||||
static void window_object_load_error_scrollmouseover(rct_window *w, sint32 scrollIndex, sint32 x, sint32 y)
|
||||
static void window_object_load_error_scrollmouseover(rct_window *w, int32_t scrollIndex, int32_t x, int32_t y)
|
||||
{
|
||||
// Highlight item that the cursor is over, or remove highlighting if none
|
||||
sint32 selected_item;
|
||||
int32_t selected_item;
|
||||
selected_item = y / SCROLLABLE_ROW_HEIGHT;
|
||||
if (selected_item < 0 || selected_item >= w->no_list_items)
|
||||
highlighted_index = -1;
|
||||
|
@ -265,7 +265,7 @@ static void window_object_load_error_scrollmouseover(rct_window *w, sint32 scrol
|
|||
widget_invalidate(w, WIDX_SCROLL);
|
||||
}
|
||||
|
||||
static void window_object_load_error_select_element_from_list(rct_window *w, sint32 index)
|
||||
static void window_object_load_error_select_element_from_list(rct_window *w, int32_t index)
|
||||
{
|
||||
if (index < 0 || index > w->no_list_items) {
|
||||
w->selected_list_item = -1;
|
||||
|
@ -276,14 +276,14 @@ static void window_object_load_error_select_element_from_list(rct_window *w, sin
|
|||
widget_invalidate(w, WIDX_SCROLL);
|
||||
}
|
||||
|
||||
static void window_object_load_error_scrollmousedown(rct_window *w, sint32 scrollIndex, sint32 x, sint32 y)
|
||||
static void window_object_load_error_scrollmousedown(rct_window *w, int32_t scrollIndex, int32_t x, int32_t y)
|
||||
{
|
||||
sint32 selected_item;
|
||||
int32_t selected_item;
|
||||
selected_item = y / SCROLLABLE_ROW_HEIGHT;
|
||||
window_object_load_error_select_element_from_list(w, selected_item);
|
||||
}
|
||||
|
||||
static void window_object_load_error_scrollgetsize(rct_window *w, sint32 scrollIndex, sint32 *width, sint32 *height)
|
||||
static void window_object_load_error_scrollgetsize(rct_window *w, int32_t scrollIndex, int32_t *width, int32_t *height)
|
||||
{
|
||||
*height = w->no_list_items * SCROLLABLE_ROW_HEIGHT;
|
||||
}
|
||||
|
@ -302,14 +302,14 @@ static void window_object_load_error_paint(rct_window *w, rct_drawpixelinfo *dpi
|
|||
gfx_draw_string_left_clipped(dpi, STR_BLACK_STRING, gCommonFormatArgs, COLOUR_BLACK, w->x + 5, w->y + 43, WW-5);
|
||||
}
|
||||
|
||||
static void window_object_load_error_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, sint32 scrollIndex)
|
||||
static void window_object_load_error_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, int32_t scrollIndex)
|
||||
{
|
||||
gfx_fill_rect(dpi, dpi->x, dpi->y, dpi->x + dpi->width - 1, dpi->y + dpi->height - 1, ColourMapA[w->colours[1]].mid_light);
|
||||
const sint32 list_width = w->widgets[WIDX_SCROLL].right - w->widgets[WIDX_SCROLL].left;
|
||||
const int32_t list_width = w->widgets[WIDX_SCROLL].right - w->widgets[WIDX_SCROLL].left;
|
||||
|
||||
for (sint32 i = 0; i < w->no_list_items; i++)
|
||||
for (int32_t i = 0; i < w->no_list_items; i++)
|
||||
{
|
||||
sint32 y = i * SCROLLABLE_ROW_HEIGHT;
|
||||
int32_t y = i * SCROLLABLE_ROW_HEIGHT;
|
||||
if (y > dpi->y + dpi->height)
|
||||
break;
|
||||
|
||||
|
|
|
@ -412,7 +412,7 @@ static constexpr const rct_string_id window_options_fullscreen_mode_names[] = {
|
|||
STR_OPTIONS_DISPLAY_FULLSCREEN_BORDERLESS,
|
||||
};
|
||||
|
||||
const sint32 window_options_tab_animation_divisor[] =
|
||||
const int32_t window_options_tab_animation_divisor[] =
|
||||
{
|
||||
4, // WINDOW_OPTIONS_PAGE_DISPLAY,
|
||||
1, // WINDOW_OPTIONS_PAGE_RENDERING,
|
||||
|
@ -423,7 +423,7 @@ const sint32 window_options_tab_animation_divisor[] =
|
|||
2, // WINDOW_OPTIONS_PAGE_ADVANCED,
|
||||
1 // WINDOW_OPTIONS_PAGE_TWITCH,
|
||||
};
|
||||
const sint32 window_options_tab_animation_frames[] =
|
||||
const int32_t window_options_tab_animation_frames[] =
|
||||
{
|
||||
8, // WINDOW_OPTIONS_PAGE_DISPLAY,
|
||||
1, // WINDOW_OPTIONS_PAGE_RENDERING,
|
||||
|
@ -435,11 +435,11 @@ const sint32 window_options_tab_animation_frames[] =
|
|||
1 // WINDOW_OPTIONS_PAGE_TWITCH,
|
||||
};
|
||||
|
||||
static void window_options_set_page(rct_window *w, sint32 page);
|
||||
static void window_options_set_page(rct_window *w, int32_t page);
|
||||
static void window_options_set_pressed_tab(rct_window *w);
|
||||
static void window_options_draw_tab_image(rct_drawpixelinfo *dpi, rct_window *w, sint32 page, sint32 spriteIndex);
|
||||
static void window_options_draw_tab_image(rct_drawpixelinfo *dpi, rct_window *w, int32_t page, int32_t spriteIndex);
|
||||
static void window_options_draw_tab_images(rct_drawpixelinfo *dpi, rct_window *w);
|
||||
static void window_options_show_dropdown(rct_window *w, rct_widget *widget, sint32 num_items);
|
||||
static void window_options_show_dropdown(rct_window *w, rct_widget *widget, int32_t num_items);
|
||||
static void window_options_update_height_markers();
|
||||
|
||||
#pragma region Events
|
||||
|
@ -447,11 +447,11 @@ static void window_options_update_height_markers();
|
|||
static void window_options_close(rct_window *w);
|
||||
static void window_options_mouseup(rct_window *w, rct_widgetindex widgetIndex);
|
||||
static void window_options_mousedown(rct_window *w, rct_widgetindex widgetIndex, rct_widget* widget);
|
||||
static void window_options_dropdown(rct_window *w, rct_widgetindex widgetIndex, sint32 dropdownIndex);
|
||||
static void window_options_dropdown(rct_window *w, rct_widgetindex widgetIndex, int32_t dropdownIndex);
|
||||
static void window_options_update(rct_window *w);
|
||||
static void window_options_invalidate(rct_window *w);
|
||||
static void window_options_paint(rct_window *w, rct_drawpixelinfo *dpi);
|
||||
static void window_options_scrollgetsize(rct_window *w, sint32 scrollIndex, sint32 *width, sint32 *height);
|
||||
static void window_options_scrollgetsize(rct_window *w, int32_t scrollIndex, int32_t *width, int32_t *height);
|
||||
static void window_options_text_input(rct_window *w, rct_widgetindex widgetIndex, char *text);
|
||||
static void window_options_tooltip(rct_window *w, rct_widgetindex widgetIndex, rct_string_id *stringid);
|
||||
|
||||
|
@ -501,7 +501,7 @@ static rct_window_event_list window_options_events = {
|
|||
(1 << WIDX_TAB_7) | \
|
||||
(1 << WIDX_TAB_8)
|
||||
|
||||
static uint64 window_options_page_enabled_widgets[] = {
|
||||
static uint64_t window_options_page_enabled_widgets[] = {
|
||||
MAIN_OPTIONS_ENABLED_WIDGETS |
|
||||
(1 << WIDX_RESOLUTION) |
|
||||
(1 << WIDX_RESOLUTION_DROPDOWN) |
|
||||
|
@ -610,7 +610,7 @@ static uint64 window_options_page_enabled_widgets[] = {
|
|||
#pragma endregion
|
||||
|
||||
static struct Resolution * _resolutions = nullptr;
|
||||
static sint32 _numResolutions = 0;
|
||||
static int32_t _numResolutions = 0;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -991,7 +991,7 @@ static void window_options_mouseup(rct_window *w, rct_widgetindex widgetIndex)
|
|||
*/
|
||||
static void window_options_mousedown(rct_window *w, rct_widgetindex widgetIndex, rct_widget* widget)
|
||||
{
|
||||
uint32 num_items;
|
||||
uint32_t num_items;
|
||||
|
||||
widget = &w->widgets[widgetIndex - 1];
|
||||
|
||||
|
@ -1002,13 +1002,13 @@ static void window_options_mousedown(rct_window *w, rct_widgetindex widgetIndex,
|
|||
{
|
||||
_numResolutions = context_get_resolutions(&_resolutions);
|
||||
|
||||
sint32 selectedResolution = -1;
|
||||
for (sint32 i = 0; i < _numResolutions; i++) {
|
||||
int32_t selectedResolution = -1;
|
||||
for (int32_t i = 0; i < _numResolutions; i++) {
|
||||
struct Resolution *resolution = &_resolutions[i];
|
||||
|
||||
gDropdownItemsFormat[i] = STR_DROPDOWN_MENU_LABEL;
|
||||
|
||||
uint16 *args = (uint16*)&gDropdownItemsArgs[i];
|
||||
uint16_t *args = (uint16_t*)&gDropdownItemsArgs[i];
|
||||
args[0] = STR_RESOLUTION_X_BY_Y;
|
||||
args[1] = resolution->Width;
|
||||
args[2] = resolution->Height;
|
||||
|
@ -1039,12 +1039,12 @@ static void window_options_mousedown(rct_window *w, rct_widgetindex widgetIndex,
|
|||
break;
|
||||
case WIDX_DRAWING_ENGINE_DROPDOWN:
|
||||
{
|
||||
sint32 numItems = 3;
|
||||
int32_t numItems = 3;
|
||||
#ifdef DISABLE_OPENGL
|
||||
numItems = 2;
|
||||
#endif
|
||||
|
||||
for (sint32 i = 0; i < numItems; i++) {
|
||||
for (int32_t i = 0; i < numItems; i++) {
|
||||
gDropdownItemsFormat[i] = STR_DROPDOWN_MENU_LABEL;
|
||||
gDropdownItemsArgs[i] = DrawingEngineStringIds[i];
|
||||
}
|
||||
|
@ -1182,7 +1182,7 @@ static void window_options_mousedown(rct_window *w, rct_widgetindex widgetIndex,
|
|||
audio_populate_devices();
|
||||
|
||||
// populate the list with the sound devices
|
||||
for (size_t i = 0; (sint32)i < gAudioDeviceCount; i++) {
|
||||
for (size_t i = 0; (int32_t)i < gAudioDeviceCount; i++) {
|
||||
gDropdownItemsFormat[i] = STR_OPTIONS_DROPDOWN_ITEM;
|
||||
gDropdownItemsArgs[i] = (uintptr_t)gAudioDevices[i].name;
|
||||
}
|
||||
|
@ -1209,7 +1209,7 @@ static void window_options_mousedown(rct_window *w, rct_widgetindex widgetIndex,
|
|||
case WINDOW_OPTIONS_PAGE_CONTROLS_AND_INTERFACE:
|
||||
switch (widgetIndex) {
|
||||
case WIDX_THEMES_DROPDOWN:
|
||||
num_items = (uint32)theme_manager_get_num_available_themes();
|
||||
num_items = (uint32_t)theme_manager_get_num_available_themes();
|
||||
|
||||
for (size_t i = 0; i < num_items; i++) {
|
||||
gDropdownItemsFormat[i] = STR_OPTIONS_DROPDOWN_ITEM;
|
||||
|
@ -1227,7 +1227,7 @@ static void window_options_mousedown(rct_window *w, rct_widgetindex widgetIndex,
|
|||
widget->right - widget->left - 3
|
||||
);
|
||||
|
||||
dropdown_set_checked((sint32)theme_manager_get_active_available_theme_index(), true);
|
||||
dropdown_set_checked((int32_t)theme_manager_get_active_available_theme_index(), true);
|
||||
widget_invalidate(w, WIDX_THEMES_DROPDOWN);
|
||||
break;
|
||||
}
|
||||
|
@ -1236,7 +1236,7 @@ static void window_options_mousedown(rct_window *w, rct_widgetindex widgetIndex,
|
|||
case WINDOW_OPTIONS_PAGE_MISC:
|
||||
switch (widgetIndex) {
|
||||
case WIDX_TITLE_SEQUENCE_DROPDOWN:
|
||||
num_items = (sint32)title_sequence_manager_get_count();
|
||||
num_items = (int32_t)title_sequence_manager_get_count();
|
||||
for (size_t i = 0; i < num_items; i++) {
|
||||
gDropdownItemsFormat[i] = STR_OPTIONS_DROPDOWN_ITEM;
|
||||
gDropdownItemsArgs[i] = (uintptr_t)title_sequence_manager_get_name(i);
|
||||
|
@ -1251,7 +1251,7 @@ static void window_options_mousedown(rct_window *w, rct_widgetindex widgetIndex,
|
|||
num_items
|
||||
);
|
||||
|
||||
dropdown_set_checked((sint32)title_get_current_sequence(), true);
|
||||
dropdown_set_checked((int32_t)title_get_current_sequence(), true);
|
||||
break;
|
||||
case WIDX_SCENARIO_GROUPING_DROPDOWN:
|
||||
num_items = 2;
|
||||
|
@ -1309,7 +1309,7 @@ static void window_options_mousedown(rct_window *w, rct_widgetindex widgetIndex,
|
|||
*
|
||||
* rct2: 0x006BB076
|
||||
*/
|
||||
static void window_options_dropdown(rct_window *w, rct_widgetindex widgetIndex, sint32 dropdownIndex)
|
||||
static void window_options_dropdown(rct_window *w, rct_widgetindex widgetIndex, int32_t dropdownIndex)
|
||||
{
|
||||
if (dropdownIndex == -1)
|
||||
return;
|
||||
|
@ -1324,8 +1324,8 @@ static void window_options_dropdown(rct_window *w, rct_widgetindex widgetIndex,
|
|||
gConfigGeneral.fullscreen_width = resolution->Width;
|
||||
gConfigGeneral.fullscreen_height = resolution->Height;
|
||||
|
||||
if (gConfigGeneral.fullscreen_mode == static_cast<sint32>(OpenRCT2::Ui::FULLSCREEN_MODE::FULLSCREEN))
|
||||
context_set_fullscreen_mode(static_cast<sint32>(OpenRCT2::Ui::FULLSCREEN_MODE::FULLSCREEN));
|
||||
if (gConfigGeneral.fullscreen_mode == static_cast<int32_t>(OpenRCT2::Ui::FULLSCREEN_MODE::FULLSCREEN))
|
||||
context_set_fullscreen_mode(static_cast<int32_t>(OpenRCT2::Ui::FULLSCREEN_MODE::FULLSCREEN));
|
||||
|
||||
config_save_default();
|
||||
gfx_invalidate_screen();
|
||||
|
@ -1336,17 +1336,17 @@ static void window_options_dropdown(rct_window *w, rct_widgetindex widgetIndex,
|
|||
if (dropdownIndex != gConfigGeneral.fullscreen_mode){
|
||||
context_set_fullscreen_mode(dropdownIndex);
|
||||
|
||||
gConfigGeneral.fullscreen_mode = (uint8)dropdownIndex;
|
||||
gConfigGeneral.fullscreen_mode = (uint8_t)dropdownIndex;
|
||||
config_save_default();
|
||||
gfx_invalidate_screen();
|
||||
}
|
||||
break;
|
||||
case WIDX_DRAWING_ENGINE_DROPDOWN:
|
||||
if (dropdownIndex != gConfigGeneral.drawing_engine) {
|
||||
sint32 srcEngine = drawing_engine_get_type();
|
||||
sint32 dstEngine = dropdownIndex;
|
||||
int32_t srcEngine = drawing_engine_get_type();
|
||||
int32_t dstEngine = dropdownIndex;
|
||||
|
||||
gConfigGeneral.drawing_engine = (uint8)dstEngine;
|
||||
gConfigGeneral.drawing_engine = (uint8_t)dstEngine;
|
||||
bool recreate_window = drawing_engine_requires_new_window(srcEngine, dstEngine);
|
||||
platform_refresh_video(recreate_window);
|
||||
config_save_default();
|
||||
|
@ -1357,7 +1357,7 @@ static void window_options_dropdown(rct_window *w, rct_widgetindex widgetIndex,
|
|||
// Note: offset by one to compensate for lack of NN option.
|
||||
if ((dropdownIndex + 1) != gConfigGeneral.scale_quality)
|
||||
{
|
||||
gConfigGeneral.scale_quality = (uint8)dropdownIndex + 1;
|
||||
gConfigGeneral.scale_quality = (uint8_t)dropdownIndex + 1;
|
||||
config_save_default();
|
||||
gfx_invalidate_screen();
|
||||
context_trigger_resize();
|
||||
|
@ -1390,22 +1390,22 @@ static void window_options_dropdown(rct_window *w, rct_widgetindex widgetIndex,
|
|||
break;
|
||||
case WIDX_CURRENCY_DROPDOWN:
|
||||
if(dropdownIndex == CURRENCY_CUSTOM + 1) { // Add 1 because the separator occupies a position
|
||||
gConfigGeneral.currency_format = (sint8)dropdownIndex - 1;
|
||||
gConfigGeneral.currency_format = (int8_t)dropdownIndex - 1;
|
||||
context_open_window(WC_CUSTOM_CURRENCY_CONFIG);
|
||||
} else {
|
||||
gConfigGeneral.currency_format = (sint8)dropdownIndex;
|
||||
gConfigGeneral.currency_format = (int8_t)dropdownIndex;
|
||||
}
|
||||
config_save_default();
|
||||
gfx_invalidate_screen();
|
||||
break;
|
||||
case WIDX_DISTANCE_DROPDOWN:
|
||||
gConfigGeneral.measurement_format = (sint8)dropdownIndex;
|
||||
gConfigGeneral.measurement_format = (int8_t)dropdownIndex;
|
||||
config_save_default();
|
||||
window_options_update_height_markers();
|
||||
break;
|
||||
case WIDX_TEMPERATURE_DROPDOWN:
|
||||
if (dropdownIndex != gConfigGeneral.temperature_format) {
|
||||
gConfigGeneral.temperature_format = (sint8)dropdownIndex;
|
||||
gConfigGeneral.temperature_format = (int8_t)dropdownIndex;
|
||||
config_save_default();
|
||||
gfx_invalidate_screen();
|
||||
}
|
||||
|
@ -1436,7 +1436,7 @@ static void window_options_dropdown(rct_window *w, rct_widgetindex widgetIndex,
|
|||
break;
|
||||
case WIDX_DATE_FORMAT_DROPDOWN:
|
||||
if (dropdownIndex != gConfigGeneral.date_format) {
|
||||
gConfigGeneral.date_format = (uint8)dropdownIndex;
|
||||
gConfigGeneral.date_format = (uint8_t)dropdownIndex;
|
||||
config_save_default();
|
||||
gfx_invalidate_screen();
|
||||
}
|
||||
|
@ -1469,7 +1469,7 @@ static void window_options_dropdown(rct_window *w, rct_widgetindex widgetIndex,
|
|||
context_show_error(STR_OPTIONS_MUSIC_ERR_CSS50_NOT_FOUND, STR_OPTIONS_MUSIC_ERR_CSS50_NOT_FOUND_HINT);
|
||||
}
|
||||
else {
|
||||
gConfigSound.title_music = (sint8)dropdownIndex;
|
||||
gConfigSound.title_music = (int8_t)dropdownIndex;
|
||||
config_save_default();
|
||||
window_invalidate(w);
|
||||
}
|
||||
|
@ -1495,7 +1495,7 @@ static void window_options_dropdown(rct_window *w, rct_widgetindex widgetIndex,
|
|||
case WINDOW_OPTIONS_PAGE_MISC:
|
||||
switch (widgetIndex) {
|
||||
case WIDX_TITLE_SEQUENCE_DROPDOWN:
|
||||
if (dropdownIndex != (sint32)title_get_current_sequence()) {
|
||||
if (dropdownIndex != (int32_t)title_get_current_sequence()) {
|
||||
title_sequence_change_preset((size_t)dropdownIndex);
|
||||
config_save_default();
|
||||
window_invalidate(w);
|
||||
|
@ -1503,7 +1503,7 @@ static void window_options_dropdown(rct_window *w, rct_widgetindex widgetIndex,
|
|||
break;
|
||||
case WIDX_DEFAULT_INSPECTION_INTERVAL_DROPDOWN:
|
||||
if (dropdownIndex != gConfigGeneral.default_inspection_interval) {
|
||||
gConfigGeneral.default_inspection_interval = (uint8)dropdownIndex;
|
||||
gConfigGeneral.default_inspection_interval = (uint8_t)dropdownIndex;
|
||||
config_save_default();
|
||||
window_invalidate(w);
|
||||
}
|
||||
|
@ -1523,7 +1523,7 @@ static void window_options_dropdown(rct_window *w, rct_widgetindex widgetIndex,
|
|||
switch (widgetIndex) {
|
||||
case WIDX_AUTOSAVE_DROPDOWN:
|
||||
if (dropdownIndex != gConfigGeneral.autosave_frequency) {
|
||||
gConfigGeneral.autosave_frequency = (uint8)dropdownIndex;
|
||||
gConfigGeneral.autosave_frequency = (uint8_t)dropdownIndex;
|
||||
config_save_default();
|
||||
window_invalidate(w);
|
||||
}
|
||||
|
@ -1560,11 +1560,11 @@ static void window_options_invalidate(rct_window *w)
|
|||
case WINDOW_OPTIONS_PAGE_DISPLAY:
|
||||
{
|
||||
// Resolution dropdown caption.
|
||||
set_format_arg(16, uint16, (uint16)gConfigGeneral.fullscreen_width);
|
||||
set_format_arg(18, uint16, (uint16)gConfigGeneral.fullscreen_height);
|
||||
set_format_arg(16, uint16_t, (uint16_t)gConfigGeneral.fullscreen_width);
|
||||
set_format_arg(18, uint16_t, (uint16_t)gConfigGeneral.fullscreen_height);
|
||||
|
||||
// Disable resolution dropdown on "Windowed" and "Fullscreen (desktop)"
|
||||
if (gConfigGeneral.fullscreen_mode != static_cast<sint32>(OpenRCT2::Ui::FULLSCREEN_MODE::FULLSCREEN))
|
||||
if (gConfigGeneral.fullscreen_mode != static_cast<int32_t>(OpenRCT2::Ui::FULLSCREEN_MODE::FULLSCREEN))
|
||||
{
|
||||
w->disabled_widgets |= (1 << WIDX_RESOLUTION_DROPDOWN);
|
||||
w->disabled_widgets |= (1 << WIDX_RESOLUTION);
|
||||
|
@ -1731,9 +1731,9 @@ static void window_options_invalidate(rct_window *w)
|
|||
if (w->frame_no == 0)
|
||||
{
|
||||
widget = &window_options_audio_widgets[WIDX_SOUND_VOLUME];
|
||||
w->scrolls[0].h_left = (sint16)ceil((gConfigSound.sound_volume / 100.0f) * (w->scrolls[0].h_right - ((widget->right - widget->left) - 1)));
|
||||
w->scrolls[0].h_left = (int16_t)ceil((gConfigSound.sound_volume / 100.0f) * (w->scrolls[0].h_right - ((widget->right - widget->left) - 1)));
|
||||
widget = &window_options_audio_widgets[WIDX_MUSIC_VOLUME];
|
||||
w->scrolls[1].h_left = (sint16)ceil((gConfigSound.ride_music_volume / 100.0f) * (w->scrolls[1].h_right - ((widget->right - widget->left) - 1)));
|
||||
w->scrolls[1].h_left = (int16_t)ceil((gConfigSound.ride_music_volume / 100.0f) * (w->scrolls[1].h_right - ((widget->right - widget->left) - 1)));
|
||||
}
|
||||
|
||||
widget_scroll_update_thumbs(w, WIDX_SOUND_VOLUME);
|
||||
|
@ -1813,9 +1813,9 @@ static void window_options_invalidate(rct_window *w)
|
|||
}
|
||||
|
||||
// Automatically adjust window height to fit widgets
|
||||
sint32 y = 0;
|
||||
int32_t y = 0;
|
||||
for (widget = &w->widgets[WIDX_PAGE_START]; widget->type != WWT_LAST; widget++) {
|
||||
y = std::max<sint32>(y, widget->bottom);
|
||||
y = std::max<int32_t>(y, widget->bottom);
|
||||
}
|
||||
w->height = y + 6;
|
||||
w->widgets[WIDX_BACKGROUND].bottom = w->height - 1;
|
||||
|
@ -1830,9 +1830,9 @@ static void window_options_update(rct_window *w)
|
|||
|
||||
if (w->page == WINDOW_OPTIONS_PAGE_AUDIO) {
|
||||
rct_widget *widget = &window_options_audio_widgets[WIDX_SOUND_VOLUME];
|
||||
uint8 sound_volume = (uint8)(((float)w->scrolls[0].h_left / (w->scrolls[0].h_right - ((widget->right - widget->left) - 1))) * 100);
|
||||
uint8_t sound_volume = (uint8_t)(((float)w->scrolls[0].h_left / (w->scrolls[0].h_right - ((widget->right - widget->left) - 1))) * 100);
|
||||
widget = &window_options_audio_widgets[WIDX_MUSIC_VOLUME];
|
||||
uint8 ride_music_volume = (uint8)(((float)w->scrolls[1].h_left / (w->scrolls[1].h_right - ((widget->right - widget->left) - 1))) * 100);
|
||||
uint8_t ride_music_volume = (uint8_t)(((float)w->scrolls[1].h_left / (w->scrolls[1].h_right - ((widget->right - widget->left) - 1))) * 100);
|
||||
if (sound_volume != gConfigSound.sound_volume) {
|
||||
gConfigSound.sound_volume = sound_volume;
|
||||
config_save_default();
|
||||
|
@ -1861,8 +1861,8 @@ static void window_options_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
|||
gfx_draw_string_left(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)"
|
||||
sint32 colour = w->colours[1];
|
||||
if (gConfigGeneral.fullscreen_mode != static_cast<sint32>(OpenRCT2::Ui::FULLSCREEN_MODE::FULLSCREEN))
|
||||
int32_t colour = w->colours[1];
|
||||
if (gConfigGeneral.fullscreen_mode != static_cast<int32_t>(OpenRCT2::Ui::FULLSCREEN_MODE::FULLSCREEN))
|
||||
{
|
||||
colour |= COLOUR_FLAG_INSET;
|
||||
}
|
||||
|
@ -1871,7 +1871,7 @@ static void window_options_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
|||
gfx_draw_string_left(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, w->y + window_options_display_widgets[WIDX_DRAWING_ENGINE].top + 1);
|
||||
|
||||
sint32 scale = (sint32)(gConfigGeneral.window_scale * 100);
|
||||
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, w->y + w->widgets[WIDX_SCALE].top + 1);
|
||||
|
||||
colour = w->colours[1];
|
||||
|
@ -1929,9 +1929,9 @@ static void window_options_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
|||
rct_widget pathWidget = window_options_advanced_widgets[WIDX_PATH_TO_RCT1_BUTTON];
|
||||
|
||||
// Apply vertical alignment if appropriate.
|
||||
sint32 widgetHeight = pathWidget.bottom - pathWidget.top;
|
||||
sint32 lineHeight = font_get_line_height(gCurrentFontSpriteBase);
|
||||
uint32 padding = widgetHeight > lineHeight ? (widgetHeight - lineHeight) / 2 : 0;
|
||||
int32_t widgetHeight = pathWidget.bottom - pathWidget.top;
|
||||
int32_t lineHeight = font_get_line_height(gCurrentFontSpriteBase);
|
||||
uint32_t padding = widgetHeight > lineHeight ? (widgetHeight - lineHeight) / 2 : 0;
|
||||
|
||||
gfx_draw_string_left_clipped(
|
||||
dpi,
|
||||
|
@ -1948,7 +1948,7 @@ static void window_options_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
|||
}
|
||||
|
||||
// helper function, all dropdown boxes have similar properties
|
||||
static void window_options_show_dropdown(rct_window *w, rct_widget *widget, sint32 num_items)
|
||||
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,
|
||||
|
@ -1968,7 +1968,7 @@ static void window_options_update_height_markers()
|
|||
gfx_invalidate_screen();
|
||||
}
|
||||
|
||||
static void window_options_scrollgetsize(rct_window *w, sint32 scrollIndex, sint32 *width, sint32 *height)
|
||||
static void window_options_scrollgetsize(rct_window *w, int32_t scrollIndex, int32_t *width, int32_t *height)
|
||||
{
|
||||
if (w->page == WINDOW_OPTIONS_PAGE_AUDIO) {
|
||||
*width = 1000;
|
||||
|
@ -2020,7 +2020,7 @@ static void window_options_tooltip(rct_window *w, rct_widgetindex widgetIndex, r
|
|||
|
||||
#pragma region Common
|
||||
|
||||
static void window_options_set_page(rct_window *w, sint32 page)
|
||||
static void window_options_set_page(rct_window *w, int32_t page)
|
||||
{
|
||||
w->page = page;
|
||||
w->frame_no = 0;
|
||||
|
@ -2037,23 +2037,23 @@ static void window_options_set_page(rct_window *w, sint32 page)
|
|||
|
||||
static void window_options_set_pressed_tab(rct_window *w)
|
||||
{
|
||||
sint32 i;
|
||||
int32_t i;
|
||||
for (i = 0; i < WINDOW_OPTIONS_PAGE_COUNT; i++)
|
||||
w->pressed_widgets &= ~(1 << (WIDX_TAB_1 + i));
|
||||
w->pressed_widgets |= 1LL << (WIDX_TAB_1 + w->page);
|
||||
}
|
||||
|
||||
static void window_options_draw_tab_image(rct_drawpixelinfo *dpi, rct_window *w, sint32 page, sint32 spriteIndex)
|
||||
static void window_options_draw_tab_image(rct_drawpixelinfo *dpi, rct_window *w, int32_t page, int32_t spriteIndex)
|
||||
{
|
||||
rct_widgetindex widgetIndex = WIDX_TAB_1 + page;
|
||||
rct_widget *widget = &w->widgets[widgetIndex];
|
||||
|
||||
sint16 l = w->x + widget->left;
|
||||
sint16 t = w->y + widget->top;
|
||||
int16_t l = w->x + widget->left;
|
||||
int16_t t = w->y + widget->top;
|
||||
|
||||
if (!(w->disabled_widgets & (1LL << widgetIndex))) {
|
||||
if (w->page == page) {
|
||||
sint32 frame = w->frame_no / window_options_tab_animation_divisor[w->page];
|
||||
int32_t frame = w->frame_no / window_options_tab_animation_divisor[w->page];
|
||||
spriteIndex += (frame % window_options_tab_animation_frames[w->page]);
|
||||
}
|
||||
|
||||
|
@ -2061,7 +2061,7 @@ static void window_options_draw_tab_image(rct_drawpixelinfo *dpi, rct_window *w,
|
|||
gfx_draw_sprite(dpi, spriteIndex, l, t, 0);
|
||||
} else {
|
||||
// Get the window background colour
|
||||
uint8 window_colour = NOT_TRANSLUCENT(w->colours[widget->colour]);
|
||||
uint8_t window_colour = NOT_TRANSLUCENT(w->colours[widget->colour]);
|
||||
|
||||
// Draw greyed out (light border bottom right shadow)
|
||||
gfx_draw_sprite_solid(dpi, spriteIndex, l + 1, t + 1, ColourMapA[window_colour].lighter);
|
||||
|
|
|
@ -150,7 +150,7 @@ static void window_park_entrance_close(rct_window *w);
|
|||
static void window_park_entrance_mouseup(rct_window *w, rct_widgetindex widgetIndex);
|
||||
static void window_park_entrance_resize(rct_window *w);
|
||||
static void window_park_entrance_mousedown(rct_window *w, rct_widgetindex widgetIndex, rct_widget* widget);
|
||||
static void window_park_entrance_dropdown(rct_window *w, rct_widgetindex widgetIndex, sint32 dropdownIndex);
|
||||
static void window_park_entrance_dropdown(rct_window *w, rct_widgetindex widgetIndex, int32_t dropdownIndex);
|
||||
static void window_park_entrance_update(rct_window *w);
|
||||
static void window_park_entrance_textinput(rct_window *w, rct_widgetindex widgetIndex, char *text);
|
||||
static void window_park_entrance_invalidate(rct_window *w);
|
||||
|
@ -425,7 +425,7 @@ static rct_window_event_list *window_park_page_events[] = {
|
|||
|
||||
#pragma region Enabled widgets
|
||||
|
||||
static uint32 window_park_page_enabled_widgets[] = {
|
||||
static uint32_t window_park_page_enabled_widgets[] = {
|
||||
(1 << WIDX_CLOSE) |
|
||||
(1 << WIDX_TAB_1) |
|
||||
(1 << WIDX_TAB_2) |
|
||||
|
@ -499,7 +499,7 @@ static uint32 window_park_page_enabled_widgets[] = {
|
|||
(1 << WIDX_TAB_7)
|
||||
};
|
||||
|
||||
static uint32 window_park_page_hold_down_widgets[] = {
|
||||
static uint32_t window_park_page_hold_down_widgets[] = {
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
|
@ -516,7 +516,7 @@ static uint32 window_park_page_hold_down_widgets[] = {
|
|||
|
||||
struct window_park_award {
|
||||
rct_string_id text;
|
||||
uint32 sprite;
|
||||
uint32_t sprite;
|
||||
};
|
||||
|
||||
static constexpr const window_park_award ParkAwards[] = {
|
||||
|
@ -541,7 +541,7 @@ static constexpr const window_park_award ParkAwards[] = {
|
|||
// clang-format on
|
||||
|
||||
static void window_park_init_viewport(rct_window *w);
|
||||
static void window_park_set_page(rct_window *w, sint32 page);
|
||||
static void window_park_set_page(rct_window *w, int32_t page);
|
||||
static void window_park_anchor_border_widgets(rct_window *w);
|
||||
static void window_park_set_pressed_tab(rct_window *w);
|
||||
static void window_park_draw_tab_images(rct_drawpixelinfo *dpi, rct_window *w);
|
||||
|
@ -562,7 +562,7 @@ static rct_window *window_park_open()
|
|||
w->page = WINDOW_PARK_PAGE_ENTRANCE;
|
||||
w->viewport_focus_coordinates.y = 0;
|
||||
w->frame_no = 0;
|
||||
w->list_information_type = std::numeric_limits<uint16>::max();
|
||||
w->list_information_type = std::numeric_limits<uint16_t>::max();
|
||||
w->numberOfStaff = -1;
|
||||
w->var_492 = 0;
|
||||
window_park_set_disabled_tabs(w);
|
||||
|
@ -583,7 +583,7 @@ static void window_park_set_disabled_tabs(rct_window *w)
|
|||
static void window_park_prepare_window_title_text()
|
||||
{
|
||||
set_format_arg(0, rct_string_id, gParkName);
|
||||
set_format_arg(2, uint32, gParkNameArgs);
|
||||
set_format_arg(2, uint32_t, gParkNameArgs);
|
||||
}
|
||||
|
||||
#pragma region Entrance page
|
||||
|
@ -652,7 +652,7 @@ static void window_park_entrance_mouseup(rct_window *w, rct_widgetindex widgetIn
|
|||
window_scroll_to_viewport(w);
|
||||
break;
|
||||
case WIDX_RENAME:
|
||||
set_format_arg(16, uint32, gParkNameArgs);
|
||||
set_format_arg(16, uint32_t, gParkNameArgs);
|
||||
window_text_input_open(w, WIDX_RENAME, STR_PARK_NAME, STR_ENTER_PARK_NAME, gParkName, 0, USER_STRING_MAX_LENGTH);
|
||||
break;
|
||||
case WIDX_CLOSE_LIGHT:
|
||||
|
@ -709,7 +709,7 @@ static void window_park_entrance_mousedown(rct_window *w, rct_widgetindex widget
|
|||
*
|
||||
* rct2: 0x006682B8
|
||||
*/
|
||||
static void window_park_entrance_dropdown(rct_window *w, rct_widgetindex widgetIndex, sint32 dropdownIndex)
|
||||
static void window_park_entrance_dropdown(rct_window *w, rct_widgetindex widgetIndex, int32_t dropdownIndex)
|
||||
{
|
||||
if (widgetIndex == WIDX_OPEN_OR_CLOSE) {
|
||||
if (dropdownIndex == -1)
|
||||
|
@ -754,7 +754,7 @@ static void window_park_entrance_textinput(rct_window *w, rct_widgetindex widget
|
|||
*/
|
||||
static void window_park_entrance_invalidate(rct_window *w)
|
||||
{
|
||||
sint32 i, height;
|
||||
int32_t i, height;
|
||||
|
||||
w->widgets = window_park_page_widgets[w->page];
|
||||
window_init_scroll_widgets(w);
|
||||
|
@ -763,7 +763,7 @@ static void window_park_entrance_invalidate(rct_window *w)
|
|||
|
||||
// Set open / close park button state
|
||||
set_format_arg(0, rct_string_id, gParkName);
|
||||
set_format_arg(2, uint32, gParkNameArgs);
|
||||
set_format_arg(2, uint32_t, gParkNameArgs);
|
||||
window_park_entrance_widgets[WIDX_OPEN_OR_CLOSE].image = park_is_open() ? SPR_OPEN : SPR_CLOSED;
|
||||
window_park_entrance_widgets[WIDX_CLOSE_LIGHT].image = SPR_G2_RCT1_CLOSE_BUTTON_0 + !park_is_open() * 2 + widget_is_pressed(w, WIDX_CLOSE_LIGHT);
|
||||
window_park_entrance_widgets[WIDX_OPEN_LIGHT].image = SPR_G2_RCT1_OPEN_BUTTON_0 + park_is_open() * 2 + widget_is_pressed(w, WIDX_OPEN_LIGHT);
|
||||
|
@ -864,7 +864,7 @@ static void window_park_entrance_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
|||
*/
|
||||
static void window_park_init_viewport(rct_window *w)
|
||||
{
|
||||
sint32 i, x, y, z, r, xy, zr, viewportFlags;
|
||||
int32_t i, x, y, z, r, xy, zr, viewportFlags;
|
||||
x = y = z = r = xy = zr = 0;
|
||||
rct_viewport *viewport;
|
||||
|
||||
|
@ -887,7 +887,7 @@ static void window_park_init_viewport(rct_window *w)
|
|||
if (w->viewport == nullptr) {
|
||||
viewportFlags = gConfigGeneral.always_show_gridlines ? VIEWPORT_FLAG_GRIDLINES : 0;
|
||||
} else {
|
||||
// if (w->var_482 == x && w->var_484 == y && w->var_486 == z && (uint16)w->var_488 >> 8 == r)
|
||||
// if (w->var_482 == x && w->var_484 == y && w->var_486 == z && (uint16_t)w->var_488 >> 8 == r)
|
||||
// return;
|
||||
|
||||
viewport = w->viewport;
|
||||
|
@ -1025,7 +1025,7 @@ static void window_park_rating_invalidate(rct_window *w)
|
|||
*/
|
||||
static void window_park_rating_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
||||
{
|
||||
sint32 x, y;
|
||||
int32_t x, y;
|
||||
rct_widget *widget;
|
||||
|
||||
window_draw_widgets(w, dpi);
|
||||
|
@ -1045,7 +1045,7 @@ static void window_park_rating_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
|||
x += widget->left + 22;
|
||||
y += widget->top + 26;
|
||||
|
||||
graph_draw_uint8(dpi, gParkRatingHistory, 32, x, y);
|
||||
graph_draw_uint8_t(dpi, gParkRatingHistory, 32, x, y);
|
||||
}
|
||||
|
||||
#pragma endregion
|
||||
|
@ -1142,7 +1142,7 @@ static void window_park_guests_invalidate(rct_window *w)
|
|||
*/
|
||||
static void window_park_guests_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
||||
{
|
||||
sint32 x, y;
|
||||
int32_t x, y;
|
||||
rct_widget *widget;
|
||||
|
||||
window_draw_widgets(w, dpi);
|
||||
|
@ -1162,7 +1162,7 @@ static void window_park_guests_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
|||
x += widget->left + 22;
|
||||
y += widget->top + 26;
|
||||
|
||||
graph_draw_uint8(dpi, gGuestsInParkHistory, 32, x, y);
|
||||
graph_draw_uint8_t(dpi, gGuestsInParkHistory, 32, x, y);
|
||||
}
|
||||
|
||||
#pragma endregion
|
||||
|
@ -1196,7 +1196,7 @@ static void window_park_price_resize(rct_window *w)
|
|||
*/
|
||||
static void window_park_price_mousedown(rct_window *w, rct_widgetindex widgetIndex, rct_widget* widget)
|
||||
{
|
||||
sint32 newFee;
|
||||
int32_t newFee;
|
||||
|
||||
switch (widgetIndex) {
|
||||
case WIDX_CLOSE:
|
||||
|
@ -1265,7 +1265,7 @@ static void window_park_price_invalidate(rct_window *w)
|
|||
}
|
||||
|
||||
money16 parkEntranceFee = park_get_entrance_fee();
|
||||
set_format_arg(6, uint32, parkEntranceFee);
|
||||
set_format_arg(6, uint32_t, parkEntranceFee);
|
||||
window_park_price_widgets[WIDX_PRICE].text = parkEntranceFee == 0 ? STR_FREE : STR_ARG_6_CURRENCY2DP;
|
||||
|
||||
window_align_tabs(w, WIDX_TAB_1, WIDX_TAB_7);
|
||||
|
@ -1278,7 +1278,7 @@ static void window_park_price_invalidate(rct_window *w)
|
|||
*/
|
||||
static void window_park_price_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
||||
{
|
||||
sint32 x, y;
|
||||
int32_t x, y;
|
||||
|
||||
window_draw_widgets(w, dpi);
|
||||
window_park_draw_tab_images(dpi, w);
|
||||
|
@ -1320,7 +1320,7 @@ static void window_park_stats_resize(rct_window *w)
|
|||
*/
|
||||
static void window_park_stats_update(rct_window *w)
|
||||
{
|
||||
sint32 i;
|
||||
int32_t i;
|
||||
|
||||
w->frame_no++;
|
||||
widget_invalidate(w, WIDX_TAB_5);
|
||||
|
@ -1367,7 +1367,7 @@ static void window_park_stats_invalidate(rct_window *w)
|
|||
*/
|
||||
static void window_park_stats_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
||||
{
|
||||
sint32 x, y, parkSize, stringIndex;
|
||||
int32_t x, y, parkSize, stringIndex;
|
||||
|
||||
window_draw_widgets(w, dpi);
|
||||
window_park_draw_tab_images(dpi, w);
|
||||
|
@ -1382,20 +1382,20 @@ static void window_park_stats_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
|||
stringIndex = STR_PARK_SIZE_IMPERIAL_LABEL;
|
||||
parkSize = squaredmetres_to_squaredfeet(parkSize);
|
||||
}
|
||||
set_format_arg(0, uint32, parkSize);
|
||||
set_format_arg(0, uint32_t, parkSize);
|
||||
gfx_draw_string_left(dpi, stringIndex, gCommonFormatArgs, COLOUR_BLACK, x, y);
|
||||
y += LIST_ROW_HEIGHT;
|
||||
|
||||
// Draw number of rides / attractions
|
||||
if (w->list_information_type != (uint16)-1) {
|
||||
set_format_arg(0, uint32, w->list_information_type);
|
||||
if (w->list_information_type != (uint16_t)-1) {
|
||||
set_format_arg(0, uint32_t, w->list_information_type);
|
||||
gfx_draw_string_left(dpi, STR_NUMBER_OF_RIDES_LABEL, gCommonFormatArgs, COLOUR_BLACK, x, y);
|
||||
}
|
||||
y += LIST_ROW_HEIGHT;
|
||||
|
||||
// Draw number of staff
|
||||
if (w->numberOfStaff != -1) {
|
||||
set_format_arg(0, uint32, w->numberOfStaff);
|
||||
set_format_arg(0, uint32_t, w->numberOfStaff);
|
||||
gfx_draw_string_left(dpi, STR_STAFF_LABEL, gCommonFormatArgs, COLOUR_BLACK, x, y);
|
||||
}
|
||||
y += LIST_ROW_HEIGHT;
|
||||
|
@ -1533,7 +1533,7 @@ static void window_park_objective_invalidate(rct_window *w)
|
|||
*/
|
||||
static void window_park_objective_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
||||
{
|
||||
sint32 x, y;
|
||||
int32_t x, y;
|
||||
|
||||
window_draw_widgets(w, dpi);
|
||||
window_park_draw_tab_images(dpi, w);
|
||||
|
@ -1551,8 +1551,8 @@ static void window_park_objective_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
|||
y += LIST_ROW_HEIGHT;
|
||||
|
||||
// Objective
|
||||
set_format_arg(0, uint16, gScenarioObjectiveNumGuests);
|
||||
set_format_arg(2, sint16, date_get_total_months(MONTH_OCTOBER, gScenarioObjectiveYear));
|
||||
set_format_arg(0, uint16_t, gScenarioObjectiveNumGuests);
|
||||
set_format_arg(2, int16_t, date_get_total_months(MONTH_OCTOBER, gScenarioObjectiveYear));
|
||||
set_format_arg(4, money32, gScenarioObjectiveCurrency);
|
||||
|
||||
y += gfx_draw_string_left_wrapped(dpi, gCommonFormatArgs, x, y, 221, ObjectiveNames[gScenarioObjectiveType], COLOUR_BLACK);
|
||||
|
@ -1560,7 +1560,7 @@ static void window_park_objective_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
|||
|
||||
// Objective outcome
|
||||
if (gScenarioCompletedCompanyValue != MONEY32_UNDEFINED) {
|
||||
if ((uint32)gScenarioCompletedCompanyValue == 0x80000001) {
|
||||
if ((uint32_t)gScenarioCompletedCompanyValue == 0x80000001) {
|
||||
// Objective failed
|
||||
gfx_draw_string_left_wrapped(dpi, nullptr, x, y, 222, STR_OBJECTIVE_FAILED, COLOUR_BLACK);
|
||||
} else {
|
||||
|
@ -1667,10 +1667,10 @@ static void window_park_awards_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
|||
window_draw_widgets(w, dpi);
|
||||
window_park_draw_tab_images(dpi, w);
|
||||
|
||||
sint32 x = w->x + window_park_awards_widgets[WIDX_PAGE_BACKGROUND].left + 4;
|
||||
sint32 y = w->y + window_park_awards_widgets[WIDX_PAGE_BACKGROUND].top + 4;
|
||||
sint32 count = 0;
|
||||
for (sint32 i = 0; i < MAX_AWARDS; i++) {
|
||||
int32_t x = w->x + window_park_awards_widgets[WIDX_PAGE_BACKGROUND].left + 4;
|
||||
int32_t y = w->y + window_park_awards_widgets[WIDX_PAGE_BACKGROUND].top + 4;
|
||||
int32_t count = 0;
|
||||
for (int32_t i = 0; i < MAX_AWARDS; i++) {
|
||||
Award *award = &gCurrentAwards[i];
|
||||
if (award->Time == 0)
|
||||
continue;
|
||||
|
@ -1694,9 +1694,9 @@ static void window_park_awards_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
|||
*
|
||||
* rct2: 0x00668496
|
||||
*/
|
||||
static void window_park_set_page(rct_window *w, sint32 page)
|
||||
static void window_park_set_page(rct_window *w, int32_t page)
|
||||
{
|
||||
sint32 listen;
|
||||
int32_t listen;
|
||||
|
||||
if (input_test_flag(INPUT_FLAG_TOOL_ACTIVE))
|
||||
if (w->classification == gCurrentToolWidget.window_classification && w->number == gCurrentToolWidget.window_number)
|
||||
|
@ -1742,7 +1742,7 @@ static void window_park_anchor_border_widgets(rct_window *w)
|
|||
|
||||
static void window_park_set_pressed_tab(rct_window *w)
|
||||
{
|
||||
sint32 i;
|
||||
int32_t i;
|
||||
for (i = 0; i < 7; i++)
|
||||
w->pressed_widgets &= ~(1 << (WIDX_TAB_1 + i));
|
||||
w->pressed_widgets |= 1LL << (WIDX_TAB_1 + w->page);
|
||||
|
@ -1750,7 +1750,7 @@ static void window_park_set_pressed_tab(rct_window *w)
|
|||
|
||||
static void window_park_draw_tab_images(rct_drawpixelinfo *dpi, rct_window *w)
|
||||
{
|
||||
sint32 sprite_idx;
|
||||
int32_t sprite_idx;
|
||||
|
||||
// Entrance tab
|
||||
if (!(w->disabled_widgets & (1 << WIDX_TAB_1)))
|
||||
|
|
|
@ -81,7 +81,7 @@ static void window_player_overview_close(rct_window *w);
|
|||
static void window_player_overview_mouse_up(rct_window *w, rct_widgetindex widgetIndex);
|
||||
static void window_player_overview_resize(rct_window *w);
|
||||
static void window_player_overview_mouse_down(rct_window *w, rct_widgetindex widgetIndex, rct_widget *widget);
|
||||
static void window_player_overview_dropdown(rct_window *w, rct_widgetindex widgetIndex, sint32 dropdownIndex);
|
||||
static void window_player_overview_dropdown(rct_window *w, rct_widgetindex widgetIndex, int32_t dropdownIndex);
|
||||
static void window_player_overview_update(rct_window* w);
|
||||
static void window_player_overview_invalidate(rct_window *w);
|
||||
static void window_player_overview_paint(rct_window *w, rct_drawpixelinfo *dpi);
|
||||
|
@ -162,12 +162,12 @@ static rct_window_event_list *window_player_page_events[] = {
|
|||
|
||||
#pragma endregion
|
||||
|
||||
static void window_player_set_page(rct_window* w, sint32 page);
|
||||
static void window_player_set_page(rct_window* w, int32_t page);
|
||||
static void window_player_draw_tab_images(rct_drawpixelinfo *dpi, rct_window *w);
|
||||
static void window_player_update_viewport(rct_window *w, bool scroll);
|
||||
static void window_player_update_title(rct_window* w);
|
||||
|
||||
static uint32 window_player_page_enabled_widgets[] = {
|
||||
static uint32_t window_player_page_enabled_widgets[] = {
|
||||
(1 << WIDX_CLOSE) |
|
||||
(1 << WIDX_TAB_1) |
|
||||
(1 << WIDX_TAB_2) |
|
||||
|
@ -182,7 +182,7 @@ static uint32 window_player_page_enabled_widgets[] = {
|
|||
};
|
||||
// clang-format on
|
||||
|
||||
rct_window * window_player_open(uint8 id)
|
||||
rct_window * window_player_open(uint8_t id)
|
||||
{
|
||||
rct_window* window;
|
||||
|
||||
|
@ -224,8 +224,8 @@ rct_window * window_player_open(uint8 id)
|
|||
static void window_player_overview_show_group_dropdown(rct_window *w, rct_widget *widget)
|
||||
{
|
||||
rct_widget *dropdownWidget;
|
||||
sint32 numItems, i;
|
||||
sint32 player = network_get_player_index((uint8)w->number);
|
||||
int32_t numItems, i;
|
||||
int32_t player = network_get_player_index((uint8_t)w->number);
|
||||
if (player == -1) {
|
||||
return;
|
||||
}
|
||||
|
@ -271,7 +271,7 @@ void window_player_overview_mouse_up(rct_window *w, rct_widgetindex widgetIndex)
|
|||
case WIDX_LOCATE:{
|
||||
rct_window* mainWindow = window_get_main();
|
||||
if (mainWindow != nullptr) {
|
||||
sint32 player = network_get_player_index((uint8)w->number);
|
||||
int32_t player = network_get_player_index((uint8_t)w->number);
|
||||
if (player == -1) {
|
||||
return;
|
||||
}
|
||||
|
@ -296,16 +296,16 @@ void window_player_overview_mouse_down(rct_window *w, rct_widgetindex widgetInde
|
|||
}
|
||||
}
|
||||
|
||||
void window_player_overview_dropdown(rct_window *w, rct_widgetindex widgetIndex, sint32 dropdownIndex)
|
||||
void window_player_overview_dropdown(rct_window *w, rct_widgetindex widgetIndex, int32_t dropdownIndex)
|
||||
{
|
||||
sint32 player = network_get_player_index((uint8)w->number);
|
||||
int32_t player = network_get_player_index((uint8_t)w->number);
|
||||
if (player == -1) {
|
||||
return;
|
||||
}
|
||||
if (dropdownIndex == -1) {
|
||||
return;
|
||||
}
|
||||
sint32 group = network_get_group_id(dropdownIndex);
|
||||
int32_t group = network_get_group_id(dropdownIndex);
|
||||
game_do_command(0, GAME_COMMAND_FLAG_APPLY, w->number, group, GAME_COMMAND_SET_PLAYER_GROUP, 0, 0);
|
||||
window_invalidate(w);
|
||||
}
|
||||
|
@ -320,7 +320,7 @@ void window_player_overview_update(rct_window* w)
|
|||
w->frame_no++;
|
||||
widget_invalidate(w, WIDX_TAB_1 + w->page);
|
||||
|
||||
if (network_get_player_index((uint8)w->number) == -1) {
|
||||
if (network_get_player_index((uint8_t)w->number) == -1) {
|
||||
window_close(w);
|
||||
return;
|
||||
}
|
||||
|
@ -341,13 +341,13 @@ void window_player_overview_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
|||
window_draw_widgets(w, dpi);
|
||||
window_player_draw_tab_images(dpi, w);
|
||||
|
||||
sint32 player = network_get_player_index((uint8)w->number);
|
||||
int32_t player = network_get_player_index((uint8_t)w->number);
|
||||
if (player == -1) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Draw current group
|
||||
sint32 groupindex = network_get_group_index(network_get_player_group(player));
|
||||
int32_t groupindex = network_get_group_index(network_get_player_group(player));
|
||||
if (groupindex != -1) {
|
||||
rct_widget* widget = &window_player_overview_widgets[WIDX_GROUP];
|
||||
char buffer[300];
|
||||
|
@ -369,8 +369,8 @@ void window_player_overview_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
|||
}
|
||||
|
||||
// Draw ping
|
||||
sint32 x = w->x + 90;
|
||||
sint32 y = w->y + 24;
|
||||
int32_t x = w->x + 90;
|
||||
int32_t y = w->y + 24;
|
||||
|
||||
set_format_arg(0, rct_string_id, STR_PING);
|
||||
gfx_draw_string_left(dpi, STR_WINDOW_COLOUR_2_STRINGID, gCommonFormatArgs, 0, x, y);
|
||||
|
@ -381,8 +381,8 @@ void window_player_overview_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
|||
// Draw last action
|
||||
x = w->x + (w->width / 2);
|
||||
y = w->y + w->height - 13;
|
||||
sint32 width = w->width - 8;
|
||||
sint32 lastaction = network_get_player_last_action(player, 0);
|
||||
int32_t width = w->width - 8;
|
||||
int32_t lastaction = network_get_player_last_action(player, 0);
|
||||
set_format_arg(0, rct_string_id, STR_ACTION_NA);
|
||||
if (lastaction != -999) {
|
||||
set_format_arg(0, rct_string_id, network_get_action_name_string_id(lastaction));
|
||||
|
@ -421,7 +421,7 @@ void window_player_overview_invalidate(rct_window *w)
|
|||
w->widgets[WIDX_VIEWPORT].right = w->width - 26;
|
||||
w->widgets[WIDX_VIEWPORT].bottom = w->height - 14;
|
||||
|
||||
sint32 groupDropdownWidth = w->widgets[WIDX_GROUP].right - w->widgets[WIDX_GROUP].left;
|
||||
int32_t groupDropdownWidth = w->widgets[WIDX_GROUP].right - w->widgets[WIDX_GROUP].left;
|
||||
w->widgets[WIDX_GROUP].left = (w->width - groupDropdownWidth) / 2;
|
||||
w->widgets[WIDX_GROUP].right = w->widgets[WIDX_GROUP].left + groupDropdownWidth;
|
||||
w->widgets[WIDX_GROUP_DROPDOWN].left = w->widgets[WIDX_GROUP].right - 10;
|
||||
|
@ -473,7 +473,7 @@ void window_player_statistics_update(rct_window* w)
|
|||
w->frame_no++;
|
||||
widget_invalidate(w, WIDX_TAB_1 + w->page);
|
||||
|
||||
if (network_get_player_index((uint8)w->number) == -1) {
|
||||
if (network_get_player_index((uint8_t)w->number) == -1) {
|
||||
window_close(w);
|
||||
}
|
||||
}
|
||||
|
@ -507,26 +507,26 @@ void window_player_statistics_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
|||
window_draw_widgets(w, dpi);
|
||||
window_player_draw_tab_images(dpi, w);
|
||||
|
||||
sint32 player = network_get_player_index((uint8)w->number);
|
||||
int32_t player = network_get_player_index((uint8_t)w->number);
|
||||
if (player == -1) {
|
||||
return;
|
||||
}
|
||||
|
||||
sint32 x = w->x + window_player_overview_widgets[WIDX_PAGE_BACKGROUND].left + 4;
|
||||
sint32 y = w->y + window_player_overview_widgets[WIDX_PAGE_BACKGROUND].top + 4;
|
||||
int32_t x = w->x + window_player_overview_widgets[WIDX_PAGE_BACKGROUND].left + 4;
|
||||
int32_t y = w->y + window_player_overview_widgets[WIDX_PAGE_BACKGROUND].top + 4;
|
||||
|
||||
set_format_arg(0, uint32, network_get_player_commands_ran(player));
|
||||
set_format_arg(0, uint32_t, network_get_player_commands_ran(player));
|
||||
gfx_draw_string_left(dpi, STR_COMMANDS_RAN, gCommonFormatArgs, COLOUR_BLACK, x, y);
|
||||
|
||||
y += LIST_ROW_HEIGHT;
|
||||
|
||||
set_format_arg(0, uint32, network_get_player_money_spent(player));
|
||||
set_format_arg(0, uint32_t, network_get_player_money_spent(player));
|
||||
gfx_draw_string_left(dpi, STR_MONEY_SPENT, gCommonFormatArgs, COLOUR_BLACK, x, y);
|
||||
}
|
||||
|
||||
static void window_player_set_page(rct_window* w, sint32 page)
|
||||
static void window_player_set_page(rct_window* w, int32_t page)
|
||||
{
|
||||
sint32 originalPage = w->page;
|
||||
int32_t originalPage = w->page;
|
||||
|
||||
w->page = page;
|
||||
w->frame_no = 0;
|
||||
|
@ -565,7 +565,7 @@ static void window_player_set_page(rct_window* w, sint32 page)
|
|||
static void window_player_draw_tab_images(rct_drawpixelinfo *dpi, rct_window *w)
|
||||
{
|
||||
rct_widget *widget;
|
||||
sint32 x, y, imageId;
|
||||
int32_t x, y, imageId;
|
||||
|
||||
// Tab 1
|
||||
if (!widget_is_disabled(w, WIDX_TAB_1)) {
|
||||
|
@ -593,7 +593,7 @@ static void window_player_draw_tab_images(rct_drawpixelinfo *dpi, rct_window *w)
|
|||
|
||||
static void window_player_update_viewport(rct_window *w, bool scroll)
|
||||
{
|
||||
sint32 playerIndex = network_get_player_index((uint8)w->number);
|
||||
int32_t playerIndex = network_get_player_index((uint8_t)w->number);
|
||||
if (playerIndex == -1) {
|
||||
return;
|
||||
}
|
||||
|
@ -602,7 +602,7 @@ static void window_player_update_viewport(rct_window *w, bool scroll)
|
|||
if (viewport != nullptr) {
|
||||
LocationXYZ16 coord = network_get_player_last_action_coord(playerIndex);
|
||||
if (coord.x != 0 || coord.y != 0 || coord.z != 0) {
|
||||
sint32 viewX, viewY;
|
||||
int32_t viewX, viewY;
|
||||
centre_2d_coordinates(coord.x, coord.y, coord.z, &viewX, &viewY, viewport);
|
||||
|
||||
// Don't scroll if the view was originally undefined
|
||||
|
@ -632,7 +632,7 @@ static void window_player_update_viewport(rct_window *w, bool scroll)
|
|||
|
||||
static void window_player_update_title(rct_window* w)
|
||||
{
|
||||
sint32 player = network_get_player_index((uint8)w->number);
|
||||
int32_t player = network_get_player_index((uint8_t)w->number);
|
||||
if (player != -1) {
|
||||
set_format_arg(0, const char *, network_get_player_name(player)); // set title caption to player name
|
||||
} else {
|
||||
|
|
|
@ -105,7 +105,7 @@ static void window_research_development_paint(rct_window *w, rct_drawpixelinfo *
|
|||
|
||||
static void window_research_funding_mouseup(rct_window *w, rct_widgetindex widgetIndex);
|
||||
static void window_research_funding_mousedown(rct_window *w, rct_widgetindex widgetIndex, rct_widget* widget);
|
||||
static void window_research_funding_dropdown(rct_window *w, rct_widgetindex widgetIndex, sint32 dropdownIndex);
|
||||
static void window_research_funding_dropdown(rct_window *w, rct_widgetindex widgetIndex, int32_t dropdownIndex);
|
||||
static void window_research_funding_update(rct_window *w);
|
||||
static void window_research_funding_invalidate(rct_window *w);
|
||||
static void window_research_funding_paint(rct_window *w, rct_drawpixelinfo *dpi);
|
||||
|
@ -183,7 +183,7 @@ static rct_window_event_list *window_research_page_events[] = {
|
|||
|
||||
#pragma region Enabled widgets
|
||||
|
||||
static uint32 window_research_page_enabled_widgets[] = {
|
||||
static uint32_t window_research_page_enabled_widgets[] = {
|
||||
(1 << WIDX_CLOSE) |
|
||||
(1 << WIDX_TAB_1) |
|
||||
(1 << WIDX_TAB_2) |
|
||||
|
@ -205,7 +205,7 @@ static uint32 window_research_page_enabled_widgets[] = {
|
|||
|
||||
#pragma endregion
|
||||
|
||||
const sint32 window_research_tab_animation_loops[] = { 16, 16 };
|
||||
const int32_t window_research_tab_animation_loops[] = { 16, 16 };
|
||||
|
||||
static constexpr const rct_string_id ResearchCategoryNames[] = {
|
||||
STR_RESEARCH_CATEGORY_TRANSPORT,
|
||||
|
@ -225,7 +225,7 @@ static constexpr const rct_string_id ResearchStageNames[] = {
|
|||
};
|
||||
// clang-format on
|
||||
|
||||
static void window_research_set_page(rct_window *w, sint32 page);
|
||||
static void window_research_set_page(rct_window *w, int32_t page);
|
||||
static void window_research_set_pressed_tab(rct_window *w);
|
||||
static void window_research_draw_tab_images(rct_drawpixelinfo *dpi, rct_window *w);
|
||||
|
||||
|
@ -312,7 +312,7 @@ static void window_research_development_invalidate(rct_window *w)
|
|||
window_research_development_widgets[WIDX_LAST_DEVELOPMENT_BUTTON].type = WWT_EMPTY;
|
||||
if (gResearchLastItem.rawValue != RESEARCHED_ITEMS_SEPARATOR)
|
||||
{
|
||||
uint8 type = gResearchLastItem.type;
|
||||
uint8_t type = gResearchLastItem.type;
|
||||
window_research_development_widgets[WIDX_LAST_DEVELOPMENT_BUTTON].type = WWT_FLATBTN;
|
||||
window_research_development_widgets[WIDX_LAST_DEVELOPMENT_BUTTON].image = type == RESEARCH_ENTRY_TYPE_RIDE? SPR_NEW_RIDE : SPR_NEW_SCENERY;
|
||||
}
|
||||
|
@ -334,8 +334,8 @@ void window_research_development_page_paint(rct_window *w, rct_drawpixelinfo *dp
|
|||
{
|
||||
baseWidgetIndex = baseWidgetIndex - WIDX_CURRENTLY_IN_DEVELOPMENT_GROUP;
|
||||
|
||||
sint32 x = w->x + 10;
|
||||
sint32 y = w->y + w->widgets[WIDX_CURRENTLY_IN_DEVELOPMENT_GROUP + baseWidgetIndex].top + 12;
|
||||
int32_t x = w->x + 10;
|
||||
int32_t y = w->y + w->widgets[WIDX_CURRENTLY_IN_DEVELOPMENT_GROUP + baseWidgetIndex].top + 12;
|
||||
rct_string_id stringId;
|
||||
|
||||
if (gResearchProgressStage == RESEARCH_STAGE_FINISHED_ALL) {
|
||||
|
@ -372,7 +372,7 @@ void window_research_development_page_paint(rct_window *w, rct_drawpixelinfo *dp
|
|||
// Expected
|
||||
set_format_arg(0, rct_string_id, STR_RESEARCH_STAGE_UNKNOWN);
|
||||
if (gResearchProgressStage != RESEARCH_STAGE_INITIAL_RESEARCH) {
|
||||
uint16 expectedDay = gResearchExpectedDay;
|
||||
uint16_t expectedDay = gResearchExpectedDay;
|
||||
if (expectedDay != 255) {
|
||||
// TODO: Should probably use game date format setting
|
||||
set_format_arg(0, rct_string_id, STR_RESEARCH_EXPECTED_FORMAT);
|
||||
|
@ -391,7 +391,7 @@ void window_research_development_page_paint(rct_window *w, rct_drawpixelinfo *dp
|
|||
if (gResearchLastItem.rawValue != RESEARCHED_ITEMS_SEPARATOR)
|
||||
{
|
||||
stringId = research_item_get_name(&gResearchLastItem);
|
||||
uint8 type = gResearchLastItem.type;
|
||||
uint8_t type = gResearchLastItem.type;
|
||||
lastDevelopmentFormat = (type == RESEARCH_ENTRY_TYPE_RIDE) ? STR_RESEARCH_RIDE_LABEL : STR_RESEARCH_SCENERY_LABEL;
|
||||
|
||||
gfx_draw_string_left_wrapped(dpi, &stringId, x, y, 266, lastDevelopmentFormat, COLOUR_BLACK);
|
||||
|
@ -440,7 +440,7 @@ static void window_research_funding_mouseup(rct_window *w, rct_widgetindex widge
|
|||
static void window_research_funding_mousedown(rct_window *w, rct_widgetindex widgetIndex, rct_widget* widget)
|
||||
{
|
||||
rct_widget *dropdownWidget;
|
||||
sint32 i;
|
||||
int32_t i;
|
||||
|
||||
if (widgetIndex != WIDX_RESEARCH_FUNDING_DROPDOWN_BUTTON)
|
||||
return;
|
||||
|
@ -462,7 +462,7 @@ static void window_research_funding_mousedown(rct_window *w, rct_widgetindex wid
|
|||
dropdownWidget->right - dropdownWidget->left - 3
|
||||
);
|
||||
|
||||
sint32 currentResearchLevel = gResearchFundingLevel;
|
||||
int32_t currentResearchLevel = gResearchFundingLevel;
|
||||
dropdown_set_checked(currentResearchLevel, true);
|
||||
}
|
||||
|
||||
|
@ -470,7 +470,7 @@ static void window_research_funding_mousedown(rct_window *w, rct_widgetindex wid
|
|||
*
|
||||
* rct2: 0x0069DB6D
|
||||
*/
|
||||
static void window_research_funding_dropdown(rct_window *w, rct_widgetindex widgetIndex, sint32 dropdownIndex)
|
||||
static void window_research_funding_dropdown(rct_window *w, rct_widgetindex widgetIndex, int32_t dropdownIndex)
|
||||
{
|
||||
if (widgetIndex != WIDX_RESEARCH_FUNDING_DROPDOWN_BUTTON || dropdownIndex == -1)
|
||||
return;
|
||||
|
@ -514,15 +514,15 @@ static void window_research_funding_invalidate(rct_window *w)
|
|||
window_research_funding_widgets[WIDX_RESEARCH_FUNDING_DROPDOWN_BUTTON].type = WWT_BUTTON;
|
||||
|
||||
// Current funding
|
||||
sint32 currentResearchLevel = gResearchFundingLevel;
|
||||
int32_t currentResearchLevel = gResearchFundingLevel;
|
||||
window_research_funding_widgets[WIDX_RESEARCH_FUNDING].text = ResearchFundingLevelNames[currentResearchLevel];
|
||||
}
|
||||
|
||||
// Checkboxes
|
||||
uint8 activeResearchTypes = gResearchPriorities;
|
||||
for (sint32 i = 0; i < 7; i++) {
|
||||
sint32 mask = 1 << i;
|
||||
sint32 widgetMask = 1 << (i + WIDX_TRANSPORT_RIDES);
|
||||
uint8_t activeResearchTypes = gResearchPriorities;
|
||||
for (int32_t i = 0; i < 7; i++) {
|
||||
int32_t mask = 1 << i;
|
||||
int32_t widgetMask = 1 << (i + WIDX_TRANSPORT_RIDES);
|
||||
|
||||
// Set checkbox disabled if research type is complete
|
||||
if (gResearchUncompletedCategories & mask) {
|
||||
|
@ -557,7 +557,7 @@ void window_research_funding_page_paint(rct_window *w, rct_drawpixelinfo *dpi, r
|
|||
if (gParkFlags & PARK_FLAGS_NO_MONEY)
|
||||
return;
|
||||
|
||||
sint32 currentResearchLevel = gResearchFundingLevel;
|
||||
int32_t currentResearchLevel = gResearchFundingLevel;
|
||||
money32 currentResearchCostPerWeek = research_cost_table[currentResearchLevel];
|
||||
gfx_draw_string_left(dpi, STR_RESEARCH_COST_PER_MONTH, ¤tResearchCostPerWeek, COLOUR_BLACK, w->x + 10, w->y + 77);
|
||||
}
|
||||
|
@ -570,7 +570,7 @@ void window_research_funding_page_paint(rct_window *w, rct_drawpixelinfo *dpi, r
|
|||
*
|
||||
* rct2: 0x0069CAC5
|
||||
*/
|
||||
static void window_research_set_page(rct_window *w, sint32 page)
|
||||
static void window_research_set_page(rct_window *w, int32_t page)
|
||||
{
|
||||
w->page = page;
|
||||
w->frame_no = 0;
|
||||
|
@ -603,19 +603,19 @@ static void window_research_set_page(rct_window *w, sint32 page)
|
|||
|
||||
static void window_research_set_pressed_tab(rct_window *w)
|
||||
{
|
||||
sint32 i;
|
||||
int32_t i;
|
||||
for (i = 0; i < WINDOW_RESEARCH_PAGE_COUNT; i++)
|
||||
w->pressed_widgets &= ~(1 << (WIDX_TAB_1 + i));
|
||||
w->pressed_widgets |= 1LL << (WIDX_TAB_1 + w->page);
|
||||
}
|
||||
|
||||
static void window_research_draw_tab_image(rct_drawpixelinfo *dpi, rct_window *w, sint32 page, sint32 spriteIndex)
|
||||
static void window_research_draw_tab_image(rct_drawpixelinfo *dpi, rct_window *w, int32_t page, int32_t spriteIndex)
|
||||
{
|
||||
rct_widgetindex widgetIndex = WIDX_TAB_1 + page;
|
||||
|
||||
if (!(w->disabled_widgets & (1LL << widgetIndex))) {
|
||||
if (w->page == page) {
|
||||
sint32 frame = w->frame_no / 2;
|
||||
int32_t frame = w->frame_no / 2;
|
||||
if (page == WINDOW_RESEARCH_PAGE_DEVELOPMENT)
|
||||
frame %= 8;
|
||||
spriteIndex += frame;
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -132,10 +132,10 @@ static void window_ride_construction_close(rct_window *w);
|
|||
static void window_ride_construction_mouseup(rct_window *w, rct_widgetindex widgetIndex);
|
||||
static void window_ride_construction_resize(rct_window *w);
|
||||
static void window_ride_construction_mousedown(rct_window *w, rct_widgetindex widgetIndex, rct_widget *widget);
|
||||
static void window_ride_construction_dropdown(rct_window *w, rct_widgetindex widgetIndex, sint32 dropdownIndex);
|
||||
static void window_ride_construction_dropdown(rct_window *w, rct_widgetindex widgetIndex, int32_t dropdownIndex);
|
||||
static void window_ride_construction_update(rct_window *w);
|
||||
static void window_ride_construction_toolupdate(rct_window* w, rct_widgetindex widgetIndex, sint32 x, sint32 y);
|
||||
static void window_ride_construction_tooldown(rct_window* w, rct_widgetindex widgetIndex, sint32 x, sint32 y);
|
||||
static void window_ride_construction_toolupdate(rct_window* w, rct_widgetindex widgetIndex, int32_t x, int32_t y);
|
||||
static void window_ride_construction_tooldown(rct_window* w, rct_widgetindex widgetIndex, int32_t x, int32_t y);
|
||||
static void window_ride_construction_invalidate(rct_window *w);
|
||||
static void window_ride_construction_paint(rct_window *w, rct_drawpixelinfo *dpi);
|
||||
|
||||
|
@ -439,19 +439,19 @@ static constexpr const rct_string_id RideConfigurationStringIds[] = {
|
|||
#pragma endregion
|
||||
|
||||
static bool _trackPlaceCtrlState;
|
||||
static sint32 _trackPlaceCtrlZ;
|
||||
static int32_t _trackPlaceCtrlZ;
|
||||
static bool _trackPlaceShiftState;
|
||||
static sint32 _trackPlaceShiftStartScreenX;
|
||||
static sint32 _trackPlaceShiftStartScreenY;
|
||||
static sint32 _trackPlaceShiftZ;
|
||||
static sint32 _trackPlaceZ;
|
||||
static int32_t _trackPlaceShiftStartScreenX;
|
||||
static int32_t _trackPlaceShiftStartScreenY;
|
||||
static int32_t _trackPlaceShiftZ;
|
||||
static int32_t _trackPlaceZ;
|
||||
static money32 _trackPlaceCost;
|
||||
static bool _autoOpeningShop;
|
||||
static bool _autoRotatingShop;
|
||||
static uint8 _currentlyShowingBrakeOrBoosterSpeed;
|
||||
static uint8_t _currentlyShowingBrakeOrBoosterSpeed;
|
||||
static bool _boosterTrackSelected;
|
||||
|
||||
static uint32 _currentDisabledSpecialTrackPieces;
|
||||
static uint32_t _currentDisabledSpecialTrackPieces;
|
||||
|
||||
static void window_ride_construction_construct(rct_window *w);
|
||||
static void window_ride_construction_mouseup_demolish(rct_window* w);
|
||||
|
@ -461,25 +461,25 @@ static void window_ride_construction_exit_click(rct_window *w);
|
|||
|
||||
static void window_ride_construction_draw_track_piece(
|
||||
rct_window *w, rct_drawpixelinfo *dpi,
|
||||
sint32 rideIndex, sint32 trackType, sint32 trackDirection, sint32 unknown,
|
||||
sint32 width, sint32 height
|
||||
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,
|
||||
sint32 rideIndex, sint32 trackType, sint32 trackDirection, sint32 edx,
|
||||
sint32 originX, sint32 originY, sint32 originZ
|
||||
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);
|
||||
static void window_ride_construction_select_map_tiles(Ride *ride, sint32 trackType, sint32 trackDirection, sint32 x, sint32 y);
|
||||
static void window_ride_construction_select_map_tiles(Ride *ride, int32_t trackType, int32_t trackDirection, int32_t x, int32_t y);
|
||||
static void window_ride_construction_show_special_track_dropdown(rct_window *w, rct_widget *widget);
|
||||
static void ride_selected_track_set_seat_rotation(sint32 seatRotation);
|
||||
static void loc_6C7502(sint32 al);
|
||||
static void ride_construction_set_brakes_speed(sint32 brakesSpeed);
|
||||
static void ride_construction_tooldown_entrance_exit(sint32 screenX, sint32 screenY);
|
||||
static void ride_selected_track_set_seat_rotation(int32_t seatRotation);
|
||||
static void loc_6C7502(int32_t al);
|
||||
static void ride_construction_set_brakes_speed(int32_t brakesSpeed);
|
||||
static void ride_construction_tooldown_entrance_exit(int32_t screenX, int32_t screenY);
|
||||
|
||||
static uint8 _currentPossibleRideConfigurations[32];
|
||||
static uint8_t _currentPossibleRideConfigurations[32];
|
||||
|
||||
static constexpr const rct_string_id RideConstructionSeatAngleRotationStrings[] = {
|
||||
STR_RIDE_CONSTRUCTION_SEAT_ROTATION_ANGLE_NEG_180,
|
||||
|
@ -500,12 +500,12 @@ static constexpr const rct_string_id RideConstructionSeatAngleRotationStrings[]
|
|||
STR_RIDE_CONSTRUCTION_SEAT_ROTATION_ANGLE_495,
|
||||
};
|
||||
|
||||
static bool is_track_enabled(sint32 trackFlagIndex)
|
||||
static bool is_track_enabled(int32_t trackFlagIndex)
|
||||
{
|
||||
return (_enabledRidePieces & (1ULL << trackFlagIndex)) != 0;
|
||||
}
|
||||
|
||||
static sint32 ride_get_alternative_type(Ride *ride)
|
||||
static int32_t ride_get_alternative_type(Ride *ride)
|
||||
{
|
||||
return (_currentTrackAlternative & RIDE_TYPE_ALTERNATIVE_TRACK_TYPE) ?
|
||||
RideData4[ride->type].alternate_type :
|
||||
|
@ -526,7 +526,7 @@ static void close_ride_window_for_construction(rct_windownumber number)
|
|||
*/
|
||||
rct_window *window_ride_construction_open()
|
||||
{
|
||||
sint32 rideIndex = _currentRideIndex;
|
||||
int32_t rideIndex = _currentRideIndex;
|
||||
close_ride_window_for_construction(rideIndex);
|
||||
|
||||
rct_window *w;
|
||||
|
@ -634,7 +634,7 @@ static void window_ride_construction_close(rct_window *w)
|
|||
|
||||
hide_gridlines();
|
||||
|
||||
uint8 rideIndex = _currentRideIndex;
|
||||
uint8_t rideIndex = _currentRideIndex;
|
||||
Ride * ride = get_ride(rideIndex);
|
||||
|
||||
// If we demolish a ride all windows will be closed including the construction window,
|
||||
|
@ -666,7 +666,7 @@ static void window_ride_construction_close(rct_window *w)
|
|||
}
|
||||
else
|
||||
{
|
||||
sint32 previousPauseState = gGamePaused;
|
||||
int32_t previousPauseState = gGamePaused;
|
||||
gGamePaused = 0;
|
||||
ride_action_modify(rideIndex, RIDE_MODIFY_DEMOLISH, GAME_COMMAND_FLAG_APPLY);
|
||||
gGamePaused = previousPauseState;
|
||||
|
@ -723,9 +723,9 @@ static void window_ride_construction_resize(rct_window *w)
|
|||
}
|
||||
|
||||
Ride *ride = get_ride(_currentRideIndex);
|
||||
sint32 rideType = ride_get_alternative_type(ride);
|
||||
int32_t rideType = ride_get_alternative_type(ride);
|
||||
|
||||
uint64 disabledWidgets = 0;
|
||||
uint64_t disabledWidgets = 0;
|
||||
|
||||
if (_currentTrackCurve & 0x100) {
|
||||
disabledWidgets |=
|
||||
|
@ -1275,7 +1275,7 @@ static void window_ride_construction_resize(rct_window *w)
|
|||
}
|
||||
|
||||
// Set and invalidate the changed widgets
|
||||
uint64 currentDisabledWidgets = w->disabled_widgets;
|
||||
uint64_t currentDisabledWidgets = w->disabled_widgets;
|
||||
if (currentDisabledWidgets == disabledWidgets)
|
||||
return;
|
||||
|
||||
|
@ -1533,9 +1533,9 @@ static void window_ride_construction_mousedown(rct_window *w, rct_widgetindex wi
|
|||
_currentTrackPrice = MONEY32_UNDEFINED;
|
||||
window_ride_construction_update_active_elements();
|
||||
} else {
|
||||
uint8 *brakesSpeedPtr = &_currentBrakeSpeed2;
|
||||
uint8 maxBrakesSpeed = 30;
|
||||
uint8 brakesSpeed = *brakesSpeedPtr + 2;
|
||||
uint8_t *brakesSpeedPtr = &_currentBrakeSpeed2;
|
||||
uint8_t maxBrakesSpeed = 30;
|
||||
uint8_t brakesSpeed = *brakesSpeedPtr + 2;
|
||||
if (brakesSpeed <= maxBrakesSpeed) {
|
||||
if (_rideConstructionState == RIDE_CONSTRUCTION_STATE_SELECTED) {
|
||||
ride_construction_set_brakes_speed(brakesSpeed);
|
||||
|
@ -1553,8 +1553,8 @@ static void window_ride_construction_mousedown(rct_window *w, rct_widgetindex wi
|
|||
_currentTrackPrice = MONEY32_UNDEFINED;
|
||||
window_ride_construction_update_active_elements();
|
||||
} else {
|
||||
uint8 *brakesSpeedPtr = &_currentBrakeSpeed2;
|
||||
uint8 brakesSpeed = *brakesSpeedPtr - 2;
|
||||
uint8_t *brakesSpeedPtr = &_currentBrakeSpeed2;
|
||||
uint8_t brakesSpeed = *brakesSpeedPtr - 2;
|
||||
if (brakesSpeed >= 2) {
|
||||
if (_rideConstructionState == RIDE_CONSTRUCTION_STATE_SELECTED) {
|
||||
ride_construction_set_brakes_speed(brakesSpeed);
|
||||
|
@ -1608,7 +1608,7 @@ static void window_ride_construction_mousedown(rct_window *w, rct_widgetindex wi
|
|||
*
|
||||
* rct2: 0x006C78CD
|
||||
*/
|
||||
static void window_ride_construction_dropdown(rct_window *w, rct_widgetindex widgetIndex, sint32 dropdownIndex)
|
||||
static void window_ride_construction_dropdown(rct_window *w, rct_widgetindex widgetIndex, int32_t dropdownIndex)
|
||||
{
|
||||
if (widgetIndex != WIDX_SPECIAL_TRACK_DROPDOWN)
|
||||
return;
|
||||
|
@ -1617,7 +1617,7 @@ static void window_ride_construction_dropdown(rct_window *w, rct_widgetindex wid
|
|||
|
||||
ride_construction_invalidate_current_track();
|
||||
_currentTrackPrice = MONEY32_UNDEFINED;
|
||||
sint32 trackPiece = _currentPossibleRideConfigurations[dropdownIndex];
|
||||
int32_t trackPiece = _currentPossibleRideConfigurations[dropdownIndex];
|
||||
switch (trackPiece) {
|
||||
case TRACK_ELEM_END_STATION:
|
||||
case TRACK_ELEM_S_BEND_LEFT:
|
||||
|
@ -1640,7 +1640,7 @@ static void window_ride_construction_dropdown(rct_window *w, rct_widgetindex wid
|
|||
*/
|
||||
static void window_ride_construction_construct(rct_window *w)
|
||||
{
|
||||
sint32 trackType, trackDirection, rideIndex, liftHillAndAlternativeState, x, y, z, properties;
|
||||
int32_t trackType, trackDirection, rideIndex, liftHillAndAlternativeState, x, y, z, properties;
|
||||
track_begin_end trackBeginEnd;
|
||||
|
||||
_currentTrackPrice = MONEY32_UNDEFINED;
|
||||
|
@ -1759,7 +1759,7 @@ static void window_ride_construction_construct(rct_window *w)
|
|||
*/
|
||||
static void window_ride_construction_mouseup_demolish(rct_window* w)
|
||||
{
|
||||
sint32 x, y, z, direction, type;
|
||||
int32_t x, y, z, direction, type;
|
||||
rct_tile_element *tileElement;
|
||||
CoordsXYE inputElement, outputElement;
|
||||
track_begin_end trackBeginEnd;
|
||||
|
@ -1975,10 +1975,10 @@ static void window_ride_construction_update(rct_window *w)
|
|||
*
|
||||
* rct2: 0x006CC538
|
||||
*/
|
||||
static bool ride_get_place_position_from_screen_position(sint32 screenX, sint32 screenY, sint32 *outX, sint32 *outY)
|
||||
static bool ride_get_place_position_from_screen_position(int32_t screenX, int32_t screenY, int32_t *outX, int32_t *outY)
|
||||
{
|
||||
sint16 mapX, mapY, mapZ;
|
||||
sint32 interactionType, direction;
|
||||
int16_t mapX, mapY, mapZ;
|
||||
int32_t interactionType, direction;
|
||||
rct_tile_element *tileElement;
|
||||
rct_viewport *viewport;
|
||||
|
||||
|
@ -2023,7 +2023,7 @@ static bool ride_get_place_position_from_screen_position(sint32 screenX, sint32
|
|||
tileElement = map_get_surface_element_at(mapX >> 5, mapY >> 5);
|
||||
mapZ = floor2(tileElement->base_height * 8, 16);
|
||||
mapZ += _trackPlaceShiftZ;
|
||||
mapZ = std::max<sint16>(mapZ, 16);
|
||||
mapZ = std::max<int16_t>(mapZ, 16);
|
||||
_trackPlaceZ = mapZ;
|
||||
}
|
||||
} else {
|
||||
|
@ -2032,7 +2032,7 @@ static bool ride_get_place_position_from_screen_position(sint32 screenX, sint32
|
|||
if (_trackPlaceShiftState != 0) {
|
||||
mapZ += _trackPlaceShiftZ;
|
||||
}
|
||||
_trackPlaceZ = std::max<sint32>(mapZ, 16);
|
||||
_trackPlaceZ = std::max<int32_t>(mapZ, 16);
|
||||
}
|
||||
|
||||
if (mapX == LOCATION_NULL)
|
||||
|
@ -2047,7 +2047,7 @@ static bool ride_get_place_position_from_screen_position(sint32 screenX, sint32
|
|||
*
|
||||
* rct2: 0x006C8229
|
||||
*/
|
||||
static void window_ride_construction_toolupdate(rct_window* w, rct_widgetindex widgetIndex, sint32 x, sint32 y)
|
||||
static void window_ride_construction_toolupdate(rct_window* w, rct_widgetindex widgetIndex, int32_t x, int32_t y)
|
||||
{
|
||||
switch (widgetIndex) {
|
||||
case WIDX_CONSTRUCT:
|
||||
|
@ -2064,7 +2064,7 @@ static void window_ride_construction_toolupdate(rct_window* w, rct_widgetindex w
|
|||
*
|
||||
* rct2: 0x006C8248
|
||||
*/
|
||||
static void window_ride_construction_tooldown(rct_window* w, rct_widgetindex widgetIndex, sint32 x, sint32 y)
|
||||
static void window_ride_construction_tooldown(rct_window* w, rct_widgetindex widgetIndex, int32_t x, int32_t y)
|
||||
{
|
||||
switch (widgetIndex) {
|
||||
case WIDX_CONSTRUCT:
|
||||
|
@ -2097,22 +2097,22 @@ static void window_ride_construction_invalidate(rct_window *w)
|
|||
stringId = STR_BOOSTER;
|
||||
}
|
||||
}
|
||||
set_format_arg(0, uint16, stringId);
|
||||
set_format_arg(0, uint16_t, stringId);
|
||||
|
||||
if (_currentlyShowingBrakeOrBoosterSpeed) {
|
||||
uint16 brakeSpeed2 = ((_currentBrakeSpeed2 * 9) >> 2) & 0xFFFF;
|
||||
uint16_t brakeSpeed2 = ((_currentBrakeSpeed2 * 9) >> 2) & 0xFFFF;
|
||||
if (_boosterTrackSelected)
|
||||
{
|
||||
brakeSpeed2 = get_booster_speed(ride->type, brakeSpeed2);
|
||||
}
|
||||
set_format_arg(2, uint16, brakeSpeed2);
|
||||
set_format_arg(2, uint16_t, brakeSpeed2);
|
||||
}
|
||||
|
||||
window_ride_construction_widgets[WIDX_SEAT_ROTATION_ANGLE_SPINNER].text = RideConstructionSeatAngleRotationStrings[_currentSeatRotationAngle];
|
||||
|
||||
// Set window title arguments
|
||||
set_format_arg(4, rct_string_id, ride->name);
|
||||
set_format_arg(6, uint32, ride->name_arguments);
|
||||
set_format_arg(6, uint32_t, ride->name_arguments);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -2123,7 +2123,7 @@ static void window_ride_construction_paint(rct_window *w, rct_drawpixelinfo *dpi
|
|||
{
|
||||
rct_drawpixelinfo clipdpi;
|
||||
rct_widget *widget;
|
||||
sint32 x, y, width, height;
|
||||
int32_t x, y, width, height;
|
||||
|
||||
window_draw_widgets(w, dpi);
|
||||
|
||||
|
@ -2131,7 +2131,7 @@ static void window_ride_construction_paint(rct_window *w, rct_drawpixelinfo *dpi
|
|||
if (widget->type == WWT_EMPTY)
|
||||
return;
|
||||
|
||||
sint32 trackType, trackDirection, rideIndex, liftHillAndAlternativeState;
|
||||
int32_t trackType, trackDirection, rideIndex, liftHillAndAlternativeState;
|
||||
if (window_ride_construction_update_state(&trackType, &trackDirection, &rideIndex, &liftHillAndAlternativeState, nullptr, nullptr, nullptr, nullptr))
|
||||
return;
|
||||
|
||||
|
@ -2161,8 +2161,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,
|
||||
sint32 rideIndex, sint32 trackType, sint32 trackDirection, sint32 unknown,
|
||||
sint32 width, sint32 height
|
||||
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;
|
||||
|
@ -2173,15 +2173,15 @@ static void window_ride_construction_draw_track_piece(
|
|||
while ((trackBlock + 1)->index != 0xFF)
|
||||
trackBlock++;
|
||||
|
||||
sint16 x = trackBlock->x;
|
||||
sint16 z = trackBlock->z;
|
||||
sint16 y = trackBlock->y;
|
||||
int16_t x = trackBlock->x;
|
||||
int16_t z = trackBlock->z;
|
||||
int16_t y = trackBlock->y;
|
||||
if (trackBlock->var_09 & 2) {
|
||||
x = 0;
|
||||
y = 0;
|
||||
}
|
||||
|
||||
sint16 tmp;
|
||||
int16_t tmp;
|
||||
switch (trackDirection & 3) {
|
||||
case 1:
|
||||
tmp = x;
|
||||
|
@ -2205,7 +2205,7 @@ static void window_ride_construction_draw_track_piece(
|
|||
y = 4112 + (y / 2);
|
||||
z = 1024 + z;
|
||||
|
||||
sint16 previewZOffset = ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_FLAT_RIDE) ?
|
||||
int16_t previewZOffset = ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_FLAT_RIDE) ?
|
||||
FlatRideTrackDefinitions[trackType].preview_z_offset :
|
||||
TrackDefinitions[trackType].preview_z_offset;
|
||||
z -= previewZOffset;
|
||||
|
@ -2216,7 +2216,7 @@ static void window_ride_construction_draw_track_piece(
|
|||
|
||||
dpi->x += x - width / 2;
|
||||
dpi->y += y - height / 2 - 16;
|
||||
uint32 d = unknown << 16;
|
||||
uint32_t d = unknown << 16;
|
||||
d |= rideIndex;
|
||||
d |= trackType << 8;
|
||||
|
||||
|
@ -2236,13 +2236,13 @@ static rct_tile_element *_backupTileElementArrays[5];
|
|||
*/
|
||||
static void sub_6CBCE2(
|
||||
rct_drawpixelinfo * dpi,
|
||||
sint32 rideIndex, sint32 trackType, sint32 trackDirection, sint32 edx,
|
||||
sint32 originX, sint32 originY, sint32 originZ
|
||||
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;
|
||||
sint32 preserve_current_viewport_flags;
|
||||
sint32 offsetX, offsetY;
|
||||
int32_t preserve_current_viewport_flags;
|
||||
int32_t offsetX, offsetY;
|
||||
|
||||
paint_session * session = paint_session_alloc(dpi);
|
||||
preserve_current_viewport_flags = gCurrentViewportFlags;
|
||||
|
@ -2251,10 +2251,10 @@ static void sub_6CBCE2(
|
|||
|
||||
ride = get_ride(rideIndex);
|
||||
|
||||
sint16 preserveMapSizeUnits = gMapSizeUnits;
|
||||
sint16 preserveMapSizeMinus2 = gMapSizeMinus2;
|
||||
sint16 preserveMapSize = gMapSize;
|
||||
sint16 preserveMapSizeMaxXY = gMapSizeMaxXY;
|
||||
int16_t preserveMapSizeUnits = gMapSizeUnits;
|
||||
int16_t preserveMapSizeMinus2 = gMapSizeMinus2;
|
||||
int16_t preserveMapSize = gMapSize;
|
||||
int16_t preserveMapSizeMaxXY = gMapSizeMaxXY;
|
||||
|
||||
gMapSizeUnits = 255 * 32;
|
||||
gMapSizeMinus2 = (255 * 32) + 286;
|
||||
|
@ -2263,8 +2263,8 @@ static void sub_6CBCE2(
|
|||
|
||||
trackBlock = get_track_def_from_ride(ride, trackType);
|
||||
while (trackBlock->index != 255) {
|
||||
sint32 bl = trackBlock->var_08;
|
||||
sint32 bh;
|
||||
int32_t bl = trackBlock->var_08;
|
||||
int32_t bh;
|
||||
switch (trackDirection) {
|
||||
default:
|
||||
case 0:
|
||||
|
@ -2302,13 +2302,13 @@ static void sub_6CBCE2(
|
|||
bl |= bh;
|
||||
break;
|
||||
}
|
||||
sint32 x = originX + offsetX;
|
||||
sint32 y = originY + offsetY;
|
||||
sint32 baseZ = (originZ + trackBlock->z) >> 3;
|
||||
sint32 clearanceZ = ((trackBlock->var_07 + RideData5[ride->type].clearance_height) >> 3) + baseZ + 4;
|
||||
int32_t x = originX + offsetX;
|
||||
int32_t y = originY + offsetY;
|
||||
int32_t baseZ = (originZ + trackBlock->z) >> 3;
|
||||
int32_t clearanceZ = ((trackBlock->var_07 + RideData5[ride->type].clearance_height) >> 3) + baseZ + 4;
|
||||
|
||||
sint32 tileX = x >> 5;
|
||||
sint32 tileY = y >> 5;
|
||||
int32_t tileX = x >> 5;
|
||||
int32_t tileY = y >> 5;
|
||||
|
||||
// Replace map elements with temporary ones containing track
|
||||
_backupTileElementArrays[0] = map_get_first_element_at(tileX + 0, tileY + 0);
|
||||
|
@ -2381,9 +2381,9 @@ void window_ride_construction_update_active_elements_impl()
|
|||
|
||||
_selectedTrackType = 255;
|
||||
if (_rideConstructionState == RIDE_CONSTRUCTION_STATE_SELECTED) {
|
||||
sint32 x = _currentTrackBeginX;
|
||||
sint32 y = _currentTrackBeginY;
|
||||
sint32 z = _currentTrackBeginZ;
|
||||
int32_t x = _currentTrackBeginX;
|
||||
int32_t y = _currentTrackBeginY;
|
||||
int32_t z = _currentTrackBeginZ;
|
||||
if (!sub_6C683D(&x, &y, &z, _currentTrackPieceDirection & 3, _currentTrackPieceType, 0, &tileElement, 0)) {
|
||||
_selectedTrackType = track_element_get_type(tileElement);
|
||||
if (track_element_has_speed_setting(track_element_get_type(tileElement)))
|
||||
|
@ -2404,7 +2404,7 @@ void window_ride_construction_update_enabled_track_pieces()
|
|||
{
|
||||
Ride *ride = get_ride(_currentRideIndex);
|
||||
rct_ride_entry *rideEntry = get_ride_entry_by_ride(ride);
|
||||
sint32 rideType = (_currentTrackAlternative & RIDE_TYPE_ALTERNATIVE_TRACK_TYPE) ? RideData4[ride->type].alternate_type : ride->type;
|
||||
int32_t rideType = (_currentTrackAlternative & RIDE_TYPE_ALTERNATIVE_TRACK_TYPE) ? RideData4[ride->type].alternate_type : ride->type;
|
||||
|
||||
if (rideEntry == nullptr)
|
||||
return;
|
||||
|
@ -2433,7 +2433,7 @@ void window_ride_construction_update_enabled_track_pieces()
|
|||
*/
|
||||
void sub_6C94D8()
|
||||
{
|
||||
sint32 x, y, z, direction, type, rideIndex, liftHillAndAlternativeState;
|
||||
int32_t x, y, z, direction, type, rideIndex, liftHillAndAlternativeState;
|
||||
|
||||
// Recheck if area is fine for new track.
|
||||
// Set by footpath placement
|
||||
|
@ -2533,7 +2533,7 @@ void sub_6C94D8()
|
|||
static void window_ride_construction_update_map_selection()
|
||||
{
|
||||
Ride *ride;
|
||||
sint32 trackType, trackDirection, x, y;
|
||||
int32_t trackType, trackDirection, x, y;
|
||||
|
||||
map_invalidate_map_selection_tiles();
|
||||
gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE_CONSTRUCT;
|
||||
|
@ -2574,8 +2574,8 @@ static void window_ride_construction_update_map_selection()
|
|||
static void window_ride_construction_update_possible_ride_configurations()
|
||||
{
|
||||
Ride *ride;
|
||||
sint32 trackType;
|
||||
sint32 edi;
|
||||
int32_t trackType;
|
||||
int32_t edi;
|
||||
|
||||
ride = get_ride(_currentRideIndex);
|
||||
|
||||
|
@ -2585,10 +2585,10 @@ static void window_ride_construction_update_possible_ride_configurations()
|
|||
else
|
||||
edi = ride->type;
|
||||
|
||||
sint32 currentPossibleRideConfigurationIndex = 0;
|
||||
int32_t currentPossibleRideConfigurationIndex = 0;
|
||||
_numCurrentPossibleSpecialTrackPieces = 0;
|
||||
for (trackType = 0; trackType < 256; trackType++) {
|
||||
sint32 edx = ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_FLAT_RIDE) ?
|
||||
int32_t edx = ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_FLAT_RIDE) ?
|
||||
FlatRideTrackDefinitions[trackType].type :
|
||||
TrackDefinitions[trackType].type;
|
||||
|
||||
|
@ -2603,7 +2603,7 @@ static void window_ride_construction_update_possible_ride_configurations()
|
|||
continue;
|
||||
}
|
||||
|
||||
sint32 slope, bank;
|
||||
int32_t slope, bank;
|
||||
if (_rideConstructionState == RIDE_CONSTRUCTION_STATE_FRONT || _rideConstructionState == RIDE_CONSTRUCTION_STATE_PLACE) {
|
||||
if (ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_FLAT_RIDE)) {
|
||||
slope = FlatRideTrackDefinitions[trackType].vangle_start;
|
||||
|
@ -2664,9 +2664,9 @@ static void window_ride_construction_update_possible_ride_configurations()
|
|||
*/
|
||||
static void window_ride_construction_update_widgets(rct_window *w)
|
||||
{
|
||||
uint8 rideIndex = _currentRideIndex;
|
||||
uint8_t rideIndex = _currentRideIndex;
|
||||
Ride *ride = get_ride(rideIndex);
|
||||
sint32 rideType = ride_get_alternative_type(ride);
|
||||
int32_t rideType = ride_get_alternative_type(ride);
|
||||
|
||||
w->hold_down_widgets = 0;
|
||||
if (ride_type_has_flag(rideType, RIDE_TYPE_FLAG_IS_SHOP) || !_stationConstructed) {
|
||||
|
@ -2779,7 +2779,7 @@ static void window_ride_construction_update_widgets(rct_window *w)
|
|||
window_ride_construction_widgets[WIDX_SLOPE_UP_STEEP].type = WWT_FLATBTN;
|
||||
}
|
||||
|
||||
sint32 x;
|
||||
int32_t x;
|
||||
if ((is_track_enabled(TRACK_LIFT_HILL) && _currentTrackCurve < 256) || (gCheatsEnableChainLiftOnAllTrack && ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_HAS_TRACK))) {
|
||||
window_ride_construction_widgets[WIDX_CHAIN_LIFT].type = WWT_FLATBTN;
|
||||
x = 9;
|
||||
|
@ -2788,7 +2788,7 @@ static void window_ride_construction_update_widgets(rct_window *w)
|
|||
x = 23;
|
||||
}
|
||||
|
||||
for (sint32 i = WIDX_SLOPE_DOWN_STEEP; i <= WIDX_SLOPE_UP_STEEP; i++) {
|
||||
for (int32_t i = WIDX_SLOPE_DOWN_STEEP; i <= WIDX_SLOPE_UP_STEEP; i++) {
|
||||
window_ride_construction_widgets[i].left = x;
|
||||
window_ride_construction_widgets[i].right = x + 23;
|
||||
x += 24;
|
||||
|
@ -2800,9 +2800,9 @@ static void window_ride_construction_update_widgets(rct_window *w)
|
|||
window_ride_construction_widgets[WIDX_SLOPE_DOWN_STEEP].tooltip = STR_RIDE_CONSTRUCTION_STEEP_SLOPE_DOWN_TIP;
|
||||
if (is_track_enabled(TRACK_SLOPE_VERTICAL)) {
|
||||
if (_previousTrackSlopeEnd == TRACK_SLOPE_UP_60 || _previousTrackSlopeEnd == TRACK_SLOPE_UP_90) {
|
||||
sint32 originalSlopeUpSteepLeft = window_ride_construction_widgets[WIDX_SLOPE_UP_STEEP].left;
|
||||
sint32 originalSlopeUpSteepRight = window_ride_construction_widgets[WIDX_SLOPE_UP_STEEP].right;
|
||||
for (sint32 i = WIDX_SLOPE_UP_STEEP; i > WIDX_SLOPE_DOWN_STEEP; i--) {
|
||||
int32_t originalSlopeUpSteepLeft = window_ride_construction_widgets[WIDX_SLOPE_UP_STEEP].left;
|
||||
int32_t originalSlopeUpSteepRight = window_ride_construction_widgets[WIDX_SLOPE_UP_STEEP].right;
|
||||
for (int32_t i = WIDX_SLOPE_UP_STEEP; i > WIDX_SLOPE_DOWN_STEEP; i--) {
|
||||
window_ride_construction_widgets[i].left = window_ride_construction_widgets[i - 1].left;
|
||||
window_ride_construction_widgets[i].right = window_ride_construction_widgets[i - 1].right;
|
||||
}
|
||||
|
@ -2811,9 +2811,9 @@ static void window_ride_construction_update_widgets(rct_window *w)
|
|||
window_ride_construction_widgets[WIDX_SLOPE_DOWN_STEEP].image = SPR_RIDE_CONSTRUCTION_VERTICAL_RISE;
|
||||
window_ride_construction_widgets[WIDX_SLOPE_DOWN_STEEP].tooltip = STR_RIDE_CONSTRUCTION_VERTICAL_RISE_TIP;
|
||||
} else if (_previousTrackSlopeEnd == TRACK_SLOPE_DOWN_60 || _previousTrackSlopeEnd == TRACK_SLOPE_DOWN_90) {
|
||||
sint32 originalSlopeDownSteepLeft = window_ride_construction_widgets[WIDX_SLOPE_DOWN_STEEP].left;
|
||||
sint32 originalSlopeDownSteepRight = window_ride_construction_widgets[WIDX_SLOPE_DOWN_STEEP].right;
|
||||
for (sint32 i = WIDX_SLOPE_DOWN_STEEP; i < WIDX_SLOPE_UP_STEEP; i++) {
|
||||
int32_t originalSlopeDownSteepLeft = window_ride_construction_widgets[WIDX_SLOPE_DOWN_STEEP].left;
|
||||
int32_t originalSlopeDownSteepRight = window_ride_construction_widgets[WIDX_SLOPE_DOWN_STEEP].right;
|
||||
for (int32_t i = WIDX_SLOPE_DOWN_STEEP; i < WIDX_SLOPE_UP_STEEP; i++) {
|
||||
window_ride_construction_widgets[i].left = window_ride_construction_widgets[i + 1].left;
|
||||
window_ride_construction_widgets[i].right = window_ride_construction_widgets[i + 1].right;
|
||||
}
|
||||
|
@ -2835,7 +2835,7 @@ static void window_ride_construction_update_widgets(rct_window *w)
|
|||
window_ride_construction_widgets[WIDX_SLOPE_UP_STEEP].image = SPR_RIDE_CONSTRUCTION_HELIX_UP;
|
||||
window_ride_construction_widgets[WIDX_SLOPE_UP_STEEP].tooltip = STR_RIDE_CONSTRUCTION_HELIX_UP_TIP;
|
||||
|
||||
sint32 tmp = window_ride_construction_widgets[WIDX_SLOPE_DOWN_STEEP].left;
|
||||
int32_t tmp = window_ride_construction_widgets[WIDX_SLOPE_DOWN_STEEP].left;
|
||||
window_ride_construction_widgets[WIDX_SLOPE_DOWN_STEEP].left = window_ride_construction_widgets[WIDX_SLOPE_DOWN].left;
|
||||
window_ride_construction_widgets[WIDX_SLOPE_DOWN].left = tmp;
|
||||
|
||||
|
@ -2863,7 +2863,7 @@ static void window_ride_construction_update_widgets(rct_window *w)
|
|||
window_ride_construction_widgets[WIDX_SLOPE_UP_STEEP].image = SPR_RIDE_CONSTRUCTION_HELIX_UP;
|
||||
window_ride_construction_widgets[WIDX_SLOPE_UP_STEEP].tooltip = STR_RIDE_CONSTRUCTION_HELIX_UP_TIP;
|
||||
|
||||
sint32 tmp = window_ride_construction_widgets[WIDX_SLOPE_DOWN_STEEP].left;
|
||||
int32_t tmp = window_ride_construction_widgets[WIDX_SLOPE_DOWN_STEEP].left;
|
||||
window_ride_construction_widgets[WIDX_SLOPE_DOWN_STEEP].left = window_ride_construction_widgets[WIDX_SLOPE_DOWN].left;
|
||||
window_ride_construction_widgets[WIDX_SLOPE_DOWN].left = tmp;
|
||||
|
||||
|
@ -2991,14 +2991,14 @@ static void window_ride_construction_update_widgets(rct_window *w)
|
|||
window_ride_construction_widgets[WIDX_SEAT_ROTATION_ANGLE_SPINNER_DOWN].type = WWT_BUTTON;
|
||||
window_ride_construction_widgets[WIDX_BANKING_GROUPBOX].right = 92;
|
||||
if (window_ride_construction_widgets[WIDX_BANK_LEFT].type != WWT_SPINNER) {
|
||||
for (sint32 i = WIDX_BANK_LEFT; i <= WIDX_BANK_RIGHT; i++) {
|
||||
for (int32_t i = WIDX_BANK_LEFT; i <= WIDX_BANK_RIGHT; i++) {
|
||||
window_ride_construction_widgets[i].left -= 36;
|
||||
window_ride_construction_widgets[i].right -= 36;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
uint64 pressedWidgets = w->pressed_widgets & (
|
||||
uint64_t pressedWidgets = w->pressed_widgets & (
|
||||
(1 << WIDX_BACKGROUND) |
|
||||
(1 << WIDX_TITLE) |
|
||||
(1 << WIDX_CLOSE) |
|
||||
|
@ -3137,7 +3137,7 @@ static void window_ride_construction_update_widgets(rct_window *w)
|
|||
window_invalidate(w);
|
||||
}
|
||||
|
||||
static void window_ride_construction_select_map_tiles(Ride *ride, sint32 trackType, sint32 trackDirection, sint32 x, sint32 y)
|
||||
static void window_ride_construction_select_map_tiles(Ride *ride, int32_t trackType, int32_t trackDirection, int32_t x, int32_t y)
|
||||
{
|
||||
// If the scenery tool is active, we do not display our tiles as it
|
||||
// will conflict with larger scenery objects selecting tiles
|
||||
|
@ -3147,11 +3147,11 @@ static void window_ride_construction_select_map_tiles(Ride *ride, sint32 trackTy
|
|||
}
|
||||
|
||||
const rct_preview_track *trackBlock;
|
||||
sint32 offsetX, offsetY;
|
||||
int32_t offsetX, offsetY;
|
||||
|
||||
trackBlock = get_track_def_from_ride(ride, trackType);
|
||||
trackDirection &= 3;
|
||||
sint32 selectionTileIndex = 0;
|
||||
int32_t selectionTileIndex = 0;
|
||||
while (trackBlock->index != 255) {
|
||||
switch (trackDirection) {
|
||||
default:
|
||||
|
@ -3187,9 +3187,9 @@ static void window_ride_construction_select_map_tiles(Ride *ride, sint32 trackTy
|
|||
*/
|
||||
static void window_ride_construction_show_special_track_dropdown(rct_window *w, rct_widget *widget)
|
||||
{
|
||||
sint32 defaultIndex = -1;
|
||||
for (sint32 i = 0; i < _numCurrentPossibleRideConfigurations; i++) {
|
||||
uint8 trackPiece = _currentPossibleRideConfigurations[i];
|
||||
int32_t defaultIndex = -1;
|
||||
for (int32_t i = 0; i < _numCurrentPossibleRideConfigurations; i++) {
|
||||
uint8_t trackPiece = _currentPossibleRideConfigurations[i];
|
||||
rct_string_id trackPieceStringId = RideConfigurationStringIds[trackPiece];
|
||||
if (trackPieceStringId == STR_RAPIDS) {
|
||||
Ride *ride = get_ride(_currentRideIndex);
|
||||
|
@ -3219,7 +3219,7 @@ static void window_ride_construction_show_special_track_dropdown(rct_window *w,
|
|||
widget->right - widget->left
|
||||
);
|
||||
|
||||
for (sint32 i = 0; i < 32; i++)
|
||||
for (int32_t i = 0; i < 32; i++)
|
||||
{
|
||||
if (_currentDisabledSpecialTrackPieces & (1 << i))
|
||||
{
|
||||
|
@ -3233,9 +3233,9 @@ static void window_ride_construction_show_special_track_dropdown(rct_window *w,
|
|||
*
|
||||
* rct2: 0x006C7630
|
||||
*/
|
||||
static void ride_selected_track_set_seat_rotation(sint32 seatRotation)
|
||||
static void ride_selected_track_set_seat_rotation(int32_t seatRotation)
|
||||
{
|
||||
sint32 x, y, z;
|
||||
int32_t x, y, z;
|
||||
x = _currentTrackBeginX;
|
||||
y = _currentTrackBeginY;
|
||||
z = _currentTrackBeginZ;
|
||||
|
@ -3247,7 +3247,7 @@ static void ride_selected_track_set_seat_rotation(sint32 seatRotation)
|
|||
*
|
||||
* rct2: 0x006C7502
|
||||
*/
|
||||
static void loc_6C7502(sint32 al)
|
||||
static void loc_6C7502(int32_t al)
|
||||
{
|
||||
_currentTrackSlopeEnd = al;
|
||||
_currentTrackPrice = MONEY32_UNDEFINED;
|
||||
|
@ -3263,10 +3263,10 @@ static void loc_6C7502(sint32 al)
|
|||
*
|
||||
* rct2: 0x006C76E9
|
||||
*/
|
||||
static void ride_construction_set_brakes_speed(sint32 brakesSpeed)
|
||||
static void ride_construction_set_brakes_speed(int32_t brakesSpeed)
|
||||
{
|
||||
rct_tile_element *tileElement;
|
||||
sint32 x, y, z;
|
||||
int32_t x, y, z;
|
||||
|
||||
x = _currentTrackBeginX;
|
||||
y = _currentTrackBeginY;
|
||||
|
@ -3289,9 +3289,9 @@ static void ride_construction_set_brakes_speed(sint32 brakesSpeed)
|
|||
*
|
||||
* rct2: 0x006CC6A8
|
||||
*/
|
||||
void ride_construction_toolupdate_construct(sint32 screenX, sint32 screenY)
|
||||
void ride_construction_toolupdate_construct(int32_t screenX, int32_t screenY)
|
||||
{
|
||||
sint32 x, y, z;
|
||||
int32_t x, y, z;
|
||||
Ride *ride;
|
||||
const rct_preview_track *trackBlock;
|
||||
|
||||
|
@ -3321,7 +3321,7 @@ void ride_construction_toolupdate_construct(sint32 screenX, sint32 screenY)
|
|||
gMapSelectionTiles[1].x = -1;
|
||||
gMapSelectionTiles[1].y = -1;
|
||||
|
||||
sint32 trackType, trackDirection, rideIndex, liftHillAndAlternativeState;
|
||||
int32_t trackType, trackDirection, rideIndex, liftHillAndAlternativeState;
|
||||
if (window_ride_construction_update_state(&trackType, &trackDirection, &rideIndex, &liftHillAndAlternativeState, nullptr, nullptr, nullptr, nullptr)) {
|
||||
ride_construction_invalidate_current_track();
|
||||
map_invalidate_map_selection_tiles();
|
||||
|
@ -3339,7 +3339,7 @@ void ride_construction_toolupdate_construct(sint32 screenX, sint32 screenY)
|
|||
if (_trackPlaceZ == 0) {
|
||||
// Raise z above all slopes and water
|
||||
if (gMapSelectFlags & MAP_SELECT_FLAG_ENABLE_CONSTRUCT) {
|
||||
sint32 highestZ = 0;
|
||||
int32_t highestZ = 0;
|
||||
LocationXY16 *selectedTile = gMapSelectionTiles;
|
||||
while (selectedTile->x != -1) {
|
||||
if (selectedTile->x < (256 * 32) && selectedTile->y < (256 * 32)) {
|
||||
|
@ -3355,9 +3355,9 @@ void ride_construction_toolupdate_construct(sint32 screenX, sint32 screenY)
|
|||
}
|
||||
// loc_6CC91B:
|
||||
trackBlock = get_track_def_from_ride(ride, trackType);
|
||||
sint32 bx = 0;
|
||||
int32_t bx = 0;
|
||||
do {
|
||||
bx = std::min<sint32>(bx, trackBlock->z);
|
||||
bx = std::min<int32_t>(bx, trackBlock->z);
|
||||
trackBlock++;
|
||||
} while (trackBlock->index != 255);
|
||||
z -= bx;
|
||||
|
@ -3431,7 +3431,7 @@ void ride_construction_toolupdate_construct(sint32 screenX, sint32 screenY)
|
|||
constexpr sLocationXY8 DirOffsets[4] = {{-1, 0}, {0, 1}, {1, 0}, {0, -1}};
|
||||
|
||||
bool keepOrientation = false;
|
||||
for (sint8 i = 0; i < 4; i++)
|
||||
for (int8_t i = 0; i < 4; i++)
|
||||
{
|
||||
pathsByDir[i] = map_get_footpath_element(
|
||||
(x >> 5) + DirOffsets[i].x,
|
||||
|
@ -3478,7 +3478,7 @@ void ride_construction_toolupdate_construct(sint32 screenX, sint32 screenY)
|
|||
|
||||
if (!keepOrientation)
|
||||
{
|
||||
for (sint8 i = 0; i < 4; i++)
|
||||
for (int8_t i = 0; i < 4; i++)
|
||||
{
|
||||
if (pathsByDir[i])
|
||||
{
|
||||
|
@ -3501,10 +3501,10 @@ void ride_construction_toolupdate_construct(sint32 screenX, sint32 screenY)
|
|||
*
|
||||
* rct2: 0x006CD354
|
||||
*/
|
||||
void ride_construction_toolupdate_entrance_exit(sint32 screenX, sint32 screenY)
|
||||
void ride_construction_toolupdate_entrance_exit(int32_t screenX, int32_t screenY)
|
||||
{
|
||||
sint32 x, y, direction;
|
||||
uint8 stationNum;
|
||||
int32_t x, y, direction;
|
||||
uint8_t stationNum;
|
||||
|
||||
map_invalidate_selection_rect();
|
||||
map_invalidate_map_selection_tiles();
|
||||
|
@ -3549,10 +3549,10 @@ void ride_construction_toolupdate_entrance_exit(sint32 screenX, sint32 screenY)
|
|||
*
|
||||
* rct2: 0x006CCA73
|
||||
*/
|
||||
void ride_construction_tooldown_construct(sint32 screenX, sint32 screenY)
|
||||
void ride_construction_tooldown_construct(int32_t screenX, int32_t screenY)
|
||||
{
|
||||
const CursorState * state = context_get_cursor_state();
|
||||
sint32 trackType, trackDirection, rideIndex, liftHillAndAlternativeState, x, y, z, properties, highestZ;
|
||||
int32_t trackType, trackDirection, rideIndex, liftHillAndAlternativeState, x, y, z, properties, highestZ;
|
||||
rct_window *w;
|
||||
|
||||
map_invalidate_map_selection_tiles();
|
||||
|
@ -3594,9 +3594,9 @@ void ride_construction_tooldown_construct(sint32 screenX, sint32 screenY)
|
|||
Ride *ride = get_ride(_currentRideIndex);
|
||||
if (_trackPlaceZ == 0) {
|
||||
const rct_preview_track *trackBlock = get_track_def_from_ride(ride, _currentTrackPieceType);
|
||||
sint32 bx = 0;
|
||||
int32_t bx = 0;
|
||||
do {
|
||||
bx = std::min<sint32>(bx, trackBlock->z);
|
||||
bx = std::min<int32_t>(bx, trackBlock->z);
|
||||
trackBlock++;
|
||||
} while (trackBlock->index != 255);
|
||||
z -= bx;
|
||||
|
@ -3610,7 +3610,7 @@ void ride_construction_tooldown_construct(sint32 screenX, sint32 screenY)
|
|||
}
|
||||
|
||||
if (ride->type == RIDE_TYPE_MAZE) {
|
||||
for (sint32 zAttempts = 41; zAttempts >= 0; zAttempts--) {
|
||||
for (int32_t zAttempts = 41; zAttempts >= 0; zAttempts--) {
|
||||
_rideConstructionState = RIDE_CONSTRUCTION_STATE_MAZE_BUILD;
|
||||
_currentTrackBeginX = x;
|
||||
_currentTrackBeginY = y;
|
||||
|
@ -3674,7 +3674,7 @@ void ride_construction_tooldown_construct(sint32 screenX, sint32 screenY)
|
|||
return;
|
||||
}
|
||||
|
||||
for (sint32 zAttempts = 41; zAttempts >= 0; zAttempts--) {
|
||||
for (int32_t zAttempts = 41; zAttempts >= 0; zAttempts--) {
|
||||
_rideConstructionState = RIDE_CONSTRUCTION_STATE_FRONT;
|
||||
_currentTrackBeginX = x;
|
||||
_currentTrackBeginY = y;
|
||||
|
@ -3702,14 +3702,14 @@ void ride_construction_tooldown_construct(sint32 screenX, sint32 screenY)
|
|||
zAttempts == 0 ||
|
||||
z < 0
|
||||
) {
|
||||
sint32 saveTrackDirection = _currentTrackPieceDirection;
|
||||
sint32 saveCurrentTrackCurve = _currentTrackCurve;
|
||||
sint32 savePreviousTrackSlopeEnd = _previousTrackSlopeEnd;
|
||||
sint32 saveCurrentTrackSlopeEnd = _currentTrackSlopeEnd;
|
||||
sint32 savePreviousTrackBankEnd = _previousTrackBankEnd;
|
||||
sint32 saveCurrentTrackBankEnd = _currentTrackBankEnd;
|
||||
sint32 saveCurrentTrackAlternative = _currentTrackAlternative;
|
||||
sint32 saveCurrentTrackLiftHill = _currentTrackLiftHill;
|
||||
int32_t saveTrackDirection = _currentTrackPieceDirection;
|
||||
int32_t saveCurrentTrackCurve = _currentTrackCurve;
|
||||
int32_t savePreviousTrackSlopeEnd = _previousTrackSlopeEnd;
|
||||
int32_t saveCurrentTrackSlopeEnd = _currentTrackSlopeEnd;
|
||||
int32_t savePreviousTrackBankEnd = _previousTrackBankEnd;
|
||||
int32_t saveCurrentTrackBankEnd = _currentTrackBankEnd;
|
||||
int32_t saveCurrentTrackAlternative = _currentTrackAlternative;
|
||||
int32_t saveCurrentTrackLiftHill = _currentTrackLiftHill;
|
||||
|
||||
ride_initialise_construction_window(_currentRideIndex);
|
||||
|
||||
|
@ -3751,14 +3751,14 @@ void ride_construction_tooldown_construct(sint32 screenX, sint32 screenY)
|
|||
*
|
||||
* rct2: 0x006CCA73
|
||||
*/
|
||||
static void ride_construction_tooldown_entrance_exit(sint32 screenX, sint32 screenY)
|
||||
static void ride_construction_tooldown_entrance_exit(int32_t screenX, int32_t screenY)
|
||||
{
|
||||
ride_construction_invalidate_current_track();
|
||||
map_invalidate_selection_rect();
|
||||
gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE;
|
||||
gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW;
|
||||
|
||||
sint32 mapX, mapY, direction;
|
||||
int32_t mapX, mapY, direction;
|
||||
ride_get_entrance_or_exit_position_from_screen_position(screenX, screenY, &mapX, &mapY, &direction);
|
||||
if (gRideEntranceExitPlaceDirection == 255)
|
||||
return;
|
||||
|
|
|
@ -74,15 +74,15 @@ static bool _quickDemolishMode = false;
|
|||
static void window_ride_list_mouseup(rct_window *w, rct_widgetindex widgetIndex);
|
||||
static void window_ride_list_resize(rct_window *w);
|
||||
static void window_ride_list_mousedown(rct_window *w, rct_widgetindex widgetIndex, rct_widget* widget);
|
||||
static void window_ride_list_dropdown(rct_window *w, rct_widgetindex widgetIndex, sint32 dropdownIndex);
|
||||
static void window_ride_list_dropdown(rct_window *w, rct_widgetindex widgetIndex, int32_t dropdownIndex);
|
||||
static void window_ride_list_update(rct_window *w);
|
||||
static void window_ride_list_scrollgetsize(rct_window *w, sint32 scrollIndex, sint32 *width, sint32 *height);
|
||||
static void window_ride_list_scrollmousedown(rct_window *w, sint32 scrollIndex, sint32 x, sint32 y);
|
||||
static void window_ride_list_scrollmouseover(rct_window *w, sint32 scrollIndex, sint32 x, sint32 y);
|
||||
static void window_ride_list_scrollgetsize(rct_window *w, int32_t scrollIndex, int32_t *width, int32_t *height);
|
||||
static void window_ride_list_scrollmousedown(rct_window *w, int32_t scrollIndex, int32_t x, int32_t y);
|
||||
static void window_ride_list_scrollmouseover(rct_window *w, int32_t scrollIndex, int32_t x, int32_t y);
|
||||
static void window_ride_list_tooltip(rct_window* w, rct_widgetindex widgetIndex, rct_string_id *stringId);
|
||||
static void window_ride_list_invalidate(rct_window *w);
|
||||
static void window_ride_list_paint(rct_window *w, rct_drawpixelinfo *dpi);
|
||||
static void window_ride_list_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, sint32 scrollIndex);
|
||||
static void window_ride_list_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, int32_t scrollIndex);
|
||||
|
||||
static rct_window_event_list window_ride_list_events = {
|
||||
nullptr,
|
||||
|
@ -183,7 +183,7 @@ static constexpr const rct_string_id page_names[] = {
|
|||
};
|
||||
// clang-format on
|
||||
|
||||
static sint32 _window_ride_list_information_type;
|
||||
static int32_t _window_ride_list_information_type;
|
||||
|
||||
static void window_ride_list_draw_tab_images(rct_drawpixelinfo *dpi, rct_window *w);
|
||||
static void window_ride_list_close_all(rct_window *w);
|
||||
|
@ -320,15 +320,15 @@ static void window_ride_list_mousedown(rct_window *w, rct_widgetindex widgetInde
|
|||
} else if (widgetIndex == WIDX_INFORMATION_TYPE_DROPDOWN) {
|
||||
widget--;
|
||||
|
||||
sint32 lastType;
|
||||
int32_t lastType;
|
||||
if (w->page == PAGE_RIDES)
|
||||
lastType = INFORMATION_TYPE_GUESTS_FAVOURITE;
|
||||
else
|
||||
lastType = INFORMATION_TYPE_RUNNING_COST;
|
||||
|
||||
sint32 numItems = 0;
|
||||
sint32 selectedIndex = -1;
|
||||
for (sint32 type = INFORMATION_TYPE_STATUS; type <= lastType; type++) {
|
||||
int32_t numItems = 0;
|
||||
int32_t selectedIndex = -1;
|
||||
for (int32_t type = INFORMATION_TYPE_STATUS; type <= lastType; type++) {
|
||||
if ((gParkFlags & PARK_FLAGS_NO_MONEY)) {
|
||||
if (ride_info_type_money_mapping[type]) {
|
||||
continue;
|
||||
|
@ -364,7 +364,7 @@ static void window_ride_list_mousedown(rct_window *w, rct_widgetindex widgetInde
|
|||
*
|
||||
* rct2: 0x006B3547
|
||||
*/
|
||||
static void window_ride_list_dropdown(rct_window *w, rct_widgetindex widgetIndex, sint32 dropdownIndex)
|
||||
static void window_ride_list_dropdown(rct_window *w, rct_widgetindex widgetIndex, int32_t dropdownIndex)
|
||||
{
|
||||
if (widgetIndex == WIDX_OPEN_CLOSE_ALL)
|
||||
{
|
||||
|
@ -384,13 +384,13 @@ static void window_ride_list_dropdown(rct_window *w, rct_widgetindex widgetIndex
|
|||
if (dropdownIndex == -1)
|
||||
return;
|
||||
|
||||
sint32 informationType = INFORMATION_TYPE_STATUS;
|
||||
uint32 arg = (uint32)gDropdownItemsArgs[dropdownIndex];
|
||||
int32_t informationType = INFORMATION_TYPE_STATUS;
|
||||
uint32_t arg = (uint32_t)gDropdownItemsArgs[dropdownIndex];
|
||||
for (size_t i = 0; i < Util::CountOf(ride_info_type_string_mapping); i++)
|
||||
{
|
||||
if (arg == ride_info_type_string_mapping[i])
|
||||
{
|
||||
informationType = (sint32)i;
|
||||
informationType = (int32_t)i;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -415,9 +415,9 @@ static void window_ride_list_update(rct_window *w)
|
|||
*
|
||||
* rct2: 0x006B35A1
|
||||
*/
|
||||
static void window_ride_list_scrollgetsize(rct_window *w, sint32 scrollIndex, sint32 *width, sint32 *height)
|
||||
static void window_ride_list_scrollgetsize(rct_window *w, int32_t scrollIndex, int32_t *width, int32_t *height)
|
||||
{
|
||||
sint32 top;
|
||||
int32_t top;
|
||||
|
||||
*height = w->no_list_items * SCROLLABLE_ROW_HEIGHT;
|
||||
if (w->selected_list_item != -1) {
|
||||
|
@ -438,16 +438,16 @@ static void window_ride_list_scrollgetsize(rct_window *w, sint32 scrollIndex, si
|
|||
*
|
||||
* rct2: 0x006B361F
|
||||
*/
|
||||
static void window_ride_list_scrollmousedown(rct_window *w, sint32 scrollIndex, sint32 x, sint32 y)
|
||||
static void window_ride_list_scrollmousedown(rct_window *w, int32_t scrollIndex, int32_t x, int32_t y)
|
||||
{
|
||||
sint32 index;
|
||||
int32_t index;
|
||||
|
||||
index = y / SCROLLABLE_ROW_HEIGHT;
|
||||
if (index >= w->no_list_items)
|
||||
return;
|
||||
|
||||
// Open ride window
|
||||
uint8 rideIndex = w->list_item_positions[index];
|
||||
uint8_t rideIndex = w->list_item_positions[index];
|
||||
if (_quickDemolishMode && network_get_mode() != NETWORK_MODE_CLIENT) {
|
||||
ride_action_modify(rideIndex, RIDE_MODIFY_DEMOLISH, GAME_COMMAND_FLAG_APPLY);
|
||||
window_ride_list_refresh_list(w);
|
||||
|
@ -463,9 +463,9 @@ static void window_ride_list_scrollmousedown(rct_window *w, sint32 scrollIndex,
|
|||
*
|
||||
* rct2: 0x006B35EF
|
||||
*/
|
||||
static void window_ride_list_scrollmouseover(rct_window *w, sint32 scrollIndex, sint32 x, sint32 y)
|
||||
static void window_ride_list_scrollmouseover(rct_window *w, int32_t scrollIndex, int32_t x, int32_t y)
|
||||
{
|
||||
sint32 index;
|
||||
int32_t index;
|
||||
|
||||
index = y / SCROLLABLE_ROW_HEIGHT;
|
||||
if (index >= w->no_list_items)
|
||||
|
@ -493,7 +493,7 @@ static void window_ride_list_invalidate(rct_window *w)
|
|||
window_ride_list_widgets[WIDX_CURRENT_INFORMATION_TYPE].text = ride_info_type_string_mapping[_window_ride_list_information_type];
|
||||
|
||||
// Set correct active tab
|
||||
for (sint32 i = 0; i < 3; i++)
|
||||
for (int32_t i = 0; i < 3; i++)
|
||||
w->pressed_widgets &= ~(1 << (WIDX_TAB_1 + i));
|
||||
w->pressed_widgets |= 1LL << (WIDX_TAB_1 + w->page);
|
||||
|
||||
|
@ -527,9 +527,9 @@ static void window_ride_list_invalidate(rct_window *w)
|
|||
w->widgets[WIDX_CLOSE_LIGHT].type = WWT_IMGBTN;
|
||||
w->widgets[WIDX_OPEN_LIGHT].type = WWT_IMGBTN;
|
||||
|
||||
sint8 allClosed = -1;
|
||||
sint8 allOpen = -1;
|
||||
sint32 i;
|
||||
int8_t allClosed = -1;
|
||||
int8_t allOpen = -1;
|
||||
int32_t i;
|
||||
Ride *ride;
|
||||
FOR_ALL_RIDES(i, ride) {
|
||||
if (w->page != gRideClassifications[ride->type])
|
||||
|
@ -574,9 +574,9 @@ static void window_ride_list_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
|||
*
|
||||
* rct2: 0x006B3240
|
||||
*/
|
||||
static void window_ride_list_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, sint32 scrollIndex)
|
||||
static void window_ride_list_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, int32_t scrollIndex)
|
||||
{
|
||||
sint32 i, y, argument;
|
||||
int32_t i, y, argument;
|
||||
rct_string_id format, formatSecondary;
|
||||
Ride *ride;
|
||||
|
||||
|
@ -597,7 +597,7 @@ static void window_ride_list_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi,
|
|||
|
||||
// Ride name
|
||||
set_format_arg(0, rct_string_id, ride->name);
|
||||
set_format_arg(2, uint32, ride->name_arguments);
|
||||
set_format_arg(2, uint32_t, ride->name_arguments);
|
||||
gfx_draw_string_left_clipped(dpi, format, gCommonFormatArgs, COLOUR_BLACK, 0, y - 1, 159);
|
||||
|
||||
// Ride information
|
||||
|
@ -605,75 +605,75 @@ static void window_ride_list_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi,
|
|||
switch (_window_ride_list_information_type) {
|
||||
case INFORMATION_TYPE_STATUS:
|
||||
ride_get_status(w->list_item_positions[i], &formatSecondary, &argument);
|
||||
set_format_arg(2, sint32, argument);
|
||||
set_format_arg(2, int32_t, argument);
|
||||
break;
|
||||
case INFORMATION_TYPE_POPULARITY:
|
||||
formatSecondary = STR_POPULARITY_UNKNOWN_LABEL;
|
||||
if (ride->popularity != 255) {
|
||||
formatSecondary = STR_POPULARITY_LABEL;
|
||||
set_format_arg(2, uint16, ride->popularity * 4);
|
||||
set_format_arg(2, uint16_t, ride->popularity * 4);
|
||||
}
|
||||
break;
|
||||
case INFORMATION_TYPE_SATISFACTION:
|
||||
formatSecondary = STR_SATISFACTION_UNKNOWN_LABEL;
|
||||
if (ride->satisfaction != 255) {
|
||||
formatSecondary = STR_SATISFACTION_LABEL;
|
||||
set_format_arg(2, uint16, ride->satisfaction * 5);
|
||||
set_format_arg(2, uint16_t, ride->satisfaction * 5);
|
||||
}
|
||||
break;
|
||||
case INFORMATION_TYPE_PROFIT:
|
||||
formatSecondary = 0;
|
||||
if (ride->profit != MONEY32_UNDEFINED) {
|
||||
formatSecondary = STR_PROFIT_LABEL;
|
||||
set_format_arg(2, sint32, ride->profit);
|
||||
set_format_arg(2, int32_t, ride->profit);
|
||||
}
|
||||
break;
|
||||
case INFORMATION_TYPE_TOTAL_CUSTOMERS:
|
||||
formatSecondary = STR_RIDE_LIST_TOTAL_CUSTOMERS_LABEL;
|
||||
set_format_arg(2, uint32, ride->total_customers);
|
||||
set_format_arg(2, uint32_t, ride->total_customers);
|
||||
break;
|
||||
case INFORMATION_TYPE_TOTAL_PROFIT:
|
||||
formatSecondary = 0;
|
||||
if (ride->total_profit != MONEY32_UNDEFINED) {
|
||||
formatSecondary = STR_RIDE_LIST_TOTAL_PROFIT_LABEL;
|
||||
set_format_arg(2, sint32, ride->total_profit);
|
||||
set_format_arg(2, int32_t, ride->total_profit);
|
||||
}
|
||||
break;
|
||||
case INFORMATION_TYPE_CUSTOMERS:
|
||||
formatSecondary = STR_RIDE_LIST_CUSTOMERS_PER_HOUR_LABEL;
|
||||
set_format_arg(2, uint32, ride_customers_per_hour(ride));
|
||||
set_format_arg(2, uint32_t, ride_customers_per_hour(ride));
|
||||
break;
|
||||
case INFORMATION_TYPE_AGE:
|
||||
{
|
||||
sint16 age = date_get_year(gDateMonthsElapsed - ride->build_date);
|
||||
int16_t age = date_get_year(gDateMonthsElapsed - ride->build_date);
|
||||
switch (age) {
|
||||
case 0: formatSecondary = STR_RIDE_LIST_BUILT_THIS_YEAR_LABEL; break;
|
||||
case 1: formatSecondary = STR_RIDE_LIST_BUILT_LAST_YEAR_LABEL; break;
|
||||
default: formatSecondary = STR_RIDE_LIST_BUILT_X_YEARS_AGO_LABEL; break;
|
||||
}
|
||||
set_format_arg(2, sint16, age);
|
||||
set_format_arg(2, int16_t, age);
|
||||
break;
|
||||
}
|
||||
case INFORMATION_TYPE_INCOME:
|
||||
formatSecondary = 0;
|
||||
if (ride->income_per_hour != MONEY32_UNDEFINED) {
|
||||
formatSecondary = STR_RIDE_LIST_INCOME_LABEL;
|
||||
set_format_arg(2, sint32, ride->income_per_hour);
|
||||
set_format_arg(2, int32_t, ride->income_per_hour);
|
||||
}
|
||||
break;
|
||||
case INFORMATION_TYPE_RUNNING_COST:
|
||||
formatSecondary = STR_RIDE_LIST_RUNNING_COST_UNKNOWN;
|
||||
if (ride->upkeep_cost != (money16)(uint16)0xFFFF) {
|
||||
if (ride->upkeep_cost != (money16)(uint16_t)0xFFFF) {
|
||||
formatSecondary = STR_RIDE_LIST_RUNNING_COST_LABEL;
|
||||
set_format_arg(2, sint32, ride->upkeep_cost * 16);
|
||||
set_format_arg(2, int32_t, ride->upkeep_cost * 16);
|
||||
}
|
||||
break;
|
||||
case INFORMATION_TYPE_QUEUE_LENGTH:
|
||||
set_format_arg(2, uint16, ride_get_total_queue_length(ride));
|
||||
set_format_arg(2, uint16_t, ride_get_total_queue_length(ride));
|
||||
formatSecondary = STR_QUEUE_EMPTY;
|
||||
{
|
||||
uint16 arg;
|
||||
memcpy(&arg, gCommonFormatArgs + 2, sizeof(uint16));
|
||||
uint16_t arg;
|
||||
memcpy(&arg, gCommonFormatArgs + 2, sizeof(uint16_t));
|
||||
|
||||
if (arg == 1)
|
||||
formatSecondary = STR_QUEUE_ONE_PERSON;
|
||||
|
@ -682,28 +682,28 @@ static void window_ride_list_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi,
|
|||
}
|
||||
break;
|
||||
case INFORMATION_TYPE_QUEUE_TIME:
|
||||
set_format_arg(2, uint16, ride_get_max_queue_time(ride));
|
||||
set_format_arg(2, uint16_t, ride_get_max_queue_time(ride));
|
||||
formatSecondary = STR_QUEUE_TIME_LABEL;
|
||||
{
|
||||
uint16 arg;
|
||||
memcpy(&arg, gCommonFormatArgs + 2, sizeof(uint16));
|
||||
uint16_t arg;
|
||||
memcpy(&arg, gCommonFormatArgs + 2, sizeof(uint16_t));
|
||||
|
||||
if (arg > 1)
|
||||
formatSecondary = STR_QUEUE_TIME_PLURAL_LABEL;
|
||||
}
|
||||
break;
|
||||
case INFORMATION_TYPE_RELIABILITY:
|
||||
set_format_arg(2, uint16, ride->reliability_percentage);
|
||||
set_format_arg(2, uint16_t, ride->reliability_percentage);
|
||||
formatSecondary = STR_RELIABILITY_LABEL;
|
||||
break;
|
||||
case INFORMATION_TYPE_DOWN_TIME:
|
||||
set_format_arg(2, uint16, ride->downtime);
|
||||
set_format_arg(2, uint16_t, ride->downtime);
|
||||
formatSecondary = STR_DOWN_TIME_LABEL;
|
||||
break;
|
||||
case INFORMATION_TYPE_GUESTS_FAVOURITE:
|
||||
formatSecondary = 0;
|
||||
if (gRideClassifications[ride->type] == RIDE_CLASS_RIDE) {
|
||||
set_format_arg(2, uint16, ride->guests_favourite);
|
||||
set_format_arg(2, uint16_t, ride->guests_favourite);
|
||||
formatSecondary = ride->guests_favourite == 1 ? STR_GUESTS_FAVOURITE_LABEL : STR_GUESTS_FAVOURITE_PLURAL_LABEL;
|
||||
}
|
||||
break;
|
||||
|
@ -725,7 +725,7 @@ static void window_ride_list_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi,
|
|||
*/
|
||||
static void window_ride_list_draw_tab_images(rct_drawpixelinfo *dpi, rct_window *w)
|
||||
{
|
||||
sint32 sprite_idx;
|
||||
int32_t sprite_idx;
|
||||
|
||||
// Rides tab
|
||||
sprite_idx = SPR_TAB_RIDE_0;
|
||||
|
@ -754,10 +754,10 @@ static void window_ride_list_draw_tab_images(rct_drawpixelinfo *dpi, rct_window
|
|||
*/
|
||||
void window_ride_list_refresh_list(rct_window *w)
|
||||
{
|
||||
sint32 i;
|
||||
int32_t i;
|
||||
Ride *ride, *otherRide;
|
||||
char bufferA[128], bufferB[128];
|
||||
sint32 list_index = 0;
|
||||
int32_t list_index = 0;
|
||||
|
||||
FOR_ALL_RIDES(i, ride) {
|
||||
if (w->page != gRideClassifications[ride->type] || (ride->status == RIDE_STATUS_CLOSED && !ride_has_any_track_elements(i)))
|
||||
|
@ -768,7 +768,7 @@ void window_ride_list_refresh_list(rct_window *w)
|
|||
}
|
||||
|
||||
w->list_item_positions[list_index] = i;
|
||||
sint32 current_list_position = list_index;
|
||||
int32_t current_list_position = list_index;
|
||||
switch (w->list_information_type) {
|
||||
case INFORMATION_TYPE_STATUS:
|
||||
format_string_to_upper(bufferA, 128, ride->name, &ride->name_arguments);
|
||||
|
@ -919,7 +919,7 @@ void window_ride_list_refresh_list(rct_window *w)
|
|||
|
||||
static void window_ride_list_close_all(rct_window *w)
|
||||
{
|
||||
sint32 i;
|
||||
int32_t i;
|
||||
Ride *ride;
|
||||
|
||||
FOR_ALL_RIDES(i, ride) {
|
||||
|
@ -933,7 +933,7 @@ static void window_ride_list_close_all(rct_window *w)
|
|||
|
||||
static void window_ride_list_open_all(rct_window *w)
|
||||
{
|
||||
sint32 i;
|
||||
int32_t i;
|
||||
Ride *ride;
|
||||
|
||||
FOR_ALL_RIDES(i, ride) {
|
||||
|
|
|
@ -69,7 +69,7 @@ static constexpr const rct_string_id window_save_prompt_labels[][2] = {
|
|||
static void window_save_prompt_close(rct_window *w);
|
||||
static void window_save_prompt_mouseup(rct_window *w, rct_widgetindex widgetIndex);
|
||||
static void window_save_prompt_paint(rct_window *w, rct_drawpixelinfo *dpi);
|
||||
static void window_save_prompt_callback(sint32 result, const utf8 * path);
|
||||
static void window_save_prompt_callback(int32_t result, const utf8 * path);
|
||||
|
||||
static rct_window_event_list window_save_prompt_events = {
|
||||
window_save_prompt_close,
|
||||
|
@ -109,12 +109,12 @@ static rct_window_event_list window_save_prompt_events = {
|
|||
*/
|
||||
rct_window * window_save_prompt_open()
|
||||
{
|
||||
sint32 width, height;
|
||||
int32_t width, height;
|
||||
rct_string_id stringId;
|
||||
rct_window* window;
|
||||
uint8 prompt_mode;
|
||||
uint8_t prompt_mode;
|
||||
rct_widget *widgets;
|
||||
uint64 enabled_widgets;
|
||||
uint64_t enabled_widgets;
|
||||
|
||||
prompt_mode = gSavePromptMode;
|
||||
if (prompt_mode == PM_QUIT)
|
||||
|
@ -264,7 +264,7 @@ static void window_save_prompt_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
|||
window_draw_widgets(w, dpi);
|
||||
}
|
||||
|
||||
static void window_save_prompt_callback(sint32 result, const utf8 * path)
|
||||
static void window_save_prompt_callback(int32_t result, const utf8 * path)
|
||||
{
|
||||
if (result == MODAL_RESULT_OK) {
|
||||
game_load_or_quit_no_save_prompt();
|
||||
|
|
|
@ -59,16 +59,16 @@ static void window_scenery_close(rct_window *w);
|
|||
static void window_scenery_mouseup(rct_window *w, rct_widgetindex widgetIndex);
|
||||
static void window_scenery_resize(rct_window *w);
|
||||
static void window_scenery_mousedown(rct_window *w, rct_widgetindex widgetIndex, rct_widget* widget);
|
||||
static void window_scenery_dropdown(rct_window *w, rct_widgetindex widgetIndex, sint32 dropdownIndex);
|
||||
static void window_scenery_dropdown(rct_window *w, rct_widgetindex widgetIndex, int32_t dropdownIndex);
|
||||
static void window_scenery_update(rct_window *w);
|
||||
static void window_scenery_event_07(rct_window *w);
|
||||
static void window_scenery_scrollgetsize(rct_window *w, sint32 scrollIndex, sint32 *width, sint32 *height);
|
||||
static void window_scenery_scrollmousedown(rct_window *w, sint32 scrollIndex, sint32 x, sint32 y);
|
||||
static void window_scenery_scrollmouseover(rct_window *w, sint32 scrollIndex, sint32 x, sint32 y);
|
||||
static void window_scenery_scrollgetsize(rct_window *w, int32_t scrollIndex, int32_t *width, int32_t *height);
|
||||
static void window_scenery_scrollmousedown(rct_window *w, int32_t scrollIndex, int32_t x, int32_t y);
|
||||
static void window_scenery_scrollmouseover(rct_window *w, int32_t scrollIndex, int32_t x, int32_t y);
|
||||
static void window_scenery_tooltip(rct_window* w, rct_widgetindex widgetIndex, rct_string_id *stringId);
|
||||
static void window_scenery_invalidate(rct_window *w);
|
||||
static void window_scenery_paint(rct_window *w, rct_drawpixelinfo *dpi);
|
||||
static void window_scenery_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, sint32 scrollIndex);
|
||||
static void window_scenery_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, int32_t scrollIndex);
|
||||
|
||||
static rct_window_event_list window_scenery_events = {
|
||||
window_scenery_close,
|
||||
|
@ -180,17 +180,17 @@ static rct_widget window_scenery_widgets[] = {
|
|||
void window_scenery_update_scroll(rct_window *w);
|
||||
|
||||
// rct2: 0x00F64F2C
|
||||
static sint16 window_scenery_tab_entries[SCENERY_WINDOW_TABS][SCENERY_ENTRIES_BY_TAB + 1];
|
||||
static int16_t window_scenery_tab_entries[SCENERY_WINDOW_TABS][SCENERY_ENTRIES_BY_TAB + 1];
|
||||
|
||||
/**
|
||||
* Was part of 0x006DFA00
|
||||
* The same code repeated five times for every scenery entry type
|
||||
*/
|
||||
static void init_scenery_entry(rct_scenery_entry *sceneryEntry, sint32 index, uint8 sceneryTabId)
|
||||
static void init_scenery_entry(rct_scenery_entry *sceneryEntry, int32_t index, uint8_t sceneryTabId)
|
||||
{
|
||||
if (scenery_is_invented(index) || gCheatsIgnoreResearchStatus) {
|
||||
if (sceneryTabId != 0xFF) {
|
||||
for (sint32 i = 0; i < SCENERY_ENTRIES_BY_TAB; i++) {
|
||||
for (int32_t i = 0; i < SCENERY_ENTRIES_BY_TAB; i++) {
|
||||
if (window_scenery_tab_entries[sceneryTabId][i] == -1)
|
||||
{
|
||||
window_scenery_tab_entries[sceneryTabId][i] = index;
|
||||
|
@ -200,8 +200,8 @@ static void init_scenery_entry(rct_scenery_entry *sceneryEntry, sint32 index, ui
|
|||
}
|
||||
}
|
||||
|
||||
for (sint32 i = 0; i < SCENERY_WINDOW_TABS - 1; i++) {
|
||||
sint32 counter = 0;
|
||||
for (int32_t i = 0; i < SCENERY_WINDOW_TABS - 1; i++) {
|
||||
int32_t counter = 0;
|
||||
|
||||
while (window_scenery_tab_entries[i][counter] != -1)
|
||||
{
|
||||
|
@ -213,7 +213,7 @@ static void init_scenery_entry(rct_scenery_entry *sceneryEntry, sint32 index, ui
|
|||
}
|
||||
}
|
||||
|
||||
for (sint32 i = 0; i < SCENERY_ENTRIES_BY_TAB; i++) {
|
||||
for (int32_t i = 0; i < SCENERY_ENTRIES_BY_TAB; i++) {
|
||||
if (window_scenery_tab_entries[SCENERY_WINDOW_TABS - 1][i] == -1)
|
||||
{
|
||||
window_scenery_tab_entries[SCENERY_WINDOW_TABS - 1][i] = index;
|
||||
|
@ -232,7 +232,7 @@ void window_scenery_init()
|
|||
{
|
||||
bool enabledScenerySets[SCENERY_WINDOW_TABS] = { false };
|
||||
|
||||
for (sint32 scenerySetIndex = 0; scenerySetIndex < SCENERY_WINDOW_TABS; scenerySetIndex++) {
|
||||
for (int32_t scenerySetIndex = 0; scenerySetIndex < SCENERY_WINDOW_TABS; scenerySetIndex++) {
|
||||
window_scenery_tab_entries[scenerySetIndex][0] = -1;
|
||||
if (scenerySetIndex == MAX_SCENERY_GROUP_OBJECTS)
|
||||
continue;
|
||||
|
@ -241,9 +241,9 @@ void window_scenery_init()
|
|||
if (sceneryGroupEntry == nullptr)
|
||||
continue;
|
||||
|
||||
sint32 sceneryTabEntryCount = 0;
|
||||
for (sint32 i = 0; i < sceneryGroupEntry->entry_count; i++) {
|
||||
uint16 sceneryEntryId = sceneryGroupEntry->scenery_entries[i];
|
||||
int32_t sceneryTabEntryCount = 0;
|
||||
for (int32_t i = 0; i < sceneryGroupEntry->entry_count; i++) {
|
||||
uint16_t sceneryEntryId = sceneryGroupEntry->scenery_entries[i];
|
||||
if (scenery_is_invented(sceneryEntryId) || gCheatsIgnoreResearchStatus) {
|
||||
window_scenery_tab_entries[scenerySetIndex][sceneryTabEntryCount] = sceneryEntryId;
|
||||
window_scenery_tab_entries[scenerySetIndex][++sceneryTabEntryCount] = -1;
|
||||
|
@ -254,7 +254,7 @@ void window_scenery_init()
|
|||
}
|
||||
|
||||
// small scenery
|
||||
for (uint16 sceneryId = SCENERY_SMALL_SCENERY_ID_MIN; sceneryId < SCENERY_SMALL_SCENERY_ID_MAX; sceneryId++) {
|
||||
for (uint16_t sceneryId = SCENERY_SMALL_SCENERY_ID_MIN; sceneryId < SCENERY_SMALL_SCENERY_ID_MAX; sceneryId++) {
|
||||
if (get_small_scenery_entry(sceneryId) == nullptr)
|
||||
continue;
|
||||
|
||||
|
@ -263,8 +263,8 @@ void window_scenery_init()
|
|||
}
|
||||
|
||||
// large scenery
|
||||
for (sint32 sceneryId = SCENERY_LARGE_SCENERY_ID_MIN; sceneryId < SCENERY_LARGE_SCENERY_ID_MAX; sceneryId++) {
|
||||
sint32 largeSceneryIndex = sceneryId - SCENERY_LARGE_SCENERY_ID_MIN;
|
||||
for (int32_t sceneryId = SCENERY_LARGE_SCENERY_ID_MIN; sceneryId < SCENERY_LARGE_SCENERY_ID_MAX; sceneryId++) {
|
||||
int32_t largeSceneryIndex = sceneryId - SCENERY_LARGE_SCENERY_ID_MIN;
|
||||
|
||||
if (get_large_scenery_entry(largeSceneryIndex) == nullptr)
|
||||
continue;
|
||||
|
@ -274,8 +274,8 @@ void window_scenery_init()
|
|||
}
|
||||
|
||||
// walls
|
||||
for (sint32 sceneryId = SCENERY_WALLS_ID_MIN; sceneryId < SCENERY_WALLS_ID_MAX; sceneryId++) {
|
||||
sint32 wallSceneryIndex = sceneryId - SCENERY_WALLS_ID_MIN;
|
||||
for (int32_t sceneryId = SCENERY_WALLS_ID_MIN; sceneryId < SCENERY_WALLS_ID_MAX; sceneryId++) {
|
||||
int32_t wallSceneryIndex = sceneryId - SCENERY_WALLS_ID_MIN;
|
||||
|
||||
if (get_wall_entry(wallSceneryIndex) == nullptr)
|
||||
continue;
|
||||
|
@ -285,8 +285,8 @@ void window_scenery_init()
|
|||
}
|
||||
|
||||
// banners
|
||||
for (sint32 sceneryId = SCENERY_BANNERS_ID_MIN; sceneryId < SCENERY_BANNERS_ID_MAX; sceneryId++) {
|
||||
sint32 bannerIndex = sceneryId - SCENERY_BANNERS_ID_MIN;
|
||||
for (int32_t sceneryId = SCENERY_BANNERS_ID_MIN; sceneryId < SCENERY_BANNERS_ID_MAX; sceneryId++) {
|
||||
int32_t bannerIndex = sceneryId - SCENERY_BANNERS_ID_MIN;
|
||||
|
||||
if (get_banner_entry(bannerIndex) == nullptr)
|
||||
continue;
|
||||
|
@ -296,8 +296,8 @@ void window_scenery_init()
|
|||
}
|
||||
|
||||
// path bits
|
||||
for (sint32 sceneryId = SCENERY_PATH_SCENERY_ID_MIN; sceneryId < SCENERY_PATH_SCENERY_ID_MAX; sceneryId++) {
|
||||
sint32 pathBitIndex = sceneryId - SCENERY_PATH_SCENERY_ID_MIN;
|
||||
for (int32_t sceneryId = SCENERY_PATH_SCENERY_ID_MIN; sceneryId < SCENERY_PATH_SCENERY_ID_MAX; sceneryId++) {
|
||||
int32_t pathBitIndex = sceneryId - SCENERY_PATH_SCENERY_ID_MIN;
|
||||
|
||||
if (get_footpath_item_entry(pathBitIndex) == nullptr)
|
||||
continue;
|
||||
|
@ -309,11 +309,11 @@ void window_scenery_init()
|
|||
for (rct_widgetindex widgetIndex = WIDX_SCENERY_TAB_1; widgetIndex < WIDX_SCENERY_LIST; widgetIndex++)
|
||||
window_scenery_widgets[widgetIndex].type = WWT_EMPTY;
|
||||
|
||||
uint8 tabIndexes[SCENERY_WINDOW_TABS];
|
||||
uint8 order[SCENERY_WINDOW_TABS];
|
||||
sint32 usedValues = 0;
|
||||
uint8_t tabIndexes[SCENERY_WINDOW_TABS];
|
||||
uint8_t order[SCENERY_WINDOW_TABS];
|
||||
int32_t usedValues = 0;
|
||||
|
||||
for (sint32 scenerySetId = 0; scenerySetId < MAX_SCENERY_GROUP_OBJECTS; scenerySetId++) {
|
||||
for (int32_t scenerySetId = 0; scenerySetId < MAX_SCENERY_GROUP_OBJECTS; scenerySetId++) {
|
||||
rct_scenery_group_entry* sceneryEntry = get_scenery_group_entry(scenerySetId);
|
||||
if (sceneryEntry == nullptr)
|
||||
continue;
|
||||
|
@ -326,9 +326,9 @@ void window_scenery_init()
|
|||
|
||||
while (true) {
|
||||
bool finished = true;
|
||||
for (sint32 i = 1; i < usedValues; i++) {
|
||||
for (int32_t i = 1; i < usedValues; i++) {
|
||||
if (order[i - 1] > order[i]) {
|
||||
uint8 tmp = tabIndexes[i - 1];
|
||||
uint8_t tmp = tabIndexes[i - 1];
|
||||
tabIndexes[i - 1] = tabIndexes[i];
|
||||
tabIndexes[i] = tmp;
|
||||
tmp = order[i - 1];
|
||||
|
@ -345,9 +345,9 @@ void window_scenery_init()
|
|||
tabIndexes[usedValues] = SCENERY_WINDOW_TABS - 1;
|
||||
usedValues++;
|
||||
|
||||
uint16 left = 3;
|
||||
for (sint32 i = 0; i < usedValues; i ++) {
|
||||
uint32 tabIndex = tabIndexes[i];
|
||||
uint16_t left = 3;
|
||||
for (int32_t i = 0; i < usedValues; i ++) {
|
||||
uint32_t tabIndex = tabIndexes[i];
|
||||
rct_widget* tabWidget = &window_scenery_widgets[tabIndex + WIDX_SCENERY_TAB_1];
|
||||
|
||||
if (left != 3 || tabIndex != SCENERY_WINDOW_TABS - 1) {
|
||||
|
@ -384,17 +384,17 @@ void window_scenery_set_default_placement_configuration()
|
|||
gWindowSceneryTertiaryColour = COLOUR_DARK_BROWN;
|
||||
window_scenery_init();
|
||||
|
||||
for (sint32 i = 0; i < SCENERY_WINDOW_TABS; i++)
|
||||
for (int32_t i = 0; i < SCENERY_WINDOW_TABS; i++)
|
||||
gWindowSceneryTabSelections[i] = WINDOW_SCENERY_TAB_SELECTION_UNDEFINED;
|
||||
|
||||
for (sint32 i = 0; i < SCENERY_WINDOW_TABS; i++) {
|
||||
for (int32_t i = 0; i < SCENERY_WINDOW_TABS; i++) {
|
||||
if (window_scenery_tab_entries[i][0] != -1) {
|
||||
gWindowSceneryActiveTabIndex = i;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
for (sint32 i = 0; i < 16; i++) {
|
||||
for (int32_t i = 0; i < 16; i++) {
|
||||
rct_widget *tabWidget = &window_scenery_widgets[WIDX_SCENERY_TAB_1 + i];
|
||||
if (tabWidget->type != WWT_EMPTY) {
|
||||
gWindowSceneryActiveTabIndex = i;
|
||||
|
@ -497,24 +497,24 @@ void window_scenery_close(rct_window *w)
|
|||
tool_cancel();
|
||||
}
|
||||
|
||||
static sint32 count_rows(sint32 items){
|
||||
sint32 rows = items / 9;
|
||||
static int32_t count_rows(int32_t items){
|
||||
int32_t rows = items / 9;
|
||||
|
||||
return rows;
|
||||
}
|
||||
|
||||
struct scenery_item {
|
||||
sint32 allRows;
|
||||
sint32 selected_item;
|
||||
sint16 sceneryId;
|
||||
int32_t allRows;
|
||||
int32_t selected_item;
|
||||
int16_t sceneryId;
|
||||
};
|
||||
|
||||
static scenery_item window_scenery_count_rows_with_selected_item(sint32 tabIndex)
|
||||
static scenery_item window_scenery_count_rows_with_selected_item(int32_t tabIndex)
|
||||
{
|
||||
scenery_item sceneryItem = { 0, 0, -1 };
|
||||
sint32 totalItems = 0;
|
||||
sint16 id = 0;
|
||||
sint16 sceneryId = gWindowSceneryTabSelections[tabIndex];
|
||||
int32_t totalItems = 0;
|
||||
int16_t id = 0;
|
||||
int16_t sceneryId = gWindowSceneryTabSelections[tabIndex];
|
||||
|
||||
while ((id = window_scenery_tab_entries[tabIndex][totalItems]) != -1){
|
||||
if (id == sceneryId){
|
||||
|
@ -527,20 +527,20 @@ static scenery_item window_scenery_count_rows_with_selected_item(sint32 tabIndex
|
|||
return sceneryItem;
|
||||
}
|
||||
|
||||
static sint32 window_scenery_count_rows()
|
||||
static int32_t window_scenery_count_rows()
|
||||
{
|
||||
sint32 tabIndex = gWindowSceneryActiveTabIndex;
|
||||
sint32 totalItems = 0;
|
||||
int32_t tabIndex = gWindowSceneryActiveTabIndex;
|
||||
int32_t totalItems = 0;
|
||||
|
||||
while (window_scenery_tab_entries[tabIndex][totalItems] != -1){
|
||||
totalItems++;
|
||||
}
|
||||
|
||||
sint32 rows = count_rows(totalItems + 8);
|
||||
int32_t rows = count_rows(totalItems + 8);
|
||||
return rows;
|
||||
}
|
||||
|
||||
static sint32 window_scenery_rows_height(sint32 rows)
|
||||
static int32_t window_scenery_rows_height(int32_t rows)
|
||||
{
|
||||
return rows * SCENERY_BUTTON_HEIGHT;
|
||||
}
|
||||
|
@ -596,23 +596,23 @@ static void window_scenery_mouseup(rct_window *w, rct_widgetindex widgetIndex)
|
|||
*/
|
||||
void window_scenery_update_scroll(rct_window *w)
|
||||
{
|
||||
sint32 tabIndex = gWindowSceneryActiveTabIndex;
|
||||
sint32 listHeight = w->height - 14 - window_scenery_widgets[WIDX_SCENERY_LIST].top - 1;
|
||||
int32_t tabIndex = gWindowSceneryActiveTabIndex;
|
||||
int32_t listHeight = w->height - 14 - window_scenery_widgets[WIDX_SCENERY_LIST].top - 1;
|
||||
|
||||
scenery_item sceneryItem = window_scenery_count_rows_with_selected_item(tabIndex);
|
||||
w->scrolls[0].v_bottom = window_scenery_rows_height(sceneryItem.allRows) + 1;
|
||||
|
||||
sint32 maxTop = std::max(0, w->scrolls[0].v_bottom - listHeight);
|
||||
sint32 rowSelected = count_rows(sceneryItem.selected_item);
|
||||
int32_t maxTop = std::max(0, w->scrolls[0].v_bottom - listHeight);
|
||||
int32_t rowSelected = count_rows(sceneryItem.selected_item);
|
||||
if (sceneryItem.sceneryId == -1) {
|
||||
rowSelected = 0;
|
||||
sint16 sceneryId = window_scenery_tab_entries[tabIndex][0];
|
||||
int16_t sceneryId = window_scenery_tab_entries[tabIndex][0];
|
||||
if (sceneryId != -1)
|
||||
gWindowSceneryTabSelections[tabIndex] = sceneryId;
|
||||
}
|
||||
|
||||
w->scrolls[0].v_top = window_scenery_rows_height(rowSelected);
|
||||
w->scrolls[0].v_top = std::min<sint32>(maxTop, w->scrolls[0].v_top);
|
||||
w->scrolls[0].v_top = std::min<int32_t>(maxTop, w->scrolls[0].v_top);
|
||||
|
||||
widget_scroll_update_thumbs(w, WIDX_SCENERY_LIST);
|
||||
}
|
||||
|
@ -686,19 +686,19 @@ static void window_scenery_mousedown(rct_window *w, rct_widgetindex widgetIndex,
|
|||
*
|
||||
* rct2: 0x006E1A54
|
||||
*/
|
||||
static void window_scenery_dropdown(rct_window *w, rct_widgetindex widgetIndex, sint32 dropdownIndex)
|
||||
static void window_scenery_dropdown(rct_window *w, rct_widgetindex widgetIndex, int32_t dropdownIndex)
|
||||
{
|
||||
if (dropdownIndex == -1)
|
||||
return;
|
||||
|
||||
if (widgetIndex == WIDX_SCENERY_PRIMARY_COLOUR_BUTTON) {
|
||||
gWindowSceneryPrimaryColour = (uint8)dropdownIndex;
|
||||
gWindowSceneryPrimaryColour = (uint8_t)dropdownIndex;
|
||||
}
|
||||
else if (widgetIndex == WIDX_SCENERY_SECONDARY_COLOUR_BUTTON) {
|
||||
gWindowScenerySecondaryColour = (uint8)dropdownIndex;
|
||||
gWindowScenerySecondaryColour = (uint8_t)dropdownIndex;
|
||||
}
|
||||
else if (widgetIndex == WIDX_SCENERY_TERTIARY_COLOUR_BUTTON) {
|
||||
gWindowSceneryTertiaryColour = (uint8)dropdownIndex;
|
||||
gWindowSceneryTertiaryColour = (uint8_t)dropdownIndex;
|
||||
}
|
||||
|
||||
window_invalidate(w);
|
||||
|
@ -724,8 +724,8 @@ static void window_scenery_update(rct_window *w)
|
|||
const CursorState * state = context_get_cursor_state();
|
||||
rct_window *other = window_find_from_point(state->x, state->y);
|
||||
if (other == w) {
|
||||
sint32 window_x = state->x - w->x + 26;
|
||||
sint32 window_y = state->y - w->y;
|
||||
int32_t window_x = state->x - w->x + 26;
|
||||
int32_t window_y = state->y - w->y;
|
||||
|
||||
if (window_y < 44 || window_x <= w->width) {
|
||||
rct_widgetindex widgetIndex = window_find_widget_from_point(w, state->x, state->y);
|
||||
|
@ -739,7 +739,7 @@ static void window_scenery_update(rct_window *w)
|
|||
w->max_height = WINDOW_SCENERY_HEIGHT;
|
||||
}
|
||||
} else {
|
||||
sint32 windowHeight = std::min(463, w->scrolls[0].v_bottom + 62);
|
||||
int32_t windowHeight = std::min(463, w->scrolls[0].v_bottom + 62);
|
||||
if (context_get_height() < 600)
|
||||
windowHeight = std::min(374, windowHeight);
|
||||
windowHeight = std::max(WINDOW_SCENERY_HEIGHT, windowHeight);
|
||||
|
@ -773,8 +773,8 @@ static void window_scenery_update(rct_window *w)
|
|||
} else if (gWindowSceneryPaintEnabled == 1) { // the repaint scenery tool is active
|
||||
gCurrentToolId = TOOL_PAINT_DOWN;
|
||||
} else {
|
||||
uint16 tabIndex = gWindowSceneryActiveTabIndex;
|
||||
sint16 tabSelectedSceneryId = gWindowSceneryTabSelections[tabIndex];
|
||||
uint16_t tabIndex = gWindowSceneryActiveTabIndex;
|
||||
int16_t tabSelectedSceneryId = gWindowSceneryTabSelections[tabIndex];
|
||||
|
||||
if (tabSelectedSceneryId != -1) {
|
||||
if (tabSelectedSceneryId >= 0x400) { // banner
|
||||
|
@ -796,19 +796,19 @@ static void window_scenery_update(rct_window *w)
|
|||
*
|
||||
* rct2: 0x006E1A91
|
||||
*/
|
||||
void window_scenery_scrollgetsize(rct_window *w, sint32 scrollIndex, sint32 *width, sint32 *height)
|
||||
void window_scenery_scrollgetsize(rct_window *w, int32_t scrollIndex, int32_t *width, int32_t *height)
|
||||
{
|
||||
sint32 rows = window_scenery_count_rows();
|
||||
int32_t rows = window_scenery_count_rows();
|
||||
*height = window_scenery_rows_height(rows);
|
||||
}
|
||||
|
||||
static sint16 get_scenery_id_by_cursor_pos(sint16 x, sint16 y)
|
||||
static int16_t get_scenery_id_by_cursor_pos(int16_t x, int16_t y)
|
||||
{
|
||||
sint32 tabSceneryIndex = x / SCENERY_BUTTON_WIDTH + (y / SCENERY_BUTTON_HEIGHT) * 9;
|
||||
uint8 tabIndex = gWindowSceneryActiveTabIndex;
|
||||
int32_t tabSceneryIndex = x / SCENERY_BUTTON_WIDTH + (y / SCENERY_BUTTON_HEIGHT) * 9;
|
||||
uint8_t tabIndex = gWindowSceneryActiveTabIndex;
|
||||
|
||||
sint32 itemCounter = 0;
|
||||
sint16 sceneryId = 0;
|
||||
int32_t itemCounter = 0;
|
||||
int16_t sceneryId = 0;
|
||||
while (itemCounter <= tabSceneryIndex) {
|
||||
sceneryId = window_scenery_tab_entries[tabIndex][itemCounter];
|
||||
if (sceneryId == -1)
|
||||
|
@ -824,13 +824,13 @@ static sint16 get_scenery_id_by_cursor_pos(sint16 x, sint16 y)
|
|||
*
|
||||
* rct2: 0x006E1C4A
|
||||
*/
|
||||
void window_scenery_scrollmousedown(rct_window *w, sint32 scrollIndex, sint32 x, sint32 y)
|
||||
void window_scenery_scrollmousedown(rct_window *w, int32_t scrollIndex, int32_t x, int32_t y)
|
||||
{
|
||||
sint16 sceneryId = get_scenery_id_by_cursor_pos(x, y);
|
||||
int16_t sceneryId = get_scenery_id_by_cursor_pos(x, y);
|
||||
if (sceneryId == -1)
|
||||
return;
|
||||
|
||||
uint8 tabIndex = gWindowSceneryActiveTabIndex;
|
||||
uint8_t tabIndex = gWindowSceneryActiveTabIndex;
|
||||
gWindowSceneryTabSelections[tabIndex] = sceneryId;
|
||||
|
||||
gWindowSceneryPaintEnabled &= 0xFE;
|
||||
|
@ -845,9 +845,9 @@ void window_scenery_scrollmousedown(rct_window *w, sint32 scrollIndex, sint32 x,
|
|||
*
|
||||
* rct2: 0x006E1BB8
|
||||
*/
|
||||
void window_scenery_scrollmouseover(rct_window *w, sint32 scrollIndex, sint32 x, sint32 y)
|
||||
void window_scenery_scrollmouseover(rct_window *w, int32_t scrollIndex, int32_t x, int32_t y)
|
||||
{
|
||||
sint16 sceneryId = get_scenery_id_by_cursor_pos(x, y);
|
||||
int16_t sceneryId = get_scenery_id_by_cursor_pos(x, y);
|
||||
if (sceneryId != -1) {
|
||||
w->scenery.selected_scenery_id = sceneryId;
|
||||
window_invalidate(w);
|
||||
|
@ -862,7 +862,7 @@ void window_scenery_tooltip(rct_window* w, rct_widgetindex widgetIndex, rct_stri
|
|||
{
|
||||
switch (widgetIndex) {
|
||||
case WIDX_SCENERY_LIST:
|
||||
set_format_arg(0, uint16, STR_LIST);
|
||||
set_format_arg(0, uint16_t, STR_LIST);
|
||||
break;
|
||||
case WIDX_SCENERY_TAB_1:
|
||||
case WIDX_SCENERY_TAB_2:
|
||||
|
@ -897,8 +897,8 @@ void window_scenery_tooltip(rct_window* w, rct_widgetindex widgetIndex, rct_stri
|
|||
*/
|
||||
void window_scenery_invalidate(rct_window *w)
|
||||
{
|
||||
uint16 tabIndex = gWindowSceneryActiveTabIndex;
|
||||
uint32 titleStringId = STR_MISCELLANEOUS;
|
||||
uint16_t tabIndex = gWindowSceneryActiveTabIndex;
|
||||
uint32_t titleStringId = STR_MISCELLANEOUS;
|
||||
if (tabIndex < SCENERY_WINDOW_TABS - 1) {
|
||||
rct_scenery_group_entry * sgEntry = get_scenery_group_entry(tabIndex);
|
||||
if (sgEntry != nullptr) {
|
||||
|
@ -925,7 +925,7 @@ void window_scenery_invalidate(rct_window *w)
|
|||
window_scenery_widgets[WIDX_SCENERY_EYEDROPPER_BUTTON].type = WWT_FLATBTN;
|
||||
}
|
||||
|
||||
sint16 tabSelectedSceneryId = gWindowSceneryTabSelections[tabIndex];
|
||||
int16_t tabSelectedSceneryId = gWindowSceneryTabSelections[tabIndex];
|
||||
if (tabSelectedSceneryId != -1) {
|
||||
if (tabSelectedSceneryId < 0x100) {
|
||||
if (!(gWindowSceneryPaintEnabled & 1)) {
|
||||
|
@ -1036,16 +1036,16 @@ void window_scenery_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
|||
{
|
||||
window_draw_widgets(w, dpi);
|
||||
|
||||
uint16 tabIndex = gWindowSceneryActiveTabIndex;
|
||||
uint16 selectedWidgetId = tabIndex + 4;
|
||||
uint32 imageId = ((w->colours[1] << 19) | window_scenery_widgets[selectedWidgetId].image) + 1ul;
|
||||
uint16_t tabIndex = gWindowSceneryActiveTabIndex;
|
||||
uint16_t selectedWidgetId = tabIndex + 4;
|
||||
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,
|
||||
selectedWidgetId);
|
||||
|
||||
sint16 selectedSceneryEntryId = w->scenery.selected_scenery_id;
|
||||
int16_t selectedSceneryEntryId = w->scenery.selected_scenery_id;
|
||||
if (selectedSceneryEntryId == -1) {
|
||||
if (gWindowSceneryPaintEnabled & 1) // repaint coloured scenery tool is on
|
||||
return;
|
||||
|
@ -1058,7 +1058,7 @@ void window_scenery_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
|||
return;
|
||||
}
|
||||
|
||||
uint32 price = 0;
|
||||
uint32_t price = 0;
|
||||
|
||||
rct_scenery_entry* sceneryEntry = nullptr;
|
||||
if (selectedSceneryEntryId >= 0x400) {
|
||||
|
@ -1082,7 +1082,7 @@ void window_scenery_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
|||
price = gSceneryPlaceCost;
|
||||
}
|
||||
|
||||
set_format_arg(0, uint32, price);
|
||||
set_format_arg(0, uint32_t, price);
|
||||
|
||||
if (!(gParkFlags & PARK_FLAGS_NO_MONEY)) {
|
||||
// -14
|
||||
|
@ -1099,18 +1099,18 @@ void window_scenery_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
|||
*
|
||||
* rct2: 0x006E15ED
|
||||
*/
|
||||
void window_scenery_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, sint32 scrollIndex)
|
||||
void window_scenery_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, int32_t scrollIndex)
|
||||
{
|
||||
gfx_clear(dpi, ColourMapA[w->colours[1]].mid_light);
|
||||
|
||||
uint8 tabIndex = gWindowSceneryActiveTabIndex;
|
||||
uint8_t tabIndex = gWindowSceneryActiveTabIndex;
|
||||
|
||||
sint32 sceneryTabItemIndex = 0;
|
||||
sint16 currentSceneryGlobalId = -1;
|
||||
sint16 left = 0, top = 0;
|
||||
int32_t sceneryTabItemIndex = 0;
|
||||
int16_t currentSceneryGlobalId = -1;
|
||||
int16_t left = 0, top = 0;
|
||||
|
||||
while ((currentSceneryGlobalId = window_scenery_tab_entries[tabIndex][sceneryTabItemIndex]) != -1) {
|
||||
uint16 tabSelectedSceneryId = gWindowSceneryTabSelections[tabIndex];
|
||||
uint16_t tabSelectedSceneryId = gWindowSceneryTabSelections[tabIndex];
|
||||
|
||||
if (gWindowSceneryPaintEnabled == 1 || gWindowSceneryEyedropperEnabled) {
|
||||
if (w->scenery.selected_scenery_id == currentSceneryGlobalId) {
|
||||
|
@ -1134,7 +1134,7 @@ void window_scenery_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, sint32 sc
|
|||
if (clip_drawpixelinfo(&clipdpi, dpi, left + 1, top + 1, SCENERY_BUTTON_WIDTH - 2, SCENERY_BUTTON_HEIGHT - 2)) {
|
||||
if (currentSceneryGlobalId >= SCENERY_BANNERS_ID_MIN) {
|
||||
sceneryEntry = get_banner_entry(currentSceneryGlobalId - SCENERY_BANNERS_ID_MIN);
|
||||
uint32 imageId = sceneryEntry->image + gWindowSceneryRotation * 2;
|
||||
uint32_t imageId = sceneryEntry->image + gWindowSceneryRotation * 2;
|
||||
imageId |= (gWindowSceneryPrimaryColour << 19) | IMAGE_TYPE_REMAP;
|
||||
|
||||
gfx_draw_sprite(&clipdpi, imageId, 0x21, 0x28, w->colours[1]);
|
||||
|
@ -1142,7 +1142,7 @@ void window_scenery_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, sint32 sc
|
|||
}
|
||||
else if (currentSceneryGlobalId >= SCENERY_LARGE_SCENERY_ID_MIN) {
|
||||
sceneryEntry = get_large_scenery_entry(currentSceneryGlobalId - SCENERY_LARGE_SCENERY_ID_MIN);
|
||||
uint32 imageId = sceneryEntry->image + gWindowSceneryRotation;
|
||||
uint32_t imageId = sceneryEntry->image + gWindowSceneryRotation;
|
||||
imageId |= (gWindowSceneryPrimaryColour << 19) | IMAGE_TYPE_REMAP;
|
||||
imageId |= (gWindowScenerySecondaryColour << 24) | IMAGE_TYPE_REMAP_2_PLUS;
|
||||
|
||||
|
@ -1150,9 +1150,9 @@ void window_scenery_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, sint32 sc
|
|||
}
|
||||
else if (currentSceneryGlobalId >= SCENERY_WALLS_ID_MIN) {
|
||||
sceneryEntry = get_wall_entry(currentSceneryGlobalId - SCENERY_WALLS_ID_MIN);
|
||||
uint32 imageId = sceneryEntry->image;
|
||||
uint8 tertiaryColour = w->colours[1];
|
||||
uint16 spriteTop = (sceneryEntry->wall.height * 2) + 0x32;
|
||||
uint32_t imageId = sceneryEntry->image;
|
||||
uint8_t tertiaryColour = w->colours[1];
|
||||
uint16_t spriteTop = (sceneryEntry->wall.height * 2) + 0x32;
|
||||
|
||||
if (sceneryEntry->wall.flags & WALL_SCENERY_HAS_GLASS) {
|
||||
imageId |= (gWindowSceneryPrimaryColour << 19) | IMAGE_TYPE_REMAP;
|
||||
|
@ -1185,13 +1185,13 @@ void window_scenery_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, sint32 sc
|
|||
}
|
||||
else if (currentSceneryGlobalId >= SCENERY_PATH_SCENERY_ID_MIN) {
|
||||
sceneryEntry = get_footpath_item_entry(currentSceneryGlobalId - SCENERY_PATH_SCENERY_ID_MIN);
|
||||
uint32 imageId = sceneryEntry->image;
|
||||
uint32_t imageId = sceneryEntry->image;
|
||||
|
||||
gfx_draw_sprite(&clipdpi, imageId, 0x0B, 0x10, w->colours[1]);
|
||||
}
|
||||
else {
|
||||
sceneryEntry = get_small_scenery_entry(currentSceneryGlobalId);
|
||||
uint32 imageId = sceneryEntry->image + gWindowSceneryRotation;
|
||||
uint32_t imageId = sceneryEntry->image + gWindowSceneryRotation;
|
||||
|
||||
if (scenery_small_entry_has_flag(sceneryEntry, SMALL_SCENERY_FLAG_HAS_PRIMARY_COLOUR)) {
|
||||
imageId |= (gWindowSceneryPrimaryColour << 19) | IMAGE_TYPE_REMAP;
|
||||
|
@ -1201,7 +1201,7 @@ void window_scenery_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, sint32 sc
|
|||
}
|
||||
}
|
||||
|
||||
uint16 spriteTop = (sceneryEntry->small_scenery.height / 4) + 0x2B;
|
||||
uint16_t spriteTop = (sceneryEntry->small_scenery.height / 4) + 0x2B;
|
||||
|
||||
if (scenery_small_entry_has_flag(sceneryEntry, SMALL_SCENERY_FLAG_FULL_TILE) &&
|
||||
scenery_small_entry_has_flag(sceneryEntry, SMALL_SCENERY_FLAG_VOFFSET_CENTRE)) {
|
||||
|
@ -1233,11 +1233,11 @@ void window_scenery_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, sint32 sc
|
|||
}
|
||||
}
|
||||
|
||||
static sint32 window_scenery_find_tab_with_scenery_id(sint32 sceneryId)
|
||||
static int32_t window_scenery_find_tab_with_scenery_id(int32_t sceneryId)
|
||||
{
|
||||
for (sint32 i = 0; i < SCENERY_WINDOW_TABS; i++) {
|
||||
for (sint32 j = 0; j < SCENERY_ENTRIES_BY_TAB; j++) {
|
||||
sint16 entry = window_scenery_tab_entries[i][j];
|
||||
for (int32_t i = 0; i < SCENERY_WINDOW_TABS; i++) {
|
||||
for (int32_t j = 0; j < SCENERY_ENTRIES_BY_TAB; j++) {
|
||||
int16_t entry = window_scenery_tab_entries[i][j];
|
||||
if (entry == -1) break;
|
||||
if (entry == sceneryId) return i;
|
||||
}
|
||||
|
@ -1245,12 +1245,12 @@ static sint32 window_scenery_find_tab_with_scenery_id(sint32 sceneryId)
|
|||
return -1;
|
||||
}
|
||||
|
||||
bool window_scenery_set_selected_item(sint32 sceneryId)
|
||||
bool window_scenery_set_selected_item(int32_t sceneryId)
|
||||
{
|
||||
bool result = false;
|
||||
rct_window * w = window_bring_to_front_by_class(WC_SCENERY);
|
||||
if (w != nullptr) {
|
||||
sint32 tabIndex = window_scenery_find_tab_with_scenery_id(sceneryId);
|
||||
int32_t tabIndex = window_scenery_find_tab_with_scenery_id(sceneryId);
|
||||
if (tabIndex != -1) {
|
||||
gWindowSceneryActiveTabIndex = tabIndex;
|
||||
gWindowSceneryTabSelections[tabIndex] = sceneryId;
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue