Skip to content

Commit

Permalink
Smol fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
htv04 committed Aug 16, 2022
1 parent 2e7b7fe commit 30473bc
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 15 deletions.
4 changes: 3 additions & 1 deletion data/boot.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions src/wiilove/lib/FreeTypeGX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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<float>(this->getStyleOffsetHeight(textStyle)) * scaleY;
y_offset += static_cast<float>(this->getStyleOffsetHeight(textStyle)) * scaleY;
}

for (size_t i = 0; i < wcslen(text); i++) {
Expand Down
8 changes: 4 additions & 4 deletions src/wiilove/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
// Libraries
#include <sol/sol.hpp>
#include <grrlib-mod.h>
#ifndef HW_DOL
#if !defined(HW_DOL)
#include <wiiuse/wpad.h>
#endif // !HW_DOL
#include <string>
Expand All @@ -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

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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(
Expand Down
8 changes: 4 additions & 4 deletions src/wiilove/modules/event.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
// Libraries
#include <sol/sol.hpp>
#include <grrlib-mod.h>
#ifndef HW_DOL
#if !defined(HW_DOL)
#include <wiiuse/wpad.h>
#endif // !HW_DOL
#include <vector>
Expand Down Expand Up @@ -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
}
Expand All @@ -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
}
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/wiilove/modules/graphics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include <grrlib-mod.h>
#include <FreeTypeGX.hpp>
#include <ogc/gx.h>
#ifndef HW_DOL
#if !defined(HW_DOL)
#include <ogc/conf.h>
#endif // !HW_DOL
#include <utility>
Expand Down Expand Up @@ -60,7 +60,7 @@ namespace {
}

void init() {
#ifndef HW_DOL
#if !defined(HW_DOL)
widescreen = CONF_GetAspectRatio() == CONF_ASPECT_16_9;
#endif // !HW_DOL

Expand Down
2 changes: 1 addition & 1 deletion src/wiilove/modules/wiimote.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* <https://www.gnu.org/licenses/>.
*/

#ifndef HW_DOL
#if !defined(HW_DOL)

// Libraries
#include <sol/sol.hpp>
Expand Down
2 changes: 1 addition & 1 deletion src/wiilove/modules/wiimote.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

#pragma once

#ifndef HW_DOL
#if !defined(HW_DOL)

// Libraries
#include <sol/sol.hpp>
Expand Down

0 comments on commit 30473bc

Please sign in to comment.