plib-cvs Mailing List for PLIB (Page 48)
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: J?rgen M. <j_m...@us...> - 2002-07-27 12:45:00
|
Update of /cvsroot/plib/plib/src/ssg In directory usw-pr-cvs1:/tmp/cvs-serv13724/src/ssg Modified Files: Makefile.am ssg.cxx ssg.h ssgconf.h Removed Files: ssgLoadBGL.cxx ssgLoadBGL.h Log Message: BGL loader removed Index: Makefile.am =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/Makefile.am,v retrieving revision 1.33 retrieving revision 1.34 diff -u -d -r1.33 -r1.34 --- Makefile.am 1 Jul 2002 00:19:07 -0000 1.33 +++ Makefile.am 27 Jul 2002 12:44:56 -0000 1.34 @@ -21,7 +21,7 @@ ssgLoadOFF.cxx ssgSaveOFF.cxx ssgSaveQHI.cxx ssgLoadVRML1.cxx ssgSaveVRML1.cxx\ ssgLoaderWriterStuff.h ssgMSFSPalette.h ssg3ds.h ssgLoadMDL.h \ ssgSave3ds.cxx ssgAxisTransform.cxx ssgLoadATG.cxx ssgSaveATG.cxx\ - ssgLoadIV.cxx ssgLoad.cxx ssgLoadVRML.h ssgLoadBGL.cxx ssgLoadMDL_BGLTexture.cxx + ssgLoadIV.cxx ssgLoad.cxx ssgLoadVRML.h ssgLoadMDL_BGLTexture.cxx INCLUDES = -I$(top_srcdir)/src/sg INCLUDES += -I$(top_srcdir)/src/util Index: ssg.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssg.cxx,v retrieving revision 1.55 retrieving revision 1.56 diff -u -d -r1.55 -r1.56 --- ssg.cxx 20 Jul 2002 11:58:20 -0000 1.55 +++ ssg.cxx 27 Jul 2002 12:44:56 -0000 1.56 @@ -148,11 +148,6 @@ ssgAddModelFormat ( ".mdl", ssgLoadMDL , NULL ) ; #endif -#ifdef SSG_LOAD_BGL_SUPPORTED - ssgAddModelFormat ( ".bgl", ssgLoadBGL , NULL ) ; - ssgAddModelFormat ( ".bgb", ssgLoadBGLBatch , NULL ) ; -#endif - #ifdef SSG_LOAD_TGA_SUPPORTED ssgAddTextureFormat ( ".tga" , ssgLoadTGA ) ; #endif @@ -173,7 +168,7 @@ ssgAddTextureFormat ( ".bw" , ssgLoadSGI ) ; #endif -#if defined(SSG_LOAD_MDL_SUPPORTED) || defined(SSG_LOAD_BGL_SUPPORTED) || defined(SSG_LOAD_MDL_BGL_TEXTURE_SUPPORTED) +#if defined(SSG_LOAD_MDL_SUPPORTED) || defined(SSG_LOAD_MDL_BGL_TEXTURE_SUPPORTED) ssgAddTextureFormat ( ".0af" , ssgLoadMDLTexture ) ; ssgAddTextureFormat ( ".1af" , ssgLoadMDLTexture ) ; ssgAddTextureFormat ( ".2af" , ssgLoadMDLTexture ) ; Index: ssg.h =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssg.h,v retrieving revision 1.140 retrieving revision 1.141 diff -u -d -r1.140 -r1.141 --- ssg.h 22 Jul 2002 14:33:17 -0000 1.140 +++ ssg.h 27 Jul 2002 12:44:56 -0000 1.141 @@ -2629,8 +2629,6 @@ ssgEntity *ssgLoadOBJ ( const char *fname, const ssgLoaderOptions *options = NULL ) ; ssgEntity *ssgLoadMD2 ( const char *fname, const ssgLoaderOptions *options = NULL ) ; ssgEntity *ssgLoadMDL ( const char *fname, const ssgLoaderOptions *options = NULL ) ; -ssgEntity *ssgLoadBGL ( const char *fname, const ssgLoaderOptions *options = NULL ) ; -ssgEntity *ssgLoadBGLBatch ( const char *fname, const ssgLoaderOptions *options = NULL ) ; ssgEntity *ssgLoadX ( const char *fname, const ssgLoaderOptions *options = NULL ) ; ssgEntity *ssgLoadFLT ( const char *fname, const ssgLoaderOptions *options = NULL ) ; ssgEntity *ssgLoadM ( const char *fname, const ssgLoaderOptions *options = NULL ) ; Index: ssgconf.h =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgconf.h,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- ssgconf.h 9 Jun 2002 11:29:54 -0000 1.8 +++ ssgconf.h 27 Jul 2002 12:44:56 -0000 1.9 @@ -49,6 +49,5 @@ #define SSG_LOAD_TGA_SUPPORTED #define SSG_LOAD_BMP_SUPPORTED #define SSG_LOAD_MDL_SUPPORTED -#define SSG_LOAD_BGL_SUPPORTED #define SSG_LOAD_MDL_BGL_TEXTURE_SUPPORTED #endif --- ssgLoadBGL.cxx DELETED --- --- ssgLoadBGL.h DELETED --- |
From: J?rgen M. <j_m...@us...> - 2002-07-27 11:48:54
|
Update of /cvsroot/plib/plib/src/ssg In directory usw-pr-cvs1:/tmp/cvs-serv5110/src/ssg Modified Files: ssgLoadBGL.cxx Log Message: REMOVED until legal issues are sorted out Index: ssgLoadBGL.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgLoadBGL.cxx,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- ssgLoadBGL.cxx 26 Jul 2002 16:53:26 -0000 1.13 +++ ssgLoadBGL.cxx 27 Jul 2002 11:48:51 -0000 1.14 @@ -77,6 +77,7 @@ // - support background textures with correct layering // - checked re-usage of loaded vertices more carfully (i.e. condsider // its normal before re-using them). +// - REMOVED until legal issues are resolved // //=========================================================================== // Copyright (c) 2000 Thomas E. Sevaldrud <ts...@ma...> @@ -91,2788 +92,24 @@ #ifdef SSG_LOAD_BGL_SUPPORTED [...2772 lines suppressed...] - } - } - break; - - } // end of bgl parse switch - - if (skip_offset > 0) - fseek( fp, skip_offset, SEEK_CUR ); - - } // end of bgl parse while loop - - } // end of bgl "object header opcode" while loop + return NULL ; } - -#else - ssgEntity *ssgLoadBGL(const char *fname, const ssgLoaderOptions *options) { |
From: J?rgen M. <j_m...@us...> - 2002-07-26 16:53:29
|
Update of /cvsroot/plib/plib/src/ssg In directory usw-pr-cvs1:/tmp/cvs-serv18390/src/ssg Modified Files: ssgLoadBGL.cxx ssgLoadBGL.h Log Message: GLenum patch of Simon support of season texture maps and some solid color enhancements Index: ssgLoadBGL.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgLoadBGL.cxx,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- ssgLoadBGL.cxx 22 Jul 2002 15:10:20 -0000 1.12 +++ ssgLoadBGL.cxx 26 Jul 2002 16:53:26 -0000 1.13 @@ -115,9 +115,6 @@ static ssgTransform *curr_branch_; static sgMat4 curr_matrix_; -static char *curr_tex_name_; -static int curr_tex_type_; -static int curr_tex_wrap_; // File Address Stack static const int MAX_STACK_DEPTH = 128; @@ -138,14 +135,21 @@ static bool perspective_; [...727 lines suppressed...] ((ssgVtxArray *)curr_part_)->removeUnusedVertices(); @@ -2577,7 +2613,8 @@ } ssgVtxTable *Vtx = new ssgVtxTable(GL_TRIANGLE_FAN, vertices, normals, texcoords, NULL); Vtx->setState(state); - building -> addKid (Vtx); +// building -> addKid (Vtx); + building->addKid( current_options -> createLeaf(Vtx, NULL) ); toffset += ntoffset; } } @@ -2747,7 +2784,7 @@ tex_coords_, NULL, strips ); - curr_part_->setState( createState(true, SColor) ); + curr_part_->setState( createState(true, &surface_) ); ssgBranch* grp = getCurrGroup(); ((ssgVtxArray *)curr_part_)->removeUnusedVertices(); grp->addKid( current_options -> createLeaf(curr_part_, NULL) ); Index: ssgLoadBGL.h =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgLoadBGL.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- ssgLoadBGL.h 20 Jul 2002 19:30:57 -0000 1.2 +++ ssgLoadBGL.h 26 Jul 2002 16:53:26 -0000 1.3 @@ -61,6 +61,12 @@ #define RUNAWAY_LAYER 24 #define ZERO_LAYER 24 +#define TF_LIGHT_MAP 0x80 +#define TF_HAZE_MAP 0x40 +#define TF_SPRING 0x08 +#define TF_FALL 0x10 +#define TF_WINTER 0x20 + #undef ABS #undef MIN #undef MAX @@ -78,12 +84,17 @@ // type definitions +typedef struct { + sgVec4 color; + bool has_emission; + bool has_alpha; +} COLOR; // class declarations class ssgLayeredVtxArray : public ssgVtxArray { public: - ssgLayeredVtxArray ( unsigned int, + ssgLayeredVtxArray ( GLenum, ssgVertexArray *, ssgNormalArray *, ssgTexCoordArray *, |
From: Wolfram K. <wol...@us...> - 2002-07-22 15:10:23
|
Update of /cvsroot/plib/plib/src/ssg In directory usw-pr-cvs1:/tmp/cvs-serv10026 Modified Files: ssgLoadBGL.cxx Log Message: Called "removeUnusedVertices" to optimize the output of the loader. Index: ssgLoadBGL.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgLoadBGL.cxx,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- ssgLoadBGL.cxx 20 Jul 2002 19:30:57 -0000 1.11 +++ ssgLoadBGL.cxx 22 Jul 2002 15:10:20 -0000 1.12 @@ -1255,6 +1255,7 @@ curr_part_->setState( createState(has_texture, color) ); } ssgBranch* grp = getCurrGroup(); + ((ssgVtxArray *)curr_part_)->removeUnusedVertices(); grp->addKid( current_options -> createLeaf(curr_part_, NULL) ); } @@ -1292,6 +1293,7 @@ curr_part_->setState( createState(true, color) ); ssgBranch* grp = getCurrGroup(); + ((ssgVtxArray *)curr_part_)->removeUnusedVertices(); grp->addKid( current_options -> createLeaf(curr_part_, NULL) ); } @@ -1894,7 +1896,8 @@ curr_index_ ); curr_part_->setState( createState(false, LColor) ); ssgBranch* grp = getCurrGroup(); - grp->addKid( current_options -> createLeaf(curr_part_, NULL) ); + ((ssgVtxArray *)curr_part_)->removeUnusedVertices(); + grp->addKid( current_options -> createLeaf(curr_part_, NULL) ); poly_from_line_numverts = 0; } break; @@ -2003,7 +2006,8 @@ curr_part_->setState( createState(true, GColor) ); ssgBranch* grp = getCurrGroup(); - grp->addKid( current_options -> createLeaf(curr_part_, NULL) ); + ((ssgVtxArray *)curr_part_)->removeUnusedVertices(); + grp->addKid( current_options -> createLeaf(curr_part_, NULL) ); } break; @@ -2032,7 +2036,8 @@ curr_tex_wrap_ = TRUE; curr_part_->setState( createState(false, SColor) ); ssgBranch* grp = getCurrGroup(); - grp->addKid( current_options -> createLeaf(curr_part_, NULL) ); + ((ssgVtxArray *)curr_part_)->removeUnusedVertices(); + grp->addKid( current_options -> createLeaf(curr_part_, NULL) ); } break; @@ -2228,7 +2233,8 @@ curr_part_->setState( createState(false, LColor) ); } ssgBranch* grp = getCurrGroup(); - grp->addKid( current_options -> createLeaf(curr_part_, NULL) ); + ((ssgVtxArray *)curr_part_)->removeUnusedVertices(); + grp->addKid( current_options -> createLeaf(curr_part_, NULL) ); poly_from_line = false; } @@ -2743,7 +2749,8 @@ strips ); curr_part_->setState( createState(true, SColor) ); ssgBranch* grp = getCurrGroup(); - grp->addKid( current_options -> createLeaf(curr_part_, NULL) ); + ((ssgVtxArray *)curr_part_)->removeUnusedVertices(); + grp->addKid( current_options -> createLeaf(curr_part_, NULL) ); } } } |
From: Wolfram K. <wol...@us...> - 2002-07-22 14:46:50
|
Update of /cvsroot/plib/plib/src/ssg In directory usw-pr-cvs1:/tmp/cvs-serv31978 Modified Files: ssgLoadX.cxx Log Message: The names of all handled entities are read now. Currently, only the names of meshes are used. They are passed on to the ssgLoaderWriterMesh, which sets the ssgLeaf-node-names to them. Index: ssgLoadX.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgLoadX.cxx,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- ssgLoadX.cxx 10 Jun 2002 16:34:32 -0000 1.18 +++ ssgLoadX.cxx 22 Jul 2002 14:46:46 -0000 1.19 @@ -203,17 +203,19 @@ { parser.error("unexpected end fo file\n"); return FALSE; } - - if (0!=strcmp(sNextToken, "{")) - { sName=sNextToken; - sNextToken=parser.getNextToken(0); - if (0!=strcmp(sNextToken, "{")) + sName = NULL; + if (0 != strcmp(sNextToken, "{")) + { sName = new char[ strlen(sNextToken) + 1 ]; + assert ( sName ); + strcpy(sName, sNextToken); + sNextToken = parser.getNextToken(0); + if (0 != strcmp(sNextToken, "{")) parser.error("\"{\" expected\n"); } - sNextToken=parser.getNextToken(0); + sNextToken = parser.getNextToken(0); - if(sNextToken[0]=='<') // UUID - sNextToken=parser.getNextToken(0); + if(sNextToken[0] == '<') // UUID + sNextToken = parser.getNextToken(0); if ( parser.eof ) { parser.error("unexpected end fo file\n"); return FALSE; @@ -221,6 +223,8 @@ if (!aEntities[i].HandleEntity(sName, sNextToken)) return FALSE; + if ( sName ) + delete [] sName; } else if (aEntities[i].bMayBeIgnored) @@ -252,7 +256,7 @@ static ssgSimpleState *currentState; extern sgVec4 currentDiffuse; -static int HandleTextureFileName(const char *sName, const char *firstToken) +static int HandleTextureFileName(const char * /*sName*/, const char *firstToken) {/* TextureFilename { "../image/box_top.gif"; @@ -277,7 +281,7 @@ return TRUE; } -static int HandleMaterial(const char *sName, const char *firstToken) +static int HandleMaterial(const char * /*sName*/, const char *firstToken) // return TRUE on success { SGfloat power; int bFoundTextureFileName = FALSE; @@ -481,11 +485,10 @@ } -static int HandleMesh(const char * /* sName */, const char *firstToken) +static int HandleMesh(const char * sName, const char *firstToken) { u32 i, j, nNoOfVertices, nNoOfVerticesForThisFace, nNoOfFaces; int iVertex, aiVertices[MAX_NO_VERTICES_PER_FACE]; - //char *sMeshName = parser.getNextToken("Mesh name"); //parser.expectNextToken("{"); if (! Ascii2UInt(nNoOfVertices, firstToken, "nNoOfVertices")) @@ -494,6 +497,7 @@ //parser.getNextInt("number of vertices"); currentMesh.reInit (); + currentMesh.setName( sName ); currentMesh.createVertices( nNoOfVertices ); parser.expectNextToken(";"); |
From: Wolfram K. <wol...@us...> - 2002-07-22 14:43:06
|
Update of /cvsroot/plib/plib/src/ssg In directory usw-pr-cvs1:/tmp/cvs-serv30407 Modified Files: ssgLoaderWriterStuff.cxx ssgLoaderWriterStuff.h Log Message: ssgLoaderWriterMesh now has a name that can be set via setName Index: ssgLoaderWriterStuff.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgLoaderWriterStuff.cxx,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- ssgLoaderWriterStuff.cxx 18 Dec 2001 16:35:59 -0000 1.24 +++ ssgLoaderWriterStuff.cxx 22 Jul 2002 14:43:03 -0000 1.25 @@ -411,6 +411,7 @@ perFaceAndVertexTextureCoordinate2Lists = NULL ; theMaterials = NULL ; perVertexTextureCoordinates2 = NULL ; + name = NULL ; textureCoordinatesArePerVertex = TRUE ; } @@ -667,7 +668,20 @@ ssgEntity *model = current_options -> createLeaf ( leaf, NULL) ; assert( model != NULL ); + model->setName(name); curr_branch_->addKid(model); +} + +void ssgLoaderWriterMesh::setName( const char *meshName ) +{ + delete [] name; + if ( !meshName ) + name = NULL; + else + { + name = new char [ strlen(meshName) + 1 ]; + strcpy(name, meshName); + } } Index: ssgLoaderWriterStuff.h =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgLoaderWriterStuff.h,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- ssgLoaderWriterStuff.h 7 Nov 2001 23:51:10 -0000 1.20 +++ ssgLoaderWriterStuff.h 22 Jul 2002 14:43:03 -0000 1.21 @@ -77,6 +77,7 @@ class ssgLoaderWriterMesh { // ***** general **** + char *name; // array of Vec3s: class ssgVertexArray *theVertices; // one index per face: @@ -115,7 +116,8 @@ void setVertices( class ssgVertexArray *vertexArray ); class ssgTexCoordArray *getPerVertexTextureCoordinates2(void) { return perVertexTextureCoordinates2; } void setPerVertexTextureCoordinates2( class ssgTexCoordArray *texCoordArray ); - + void setName( const char *meshName ); + void addToSSG( class ssgSimpleState *currentstate, class ssgLoaderOptions* currentOptions, |
From: Wolfram K. <wol...@us...> - 2002-07-22 14:35:10
|
Update of /cvsroot/plib/plib/src/ssg In directory usw-pr-cvs1:/tmp/cvs-serv27067 Modified Files: ssgLoadMDL.cxx Log Message: Using removeUnusedVertices to optimize MDLs while they are loaded. Index: ssgLoadMDL.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgLoadMDL.cxx,v retrieving revision 1.41 retrieving revision 1.42 diff -u -d -r1.41 -r1.42 --- ssgLoadMDL.cxx 20 Jun 2002 20:07:52 -0000 1.41 +++ ssgLoadMDL.cxx 22 Jul 2002 14:35:07 -0000 1.42 @@ -1170,6 +1170,7 @@ } ssgBranch* grp = getCurrGroup(); + ((ssgVtxArray *)curr_part_)->removeUnusedVertices(); grp->addKid( current_options -> createLeaf(curr_part_, NULL) ); } break; @@ -1234,6 +1235,7 @@ } ssgBranch* grp = getCurrGroup(); + ((ssgVtxArray *)curr_part_)->removeUnusedVertices(); grp->addKid( current_options -> createLeaf(curr_part_, NULL) ); } break; @@ -1284,6 +1286,7 @@ } ssgBranch* grp = getCurrGroup(); + ((ssgVtxArray *)curr_part_)->removeUnusedVertices(); grp->addKid( current_options -> createLeaf(curr_part_, NULL) ); } break; @@ -1338,6 +1341,7 @@ } ssgBranch* grp = getCurrGroup(); + ((ssgVtxArray *)curr_part_)->removeUnusedVertices(); grp->addKid( current_options -> createLeaf(curr_part_, NULL) ); } break; @@ -1491,3 +1495,4 @@ #endif + |
From: Wolfram K. <wol...@us...> - 2002-07-22 14:33:20
|
Update of /cvsroot/plib/plib/src/ssg In directory usw-pr-cvs1:/tmp/cvs-serv26354 Modified Files: ssg.h Log Message: Implemented ssgIndexArray::print Implemented removeUnusedVertices Index: ssg.h =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssg.h,v retrieving revision 1.139 retrieving revision 1.140 diff -u -d -r1.139 -r1.140 --- ssg.h 20 Jul 2002 11:58:20 -0000 1.139 +++ ssg.h 22 Jul 2002 14:33:17 -0000 1.140 @@ -541,6 +541,7 @@ { type = ssgTypeIndexArray () ; } + virtual void print ( FILE *fd = stderr, char *indent = "", int how_much = 2 ) ; short *get ( unsigned int n ) { return (short *) raw_get ( n ) ; } void add ( short thing ) { raw_add ( (char *) &thing ) ; } ; void set ( short thing, unsigned int n ) { raw_set ( (char *) &thing, n ) ; } ; @@ -1536,6 +1537,7 @@ return (getNumIndices()<=0) ? &_ssgIndex0 : indices->get(i);} + void removeUnusedVertices(); virtual ~ssgVtxArray (void) ; virtual const char *getTypeName(void) ; |
From: Wolfram K. <wol...@us...> - 2002-07-22 14:32:32
|
Update of /cvsroot/plib/plib/src/ssg In directory usw-pr-cvs1:/tmp/cvs-serv26143 Modified Files: ssgSimpleList.cxx Log Message: Implemented ssgIndexArray::print Index: ssgSimpleList.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgSimpleList.cxx,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- ssgSimpleList.cxx 23 Mar 2002 15:06:45 -0000 1.11 +++ ssgSimpleList.cxx 22 Jul 2002 14:32:29 -0000 1.12 @@ -103,6 +103,17 @@ +void ssgIndexArray::print ( FILE *fd, char *indent, int how_much ) +{ + ssgSimpleList::print ( fd, indent, how_much ) ; + + if ( how_much < 4 ) + return; + + for ( unsigned int i = 0 ; i < total ; i++ ) + fprintf ( fd, "%s I%d) { %d }\n", indent, i, + (int) (*get(i)) ) ; +} void ssgTexCoordArray::print ( FILE *fd, char *indent, int how_much ) { |
From: Wolfram K. <wol...@us...> - 2002-07-22 14:31:43
|
Update of /cvsroot/plib/plib/src/ssg In directory usw-pr-cvs1:/tmp/cvs-serv25867 Modified Files: ssgVtxArray.cxx Log Message: Implemented removeUnusedVertices Index: ssgVtxArray.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgVtxArray.cxx,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- ssgVtxArray.cxx 20 Mar 2002 17:26:31 -0000 1.22 +++ ssgVtxArray.cxx 22 Jul 2002 14:31:38 -0000 1.23 @@ -182,6 +182,78 @@ glPopClientAttrib ( ) ; } +void ssgVtxArray::removeUnusedVertices() +// this removes any vertices (including normal, TexCoords and colour) +// that are not referenced by the index array +{ + + bool doNormals = FALSE, doTexCoords = FALSE, doColours = FALSE; + + assert(vertices); + if(!indices) + { ulSetError( UL_WARNING, "indices == NULL\n"); + return; + } + if(normals) + if(normals->getNum() != 0) + doNormals = TRUE; + if(texcoords) + if(texcoords->getNum() != 0) + doTexCoords = TRUE; + if(colours) + if(colours->getNum() != 0) + doColours = TRUE; + + long * oldIndex2NewIndex = new long[vertices->getNum()]; + int i, oldIndex, newIndex; + for(i=0;i<vertices->getNum();i++) + oldIndex2NewIndex[i]=-1; // marker for "not used" + + ssgVertexArray *newVL= new ssgVertexArray(); + ssgNormalArray *newNL = NULL; + ssgTexCoordArray *newTL = NULL; + ssgColourArray *newCL = NULL; + + if(doNormals) + newNL = new ssgNormalArray(); + if (doTexCoords) + newTL = new ssgTexCoordArray(); + if (doColours) + newCL = new ssgColourArray(); + + for(i=0; i<indices->getNum(); i++) + { oldIndex = *indices->get(i); + if (oldIndex2NewIndex[ oldIndex ] != -1) + indices->set(oldIndex2NewIndex[ oldIndex ], i); + else + { newIndex = newVL->getNum(); + indices->set(newIndex , i); + oldIndex2NewIndex[ oldIndex ] = newIndex; + newVL->add(vertices->get(oldIndex)); + if(doNormals) + newNL->add(normals->get(oldIndex)); + if (doTexCoords) + newTL->add(texcoords->get(oldIndex)); + if (doColours) + newCL->add(colours->get(oldIndex)); + } + } + vertices->deRef(); + vertices = newVL; + + if(doNormals) + { normals->deRef(); + normals = newNL; + } + if (doTexCoords) + { texcoords->deRef(); + texcoords = newTL; + } + if (doColours) + { colours->deRef(); + colours = newCL; + } +} void ssgVtxArray::draw_geometry () { |
From: J?rgen M. <j_m...@us...> - 2002-07-20 19:31:25
|
Update of /cvsroot/plib/plib/src/ssg In directory usw-pr-cvs1:/tmp/cvs-serv1413/src/ssg Modified Files: ssgLoadBGL.cxx ssgLoadBGL.h Log Message: fix for Win32 pathnames Index: ssgLoadBGL.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgLoadBGL.cxx,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- ssgLoadBGL.cxx 20 Jul 2002 11:58:20 -0000 1.10 +++ ssgLoadBGL.cxx 20 Jul 2002 19:30:57 -0000 1.11 @@ -94,6 +94,7 @@ //#define JMDEBUG #include "ssgLoadBGL.h" #include "ssgLoadMDL.h" +#include "ssgLoadMDL.h" static ssgLoaderOptions *current_options; @@ -1314,7 +1315,7 @@ } // check for path in batch file name strcpy(filename, fname); - char *p = strrchr(filename,'/'); + char *p = strrchr(filename, SLASH); if ( p != 0) { p++; } @@ -1325,8 +1326,8 @@ models_ = new ssgBranch(); char* model_name = new char[128]; char *ptr = (char*)&fname[strlen(fname) - 1]; - while(ptr != &fname[0] && *ptr != '/') ptr--; - if(*ptr == '/') ptr++; + while(ptr != &fname[0] && *ptr != SLASH) ptr--; + if(*ptr == SLASH) ptr++; strcpy(model_name, ptr); ptr = &model_name[strlen(model_name)]; while(*ptr != '.' && ptr != &model_name[0]) ptr--; @@ -1382,8 +1383,8 @@ model_ = new ssgBranch(); char* model_name = new char[128]; char *ptr = (char*)&fname[strlen(fname) - 1]; - while(ptr != &fname[0] && *ptr != '/') ptr--; - if(*ptr == '/') ptr++; + while(ptr != &fname[0] && *ptr != SLASH) ptr--; + if(*ptr == SLASH) ptr++; strcpy(model_name, ptr); ptr = &model_name[strlen(model_name)]; while(*ptr != '.' && ptr != &model_name[0]) ptr--; Index: ssgLoadBGL.h =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgLoadBGL.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- ssgLoadBGL.h 20 Jul 2002 11:58:20 -0000 1.1 +++ ssgLoadBGL.h 20 Jul 2002 19:30:57 -0000 1.2 @@ -70,6 +70,13 @@ #define MIN3(a,b,c) ((a) <= (b) ? MIN(a,c) : MIN(b,c)) #define MAX3(a,b,c) ((a) >= (b) ? MAX(a,c) : MAX(b,c)) +#if defined(WIN32) && !defined(__CYGWIN__) +#define SLASH '\\' +#else +#define SLASH '/' +#endif + + // type definitions // class declarations |
From: J?rgen M. <j_m...@us...> - 2002-07-20 11:58:23
|
Update of /cvsroot/plib/plib/src/ssg In directory usw-pr-cvs1:/tmp/cvs-serv24388/src/ssg Modified Files: ssg.cxx ssg.h ssgLoadBGL.cxx ssgLoadMDL.h Added Files: ssgLoadBGL.h Log Message: - Layer Call & Layer Call 32 added - Layering for ground textures added - Single line drawing changed again to support one dot in start / end surface context - fixed texture size for polygons with no texture coordinates - reworked building generation (4 different shapes are generated) - support background textures with correct layering - checked re-usage of loaded vertices more carfully (i.e. condsider its normal before re-using them). --- NEW FILE: ssgLoadBGL.h --- /* PLIB - A Suite of Portable Game Libraries Copyright (C) 2001 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 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA For further information visit http://plib.sourceforge.net $Id: ssgLoadBGL.h,v 1.1 2002/07/20 11:58:20 j_marquardt Exp $ */ //=========================================================================== // // File: ssgLoadBGL.h // // Created: Tue Feb 29 22:20:31 2000 // // Author: Juergen Marquardt <jue...@t-...> // // //=========================================================================== // Copyright (c) 2002 Jürgen Marquardt <jue...@t-...> //=========================================================================== // common shininess for all objects other than background surface #define DEF_SHININESS 50 #ifdef JMDEBUG #include <iostream> #define JMPRINT(x,y) cout.flags(x); cout << y << "\n" #else #define JMPRINT(x,y) #endif #ifdef PRINT_JOHN #define PRINT_JOHN(x) PRINT_JOHN(x) #define PRINT_JOHN2(x,y) PRINT_JOHN2(x,y) #define PRINT_JOHN3(x,y,z) PRINT_JOHN3(x,y,z) #else #define PRINT_JOHN(x) #define PRINT_JOHN2(x,y) #define PRINT_JOHN3(x,y,z) #endif #define EARTH_RADIUS 6367311.808 #define MAX_PATH_LENGTH 1024 #define RUNAWAY_LAYER 24 #define ZERO_LAYER 24 #undef ABS #undef MIN #undef MAX #define ABS(x) ((x) >= 0 ? (x) : -(x)) #define MIN(a,b) ((a) <= (b) ? (a) : (b)) #define MAX(a,b) ((a) >= (b) ? (a) : (b)) #define MIN3(a,b,c) ((a) <= (b) ? MIN(a,c) : MIN(b,c)) #define MAX3(a,b,c) ((a) >= (b) ? MAX(a,c) : MAX(b,c)) // type definitions // class declarations class ssgLayeredVtxArray : public ssgVtxArray { public: ssgLayeredVtxArray ( unsigned int, ssgVertexArray *, ssgNormalArray *, ssgTexCoordArray *, ssgColourArray *, ssgIndexArray * ); bool isOnGround(); void moveToBackground(); }; // function declarations static void parse_proc_scenery(FILE*); static ssgBranch *ssgLoadBGLFile(const char * ); Index: ssg.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssg.cxx,v retrieving revision 1.54 retrieving revision 1.55 diff -u -d -r1.54 -r1.55 --- ssg.cxx 10 Jun 2002 20:58:03 -0000 1.54 +++ ssg.cxx 20 Jul 2002 11:58:20 -0000 1.55 @@ -150,6 +150,7 @@ #ifdef SSG_LOAD_BGL_SUPPORTED ssgAddModelFormat ( ".bgl", ssgLoadBGL , NULL ) ; + ssgAddModelFormat ( ".bgb", ssgLoadBGLBatch , NULL ) ; #endif #ifdef SSG_LOAD_TGA_SUPPORTED @@ -197,6 +198,10 @@ ssgAddTextureFormat ( ".pat" , ssgLoadMDLTexture ) ; ssgAddTextureFormat ( ".r8" , ssgLoadMDLTexture ) ; ssgAddTextureFormat ( ".naz" , ssgLoadMDLTexture ) ; + ssgAddTextureFormat ( ".ktx" , ssgLoadMDLTexture ) ; + ssgAddTextureFormat ( ".oav" , ssgLoadMDLTexture ) ; + ssgAddTextureFormat ( ".sky" , ssgLoadMDLTexture ) ; + ssgAddTextureFormat ( ".ngt" , ssgLoadMDLTexture ) ; #endif } Index: ssg.h =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssg.h,v retrieving revision 1.138 retrieving revision 1.139 diff -u -d -r1.138 -r1.139 --- ssg.h 10 Jun 2002 16:07:13 -0000 1.138 +++ ssg.h 20 Jul 2002 11:58:20 -0000 1.139 @@ -2628,6 +2628,7 @@ ssgEntity *ssgLoadMD2 ( const char *fname, const ssgLoaderOptions *options = NULL ) ; ssgEntity *ssgLoadMDL ( const char *fname, const ssgLoaderOptions *options = NULL ) ; ssgEntity *ssgLoadBGL ( const char *fname, const ssgLoaderOptions *options = NULL ) ; +ssgEntity *ssgLoadBGLBatch ( const char *fname, const ssgLoaderOptions *options = NULL ) ; ssgEntity *ssgLoadX ( const char *fname, const ssgLoaderOptions *options = NULL ) ; ssgEntity *ssgLoadFLT ( const char *fname, const ssgLoaderOptions *options = NULL ) ; ssgEntity *ssgLoadM ( const char *fname, const ssgLoaderOptions *options = NULL ) ; Index: ssgLoadBGL.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgLoadBGL.cxx,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- ssgLoadBGL.cxx 10 Jul 2002 10:10:38 -0000 1.9 +++ ssgLoadBGL.cxx 20 Jul 2002 11:58:20 -0000 1.10 @@ -1,17 +1,17 @@ /* PLIB - A Suite of Portable Game Libraries Copyright (C) 2001 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. - + [...3336 lines suppressed...] break; - } //end of bgl parse switch + } // end of bgl parse switch if (skip_offset > 0) fseek( fp, skip_offset, SEEK_CUR ); - - } //end of bgl parse while loop - } // end of bgl "object header opcode" while loop - - fclose(fp); + } // end of bgl parse while loop - return model_; + } // end of bgl "object header opcode" while loop } #else Index: ssgLoadMDL.h =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgLoadMDL.h,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- ssgLoadMDL.h 9 Jun 2002 15:30:39 -0000 1.8 +++ ssgLoadMDL.h 20 Jul 2002 11:58:20 -0000 1.9 @@ -308,7 +308,7 @@ { 0x41, "BGL_SHADOW_VICALL" , 6 }, { 0x42, "BGL_POLYGON_RUNWAY" , 40 }, { 0x43, "BGL_TEXTURE2" , -1 }, - { 0x44, "BGL_TEXTURE_RUNWAY" , 40 }, + { 0x44, "BGL_TEXTURE_RUNWAY" , 64 }, // 40 { 0x45, "OBSOLETE 0x45" , 16 }, { 0x46, "BGL_POINT_VICALL" , 22 }, { 0x47, "RESERVED" , 4 }, |
From: James J. <pu...@us...> - 2002-07-14 16:03:15
|
Update of /cvsroot/plib/plib/src/pui In directory usw-pr-cvs1:/tmp/cvs-serv1106 Modified Files: puInput.cxx Log Message: John Fay: Fix memory leak Index: puInput.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/pui/puInput.cxx,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- puInput.cxx 6 Jun 2002 15:00:49 -0000 1.24 +++ puInput.cxx 14 Jul 2002 16:03:13 -0000 1.25 @@ -56,6 +56,7 @@ strcpy ( p + select_start_position, getStringValue () + select_end_position ) ; setValue ( p ) ; + delete [] p ; cursor_position = select_end_position = select_start_position ; } |
From: James J. <pu...@us...> - 2002-07-14 16:01:35
|
Update of /cvsroot/plib/plib/src/pui In directory usw-pr-cvs1:/tmp/cvs-serv544 Modified Files: pu.h puSpinBox.cxx puBiSlider.cxx puTriSlider.cxx Log Message: John Fay: Fix linux compile warnings, casting. Index: pu.h =================================================================== RCS file: /cvsroot/plib/plib/src/pui/pu.h,v retrieving revision 1.115 retrieving revision 1.116 diff -u -d -r1.115 -r1.116 --- pu.h 12 Jul 2002 03:23:33 -0000 1.115 +++ pu.h 14 Jul 2002 16:01:31 -0000 1.116 @@ -558,7 +558,7 @@ puPostRefresh () ; } - void setValue ( const char *s ) ; + virtual void setValue ( const char *s ) ; void getValue ( int *i ) { re_eval () ; *i = *getIntegerp () ; } void getValue ( float *f ) { re_eval () ; *f = *getFloaterp () ; } @@ -1236,8 +1236,8 @@ [...63 lines suppressed...] recalc_bbox() ; } @@ -1715,14 +1716,14 @@ } puFilePicker ( int x, int y, int arrows, - const char* dir, const char *title = "Pick a file" ) : + const char *dir, const char *title = "Pick a file" ) : puDialogBox ( x, y ) { - puFilePickerInit ( x, y, arrows, 220, 170, dir, title ) ; + puFilePickerInit ( x, y, 220, 170, arrows, dir, title ) ; } puFilePicker ( int x, int y, - const char* dir, const char *title = "Pick a file" ) : + const char *dir, const char *title = "Pick a file" ) : puDialogBox ( x, y ) { puFilePickerInit ( x, y, 220, 170, 1, dir, title ) ; Index: puSpinBox.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/pui/puSpinBox.cxx,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- puSpinBox.cxx 12 Jul 2002 02:57:19 -0000 1.1 +++ puSpinBox.cxx 14 Jul 2002 16:01:31 -0000 1.2 @@ -37,8 +37,7 @@ { //input_box->draw ( dx, dy ) ; - int size = ( inbox_height ) * getArrowHeight() ; - int scalar = ( inbox_height ) * ( getArrowHeight() - 0.5 ); + int size = int(inbox_height * getArrowHeight()) ; int pos_y = dy + abox.min[1] + size / 2 ; int pos_x = dx ; if ( getArrowPosition() == 1 ) { @@ -84,8 +83,7 @@ if ( button == PU_LEFT_BUTTON && updown == PU_UP ) { - int size = ( inbox_height ) * getArrowHeight() ; - int scalar = ( inbox_height ) * ( getArrowHeight() - 0.5 ); + int size = int( inbox_height * getArrowHeight()) ; if ( ( x < abox.max[0] - size ) && ( getArrowPosition() == 1 ) || ( x > abox.min[0] + size ) && ( getArrowPosition() == 0 ) ) {/* User clicked in the input box */ Index: puBiSlider.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/pui/puBiSlider.cxx,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- puBiSlider.cxx 12 Jul 2002 02:57:19 -0000 1.18 +++ puBiSlider.cxx 14 Jul 2002 16:01:31 -0000 1.19 @@ -107,7 +107,7 @@ next_value = (next_value < 0.0f) ? 0.0f : (next_value > 1.0) ? 1.0f : next_value ; - float new_value = getMinValue() + ( next_value * ( getMaxValue() - getMinValue() ) + 0.5 ) ; + float new_value = getMinValue() + next_value * ( getMaxValue() - getMinValue() ) ; if ( ( getActiveButton() == 0 ) || ( updown == PU_DOWN ) ) // No currently-active slider, set whichever is closest { Index: puTriSlider.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/pui/puTriSlider.cxx,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- puTriSlider.cxx 12 Jul 2002 02:57:19 -0000 1.19 +++ puTriSlider.cxx 14 Jul 2002 16:01:31 -0000 1.20 @@ -126,7 +126,7 @@ next_value = (next_value < 0.0f) ? 0.0f : (next_value > 1.0) ? 1.0f : next_value ; - int new_value = getMinValue() + (int)( next_value * ( getMaxValue() - getMinValue() ) + 0.5 ) ; + float new_value = getMinValue() + next_value * ( getMaxValue() - getMinValue() ) ; if ( getFreezeEnds() ) // Cannot move end sliders, must move middle one { |
From: James J. <pu...@us...> - 2002-07-12 03:27:27
|
Update of /cvsroot/plib/plib/src/pui In directory usw-pr-cvs1:/tmp/cvs-serv17831 Modified Files: pui.dsp Log Message: PuRange addition Index: pui.dsp =================================================================== RCS file: /cvsroot/plib/plib/src/pui/pui.dsp,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- pui.dsp 17 Dec 2001 22:43:59 -0000 1.20 +++ pui.dsp 12 Jul 2002 03:27:24 -0000 1.21 @@ -70,7 +70,7 @@ # PROP Intermediate_Dir "Debug" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c -# ADD CPP /nologo /MTd /W3 /GX /Zi /Od /I "..\fnt" /I "..\sg" /I "..\util" /I "../../../glut/include" /I "../../glut/include" /I ".." /I "../glut/include" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /D "GLUT_IS_PRESENT" /FD /GZ /c +# ADD CPP /nologo /MTd /W3 /GX /Zi /Od /I "..\fnt" /I "..\sg" /I "..\util" /I "../../../glut/include" /I "../../glut/include" /I ".." /I "../glut/include" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /D "GLUT_IS_PRESENT" /FR /FD /GZ /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" @@ -194,11 +194,23 @@ # End Source File # Begin Source File +SOURCE=.\puRange.cxx +# End Source File +# Begin Source File + +SOURCE=.\puScrollBar.cxx +# End Source File +# Begin Source File + SOURCE=.\puSelectBox.cxx # End Source File # Begin Source File SOURCE=.\puSlider.cxx +# End Source File +# Begin Source File + +SOURCE=.\puSpinBox.cxx # End Source File # Begin Source File |
From: James J. <pu...@us...> - 2002-07-12 03:23:36
|
Update of /cvsroot/plib/plib/src/pui In directory usw-pr-cvs1:/tmp/cvs-serv17087 Modified Files: pu.h puGroup.cxx puMenuBar.cxx puObject.cxx puPopupMenu.cxx puVerticalMenu.cxx Log Message: Added "vStatus" and related functions to puGroup to facilitate allowing Menubars and Vertical Menus to (optionally) lock themselves in the corner of the window, no matter what window reshapes take place. Index: pu.h =================================================================== RCS file: /cvsroot/plib/plib/src/pui/pu.h,v retrieving revision 1.114 retrieving revision 1.115 diff -u -d -r1.114 -r1.115 --- pu.h 12 Jul 2002 02:57:19 -0000 1.114 +++ pu.h 12 Jul 2002 03:23:33 -0000 1.115 @@ -625,6 +625,7 @@ int highlighted ; int am_default ; int window ; /* Which window does the object appear in? */ + int v_status ; /* 1 if the Object should lock in the top left corner, 0 if not */ const char *label ; puFont labelFont ; int labelPlace ; const char *legend ; puFont legendFont ; int legendPlace ; @@ -862,6 +863,9 @@ int getDefaultIntegerValue ( void ) { return default_value.getIntegerValue () ; } float getDefaultFloatValue ( void ) { return default_value.getFloatValue () ; } char *getDefaultStringValue ( void ) { return default_value.getStringValue () ; } + + int getVStatus ( void ) const { return v_status ; } /* JCJ 6 Jun 2002 */ + void setVStatus ( int vstat ) { v_status = vstat ; } } ; /* @@ -1434,6 +1438,7 @@ { type |= PUCLASS_VERTMENU ; floating = TRUE ; + if ( y < 0 ) { setVStatus( TRUE ) ; } /* It is now supposed to stick to the top left - JCJ*/ } void add_submenu ( const char *str, char *items[], puCallback _cb[] ) ; Index: puGroup.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/pui/puGroup.cxx,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- puGroup.cxx 19 Dec 2001 19:30:41 -0000 1.19 +++ puGroup.cxx 12 Jul 2002 03:23:33 -0000 1.20 @@ -255,16 +255,40 @@ * correctly. */ - if ( ( bo -> getType () & PUCLASS_MENUBAR ) && - ( bo -> getWindow () == puGetWindow () ) ) + int x, y ; + int xdraw = dx + abox.min[0] ; + int ydraw = dy + abox.min[1] ; + bo -> getPosition (&x, &y) ; + /* Introduced PUCLASS_VERTMENU into the club of widgets being automatically moved */ + /* to the top-left corner of the screen. This eliminates all Vertmenu-resize and */ + /* window-jumping problems. - JCJ 31 May 2002 */ + + /* If the object is a menubar or a vertmenu and supposed to be locked to the top, */ + /* then move it there. - JCJ 6 June 2002 */ + if ( ( ( bo -> getType () & PUCLASS_MENUBAR ) || + ( ( bo -> getType () & PUCLASS_VERTMENU ) && + ( bo -> getVStatus () == 1 ) ) ) && + ( bo -> getWindow () == puGetWindow () ) ) { int obWidth, obHeight ; bo -> getSize ( &obWidth, &obHeight ) ; bo -> setPosition ( 0, puGetWindowHeight() - obHeight ) ; + } + else + { + if ( ( y < 0 ) && ( bo->getType () & PUCLASS_POPUPMENU ) ) + { + /* IF the object's bottom left corner lies outside the window, THEN */ + /* move the object to the top left - JCJ and Fay 5 Jun 2002 */ + int absx, absy ; + bo -> getAbsolutePosition (&absx, &absy) ; + if ( absy < 0 ) + ydraw -= absy ; + } } - bo -> draw ( dx + abox.min[0], dy + abox.min[1] ) ; + bo -> draw ( xdraw, ydraw ) ; } } Index: puMenuBar.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/pui/puMenuBar.cxx,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- puMenuBar.cxx 10 Nov 2001 13:37:38 -0000 1.14 +++ puMenuBar.cxx 12 Jul 2002 03:23:33 -0000 1.15 @@ -1,21 +1,21 @@ /* PLIB - A Suite of Portable Game Libraries Copyright (C) 2001 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 $Id$ @@ -64,16 +64,19 @@ if ( x_siz < (x_max - x_min) ) x_siz = x_max - x_min ; // Adjust the present size if ( y_siz < (y_max - y_min) ) y_siz = y_max - y_min ; - int x_pos = glutGet ( (GLenum)GLUT_WINDOW_X ) ; - int y_pos = glutGet ( (GLenum)GLUT_WINDOW_Y ) ; + //int x_pos = glutGet ( (GLenum)GLUT_WINDOW_X ) ; + //int y_pos = glutGet ( (GLenum)GLUT_WINDOW_Y ) ; glutReshapeWindow ( x_siz, y_siz ) ; - glutPositionWindow ( x_pos + x_min, y_pos ) ; + //glutPositionWindow ( x_pos + x_min, y_pos ) ; // Unneccessary - JCJ 6 Jun 2002 x_min = par_box->min[0] - x_min ; y_min = y_siz - ( par_box->max[1] - par_box->min[1] ) ; - parent -> setPosition ( x_min, y_min ) ; + /* If the parent window is SUPPOSED to be stuck at the top of the screen, move it. + - JCJ 6 June 2002 */ + if (parent -> getVStatus () == 1) + parent -> setPosition ( x_min, y_min ) ; glutSetWindow ( temp_window ) ; } Index: puObject.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/pui/puObject.cxx,v retrieving revision 1.43 retrieving revision 1.44 diff -u -d -r1.43 -r1.44 --- puObject.cxx 12 Jul 2002 01:01:24 -0000 1.43 +++ puObject.cxx 12 Jul 2002 03:23:33 -0000 1.44 @@ -139,6 +139,7 @@ highlighted = FALSE ; am_default = FALSE ; window = puGetWindow () ; + v_status = 0 ; cb = NULL ; active_cb = NULL ; Index: puPopupMenu.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/pui/puPopupMenu.cxx,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- puPopupMenu.cxx 7 Nov 2001 23:51:09 -0000 1.11 +++ puPopupMenu.cxx 12 Jul 2002 03:23:33 -0000 1.12 @@ -1,26 +1,27 @@ /* PLIB - A Suite of Portable Game Libraries Copyright (C) 2001 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 $Id$ */ + #include "puLocal.h" puObject *puPopupMenu::add_item ( const char *str, puCallback _cb ) @@ -121,9 +122,16 @@ if ( dlist == NULL || ! isVisible () || ! isActive () || ( window != puGetWindow () ) ) return FALSE ; - /* Must test 'isHit' before making the menu invisible! */ + /* If an item is going to fall out the bottom of the window and puGroup will */ + /* move it upward (around line 303 of puGroup.cxx), then make sure checkhit */ + /* realizes the thing has moved -- JCJ and Fay 5 June 2002 */ - int hit = isHit ( x, y ) ; + int absx, absy ; + getAbsolutePosition (&absx, &absy) ; + if ( absy < 0 ) + y += absy ; + + /* Must test 'isHit' before making the menu invisible! */ /* * June 17th, 1998, Shammi : @@ -136,6 +144,12 @@ track of changing abox sizes when daughter objects are changing sizes. */ + + int hit = isHit ( x, y ) ; + + /* If the mouse is clicked on another widget, hide the window - JCJ 18 Jun 2002 */ + if ( updown != PU_DRAG && !hit ) + hide () ; recalc_bbox(); x -= abox.min[0] ; Index: puVerticalMenu.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/pui/puVerticalMenu.cxx,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- puVerticalMenu.cxx 7 Nov 2001 23:51:09 -0000 1.6 +++ puVerticalMenu.cxx 12 Jul 2002 03:23:33 -0000 1.7 @@ -26,6 +26,7 @@ extern void puMenuBar_drop_down_the_menu ( puObject *b ); +/* If there is only one entry in a vmenu, just act as if clicking the menu clicks the oneshot underneath it. */ void puVerticalMenu::add_submenu ( const char *str, char *items[], puCallback _cb[] ) { int w, h ; |
From: James J. <pu...@us...> - 2002-07-12 03:05:21
|
Update of /cvsroot/plib/plib/demos/p-guide/src In directory usw-pr-cvs1:/tmp/cvs-serv13361 Modified Files: Makefile.am StatusWindow.cxx WidgetWindow.cxx WriteCode.cxx pGuide.cxx pGuide.dsp Added Files: LoadSave.cxx Log Message: Added XML saving and loading, misc. bugfixes, and SpinBoxes. --- NEW FILE: LoadSave.cxx --- /* P-GUIDE - PUI-based Graphical User Interface Designer Copyright (C) 2002 John F. Fay This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ [...486 lines suppressed...] } } if (strstr(tag, "/savefile")) { static int mouse_x ; static int mouse_y ; glutSetWindow ( main_window ) ; glutSetWindowTitle ( window_name->getStringValue() ) ; mouse_x = 999 ; mouse_y = 999 ; glutReshapeWindow ( window_size_x->getValue(), window_size_y->getValue() ) ; glutSetWindow ( status_window ) ; } buffer[0] = '\0'; } fclose (in); } Index: Makefile.am =================================================================== RCS file: /cvsroot/plib/plib/demos/p-guide/src/Makefile.am,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- Makefile.am 8 May 2002 22:49:55 -0000 1.1 +++ Makefile.am 12 Jul 2002 03:05:17 -0000 1.2 @@ -1,7 +1,7 @@ bin_PROGRAMS = pguide pguide_SOURCES = CreateWidget.cxx pGuide.cxx StatusWindow.cxx WidgetList.h \ - WidgetWindow.cxx WriteCode.cxx + WidgetWindow.cxx WriteCode.cxx LoadSave.cxx EXTRA_DIST = pGuide.dsp Index: StatusWindow.cxx =================================================================== RCS file: /cvsroot/plib/plib/demos/p-guide/src/StatusWindow.cxx,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- StatusWindow.cxx 8 May 2002 22:49:55 -0000 1.1 +++ StatusWindow.cxx 12 Jul 2002 03:05:17 -0000 1.2 @@ -30,10 +30,13 @@ extern WidgetList *active_widget ; extern puObject *active_object ; +extern char pguide_current_directory [ PUSTRING_MAX ] ; + extern bool main_window_changed ; // Status window parameters int status_window = 0 ; // Window handle +extern int main_window ; [...341 lines suppressed...] - window_color_b = new puInput ( 200, 260, 240, 280 ) ; + + window_color_b = new puSpinBox ( 370, 285, 420, 305 ) ; + window_color_b->setMinValue(0.0); + window_color_b->setMaxValue(1.0); + window_color_b->setStepSize(0.05); + window_color_b->setLabel ( "Blue" ) ; + window_color_b->setLabelPlace ( PUPLACE_TOP_CENTERED ) ; window_color_b->setValuator ( &main_window_color_b ) ; - window_color_a = new puInput ( 240, 260, 280, 280 ) ; + window_color_a = new puSpinBox ( 420, 285, 470, 305 ) ; + window_color_a->setMinValue(0.0); + window_color_a->setMaxValue(1.0); + window_color_a->setStepSize(0.05); + window_color_a->setLabel ( "Alpha" ) ; + window_color_a->setLabelPlace ( PUPLACE_TOP_CENTERED ) ; window_color_a->setValuator ( &main_window_color_a ) ; status_group->close () ; Index: WidgetWindow.cxx =================================================================== RCS file: /cvsroot/plib/plib/demos/p-guide/src/WidgetWindow.cxx,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- WidgetWindow.cxx 8 May 2002 22:49:55 -0000 1.1 +++ WidgetWindow.cxx 12 Jul 2002 03:05:17 -0000 1.2 @@ -128,8 +128,6 @@ active_button = (puButton *)ob ; } - - void input_cb ( puObject *ob ) { selected_object_sticky = ( glutGetModifiers () & GLUT_ACTIVE_CTRL ) ? 1 : 0 ; Index: WriteCode.cxx =================================================================== RCS file: /cvsroot/plib/plib/demos/p-guide/src/WriteCode.cxx,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- WriteCode.cxx 8 May 2002 22:49:55 -0000 1.1 +++ WriteCode.cxx 12 Jul 2002 03:05:17 -0000 1.2 @@ -55,6 +55,18 @@ // Get the file name and open the file char* filename ; file_selector -> getValue ( &filename ) ; + if (filename[0] == '\0') + { + puDeleteObject ( file_selector ) ; + file_selector = (puFileSelector *)NULL ; + glutHideWindow () ; + glutSetWindow ( status_window ) ; + return ; + } + + /* If they didn't give an extension, then tack ".cxx" onto the end. */ + if(!strstr(filename, ".")) + sprintf(filename, "%s.cxx", filename); FILE *out = fopen ( filename, "wt" ) ; if ( !out ) @@ -273,8 +285,8 @@ fprintf ( out, " \n" ) ; - wid = wid->next ; } + wid = wid->next ; } } Index: pGuide.cxx =================================================================== RCS file: /cvsroot/plib/plib/demos/p-guide/src/pGuide.cxx,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- pGuide.cxx 8 May 2002 22:49:55 -0000 1.1 +++ pGuide.cxx 12 Jul 2002 03:05:17 -0000 1.2 @@ -17,6 +17,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#define VERSION = "0.1a" + // Program to allow the user to build a PUI Graphical User Interface #include <plib/pu.h> @@ -45,14 +47,17 @@ main_window_color_b = 1.0, main_window_color_a = 1.0 ; bool main_window_changed = false ; +bool currently_loading = false ; static int ctrl_key_down = 0 ; static int mouse_x = 0 ; static int mouse_y = 0 ; +char pguide_current_directory [ PUSTRING_MAX ] ; + // Widget count -static int widget_number = 0 ; +int widget_number = 0 ; // From the status window: @@ -233,6 +238,12 @@ mouse_x = x ; mouse_y = y ; + if ( puActiveWidget() && ( active_object != puActiveWidget() ) ) + { + puActiveWidget() -> invokeDownCallback () ; + puDeactivateWidget () ; + } + ctrl_key_down = ( glutGetModifiers () & GLUT_ACTIVE_CTRL ) ; // Downclick: Place a new widget, activate an existing widget, or deactivate widget @@ -346,8 +357,9 @@ main_window_changed = true ; - if ( ( mouse_x < main_window_width/2 ) || // Grabbed the left edge ... - ( mouse_y < main_window_height/2 ) ) // or the bottom edge, move the widgets + if ( ( !currently_loading ) && ( + ( mouse_x < main_window_width/2 ) || // Grabbed the left edge ... + ( mouse_y < main_window_height/2 ) ) ) // or the bottom edge, move the widgets { WidgetList *wid = widgets ; int deltax = 0 ; @@ -371,11 +383,14 @@ window_size_x->setValue ( w ) ; window_size_y->setValue ( h ) ; + + currently_loading = false ; } static void main_window_displayfn ( void ) { /* Clear the screen */ + glutSetWindow ( main_window ) ; glClearColor ( main_window_color_r, main_window_color_g, main_window_color_b, main_window_color_a ) ; glClear ( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT ) ; @@ -439,6 +454,7 @@ { extern int define_widget_window () ; extern int define_status_window () ; + int i = 0; strcpy ( main_window_name, "PUI GUI Builder" ) ; @@ -456,6 +472,14 @@ glutReshapeFunc ( main_window_reshapefn ) ; glutIdleFunc ( main_window_displayfn ) ; + strcpy (pguide_current_directory, argv[0]+2); + i = strlen(pguide_current_directory); + while (pguide_current_directory[i] != '\\') { + if (i>0) i-- ; + else break ; + } + //pguide_current_directory[0] = '\\'; + pguide_current_directory[i+1] = '\0'; puInit () ; #ifdef VOODOO Index: pGuide.dsp =================================================================== RCS file: /cvsroot/plib/plib/demos/p-guide/src/pGuide.dsp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- pGuide.dsp 5 Jun 2002 18:23:09 -0000 1.2 +++ pGuide.dsp 12 Jul 2002 03:05:18 -0000 1.3 @@ -48,8 +48,8 @@ # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 !ELSEIF "$(CFG)" == "pGuide - Win32 Debug" @@ -64,16 +64,17 @@ # PROP Intermediate_Dir "pGuide___Win32_Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c -# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "c:\\" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c +# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "c:\\" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /YX /FD /GZ /c # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 pui_d.lib sg_d.lib fnt_d.lib ul_d.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"c:\plib" +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 pui_d.lib sg_d.lib fnt_d.lib ul_d.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /nodefaultlib:"LIBCMTD" /pdbtype:sept /libpath:"c:\plib" +# SUBTRACT LINK32 /pdb:none !ENDIF @@ -84,6 +85,10 @@ # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=.\LoadSave.cxx +# End Source File # Begin Source File SOURCE=.\pGuide.cxx |
Update of /cvsroot/plib/plib/src/pui In directory usw-pr-cvs1:/tmp/cvs-serv11761 Modified Files: Makefile.am pu.h puArrowButton.cxx puBiSlider.cxx puDial.cxx puSlider.cxx puTriSlider.cxx Added Files: puRange.cxx puSpinBox.cxx Log Message: Added new class: puRange. Added new widget: puSpinBox. Updated all previous "slider" widgets to now use the functions contained within puRange. --- NEW FILE: puRange.cxx --- /* PLIB - A Suite of Portable Game Libraries Copyright (C) 2001 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 */ #include "puLocal.h" --- NEW FILE: puSpinBox.cxx --- /* PLIB - A Suite of Portable Game Libraries Copyright (C) 2001 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 [...88 lines suppressed...] input_box->setValue ( getFloatValue () ) ; } puSetActiveWidget ( this, x, y ) ; invokeCallback () ; } } int puSpinBox::checkKey ( int key, int updown ) { input_box->checkKey ( key, updown ) ; setValue ( input_box->getFloatValue () ) ; if ( getFloatValue () > getMaxValue () ) setValue ( getMaxValue () ) ; else if ( getFloatValue () < getMinValue () ) setValue ( getMinValue () ) ; invokeCallback () ; return TRUE ; } Index: Makefile.am =================================================================== RCS file: /cvsroot/plib/plib/src/pui/Makefile.am,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- Makefile.am 25 Oct 2001 20:30:38 -0000 1.13 +++ Makefile.am 12 Jul 2002 02:57:19 -0000 1.14 @@ -10,7 +10,8 @@ puFilePicker.cxx puListBox.cxx puSlider.cxx puText.cxx \ puValue.cxx puFont.cxx puBiSlider.cxx puTriSlider.cxx \ puDial.cxx puVerticalMenu.cxx puLargeInput.cxx \ - puFileSelector.cxx puComboBox.cxx puSelectBox.cxx + puFileSelector.cxx puComboBox.cxx puSelectBox.cxx puRange.cxx \ + puSpinBox.cxx INCLUDES = -I$(top_srcdir)/src/sg -I$(top_srcdir)/src/fnt INCLUDES += -I$(top_srcdir)/src/util Index: pu.h =================================================================== RCS file: /cvsroot/plib/plib/src/pui/pu.h,v retrieving revision 1.113 retrieving revision 1.114 diff -u -d -r1.113 -r1.114 --- pu.h 12 Jul 2002 01:55:16 -0000 1.113 +++ pu.h 12 Jul 2002 02:57:19 -0000 1.114 @@ -326,6 +326,8 @@ #define PUCLASS_LARGEINPUT 0x00400000 #define PUCLASS_COMBOBOX 0x00800000 #define PUCLASS_SELECTBOX 0x01000000 +#define PUCLASS_RANGE 0x02000000 +#define PUCLASS_SPINBOX 0x04000000 /* This function is not required for GLUT programs */ void puSetWindowSize ( int width, int height ) ; @@ -349,6 +351,8 @@ class puPopupMenu ; class puMenuBar ; [...338 lines suppressed...] + { + type |= PUCLASS_SPINBOX ; + if (arrow_pos==1) + input_box = new puInput ( minx, miny, maxx - (maxy-miny)/2, maxy ) ; + else + input_box = new puInput ( minx + (maxy-miny)/2, miny, maxx, maxy ) ; + up_arrow_active = down_arrow_active = 0 ; + arrow_position = arrow_pos ; + arrow_height = 0.5f ; + inbox_height = maxy - miny ; + } + + ~puSpinBox () + { + puDeleteObject ( (puObject *)input_box ) ; // THIS MAY NEED TO CHANGE !!! + } +} ; class puButtonBox : public puObject { Index: puArrowButton.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/pui/puArrowButton.cxx,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- puArrowButton.cxx 10 Nov 2001 13:37:38 -0000 1.13 +++ puArrowButton.cxx 12 Jul 2002 02:57:19 -0000 1.14 @@ -23,6 +23,110 @@ #include "puLocal.h" +void puDrawArrowButtonTriangle ( int pos_x, int pos_y, int size_x, int size_y, + puColour colour, int arrow_type, int active ) +{ + /* + If greyed out then halve the opacity when drawing + the widget + */ + [...186 lines suppressed...] - case PUARROW_FASTRIGHT : - glBegin ( GL_TRIANGLES ) ; - glVertex2i ( pos_x - size_x/4, pos_y - size_y/4 ) ; - glVertex2i ( pos_x , pos_y ) ; - glVertex2i ( pos_x - size_x/4, pos_y + size_y/4 ) ; - - glVertex2i ( pos_x , pos_y - size_y/4 ) ; - glVertex2i ( pos_x + size_x/4, pos_y ) ; - glVertex2i ( pos_x , pos_y + size_y/4 ) ; - glEnd () ; - break; - - default : - ulSetError ( UL_WARNING, "PUI: Unrecognised 'arrow_type' %d", arrow_type ) ; - break; - } + puDrawArrowButtonTriangle ( pos_x, pos_y, size_x, size_y, colour [ PUCOL_MISC ], arrow_type, active ) ; } draw_label ( dx, dy ) ; Index: puBiSlider.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/pui/puBiSlider.cxx,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- puBiSlider.cxx 7 Nov 2001 23:51:09 -0000 1.17 +++ puBiSlider.cxx 12 Jul 2002 02:57:19 -0000 1.18 @@ -51,7 +51,7 @@ char str_value[10] ; sprintf (str_value, "%d", getCurrentMax() ) ; - draw_slider_box ( dx, dy, val, str_value ) ; + draw_slider_box ( dx, dy, abox, val, str_value ) ; // Draw the current_min slider and label it @@ -62,7 +62,7 @@ sprintf (str_value, "%d", getCurrentMin() ) ; - draw_slider_box ( dx, dy, val, str_value ) ; + draw_slider_box ( dx, dy, abox, val, str_value ) ; draw_legend ( dx, dy ) ; } @@ -107,29 +107,29 @@ next_value = (next_value < 0.0f) ? 0.0f : (next_value > 1.0) ? 1.0f : next_value ; - int new_value = getMinValue() + (int)( next_value * ( getMaxValue() - getMinValue() ) + 0.5 ) ; + float new_value = getMinValue() + ( next_value * ( getMaxValue() - getMinValue() ) + 0.5 ) ; if ( ( getActiveButton() == 0 ) || ( updown == PU_DOWN ) ) // No currently-active slider, set whichever is closest { if ( (new_value-getCurrentMin()) < (getCurrentMax()-new_value) ) // Closest to current_min { - setCurrentMin ( new_value ) ; + setCurrentMin ( checkStep(new_value) ) ; setActiveButton ( 1 ) ; } else // Closest to current_max { - setCurrentMax ( new_value ) ; + setCurrentMax ( checkStep(new_value) ) ; setActiveButton ( 2 ) ; } } else if ( getActiveButton() == 1 ) // Currently moving current_min { - setCurrentMin ( new_value ) ; + setCurrentMin ( checkStep(new_value) ) ; if ( getCurrentMax() < getCurrentMin() ) setCurrentMax ( getCurrentMin() ) ; } else if ( getActiveButton() == 2 ) // Currently moving current_max { - setCurrentMax ( new_value ) ; + setCurrentMax ( checkStep(new_value) ) ; if ( getCurrentMax() < getCurrentMin() ) setCurrentMin ( getCurrentMax() ) ; } @@ -145,7 +145,7 @@ } break ; - case PUSLIDER_DELTA : + case PUSLIDER_DELTA :/* Deprecated! */ if ( fabs ( last_cb_value - next_value ) >= cb_delta ) { last_cb_value = next_value ; Index: puDial.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/pui/puDial.cxx,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- puDial.cxx 10 Jun 2002 23:10:13 -0000 1.21 +++ puDial.cxx 12 Jul 2002 02:57:19 -0000 1.22 @@ -1,21 +1,21 @@ /* PLIB - A Suite of Portable Game Libraries Copyright (C) 2001 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 $Id$ @@ -81,6 +81,7 @@ float val ; getValue ( &val ) ; + val = ( val - minimum_value) / (maximum_value - minimum_value) ; if ( val < 0.0 ) val = 0.0 ; if ( val > 1.0 ) val = 1.0 ; @@ -144,26 +145,27 @@ else if ( ( angle < 0.25 ) && ( getFloatValue () > 0.75 ) ) angle = 1.0 ; } - - setValue ( angle ) ; + + angle = angle * (maximum_value - minimum_value) + minimum_value ; + setValue( checkStep(angle) ) ; switch ( cb_mode ) { case PUSLIDER_CLICK : if ( updown == active_mouse_edge ) { - last_cb_value = angle ; - puSetActiveWidget ( this, x, y ) ; - invokeCallback () ; + last_cb_value = angle ; + puSetActiveWidget ( this, x, y ) ; + invokeCallback () ; } break ; - case PUSLIDER_DELTA : + case PUSLIDER_DELTA :/* Deprecated! */ if ( fabs ( last_cb_value - angle ) >= cb_delta ) { - last_cb_value = angle ; - puSetActiveWidget ( this, x, y ) ; - invokeCallback () ; + last_cb_value = angle ; + puSetActiveWidget ( this, x, y ) ; + invokeCallback () ; } break ; Index: puSlider.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/pui/puSlider.cxx,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- puSlider.cxx 1 Mar 2002 14:54:44 -0000 1.22 +++ puSlider.cxx 12 Jul 2002 02:57:19 -0000 1.23 @@ -1,21 +1,21 @@ /* PLIB - A Suite of Portable Game Libraries Copyright (C) 2001 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 $Id$ @@ -24,12 +24,12 @@ #include "puLocal.h" -void puSlider::draw_slider_box ( int dx, int dy, float val, const char *box_label ) +void puSlider::draw_slider_box ( int dx, int dy, const puBox &box, float val, const char *box_label ) { int sd, od ; if ( isVertical() ) { sd = 1 ; od = 0 ; } else { sd = 0 ; od = 1 ; } - int sz = abox.max [sd] - abox.min [sd] ; // Size of slider box, in pixels + int sz = box.max [sd] - box.min [sd] ; // Size of slider box, in pixels if ( val < 0.0f ) val = 0.0f ; if ( val > 1.0f ) val = 1.0f ; @@ -38,10 +38,10 @@ puBox bx ; - bx.min [ sd ] = abox.min [ sd ] + (int) val ; + bx.min [ sd ] = box.min [ sd ] + (int) val ; bx.max [ sd ] = (int) ( (float) bx.min [ sd ] + (float) sz * slider_fraction ) ; - bx.min [ od ] = abox.min [ od ] + 2 ; - bx.max [ od ] = abox.max [ od ] - 2 ; + bx.min [ od ] = box.min [ od ] + 2 ; + bx.max [ od ] = box.max [ od ] - 2 ; bx.draw ( dx, dy, PUSTYLE_SMALL_SHADED, colour, FALSE, 2 ) ; @@ -88,11 +88,9 @@ r_cb ( this, dx, dy, render_data ) ; else { - float val ; - - getValue ( & val ) ; + float val = getFloatValue () ; - draw_slider_box ( dx, dy, val ) ; + draw_slider_box ( dx, dy, abox, ( val - minimum_value ) / ( maximum_value - minimum_value ) ) ; draw_legend ( dx, dy ) ; } @@ -135,9 +133,10 @@ } next_value = (next_value < 0.0f) ? 0.0f : (next_value > 1.0f) ? 1.0f : next_value ; + next_value = next_value * ( maximum_value - minimum_value ) + minimum_value ; - setValue ( next_value ) ; - + setValue ( checkStep (next_value) ); + switch ( cb_mode ) { case PUSLIDER_CLICK : @@ -149,7 +148,7 @@ } break ; - case PUSLIDER_DELTA : + case PUSLIDER_DELTA : /* Deprecated! */ if ( fabs ( last_cb_value - next_value ) >= cb_delta ) { last_cb_value = next_value ; Index: puTriSlider.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/pui/puTriSlider.cxx,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- puTriSlider.cxx 10 Jun 2002 18:39:37 -0000 1.18 +++ puTriSlider.cxx 12 Jul 2002 02:57:19 -0000 1.19 @@ -50,7 +50,7 @@ char str_value[10] ; sprintf (str_value, "%d", getIntegerValue () ) ; - draw_slider_box ( dx, dy, val, str_value ) ; + draw_slider_box ( dx, dy, abox, val, str_value ) ; if ( val < 0.0f ) val = 0.0f ; if ( val > 1.0f ) val = 1.0f ; @@ -64,7 +64,7 @@ sprintf (str_value, "%d", getCurrentMax() ) ; [...74 lines suppressed...] { - setCurrentMax ( new_value ) ; + setCurrentMax ( checkStep(new_value) ) ; if ( getIntegerValue() > getCurrentMax() ) setValue ( getCurrentMax() ) ; if ( getCurrentMax() < getCurrentMin() ) setCurrentMin ( getCurrentMax() ) ; } @@ -180,7 +186,7 @@ } break ; - case PUSLIDER_DELTA : + case PUSLIDER_DELTA :/* Deprecated! */ if ( fabs ( last_cb_value - next_value ) >= cb_delta ) { last_cb_value = next_value ; @@ -198,4 +204,3 @@ } } } - |
From: James J. <pu...@us...> - 2002-07-12 01:55:20
|
Update of /cvsroot/plib/plib/src/pui In directory usw-pr-cvs1:/tmp/cvs-serv32732 Modified Files: pu.h puLargeInput.cxx Log Message: PuLargeInput: Added support for all normal editing keys (pgup/down, end/home, arrows, etc...) so it acts much more like a normal text editor. Removed callbacks from the puSliders. Index: pu.h =================================================================== RCS file: /cvsroot/plib/plib/src/pui/pu.h,v retrieving revision 1.112 retrieving revision 1.113 diff -u -d -r1.112 -r1.113 --- pu.h 12 Jul 2002 01:01:24 -0000 1.112 +++ pu.h 12 Jul 2002 01:55:16 -0000 1.113 @@ -1716,6 +1716,7 @@ void setSize ( int w, int h ) ; int getNumLines ( void ) const { return num_lines ; } + int getLinesInWindow ( void ) const { return lines_in_window ; } void setTopLineInWindow ( int val ) { top_line_in_window = val ; } void draw ( int dx, int dy ) ; Index: puLargeInput.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/pui/puLargeInput.cxx,v retrieving revision 1.32 retrieving revision 1.33 diff -u -d -r1.32 -r1.33 --- puLargeInput.cxx 20 Jun 2002 20:07:53 -0000 1.32 +++ puLargeInput.cxx 12 Jul 2002 01:55:16 -0000 1.33 @@ -50,14 +50,20 @@ float val ; slider->getValue ( &val ) ; val = 1.0f - val ; + int lines_in_window = text->getLinesInWindow () ; int num_lines = text->getNumLines () ; if ( num_lines > 0 ) { int idx = int ( num_lines * val + 0.5 ) + inc ; - if ( idx > num_lines ) idx = num_lines ; + /* Modified so that when clicking the down arrows, they will not scroll lines_in_window */ + /* off the screen any longer, requiring "transparent" or "do-nothing" clicks of the top */ [...587 lines suppressed...] + /* If running off the screen, scroll right. - JCJ 28 Jun 2002 */ + if ((bottom_value*max_width)+(box_width) < line_width_to_cursor+5) { + bottom_slider->setValue( ((bottom_value*max_width)+(box_width/2)+5)/max_width ) ; + } + + if (key == '\n') { + /* If pressing enter, figure out which line this is. */ + while ( line_counter < cursor_position) { + if ( old_text [ line_counter ] == '\n' ) current_line_in_window++ ; + line_counter++ ; + } + /* If hitting enter at the bottom of the screen, scroll down. - JCJ 28 Jun 2002 */ + if ( (current_line_in_window+1) >= bottom_line_in_window ) { + setTopLineInWindow ( top_line_in_window + 1 ); + right_slider->setValue (1.0f - (float)top_line_in_window / num_lines ) ; + } + } setText ( p ) ; setCursor ( temp_cursor + 1 ) ; |
From: James J. <pu...@us...> - 2002-07-12 01:01:27
|
Update of /cvsroot/plib/plib/src/pui In directory usw-pr-cvs1:/tmp/cvs-serv21955 Modified Files: pu.cxx pu.h puObject.cxx Log Message: Fixed memory leak in puCleanUpJunk, added puGetPressedButton, and PU_NOBUTTON to fix a potential problem with passive motion checkhits. Index: pu.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/pui/pu.cxx,v retrieving revision 1.52 retrieving revision 1.53 diff -u -d -r1.52 -r1.53 --- pu.cxx 20 Jun 2002 20:14:01 -0000 1.52 +++ pu.cxx 12 Jul 2002 01:01:24 -0000 1.53 @@ -222,12 +222,14 @@ static void puCleanUpJunk ( void ) { + puObject * local_objects_to_delete = objects_to_delete ; + objects_to_delete = NULL ; /* Step through the linked list of objects to delete, removing them. */ - while ( objects_to_delete != NULL ) + while ( local_objects_to_delete != NULL ) { - puObject *next_ob = objects_to_delete -> getNextObject() ; - delete objects_to_delete ; - objects_to_delete = next_ob ; + puObject *next_ob = local_objects_to_delete -> getNextObject() ; + delete local_objects_to_delete ; + local_objects_to_delete = next_ob ; } } @@ -349,6 +351,12 @@ static int pu_mouse_offset_x = 0 ; static int pu_mouse_offset_y = 0 ; +int puGetPressedButton () +{ + return last_buttons ; +} + + int puMouse ( int button, int updown, int x, int y ) { puCursor ( x, y ) ; @@ -392,13 +400,10 @@ { puCursor ( x, y ) ; - if ( last_buttons == 0 ) - return FALSE ; - int button = (last_buttons & (1<<PU_LEFT_BUTTON )) ? PU_LEFT_BUTTON : (last_buttons & (1<<PU_MIDDLE_BUTTON)) ? PU_MIDDLE_BUTTON : - (last_buttons & (1<<PU_RIGHT_BUTTON )) ? PU_RIGHT_BUTTON : 0 ; + (last_buttons & (1<<PU_RIGHT_BUTTON )) ? PU_RIGHT_BUTTON : PU_NOBUTTON ; int h = puGetWindowHeight () ; Index: pu.h =================================================================== RCS file: /cvsroot/plib/plib/src/pui/pu.h,v retrieving revision 1.111 retrieving revision 1.112 diff -u -d -r1.111 -r1.112 --- pu.h 7 Jul 2002 19:00:48 -0000 1.111 +++ pu.h 12 Jul 2002 01:01:24 -0000 1.112 @@ -54,6 +54,7 @@ #ifdef PU_NOT_USING_GLUT +#define PU_NOBUTTON -1 #define PU_LEFT_BUTTON 0 #define PU_MIDDLE_BUTTON 1 #define PU_RIGHT_BUTTON 2 @@ -62,6 +63,7 @@ #else +#define PU_NOBUTTON -1 #define PU_LEFT_BUTTON GLUT_LEFT_BUTTON #define PU_MIDDLE_BUTTON GLUT_MIDDLE_BUTTON #define PU_RIGHT_BUTTON GLUT_RIGHT_BUTTON @@ -428,6 +430,8 @@ void puSetActiveWidget ( puObject *w, int x, int y ) ; puObject *puActiveWidget ( void ) ; +// Return the currently active mouse button +extern int puGetPressedButton () ; class puValue { Index: puObject.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/pui/puObject.cxx,v retrieving revision 1.42 retrieving revision 1.43 diff -u -d -r1.42 -r1.43 --- puObject.cxx 15 Apr 2002 20:40:11 -0000 1.42 +++ puObject.cxx 12 Jul 2002 01:01:24 -0000 1.43 @@ -488,13 +488,13 @@ int puObject::checkHit ( int button, int updown, int x, int y ) { - if ( isHit( x, y ) ) + if ( ( ( puGetPressedButton () || updown == PU_UP ) ) && isHit( x, y ) ) { doHit ( button, updown, x, y ) ; return TRUE ; } - lowlight () ; return FALSE ; } + |
From: Wolfram K. <wol...@us...> - 2002-07-10 10:10:42
|
Update of /cvsroot/plib/plib/src/ssg In directory usw-pr-cvs1:/tmp/cvs-serv26440 Modified Files: ssgLoadBGL.cxx Log Message: Due to int versus GLenum problems, it did not compile for some people. Patch by Simon Fowler Index: ssgLoadBGL.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgLoadBGL.cxx,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- ssgLoadBGL.cxx 20 Jun 2002 20:07:52 -0000 1.8 +++ ssgLoadBGL.cxx 10 Jul 2002 10:10:38 -0000 1.9 @@ -536,7 +536,7 @@ //=========================================================================== -static int createTriangIndices(ssgIndexArray *ixarr, +static GLenum createTriangIndices(ssgIndexArray *ixarr, int numverts, const sgVec3 s_norm) { sgVec3 v1, v2, cross; @@ -670,7 +670,7 @@ #endif ssgIndexArray *strips = new ssgIndexArray(3* (numverts-2)); ssgIndexArray *idx_array; - int ret; + GLenum ret; if ( (up != 0 ) && (down != 0)) { numverts = _ssgTriangulate(vertex_array_, ixarr, numverts, strips); numverts *= 3; @@ -704,10 +704,10 @@ //=========================================================================== -static int readTexIndices(FILE *fp, int numverts, const sgVec3 s_norm, bool flip_y) +static GLenum readTexIndices(FILE *fp, int numverts, const sgVec3 s_norm, bool flip_y) { if(numverts <= 0) - return false; + return GL_FALSE; ssgIndexArray *curr_index_ = new ssgIndexArray(); @@ -795,10 +795,10 @@ //=========================================================================== -static int readIndices(FILE* fp, int numverts, const sgVec3 s_norm) +static GLenum readIndices(FILE* fp, int numverts, const sgVec3 s_norm) { if(numverts <= 0) - return false; + return GL_FALSE; ssgIndexArray *curr_index_ = new ssgIndexArray(); @@ -1822,7 +1822,7 @@ flip_y = ulStrEqual( texture_extension, "BMP" ) != 0 ; } - int type = readTexIndices(fp, numverts, v, flip_y); + GLenum type = readTexIndices(fp, numverts, v, flip_y); if(!has_normals_) { @@ -1870,7 +1870,7 @@ flip_y = ulStrEqual( texture_extension, "BMP" ) != 0 ; } - int type = readTexIndices(fp, numverts, v, flip_y); + GLenum type = readTexIndices(fp, numverts, v, flip_y); if(!has_normals_) { @@ -1909,7 +1909,7 @@ readVector(fp, v); // Read vertex indices - int type = readIndices(fp, numverts, v); + GLenum type = readIndices(fp, numverts, v); if(!has_normals_) { @@ -1952,7 +1952,7 @@ ulEndianReadLittle32(fp); #endif // Read vertex indices - int type = readIndices(fp, numverts, v); + GLenum type = readIndices(fp, numverts, v); if(!has_normals_) { |
From: Dave M. <mc...@us...> - 2002-07-08 03:37:25
|
Update of /cvsroot/plib/plib/src/net In directory usw-pr-cvs1:/tmp/cvs-serv29276/src/net Modified Files: netBuffer.h netChannel.h netChat.h netMonitor.h readme.txt Log Message: call it PLIB network library instead of Pegasus Index: netBuffer.h =================================================================== RCS file: /cvsroot/plib/plib/src/net/netBuffer.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- netBuffer.h 18 Dec 2001 16:55:07 -0000 1.5 +++ netBuffer.h 8 Jul 2002 03:37:22 -0000 1.6 @@ -66,7 +66,7 @@ * * AUTHORS * Sam Rushing <ru...@ni...> - original version for Medusa -* Dave McClurg <dp...@ef...> - modified for use in Pegasus +* Dave McClurg <dp...@ef...> - modified for use in PLIB * * CREATION DATE * Dec-2000 Index: netChannel.h =================================================================== RCS file: /cvsroot/plib/plib/src/net/netChannel.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- netChannel.h 18 Dec 2001 16:55:07 -0000 1.6 +++ netChannel.h 8 Jul 2002 03:37:22 -0000 1.7 @@ -41,7 +41,7 @@ * * AUTHORS * Sam Rushing <ru...@ni...> - original version for Medusa -* Dave McClurg <dp...@ef...> - modified for use in Pegasus +* Dave McClurg <dp...@ef...> - modified for use in PLIB * * CREATION DATE * Dec-2000 Index: netChat.h =================================================================== RCS file: /cvsroot/plib/plib/src/net/netChat.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- netChat.h 7 Nov 2001 23:51:09 -0000 1.3 +++ netChat.h 8 Jul 2002 03:37:22 -0000 1.4 @@ -49,7 +49,7 @@ * * AUTHORS * Sam Rushing <ru...@ni...> - original version for Medusa -* Dave McClurg <dp...@ef...> - modified for use in Pegasus +* Dave McClurg <dp...@ef...> - modified for use in PLIB * * CREATION DATE * Dec-2000 Index: netMonitor.h =================================================================== RCS file: /cvsroot/plib/plib/src/net/netMonitor.h,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- netMonitor.h 1 Jul 2002 02:42:57 -0000 1.7 +++ netMonitor.h 8 Jul 2002 03:37:22 -0000 1.8 @@ -32,7 +32,7 @@ * * AUTHORS * Sam Rushing <ru...@ni...> - original version for Medusa -* Dave McClurg <dp...@ef...> - modified for use in Pegasus +* Dave McClurg <dp...@ef...> - modified for use in PLIB * * CREATION DATE * Dec-2000 Index: readme.txt =================================================================== RCS file: /cvsroot/plib/plib/src/net/readme.txt,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- readme.txt 14 Jun 2001 19:00:20 -0000 1.2 +++ readme.txt 8 Jul 2002 03:37:22 -0000 1.3 @@ -1,35 +1,20 @@ -Pegasus Network Library -http://pnet.sourceforge.net ---------------------------- - by Dave McClurg <dp...@ef...> - +PLIB Network Library +------------------- DESCRIPTION: -Pegasus is a C++ library for making networked games. +This is a C++ library for making networked games. It includes event-driven channels, support for buffering and pipelining, a monitor server for remote telnet admin, and binary messages. +HISTORY -ORIGINS: - -Pegasus is based on Medusa, a high-performance internet -server architecture. - +Initial work by Dave McClurg <dp...@ef...> +This library is based on from a high-performance +internet server architecture for Python called Medusa. http://www.nightmare.com/medusa/medusa.html - -Medusa is mainly for Python -- a really great scripting language. -I wanted a C++ library which had the same simplicity as Medusa -and worked for the type of games i wanted to write. -I found a C++ port of Medusa and used that as a starting point. - -I use the name Pegasus because when Perseus (a son of Zeus) killed -Medusa by cutting off her head, from the drops of her blood sprang -Pegasus. Pegasus was a winged horse who immediately flew up to -Heaven to live with the gods. He was said to carry the thunderbolts -for Zeus. lol. - +Added binary messages and PLIB naming conventions LICENSING: |
From: Dave M. <mc...@us...> - 2002-07-08 03:22:43
|
Update of /cvsroot/plib/plib/src/net In directory usw-pr-cvs1:/tmp/cvs-serv26625/src/net Modified Files: netMessage.h Log Message: netMessage comments Index: netMessage.h =================================================================== RCS file: /cvsroot/plib/plib/src/net/netMessage.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- netMessage.h 7 Nov 2001 23:51:09 -0000 1.6 +++ netMessage.h 8 Jul 2002 03:22:40 -0000 1.7 @@ -108,15 +108,18 @@ public: + // incoming message; header is already there netMessage ( const char* s, int n ) : netBuffer(n) { assert ( n >= 5 ) ; append(s,n); - pos = 5 ; + pos = 5 ; // seek past header } + // outgoing message netMessage ( int type, int to_id, int from_id=0, int n=256 ) : netBuffer(n) { + // output header putw ( 0 ) ; //msg_len putbyte ( type ) ; putbyte ( to_id ) ; |
From: Sebastian U. <ud...@us...> - 2002-07-07 19:06:01
|
Update of /cvsroot/plib/plib/src/pui In directory usw-pr-cvs1:/tmp/cvs-serv25237 Modified Files: puFileSelector.cxx Log Message: Fixed bug in puFileSelector (thanks to Dave McClurg and Julian Foad Index: puFileSelector.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/pui/puFileSelector.cxx,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- puFileSelector.cxx 20 Jun 2002 20:07:53 -0000 1.24 +++ puFileSelector.cxx 7 Jul 2002 19:05:56 -0000 1.25 @@ -610,28 +610,30 @@ return ; } - for ( ifile = 0 ; - (dp = ulReadDir(dirp)) != NULL && ifile < num_files ; - ifile++ ) + ifile = 0 ; + + while ( (dp = ulReadDir(dirp)) != NULL && ifile < num_files ) { /* Skip over the "." entry... */ - if ( strcmp ( dp->d_name, "." ) == 0 ) - continue ; + if ( strcmp ( dp->d_name, "." ) != 0 ) + { + dflag[ ifile ] = dp->d_isdir ; - dflag[ ifile ] = dp->d_isdir ; + if ( dflag[ ifile ] ) + { + files[ ifile ] = new char[ strlen(dp->d_name)+4 ] ; + strcpy ( files [ ifile ], "[" ) ; + strcat ( files [ ifile ], dp->d_name ) ; + strcat ( files [ ifile ], "]" ) ; + } + else + { + files[ ifile ] = new char[ strlen(dp->d_name)+1 ] ; + strcpy ( files [ ifile ], dp->d_name ) ; + } - if ( dflag[ ifile ] ) - { - files[ ifile ] = new char[ strlen(dp->d_name)+4 ] ; - strcpy ( files [ ifile ], "[" ) ; - strcat ( files [ ifile ], dp->d_name ) ; - strcat ( files [ ifile ], "]" ) ; - } - else - { - files[ ifile ] = new char[ strlen(dp->d_name)+1 ] ; - strcpy ( files [ ifile ], dp->d_name ) ; + ifile++ ; } } |
From: Sebastian U. <ud...@us...> - 2002-07-07 19:00:51
|
Update of /cvsroot/plib/plib/src/pui In directory usw-pr-cvs1:/tmp/cvs-serv23781 Modified Files: puFont.cxx pu.h Log Message: Added puFont::getFloatStringWidth (suggested by John F. Fay) Index: puFont.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/pui/puFont.cxx,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- puFont.cxx 4 Jun 2002 22:03:33 -0000 1.15 +++ puFont.cxx 7 Jul 2002 19:00:48 -0000 1.16 @@ -55,13 +55,13 @@ #endif // #ifdef _PU_USE_GLUT_FONTS -int puFont::getStringWidth ( const char *str ) const +float puFont::getFloatStringWidth ( const char *str ) const { if ( str == NULL ) - return 0 ; + return 0.0f ; #ifdef _PU_USE_GLUT_FONTS - if ( glut_font_handle != (GlutFont) 0 ) + if ( glut_font_handle != NULL ) { int res = 0 ; int max_res = 0 ; @@ -81,7 +81,7 @@ if ( res > max_res ) max_res = res; - return max_res ; + return (float) max_res ; } #endif // #ifdef _PU_USE_GLUT_FONTS @@ -89,7 +89,7 @@ { float r, l ; fnt_font_handle -> getBBox ( str, pointsize, slant, &l, &r, NULL, NULL ) ; - return (int) ( r - l ) ; + return ( r - l ) ; } return 0 ; Index: pu.h =================================================================== RCS file: /cvsroot/plib/plib/src/pui/pu.h,v retrieving revision 1.110 retrieving revision 1.111 diff -u -d -r1.110 -r1.111 --- pu.h 7 Jul 2002 18:27:40 -0000 1.110 +++ pu.h 7 Jul 2002 19:00:48 -0000 1.111 @@ -126,7 +126,12 @@ int getStringDescender ( void ) const ; int getStringHeight ( const char *str ) const ; int getStringHeight ( void ) const { return getStringHeight ( "K" ) ; } - int getStringWidth ( const char *str ) const ; + + float getFloatStringWidth ( const char *str ) const ; + int getStringWidth ( const char *str ) const /* Deprecated ? */ + { + return (int) getFloatStringWidth ( str ) ; + } void drawString ( const char *str, int x, int y ) ; } ; |