summaryrefslogtreecommitdiff
path: root/src/init.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/init.c')
-rw-r--r--src/init.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/init.c b/src/init.c
index 812598f..153dd6e 100644
--- a/src/init.c
+++ b/src/init.c
@@ -8,11 +8,15 @@
** Last update Sun Apr 22 16:09:49 2012 olivier gayot
*/
+#include "config.h"
+
#include <stdio.h>
#include <sdl_digit.h>
#include <strings.h>
#include "minesweeper.h"
+#define IMG_DIR DATADIR "/img"
+
static void rand_bombs(bool bombs[BLOCK_H][BLOCK_W]);
static SDL_Surface *xSDL_LoadBMP(const char *path);
@@ -51,14 +55,14 @@ void load_surfaces(void) {
char str[256];
for (int i = 0; i < 9; ++i) {
- snprintf(str, 256, "img/%d.bmp", i);
+ snprintf(str, 256, IMG_DIR "/%d.bmp", i);
surf_number[i] = xSDL_LoadBMP(str);
}
- bmb_surf = xSDL_LoadBMP("img/b.bmp");
- hidden_surf = xSDL_LoadBMP("img/hidden.bmp");
- flag_surf = xSDL_LoadBMP("img/flag.bmp");
- wrong_flag = xSDL_LoadBMP("img/wrong_flag.bmp");
- selection_surf = xSDL_LoadBMP("img/selection.bmp");
+ bmb_surf = xSDL_LoadBMP(IMG_DIR "/b.bmp");
+ hidden_surf = xSDL_LoadBMP(IMG_DIR "/hidden.bmp");
+ flag_surf = xSDL_LoadBMP(IMG_DIR "/flag.bmp");
+ wrong_flag = xSDL_LoadBMP(IMG_DIR "/wrong_flag.bmp");
+ selection_surf = xSDL_LoadBMP(IMG_DIR "/selection.bmp");
SDL_SetColorKey(selection_surf, SDL_SRCCOLORKEY, 0);
}