чување a79168228ec82697c7be4cabdb97c789b91ddf7a
родитељ 43013189dfa79769b924d84f5349cc147a05255e
Аутор: Страхиња Радић <contact@strahinja.org>
Датум: Wed, 16 Aug 2023 13:45:37 +0200
Also install sprites
Signed-off-by: Страхиња Радић <contact@strahinja.org>
Diffstat:
измењених датотека: 3, додавања: 6(+), брисања: 3(-)
diff --git a/install.do b/install.do
@@ -9,6 +9,6 @@ if [ -z "$DATADIR" ]; then
fi
install -d $BINDIR $DATADIR
install -m 0755 lav-sdl $BINDIR
-for datafile in *.dat; do
+for datafile in *.dat *.png; do
install -m 0644 $datafile $DATADIR/$datafile
done
diff --git a/lav-sdl.c b/lav-sdl.c
@@ -507,7 +507,8 @@ load_textures(void)
{
SDL_Surface* surface = NULL;
- surface = IMG_Load("sprites.png");
+ /* TODO: Tre DATADIR, then ., then fail */
+ surface = IMG_Load(SPRITES_PNG);
if (!surface)
{
print_error("IMG_Load failed: %s", IMG_GetError());
@@ -524,7 +525,7 @@ load_textures(void)
SDL_FreeSurface(surface);
surface = NULL;
- surface = IMG_Load("ter16.png");
+ surface = IMG_Load(TER16_PNG);
if (!surface)
{
print_error("IMG_Load failed: %s", IMG_GetError());
diff --git a/local.h.in b/local.h.in
@@ -3,3 +3,5 @@
* See the file LICENSE for exact copyright and license details. */
#define DEFAULT_DATAFILE "%DATADIR%/lavirint.dat"
+#define TER16_PNG "%DATADIR%/ter16.png"
+#define SPRITES_PNG "%DATADIR%/sprites.png"