changeset 52:150e832193fe

fix.
author koba <koba@cr.ie.u-ryukyu.ac.jp>
date Sun, 23 Jan 2011 19:01:34 +0900
parents 2e123c4bf5ca
children b31bed246abd
files Character.c Character_state.c Makefile.mac TaskDandy.cc schedule3.c state_task.cc state_task.h
diffstat 7 files changed, 17 insertions(+), 100 deletions(-) [+]
line wrap: on
line diff
--- a/Character.c	Sat Jan 22 16:47:33 2011 +0900
+++ b/Character.c	Sun Jan 23 19:01:34 2011 +0900
@@ -14,11 +14,10 @@
 #include "sgoex.h"
 #include "collision.h"
 #include "debug.h"
-
 #include "error.h"
-#include "state_task.h"
 #include "debug_db.h"
 #include "Func.h"
+#include "StateList.h"
 
 #define CHARACTER_MAX_POOL_SIZE 2048
 
@@ -131,11 +130,13 @@
     q->s = 0;
     q->f = TRUE;
 
+    
     if (q->tama == FALSE) {
-      printf("F%d:   [%s] [%d] x=%f  y=%f  vx=%f  vy=%f  CREATE\n",
-	     filpcount, dtable[q->charano].name, q->chara_id,
-	     q->x, q->y, q->vx, q->vy);
+        printf("F%d: CREATE  [NAME]%s  [ID]%d  [COORD]x= %f  y= %f  vx= %f  vy= %f\n",
+	       filpcount, dtable[q->charano].name, q->chara_id,
+	       q->x, q->y, q->vx, q->vy);
     }
+    
 }
 
 void state_update()
--- a/Character_state.c	Sat Jan 22 16:47:33 2011 +0900
+++ b/Character_state.c	Sun Jan 23 19:01:34 2011 +0900
@@ -53,9 +53,9 @@
 delete_chara(CHARACTER *p)
 {
   if (p->tama == FALSE) {
-    printf("F%d:   [%s] [%d] x=%f  y=%f  vx=%f  vy=%f  DELETE\n",
-	   filpcount, dtable[p->charano].name, p->chara_id,
-	   p->x, p->y, p->vx, p->vy);
+      printf("F%d: DELETE  [NAME]%s_%d  [VIT]%lf  [COORD]x= %f  y= %f  vx= %f  vy= %f\n",
+	     filpcount, dtable[p->charano].name, p->chara_id, p->vit,
+	     p->x, p->y, p->vx, p->vy);
   }
   
   CHARACTER *parent = p;
--- a/Makefile.mac	Sat Jan 22 16:47:33 2011 +0900
+++ b/Makefile.mac	Sun Jan 23 19:01:34 2011 +0900
@@ -2,7 +2,7 @@
 include ./Makefile.def
 
 TARGET = demo dandy t_dandy
-OBJS    =  Character.o Bom.o tokuten.o count2.o schedule3.o tama2.o syokika.o Ss.o sound.o  profile.o debug.o trace.o LoadSprite.o xml.o b64_de.o tree_controll.o object.o sys.o
+OBJS    =  Character.o Bom.o tokuten.o count2.o schedule3.o tama2.o syokika.o Ss.o sound.o  profile.o debug.o trace.o LoadSprite.o xml.o b64_de.o tree_controll.o object.o sys.o StateList.o
 
 TASK_DIR  = ppe
 TASK_SRCS_TMP = $(wildcard $(TASK_DIR)/*.cc)
--- a/TaskDandy.cc	Sat Jan 22 16:47:33 2011 +0900
+++ b/TaskDandy.cc	Sun Jan 23 19:01:34 2011 +0900
@@ -30,7 +30,7 @@
 #include "Character.h"
 #include "Character_state.h"
 #include "property.h"
-#include "state_task.h"
+#include "StateList.h"
 #include "debug_db.h"
 
 static int use_keybord = 0;
@@ -41,10 +41,6 @@
 static int cf = 0;
 static int cc = 0;
 
-//static SDL_Surface *screen;
-// static Uint32 background;
-// static char *pad_trace_file;
-
 extern void schedule();
 extern void tokuten();
 extern void Pad();
--- a/schedule3.c	Sat Jan 22 16:47:33 2011 +0900
+++ b/schedule3.c	Sun Jan 23 19:01:34 2011 +0900
@@ -235,7 +235,7 @@
 	    for(p = active_chara_list;p!=NULL;p=p->next)
 	      {
 		p->f = FALSE;
-		p->state = delete_chara;
+		p->state = noaction;
 		p->collision = noaction;
 	      }
 	    Putenemy(4, 520, -128, 0, 1, chara_state8);	// 1面ボスをPutenemy
--- a/state_task.cc	Sat Jan 22 16:47:33 2011 +0900
+++ b/state_task.cc	Sun Jan 23 19:01:34 2011 +0900
@@ -15,9 +15,10 @@
 #include "TaskManager.h"
 #include "Func.h"
 #include "property.h"
-#include "state_task.h"
 #include "ObjectType.h"
 #include "debug_db.h"
+#include "StateList.h"
+
 
 extern DebugDB dtable[DEFOBJ];
 extern SpriteTable sptable[DEFOBJ];
@@ -42,8 +43,6 @@
 
 int counter = 0;
 
-State state_list[LIST_NUM];
-
 /* output 0~3 */
 static
 int get_num()
@@ -64,6 +63,7 @@
     return value;
 }
 
+
 static void
 ReDefSprite(int number, float w, float h, int color)
 {
@@ -78,75 +78,6 @@
 }
 
 
-static int
-GetStateNum(int task_num)
-{
-    int num = task_num % LIST_NUM;
-
-    return num;
-}
-
-static void
-SetTaskState(int task_num, CHARACTER *(state)(CHARACTER *chara))
-{
-    int num = GetStateNum(task_num);
-    
-    state_list[num] = state;
-}
-
-void
-initStateList()
-{
-    SetTaskState(DELETE_CHARA, delete_chara);
-    SetTaskState(STATE0, chara_state0);
-    SetTaskState(STATE1, chara_state1);
-    SetTaskState(STATE2, chara_state2);
-    SetTaskState(STATE3, chara_state3);
-    SetTaskState(STATE4, chara_state4);
-    SetTaskState(STATE5, chara_state5);
-    SetTaskState(STATE6, chara_state6);
-    SetTaskState(STATE7, chara_state7);
-    SetTaskState(STATE8, chara_state8);
-    SetTaskState(STATE9, chara_state9);
-    SetTaskState(STATE10, chara_state10);
-    SetTaskState(STATE11, chara_state11);
-    SetTaskState(STATE12, chara_state12);
-    SetTaskState(STATE13, chara_state13);
-
-    SetTaskState(STATE20, chara_state20);
-    SetTaskState(STATE21, chara_state21);
-    SetTaskState(STATE22, chara_state22);
-    SetTaskState(STATE23, chara_state23);
-    SetTaskState(STATE24, chara_state24);
-    SetTaskState(STATE25, chara_state25);
-    SetTaskState(STATE26, chara_state26);
-    SetTaskState(STATE27, chara_state27);
-    SetTaskState(STATE28, chara_state28);
-    SetTaskState(STATE29, chara_state29);
-    SetTaskState(STATE30, chara_state30);
-    SetTaskState(STATE31, chara_state31);
-    SetTaskState(STATE32, chara_state32);
-    SetTaskState(STATE33, chara_state33);
-    SetTaskState(STATE34, chara_state34);
-    SetTaskState(STATE35, chara_state35);
-    SetTaskState(STATE40, chara_state40);
-    SetTaskState(STATE41, chara_state41);
-
-    SetTaskState(STATE400, chara_state400);
-    SetTaskState(STATE401, chara_state401);
-    SetTaskState(STATE402, chara_state402);
-
-    SetTaskState(STATE410, chara_state410);
-    SetTaskState(STATE411, chara_state411);
-
-    SetTaskState(STATE500, chara_state500);
-    SetTaskState(STATE501, chara_state501);
-
-    SetTaskState(STATE600, chara_state600);
-    SetTaskState(STATE601, chara_state601);
-    SetTaskState(STATE602, chara_state602);
-}
-
 void
 updateState(SchedTask *s, void *chara, void *arg)
 {
@@ -666,8 +597,8 @@
 delete_chara(CHARACTER *p)
 {
   if (p->tama == FALSE) {
-    printf("F%d:   [%s] [%d] x=%f  y=%f  vx=%f  vy=%f  DELETE\n",
-	   filpcount, dtable[p->charano].name, p->chara_id,
+    printf("F%d: DELETE  [NAME]%s_%d  [VIT]%lf  [COORD]x= %f  y= %f  vx= %f  vy= %f\n",
+	   filpcount, dtable[p->charano].name, p->chara_id, p->vit,
 	   p->x, p->y, p->vx, p->vy);
   }
 
--- a/state_task.h	Sat Jan 22 16:47:33 2011 +0900
+++ b/state_task.h	Sun Jan 23 19:01:34 2011 +0900
@@ -1,11 +0,0 @@
-#ifndef INCLUDE_STATE_TASK
-#define INCLUDE_STATE_TASK
-
-#define LIST_NUM 50
-#define DATA_LENGTH 10
-
-extern State state_list[LIST_NUM];
-
-void initStateList();
-
-#endif