mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-19 13:03:11 +01:00
Replace our own integer types with standard ones
This commit is contained in:
@@ -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())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user