forked from rosebudai/OpenRCT2-Web
Finish Removing snake_case from Drawing Methods
This commit is contained in:
1 parent
0e3a0a5ce0
commit
8504c8d05e
72 files changed
+412
-410
No files matched your search
@@ -616,7 +616,7 @@ public:
|
||||
|
||||
void CloseWindow() override
|
||||
{
|
||||
drawing_engine_dispose();
|
||||
DrawingEngineDispose();
|
||||
if (_window != nullptr)
|
||||
{
|
||||
SDL_DestroyWindow(_window);
|
||||
@@ -758,7 +758,7 @@ private:
|
||||
_platformUiContext->SetWindowIcon(_window);
|
||||
|
||||
// Initialise the surface, palette and draw buffer
|
||||
drawing_engine_init();
|
||||
DrawingEngineInit();
|
||||
OnResize(width, height);
|
||||
|
||||
UpdateFullscreenResolutions();
|
||||
@@ -778,7 +778,7 @@ private:
|
||||
_width = static_cast<int32_t>(width / gConfigGeneral.WindowScale);
|
||||
_height = static_cast<int32_t>(height / gConfigGeneral.WindowScale);
|
||||
|
||||
drawing_engine_resize();
|
||||
DrawingEngineResize();
|
||||
|
||||
uint32_t flags = SDL_GetWindowFlags(_window);
|
||||
if ((flags & SDL_WINDOW_MINIMIZED) == 0)
|
||||
|
||||
@@ -165,7 +165,7 @@ public:
|
||||
|
||||
if (gConfigGeneral.EnableLightFx)
|
||||
{
|
||||
auto& lightPalette = lightfx_get_palette();
|
||||
auto& lightPalette = LightFXGetPalette();
|
||||
for (int32_t i = 0; i < 256; i++)
|
||||
{
|
||||
const auto& src = lightPalette[i];
|
||||
@@ -210,7 +210,7 @@ private:
|
||||
int32_t pitch;
|
||||
if (SDL_LockTexture(_screenTexture, nullptr, &pixels, &pitch) == 0)
|
||||
{
|
||||
lightfx_render_to_texture(pixels, pitch, _bits, _width, _height, _paletteHWMapped, _lightPaletteHWMapped);
|
||||
LightFXRenderToTexture(pixels, pitch, _bits, _width, _height, _paletteHWMapped, _lightPaletteHWMapped);
|
||||
SDL_UnlockTexture(_screenTexture);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -206,7 +206,7 @@ public:
|
||||
{
|
||||
_window = static_cast<SDL_Window*>(_uiContext->GetWindow());
|
||||
_bitsDPI.DrawingEngine = this;
|
||||
lightfx_set_available(false);
|
||||
LightFXSetAvailable(false);
|
||||
}
|
||||
|
||||
~OpenGLDrawingEngine() override
|
||||
|
||||
@@ -33,7 +33,7 @@ static FontStyle InGameConsoleGetFontStyle()
|
||||
|
||||
static int32_t InGameConsoleGetLineHeight()
|
||||
{
|
||||
return font_get_line_height(InGameConsoleGetFontStyle());
|
||||
return FontGetLineHeight(InGameConsoleGetFontStyle());
|
||||
}
|
||||
|
||||
InGameConsole::InGameConsole()
|
||||
|
||||
@@ -74,7 +74,7 @@ namespace OpenRCT2::Scripting
|
||||
GfxSetG1Element(index, &empty);
|
||||
}
|
||||
}
|
||||
gfx_object_free_images(range.BaseId, range.Count);
|
||||
GfxObjectFreeImages(range.BaseId, range.Count);
|
||||
}
|
||||
|
||||
std::optional<ImageList> AllocateCustomImages(const std::shared_ptr<Plugin>& plugin, uint32_t count)
|
||||
@@ -82,7 +82,7 @@ namespace OpenRCT2::Scripting
|
||||
std::vector<rct_g1_element> images;
|
||||
images.resize(count);
|
||||
|
||||
auto base = gfx_object_allocate_images(images.data(), count);
|
||||
auto base = GfxObjectAllocateImages(images.data(), count);
|
||||
if (base == ImageIndexUndefined)
|
||||
{
|
||||
return {};
|
||||
@@ -397,7 +397,7 @@ namespace OpenRCT2::Scripting
|
||||
el.flags |= G1_FLAG_RLE_COMPRESSION;
|
||||
}
|
||||
GfxSetG1Element(id, &el);
|
||||
drawing_engine_invalidate_image(id);
|
||||
DrawingEngineInvalidateImage(id);
|
||||
}
|
||||
|
||||
void DukSetPixelData(duk_context* ctx, ImageIndex id, const DukValue& dukPixelData)
|
||||
@@ -464,7 +464,7 @@ namespace OpenRCT2::Scripting
|
||||
GfxSetG1Element(id, &newg1);
|
||||
}
|
||||
|
||||
drawing_engine_invalidate_image(id);
|
||||
DrawingEngineInvalidateImage(id);
|
||||
}
|
||||
|
||||
} // namespace OpenRCT2::Scripting
|
||||
|
||||
@@ -212,7 +212,7 @@ private:
|
||||
auto const& versionPlaceholder = widgets[WIDX_VERSION];
|
||||
auto versionPlaceHolderWidth = versionPlaceholder.right - versionPlaceholder.left;
|
||||
auto centreX = versionPlaceholder.left + versionPlaceHolderWidth / 2;
|
||||
auto centreY = (versionPlaceholder.top + versionPlaceholder.bottom - font_get_line_height(FontStyle::Medium)) / 2;
|
||||
auto centreY = (versionPlaceholder.top + versionPlaceholder.bottom - FontGetLineHeight(FontStyle::Medium)) / 2;
|
||||
auto centrePos = windowPos + ScreenCoordsXY(centreX, centreY);
|
||||
DrawTextWrapped(&dpi, centrePos, versionPlaceHolderWidth, STR_STRING, ft, { colours[1], TextAlignment::CENTRE });
|
||||
|
||||
@@ -233,7 +233,7 @@ private:
|
||||
|
||||
auto screenCoords = ScreenCoordsXY{ windowPos.x + 200, yPage + 5 };
|
||||
|
||||
int32_t lineHeight = font_get_line_height(FontStyle::Medium);
|
||||
int32_t lineHeight = FontGetLineHeight(FontStyle::Medium);
|
||||
|
||||
// Credits
|
||||
DrawTextBasic(&dpi, screenCoords, STR_COPYRIGHT_CS, {}, { TextAlignment::CENTRE });
|
||||
|
||||
@@ -187,7 +187,7 @@ public:
|
||||
|
||||
void OnScrollDraw(int32_t scrollIndex, rct_drawpixelinfo& dpi) override
|
||||
{
|
||||
const int32_t lineHeight = font_get_line_height(FontStyle::Medium);
|
||||
const int32_t lineHeight = FontGetLineHeight(FontStyle::Medium);
|
||||
|
||||
ScreenCoordsXY screenCoords(3, 3 - lineHeight);
|
||||
for (const auto& line : _changelogLines)
|
||||
@@ -204,7 +204,7 @@ public:
|
||||
{
|
||||
return ScreenSize(
|
||||
_changelogLongestLineWidth + 4,
|
||||
static_cast<int32_t>(_changelogLines.size()) * font_get_line_height(FontStyle::Medium));
|
||||
static_cast<int32_t>(_changelogLines.size()) * FontGetLineHeight(FontStyle::Medium));
|
||||
}
|
||||
|
||||
// TODO: This probably should be a utility function defined elsewhere for reusability
|
||||
|
||||
@@ -142,7 +142,7 @@ rct_window* WindowErrorOpen(std::string_view title, std::string_view message)
|
||||
GfxWrapString(buffer.data(), width + 1, FontStyle::Medium, &numLines);
|
||||
|
||||
width = width + 3;
|
||||
int32_t height = (numLines + 1) * font_get_line_height(FontStyle::Medium) + 4;
|
||||
int32_t height = (numLines + 1) * FontGetLineHeight(FontStyle::Medium) + 4;
|
||||
int32_t screenWidth = ContextGetWidth();
|
||||
int32_t screenHeight = ContextGetHeight();
|
||||
const CursorState* state = ContextGetCursorState();
|
||||
|
||||
@@ -111,7 +111,7 @@ rct_window* WindowGameBottomToolbarOpen()
|
||||
int32_t screenHeight = ContextGetHeight();
|
||||
|
||||
// Figure out how much line height we have to work with.
|
||||
uint32_t line_height = font_get_line_height(FontStyle::Medium);
|
||||
uint32_t line_height = FontGetLineHeight(FontStyle::Medium);
|
||||
uint32_t toolbar_height = line_height * 2 + 12;
|
||||
|
||||
rct_window* window = WindowCreate(
|
||||
@@ -220,7 +220,7 @@ static OpenRCT2String WindowGameBottomToolbarTooltip(rct_window* w, const Widget
|
||||
static void WindowGameBottomToolbarInvalidate(rct_window* w)
|
||||
{
|
||||
// Figure out how much line height we have to work with.
|
||||
uint32_t line_height = font_get_line_height(FontStyle::Medium);
|
||||
uint32_t line_height = FontGetLineHeight(FontStyle::Medium);
|
||||
|
||||
// Reset dimensions as appropriate -- in case we're switching languages.
|
||||
w->height = line_height * 2 + 12;
|
||||
@@ -396,7 +396,7 @@ static void WindowGameBottomToolbarDrawLeftPanel(rct_drawpixelinfo* dpi, rct_win
|
||||
GfxFillRectInset(dpi, { topLeft, bottomRight }, w->colours[1], INSET_RECT_F_30);
|
||||
|
||||
// Figure out how much line height we have to work with.
|
||||
uint32_t line_height = font_get_line_height(FontStyle::Medium);
|
||||
uint32_t line_height = FontGetLineHeight(FontStyle::Medium);
|
||||
|
||||
// Draw money
|
||||
if (!(gParkFlags & PARK_FLAGS_NO_MONEY))
|
||||
@@ -512,7 +512,7 @@ static void WindowGameBottomToolbarDrawRightPanel(rct_drawpixelinfo* dpi, rct_wi
|
||||
DrawTextBasic(dpi, screenCoords, stringId, ft, { colour, TextAlignment::CENTRE });
|
||||
|
||||
// Figure out how much line height we have to work with.
|
||||
uint32_t line_height = font_get_line_height(FontStyle::Medium);
|
||||
uint32_t line_height = FontGetLineHeight(FontStyle::Medium);
|
||||
|
||||
// Temperature
|
||||
screenCoords = { w->windowPos.x + window_game_bottom_toolbar_widgets[WIDX_RIGHT_OUTSET].left + 15,
|
||||
@@ -662,7 +662,7 @@ static void WindowGameBottomToolbarDrawMiddlePanel(rct_drawpixelinfo* dpi, rct_w
|
||||
w->colours[1], INSET_RECT_F_30);
|
||||
|
||||
// Figure out how much line height we have to work with.
|
||||
uint32_t line_height = font_get_line_height(FontStyle::Medium);
|
||||
uint32_t line_height = FontGetLineHeight(FontStyle::Medium);
|
||||
|
||||
ScreenCoordsXY middleWidgetCoords(
|
||||
w->windowPos.x + middleOutsetWidget->midX(), w->windowPos.y + middleOutsetWidget->top + line_height + 1);
|
||||
|
||||
@@ -1034,7 +1034,7 @@ private:
|
||||
void StatsBarsDraw(int32_t value, const ScreenCoordsXY& origCoords, rct_drawpixelinfo& dpi, int32_t colour, bool blinkFlag)
|
||||
{
|
||||
auto coords = origCoords;
|
||||
if (font_get_line_height(FontStyle::Medium) > 10)
|
||||
if (FontGetLineHeight(FontStyle::Medium) > 10)
|
||||
{
|
||||
coords.y += 1;
|
||||
}
|
||||
|
||||
@@ -162,7 +162,7 @@ public:
|
||||
g1temp.height = 217;
|
||||
g1temp.flags = G1_FLAG_HAS_TRANSPARENCY;
|
||||
GfxSetG1Element(SPR_TEMP, &g1temp);
|
||||
drawing_engine_invalidate_image(SPR_TEMP);
|
||||
DrawingEngineInvalidateImage(SPR_TEMP);
|
||||
GfxDrawSprite(&dpi, ImageId(SPR_TEMP), screenPos);
|
||||
|
||||
screenPos = windowPos + ScreenCoordsXY{ widget->midX(), widget->bottom - 12 };
|
||||
|
||||
@@ -714,7 +714,7 @@ public:
|
||||
g1temp.x_offset = -8;
|
||||
g1temp.y_offset = -8;
|
||||
GfxSetG1Element(SPR_TEMP, &g1temp);
|
||||
drawing_engine_invalidate_image(SPR_TEMP);
|
||||
DrawingEngineInvalidateImage(SPR_TEMP);
|
||||
GfxDrawSprite(&dpi, ImageId(SPR_TEMP), { 0, 0 });
|
||||
|
||||
if (selected_tab == PAGE_PEEPS)
|
||||
|
||||
@@ -334,7 +334,7 @@ static ScreenCoordsXY WindowMultiplayerInformationGetSize()
|
||||
return _windowInformationSize;
|
||||
}
|
||||
|
||||
int32_t lineHeight = font_get_line_height(FontStyle::Medium);
|
||||
int32_t lineHeight = FontGetLineHeight(FontStyle::Medium);
|
||||
|
||||
// Base dimensions.
|
||||
const int32_t width = 450;
|
||||
|
||||
@@ -50,7 +50,7 @@ private:
|
||||
int32_t _pressedNewsItemIndex{}, _pressedButtonIndex{}, _suspendUpdateTicks{};
|
||||
static int32_t CalculateItemHeight()
|
||||
{
|
||||
return 4 * font_get_line_height(FontStyle::Small) + 2;
|
||||
return 4 * FontGetLineHeight(FontStyle::Small) + 2;
|
||||
}
|
||||
|
||||
public:
|
||||
@@ -173,7 +173,7 @@ public:
|
||||
|
||||
void OnScrollDraw(int32_t scrollIndex, rct_drawpixelinfo& dpi) override
|
||||
{
|
||||
int32_t lineHeight = font_get_line_height(FontStyle::Small);
|
||||
int32_t lineHeight = FontGetLineHeight(FontStyle::Small);
|
||||
int32_t itemHeight = CalculateItemHeight();
|
||||
int32_t y = 0;
|
||||
int32_t i = 0;
|
||||
|
||||
@@ -682,13 +682,13 @@ private:
|
||||
{
|
||||
case WIDX_UNCAP_FPS_CHECKBOX:
|
||||
gConfigGeneral.UncapFPS ^= 1;
|
||||
drawing_engine_set_vsync(gConfigGeneral.UseVSync);
|
||||
DrawingEngineSetVSync(gConfigGeneral.UseVSync);
|
||||
ConfigSaveDefault();
|
||||
Invalidate();
|
||||
break;
|
||||
case WIDX_USE_VSYNC_CHECKBOX:
|
||||
gConfigGeneral.UseVSync ^= 1;
|
||||
drawing_engine_set_vsync(gConfigGeneral.UseVSync);
|
||||
DrawingEngineSetVSync(gConfigGeneral.UseVSync);
|
||||
ConfigSaveDefault();
|
||||
Invalidate();
|
||||
break;
|
||||
@@ -845,7 +845,7 @@ private:
|
||||
DrawingEngine dstEngine = static_cast<DrawingEngine>(dropdownIndex);
|
||||
|
||||
gConfigGeneral.DrawingEngine = dstEngine;
|
||||
bool recreate_window = drawing_engine_requires_new_window(srcEngine, dstEngine);
|
||||
bool recreate_window = DrawingEngineRequiresNewWindow(srcEngine, dstEngine);
|
||||
RefreshVideo(recreate_window);
|
||||
ConfigSaveDefault();
|
||||
Invalidate();
|
||||
@@ -2013,7 +2013,7 @@ private:
|
||||
|
||||
// Apply vertical alignment if appropriate.
|
||||
int32_t widgetHeight = pathWidget.bottom - pathWidget.top;
|
||||
int32_t lineHeight = font_get_line_height(FontStyle::Medium);
|
||||
int32_t lineHeight = FontGetLineHeight(FontStyle::Medium);
|
||||
uint32_t padding = widgetHeight > lineHeight ? (widgetHeight - lineHeight) / 2 : 0;
|
||||
ScreenCoordsXY screenCoords = { windowPos.x + pathWidget.left + 1,
|
||||
windowPos.y + pathWidget.top + static_cast<int32_t>(padding) };
|
||||
|
||||
@@ -2905,7 +2905,7 @@ static void WindowRideVehiclePaint(rct_window* w, rct_drawpixelinfo* dpi)
|
||||
// Intensity Factor
|
||||
if (rideEntry->intensity_multiplier != 0)
|
||||
{
|
||||
int32_t lineHeight = font_get_line_height(FontStyle::Medium);
|
||||
int32_t lineHeight = FontGetLineHeight(FontStyle::Medium);
|
||||
if (lineHeight != 10)
|
||||
screenCoords.x += 150;
|
||||
else
|
||||
|
||||
@@ -291,10 +291,10 @@ static int32_t GetScenarioListItemSize()
|
||||
return 24;
|
||||
|
||||
// Scenario title
|
||||
int32_t lineHeight = font_get_line_height(FontStyle::Medium);
|
||||
int32_t lineHeight = FontGetLineHeight(FontStyle::Medium);
|
||||
|
||||
// 'Completed by' line
|
||||
lineHeight += font_get_line_height(FontStyle::Small);
|
||||
lineHeight += FontGetLineHeight(FontStyle::Small);
|
||||
|
||||
return lineHeight;
|
||||
}
|
||||
@@ -566,7 +566,7 @@ static void WindowScenarioselectScrollpaint(rct_window* w, rct_drawpixelinfo* dp
|
||||
const int32_t scenarioItemHeight = GetScenarioListItemSize();
|
||||
|
||||
// Scenario title
|
||||
int32_t scenarioTitleHeight = font_get_line_height(FontStyle::Medium);
|
||||
int32_t scenarioTitleHeight = FontGetLineHeight(FontStyle::Medium);
|
||||
|
||||
int32_t y = 0;
|
||||
for (const auto& listItem : _listItems)
|
||||
|
||||
@@ -1539,7 +1539,7 @@ public:
|
||||
{
|
||||
auto& listWidget = widgets[WIDX_LIST];
|
||||
auto centrePos = ScreenCoordsXY{ listWidget.width() / 2,
|
||||
(listWidget.height() - font_get_line_height(FontStyle::Medium)) / 2 };
|
||||
(listWidget.height() - FontGetLineHeight(FontStyle::Medium)) / 2 };
|
||||
auto ft = Formatter{};
|
||||
auto textPaint = TextPaint{ colours[1], TextAlignment::CENTRE };
|
||||
DrawTextWrapped(&dpi, centrePos, listWidth, STR_TILE_INSPECTOR_SELECT_TILE_HINT, ft, textPaint);
|
||||
|
||||
@@ -39,7 +39,7 @@ public:
|
||||
{
|
||||
int32_t textWidth = FormatTextForTooltip(message);
|
||||
width = textWidth + 3;
|
||||
height = ((_tooltipNumLines + 1) * font_get_line_height(FontStyle::Small)) + 4;
|
||||
height = ((_tooltipNumLines + 1) * FontGetLineHeight(FontStyle::Small)) + 4;
|
||||
|
||||
window_tooltip_widgets[WIDX_BACKGROUND].right = width;
|
||||
window_tooltip_widgets[WIDX_BACKGROUND].bottom = height;
|
||||
|
||||
@@ -299,7 +299,7 @@ public:
|
||||
g1temp.width = TRACK_MINI_PREVIEW_WIDTH;
|
||||
g1temp.height = TRACK_MINI_PREVIEW_HEIGHT;
|
||||
GfxSetG1Element(SPR_TEMP, &g1temp);
|
||||
drawing_engine_invalidate_image(SPR_TEMP);
|
||||
DrawingEngineInvalidateImage(SPR_TEMP);
|
||||
GfxDrawSprite(&clippedDpi, ImageId(SPR_TEMP, NOT_TRANSLUCENT(this->colours[0])), { 0, 0 });
|
||||
}
|
||||
|
||||
|
||||
@@ -501,7 +501,7 @@ public:
|
||||
g1temp.height = 217;
|
||||
g1temp.flags = G1_FLAG_HAS_TRANSPARENCY;
|
||||
GfxSetG1Element(SPR_TEMP, &g1temp);
|
||||
drawing_engine_invalidate_image(SPR_TEMP);
|
||||
DrawingEngineInvalidateImage(SPR_TEMP);
|
||||
GfxDrawSprite(&dpi, ImageId(SPR_TEMP), trackPreview);
|
||||
|
||||
screenPos.y = windowPos.y + tdWidget.bottom - 12;
|
||||
|
||||
@@ -194,7 +194,7 @@ namespace OpenRCT2
|
||||
_objectManager->UnloadAll();
|
||||
}
|
||||
|
||||
gfx_object_check_all_images_freed();
|
||||
GfxObjectCheckAllImagesFreed();
|
||||
GfxUnloadCsg();
|
||||
GfxUnloadG2();
|
||||
GfxUnloadG1();
|
||||
@@ -470,7 +470,7 @@ namespace OpenRCT2
|
||||
{
|
||||
return false;
|
||||
}
|
||||
lightfx_init();
|
||||
LightFXInit();
|
||||
}
|
||||
|
||||
input_reset_place_obj_modifier();
|
||||
@@ -513,7 +513,7 @@ namespace OpenRCT2
|
||||
// Fallback to software
|
||||
gConfigGeneral.DrawingEngine = DrawingEngine::Software;
|
||||
ConfigSaveDefault();
|
||||
drawing_engine_init();
|
||||
DrawingEngineInit();
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -541,7 +541,7 @@ namespace OpenRCT2
|
||||
// Fallback to software
|
||||
gConfigGeneral.DrawingEngine = DrawingEngine::Software;
|
||||
ConfigSaveDefault();
|
||||
drawing_engine_init();
|
||||
DrawingEngineInit();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -853,7 +853,7 @@ namespace OpenRCT2
|
||||
}
|
||||
GfxLoadG2();
|
||||
GfxLoadCsg();
|
||||
font_sprite_initialise_characters();
|
||||
FontSpriteInitialiseCharacters();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -286,12 +286,12 @@ static void screen_intro_draw_logo(rct_drawpixelinfo* dpi)
|
||||
int32_t imageWidth = 640;
|
||||
int32_t imageX = (screenWidth - imageWidth) / 2;
|
||||
|
||||
drawing_engine_invalidate_image(SPR_INTRO_LOGO_00);
|
||||
drawing_engine_invalidate_image(SPR_INTRO_LOGO_10);
|
||||
drawing_engine_invalidate_image(SPR_INTRO_LOGO_20);
|
||||
drawing_engine_invalidate_image(SPR_INTRO_LOGO_01);
|
||||
drawing_engine_invalidate_image(SPR_INTRO_LOGO_11);
|
||||
drawing_engine_invalidate_image(SPR_INTRO_LOGO_21);
|
||||
DrawingEngineInvalidateImage(SPR_INTRO_LOGO_00);
|
||||
DrawingEngineInvalidateImage(SPR_INTRO_LOGO_10);
|
||||
DrawingEngineInvalidateImage(SPR_INTRO_LOGO_20);
|
||||
DrawingEngineInvalidateImage(SPR_INTRO_LOGO_01);
|
||||
DrawingEngineInvalidateImage(SPR_INTRO_LOGO_11);
|
||||
DrawingEngineInvalidateImage(SPR_INTRO_LOGO_21);
|
||||
|
||||
GfxClear(dpi, BACKROUND_COLOUR_LOGO);
|
||||
GfxDrawSprite(dpi, ImageId(SPR_INTRO_LOGO_00), { imageX + 0, 0 });
|
||||
|
||||
@@ -77,7 +77,7 @@ static std::vector<RecordedPaintSession> extract_paint_session(std::string_view
|
||||
log_info("Starting...");
|
||||
if (context->Initialise())
|
||||
{
|
||||
drawing_engine_init();
|
||||
DrawingEngineInit();
|
||||
if (!context->LoadParkFromFile(std::string(parkFileName)))
|
||||
{
|
||||
log_error("Failed to load park!");
|
||||
@@ -125,7 +125,7 @@ static std::vector<RecordedPaintSession> extract_paint_session(std::string_view
|
||||
ViewportRender(&dpi, &viewport, { { 0, 0 }, { viewport.width, viewport.height } }, &sessions);
|
||||
|
||||
free(dpi.bits);
|
||||
drawing_engine_dispose();
|
||||
DrawingEngineDispose();
|
||||
}
|
||||
log_info("Got %u paint sessions.", std::size(sessions));
|
||||
return sessions;
|
||||
|
||||
@@ -70,7 +70,7 @@ static inline uint32_t rctc_to_rct2_index(uint32_t image)
|
||||
}
|
||||
// clang-format on
|
||||
|
||||
static void read_and_convert_gxdat(IStream* stream, size_t count, bool is_rctc, rct_g1_element* elements)
|
||||
static void ReadAndConvertGxDat(IStream* stream, size_t count, bool is_rctc, rct_g1_element* elements)
|
||||
{
|
||||
auto g1Elements32 = std::make_unique<rct_g1_element_32bit[]>(count);
|
||||
stream->Read(g1Elements32.get(), count * sizeof(rct_g1_element_32bit));
|
||||
@@ -213,7 +213,7 @@ bool GfxLoadG1(const IPlatformEnvironment& env)
|
||||
// Read element headers
|
||||
bool is_rctc = _g1.header.num_entries == SPR_RCTC_G1_END;
|
||||
_g1.elements.resize(_g1.header.num_entries);
|
||||
read_and_convert_gxdat(&fs, _g1.header.num_entries, is_rctc, _g1.elements.data());
|
||||
ReadAndConvertGxDat(&fs, _g1.header.num_entries, is_rctc, _g1.elements.data());
|
||||
gTinyFontAntiAliased = is_rctc;
|
||||
|
||||
// Read element data
|
||||
@@ -277,7 +277,7 @@ bool GfxLoadG2()
|
||||
|
||||
// Read element headers
|
||||
_g2.elements.resize(_g2.header.num_entries);
|
||||
read_and_convert_gxdat(&fs, _g2.header.num_entries, false, _g2.elements.data());
|
||||
ReadAndConvertGxDat(&fs, _g2.header.num_entries, false, _g2.elements.data());
|
||||
|
||||
// Read element data
|
||||
_g2.data = fs.ReadArray<uint8_t>(_g2.header.total_size);
|
||||
@@ -350,7 +350,7 @@ bool GfxLoadCsg()
|
||||
|
||||
// Read element headers
|
||||
_csg.elements.resize(_csg.header.num_entries);
|
||||
read_and_convert_gxdat(&fileHeader, _csg.header.num_entries, false, _csg.elements.data());
|
||||
ReadAndConvertGxDat(&fileHeader, _csg.header.num_entries, false, _csg.elements.data());
|
||||
|
||||
// Read element data
|
||||
_csg.data = fileData.ReadArray<uint8_t>(_csg.header.total_size);
|
||||
@@ -389,7 +389,7 @@ std::optional<rct_gx> GfxLoadGx(const std::vector<uint8_t>& buffer)
|
||||
|
||||
// Read element headers
|
||||
gx.elements.resize(gx.header.num_entries);
|
||||
read_and_convert_gxdat(&istream, gx.header.num_entries, false, gx.elements.data());
|
||||
ReadAndConvertGxDat(&istream, gx.header.num_entries, false, gx.elements.data());
|
||||
|
||||
// Read element data
|
||||
gx.data = istream.ReadArray<uint8_t>(gx.header.total_size);
|
||||
@@ -403,7 +403,7 @@ std::optional<rct_gx> GfxLoadGx(const std::vector<uint8_t>& buffer)
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
static std::optional<PaletteMap> FASTCALL gfx_draw_sprite_get_palette(ImageId imageId)
|
||||
static std::optional<PaletteMap> FASTCALL GfxDrawSpriteGetPalette(ImageId imageId)
|
||||
{
|
||||
if (!imageId.HasSecondary())
|
||||
{
|
||||
@@ -448,7 +448,7 @@ void FASTCALL GfxDrawSpriteSoftware(rct_drawpixelinfo* dpi, const ImageId imageI
|
||||
{
|
||||
if (imageId.HasValue())
|
||||
{
|
||||
auto palette = gfx_draw_sprite_get_palette(imageId);
|
||||
auto palette = GfxDrawSpriteGetPalette(imageId);
|
||||
if (!palette)
|
||||
{
|
||||
palette = PaletteMap::GetDefault();
|
||||
|
||||
@@ -40,7 +40,7 @@ enum : uint32_t
|
||||
TEXT_DRAW_FLAG_NO_DRAW = 1u << 31
|
||||
};
|
||||
|
||||
static int32_t ttf_get_string_width(std::string_view text, FontStyle fontStyle, bool noFormatting);
|
||||
static int32_t TTFGetStringWidth(std::string_view text, FontStyle fontStyle, bool noFormatting);
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -84,12 +84,12 @@ int32_t GfxGetStringWidthNewLined(std::string_view text, FontStyle fontStyle)
|
||||
*/
|
||||
int32_t GfxGetStringWidth(std::string_view text, FontStyle fontStyle)
|
||||
{
|
||||
return ttf_get_string_width(text, fontStyle, false);
|
||||
return TTFGetStringWidth(text, fontStyle, false);
|
||||
}
|
||||
|
||||
int32_t GfxGetStringWidthNoFormatting(std::string_view text, FontStyle fontStyle)
|
||||
{
|
||||
return ttf_get_string_width(text, fontStyle, true);
|
||||
return TTFGetStringWidth(text, fontStyle, true);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -282,7 +282,7 @@ void GfxDrawStringLeftCentred(
|
||||
/**
|
||||
* Changes the palette so that the next character changes colour
|
||||
*/
|
||||
static void colour_char(uint8_t colour, const uint16_t* current_font_flags, uint8_t* palette_pointer)
|
||||
static void ColourCharacter(uint8_t colour, const uint16_t* current_font_flags, uint8_t* palette_pointer)
|
||||
{
|
||||
int32_t colour32 = 0;
|
||||
const rct_g1_element* g1 = GfxGetG1Element(SPR_TEXT_PALETTE);
|
||||
@@ -307,7 +307,7 @@ static void colour_char(uint8_t colour, const uint16_t* current_font_flags, uint
|
||||
* Changes the palette so that the next character changes colour
|
||||
* This is specific to changing to a predefined window related colour
|
||||
*/
|
||||
static void colour_char_window(uint8_t colour, const uint16_t* current_font_flags, uint8_t* palette_pointer)
|
||||
static void ColourCharacterWindow(uint8_t colour, const uint16_t* current_font_flags, uint8_t* palette_pointer)
|
||||
{
|
||||
int32_t eax;
|
||||
|
||||
@@ -355,7 +355,7 @@ void DrawStringCentredRaw(
|
||||
}
|
||||
text = const_cast<char*>(ch + 1);
|
||||
|
||||
screenCoords.y += font_get_line_height(fontStyle);
|
||||
screenCoords.y += FontGetLineHeight(fontStyle);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -441,7 +441,7 @@ void DrawNewsTicker(
|
||||
format_string(buffer, 256, format, args);
|
||||
|
||||
GfxWrapString(buffer, width, FontStyle::Small, &numLines);
|
||||
lineHeight = font_get_line_height(FontStyle::Small);
|
||||
lineHeight = FontGetLineHeight(FontStyle::Small);
|
||||
|
||||
int32_t numCharactersDrawn = 0;
|
||||
int32_t numCharactersToDraw = ticks;
|
||||
@@ -501,10 +501,10 @@ struct text_draw_info
|
||||
const int8_t* y_offset;
|
||||
};
|
||||
|
||||
static void ttf_draw_character_sprite(rct_drawpixelinfo* dpi, int32_t codepoint, text_draw_info* info)
|
||||
static void TTFDrawCharacterSprite(rct_drawpixelinfo* dpi, int32_t codepoint, text_draw_info* info)
|
||||
{
|
||||
int32_t characterWidth = font_sprite_get_codepoint_width(info->FontStyle, codepoint);
|
||||
auto sprite = font_sprite_get_codepoint_sprite(info->FontStyle, codepoint);
|
||||
int32_t characterWidth = FontSpriteGetCodepointWidth(info->FontStyle, codepoint);
|
||||
auto sprite = FontSpriteGetCodepointSprite(info->FontStyle, codepoint);
|
||||
|
||||
if (!(info->flags & TEXT_DRAW_FLAG_NO_DRAW))
|
||||
{
|
||||
@@ -521,38 +521,38 @@ static void ttf_draw_character_sprite(rct_drawpixelinfo* dpi, int32_t codepoint,
|
||||
info->x += characterWidth;
|
||||
}
|
||||
|
||||
static void ttf_draw_string_raw_sprite(rct_drawpixelinfo* dpi, std::string_view text, text_draw_info* info)
|
||||
static void TTFDrawStringRawSprite(rct_drawpixelinfo* dpi, std::string_view text, text_draw_info* info)
|
||||
{
|
||||
CodepointView codepoints(text);
|
||||
for (auto codepoint : codepoints)
|
||||
{
|
||||
ttf_draw_character_sprite(dpi, codepoint, info);
|
||||
TTFDrawCharacterSprite(dpi, codepoint, info);
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef NO_TTF
|
||||
|
||||
static int _ttfGlId = 0;
|
||||
static void ttf_draw_string_raw_ttf(rct_drawpixelinfo* dpi, std::string_view text, text_draw_info* info)
|
||||
static void TTFDrawStringRawTTF(rct_drawpixelinfo* dpi, std::string_view text, text_draw_info* info)
|
||||
{
|
||||
if (!ttf_initialise())
|
||||
if (!TTFInitialise())
|
||||
return;
|
||||
|
||||
TTFFontDescriptor* fontDesc = ttf_get_font_from_sprite_base(info->FontStyle);
|
||||
TTFFontDescriptor* fontDesc = TTFGetFontFromSpriteBase(info->FontStyle);
|
||||
if (fontDesc->font == nullptr)
|
||||
{
|
||||
ttf_draw_string_raw_sprite(dpi, text, info);
|
||||
TTFDrawStringRawSprite(dpi, text, info);
|
||||
return;
|
||||
}
|
||||
|
||||
if (info->flags & TEXT_DRAW_FLAG_NO_DRAW)
|
||||
{
|
||||
info->x += ttf_getwidth_cache_get_or_add(fontDesc->font, text);
|
||||
info->x += TTFGetWidthCacheGetOrAdd(fontDesc->font, text);
|
||||
return;
|
||||
}
|
||||
|
||||
uint8_t colour = info->palette[1];
|
||||
TTFSurface* surface = ttf_surface_cache_get_or_add(fontDesc->font, text);
|
||||
TTFSurface* surface = TTFSurfaceCacheGetOrAdd(fontDesc->font, text);
|
||||
if (surface == nullptr)
|
||||
return;
|
||||
|
||||
@@ -709,7 +709,7 @@ static void ttf_draw_string_raw_ttf(rct_drawpixelinfo* dpi, std::string_view tex
|
||||
|
||||
#endif // NO_TTF
|
||||
|
||||
static void ttf_process_format_code(rct_drawpixelinfo* dpi, const FmtString::token& token, text_draw_info* info)
|
||||
static void TTFProcessFormatCode(rct_drawpixelinfo* dpi, const FmtString::token& token, text_draw_info* info)
|
||||
{
|
||||
switch (token.kind)
|
||||
{
|
||||
@@ -718,11 +718,11 @@ static void ttf_process_format_code(rct_drawpixelinfo* dpi, const FmtString::tok
|
||||
break;
|
||||
case FormatToken::Newline:
|
||||
info->x = info->startX;
|
||||
info->y += font_get_line_height(info->FontStyle);
|
||||
info->y += FontGetLineHeight(info->FontStyle);
|
||||
break;
|
||||
case FormatToken::NewlineSmall:
|
||||
info->x = info->startX;
|
||||
info->y += font_get_line_height_small(info->FontStyle);
|
||||
info->y += FontGetLineHeightSmall(info->FontStyle);
|
||||
break;
|
||||
case FormatToken::FontTiny:
|
||||
info->FontStyle = FontStyle::Tiny;
|
||||
@@ -742,19 +742,19 @@ static void ttf_process_format_code(rct_drawpixelinfo* dpi, const FmtString::tok
|
||||
case FormatToken::ColourWindow1:
|
||||
{
|
||||
uint16_t flags = info->flags;
|
||||
colour_char_window(gCurrentWindowColours[0], &flags, info->palette);
|
||||
ColourCharacterWindow(gCurrentWindowColours[0], &flags, info->palette);
|
||||
break;
|
||||
}
|
||||
case FormatToken::ColourWindow2:
|
||||
{
|
||||
uint16_t flags = info->flags;
|
||||
colour_char_window(gCurrentWindowColours[1], &flags, info->palette);
|
||||
ColourCharacterWindow(gCurrentWindowColours[1], &flags, info->palette);
|
||||
break;
|
||||
}
|
||||
case FormatToken::ColourWindow3:
|
||||
{
|
||||
uint16_t flags = info->flags;
|
||||
colour_char_window(gCurrentWindowColours[2], &flags, info->palette);
|
||||
ColourCharacterWindow(gCurrentWindowColours[2], &flags, info->palette);
|
||||
break;
|
||||
}
|
||||
case FormatToken::InlineSprite:
|
||||
@@ -776,7 +776,7 @@ static void ttf_process_format_code(rct_drawpixelinfo* dpi, const FmtString::tok
|
||||
{
|
||||
uint16_t flags = info->flags;
|
||||
auto colourIndex = FormatTokenGetTextColourIndex(token.kind);
|
||||
colour_char(static_cast<uint8_t>(colourIndex), &flags, info->palette);
|
||||
ColourCharacter(static_cast<uint8_t>(colourIndex), &flags, info->palette);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -813,7 +813,7 @@ static bool ShouldUseSpriteForCodepoint(char32_t codepoint)
|
||||
}
|
||||
#endif // NO_TTF
|
||||
|
||||
static void ttf_process_string_literal(rct_drawpixelinfo* dpi, std::string_view text, text_draw_info* info)
|
||||
static void TTFProcessStringLiteral(rct_drawpixelinfo* dpi, std::string_view text, text_draw_info* info)
|
||||
{
|
||||
#ifndef NO_TTF
|
||||
bool isTTF = info->flags & TEXT_DRAW_FLAG_TTF;
|
||||
@@ -823,7 +823,7 @@ static void ttf_process_string_literal(rct_drawpixelinfo* dpi, std::string_view
|
||||
|
||||
if (!isTTF)
|
||||
{
|
||||
ttf_draw_string_raw_sprite(dpi, text, info);
|
||||
TTFDrawStringRawSprite(dpi, text, info);
|
||||
}
|
||||
#ifndef NO_TTF
|
||||
else
|
||||
@@ -846,7 +846,7 @@ static void ttf_process_string_literal(rct_drawpixelinfo* dpi, std::string_view
|
||||
# pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
|
||||
# endif
|
||||
auto len = it.GetIndex() - ttfRunIndex.value();
|
||||
ttf_draw_string_raw_ttf(dpi, text.substr(ttfRunIndex.value(), len), info);
|
||||
TTFDrawStringRawTTF(dpi, text.substr(ttfRunIndex.value(), len), info);
|
||||
# ifdef __MINGW32__
|
||||
# pragma GCC diagnostic pop
|
||||
# endif
|
||||
@@ -854,7 +854,7 @@ static void ttf_process_string_literal(rct_drawpixelinfo* dpi, std::string_view
|
||||
}
|
||||
|
||||
// Draw the sprite font glyph
|
||||
ttf_draw_character_sprite(dpi, codepoint, info);
|
||||
TTFDrawCharacterSprite(dpi, codepoint, info);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -869,24 +869,24 @@ static void ttf_process_string_literal(rct_drawpixelinfo* dpi, std::string_view
|
||||
{
|
||||
// Final TTF run
|
||||
auto len = text.size() - *ttfRunIndex;
|
||||
ttf_draw_string_raw_ttf(dpi, text.substr(ttfRunIndex.value(), len), info);
|
||||
TTFDrawStringRawTTF(dpi, text.substr(ttfRunIndex.value(), len), info);
|
||||
}
|
||||
}
|
||||
#endif // NO_TTF
|
||||
}
|
||||
|
||||
static void ttf_process_string_codepoint(rct_drawpixelinfo* dpi, codepoint_t codepoint, text_draw_info* info)
|
||||
static void TTFProcessStringCodepoint(rct_drawpixelinfo* dpi, codepoint_t codepoint, text_draw_info* info)
|
||||
{
|
||||
char buffer[8]{};
|
||||
utf8_write_codepoint(buffer, codepoint);
|
||||
ttf_process_string_literal(dpi, buffer, info);
|
||||
TTFProcessStringLiteral(dpi, buffer, info);
|
||||
}
|
||||
|
||||
static void ttf_process_string(rct_drawpixelinfo* dpi, std::string_view text, text_draw_info* info)
|
||||
static void TTFProcessString(rct_drawpixelinfo* dpi, std::string_view text, text_draw_info* info)
|
||||
{
|
||||
if (info->flags & TEXT_DRAW_FLAG_NO_FORMATTING)
|
||||
{
|
||||
ttf_process_string_literal(dpi, text, info);
|
||||
TTFProcessStringLiteral(dpi, text, info);
|
||||
info->maxX = std::max(info->maxX, info->x);
|
||||
info->maxY = std::max(info->maxY, info->y);
|
||||
}
|
||||
@@ -897,16 +897,16 @@ static void ttf_process_string(rct_drawpixelinfo* dpi, std::string_view text, te
|
||||
{
|
||||
if (token.IsLiteral())
|
||||
{
|
||||
ttf_process_string_literal(dpi, token.text, info);
|
||||
TTFProcessStringLiteral(dpi, token.text, info);
|
||||
}
|
||||
else if (token.IsCodepoint())
|
||||
{
|
||||
auto codepoint = token.GetCodepoint();
|
||||
ttf_process_string_codepoint(dpi, codepoint, info);
|
||||
TTFProcessStringCodepoint(dpi, codepoint, info);
|
||||
}
|
||||
else
|
||||
{
|
||||
ttf_process_format_code(dpi, token, info);
|
||||
TTFProcessFormatCode(dpi, token, info);
|
||||
}
|
||||
info->maxX = std::max(info->maxX, info->x);
|
||||
info->maxY = std::max(info->maxY, info->y);
|
||||
@@ -914,7 +914,7 @@ static void ttf_process_string(rct_drawpixelinfo* dpi, std::string_view text, te
|
||||
}
|
||||
}
|
||||
|
||||
static void ttf_process_initial_colour(int32_t colour, text_draw_info* info)
|
||||
static void TTFProcessInitialColour(int32_t colour, text_draw_info* info)
|
||||
{
|
||||
if (colour != TEXT_COLOUR_254 && colour != TEXT_COLOUR_255)
|
||||
{
|
||||
@@ -929,7 +929,7 @@ static void ttf_process_initial_colour(int32_t colour, text_draw_info* info)
|
||||
if (!(info->flags & TEXT_DRAW_FLAG_INSET))
|
||||
{
|
||||
uint16_t flags = info->flags;
|
||||
colour_char_window(colour, &flags, reinterpret_cast<uint8_t*>(&info->palette));
|
||||
ColourCharacterWindow(colour, &flags, reinterpret_cast<uint8_t*>(&info->palette));
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -969,7 +969,7 @@ static void ttf_process_initial_colour(int32_t colour, text_draw_info* info)
|
||||
}
|
||||
}
|
||||
|
||||
void TtfDrawString(
|
||||
void TTFDrawString(
|
||||
rct_drawpixelinfo* dpi, const_utf8string text, int32_t colour, const ScreenCoordsXY& coords, bool noFormatting,
|
||||
FontStyle fontStyle, TextDarkness darkness)
|
||||
{
|
||||
@@ -1004,14 +1004,14 @@ void TtfDrawString(
|
||||
}
|
||||
|
||||
std::memcpy(info.palette, gTextPalette, sizeof(info.palette));
|
||||
ttf_process_initial_colour(colour, &info);
|
||||
ttf_process_string(dpi, text, &info);
|
||||
TTFProcessInitialColour(colour, &info);
|
||||
TTFProcessString(dpi, text, &info);
|
||||
std::memcpy(gTextPalette, info.palette, sizeof(info.palette));
|
||||
|
||||
dpi->lastStringPos = { info.x, info.y };
|
||||
}
|
||||
|
||||
static int32_t ttf_get_string_width(std::string_view text, FontStyle fontStyle, bool noFormatting)
|
||||
static int32_t TTFGetStringWidth(std::string_view text, FontStyle fontStyle, bool noFormatting)
|
||||
{
|
||||
text_draw_info info;
|
||||
info.FontStyle = fontStyle;
|
||||
@@ -1034,7 +1034,7 @@ static int32_t ttf_get_string_width(std::string_view text, FontStyle fontStyle,
|
||||
info.flags |= TEXT_DRAW_FLAG_NO_FORMATTING;
|
||||
}
|
||||
|
||||
ttf_process_string(nullptr, text, &info);
|
||||
TTFProcessString(nullptr, text, &info);
|
||||
|
||||
return info.maxX;
|
||||
}
|
||||
@@ -1064,8 +1064,8 @@ void GfxDrawStringWithYOffsets(
|
||||
}
|
||||
|
||||
std::memcpy(info.palette, gTextPalette, sizeof(info.palette));
|
||||
ttf_process_initial_colour(colour, &info);
|
||||
ttf_process_string(dpi, text, &info);
|
||||
TTFProcessInitialColour(colour, &info);
|
||||
TTFProcessString(dpi, text, &info);
|
||||
std::memcpy(gTextPalette, info.palette, sizeof(info.palette));
|
||||
|
||||
dpi->lastStringPos = { info.x, info.y };
|
||||
|
||||
@@ -805,9 +805,9 @@ void UpdatePalette(const uint8_t* colours, int32_t start_index, int32_t num_colo
|
||||
uint8_t g = colours[1];
|
||||
uint8_t b = colours[0];
|
||||
|
||||
if (lightfx_is_available())
|
||||
if (LightFXIsAvailable())
|
||||
{
|
||||
lightfx_apply_palette_filter(i, &r, &g, &b);
|
||||
LightFXApplyPaletteFilter(i, &r, &g, &b);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -835,7 +835,7 @@ void UpdatePalette(const uint8_t* colours, int32_t start_index, int32_t num_colo
|
||||
|
||||
if (!gOpenRCT2Headless)
|
||||
{
|
||||
drawing_engine_set_palette(gPalette);
|
||||
DrawingEngineSetPalette(gPalette);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -847,12 +847,12 @@ void RefreshVideo(bool recreateWindow)
|
||||
}
|
||||
else
|
||||
{
|
||||
drawing_engine_dispose();
|
||||
drawing_engine_init();
|
||||
drawing_engine_resize();
|
||||
DrawingEngineDispose();
|
||||
DrawingEngineInit();
|
||||
DrawingEngineResize();
|
||||
}
|
||||
|
||||
drawing_engine_set_palette(gPalette);
|
||||
DrawingEngineSetPalette(gPalette);
|
||||
GfxInvalidateScreen();
|
||||
}
|
||||
|
||||
|
||||
@@ -550,7 +550,7 @@ int32_t GfxGetStringWidthNoFormatting(std::string_view text, FontStyle fontStyle
|
||||
int32_t StringGetHeightRaw(std::string_view text, FontStyle fontStyle);
|
||||
int32_t GfxClipString(char* buffer, int32_t width, FontStyle fontStyle);
|
||||
void ShortenPath(utf8* buffer, size_t bufferSize, const utf8* path, int32_t availableWidth, FontStyle fontStyle);
|
||||
void TtfDrawString(
|
||||
void TTFDrawString(
|
||||
rct_drawpixelinfo* dpi, const_utf8string text, int32_t colour, const ScreenCoordsXY& coords, bool noFormatting,
|
||||
FontStyle fontStyle, TextDarkness darkness);
|
||||
|
||||
|
||||
@@ -235,7 +235,7 @@ static char32_t _biggestCodepointValue = 0;
|
||||
*
|
||||
* rct2: 0x006C19AC
|
||||
*/
|
||||
void font_sprite_initialise_characters()
|
||||
void FontSpriteInitialiseCharacters()
|
||||
{
|
||||
// Compute min and max that helps avoiding lookups for no reason.
|
||||
_smallestCodepointValue = std::numeric_limits<char32_t>::max();
|
||||
@@ -280,7 +280,7 @@ void font_sprite_initialise_characters()
|
||||
ScrollingTextInitialiseBitmaps();
|
||||
}
|
||||
|
||||
int32_t font_sprite_get_codepoint_offset(int32_t codepoint)
|
||||
int32_t FontSpriteGetCodepointOffset(int32_t codepoint)
|
||||
{
|
||||
// Only search the table when its in range of the map.
|
||||
if (static_cast<char32_t>(codepoint) >= _smallestCodepointValue
|
||||
@@ -297,9 +297,9 @@ int32_t font_sprite_get_codepoint_offset(int32_t codepoint)
|
||||
return codepoint - 32;
|
||||
}
|
||||
|
||||
int32_t font_sprite_get_codepoint_width(FontStyle fontStyle, int32_t codepoint)
|
||||
int32_t FontSpriteGetCodepointWidth(FontStyle fontStyle, int32_t codepoint)
|
||||
{
|
||||
int32_t glyphIndex = font_sprite_get_codepoint_offset(codepoint);
|
||||
int32_t glyphIndex = FontSpriteGetCodepointOffset(codepoint);
|
||||
auto baseFontIndex = EnumValue(fontStyle);
|
||||
if (glyphIndex >= FONT_SPRITE_GLYPH_COUNT)
|
||||
{
|
||||
@@ -321,10 +321,10 @@ int32_t font_sprite_get_codepoint_width(FontStyle fontStyle, int32_t codepoint)
|
||||
return _spriteFontCharacterWidths[baseFontIndex][glyphIndex];
|
||||
}
|
||||
|
||||
ImageId font_sprite_get_codepoint_sprite(FontStyle fontStyle, int32_t codepoint)
|
||||
ImageId FontSpriteGetCodepointSprite(FontStyle fontStyle, int32_t codepoint)
|
||||
{
|
||||
int32_t offset = EnumValue(fontStyle) * FONT_SPRITE_GLYPH_COUNT;
|
||||
auto codePointOffset = font_sprite_get_codepoint_offset(codepoint);
|
||||
auto codePointOffset = FontSpriteGetCodepointOffset(codepoint);
|
||||
if (codePointOffset > FONT_SPRITE_GLYPH_COUNT)
|
||||
{
|
||||
offset = EnumValue(fontStyle) * SPR_G2_GLYPH_COUNT;
|
||||
@@ -333,7 +333,7 @@ ImageId font_sprite_get_codepoint_sprite(FontStyle fontStyle, int32_t codepoint)
|
||||
return ImageId(SPR_CHAR_START + offset + codePointOffset, COLOUR_BLACK);
|
||||
}
|
||||
|
||||
int32_t font_get_line_height(FontStyle fontStyle)
|
||||
int32_t FontGetLineHeight(FontStyle fontStyle)
|
||||
{
|
||||
auto fontSize = EnumValue(fontStyle);
|
||||
#ifndef NO_TTF
|
||||
@@ -345,12 +345,12 @@ int32_t font_get_line_height(FontStyle fontStyle)
|
||||
return SpriteFontLineHeight[fontSize];
|
||||
}
|
||||
|
||||
int32_t font_get_line_height_small(FontStyle fontStyle)
|
||||
int32_t FontGetLineHeightSmall(FontStyle fontStyle)
|
||||
{
|
||||
return font_get_line_height(fontStyle) / 2;
|
||||
return FontGetLineHeight(fontStyle) / 2;
|
||||
}
|
||||
|
||||
bool font_supports_string_sprite(const utf8* text)
|
||||
bool FontSupportsStringSprite(const utf8* text)
|
||||
{
|
||||
const utf8* src = text;
|
||||
|
||||
@@ -377,7 +377,7 @@ bool font_supports_string_sprite(const utf8* text)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool font_supports_string_ttf(const utf8* text, FontStyle fontStyle)
|
||||
bool FontSupportsStringTTF(const utf8* text, FontStyle fontStyle)
|
||||
{
|
||||
#ifndef NO_TTF
|
||||
const utf8* src = text;
|
||||
@@ -390,7 +390,7 @@ bool font_supports_string_ttf(const utf8* text, FontStyle fontStyle)
|
||||
uint32_t codepoint;
|
||||
while ((codepoint = utf8_get_next(src, &src)) != 0)
|
||||
{
|
||||
bool supported = ttf_provides_glyph(font, codepoint);
|
||||
bool supported = TTFProvidesGlyph(font, codepoint);
|
||||
if (!supported)
|
||||
{
|
||||
return false;
|
||||
@@ -402,12 +402,12 @@ bool font_supports_string_ttf(const utf8* text, FontStyle fontStyle)
|
||||
#endif // NO_TTF
|
||||
}
|
||||
|
||||
bool font_supports_string(const utf8* text, FontStyle fontStyle)
|
||||
bool FontSupportsString(const utf8* text, FontStyle fontStyle)
|
||||
{
|
||||
if (LocalisationService_UseTrueTypeFont())
|
||||
{
|
||||
return font_supports_string_ttf(text, fontStyle);
|
||||
return FontSupportsStringTTF(text, fontStyle);
|
||||
}
|
||||
|
||||
return font_supports_string_sprite(text);
|
||||
return FontSupportsStringSprite(text);
|
||||
}
|
||||
@@ -52,12 +52,12 @@ extern TTFFontSetDescriptor* gCurrentTTFFontSet;
|
||||
|
||||
#endif // NO_TTF
|
||||
|
||||
void font_sprite_initialise_characters();
|
||||
int32_t font_sprite_get_codepoint_offset(int32_t codepoint);
|
||||
int32_t font_sprite_get_codepoint_width(FontStyle fontStyle, int32_t codepoint);
|
||||
ImageId font_sprite_get_codepoint_sprite(FontStyle fontStyle, int32_t codepoint);
|
||||
int32_t font_get_line_height(FontStyle fontStyle);
|
||||
int32_t font_get_line_height_small(FontStyle fontStyle);
|
||||
bool font_supports_string_sprite(const utf8* text);
|
||||
bool font_supports_string_ttf(const utf8* text, FontStyle fontStyle);
|
||||
bool font_supports_string(const utf8* text, FontStyle fontStyle);
|
||||
void FontSpriteInitialiseCharacters();
|
||||
int32_t FontSpriteGetCodepointOffset(int32_t codepoint);
|
||||
int32_t FontSpriteGetCodepointWidth(FontStyle fontStyle, int32_t codepoint);
|
||||
ImageId FontSpriteGetCodepointSprite(FontStyle fontStyle, int32_t codepoint);
|
||||
int32_t FontGetLineHeight(FontStyle fontStyle);
|
||||
int32_t FontGetLineHeightSmall(FontStyle fontStyle);
|
||||
bool FontSupportsStringSprite(const utf8* text);
|
||||
bool FontSupportsStringTTF(const utf8* text, FontStyle fontStyle);
|
||||
bool FontSupportsString(const utf8* text, FontStyle fontStyle);
|
||||
@@ -186,7 +186,7 @@ static void FreeImageList(uint32_t baseImageId, uint32_t count)
|
||||
_freeLists.push_back({ baseImageId, count });
|
||||
}
|
||||
|
||||
uint32_t gfx_object_allocate_images(const rct_g1_element* images, uint32_t count)
|
||||
uint32_t GfxObjectAllocateImages(const rct_g1_element* images, uint32_t count)
|
||||
{
|
||||
if (count == 0 || gOpenRCT2NoGraphics)
|
||||
{
|
||||
@@ -204,14 +204,14 @@ uint32_t gfx_object_allocate_images(const rct_g1_element* images, uint32_t count
|
||||
for (uint32_t i = 0; i < count; i++)
|
||||
{
|
||||
GfxSetG1Element(imageId, &images[i]);
|
||||
drawing_engine_invalidate_image(imageId);
|
||||
DrawingEngineInvalidateImage(imageId);
|
||||
imageId++;
|
||||
}
|
||||
|
||||
return baseImageId;
|
||||
}
|
||||
|
||||
void gfx_object_free_images(uint32_t baseImageId, uint32_t count)
|
||||
void GfxObjectFreeImages(uint32_t baseImageId, uint32_t count)
|
||||
{
|
||||
if (baseImageId != 0 && baseImageId != INVALID_IMAGE_ID)
|
||||
{
|
||||
@@ -222,14 +222,14 @@ void gfx_object_free_images(uint32_t baseImageId, uint32_t count)
|
||||
uint32_t imageId = baseImageId + i;
|
||||
rct_g1_element g1 = {};
|
||||
GfxSetG1Element(imageId, &g1);
|
||||
drawing_engine_invalidate_image(imageId);
|
||||
DrawingEngineInvalidateImage(imageId);
|
||||
}
|
||||
|
||||
FreeImageList(baseImageId, count);
|
||||
}
|
||||
}
|
||||
|
||||
void gfx_object_check_all_images_freed()
|
||||
void GfxObjectCheckAllImagesFreed()
|
||||
{
|
||||
if (_allocatedImageCount != 0)
|
||||
{
|
||||
|
||||
@@ -55,9 +55,9 @@ constexpr bool operator!=(const ImageList& lhs, const ImageList& rhs)
|
||||
return !(lhs == rhs);
|
||||
}
|
||||
|
||||
uint32_t gfx_object_allocate_images(const rct_g1_element* images, uint32_t count);
|
||||
void gfx_object_free_images(uint32_t baseImageId, uint32_t count);
|
||||
void gfx_object_check_all_images_freed();
|
||||
uint32_t GfxObjectAllocateImages(const rct_g1_element* images, uint32_t count);
|
||||
void GfxObjectFreeImages(uint32_t baseImageId, uint32_t count);
|
||||
void GfxObjectCheckAllImagesFreed();
|
||||
size_t ImageListGetUsedCount();
|
||||
size_t ImageListGetMaximum();
|
||||
const std::list<ImageList>& GetAvailableAllocationRanges();
|
||||
@@ -85,7 +85,7 @@ static ZoomLevel _current_view_zoom_back_delay{ 0 };
|
||||
|
||||
static GamePalette gPalette_light;
|
||||
|
||||
static uint8_t calc_light_intensity_lantern(int32_t x, int32_t y)
|
||||
static uint8_t CalcLightIntensityLantern(int32_t x, int32_t y)
|
||||
{
|
||||
double distance = static_cast<double>(x * x + y * y);
|
||||
|
||||
@@ -96,7 +96,7 @@ static uint8_t calc_light_intensity_lantern(int32_t x, int32_t y)
|
||||
return static_cast<uint8_t>(std::min(255.0, light * 255.0));
|
||||
}
|
||||
|
||||
static uint8_t calc_light_intensity_spot(int32_t x, int32_t y)
|
||||
static uint8_t CalcLightIntensitySpot(int32_t x, int32_t y)
|
||||
{
|
||||
double distance = static_cast<double>(x * x + y * y);
|
||||
|
||||
@@ -107,7 +107,7 @@ static uint8_t calc_light_intensity_spot(int32_t x, int32_t y)
|
||||
return static_cast<uint8_t>(std::min(255.0, light * 255.0)) >> 4;
|
||||
}
|
||||
|
||||
static void calc_rescale_light_half(uint8_t* target, uint8_t* source, uint32_t targetWidth, uint32_t targetHeight)
|
||||
static void CalcRescaleLightHalf(uint8_t* target, uint8_t* source, uint32_t targetWidth, uint32_t targetHeight)
|
||||
{
|
||||
uint8_t* parcerRead = source;
|
||||
uint8_t* parcerWrite = target;
|
||||
@@ -124,22 +124,22 @@ static void calc_rescale_light_half(uint8_t* target, uint8_t* source, uint32_t t
|
||||
}
|
||||
}
|
||||
|
||||
void lightfx_set_available(bool available)
|
||||
void LightFXSetAvailable(bool available)
|
||||
{
|
||||
_lightfxAvailable = available;
|
||||
}
|
||||
|
||||
bool lightfx_is_available()
|
||||
bool LightFXIsAvailable()
|
||||
{
|
||||
return _lightfxAvailable && gConfigGeneral.EnableLightFx != 0;
|
||||
}
|
||||
|
||||
bool lightfx_for_vehicles_is_available()
|
||||
bool LightFXForVehiclesIsAvailable()
|
||||
{
|
||||
return lightfx_is_available() && gConfigGeneral.EnableLightFxForVehicles != 0;
|
||||
return LightFXIsAvailable() && gConfigGeneral.EnableLightFxForVehicles != 0;
|
||||
}
|
||||
|
||||
void lightfx_init()
|
||||
void LightFXInit()
|
||||
{
|
||||
_LightListBack = _LightListA;
|
||||
_LightListFront = _LightListB;
|
||||
@@ -155,7 +155,7 @@ void lightfx_init()
|
||||
{
|
||||
for (int32_t x = 0; x < 256; x++)
|
||||
{
|
||||
*parcer = calc_light_intensity_lantern(x - 128, y - 128);
|
||||
*parcer = CalcLightIntensityLantern(x - 128, y - 128);
|
||||
parcer++;
|
||||
}
|
||||
}
|
||||
@@ -166,28 +166,28 @@ void lightfx_init()
|
||||
{
|
||||
for (int32_t x = 0; x < 256; x++)
|
||||
{
|
||||
*parcer = calc_light_intensity_spot(x - 128, y - 128);
|
||||
*parcer = CalcLightIntensitySpot(x - 128, y - 128);
|
||||
parcer++;
|
||||
}
|
||||
}
|
||||
|
||||
calc_rescale_light_half(_bakedLightTexture_lantern_2, _bakedLightTexture_lantern_3, 128, 128);
|
||||
calc_rescale_light_half(_bakedLightTexture_lantern_1, _bakedLightTexture_lantern_2, 64, 64);
|
||||
calc_rescale_light_half(_bakedLightTexture_lantern_0, _bakedLightTexture_lantern_1, 32, 32);
|
||||
CalcRescaleLightHalf(_bakedLightTexture_lantern_2, _bakedLightTexture_lantern_3, 128, 128);
|
||||
CalcRescaleLightHalf(_bakedLightTexture_lantern_1, _bakedLightTexture_lantern_2, 64, 64);
|
||||
CalcRescaleLightHalf(_bakedLightTexture_lantern_0, _bakedLightTexture_lantern_1, 32, 32);
|
||||
|
||||
calc_rescale_light_half(_bakedLightTexture_spot_2, _bakedLightTexture_spot_3, 128, 128);
|
||||
calc_rescale_light_half(_bakedLightTexture_spot_1, _bakedLightTexture_spot_2, 64, 64);
|
||||
calc_rescale_light_half(_bakedLightTexture_spot_0, _bakedLightTexture_spot_1, 32, 32);
|
||||
CalcRescaleLightHalf(_bakedLightTexture_spot_2, _bakedLightTexture_spot_3, 128, 128);
|
||||
CalcRescaleLightHalf(_bakedLightTexture_spot_1, _bakedLightTexture_spot_2, 64, 64);
|
||||
CalcRescaleLightHalf(_bakedLightTexture_spot_0, _bakedLightTexture_spot_1, 32, 32);
|
||||
}
|
||||
|
||||
void lightfx_update_buffers(rct_drawpixelinfo* info)
|
||||
void LightFXUpdateBuffers(rct_drawpixelinfo* info)
|
||||
{
|
||||
_light_rendered_buffer_front = realloc(_light_rendered_buffer_front, info->width * info->height);
|
||||
_light_rendered_buffer_back = realloc(_light_rendered_buffer_back, info->width * info->height);
|
||||
_pixelInfo = *info;
|
||||
}
|
||||
|
||||
void lightfx_prepare_light_list()
|
||||
void LightFXPrepareLightList()
|
||||
{
|
||||
for (uint32_t light = 0; light < LightListCurrentCountFront; light++)
|
||||
{
|
||||
@@ -401,7 +401,7 @@ void lightfx_prepare_light_list()
|
||||
}
|
||||
}
|
||||
|
||||
void lightfx_swap_buffers()
|
||||
void LightFXSwapBuffers()
|
||||
{
|
||||
void* tmp = _light_rendered_buffer_back;
|
||||
_light_rendered_buffer_back = _light_rendered_buffer_front;
|
||||
@@ -429,7 +429,7 @@ void lightfx_swap_buffers()
|
||||
_current_view_zoom_back_delay = _current_view_zoom_back;
|
||||
}
|
||||
|
||||
void lightfx_update_viewport_settings()
|
||||
void LightFXUpdateViewportSettings()
|
||||
{
|
||||
rct_window* mainWindow = WindowGetMain();
|
||||
if (mainWindow != nullptr)
|
||||
@@ -442,7 +442,7 @@ void lightfx_update_viewport_settings()
|
||||
}
|
||||
}
|
||||
|
||||
void lightfx_render_lights_to_frontbuffer()
|
||||
void LightFXRenderLightsToFrontBuffer()
|
||||
{
|
||||
if (_light_rendered_buffer_front == nullptr)
|
||||
{
|
||||
@@ -614,17 +614,17 @@ void lightfx_render_lights_to_frontbuffer()
|
||||
}
|
||||
}
|
||||
|
||||
void* lightfx_get_front_buffer()
|
||||
void* LightFXGetFrontBuffer()
|
||||
{
|
||||
return _light_rendered_buffer_front;
|
||||
}
|
||||
|
||||
const GamePalette& lightfx_get_palette()
|
||||
const GamePalette& LightFXGetPalette()
|
||||
{
|
||||
return gPalette_light;
|
||||
}
|
||||
|
||||
static void LightfxAdd3DLight(
|
||||
static void LightFXAdd3DLight(
|
||||
const uint32_t lightHash, const LightFXQualifier qualifier, const uint8_t id, const CoordsXYZ& loc,
|
||||
const LightType lightType)
|
||||
{
|
||||
@@ -671,26 +671,26 @@ static void LightfxAdd3DLight(
|
||||
// log_warning("new 3d light");
|
||||
}
|
||||
|
||||
static void LightfxAdd3DLight(const CoordsXYZ& loc, const LightType lightType)
|
||||
static void LightFXAdd3DLight(const CoordsXYZ& loc, const LightType lightType)
|
||||
{
|
||||
LightfxAdd3DLight(((loc.x << 16) | loc.y), LightFXQualifier::Map, loc.z, loc, lightType);
|
||||
LightFXAdd3DLight(((loc.x << 16) | loc.y), LightFXQualifier::Map, loc.z, loc, lightType);
|
||||
}
|
||||
|
||||
void LightfxAdd3DLight(const EntityBase& entity, const uint8_t id, const CoordsXYZ& loc, const LightType lightType)
|
||||
void LightFXAdd3DLight(const EntityBase& entity, const uint8_t id, const CoordsXYZ& loc, const LightType lightType)
|
||||
{
|
||||
LightfxAdd3DLight(entity.sprite_index.ToUnderlying(), LightFXQualifier::Entity, id, loc, lightType);
|
||||
LightFXAdd3DLight(entity.sprite_index.ToUnderlying(), LightFXQualifier::Entity, id, loc, lightType);
|
||||
}
|
||||
|
||||
void lightfx_add_3d_light_magic_from_drawing_tile(
|
||||
void LightFXAdd3DLightMagicFromDrawingTile(
|
||||
const CoordsXY& mapPosition, int16_t offsetX, int16_t offsetY, int16_t offsetZ, LightType lightType)
|
||||
{
|
||||
int16_t x = mapPosition.x + offsetX + 16;
|
||||
int16_t y = mapPosition.y + offsetY + 16;
|
||||
|
||||
LightfxAdd3DLight({ x, y, offsetZ }, lightType);
|
||||
LightFXAdd3DLight({ x, y, offsetZ }, lightType);
|
||||
}
|
||||
|
||||
uint32_t lightfx_get_light_polution()
|
||||
uint32_t LightFXGetLightPolution()
|
||||
{
|
||||
return _lightPolution_front;
|
||||
}
|
||||
@@ -700,10 +700,10 @@ static constexpr const int16_t offsetLookup[] = {
|
||||
};
|
||||
void LightFxAddLightsMagicVehicle_ObservationTower(const Vehicle* vehicle)
|
||||
{
|
||||
LightfxAdd3DLight(*vehicle, 0, { vehicle->x, vehicle->y + 16, vehicle->z }, LightType::Spot3);
|
||||
LightfxAdd3DLight(*vehicle, 1, { vehicle->x + 16, vehicle->y, vehicle->z }, LightType::Spot3);
|
||||
LightfxAdd3DLight(*vehicle, 2, { vehicle->x - 16, vehicle->y, vehicle->z }, LightType::Spot3);
|
||||
LightfxAdd3DLight(*vehicle, 3, { vehicle->x, vehicle->y - 16, vehicle->z }, LightType::Spot3);
|
||||
LightFXAdd3DLight(*vehicle, 0, { vehicle->x, vehicle->y + 16, vehicle->z }, LightType::Spot3);
|
||||
LightFXAdd3DLight(*vehicle, 1, { vehicle->x + 16, vehicle->y, vehicle->z }, LightType::Spot3);
|
||||
LightFXAdd3DLight(*vehicle, 2, { vehicle->x - 16, vehicle->y, vehicle->z }, LightType::Spot3);
|
||||
LightFXAdd3DLight(*vehicle, 3, { vehicle->x, vehicle->y - 16, vehicle->z }, LightType::Spot3);
|
||||
}
|
||||
|
||||
void LightFxAddLightsMagicVehicle_MineTrainCoaster(const Vehicle* vehicle)
|
||||
@@ -712,13 +712,13 @@ void LightFxAddLightsMagicVehicle_MineTrainCoaster(const Vehicle* vehicle)
|
||||
{
|
||||
int16_t place_x = vehicle->x - offsetLookup[(vehicle->sprite_direction + 0) % 32] * 2;
|
||||
int16_t place_y = vehicle->y - offsetLookup[(vehicle->sprite_direction + 8) % 32] * 2;
|
||||
LightfxAdd3DLight(*vehicle, 0, { place_x, place_y, vehicle->z }, LightType::Spot3);
|
||||
LightFXAdd3DLight(*vehicle, 0, { place_x, place_y, vehicle->z }, LightType::Spot3);
|
||||
}
|
||||
}
|
||||
|
||||
void LightFxAddLightsMagicVehicle_ChairLift(const Vehicle* vehicle)
|
||||
{
|
||||
LightfxAdd3DLight(*vehicle, 0, { vehicle->x, vehicle->y, vehicle->z - 16 }, LightType::Lantern2);
|
||||
LightFXAdd3DLight(*vehicle, 0, { vehicle->x, vehicle->y, vehicle->z - 16 }, LightType::Lantern2);
|
||||
}
|
||||
void LightFxAddLightsMagicVehicle_BoatHire(const Vehicle* vehicle)
|
||||
{
|
||||
@@ -732,33 +732,33 @@ void LightFxAddLightsMagicVehicle_BoatHire(const Vehicle* vehicle)
|
||||
int16_t place_y = vehicle_draw->y;
|
||||
place_x -= offsetLookup[(vehicle_draw->sprite_direction + 0) % 32];
|
||||
place_y -= offsetLookup[(vehicle_draw->sprite_direction + 8) % 32];
|
||||
LightfxAdd3DLight(*vehicle, 0, { place_x, place_y, vehicle_draw->z }, LightType::Spot2);
|
||||
LightFXAdd3DLight(*vehicle, 0, { place_x, place_y, vehicle_draw->z }, LightType::Spot2);
|
||||
place_x -= offsetLookup[(vehicle_draw->sprite_direction + 0) % 32];
|
||||
place_y -= offsetLookup[(vehicle_draw->sprite_direction + 8) % 32];
|
||||
LightfxAdd3DLight(*vehicle, 1, { place_x, place_y, vehicle_draw->z }, LightType::Spot2);
|
||||
LightFXAdd3DLight(*vehicle, 1, { place_x, place_y, vehicle_draw->z }, LightType::Spot2);
|
||||
}
|
||||
void LightFxAddLightsMagicVehicle_Monorail(const Vehicle* vehicle)
|
||||
{
|
||||
LightfxAdd3DLight(*vehicle, 0, { vehicle->x, vehicle->y, vehicle->z + 12 }, LightType::Spot2);
|
||||
LightFXAdd3DLight(*vehicle, 0, { vehicle->x, vehicle->y, vehicle->z + 12 }, LightType::Spot2);
|
||||
int16_t place_x = vehicle->x;
|
||||
int16_t place_y = vehicle->y;
|
||||
if (vehicle == vehicle->TrainHead())
|
||||
{
|
||||
place_x -= offsetLookup[(vehicle->sprite_direction + 0) % 32] * 2;
|
||||
place_y -= offsetLookup[(vehicle->sprite_direction + 8) % 32] * 2;
|
||||
LightfxAdd3DLight(*vehicle, 1, { place_x, place_y, vehicle->z + 10 }, LightType::Lantern3);
|
||||
LightFXAdd3DLight(*vehicle, 1, { place_x, place_y, vehicle->z + 10 }, LightType::Lantern3);
|
||||
place_x -= offsetLookup[(vehicle->sprite_direction + 0) % 32] * 3;
|
||||
place_y -= offsetLookup[(vehicle->sprite_direction + 8) % 32] * 3;
|
||||
LightfxAdd3DLight(*vehicle, 2, { place_x, place_y, vehicle->z + 2 }, LightType::Lantern3);
|
||||
LightFXAdd3DLight(*vehicle, 2, { place_x, place_y, vehicle->z + 2 }, LightType::Lantern3);
|
||||
}
|
||||
if (vehicle == vehicle->TrainTail())
|
||||
{
|
||||
place_x += offsetLookup[(vehicle->sprite_direction + 0) % 32] * 2;
|
||||
place_y += offsetLookup[(vehicle->sprite_direction + 8) % 32] * 2;
|
||||
LightfxAdd3DLight(*vehicle, 3, { place_x, place_y, vehicle->z + 10 }, LightType::Lantern3);
|
||||
LightFXAdd3DLight(*vehicle, 3, { place_x, place_y, vehicle->z + 10 }, LightType::Lantern3);
|
||||
place_x += offsetLookup[(vehicle->sprite_direction + 0) % 32] * 2;
|
||||
place_y += offsetLookup[(vehicle->sprite_direction + 8) % 32] * 2;
|
||||
LightfxAdd3DLight(*vehicle, 4, { place_x, place_y, vehicle->z + 2 }, LightType::Lantern3);
|
||||
LightFXAdd3DLight(*vehicle, 4, { place_x, place_y, vehicle->z + 2 }, LightType::Lantern3);
|
||||
}
|
||||
}
|
||||
void LightFxAddLightsMagicVehicle_MiniatureRailway(const Vehicle* vehicle)
|
||||
@@ -767,18 +767,18 @@ void LightFxAddLightsMagicVehicle_MiniatureRailway(const Vehicle* vehicle)
|
||||
{
|
||||
int16_t place_x = vehicle->x - offsetLookup[(vehicle->sprite_direction + 0) % 32] * 2;
|
||||
int16_t place_y = vehicle->y - offsetLookup[(vehicle->sprite_direction + 8) % 32] * 2;
|
||||
LightfxAdd3DLight(*vehicle, 1, { place_x, place_y, vehicle->z + 10 }, LightType::Lantern3);
|
||||
LightFXAdd3DLight(*vehicle, 1, { place_x, place_y, vehicle->z + 10 }, LightType::Lantern3);
|
||||
place_x -= offsetLookup[(vehicle->sprite_direction + 0) % 32] * 2;
|
||||
place_y -= offsetLookup[(vehicle->sprite_direction + 8) % 32] * 2;
|
||||
LightfxAdd3DLight(*vehicle, 2, { place_x, place_y, vehicle->z + 2 }, LightType::Lantern3);
|
||||
LightFXAdd3DLight(*vehicle, 2, { place_x, place_y, vehicle->z + 2 }, LightType::Lantern3);
|
||||
}
|
||||
else
|
||||
{
|
||||
LightfxAdd3DLight(*vehicle, 0, { vehicle->x, vehicle->y, vehicle->z + 10 }, LightType::Lantern3);
|
||||
LightFXAdd3DLight(*vehicle, 0, { vehicle->x, vehicle->y, vehicle->z + 10 }, LightType::Lantern3);
|
||||
}
|
||||
}
|
||||
|
||||
void LightfxAddLightsMagicVehicle(const Vehicle* vehicle)
|
||||
void LightFXAddLightsMagicVehicle(const Vehicle* vehicle)
|
||||
{
|
||||
auto ride = vehicle->GetRide();
|
||||
if (ride == nullptr)
|
||||
@@ -794,18 +794,18 @@ void LightFxAddKioskLights(const CoordsXY& mapPosition, const int32_t height, co
|
||||
uint8_t relativeRotation = (4 - GetCurrentRotation()) % 4;
|
||||
CoordsXY lanternOffset1 = CoordsXY(0, 16).Rotate(relativeRotation);
|
||||
CoordsXY lanternOffset2 = CoordsXY(16, 0).Rotate(relativeRotation);
|
||||
lightfx_add_3d_light_magic_from_drawing_tile(
|
||||
LightFXAdd3DLightMagicFromDrawingTile(
|
||||
mapPosition, lanternOffset1.x, lanternOffset1.y, height + zOffset, LightType::Lantern3);
|
||||
lightfx_add_3d_light_magic_from_drawing_tile(
|
||||
LightFXAdd3DLightMagicFromDrawingTile(
|
||||
mapPosition, lanternOffset2.x, lanternOffset2.y, height + zOffset, LightType::Lantern3);
|
||||
lightfx_add_3d_light_magic_from_drawing_tile(mapPosition, 8, 32, height, LightType::Spot1);
|
||||
lightfx_add_3d_light_magic_from_drawing_tile(mapPosition, 32, 8, height, LightType::Spot1);
|
||||
lightfx_add_3d_light_magic_from_drawing_tile(mapPosition, -32, 8, height, LightType::Spot1);
|
||||
lightfx_add_3d_light_magic_from_drawing_tile(mapPosition, 8, -32, height, LightType::Spot1);
|
||||
lightfx_add_3d_light_magic_from_drawing_tile(mapPosition, -8, 32, height, LightType::Spot1);
|
||||
lightfx_add_3d_light_magic_from_drawing_tile(mapPosition, 32, -8, height, LightType::Spot1);
|
||||
lightfx_add_3d_light_magic_from_drawing_tile(mapPosition, -32, -8, height, LightType::Spot1);
|
||||
lightfx_add_3d_light_magic_from_drawing_tile(mapPosition, -8, -32, height, LightType::Spot1);
|
||||
LightFXAdd3DLightMagicFromDrawingTile(mapPosition, 8, 32, height, LightType::Spot1);
|
||||
LightFXAdd3DLightMagicFromDrawingTile(mapPosition, 32, 8, height, LightType::Spot1);
|
||||
LightFXAdd3DLightMagicFromDrawingTile(mapPosition, -32, 8, height, LightType::Spot1);
|
||||
LightFXAdd3DLightMagicFromDrawingTile(mapPosition, 8, -32, height, LightType::Spot1);
|
||||
LightFXAdd3DLightMagicFromDrawingTile(mapPosition, -8, 32, height, LightType::Spot1);
|
||||
LightFXAdd3DLightMagicFromDrawingTile(mapPosition, 32, -8, height, LightType::Spot1);
|
||||
LightFXAdd3DLightMagicFromDrawingTile(mapPosition, -32, -8, height, LightType::Spot1);
|
||||
LightFXAdd3DLightMagicFromDrawingTile(mapPosition, -8, -32, height, LightType::Spot1);
|
||||
}
|
||||
|
||||
void LightFxAddShopLights(const CoordsXY& mapPosition, const uint8_t direction, const int32_t height, const uint8_t zOffset)
|
||||
@@ -814,29 +814,29 @@ void LightFxAddShopLights(const CoordsXY& mapPosition, const uint8_t direction,
|
||||
{
|
||||
CoordsXY spotOffset1 = CoordsXY(-32, 8).Rotate(direction);
|
||||
CoordsXY spotOffset2 = CoordsXY(-32, 4).Rotate(direction);
|
||||
lightfx_add_3d_light_magic_from_drawing_tile(mapPosition, spotOffset1.x, spotOffset1.y, height, LightType::Spot1);
|
||||
lightfx_add_3d_light_magic_from_drawing_tile(mapPosition, spotOffset2.x, spotOffset2.y, height, LightType::Spot2);
|
||||
LightFXAdd3DLightMagicFromDrawingTile(mapPosition, spotOffset1.x, spotOffset1.y, height, LightType::Spot1);
|
||||
LightFXAdd3DLightMagicFromDrawingTile(mapPosition, spotOffset2.x, spotOffset2.y, height, LightType::Spot2);
|
||||
}
|
||||
else if (direction == (7 - GetCurrentRotation()) % 4) // Back left Facing Stall
|
||||
{
|
||||
CoordsXY spotOffset1 = CoordsXY(-32, -8).Rotate(direction);
|
||||
CoordsXY spotOffset2 = CoordsXY(-32, -4).Rotate(direction);
|
||||
lightfx_add_3d_light_magic_from_drawing_tile(mapPosition, spotOffset1.x, spotOffset1.y, height, LightType::Spot1);
|
||||
lightfx_add_3d_light_magic_from_drawing_tile(mapPosition, spotOffset2.x, spotOffset2.y, height, LightType::Spot2);
|
||||
LightFXAdd3DLightMagicFromDrawingTile(mapPosition, spotOffset1.x, spotOffset1.y, height, LightType::Spot1);
|
||||
LightFXAdd3DLightMagicFromDrawingTile(mapPosition, spotOffset2.x, spotOffset2.y, height, LightType::Spot2);
|
||||
}
|
||||
else // Forward Facing Stall
|
||||
{
|
||||
CoordsXY spotOffset1 = CoordsXY(-32, 8).Rotate(direction);
|
||||
CoordsXY spotOffset2 = CoordsXY(-32, -8).Rotate(direction);
|
||||
CoordsXY lanternOffset = CoordsXY(-16, 0).Rotate(direction);
|
||||
lightfx_add_3d_light_magic_from_drawing_tile(
|
||||
LightFXAdd3DLightMagicFromDrawingTile(
|
||||
mapPosition, lanternOffset.x, lanternOffset.y, height + zOffset, LightType::Lantern3);
|
||||
lightfx_add_3d_light_magic_from_drawing_tile(mapPosition, spotOffset1.x, spotOffset1.y, height, LightType::Spot1);
|
||||
lightfx_add_3d_light_magic_from_drawing_tile(mapPosition, spotOffset2.x, spotOffset2.y, height, LightType::Spot1);
|
||||
LightFXAdd3DLightMagicFromDrawingTile(mapPosition, spotOffset1.x, spotOffset1.y, height, LightType::Spot1);
|
||||
LightFXAdd3DLightMagicFromDrawingTile(mapPosition, spotOffset2.x, spotOffset2.y, height, LightType::Spot1);
|
||||
}
|
||||
}
|
||||
|
||||
void lightfx_apply_palette_filter(uint8_t i, uint8_t* r, uint8_t* g, uint8_t* b)
|
||||
void LightFXApplyPaletteFilter(uint8_t i, uint8_t* r, uint8_t* g, uint8_t* b)
|
||||
{
|
||||
float night = static_cast<float>(pow(gDayNightCycle, 1.5));
|
||||
|
||||
@@ -919,7 +919,7 @@ void lightfx_apply_palette_filter(uint8_t i, uint8_t* r, uint8_t* g, uint8_t* b)
|
||||
reduceColourLit *= night / static_cast<float>(std::pow(std::max(1.01f, 0.4f + lightAvg), 2.0));
|
||||
|
||||
float targetLightPollution = reduceColourLit
|
||||
* std::max(0.0f, 0.0f + 0.000001f * static_cast<float>(lightfx_get_light_polution()));
|
||||
* std::max(0.0f, 0.0f + 0.000001f * static_cast<float>(LightFXGetLightPolution()));
|
||||
lightPolution -= (lightPolution - targetLightPollution) * 0.001f;
|
||||
|
||||
// lightPollution /= 1.0f + fogginess * 1.0f;
|
||||
@@ -1007,7 +1007,7 @@ void lightfx_apply_palette_filter(uint8_t i, uint8_t* r, uint8_t* g, uint8_t* b)
|
||||
}
|
||||
}
|
||||
|
||||
static uint8_t mix_light(uint32_t a, uint32_t b, uint32_t intensity)
|
||||
static uint8_t MixLight(uint32_t a, uint32_t b, uint32_t intensity)
|
||||
{
|
||||
intensity = intensity * 6;
|
||||
uint32_t bMul = (b * intensity) >> 8;
|
||||
@@ -1016,16 +1016,16 @@ static uint8_t mix_light(uint32_t a, uint32_t b, uint32_t intensity)
|
||||
return result;
|
||||
}
|
||||
|
||||
void lightfx_render_to_texture(
|
||||
void LightFXRenderToTexture(
|
||||
void* dstPixels, uint32_t dstPitch, uint8_t* bits, uint32_t width, uint32_t height, const uint32_t* palette,
|
||||
const uint32_t* lightPalette)
|
||||
{
|
||||
lightfx_update_viewport_settings();
|
||||
lightfx_swap_buffers();
|
||||
lightfx_prepare_light_list();
|
||||
lightfx_render_lights_to_frontbuffer();
|
||||
LightFXUpdateViewportSettings();
|
||||
LightFXSwapBuffers();
|
||||
LightFXPrepareLightList();
|
||||
LightFXRenderLightsToFrontBuffer();
|
||||
|
||||
uint8_t* lightBits = static_cast<uint8_t*>(lightfx_get_front_buffer());
|
||||
uint8_t* lightBits = static_cast<uint8_t*>(LightFXGetFrontBuffer());
|
||||
if (lightBits == nullptr)
|
||||
{
|
||||
return;
|
||||
@@ -1049,10 +1049,10 @@ void lightfx_render_to_texture(
|
||||
}
|
||||
else
|
||||
{
|
||||
colour |= mix_light((darkColour >> 0) & 0xFF, (lightColour >> 0) & 0xFF, lightIntensity);
|
||||
colour |= mix_light((darkColour >> 8) & 0xFF, (lightColour >> 8) & 0xFF, lightIntensity) << 8;
|
||||
colour |= mix_light((darkColour >> 16) & 0xFF, (lightColour >> 16) & 0xFF, lightIntensity) << 16;
|
||||
colour |= mix_light((darkColour >> 24) & 0xFF, (lightColour >> 24) & 0xFF, lightIntensity) << 24;
|
||||
colour |= MixLight((darkColour >> 0) & 0xFF, (lightColour >> 0) & 0xFF, lightIntensity);
|
||||
colour |= MixLight((darkColour >> 8) & 0xFF, (lightColour >> 8) & 0xFF, lightIntensity) << 8;
|
||||
colour |= MixLight((darkColour >> 16) & 0xFF, (lightColour >> 16) & 0xFF, lightIntensity) << 16;
|
||||
colour |= MixLight((darkColour >> 24) & 0xFF, (lightColour >> 24) & 0xFF, lightIntensity) << 24;
|
||||
}
|
||||
*dst++ = colour;
|
||||
}
|
||||
|
||||
@@ -42,28 +42,28 @@ constexpr LightType SetLightTypeSize(LightType type, uint8_t size)
|
||||
return static_cast<LightType>(((static_cast<uint8_t>(type) & ~0x3) | size));
|
||||
}
|
||||
|
||||
void lightfx_set_available(bool available);
|
||||
bool lightfx_is_available();
|
||||
bool lightfx_for_vehicles_is_available();
|
||||
void LightFXSetAvailable(bool available);
|
||||
bool LightFXIsAvailable();
|
||||
bool LightFXForVehiclesIsAvailable();
|
||||
|
||||
void lightfx_init();
|
||||
void LightFXInit();
|
||||
|
||||
void lightfx_update_buffers(rct_drawpixelinfo*);
|
||||
void LightFXUpdateBuffers(rct_drawpixelinfo*);
|
||||
|
||||
void lightfx_prepare_light_list();
|
||||
void lightfx_swap_buffers();
|
||||
void lightfx_render_lights_to_frontbuffer();
|
||||
void lightfx_update_viewport_settings();
|
||||
void LightFXPrepareLightList();
|
||||
void LightFXSwapBuffers();
|
||||
void LightFXRenderLightsToFrontBuffer();
|
||||
void LightFXUpdateViewportSettings();
|
||||
|
||||
void* lightfx_get_front_buffer();
|
||||
const GamePalette& lightfx_get_palette();
|
||||
void* LightFXGetFrontBuffer();
|
||||
const GamePalette& LightFXGetPalette();
|
||||
|
||||
void LightfxAdd3DLight(const EntityBase& entity, const uint8_t id, const CoordsXYZ& loc, const LightType lightType);
|
||||
void LightFXAdd3DLight(const EntityBase& entity, const uint8_t id, const CoordsXYZ& loc, const LightType lightType);
|
||||
|
||||
void lightfx_add_3d_light_magic_from_drawing_tile(
|
||||
void LightFXAdd3DLightMagicFromDrawingTile(
|
||||
const CoordsXY& mapPosition, int16_t offsetX, int16_t offsetY, int16_t offsetZ, LightType lightType);
|
||||
|
||||
void LightfxAddLightsMagicVehicle(const Vehicle* vehicle);
|
||||
void LightFXAddLightsMagicVehicle(const Vehicle* vehicle);
|
||||
void LightFxAddLightsMagicVehicle_ObservationTower(const Vehicle* vehicle);
|
||||
void LightFxAddLightsMagicVehicle_MineTrainCoaster(const Vehicle* vehicle);
|
||||
void LightFxAddLightsMagicVehicle_ChairLift(const Vehicle* vehicle);
|
||||
@@ -74,9 +74,9 @@ void LightFxAddLightsMagicVehicle_MiniatureRailway(const Vehicle* vehicle);
|
||||
void LightFxAddKioskLights(const CoordsXY& mapPosition, const int32_t height, const uint8_t zOffset);
|
||||
void LightFxAddShopLights(const CoordsXY& mapPosition, const uint8_t direction, const int32_t height, const uint8_t zOffset);
|
||||
|
||||
uint32_t lightfx_get_light_polution();
|
||||
uint32_t LightFXGetLightPolution();
|
||||
|
||||
void lightfx_apply_palette_filter(uint8_t i, uint8_t* r, uint8_t* g, uint8_t* b);
|
||||
void lightfx_render_to_texture(
|
||||
void LightFXApplyPaletteFilter(uint8_t i, uint8_t* r, uint8_t* g, uint8_t* b);
|
||||
void LightFXRenderToTexture(
|
||||
void* dstPixels, uint32_t dstPitch, uint8_t* bits, uint32_t width, uint32_t height, const uint32_t* palette,
|
||||
const uint32_t* lightPalette);
|
||||
@@ -16,7 +16,7 @@
|
||||
* Draws a horizontal line of specified colour to a buffer.
|
||||
* rct2: 0x0068474C
|
||||
*/
|
||||
static void gfx_draw_line_on_buffer(rct_drawpixelinfo* dpi, char colour, const ScreenCoordsXY& coords, int32_t no_pixels)
|
||||
static void GfxDrawLineOnBuffer(rct_drawpixelinfo* dpi, char colour, const ScreenCoordsXY& coords, int32_t no_pixels)
|
||||
{
|
||||
ScreenCoordsXY offset{ coords.x - dpi->x, coords.y - dpi->y };
|
||||
|
||||
@@ -140,14 +140,14 @@ void GfxDrawLineSoftware(rct_drawpixelinfo* dpi, const ScreenLine& line, int32_t
|
||||
{
|
||||
// Vertical lines are drawn 1 pixel at a time
|
||||
if (steep)
|
||||
gfx_draw_line_on_buffer(dpi, colour, { y, x }, 1);
|
||||
GfxDrawLineOnBuffer(dpi, colour, { y, x }, 1);
|
||||
|
||||
error -= delta_y;
|
||||
if (error < 0)
|
||||
{
|
||||
// Non vertical lines are drawn with as many pixels in a horizontal line as possible
|
||||
if (!steep)
|
||||
gfx_draw_line_on_buffer(dpi, colour, { x_start, y }, no_pixels);
|
||||
GfxDrawLineOnBuffer(dpi, colour, { x_start, y }, no_pixels);
|
||||
|
||||
// Reset non vertical line vars
|
||||
x_start = x + 1;
|
||||
@@ -159,7 +159,7 @@ void GfxDrawLineSoftware(rct_drawpixelinfo* dpi, const ScreenLine& line, int32_t
|
||||
// Catch the case of the last line
|
||||
if (x + 1 == x2 && !steep)
|
||||
{
|
||||
gfx_draw_line_on_buffer(dpi, colour, { x_start, y }, no_pixels);
|
||||
GfxDrawLineOnBuffer(dpi, colour, { x_start, y }, no_pixels);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -51,13 +51,13 @@ static IDrawingEngine* GetDrawingEngine()
|
||||
return result;
|
||||
}
|
||||
|
||||
bool drawing_engine_requires_new_window(DrawingEngine srcEngine, DrawingEngine dstEngine)
|
||||
bool DrawingEngineRequiresNewWindow(DrawingEngine srcEngine, DrawingEngine dstEngine)
|
||||
{
|
||||
bool openGL = srcEngine == DrawingEngine::OpenGL || dstEngine == DrawingEngine::OpenGL;
|
||||
return Platform::RequireNewWindow(openGL);
|
||||
}
|
||||
|
||||
void drawing_engine_init()
|
||||
void DrawingEngineInit()
|
||||
{
|
||||
auto context = GetContext();
|
||||
if (context != nullptr)
|
||||
@@ -66,7 +66,7 @@ void drawing_engine_init()
|
||||
}
|
||||
}
|
||||
|
||||
void drawing_engine_resize()
|
||||
void DrawingEngineResize()
|
||||
{
|
||||
auto context = GetContext();
|
||||
if (context != nullptr)
|
||||
@@ -80,7 +80,7 @@ void drawing_engine_resize()
|
||||
}
|
||||
}
|
||||
|
||||
void drawing_engine_set_palette(const GamePalette& colours)
|
||||
void DrawingEngineSetPalette(const GamePalette& colours)
|
||||
{
|
||||
auto context = GetContext();
|
||||
if (context != nullptr)
|
||||
@@ -93,7 +93,7 @@ void drawing_engine_set_palette(const GamePalette& colours)
|
||||
}
|
||||
}
|
||||
|
||||
void drawing_engine_copy_rect(int32_t x, int32_t y, int32_t width, int32_t height, int32_t dx, int32_t dy)
|
||||
void DrawingEngineCopyRect(int32_t x, int32_t y, int32_t width, int32_t height, int32_t dx, int32_t dy)
|
||||
{
|
||||
auto context = GetContext();
|
||||
if (context != nullptr)
|
||||
@@ -106,7 +106,7 @@ void drawing_engine_copy_rect(int32_t x, int32_t y, int32_t width, int32_t heigh
|
||||
}
|
||||
}
|
||||
|
||||
void drawing_engine_dispose()
|
||||
void DrawingEngineDispose()
|
||||
{
|
||||
auto context = GetContext();
|
||||
if (context != nullptr)
|
||||
@@ -115,14 +115,14 @@ void drawing_engine_dispose()
|
||||
}
|
||||
}
|
||||
|
||||
rct_drawpixelinfo* drawing_engine_get_dpi()
|
||||
rct_drawpixelinfo* DrawingEngineGetDpi()
|
||||
{
|
||||
auto context = GetContext();
|
||||
auto drawingEngine = context->GetDrawingEngine();
|
||||
return drawingEngine->GetDrawingPixelInfo();
|
||||
}
|
||||
|
||||
bool drawing_engine_has_dirty_optimisations()
|
||||
bool DrawingEngineHasDirtyOptimisations()
|
||||
{
|
||||
bool result = false;
|
||||
auto drawingEngine = GetDrawingEngine();
|
||||
@@ -133,7 +133,7 @@ bool drawing_engine_has_dirty_optimisations()
|
||||
return result;
|
||||
}
|
||||
|
||||
void drawing_engine_invalidate_image(uint32_t image)
|
||||
void DrawingEngineInvalidateImage(uint32_t image)
|
||||
{
|
||||
auto drawingEngine = GetDrawingEngine();
|
||||
if (drawingEngine != nullptr)
|
||||
@@ -142,7 +142,7 @@ void drawing_engine_invalidate_image(uint32_t image)
|
||||
}
|
||||
}
|
||||
|
||||
void drawing_engine_set_vsync(bool vsync)
|
||||
void DrawingEngineSetVSync(bool vsync)
|
||||
{
|
||||
auto drawingEngine = GetDrawingEngine();
|
||||
if (drawingEngine != nullptr)
|
||||
|
||||
@@ -18,14 +18,14 @@ enum class DrawingEngine : int32_t;
|
||||
extern StringId DrawingEngineStringIds[3];
|
||||
|
||||
DrawingEngine drawing_engine_get_type();
|
||||
bool drawing_engine_requires_new_window(DrawingEngine srcEngine, DrawingEngine dstEngine);
|
||||
void drawing_engine_init();
|
||||
void drawing_engine_resize();
|
||||
void drawing_engine_set_palette(const GamePalette& colours);
|
||||
void drawing_engine_copy_rect(int32_t x, int32_t y, int32_t width, int32_t height, int32_t dx, int32_t dy);
|
||||
void drawing_engine_dispose();
|
||||
bool DrawingEngineRequiresNewWindow(DrawingEngine srcEngine, DrawingEngine dstEngine);
|
||||
void DrawingEngineInit();
|
||||
void DrawingEngineResize();
|
||||
void DrawingEngineSetPalette(const GamePalette& colours);
|
||||
void DrawingEngineCopyRect(int32_t x, int32_t y, int32_t width, int32_t height, int32_t dx, int32_t dy);
|
||||
void DrawingEngineDispose();
|
||||
|
||||
rct_drawpixelinfo* drawing_engine_get_dpi();
|
||||
bool drawing_engine_has_dirty_optimisations();
|
||||
void drawing_engine_invalidate_image(uint32_t image);
|
||||
void drawing_engine_set_vsync(bool vsync);
|
||||
rct_drawpixelinfo* DrawingEngineGetDpi();
|
||||
bool DrawingEngineHasDirtyOptimisations();
|
||||
void DrawingEngineInvalidateImage(uint32_t image);
|
||||
void DrawingEngineSetVSync(bool vsync);
|
||||
@@ -42,9 +42,9 @@ static uint8_t _characterBitmaps[FONT_SPRITE_GLYPH_COUNT + SPR_G2_GLYPH_COUNT][8
|
||||
static uint32_t _drawSCrollNextIndex = 0;
|
||||
static std::mutex _scrollingTextMutex;
|
||||
|
||||
static void scrolling_text_set_bitmap_for_sprite(
|
||||
static void ScrollingTextSetBitmapForSprite(
|
||||
std::string_view text, int32_t scroll, uint8_t* bitmap, const int16_t* scrollPositionOffsets, colour_t colour);
|
||||
static void scrolling_text_set_bitmap_for_ttf(
|
||||
static void ScrollingTextSetBitmapForTTF(
|
||||
std::string_view text, int32_t scroll, uint8_t* bitmap, const int16_t* scrollPositionOffsets, colour_t colour);
|
||||
|
||||
static void ScrollingTextInitialiseCharacterBitmaps(uint32_t glyphStart, uint16_t offset, uint16_t count, bool isAntiAliased)
|
||||
@@ -109,9 +109,9 @@ void ScrollingTextInitialiseBitmaps()
|
||||
ScrollingTextInitialiseScrollingText();
|
||||
}
|
||||
|
||||
static uint8_t* font_sprite_get_codepoint_bitmap(int32_t codepoint)
|
||||
static uint8_t* FontSpriteGetCodepointBitmap(int32_t codepoint)
|
||||
{
|
||||
auto offset = font_sprite_get_codepoint_offset(codepoint);
|
||||
auto offset = FontSpriteGetCodepointOffset(codepoint);
|
||||
if (offset >= FONT_SPRITE_GLYPH_COUNT)
|
||||
{
|
||||
return _characterBitmaps[offset - (SPR_G2_CHAR_BEGIN - SPR_CHAR_START) + FONT_SPRITE_GLYPH_COUNT];
|
||||
@@ -120,7 +120,7 @@ static uint8_t* font_sprite_get_codepoint_bitmap(int32_t codepoint)
|
||||
return _characterBitmaps[offset];
|
||||
}
|
||||
|
||||
static int32_t scrolling_text_get_matching_or_oldest(
|
||||
static int32_t ScrollingTextGetMatchingOrOldest(
|
||||
StringId stringId, Formatter& ft, uint16_t scroll, uint16_t scrollingMode, colour_t colour)
|
||||
{
|
||||
uint32_t oldestId = 0xFFFFFFFF;
|
||||
@@ -146,7 +146,7 @@ static int32_t scrolling_text_get_matching_or_oldest(
|
||||
return scrollIndex;
|
||||
}
|
||||
|
||||
static void scrolling_text_format(utf8* dst, size_t size, rct_draw_scroll_text* scrollText)
|
||||
static void ScrollingTextFormat(utf8* dst, size_t size, rct_draw_scroll_text* scrollText)
|
||||
{
|
||||
if (gConfigGeneral.UpperCaseBanners)
|
||||
{
|
||||
@@ -1447,7 +1447,7 @@ ImageId ScrollingTextSetup(
|
||||
|
||||
_drawSCrollNextIndex++;
|
||||
ft.Rewind();
|
||||
int32_t scrollIndex = scrolling_text_get_matching_or_oldest(stringId, ft, scroll, scrollingMode, colour);
|
||||
int32_t scrollIndex = ScrollingTextGetMatchingOrOldest(stringId, ft, scroll, scrollingMode, colour);
|
||||
if (scrollIndex >= SPR_SCROLLING_TEXT_START)
|
||||
return ImageId(scrollIndex);
|
||||
|
||||
@@ -1462,26 +1462,26 @@ ImageId ScrollingTextSetup(
|
||||
|
||||
// Create the string to draw
|
||||
utf8 scrollString[256];
|
||||
scrolling_text_format(scrollString, 256, scrollText);
|
||||
ScrollingTextFormat(scrollString, 256, scrollText);
|
||||
|
||||
const int16_t* scrollingModePositions = _scrollPositions[scrollingMode];
|
||||
|
||||
std::fill_n(scrollText->bitmap, 320 * 8, 0x00);
|
||||
if (LocalisationService_UseTrueTypeFont())
|
||||
{
|
||||
scrolling_text_set_bitmap_for_ttf(scrollString, scroll, scrollText->bitmap, scrollingModePositions, colour);
|
||||
ScrollingTextSetBitmapForTTF(scrollString, scroll, scrollText->bitmap, scrollingModePositions, colour);
|
||||
}
|
||||
else
|
||||
{
|
||||
scrolling_text_set_bitmap_for_sprite(scrollString, scroll, scrollText->bitmap, scrollingModePositions, colour);
|
||||
ScrollingTextSetBitmapForSprite(scrollString, scroll, scrollText->bitmap, scrollingModePositions, colour);
|
||||
}
|
||||
|
||||
uint32_t imageId = SPR_SCROLLING_TEXT_START + scrollIndex;
|
||||
drawing_engine_invalidate_image(imageId);
|
||||
DrawingEngineInvalidateImage(imageId);
|
||||
return ImageId(imageId);
|
||||
}
|
||||
|
||||
static void scrolling_text_set_bitmap_for_sprite(
|
||||
static void ScrollingTextSetBitmapForSprite(
|
||||
std::string_view text, int32_t scroll, uint8_t* bitmap, const int16_t* scrollPositionOffsets, colour_t colour)
|
||||
{
|
||||
auto characterColour = colour;
|
||||
@@ -1497,8 +1497,8 @@ static void scrolling_text_set_bitmap_for_sprite(
|
||||
CodepointView codepoints(token.text);
|
||||
for (auto codepoint : codepoints)
|
||||
{
|
||||
auto characterWidth = font_sprite_get_codepoint_width(FontStyle::Tiny, codepoint);
|
||||
auto characterBitmap = font_sprite_get_codepoint_bitmap(codepoint);
|
||||
auto characterWidth = FontSpriteGetCodepointWidth(FontStyle::Tiny, codepoint);
|
||||
auto characterBitmap = FontSpriteGetCodepointBitmap(codepoint);
|
||||
for (; characterWidth != 0; characterWidth--, characterBitmap++)
|
||||
{
|
||||
// Skip any non-displayed columns
|
||||
@@ -1541,14 +1541,14 @@ static void scrolling_text_set_bitmap_for_sprite(
|
||||
}
|
||||
}
|
||||
|
||||
static void scrolling_text_set_bitmap_for_ttf(
|
||||
static void ScrollingTextSetBitmapForTTF(
|
||||
std::string_view text, int32_t scroll, uint8_t* bitmap, const int16_t* scrollPositionOffsets, colour_t colour)
|
||||
{
|
||||
#ifndef NO_TTF
|
||||
auto fontDesc = ttf_get_font_from_sprite_base(FontStyle::Tiny);
|
||||
auto fontDesc = TTFGetFontFromSpriteBase(FontStyle::Tiny);
|
||||
if (fontDesc->font == nullptr)
|
||||
{
|
||||
scrolling_text_set_bitmap_for_sprite(text, scroll, bitmap, scrollPositionOffsets, colour);
|
||||
ScrollingTextSetBitmapForSprite(text, scroll, bitmap, scrollPositionOffsets, colour);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1573,7 +1573,7 @@ static void scrolling_text_set_bitmap_for_ttf(
|
||||
}
|
||||
}
|
||||
|
||||
auto surface = ttf_surface_cache_get_or_add(fontDesc->font, ttfBuffer.c_str());
|
||||
auto surface = TTFSurfaceCacheGetOrAdd(fontDesc->font, ttfBuffer.c_str());
|
||||
if (surface == nullptr)
|
||||
{
|
||||
return;
|
||||
|
||||
@@ -59,14 +59,14 @@ static int32_t _ttfGetWidthCacheMissCount = 0;
|
||||
|
||||
static std::mutex _mutex;
|
||||
|
||||
static TTF_Font* ttf_open_font(const utf8* fontPath, int32_t ptSize);
|
||||
static void ttf_close_font(TTF_Font* font);
|
||||
static void ttf_surface_cache_dispose(ttf_cache_entry* entry);
|
||||
static void ttf_surface_cache_dispose_all();
|
||||
static void ttf_getwidth_cache_dispose_all();
|
||||
static bool ttf_get_size(TTF_Font* font, std::string_view text, int32_t* outWidth, int32_t* outHeight);
|
||||
static void ttf_toggle_hinting(bool);
|
||||
static TTFSurface* ttf_render(TTF_Font* font, std::string_view text);
|
||||
static TTF_Font* TTFOpenFont(const utf8* fontPath, int32_t ptSize);
|
||||
static void TTFCloseFont(TTF_Font* font);
|
||||
static void TTFSurfaceCacheDispose(ttf_cache_entry* entry);
|
||||
static void TTFSurfaceCacheDisposeAll();
|
||||
static void TTFGetWidthCacheDisposeAll();
|
||||
static bool TTFGetSize(TTF_Font* font, std::string_view text, int32_t* outWidth, int32_t* outHeight);
|
||||
static void TTFToggleHinting(bool);
|
||||
static TTFSurface* TTFRender(TTF_Font* font, std::string_view text);
|
||||
|
||||
template<typename T> class FontLockHelper
|
||||
{
|
||||
@@ -88,7 +88,7 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
static void ttf_toggle_hinting(bool)
|
||||
static void TTFToggleHinting(bool)
|
||||
{
|
||||
if (!LocalisationService_UseTrueTypeFont())
|
||||
{
|
||||
@@ -104,11 +104,11 @@ static void ttf_toggle_hinting(bool)
|
||||
|
||||
if (_ttfSurfaceCacheCount)
|
||||
{
|
||||
ttf_surface_cache_dispose_all();
|
||||
TTFSurfaceCacheDisposeAll();
|
||||
}
|
||||
}
|
||||
|
||||
bool ttf_initialise()
|
||||
bool TTFInitialise()
|
||||
{
|
||||
FontLockHelper<std::mutex> lock(_mutex);
|
||||
|
||||
@@ -132,7 +132,7 @@ bool ttf_initialise()
|
||||
return false;
|
||||
}
|
||||
|
||||
fontDesc->font = ttf_open_font(fontPath.c_str(), fontDesc->ptSize);
|
||||
fontDesc->font = TTFOpenFont(fontPath.c_str(), fontDesc->ptSize);
|
||||
if (fontDesc->font == nullptr)
|
||||
{
|
||||
log_verbose("Unable to load '%s'", fontPath.c_str());
|
||||
@@ -140,29 +140,29 @@ bool ttf_initialise()
|
||||
}
|
||||
}
|
||||
|
||||
ttf_toggle_hinting(true);
|
||||
TTFToggleHinting(true);
|
||||
|
||||
_ttfInitialised = true;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void ttf_dispose()
|
||||
void TTFDispose()
|
||||
{
|
||||
FontLockHelper<std::mutex> lock(_mutex);
|
||||
|
||||
if (!_ttfInitialised)
|
||||
return;
|
||||
|
||||
ttf_surface_cache_dispose_all();
|
||||
ttf_getwidth_cache_dispose_all();
|
||||
TTFSurfaceCacheDisposeAll();
|
||||
TTFGetWidthCacheDisposeAll();
|
||||
|
||||
for (int32_t i = 0; i < FontStyleCount; i++)
|
||||
{
|
||||
TTFFontDescriptor* fontDesc = &(gCurrentTTFFontSet->size[i]);
|
||||
if (fontDesc->font != nullptr)
|
||||
{
|
||||
ttf_close_font(fontDesc->font);
|
||||
TTFCloseFont(fontDesc->font);
|
||||
fontDesc->font = nullptr;
|
||||
}
|
||||
}
|
||||
@@ -172,17 +172,17 @@ void ttf_dispose()
|
||||
_ttfInitialised = false;
|
||||
}
|
||||
|
||||
static TTF_Font* ttf_open_font(const utf8* fontPath, int32_t ptSize)
|
||||
static TTF_Font* TTFOpenFont(const utf8* fontPath, int32_t ptSize)
|
||||
{
|
||||
return TTF_OpenFont(fontPath, ptSize);
|
||||
}
|
||||
|
||||
static void ttf_close_font(TTF_Font* font)
|
||||
static void TTFCloseFont(TTF_Font* font)
|
||||
{
|
||||
TTF_CloseFont(font);
|
||||
}
|
||||
|
||||
static uint32_t ttf_surface_cache_hash(TTF_Font* font, std::string_view text)
|
||||
static uint32_t TTFSurfaceCacheHash(TTF_Font* font, std::string_view text)
|
||||
{
|
||||
uint32_t hash = static_cast<uint32_t>(((reinterpret_cast<uintptr_t>(font) * 23) ^ 0xAAAAAAAA) & 0xFFFFFFFF);
|
||||
for (auto c : text)
|
||||
@@ -192,11 +192,11 @@ static uint32_t ttf_surface_cache_hash(TTF_Font* font, std::string_view text)
|
||||
return hash;
|
||||
}
|
||||
|
||||
static void ttf_surface_cache_dispose(ttf_cache_entry* entry)
|
||||
static void TTFSurfaceCacheDispose(ttf_cache_entry* entry)
|
||||
{
|
||||
if (entry->surface != nullptr)
|
||||
{
|
||||
ttf_free_surface(entry->surface);
|
||||
TTFFreeSurface(entry->surface);
|
||||
free(entry->text);
|
||||
|
||||
entry->surface = nullptr;
|
||||
@@ -205,26 +205,26 @@ static void ttf_surface_cache_dispose(ttf_cache_entry* entry)
|
||||
}
|
||||
}
|
||||
|
||||
static void ttf_surface_cache_dispose_all()
|
||||
static void TTFSurfaceCacheDisposeAll()
|
||||
{
|
||||
for (int32_t i = 0; i < TTF_SURFACE_CACHE_SIZE; i++)
|
||||
{
|
||||
ttf_surface_cache_dispose(&_ttfSurfaceCache[i]);
|
||||
TTFSurfaceCacheDispose(&_ttfSurfaceCache[i]);
|
||||
_ttfSurfaceCacheCount--;
|
||||
}
|
||||
}
|
||||
|
||||
void ttf_toggle_hinting()
|
||||
void TTFToggleHinting()
|
||||
{
|
||||
FontLockHelper<std::mutex> lock(_mutex);
|
||||
ttf_toggle_hinting(true);
|
||||
TTFToggleHinting(true);
|
||||
}
|
||||
|
||||
TTFSurface* ttf_surface_cache_get_or_add(TTF_Font* font, std::string_view text)
|
||||
TTFSurface* TTFSurfaceCacheGetOrAdd(TTF_Font* font, std::string_view text)
|
||||
{
|
||||
ttf_cache_entry* entry;
|
||||
|
||||
uint32_t hash = ttf_surface_cache_hash(font, text);
|
||||
uint32_t hash = TTFSurfaceCacheHash(font, text);
|
||||
int32_t index = hash % TTF_SURFACE_CACHE_SIZE;
|
||||
|
||||
FontLockHelper<std::mutex> lock(_mutex);
|
||||
@@ -256,9 +256,9 @@ TTFSurface* ttf_surface_cache_get_or_add(TTF_Font* font, std::string_view text)
|
||||
|
||||
// Cache miss, replace entry with new surface
|
||||
entry = &_ttfSurfaceCache[index];
|
||||
ttf_surface_cache_dispose(entry);
|
||||
TTFSurfaceCacheDispose(entry);
|
||||
|
||||
TTFSurface* surface = ttf_render(font, text);
|
||||
TTFSurface* surface = TTFRender(font, text);
|
||||
if (surface == nullptr)
|
||||
{
|
||||
return nullptr;
|
||||
@@ -275,7 +275,7 @@ TTFSurface* ttf_surface_cache_get_or_add(TTF_Font* font, std::string_view text)
|
||||
return entry->surface;
|
||||
}
|
||||
|
||||
static void ttf_getwidth_cache_dispose(ttf_getwidth_cache_entry* entry)
|
||||
static void TTFGetWidthCacheDispose(ttf_getwidth_cache_entry* entry)
|
||||
{
|
||||
if (entry->text != nullptr)
|
||||
{
|
||||
@@ -287,20 +287,20 @@ static void ttf_getwidth_cache_dispose(ttf_getwidth_cache_entry* entry)
|
||||
}
|
||||
}
|
||||
|
||||
static void ttf_getwidth_cache_dispose_all()
|
||||
static void TTFGetWidthCacheDisposeAll()
|
||||
{
|
||||
for (int32_t i = 0; i < TTF_GETWIDTH_CACHE_SIZE; i++)
|
||||
{
|
||||
ttf_getwidth_cache_dispose(&_ttfGetWidthCache[i]);
|
||||
TTFGetWidthCacheDispose(&_ttfGetWidthCache[i]);
|
||||
_ttfGetWidthCacheCount--;
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t ttf_getwidth_cache_get_or_add(TTF_Font* font, std::string_view text)
|
||||
uint32_t TTFGetWidthCacheGetOrAdd(TTF_Font* font, std::string_view text)
|
||||
{
|
||||
ttf_getwidth_cache_entry* entry;
|
||||
|
||||
uint32_t hash = ttf_surface_cache_hash(font, text);
|
||||
uint32_t hash = TTFSurfaceCacheHash(font, text);
|
||||
int32_t index = hash % TTF_GETWIDTH_CACHE_SIZE;
|
||||
|
||||
FontLockHelper<std::mutex> lock(_mutex);
|
||||
@@ -332,10 +332,10 @@ uint32_t ttf_getwidth_cache_get_or_add(TTF_Font* font, std::string_view text)
|
||||
|
||||
// Cache miss, replace entry with new width
|
||||
entry = &_ttfGetWidthCache[index];
|
||||
ttf_getwidth_cache_dispose(entry);
|
||||
TTFGetWidthCacheDispose(entry);
|
||||
|
||||
int32_t width, height;
|
||||
ttf_get_size(font, text, &width, &height);
|
||||
TTFGetSize(font, text, &width, &height);
|
||||
|
||||
_ttfGetWidthCacheMissCount++;
|
||||
|
||||
@@ -347,25 +347,25 @@ uint32_t ttf_getwidth_cache_get_or_add(TTF_Font* font, std::string_view text)
|
||||
return entry->width;
|
||||
}
|
||||
|
||||
TTFFontDescriptor* ttf_get_font_from_sprite_base(FontStyle fontStyle)
|
||||
TTFFontDescriptor* TTFGetFontFromSpriteBase(FontStyle fontStyle)
|
||||
{
|
||||
FontLockHelper<std::mutex> lock(_mutex);
|
||||
return &gCurrentTTFFontSet->size[EnumValue(fontStyle)];
|
||||
}
|
||||
|
||||
bool ttf_provides_glyph(const TTF_Font* font, codepoint_t codepoint)
|
||||
bool TTFProvidesGlyph(const TTF_Font* font, codepoint_t codepoint)
|
||||
{
|
||||
return TTF_GlyphIsProvided(font, codepoint);
|
||||
}
|
||||
|
||||
static bool ttf_get_size(TTF_Font* font, std::string_view text, int32_t* outWidth, int32_t* outHeight)
|
||||
static bool TTFGetSize(TTF_Font* font, std::string_view text, int32_t* outWidth, int32_t* outHeight)
|
||||
{
|
||||
thread_local std::string buffer;
|
||||
buffer.assign(text);
|
||||
return TTF_SizeUTF8(font, buffer.c_str(), outWidth, outHeight);
|
||||
}
|
||||
|
||||
static TTFSurface* ttf_render(TTF_Font* font, std::string_view text)
|
||||
static TTFSurface* TTFRender(TTF_Font* font, std::string_view text)
|
||||
{
|
||||
thread_local std::string buffer;
|
||||
buffer.assign(text);
|
||||
@@ -377,7 +377,7 @@ static TTFSurface* ttf_render(TTF_Font* font, std::string_view text)
|
||||
return TTF_RenderUTF8_Solid(font, buffer.c_str(), 0x000000FF);
|
||||
}
|
||||
|
||||
void ttf_free_surface(TTFSurface* surface)
|
||||
void TTFFreeSurface(TTFSurface* surface)
|
||||
{
|
||||
free(const_cast<void*>(surface->pixels));
|
||||
free(surface);
|
||||
@@ -387,12 +387,12 @@ void ttf_free_surface(TTFSurface* surface)
|
||||
|
||||
# include "TTF.h"
|
||||
|
||||
bool ttf_initialise()
|
||||
bool TTFInitialise()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void ttf_dispose()
|
||||
void TTFDispose()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -13,8 +13,8 @@
|
||||
|
||||
#include <string_view>
|
||||
|
||||
bool ttf_initialise();
|
||||
void ttf_dispose();
|
||||
bool TTFInitialise();
|
||||
void TTFDispose();
|
||||
|
||||
#ifndef NO_TTF
|
||||
|
||||
@@ -26,12 +26,12 @@ struct TTFSurface
|
||||
int32_t pitch;
|
||||
};
|
||||
|
||||
TTFFontDescriptor* ttf_get_font_from_sprite_base(FontStyle fontStyle);
|
||||
void ttf_toggle_hinting();
|
||||
TTFSurface* ttf_surface_cache_get_or_add(TTF_Font* font, std::string_view text);
|
||||
uint32_t ttf_getwidth_cache_get_or_add(TTF_Font* font, std::string_view text);
|
||||
bool ttf_provides_glyph(const TTF_Font* font, codepoint_t codepoint);
|
||||
void ttf_free_surface(TTFSurface* surface);
|
||||
TTFFontDescriptor* TTFGetFontFromSpriteBase(FontStyle fontStyle);
|
||||
void TTFToggleHinting();
|
||||
TTFSurface* TTFSurfaceCacheGetOrAdd(TTF_Font* font, std::string_view text);
|
||||
uint32_t TTFGetWidthCacheGetOrAdd(TTF_Font* font, std::string_view text);
|
||||
bool TTFProvidesGlyph(const TTF_Font* font, codepoint_t codepoint);
|
||||
void TTFFreeSurface(TTFSurface* surface);
|
||||
|
||||
// TTF_SDLPORT
|
||||
int TTF_Init(void);
|
||||
|
||||
@@ -1325,7 +1325,7 @@ TTFSurface* TTF_RenderUTF8_Solid(TTF_Font* font, const char* text, [[maybe_unuse
|
||||
if (error)
|
||||
{
|
||||
TTF_SetFTError("Couldn't find glyph", error);
|
||||
ttf_free_surface(textbuf);
|
||||
TTFFreeSurface(textbuf);
|
||||
return NULL;
|
||||
}
|
||||
glyph = font->current;
|
||||
@@ -1458,7 +1458,7 @@ TTFSurface* TTF_RenderUTF8_Shaded(TTF_Font* font, const char* text, [[maybe_unus
|
||||
if (error)
|
||||
{
|
||||
TTF_SetFTError("Couldn't find glyph", error);
|
||||
ttf_free_surface(textbuf);
|
||||
TTFFreeSurface(textbuf);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ public:
|
||||
|
||||
MaxWidth = GfxWrapString(Buffer, width, paint.FontStyle, &LineCount);
|
||||
LineCount += 1;
|
||||
LineHeight = font_get_line_height(paint.FontStyle);
|
||||
LineHeight = FontGetLineHeight(paint.FontStyle);
|
||||
}
|
||||
|
||||
void Draw(rct_drawpixelinfo* dpi, const ScreenCoordsXY& coords)
|
||||
@@ -100,7 +100,7 @@ static void DrawText(
|
||||
break;
|
||||
}
|
||||
|
||||
TtfDrawString(dpi, text, paint.Colour, alignedCoords, noFormatting, paint.FontStyle, paint.Darkness);
|
||||
TTFDrawString(dpi, text, paint.Colour, alignedCoords, noFormatting, paint.FontStyle, paint.Darkness);
|
||||
|
||||
if (paint.UnderlineText == TextUnderline::On)
|
||||
{
|
||||
|
||||
@@ -122,7 +122,7 @@ X8DrawingEngine::X8DrawingEngine([[maybe_unused]] const std::shared_ptr<Ui::IUiC
|
||||
{
|
||||
_drawingContext = new X8DrawingContext(this);
|
||||
_bitsDPI.DrawingEngine = this;
|
||||
lightfx_set_available(true);
|
||||
LightFXSetAvailable(true);
|
||||
_lastLightFXenabled = (gConfigGeneral.EnableLightFx != 0);
|
||||
}
|
||||
|
||||
@@ -338,9 +338,9 @@ void X8DrawingEngine::ConfigureBits(uint32_t width, uint32_t height, uint32_t pi
|
||||
|
||||
ConfigureDirtyGrid();
|
||||
|
||||
if (lightfx_is_available())
|
||||
if (LightFXIsAvailable())
|
||||
{
|
||||
lightfx_update_buffers(dpi);
|
||||
LightFXUpdateBuffers(dpi);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2775,7 +2775,7 @@ void Peep::Paint(PaintSession& session, int32_t imageDirection) const
|
||||
{
|
||||
PROFILED_FUNCTION();
|
||||
|
||||
if (lightfx_is_available())
|
||||
if (LightFXIsAvailable())
|
||||
{
|
||||
if (Is<Staff>())
|
||||
{
|
||||
@@ -2798,7 +2798,7 @@ void Peep::Paint(PaintSession& session, int32_t imageDirection) const
|
||||
return;
|
||||
}
|
||||
|
||||
LightfxAdd3DLight(*this, 0, loc, LightType::Spot1);
|
||||
LightFXAdd3DLight(*this, 0, loc, LightType::Spot1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -280,7 +280,7 @@ static int32_t ChatHistoryDrawString(
|
||||
|
||||
int32_t numLines;
|
||||
GfxWrapString(bufferPtr, width, FontStyle::Medium, &numLines);
|
||||
auto lineHeight = font_get_line_height(FontStyle::Medium);
|
||||
auto lineHeight = FontGetLineHeight(FontStyle::Medium);
|
||||
|
||||
int32_t expectedY = screenCoords.y - (numLines * lineHeight);
|
||||
if (expectedY < 50)
|
||||
@@ -308,7 +308,7 @@ int32_t ChatStringWrappedGetHeight(void* args, int32_t width)
|
||||
|
||||
int32_t numLines;
|
||||
GfxWrapString(bufferPtr, width, FontStyle::Medium, &numLines);
|
||||
int32_t lineHeight = font_get_line_height(FontStyle::Medium);
|
||||
int32_t lineHeight = FontGetLineHeight(FontStyle::Medium);
|
||||
|
||||
int32_t lineY = 0;
|
||||
for (int32_t line = 0; line <= numLines; ++line)
|
||||
|
||||
@@ -107,7 +107,7 @@ TTFFontSetDescriptor TTFFontMicroHei = { {
|
||||
|
||||
static void LoadSpriteFont(LocalisationService& localisationService)
|
||||
{
|
||||
ttf_dispose();
|
||||
TTFDispose();
|
||||
localisationService.UseTrueTypeFont(false);
|
||||
#ifndef NO_TTF
|
||||
gCurrentTTFFontSet = nullptr;
|
||||
@@ -120,8 +120,8 @@ static bool LoadFont(LocalisationService& localisationService, TTFFontSetDescrip
|
||||
localisationService.UseTrueTypeFont(true);
|
||||
gCurrentTTFFontSet = font;
|
||||
|
||||
ttf_dispose();
|
||||
bool fontInitialised = ttf_initialise();
|
||||
TTFDispose();
|
||||
bool fontInitialised = TTFInitialise();
|
||||
return fontInitialised;
|
||||
}
|
||||
|
||||
@@ -136,11 +136,11 @@ static bool LoadCustomConfigFont(LocalisationService& localisationService)
|
||||
gConfigFonts.OffsetY, gConfigFonts.HeightMedium, gConfigFonts.HintingThreshold, nullptr },
|
||||
} };
|
||||
|
||||
ttf_dispose();
|
||||
TTFDispose();
|
||||
localisationService.UseTrueTypeFont(true);
|
||||
gCurrentTTFFontSet = &TTFFontCustom;
|
||||
|
||||
bool fontInitialised = ttf_initialise();
|
||||
bool fontInitialised = TTFInitialise();
|
||||
return fontInitialised;
|
||||
}
|
||||
#endif // NO_TTF
|
||||
|
||||
@@ -1172,7 +1172,7 @@ static int32_t ConsoleCommandSet(InteractiveConsole& console, const arguments_t&
|
||||
gConfigFonts.EnableHinting = (int_val[0] != 0);
|
||||
ConfigSaveDefault();
|
||||
console.Execute("get enable_hinting");
|
||||
ttf_toggle_hinting();
|
||||
TTFToggleHinting();
|
||||
}
|
||||
#endif
|
||||
else if (invalidArgs)
|
||||
|
||||
@@ -504,11 +504,11 @@ int32_t CmdlineForGfxbench(const char** argv, int32_t argc)
|
||||
std::unique_ptr<IContext> context(CreateContext());
|
||||
if (context->Initialise())
|
||||
{
|
||||
drawing_engine_init();
|
||||
DrawingEngineInit();
|
||||
|
||||
BenchgfxRenderScreenshots(inputPath, context, iterationCount);
|
||||
|
||||
drawing_engine_dispose();
|
||||
DrawingEngineDispose();
|
||||
}
|
||||
|
||||
return 1;
|
||||
@@ -602,7 +602,7 @@ int32_t CmdlineForScreenshot(const char** argv, int32_t argc, ScreenshotOptions*
|
||||
throw std::runtime_error("Failed to initialize context.");
|
||||
}
|
||||
|
||||
drawing_engine_init();
|
||||
DrawingEngineInit();
|
||||
|
||||
if (!context->LoadParkFromFile(inputPath))
|
||||
{
|
||||
@@ -699,7 +699,7 @@ int32_t CmdlineForScreenshot(const char** argv, int32_t argc, ScreenshotOptions*
|
||||
}
|
||||
ReleaseDPI(dpi);
|
||||
|
||||
drawing_engine_dispose();
|
||||
DrawingEngineDispose();
|
||||
|
||||
return exitCode;
|
||||
}
|
||||
|
||||
@@ -364,7 +364,7 @@ static void ViewportRedrawAfterShift(
|
||||
if (abs(coords.x) < viewport->width && abs(coords.y) < viewport->height)
|
||||
{
|
||||
// update whole block ?
|
||||
drawing_engine_copy_rect(viewport->pos.x, viewport->pos.y, viewport->width, viewport->height, coords.x, coords.y);
|
||||
DrawingEngineCopyRect(viewport->pos.x, viewport->pos.y, viewport->width, viewport->height, coords.x, coords.y);
|
||||
|
||||
if (coords.x > 0)
|
||||
{
|
||||
@@ -478,9 +478,9 @@ static void ViewportMove(const ScreenCoordsXY& coords, rct_window* w, rct_viewpo
|
||||
if (top >= bottom)
|
||||
return;
|
||||
|
||||
if (drawing_engine_has_dirty_optimisations())
|
||||
if (DrawingEngineHasDirtyOptimisations())
|
||||
{
|
||||
rct_drawpixelinfo* dpi = drawing_engine_get_dpi();
|
||||
rct_drawpixelinfo* dpi = DrawingEngineGetDpi();
|
||||
WindowDrawAll(dpi, left, top, right, bottom);
|
||||
return;
|
||||
}
|
||||
@@ -530,9 +530,9 @@ static void ViewportMove(const ScreenCoordsXY& coords, rct_window* w, rct_viewpo
|
||||
return;
|
||||
}
|
||||
|
||||
if (drawing_engine_has_dirty_optimisations())
|
||||
if (DrawingEngineHasDirtyOptimisations())
|
||||
{
|
||||
rct_drawpixelinfo* dpi = drawing_engine_get_dpi();
|
||||
rct_drawpixelinfo* dpi = DrawingEngineGetDpi();
|
||||
ViewportShiftPixels(dpi, w, viewport, x_diff, y_diff);
|
||||
}
|
||||
|
||||
|
||||
@@ -211,6 +211,8 @@
|
||||
<ClInclude Include="drawing\Font.h" />
|
||||
<ClInclude Include="drawing\IDrawingContext.h" />
|
||||
<ClInclude Include="drawing\IDrawingEngine.h" />
|
||||
<ClInclude Include="drawing\Image.h" />
|
||||
<ClInclude Include="drawing\ImageId.hpp" />
|
||||
<ClInclude Include="drawing\ImageImporter.h" />
|
||||
<ClInclude Include="drawing\LightFX.h" />
|
||||
<ClInclude Include="drawing\NewDrawing.h" />
|
||||
@@ -1011,4 +1013,4 @@
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
</Project>
|
||||
</Project>
|
||||
@@ -402,7 +402,7 @@ namespace OpenRCT2
|
||||
// Currency symbol
|
||||
auto symbol = currencyDesc->symbol_unicode;
|
||||
auto affix = currencyDesc->affix_unicode;
|
||||
if (!font_supports_string(symbol, FontStyle::Medium))
|
||||
if (!FontSupportsString(symbol, FontStyle::Medium))
|
||||
{
|
||||
symbol = currencyDesc->symbol_ascii;
|
||||
affix = currencyDesc->affix_ascii;
|
||||
|
||||
@@ -62,13 +62,13 @@ void BannerObject::Load()
|
||||
{
|
||||
GetStringTable().Sort();
|
||||
_legacyType.name = language_allocate_object_string(GetName());
|
||||
_legacyType.image = gfx_object_allocate_images(GetImageTable().GetImages(), GetImageTable().GetCount());
|
||||
_legacyType.image = GfxObjectAllocateImages(GetImageTable().GetImages(), GetImageTable().GetCount());
|
||||
}
|
||||
|
||||
void BannerObject::Unload()
|
||||
{
|
||||
language_free_object_string(_legacyType.name);
|
||||
gfx_object_free_images(_legacyType.image, GetImageTable().GetCount());
|
||||
GfxObjectFreeImages(_legacyType.image, GetImageTable().GetCount());
|
||||
|
||||
_legacyType.name = 0;
|
||||
_legacyType.image = 0;
|
||||
|
||||
@@ -30,13 +30,13 @@ void EntranceObject::Load()
|
||||
{
|
||||
GetStringTable().Sort();
|
||||
_legacyType.string_idx = language_allocate_object_string(GetName());
|
||||
_legacyType.image_id = gfx_object_allocate_images(GetImageTable().GetImages(), GetImageTable().GetCount());
|
||||
_legacyType.image_id = GfxObjectAllocateImages(GetImageTable().GetImages(), GetImageTable().GetCount());
|
||||
}
|
||||
|
||||
void EntranceObject::Unload()
|
||||
{
|
||||
language_free_object_string(_legacyType.string_idx);
|
||||
gfx_object_free_images(_legacyType.image_id, GetImageTable().GetCount());
|
||||
GfxObjectFreeImages(_legacyType.image_id, GetImageTable().GetCount());
|
||||
|
||||
_legacyType.string_idx = 0;
|
||||
_legacyType.image_id = 0;
|
||||
|
||||
@@ -66,7 +66,7 @@ void FootpathItemObject::Load()
|
||||
{
|
||||
GetStringTable().Sort();
|
||||
_legacyType.name = language_allocate_object_string(GetName());
|
||||
_legacyType.image = gfx_object_allocate_images(GetImageTable().GetImages(), GetImageTable().GetCount());
|
||||
_legacyType.image = GfxObjectAllocateImages(GetImageTable().GetImages(), GetImageTable().GetCount());
|
||||
|
||||
_legacyType.scenery_tab_id = OBJECT_ENTRY_INDEX_NULL;
|
||||
}
|
||||
@@ -74,7 +74,7 @@ void FootpathItemObject::Load()
|
||||
void FootpathItemObject::Unload()
|
||||
{
|
||||
language_free_object_string(_legacyType.name);
|
||||
gfx_object_free_images(_legacyType.image, GetImageTable().GetCount());
|
||||
GfxObjectFreeImages(_legacyType.image, GetImageTable().GetCount());
|
||||
|
||||
_legacyType.name = 0;
|
||||
_legacyType.image = 0;
|
||||
|
||||
@@ -38,7 +38,7 @@ void FootpathObject::Load()
|
||||
{
|
||||
GetStringTable().Sort();
|
||||
_legacyType.string_idx = language_allocate_object_string(GetName());
|
||||
_legacyType.image = gfx_object_allocate_images(GetImageTable().GetImages(), GetImageTable().GetCount());
|
||||
_legacyType.image = GfxObjectAllocateImages(GetImageTable().GetImages(), GetImageTable().GetCount());
|
||||
_legacyType.bridge_image = _legacyType.image + 109;
|
||||
|
||||
_pathSurfaceDescriptor.Name = _legacyType.string_idx;
|
||||
@@ -63,7 +63,7 @@ void FootpathObject::Load()
|
||||
void FootpathObject::Unload()
|
||||
{
|
||||
language_free_object_string(_legacyType.string_idx);
|
||||
gfx_object_free_images(_legacyType.image, GetImageTable().GetCount());
|
||||
GfxObjectFreeImages(_legacyType.image, GetImageTable().GetCount());
|
||||
|
||||
_legacyType.string_idx = 0;
|
||||
_legacyType.image = 0;
|
||||
|
||||
@@ -21,7 +21,7 @@ void FootpathRailingsObject::Load()
|
||||
auto numImages = GetImageTable().GetCount();
|
||||
if (numImages != 0)
|
||||
{
|
||||
PreviewImageId = gfx_object_allocate_images(GetImageTable().GetImages(), GetImageTable().GetCount());
|
||||
PreviewImageId = GfxObjectAllocateImages(GetImageTable().GetImages(), GetImageTable().GetCount());
|
||||
BridgeImageId = PreviewImageId + 37;
|
||||
RailingsImageId = PreviewImageId + 1;
|
||||
}
|
||||
@@ -39,7 +39,7 @@ void FootpathRailingsObject::Load()
|
||||
void FootpathRailingsObject::Unload()
|
||||
{
|
||||
language_free_object_string(NameStringId);
|
||||
gfx_object_free_images(PreviewImageId, GetImageTable().GetCount());
|
||||
GfxObjectFreeImages(PreviewImageId, GetImageTable().GetCount());
|
||||
|
||||
NameStringId = 0;
|
||||
PreviewImageId = 0;
|
||||
|
||||
@@ -22,7 +22,7 @@ void FootpathSurfaceObject::Load()
|
||||
auto numImages = GetImageTable().GetCount();
|
||||
if (numImages != 0)
|
||||
{
|
||||
PreviewImageId = gfx_object_allocate_images(GetImageTable().GetImages(), GetImageTable().GetCount());
|
||||
PreviewImageId = GfxObjectAllocateImages(GetImageTable().GetImages(), GetImageTable().GetCount());
|
||||
BaseImageId = PreviewImageId + 1;
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ void FootpathSurfaceObject::Load()
|
||||
void FootpathSurfaceObject::Unload()
|
||||
{
|
||||
language_free_object_string(NameStringId);
|
||||
gfx_object_free_images(PreviewImageId, GetImageTable().GetCount());
|
||||
GfxObjectFreeImages(PreviewImageId, GetImageTable().GetCount());
|
||||
|
||||
NameStringId = 0;
|
||||
PreviewImageId = 0;
|
||||
|
||||
@@ -109,7 +109,7 @@ void LargeSceneryObject::Load()
|
||||
{
|
||||
GetStringTable().Sort();
|
||||
_legacyType.name = language_allocate_object_string(GetName());
|
||||
_baseImageId = gfx_object_allocate_images(GetImageTable().GetImages(), GetImageTable().GetCount());
|
||||
_baseImageId = GfxObjectAllocateImages(GetImageTable().GetImages(), GetImageTable().GetCount());
|
||||
_legacyType.image = _baseImageId;
|
||||
|
||||
_legacyType.tiles = _tiles.data();
|
||||
@@ -132,7 +132,7 @@ void LargeSceneryObject::Load()
|
||||
void LargeSceneryObject::Unload()
|
||||
{
|
||||
language_free_object_string(_legacyType.name);
|
||||
gfx_object_free_images(_baseImageId, GetImageTable().GetCount());
|
||||
GfxObjectFreeImages(_baseImageId, GetImageTable().GetCount());
|
||||
|
||||
_legacyType.name = 0;
|
||||
_baseImageId = _legacyType.image = 0;
|
||||
|
||||
@@ -74,7 +74,7 @@ void MusicObject::Load()
|
||||
}
|
||||
|
||||
_hasPreview = !!GetImageTable().GetCount();
|
||||
_previewImageId = gfx_object_allocate_images(GetImageTable().GetImages(), GetImageTable().GetCount());
|
||||
_previewImageId = GfxObjectAllocateImages(GetImageTable().GetImages(), GetImageTable().GetCount());
|
||||
}
|
||||
|
||||
void MusicObject::Unload()
|
||||
|
||||
@@ -206,7 +206,7 @@ void RideObject::Load()
|
||||
_legacyType.naming.Name = language_allocate_object_string(GetName());
|
||||
_legacyType.naming.Description = language_allocate_object_string(GetDescription());
|
||||
_legacyType.capacity = language_allocate_object_string(GetCapacity());
|
||||
_legacyType.images_offset = gfx_object_allocate_images(GetImageTable().GetImages(), GetImageTable().GetCount());
|
||||
_legacyType.images_offset = GfxObjectAllocateImages(GetImageTable().GetImages(), GetImageTable().GetCount());
|
||||
_legacyType.vehicle_preset_list = &_presetColours;
|
||||
|
||||
int32_t currentCarImagesOffset = _legacyType.images_offset + RCT2::ObjectLimits::MaxRideTypesPerRideEntry;
|
||||
@@ -275,7 +275,7 @@ void RideObject::Unload()
|
||||
language_free_object_string(_legacyType.naming.Name);
|
||||
language_free_object_string(_legacyType.naming.Description);
|
||||
language_free_object_string(_legacyType.capacity);
|
||||
gfx_object_free_images(_legacyType.images_offset, GetImageTable().GetCount());
|
||||
GfxObjectFreeImages(_legacyType.images_offset, GetImageTable().GetCount());
|
||||
|
||||
_legacyType.naming.Name = 0;
|
||||
_legacyType.naming.Description = 0;
|
||||
|
||||
@@ -57,14 +57,14 @@ void SceneryGroupObject::Load()
|
||||
{
|
||||
GetStringTable().Sort();
|
||||
_legacyType.name = language_allocate_object_string(GetName());
|
||||
_legacyType.image = gfx_object_allocate_images(GetImageTable().GetImages(), GetImageTable().GetCount());
|
||||
_legacyType.image = GfxObjectAllocateImages(GetImageTable().GetImages(), GetImageTable().GetCount());
|
||||
_legacyType.SceneryEntries.clear();
|
||||
}
|
||||
|
||||
void SceneryGroupObject::Unload()
|
||||
{
|
||||
language_free_object_string(_legacyType.name);
|
||||
gfx_object_free_images(_legacyType.image, GetImageTable().GetCount());
|
||||
GfxObjectFreeImages(_legacyType.image, GetImageTable().GetCount());
|
||||
|
||||
_legacyType.name = 0;
|
||||
_legacyType.image = 0;
|
||||
|
||||
@@ -75,7 +75,7 @@ void SmallSceneryObject::Load()
|
||||
{
|
||||
GetStringTable().Sort();
|
||||
_legacyType.name = language_allocate_object_string(GetName());
|
||||
_legacyType.image = gfx_object_allocate_images(GetImageTable().GetImages(), GetImageTable().GetCount());
|
||||
_legacyType.image = GfxObjectAllocateImages(GetImageTable().GetImages(), GetImageTable().GetCount());
|
||||
|
||||
_legacyType.scenery_tab_id = OBJECT_ENTRY_INDEX_NULL;
|
||||
|
||||
@@ -90,7 +90,7 @@ void SmallSceneryObject::Load()
|
||||
void SmallSceneryObject::Unload()
|
||||
{
|
||||
language_free_object_string(_legacyType.name);
|
||||
gfx_object_free_images(_legacyType.image, GetImageTable().GetCount());
|
||||
GfxObjectFreeImages(_legacyType.image, GetImageTable().GetCount());
|
||||
|
||||
_legacyType.name = 0;
|
||||
_legacyType.image = 0;
|
||||
|
||||
@@ -25,7 +25,7 @@ void StationObject::Load()
|
||||
auto numImages = GetImageTable().GetCount();
|
||||
if (numImages != 0)
|
||||
{
|
||||
BaseImageId = gfx_object_allocate_images(GetImageTable().GetImages(), GetImageTable().GetCount());
|
||||
BaseImageId = GfxObjectAllocateImages(GetImageTable().GetImages(), GetImageTable().GetCount());
|
||||
|
||||
uint32_t shelterOffset = (Flags & STATION_OBJECT_FLAGS::IS_TRANSPARENT) ? 32 : 16;
|
||||
if (numImages > shelterOffset)
|
||||
@@ -38,7 +38,7 @@ void StationObject::Load()
|
||||
void StationObject::Unload()
|
||||
{
|
||||
language_free_object_string(NameStringId);
|
||||
gfx_object_free_images(BaseImageId, GetImageTable().GetCount());
|
||||
GfxObjectFreeImages(BaseImageId, GetImageTable().GetCount());
|
||||
|
||||
NameStringId = 0;
|
||||
BaseImageId = ImageIndexUndefined;
|
||||
|
||||
@@ -22,7 +22,7 @@ void TerrainEdgeObject::Load()
|
||||
{
|
||||
GetStringTable().Sort();
|
||||
NameStringId = language_allocate_object_string(GetName());
|
||||
IconImageId = gfx_object_allocate_images(GetImageTable().GetImages(), GetImageTable().GetCount());
|
||||
IconImageId = GfxObjectAllocateImages(GetImageTable().GetImages(), GetImageTable().GetCount());
|
||||
|
||||
// First image is icon followed by edge images
|
||||
BaseImageId = IconImageId + 1;
|
||||
@@ -31,7 +31,7 @@ void TerrainEdgeObject::Load()
|
||||
void TerrainEdgeObject::Unload()
|
||||
{
|
||||
language_free_object_string(NameStringId);
|
||||
gfx_object_free_images(IconImageId, GetImageTable().GetCount());
|
||||
GfxObjectFreeImages(IconImageId, GetImageTable().GetCount());
|
||||
|
||||
NameStringId = 0;
|
||||
IconImageId = 0;
|
||||
|
||||
@@ -25,7 +25,7 @@ void TerrainSurfaceObject::Load()
|
||||
{
|
||||
GetStringTable().Sort();
|
||||
NameStringId = language_allocate_object_string(GetName());
|
||||
IconImageId = gfx_object_allocate_images(GetImageTable().GetImages(), GetImageTable().GetCount());
|
||||
IconImageId = GfxObjectAllocateImages(GetImageTable().GetImages(), GetImageTable().GetCount());
|
||||
if ((Flags & SMOOTH_WITH_SELF) || (Flags & SMOOTH_WITH_OTHER))
|
||||
{
|
||||
PatternBaseImageId = IconImageId + 1;
|
||||
@@ -41,7 +41,7 @@ void TerrainSurfaceObject::Load()
|
||||
void TerrainSurfaceObject::Unload()
|
||||
{
|
||||
language_free_object_string(NameStringId);
|
||||
gfx_object_free_images(IconImageId, GetImageTable().GetCount());
|
||||
GfxObjectFreeImages(IconImageId, GetImageTable().GetCount());
|
||||
|
||||
NameStringId = 0;
|
||||
IconImageId = 0;
|
||||
|
||||
@@ -56,13 +56,13 @@ void WallObject::Load()
|
||||
{
|
||||
GetStringTable().Sort();
|
||||
_legacyType.name = language_allocate_object_string(GetName());
|
||||
_legacyType.image = gfx_object_allocate_images(GetImageTable().GetImages(), GetImageTable().GetCount());
|
||||
_legacyType.image = GfxObjectAllocateImages(GetImageTable().GetImages(), GetImageTable().GetCount());
|
||||
}
|
||||
|
||||
void WallObject::Unload()
|
||||
{
|
||||
language_free_object_string(_legacyType.name);
|
||||
gfx_object_free_images(_legacyType.image, GetImageTable().GetCount());
|
||||
GfxObjectFreeImages(_legacyType.image, GetImageTable().GetCount());
|
||||
|
||||
_legacyType.name = 0;
|
||||
_legacyType.image = 0;
|
||||
|
||||
@@ -38,7 +38,7 @@ void WaterObject::Load()
|
||||
{
|
||||
GetStringTable().Sort();
|
||||
_legacyType.string_idx = language_allocate_object_string(GetName());
|
||||
_legacyType.image_id = gfx_object_allocate_images(GetImageTable().GetImages(), GetImageTable().GetCount());
|
||||
_legacyType.image_id = GfxObjectAllocateImages(GetImageTable().GetImages(), GetImageTable().GetCount());
|
||||
_legacyType.palette_index_1 = _legacyType.image_id + 1;
|
||||
_legacyType.palette_index_2 = _legacyType.image_id + 4;
|
||||
|
||||
@@ -47,7 +47,7 @@ void WaterObject::Load()
|
||||
|
||||
void WaterObject::Unload()
|
||||
{
|
||||
gfx_object_free_images(_legacyType.image_id, GetImageTable().GetCount());
|
||||
GfxObjectFreeImages(_legacyType.image_id, GetImageTable().GetCount());
|
||||
language_free_object_string(_legacyType.string_idx);
|
||||
|
||||
_legacyType.string_idx = 0;
|
||||
|
||||
@@ -117,9 +117,9 @@ void EntityPaintSetup(PaintSession& session, const CoordsXY& pos)
|
||||
{
|
||||
case EntityType::Vehicle:
|
||||
spr->As<Vehicle>()->Paint(session, image_direction);
|
||||
if (lightfx_for_vehicles_is_available())
|
||||
if (LightFXForVehiclesIsAvailable())
|
||||
{
|
||||
LightfxAddLightsMagicVehicle(spr->As<Vehicle>());
|
||||
LightFXAddLightsMagicVehicle(spr->As<Vehicle>());
|
||||
}
|
||||
break;
|
||||
case EntityType::Guest:
|
||||
|
||||
@@ -912,7 +912,7 @@ void PaintDrawMoneyStructs(rct_drawpixelinfo* dpi, PaintStringStruct* ps)
|
||||
// Use sprite font unless the currency contains characters unsupported by the sprite font
|
||||
auto forceSpriteFont = false;
|
||||
const auto& currencyDesc = CurrencyDescriptors[EnumValue(gConfigGeneral.CurrencyFormat)];
|
||||
if (LocalisationService_UseTrueTypeFont() && font_supports_string_sprite(currencyDesc.symbol_unicode))
|
||||
if (LocalisationService_UseTrueTypeFont() && FontSupportsStringSprite(currencyDesc.symbol_unicode))
|
||||
{
|
||||
forceSpriteFont = true;
|
||||
}
|
||||
|
||||
@@ -81,26 +81,26 @@ static void PaintRideEntranceExitLightEffects(PaintSession& session, int32_t hei
|
||||
{
|
||||
PROFILED_FUNCTION();
|
||||
|
||||
if (lightfx_is_available())
|
||||
if (LightFXIsAvailable())
|
||||
{
|
||||
if (entranceEl.GetEntranceType() == ENTRANCE_TYPE_RIDE_ENTRANCE)
|
||||
{
|
||||
lightfx_add_3d_light_magic_from_drawing_tile(session.MapPosition, 0, 0, height + 45, LightType::Lantern3);
|
||||
LightFXAdd3DLightMagicFromDrawingTile(session.MapPosition, 0, 0, height + 45, LightType::Lantern3);
|
||||
}
|
||||
|
||||
switch (entranceEl.GetDirection())
|
||||
{
|
||||
case 0:
|
||||
lightfx_add_3d_light_magic_from_drawing_tile(session.MapPosition, 16, 0, height + 16, LightType::Lantern2);
|
||||
LightFXAdd3DLightMagicFromDrawingTile(session.MapPosition, 16, 0, height + 16, LightType::Lantern2);
|
||||
break;
|
||||
case 1:
|
||||
lightfx_add_3d_light_magic_from_drawing_tile(session.MapPosition, 0, -16, height + 16, LightType::Lantern2);
|
||||
LightFXAdd3DLightMagicFromDrawingTile(session.MapPosition, 0, -16, height + 16, LightType::Lantern2);
|
||||
break;
|
||||
case 2:
|
||||
lightfx_add_3d_light_magic_from_drawing_tile(session.MapPosition, -16, 0, height + 16, LightType::Lantern2);
|
||||
LightFXAdd3DLightMagicFromDrawingTile(session.MapPosition, -16, 0, height + 16, LightType::Lantern2);
|
||||
break;
|
||||
case 3:
|
||||
lightfx_add_3d_light_magic_from_drawing_tile(session.MapPosition, 0, 16, height + 16, LightType::Lantern2);
|
||||
LightFXAdd3DLightMagicFromDrawingTile(session.MapPosition, 0, 16, height + 16, LightType::Lantern2);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -253,9 +253,9 @@ static void PaintParkEntranceLightEffects(PaintSession& session)
|
||||
{
|
||||
PROFILED_FUNCTION();
|
||||
|
||||
if (lightfx_is_available())
|
||||
if (LightFXIsAvailable())
|
||||
{
|
||||
lightfx_add_3d_light_magic_from_drawing_tile(session.MapPosition, 0, 0, 155, LightType::Lantern3);
|
||||
LightFXAdd3DLightMagicFromDrawingTile(session.MapPosition, 0, 0, 155, LightType::Lantern3);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -934,7 +934,7 @@ static void PaintLampLightEffects(PaintSession& session, const PathElement& path
|
||||
{
|
||||
PROFILED_FUNCTION();
|
||||
|
||||
if (lightfx_is_available())
|
||||
if (LightFXIsAvailable())
|
||||
{
|
||||
if (pathEl.HasAddition() && !(pathEl.IsBroken()))
|
||||
{
|
||||
@@ -943,19 +943,19 @@ static void PaintLampLightEffects(PaintSession& session, const PathElement& path
|
||||
{
|
||||
if (!(pathEl.GetEdges() & EDGE_NE))
|
||||
{
|
||||
lightfx_add_3d_light_magic_from_drawing_tile(session.MapPosition, -16, 0, height + 23, LightType::Lantern3);
|
||||
LightFXAdd3DLightMagicFromDrawingTile(session.MapPosition, -16, 0, height + 23, LightType::Lantern3);
|
||||
}
|
||||
if (!(pathEl.GetEdges() & EDGE_SE))
|
||||
{
|
||||
lightfx_add_3d_light_magic_from_drawing_tile(session.MapPosition, 0, 16, height + 23, LightType::Lantern3);
|
||||
LightFXAdd3DLightMagicFromDrawingTile(session.MapPosition, 0, 16, height + 23, LightType::Lantern3);
|
||||
}
|
||||
if (!(pathEl.GetEdges() & EDGE_SW))
|
||||
{
|
||||
lightfx_add_3d_light_magic_from_drawing_tile(session.MapPosition, 16, 0, height + 23, LightType::Lantern3);
|
||||
LightFXAdd3DLightMagicFromDrawingTile(session.MapPosition, 16, 0, height + 23, LightType::Lantern3);
|
||||
}
|
||||
if (!(pathEl.GetEdges() & EDGE_NW))
|
||||
{
|
||||
lightfx_add_3d_light_magic_from_drawing_tile(session.MapPosition, 0, -16, height + 23, LightType::Lantern3);
|
||||
LightFXAdd3DLightMagicFromDrawingTile(session.MapPosition, 0, -16, height + 23, LightType::Lantern3);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2204,7 +2204,7 @@ void PaintTrack(PaintSession& session, Direction direction, int32_t height, cons
|
||||
}
|
||||
}
|
||||
|
||||
if (lightfx_is_available())
|
||||
if (LightFXIsAvailable())
|
||||
{
|
||||
uint8_t zOffset = 16;
|
||||
const auto& rtd = ride->GetRideTypeDescriptor();
|
||||
|
||||
Reference in new issue
Block a user