plib-cvs Mailing List for PLIB (Page 5)
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: Wolfram K. <wol...@us...> - 2004-10-29 22:43:34
|
Update of /cvsroot/plib/plib/examples/src/ssg/viewer/data In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7426 Added Files: animated.ASE Log Message: Example for *CONTROL_TCB_ROT_KEY animation. --- NEW FILE: animated.ASE --- *3DSMAX_ASCIIEXPORT 200 *COMMENT "AsciiExport Version 2.00 - Sun Oct 24 23:45:37 2004" *SCENE { *SCENE_FILENAME "" *SCENE_FIRSTFRAME 0 *SCENE_LASTFRAME 100 *SCENE_FRAMESPEED 30 *SCENE_TICKSPERFRAME 160 *SCENE_BACKGROUND_STATIC 0.0000 0.0000 0.0000 *SCENE_AMBIENT_STATIC 0.0000 0.0000 0.0000 } *MATERIAL_LIST { *MATERIAL_COUNT 2 *MATERIAL 0 { *MATERIAL_NAME "Brown" *MATERIAL_CLASS "Standard" *MATERIAL_AMBIENT 0.5020 0.5020 0.5020 *MATERIAL_DIFFUSE 0.5020 0.5020 0.5020 *MATERIAL_SPECULAR 0.5020 0.5020 0.5020 [...260 lines suppressed...] *MESH_VERTEXNORMAL 0 -1.0000 0.0000 0.0000 *MESH_VERTEXNORMAL 4 -1.0000 0.0000 0.0000 *MESH_FACENORMAL 11 -1.0000 0.0000 0.0000 *MESH_VERTEXNORMAL 4 -1.0000 0.0000 0.0000 *MESH_VERTEXNORMAL 6 -1.0000 0.0000 0.0000 *MESH_VERTEXNORMAL 2 -1.0000 0.0000 0.0000 } } *PROP_MOTIONBLUR 0 *PROP_CASTSHADOW 1 *PROP_RECVSHADOW 1 *TM_ANIMATION { *NODE_NAME "Box02" *CONTROL_ROT_TCB { *CONTROL_TCB_ROT_KEY 0 1.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 *CONTROL_TCB_ROT_KEY 1600 0.0000 -1.0000 -0.0000 0.3491 0.0000 0.0000 0.0000 0.0000 0.0000 } } *WIREFRAME_COLOR 0.2235 0.0314 0.5333 } |
From: Wolfram K. <wol...@us...> - 2004-10-29 22:41:50
|
Update of /cvsroot/plib/plib/src/ssg In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6948 Modified Files: ssgLoadASE.cxx Log Message: Implemented *CONTROL_TCB_ROT_KEY (translation not implemented yet). This creates ssgAnimTransform nodes for animation. Index: ssgLoadASE.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgLoadASE.cxx,v retrieving revision 1.47 retrieving revision 1.48 diff -u -d -r1.47 -r1.48 --- ssgLoadASE.cxx 4 Oct 2004 08:11:26 -0000 1.47 +++ ssgLoadASE.cxx 29 Oct 2004 22:41:37 -0000 1.48 @@ -169,7 +169,7 @@ static u32 last_frame ; static u32 frame_speed ; static u32 ticks_per_frame ; -static u32 num_frames ; +static u32 num_frames=0 ; static _ssgParserSpec parser_spec = { @@ -1144,10 +1144,13 @@ return( &obj->tkeys[ frame ] ); } [...82 lines suppressed...] for ( u32 i = 1 ; i < obj->num_tkeys ; i++ ) { @@ -1514,13 +1559,11 @@ sgMakeTransMat4 ( tmp, pos ) ; sgPostMultMat4 ( mat, tmp ) ; - ta -> add ( mat ) ; + at->setATransform ( mat, i); } - - ssgTransform* tr = new ssgTransform ; - tr = current_options -> createTransform ( tr, ta ) ; - tr -> addKid ( mesh_entity ) ; - mesh_entity = tr ; + // insert the ssgAnimTransform into the scene graph: + at-> addKid ( mesh_entity ) ; + mesh_entity = at; } parent_branch -> addKid ( mesh_entity ) ; |
From: Wolfram K. <wol...@us...> - 2004-10-29 22:30:43
|
Update of /cvsroot/plib/plib/src/ssg In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4306 Added Files: ssgAnimTransform.cxx Log Message: Implementing ssgAnimTransform --- NEW FILE: ssgAnimTransform.cxx --- /* PLIB - A Suite of Portable Game Libraries Copyright (C) 1998-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 For further information visit http://plib.sourceforge.net [...135 lines suppressed...] return ssgBranch::save ( fd ) ; } void ssgAnimTransform::print ( FILE *fd, char *indent, int how_much ) { if ( how_much == 0 ) return ; fprintf ( fd, "%sCurrent Bank = %f\n", indent, curr_bank ); fprintf ( fd, "%sMode = %d\n", indent, (int)mode ); if ( how_much > 1 ) transformations.print( fd, indent, how_much ); ssgBranch::print ( fd, indent, how_much ) ; } |
From: Wolfram K. <wol...@us...> - 2004-10-29 22:28:26
|
Update of /cvsroot/plib/plib/src/ssg In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3649 Modified Files: ssgLoadASC.cxx Log Message: untexturedState is now a pointer. Setting the name of the material (state) to the texturename, if textured. Index: ssgLoadASC.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgLoadASC.cxx,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- ssgLoadASC.cxx 6 Oct 2004 14:31:55 -0000 1.2 +++ ssgLoadASC.cxx 29 Oct 2004 22:28:16 -0000 1.3 @@ -259,7 +259,7 @@ static ssgSimpleState *currentState; // we only need one of these, since obviously the texture name is the only materialproperty in asc: -static ssgSimpleState untexturedState; +static ssgSimpleState *untexturedState = NULL; extern sgVec4 currentDiffuse; @@ -497,7 +497,7 @@ MeshStatus.materialed_but_not_mapped = FALSE; MeshStatus.hidden = FALSE; // unused noOfAscmaterials=0; - currentState = &untexturedState; + currentState = untexturedState; currentMesh.reInit (); @@ -572,6 +572,7 @@ currentState->setShininess(50); // set texture currentState -> setTexture( current_options -> createTexture( s ) ); + currentState -> setName(s); currentState -> enable( GL_TEXTURE_2D ); currentMesh.addMaterial(¤tState); return noOfAscmaterials-1; @@ -661,7 +662,7 @@ } else { - int iFace, A, B, C, AB, _BC, CA; + int iFace, AB, _BC, CA; int aiVertices[3]; if (!parser.getNextInt(iFace, "Face index")) return FALSE; assert(MeshStatus.isvalid); @@ -976,21 +977,22 @@ MeshStatus.sName = NULL; - untexturedState.setOpaque(); - untexturedState.disable(GL_BLEND); - untexturedState.disable(GL_ALPHA_TEST); - untexturedState.disable(GL_TEXTURE_2D); - untexturedState.enable(GL_COLOR_MATERIAL); - untexturedState.enable(GL_LIGHTING); - untexturedState.setShadeModel(GL_SMOOTH); - untexturedState.setMaterial(GL_AMBIENT , 0.7f, 0.7f, 0.7f, 1.0f); - untexturedState.setMaterial(GL_DIFFUSE , 0.7f, 0.7f, 0.7f, 1.0f); - untexturedState.setMaterial(GL_SPECULAR, 1.0f, 1.0f, 1.0f, 1.0f); - untexturedState.setMaterial(GL_EMISSION, 0.0f, 0.0f, 0.0f, 1.0f); - untexturedState.setShininess(50); - untexturedState.ref(); + untexturedState = new ssgSimpleState; + untexturedState->setOpaque(); + untexturedState->disable(GL_BLEND); + untexturedState->disable(GL_ALPHA_TEST); + untexturedState->disable(GL_TEXTURE_2D); + untexturedState->enable(GL_COLOR_MATERIAL); + untexturedState->enable(GL_LIGHTING); + untexturedState->setShadeModel(GL_SMOOTH); + untexturedState->setMaterial(GL_AMBIENT , 0.7f, 0.7f, 0.7f, 1.0f); + untexturedState->setMaterial(GL_DIFFUSE , 0.7f, 0.7f, 0.7f, 1.0f); + untexturedState->setMaterial(GL_SPECULAR, 1.0f, 1.0f, 1.0f, 1.0f); + untexturedState->setMaterial(GL_EMISSION, 0.0f, 0.0f, 0.0f, 1.0f); + untexturedState->setShininess(50); + untexturedState->ref(); - currentState = &untexturedState; + currentState = untexturedState; top_branch = new ssgBranch ; curr_branch_ = top_branch; if ( !parser.openFile( fname, &parser_spec )) @@ -1006,5 +1008,8 @@ // parse_free(); parser.closeFile(); + untexturedState->deRef(); + if(untexturedState->getRef()==0) + delete untexturedState; return top_branch ; } |
From: Wolfram K. <wol...@us...> - 2004-10-29 22:24:19
|
Update of /cvsroot/plib/plib/src/ssg In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2636 Modified Files: ssg.cxx ssg.dsp ssg.h Log Message: Implementing ssgAnimTransform Index: ssg.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssg.cxx,v retrieving revision 1.69 retrieving revision 1.70 diff -u -d -r1.69 -r1.70 --- ssg.cxx 6 Oct 2004 14:27:04 -0000 1.69 +++ ssg.cxx 29 Oct 2004 22:24:08 -0000 1.70 @@ -148,7 +148,7 @@ ssgAddModelFormat ( ".iv", ssgLoadIV , ssgSaveIV ) ; ssgAddModelFormat ( ".asc", ssgLoadASC , ssgSaveASC ) ; //ssgAddModelFormat ( ".pov", NULL , ssgSavePOV ) ; - + #ifdef SSG_LOAD_MDL_SUPPORTED ssgAddModelFormat ( ".mdl", ssgLoadMDL , NULL ) ; @@ -357,7 +357,8 @@ //static ssgBase *createBaseTransform () { return new ssgBaseTransform ; } static ssgBase *createTransform () { return new ssgTransform ; } static ssgBase *createTexTrans () { return new ssgTexTrans ; } -static ssgBase *createAxisTransform() { return new ssgAxisTransform; } +static ssgBase *createAnimTransform() { return new ssgAnimTransform ; } +static ssgBase *createAxisTransform() { return new ssgAxisTransform ; } static ssgBase *createSelector () { return new ssgSelector ; } static ssgBase *createRangeSelector () { return new ssgRangeSelector ; } static ssgBase *createTimedSelector () { return new ssgTimedSelector ; } @@ -400,9 +401,10 @@ { ssgTypeBranch () , createBranch }, //{ ssgTypeBaseTransform () , createBaseTransform }, { ssgTypeTransform () , createTransform }, + { ssgTypeAnimTransform () , createAnimTransform }, { ssgTypeTexTrans () , createTexTrans }, - { ssgTypeAxisTransform () , createAxisTransform }, - { ssgTypeSelector () , createSelector }, + { ssgTypeAxisTransform () , createAxisTransform }, + { ssgTypeSelector () , createSelector }, { ssgTypeRangeSelector () , createRangeSelector }, { ssgTypeTimedSelector () , createTimedSelector }, { ssgTypeTweenController () , createTweenController }, @@ -434,7 +436,7 @@ if ( type == 0 || func == NULL ) { ulSetError ( UL_WARNING, "ssgRegisterType: Bad arguments (type %#x, func %p).", - type, func ) ; + type, func ) ; return ; } @@ -469,8 +471,8 @@ ulSetError ( UL_WARNING, "ssgCreateOfType: Got null object for type %#x.", type ) ; else if ( obj -> getType () != type ) ulSetError ( UL_WARNING, - "ssgCreateOfType: Created object has wrong type %#x (%s), expected %#x.", - obj -> getType (), obj -> getTypeName (), type ) ; + "ssgCreateOfType: Created object has wrong type %#x (%s), expected %#x.", + obj -> getType (), obj -> getTypeName (), type ) ; return obj ; } Index: ssg.dsp =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssg.dsp,v retrieving revision 1.52 retrieving revision 1.53 diff -u -d -r1.52 -r1.53 --- ssg.dsp 4 Oct 2004 18:47:24 -0000 1.52 +++ ssg.dsp 29 Oct 2004 22:24:08 -0000 1.53 @@ -112,6 +112,10 @@ # End Source File # Begin Source File +SOURCE=.\ssgAnimTransform.cxx +# End Source File +# Begin Source File + SOURCE=.\ssgAxisTransform.cxx # End Source File # Begin Source File Index: ssg.h =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssg.h,v retrieving revision 1.173 retrieving revision 1.174 diff -u -d -r1.173 -r1.174 --- ssg.h 4 Oct 2004 18:25:59 -0000 1.173 +++ ssg.h 29 Oct 2004 22:24:08 -0000 1.174 @@ -99,6 +99,7 @@ #define _SSG_TYPE_TRANSFORM 0x00001000 #define _SSG_TYPE_TEXTRANS 0x00002000 #define _SSG_TYPE_AXISTRANSFORM 0x00004000 +#define _SSG_TYPE_ANIMTRANSFORM 0x00008000 #define _SSG_TYPE_SELECTOR 0x00000100 #define _SSG_TYPE_RANGESELECTOR 0x00001000 #define _SSG_TYPE_TIMEDSELECTOR 0x00002000 @@ -142,6 +143,7 @@ inline int ssgTypeTweenController(){ return _SSG_TYPE_TWEENCONTROLLER | ssgTypeBranch() ; } inline int ssgTypeBaseTransform() { return _SSG_TYPE_BASETRANSFORM | ssgTypeBranch () ; } inline int ssgTypeTransform () { return _SSG_TYPE_TRANSFORM | ssgTypeBaseTransform () ; } +inline int ssgTypeAnimTransform() { return _SSG_TYPE_ANIMTRANSFORM | ssgTypeTransform () ; } inline int ssgTypeTexTrans () { return _SSG_TYPE_TEXTRANS | ssgTypeBaseTransform () ; } inline int ssgTypeAxisTransform() { return _SSG_TYPE_AXISTRANSFORM | ssgTypeTransform () ; } inline int ssgTypeSelector () { return _SSG_TYPE_SELECTOR | ssgTypeBranch () ; } @@ -1302,6 +1304,7 @@ extern sgVec3 _ssgNormalUp ; extern sgVec2 _ssgTexCoord00 ; extern short _ssgIndex0 ; +extern float _ssgGlobTime ; // used by ssgAnimTransform. Has to be set by the appliation! class ssgVTable : public ssgLeaf @@ -2047,6 +2050,39 @@ virtual void recalcBSphere () ; } ; +class ssgAnimTransform : public ssgTransform +{ + float curr_bank ; + int mode ; /* SSGTWEEN_STOP_AT_END or SSGTWEEN_REPEAT */ + class ssgTransformArray transformations; + +protected: + + virtual void copy_from ( ssgAnimTransform *src, int clone_flags ) ; + +public: + + void setNum ( unsigned int n ) { transformations.setNum( n ); } + void setATransform ( sgMat4 thing, unsigned int n ) { transformations.raw_set ( (char *) thing, n ) ; } ; + + + virtual ssgBase *clone ( int clone_flags = 0 ) ; + ssgAnimTransform (void) ; + virtual ~ssgAnimTransform (void) ; + + void setMode ( int _mode ) { mode = _mode ; } + int getMode () { return mode ; } + + void selectBank ( float f ) { curr_bank = f ; } + float getCurrBank () { return curr_bank ; } + + virtual void cull ( sgFrustum *f, sgMat4 m, int test_needed ) ; + virtual const char *getTypeName(void) ; + virtual void print ( FILE *fd = stderr, char *indent = "", int how_much = 2 ) ; + virtual int load ( FILE *fd ) ; + virtual int save ( FILE *fd ) ; +} ; + class ssgAxisTransform : public ssgTransform { |
From: Wolfram K. <wol...@us...> - 2004-10-29 21:26:17
|
Update of /cvsroot/plib/plib/examples/src/ssg/viewer In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23367 Modified Files: viewer.cxx Log Message: Made code simpler, partly by using ssgAnimTransform Index: viewer.cxx =================================================================== RCS file: /cvsroot/plib/plib/examples/src/ssg/viewer/viewer.cxx,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- viewer.cxx 25 Oct 2004 20:53:29 -0000 1.24 +++ viewer.cxx 29 Oct 2004 21:26:03 -0000 1.25 @@ -69,6 +69,8 @@ 2 - Single move and Jump 10 moves */ + + /* scene graph */ @@ -96,8 +98,7 @@ static const int speed_tab [] = { 0, 1, 2, 3, 4, 5, 6, 10, 12, 15, 20, 30, 60 }; [...183 lines suppressed...] if ( speed_tab[ speed_index ] != MAX_SPEED ) speed_index ++ ; - anim_delay = get_delay( speed_index ); break; case '-': if ( speed_tab[ speed_index ] != 0 ) speed_index -- ; - anim_delay = get_delay( speed_index ); break; case ' ': Ex = 0; @@ -847,6 +806,8 @@ sgVec3 sunposn ; sgSetVec3 ( sunposn, 200.0f, -500.0f, 500.0f ) ; ssgGetLight ( 0 ) -> setPosition ( sunposn ) ; + + /* Set up the path to the data files |
From: Wolfram K. <wol...@us...> - 2004-10-25 20:53:38
|
Update of /cvsroot/plib/plib/examples/src/ssg/viewer In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25402 Modified Files: viewer.cxx Log Message: Implemented fluid animation Index: viewer.cxx =================================================================== RCS file: /cvsroot/plib/plib/examples/src/ssg/viewer/viewer.cxx,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- viewer.cxx 1 Sep 2002 12:04:52 -0000 1.23 +++ viewer.cxx 25 Oct 2004 20:53:29 -0000 1.24 @@ -262,11 +262,32 @@ int num = ta -> getNum () ; if ( num > 0 ) { +#ifdef DISCREET_STEPS int frame = anim_frame ; if ( frame >= num ) frame = num-1 ; ta -> selection = frame ; p -> setTransform ( *( ta -> get ( ta -> selection ) ) ) ; +#else + /* fluid motion */ + int curr_time = glutGet((GLenum)GLUT_ELAPSED_TIME); // in ms + int nFrame = curr_time / 1000; + int frac = curr_time -1000*nFrame; + float tFrame, tFrameP1; + tFrame = frac / 1000.0f; + tFrameP1 = 1.0 - tFrame; + nFrame = nFrame - (num-1) * (nFrame/(num-1)); + assert(nFrame<num-1); + { + sgMat4 XForm, *pmFrame; + pmFrame = ta -> get ( nFrame ); + sgMat4 *pmFrameP1 = ta -> get ( nFrame+1 ); + for(int i=0;i<4;i++) + for(int j=0; j<4; j++) + XForm[i][j] = tFrame * ((*pmFrame)[i][j]) + tFrameP1 * ((*pmFrameP1)[i][j]); + p -> setTransform ( XForm ); + } +#end } } } |
From: Wolfram K. <wol...@us...> - 2004-10-20 23:49:42
|
Update of /cvsroot/plib/plib/src/js In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14981 Modified Files: js.h jsLinux.cxx jsLinuxOld.cxx Log Message: Changes by Mathias Froehlich, see his mail on plib-devel from Date: Mon, 18 Oct 2004 21:19:04 +0200 Index: js.h =================================================================== RCS file: /cvsroot/plib/plib/src/js/js.h,v retrieving revision 1.32 retrieving revision 1.33 diff -u -d -r1.32 -r1.33 --- js.h 21 Sep 2004 11:45:55 -0000 1.32 +++ js.h 20 Oct 2004 23:49:33 -0000 1.33 @@ -23,6 +23,7 @@ #ifndef __INCLUDED_JS_H__ #define __INCLUDED_JS_H__ 1 +#define JS_NEW #include "ul.h" Index: jsLinux.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/js/jsLinux.cxx,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- jsLinux.cxx 21 Sep 2004 11:45:55 -0000 1.5 +++ jsLinux.cxx 20 Oct 2004 23:49:33 -0000 1.6 @@ -23,9 +23,12 @@ #include "js.h" -#if defined (UL_LINUX) && defined (JS_NEW) +#if defined (UL_LINUX) #include <linux/joystick.h> + +#if defined(JS_VERSION) && JS_VERSION >= 0x010000 + #include <sys/param.h> #include <fcntl.h> #include <sys/ioctl.h> @@ -75,6 +78,19 @@ if ( num_axes > _JS_MAX_AXES ) num_axes = _JS_MAX_AXES ; + // Remove any deadband value already done in the kernel. + // Since we have our own deadband management this is save to do so. + struct js_corr corr [ _JS_MAX_AXES ] ; + ioctl ( os->fd, JSIOCGCORR, corr ); + for ( int i = 0; i < num_axes ; ++i ) { + if ( corr[ i ] . type == JS_CORR_BROKEN ) { + int nodeadband = ( corr[ i ] . coef[ 0 ] + corr[ i ] . coef[ 1 ] ) / 2 ; + corr[ i ] . coef[ 0 ] = nodeadband ; + corr[ i ] . coef[ 1 ] = nodeadband ; + } + } + ioctl ( os->fd, JSIOCSCORR, corr ); + for ( int i = 0 ; i < _JS_MAX_AXES ; i++ ) { max [ i ] = 32767.0f ; @@ -180,3 +196,4 @@ } #endif +#endif Index: jsLinuxOld.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/js/jsLinuxOld.cxx,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- jsLinuxOld.cxx 21 Sep 2004 11:45:55 -0000 1.3 +++ jsLinuxOld.cxx 20 Oct 2004 23:49:33 -0000 1.4 @@ -23,11 +23,14 @@ #include "js.h" -#if defined (UL_LINUX) && !defined (JS_NEW) +#if defined (UL_LINUX) + +#include <linux/joystick.h> + +#if !defined(JS_VERSION) || JS_VERSION >= 0x010000 #include <fcntl.h> #include <sys/ioctl.h> -#include <linux/joystick.h> struct os_specific_s { JS_DATA_TYPE js ; @@ -140,3 +143,4 @@ void jsInit() {} #endif +#endif |
From: Nick M. <nm...@us...> - 2004-10-13 02:17:03
|
Update of /cvsroot/plib/plib/examples/src/ssg/sky In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4643/examples/src/ssg/sky Modified Files: sky.cxx Log Message: John Fay - fixed compiler warnings Index: sky.cxx =================================================================== RCS file: /cvsroot/plib/plib/examples/src/ssg/sky/sky.cxx,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- sky.cxx 26 Sep 2003 14:56:01 -0000 1.3 +++ sky.cxx 13 Oct 2004 02:16:53 -0000 1.4 @@ -91,16 +91,16 @@ static int curr_body = 0 ; static int curr_cloud = 0 ; -static sgVec4 black = { 0.0, 0.0, 0.0, 1.0 } ; -static sgVec4 white = { 1.0, 1.0, 1.0, 1.0 } ; -static sgVec4 translucent_white = { 1.0, 1.0, 1.0, 0.8 } ; +static sgVec4 black = { 0.0f, 0.0f, 0.0f, 1.0f } ; +static sgVec4 white = { 1.0f, 1.0f, 1.0f, 1.0f } ; +static sgVec4 translucent_white = { 1.0f, 1.0f, 1.0f, 0.8f } ; -static sgVec4 base_sky_color = { 0.39, 0.5, 0.74, 1.0 } ; [...124 lines suppressed...] glFogf ( GL_FOG_DENSITY, fog_exp2_density); glFogi ( GL_FOG_MODE, GL_EXP2 ); @@ -612,7 +612,7 @@ bodyRADial->setWrap ( 1 ) ; bodyRADial->setMaxValue ( 360 ) ; bodyRADial->setMinValue ( 0 ) ; - bodyRADial->setStepSize ( 0.1 ) ; + bodyRADial->setStepSize ( 0.1f ) ; bodyRADial->setCBMode ( PUSLIDER_ALWAYS ) ; bodyRADial->setCallback ( bodyRADial_cb ) ; bodyRADial->setLabel ( "Right Ascension" ) ; @@ -624,7 +624,7 @@ bodyDeclDial->setWrap ( 1 ) ; bodyDeclDial->setMaxValue ( 360 ) ; bodyDeclDial->setMinValue ( 0 ) ; - bodyDeclDial->setStepSize ( 0.1 ) ; + bodyDeclDial->setStepSize ( 0.1f ) ; bodyDeclDial->setCBMode ( PUSLIDER_ALWAYS ) ; bodyDeclDial->setCallback ( bodyDeclDial_cb ) ; bodyDeclDial->setLabel ( "Declination" ) ; |
From: Wolfram K. <wol...@us...> - 2004-10-06 15:29:44
|
Update of /cvsroot/plib/plib/src/ssg In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3707 Modified Files: ssg.cxx Log Message: Compile fix by Melchior Franz. Index: ssg.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssg.cxx,v retrieving revision 1.68 retrieving revision 1.69 diff -u -d -r1.68 -r1.69 --- ssg.cxx 4 Oct 2004 18:23:31 -0000 1.68 +++ ssg.cxx 6 Oct 2004 14:27:04 -0000 1.69 @@ -132,7 +132,6 @@ ssgAddModelFormat ( ".3ds", ssgLoad3ds , ssgSave3ds ) ; ssgAddModelFormat ( ".ac" , ssgLoadAC3D , ssgSaveAC ) ; ssgAddModelFormat ( ".ase", ssgLoadASE , ssgSaveASE ) ; - ssgAddModelFormat ( ".vb", NULL , ssgSaveVBIB) ; ssgAddModelFormat ( ".dof", ssgLoadDOF , NULL ) ; ssgAddModelFormat ( ".dxf", ssgLoadDXF , ssgSaveDXF ) ; ssgAddModelFormat ( ".obj", ssgLoadOBJ , ssgSaveOBJ ) ; |
From: Wolfram K. <wol...@us...> - 2004-10-06 14:33:27
|
Update of /cvsroot/plib/plib/src/ssg In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4689 Modified Files: ssgLoadASC.cxx Log Message: Replaced str(n)icmp by ulStr(N)Equal to make things portable. Index: ssgLoadASC.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgLoadASC.cxx,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- ssgLoadASC.cxx 4 Oct 2004 08:03:37 -0000 1.1 +++ ssgLoadASC.cxx 6 Oct 2004 14:31:55 -0000 1.2 @@ -55,13 +55,13 @@ while((*p == ' ') || (*p == 9)) p++; // p points to the first word (or the line end) now. - if(0 == strnicmp(p, "Page", strlen("Page"))) + if(0 == ulStrNEqual(p, "Page", strlen("Page"))) { // Since this loader ignores the line structure, // we can also ignore the \n or \r and just "delete" the whole line line[0] = 0; } - if(0 == strnicmp(p, "Camera", strlen("Camera"))) + if(0 == ulStrNEqual(p, "Camera", strlen("Camera"))) line[0] = 0; } @@ -551,7 +551,7 @@ s[strlen(s)-1]=0; // **** search for it **** for(int i=0; i<noOfAscmaterials; i++) - if(0==stricmp(s, AscMaterials[i].sName)) + if(0==ulStrEqual(s, AscMaterials[i].sName)) return i; // **** not found - create it **** AscMaterials[noOfAscmaterials].sName = new char[strlen(s)+1]; @@ -605,7 +605,7 @@ // "Vertex 0: X:115.710701 Y:180.000305 Z:-60.796242 U:0.048042 V:0.996284" { char *sNextToken = parser.peekAtNextToken( "vertex list?" ); - if(0 == stricmp("list", sNextToken)) + if(0 == ulStrEqual("list", sNextToken)) { parser.expectNextToken("list"); parser.expectNextToken(":"); @@ -654,7 +654,7 @@ // "Face 0: A:0 B:10 C:7 AB:1 BC:1 CA:1" { char *sNextToken = parser.peekAtNextToken( "Face list?" ); - if(0 == stricmp("list", sNextToken)) + if(0 == ulStrEqual("list", sNextToken)) { parser.expectNextToken("list"); parser.expectNextToken(":"); |
From: Wolfram K. <wol...@us...> - 2004-10-06 14:26:50
|
Update of /cvsroot/plib/plib/src/ssg In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3325 Modified Files: ssgLoaderWriterStuff.cxx Log Message: I had committed some internal changes (WKSHORT instead of short). Index: ssgLoaderWriterStuff.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgLoaderWriterStuff.cxx,v retrieving revision 1.30 retrieving revision 1.31 diff -u -d -r1.30 -r1.31 --- ssgLoaderWriterStuff.cxx 4 Oct 2004 18:20:25 -0000 1.30 +++ ssgLoaderWriterStuff.cxx 6 Oct 2004 14:25:11 -0000 1.31 @@ -170,7 +170,7 @@ } } for (i = 0; i < l_node->getNumTriangles(); i++) { - WKSHORT v1, v2, v3; + short v1, v2, v3; l_node->getTriangle(i, &v1, &v2, &v3); indices->add( vert_low + v1 ); indices->add( vert_low + v2 ); @@ -528,7 +528,7 @@ sgVec3 v1, v2, n; for (int i = 0; i < indexList->getNum() / 3; i++) { - WKSHORT indices[3] = { *indexList->get( i*3 ), *indexList->get( i*3 + 1), *indexList->get( i*3 + 2) }; + short indices[3] = { *indexList->get( i*3 ), *indexList->get( i*3 + 1), *indexList->get( i*3 + 2) }; sgSubVec3(v1, vertexList->get(indices[1]), vertexList->get(indices[0])); sgSubVec3(v2, vertexList->get(indices[2]), vertexList->get(indices[0])); @@ -574,7 +574,7 @@ { for( j=0; j<oneFace->getNum(); j++ ) { - WKSHORT *ps = (WKSHORT *)oneFace->get(j); + short *ps = oneFace->get(j); float *newTextureCoordinate2 = textureCoordsForOneFace->get( j ); float *oldTextureCoordinate2 = perVertexTextureCoordinates2->get( *ps ); @@ -705,7 +705,7 @@ { ulSetError(UL_DEBUG, "%d Material Indexes:", materialIndices->getNum()); for(i=0;i<materialIndices->getNum();i++) - { WKSHORT s=*(materialIndices->get(i)); + { short s=*(materialIndices->get(i)); ulSetError(UL_DEBUG, "%ld", (long)s); } } @@ -738,7 +738,7 @@ newPerVertexTextureCoordinates2 = new ssgTexCoordArray(); for (j=0; j<theVertices->getNum(); j++) - oldVertexIndexToNewVertexIndex->add ( WKSHORT(0xFFFF) ); // 0xFFFF stands for "unused in new Mesh" + oldVertexIndexToNewVertexIndex->add ( short(0xFFFF) ); // 0xFFFF stands for "unused in new Mesh" // Go through all the old Faces, look for the correct material and copy those // faces and indexes into the new |
From: Wolfram K. <wol...@us...> - 2004-10-05 14:39:43
|
Update of /cvsroot/plib/plib/src/ssg In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14653 Modified Files: ssgSaveASC.cxx Log Message: In the last commit, there were also two local changes (one of them WIP). Index: ssgSaveASC.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgSaveASC.cxx,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- ssgSaveASC.cxx 5 Oct 2004 14:34:47 -0000 1.5 +++ ssgSaveASC.cxx 5 Oct 2004 14:38:25 -0000 1.6 @@ -135,7 +135,7 @@ fprintf ( save_fd, "Face list:\n"); for ( j = 0; j < num_face; j++ ) { - WKSHORT i1,i2,i3; + short i1,i2,i3; vt -> getTriangle ( j, &i1, &i2, &i3 ) ; fprintf ( save_fd, "Face %d: A:%d B:%d C:%d AB:1 BC:1 CA:1\n", j, i1, i2, i3 ); @@ -166,17 +166,7 @@ if ( e -> isAKindOf ( ssgTypeBranch() ) ) { ssgBranch *br = (ssgBranch *) e ; - int i, j; - for ( i = 0 ; i < br -> getNumKids () ; i++ ) - if(br -> getKid ( i )-> isAKindOf ( ssgTypeVtxTable() )) - for ( j = i+1 ; j < br -> getNumKids () ; j++ ) - if(br -> getKid ( j )-> isAKindOf ( ssgTypeVtxTable() )) - if(0 == stricmp(br -> getKid ( i )-> getPrintableName(), - br -> getKid ( j )-> getPrintableName()) - { - } - - for ( i = 0 ; i < br -> getNumKids () ; i++ ) + for (int i = 0 ; i < br -> getNumKids () ; i++ ) save_geom ( br -> getKid ( i ) ) ; } else |
From: Wolfram K. <wol...@us...> - 2004-10-05 14:36:07
|
Update of /cvsroot/plib/plib/src/ssg In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13670 Modified Files: ssgSaveASC.cxx Log Message: save_scale implemented. fixed texture file name handling. Removed possible different behaviour for selectors and other branches regarding saving. Index: ssgSaveASC.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgSaveASC.cxx,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- ssgSaveASC.cxx 13 Sep 2004 12:11:56 -0000 1.4 +++ ssgSaveASC.cxx 5 Oct 2004 14:34:47 -0000 1.5 @@ -31,7 +31,8 @@ static FILE *save_fd ; static ssgSimpleStateArray gSSL; - +float save_scale = 1.0f; +int calledByTheHuman = TRUE; static void save_vtx_table ( ssgVtxTable *vt ) { @@ -55,86 +56,90 @@ int num_face = vt -> getNumTriangles () ; [...209 lines suppressed...] return FALSE ; } - + if(calledByTheHuman) + if(save_scale!=1.0f) + { +#ifdef WIN32 + char temp[999]; + sprintf(temp, "Applying a scale factor of %f", save_scale); + ::MessageBox(0, temp, "For your info:", 0); +#else + printf("Applying a scale factor of %f", save_scale); +#endif + } int result = ssgSaveASC ( save_fd, ent ) ; fclose ( save_fd ) ; - return result ; } |
From: Wolfram K. <wol...@us...> - 2004-10-04 18:48:15
|
Update of /cvsroot/plib/plib/src/ssg In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv350 Modified Files: ssg.dsp Log Message: ASC loader added Index: ssg.dsp =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssg.dsp,v retrieving revision 1.51 retrieving revision 1.52 diff -u -d -r1.51 -r1.52 --- ssg.dsp 26 Sep 2004 09:38:52 -0000 1.51 +++ ssg.dsp 4 Oct 2004 18:47:24 -0000 1.52 @@ -23,6 +23,8 @@ # Begin Project # PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" CPP=cl.exe RSC=rc.exe @@ -182,6 +184,10 @@ # End Source File # Begin Source File +SOURCE=.\ssgLoadASC.cxx +# End Source File +# Begin Source File + SOURCE=.\ssgLoadASE.cxx # End Source File # Begin Source File @@ -218,10 +224,6 @@ # End Source File # Begin Source File -SOURCE=.\ssgSaveIV.cxx -# End Source File -# Begin Source File - SOURCE=.\ssgLoadM.cxx # End Source File # Begin Source File @@ -354,6 +356,10 @@ # End Source File # Begin Source File +SOURCE=.\ssgSaveIV.cxx +# End Source File +# Begin Source File + SOURCE=.\ssgSaveM.cxx # End Source File # Begin Source File |
From: Wolfram K. <wol...@us...> - 2004-10-04 18:34:59
|
Update of /cvsroot/plib/plib/src/ssg In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29922 Modified Files: ssgLoadMDL.cxx Log Message: Further changes to LoDs. Still experimenting with culling :-( Index: ssgLoadMDL.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgLoadMDL.cxx,v retrieving revision 1.53 retrieving revision 1.54 diff -u -d -r1.53 -r1.54 --- ssgLoadMDL.cxx 25 Feb 2004 15:39:33 -0000 1.53 +++ ssgLoadMDL.cxx 4 Oct 2004 18:33:28 -0000 1.54 @@ -39,6 +39,9 @@ #include "ssgLocal.h" +// kludge: global +int g_noLoDs =1; + #ifdef SSG_LOAD_MDL_SUPPORTED #include "ssgLoadMDL.h" @@ -57,50 +60,53 @@ static ssgLoaderOptions *current_options; [...1482 lines suppressed...] fclose(fp); #ifdef DEBUG - fclose(wkfp); + fclose(wkfp); #endif // :-((( delete curr_vtx_; delete curr_norm_; - DEBUGPRINT("\n" << vertex_array_->getNum() << " vertices\n"); - printf("NoLoDs = %d\n", (int)noLoDs); - g_noLoDs = noLoDs; + DEBUGPRINT("\n" << vertex_array_->getNum() << " vertices\n"); + printf("NoLoDs = %d\n", (int)noLoDs); + printf("noGT=%d, noLT=%d, no0=%d\n", noGT, noLT, no0); + g_noLoDs = noLoDs; return model_; } |
From: Wolfram K. <wol...@us...> - 2004-10-04 18:27:20
|
Update of /cvsroot/plib/plib/src/ssg In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28015 Modified Files: ssg.h Log Message: Adding ASC loader. Index: ssg.h =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssg.h,v retrieving revision 1.172 retrieving revision 1.173 diff -u -d -r1.172 -r1.173 --- ssg.h 26 Sep 2004 09:38:52 -0000 1.172 +++ ssg.h 4 Oct 2004 18:25:59 -0000 1.173 @@ -2722,6 +2722,7 @@ ssgEntity *ssgLoad ( const char *fname, const ssgLoaderOptions *options = NULL ) ; ssgEntity *ssgLoad3ds ( const char *fname, const ssgLoaderOptions *options = NULL ) ; ssgEntity *ssgLoadAC3D ( const char *fname, const ssgLoaderOptions *options = NULL ) ; +ssgEntity *ssgLoadASC ( const char *fname, const ssgLoaderOptions *options = NULL ) ; ssgEntity *ssgLoadSSG ( const char *fname, const ssgLoaderOptions *options = NULL ) ; ssgEntity *ssgLoadASE ( const char *fname, const ssgLoaderOptions *options = NULL ) ; ssgEntity *ssgLoadDOF ( const char *fname, const ssgLoaderOptions *options = NULL ) ; |
From: Wolfram K. <wol...@us...> - 2004-10-04 18:24:53
|
Update of /cvsroot/plib/plib/src/ssg In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27617 Modified Files: ssg.cxx Log Message: Adding ASC loader. Index: ssg.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssg.cxx,v retrieving revision 1.67 retrieving revision 1.68 diff -u -d -r1.67 -r1.68 --- ssg.cxx 26 Sep 2004 09:38:52 -0000 1.67 +++ ssg.cxx 4 Oct 2004 18:23:31 -0000 1.68 @@ -132,6 +132,7 @@ ssgAddModelFormat ( ".3ds", ssgLoad3ds , ssgSave3ds ) ; ssgAddModelFormat ( ".ac" , ssgLoadAC3D , ssgSaveAC ) ; ssgAddModelFormat ( ".ase", ssgLoadASE , ssgSaveASE ) ; + ssgAddModelFormat ( ".vb", NULL , ssgSaveVBIB) ; ssgAddModelFormat ( ".dof", ssgLoadDOF , NULL ) ; ssgAddModelFormat ( ".dxf", ssgLoadDXF , ssgSaveDXF ) ; ssgAddModelFormat ( ".obj", ssgLoadOBJ , ssgSaveOBJ ) ; @@ -146,7 +147,7 @@ ssgAddModelFormat ( ".qhi" , NULL , ssgSaveQHI ) ; ssgAddModelFormat ( ".wrl", ssgLoadVRML1, ssgSaveVRML1 ) ; ssgAddModelFormat ( ".iv", ssgLoadIV , ssgSaveIV ) ; - ssgAddModelFormat ( ".asc", NULL , ssgSaveASC ) ; + ssgAddModelFormat ( ".asc", ssgLoadASC , ssgSaveASC ) ; //ssgAddModelFormat ( ".pov", NULL , ssgSavePOV ) ; |
From: Wolfram K. <wol...@us...> - 2004-10-04 18:21:56
|
Update of /cvsroot/plib/plib/src/ssg In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26960 Modified Files: ssgLoaderWriterStuff.cxx Log Message: Add vertex texture coords only when adding a vertex Index: ssgLoaderWriterStuff.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgLoaderWriterStuff.cxx,v retrieving revision 1.29 retrieving revision 1.30 diff -u -d -r1.29 -r1.30 --- ssgLoaderWriterStuff.cxx 15 Sep 2002 01:29:12 -0000 1.29 +++ ssgLoaderWriterStuff.cxx 4 Oct 2004 18:20:25 -0000 1.30 @@ -170,7 +170,7 @@ } } for (i = 0; i < l_node->getNumTriangles(); i++) { - short v1, v2, v3; + WKSHORT v1, v2, v3; l_node->getTriangle(i, &v1, &v2, &v3); indices->add( vert_low + v1 ); indices->add( vert_low + v2 ); @@ -528,7 +528,7 @@ sgVec3 v1, v2, n; [...67 lines suppressed...] newVertexIndex = newVertices->getNum(); newVertices->add( theVertices->get( oldVertexIndex ) ); oldVertexIndexToNewVertexIndex->set( newVertexIndex, oldVertexIndex ); - } + if ( perVertexTextureCoordinates2 != NULL ) newPerVertexTextureCoordinates2 -> add( perVertexTextureCoordinates2->get( oldVertexIndex ) ); + } // From here on the indexes in thisFace are only valid in relation to // newVertices and newtextureCoordinatePerVertex. Since this face will not be used for any // further material, this doesn't lead to problems. @@ -810,7 +810,7 @@ current_options, curr_branch_); } } - } + } } int ssgLoaderWriterMesh::checkMe() |
From: Wolfram K. <wol...@us...> - 2004-10-04 08:18:40
|
Update of /cvsroot/plib/plib/src/ssg In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29287 Modified Files: ssgOptimiser.cxx Log Message: Checking for "-1" Index: ssgOptimiser.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgOptimiser.cxx,v retrieving revision 1.34 retrieving revision 1.35 diff -u -d -r1.34 -r1.35 --- ssgOptimiser.cxx 20 Jan 2004 22:21:02 -0000 1.34 +++ ssgOptimiser.cxx 4 Oct 2004 08:18:26 -0000 1.35 @@ -28,7 +28,7 @@ static float optimise_vtol [3] = { - 0.001f, /* DISTANCE_SLOP = One millimeter */ + 0.001f, /* DISTANCE_SLOP = One millimeter */ 0.04f, /* COLOUR_SLOP = Four percent */ 0.004f, /* TEXCOORD_SLOP = One texel on a 256 map */ } ; @@ -374,7 +374,7 @@ { short i = find ( v, t, c, FALSE ) ; - if ( i >= 0 ) + if (( i >= 0 ) && (i <0xFFFF)) { vlist [ i ] -> bump () ; return i ; @@ -898,7 +898,7 @@ } } -static void flatten ( ssgBranch *parent, ssgEntity *ent, sgMat4 mat ) +void flatten ( ssgBranch *parent, ssgEntity *ent, sgMat4 mat ) { /* Move all transforms down to the leaf nodes and |
From: Wolfram K. <wol...@us...> - 2004-10-04 08:11:47
|
Update of /cvsroot/plib/plib/src/ssg In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27545 Modified Files: ssgLoadASE.cxx ssgLoadATG.cxx ssgLoadIV.cxx ssgLoadOFF.cxx ssgLoadVRML1.cxx ssgParser.h Log Message: Added "pre_processor" to ParserSpec. Index: ssgLoadASE.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgLoadASE.cxx,v retrieving revision 1.46 retrieving revision 1.47 diff -u -d -r1.46 -r1.47 --- ssgLoadASE.cxx 30 Nov 2002 00:41:50 -0000 1.46 +++ ssgLoadASE.cxx 4 Oct 2004 08:11:26 -0000 1.47 @@ -175,6 +175,7 @@ { "\r\n\t ", // delim_chars_skipable 0, // delim_chars_non_skipable + NULL, // pre_processor "{", // open_brace_chars "}", // close_brace_chars '"', // quote_char Index: ssgLoadATG.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgLoadATG.cxx,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- ssgLoadATG.cxx 15 Sep 2002 01:29:11 -0000 1.18 +++ ssgLoadATG.cxx 4 Oct 2004 08:11:26 -0000 1.19 @@ -86,6 +86,7 @@ { "\r\n\t ", // delim_chars_skipable NULL, // delim_chars_non_skipable + NULL, // pre_processor NULL, // open_brace_chars NULL, // close_brace_chars '"', // quote_char. not used for scenery Index: ssgLoadIV.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgLoadIV.cxx,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- ssgLoadIV.cxx 15 Sep 2002 01:29:12 -0000 1.11 +++ ssgLoadIV.cxx 4 Oct 2004 08:11:26 -0000 1.12 @@ -29,6 +29,7 @@ { "\r\n\t, ", // delim_chars_skipable 0, // delim_chars_non_skipable + NULL, // pre_processor "{[", // open_brace_chars "}]", // close_brace_chars '"', // quote_char Index: ssgLoadOFF.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgLoadOFF.cxx,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- ssgLoadOFF.cxx 2 Sep 2002 06:05:48 -0000 1.11 +++ ssgLoadOFF.cxx 4 Oct 2004 08:11:26 -0000 1.12 @@ -62,6 +62,7 @@ { "\r\n\t ", // delim_chars_skipable ",;", // delim_chars_non_skipable + NULL, // pre_processor "", // open_brace_chars "", // close_brace_chars '"', // quote_char. not used for OFF Index: ssgLoadVRML1.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgLoadVRML1.cxx,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- ssgLoadVRML1.cxx 15 Sep 2002 01:29:12 -0000 1.11 +++ ssgLoadVRML1.cxx 4 Oct 2004 08:11:26 -0000 1.12 @@ -43,6 +43,7 @@ { "\r\n\t, ", // delim_chars_skipable 0, // delim_chars_non_skipable + NULL, // pre_processor "{[", // open_brace_chars "}]", // close_brace_chars '"', // quote_char Index: ssgParser.h =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgParser.h,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- ssgParser.h 2 Sep 2002 06:05:48 -0000 1.15 +++ ssgParser.h 4 Oct 2004 08:11:26 -0000 1.16 @@ -29,12 +29,16 @@ // Be sure to read the ssg-documentation, especially the chapter // on loaders/writers + +typedef void PreProcessorFunctionType(char *line); + // The _ssgParserSpec contains the rules how to extract the tokens: struct _ssgParserSpec { // delimiters; Thats is, chars that delimit tokens: const char* delim_chars_skipable ; // these are "swallowed" by the parser const char* delim_chars_non_skipable ; // These are handed to the app. + PreProcessorFunctionType *pre_processor; // After reading a line, it is first given to the preprocessor to tweak it in place. const char* open_brace_chars ; const char* close_brace_chars ; char quote_char ; |
From: Wolfram K. <wol...@us...> - 2004-10-04 08:10:18
|
Update of /cvsroot/plib/plib/src/ssg In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27221 Modified Files: ssgLoadX.cxx ssgParser.cxx Log Message: Added "pre_processor" to ParserSpec. Fixed typos. Index: ssgLoadX.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgLoadX.cxx,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- ssgLoadX.cxx 26 Jul 2003 09:33:18 -0000 1.21 +++ ssgLoadX.cxx 4 Oct 2004 08:10:00 -0000 1.22 @@ -23,7 +23,7 @@ // // .X loader for SSG/PLIB -// .X is the 3D file format for Micro$ofts directX retained mode. +// .X is the 3D file format for Micro$ofts directX. // Written by Wolfram Kuss (Wol...@t-...) in Oct/Nov of 2000 // #include "ssgLocal.h" @@ -55,6 +55,7 @@ { "\r\n\t ", // delim_chars_skipable ",;", // delim_chars_non_skipable + NULL, // pre_processor "{", // open_brace_chars "}", // close_brace_chars '"', // quote_char @@ -133,7 +134,7 @@ while ( TRUE) { token = parser.getNextToken(0); if ( parser.eof ) - { parser.error("unexpected end fo file\n"); + { parser.error("unexpected end of file\n"); return ; //FALSE; } @@ -200,9 +201,10 @@ { char *sNextToken, *sName=globEmpty; sNextToken=parser.getNextToken(0); if ( parser.eof ) - { parser.error("unexpected end fo file\n"); + { parser.error("unexpected end of file\n"); return FALSE; } + // if entity is named, read the name. skip "{": sName = NULL; if (0 != strcmp(sNextToken, "{")) { sName = new char[ strlen(sNextToken) + 1 ]; @@ -217,7 +219,7 @@ if(sNextToken[0] == '<') // UUID sNextToken = parser.getNextToken(0); if ( parser.eof ) - { parser.error("unexpected end fo file\n"); + { parser.error("unexpected end of file\n"); return FALSE; } @@ -231,7 +233,7 @@ IgnoreEntity ( 0 ); else { - parser.error("I am sorry, but Entity-typ '%s' is not yet implemented.", aEntities[i].sName); + parser.error("I am sorry, but Entity-type '%s' is not yet implemented.", aEntities[i].sName); return FALSE ; } @@ -562,7 +564,7 @@ while(TRUE) { char *nextToken =parser.getNextToken(0); if ( parser.eof ) - { parser.error("unexpected end fo file\n"); + { parser.error("unexpected end of file\n"); return FALSE; } Index: ssgParser.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgParser.cxx,v retrieving revision 1.27 retrieving revision 1.28 diff -u -d -r1.27 -r1.28 --- ssgParser.cxx 4 May 2004 12:37:33 -0000 1.27 +++ ssgParser.cxx 4 Oct 2004 08:10:00 -0000 1.28 @@ -42,6 +42,7 @@ { "\r\n\t ", // delim_chars_skipable 0, // delim_chars_non_skipable + NULL, // pre_processor 0, // open_brace_chars 0, // close_brace_chars '"', // quote_char @@ -145,7 +146,7 @@ static char *EOL_string = "EOL reached"; char* _ssgParser::getNextToken( const char* name ) -// Fetches next token, even if it has to read over some empty or commant-only lines to get to it. +// Fetches next token, even if it has to read over some empty or comment-only lines to get to it. // Never returns NULL. Returns EOF_string on EOF. { while(!( curtok < numtok )) @@ -166,7 +167,7 @@ } char *_ssgParser::peekAtNextToken( const char* name ) -// Like getNextToken, but doesnÄt remove the token from the input stream +// Like getNextToken, but doesn't remove the token from the input stream { while(!( curtok < numtok )) { //int startLevel = level; @@ -327,6 +328,8 @@ eof = TRUE; return(0) ; } + if(spec.pre_processor != NULL) + spec.pre_processor (linebuf); memcpy( tokbuf, linebuf, sizeof(linebuf) ) ; ptr = tokbuf ; |
From: Wolfram K. <wol...@us...> - 2004-10-04 08:03:53
|
Update of /cvsroot/plib/plib/src/ssg In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25947 Modified Files: Makefile.am Added Files: ssgLoadASC.cxx Log Message: adding ssgLoadASC, very first version --- NEW FILE: ssgLoadASC.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 [...971 lines suppressed...] untexturedState.ref(); currentState = &untexturedState; top_branch = new ssgBranch ; curr_branch_ = top_branch; if ( !parser.openFile( fname, &parser_spec )) { delete top_branch ; return 0; } if ( !parse() ) { delete top_branch ; top_branch = 0 ; } // parse_free(); parser.closeFile(); return top_branch ; } Index: Makefile.am =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/Makefile.am,v retrieving revision 1.46 retrieving revision 1.47 diff -u -d -r1.46 -r1.47 --- Makefile.am 26 Sep 2004 09:38:52 -0000 1.46 +++ Makefile.am 4 Oct 2004 08:03:36 -0000 1.47 @@ -25,7 +25,7 @@ ssgSaveVRML1.cxx ssgLoaderWriterStuff.h ssgMSFSPalette.h ssg3ds.h \ 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 \ + ssgLoadMDL_BGLTexture.cxx ssgLoadXPlaneObj.cxx ssgLoadASC.cxx ssgSaveASC.cxx \ ssgSaveIV.cxx \ ssgVertSplitter.h ssgVertSplitter.cxx ssgStatistics.cxx |
From: Wolfram K. <wol...@us...> - 2004-10-02 12:21:03
|
Update of /cvsroot/plib/plib/src/util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18191 Modified Files: ulError.cxx Log Message: Improved handling of fatal erros for Windows users. Index: ulError.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/util/ulError.cxx,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- ulError.cxx 2 Sep 2002 06:05:49 -0000 1.7 +++ ulError.cxx 2 Oct 2004 12:20:43 -0000 1.8 @@ -51,7 +51,14 @@ fprintf ( stderr, "%s: %s\n", _ulSeverityText[ severity ], _ulErrorBuffer ) ; if ( severity == UL_FATAL ) + { +#ifdef WIN32 + // A Windows user that does not start the program from the command line + // will not see output to stderr + ::MessageBox(0, _ulErrorBuffer, "fatal error!:", 0); +#endif exit (1) ; + } } } |
From: Wolfram K. <wol...@us...> - 2004-10-02 12:12:43
|
Update of /cvsroot/plib/plib/src/ssg In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16827 Modified Files: ssgLoadAC.cxx Log Message: Lines with "crease" are now ignored, so *.ac files with "crease" can be loaded. Index: ssgLoadAC.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgLoadAC.cxx,v retrieving revision 1.33 retrieving revision 1.34 diff -u -d -r1.33 -r1.34 --- ssgLoadAC.cxx 26 Sep 2004 09:37:00 -0000 1.33 +++ ssgLoadAC.cxx 2 Oct 2004 12:12:28 -0000 1.34 @@ -59,6 +59,7 @@ static int do_texture ( char *s ) ; static int do_texrep ( char *s ) ; static int do_texoff ( char *s ) ; +static int do_crease ( char *s ) ; static int do_rot ( char *s ) ; static int do_loc ( char *s ) ; static int do_url ( char *s ) ; @@ -149,6 +150,7 @@ { "texture" , do_texture }, { "texrep" , do_texrep }, { "texoff" , do_texoff }, + { "crease" , do_crease }, { "rot" , do_rot }, { "loc" , do_loc }, { "url" , do_url }, @@ -412,6 +414,17 @@ return PARSE_CONT ; } +static int do_crease ( char *s ) +{ + // the crease angle is not yet used. However, reading the crease line correctly means + // *.ac lines with "crease" can now be read. + float creaseAngle; + if ( sscanf ( s, "%f", & creaseAngle ) != 1 ) + ulSetError ( UL_WARNING, "ac_to_gl: Illegal crease angle." ) ; + + return PARSE_CONT ; +} + static int do_rot ( char *s ) { current_matrix [ 0 ][ 3 ] = current_matrix [ 1 ][ 3 ] = current_matrix [ 2 ][ 3 ] = |