plib-cvs Mailing List for PLIB (Page 6)
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: Bram S. <br...@us...> - 2004-09-26 09:39:03
|
Update of /cvsroot/plib/plib/src/ssg In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21025 Modified Files: Makefile.am ssg.cxx ssg.dsp ssg.h Added Files: ssgSaveIV.cxx Log Message: Added OpenInventor exporter --- NEW FILE: ssgSaveIV.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 [...262 lines suppressed...] // Entry point: save ssg hierarchy as an OpenInventor file. int ssgSaveIV ( const char *filename, ssgEntity *ent ) { FILE *f = fopen( filename, "w" ) ; if ( !f ) return FALSE ; fprintf( f, "#Inventor V2.1 ascii\n" ) ; fprintf ( f, "#Export from plib version %d.%d.%d\n\n", PLIB_MAJOR_VERSION, PLIB_MINOR_VERSION, PLIB_TINY_VERSION ) ; indentLevel = 0 ; walkTree( ent, f ) ; return TRUE ; } Index: Makefile.am =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/Makefile.am,v retrieving revision 1.45 retrieving revision 1.46 diff -u -d -r1.45 -r1.46 --- Makefile.am 2 Feb 2004 01:35:15 -0000 1.45 +++ Makefile.am 26 Sep 2004 09:38:52 -0000 1.46 @@ -26,6 +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 ssgSaveASC.cxx \ + ssgSaveIV.cxx \ ssgVertSplitter.h ssgVertSplitter.cxx ssgStatistics.cxx INCLUDES = -I$(top_srcdir)/src/sg -I$(top_srcdir)/src/util Index: ssg.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssg.cxx,v retrieving revision 1.66 retrieving revision 1.67 diff -u -d -r1.66 -r1.67 --- ssg.cxx 24 Jun 2004 16:30:54 -0000 1.66 +++ ssg.cxx 26 Sep 2004 09:38:52 -0000 1.67 @@ -145,7 +145,7 @@ ssgAddModelFormat ( ".atg" , ssgLoadATG , ssgSaveATG ) ; ssgAddModelFormat ( ".qhi" , NULL , ssgSaveQHI ) ; ssgAddModelFormat ( ".wrl", ssgLoadVRML1, ssgSaveVRML1 ) ; - ssgAddModelFormat ( ".iv", ssgLoadIV , NULL ) ; + ssgAddModelFormat ( ".iv", ssgLoadIV , ssgSaveIV ) ; ssgAddModelFormat ( ".asc", NULL , ssgSaveASC ) ; //ssgAddModelFormat ( ".pov", NULL , ssgSavePOV ) ; Index: ssg.dsp =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssg.dsp,v retrieving revision 1.50 retrieving revision 1.51 diff -u -d -r1.50 -r1.51 --- ssg.dsp 25 Mar 2004 18:27:13 -0000 1.50 +++ ssg.dsp 26 Sep 2004 09:38:52 -0000 1.51 @@ -218,6 +218,10 @@ # End Source File # Begin Source File +SOURCE=.\ssgSaveIV.cxx +# End Source File +# Begin Source File + SOURCE=.\ssgLoadM.cxx # End Source File # Begin Source File Index: ssg.h =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssg.h,v retrieving revision 1.171 retrieving revision 1.172 diff -u -d -r1.171 -r1.172 --- ssg.h 24 Jun 2004 16:30:54 -0000 1.171 +++ ssg.h 26 Sep 2004 09:38:52 -0000 1.172 @@ -2715,6 +2715,7 @@ int ssgSaveATG ( const char *fname, ssgEntity *ent ) ; int ssgSaveVRML1( const char *fname, ssgEntity *ent ) ; int ssgSaveASC ( const char *fname, ssgEntity *ent ) ; +int ssgSaveIV ( const char *fname, ssgEntity *ent ) ; int ssgSavePOV ( const char *fname, ssgEntity *ent ) ; |
From: Bram S. <br...@us...> - 2004-09-26 09:37:09
|
Update of /cvsroot/plib/plib/src/ssg In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20739 Modified Files: ssgLoadAC.cxx Log Message: Added diffuse setting to avoid insensable values Index: ssgLoadAC.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgLoadAC.cxx,v retrieving revision 1.32 retrieving revision 1.33 diff -u -d -r1.32 -r1.33 --- ssgLoadAC.cxx 11 Jul 2003 11:16:43 -0000 1.32 +++ ssgLoadAC.cxx 26 Sep 2004 09:37:00 -0000 1.33 @@ -30,7 +30,7 @@ { sgVec4 spec ; sgVec4 emis ; - sgVec4 rgb ; + sgVec4 rgb ; // Should be named rgba instead - Bram float shi ; } ; @@ -204,6 +204,7 @@ ssgSimpleState *st = new ssgSimpleState () ; + st -> setMaterial ( GL_DIFFUSE, mat -> rgb ) ; st -> setMaterial ( GL_SPECULAR, mat -> spec ) ; st -> setMaterial ( GL_EMISSION, mat -> emis ) ; st -> setShininess ( mat -> shi ) ; |
From: Wolfram K. <wol...@us...> - 2004-09-22 22:43:34
|
Update of /cvsroot/plib/plib/src/ssg In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25399 Modified Files: ssgLoadPCX.cxx Log Message: Untabified. Index: ssgLoadPCX.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgLoadPCX.cxx,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- ssgLoadPCX.cxx 13 Sep 2004 12:14:56 -0000 1.3 +++ ssgLoadPCX.cxx 22 Sep 2004 22:43:24 -0000 1.4 @@ -37,7 +37,7 @@ //=========================================================================== #include "ssgLocal.h" -typedef unsigned char UByte,*UByteP; +typedef unsigned char UByte,*UByteP; #include "pcx.h" @@ -48,40 +48,40 @@ int ReadFileIntoBuffer(const char *fname, UByte *&buffer, UByte *&bufferorig, unsigned long &file_length) // Opens the file, allocates buffer of correct size to hold the file, reads it, closes it [...195 lines suppressed...] - UByte a = pAlfa?pAlfa[iRunningIndex]:255; + UByte a = pAlfa?pAlfa[iRunningIndex]:255; UByte b = pBody[iRunningIndex++]; texels[c++] = buffer[b*3 ]; texels[c++] = buffer[b*3 + 1]; @@ -171,10 +171,10 @@ } } - delete [] pBodyorig; - delete [] bufferorig; - if (pAlfa) - delete [] pAlfa; + delete [] pBodyorig; + delete [] bufferorig; + if (pAlfa) + delete [] pAlfa; return ssgMakeMipMaps ( texels, width, height, 4 ) ; } #else |
From: Eric L. <smo...@us...> - 2004-09-22 21:09:48
|
Update of /cvsroot/plib/plib/src/puAux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4602 Modified Files: puAux.h puAuxComboBox.cxx Log Message: John Fay's changes to puAux.h and puAuxComboBox.cxx. Added method puaComboBox::setSize. puaChooser destructor is now virtual. Index: puAux.h =================================================================== RCS file: /cvsroot/plib/plib/src/puAux/puAux.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- puAux.h 5 Aug 2004 01:03:49 -0000 1.2 +++ puAux.h 22 Sep 2004 21:09:35 -0000 1.3 @@ -242,6 +242,7 @@ invokeCallback () ; } } + void setCurrentItem ( const char *item_ptr ) ; void setPosition ( int x, int y ) @@ -252,6 +253,8 @@ newList ( list ) ; } + void setSize ( int w, int h ) ; + void draw ( int dx, int dy ) ; int checkHit ( int button, int updown, int x, int y ) ; int checkKey ( int key, int updown ) ; @@ -810,7 +813,7 @@ public: - ~puaChooser () + virtual ~puaChooser () { delete chooser_button ; delete popup_menu ; Index: puAuxComboBox.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/puAux/puAuxComboBox.cxx,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- puAuxComboBox.cxx 21 Mar 2004 19:03:23 -0000 1.3 +++ puAuxComboBox.cxx 22 Sep 2004 21:09:35 -0000 1.4 @@ -269,3 +269,11 @@ newList ( entries ) ; } +void puaComboBox::setSize ( int w, int h ) +{ + int arrow_width = (int) ( float(h) / 1.5f ) ; + input->setSize ( w - arrow_width, h ) ; + arrow_btn->setPosition ( w - arrow_width, 0 ) ; + arrow_btn->setSize ( arrow_width, h ) ; +} + |
From: Eric L. <smo...@us...> - 2004-09-21 11:46:06
|
Update of /cvsroot/plib/plib/src/js In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2333 Modified Files: js.cxx js.h jsBSD.cxx jsLinux.cxx jsLinuxOld.cxx jsMacOS.cxx jsMacOSX.cxx jsNone.cxx jsWindows.cxx Log Message: Many changes courtesy of John Fay. Index: js.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/js/js.cxx,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- js.cxx 15 Aug 2004 00:12:32 -0000 1.4 +++ js.cxx 21 Sep 2004 11:45:55 -0000 1.5 @@ -22,9 +22,6 @@ #include "js.h" - -/// void jsInit () {} - float jsJoystick::fudge_axis ( float value, int axis ) const { if ( value < center[axis] ) @@ -86,3 +83,4 @@ } + Index: js.h =================================================================== RCS file: /cvsroot/plib/plib/src/js/js.h,v retrieving revision 1.31 retrieving revision 1.32 diff -u -d -r1.31 -r1.32 --- js.h 15 Aug 2004 00:12:32 -0000 1.31 +++ js.h 21 Sep 2004 11:45:55 -0000 1.32 @@ -93,3 +93,4 @@ #endif + Index: jsBSD.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/js/jsBSD.cxx,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- jsBSD.cxx 15 Aug 2004 00:12:32 -0000 1.4 +++ jsBSD.cxx 21 Sep 2004 11:45:55 -0000 1.5 @@ -38,7 +38,7 @@ #include "js.h" -#if defined(UL_BSD) +#if defined (UL_BSD) #if defined(__NetBSD__) || defined(__FreeBSD__) #define HAVE_USB_JS 1 Index: jsLinux.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/js/jsLinux.cxx,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- jsLinux.cxx 15 Aug 2004 00:12:32 -0000 1.4 +++ jsLinux.cxx 21 Sep 2004 11:45:55 -0000 1.5 @@ -23,8 +23,9 @@ #include "js.h" -#if defined(UL_LINUX) && defined(JS_NEW) +#if defined (UL_LINUX) && defined (JS_NEW) +#include <linux/joystick.h> #include <sys/param.h> #include <fcntl.h> #include <sys/ioctl.h> @@ -39,9 +40,6 @@ void jsInit () {} - -/* check the joystick driver version */ - void jsJoystick::open () { name [0] = '\0' ; @@ -182,4 +180,3 @@ } #endif - Index: jsLinuxOld.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/js/jsLinuxOld.cxx,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- jsLinuxOld.cxx 15 Aug 2004 00:12:32 -0000 1.2 +++ jsLinuxOld.cxx 21 Sep 2004 11:45:55 -0000 1.3 @@ -23,7 +23,7 @@ #include "js.h" -#if defined(UL_LINUX) && !defined(JS_NEW) +#if defined (UL_LINUX) && !defined (JS_NEW) #include <fcntl.h> #include <sys/ioctl.h> Index: jsMacOS.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/js/jsMacOS.cxx,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- jsMacOS.cxx 15 Aug 2004 00:12:32 -0000 1.3 +++ jsMacOS.cxx 21 Sep 2004 11:45:55 -0000 1.4 @@ -23,11 +23,11 @@ #include "js.h" -#ifdef UL_MACINTOSH +#if defined (UL_MACINTOSH) #include <InputSprocket.h> -//#define _JS_MAX_AXES_MAC 9 // not used +//#define _JS_MAX_AXES_MAC 9 #define isp_num_axis 9 #define isp_num_needs 41 @@ -208,4 +208,3 @@ void jsInit() {} #endif - Index: jsNone.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/js/jsNone.cxx,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- jsNone.cxx 15 Aug 2004 00:12:32 -0000 1.3 +++ jsNone.cxx 21 Sep 2004 11:45:55 -0000 1.4 @@ -22,12 +22,9 @@ #include "js.h" -#if defined(UL_IRIX) || defined(UL_SOLARIS) || defined(UL_HPUX) +#if defined(UL_IRIX) || defined(UL_SOLARIS) || defined (UL_HPUX) -/* -struct os_specific_s { -} -*/ +struct os_specific_s ; void jsJoystick::open () @@ -39,7 +36,7 @@ void jsJoystick::close () { - // if (os) delete os; + error = TRUE ; } @@ -56,5 +53,7 @@ if ( buttons != NULL ) *buttons = 0 ; } +void jsInit () {} + #endif Index: jsWindows.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/js/jsWindows.cxx,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- jsWindows.cxx 15 Aug 2004 15:08:24 -0000 1.4 +++ jsWindows.cxx 21 Sep 2004 11:45:55 -0000 1.5 @@ -23,10 +23,8 @@ #include "js.h" -#ifdef UL_WIN32 +#if defined (UL_WIN32) -// Since we use joyGetPosEx to request the joystick values, -// we have never more than 8 axes to worry about: #define _JS_MAX_AXES_WIN 8 /* X,Y,Z,R,U,V,POV_X,POV_Y */ struct os_specific_s { @@ -128,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_WIN ; + num_axes = _JS_MAX_AXES ; min [ 7 ] = -1.0 ; max [ 7 ] = 1.0 ; // POV Y min [ 6 ] = -1.0 ; max [ 6 ] = 1.0 ; // POV X } @@ -258,4 +256,3 @@ void jsInit() {} #endif - |
From: Wolfram K. <wol...@us...> - 2004-09-14 12:19:15
|
Update of /cvsroot/plib/plib/src/ssg In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11815 Modified Files: ssgconf.h Log Message: Fixed comment, suggested by Mr. John F Fay. Index: ssgconf.h =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgconf.h,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- ssgconf.h 13 Sep 2004 10:57:32 -0000 1.13 +++ ssgconf.h 14 Sep 2004 12:19:05 -0000 1.14 @@ -39,8 +39,8 @@ /* For optional use of PNG textures, download the glpng library from - http://www.wyatt100.freeserve.co.uk/download.htm and un-comment - the following line. + http://www.wyatt100.freeserve.co.uk/download.htm and + change the #undef to a #define in the following line. */ #undef SSG_LOAD_PNG_SUPPORTED |
From: Wolfram K. <wol...@us...> - 2004-09-13 12:15:04
|
Update of /cvsroot/plib/plib/src/ssg In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6422/ssg Modified Files: ssgLoadPCX.cxx Log Message: Major rework, especially to previously virtually not existing the alfa handling. Index: ssgLoadPCX.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgLoadPCX.cxx,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- ssgLoadPCX.cxx 24 Jan 2004 18:21:55 -0000 1.2 +++ ssgLoadPCX.cxx 13 Sep 2004 12:14:56 -0000 1.3 @@ -45,7 +45,8 @@ #ifdef SSG_LOAD_PCX_SUPPORTED -bool ssgLoadPCX ( const char *fname, ssgTextureInfo* info ) +int ReadFileIntoBuffer(const char *fname, UByte *&buffer, UByte *&bufferorig, unsigned long &file_length) +// Opens the file, allocates buffer of correct size to hold the file, reads it, closes it { // **** open file **** FILE *tfile; @@ -56,15 +57,23 @@ [...93 lines suppressed...] for (int y = 0; y < height; y++) { for (int x = 0; x < width; x++) { - UByte b = *pBody++; + UByte a = pAlfa?pAlfa[iRunningIndex]:255; + UByte b = pBody[iRunningIndex++]; texels[c++] = buffer[b*3 ]; texels[c++] = buffer[b*3 + 1]; texels[c++] = buffer[b*3 + 2]; - texels[c++] = 255; //(b<index)?0:255; + texels[c++] = a; } } delete [] pBodyorig; delete [] bufferorig; + if (pAlfa) + delete [] pAlfa; return ssgMakeMipMaps ( texels, width, height, 4 ) ; } #else |
From: Wolfram K. <wol...@us...> - 2004-09-13 12:12:05
|
Update of /cvsroot/plib/plib/src/ssg In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5875/ssg Modified Files: ssgSaveASC.cxx ssgSaveASE.cxx Log Message: Wheh saving selectors, now all children are saved. Index: ssgSaveASC.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgSaveASC.cxx,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- ssgSaveASC.cxx 14 Dec 2003 14:58:40 -0000 1.3 +++ ssgSaveASC.cxx 13 Sep 2004 12:11:56 -0000 1.4 @@ -164,7 +164,8 @@ if ( br -> isAKindOf ( ssgTypeSelector() ) ) { - save_geom ( br -> getKid ( 0 ) ) ; + for ( int i = 0 ; i < br -> getNumKids () ; i++ ) + save_geom ( br -> getKid ( i ) ) ; } else { @@ -178,7 +179,7 @@ if(bUseSpare) if( 1 != e->getSpare() ) bSaveIt = FALSE; - + if ( bSaveIt ) { ssgVtxTable *vt = (ssgVtxTable *) e ; Index: ssgSaveASE.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgSaveASE.cxx,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- ssgSaveASE.cxx 2 Sep 2002 06:05:48 -0000 1.13 +++ ssgSaveASE.cxx 13 Sep 2004 12:11:56 -0000 1.14 @@ -272,7 +272,8 @@ if ( br -> isAKindOf ( ssgTypeSelector() ) ) { - save_geom ( br -> getKid ( 0 ) ) ; + for ( int i = 0 ; i < br -> getNumKids () ; i++ ) + save_geom ( br -> getKid ( i ) ) ; } else { |
From: Wolfram K. <wol...@us...> - 2004-09-13 12:02:51
|
Update of /cvsroot/plib/plib/src/ssg In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4090/ssg Modified Files: ssgTween.cxx Log Message: Removing unnecessary lines found by Mr. John F Fay. Index: ssgTween.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgTween.cxx,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- ssgTween.cxx 4 Dec 2002 19:12:35 -0000 1.12 +++ ssgTween.cxx 13 Sep 2004 12:02:36 -0000 1.13 @@ -147,7 +147,6 @@ colours -> ref () ; dirtyBSphere () ; /* Cause parents to redo their bspheres */ - bsphere_is_invalid = TRUE ; return bank ; } @@ -181,7 +180,6 @@ banked_vertices -> replaceEntity ( curr_bank, vl ) ; ssgVtxTable::setVertices ( vl ) ; dirtyBSphere () ; /* Cause parents to redo their bspheres */ - bsphere_is_invalid = TRUE ; } void ssgTween::setNormals ( ssgNormalArray *nl ) @@ -189,7 +187,6 @@ banked_normals -> replaceEntity ( curr_bank, nl ) ; ssgVtxTable::setNormals ( nl ) ; dirtyBSphere () ; /* Cause parents to redo their bspheres */ - bsphere_is_invalid = TRUE ; } void ssgTween::setTexCoords ( ssgTexCoordArray *tl ) @@ -197,7 +194,6 @@ banked_texcoords -> replaceEntity ( curr_bank, tl ) ; ssgVtxTable::setTexCoords ( tl ) ; dirtyBSphere () ; /* Cause parents to redo their bspheres */ - bsphere_is_invalid = TRUE ; } void ssgTween::setColours ( ssgColourArray *cl ) @@ -205,7 +201,6 @@ banked_colours -> replaceEntity ( curr_bank, cl ) ; ssgVtxTable::setColours ( cl ) ; dirtyBSphere () ; /* Cause parents to redo their bspheres */ - bsphere_is_invalid = TRUE ; } ssgTween::~ssgTween () @@ -253,7 +248,6 @@ extendBSphere ( & bbox ) ; dirtyBSphere () ; /* Cause parents to redo their bspheres */ - bsphere_is_invalid = FALSE ; } |
From: Wolfram K. <wol...@us...> - 2004-09-13 12:01:24
|
Update of /cvsroot/plib/plib/src/ssg In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3628/ssg Modified Files: ssgVtxArray.cxx Log Message: Fixing memory leak found by Mr. John F Fay. Index: ssgVtxArray.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgVtxArray.cxx,v retrieving revision 1.27 retrieving revision 1.28 diff -u -d -r1.27 -r1.28 --- ssgVtxArray.cxx 2 Feb 2004 01:35:15 -0000 1.27 +++ ssgVtxArray.cxx 13 Sep 2004 12:01:15 -0000 1.28 @@ -259,6 +259,7 @@ colours = newCL; newCL->ref(); } + delete [] oldIndex2NewIndex; } void ssgVtxArray::draw_geometry () |
From: Wolfram K. <wol...@us...> - 2004-09-13 11:49:47
|
Update of /cvsroot/plib/plib/src/ssg In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1480/ssg Modified Files: ssgEntity.cxx Log Message: Using DirtyBSphere instead of just setting the flag. So, the BSphere of the parents is marked as dirty as well. Fix by Mr. John F Fay. Index: ssgEntity.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgEntity.cxx,v retrieving revision 1.27 retrieving revision 1.28 diff -u -d -r1.27 -r1.28 --- ssgEntity.cxx 13 Sep 2004 11:30:55 -0000 1.27 +++ ssgEntity.cxx 13 Sep 2004 11:49:36 -0000 1.28 @@ -429,7 +429,7 @@ int ssgEntity::load ( FILE *fd ) { - bsphere_is_invalid = TRUE ; + dirtyBSphere(); _ssgReadInt ( fd, &traversal_mask ) ; return ssgBase::load(fd) ; } |
From: Wolfram K. <wol...@us...> - 2004-09-13 11:43:17
|
Update of /cvsroot/plib/plib/src/ssg In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32629/ssg Modified Files: ssgVtxTable.cxx Log Message: Style changes by Mr John F Fay Index: ssgVtxTable.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgVtxTable.cxx,v retrieving revision 1.36 retrieving revision 1.37 diff -u -d -r1.36 -r1.37 --- ssgVtxTable.cxx 24 Jun 2004 16:30:55 -0000 1.36 +++ ssgVtxTable.cxx 13 Sep 2004 11:43:08 -0000 1.37 @@ -28,34 +28,33 @@ int ssgSimpleList::compare(ssgSimpleList *other, int print_result) { - int result = TRUE; + int result = TRUE; if (total !=other->total ) - { result = FALSE; - if(print_result) - printf("ERROR: total \n"); - } - else [...340 lines suppressed...] + ssgVtxArray * s = new ssgVtxArray ( getGLtype(), + vertices, normals, texcoords, colours, indices); + s->setName(name); + s->setState(state); + return s; } @@ -944,9 +944,9 @@ return ; sprintf ( in, "%s ", indent ); - + ssgLeaf ::print ( fd, indent, how_much ) ; - + if ( vertices == NULL ) fprintf ( fd, "%s No Vertices!\n", indent ) ; else |
From: Wolfram K. <wol...@us...> - 2004-09-13 11:34:08
|
Update of /cvsroot/plib/plib/src/ssg In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30480/ssg Modified Files: ssgLeaf.cxx Log Message: Identation fixes by Mr John F Fay Index: ssgLeaf.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgLeaf.cxx,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- ssgLeaf.cxx 20 Nov 2003 13:58:35 -0000 1.24 +++ ssgLeaf.cxx 13 Sep 2004 11:33:58 -0000 1.25 @@ -28,12 +28,12 @@ void ssgLeaf::setState ( ssgState *st ) { - ssgDeRefDelete ( state ) ; + ssgDeRefDelete ( state ) ; - state = st ; + state = st ; - if ( state != NULL ) - state->ref() ; + if ( state != NULL ) + state->ref() ; } void ssgLeaf::copy_from ( ssgLeaf *src, int clone_flags ) @@ -52,12 +52,12 @@ else state = s ; - //~~ T.G. increment ref counter - if (state != NULL) - state->ref(); + //~~ T.G. increment ref counter + if (state != NULL) + state->ref(); - setCallback( SSG_CALLBACK_PREDRAW, src->getCallback( SSG_CALLBACK_PREDRAW ) ); - setCallback( SSG_CALLBACK_POSTDRAW, src->getCallback( SSG_CALLBACK_POSTDRAW ) ); + setCallback( SSG_CALLBACK_PREDRAW, src->getCallback( SSG_CALLBACK_PREDRAW ) ); + setCallback( SSG_CALLBACK_POSTDRAW, src->getCallback( SSG_CALLBACK_POSTDRAW ) ); } |
From: Wolfram K. <wol...@us...> - 2004-09-13 11:31:05
|
Update of /cvsroot/plib/plib/src/ssg In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29651/ssg Modified Files: ssgEntity.cxx Log Message: Typo fixes by Mr John F Fay Index: ssgEntity.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgEntity.cxx,v retrieving revision 1.26 retrieving revision 1.27 diff -u -d -r1.26 -r1.27 --- ssgEntity.cxx 20 Nov 2003 13:58:35 -0000 1.26 +++ ssgEntity.cxx 13 Sep 2004 11:30:55 -0000 1.27 @@ -114,7 +114,7 @@ Get the entity whos name equals match (case sensitive) or 0 if there isn't This will be overridden by descendant classes to search trees, etc. This makes recovery of tagged parts of objects simple. - I envisage it being used to find axles, gimbles etc and to seperate many objects + I envisage it being used to find axles, gimbals etc and to separate many objects from a single loaded model file. The base version in ssgEntity returns the ssgEntity if the name refers to this entity or 0 if not. */ @@ -128,7 +128,7 @@ /* Get the entity specified by the path. A path is a series of names - seperated by '/'. Each sub-unit is searched so long as the path matches. + separated by '/'. Each sub-unit is searched so long as the path matches. A single leading '/' on the path is ignored. */ |
From: Wolfram K. <wol...@us...> - 2004-09-13 11:28:45
|
Update of /cvsroot/plib/plib/src/ssg In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29149/ssg Modified Files: ssgStateSelector.cxx Log Message: Untabified. Suggestion by Mr John F Fay Index: ssgStateSelector.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgStateSelector.cxx,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- ssgStateSelector.cxx 2 Sep 2002 06:05:49 -0000 1.20 +++ ssgStateSelector.cxx 13 Sep 2004 11:28:34 -0000 1.21 @@ -41,9 +41,9 @@ else statelist [ i ] = s ; - //~~ T.G. needs ref count incremented - if (statelist [ i ] != NULL ) - statelist [ i ] -> ref(); + //~~ T.G. needs ref count incremented + if (statelist [ i ] != NULL ) + statelist [ i ] -> ref(); } } @@ -80,7 +80,7 @@ { //~~ T.G. deref states before deleting list for ( int i = 0 ; i < nstates ; i++ ) - ssgDeRefDelete( statelist [ i ] ); + ssgDeRefDelete( statelist [ i ] ); delete [] statelist ; } |
From: Wolfram K. <wol...@us...> - 2004-09-13 11:16:52
|
Update of /cvsroot/plib/plib/src/ssg In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26808/ssg Modified Files: ssgList.cxx Log Message: Speed optimisation by Mr. Fay John F. Index: ssgList.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgList.cxx,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- ssgList.cxx 2 Sep 2002 06:05:48 -0000 1.8 +++ ssgList.cxx 13 Sep 2004 11:16:43 -0000 1.9 @@ -91,7 +91,7 @@ void ssgList::removeAllEntities () { while ( total > 0 ) - removeEntity ( (unsigned int) 0 ) ; + removeEntity ( (unsigned int) total-1 ) ; } void ssgList::removeEntity ( unsigned int n ) @@ -112,7 +112,8 @@ ssgList::removeEntity ( n ) ; e -> deadBeefCheck () ; - ssgDeRefDelete ( e ) ; + // wk 20.4.2002 problems with mywalk... when merging hiearchy nodes: + ssgDeRefDelete ( e ) ; } |
From: Wolfram K. <wol...@us...> - 2004-09-13 10:57:41
|
Update of /cvsroot/plib/plib/src/ssg In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22639/ssg Modified Files: ssgconf.h Log Message: Fixed typo Index: ssgconf.h =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgconf.h,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- ssgconf.h 12 Dec 2003 18:23:55 -0000 1.12 +++ ssgconf.h 13 Sep 2004 10:57:32 -0000 1.13 @@ -32,7 +32,7 @@ * library that you will not be using. I wish I could figure out how to * automate this, but I can't do that without making it seriously hard * on the users. So if you are not using an ability, change the #define - * to and #undef, and that part of the library will not be compiled. If + * to an #undef, and that part of the library will not be compiled. If * your linker can't find a function, you may want to make sure the * ability is defined here. */ |
From: Wolfram K. <wol...@us...> - 2004-09-13 10:48:18
|
Update of /cvsroot/plib/plib/src/ssg In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21243/ssg Modified Files: ssgLocal.h Log Message: MSVC needs a "class". Index: ssgLocal.h =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgLocal.h,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- ssgLocal.h 24 Jun 2004 16:30:54 -0000 1.24 +++ ssgLocal.h 13 Sep 2004 10:48:10 -0000 1.25 @@ -129,7 +129,7 @@ int _ssgSaveObject ( FILE * , ssgBase * ) ; int _ssgLoadObject ( FILE * , ssgBase ** , int type_mask = 0 ) ; -extern ssgStatistics _ssgCurrStatistics ; +extern class ssgStatistics _ssgCurrStatistics ; extern bool _ssgBackFaceCollisions ; |
From: Eric L. <smo...@us...> - 2004-08-15 15:08:33
|
Update of /cvsroot/plib/plib/src/js In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1880 Modified Files: jsWindows.cxx Log Message: John Fay's fixes for some windows-only compile errors. Index: jsWindows.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/js/jsWindows.cxx,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- jsWindows.cxx 15 Aug 2004 00:12:32 -0000 1.3 +++ jsWindows.cxx 15 Aug 2004 15:08:24 -0000 1.4 @@ -41,7 +41,7 @@ // Inspired by // http://msdn.microsoft.com/archive/en-us/dnargame/html/msdn_sidewind3d.asp -static bool getOEMProductName ( jsJoystick* joy, char *buf, int buf_sz ) +bool os_specific_s::getOEMProductName ( jsJoystick* joy, char *buf, int buf_sz ) { if ( joy->error ) return false ; @@ -116,7 +116,7 @@ { // Device name from jsCaps is often "Microsoft PC-joystick driver", // at least for USB. Try to get the real name from the registry. - if ( ! getOEMProductName ( this, name, sizeof(name) ) ) + if ( ! os->getOEMProductName ( this, name, sizeof(name) ) ) { ulSetError ( UL_WARNING, "JS: Failed to read joystick name from registry" ) ; |
From: Eric L. <smo...@us...> - 2004-08-15 00:12:42
|
Update of /cvsroot/plib/plib/src/js In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13436 Modified Files: js.cxx js.h jsBSD.cxx jsLinux.cxx jsLinuxOld.cxx jsMacOS.cxx jsMacOSX.cxx jsNone.cxx jsWindows.cxx Log Message: Olivier A's js rewrite Index: js.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/js/js.cxx,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- js.cxx 29 Nov 2002 19:39:48 -0000 1.3 +++ js.cxx 15 Aug 2004 00:12:32 -0000 1.4 @@ -22,7 +22,8 @@ #include "js.h" -void jsInit () {} + +/// void jsInit () {} float jsJoystick::fudge_axis ( float value, int axis ) const { Index: js.h =================================================================== RCS file: /cvsroot/plib/plib/src/js/js.h,v retrieving revision 1.30 retrieving revision 1.31 diff -u -d -r1.30 -r1.31 --- js.h 11 Nov 2003 22:54:48 -0000 1.30 +++ js.h 15 Aug 2004 00:12:32 -0000 1.31 @@ -32,106 +32,18 @@ #define _JS_MAX_AXES 16 #define _JS_MAX_BUTTONS 32 - -#ifdef UL_MACINTOSH -# include <InputSprocket.h> -#endif - -#ifdef UL_MAC_OSX -# include <mach/mach.h> -# include <IOKit/IOkitLib.h> [...94 lines suppressed...] + friend struct os_specific_s ; int error ; char name [ 128 ] ; int num_axes ; @@ -143,7 +55,6 @@ float max [ _JS_MAX_AXES ] ; float min [ _JS_MAX_AXES ] ; - void open () ; void close () ; @@ -175,6 +86,7 @@ void read ( int *buttons, float *axes ) ; void rawRead ( int *buttons, float *axes ) ; + // bool SetForceFeedBack ( int axe, float force ); } ; extern void jsInit () ; Index: jsBSD.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/js/jsBSD.cxx,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- jsBSD.cxx 20 Mar 2004 00:21:53 -0000 1.3 +++ jsBSD.cxx 15 Aug 2004 00:12:32 -0000 1.4 @@ -35,6 +35,7 @@ * an API extension, and to be useful for my devious purposes, FlightGear * would need to understand that. */ + #include "js.h" #if defined(UL_BSD) @@ -495,4 +496,6 @@ #endif } +void jsInit () {} + #endif Index: jsLinux.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/js/jsLinux.cxx,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- jsLinux.cxx 10 Apr 2003 12:36:27 -0000 1.3 +++ jsLinux.cxx 15 Aug 2004 00:12:32 -0000 1.4 @@ -29,6 +29,17 @@ #include <fcntl.h> #include <sys/ioctl.h> +struct os_specific_s { + js_event js ; + int tmp_buttons ; + float tmp_axes [ _JS_MAX_AXES ] ; + char fname [ 128 ] ; + int fd ; +}; + [...117 lines suppressed...] @@ -156,15 +169,15 @@ /* use the old values */ - if ( buttons != NULL ) *buttons = tmp_buttons ; + if ( buttons != NULL ) *buttons = os->tmp_buttons ; if ( axes != NULL ) - memcpy ( axes, tmp_axes, sizeof(float) * num_axes ) ; + memcpy ( axes, os->tmp_axes, sizeof(float) * num_axes ) ; return ; } if ( buttons != NULL ) - *buttons = tmp_buttons ; + *buttons = os->tmp_buttons ; } } Index: jsLinuxOld.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/js/jsLinuxOld.cxx,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- jsLinuxOld.cxx 29 Nov 2002 19:39:48 -0000 1.1 +++ jsLinuxOld.cxx 15 Aug 2004 00:12:32 -0000 1.2 @@ -29,6 +29,12 @@ #include <sys/ioctl.h> #include <linux/joystick.h> +struct os_specific_s { + JS_DATA_TYPE js ; + char fname [ 128 ] ; + int fd ; +}; + void jsJoystick::open () { name [0] = '\0' ; @@ -36,9 +42,9 @@ num_axes = 2 ; /* Default for older Linux systems. */ num_buttons = 32 ; - fd = ::open ( fname, O_RDONLY ) ; + os->fd = ::open ( os->fname, O_RDONLY ) ; - error = ( fd < 0 ) ; + error = ( os->fd < 0 ) ; if ( error ) return ; @@ -79,18 +85,20 @@ void jsJoystick::close () { if ( ! error ) - ::close ( fd ) ; + ::close ( os->fd ) ; + delete os; } jsJoystick::jsJoystick ( int ident ) { id = ident ; + os = new struct os_specific_s; + + sprintf ( os->fname, "/dev/input/js%d", ident ) ; - sprintf ( fname, "/dev/input/js%d", ident ) ; - - if ( access ( fname, F_OK ) != 0 ) - sprintf ( fname, "/dev/js%d", ident ) ; + if ( access ( os->fname, F_OK ) != 0 ) + sprintf ( os->fname, "/dev/js%d", ident ) ; open () ; } @@ -110,24 +118,25 @@ return ; } - int status = ::read ( fd, &js, JS_RETURN ) ; + int status = ::read ( os->fd, &(os->js), JS_RETURN ) ; if ( status != JS_RETURN ) { - perror ( fname ) ; + perror ( os->fname ) ; setError () ; return ; } if ( buttons != NULL ) - *buttons = js.buttons ; + *buttons = os->js.buttons ; if ( axes != NULL ) { - axes[0] = (float) js.x ; - axes[1] = (float) js.y ; + axes[0] = (float) os->js.x ; + axes[1] = (float) os->js.y ; } } -#endif +void jsInit() {} +#endif Index: jsMacOS.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/js/jsMacOS.cxx,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- jsMacOS.cxx 30 Nov 2002 00:41:49 -0000 1.2 +++ jsMacOS.cxx 15 Aug 2004 00:12:32 -0000 1.3 @@ -25,8 +25,16 @@ #ifdef UL_MACINTOSH -#define _JS_MAX_AXES 9 +#include <InputSprocket.h> +//#define _JS_MAX_AXES_MAC 9 // not used +#define isp_num_axis 9 +#define isp_num_needs 41 + +struct os_specific_s { + ISpElementReference isp_elem [ isp_num_needs ] ; + ISpNeed isp_needs [ isp_num_needs ] ; +}; void jsJoystick::open () { @@ -93,7 +101,7 @@ { "\pButton 31", 128, 0, 0, kISpElementKind_Button, kISpElementLabel_Btn_Select, 0, 0, 0, 0 }, } ; - memcpy ( isp_needs, temp_isp_needs, sizeof(temp_isp_needs) ) ; + memcpy ( os->isp_needs, temp_isp_needs, sizeof(temp_isp_needs) ) ; // next two calls allow keyboard and mouse to emulate other input @@ -108,10 +116,10 @@ ISP_CHECK_ERR(err) */ - err = ISpElement_NewVirtualFromNeeds ( isp_num_needs, isp_needs, isp_elem, 0 ) ; + err = ISpElement_NewVirtualFromNeeds ( isp_num_needs, os->isp_needs, os->isp_elem, 0 ) ; ISP_CHECK_ERR(err) - err = ISpInit ( isp_num_needs, isp_needs, isp_elem, 'PLIB', nil, 0, 128, 0 ) ; + err = ISpInit ( isp_num_needs, os->isp_needs, os->isp_elem, 'PLIB', nil, 0, 128, 0 ) ; ISP_CHECK_ERR(err) num_buttons = isp_num_needs - isp_num_axis ; @@ -141,13 +149,15 @@ ISpSuspend () ; ISpStop () ; ISpShutdown () ; + delete os; } jsJoystick::jsJoystick ( int ident ) { id = ident ; - sprintf ( fname, "/dev/js%d", ident ) ; /* FIXME */ + os = new struct os_specific_s; + // sprintf ( fname, "/dev/js%d", ident ) ; /* FIXME */ open () ; } @@ -176,7 +186,7 @@ for ( i = 0 ; i < num_buttons ; i++ ) { - err = ISpElement_GetSimpleState ( isp_elem [ i + isp_num_axis ], &state) ; + err = ISpElement_GetSimpleState ( os->isp_elem [ i + isp_num_axis ], &state) ; ISP_CHECK_ERR(err) *buttons |= state << i ; @@ -187,7 +197,7 @@ { for ( i = 0 ; i < num_axes ; i++ ) { - err = ISpElement_GetSimpleState ( isp_elem [ i ], &state ) ; + err = ISpElement_GetSimpleState ( os->isp_elem [ i ], &state ) ; ISP_CHECK_ERR(err) axes [i] = (float) state ; @@ -195,4 +205,7 @@ } } +void jsInit() {} + #endif + Index: jsMacOSX.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/js/jsMacOSX.cxx,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- jsMacOSX.cxx 18 Mar 2004 17:20:52 -0000 1.2 +++ jsMacOSX.cxx 15 Aug 2004 00:12:32 -0000 1.3 @@ -1,7 +1,33 @@ +/* + 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 [...432 lines suppressed...] + + // hats: + for (int h=0; h < os->num_hats; ++h) { + (*(os->hidDev))->getElementValue(os->hidDev, os->hatCookies[h], &hidEvent); + long result = ( hidEvent.value - os->hat_min[h] ) * 8; + result /= ( os->hat_max[h] - os->hat_min[h] + 1 ); + if ( (result>=0) && (result<8) ) + { + axes[h+real_num_axes+1] = NS_hat[result]; + axes[h+real_num_axes] = WE_hat[result]; + } + else + { + axes[h+real_num_axes] = 0; + axes[h+real_num_axes+1] = 0; + } + } } #endif Index: jsNone.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/js/jsNone.cxx,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- jsNone.cxx 4 Jan 2003 02:55:54 -0000 1.2 +++ jsNone.cxx 15 Aug 2004 00:12:32 -0000 1.3 @@ -24,7 +24,11 @@ #if defined(UL_IRIX) || defined(UL_SOLARIS) || defined(UL_HPUX) -/* check the joystick driver version */ +/* +struct os_specific_s { +} +*/ + void jsJoystick::open () { @@ -33,10 +37,9 @@ } - void jsJoystick::close () { - error = TRUE ; + // if (os) delete os; } @@ -44,6 +47,7 @@ { error = TRUE ; num_axes = num_buttons = 0 ; + os = NULL; } Index: jsWindows.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/js/jsWindows.cxx,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- jsWindows.cxx 24 Mar 2004 15:57:09 -0000 1.2 +++ jsWindows.cxx 15 Aug 2004 00:12:32 -0000 1.3 @@ -27,17 +27,23 @@ // Since we use joyGetPosEx to request the joystick values, // we have never more than 8 axes to worry about: -#undef _JS_MAX_AXES -#define _JS_MAX_AXES 8 /* X,Y,Z,R,U,V,POV_X,POV_Y */ +#define _JS_MAX_AXES_WIN 8 /* X,Y,Z,R,U,V,POV_X,POV_Y */ + +struct os_specific_s { + JOYCAPS jsCaps ; + JOYINFOEX js ; + UINT js_id ; [...165 lines suppressed...] - case 3: axes[2] = (float) js . dwZpos ; - case 2: axes[1] = (float) js . dwYpos ; - case 1: axes[0] = (float) js . dwXpos ; + case 6: axes[5] = (float) os->js . dwVpos ; + case 5: axes[4] = (float) os->js . dwUpos ; + case 4: axes[3] = (float) os->js . dwRpos ; + case 3: axes[2] = (float) os->js . dwZpos ; + case 2: axes[1] = (float) os->js . dwYpos ; + case 1: axes[0] = (float) os->js . dwXpos ; break; default: @@ -247,5 +255,7 @@ } } +void jsInit() {} + #endif |
From: James J. <pu...@us...> - 2004-08-05 01:07:35
|
Update of /cvsroot/plib/plib/src/sg In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19375 Modified Files: sg.cxx sgd.cxx Log Message: SG efficiency: "sg[d]DistSquaredToLineSegmentVec3" with fewer square root invocations (John Fay) Index: sg.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/sg/sg.cxx,v retrieving revision 1.43 retrieving revision 1.44 diff -u -d -r1.43 -r1.44 --- sg.cxx 9 Apr 2004 01:41:11 -0000 1.43 +++ sg.cxx 5 Aug 2004 01:07:09 -0000 1.44 @@ -860,16 +860,14 @@ SGfloat sgDistSquaredToLineSegmentVec3 ( const sgLineSegment3 line, const sgVec3 pnt ) { - sgLine3 l ; sgLineSegment3ToLine3 ( & l, line ) ; - - sgVec3 v ; sgSubVec3 ( v , line.b, line.a ) ; sgNormalizeVec3 ( v ) ; - sgVec3 r1 ; sgSubVec3 ( r1, pnt , line.a ) ; - + sgVec3 v ; sgSubVec3 ( v, line.b, line.a ) ; + sgVec3 r1 ; sgSubVec3 ( r1, pnt, line.a ) ; + SGfloat r1_dot_v = sgScalarProductVec3 ( r1, v ) ; - + if ( r1_dot_v <= 0 ) /* Off the "A" end */ return sgScalarProductVec3 ( r1, r1 ) ; - + sgVec3 r2 ; sgSubVec3 ( r2, pnt, line.b ) ; SGfloat r2_dot_v = sgScalarProductVec3 ( r2, v ) ; @@ -879,7 +877,7 @@ /* Closest point on line is on the line segment */ - return sgScalarProductVec3 ( r1, r1 ) - r1_dot_v * r1_dot_v ; + return sgScalarProductVec3 ( r1, r1 ) - r1_dot_v * r1_dot_v / sgScalarProductVec3 ( v, v ) ; } Index: sgd.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/sg/sgd.cxx,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- sgd.cxx 9 Apr 2004 01:41:11 -0000 1.14 +++ sgd.cxx 5 Aug 2004 01:07:09 -0000 1.15 @@ -859,26 +859,24 @@ SGDfloat sgdDistSquaredToLineSegmentVec3 ( const sgdLineSegment3 line, const sgdVec3 pnt ) { - sgdLine3 l ; sgdLineSegment3ToLine3 ( & l, line ) ; - - sgdVec3 v ; sgdSubVec3 ( v, line.b, line.a ) ; sgdNormalizeVec3 ( v ) ; + sgdVec3 v ; sgdSubVec3 ( v, line.b, line.a ) ; sgdVec3 r1 ; sgdSubVec3 ( r1, pnt, line.a ) ; - - SGDfloat r1_dot_v = sgdScalarProductVec3 ( r1, v /*l.direction_vector*/ ) ; - + + SGDfloat r1_dot_v = sgdScalarProductVec3 ( r1, v ) ; + if ( r1_dot_v <= 0 ) /* Off the "A" end */ return sgdScalarProductVec3 ( r1, r1 ) ; - + sgdVec3 r2 ; sgdSubVec3 ( r2, pnt, line.b ) ; - SGDfloat r2_dot_v = sgdScalarProductVec3 ( r2, v /*l.direction_vector*/ ) ; - + SGDfloat r2_dot_v = sgdScalarProductVec3 ( r2, v ) ; + if ( r2_dot_v >= 0 ) /* Off the "B" end */ return sgdScalarProductVec3 ( r2, r2 ) ; /* Closest point on line is on the line segment */ - return sgdScalarProductVec3 ( r1, r1 ) - r1_dot_v * r1_dot_v ; + return sgdScalarProductVec3 ( r1, r1 ) - r1_dot_v * r1_dot_v / sgdScalarProductVec3 ( v, v ) ; } |
From: James J. <pu...@us...> - 2004-08-05 01:05:58
|
Update of /cvsroot/plib/plib/src/pui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19250 Modified Files: pu.h puBox.cxx puFont.cxx puInput.cxx puObject.cxx Log Message: (1) "puBox.cxx" - Change the amount and appearance of the "default-return" widget dashed lines (2) "pu.h", "puFont.cxx", "puInput.cxx", and "puObject.cxx" - Andy Ross' rendering fixes (related to the "fnt" library changes) Index: pu.h =================================================================== RCS file: /cvsroot/plib/plib/src/pui/pu.h,v retrieving revision 1.147 retrieving revision 1.148 diff -u -d -r1.147 -r1.148 --- pu.h 6 Apr 2004 12:53:16 -0000 1.147 +++ pu.h 5 Aug 2004 01:05:48 -0000 1.148 @@ -62,9 +62,11 @@ slant = sl ; } + float getPointSize ( ) const { return pointsize; } + int getStringDescender ( void ) const ; int getStringHeight ( const char *str ) const ; - int getStringHeight ( void ) const { return getStringHeight ( "K" ) ; } + int getStringHeight ( void ) const { return getStringHeight ( "" ) ; } float getFloatStringWidth ( const char *str ) const ; int getStringWidth ( const char *str ) const /* Deprecated ? */ Index: puBox.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/pui/puBox.cxx,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- puBox.cxx 2 Sep 2002 06:05:45 -0000 1.10 +++ puBox.cxx 5 Aug 2004 01:05:48 -0000 1.11 @@ -24,7 +24,7 @@ #include "puLocal.h" -#define PU_DFLT_OFFSET 8 +#define PU_DFLT_OFFSET 5 void puBox::extend ( puBox *bx ) { @@ -253,10 +253,10 @@ glLineStipple ( 1, 0xF0F0 ) ; glEnable ( GL_LINE_STIPPLE ) ; glBegin ( GL_LINE_LOOP ) ; - glVertex2i ( dx + min[0] + PU_DFLT_OFFSET, dy + min[1] + PU_DFLT_OFFSET ) ; - glVertex2i ( dx + min[0] + PU_DFLT_OFFSET, dy + max[1] - PU_DFLT_OFFSET ) ; - glVertex2i ( dx + max[0] - PU_DFLT_OFFSET, dy + max[1] - PU_DFLT_OFFSET ) ; - glVertex2i ( dx + max[0] - PU_DFLT_OFFSET, dy + min[1] + PU_DFLT_OFFSET ) ; + glVertex2f ( dx + min[0] + PU_DFLT_OFFSET + 0.5f, dy + min[1] + PU_DFLT_OFFSET + 0.5f ) ; + glVertex2f ( dx + min[0] + PU_DFLT_OFFSET + 0.5f, dy + max[1] - PU_DFLT_OFFSET - 0.5f ) ; + glVertex2f ( dx + max[0] - PU_DFLT_OFFSET - 0.5f, dy + max[1] - PU_DFLT_OFFSET - 0.5f ) ; + glVertex2f ( dx + max[0] - PU_DFLT_OFFSET - 0.5f, dy + min[1] + PU_DFLT_OFFSET + 0.5f ) ; glEnd () ; glDisable ( GL_LINE_STIPPLE ) ; } Index: puFont.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/pui/puFont.cxx,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- puFont.cxx 16 Feb 2004 13:49:03 -0000 1.23 +++ puFont.cxx 5 Aug 2004 01:05:48 -0000 1.24 @@ -75,15 +75,22 @@ int puFont::getStringHeight ( const char *s ) const { - /* Height *excluding* descender */ - - if ( s == NULL ) - return 0 ; + if (!s || !fnt_font_handle) return 0 ; - if ( fnt_font_handle != NULL ) - return int ( pointsize * ( 1.333f * count_lines ( s ) - 0.333f ) ) ; + // The height of a single line is the ascender plus descender, not + // including whitespace above and below. Each additional line + // adds one point size, of course. Remember to round up to avoid + // overlapping artifacts. The bbox string is just a sample of + // "likely to be tall" glyphs. + float ascend; + fnt_font_handle -> getBBox ( "$lfKL", pointsize, slant, NULL, NULL, NULL, &ascend ) ; + float height = ascend + getStringDescender() ; + int lines = count_lines ( s ) ; + if ( lines > 1 ) + height += ( lines - 1 ) * pointsize ; - return 0 ; + return int ( height + 0.999 ) ; + // return int ( pointsize * count_lines ( s ) + 0.999 ) - getStringDescender(); } Index: puInput.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/pui/puInput.cxx,v retrieving revision 1.34 retrieving revision 1.35 diff -u -d -r1.34 -r1.35 --- puInput.cxx 23 Feb 2004 04:16:52 -0000 1.34 +++ puInput.cxx 5 Aug 2004 01:05:48 -0000 1.35 @@ -82,7 +82,8 @@ else { int xx = legendFont.getStringWidth ( " " ) ; - int yy = ( abox.max[1] - abox.min[1] - legendFont.getStringHeight () ) / 2 ; + int yy = ( ( abox.max[1] - abox.min[1] - legendFont.getStringHeight () ) / 2 + + legendFont.getStringDescender () ) ; int ncut ; char *s2 ; @@ -150,20 +151,20 @@ { s2 [ cursor_position-ncut ] = '\0' ; - int cpos = legendFont.getStringWidth ( s2 ) + xx + dx + abox.min[0] ; - int top = yy + legendFont.getStringHeight () ; - int bot = yy - legendFont.getStringDescender() ; + float cpos = 0.5f + legendFont.getStringWidth ( s2 ) + xx + dx + abox.min[0] ; + float top = 0.5f + dy + abox.min[1] + yy + legendFont.getPointSize () ; + float bot = 0.5f + dy + abox.min[1] + yy - legendFont.getStringDescender() ; glColor4fv ( colour [ PUCOL_MISC ] ) ; glBegin ( GL_LINES ) ; - glVertex2i ( cpos , dy + abox.min[1] + bot ) ; - glVertex2i ( cpos , dy + abox.min[1] + top ) ; - glVertex2i ( cpos - 1, dy + abox.min[1] + bot ) ; - glVertex2i ( cpos - 1, dy + abox.min[1] + top ) ; - glVertex2i ( cpos - 4, dy + abox.min[1] + bot ) ; - glVertex2i ( cpos + 3, dy + abox.min[1] + bot ) ; - glVertex2i ( cpos - 4, dy + abox.min[1] + top ) ; - glVertex2i ( cpos + 3, dy + abox.min[1] + top ) ; + glVertex2f ( cpos , bot ) ; + glVertex2f ( cpos , top ) ; + glVertex2f ( cpos - 1, bot ) ; + glVertex2f ( cpos - 1, top ) ; + glVertex2f ( cpos - 3, bot ) ; + glVertex2f ( cpos + 3, bot ) ; + glVertex2f ( cpos - 3, top ) ; + glVertex2f ( cpos + 3, top ) ; glEnd () ; } } Index: puObject.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/pui/puObject.cxx,v retrieving revision 1.49 retrieving revision 1.50 diff -u -d -r1.49 -r1.50 --- puObject.cxx 19 Sep 2002 23:32:58 -0000 1.49 +++ puObject.cxx 5 Aug 2004 01:05:48 -0000 1.50 @@ -337,9 +337,9 @@ case PUPLACE_LOWER_LEFT : /* Backwards compatibility to PUPLACE_LEFT */ case PUPLACE_LOWER_RIGHT : /* Backwards compatibility to PUPLACE_RIGHT */ default : - yy = ( abox.max[1] - abox.min[1] + - legendFont.getStringHeight ( legend ) ) / 2 - - legendFont.getStringHeight () ; + yy = ( abox.max[1] - abox.min[1] + - legendFont.getStringHeight ( legend ) ) / 2 + + legendFont.getStringDescender () ; break ; case PUPLACE_BOTTOM_LEFT : @@ -427,9 +427,9 @@ case PUPLACE_CENTERED_LEFT : case PUPLACE_CENTERED_RIGHT : default : - yy = ( bbox.max[1] - bbox.min[1] + - labelFont.getStringHeight ( label ) ) / 2 - - labelFont.getStringHeight () ; + yy = ( bbox.max[1] - bbox.min[1] - + labelFont.getStringHeight ( label ) ) / 2 + + labelFont.getStringDescender () ; break ; case PUPLACE_LOWER_LEFT : |
From: James J. <pu...@us...> - 2004-08-05 01:04:08
|
Update of /cvsroot/plib/plib/src/puAux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18925 Modified Files: Makefile.am puAux.h puAuxCompass.cxx Added Files: puAuxChooser.cxx Log Message: Adds puAuxChooser and some changes to puAuxCompass (John Fay) --- NEW FILE: puAuxChooser.cxx --- /* PUI Auxiliary Widget Library Derived from PLIB, the Portable Game Library by Steve Baker. Copyright (C) 1998,2002,2004 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 [...65 lines suppressed...] void puaChooser::menuCleanup ( puObject *ob ) { puObject *p = ob -> getParent () ; ((puaChooser*)( p -> getUserData () )) -> menuCleanup ( ob -> getLegend () ) ; } void puaChooser::static_popup_cb ( puObject *ob ) { ((puaChooser*)( ob -> getUserData () )) -> popup_cb () ; } void puaChooser::static_menu_cb ( puObject *ob ) { ((puaChooser*)( ob -> getUserData () )) -> menuCleanup ( (const char *)NULL ) ; } Index: Makefile.am =================================================================== RCS file: /cvsroot/plib/plib/src/puAux/Makefile.am,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Makefile.am 21 Mar 2004 19:49:48 -0000 1.2 +++ Makefile.am 5 Aug 2004 01:03:49 -0000 1.3 @@ -16,7 +16,8 @@ puAuxSliderWithInput.cxx \ puAuxSpinBox.cxx \ puAuxTriSlider.cxx \ - puAuxVerticalMenu.cxx + puAuxVerticalMenu.cxx \ + puAuxChooser.cxx INCLUDES = -I$(top_srcdir)/src/sg \ -I$(top_srcdir)/src/pui \ Index: puAux.h =================================================================== RCS file: /cvsroot/plib/plib/src/puAux/puAux.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- puAux.h 28 Feb 2004 00:54:03 -0000 1.1 +++ puAux.h 5 Aug 2004 01:03:49 -0000 1.2 @@ -41,6 +41,7 @@ #define PUCLASS_BISLIDERWITHENDS 0x02000000 #define PUCLASS_SLIDERWITHINPUT 0x04000000 #define PUCLASS_COMPASS 0x08000000 +#define PUCLASS_CHOOSER 0x10000000 // Widget Declarations @@ -56,6 +57,7 @@ class puaBiSliderWithEnds ; class puaCompass ; class puaSliderWithInput ; +class puaChooser ; // A File selector widget @@ -743,7 +745,11 @@ { setValue ( PUACOMPASS_INACTIVE ) ; - sgSetQuat ( rotation, 1.0f, 0.0f, 0.0f, 0.0f ) ; +// sgSetQuat ( rotation, 1.0f, 0.0f, 0.0f, 0.0f ) ; +// sgSetQuat ( rotation, 0.707107f, 0.707107f, 0.0f, 0.0f ) ; +// sgSetQuat ( rotation, 0.5f, -0.5f, 0.5f, 0.5f ) ; +// sgSetQuat ( rotation, 0.866025f, -0.166667f, 0.166667f, 0.166667f ) ; + sgSetQuat ( rotation, 0.866025f, -0.408248f, 0.288675f, 0.0f ) ; sgSetVec3 ( translation, 0.0f, 0.0f, 0.0f ) ; point_size = 10.0f ; @@ -764,9 +770,20 @@ // Accessors and mutators void getRotation ( sgQuat q ) const { memcpy ( q, rotation, 4 * sizeof(sgFloat) ) ; } void setRotation ( sgQuat q ) { memcpy ( rotation, q, 4 * sizeof(sgFloat) ) ; } + void setRotation ( sgFloat t, sgFloat x, sgFloat y, sgFloat z ) + { + sgFloat sinth = sgSin ( t / 2.0f ) ; + sgFloat norm = sgSqrt ( x * x + y * y + z * z ) ; + if ( norm == 0.0 ) norm = 1.0 ; + rotation[SG_W] = sgCos ( t / 2.0f ) ; + rotation[SG_X] = sinth * x / norm ; + rotation[SG_Y] = sinth * y / norm ; + rotation[SG_Z] = sinth * z / norm ; + } void getTranslation ( sgVec3 t ) const { memcpy ( t, translation, 3 * sizeof(sgFloat) ) ; } void setTranslation ( sgVec3 t ) { memcpy ( translation, t, 3 * sizeof(sgFloat) ) ; } + void setTranslation ( sgFloat x, sgFloat y, sgFloat z ) { translation[SG_X] = x ; translation[SG_Y] = y ; translation[SG_Z] = z ; } float getPointSize () const { return point_size ; } void setPointSize ( float p ) { point_size = p ; } @@ -779,5 +796,41 @@ } ; +class puaChooser +{ + UL_TYPE_DATA + + puButton *chooser_button ; + puPopupMenu *popup_menu ; + + int x1, y1, x2, y2 ; + + static void static_popup_cb ( puObject * ) ; + static void static_menu_cb ( puObject * ) ; + +public: + + ~puaChooser () + { + delete chooser_button ; + delete popup_menu ; + } + + puaChooser ( int _x1, int _y1, int _x2, int _y2, char *legend ) ; + + void add_item ( char *str, puCallback _cb, void *_user_data = NULL ) ; + void close () ; + + void popup_cb () ; + + void menuCleanup ( const char *s ) ; + + void hide () { chooser_button -> hide () ; popup_menu -> hide () ; } + void reveal () { chooser_button -> reveal () ; popup_menu -> hide () ; } + + static void menuCleanup ( puObject * ) ; +} ; + + #endif Index: puAuxCompass.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/puAux/puAuxCompass.cxx,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- puAuxCompass.cxx 21 Mar 2004 19:03:23 -0000 1.4 +++ puAuxCompass.cxx 5 Aug 2004 01:03:49 -0000 1.5 @@ -37,19 +37,19 @@ if ( getIntegerValue () == value ) \ glColor4fv ( colour [ PUCOL_LEGEND ] ) ; \ else \ - glColor4f ( 1.0, 1.0, 1.0, 1.0 ) + glColor4fv ( colour [ PUCOL_FOREGROUND ] ) #define SET_ARC_COLOUR2(value1,value2) \ if ( ( getIntegerValue () == value1 ) || ( getIntegerValue () == value2 ) ) \ glColor4fv ( colour [ PUCOL_LEGEND ] ) ; \ else \ - glColor4f ( 1.0, 1.0, 1.0, 1.0 ) + glColor4fv ( colour [ PUCOL_FOREGROUND ] ) #define SET_ARC_COLOUR3(value1,value2,value3) \ if ( ( getIntegerValue () == value1 ) || ( getIntegerValue () == value2 ) || ( getIntegerValue () == value3 ) ) \ glColor4fv ( colour [ PUCOL_LEGEND ] ) ; \ else \ - glColor4f ( 1.0, 1.0, 1.0, 1.0 ) + glColor4fv ( colour [ PUCOL_FOREGROUND ] ) void puaCompass::draw ( int dx, int dy ) { @@ -69,8 +69,8 @@ { float xsize = float(abox.max[0] - abox.min[0]) ; float ysize = float(abox.max[1] - abox.min[1]) ; - float xcenter = float(dx) + xsize / 2.0f ; - float ycenter = float(dy) + ysize / 2.0f ; + float xcenter = float(dx + abox.min[0]) + xsize / 2.0f ; + float ycenter = float(dy + abox.min[1]) + ysize / 2.0f ; float size = ( ( xsize > ysize ) ? ysize : xsize ) / 2.5f ; glMatrixMode ( GL_MODELVIEW ) ; @@ -217,8 +217,8 @@ mouse_click_line.direction_vector[1] = 2.0f * ( prev_rotation[SG_W] * prev_rotation[SG_X] + prev_rotation[SG_Y] * prev_rotation[SG_Z] ) ; mouse_click_line.direction_vector[2] = prev_rotation[SG_W] * prev_rotation[SG_W] + prev_rotation[SG_Z] * prev_rotation[SG_Z] - prev_rotation[SG_X] * prev_rotation[SG_X] - prev_rotation[SG_Y] * prev_rotation[SG_Y] ; - float xm = float(x) - xsize / 2.0f ; - float ym = float(y) - ysize / 2.0f ; + float xm = float(x - abox.min[0]) - xsize / 2.0f ; + float ym = float(y - abox.min[1]) - ysize / 2.0f ; sgSetVec3 ( mouse_click_line.point_on_line, xm, ym, 0.0f ) ; sgRotateCoordQuat ( mouse_click_line.point_on_line, prev_rotation ) ; |
From: James J. <pu...@us...> - 2004-08-05 00:57:47
|
Update of /cvsroot/plib/plib/src/psl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18071 Modified Files: pslCompiler.h pslProgram.cxx Log Message: Implements some reference-counting in PSL, in accordance with Jonathan Wheare's e-mail of 4/20/04 at 9:20 AM. Index: pslCompiler.h =================================================================== RCS file: /cvsroot/plib/plib/src/psl/pslCompiler.h,v retrieving revision 1.33 retrieving revision 1.34 diff -u -d -r1.33 -r1.34 --- pslCompiler.h 6 Jan 2003 05:10:13 -0000 1.33 +++ pslCompiler.h 5 Aug 2004 00:57:37 -0000 1.34 @@ -51,6 +51,8 @@ class pslCompiler { + int ref_count; // reference count. Clean up when this reaches zero + /* File I/O and preprocessor */ int getChar () ; @@ -313,6 +315,7 @@ const pslExtension *_extn, const char *_progName ) { + ref_count = 1; program = prog ; progName = ulStrDup ( _progName ) ; @@ -344,6 +347,21 @@ } } + void ref() + { + ref_count++; + } + + void deref() + { + ref_count--; + if(ref_count < 1) + { + delete [] code; + delete this; + } + } + const pslExtension *getExtensions () const { return extensions ; } int printInstruction ( FILE *fd, int addr ) const ; Index: pslProgram.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/psl/pslProgram.cxx,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- pslProgram.cxx 6 Jan 2003 05:10:14 -0000 1.17 +++ pslProgram.cxx 5 Aug 2004 00:57:38 -0000 1.18 @@ -86,9 +86,8 @@ /* We need ref-counting on code/compiler */ /* DEBUG-ME! */ delete [] progName ; - delete compiler ; delete context ; - delete [] code ; + compiler -> ref(); } |
From: James J. <pu...@us...> - 2004-08-05 00:55:43
|
Update of /cvsroot/plib/plib/src/pw In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17799 Modified Files: pwWindows.cxx Log Message: This implements the key auto-repeat in Windows to be the same as it is in X11. (John Fay) Index: pwWindows.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/pw/pwWindows.cxx,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- pwWindows.cxx 9 Apr 2004 00:05:19 -0000 1.12 +++ pwWindows.cxx 5 Aug 2004 00:55:32 -0000 1.13 @@ -121,7 +121,20 @@ case WM_KEYDOWN: /* If the key is already down, we are on auto-repeat. Break if the autorepeat is disabled. */ - if ( ( updown == PW_DOWN ) && ( int(wParam) == old_key ) && !autoRepeat ) break ; + if ( ( updown == PW_DOWN ) && ( int(wParam) == old_key ) ) + { + if ( autoRepeat ) + { + /* Disable CTRL, SHIFT, CapsLock keys from making a callback */ + if ( ( key == VK_CONTROL ) || ( key == VK_SHIFT ) || ( key == VK_CAPITAL ) ) + break ; + + if ( key != -1 && kbCB ) // Autorepeat enabled, call the callback with an "up" setting + (*kbCB) ( key, PW_UP, lastx, lasty ) ; + } + else + break ; // Autorepeat not enabled, just break + } updown = PW_DOWN ; old_key = wParam ; @@ -202,7 +215,6 @@ autoRepeat = enable ; } - void pwSetCallbacks ( pwKeybdFunc *kb, pwMouseFunc *ms, pwMousePosFunc *mp, pwResizeCB *rcb, pwExitCB *ecb ) { @@ -226,6 +238,8 @@ } +//typedef const char * wglGetExtensionsStringARBtype ( HDC hdc ) ; + void pwInit ( int x, int y, int w, int h, int multisample, char *title, int border, int num_samples ) { @@ -294,6 +308,14 @@ exit ( 1 ) ; } +// wglGetExtensionsStringARBtype *wglGetExtensionsStringARB = (wglGetExtensionsStringARBtype *)wglGetProcAddress ( "wglGetExtensionsStringARB" ) ; +// const char *extensionsString = wglGetExtensionsStringARB ( currDC ) ; + +// printf ( "%s %x %s\n", glGetString ( GL_EXTENSIONS ), wglGetExtensionsStringARB, extensionsString ) ; + +// if (!GLExtensionExists("WGL_ARB_multisample ")) +// return suggestedFormat; + /* Set pixel format for DC */ PIXELFORMATDESCRIPTOR pfd = { sizeof(PIXELFORMATDESCRIPTOR), /* size of this pfd */ |