Mercurial > hg > old > magoroku_racing
changeset 143:be127b7d1812
minor fix
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Sat, 23 Jul 2011 10:18:28 +0900 |
parents | 8ac08eda80ac |
children | d1ddd095ab03 |
files | col.cc field.cc getStrFromFile.cc getStrFromFile.h libps2.h |
diffstat | 5 files changed, 19 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/col.cc Sat Jul 23 05:21:45 2011 +0900 +++ b/col.cc Sat Jul 23 10:18:28 2011 +0900 @@ -73,7 +73,6 @@ int i; ColFacePtr col_face=hd->colface; - printf("------------ hd->facenum = %d --------------\n",hd->facenum); for (i=0; i<hd->facenum; i++) { @@ -90,6 +89,10 @@ } return false; NOCOLLISION: + printf("---on hd->facenum = %d/%d ----- ",i, hd->facenum); + printf("P x,y,z = %f,%f,%f ",col_face[i].p0[0],col_face[i].p0[1],col_face[i].p0[2]); + printf("N x,y,z = %f,%f,%f\n",col_face[i].normal[0],col_face[i].normal[1],col_face[i].normal[2]); + ps2_vu0_copy_vector(p, o); ps2_vu0_copy_vector(pose, col_face[i].normal); return true;
--- a/field.cc Sat Jul 23 05:21:45 2011 +0900 +++ b/field.cc Sat Jul 23 10:18:28 2011 +0900 @@ -77,6 +77,7 @@ fflush(stderr); exit(EXIT_FAILURE); } + memset(self, 0, sizeof(Field)); self->object = obj; self->next = NULL;
--- a/getStrFromFile.cc Sat Jul 23 05:21:45 2011 +0900 +++ b/getStrFromFile.cc Sat Jul 23 10:18:28 2011 +0900 @@ -15,7 +15,7 @@ reallocとかでfree()しなくて良い方法も教えて下さい. */ -int getStrFromFile( char **getStrDate, const char *fname, const char *searchStartStr, const char *searchEndStr ) +int getStrFromFile( char **getStrData, const char *fname, const char *searchStartStr, const char *searchEndStr ) { // 読み込んだ文字列の回数. 最後にコレを返す int num = 0; @@ -54,11 +54,15 @@ int lenNum = strlen(p1 + searchStartStrLen); // 動的にメモリ確保したい。なんかオカしいってのはわかるケド、良い方法が思いつかん - getStrDate[num] = (char*)malloc(sizeof(char)*lenNum+1); + getStrData[num] = (char*)malloc(sizeof(char)*lenNum+1); - strcpy(getStrDate[num], p1+searchStartStrLen); + strcpy(getStrData[num], p1+searchStartStrLen); num ++; + if (num>=64) { + printf("Too many objects in file %s\n", fname); + exit(0); + } } } @@ -67,7 +71,7 @@ printf("num = %d\n",num); for( int i = 0; i < num; i ++ ){ - printf("getStrDate[%d] = %s\n", i, getStrDate[i]); + printf("getStrData[%d] = %s\n", i, getStrData[i]); } return num;
--- a/getStrFromFile.h Sat Jul 23 05:21:45 2011 +0900 +++ b/getStrFromFile.h Sat Jul 23 10:18:28 2011 +0900 @@ -1,3 +1,3 @@ /* getStrFromFile.h */ -int getStrFromFile( char **getStrDate, const char *fname, const char *searchStartStr, const char *searchEndStr ); +int getStrFromFile( char **getStrData, const char *fname, const char *searchStartStr, const char *searchEndStr );
--- a/libps2.h Sat Jul 23 05:21:45 2011 +0900 +++ b/libps2.h Sat Jul 23 10:18:28 2011 +0900 @@ -55,10 +55,13 @@ // xmlファイル内の 各 surface name の文字列入れる // 要素数は名前の文字数の最大数。 + // surface数. 一つのオブジェクトが持つpartの数 + struct object *next; + + int partNum; + char *partName[64]; - // surface数. 一つのオブジェクトが持つpartの数 - int partNum; } OBJECT;