plib-cvs Mailing List for PLIB (Page 25)
Brought to you by:
sjbaker
You can subscribe to this list here.
2002 |
Jan
(25) |
Feb
(10) |
Mar
(60) |
Apr
(49) |
May
(54) |
Jun
(94) |
Jul
(82) |
Aug
(251) |
Sep
(366) |
Oct
(17) |
Nov
(20) |
Dec
(14) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(12) |
Feb
(8) |
Mar
(2) |
Apr
(4) |
May
(5) |
Jun
(8) |
Jul
(23) |
Aug
(8) |
Sep
(7) |
Oct
(5) |
Nov
(20) |
Dec
(20) |
2004 |
Jan
(19) |
Feb
(70) |
Mar
(108) |
Apr
(24) |
May
(6) |
Jun
(5) |
Jul
|
Aug
(8) |
Sep
(18) |
Oct
(27) |
Nov
|
Dec
(13) |
2005 |
Jan
(19) |
Feb
(13) |
Mar
(1) |
Apr
|
May
(10) |
Jun
(1) |
Jul
(10) |
Aug
(5) |
Sep
(2) |
Oct
(2) |
Nov
(6) |
Dec
(4) |
2006 |
Jan
(9) |
Feb
|
Mar
(3) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Sebastian U. <ud...@us...> - 2002-09-15 02:31:52
|
Update of /cvsroot/plib/plib/demos/simon/astropong In directory usw-pr-cvs1:/tmp/cvs-serv8527 Modified Files: astropong.psl Log Message: Added copyright notices and copying permission statement Index: astropong.psl =================================================================== RCS file: /cvsroot/plib/plib/demos/simon/astropong/astropong.psl,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- astropong.psl 15 Sep 2002 00:02:51 -0000 1.1 +++ astropong.psl 15 Sep 2002 02:31:49 -0000 1.2 @@ -1,3 +1,26 @@ +/* + AstroPong - A 3D Pong Game + Copyright (C) 2002 Oliver Baker + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + For further information visit http://plib.sourceforge.net + + $Id$ +*/ + #define ARENA_SIZE 8.0 /* meters */ #define ARENA_LENGTH 10.0 /* meters */ |
From: Sebastian U. <ud...@us...> - 2002-09-15 01:59:27
|
Update of /cvsroot/plib/plib/demos/simon/src In directory usw-pr-cvs1:/tmp/cvs-serv31905 Modified Files: simon_api.cxx simon.cxx simon.h Log Message: Added copyright notices and copying permission statement Index: simon_api.cxx =================================================================== RCS file: /cvsroot/plib/plib/demos/simon/src/simon_api.cxx,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- simon_api.cxx 15 Sep 2002 01:44:46 -0000 1.2 +++ simon_api.cxx 15 Sep 2002 01:59:23 -0000 1.3 @@ -1,3 +1,26 @@ +/* + PLIB - A Suite of Portable Game Libraries + Copyright (C) 2002 Steve Baker + + This library is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + For further information visit http://plib.sourceforge.net + + $Id$ +*/ + #include "simon.h" #include <plib/js.h> Index: simon.cxx =================================================================== RCS file: /cvsroot/plib/plib/demos/simon/src/simon.cxx,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- simon.cxx 15 Sep 2002 00:02:51 -0000 1.3 +++ simon.cxx 15 Sep 2002 01:59:23 -0000 1.4 @@ -1,3 +1,26 @@ +/* + PLIB - A Suite of Portable Game Libraries + Copyright (C) 2002 Steve Baker + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + For further information visit http://plib.sourceforge.net + + $Id$ +*/ + #include <simon.h> #include <plib/psl.h> Index: simon.h =================================================================== RCS file: /cvsroot/plib/plib/demos/simon/src/simon.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- simon.h 15 Sep 2002 01:44:46 -0000 1.2 +++ simon.h 15 Sep 2002 01:59:23 -0000 1.3 @@ -1,11 +1,35 @@ +/* + PLIB - A Suite of Portable Game Libraries + Copyright (C) 2002 Steve Baker + + This library is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + For further information visit http://plib.sourceforge.net + + $Id$ +*/ + + #include <stdio.h> #include <stdlib.h> #include <ctype.h> #include <string.h> #ifdef WIN32 -#include <windows.h> +# include <windows.h> #else -#include <unistd.h> +# include <unistd.h> #endif #include <math.h> #include <plib/ssg.h> |
From: Sebastian U. <ud...@us...> - 2002-09-15 01:46:36
|
Update of /cvsroot/plib/plib/demos/simon/src In directory usw-pr-cvs1:/tmp/cvs-serv28823 Modified Files: Makefile Log Message: Ooops ... Index: Makefile =================================================================== RCS file: /cvsroot/plib/plib/demos/simon/src/Makefile,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- Makefile 15 Sep 2002 01:44:46 -0000 1.3 +++ Makefile 15 Sep 2002 01:46:33 -0000 1.4 @@ -1,17 +1,17 @@ SIMON = libsimon.a simon -LIBS = -L/usr/X11R6/lib -lplibpsl -lplibssg -lplibsg -lplibul -lglut -lGLU -lGL -lpthread -lX11 -lm +LIBS = -lplibpsl -lplibssg -lplibsg -lplibul -lglut -lGLU -lGL -lpthread -L/usr/X11/lib -lX11 -lm all: ${SIMON} -simon : libsimon.a simon.o +simon : libsimon.a simon.o /usr/lib/libplibpsl.a g++ -o simon simon.o libsimon.a ${LIBS} simon.o : simon.cxx simon.h - g++ -I/usr/X11R6/include -I. -o simon.o -c simon.cxx + g++ -I. -o simon.o -c simon.cxx simon_api.o : simon_api.cxx simon.h - g++ -I/usr/X11R6/include -o simon_api.o -c simon_api.cxx + g++ -o simon_api.o -c simon_api.cxx libsimon.a : simon_api.o ar cru libsimon.a simon_api.o |
From: Sebastian U. <ud...@us...> - 2002-09-15 01:44:49
|
Update of /cvsroot/plib/plib/demos/simon/src In directory usw-pr-cvs1:/tmp/cvs-serv28307 Modified Files: Makefile simon.h simon_api.cxx Log Message: Const-correctness; Global namespace pollution Index: Makefile =================================================================== RCS file: /cvsroot/plib/plib/demos/simon/src/Makefile,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Makefile 14 Sep 2002 20:52:42 -0000 1.2 +++ Makefile 15 Sep 2002 01:44:46 -0000 1.3 @@ -1,17 +1,17 @@ SIMON = libsimon.a simon -LIBS = -lplibpsl -lplibssg -lplibsg -lplibul -lglut -lGLU -lGL -lpthread -L/usr/X11/lib -lX11 -lm +LIBS = -L/usr/X11R6/lib -lplibpsl -lplibssg -lplibsg -lplibul -lglut -lGLU -lGL -lpthread -lX11 -lm all: ${SIMON} -simon : libsimon.a simon.o /usr/lib/libplibpsl.a +simon : libsimon.a simon.o g++ -o simon simon.o libsimon.a ${LIBS} simon.o : simon.cxx simon.h - g++ -I. -o simon.o -c simon.cxx + g++ -I/usr/X11R6/include -I. -o simon.o -c simon.cxx simon_api.o : simon_api.cxx simon.h - g++ -o simon_api.o -c simon_api.cxx + g++ -I/usr/X11R6/include -o simon_api.o -c simon_api.cxx libsimon.a : simon_api.o ar cru libsimon.a simon_api.o Index: simon.h =================================================================== RCS file: /cvsroot/plib/plib/demos/simon/src/simon.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- simon.h 14 Sep 2002 19:50:29 -0000 1.1 +++ simon.h 15 Sep 2002 01:44:46 -0000 1.2 @@ -15,7 +15,7 @@ void siUpdate () ; void siRun () ; -int siLoad ( char *filename ) ; +int siLoad ( const char *filename ) ; void siPosition ( int hh, float x, float y, float z = 0.0f, float h = 0.0f, Index: simon_api.cxx =================================================================== RCS file: /cvsroot/plib/plib/demos/simon/src/simon_api.cxx,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- simon_api.cxx 14 Sep 2002 20:52:42 -0000 1.1 +++ simon_api.cxx 15 Sep 2002 01:44:46 -0000 1.2 @@ -20,7 +20,7 @@ public: - siEntity ( char *_fname ) + siEntity ( const char *_fname ) { siModels [ siNextModel ] = this ; @@ -32,20 +32,19 @@ exit ( 1 ) ; } - name = new char [ strlen(_fname)+1 ] ; - strcpy ( name, _fname ) ; + name = ulStrDup ( _fname ) ; sgZeroCoord ( & pos ) ; sgZeroCoord ( & vel ) ; } - int getHandle () { return handle ; } + int getHandle () const { return handle ; } - float getPositionX () { return pos.xyz[0] ; } - float getPositionY () { return pos.xyz[1] ; } - float getPositionZ () { return pos.xyz[2] ; } - float getPositionH () { return pos.hpr[0] ; } - float getPositionP () { return pos.hpr[1] ; } - float getPositionR () { return pos.hpr[2] ; } + float getPositionX () const { return pos.xyz[0] ; } + float getPositionY () const { return pos.xyz[1] ; } + float getPositionZ () const { return pos.xyz[2] ; } + float getPositionH () const { return pos.hpr[0] ; } + float getPositionP () const { return pos.hpr[1] ; } + float getPositionR () const { return pos.hpr[2] ; } void setSpeedAndDirection ( float s, float h, float p ) { @@ -103,7 +102,7 @@ public: - siModel ( char *_fname ) : siEntity ( _fname ) + siModel ( const char *_fname ) : siEntity ( _fname ) { tra = new ssgTransform ; ent = ssgLoad ( name ) ; @@ -123,7 +122,7 @@ } ; -siEntity *getModel ( int i ) +static siEntity *getModel ( int i ) { if ( i < 0 || i >= SI_MAX_MODELS || siModels [ i ] == NULL ) @@ -184,12 +183,12 @@ -jsJoystick js (0) ; +static jsJoystick js (0) ; -bool A, B, C, D, L, R ; +static bool A, B, C, D, L, R ; -float leftright ; -float updown ; +static float leftright ; +static float updown ; static void read_joystick () { @@ -320,7 +319,7 @@ /* Load a simple model */ -int siLoad ( char *filename ) +int siLoad ( const char *filename ) { if ( ! siInitialised ) siInit () ; |
From: Sebastian U. <ud...@us...> - 2002-09-15 01:42:58
|
Update of /cvsroot/plib/plib/doc/psl In directory usw-pr-cvs1:/tmp/cvs-serv27795 Modified Files: appl_guide.html Log Message: Updated pslProgram constructor definition in document Index: appl_guide.html =================================================================== RCS file: /cvsroot/plib/plib/doc/psl/appl_guide.html,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- appl_guide.html 13 Sep 2002 23:51:39 -0000 1.5 +++ appl_guide.html 15 Sep 2002 01:42:54 -0000 1.6 @@ -86,9 +86,9 @@ { public: - pslProgram ( pslExtension *extns, const char *name ) ; + pslProgram ( const pslExtension *extns, const char *name ) ; - pslProgram ( pslProgram *prog, const char *name ) ; + pslProgram ( pslProgram *prog, const char *name ) ; void setUserData ( void *data ) ; |
From: Sebastian U. <ud...@us...> - 2002-09-15 01:34:27
|
Update of /cvsroot/plib/plib/src/psl In directory usw-pr-cvs1:/tmp/cvs-serv25781 Modified Files: psl.h pslCompiler.h pslContext.h pslProgram.cxx Log Message: Const-correctness Index: psl.h =================================================================== RCS file: /cvsroot/plib/plib/src/psl/psl.h,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- psl.h 14 Sep 2002 15:47:33 -0000 1.16 +++ psl.h 15 Sep 2002 01:34:24 -0000 1.17 @@ -219,10 +219,10 @@ class pslProgram { - pslOpcode *code ; - pslContext *context ; - pslCompiler *compiler ; - pslExtension *extensions ; + pslOpcode *code ; + pslContext *context ; + pslCompiler *compiler ; + const pslExtension *extensions ; void *userData ; @@ -230,15 +230,15 @@ public: - pslProgram ( pslExtension *ext, const char *_progName = NULL ) ; + pslProgram ( const pslExtension *ext, const char *_progName = NULL ) ; pslProgram ( pslProgram *src, const char *_progName = NULL ) ; ~pslProgram () ; - pslContext *getContext () const { return context ; } - pslOpcode *getCode () const { return code ; } - pslCompiler *getCompiler () const { return compiler ; } - pslExtension *getExtensions () const { return extensions ; } + pslContext *getContext () const { return context ; } + pslOpcode *getCode () const { return code ; } + pslCompiler *getCompiler () const { return compiler ; } + const pslExtension *getExtensions () const { return extensions ; } char *getProgName () const { return progName ; } Index: pslCompiler.h =================================================================== RCS file: /cvsroot/plib/plib/src/psl/pslCompiler.h,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- pslCompiler.h 15 Sep 2002 00:02:51 -0000 1.24 +++ pslCompiler.h 15 Sep 2002 01:34:24 -0000 1.25 @@ -203,7 +203,7 @@ int getExtensionSymbol ( const char *s ) const ; - pslExtension *extensions ; + const pslExtension *extensions ; /* Forward references to code symbols that are not yet defined */ @@ -289,7 +289,7 @@ pslCompiler ( pslProgram *prog, pslOpcode *_code, - pslExtension *_extn, + const pslExtension *_extn, const char *_progName ) { program = prog ; @@ -322,7 +322,7 @@ } } - pslExtension *getExtensions () const { return extensions ; } + const pslExtension *getExtensions () const { return extensions ; } int printInstruction ( FILE *fd, int addr ) const ; Index: pslContext.h =================================================================== RCS file: /cvsroot/plib/plib/src/psl/pslContext.h,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- pslContext.h 13 Sep 2002 17:37:27 -0000 1.8 +++ pslContext.h 15 Sep 2002 01:34:24 -0000 1.9 @@ -24,9 +24,9 @@ class pslContext { - pslOpcode *code ; - pslExtension *extensions ; - pslProgram *program ; + pslOpcode *code ; + const pslExtension *extensions ; + pslProgram *program ; pslVariable variable [ MAX_VARIABLE ] ; pslValue stack [ MAX_STACK ] ; Index: pslProgram.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/psl/pslProgram.cxx,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- pslProgram.cxx 13 Sep 2002 22:32:15 -0000 1.10 +++ pslProgram.cxx 15 Sep 2002 01:34:24 -0000 1.11 @@ -24,7 +24,7 @@ #include "pslLocal.h" -pslProgram::pslProgram ( pslExtension *ext, const char *_prgnm ) +pslProgram::pslProgram ( const pslExtension *ext, const char *_prgnm ) { if ( ! _pslInitialised ) ulSetError ( UL_FATAL, |
From: Sebastian U. <ud...@us...> - 2002-09-15 01:29:15
|
Update of /cvsroot/plib/plib/src/ssg In directory usw-pr-cvs1:/tmp/cvs-serv24925 Modified Files: ssg.h ssgBase.cxx ssgIO.cxx ssgLoad.cxx ssgLoadAC.cxx ssgLoadASE.cxx ssgLoadATG.cxx ssgLoadDXF.cxx ssgLoadIV.cxx ssgLoadOBJ.cxx ssgLoadVRML1.cxx ssgLoaderWriterStuff.cxx ssgSave3ds.cxx Log Message: Replaced some instances of 'new' + strcpy () with ulStrDup () Index: ssg.h =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssg.h,v retrieving revision 1.148 retrieving revision 1.149 diff -u -d -r1.148 -r1.149 --- ssg.h 9 Sep 2002 09:08:29 -0000 1.148 +++ ssg.h 15 Sep 2002 01:29:11 -0000 1.149 @@ -728,10 +728,7 @@ if ( fname == NULL ) filename = NULL ; else - { - filename = new char [ strlen(fname)+1 ] ; - strcpy ( filename, fname ) ; - } + filename = ulStrDup ( fname ) ; } virtual void print ( FILE *fd = stderr, char *indent = "", int how_much = 2 ) ; Index: ssgBase.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgBase.cxx,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- ssgBase.cxx 2 Sep 2002 06:05:47 -0000 1.20 +++ ssgBase.cxx 15 Sep 2002 01:29:11 -0000 1.21 @@ -95,10 +95,7 @@ if ( nm == NULL ) name = NULL ; else - { - name = new char [ strlen ( nm ) + 1 ] ; - strcpy ( name, nm ) ; - } + name = ulStrDup ( nm ) ; } void ssgBase::zeroSpareRecursive (){ zeroSpare () ; } Index: ssgIO.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgIO.cxx,v retrieving revision 1.37 retrieving revision 1.38 diff -u -d -r1.37 -r1.38 --- ssgIO.cxx 2 Sep 2002 06:05:48 -0000 1.37 +++ ssgIO.cxx 15 Sep 2002 01:29:11 -0000 1.38 @@ -217,10 +217,7 @@ if ( s[0] == '\0' ) *var = NULL ; else - { - *var = new char [ strlen(s)+1 ] ; - strcpy ( *var, s ) ; - } + *var = ulStrDup ( s ) ; } Index: ssgLoad.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgLoad.cxx,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- ssgLoad.cxx 2 Sep 2002 06:05:48 -0000 1.24 +++ ssgLoad.cxx 15 Sep 2002 01:29:11 -0000 1.25 @@ -137,15 +137,13 @@ void ssgLoaderOptions::setModelDir ( const char *s ) { delete [] model_dir ; - model_dir = new char [ strlen ( s ) + 1 ] ; - strcpy ( model_dir, s ) ; + model_dir = ulStrDup ( s ) ; } void ssgLoaderOptions::setTextureDir ( const char *s ) { delete [] texture_dir ; - texture_dir = new char [ strlen ( s ) + 1 ] ; - strcpy ( texture_dir, s ) ; + texture_dir = ulStrDup ( s ) ; } Index: ssgLoadAC.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgLoadAC.cxx,v retrieving revision 1.29 retrieving revision 1.30 diff -u -d -r1.29 -r1.30 --- ssgLoadAC.cxx 2 Sep 2002 06:05:48 -0000 1.29 +++ ssgLoadAC.cxx 15 Sep 2002 01:29:11 -0000 1.30 @@ -382,10 +382,7 @@ if ( s == NULL || s[0] == '\0' ) current_tfname = NULL ; else - { - current_tfname = new char [ strlen(s)+1 ] ; - strcpy ( current_tfname, s ) ; - } + current_tfname = ulStrDup ( s ) ; return PARSE_CONT ; } Index: ssgLoadASE.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgLoadASE.cxx,v retrieving revision 1.44 retrieving revision 1.45 diff -u -d -r1.44 -r1.45 --- ssgLoadASE.cxx 2 Sep 2002 06:05:48 -0000 1.44 +++ ssgLoadASE.cxx 15 Sep 2002 01:29:11 -0000 1.45 @@ -361,16 +361,15 @@ char* fname; if (! parser.parseString(fname, "bitmap filename") ) return FALSE; - + //strip existing directory from fname char* slash = strrchr ( fname, '/' ) ; if ( !slash ) slash = strrchr ( fname, '\\' ) ; //for dos if ( slash ) fname = slash + 1 ; - - mat->tfname = new char [ strlen(fname)+1 ] ; - strcpy ( mat->tfname, fname ) ; + + mat->tfname = ulStrDup ( fname ) ; } } else if (!strcmp(token,"*UVW_U_TILING")) @@ -438,14 +437,10 @@ char buff [ 256 ] ; sprintf( buff, "%s, sub#%d", mat_name, sub_index ); - mat->name = new char [ strlen(buff)+1 ] ; - strcpy ( mat->name, buff ) ; + mat->name = ulStrDup ( buff ) ; } else - { - mat->name = new char [ strlen(name)+1 ] ; - strcpy ( mat->name, name ) ; - } + mat->name = ulStrDup ( name ) ; } else if (!strcmp(token,"*MATERIAL_AMBIENT")) { @@ -1250,8 +1245,7 @@ return FALSE; - obj->name = new char [ strlen(name)+1 ] ; - strcpy ( obj->name, name ) ; + obj->name = ulStrDup ( name ) ; } } else if (!strcmp(token,"*NODE_PARENT")) @@ -1263,8 +1257,7 @@ return FALSE; - obj->parent = new char [ strlen(name)+1 ] ; - strcpy ( obj->parent, name ) ; + obj->parent = ulStrDup ( name ) ; } } else if (!strcmp(token,"*NODE_TM")) Index: ssgLoadATG.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgLoadATG.cxx,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- ssgLoadATG.cxx 2 Sep 2002 06:05:48 -0000 1.17 +++ ssgLoadATG.cxx 15 Sep 2002 01:29:11 -0000 1.18 @@ -155,8 +155,7 @@ { if ( _current_usemtl != NULL ) delete [] _current_usemtl ; - _current_usemtl = new char [ strlen ( usemtl ) + 1 ] ; - strcpy ( _current_usemtl, usemtl ) ; + _current_usemtl = ulStrDup ( usemtl ) ; } } //# gbs -2710586.16105 -4275323.15743 3867065.62925 7623.60 @@ -298,8 +297,7 @@ // bring _last_usemtl up to date if ( _last_usemtl != NULL ) delete [] _last_usemtl; - _last_usemtl= new char [ strlen ( _current_usemtl ) + 1 ] ; - strcpy ( _last_usemtl, _current_usemtl ) ; + _last_usemtl= ulStrDup ( _current_usemtl ) ; // create SimpleState Index: ssgLoadDXF.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgLoadDXF.cxx,v retrieving revision 1.26 retrieving revision 1.27 diff -u -d -r1.26 -r1.27 --- ssgLoadDXF.cxx 2 Sep 2002 06:05:48 -0000 1.26 +++ ssgLoadDXF.cxx 15 Sep 2002 01:29:11 -0000 1.27 @@ -777,14 +777,11 @@ if ( ent_type == ENT_INSERT || current_block != NULL ) { - if ( ent_type == ENT_INSERT && block_name == NULL ) { - block_name = new char[ strlen(input2)+1 ] ; - strcpy ( block_name, input2 ) ; - } + if ( ent_type == ENT_INSERT && block_name == NULL ) + block_name = ulStrDup ( input2 ) ; if ( current_block != NULL && current_block->getName() == NULL ) { - char* name = new char[ strlen(input2)+1 ] ; - strcpy ( name, input2 ) ; + char* name = ulStrDup ( input2 ) ; current_block->setName( name ) ; } } Index: ssgLoadIV.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgLoadIV.cxx,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- ssgLoadIV.cxx 2 Sep 2002 06:05:48 -0000 1.10 +++ ssgLoadIV.cxx 15 Sep 2002 01:29:12 -0000 1.11 @@ -344,8 +344,7 @@ vrmlParser.expectNextToken("filename"); if( !vrmlParser.getNextString( token, NULL ) ) return FALSE; - fileName = new char[ strlen( token ) + 1 ]; - strcpy( fileName, token ); + fileName = ulStrDup ( token ) ; } else if( !strcmp( token, "wrapS") ) { Index: ssgLoadOBJ.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgLoadOBJ.cxx,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- ssgLoadOBJ.cxx 2 Sep 2002 06:05:48 -0000 1.22 +++ ssgLoadOBJ.cxx 15 Sep 2002 01:29:12 -0000 1.23 @@ -241,8 +241,7 @@ if ( count == 1 ) { index ++ ; memset( &materials[ index ], 0, sizeof(matData) ) ; - materials[ index ].name = new char [ strlen ( name ) + 1 ] ; - strcpy ( materials[ index ].name, name ) ; + materials[ index ].name = ulStrDup ( name ) ; materials[ index ].amb[3] = 1.0f ; materials[ index ].diff[3] = 1.0f ; materials[ index ].spec[3] = 1.0f ; @@ -285,10 +284,8 @@ char tfname[MAX_LINE_LEN]; count = sscanf ( next, "%s%n", tfname, &width ) ; - if ( count == 1 && index >= 0 ) { - materials[ index ].tfname = new char [ strlen( tfname )+1 ] ; - strcpy ( materials[ index ].tfname, tfname ) ; - } + if ( count == 1 && index >= 0 ) + materials[ index ].tfname = ulStrDup ( tfname ) ; } } Index: ssgLoadVRML1.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgLoadVRML1.cxx,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- ssgLoadVRML1.cxx 2 Sep 2002 06:05:48 -0000 1.10 +++ ssgLoadVRML1.cxx 15 Sep 2002 01:29:12 -0000 1.11 @@ -236,8 +236,7 @@ ulSetError(UL_DEBUG, "DEF: Found an object definition %s.", token); if( childDefName != NULL ) delete [] childDefName; - childDefName = new char[ strlen( token ) + 1]; - strcpy( childDefName, token ); + childDefName = ulStrDup ( token ) ; } else if( !strcmp( token, "USE" ) ) { Index: ssgLoaderWriterStuff.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgLoaderWriterStuff.cxx,v retrieving revision 1.28 retrieving revision 1.29 diff -u -d -r1.28 -r1.29 --- ssgLoaderWriterStuff.cxx 9 Sep 2002 09:01:18 -0000 1.28 +++ ssgLoaderWriterStuff.cxx 15 Sep 2002 01:29:12 -0000 1.29 @@ -677,10 +677,7 @@ if ( !meshName ) name = NULL; else - { - name = new char [ strlen(meshName) + 1 ]; - strcpy(name, meshName); - } + name = ulStrDup(meshName); } Index: ssgSave3ds.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgSave3ds.cxx,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- ssgSave3ds.cxx 2 Sep 2002 06:05:48 -0000 1.7 +++ ssgSave3ds.cxx 15 Sep 2002 01:29:12 -0000 1.8 @@ -260,8 +260,7 @@ static _ssgSave3dsChunk* create_facemat_chunk( ssgLeaf* leaf ) { char* matname = get_material_name( (ssgSimpleState*)leaf->getState() ); - char* namecopy = new char[ strlen(matname)+1 ]; - strcpy(namecopy, matname); + char* namecopy = ulStrDup ( matname ) ; _ssgSave3dsData* namedata = new _ssgSave3dsData(namecopy, 1, strlen(matname) + 1); @@ -361,8 +360,7 @@ _ssgSave3dsChunk* objs = new _ssgSave3dsChunk(CHUNK_OBJBLOCK); static const char const_objname[] = "Object written by ssgSave3ds"; - char *objname = new char[ strlen(const_objname) + 1 ]; - strcpy(objname, const_objname); + char *objname = ulStrDup ( const_objname ) ; objs->addData( new _ssgSave3dsData(objname, 1, strlen(objname)+1) ); parent->addKid(objs); @@ -411,8 +409,7 @@ _ssgSave3dsChunk *map_chunk = new _ssgSave3dsChunk(CHUNK_TEXTURE); _ssgSave3dsChunk *mapname_chunk = new _ssgSave3dsChunk(CHUNK_MAPFILENAME); - char *mapname = new char[ strlen(state->getTextureFilename()) + 1 ]; - strcpy(mapname, state->getTextureFilename()); + char *mapname = ulStrDup(state->getTextureFilename()); mapname_chunk -> addData( new _ssgSave3dsData(mapname, 1, strlen(mapname) + 1) ); map_chunk -> addKid(mapname_chunk); @@ -430,10 +427,9 @@ _ssgSave3dsChunk *matname_chunk = new _ssgSave3dsChunk(CHUNK_MATNAME); char *matname; - if (state->getName() != NULL) { - matname = new char[ strlen(state->getName()) + 1 ]; - strcpy(matname, state->getName()); - } else { + if (state->getName() != NULL) + matname = ulStrDup(state->getName()); + else { matname = new char[16]; sprintf(matname, "Material #%d", mat_count); } |
From: Sebastian U. <ud...@us...> - 2002-09-15 01:05:21
|
Update of /cvsroot/plib/plib/src/psl In directory usw-pr-cvs1:/tmp/cvs-serv20695 Modified Files: pslToken.cxx Log Message: Replaced some instances of 'new' + strcpy () with ulStrDup () Index: pslToken.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/psl/pslToken.cxx,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- pslToken.cxx 14 Sep 2002 04:45:55 -0000 1.19 +++ pslToken.cxx 15 Sep 2002 01:05:18 -0000 1.20 @@ -235,10 +235,8 @@ error ( "Too many #define's\n" ) ; else { - define_token [ next_define ] = new char [ strlen ( token ) + 1 ] ; - define_replacement [ next_define ] = new char [ strlen ( subst ) + 1 ] ; - strcpy ( define_token [ next_define ], token ) ; - strcpy ( define_replacement [ next_define ], subst ) ; + define_token [ next_define ] = ulStrDup ( token ) ; + define_replacement [ next_define ] = ulStrDup ( subst ) ; next_define++ ; } } |
From: Sebastian U. <ud...@us...> - 2002-09-15 01:02:22
|
Update of /cvsroot/plib/plib/src/util In directory usw-pr-cvs1:/tmp/cvs-serv20004 Modified Files: ulRTTI.cxx Log Message: Replaced an instance of 'new' + strcpy () with ulStrDup () Index: ulRTTI.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/util/ulRTTI.cxx,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- ulRTTI.cxx 2 Sep 2002 06:05:49 -0000 1.4 +++ ulRTTI.cxx 15 Sep 2002 01:02:19 -0000 1.5 @@ -36,9 +36,7 @@ void* (*f1)(int,void*),void* (*f2)() ) { /* Create default ulRTTITypeinfo */ - int name_sz = strlen ( name ) + 1 ; - n = new char [ name_sz ] ; - memcpy ( n, name, name_sz ) ; + n = ulStrDup ( name ) ; b = bb ; /* ns = 0 ; subtypes = 0 ; */ |
From: Sebastian U. <ud...@us...> - 2002-09-15 01:00:27
|
Update of /cvsroot/plib/plib/src/pui In directory usw-pr-cvs1:/tmp/cvs-serv19552 Modified Files: pu.cxx pu.h puFilePicker.cxx puLargeInput.cxx Log Message: Replaced some instances of 'new' + strcpy () with ulStrDup () Index: pu.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/pui/pu.cxx,v retrieving revision 1.57 retrieving revision 1.58 diff -u -d -r1.57 -r1.58 --- pu.cxx 2 Sep 2002 06:05:44 -0000 1.57 +++ pu.cxx 15 Sep 2002 01:00:21 -0000 1.58 @@ -477,8 +477,7 @@ void puSetPasteBuffer ( char *ch ) { delete [] input_paste_buffer ; - input_paste_buffer = new char [ strlen(ch) + 1 ] ; - strcpy ( input_paste_buffer, ch ) ; + input_paste_buffer = ulStrDup ( ch ) ; } char *puGetPasteBuffer ( void ) { return input_paste_buffer ; } Index: pu.h =================================================================== RCS file: /cvsroot/plib/plib/src/pui/pu.h,v retrieving revision 1.128 retrieving revision 1.129 diff -u -d -r1.128 -r1.129 --- pu.h 2 Sep 2002 13:47:02 -0000 1.128 +++ pu.h 15 Sep 2002 01:00:23 -0000 1.129 @@ -1543,10 +1543,7 @@ delete [] valid_data ; if ( data != NULL ) - { - valid_data = new char [ strlen ( data ) + 1 ] ; - strcpy ( valid_data, data ) ; - } + valid_data = ulStrDup ( data ) ; else valid_data = NULL ; } Index: puFilePicker.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/pui/puFilePicker.cxx,v retrieving revision 1.29 retrieving revision 1.30 diff -u -d -r1.29 -r1.30 --- puFilePicker.cxx 2 Sep 2002 06:05:45 -0000 1.29 +++ puFilePicker.cxx 15 Sep 2002 01:00:23 -0000 1.30 @@ -526,10 +526,7 @@ strcat ( files [ ifile ], "]" ) ; } else - { - files[ ifile ] = new char[ strlen(dp->d_name)+1 ] ; - strcpy ( files [ ifile ], dp->d_name ) ; - } + files[ ifile ] = ulStrDup ( dp->d_name ) ; } files [ ifile ] = NULL ; Index: puLargeInput.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/pui/puLargeInput.cxx,v retrieving revision 1.38 retrieving revision 1.39 diff -u -d -r1.38 -r1.39 --- puLargeInput.cxx 2 Sep 2002 06:05:45 -0000 1.38 +++ puLargeInput.cxx 15 Sep 2002 01:00:23 -0000 1.39 @@ -747,8 +747,7 @@ // Get the line number and position on the line of the mouse char *strval = bottom_slider ? getText () : getWrappedText () ; - char *tmpval = new char [ strlen(strval) + 1 ] ; - strcpy ( tmpval, strval ) ; + char *tmpval = ulStrDup ( strval ) ; int i = strlen ( tmpval ) ; @@ -821,10 +820,11 @@ select_end_position = select_start_position ; select_start_position = i ; } - } else highlight () ; + + delete [] tmpval ; } else lowlight () ; |
From: Sebastian U. <ud...@us...> - 2002-09-15 00:56:42
|
Update of /cvsroot/plib/plib/src/pui In directory usw-pr-cvs1:/tmp/cvs-serv18867 Modified Files: puValue.cxx Log Message: Made skip_whitespace routine 'static' Index: puValue.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/pui/puValue.cxx,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- puValue.cxx 2 Sep 2002 06:05:46 -0000 1.22 +++ puValue.cxx 15 Sep 2002 00:56:38 -0000 1.23 @@ -27,7 +27,7 @@ UL_RTTI_DEF(puValue) -inline void skip_whitespace ( const char **str ) +static inline void skip_whitespace ( const char **str ) { while ( isspace ( **str ) != 0 ) (*str)++ ; |
From: Sebastian U. <ud...@us...> - 2002-09-15 00:39:06
|
Update of /cvsroot/plib/plib/src/sl In directory usw-pr-cvs1:/tmp/cvs-serv15491 Modified Files: sl.h Log Message: Replaced an instance of new + strcpy () with ulStrDup () Index: sl.h =================================================================== RCS file: /cvsroot/plib/plib/src/sl/sl.h,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- sl.h 2 Sep 2002 06:05:47 -0000 1.16 +++ sl.h 15 Sep 2002 00:39:03 -0000 1.17 @@ -254,8 +254,7 @@ void setComment ( const char *nc ) { delete [] comment ; - comment = new char [ strlen ( nc ) + 1 ] ; - strcpy ( comment, nc ) ; + comment = ulStrDup ( nc ) ; } Uchar *getBuffer () const { return buffer ; } |
From: Steve B. <sj...@us...> - 2002-09-15 00:03:00
|
Update of /cvsroot/plib/plib/demos/simon In directory usw-pr-cvs1:/tmp/cvs-serv7115/plib/demos/simon Modified Files: README Added Files: AUTHORS COPYING Log Message: Added the AstroPong demo. Fixed up a couple of bugs in PSL. --- NEW FILE: AUTHORS --- SIMON was written by Steve Baker. AstroPong was written by Oliver Baker. --- NEW FILE: COPYING --- GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. [...301 lines suppressed...] The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. <signature of Ty Coon>, 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. Index: README =================================================================== RCS file: /cvsroot/plib/plib/demos/simon/README,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- README 14 Sep 2002 19:50:28 -0000 1.1 +++ README 15 Sep 2002 00:02:51 -0000 1.2 @@ -14,6 +14,44 @@ of 3D programming to make it possible for someone with only the very minimum of programming experience to write simple 3D applications. + + +INSTALLATION +============ + Right now, you build SIMON by running 'make' and install it by running 'make install' as root. You must already have PLIB installed. + + + +RUNNING SIMON +============= + +There are two ways to write SIMON programs: + + 1) Write your code in C++ and link it to libsimon + (the LIBRARY version of SIMON). + + 2) Write your code in PSL (The PLIB Scripting Language) + and use the 'simon' program to run it. + +Documentation for both methods are in the 'doc' directory. + + + +DEMO'S +====== + +AstroPong is my son's first ever game (his first ever program actually). +It was originally written in C++ using libsimon - but has subsequently +been converted into PSL for use as a demonstration program. + +Once you've done a 'make install', you can change directory down into +the 'simon' directory and run: + + simon astropong.psl + +...move your paddle using the joystick - don't let the herring +escape from the ice cube! + |
From: Steve B. <sj...@us...> - 2002-09-15 00:03:00
|
Update of /cvsroot/plib/plib/src/psl In directory usw-pr-cvs1:/tmp/cvs-serv7115/plib/src/psl Modified Files: pslCodeGen.cxx pslCompiler.cxx pslCompiler.h pslExpression.cxx pslLocal.h Log Message: Added the AstroPong demo. Fixed up a couple of bugs in PSL. Index: pslCodeGen.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/psl/pslCodeGen.cxx,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- pslCodeGen.cxx 14 Sep 2002 15:47:33 -0000 1.23 +++ pslCodeGen.cxx 15 Sep 2002 00:02:51 -0000 1.24 @@ -27,7 +27,10 @@ void pslCompiler::pushCodeByte ( pslOpcode op ) { - code [ next_code++ ] = op ; + if ( next_code >= MAX_CODE - 1 ) + error ( "Program too big!" ) ; + else + code [ next_code++ ] = op ; } Index: pslCompiler.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/psl/pslCompiler.cxx,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- pslCompiler.cxx 14 Sep 2002 06:12:32 -0000 1.21 +++ pslCompiler.cxx 15 Sep 2002 00:02:51 -0000 1.22 @@ -523,7 +523,6 @@ { ungetToken ( c ) ; ungetToken ( var ) ; - // pushFunctionCall ( var ) ; pushExpression () ; pushPop () ; return TRUE ; Index: pslCompiler.h =================================================================== RCS file: /cvsroot/plib/plib/src/psl/pslCompiler.h,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- pslCompiler.h 14 Sep 2002 06:12:32 -0000 1.23 +++ pslCompiler.h 15 Sep 2002 00:02:51 -0000 1.24 @@ -141,8 +141,9 @@ int pushBitwiseExpression () ; int pushMultExpression () ; int pushAddExpression () ; - int pushRelExpression () ; int pushShiftExpression () ; + int pushRelExpression () ; + int pushBoolExpression () ; int pushExpression () ; /* Statement-level parsers & code generators. */ Index: pslExpression.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/psl/pslExpression.cxx,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- pslExpression.cxx 14 Sep 2002 20:52:42 -0000 1.13 +++ pslExpression.cxx 15 Sep 2002 00:02:51 -0000 1.14 @@ -43,7 +43,7 @@ if ( strcmp ( c, ")" ) != 0 ) { ungetToken ( c ) ; - return error ( "Missing ')' after expression (found '%s')", c ); + return error ( "Missing ')' (found '%s')", c ); } return TRUE ; @@ -331,9 +331,39 @@ } + +int pslCompiler::pushBoolExpression () +{ + if ( ! pushRelExpression () ) + return FALSE ; + + while ( TRUE ) + { + char c [ MAX_TOKEN ] ; + + getToken ( c ) ; + + if ( strcmp ( c, "&&" ) != 0 && + strcmp ( c, "||" ) != 0 ) + { + ungetToken ( c ) ; + return TRUE ; + } + + if ( ! pushRelExpression () ) + return FALSE ; + + if ( strcmp ( c, "&&" ) == 0 ) + pushAndAnd () ; + else + pushOrOr () ; + } +} + + int pslCompiler::pushExpression () { - return pushRelExpression () ; + return pushBoolExpression () ; } Index: pslLocal.h =================================================================== RCS file: /cvsroot/plib/plib/src/psl/pslLocal.h,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- pslLocal.h 10 Sep 2002 04:37:39 -0000 1.15 +++ pslLocal.h 15 Sep 2002 00:02:51 -0000 1.16 @@ -41,7 +41,7 @@ #define MAX_VARIABLE 256 #define MAX_LABEL 256 #define MAX_TOKEN 1024 -#define MAX_CODE 512 +#define MAX_CODE 65536 #define MAX_STACK 256 #define MAX_NESTING 32 #define MAX_UNGET 64 |
From: Steve B. <sj...@us...> - 2002-09-15 00:03:00
|
Update of /cvsroot/plib/plib/doc/psl In directory usw-pr-cvs1:/tmp/cvs-serv7115/plib/doc/psl Modified Files: prog_guide.html Log Message: Added the AstroPong demo. Fixed up a couple of bugs in PSL. Index: prog_guide.html =================================================================== RCS file: /cvsroot/plib/plib/doc/psl/prog_guide.html,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- prog_guide.html 14 Sep 2002 06:23:27 -0000 1.8 +++ prog_guide.html 15 Sep 2002 00:02:51 -0000 1.9 @@ -123,6 +123,7 @@ The following features are "NOT IMPLEMENTED YET" - but will hopefully arrive soon: <ul> + <li> Multiple assignments (eg x = y = 0 ; ) <li> Logic operators "&&", "||". <li> Character constants. <li> Arrays & Structs. |
From: Steve B. <sj...@us...> - 2002-09-15 00:03:00
|
Update of /cvsroot/plib/plib/demos/simon/src In directory usw-pr-cvs1:/tmp/cvs-serv7115/plib/demos/simon/src Modified Files: simon.cxx Log Message: Added the AstroPong demo. Fixed up a couple of bugs in PSL. Index: simon.cxx =================================================================== RCS file: /cvsroot/plib/plib/demos/simon/src/simon.cxx,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- simon.cxx 14 Sep 2002 20:52:42 -0000 1.2 +++ simon.cxx 15 Sep 2002 00:02:51 -0000 1.3 @@ -2,6 +2,70 @@ #include <simon.h> #include <plib/psl.h> +pslValue my_siJoystickUD ( int, pslValue *, pslProgram * ) +{ + pslValue ret ; + ret . set ( siJoystickUD () ) ; + return ret ; +} + + [...120 lines suppressed...] { res = prog -> step () ; @@ -85,6 +171,17 @@ if ( res == PSL_PROGRAM_END ) exit ( 0 ) ; + + ck.update () ; + total_time += ck.getDeltaTime () ; + nframes++ ; + + if ( nframes == 100 ) + { + fprintf ( stderr, "Avg PSL Interp time = %fs.\n", total_time / nframes ) ; + nframes = 0 ; + total_time = 0.0 ; + } } |
From: Steve B. <sj...@us...> - 2002-09-15 00:03:00
|
Update of /cvsroot/plib/plib/demos/simon/astropong In directory usw-pr-cvs1:/tmp/cvs-serv7115/plib/demos/simon/astropong Added Files: astropong.psl Log Message: Added the AstroPong demo. Fixed up a couple of bugs in PSL. --- NEW FILE: astropong.psl --- #define ARENA_SIZE 8.0 /* meters */ #define ARENA_LENGTH 10.0 /* meters */ #define BALL_SIZE 2.5 /* meters */ #define BOUNCE (ARENA_SIZE/2.0 - BALL_SIZE/2.0) #define BOUNCEY (ARENA_LENGTH/2.0 - BALL_SIZE/2.0) #define BAT_SIZE (1.0 + BALL_SIZE/2.0) /* From the center to the sides */ int arena ; int shadow ; int difficulty ; int scoreBoardR ; int scoreBoardB ; int ball ; int bPaddle ; int rPaddle ; int camera ; [...189 lines suppressed...] if ( rpaddleZ < -BOUNCE ) rpaddleZ = -BOUNCE ; /* Tell SIMON where to position the paddle, ball and camera */ /* MODEL X, Y, Z, H, P, R */ siPosition ( scoreBoardR, 1, 0, 0, 0, scoreSpinR, 0 ) ; siPosition ( scoreBoardB, -1, 0, 0, 0, scoreSpinB, 0 ) ; siPosition ( bPaddle , bpaddleX, 5, bpaddleZ, 0, 0 , 0 ) ; siPosition ( rPaddle , rpaddleX, -5, rpaddleZ, 0, 0 , 0 ) ; siPosition ( ball , ballX, ballY, ballZ, ballSpinH,ballSpinP,ballSpinR); siPosition ( arena , 0, 0, 0, 0, 0 , 0 ) ; siPosition ( shadow , ballX, ballY, -4, 0, 0 , 0 ) ; siPosition ( camera , 0, -10, 0, 0, 0 , 0 ) ; pause ; } } |
From: Sebastian U. <ud...@us...> - 2002-09-15 00:00:17
|
Update of /cvsroot/plib/plib/demos/simon/doc In directory usw-pr-cvs1:/tmp/cvs-serv6249 Modified Files: index.html Log Message: Changed instructions to link against UL Index: index.html =================================================================== RCS file: /cvsroot/plib/plib/demos/simon/doc/index.html,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- index.html 14 Sep 2002 23:54:15 -0000 1.3 +++ index.html 15 Sep 2002 00:00:14 -0000 1.4 @@ -238,7 +238,7 @@ # SIMONDIR = /usr/local/simon SIMON = -I${SIMONDIR} -L${SIMONDIR} - LIBS = -lsimon -lplibssg -lplibsg -lglut -lGLU -lGL -L/usr/X11/lib -lX11 -lm + LIBS = -lsimon -lplibssg -lplibsg -lplibul -lglut -lGLU -lGL -L/usr/X11/lib -lX11 -lm all: ${TARGETS} |
From: Steve B. <sj...@us...> - 2002-09-14 23:59:13
|
Update of /cvsroot/plib/plib/demos/simon/astropong/data In directory usw-pr-cvs1:/tmp/cvs-serv5870/data Log Message: Directory /cvsroot/plib/plib/demos/simon/astropong/data added to the repository |
From: Steve B. <sj...@us...> - 2002-09-14 23:58:24
|
Update of /cvsroot/plib/plib/demos/simon/astropong In directory usw-pr-cvs1:/tmp/cvs-serv5484/astropong Log Message: Directory /cvsroot/plib/plib/demos/simon/astropong added to the repository |
From: Sebastian U. <ud...@us...> - 2002-09-14 23:54:18
|
Update of /cvsroot/plib/plib/demos/simon/doc In directory usw-pr-cvs1:/tmp/cvs-serv4055 Modified Files: index.html Log Message: Argh - confused < and > ! Index: index.html =================================================================== RCS file: /cvsroot/plib/plib/demos/simon/doc/index.html,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- index.html 14 Sep 2002 23:50:06 -0000 1.2 +++ index.html 14 Sep 2002 23:54:15 -0000 1.3 @@ -51,11 +51,11 @@ All SIMON programs have to start with the line: <pre> - #include >simon.h< + #include <simon.h> </pre> ...this brings in all the information the compiler needs in order for you to -write a SIMON program. Think of it like '#include >stdio.h<' but for +write a SIMON program. Think of it like '#include <stdio.h>' but for programs that are just doing 3D rendering. <p> Then, you have to declare an integer variable for everything in the scene |
From: Sebastian U. <ud...@us...> - 2002-09-14 23:50:09
|
Update of /cvsroot/plib/plib/demos/simon/doc In directory usw-pr-cvs1:/tmp/cvs-serv2811 Modified Files: index.html Log Message: HTML 4.0 compliance Index: index.html =================================================================== RCS file: /cvsroot/plib/plib/demos/simon/doc/index.html,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- index.html 14 Sep 2002 19:50:29 -0000 1.1 +++ index.html 14 Sep 2002 23:50:06 -0000 1.2 @@ -1,5 +1,11 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<HTML> +<HEAD> + <META http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> + <TITLE>WELCOME TO S.I.M.O.N</TITLE> +</HEAD> +<BODY> -<TITLE>WELCOME TO S.I.M.O.N</TITLE> <H1>WELCOME TO S.I.M.O.N</H1> <center>by Steve Baker</center> @@ -45,12 +51,12 @@ All SIMON programs have to start with the line: <pre> - #include <simon.h> + #include >simon.h< </pre> ...this brings in all the information the compiler needs in order for you to -write a SIMON program. Think of it like '#include <stdio.h>' but for programs -that are just doing 3D rendering. +write a SIMON program. Think of it like '#include >stdio.h<' but for +programs that are just doing 3D rendering. <p> Then, you have to declare an integer variable for everything in the scene that your program needs - which includes at least the scenery and the camera. @@ -246,3 +252,5 @@ test1 : test1.cxx ; g++ ${SIMON} -o test1 test1.cxx ${LIBS} </pre> +</BODY> +</HTML> |
From: Sebastian U. <ud...@us...> - 2002-09-14 23:40:33
|
Update of /cvsroot/plib/plib/demos/p-guide/doc In directory usw-pr-cvs1:/tmp/cvs-serv380 Modified Files: p-guide.html Log Message: HTML 4.0 compliance Index: p-guide.html =================================================================== RCS file: /cvsroot/plib/plib/demos/p-guide/doc/p-guide.html,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- p-guide.html 8 May 2002 22:49:55 -0000 1.1 +++ p-guide.html 14 Sep 2002 23:40:28 -0000 1.2 @@ -1,4 +1,4 @@ -<!doctype html public "-//w3c//dtd html 4.0 transitional//en"> +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> @@ -65,6 +65,7 @@ Widget Settings</h2> The user can control the following settings of his widget from controls in the Status window: +<ul> <li> Name (the name of the variable which is the pointer to the widget in the program)</li> @@ -83,8 +84,9 @@ <li> Callbacks</li> +</ul> -<br>The user may also modify the size and position of his widgets directly +The user may also modify the size and position of his widgets directly in the Main window. To change the size, he clicks inside the widget within five pixels of the edge and then drags the mouse to extend the widget. To change the position he clicks inside the widget away from the edges @@ -139,8 +141,6 @@ <br>If the user clicks on the "Quit" button, the program will stop. Again, if there have been changes since the last code writing or clearing, the program will ask if he is sure. -<br> -<br> </body> </html> |
From: Steve B. <sj...@us...> - 2002-09-14 20:52:45
|
Update of /cvsroot/plib/plib/examples/src/psl/data In directory usw-pr-cvs1:/tmp/cvs-serv22648/plib/examples/src/psl/data Modified Files: test.psl Log Message: Fixed bug in PSL expression handler. Index: test.psl =================================================================== RCS file: /cvsroot/plib/plib/examples/src/psl/data/test.psl,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- test.psl 14 Sep 2002 06:23:27 -0000 1.24 +++ test.psl 14 Sep 2002 20:52:42 -0000 1.25 @@ -2,7 +2,8 @@ void main () { - for ( int i = 0 ; i < 0x10 ; i++ ) - printf ( "Hello ", i, "\n" ) ; + int diff ; + + if ( diff == 1 ) { diff = 2 ; } else { diff = 3 ; } } |
From: Steve B. <sj...@us...> - 2002-09-14 20:52:45
|
Update of /cvsroot/plib/plib/src/psl In directory usw-pr-cvs1:/tmp/cvs-serv22648/plib/src/psl Modified Files: pslExpression.cxx Log Message: Fixed bug in PSL expression handler. Index: pslExpression.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/psl/pslExpression.cxx,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- pslExpression.cxx 14 Sep 2002 06:12:32 -0000 1.12 +++ pslExpression.cxx 14 Sep 2002 20:52:42 -0000 1.13 @@ -40,10 +40,10 @@ getToken ( c ) ; - if ( strcmp ( c, ")" ) == 0 ) + if ( strcmp ( c, ")" ) != 0 ) { ungetToken ( c ) ; - return error ( "Missing ')' (found '%s')", c ); + return error ( "Missing ')' after expression (found '%s')", c ); } return TRUE ; |