plib-cvs Mailing List for PLIB (Page 22)
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: Steve B. <sj...@us...> - 2002-11-30 00:41:53
|
Update of /cvsroot/plib/plib/src/js In directory sc8-pr-cvs1:/tmp/cvs-serv1232/plib/src/js Modified Files: js.h jsMacOS.cxx Log Message: Cleared up some compile errors...replaced more ad-hoc ifdef's with UL_whatever tokens. Index: js.h =================================================================== RCS file: /cvsroot/plib/plib/src/js/js.h,v retrieving revision 1.27 retrieving revision 1.28 diff -u -d -r1.27 -r1.28 --- js.h 29 Nov 2002 19:39:48 -0000 1.27 +++ js.h 30 Nov 2002 00:41:49 -0000 1.28 @@ -50,7 +50,13 @@ #if defined(JS_VERSION) && JS_VERSION >= 0x010000 # define JS_NEW -#else +#endif +#endif + +#define JS_TRUE 1 +#define JS_FALSE 0 + +#ifndef JS_RETURN /* We'll put these values in and that should @@ -68,11 +74,6 @@ # define JS_RETURN (sizeof(struct JS_DATA_TYPE)) #endif -#endif - -#define JS_TRUE 1 -#define JS_FALSE 0 - class jsJoystick { Index: jsMacOS.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/js/jsMacOS.cxx,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- jsMacOS.cxx 29 Nov 2002 19:39:48 -0000 1.1 +++ jsMacOS.cxx 30 Nov 2002 00:41:49 -0000 1.2 @@ -23,7 +23,7 @@ #include "js.h" -#ifdef _JS_MACINTOSH +#ifdef UL_MACINTOSH #define _JS_MAX_AXES 9 |
From: Steve B. <sj...@us...> - 2002-11-30 00:41:52
|
Update of /cvsroot/plib/plib/src/net In directory sc8-pr-cvs1:/tmp/cvs-serv1232/plib/src/net Modified Files: netMessage.h netSocket.cxx Log Message: Cleared up some compile errors...replaced more ad-hoc ifdef's with UL_whatever tokens. Index: netMessage.h =================================================================== RCS file: /cvsroot/plib/plib/src/net/netMessage.h,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- netMessage.h 2 Sep 2002 06:05:44 -0000 1.8 +++ netMessage.h 30 Nov 2002 00:41:49 -0000 1.9 @@ -42,7 +42,7 @@ #include "netBuffer.h" -#if defined(__CYGWIN__) || !defined (WIN32) +#ifndef UL_MSVC #include <netinet/in.h> // ntohs() etc prototypes #endif Index: netSocket.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/net/netSocket.cxx,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- netSocket.cxx 2 Sep 2002 06:05:44 -0000 1.23 +++ netSocket.cxx 30 Nov 2002 00:41:49 -0000 1.24 @@ -23,9 +23,9 @@ #include "netSocket.h" -#if defined(__CYGWIN__) || !defined (WIN32) +#if defined(UL_CYGWIN) || !defined (UL_WIN32) -#if defined(__APPLE__) +#if defined(UL_MAC_OSX) # include <netinet/in.h> #endif @@ -45,7 +45,7 @@ #endif -#if defined(_MSC_VER) && !defined(socklen_t) +#if defined(UL_MSVC) && !defined(socklen_t) #define socklen_t int #endif @@ -186,7 +186,7 @@ { assert ( handle != -1 ) ; -#if defined(__CYGWIN__) || !defined (WIN32) +#if defined(UL_CYGWIN) || !defined (UL_WIN32) int delay_flag = ::fcntl (handle, F_GETFL, 0); if (blocking) @@ -210,7 +210,7 @@ int result; if ( broadcast ) { int one = 1; -#ifdef WIN32 +#ifdef UL_WIN32 result = ::setsockopt( handle, SOL_SOCKET, SO_BROADCAST, (char*)&one, sizeof(one) ); #else result = ::setsockopt( handle, SOL_SOCKET, SO_BROADCAST, &one, sizeof(one) ); @@ -292,7 +292,7 @@ { if ( handle != -1 ) { -#if defined(__CYGWIN__) || !defined (WIN32) +#if defined(UL_CYGWIN) || !defined (UL_WIN32) ::close( handle ); #else ::closesocket( handle ); @@ -304,7 +304,7 @@ bool netSocket::isNonBlockingError () { -#if defined(__CYGWIN__) || !defined (WIN32) +#if defined(UL_CYGWIN) || !defined (UL_WIN32) switch (errno) { case EWOULDBLOCK: // always == NET_EAGAIN? case EALREADY: @@ -403,7 +403,7 @@ /* Init/Exit functions */ static void netExit ( void ) { -#if defined(__CYGWIN__) || !defined (WIN32) +#if defined(UL_CYGWIN) || !defined (UL_WIN32) #else /* Clean up windows networking */ if ( WSACleanup() == SOCKET_ERROR ) { @@ -419,7 +419,7 @@ { assert ( sizeof(sockaddr_in) == sizeof(netAddress) ) ; -#if defined(__CYGWIN__) || !defined (WIN32) +#if defined(UL_CYGWIN) || !defined (UL_WIN32) #else /* Start up the windows networking */ WORD version_wanted = MAKEWORD(1,1); @@ -444,3 +444,5 @@ va_end(argptr); return( buffer ); } + + |
From: Steve B. <sj...@us...> - 2002-11-30 00:41:52
|
Update of /cvsroot/plib/plib/src/pui In directory sc8-pr-cvs1:/tmp/cvs-serv1232/plib/src/pui Modified Files: pu.cxx puFilePicker.cxx puFileSelector.cxx puLocal.h Log Message: Cleared up some compile errors...replaced more ad-hoc ifdef's with UL_whatever tokens. Index: pu.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/pui/pu.cxx,v retrieving revision 1.61 retrieving revision 1.62 diff -u -d -r1.61 -r1.62 --- pu.cxx 19 Sep 2002 23:32:57 -0000 1.61 +++ pu.cxx 30 Nov 2002 00:41:49 -0000 1.62 @@ -23,14 +23,12 @@ #include "puLocal.h" -#ifndef WIN32 -# if defined(macintosh) -# include <agl.h> -# elif defined(__APPLE__) +#if defined(UL_MACINTOSH) +# include <agl.h> +#elif defined(UL_MAC_OSX) # include <OpenGL/CGLCurrent.h> -# else -# include <GL/glx.h> -# endif +#else +# include <GL/glx.h> #endif int puRefresh = TRUE ; @@ -106,11 +104,11 @@ { #if defined(CONSOLE) return true ; -#elif defined(WIN32) +#elif defined(UL_WIN32) return ( wglGetCurrentContext () != NULL ) ; -#elif defined(macintosh) +#elif defined(UL_MACINTOSH) return ( aglGetCurrentContext () != NULL ) ; -#elif defined(__APPLE__) +#elif defined(UL_MAC_OSX) return ( CGLGetCurrentContext () != NULL ) ; #else return ( glXGetCurrentContext () != NULL ) ; Index: puFilePicker.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/pui/puFilePicker.cxx,v retrieving revision 1.31 retrieving revision 1.32 diff -u -d -r1.31 -r1.32 --- puFilePicker.cxx 21 Sep 2002 17:47:09 -0000 1.31 +++ puFilePicker.cxx 30 Nov 2002 00:41:49 -0000 1.32 @@ -45,7 +45,7 @@ UL_RTTI_DEF1(puFilePicker,puDialogBox) -#if defined(WIN32) && !defined(__CYGWIN__) +#ifdef UL_MSVC #define DOTDOTSLASH "..\\" #define SLASH "\\" #else @@ -381,7 +381,7 @@ listing. */ -#if defined(WIN32) +#ifdef UL_WIN32 if ( c1 >= 'a' && c1 <= 'z' ) c1 = c1 - ('a'-'A') ; Index: puFileSelector.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/pui/puFileSelector.cxx,v retrieving revision 1.32 retrieving revision 1.33 diff -u -d -r1.32 -r1.33 --- puFileSelector.cxx 17 Oct 2002 12:04:58 -0000 1.32 +++ puFileSelector.cxx 30 Nov 2002 00:41:49 -0000 1.33 @@ -46,7 +46,7 @@ UL_RTTI_DEF1(puFileSelector,puDialogBox) -#if defined(WIN32) && !defined(__CYGWIN__) +#ifdef UL_MSVC #define DOTDOTSLASH "..\\" #define SLASH "\\" #else @@ -95,7 +95,7 @@ static bool is_slash ( char ch ) { -#if defined(WIN32) +#ifdef UL_WIN32 /* win32 can use back or forward slash */ return ch == '\\' || ch == '/' ; #else @@ -484,7 +484,7 @@ listing. */ -#if defined(WIN32) && !defined(__CYGWIN__) +#ifdef UL_MSVC if ( c1 >= 'a' && c1 <= 'z' ) c1 = c1 - ('a'-'A') ; Index: puLocal.h =================================================================== RCS file: /cvsroot/plib/plib/src/pui/puLocal.h,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- puLocal.h 19 Sep 2002 23:32:58 -0000 1.11 +++ puLocal.h 30 Nov 2002 00:41:49 -0000 1.12 @@ -32,7 +32,7 @@ # ifdef FREEGLUT_IS_PRESENT # include <GL/freeglut.h> # else -# ifdef __APPLE__ +# ifdef UL_MAC_OSX # include <GLUT/glut.h> # else # include <GL/glut.h> |
From: Steve B. <sj...@us...> - 2002-11-29 19:39:51
|
Update of /cvsroot/plib/plib/src/util In directory sc8-pr-cvs1:/tmp/cvs-serv26502/plib/src/util Modified Files: ul.cxx ul.h ulClock.cxx Log Message: Major rework of JS library. Cleaned up OS type flags in conditional compilations. Index: ul.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/util/ul.cxx,v retrieving revision 1.30 retrieving revision 1.31 diff -u -d -r1.30 -r1.31 --- ul.cxx 26 Oct 2002 19:00:56 -0000 1.30 +++ ul.cxx 29 Nov 2002 19:39:48 -0000 1.31 @@ -27,14 +27,13 @@ #include <sys/types.h> #include <sys/stat.h> -#if defined(__CYGWIN__) || !defined(WIN32) -#include <dirent.h> -#elif defined(WIN32) +#ifdef UL_MSVC #include <direct.h> +#else +#include <dirent.h> #endif [...429 lines suppressed...] pathname[1] == ':' && ( pathname[2] == SLASH[0] || pathname[2] == '/' ) ) ; -#elif defined(macintosh) +#elif defined(UL_MACINTOSH) return (pathname [0] != ':' && strchr( pathname, ':') != NULL ); -#else +#else return pathname [0] == SLASH[0] ; #endif } @@ -490,7 +525,7 @@ has enough space for 'maxlength-1' characters and a '\0'. */ -#if defined(_MSC_VER) || defined(__MINGW__) +#ifdef UL_MSVC return _getcwd ( result, maxlength ) ; #else return getcwd ( result, maxlength ) ; Index: ul.h =================================================================== RCS file: /cvsroot/plib/plib/src/util/ul.h,v retrieving revision 1.55 retrieving revision 1.56 diff -u -d -r1.55 -r1.56 --- ul.h 11 Sep 2002 22:29:43 -0000 1.55 +++ ul.h 29 Nov 2002 19:39:48 -0000 1.56 @@ -44,50 +44,86 @@ #include <ctype.h> #include <assert.h> -#if !defined(WIN32) && (defined(_WIN32) || defined(__WIN32__) || \ - defined(__CYGWIN__) || defined(_MSC_VER)) -# define WIN32 +/**********************\ +* * +* Determine OS type * +* * +\**********************/ [...163 lines suppressed...] @@ -547,9 +583,8 @@ } }; -#elif defined (__APPLE__) +#elif defined (UL_MAC_OSX) -/* Mac OS X */ class ulDynamicLibrary { @@ -651,7 +686,7 @@ } } ; -#endif /* if defined(WIN32) */ +#endif class ulList Index: ulClock.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/util/ulClock.cxx,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- ulClock.cxx 2 Sep 2002 06:05:49 -0000 1.8 +++ ulClock.cxx 29 Nov 2002 19:39:48 -0000 1.9 @@ -24,46 +24,44 @@ #include <stdio.h> #include <stdlib.h> -#if defined(WIN32) -#include <windows.h> -#include <mmsystem.h> - #ifdef __CYGWIN__ +#include "ul.h" + +#ifdef UL_CYGWIN typedef long long _int64; #define LARGEINTEGER _int64 -// #include <largeint.h> - #endif #else #include <sys/time.h> #endif + #include <time.h> -#include "ul.h" +#ifdef UL_WIN32 -#if defined(WIN32) double ulClock::res ; int ulClock::perf_timer = -1; void ulClock::initPerformanceTimer () { - if( perf_timer == -1 ) { - /* Use Performance Timer if it's available, mmtimer if not. */ + if ( perf_timer == -1 ) + { + /* Use Performance Timer if it's available, mmtimer if not. */ - __int64 frequency ; + __int64 frequency ; - perf_timer = QueryPerformanceFrequency ( (LARGE_INTEGER *) & frequency ) ; + perf_timer = QueryPerformanceFrequency ( (LARGE_INTEGER *) & frequency ) ; - if ( perf_timer ) - { - res = 1.0 / (double) frequency ; - perf_timer = 1 ; - } - } + if ( perf_timer ) + { + res = 1.0 / (double) frequency ; + perf_timer = 1 ; + } + } } #endif double ulClock::getRawTime () const { -#if defined(WIN32) +#ifdef UL_WIN32 /* Use Performance Timer if it's available, mmtimer if not. */ |
From: Steve B. <sj...@us...> - 2002-11-29 19:39:51
|
Update of /cvsroot/plib/plib/src/js In directory sc8-pr-cvs1:/tmp/cvs-serv26502/plib/src/js Modified Files: Makefile.am js.cxx js.h Added Files: README jsBSD.cxx jsLinux.cxx jsLinuxOld.cxx jsMacOS.cxx jsWindows.cxx Log Message: Major rework of JS library. Cleaned up OS type flags in conditional compilations. --- NEW FILE: README --- Joystick interfaces are horribly non-portable. Using conditional compilation on a line-by-line basis became FAR too complex after more than a couple of OS's were supported so now there is on standard interface header: js.h ...one set of common routines: js.cxx ...and a bunch of OS-specific code: jsLinux.cxx jsLinuxOld.cxx jsWindows.cxx jsBSD.cxx jsMacOS.cxx --- NEW FILE: jsBSD.cxx --- /* PLIB - A Suite of Portable Game Libraries Copyright (C) 1998,2002 Steve Baker This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library 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 Library General Public License for more details. You should have received a copy of the GNU Library 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 [...104 lines suppressed...] if ( status != JS_RETURN_SIZE ) { perror ( fname ) ; setError () ; return ; } if ( buttons != NULL ) *buttons = ( js.b1 ? 1 : 0 ) | ( js.b2 ? 2 : 0 ) ; if ( axes != NULL ) { axes[0] = (float) js.x ; axes[1] = (float) js.y ; } } #endif --- NEW FILE: jsLinux.cxx --- /* PLIB - A Suite of Portable Game Libraries Copyright (C) 1998,2002 Steve Baker This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library 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 Library General Public License for more details. You should have received a copy of the GNU Library 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 [...126 lines suppressed...] default: ulSetError ( UL_WARNING, "PLIB_JS: Unrecognised /dev/js return!?!" ) ; /* use the old values */ if ( buttons != NULL ) *buttons = tmp_buttons ; if ( axes != NULL ) memcpy ( axes, tmp_axes, sizeof(float) * num_axes ) ; return ; } if ( buttons != NULL ) *buttons = tmp_buttons ; } } #endif --- NEW FILE: jsLinuxOld.cxx --- /* PLIB - A Suite of Portable Game Libraries Copyright (C) 1998,2002 Steve Baker This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library 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 Library General Public License for more details. You should have received a copy of the GNU Library 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 [...94 lines suppressed...] if ( status != JS_RETURN ) { perror ( fname ) ; setError () ; return ; } if ( buttons != NULL ) *buttons = js.buttons ; if ( axes != NULL ) { axes[0] = (float) js.x ; axes[1] = (float) js.y ; } } #endif --- NEW FILE: jsMacOS.cxx --- /* PLIB - A Suite of Portable Game Libraries Copyright (C) 1998,2002 Steve Baker This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library 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 Library General Public License for more details. You should have received a copy of the GNU Library 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 [...159 lines suppressed...] err = ISpElement_GetSimpleState ( isp_elem [ i + isp_num_axis ], &state) ; ISP_CHECK_ERR(err) *buttons |= state << i ; } } if ( axes != NULL ) { for ( i = 0 ; i < num_axes ; i++ ) { err = ISpElement_GetSimpleState ( isp_elem [ i ], &state ) ; ISP_CHECK_ERR(err) axes [i] = (float) state ; } } } #endif --- NEW FILE: jsWindows.cxx --- /* PLIB - A Suite of Portable Game Libraries Copyright (C) 1998,2002 Steve Baker This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library 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 Library General Public License for more details. You should have received a copy of the GNU Library 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 [...209 lines suppressed...] axes [ 7 ] = ( s < 0.0 ) ? -c/s : c/s ; } } case 6: axes[5] = (float) js . dwVpos ; case 5: axes[4] = (float) js . dwUpos ; case 4: axes[3] = (float) js . dwRpos ; case 3: axes[2] = (float) js . dwZpos ; case 2: axes[1] = (float) js . dwYpos ; case 1: axes[0] = (float) js . dwXpos ; break; default: ulSetError ( UL_WARNING, "PLIB_JS: Wrong num_axes. Joystick input is now invalid" ) ; } } } #endif Index: Makefile.am =================================================================== RCS file: /cvsroot/plib/plib/src/js/Makefile.am,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- Makefile.am 1 Sep 2002 00:29:28 -0000 1.7 +++ Makefile.am 29 Nov 2002 19:39:48 -0000 1.8 @@ -4,7 +4,8 @@ include_HEADERS = js.h -libplibjs_a_SOURCES = js.cxx +libplibjs_a_SOURCES = js.cxx jsLinux.cxx jsLinuxOld.cxx jsMacOS.cxx \ + jsWindows.cxx jsBSD.cxx INCLUDES = -I$(top_srcdir)/src/util Index: js.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/js/js.cxx,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- js.cxx 2 Sep 2002 06:05:43 -0000 1.2 +++ js.cxx 29 Nov 2002 19:39:48 -0000 1.3 @@ -24,4 +24,64 @@ void jsInit () {} +float jsJoystick::fudge_axis ( float value, int axis ) const +{ + if ( value < center[axis] ) + { + float xx = ( value - center[ axis ] ) / + ( center [ axis ] - min [ axis ] ) ; + + if ( xx < -saturate [ axis ] ) + return -1.0f ; + + if ( xx > -dead_band [ axis ] ) + return 0.0f ; + + xx = ( xx + dead_band [ axis ] ) / + ( saturate [ axis ] - dead_band [ axis ] ) ; + + return ( xx < -1.0f ) ? -1.0f : xx ; + } + else + { + float xx = ( value - center [ axis ] ) / + ( max [ axis ] - center [ axis ] ) ; + + if ( xx > saturate [ axis ] ) + return 1.0f ; + + if ( xx < dead_band [ axis ] ) + return 0.0f ; + + xx = ( xx - dead_band [ axis ] ) / + ( saturate [ axis ] - dead_band [ axis ] ) ; + + return ( xx > 1.0f ) ? 1.0f : xx ; + } +} + + +void jsJoystick::read ( int *buttons, float *axes ) +{ + if ( error ) + { + if ( buttons ) + *buttons = 0 ; + + if ( axes ) + for ( int i = 0 ; i < num_axes ; i++ ) + axes[i] = 0.0f ; + + return ; + } + + float raw_axes [ _JS_MAX_AXES ] ; + + rawRead ( buttons, raw_axes ) ; + + if ( axes ) + for ( int i = 0 ; i < num_axes ; i++ ) + axes[i] = fudge_axis ( raw_axes[i], i ) ; +} + Index: js.h =================================================================== RCS file: /cvsroot/plib/plib/src/js/js.h,v retrieving revision 1.26 retrieving revision 1.27 diff -u -d -r1.26 -r1.27 --- js.h 9 Sep 2002 22:27:53 -0000 1.26 +++ js.h 29 Nov 2002 19:39:48 -0000 1.27 @@ -30,121 +30,75 @@ #include <stdlib.h> #include <string.h> // -dw- for memcpy -#ifdef macintosh -# include <InputSprocket.h> -#endif - -/* - FreeBSD port - courtesy of Stephen Montgomery-Smith - <st...@ma...> - [...834 lines suppressed...] -# if defined(__FreeBSD__) || defined(__NetBSD__) - *buttons = ( js.b1 ? 1 : 0 ) | ( js.b2 ? 2 : 0 ) ; -# else - *buttons = js.buttons ; -# endif - - if ( axes != NULL ) - { - axes[0] = (float) js.x ; - axes[1] = (float) js.y ; - } -# endif -} - -#endif - -//lint -restore #endif |
From: Steve B. <sj...@us...> - 2002-11-29 19:39:51
|
Update of /cvsroot/plib/plib/src/ssg In directory sc8-pr-cvs1:/tmp/cvs-serv26502/plib/src/ssg Modified Files: ssg.h ssgEntity.cxx ssgTransform.cxx Log Message: Major rework of JS library. Cleaned up OS type flags in conditional compilations. Index: ssg.h =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssg.h,v retrieving revision 1.157 retrieving revision 1.158 diff -u -d -r1.157 -r1.158 --- ssg.h 10 Nov 2002 17:12:13 -0000 1.157 +++ ssg.h 29 Nov 2002 19:39:48 -0000 1.158 @@ -1135,6 +1135,9 @@ int preTravTests ( int *test_needed, int which ) ; void postTravTests ( int which ) ; + virtual void getNetTransform ( sgMat4 xform ) ; + virtual void getLastNetTransform ( sgMat4 xform ) ; + /* for backward compatibility */ virtual ssgCallback getCallback ( int cb_type ) ; virtual void setCallback ( int cb_type, ssgCallback cb ) ; @@ -1833,7 +1836,7 @@ double get_time() const { if (time_mode == SSG_ANIM_FRAME) - return static_cast<float>( ssgGetFrameCounter() ); + return (double) ssgGetFrameCounter() ; else return ck.update(), ck.getAbsTime(); } @@ -1993,6 +1996,9 @@ virtual void setTransform ( sgCoord *xform ) ; virtual void setTransform ( sgCoord *xform, float sx, float sy, float sz ) ; virtual void setTransform ( sgMat4 xform ) ; + + virtual void getNetTransform ( sgMat4 xform ) ; + virtual void getLastNetTransform ( sgMat4 xform ) ; virtual const char *getTypeName(void) ; virtual int load ( FILE *fd ) ; Index: ssgEntity.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgEntity.cxx,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- ssgEntity.cxx 9 Sep 2002 09:08:29 -0000 1.22 +++ ssgEntity.cxx 29 Nov 2002 19:39:48 -0000 1.23 @@ -379,3 +379,22 @@ } + +void ssgEntity::getNetTransform ( sgMat4 xform ) +{ + if ( getNumParents () > 0 ) + getParent ( 0 ) -> getNetTransform ( xform ) ; + else + sgMakeIdentMat4 ( xform ) ; +} + + +void ssgEntity::getLastNetTransform ( sgMat4 xform ) +{ + if ( getNumParents () > 0 ) + getParent ( 0 ) -> getLastNetTransform ( xform ) ; + else + sgMakeIdentMat4 ( xform ) ; +} + + Index: ssgTransform.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgTransform.cxx,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- ssgTransform.cxx 2 Sep 2002 06:05:49 -0000 1.12 +++ ssgTransform.cxx 29 Nov 2002 19:39:48 -0000 1.13 @@ -199,6 +199,32 @@ } +void ssgTransform::getNetTransform ( sgMat4 xform ) +{ + if ( getNumParents () > 0 ) + { + getParent ( 0 ) -> getNetTransform ( xform ) ; + sgPreMultMat4 ( xform, transform ) ; + } + else + sgCopyMat4 ( xform, transform ) ; +} + + +void ssgTransform::getLastNetTransform ( sgMat4 xform ) +{ + sgMat4 last_xform ; + getLastTransform ( last_xform ) ; + + if ( getNumParents () > 0 ) + { + getParent ( 0 ) -> getLastNetTransform ( xform ) ; + sgPreMultMat4 ( xform, last_xform ) ; + } + else + sgCopyMat4 ( xform, last_xform ) ; +} + int ssgTransform::load ( FILE *fd ) { |
From: Steve B. <sj...@us...> - 2002-11-10 17:12:17
|
Update of /cvsroot/plib/plib/src/ssg In directory usw-pr-cvs1:/tmp/cvs-serv20968/plib/src/ssg Modified Files: ssg.h ssgContext.cxx ssgTween.cxx ssgVTable.cxx ssgVtxTable.cxx Log Message: Added ability to override current rendering state. Index: ssg.h =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssg.h,v retrieving revision 1.156 retrieving revision 1.157 diff -u -d -r1.156 -r1.157 --- ssg.h 8 Nov 2002 18:35:07 -0000 1.156 +++ ssg.h 10 Nov 2002 17:12:13 -0000 1.157 @@ -2271,10 +2271,11 @@ ssgSimpleState *basicState ; sgFrustum *frustum ; - sgMat4 cameraMatrix ; - int cullFace ; - int ovTexture ; - int ovCullface ; + sgMat4 cameraMatrix ; + int cullFace ; + int ovTexture ; + int ovCullface ; + ssgState *ovState ; public: @@ -2311,6 +2312,7 @@ return ((i<0)||(i>=6)) ? NULL : clipPlane [i] ; } + void overrideState ( ssgState *s ) ; void overrideTexture ( int on_off ) ; void overrideCullface ( int on_off ) ; @@ -2325,6 +2327,8 @@ else glDisable ( GL_CULL_FACE ) ; } + ssgState *overriddenState () { return ovState ; } + int stateOverridden () { return ovState != NULL ; } int textureOverridden () { return ovTexture ; } int cullfaceOverridden () { return ovCullface ; } int cullfaceIsEnabled () { return cullFace ; } @@ -2379,6 +2383,11 @@ inline void ssgGetCameraPosition ( sgVec3 pos ) { _ssgCurrentContext -> getCameraPosition ( pos ) ; +} + +inline void ssgOverrideState ( ssgState *s ) +{ + _ssgCurrentContext->overrideState ( s ) ; } inline void ssgOverrideTexture ( int on_off ) Index: ssgContext.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgContext.cxx,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- ssgContext.cxx 28 Oct 2002 09:31:51 -0000 1.18 +++ ssgContext.cxx 10 Nov 2002 17:12:13 -0000 1.19 @@ -96,7 +96,11 @@ glEnable ( GL_CULL_FACE ) ; cullFace = TRUE ; - basicState -> force () ; + + if ( ovState != NULL ) + ovState -> force () ; + else + basicState -> force () ; } @@ -108,6 +112,11 @@ void ssgContext::getCameraPosition ( sgVec3 pos ) { sgCopyVec3 ( pos, cameraMatrix [ 3 ] ) ; +} + +void ssgContext::overrideState ( ssgState *s ) +{ + ovState = s ; } void ssgContext::overrideTexture ( int on_off ) Index: ssgTween.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgTween.cxx,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- ssgTween.cxx 4 Nov 2002 05:11:22 -0000 1.10 +++ ssgTween.cxx 10 Nov 2002 17:12:13 -0000 1.11 @@ -254,7 +254,11 @@ if ( ! preDraw () ) return ; - if ( hasState () ) getState () -> apply () ; + if ( _ssgCurrentContext-> stateOverridden () ) + _ssgCurrentContext -> overriddenState () -> apply () ; + else + if ( hasState () ) + getState () -> apply () ; stats_num_leaves++ ; stats_num_vertices += getNumVertices() ; Index: ssgVTable.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgVTable.cxx,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- ssgVTable.cxx 2 Sep 2002 06:05:49 -0000 1.16 +++ ssgVTable.cxx 10 Nov 2002 17:12:13 -0000 1.17 @@ -289,7 +289,11 @@ if ( ! preDraw () ) return ; - if ( hasState () ) getState () -> apply () ; + if ( _ssgCurrentContext-> stateOverridden () ) + _ssgCurrentContext -> overriddenState () -> apply () ; + else + if ( hasState () ) + getState () -> apply () ; stats_num_leaves++ ; stats_num_vertices += num_vertices ; Index: ssgVtxTable.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgVtxTable.cxx,v retrieving revision 1.30 retrieving revision 1.31 diff -u -d -r1.30 -r1.31 --- ssgVtxTable.cxx 2 Sep 2002 06:05:49 -0000 1.30 +++ ssgVtxTable.cxx 10 Nov 2002 17:12:13 -0000 1.31 @@ -439,7 +439,11 @@ if ( ! preDraw () ) return ; - if ( hasState () ) getState () -> apply () ; + if ( _ssgCurrentContext-> stateOverridden () ) + _ssgCurrentContext -> overriddenState () -> apply () ; + else + if ( hasState () ) + getState () -> apply () ; stats_num_leaves++ ; stats_num_vertices += getNumVertices() ; |
From: Steve B. <sj...@us...> - 2002-11-09 21:44:01
|
Update of /cvsroot/plib/plib/src/psl In directory usw-pr-cvs1:/tmp/cvs-serv26552/plib/src/psl Modified Files: pslFileIO.cxx Log Message: Ungetstack needed to be able to unget EOF markers. Index: pslFileIO.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/psl/pslFileIO.cxx,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- pslFileIO.cxx 27 Sep 2002 15:45:06 -0000 1.6 +++ pslFileIO.cxx 9 Nov 2002 21:43:58 -0000 1.7 @@ -33,7 +33,7 @@ FILE *fd ; char *fname ; - char ungetStack [ MAX_UNGET_CHAR ] ; + int ungetStack [ MAX_UNGET_CHAR ] ; int ungetSP ; int line_no ; |
From: Steve B. <sj...@us...> - 2002-11-09 21:38:31
|
Update of /cvsroot/plib/plib/src/ssg In directory usw-pr-cvs1:/tmp/cvs-serv21026/plib/src/ssg Modified Files: ssgLoadXPlaneObj.cxx Log Message: Replaced cstdio with stdio.h Index: ssgLoadXPlaneObj.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgLoadXPlaneObj.cxx,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- ssgLoadXPlaneObj.cxx 15 Oct 2002 19:43:04 -0000 1.2 +++ ssgLoadXPlaneObj.cxx 9 Nov 2002 21:38:28 -0000 1.3 @@ -35,8 +35,8 @@ * Point objects are not handled. */ -#include <cstdio> -#include <cstring> +#include <stdio.h> +#include <string.h> #include "ssgLocal.h" |
From: Sebastian U. <ud...@us...> - 2002-11-09 21:27:26
|
Update of /cvsroot/plib/plib/src/fnt In directory usw-pr-cvs1:/tmp/cvs-serv10999 Modified Files: fntLocal.h fntTXF.cxx Log Message: Removed some global namespace pollution Index: fntLocal.h =================================================================== RCS file: /cvsroot/plib/plib/src/fnt/fntLocal.h,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- fntLocal.h 2 Sep 2002 06:05:43 -0000 1.7 +++ fntLocal.h 9 Nov 2002 21:27:21 -0000 1.8 @@ -25,13 +25,13 @@ #include "fnt.h" -extern int isSwapped ; -extern FILE *curr_image_fd ; +extern int _fntIsSwapped ; +extern FILE *_fntCurrImageFd ; inline void _fnt_swab_short ( unsigned short *x ) { - if ( isSwapped ) + if ( _fntIsSwapped ) *x = (( *x >> 8 ) & 0x00FF ) | (( *x << 8 ) & 0xFF00 ) ; } @@ -39,7 +39,7 @@ inline void _fnt_swab_int ( unsigned int *x ) { - if ( isSwapped ) + if ( _fntIsSwapped ) *x = (( *x >> 24 ) & 0x000000FF ) | (( *x >> 8 ) & 0x0000FF00 ) | (( *x << 8 ) & 0x00FF0000 ) | @@ -49,7 +49,7 @@ inline void _fnt_swab_int_array ( int *x, int leng ) { - if ( ! isSwapped ) + if ( ! _fntIsSwapped ) return ; for ( int i = 0 ; i < leng ; i++ ) @@ -66,14 +66,14 @@ inline unsigned char _fnt_readByte () { unsigned char x ; - fread ( & x, sizeof(unsigned char), 1, curr_image_fd ) ; + fread ( & x, sizeof(unsigned char), 1, _fntCurrImageFd ) ; return x ; } inline unsigned short _fnt_readShort () { unsigned short x ; - fread ( & x, sizeof(unsigned short), 1, curr_image_fd ) ; + fread ( & x, sizeof(unsigned short), 1, _fntCurrImageFd ) ; _fnt_swab_short ( & x ) ; return x ; } @@ -81,7 +81,7 @@ inline unsigned int _fnt_readInt () { unsigned int x ; - fread ( & x, sizeof(unsigned int), 1, curr_image_fd ) ; + fread ( & x, sizeof(unsigned int), 1, _fntCurrImageFd ) ; _fnt_swab_int ( & x ) ; return x ; } Index: fntTXF.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/fnt/fntTXF.cxx,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- fntTXF.cxx 2 Sep 2002 06:05:43 -0000 1.16 +++ fntTXF.cxx 9 Nov 2002 21:27:21 -0000 1.17 @@ -49,8 +49,8 @@ #endif } -FILE *curr_image_fd ; -int isSwapped = FALSE ; +FILE *_fntCurrImageFd ; +int _fntIsSwapped = FALSE ; static void tex_make_mip_maps ( GLubyte *image, int xsize, int ysize, int zsize ) @@ -187,7 +187,7 @@ return FNT_FALSE ; } - curr_image_fd = fd ; + _fntCurrImageFd = fd ; unsigned char magic [ 4 ] ; @@ -206,10 +206,10 @@ return FNT_FALSE ; } - isSwapped = FALSE ; + _fntIsSwapped = FALSE ; int endianness = _fnt_readInt () ; - isSwapped = ( endianness != 0x12345678 ) ; + _fntIsSwapped = ( endianness != 0x12345678 ) ; int format = _fnt_readInt () ; int tex_width = _fnt_readInt () ; |
From: Steve B. <sj...@us...> - 2002-11-09 00:21:48
|
Update of /cvsroot/plib/plib In directory usw-pr-cvs1:/tmp/cvs-serv17361/plib Modified Files: configure.in Log Message: Added dependancy on pthreads. Index: configure.in =================================================================== RCS file: /cvsroot/plib/plib/configure.in,v retrieving revision 1.48 retrieving revision 1.49 diff -u -d -r1.48 -r1.49 --- configure.in 5 Sep 2002 06:14:56 -0000 1.48 +++ configure.in 9 Nov 2002 00:21:43 -0000 1.49 @@ -264,6 +264,7 @@ 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: Steve B. <sj...@us...> - 2002-11-08 18:35:10
|
Update of /cvsroot/plib/plib/src/ssg In directory usw-pr-cvs1:/tmp/cvs-serv29303/plib/src/ssg Modified Files: ssg.h ssgAnimation.cxx Log Message: Changed 'float' time to 'double'. Index: ssg.h =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssg.h,v retrieving revision 1.155 retrieving revision 1.156 diff -u -d -r1.155 -r1.156 --- ssg.h 4 Nov 2002 05:11:22 -0000 1.155 +++ ssg.h 8 Nov 2002 18:35:07 -0000 1.156 @@ -1808,10 +1808,10 @@ ssgAnimEnum running ; ssgAnimDirection mode ; - float start_time ; - float pause_time ; - float loop_time ; - float* times ; + double start_time ; + double pause_time ; + double loop_time ; + float *times ; int curr ; int start ; int end ; @@ -1830,7 +1830,7 @@ protected: virtual void copy_from ( ssgTimedSelector *src, int clone_flags ) ; - float get_time() const + double get_time() const { if (time_mode == SSG_ANIM_FRAME) return static_cast<float>( ssgGetFrameCounter() ); Index: ssgAnimation.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgAnimation.cxx,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- ssgAnimation.cxx 24 Oct 2002 14:21:23 -0000 1.15 +++ ssgAnimation.cxx 8 Nov 2002 18:35:07 -0000 1.16 @@ -63,8 +63,8 @@ select ( 1 ) ; running = SSG_ANIM_STOP ; mode = SSG_ANIM_SHUTTLE ; - start_time = pause_time = 0.0f ; - loop_time = 1.0f ; + start_time = pause_time = 0.0 ; + loop_time = 1.0 ; times = new float [ max_kids ] ; for ( int i = 0 ; i < max_kids ; i++ ) @@ -106,7 +106,7 @@ int ssgTimedSelector::getStep () { - float t = get_time () ; + double t = get_time () ; if ( running == SSG_ANIM_STOP || running == SSG_ANIM_PAUSE ) return curr ; @@ -128,24 +128,24 @@ { /* Compute time since start of this loop */ - t = t - (float) floor ( t / loop_time ) * loop_time ; + t = t - floor ( t / loop_time ) * loop_time ; } else if ( mode == SSG_ANIM_SWING ) { /* Compute time since start of this swing loop */ - t = t - (float) floor ( t / (2.0f * loop_time) ) * (2.0f * loop_time) ; + t = t - floor ( t / (2.0 * loop_time) ) * (2.0 * loop_time) ; /* Are we on the reverse part of the loop? */ if ( t >= loop_time ) - t = 2.0f * loop_time - t ; + t = 2.0 * loop_time - t ; } int k ; - for ( k = start ; t > 0.0f && k <= end ; k++ ) - t -= times [ k ] ; + for ( k = start ; t > 0.0 && k <= end ; k++ ) + t -= (double) times [ k ] ; //DaveM: i removed this line because, in shuttle mode, start plays twice k-- ; @@ -170,9 +170,9 @@ { _ssgReadInt ( fd, (int *) & running ) ; _ssgReadInt ( fd, (int *) & mode ) ; - _ssgReadFloat ( fd, & start_time ) ; - _ssgReadFloat ( fd, & pause_time ) ; - _ssgReadFloat ( fd, & loop_time ) ; +// _ssgReadDouble( fd, & start_time ) ; +// _ssgReadDouble( fd, & pause_time ) ; +// _ssgReadDouble( fd, & loop_time ) ; _ssgReadInt ( fd, & max_kids ) ; delete [] times ; times = new float [ max_kids ] ; @@ -189,9 +189,9 @@ { _ssgWriteInt ( fd, (int) running ) ; _ssgWriteInt ( fd, (int) mode ) ; - _ssgWriteFloat ( fd, start_time ) ; - _ssgWriteFloat ( fd, pause_time ) ; - _ssgWriteFloat ( fd, loop_time ) ; +// _ssgWriteFloat ( fd, start_time ) ; +// _ssgWriteFloat ( fd, pause_time ) ; +// _ssgWriteFloat ( fd, loop_time ) ; _ssgWriteInt ( fd, max_kids ) ; _ssgWriteFloat ( fd, max_kids, times ) ; _ssgWriteInt ( fd, curr ) ; |
From: Steve B. <sj...@us...> - 2002-11-04 05:11:26
|
Update of /cvsroot/plib/plib/src/ssg In directory usw-pr-cvs1:/tmp/cvs-serv27338/plib/src/ssg Modified Files: ssg.h ssgLocal.h ssgTween.cxx ssgTweenController.cxx Log Message: Added ability for Tween controllers to wrap-around their animations. Index: ssg.h =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssg.h,v retrieving revision 1.154 retrieving revision 1.155 diff -u -d -r1.154 -r1.155 --- ssg.h 28 Oct 2002 09:31:51 -0000 1.154 +++ ssg.h 4 Nov 2002 05:11:22 -0000 1.155 @@ -1609,9 +1609,13 @@ } ; +#define SSGTWEEN_STOP_AT_END 0 +#define SSGTWEEN_REPEAT 1 + class ssgTweenController : public ssgBranch { float curr_bank ; + int mode ; /* STOP_AT_END or REPEAT */ protected: @@ -1622,6 +1626,9 @@ virtual ssgBase *clone ( int clone_flags = 0 ) ; ssgTweenController (void) ; virtual ~ssgTweenController (void) ; + + void setMode ( int _mode ) { mode = _mode ; } + int getMode () { return mode ; } void selectBank ( float f ) { curr_bank = f ; } float getCurrBank () { return curr_bank ; } Index: ssgLocal.h =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgLocal.h,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- ssgLocal.h 2 Sep 2002 06:05:48 -0000 1.21 +++ ssgLocal.h 4 Nov 2002 05:11:22 -0000 1.22 @@ -117,6 +117,8 @@ float _ssgGetCurrentTweenState () ; void _ssgSetCurrentTweenState ( float tweenstate ) ; +int _ssgGetCurrentTweenMode () ; +void _ssgSetCurrentTweenMode ( 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.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- ssgTween.cxx 2 Sep 2002 06:05:49 -0000 1.9 +++ ssgTween.cxx 4 Nov 2002 05:11:22 -0000 1.10 @@ -27,16 +27,15 @@ #include "ul.h" static float current_tween_state = 0.0f ; +static int current_tween_mode = SSGTWEEN_STOP_AT_END ; const char *ssgTween::getTypeName (void) { return "ssgTween" ; } +int _ssgGetCurrentTweenMode () { return current_tween_mode ; } float _ssgGetCurrentTweenState () { return current_tween_state ; } - -void _ssgSetCurrentTweenState ( float tstate ) -{ - current_tween_state = tstate ; -} +void _ssgSetCurrentTweenMode ( int mode ) { current_tween_mode = mode ; } +void _ssgSetCurrentTweenState ( float tstate ) { current_tween_state= tstate ;} void ssgTween::copy_from ( ssgTween *src, int clone_flags ) { @@ -269,8 +268,17 @@ int state2 = state1 + 1 ; float tween = tstate - (float) state1 ; - if ( state1 >= num_banks ) state1 = num_banks - 1 ; - if ( state2 >= num_banks ) state2 = num_banks - 1 ; + if ( _ssgGetCurrentTweenMode () == SSGTWEEN_REPEAT ) + { + state1 %= num_banks ; + state2 %= num_banks ; + } + else + { + if ( state1 >= num_banks ) state1 = num_banks - 1 ; + if ( state2 >= num_banks ) state2 = num_banks - 1 ; + } + if ( state1 == state2 ) tween = 0.0f ; int l1, l2 ; Index: ssgTweenController.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgTweenController.cxx,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- ssgTweenController.cxx 2 Sep 2002 06:05:49 -0000 1.5 +++ ssgTweenController.cxx 4 Nov 2002 05:11:22 -0000 1.6 @@ -58,11 +58,15 @@ void ssgTweenController::cull ( sgFrustum *f, sgMat4 m, int test_needed ) { float tmp = _ssgGetCurrentTweenState () ; + int mm = _ssgGetCurrentTweenMode () ; + _ssgSetCurrentTweenState ( curr_bank ) ; + _ssgSetCurrentTweenMode ( mode ) ; ssgBranch::cull ( f, m, test_needed ) ; _ssgSetCurrentTweenState ( tmp ) ; + _ssgSetCurrentTweenMode ( mm ) ; } |
From: Steve B. <sj...@us...> - 2002-11-04 05:11:26
|
Update of /cvsroot/plib/plib/doc/ssg In directory usw-pr-cvs1:/tmp/cvs-serv27338/plib/doc/ssg Modified Files: branches.html Log Message: Added ability for Tween controllers to wrap-around their animations. Index: branches.html =================================================================== RCS file: /cvsroot/plib/plib/doc/ssg/branches.html,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- branches.html 24 Aug 2002 20:36:20 -0000 1.6 +++ branches.html 4 Nov 2002 05:11:22 -0000 1.7 @@ -82,6 +82,22 @@ will be rendered. That's a "float" quantity - so if you selectBank(2.4) then the ssgTweens will render their vertices in a position (colour, etc) that's 40% of the way between the bank 2 and bank 3. +<p> +You can also set the behaviour when the selected bank number is larger +than the number of banks in the model. This tends to happen when you +simply add some amount of to the bank selector each frame in order +to keep the animation running forever: +<pre> + + ssgTweenController::setMode ( int mode ) ; + +</pre> +'mode' can either be SSGTWEEN_STOP_AT_END or SSGTWEEN_REPEAT. +The default is STOP_AT_END - where anytime the bank selector +is larger than the actual number of banks in the ssgTween node, +it is clamped to the largest possible number. If you choose +REPEAT, then the bank number will be taken modulo the number of +banks. <H2><code>class ssgSelector</code> - A switch point,</H2> Most ssgBranch nodes represent a collection of objects that are all present in the scene at the same time. ssgSelector |
From: Steve B. <sj...@us...> - 2002-10-30 12:33:03
|
Update of /cvsroot/plib/plib/src/psl In directory usw-pr-cvs1:/tmp/cvs-serv19952/plib/src/psl Modified Files: pslCompiler.h pslProgram.cxx Log Message: Fixed double-delete problem that crashed PSL applications when a pslProgram was deleted. Index: pslCompiler.h =================================================================== RCS file: /cvsroot/plib/plib/src/psl/pslCompiler.h,v retrieving revision 1.31 retrieving revision 1.32 diff -u -d -r1.31 -r1.32 --- pslCompiler.h 22 Sep 2002 18:25:16 -0000 1.31 +++ pslCompiler.h 30 Oct 2002 12:32:58 -0000 1.32 @@ -40,6 +40,8 @@ return symbol != NULL && strcmp ( s, symbol ) == 0 ; } + pslFwdRef () { symbol = NULL ; } + ~pslFwdRef () { delete [] symbol ; } } ; @@ -334,9 +336,9 @@ { delete [] define_token [ i ] ; delete [] define_replacement [ i ] ; - delete [] symtab [ i ] . symbol ; - delete [] code_symtab [ i ] . symbol ; - delete [] forward_ref [ i ] . symbol ; + delete [] symtab [ i ] . symbol ; symtab [ i ] . symbol = NULL ; + delete [] code_symtab [ i ] . symbol ; code_symtab [ i ] . symbol = NULL ; + delete [] forward_ref [ i ] . symbol ; forward_ref [ i ] . symbol = NULL ; } } Index: pslProgram.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/psl/pslProgram.cxx,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- pslProgram.cxx 22 Sep 2002 15:22:21 -0000 1.15 +++ pslProgram.cxx 30 Oct 2002 12:32:59 -0000 1.16 @@ -36,7 +36,7 @@ progName = NULL ; - if ( _prgnm == NULL ) _prgnm = "PSLptogram" ; + if ( _prgnm == NULL ) _prgnm = "PSLprogram" ; setProgName ( _prgnm ) ; @@ -67,6 +67,9 @@ setProgName ( _prgnm ) ; + /* This will fail if this pslProgram is ever deleted */ + /* We need ref-counting on code/compiler */ + code = src -> getCode () ; compiler = src -> getCompiler () ; extensions = src -> getExtensions () ; @@ -79,6 +82,9 @@ pslProgram::~pslProgram () { + /* This will fail if this pslProgram was copy-constructed */ + /* We need ref-counting on code/compiler */ + /* DEBUG-ME! */ delete [] progName ; delete compiler ; delete context ; |
From: Steve B. <sj...@us...> - 2002-10-29 23:39:14
|
Update of /cvsroot/plib/plib/src/ssg In directory usw-pr-cvs1:/tmp/cvs-serv10144/plib/src/ssg Modified Files: ssgSaveFLT.cxx Log Message: Major rework to all parts of FLT writer. Index: ssgSaveFLT.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgSaveFLT.cxx,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- ssgSaveFLT.cxx 17 Oct 2002 13:42:31 -0000 1.2 +++ ssgSaveFLT.cxx 29 Oct 2002 23:39:09 -0000 1.3 @@ -1,21 +1,22 @@ + /* PLIB - A Suite of Portable Game Libraries Copyright (C) 1998,2002 Steve Baker - + This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - [...525 lines suppressed...] max = texList -> getNumEntities () ; for ( i = 0 ; i < max ; i++ ) - delete (FLT_texture *) texList -> getEntity ( i ) ; + delete (FLT_texture *) texList -> getEntity ( i ) ; delete texList ; max = vtxList -> getNumEntities () ; for ( i = 0 ; i < max ; i++ ) - delete (FLT_vertex *) vtxList -> getEntity ( i ) ; + delete (FLT_vertex *) vtxList -> getEntity ( i ) ; delete vtxList ; +#endif return TRUE ; } + |
From: Steve B. <sj...@us...> - 2002-10-28 09:31:55
|
Update of /cvsroot/plib/plib/src/ssg In directory usw-pr-cvs1:/tmp/cvs-serv317/plib/src/ssg Modified Files: ssg.h ssgContext.cxx Log Message: Fixed const-correctness problem. Index: ssg.h =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssg.h,v retrieving revision 1.153 retrieving revision 1.154 diff -u -d -r1.153 -r1.154 --- ssg.h 26 Oct 2002 19:00:55 -0000 1.153 +++ ssg.h 28 Oct 2002 09:31:51 -0000 1.154 @@ -2345,7 +2345,7 @@ void getCameraPosition ( sgVec3 pos ) ; void setCamera ( sgMat4 mat ) ; - void setCamera ( sgCoord *coord ) ; + void setCamera ( const sgCoord *coord ) ; void setCameraLookAt ( const sgVec3 eye, const sgVec3 center, const sgVec3 up ) ; void setCameraLookAt ( const sgVec3 eye, const sgVec3 center ) ; Index: ssgContext.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgContext.cxx,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- ssgContext.cxx 26 Oct 2002 19:00:55 -0000 1.17 +++ ssgContext.cxx 28 Oct 2002 09:31:51 -0000 1.18 @@ -172,7 +172,7 @@ sgPreMultMat4 ( cameraMatrix, viewmat ) ; } -void ssgContext::setCamera ( sgCoord *coord ) +void ssgContext::setCamera ( const sgCoord *coord ) { sgMat4 viewmat, mat ; |
From: Curtis O. <cu...@us...> - 2002-10-26 19:19:28
|
Update of /cvsroot/plib/plib/src/ssg In directory usw-pr-cvs1:/tmp/cvs-serv31554 Modified Files: ssgBranch.cxx Log Message: There are two removeKid() functions, one by index and one by *kid_ptr. The removeKid(index) function is just a wrapper that looks up the kid pointer and calls removeKid(kid_ptr *) However removeKid(by kid pointer *) always does a linear search to find the kid index again. This patch simply reverses which is the wrapper and which is the actual deleting function. I assert that it makes more sense to have removeKid(index) do the actual delete because it already knows the index and can do the delete directly. removeKid(kid_ptr *) can be the wrapper which searches for an appropriate index and calls removeKid(index) Index: ssgBranch.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgBranch.cxx,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- ssgBranch.cxx 2 Sep 2002 06:05:47 -0000 1.21 +++ ssgBranch.cxx 26 Oct 2002 19:19:25 -0000 1.22 @@ -92,25 +92,25 @@ { ssgEntity *k = kids.getEntity ( n ) ; - if ( k != NULL ) - removeKid ( k ) ; + if ( k != NULL ) { + k -> removeParent ( this ) ; + kids.removeEntity ( n ) ; + dirtyBSphere () ; + } } void ssgBranch::removeKid ( ssgEntity *entity ) { - entity -> removeParent ( this ) ; - kids.removeEntity ( entity ) ; - dirtyBSphere () ; + removeKid( searchForKid( entity ) ); } void ssgBranch::removeAllKids (void) { - ssgEntity *k ; - - while ( ( k = getKid ( 0 ) ) != NULL ) + for ( int k = getNumKids() - 1; k >= 0; --k ) { removeKid ( k ) ; + } } |
From: Steve B. <sj...@us...> - 2002-10-26 19:00:59
|
Update of /cvsroot/plib/plib/src/util In directory usw-pr-cvs1:/tmp/cvs-serv19109/plib/src/util Modified Files: ul.cxx Log Message: Relaxed some class restrictions where ssgRoot was required to allow a mere ssgBranch to stand in for it. Cleaned up ulStrEqual a little. Index: ul.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/util/ul.cxx,v retrieving revision 1.29 retrieving revision 1.30 diff -u -d -r1.29 -r1.30 --- ul.cxx 2 Sep 2002 06:05:49 -0000 1.29 +++ ul.cxx 26 Oct 2002 19:00:56 -0000 1.30 @@ -436,13 +436,13 @@ continue ; if ( c1 >= 'a' && c1 <= 'z' ) - c1 = c1 - ('a'-'A') ; + c1 -= ('a'-'A') ; if ( c2 >= 'a' && c2 <= 'z' ) - c2 = c2 - ('a'-'A') ; + c2 -= ('a'-'A') ; if ( c1 != c2 ) - return FALSE ; + return FALSE ; } return TRUE ; |
From: Steve B. <sj...@us...> - 2002-10-26 19:00:59
|
Update of /cvsroot/plib/plib/src/ssg In directory usw-pr-cvs1:/tmp/cvs-serv19109/plib/src/ssg Modified Files: ssg.cxx ssg.h ssgContext.cxx ssgIsect.cxx Log Message: Relaxed some class restrictions where ssgRoot was required to allow a mere ssgBranch to stand in for it. Cleaned up ulStrEqual a little. Index: ssg.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssg.cxx,v retrieving revision 1.59 retrieving revision 1.60 diff -u -d -r1.59 -r1.60 --- ssg.cxx 17 Oct 2002 12:05:00 -0000 1.59 +++ ssg.cxx 26 Oct 2002 19:00:55 -0000 1.60 @@ -205,7 +205,7 @@ -void ssgCullAndPick ( ssgRoot *r, sgVec2 botleft, sgVec2 topright ) +void ssgCullAndPick ( ssgBranch *r, sgVec2 botleft, sgVec2 topright ) { if ( _ssgCurrentContext == NULL ) { @@ -259,7 +259,7 @@ } -void ssgCullAndDraw ( ssgRoot *r ) +void ssgCullAndDraw ( ssgBranch *r ) { if ( _ssgCurrentContext == NULL ) { Index: ssg.h =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssg.h,v retrieving revision 1.152 retrieving revision 1.153 diff -u -d -r1.152 -r1.153 --- ssg.h 24 Oct 2002 14:21:22 -0000 1.152 +++ ssg.h 26 Oct 2002 19:00:55 -0000 1.153 @@ -2341,7 +2341,7 @@ int isOrtho () { return frustum -> isOrtho () ; } // is orthographic ssgSimpleState *getState () { return currentState ; } - void cull ( ssgRoot *r ) ; + void cull ( ssgBranch *r ) ; void getCameraPosition ( sgVec3 pos ) ; void setCamera ( sgMat4 mat ) ; @@ -2487,11 +2487,11 @@ void ssgInit () ; -void ssgCullAndDraw ( ssgRoot *root ) ; -void ssgCullAndPick ( ssgRoot *root, sgVec2 botleft, sgVec2 topright ) ; -int ssgIsect ( ssgRoot *root, sgSphere *s, sgMat4 m, ssgHit **results ) ; -int ssgHOT ( ssgRoot *root, sgVec3 s, sgMat4 m, ssgHit **results ) ; -int ssgLOS ( ssgRoot *root, sgVec3 s, sgMat4 m, ssgHit **results ) ; +void ssgCullAndDraw ( ssgBranch *root ) ; +void ssgCullAndPick ( ssgBranch *root, sgVec2 botleft, sgVec2 topright ) ; +int ssgIsect ( ssgBranch *root, sgSphere*s,sgMat4 m, ssgHit **results ) ; +int ssgHOT ( ssgBranch *root, sgVec3 s, sgMat4 m, ssgHit **results ) ; +int ssgLOS ( ssgBranch *root, sgVec3 s, sgMat4 m, ssgHit **results ) ; /* Load/Save functions */ Index: ssgContext.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgContext.cxx,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- ssgContext.cxx 9 Sep 2002 09:08:29 -0000 1.16 +++ ssgContext.cxx 26 Oct 2002 19:00:55 -0000 1.17 @@ -245,7 +245,7 @@ glLoadMatrixf ( (float *) mat ) ; } -void ssgContext::cull ( ssgRoot *r ) +void ssgContext::cull ( ssgBranch *r ) { r -> cull ( frustum, cameraMatrix, TRUE ) ; } Index: ssgIsect.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgIsect.cxx,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- ssgIsect.cxx 2 Sep 2002 06:05:48 -0000 1.5 +++ ssgIsect.cxx 26 Oct 2002 19:00:55 -0000 1.6 @@ -69,7 +69,7 @@ } -int ssgIsect ( ssgRoot *root, sgSphere *s, sgMat4 mat, ssgHit **results ) +int ssgIsect ( ssgBranch *root, sgSphere *s, sgMat4 mat, ssgHit **results ) { _ssgIsHotTest = FALSE ; _ssgIsLosTest = FALSE ; @@ -81,7 +81,7 @@ } -int ssgHOT ( ssgRoot *root, sgVec3 s, sgMat4 mat, ssgHit **results ) +int ssgHOT ( ssgBranch *root, sgVec3 s, sgMat4 mat, ssgHit **results ) { _ssgIsHotTest = TRUE ; _ssgIsLosTest = FALSE ; @@ -93,7 +93,7 @@ } -int ssgLOS ( ssgRoot *root, sgVec3 s, sgMat4 mat, ssgHit **results ) +int ssgLOS ( ssgBranch *root, sgVec3 s, sgMat4 mat, ssgHit **results ) { _ssgIsHotTest = FALSE ; _ssgIsLosTest = TRUE ; |
From: Steve B. <sj...@us...> - 2002-10-26 14:25:02
|
Update of /cvsroot/plib/plib/src/fnt In directory usw-pr-cvs1:/tmp/cvs-serv22329/plib/src/fnt Modified Files: fnt.cxx fnt.h Log Message: Added fntInit() - which logically should be present even though it does nothing yet. Index: fnt.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/fnt/fnt.cxx,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- fnt.cxx 2 Sep 2002 06:05:43 -0000 1.11 +++ fnt.cxx 26 Oct 2002 14:24:59 -0000 1.12 @@ -244,3 +244,9 @@ } } +void fntInit () +{ + /* Empty right now */ +} + + Index: fnt.h =================================================================== RCS file: /cvsroot/plib/plib/src/fnt/fnt.h,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- fnt.h 2 Sep 2002 06:05:43 -0000 1.12 +++ fnt.h 26 Oct 2002 14:24:59 -0000 1.13 @@ -291,5 +291,7 @@ } ; +void fntInit () ; + #endif |
From: Steve B. <sj...@us...> - 2002-10-26 14:25:02
|
Update of /cvsroot/plib/plib/doc/fnt In directory usw-pr-cvs1:/tmp/cvs-serv22329/plib/doc/fnt Modified Files: index.html Log Message: Added fntInit() - which logically should be present even though it does nothing yet. Index: index.html =================================================================== RCS file: /cvsroot/plib/plib/doc/fnt/index.html,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- index.html 24 Mar 2002 01:13:19 -0000 1.8 +++ index.html 26 Oct 2002 14:24:59 -0000 1.9 @@ -55,6 +55,11 @@ texout . end () ; </pre> +<H2>fntInit</H2> +All programs that use the FNT library should call 'fntInit()' sometime +after they have established a valid OpenGL rendering context and +before they make any other FNT library calls. + <H2>The Classes</H2> There are three external classes used in FNT: <pre> |
From: Steve B. <sj...@us...> - 2002-10-26 13:52:20
|
Update of /cvsroot/plib/plib/src/util In directory usw-pr-cvs1:/tmp/cvs-serv13583/plib/src/util Modified Files: ulList.cxx Log Message: Fixed bug in replaceEntity when 'old' is not present in the list. Index: ulList.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/util/ulList.cxx,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- ulList.cxx 2 Sep 2002 06:05:49 -0000 1.5 +++ ulList.cxx 26 Oct 2002 13:52:13 -0000 1.6 @@ -106,7 +106,10 @@ void ulList::replaceEntity ( unsigned int n, void *new_entity ) { - entity_list [ n ] = new_entity; -} + if ( n >= 0 ) + entity_list [ n ] = new_entity; + else + addEntity ( new_entity ) ; +} |
From: Curtis O. <cu...@us...> - 2002-10-24 14:21:27
|
Update of /cvsroot/plib/plib/src/ssg In directory usw-pr-cvs1:/tmp/cvs-serv12357 Modified Files: ssg.h ssgAnimation.cxx Log Message: Bernie Bright: I have successfully used ulClock to add frame rate independent timing to ssgTimedSelector. setDuration() now takes an extra argument that specifies either frame or clock based timing. The value defaults to frame to maintain backwards compatibility. I have only tested this on Linux. Since I don't have cvs write access and my email to Steve bounced the changes can be downloaded from <http://www.users.bigpond.net.au/bbright/ssg.tar.gz>. Index: ssg.h =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssg.h,v retrieving revision 1.151 retrieving revision 1.152 diff -u -d -r1.151 -r1.152 --- ssg.h 17 Oct 2002 12:05:00 -0000 1.151 +++ ssg.h 24 Oct 2002 14:21:22 -0000 1.152 @@ -1788,6 +1788,12 @@ SSG_ANIM_SHUTTLE } ; +enum ssgAnimTimeMode +{ + SSG_ANIM_FRAME, + SSG_ANIM_CLOCK +}; + class ssgTimedSelector : public ssgSelector { @@ -1803,6 +1809,9 @@ int start ; int end ; + ssgAnimTimeMode time_mode ; + static ulClock ck ; + void compute_loop_time () { loop_time = 0 ; @@ -1813,6 +1822,14 @@ protected: virtual void copy_from ( ssgTimedSelector *src, int clone_flags ) ; + + float get_time() const + { + if (time_mode == SSG_ANIM_FRAME) + return static_cast<float>( ssgGetFrameCounter() ); + else + return ck.update(), ck.getAbsTime(); + } public: virtual ssgBase *clone ( int clone_flags = 0 ) ; @@ -1823,10 +1840,13 @@ int getStep () ; + ssgAnimTimeMode getTimeMode() const { return time_mode; } + float getDuration ( int i = 0 ) { return times [ i ] ; } - void setDuration ( float ti, int i = -1 ) + void setDuration ( float ti, int i = -1, ssgAnimTimeMode m = SSG_ANIM_FRAME ) { + time_mode = m; if ( i >= 0 && i < max_kids ) times [ i ] = ti ; else @@ -1842,13 +1862,13 @@ if ( m == SSG_ANIM_PAUSE ) { - pause_time = (float) ssgGetFrameCounter () ; + pause_time = get_time() ; curr = getStep () ; } else if ( m == SSG_ANIM_RESUME ) { - start_time += (float) ssgGetFrameCounter () - pause_time ; + start_time += get_time () - pause_time ; if ( running != SSG_ANIM_STOP ) m = SSG_ANIM_START ; @@ -1856,7 +1876,7 @@ else if ( m == SSG_ANIM_START ) { - start_time = (float) ssgGetFrameCounter () ; + start_time = get_time () ; curr = getStep () ; } Index: ssgAnimation.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgAnimation.cxx,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- ssgAnimation.cxx 2 Sep 2002 06:05:47 -0000 1.14 +++ ssgAnimation.cxx 24 Oct 2002 14:21:23 -0000 1.15 @@ -24,12 +24,15 @@ #include "ssgLocal.h" +ulClock ssgTimedSelector::ck; + void ssgTimedSelector::copy_from ( ssgTimedSelector *src, int clone_flags ) { ssgSelector::copy_from ( src, clone_flags ) ; running = src -> running ; mode = src -> mode ; + time_mode = src -> time_mode ; start_time = src -> start_time ; pause_time = src -> pause_time ; @@ -68,6 +71,9 @@ times [ i ] = 1.0f ; curr = start = end = 0 ; + + time_mode = SSG_ANIM_FRAME ; + ck.reset() ; } @@ -100,7 +106,7 @@ int ssgTimedSelector::getStep () { - float t = (float) ssgGetFrameCounter () ; + float t = get_time () ; if ( running == SSG_ANIM_STOP || running == SSG_ANIM_PAUSE ) return curr ; @@ -142,7 +148,7 @@ t -= times [ k ] ; //DaveM: i removed this line because, in shuttle mode, start plays twice -// k-- ; + k-- ; if ( k < start ) k = start ; if ( k > end ) k = end ; @@ -174,6 +180,7 @@ _ssgReadInt ( fd, & curr ) ; _ssgReadInt ( fd, & start ) ; _ssgReadInt ( fd, & end ) ; + _ssgReadInt ( fd, (int *) & time_mode ) ; return ssgSelector::load(fd) ; } @@ -190,6 +197,7 @@ _ssgWriteInt ( fd, curr ) ; _ssgWriteInt ( fd, start ) ; _ssgWriteInt ( fd, end ) ; + _ssgWriteInt ( fd, (int) time_mode ) ; return ssgSelector::save(fd) ; } |
From: James J. <pu...@us...> - 2002-10-18 16:23:00
|
Update of /cvsroot/plib/plib/demos/p-guide/src In directory usw-pr-cvs1:/tmp/cvs-serv14512 Modified Files: WriteCode.cxx Log Message: J. Fay: Insert include for glut.h into exported files. Index: WriteCode.cxx =================================================================== RCS file: /cvsroot/plib/plib/demos/p-guide/src/WriteCode.cxx,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- WriteCode.cxx 31 Aug 2002 08:14:39 -0000 1.8 +++ WriteCode.cxx 18 Oct 2002 16:22:57 -0000 1.9 @@ -103,6 +103,7 @@ fprintf ( out, "// TODO: Any additional includes you may need\n\n" ) ; + fprintf ( out, "#include <GL/glut.h>\n\n" ) ; fprintf ( out, "#include <plib/pu.h>\n\n" ) ; fprintf ( out, "// GLUT Window Handle\n" ) ; |