summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorStarla Insigna <starla4444@gmail.com>2013-08-25 14:41:26 -0400
committerStarla Insigna <starla4444@gmail.com>2013-08-25 14:41:26 -0400
commit387685d34e6c4ebee776a700a01fed4df05446be (patch)
tree1ce4f92037f77fbaee93225b44199cefa215f8f1
parent8ac5ac0365569cd8fab1ba6360a09e748a4fa299 (diff)
downloadmazeoflife-387685d34e6c4ebee776a700a01fed4df05446be.tar.gz
mazeoflife-387685d34e6c4ebee776a700a01fed4df05446be.tar.bz2
mazeoflife-387685d34e6c4ebee776a700a01fed4df05446be.zip
Replaced internal resources with external ones for compatibility
-rw-r--r--.hgignore1
-rw-r--r--Makefile12
-rw-r--r--chlstate.cpp4
-rw-r--r--hsglobal.cpp4
-rw-r--r--hslocal.cpp6
-rw-r--r--hsnew.cpp4
-rw-r--r--hssubmit.cpp6
-rw-r--r--htpstate.cpp6
-rw-r--r--includes.h1
-rw-r--r--mazeoflife.cpp5
-rw-r--r--resources.h24
-rw-r--r--titlestate.cpp4
12 files changed, 26 insertions, 51 deletions
diff --git a/.hgignore b/.hgignore index 378eac2..d76b74e 100644 --- a/.hgignore +++ b/.hgignore
@@ -1 +1,2 @@
1build 1build
2.DS_Store
diff --git a/Makefile b/Makefile index 27d70a9..8a9d3b5 100644 --- a/Makefile +++ b/Makefile
@@ -10,8 +10,8 @@ MODULES = $(patsubst %.cpp,%,$(FILES))
10SOURCES = $(addsuffix .o,$(MODULES)) 10SOURCES = $(addsuffix .o,$(MODULES))
11WINSRC = $(addsuffix win,$(SOURCES)) 11WINSRC = $(addsuffix win,$(SOURCES))
12RES = $(wildcard resources/*) 12RES = $(wildcard resources/*)
13CRES = $(patsubst resources/%,build/%,$(addsuffix .o,$(RES))) 13CRES = $(patsubst resources/%,build/%,$(RES))
14LINCCFL = `sdl-config --cflags` 14LINCCFL = `sdl-config --cflags` -I/usr/local/Cellar/sdl_net/1.2.8/include/SDL/ -I/usr/local/Cellar/sdl_ttf/2.0.11/include/SDL/
15LINLDFL = `sdl-config --libs` -lSDL_ttf -lSDL_net 15LINLDFL = `sdl-config --libs` -lSDL_ttf -lSDL_net
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
17WINLDFL = `/opt/SDL-1.2.9/bin/i386-mingw32msvc-sdl-config --libs` -lSDL_ttf -lSDL_net 17WINLDFL = `/opt/SDL-1.2.9/bin/i386-mingw32msvc-sdl-config --libs` -lSDL_ttf -lSDL_net
@@ -27,13 +27,13 @@ clean:
27 rm -rdfv build 27 rm -rdfv build
28 28
29$(LTARGET): $(SOURCES) $(CRES) 29$(LTARGET): $(SOURCES) $(CRES)
30 $(CC) $(SOURCES) $(CRES) -o $(LTARGET) $(LINLDFL) 30 $(CC) $(SOURCES) -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) $(CRES) build/winres.o 35$(WTARGET): $(WINSRC) $(CRES) build/winres.o
36 $(WINCC) $(WINSRC) $(CRES) build/winres.o -o $(WTARGET) $(WINLDFL) 36 $(WINCC) $(WINSRC) 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$(CRES): build/%.o: resources/% 44$(CRES): build/%: resources/%
45 objcopy --input binary --output elf32-i386 -B i386 $? $@ 45 cp $? $@
diff --git a/chlstate.cpp b/chlstate.cpp index 14182a2..48bf8c2 100644 --- a/chlstate.cpp +++ b/chlstate.cpp
@@ -2,8 +2,8 @@
2 2
3ChooseHighscoreListState::ChooseHighscoreListState() 3ChooseHighscoreListState::ChooseHighscoreListState()
4{ 4{
5 LOADIMAGE(background,chl) 5 background = SDL_LoadBMP("chl.bmp");
6 LOADIMAGE(pointer,pointer) 6 pointer = SDL_LoadBMP("pointer.bmp");
7 7
8 selection = 0; 8 selection = 0;
9} 9}
diff --git a/hsglobal.cpp b/hsglobal.cpp index 37db44b..c21d314 100644 --- a/hsglobal.cpp +++ b/hsglobal.cpp
@@ -2,8 +2,8 @@
2 2
3GlobalHighscoreListState::GlobalHighscoreListState() 3GlobalHighscoreListState::GlobalHighscoreListState()
4{ 4{
5 LOADIMAGE(options,hlo_rtm) 5 options = SDL_LoadBMP("hlo_rtm.bmp");
6 LOADIMAGE(pointer,pointer) 6 pointer = SDL_LoadBMP("pointer.bmp");
7 7
8 list = SDL_CreateRGBSurface(SDL_SWSURFACE || SDL_SRCCOLORKEY, 480, 480, 32, 0,0,0,0); 8 list = SDL_CreateRGBSurface(SDL_SWSURFACE || SDL_SRCCOLORKEY, 480, 480, 32, 0,0,0,0);
9 Uint32 bgColor = SDL_MapRGB(list->format, 255, 255, 255); 9 Uint32 bgColor = SDL_MapRGB(list->format, 255, 255, 255);
diff --git a/hslocal.cpp b/hslocal.cpp index c53f397..b33a094 100644 --- a/hslocal.cpp +++ b/hslocal.cpp
@@ -6,12 +6,12 @@ LocalHighscoreListState::LocalHighscoreListState(bool fromGame)
6 6
7 if (fromGame) 7 if (fromGame)
8 { 8 {
9 LOADIMAGE(options,hlo_paartm) 9 options = SDL_LoadBMP("hlo_paartm.bmp");
10 } else { 10 } else {
11 LOADIMAGE(options,hlo_rtm) 11 options = SDL_LoadBMP("hlo_rtm.bmp");
12 } 12 }
13 13
14 LOADIMAGE(pointer,pointer) 14 pointer = SDL_LoadBMP("pointer.bmp");
15 15
16 LocalHighscoreList* lhl = new LocalHighscoreList(); 16 LocalHighscoreList* lhl = new LocalHighscoreList();
17 list = lhl->render(); 17 list = lhl->render();
diff --git a/hsnew.cpp b/hsnew.cpp index 8b752a6..2f3e0a2 100644 --- a/hsnew.cpp +++ b/hsnew.cpp
@@ -4,8 +4,8 @@ NewHighscoreState::NewHighscoreState(int level)
4{ 4{
5 this->level = level; 5 this->level = level;
6 6
7 LOADIMAGE(options,hlo_passartm) 7 options = SDL_LoadBMP("hlo_passartm.bmp");
8 LOADIMAGE(pointer,pointer) 8 pointer = SDL_LoadBMP("pointer.bmp");
9 9
10 lhl = new NewHighscoreList(level); 10 lhl = new NewHighscoreList(level);
11 newpos = lhl->getNewPos(); 11 newpos = lhl->getNewPos();
diff --git a/hssubmit.cpp b/hssubmit.cpp index 690749a..7d4c551 100644 --- a/hssubmit.cpp +++ b/hssubmit.cpp
@@ -2,7 +2,7 @@
2 2
3SubmitHighscoreListState::SubmitHighscoreListState(char* hsname, int level) 3SubmitHighscoreListState::SubmitHighscoreListState(char* hsname, int level)
4{ 4{
5 LOADIMAGE(pointer,pointer) 5 pointer = SDL_LoadBMP("pointer.bmp");
6 6
7 this->hsname = hsname; 7 this->hsname = hsname;
8 this->level = level; 8 this->level = level;
@@ -38,9 +38,9 @@ int SubmitHighscoreListState::LoadHighscoreList(void* pParam)
38 38
39 if (lhl->hasFailed()) 39 if (lhl->hasFailed())
40 { 40 {
41 LOADIMAGE(((SubmitHighscoreListState*)pParam)->options,hlo_passartm) 41 ((SubmitHighscoreListState*)pParam)->options = SDL_LoadBMP("hlo_passartm.bmp");
42 } else { 42 } else {
43 LOADIMAGE(((SubmitHighscoreListState*)pParam)->options,hlo_paartm) 43 ((SubmitHighscoreListState*)pParam)->options = SDL_LoadBMP("hlo_paartm.bmp");
44 } 44 }
45 45
46 SDL_Rect oSpace = {0, 440, ((SubmitHighscoreListState*)pParam)->options->w, ((SubmitHighscoreListState*)pParam)->options->h}; 46 SDL_Rect oSpace = {0, 440, ((SubmitHighscoreListState*)pParam)->options->w, ((SubmitHighscoreListState*)pParam)->options->h};
diff --git a/htpstate.cpp b/htpstate.cpp index 03d02c6..fbf6b71 100644 --- a/htpstate.cpp +++ b/htpstate.cpp
@@ -2,9 +2,9 @@
2 2
3HowToPlayState::HowToPlayState() 3HowToPlayState::HowToPlayState()
4{ 4{
5 LOADIMAGE(background1,htp1) 5 background1 = SDL_LoadBMP("htp1.bmp");
6 LOADIMAGE(background2,htp2) 6 background2 = SDL_LoadBMP("htp2.bmp");
7 LOADIMAGE(pointer,pointer) 7 pointer = SDL_LoadBMP("pointer.bmp");
8 8
9 secondPage = false; 9 secondPage = false;
10 selection = 0; 10 selection = 0;
diff --git a/includes.h b/includes.h index b7c0d56..6023709 100644 --- a/includes.h +++ b/includes.h
@@ -11,7 +11,6 @@
11#include <exception> 11#include <exception>
12#include "state.h" 12#include "state.h"
13#include "mazeoflife.h" 13#include "mazeoflife.h"
14#include "resources.h"
15#include "titlestate.h" 14#include "titlestate.h"
16#include "htpstate.h" 15#include "htpstate.h"
17#include "chlstate.h" 16#include "chlstate.h"
diff --git a/mazeoflife.cpp b/mazeoflife.cpp index 45fc377..9033526 100644 --- a/mazeoflife.cpp +++ b/mazeoflife.cpp
@@ -33,7 +33,7 @@ int main(int argc, char *argv[])
33 SDL_WM_SetCaption("Maze Of Life", NULL); 33 SDL_WM_SetCaption("Maze Of Life", NULL);
34 34
35 SDL_Surface* icon; 35 SDL_Surface* icon;
36 LOADIMAGE(icon,icon) 36 icon = SDL_LoadBMP("icon.bmp");
37 SDL_WM_SetIcon(icon, NULL); 37 SDL_WM_SetIcon(icon, NULL);
38 38
39 /* 39 /*
@@ -118,8 +118,7 @@ Uint32 tick(Uint32 interval, void *param)
118 118
119TTF_Font* loadFont(int size) 119TTF_Font* loadFont(int size)
120{ 120{
121 SDL_RWops* mono_rw = SDL_RWFromMem(&RESNAME(mono_ttf,start), (int) &RESNAME(mono_ttf,size)); 121 TTF_Font* tmpfont = TTF_OpenFont("mono.ttf", size);
122 TTF_Font* tmpfont = TTF_OpenFontRW(mono_rw, 1, size);
123 122
124 if (tmpfont == NULL) 123 if (tmpfont == NULL)
125 { 124 {
diff --git a/resources.h b/resources.h deleted file mode 100644 index 4743950..0000000 --- a/resources.h +++ /dev/null
@@ -1,24 +0,0 @@
1#ifndef RESOURCES_H
2#define RESOURCES_H
3
4#ifdef WINDOWS
5#define RESNAME(title,part) binary_resources_ ## title ## _ ## part
6#else
7#define RESNAME(title,part) _binary_resources_ ## title ## _ ## part
8#endif
9
10#define DEFRES(title) extern int* RESNAME(title,start); extern int* RESNAME(title,size);
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);
12
13DEFRES(icon_bmp)
14DEFRES(title_bmp)
15DEFRES(pointer_bmp)
16DEFRES(htp1_bmp)
17DEFRES(htp2_bmp)
18DEFRES(chl_bmp)
19DEFRES(hlo_rtm_bmp)
20DEFRES(hlo_paartm_bmp)
21DEFRES(hlo_passartm_bmp)
22DEFRES(mono_ttf)
23
24#endif
diff --git a/titlestate.cpp b/titlestate.cpp index 2622caa..95023e5 100644 --- a/titlestate.cpp +++ b/titlestate.cpp
@@ -2,8 +2,8 @@
2 2
3TitleState::TitleState() 3TitleState::TitleState()
4{ 4{
5 LOADIMAGE(background,title) 5 background = SDL_LoadBMP("title.bmp");
6 LOADIMAGE(pointer,pointer) 6 pointer = SDL_LoadBMP("pointer.bmp");
7 7
8 selection = 0; 8 selection = 0;
9} 9}