Skip to content

Commit

Permalink
Also load sprites relative to the launched script
Browse files Browse the repository at this point in the history
  • Loading branch information
Daft-Freak committed Sep 14, 2024
1 parent eaddd34 commit 295e8ec
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lua-bindings/surface.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#include "../luablitlib.hpp"

extern std::string base_path;

using namespace blit;

static Surface *to_surface(lua_State *L, int arg) {
Expand Down Expand Up @@ -237,7 +239,7 @@ static int surface_load_sprites(lua_State *L, Surface *surface, int first_arg) {
delete surface->sprites;
surface->sprites = nullptr;
}
surface->sprites = Surface::load(filename);
surface->sprites = Surface::load(base_path + "/" + filename);
return 0;
}

Expand Down

0 comments on commit 295e8ec

Please sign in to comment.