[Plib-cvs] plib/demos/ttt3d/src cell.cxx,1.1,1.2 game.cxx,1.2,1.3 gfx.cxx,1.2,1.3 material.cxx,1.1,1
Brought to you by:
sjbaker
Update of /cvsroot/plib/plib/demos/ttt3d/src In directory usw-pr-cvs1:/tmp/cvs-serv21543 Modified Files: cell.cxx game.cxx gfx.cxx material.cxx material.h p3d.h sound.cxx sound.h status.cxx status.h ttt3d.cxx Log Message: Solved some compiler warnings; Cleanups Index: cell.cxx =================================================================== RCS file: /cvsroot/plib/plib/demos/ttt3d/src/cell.cxx,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- cell.cxx 20 Jun 2001 05:40:10 -0000 1.1 +++ cell.cxx 10 Jun 2002 22:13:30 -0000 1.2 @@ -2,9 +2,9 @@ #include "p3d.h" #include <plib/ssgAux.h> -ssgBranch *wire_cube = NULL ; -ssgBranch * X_cube = NULL ; -ssgBranch * O_cube = NULL ; +static ssgBranch *wire_cube = NULL ; +static ssgBranch * X_cube = NULL ; +static ssgBranch * O_cube = NULL ; ssgTransform *makeGround () @@ -163,7 +163,7 @@ } -void makeWireCube() +static void makeWireCube() { wire_cube = new ssgBranch () ; @@ -204,7 +204,7 @@ } -ssgBranch *X () +static ssgBranch *X () { ssgaCube *XXX = new ssgaCube () ; @@ -215,7 +215,7 @@ } -ssgBranch *O () +static ssgBranch *O () { ssgaSphere *OOO = new ssgaSphere ( 300 ) ; @@ -226,14 +226,14 @@ } -void makeXcube () +static void makeXcube () { X_cube = new ssgBranch () ; X_cube -> addKid ( X () ) ; } -void makeOcube () +static void makeOcube () { O_cube = new ssgBranch () ; O_cube -> addKid ( O () ) ; Index: game.cxx =================================================================== RCS file: /cvsroot/plib/plib/demos/ttt3d/src/game.cxx,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- game.cxx 21 Jun 2001 02:02:04 -0000 1.2 +++ game.cxx 10 Jun 2002 22:13:31 -0000 1.3 @@ -4,19 +4,19 @@ #include <ctype.h> #include "game.h" -char board [4][4][4] ; -int last_x = -1 ; -int last_y = -1 ; -int last_z = -1 ; +static char board [4][4][4] ; +static int last_x = -1 ; +static int last_y = -1 ; +static int last_z = -1 ; #define NUM_ROWS ( 3 * 16 + 3 * 8 + 4 ) -char *row [ NUM_ROWS ][ 4 ] ; -char rowptr [ 4 ][ 4 ][ 4 ][ 8 ] ; -char rowptrctr [ 4 ][ 4 ][ 4 ] ; +static char *row [ NUM_ROWS ][ 4 ] ; +static char rowptr [ 4 ][ 4 ][ 4 ][ 8 ] ; +static char rowptrctr [ 4 ][ 4 ][ 4 ] ; -void setupRowArray () +static void setupRowArray () { int x, y, z; @@ -184,7 +184,7 @@ } -void clearBoard () +static void clearBoard () { for ( int x = 0 ; x < 4 ; x++ ) for ( int y = 0 ; y < 4 ; y++ ) @@ -193,7 +193,7 @@ } -void printBoard ( int winrow ) +/*void printBoard ( int winrow ) { int x, y, z; @@ -275,11 +275,11 @@ printf ( "\n" ) ; printf ( "\n" ) ; -} +}*/ -int value [4][4] = /* Value of 1000000 means play here to win. */ +static int value [4][4] = /* Value of 1000000 means play here to win. */ { { 1, 3,10, 1000000 }, /* No enemy, 0,1,2,3 of ours */ { 2, 0, 0, 0 }, /* One enemy, 0,1,2,3 of ours */ @@ -292,7 +292,7 @@ static int win = STILL_PLAYING ; -int countRow ( int r ) +static int countRow ( int r ) { int x = 0 ; int o = 0 ; @@ -318,7 +318,7 @@ -int getLoc ( char *msg ) +/*int getLoc ( char *msg ) { while ( 1 ) @@ -348,7 +348,7 @@ else printf ( "Please type a NUMBER in the range 0 to 63.\n" ) ; } -} +}*/ Index: gfx.cxx =================================================================== RCS file: /cvsroot/plib/plib/demos/ttt3d/src/gfx.cxx,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- gfx.cxx 20 Jun 2001 06:11:48 -0000 1.2 +++ gfx.cxx 10 Jun 2002 22:13:31 -0000 1.3 @@ -20,12 +20,12 @@ return k ; } -void reshape ( int w, int h ) +static void reshape ( int w, int h ) { glViewport ( 0, 0, w, h ) ; } -void initWindow ( int w, int h ) +static void initWindow ( int w, int h ) { int fake_argc = 1 ; char *fake_argv[3] ; Index: material.cxx =================================================================== RCS file: /cvsroot/plib/plib/demos/ttt3d/src/material.cxx,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- material.cxx 20 Jun 2001 05:40:10 -0000 1.1 +++ material.cxx 10 Jun 2002 22:13:31 -0000 1.2 @@ -3,7 +3,7 @@ ssgSimpleState *default_gst, *O_gst, *X_gst, *ground_gst, *ctrls_gst ; -Material gs_setup [] = +static Material gs_setup [] = { /* gst texture_map clamp, trans,aref,light,frctn,0 */ { &default_gst, "", FALSE, TRUE , 0.0, FALSE, 1.0, 0 }, @@ -61,7 +61,7 @@ -ssgState *getAppState ( char *fname ) +static ssgState *getAppState ( char *fname ) { if ( fname == NULL || fname[0] == '\0' ) return gs_setup [ 0 ] . getState() ; @@ -139,7 +139,7 @@ } -Material *getMaterial ( ssgState *s ) +/*Material *getMaterial ( ssgState *s ) { return & ( gs_setup [ s -> getExternalPropertyIndex () ] ) ; } @@ -148,5 +148,5 @@ Material *getMaterial ( ssgLeaf *l ) { return getMaterial ( l -> getState () ) ; -} +}*/ Index: material.h =================================================================== RCS file: /cvsroot/plib/plib/demos/ttt3d/src/material.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- material.h 20 Jun 2001 05:40:10 -0000 1.1 +++ material.h 10 Jun 2002 22:13:31 -0000 1.2 @@ -21,8 +21,8 @@ void initMaterials () ; -Material *getMaterial ( ssgState *s ) ; -Material *getMaterial ( ssgLeaf *l ) ; +/*Material *getMaterial ( ssgState *s ) ; +Material *getMaterial ( ssgLeaf *l ) ;*/ extern ssgSimpleState *default_gst, *O_gst, *X_gst, *ground_gst, *ctrls_gst ; Index: p3d.h =================================================================== RCS file: /cvsroot/plib/plib/demos/ttt3d/src/p3d.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- p3d.h 20 Jun 2001 05:40:10 -0000 1.1 +++ p3d.h 10 Jun 2002 22:13:31 -0000 1.2 @@ -43,7 +43,7 @@ extern int game_state ; extern ssgRoot *scene ; -extern char *ttt3d_datadir ; +//extern const char *ttt3d_datadir ; void startLevel () ; void makeMove () ; Index: sound.cxx =================================================================== RCS file: /cvsroot/plib/plib/demos/ttt3d/src/sound.cxx,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- sound.cxx 20 Jun 2001 05:40:10 -0000 1.1 +++ sound.cxx 10 Jun 2002 22:13:31 -0000 1.2 @@ -3,7 +3,7 @@ struct Sound { - char *fname ; + const char *fname ; slSample *s ; } ; @@ -33,7 +33,7 @@ } -void SoundSystem::change_track ( char *fname ) +void SoundSystem::change_track ( const char *fname ) { if ( fname == NULL ) fname = "" ; Index: sound.h =================================================================== RCS file: /cvsroot/plib/plib/demos/ttt3d/src/sound.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- sound.h 20 Jun 2001 05:40:10 -0000 1.1 +++ sound.h 10 Jun 2002 22:13:31 -0000 1.2 @@ -23,7 +23,7 @@ sched -> setSafetyMargin ( t ) ; } - void change_track ( char *fname ) ; + void change_track ( const char *fname ) ; void disable_music () ; void enable_music () ; Index: status.cxx =================================================================== RCS file: /cvsroot/plib/plib/demos/ttt3d/src/status.cxx,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- status.cxx 28 Dec 2001 23:15:19 -0000 1.2 +++ status.cxx 10 Jun 2002 22:13:31 -0000 1.3 @@ -10,13 +10,13 @@ #define MAX_STRING 30 #define MAX_STRING_LENGTH 256 -int displayed_score = 0 ; +static int displayed_score = 0 ; static fntRenderer *text = NULL ; char debug_strings [ MAX_STRING ][ MAX_STRING_LENGTH ] ; -int next_string = 0 ; -int stats_enabled = FALSE ; [...127 lines suppressed...] static int timer = 0 ; @@ -255,7 +255,7 @@ } -void drawGameIntroText () +static void drawGameIntroText () { static int timer = 0 ; @@ -279,7 +279,7 @@ } -void drawGameRunningText ( int score ) +static void drawGameRunningText ( int score ) { displayed_score = score ; drawInGameScore () ; Index: status.h =================================================================== RCS file: /cvsroot/plib/plib/demos/ttt3d/src/status.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- status.h 20 Jun 2001 05:40:10 -0000 1.1 +++ status.h 10 Jun 2002 22:13:31 -0000 1.2 @@ -1,17 +1,17 @@ void drawStatusText ( int score ) ; -void stPrintf ( char *fmt, ... ) ; -void stToggle () ; +/*void stPrintf ( char *fmt, ... ) ; +void stToggle () ;*/ -void memorial () ; +//void memorial () ; void about () ; void credits () ; void versions () ; void help () ; void hide_status () ; -double read_time_of_day () ; +/*double read_time_of_day () ; void start_stopwatch () ; -extern int time_out ; +extern int time_out ;*/ Index: ttt3d.cxx =================================================================== RCS file: /cvsroot/plib/plib/demos/ttt3d/src/ttt3d.cxx,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- ttt3d.cxx 21 Jun 2001 02:02:04 -0000 1.2 +++ ttt3d.cxx 10 Jun 2002 22:13:31 -0000 1.3 @@ -11,17 +11,17 @@ # define F_OK 04 #endif -char *ttt3d_datadir = NULL ; +static const char *ttt3d_datadir = NULL ; GFX *gfx = NULL ; GUI *gui = NULL ; SoundSystem *sound = NULL ; ssgRoot *scene = NULL ; -ssgTransform *spin = NULL ; +static ssgTransform *spin = NULL ; Puzzle *puzzle = NULL ; -float spin_rot = 0.0f ; -float spin_alt = 0.0f ; -float spin_pit = 0.0f ; -float zoom = 60.0f ; +static float spin_rot = 0.0f ; +static float spin_alt = 0.0f ; +static float spin_pit = 0.0f ; +static float zoom = 60.0f ; int game_state = GAME_START_OF_DAY ; Level level ; @@ -133,7 +133,7 @@ -void spinPuzzle () +static void spinPuzzle () { sgMat4 rot, pit, final ; |