From 30473bc6e4c7a5d6d29709eb61d012ca11c1217e Mon Sep 17 00:00:00 2001 From: Harrison <53527582+HTV04@users.noreply.github.com> Date: Tue, 16 Aug 2022 09:33:05 -0400 Subject: [PATCH] Smol fixes --- data/boot.lua | 4 +++- src/wiilove/lib/FreeTypeGX.cpp | 4 ++-- src/wiilove/main.cpp | 8 ++++---- src/wiilove/modules/event.cpp | 8 ++++---- src/wiilove/modules/graphics.cpp | 4 ++-- src/wiilove/modules/wiimote.cpp | 2 +- src/wiilove/modules/wiimote.hpp | 2 +- 7 files changed, 17 insertions(+), 15 deletions(-) diff --git a/data/boot.lua b/data/boot.lua index 3f6b418..6a54d19 100644 --- a/data/boot.lua +++ b/data/boot.lua @@ -147,7 +147,9 @@ if love.getMode() == "final" then -- Run everything unprotected -- Load main.lua to intialize functions love.filesystem.load("main.lua")() - return love.run() + love.run() + + return else -- Run everything protected local main, error diff --git a/src/wiilove/lib/FreeTypeGX.cpp b/src/wiilove/lib/FreeTypeGX.cpp index 1a2cbf6..72ad1a5 100644 --- a/src/wiilove/lib/FreeTypeGX.cpp +++ b/src/wiilove/lib/FreeTypeGX.cpp @@ -473,7 +473,7 @@ ftgxCharData* FreeTypeGX::getCharacter(wchar_t character) { */ int FreeTypeGX::drawText(float x, float y, const wchar_t *text, float scaleX, float scaleY, float offsetX, float offsetY, float degrees, int textStyle) { float x_pos = x, printed = 0; - float x_offset = 0, y_offset = this->ftHeight * -scaleY; + float x_offset = 0, y_offset = -this->ftHeight * scaleY; GXTexObj glyphTexture; FT_Vector pairDelta; @@ -488,7 +488,7 @@ int FreeTypeGX::drawText(float x, float y, const wchar_t *text, float scaleX, fl } if(textStyle & FTGX_ALIGN_MASK) { - y_offset = static_cast(this->getStyleOffsetHeight(textStyle)) * scaleY; + y_offset += static_cast(this->getStyleOffsetHeight(textStyle)) * scaleY; } for (size_t i = 0; i < wcslen(text); i++) { diff --git a/src/wiilove/main.cpp b/src/wiilove/main.cpp index 36f3f91..ae2070d 100644 --- a/src/wiilove/main.cpp +++ b/src/wiilove/main.cpp @@ -20,7 +20,7 @@ // Libraries #include #include -#ifndef HW_DOL +#if !defined(HW_DOL) #include #endif // !HW_DOL #include @@ -40,7 +40,7 @@ #include "modules/math.hpp" #include "modules/system.hpp" #include "modules/timer.hpp" -#ifndef HW_DOL +#if !defined(HW_DOL) #include "modules/wiimote.hpp" #endif // !HW_DOL @@ -83,7 +83,7 @@ int main(int argc, char **argv) { love::graphics::init(); love::timer::init(); -#ifndef HW_DOL +#if !defined(HW_DOL) love::system::init(); love::wiimote::init(); #endif // !HW_DOL @@ -194,7 +194,7 @@ int main(int argc, char **argv) { "step", love::timer::module::step, "sleep", love::timer::module::sleep -#ifndef HW_DOL +#if !defined(HW_DOL) ), "wiimote", lua.create_table_with( diff --git a/src/wiilove/modules/event.cpp b/src/wiilove/modules/event.cpp index 72f3f52..34ef21f 100644 --- a/src/wiilove/modules/event.cpp +++ b/src/wiilove/modules/event.cpp @@ -22,7 +22,7 @@ // Libraries #include #include -#ifndef HW_DOL +#if !defined(HW_DOL) #include #endif // !HW_DOL #include @@ -50,7 +50,7 @@ namespace { int resetFunc = -1; void resetPressed(unsigned int irq, void *ctx) { resetFunc = SYS_RETURNTOMENU; } void powerPressed() { resetFunc = SYS_POWEROFF; } -#ifndef HW_DOL +#if !defined(HW_DOL) void wiimotePowerPressed(int id) { resetFunc = SYS_POWEROFF; } #endif // !HW_DOL } @@ -59,7 +59,7 @@ void init () { // SYS_ResetSystem callbacks SYS_SetResetCallback(resetPressed); SYS_SetPowerCallback(powerPressed); -#ifndef HW_DOL +#if !defined(HW_DOL) WPAD_SetPowerButtonCallback(wiimotePowerPressed); #endif // !HW_DOL } @@ -94,7 +94,7 @@ void pump(sol::this_state s) { events.push_back(makeEvent()); -#ifndef HW_DOL +#if !defined(HW_DOL) // Update wiimotes love::wiimote::update(wiimoteAdds, wiimoteRemoves, homePressed); #endif // !HW_DOL diff --git a/src/wiilove/modules/graphics.cpp b/src/wiilove/modules/graphics.cpp index 64bc225..f97571c 100644 --- a/src/wiilove/modules/graphics.cpp +++ b/src/wiilove/modules/graphics.cpp @@ -23,7 +23,7 @@ #include #include #include -#ifndef HW_DOL +#if !defined(HW_DOL) #include #endif // !HW_DOL #include @@ -60,7 +60,7 @@ namespace { } void init() { -#ifndef HW_DOL +#if !defined(HW_DOL) widescreen = CONF_GetAspectRatio() == CONF_ASPECT_16_9; #endif // !HW_DOL diff --git a/src/wiilove/modules/wiimote.cpp b/src/wiilove/modules/wiimote.cpp index 55ab0af..850b98f 100644 --- a/src/wiilove/modules/wiimote.cpp +++ b/src/wiilove/modules/wiimote.cpp @@ -19,7 +19,7 @@ * . */ -#ifndef HW_DOL +#if !defined(HW_DOL) // Libraries #include diff --git a/src/wiilove/modules/wiimote.hpp b/src/wiilove/modules/wiimote.hpp index d056d9c..80621e2 100644 --- a/src/wiilove/modules/wiimote.hpp +++ b/src/wiilove/modules/wiimote.hpp @@ -21,7 +21,7 @@ #pragma once -#ifndef HW_DOL +#if !defined(HW_DOL) // Libraries #include