author | ecalot
<ecalot> 2005-01-10 23:14:36 UTC |
committer | ecalot
<ecalot> 2005-01-10 23:14:36 UTC |
parent | 1092035b0bc7da5923d1362e0b13c30b60f36e8b |
FP/src/Makefile | +2 | -2 |
FP/src/ker/kernel.c | +7 | -3 |
FP/src/ker/titles.c | +10 | -9 |
diff --git a/FP/src/Makefile b/FP/src/Makefile index 9349dac..27a0d7a 100644 --- a/FP/src/Makefile +++ b/FP/src/Makefile @@ -68,7 +68,7 @@ LINKEROPTIONS = $(LINKERRELEASE) # main file # ############# -$(EXEFILE): check $(OBJFILES) +$(EXEFILE): $(OBJFILES) $(INFO) Linking files... $(MAKEDIR) bin $(LINKER) $(LINKEROPTIONS) -o $(EXEFILE) $(OBJFILES) $(LIBS) $(LINKEROPTIONS) @@ -106,7 +106,7 @@ build: clean $(EXEFILE) all: build -install: download build +install: checks download build headers: $(GENERATEDRESHEADERS) $(GENERATEDSTAHEADERS) $(GENERATEDTILHEADERS)\ $(GENERATEDOTHHEADERS) diff --git a/FP/src/ker/kernel.c b/FP/src/ker/kernel.c index 1b45d1f..82aae69 100644 --- a/FP/src/ker/kernel.c +++ b/FP/src/ker/kernel.c @@ -47,16 +47,19 @@ kernel.c: FreePrince : Main Kernel * Main game control function */ +tObject kid; + int playgame(int optionflag,int level) { /* Create objects */ tKey key=inputCreateKey(); - /*TODO: use a map.c function that reads this information and creates the kid*/ - tObject kid=objectCreate(30,1,DIR_RIGHT,stateKidInLevel(/*level*/1),RES_IMG_ALL_KID,1); tData* resMap=resLoad(RES_MAP|level); tMap* map=(tMap*)resMap->pFrames; tRoom room; tRoomId roomId; + /*TODO: use a map.c function that reads this information and creates the kid*/ + kid=objectCreate(30,1,DIR_RIGHT,stateKidInLevel(/*level*/1),RES_IMG_ALL_KID,1); + /* Game loop here */ /* Initialize kid and room in the map */ @@ -152,6 +155,7 @@ int playgame(int optionflag,int level) { * Main function */ + int kernel(int optionflag,int level) { /* levels=-1 is default * levels from 0 to n is the level number @@ -192,7 +196,7 @@ int kernel(int optionflag,int level) { } } while(!quit); - objectFree(); + objectFree(kid); inputStopTimer(); outputStop(); return 0; diff --git a/FP/src/ker/titles.c b/FP/src/ker/titles.c index 6d24451..ef4a00c 100644 --- a/FP/src/ker/titles.c +++ b/FP/src/ker/titles.c @@ -119,18 +119,19 @@ tMenuOption playAnimation(int id) { /* move objects */ for (i=0;i<activet;i++) { - int exitCode=0; /*TODO: detect exits */ if (statesAlive[i]) { + int exitCode; exitCode=objectMove(ta+i,nullKey,NULL); - objectDraw(ta[i]); - } - - /* detect exited states and destroy them */ - if (exitCode<0) { /* exit code detected */ - printf("exit Code detected: i=%d exit=%d \n",i,exitCode); - objectFree(ta[i]); - statesAlive[i]=0; /* remember it is destroyed */ + + /* detect exited states and destroy them */ + if (exitCode<0) { /* exit code detected */ + printf("exit Code detected: i=%d exit=%d \n",i,exitCode); + objectFree(ta[i]); + statesAlive[i]=0; /* remember it is destroyed */ + } else { + objectDraw(ta[i]); + } } }