summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--Makefile14
-rw-r--r--resources.h21
-rw-r--r--resources/chl.bmp (renamed from chl.bmp)bin921654 -> 921654 bytes
-rw-r--r--resources/htp1.bmp (renamed from htp1.bmp)bin921738 -> 921738 bytes
-rw-r--r--resources/htp2.bmp (renamed from htp2.bmp)bin921738 -> 921738 bytes
-rw-r--r--resources/icon.bmp (renamed from icon.bmp)bin3126 -> 3126 bytes
-rw-r--r--resources/pointer.bmp (renamed from pointer.bmp)bin2038 -> 2038 bytes
-rw-r--r--resources/title.bmp (renamed from title.bmp)bin921654 -> 921654 bytes
8 files changed, 18 insertions, 17 deletions
diff --git a/Makefile b/Makefile index e44f590..9bad9b2 100644 --- a/Makefile +++ b/Makefile
@@ -9,8 +9,8 @@ HEADERS = $(wildcard *.h)
9MODULES = $(patsubst %.cpp,%,$(FILES)) 9MODULES = $(patsubst %.cpp,%,$(FILES))
10SOURCES = $(addsuffix .o,$(MODULES)) 10SOURCES = $(addsuffix .o,$(MODULES))
11WINSRC = $(addsuffix win,$(SOURCES)) 11WINSRC = $(addsuffix win,$(SOURCES))
12IMAGES = $(wildcard *.bmp) 12RES = $(wildcard resources/*)
13CIMAGES = $(addprefix build/,$(IMAGES:.bmp=.bmp.o)) 13CRES = $(patsubst resources/%,build/%,$(addsuffix .o,$(RES)))
14LINCCFL = `sdl-config --cflags` 14LINCCFL = `sdl-config --cflags`
15LINLDFL = `sdl-config --libs` 15LINLDFL = `sdl-config --libs`
16WINCCFL = `/opt/SDL-1.2.9/bin/i386-mingw32msvc-sdl-config --cflags` -DWINDOWS 16WINCCFL = `/opt/SDL-1.2.9/bin/i386-mingw32msvc-sdl-config --cflags` -DWINDOWS
@@ -26,14 +26,14 @@ init:
26clean: 26clean:
27 rm -rdfv build 27 rm -rdfv build
28 28
29$(LTARGET): $(SOURCES) $(CIMAGES) 29$(LTARGET): $(SOURCES) $(CRES)
30 $(CC) $(SOURCES) $(CIMAGES) -o $(LTARGET) $(LINLDFL) 30 $(CC) $(SOURCES) $(CRES) -o $(LTARGET) $(LINLDFL)
31 31
32$(SOURCES): build/%.o: %.cpp $(HEADERS) 32$(SOURCES): build/%.o: %.cpp $(HEADERS)
33 $(CC) -c $< -o $@ $(LINCCFL) 33 $(CC) -c $< -o $@ $(LINCCFL)
34 34
35$(WTARGET): $(WINSRC) $(CIMAGES) build/winres.o 35$(WTARGET): $(WINSRC) $(CRES) build/winres.o
36 $(WINCC) $(WINSRC) $(CIMAGES) build/winres.o -o $(WTARGET) $(WINLDFL) 36 $(WINCC) $(WINSRC) $(CRES) build/winres.o -o $(WTARGET) $(WINLDFL)
37 37
38$(WINSRC): build/%.owin: %.cpp $(HEADERS) 38$(WINSRC): build/%.owin: %.cpp $(HEADERS)
39 $(WINCC) -c $< -o $@ $(WINCCFL) 39 $(WINCC) -c $< -o $@ $(WINCCFL)
@@ -41,5 +41,5 @@ $(WINSRC): build/%.owin: %.cpp $(HEADERS)
41build/winres.o: winres.rc 41build/winres.o: winres.rc
42 $(WINDRES) $? $@ 42 $(WINDRES) $? $@
43 43
44$(CIMAGES): build/%.bmp.o: %.bmp 44$(CRES): build/%.o: resources/%
45 objcopy --input binary --output elf32-i386 -B i386 $? $@ 45 objcopy --input binary --output elf32-i386 -B i386 $? $@
diff --git a/resources.h b/resources.h index dd18ffe..fc9229a 100644 --- a/resources.h +++ b/resources.h
@@ -2,18 +2,19 @@
2#define RESOURCES_H 2#define RESOURCES_H
3 3
4#ifdef WINDOWS 4#ifdef WINDOWS
5#define LOADIMAGE(var,title) SDL_RWops * title ## _rw = SDL_RWFromMem(&binary_ ## title ## _bmp_start, (int) &binary_ ## title ## _bmp_size); var = SDL_LoadBMP_RW( title ## _rw, 1); 5#define RESNAME(title,part) binary_resources_ ## title ## _ ## part
6#define DEFIMAGE(title) extern int* binary_ ## title ## _bmp_start; extern int* binary_ ## title ## _bmp_size;
7#else 6#else
8#define LOADIMAGE(var,title) SDL_RWops * title ## _rw = SDL_RWFromMem(&_binary_ ## title ## _bmp_start, (int) &_binary_ ## title ## _bmp_size); var = SDL_LoadBMP_RW( title ## _rw, 1); 7#define RESNAME(title,part) _binary_resources_ ## title ## _ ## part
9#define DEFIMAGE(title) extern int* _binary_ ## title ## _bmp_start; extern int* _binary_ ## title ## _bmp_size;
10#endif 8#endif
11 9
12DEFIMAGE(icon) 10#define DEFRES(title) extern int* RESNAME(title,start); extern int* RESNAME(title,size);
13DEFIMAGE(title) 11#define LOADIMAGE(var,title) SDL_RWops * title ## _rw = SDL_RWFromMem(&RESNAME(title ## _bmp,start), (int) &RESNAME(title ## _bmp,size)); var = SDL_LoadBMP_RW( title ## _rw, 1);
14DEFIMAGE(pointer) 12
15DEFIMAGE(htp1) 13DEFRES(icon_bmp)
16DEFIMAGE(htp2) 14DEFRES(title_bmp)
17DEFIMAGE(chl) 15DEFRES(pointer_bmp)
16DEFRES(htp1_bmp)
17DEFRES(htp2_bmp)
18DEFRES(chl_bmp)
18 19
19#endif 20#endif
diff --git a/chl.bmp b/resources/chl.bmp index b69efd0..b69efd0 100644 --- a/chl.bmp +++ b/resources/chl.bmp
Binary files differ
diff --git a/htp1.bmp b/resources/htp1.bmp index df06101..df06101 100644 --- a/htp1.bmp +++ b/resources/htp1.bmp
Binary files differ
diff --git a/htp2.bmp b/resources/htp2.bmp index 5dcb4c4..5dcb4c4 100644 --- a/htp2.bmp +++ b/resources/htp2.bmp
Binary files differ
diff --git a/icon.bmp b/resources/icon.bmp index 024cea5..024cea5 100644 --- a/icon.bmp +++ b/resources/icon.bmp
Binary files differ
diff --git a/pointer.bmp b/resources/pointer.bmp index e1cee4e..e1cee4e 100644 --- a/pointer.bmp +++ b/resources/pointer.bmp
Binary files differ
diff --git a/title.bmp b/resources/title.bmp index ae0b624..ae0b624 100644 --- a/title.bmp +++ b/resources/title.bmp
Binary files differ