plib-cvs Mailing List for PLIB (Page 4)
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: Bert D. <dri...@us...> - 2005-01-12 01:22:47
|
Update of /cvsroot/plib/plib/src/js In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22866/src/js Modified Files: jsBSD.cxx Log Message: Apply two patches from the FreeBSD ports collection. Index: jsBSD.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/js/jsBSD.cxx,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- jsBSD.cxx 21 Sep 2004 11:45:55 -0000 1.5 +++ jsBSD.cxx 12 Jan 2005 01:22:26 -0000 1.6 @@ -45,7 +45,11 @@ #endif #include <sys/ioctl.h> -#include <machine/joystick.h> // For analog joysticks +#if defined(__FreeBSD__) +# include <sys/joystick.h> +#else +# include <machine/joystick.h> // For analog joysticks +#endif #ifdef HAVE_USB_JS #if defined(__NetBSD__) #ifdef HAVE_USBHID_H @@ -55,7 +59,12 @@ #endif #elif defined(__FreeBSD__) extern "C" { -#include <libusbhid.h> +# if __FreeBSD_version < 500000 +# include <libusbhid.h> +# else +# define HAVE_USBHID_H 1 +# include <usbhid.h> +# endif } #endif #include <dev/usb/usb.h> |
From: Bram S. <br...@us...> - 2005-01-10 15:47:14
|
Update of /cvsroot/plib/plib/tools/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15355 Modified Files: Makefile.am Added Files: plibconvert.cxx Log Message: Added commandline conversion tool --- NEW FILE: plibconvert.cxx --- // plibconvert.cxx // // Written by Bram Stolk // Published as part of Steve Baker's PLIB under GPL // // Build with : // g++ -o plibconvert plibconvert.cxx -lplibssg -lplibsg -lplibul -lGL #include <assert.h> #include <stdio.h> #include <stdlib.h> #include <GL/glx.h> #include <plib/ssg.h> int main(int argc, char *argv[]) { if (argc!=3) { fprintf(stderr,"Usage: %s source destination\n", argv[0]); exit(1); } assert(strcmp(argv[1], argv[2])); #ifdef GLX_VERSION_1_3 // Although we will not be doing any rendering, we must create // a valid rendering context before we can call ssgInit() Display *dpy = XOpenDisplay(0); int scn=DefaultScreen(dpy); int cnt; GLXFBConfig *cfg = glXGetFBConfigs(dpy, scn, &cnt); fprintf(stderr,"glXGetFBConfigs returned %p (%d matches)\n", cfg, cnt); assert(cnt); int attrlist[] = { GLX_PBUFFER_WIDTH, 1, GLX_PBUFFER_HEIGHT, 1, 0 }; GLXPbufferSGIX pBuffer = glXCreatePbuffer(dpy, cfg[0], attrlist); fprintf(stderr,"pBuffer = %p\n", pBuffer); GLXContext cx = glXCreateNewContext(dpy, cfg[0], GLX_RGBA_TYPE, 0, GL_TRUE); glXMakeCurrent(dpy, pBuffer, cx); // Initialize plib ssgInit(); ssgTexturePath ( "." ) ; ssgModelPath ( "." ) ; ssgEntity *e = ssgLoad(argv[1]); // Load e->print(stdout); // Inform ssgSave(argv[2], e); // Store #else fprintf(stderr,"This util uses a pbuffer as context for plib. To build the source, you need glx protocol 1.3 or higher.\n"); #endif } Index: Makefile.am =================================================================== RCS file: /cvsroot/plib/plib/tools/src/Makefile.am,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Makefile.am 11 Jan 2001 16:21:05 -0000 1.2 +++ Makefile.am 10 Jan 2005 15:46:49 -0000 1.3 @@ -1,3 +1,10 @@ SUBDIRS = af2rgb +bin_PROGRAMS = plibconvert + +plibconvert_SOURCES = plibconvert.cxx + +plibconvert_LDADD = -lplibssg -lplibsg -lplibul + + |
From: Bram S. <br...@us...> - 2005-01-10 15:25:14
|
Update of /cvsroot/plib/plib/tools In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10891 Modified Files: configure.in Log Message: pthread test was in toplvl configure.in but not in tools/configure.in Index: configure.in =================================================================== RCS file: /cvsroot/plib/plib/tools/configure.in,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- configure.in 11 Sep 2002 22:28:31 -0000 1.7 +++ configure.in 10 Jan 2005 15:25:04 -0000 1.8 @@ -57,6 +57,8 @@ dnl Reasonable stuff non-windoze variants ... :-) + AC_CHECK_LIB(pthread, pthread_create) + AC_CHECK_LIB(GL, glNewList) if test "x$ac_cv_lib_GL_glNewList" = "xno" ; then dnl if no GL, check for MesaGL |
From: Bram S. <br...@us...> - 2005-01-09 13:47:45
|
Update of /cvsroot/plib/plib/tools/src/af2rgb In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8833 Modified Files: af2rgb.cxx Log Message: _ulEndianSwap now seems to be ulEndianSwap Index: af2rgb.cxx =================================================================== RCS file: /cvsroot/plib/plib/tools/src/af2rgb/af2rgb.cxx,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- af2rgb.cxx 31 Aug 2002 13:49:08 -0000 1.9 +++ af2rgb.cxx 9 Jan 2005 13:47:36 -0000 1.10 @@ -35,7 +35,7 @@ if (ulIsLittleEndian) // this is the other way round compared to normally. // obviously, this is because the .rgb format comes from SGI. - _ulEndianSwap(&x); + ulEndianSwap(&x); return fwrite( & x, sizeof(unsigned short), 1, fd ) ; @@ -45,7 +45,7 @@ { if (ulIsLittleEndian) // this is the other way round compared to normally. // obviously, this is because the .rgb format comes from SGI. - _ulEndianSwap(&x); + ulEndianSwap(&x); return fwrite( & x, sizeof(unsigned int), 1, fd ) ; } |
From: Bram S. <br...@us...> - 2005-01-09 13:39:30
|
Update of /cvsroot/plib/plib/examples In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7067 Modified Files: configure.in Log Message: Added pthread test, req'd by libGL on some platforms Index: configure.in =================================================================== RCS file: /cvsroot/plib/plib/examples/configure.in,v retrieving revision 1.40 retrieving revision 1.41 diff -u -d -r1.40 -r1.41 --- configure.in 21 Mar 2004 19:29:25 -0000 1.40 +++ configure.in 9 Jan 2005 13:39:22 -0000 1.41 @@ -143,6 +143,8 @@ dnl Reasonable stuff non-windoze variants ... :-) + AC_CHECK_LIB(pthread, pthread_create) + AC_CHECK_LIB(GL, glNewList, OGL_LIBS="-lGL $OGL_LIBS",,$OGL_LIBS) if test "x$ac_cv_lib_GL_glNewList" = "xno" ; then dnl if no GL, check for MesaGL |
From: Bram S. <br...@us...> - 2005-01-09 13:38:29
|
Update of /cvsroot/plib/plib/examples/src/pw In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6810 Modified Files: Makefile.am Log Message: There is no lorenz demo present here, dont try to build it Index: Makefile.am =================================================================== RCS file: /cvsroot/plib/plib/examples/src/pw/Makefile.am,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- Makefile.am 24 Jun 2004 16:30:54 -0000 1.3 +++ Makefile.am 9 Jan 2005 13:38:21 -0000 1.4 @@ -1,16 +1,14 @@ if BUILD_PW -noinst_PROGRAMS = pw_demo pw_pui lorenz +noinst_PROGRAMS = pw_demo pw_pui pw_demo_SOURCES = pw_demo.cxx pw_pui_SOURCES = pw_pui.cxx -lorenz_SOURCES = lorenz.cxx pw_demo_LDADD = -lplibpw -lplibul $(OGL_LIBS) pw_pui_LDADD = -lplibpw -lplibpu -lplibfnt -lplibsg -lplibul $(OGL_LIBS) -lorenz_LDADD = -lplibpw -lplibpu -lplibfnt -lplibsg -lplibul $(OGL_LIBS) endif -EXTRA_DIST = pw_demo.dsp lorenz.dsp +EXTRA_DIST = pw_demo.dsp |
From: Bram S. <br...@us...> - 2005-01-09 13:13:23
|
Update of /cvsroot/plib/plib/src/ssgAux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv959 Modified Files: ssgaSphere.h Log Message: Fixed warning on missing newline Index: ssgaSphere.h =================================================================== RCS file: /cvsroot/plib/plib/src/ssgAux/ssgaSphere.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- ssgaSphere.h 26 Jul 2003 06:16:19 -0000 1.1 +++ ssgaSphere.h 9 Jan 2005 13:13:12 -0000 1.2 @@ -29,4 +29,5 @@ ssgBranch *ssgaMakeSphere( ssgSimpleState *state, ssgColourArray *cl, float radius, int slices, int stacks, - ssgCallback predraw, ssgCallback postdraw ); \ No newline at end of file + ssgCallback predraw, ssgCallback postdraw ); + |
From: Bram S. <br...@us...> - 2005-01-09 13:10:19
|
Update of /cvsroot/plib/plib/src/ssg In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32572 Modified Files: ssgOptimiser.cxx Log Message: Removed silly conditional Index: ssgOptimiser.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgOptimiser.cxx,v retrieving revision 1.36 retrieving revision 1.37 diff -u -d -r1.36 -r1.37 --- ssgOptimiser.cxx 1 Dec 2004 08:28:05 -0000 1.36 +++ ssgOptimiser.cxx 9 Jan 2005 13:10:08 -0000 1.37 @@ -374,7 +374,7 @@ { short i = find ( v, t, c, FALSE ) ; - if (( i >= 0 ) && (i <0xFFFF)) + if ( i >= 0 ) { vlist [ i ] -> bump () ; return i ; |
From: Wolfram K. <wol...@us...> - 2005-01-05 00:06:23
|
Update of /cvsroot/plib/plib/doc/ssg In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21359 Modified Files: non_class.html Log Message: Added ASC writer Index: non_class.html =================================================================== RCS file: /cvsroot/plib/plib/doc/ssg/non_class.html,v retrieving revision 1.31 retrieving revision 1.32 diff -u -d -r1.31 -r1.32 --- non_class.html 24 Jun 2004 16:30:54 -0000 1.31 +++ non_class.html 5 Jan 2005 00:05:58 -0000 1.32 @@ -404,15 +404,14 @@ <tr> <td> Feature</td> <td> 3DS<BR>load</td> - <td> AC<BR>load</td> - <td> AC<BR>save</td> + <td> AC<BR>load/<BR>save</td> + <td> ASC<BR>save</td> <td> ASE<BR>load/<BR>save</td> <td> ATG<BR>load/<BR>save</td> <td> DXF<BR>load</td> <td> DXF<BR>save</td> [...223 lines suppressed...] - <td> A</td> <td> ?</td> <td> A</td> <td> A</td> @@ -803,7 +786,6 @@ <td> A</td> <td> D</td> <td> A</td> - <td> A</td> <td> ?</td> <td> A</td> <td> A</td> @@ -826,7 +808,6 @@ <td> A</td> <td> B</td> <td> A</td> - <td> A</td> <td> B</td> <td> A</td> <td> A</td> |
From: Wolfram K. <wol...@us...> - 2005-01-04 23:10:39
|
Update of /cvsroot/plib/plib/src/util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11653/util Modified Files: ul.cxx Log Message: Fixed copy and paste error in comment Index: ul.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/util/ul.cxx,v retrieving revision 1.34 retrieving revision 1.35 diff -u -d -r1.34 -r1.35 --- ul.cxx 30 Oct 2004 16:11:07 -0000 1.34 +++ ul.cxx 4 Jan 2005 23:10:17 -0000 1.35 @@ -466,7 +466,7 @@ offering. **** ATTENTION **** - WK: If you used strnicmp, make sure you realise the completely + WK: If you used stricmp, make sure you realise the completely changed meaning of the return value - 0 means not equal! */ |
From: Steve B. <sj...@us...> - 2004-12-29 07:20:20
|
Update of /cvsroot/plib/plib/demos/exposer/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10737/plib/demos/exposer/src Modified Files: load_save.cxx Log Message: Fixed some bugs in tweening. Added functions to dump Z buffer into ssgaScreenDump. Index: load_save.cxx =================================================================== RCS file: /cvsroot/plib/plib/demos/exposer/src/load_save.cxx,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- load_save.cxx 17 Aug 2002 23:58:38 -0000 1.11 +++ load_save.cxx 29 Dec 2004 07:19:38 -0000 1.12 @@ -113,13 +113,19 @@ if ( p == NULL ) { ssgModelPath ( "." ) ; - ssgTexturePath ( "." ) ; + if ( getenv ( "EXPOSER_TEXTURE_PATH" ) != NULL ) + ssgTexturePath ( getenv ( "EXPOSER_TEXTURE_PATH" ) ) ; + else + ssgTexturePath ( "." ) ; strcpy ( fname, path ) ; } else [...81 lines suppressed...] { ssgModelPath ( "." ) ; - ssgTexturePath ( "." ) ; + if ( getenv ( "EXPOSER_TEXTURE_PATH" ) != NULL ) + ssgTexturePath ( getenv ( "EXPOSER_TEXTURE_PATH" ) ) ; + else + ssgTexturePath ( "." ) ; strcpy ( fname, path ) ; } else { ssgModelPath ( path ) ; - ssgTexturePath ( path ) ; + if ( getenv ( "EXPOSER_TEXTURE_PATH" ) != NULL ) + ssgTexturePath ( getenv ( "EXPOSER_TEXTURE_PATH" ) ) ; + else + ssgTexturePath ( path ) ; strcpy ( fname, p ) ; } |
From: Steve B. <sj...@us...> - 2004-12-29 07:20:18
|
Update of /cvsroot/plib/plib/demos/exposer/data In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10737/plib/demos/exposer/data Modified Files: human.ac Log Message: Fixed some bugs in tweening. Added functions to dump Z buffer into ssgaScreenDump. Index: human.ac =================================================================== RCS file: /cvsroot/plib/plib/demos/exposer/data/human.ac,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- human.ac 20 Jul 2001 03:45:58 -0000 1.1 +++ human.ac 29 Dec 2004 07:19:38 -0000 1.2 @@ -5,79 +5,6 @@ OBJECT world kids 3 OBJECT poly -name "bones" -loc 0.0111648 0.99798 -0.104503 -texture "teeshirt_human.rgb" -texrep -1 1 -numvert 19 --0.00128026 0.22656 0.0769265 --0.000640289 0.645104 0.0567337 -0.195822 0.645104 0.0116575 [...125 lines suppressed...] +SURF 0x32 +mat 2 +refs 2 +0 0.49925 0.613698 +12 0.4951 0.498152 +SURF 0x32 +mat 2 +refs 4 +12 0.4951 0.498152 +13 0.409379 0.289783 +14 0.395005 0.0227482 +15 0.402269 0.000785255 +SURF 0x32 +mat 2 +refs 4 +12 0.4951 0.498152 +16 0.59553 0.288998 +17 0.609905 0.0219625 +18 0.607449 0 +kids 0 |
From: Steve B. <sj...@us...> - 2004-12-29 07:19:56
|
Update of /cvsroot/plib/plib/src/ssgAux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10737/plib/src/ssgAux Modified Files: ssgaFire.cxx ssgaScreenDump.cxx ssgaScreenDump.h Log Message: Fixed some bugs in tweening. Added functions to dump Z buffer into ssgaScreenDump. Index: ssgaFire.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssgAux/ssgaFire.cxx,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- ssgaFire.cxx 2 Sep 2002 06:05:49 -0000 1.5 +++ ssgaFire.cxx 29 Dec 2004 07:19:40 -0000 1.6 @@ -126,6 +126,7 @@ static int preFireDraw ( ssgEntity * ) { + glDisable ( GL_FOG ) ; glBlendFunc ( GL_ONE, GL_ONE ) ; return TRUE ; } @@ -134,6 +135,7 @@ static int postFireDraw ( ssgEntity * ) { glBlendFunc ( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA ) ; + glEnable ( GL_FOG ) ; return TRUE ; } Index: ssgaScreenDump.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssgAux/ssgaScreenDump.cxx,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- ssgaScreenDump.cxx 16 Feb 2004 02:26:28 -0000 1.3 +++ ssgaScreenDump.cxx 29 Dec 2004 07:19:40 -0000 1.4 @@ -48,6 +48,67 @@ } +void ssgaScreenDepthDump ( char *filename, + int xsize, int ysize, int frontBuffer ) +{ + FILE *fd = fopen ( filename, "wb" ) ; + + if ( fd == NULL ) + { + fprintf ( stderr, "Failed to open '%s' for writing screendepthdump.\n", + filename ) ; + return ; + } + + unsigned char *row = new unsigned char [ xsize ] ; + unsigned int *buffer = ssgaScreenDepthDump ( xsize, ysize, frontBuffer ) ; + + char type = 0 /* RGB_IMG_VERBATIM */ ; + short dim = 3 ; + short zsize = 3 ; + char bpp = 1 ; + int min = 0 ; + int max = 255 ; + short magic = 0x01DA /* RGB_IMG_MAGIC */ ; + int colormap = 0 ; + int i ; + + writeShort ( fd, magic ) ; + writeByte ( fd, type ) ; + writeByte ( fd, bpp ) ; + writeShort ( fd, dim ) ; + writeShort ( fd, xsize ) ; + writeShort ( fd, ysize ) ; + writeShort ( fd, zsize ) ; + writeInt ( fd, min ) ; + writeInt ( fd, max ) ; + writeInt ( fd, 0 ) ; /* Dummy field */ + + for ( i = 0 ; i < 80 ; i++ ) + writeByte ( fd, '\0' ) ; /* Name field */ + + writeInt ( fd, colormap ) ; + + for ( i = 0 ; i < 404 ; i++ ) + writeByte ( fd, 0 ) ; /* Dummy field */ + + for ( int z = 0 ; z < 3 ; z++ ) + for ( int y = 0 ; y < ysize ; y++ ) + { + for ( i = 0 ; i < xsize ; i++ ) + row [ i ] = ((buffer [ y * xsize + i ] >> (8*z)) & 0xFF) ; + + fseek ( fd, ( z * ysize + y ) * xsize + 512, SEEK_SET ) ; + fwrite ( row, 1, xsize, fd ) ; + } + + fclose ( fd ) ; + + delete row ; + delete buffer ; +} + + void ssgaScreenDump ( char *filename, int xsize, int ysize, int frontBuffer ) { FILE *fd = fopen ( filename, "wb" ) ; @@ -124,3 +185,20 @@ } + +unsigned int *ssgaScreenDepthDump ( int xsize, int ysize, int frontBuffer ) +{ + unsigned int *buffer = new unsigned int [ xsize * ysize ] ; + + if ( frontBuffer ) + glReadBuffer ( GL_FRONT ) ; + + glReadPixels( 0, 0, xsize, ysize, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, + (void *) buffer ) ; + if ( frontBuffer ) + glReadBuffer ( GL_BACK ) ; + + return buffer ; +} + + Index: ssgaScreenDump.h =================================================================== RCS file: /cvsroot/plib/plib/src/ssgAux/ssgaScreenDump.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- ssgaScreenDump.h 16 Feb 2004 02:26:28 -0000 1.2 +++ ssgaScreenDump.h 29 Dec 2004 07:19:40 -0000 1.3 @@ -5,10 +5,17 @@ int width, int height, int frontBuffer = TRUE ) ; +/* Put low order 24 bits to disk (R=lsb, G=middle byte, B=msb) */ + +void ssgaScreenDepthDump ( char *filename, + int width, int height, + int frontBuffer = TRUE ) ; + /* Dump to a memory buffer - three bytes per pixel */ unsigned char *ssgaScreenDump ( int width, int height, int frontBuffer = TRUE ) ; - +unsigned int *ssgaScreenDepthDump ( int width, int height, + int frontBuffer = TRUE ) ; |
From: Steve B. <sj...@us...> - 2004-12-29 07:19:56
|
Update of /cvsroot/plib/plib/src/ssg In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10737/plib/src/ssg Modified Files: ssg.h ssgDList.cxx ssgLocal.h ssgTween.cxx ssgTweenController.cxx Log Message: Fixed some bugs in tweening. Added functions to dump Z buffer into ssgaScreenDump. Index: ssg.h =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssg.h,v retrieving revision 1.175 retrieving revision 1.176 diff -u -d -r1.175 -r1.176 --- ssg.h 1 Dec 2004 08:28:05 -0000 1.175 +++ ssg.h 29 Dec 2004 07:19:40 -0000 1.176 @@ -2206,8 +2206,8 @@ void setID ( int i ) { id = i ; } int isOn () { return is_turned_on ; } - void on () { is_turned_on = TRUE ; } - void off () { is_turned_on = FALSE ; } + void on () { is_turned_on = TRUE ; } + void off () { is_turned_on = FALSE ; } void setPosition ( const sgVec3 pos ) { sgCopyVec3 ( position, pos ) ; } void getPosition ( sgVec3 pos ) { sgCopyVec3 ( pos, position ) ; } @@ -2222,7 +2222,6 @@ case GL_SPECULAR : sgCopyVec4 ( specular, col ) ; break ; default : break ; } - setup () ; } void getColour ( GLenum which, sgVec4 col ) @@ -2428,7 +2427,7 @@ ssgSimpleState *getState () { return currentState ; } void cull ( ssgBranch *r ) ; - void getCameraPosition ( sgVec3 pos ) ; + void getCameraPosition ( sgVec3 pos ) ; void setCamera ( sgMat4 mat ) ; void setCamera ( const sgCoord *coord ) ; void setCameraLookAt ( const sgVec3 eye, const sgVec3 center, const sgVec3 up ) ; Index: ssgDList.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgDList.cxx,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- ssgDList.cxx 2 Sep 2002 06:05:48 -0000 1.11 +++ ssgDList.cxx 29 Dec 2004 07:19:40 -0000 1.12 @@ -28,6 +28,7 @@ enum _ssgDListType { SSG_DLIST_LEAF, + SSG_DLIST_SET_TWEEN_STATE, SSG_DLIST_LOAD_MATRIX, SSG_DLIST_PUSH_MATRIX, SSG_DLIST_POP_MATRIX, @@ -42,9 +43,18 @@ _ssgDListType type ; sgMat4 mat ; ssgLeaf *leaf ; + float tween_state ; + int tween_mode ; _ssgDList () { setEmpty () ; } + void setTweenState ( float _state, int _mode ) + { + type = SSG_DLIST_SET_TWEEN_STATE ; + tween_state = _state ; + tween_mode = _mode ; + } + void setPopMatrix () { type = SSG_DLIST_POP_MATRIX ; @@ -92,6 +102,10 @@ leaf -> draw () ; break ; + case SSG_DLIST_SET_TWEEN_STATE : + _ssgSetRealCurrentTweenSettings ( tween_state, tween_mode ) ; + break ; + case SSG_DLIST_POP_MATRIX : glPopMatrix () ; break ; @@ -161,6 +175,15 @@ } +void _ssgSetTweenState ( float state, int mode ) +{ + if ( next_dlist >= MAX_DLIST ) + ulSetError ( UL_WARNING, "DList stack overflow!" ) ; + else + dlist [ next_dlist++ ] . setTweenState ( state, mode ) ; +} + + void _ssgPopMatrix () { /* @@ -247,3 +270,4 @@ else dlist [ next_dlist++ ] . setDrawLeaf ( l ) ; } + Index: ssgLocal.h =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgLocal.h,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- ssgLocal.h 13 Sep 2004 10:48:10 -0000 1.25 +++ ssgLocal.h 29 Dec 2004 07:19:40 -0000 1.26 @@ -41,6 +41,7 @@ void _ssgForceLineState () ; void _ssgDrawDList () ; +void _ssgSetTweenState ( float state, int mode ) ; void _ssgPushMatrix ( sgMat4 m ) ; void _ssgPopMatrix () ; void _ssgLoadMatrix ( sgMat4 m ) ; @@ -116,9 +117,9 @@ int _ssgWriteError ( void ) ; float _ssgGetCurrentTweenState () ; -void _ssgSetCurrentTweenState ( float tweenstate ) ; int _ssgGetCurrentTweenMode () ; -void _ssgSetCurrentTweenMode ( int tweenmode ) ; +void _ssgSetCurrentTweenSettings ( float tweenstate, int tweenmode ) ; +void _ssgSetRealCurrentTweenSettings ( float tweenstate, int tweenmode ) ; /* Routines for storing arbitrary ssgBase derived objects within SSG files. Index: ssgTween.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgTween.cxx,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- ssgTween.cxx 13 Sep 2004 12:02:36 -0000 1.13 +++ ssgTween.cxx 29 Dec 2004 07:19:40 -0000 1.14 @@ -34,8 +34,20 @@ int _ssgGetCurrentTweenMode () { return current_tween_mode ; } float _ssgGetCurrentTweenState () { return current_tween_state ; } -void _ssgSetCurrentTweenMode ( int mode ) { current_tween_mode = mode ; } -void _ssgSetCurrentTweenState ( float tstate ) { current_tween_state= tstate ;} + +void _ssgSetCurrentTweenSettings ( float state, int mode ) +{ + _ssgSetRealCurrentTweenSettings ( state, mode ) ; + _ssgSetTweenState ( state, mode ) ; /* Add it into the Dlist for later */ +} + + +void _ssgSetRealCurrentTweenSettings ( float state, int mode ) +{ + current_tween_mode = mode ; + current_tween_state = state ; +} + void ssgTween::copy_from ( ssgTween *src, int clone_flags ) { Index: ssgTweenController.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgTweenController.cxx,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- ssgTweenController.cxx 4 Nov 2002 05:11:22 -0000 1.6 +++ ssgTweenController.cxx 29 Dec 2004 07:19:40 -0000 1.7 @@ -57,16 +57,14 @@ void ssgTweenController::cull ( sgFrustum *f, sgMat4 m, int test_needed ) { - float tmp = _ssgGetCurrentTweenState () ; - int mm = _ssgGetCurrentTweenMode () ; + float old_state = _ssgGetCurrentTweenState () ; + int old_mode = _ssgGetCurrentTweenMode () ; - _ssgSetCurrentTweenState ( curr_bank ) ; - _ssgSetCurrentTweenMode ( mode ) ; + _ssgSetCurrentTweenSettings ( curr_bank, mode ) ; ssgBranch::cull ( f, m, test_needed ) ; - _ssgSetCurrentTweenState ( tmp ) ; - _ssgSetCurrentTweenMode ( mm ) ; + _ssgSetCurrentTweenSettings ( old_state, old_mode ) ; } |
From: Steve B. <sj...@us...> - 2004-12-29 07:19:54
|
Update of /cvsroot/plib/plib/examples/src/ssg/tween_test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10737/plib/examples/src/ssg/tween_test Modified Files: Makefile.am tween_test.cxx Log Message: Fixed some bugs in tweening. Added functions to dump Z buffer into ssgaScreenDump. Index: Makefile.am =================================================================== RCS file: /cvsroot/plib/plib/examples/src/ssg/tween_test/Makefile.am,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- Makefile.am 1 Sep 2002 05:22:26 -0000 1.3 +++ Makefile.am 29 Dec 2004 07:19:39 -0000 1.4 @@ -4,8 +4,7 @@ tween_test_SOURCES = tween_test.cxx -tween_test_LDADD = -lplibssgaux -lplibssg -lplibsg -lplibul $(GLUT_LIBS) \ - $(OGL_LIBS) +tween_test_LDADD = -lplibssgaux -lplibssg -lplibsg -lplibpw -lplibul $(OGL_LIBS) endif Index: tween_test.cxx =================================================================== RCS file: /cvsroot/plib/plib/examples/src/ssg/tween_test/tween_test.cxx,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- tween_test.cxx 1 Sep 2002 12:04:52 -0000 1.3 +++ tween_test.cxx 29 Dec 2004 07:19:39 -0000 1.4 @@ -32,18 +32,11 @@ # include <unistd.h> #endif #include <math.h> +#include <GL/gl.h> #include <plib/ssg.h> #include <plib/ssgAux.h> - -#ifdef FREEGLUT_IS_PRESENT -# include <GL/freeglut.h> -#else -# ifdef __APPLE__ [...79 lines suppressed...] + pwSetCallbacks ( NULL, NULL, NULL, NULL, NULL ) ; /* Initialise SSG @@ -291,7 +242,14 @@ { init_graphics () ; load_database () ; - glutMainLoop () ; + + while ( 1 ) + { + ulMilliSecondSleep ( 16 ) ; + redraw () ; + pwSwapBuffers () ; + } + return 0 ; } |
From: Steve B. <sj...@us...> - 2004-12-29 07:19:54
|
Update of /cvsroot/plib/plib/examples/src/ssg/water In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10737/plib/examples/src/ssg/water Modified Files: water.cxx Log Message: Fixed some bugs in tweening. Added functions to dump Z buffer into ssgaScreenDump. Index: water.cxx =================================================================== RCS file: /cvsroot/plib/plib/examples/src/ssg/water/water.cxx,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- water.cxx 2 Mar 2004 16:25:49 -0000 1.25 +++ water.cxx 29 Dec 2004 07:19:40 -0000 1.26 @@ -797,9 +797,9 @@ scene = new ssgRoot ; scene -> addKid ( ocean ) ; + scene -> addKid ( fire ) ; scene -> addKid ( pedestal ) ; scene -> addKid ( teapot ) ; - scene -> addKid ( fire ) ; scene -> addKid ( sun ) ; } |
From: Steve B. <sj...@us...> - 2004-12-29 07:19:54
|
Update of /cvsroot/plib/plib/examples/src/fnt In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10737/plib/examples/src/fnt Modified Files: Makefile.am Added Files: hello_world.cxx Log Message: Fixed some bugs in tweening. Added functions to dump Z buffer into ssgaScreenDump. --- NEW FILE: hello_world.cxx --- /* PLIB - A Suite of Portable Game Libraries Copyright (C) 2001 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: hello_world.cxx,v 1.1 2004/12/29 07:19:39 sjbaker Exp $ */ #include <plib/pw.h> #include <plib/fnt.h> int main ( int argc, char **argv ) { int w, h ; pwInit ( 100, 100, 230, 50, false, "FNT Hello World Demo", true, 0 ) ; pwSetCallbacks ( NULL, NULL, NULL, NULL, NULL ) ; pwGetSize ( &w, &h ) ; fntRenderer *text = new fntRenderer () ; text -> setFont ( new fntTexFont ( "data/Helvetica.txf" ) ) ; text -> setPointSize ( 30.0f ) ; glEnable ( GL_ALPHA_TEST ) ; glEnable ( GL_BLEND ) ; glAlphaFunc ( GL_GREATER, 0.1f ) ; glBlendFunc ( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA ) ; glMatrixMode ( GL_PROJECTION ) ; glLoadIdentity () ; glOrtho ( 0, w, 0, h, -1, 1 ) ; while ( 1 ) { glClearColor ( 0.1f, 0.4f, 0.1f, 1.0f ) ; glClear ( GL_COLOR_BUFFER_BIT ) ; text -> begin () ; glColor3f ( 1.0f, 1.0f, 0.0f ) ; text -> start2f ( 10.0f, 10.0f ) ; text -> puts ( "Hello World." ) ; text -> end () ; pwSwapBuffers () ; } return 0 ; } Index: Makefile.am =================================================================== RCS file: /cvsroot/plib/plib/examples/src/fnt/Makefile.am,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- Makefile.am 1 Sep 2002 05:22:24 -0000 1.5 +++ Makefile.am 29 Dec 2004 07:19:39 -0000 1.6 @@ -1,13 +1,16 @@ if BUILD_FNT -noinst_PROGRAMS = fnt_test slideshow +noinst_PROGRAMS = fnt_test slideshow hello_world + +hello_world_SOURCES = hello_world.cxx fnt_test_SOURCES = fnt_test.cxx slideshow_SOURCES = slideshow.cxx -fnt_test_LDADD = -lplibfnt -lplibsg -lplibul $(GLUT_LIBS) $(OGL_LIBS) -slideshow_LDADD = -lplibfnt -lplibsg -lplibul $(GLUT_LIBS) $(OGL_LIBS) +hello_world_LDADD = -lplibpw -lplibfnt -lplibsg -lplibul $(OGL_LIBS) +fnt_test_LDADD = -lplibfnt -lplibsg -lplibul $(GLUT_LIBS) $(OGL_LIBS) +slideshow_LDADD = -lplibfnt -lplibsg -lplibul $(GLUT_LIBS) $(OGL_LIBS) endif |
From: Steve B. <sj...@us...> - 2004-12-29 07:19:53
|
Update of /cvsroot/plib/plib/doc/fnt In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10737/plib/doc/fnt Modified Files: index.html Log Message: Fixed some bugs in tweening. Added functions to dump Z buffer into ssgaScreenDump. Index: index.html =================================================================== RCS file: /cvsroot/plib/plib/doc/fnt/index.html,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- index.html 26 Oct 2002 14:24:59 -0000 1.9 +++ index.html 29 Dec 2004 07:19:38 -0000 1.10 @@ -257,7 +257,7 @@ format - which has the '.txf' filename extension. Returns TRUE for success, FALSE for failure. Details of the TXF file format can be found in -<A HREF="http://www.opengl.org/developers/code/mjktips/TexFont/TexFont.html"> +<A HREF="http://www.opengl.org/resources/code/rendering/mjktips/TexFont/TexFont.html"> Marks's document about Textured Fonts</A> <p> Just as with all fntFont derived classes, you can optionally specify @@ -357,7 +357,8 @@ The '.txf' font format was designed by Mark Kilgard - who also produced some tools for dealing with them. <p> -Check <A HREF="http://www.opengl.org/developers/code/mjktips/TexFont/TexFont.html"> +Check <A HREF="http://www.opengl.org/resources/code/rendering/mjktips/TexFont/TexFont.html"> + Marks's document about Textured Fonts</A> for further information. Of particular interest is Mark's "gentexfont" program that can create a TXF format font from an X-windows font. |
From: Steve B. <sj...@us...> - 2004-12-29 07:19:52
|
Update of /cvsroot/plib/plib/examples/src/sl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10737/plib/examples/src/sl Modified Files: Makefile.am README Added Files: playsound.cxx Log Message: Fixed some bugs in tweening. Added functions to dump Z buffer into ssgaScreenDump. --- NEW FILE: playsound.cxx --- /* PLIB - A Suite of Portable Game Libraries Copyright (C) 2001 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: playsound.cxx,v 1.1 2004/12/29 07:19:39 sjbaker Exp $ */ #include <plib/sl.h> #include <plib/sm.h> #include <math.h> /* Construct a sound scheduler and a mixer. */ slScheduler sched ( 8000 ) ; smMixer mixer ( "/dev/mixer" ) ; #ifndef M_PI #define EX_PI 3.1415926535 #else #define EX_PI M_PI #endif int main ( int argc, char **argv ) { mixer . setMasterVolume ( 100 ) ; sched . setSafetyMargin ( 0.128f ) ; /* Set up the samples and a loop */ slSample *s1 = new slSample ( argv[1], & sched ) ; s1 -> adjustVolume ( 10.0f ) ; sched . loopSample ( s1 ) ; int tim = 0 ; /* My periodic event timer. */ while ( SL_TRUE ) { tim++ ; /* Time passes */ #ifdef WIN32 Sleep ( 1000 / 30 ) ; /* 30Hz */ #elif defined(sgi) sginap( 3 ); /* ARG */ #else usleep ( 1000000 / 30 ) ; /* 30Hz */ #endif /* This would normally be called just before the graphics buffer swap - but it could be anywhere where it's guaranteed to get called fairly often. */ sched . update () ; } return 0 ; } Index: Makefile.am =================================================================== RCS file: /cvsroot/plib/plib/examples/src/sl/Makefile.am,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- Makefile.am 2 Sep 2002 10:42:49 -0000 1.7 +++ Makefile.am 29 Dec 2004 07:19:39 -0000 1.8 @@ -1,12 +1,14 @@ if BUILD_SL -noinst_PROGRAMS = example mod_demo +noinst_PROGRAMS = example mod_demo playsound example_SOURCES = example.cxx mod_demo_SOURCES = mod_demo.cxx +playsound_SOURCES = playsound.cxx -example_LDADD = -lplibsm -lplibsl -lplibul $(SND_LIBS) -lm -mod_demo_LDADD = -lplibsm -lplibsl -lplibul $(SND_LIBS) -lm +example_LDADD = -lplibsm -lplibsl -lplibul $(SND_LIBS) -lm +mod_demo_LDADD = -lplibsm -lplibsl -lplibul $(SND_LIBS) -lm +playsound_LDADD = -lplibsm -lplibsl -lplibul $(SND_LIBS) -lm endif Index: README =================================================================== RCS file: /cvsroot/plib/plib/examples/src/sl/README,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- README 16 Sep 2000 03:15:19 -0000 1.1 +++ README 29 Dec 2004 07:19:39 -0000 1.2 @@ -4,5 +4,15 @@ for demonstration purposes only. Please don't use it in your applications. + +example -- Plays a variety of sounds read from samples on disk plus + it generates a sound in-situ in memory. A good general + sound sample replay example. + +playsound -- Plays any sound sample file that you enter on it's + command line. Much simpler than 'example'. + +mod_demo -- Plays a '.mod' music file. + -- Steve Baker. |
From: Wolfram K. <wol...@us...> - 2004-12-02 21:26:49
|
Update of /cvsroot/plib/plib/src/ssg In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7265/ssg Modified Files: ssgLoadX.cxx Log Message: Implementing global materiallist. Making tokens case-insensitive. Index: ssgLoadX.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgLoadX.cxx,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- ssgLoadX.cxx 4 Oct 2004 08:10:00 -0000 1.22 +++ ssgLoadX.cxx 2 Dec 2004 21:26:39 -0000 1.23 @@ -139,9 +139,9 @@ } assert(token!=NULL); - if ( strcmp(token,"{") == 0 ) + if ( ulStrEqual (token,"{") ) Level++; - else if ( strcmp(token,"}") == 0 ) + else if ( ulStrEqual (token,"}") ) { assert(Level>0); // Fixme, NIV14: Handle this gracefully. if (Level==1) return; // found THE closing brace of entitiy [...111 lines suppressed...] - if (strcmp(token,"0032") && strcmp(token,"0064")) + if (!ulStrEqual(token,"0032") && !ulStrEqual (token,"0064")) { parser.error("not X format, invalid Header"); return FALSE ; @@ -692,6 +723,7 @@ current_options = ssgGetCurrentOptions () ; currentState = NULL; + globalMaterialList = NULL; top_branch = new ssgBranch ; curr_branch_ = top_branch; if ( !parser.openFile( fname, &parser_spec )) @@ -707,5 +739,6 @@ // parse_free(); parser.closeFile(); + delete globalMaterialList; return top_branch ; } |
From: Wolfram K. <wol...@us...> - 2004-12-02 20:56:41
|
Update of /cvsroot/plib/plib/src/ssg In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31821/ssg Modified Files: ssgLoadASC.cxx Log Message: ulStrNEqual works differently than strnicmp, I had not taken this into account when changing over. Index: ssgLoadASC.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgLoadASC.cxx,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- ssgLoadASC.cxx 29 Oct 2004 22:28:16 -0000 1.3 +++ ssgLoadASC.cxx 2 Dec 2004 20:56:30 -0000 1.4 @@ -55,13 +55,13 @@ while((*p == ' ') || (*p == 9)) p++; // p points to the first word (or the line end) now. - if(0 == ulStrNEqual(p, "Page", strlen("Page"))) + if(ulStrNEqual(p, "Page", strlen("Page"))) { // Since this loader ignores the line structure, // we can also ignore the \n or \r and just "delete" the whole line line[0] = 0; } - if(0 == ulStrNEqual(p, "Camera", strlen("Camera"))) + if(ulStrNEqual(p, "Camera", strlen("Camera"))) line[0] = 0; } @@ -551,7 +551,7 @@ s[strlen(s)-1]=0; // **** search for it **** for(int i=0; i<noOfAscmaterials; i++) - if(0==ulStrEqual(s, AscMaterials[i].sName)) + if(ulStrEqual(s, AscMaterials[i].sName)) return i; // **** not found - create it **** AscMaterials[noOfAscmaterials].sName = new char[strlen(s)+1]; @@ -606,7 +606,7 @@ // "Vertex 0: X:115.710701 Y:180.000305 Z:-60.796242 U:0.048042 V:0.996284" { char *sNextToken = parser.peekAtNextToken( "vertex list?" ); - if(0 == ulStrEqual("list", sNextToken)) + if(ulStrEqual("list", sNextToken)) { parser.expectNextToken("list"); parser.expectNextToken(":"); @@ -655,7 +655,7 @@ // "Face 0: A:0 B:10 C:7 AB:1 BC:1 CA:1" { char *sNextToken = parser.peekAtNextToken( "Face list?" ); - if(0 == ulStrEqual("list", sNextToken)) + if(ulStrEqual("list", sNextToken)) { parser.expectNextToken("list"); parser.expectNextToken(":"); |
From: Wolfram K. <wol...@us...> - 2004-12-02 20:12:06
|
Update of /cvsroot/plib/plib/src/js In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20472 Modified Files: jsWindows.cxx Log Message: changed _JS_MAX_AXES to _JS_MAX_AXES_WIN Index: jsWindows.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/js/jsWindows.cxx,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- jsWindows.cxx 21 Sep 2004 11:45:55 -0000 1.5 +++ jsWindows.cxx 2 Dec 2004 20:11:56 -0000 1.6 @@ -126,7 +126,7 @@ // X,Y,Z,R,U,V,POV - not necessarily the first n of these. if ( os->jsCaps.wCaps & JOYCAPS_HASPOV ) { - num_axes = _JS_MAX_AXES ; + num_axes = _JS_MAX_AXES_WIN ; min [ 7 ] = -1.0 ; max [ 7 ] = 1.0 ; // POV Y min [ 6 ] = -1.0 ; max [ 6 ] = 1.0 ; // POV X } |
From: Wolfram K. <wol...@us...> - 2004-12-01 08:28:18
|
Update of /cvsroot/plib/plib/src/ssg In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20212/ssg Modified Files: ssg.h ssgLoadAC.cxx ssgOptimiser.cxx ssgSaveAC.cxx ssgTransform.cxx ssgVtxArray.cxx ssgVtxTable.cxx Log Message: Patch by Mathias Fröhlich. For the discussion, see the thread "[Plib-devel] [PATCH] crease for ac3d files and speedup" in the mailing list, starting Fri, 8 Oct 2004. Implemented "crease" feature in AC files. AC loader cleanup. Optimisations for runtime speed. In ssgOptimizer.cxx, in the stripify function, check whether the nodes are named. Index: ssg.h =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssg.h,v retrieving revision 1.174 retrieving revision 1.175 diff -u -d -r1.174 -r1.175 --- ssg.h 29 Oct 2004 22:24:08 -0000 1.174 +++ ssg.h 1 Dec 2004 08:28:05 -0000 1.175 @@ -1472,18 +1472,14 @@ void getTexCoordList ( void **list ) { *list = texcoords -> get ( 0 ) ; } void getColourList ( void **list ) { *list = colours -> get ( 0 ) ; } - float *getVertex (int i){ if(i>=getNumVertices())i=getNumVertices()-1; - return (getNumVertices()<=0) ? - _ssgVertex000 : vertices->get(i);} - float *getNormal (int i){ if(i>=getNumNormals())i=getNumNormals()-1; - return (getNumNormals()<=0) ? - _ssgNormalUp : normals->get(i);} - float *getTexCoord(int i){ if(i>=getNumTexCoords())i=getNumTexCoords()-1; - return (getNumTexCoords()<=0) ? - _ssgTexCoord00 : texcoords->get(i);} - float *getColour (int i){ if(i>=getNumColours())i=getNumColours()-1; - return (getNumColours()<=0) ? - _ssgColourWhite : colours->get(i);} + float *getVertex (int i){ int nv=getNumVertices(); if(i>=nv)i=nv-1; + return (nv<=0) ? _ssgVertex000:vertices->get(i);} + float *getNormal (int i){ int nn=getNumNormals(); if(i>=nn)i=nn-1; + return (nn<=0) ? _ssgNormalUp:normals->get(i);} + float *getTexCoord(int i){ int nc=getNumTexCoords(); if(i>=nc)i=nc-1; + return (nc<=0) ? _ssgTexCoord00:texcoords->get(i);} + float *getColour (int i){ int nc=getNumColours(); if(i>=nc)i=nc-1; + return (nc<=0) ? _ssgColourWhite:colours->get(i);} ssgVtxArray *getAs_ssgVtxArray (); @@ -1589,9 +1585,8 @@ void getIndexList ( void **list ) { *list = indices -> get ( 0 ) ; } - short *getIndex (int i){ if(i>=getNumIndices())i=getNumIndices()-1; - return (getNumIndices()<=0) ? - &_ssgIndex0 : indices->get(i);} + short *getIndex (int i){ int ni=getNumIndices();if(i>=ni)i=ni-1; + return (ni<=0) ? &_ssgIndex0 : indices->get(i);} void removeUnusedVertices(); virtual ~ssgVtxArray (void) ; Index: ssgLoadAC.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgLoadAC.cxx,v retrieving revision 1.34 retrieving revision 1.35 diff -u -d -r1.34 -r1.35 --- ssgLoadAC.cxx 2 Oct 2004 12:12:28 -0000 1.34 +++ ssgLoadAC.cxx 1 Dec 2004 08:28:05 -0000 1.35 @@ -23,35 +23,43 @@ #include "ssgLocal.h" +#include "ssgVertSplitter.h" static FILE *loader_fd ; struct _ssgMaterial { + sgVec4 rgba ; sgVec4 spec ; [...565 lines suppressed...] - vtab = NULL ; - current_material = NULL ; - current_colour = NULL ; current_tfname = NULL ; current_branch = NULL ; + current_crease = 61.0 ; + sgSetVec2 ( texrep, 1.0, 1.0 ) ; sgSetVec2 ( texoff, 0.0, 0.0 ) ; @@ -698,7 +938,6 @@ delete [] current_tfname ; current_tfname = NULL ; - delete [] vtab ; fclose ( loader_fd ) ; return current_branch ; Index: ssgOptimiser.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgOptimiser.cxx,v retrieving revision 1.35 retrieving revision 1.36 diff -u -d -r1.35 -r1.36 --- ssgOptimiser.cxx 4 Oct 2004 08:18:26 -0000 1.35 +++ ssgOptimiser.cxx 1 Dec 2004 08:28:05 -0000 1.36 @@ -869,7 +869,7 @@ switch ( b_ent -> getNumKids () ) { case 0: - if ( b_ent -> getUserData() == NULL ) + if ( b_ent -> getUserData() == NULL && b_ent -> getName () == NULL ) safe_replace_kid ( NULL, b_ent, NULL ) ; break; @@ -877,7 +877,13 @@ if ( b_ent -> isA ( ssgTypeBranch () ) && b_ent -> getUserData () == NULL ) { - safe_replace_kid ( NULL, b_ent, b_ent -> getKid ( 0 ) ) ; + ssgEntity *k = b_ent -> getKid ( 0 ) ; + if ( b_ent -> getName () != NULL && k -> getName () != NULL ) + break; + if ( b_ent -> getName () != NULL ) + k -> setName ( b_ent -> getName () ) ; + + safe_replace_kid ( NULL, b_ent, k ) ; } else if ( ! b_ent -> isAKindOf ( ssgTypeSelector () ) && b_ent -> getKid ( 0 ) -> isA ( ssgTypeBranch () ) && Index: ssgSaveAC.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgSaveAC.cxx,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- ssgSaveAC.cxx 4 May 2004 12:43:54 -0000 1.20 +++ ssgSaveAC.cxx 1 Dec 2004 08:28:05 -0000 1.21 @@ -119,7 +119,7 @@ for ( i = 0 ; i < num_tris ; i++ ) { - fprintf ( save_fd, "SURF 0x0\n" ) ; + fprintf ( save_fd, "SURF 0x0%x\n", (! vt -> getCullFace () ) << 5 ) ; ssgState *s = vt->getState (); int istate = 0; Index: ssgTransform.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgTransform.cxx,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- ssgTransform.cxx 29 Nov 2002 19:39:48 -0000 1.13 +++ ssgTransform.cxx 1 Dec 2004 08:28:05 -0000 1.14 @@ -165,33 +165,36 @@ void ssgTransform::setTransform ( sgVec3 xyz ) { - updateTransform () ; - sgMakeTransMat4 ( transform, xyz ) ; - firsttime () ; - dirtyBSphere () ; + sgMat4 tmp_trans; + sgMakeTransMat4 ( tmp_trans, xyz ) ; + setTransform ( tmp_trans ) ; } void ssgTransform::setTransform ( sgCoord *xform ) { - updateTransform () ; - sgMakeCoordMat4 ( transform, xform ) ; - firsttime () ; - dirtyBSphere () ; + sgMat4 tmp_trans; + sgMakeCoordMat4 ( tmp_trans, xform ) ; + setTransform ( tmp_trans ) ; } void ssgTransform::setTransform ( sgCoord *xform, float sx, float sy, float sz ) { - updateTransform () ; - sgMakeCoordMat4 ( transform, xform ) ; - sgScaleVec3 ( transform[0], sx ) ; - sgScaleVec3 ( transform[1], sy ) ; - sgScaleVec3 ( transform[2], sz ) ; - firsttime () ; - dirtyBSphere () ; + sgMat4 tmp_trans; + sgMakeCoordMat4 ( tmp_trans, xform ) ; + sgScaleVec3 ( tmp_trans[0], sx ) ; + sgScaleVec3 ( tmp_trans[1], sy ) ; + sgScaleVec3 ( tmp_trans[2], sz ) ; + setTransform ( tmp_trans ); } void ssgTransform::setTransform ( sgMat4 xform ) { + if ( sgEqualVec4( xform[0], transform[0] ) && + sgEqualVec4( xform[1], transform[1] ) && + sgEqualVec4( xform[2], transform[2] ) && + sgEqualVec4( xform[3], transform[3] ) ) + return; + updateTransform () ; sgCopyMat4 ( transform, xform ) ; firsttime () ; Index: ssgVtxArray.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgVtxArray.cxx,v retrieving revision 1.28 retrieving revision 1.29 diff -u -d -r1.28 -r1.29 --- ssgVtxArray.cxx 13 Sep 2004 12:01:15 -0000 1.28 +++ ssgVtxArray.cxx 1 Dec 2004 08:28:05 -0000 1.29 @@ -195,13 +195,13 @@ return; } if(normals) - if(normals->getNum() != 0) + if(1 < normals->getNum()) doNormals = TRUE; if(texcoords) - if(texcoords->getNum() != 0) + if(1 < texcoords->getNum()) doTexCoords = TRUE; if(colours) - if(colours->getNum() != 0) + if(1 < colours->getNum()) doColours = TRUE; long * oldIndex2NewIndex = new long[vertices->getNum()]; Index: ssgVtxTable.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgVtxTable.cxx,v retrieving revision 1.37 retrieving revision 1.38 diff -u -d -r1.37 -r1.38 --- ssgVtxTable.cxx 13 Sep 2004 11:43:08 -0000 1.37 +++ ssgVtxTable.cxx 1 Dec 2004 08:28:05 -0000 1.38 @@ -407,7 +407,9 @@ */ - for ( i = 0 ; i < getNumVertices() ; i++ ) + int num_vertices = getNumVertices () ; + int num_normals = getNumNormals () ; + for ( i = 0 ; i < num_vertices ; i++ ) sgXformPnt3 ( vertices->get(i), vertices->get(i), m ) ; @@ -444,17 +446,17 @@ sgScaleVec3 ( w[2], m[2], scale ) ; } - for ( i = 0 ; i < getNumNormals() ; i++ ) + for ( i = 0 ; i < num_normals ; i++ ) sgXformVec3 ( normals->get(i), normals->get(i), w ) ; } else - for ( i = 0 ; i < getNumNormals() ; i++ ) + for ( i = 0 ; i < num_normals ; i++ ) sgXformVec3 ( normals->get(i), normals->get(i), m ) ; if ( ( flags & SG_NONORTHO ) ) { - for ( i = 0 ; i < getNumNormals() ; i++ ) + for ( i = 0 ; i < num_normals ; i++ ) sgNormaliseVec3 ( normals->get(i) ) ; } @@ -468,7 +470,8 @@ emptyBSphere () ; bbox . empty () ; - for ( int i = 0 ; i < getNumVertices() ; i++ ) + int num_vertices = getNumVertices () ; + for ( int i = 0 ; i < num_vertices ; i++ ) bbox . extend ( vertices->get(i) ) ; extendBSphere ( & bbox ) ; |
From: Wolfram K. <wol...@us...> - 2004-10-30 16:11:41
|
Update of /cvsroot/plib/plib/src/util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2158 Modified Files: ul.cxx Log Message: Added two conspicuous warnings in comments for others not to fall into the same trap as I did. Index: ul.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/util/ul.cxx,v retrieving revision 1.33 retrieving revision 1.34 diff -u -d -r1.33 -r1.34 --- ul.cxx 16 Dec 2003 22:32:43 -0000 1.33 +++ ul.cxx 30 Oct 2004 16:11:07 -0000 1.34 @@ -417,9 +417,15 @@ // string comparisons that are *not* case sensitive: /* + + I'm sick of half the machines on the planet supporting strncasecmp and the other half strnicmp - so here is my own - offering: + offering. + + **** ATTENTION **** + WK: If you used strnicmp, make sure you realise the completely + changed meaning of the return value - 0 means not equal! */ int ulStrNEqual ( const char *s1, const char *s2, int len ) @@ -457,7 +463,11 @@ /* I'm sick of half the machines on the planet supporting strcasecmp and the other half stricmp - so here is my own - offering: + offering. + + **** ATTENTION **** + WK: If you used strnicmp, make sure you realise the completely + changed meaning of the return value - 0 means not equal! */ int ulStrEqual ( const char *s1, const char *s2 ) |
From: Wolfram K. <wol...@us...> - 2004-10-29 22:46:34
|
Update of /cvsroot/plib/plib/src/ssg In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8269 Modified Files: Makefile.am Log Message: Added ssgAnimTransform.cxx Index: Makefile.am =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/Makefile.am,v retrieving revision 1.47 retrieving revision 1.48 diff -u -d -r1.47 -r1.48 --- Makefile.am 4 Oct 2004 08:03:36 -0000 1.47 +++ Makefile.am 29 Oct 2004 22:46:25 -0000 1.48 @@ -26,7 +26,7 @@ ssgLoadMDL.h ssgSave3ds.cxx ssgAxisTransform.cxx ssgLoadATG.cxx \ ssgSaveFLT.cxx ssgSaveATG.cxx ssgLoadIV.cxx ssgLoad.cxx ssgLoadVRML.h \ ssgLoadMDL_BGLTexture.cxx ssgLoadXPlaneObj.cxx ssgLoadASC.cxx ssgSaveASC.cxx \ - ssgSaveIV.cxx \ + ssgSaveIV.cxx ssgAnimTransform.cxx\ ssgVertSplitter.h ssgVertSplitter.cxx ssgStatistics.cxx INCLUDES = -I$(top_srcdir)/src/sg -I$(top_srcdir)/src/util |