Skip to content

Commit

Permalink
push some small stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
TurtleP committed Nov 15, 2024
1 parent 447095e commit ee85c86
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 17 deletions.
3 changes: 2 additions & 1 deletion platform/ctr/source/modules/font/BCFNTRasterizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,15 @@ namespace love
return (this->userdata == nullptr) ? (CFNT_s*)data->getData() : this->userdata;
}

BCFNTRasterizer::BCFNTRasterizer(Data* data, int size)
BCFNTRasterizer::BCFNTRasterizer(Data* data, int size) : userdata(nullptr)
{
this->dpiScale = 1.0f;
this->size = std::floor(size * this->dpiScale + 0.5f);

if (this->size == 0)
throw love::Exception("Invalid font size: {:d}", this->size);

/* if data wasn't a sysfont, this is zero */
if (linearGetSize(data->getData()) == 0)
{
this->userdata = (CFNT_s*)linearAlloc(data->getSize());
Expand Down
2 changes: 1 addition & 1 deletion source/modules/audio/wrap_Audio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ int Wrap_Audio::stop(lua_State* L)
{
if (lua_isnone(L, 1))
instance()->stop();
if (lua_istable(L, 1))
else if (lua_istable(L, 1))
instance()->stop(readSourceList(L, 1));
else if (lua_gettop(L) > 1)
instance()->stop(readSourceVararg(L, 1));
Expand Down
30 changes: 15 additions & 15 deletions source/modules/love/love.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,20 +164,20 @@ static int love_atpanic(lua_State* L)
return 0;
}

// #if __DEBUG__
// static void love_atcpanic()
// {
// try
// {
// throw;
// }
// catch (const std::exception& e)
// {
// std::printf("Uncaught exception: %s", e.what());
// std::exit(EXIT_FAILURE);
// }
// }
// #endif
#if __DEBUG__
static void love_atcpanic()
{
try
{
throw;
}
catch (const std::exception& e)
{
std::printf("Uncaught exception: %s", e.what());
std::exit(EXIT_FAILURE);
}
}
#endif

static void luax_addcompatibilityalias(lua_State* L, const char* module, const char* name, const char* alias)
{
Expand Down Expand Up @@ -269,7 +269,7 @@ int love_initialize(lua_State* L)
lua_atpanic(L, love_atpanic);

#if __DEBUG__
// std::set_terminate(love_atcpanic);
std::set_terminate(love_atcpanic);
#endif

return 1;
Expand Down

0 comments on commit ee85c86

Please sign in to comment.