changeset 35:3b92a4b17049 default tip

fix for macosx Yosemite
author Nozomi
date Thu, 19 May 2016 18:18:34 +0900
parents b65f6fc9c84f
children
files Character_state.c Makefile Makefile.def Makefile.mac SgoexCerium.cc bom.h object.h sgoex.c sgoex.h sound.c sound.h tree_controll.c xml.c
diffstat 13 files changed, 26 insertions(+), 42 deletions(-) [+]
line wrap: on
line diff
--- a/Character_state.c	Sat May 21 20:44:24 2011 +0900
+++ b/Character_state.c	Thu May 19 18:18:34 2016 +0900
@@ -426,7 +426,7 @@
       p->vy = rand() % 3 + 1;
       p->state = chara_state23;
     }
-  if((sf == 2))
+  if(sf == 2)
     {
       p->x = rand() % 290;
       p->y = -30;
--- a/Makefile	Sat May 21 20:44:24 2011 +0900
+++ b/Makefile	Thu May 19 18:18:34 2016 +0900
@@ -5,7 +5,7 @@
 ABI = -m$(ABIBIT)
 
 CFLAGS  += -DINVISIBLE_MODE -g $(ABI) -Wall `sdl-config --cflags` `xml2-config --cflags` $(INCLUDE)
-LIBS	+=  `sdl-config --libs`,-framework,OpenGL -lSDL_mixer -lSDL_image `xml2-config --libs`
+LIBS	+=  `sdl-config --libs`,-framework,OpenGL -lSDL_mixer -lSDL_image `xml2-config --libs` `freetype-config --libs`
 LIBS += -lCerium -lFifoManager
 
 TARGET = demo dandy test1
--- a/Makefile.def	Sat May 21 20:44:24 2011 +0900
+++ b/Makefile.def	Thu May 19 18:18:34 2016 +0900
@@ -4,7 +4,7 @@
 # ex  linux/ps3
 CERIUM = ../Cerium
 
-CC      = g++
+CC      = clang++
 OPT = -g #-O9
 CFLAGS  =  -Wall $(OPT) 
 
--- a/Makefile.mac	Sat May 21 20:44:24 2011 +0900
+++ b/Makefile.mac	Thu May 19 18:18:34 2016 +0900
@@ -6,7 +6,7 @@
 
 CFLAGS  += -g $(ABI) -O2 -Wall `sdl-config --cflags` `xml2-config --cflags` $(INCLUDE)
 LIBS	+=  `sdl-config --libs`,-framework,OpenGL -lSDL_mixer -lSDL_image `xml2-config --libs`
-LIBS += -lCerium -lFifoManager
+LIBS += -lFifoManager
 
 TARGET = demo dandy
 OBJS    =  Character.o Bom.o tokuten.o collision.o count2.o Character_state.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 
--- a/SgoexCerium.cc	Sat May 21 20:44:24 2011 +0900
+++ b/SgoexCerium.cc	Thu May 19 18:18:34 2016 +0900
@@ -16,7 +16,6 @@
     CameraPtr camera = droot->sgroot->getCamera();
 
     droot->sgroot->flip();
-    droot->sgroot->lightCalc();
 
     root = droot->createSceneGraph();
     //root->xyz[0] = screen_w/2;
@@ -25,10 +24,11 @@
     root->xyz[1] = 0;
     root->xyz[2] = 30.0f;
 
+    droot->sgroot->lightCalc(root);
     /*親の回転、座標から、子の回転、座標を算出*/
     get_matrix(root->matrix, root->angle, root->xyz, camera->matrix);
     /*法線用の行列。Cameraの行列を抜いている(Cameraのコンストラクタで、単位行列にしている)*/
-    get_matrix(root->real_matrix, root->angle, root->xyz, camera->real_matrix);
+    // get_matrix(root->real_matrix, root->angle, root->xyz, camera->real_matrix);
 
     droot->setSceneData(root);
 }
@@ -56,7 +56,7 @@
     m->my = h / 2;
     m->tex_w = power_of_two(m->w);
     m->tex_h = power_of_two(m->h);
-    m->texture = (int *)name;
+    m->texture_name = name;
 
 }
 
@@ -66,7 +66,7 @@
 PutSprite(int zorder, short x, short y, int number)
 {
     SpriteTable *m = &sptable[number];
-    char *name = (char *) m->texture;
+    const char *name =  m->texture_name;
 if (!name) {
     printf("PutSprite %d unknown\n",number);
     return;
@@ -104,7 +104,7 @@
  }
 
     SpriteTable *m = &sptable[number];
-    char *name = (char *) m->texture;
+    const char *name =  m->texture_name;
 if (!name) {
     printf("PutSpriteEx %d unknown\n",number);
     return;
--- a/bom.h	Sat May 21 20:44:24 2011 +0900
+++ b/bom.h	Thu May 19 18:18:34 2016 +0900
@@ -14,9 +14,6 @@
 
 extern int count;
 
-extern int sb_size;
-extern int se_voice[9];
-extern int vab[10];
 extern bomchar bchar[100];
 
 
--- a/object.h	Sat May 21 20:44:24 2011 +0900
+++ b/object.h	Thu May 19 18:18:34 2016 +0900
@@ -19,7 +19,7 @@
   FVECTOR *data[4];
   FVECTOR xyz;
   FVECTOR angle;
-  int *texture;         // pointer of this surface's texture
+  unsigned int texture;         // pointer of this surface's texture
   char *image_name;
   struct surface *next;
   struct surface *child;
--- a/sgoex.c	Sat May 21 20:44:24 2011 +0900
+++ b/sgoex.c	Thu May 19 18:18:34 2016 +0900
@@ -30,11 +30,7 @@
 // int i;				/* Multi-purpose */
 //static int pageno;
 
-//static int padd;
 
-static const int sgo_tpx[12] =
-{ 0, 64, 128, 192, 256, 320, 0, 64, 128, 192, 256, 320 };
-static const int sgo_tpy[12] = { 0, 0, 0, 0, 0, 0, 256, 256, 256, 256, 256, 256 };
 
 /*  sgo.h  独自の変数形  */
 SpriteTable sptable[DEFOBJ];
@@ -42,16 +38,6 @@
 
 #define IMAGE_ADJUSTMENT (0) 
 
-/**
- * 一つの画像をpageno(page number)で区切るtexture_page_offsetで
- * pagenoに対応した領域のx,yを用意しておく。PlayStationではpageno
- * で区切る必要があったのだろうが、PS2では全く意味はなさない。
- */
-static const struct texture_page_offset {
-    int x;
-    int y;
-} texpage_offset[] = {
-    {0, 0}, {128 + IMAGE_ADJUSTMENT, 0}, {256 + IMAGE_ADJUSTMENT, 0}, {384 + IMAGE_ADJUSTMENT, 0}};
 
 /*-------------------------------------------------------------
   関数プロトタイプ
--- a/sgoex.h	Sat May 21 20:44:24 2011 +0900
+++ b/sgoex.h	Thu May 19 18:18:34 2016 +0900
@@ -82,7 +82,8 @@
   int page;
   int tex_w;
   int tex_h;
-  int *texture;
+  unsigned int texture;
+  const char *texture_name;
   int tex_id;  // for open gl
 } SpriteTable;
 
--- a/sound.c	Sat May 21 20:44:24 2011 +0900
+++ b/sound.c	Thu May 19 18:18:34 2016 +0900
@@ -23,22 +23,22 @@
   (long) buf0 };
 #endif
 
-int vb_addr[10] =
+long vb_addr[10] =
 { 0x80140d00, 0x80142700, 0x80143d00, 0x80145100, 0x80148f00,
   0x8014a100, 0x80150000, 0x80140000, 0x80140000, 0x80140000
 };
 
-int vab[10];			/* SE 用 VAB */
+long vab[10];			/* SE 用 VAB */
 unsigned char *buf;
-int cnt;
-int seqno = -1;
+long cnt;
+long seqno = -1;
 
-int seq[4];			/* SEQ data id */
-int sdvab;			/* 常駐 SE.VAB */
+long seq[4];			/* SEQ data id */
+long sdvab;			/* 常駐 SE.VAB */
 
 //CdlFILE vhfile, vbfile;
 
-int SQ[10] = { 0x80155000, 0x8015f000, 0x80168000, 0x8016e000, 0x80175000,
+long SQ[10] = { 0x80155000, 0x8015f000, 0x80168000, 0x8016e000, 0x80175000,
 	       0x80177000, 0xa00d0000, 0xa00e0000, 0x801e0000
 };
 
--- a/sound.h	Sat May 21 20:44:24 2011 +0900
+++ b/sound.h	Thu May 19 18:18:34 2016 +0900
@@ -38,12 +38,12 @@
 extern void TimeSdlMixer(int fleq, int ch, int time);
 //______________________________
 
-extern int se_voice[9];
-extern int vab[10];
-extern int seq[4];
-extern int vb_addr[10];
+extern long se_voice[9];
+extern long vab[10];
+extern long seq[4];
+extern long vb_addr[10];
 
 extern unsigned char *buf;
-extern int vh_addr[10];
+extern long vh_addr[10];
 
 #endif				// _SOUND_H_
--- a/tree_controll.c	Sat May 21 20:44:24 2011 +0900
+++ b/tree_controll.c	Thu May 19 18:18:34 2016 +0900
@@ -222,7 +222,7 @@
       //image = SDL_LoadBMP(node->image_name);
       //image = IMG_Load(node->image_name);
       image = LoadSprite(node);
-      node->texture = (int *)SDL_GL_LoadTexture(image, texcoord);
+      node->texture = SDL_GL_LoadTexture(image, texcoord);
       SDL_FreeSurface(image);
     }
 }
--- a/xml.c	Sat May 21 20:44:24 2011 +0900
+++ b/xml.c	Thu May 19 18:18:34 2016 +0900
@@ -35,7 +35,7 @@
     {
 	if (*cont == '-')
 	{
-	    shift = 0.1;
+	    shift = 0;
 	}
 	else if (*cont >= '0' && *cont <= '9')
 	{