plib-cvs Mailing List for PLIB (Page 15)
Brought to you by:
sjbaker
You can subscribe to this list here.
2002 |
Jan
(25) |
Feb
(10) |
Mar
(60) |
Apr
(49) |
May
(54) |
Jun
(94) |
Jul
(82) |
Aug
(251) |
Sep
(366) |
Oct
(17) |
Nov
(20) |
Dec
(14) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(12) |
Feb
(8) |
Mar
(2) |
Apr
(4) |
May
(5) |
Jun
(8) |
Jul
(23) |
Aug
(8) |
Sep
(7) |
Oct
(5) |
Nov
(20) |
Dec
(20) |
2004 |
Jan
(19) |
Feb
(70) |
Mar
(108) |
Apr
(24) |
May
(6) |
Jun
(5) |
Jul
|
Aug
(8) |
Sep
(18) |
Oct
(27) |
Nov
|
Dec
(13) |
2005 |
Jan
(19) |
Feb
(13) |
Mar
(1) |
Apr
|
May
(10) |
Jun
(1) |
Jul
(10) |
Aug
(5) |
Sep
(2) |
Oct
(2) |
Nov
(6) |
Dec
(4) |
2006 |
Jan
(9) |
Feb
|
Mar
(3) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Steve B. <sj...@us...> - 2004-02-16 02:34:13
|
Update of /cvsroot/plib/plib/examples/src/pw In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20530/plib/examples/src/pw Added Files: Makefile.am pw_demo.cxx Log Message: Added the 'PW' library. Added some functionality to the ssgAux screen dump facility so you can dump to an array in memory as an alternative to dumping it straight to disk. --- NEW FILE: Makefile.am --- if BUILD_PW noinst_PROGRAMS = pw_demo pw_demo_SOURCES = pw_demo.cxx pw_demo_LDADD = -lplibpw -lplibul $(OGL_LIBS) endif EXTRA_DIST = pw_demo.dsp --- NEW FILE: pw_demo.cxx --- #include <stdio.h> #include <stdlib.h> #include <ctype.h> #include <GL/gl.h> #include <plib/ul.h> #include <plib/pw.h> void exFunc () { fprintf ( stderr, "Exiting.\n" ) ; pwCleanup () ; exit ( 0 ) ; } void rsFunc ( int w, int h ) { fprintf ( stderr, "Resized to %d x %d\n", w, h ) ; } void mpFunc ( int x, int y ) { fprintf ( stderr, "Mouse is at (%4dx%4d)\r", x, y ) ; } void msFunc ( int button, int updn, int x, int y ) { fprintf ( stderr, "Mouse button %d dirn %d at (%4dx%4d)\n", button, updn, x, y ) ; } void kbFunc ( int key, int updn, int x, int y ) { fprintf ( stderr, "Keyboard key %d dirn %d at (%4dx%4d)\n", key, updn, x, y ) ; if ( key == 0x1B ) /* ESC */ { pwCleanup () ; exit ( 0 ) ; } } int main ( int, char ** ) { pwInit ( 100, 100, 640, 480, false, "PLIB Window Demo", true, 0, kbFunc, msFunc, mpFunc, rsFunc, exFunc ) ; while ( 1 ) { glClearColor ( 0.5, 0.1, 0.1, 1.0 ) ; glClear ( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT ) ; pwSwapBuffers () ; } } |
From: Steve B. <sj...@us...> - 2004-02-16 02:34:12
|
Update of /cvsroot/plib/plib/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20530/plib/src Modified Files: Makefile.am Log Message: Added the 'PW' library. Added some functionality to the ssgAux screen dump facility so you can dump to an array in memory as an alternative to dumping it straight to disk. Index: Makefile.am =================================================================== RCS file: /cvsroot/plib/plib/src/Makefile.am,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- Makefile.am 5 Sep 2002 06:14:57 -0000 1.6 +++ Makefile.am 16 Feb 2004 02:26:27 -0000 1.7 @@ -1 +1 @@ -SUBDIRS = util js sl pui sg ssg fnt ssgAux net psl +SUBDIRS = util js sl pui sg ssg fnt ssgAux net psl pw |
From: Steve B. <sj...@us...> - 2004-02-16 01:25:46
|
Update of /cvsroot/plib/plib/doc/pw In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9552/pw Log Message: Directory /cvsroot/plib/plib/doc/pw added to the repository |
From: Steve B. <sj...@us...> - 2004-02-16 01:25:01
|
Update of /cvsroot/plib/plib/src/pw In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9377/pw Log Message: Directory /cvsroot/plib/plib/src/pw added to the repository |
From: Steve B. <sj...@us...> - 2004-02-16 01:16:17
|
Update of /cvsroot/plib/plib/examples/src/pw In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7848/pw Log Message: Directory /cvsroot/plib/plib/examples/src/pw added to the repository |
From: M?rten Str?m. <str...@us...> - 2004-02-15 19:58:55
|
Update of /cvsroot/plib/plib/src/fnt In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8816 Modified Files: Makefile.am fnt.dsp fnt.h Added Files: fntBitmap.cxx Log Message: Added freeglut bitmap fonts. --- NEW FILE: fntBitmap.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 [...975 lines suppressed...] static fntBitmapFont fntHelvetica12 ARGS( fgFontHelvetica12 ); static fntBitmapFont fntHelvetica18 ARGS( fgFontHelvetica18 ); static fntBitmapFont fntTimesRoman10 ARGS( fgFontTimesRoman10 ); static fntBitmapFont fntTimesRoman24 ARGS( fgFontTimesRoman24 ); fntBitmapFont *fntGetBitmapFont(int id) { fntBitmapFont *fnt = NULL; switch (id) { case FNT_BITMAP_8_BY_13: fnt = &fntFixed8x13; break; case FNT_BITMAP_9_BY_15: fnt = &fntFixed9x15; break; case FNT_BITMAP_HELVETICA_10: fnt = &fntHelvetica10; break; case FNT_BITMAP_HELVETICA_12: fnt = &fntHelvetica12; break; case FNT_BITMAP_HELVETICA_18: fnt = &fntHelvetica18; break; case FNT_BITMAP_TIMES_ROMAN_10: fnt = &fntTimesRoman10; break; case FNT_BITMAP_TIMES_ROMAN_24: fnt = &fntTimesRoman24; break; } return fnt; } Index: Makefile.am =================================================================== RCS file: /cvsroot/plib/plib/src/fnt/Makefile.am,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- Makefile.am 31 Aug 2002 22:21:20 -0000 1.9 +++ Makefile.am 15 Feb 2004 19:51:23 -0000 1.10 @@ -4,7 +4,7 @@ include_HEADERS = fnt.h -libplibfnt_a_SOURCES = fnt.cxx fntTXF.cxx fntLocal.h +libplibfnt_a_SOURCES = fnt.cxx fntTXF.cxx fntLocal.h fntBitmap.cxx INCLUDES = -I$(top_srcdir)/src/sg -I$(top_srcdir)/src/util Index: fnt.dsp =================================================================== RCS file: /cvsroot/plib/plib/src/fnt/fnt.dsp,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- fnt.dsp 17 Dec 2001 22:41:07 -0000 1.11 +++ fnt.dsp 15 Feb 2004 19:51:23 -0000 1.12 @@ -108,5 +108,9 @@ SOURCE=.\fntTXF.cxx # End Source File +# Begin Source File + +SOURCE=.\fntBitmap.cxx +# End Source File # End Target # End Project Index: fnt.h =================================================================== RCS file: /cvsroot/plib/plib/src/fnt/fnt.h,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- fnt.h 30 Nov 2002 00:41:49 -0000 1.14 +++ fnt.h 15 Feb 2004 19:51:23 -0000 1.15 @@ -214,7 +214,7 @@ vtx_left, vtx_right, vtx_bot, vtx_top ) ; } - int hasGlyph ( char c ) const { return exists[ c ] ; } + int hasGlyph ( char c ) const { return exists[ (GLubyte) c ] ; } void getBBox ( const char *s, float pointsize, float italic, float *left, float *right, @@ -244,6 +244,69 @@ } ; + +class fntBitmapFont : public fntFont +{ + protected: + + const GLubyte **data; + int first; + int count; + int height; + float xorig, yorig; + int fix; + float wid, gap; + + public: + + // data is a null-terminated list of glyph images: + // data[i][0] - image width + // data[i][1..n] - packed bitmap + + fntBitmapFont ( const GLubyte **data, int first, int height, + float xorig, float yorig ) ; + + virtual ~fntBitmapFont () ; + + virtual void getBBox ( const char *s, float pointsize, float italic, + float *left, float *right, + float *bot , float *top ) ; + + virtual void putch ( sgVec3 curpos, float pointsize, float italic, char c ) ; + virtual void puts ( sgVec3 curpos, float pointsize, float italic, const char *s ) ; + + virtual void begin () ; + virtual void end () ; + + virtual int load ( const char *fname, GLenum mag, GLenum min ) { return -1; } + + virtual void setFixedPitch ( int f ) { fix = f; } + virtual int isFixedPitch () const { return fix; } + + virtual void setWidth ( float w ) { wid = w; } + virtual void setGap ( float g ) { gap = g; } + + virtual float getWidth () const { return wid; } + virtual float getGap () const { return gap; } + + virtual int hasGlyph ( char c ) const ; +}; + + +/* Builtin Bitmap Fonts */ + +#define FNT_BITMAP_8_BY_13 0 +#define FNT_BITMAP_9_BY_15 1 +#define FNT_BITMAP_HELVETICA_10 2 +#define FNT_BITMAP_HELVETICA_12 3 +#define FNT_BITMAP_HELVETICA_18 4 +#define FNT_BITMAP_TIMES_ROMAN_10 5 +#define FNT_BITMAP_TIMES_ROMAN_24 6 + +fntBitmapFont *fntGetBitmapFont(int id); + + + class fntRenderer { fntFont *font ; |
From: M?rten Str?m. <str...@us...> - 2004-02-10 14:10:39
|
Update of /cvsroot/plib/plib/src/ssg In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22301/ssg Modified Files: ssg.dsp Log Message: Fixed weird line feeds in dsp files. Index: ssg.dsp =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssg.dsp,v retrieving revision 1.47 retrieving revision 1.48 diff -u -d -r1.47 -r1.48 --- ssg.dsp 16 Jan 2004 23:16:22 -0000 1.47 +++ ssg.dsp 10 Feb 2004 14:07:15 -0000 1.48 @@ -1,448 +1,448 @@ -# Microsoft Developer Studio Project File - Name="ssg" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Static Library" 0x0104 - -CFG=ssg - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "ssg.mak". [...865 lines suppressed...] +SOURCE=.\ssgVertSplitter.cxx +# End Source File +# Begin Source File + +SOURCE=.\ssgVertSplitter.h +# End Source File +# Begin Source File + +SOURCE=.\ssgVTable.cxx +# End Source File +# Begin Source File + +SOURCE=.\ssgVtxArray.cxx +# End Source File +# Begin Source File + +SOURCE=.\ssgVtxTable.cxx +# End Source File +# End Target +# End Project |
From: M?rten Str?m. <str...@us...> - 2004-02-10 14:10:38
|
Update of /cvsroot/plib/plib/src/js In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22301/js Modified Files: js.dsp Log Message: Fixed weird line feeds in dsp files. Index: js.dsp =================================================================== RCS file: /cvsroot/plib/plib/src/js/js.dsp,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- js.dsp 18 May 2003 13:49:33 -0000 1.17 +++ js.dsp 10 Feb 2004 14:07:15 -0000 1.18 @@ -1,128 +1,128 @@ -# Microsoft Developer Studio Project File - Name="js" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Static Library" 0x0104 - -CFG=js - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "js.mak". [...225 lines suppressed...] +SOURCE=.\jsLinux.cxx +# End Source File +# Begin Source File + +SOURCE=.\jsMacOS.cxx +# End Source File +# Begin Source File + +SOURCE=.\jsMacOSX.cxx +# End Source File +# Begin Source File + +SOURCE=.\jsNone.cxx +# End Source File +# Begin Source File + +SOURCE=.\jsWindows.cxx +# End Source File +# End Target +# End Project |
From: M?rten Str?m. <str...@us...> - 2004-02-08 18:44:21
|
Update of /cvsroot/plib/plib/src/sl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12659 Modified Files: slSample.cxx Log Message: Fixed bug in slSample::changeRate. Index: slSample.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/sl/slSample.cxx,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- slSample.cxx 2 Sep 2002 06:05:47 -0000 1.9 +++ slSample.cxx 8 Feb 2004 18:41:15 -0000 1.10 @@ -50,13 +50,15 @@ { if ( r == rate ) return ; - int length1 = length / (getBps ()/8) ; - int length2 = (int) ( (float) length1 * ( (float) r / (float) rate ) ) ; + int length2 = (int) ( (float) length * ( (float) r / (float) rate ) ) ; Uchar *buffer2 = new Uchar [ length2 ] ; - float step = (float) length1 / (float) length2 ; + int samps = length / (getBps() / 8) ; + int samps2 = length2 / (getBps() / 8) ; - for ( int i = 0 ; i < length2 / (getBps()/8); i++ ) + float step = (float) length / (float) length2 ; + + for ( int i = 0 ; i < samps2 ; i++ ) { float pos = (float) i * step ; @@ -72,11 +74,11 @@ float ratio = pos - (float) p1 ; float b1 = (getBps()==8) ? - (float) buffer [(p1<0)?0:(p1>=length1)?length1-1:p1] : - (float) ((Ushort*)buffer)[(p1<0)?0:(p1>=length1)?length1-1:p1] ; + (float) buffer [(p1<0)?0:(p1>=samps)?samps-1:p1] : + (float) ((Ushort*)buffer)[(p1<0)?0:(p1>=samps)?samps-1:p1] ; float b2 = (getBps()==8) ? - (float) buffer [(p2<0)?0:(p2>=length1)?length1-1:p2] : - (float) ((Ushort*)buffer)[(p2<0)?0:(p2>=length1)?length1-1:p2] ; + (float) buffer [(p2<0)?0:(p2>=samps)?samps-1:p2] : + (float) ((Ushort*)buffer)[(p2<0)?0:(p2>=samps)?samps-1:p2] ; float res = b1 * (1.0f-ratio) + b2 * ratio ; |
From: Wolfram K. <wol...@us...> - 2004-02-05 15:26:39
|
Update of /cvsroot/plib/plib/src/ssg In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6390/ssg Modified Files: ssg.h Log Message: Implemented textureMe. Needed for PPE. Index: ssg.h =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssg.h,v retrieving revision 1.168 retrieving revision 1.169 diff -u -d -r1.168 -r1.169 --- ssg.h 2 Feb 2004 01:35:15 -0000 1.168 +++ ssg.h 5 Feb 2004 15:24:06 -0000 1.169 @@ -1427,7 +1427,15 @@ ssgTexCoordArray *tl, ssgColourArray *cl ) ; - virtual void drawHighlight ( sgVec4 colour ) ; + void textureMe(float uP, float vP) + { texcoords = new ssgTexCoordArray; + for(int i=vertices->getNum()-1; i>=0; i--) + { sgVec2 v; + v[0] = uP; v[1] = vP; + texcoords->add(v); + } + } + virtual void drawHighlight ( sgVec4 colour ) ; virtual void drawHighlight ( sgVec4 colour, int i ) ; virtual void pick ( int baseName ) ; virtual void transform ( const sgMat4 m ) ; |
From: Steve B. <sj...@us...> - 2004-02-02 01:37:14
|
Update of /cvsroot/plib/plib/src/ssg In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12104/plib/src/ssg Modified Files: Makefile.am ssg.h ssgLocal.h ssgVTable.cxx ssgVtxArray.cxx ssgVtxTable.cxx Added Files: ssgStatistics.cxx Log Message: Added ssgStatistics. Fixed bug in sgIsect.cxx that could cause div0 error. --- NEW FILE: ssgStatistics.cxx --- #include "ssgLocal.h" ssgStatistics _ssgCurrStatistics ; void ssgStatistics::reset () { vertex_count = leaf_count = 0 ; } ssgStatistics *ssgGetLatestStatistics () { return & _ssgCurrStatistics ; } Index: Makefile.am =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/Makefile.am,v retrieving revision 1.44 retrieving revision 1.45 diff -u -d -r1.44 -r1.45 --- Makefile.am 12 Jan 2004 23:57:41 -0000 1.44 +++ Makefile.am 2 Feb 2004 01:35:15 -0000 1.45 @@ -26,7 +26,7 @@ ssgLoadMDL.h ssgSave3ds.cxx ssgAxisTransform.cxx ssgLoadATG.cxx \ ssgSaveFLT.cxx ssgSaveATG.cxx ssgLoadIV.cxx ssgLoad.cxx ssgLoadVRML.h \ ssgLoadMDL_BGLTexture.cxx ssgLoadXPlaneObj.cxx ssgSaveASC.cxx \ - ssgVertSplitter.h ssgVertSplitter.cxx + ssgVertSplitter.h ssgVertSplitter.cxx ssgStatistics.cxx INCLUDES = -I$(top_srcdir)/src/sg -I$(top_srcdir)/src/util Index: ssg.h =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssg.h,v retrieving revision 1.167 retrieving revision 1.168 diff -u -d -r1.167 -r1.168 --- ssg.h 25 Jan 2004 16:52:19 -0000 1.167 +++ ssg.h 2 Feb 2004 01:35:15 -0000 1.168 @@ -2783,6 +2783,28 @@ bool ssgConvertTexture( char * fname_output, char * fname_input ) ; +class ssgStatistics +{ + int vertex_count ; + int leaf_count ; + +public: + + void reset () ; + + void bumpVertexCount ( int i ) { vertex_count += i ; } + void bumpLeafCount ( int i ) { leaf_count += i ; } + + int getVertexCount () { return vertex_count ; } + int getLeafCount () { return leaf_count ; } + + ssgStatistics () + { + reset () ; + } +} ; + +ssgStatistics *ssgGetLatestStatistics () ; /* scene walkers */ Index: ssgLocal.h =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgLocal.h,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- ssgLocal.h 4 Nov 2002 05:11:22 -0000 1.22 +++ ssgLocal.h 2 Feb 2004 01:35:15 -0000 1.23 @@ -128,3 +128,7 @@ */ int _ssgSaveObject ( FILE * , ssgBase * ) ; int _ssgLoadObject ( FILE * , ssgBase ** , int type_mask = 0 ) ; + +extern ssgStatistics _ssgCurrStatistics ; + + Index: ssgVTable.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgVTable.cxx,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- ssgVTable.cxx 14 Dec 2003 14:49:36 -0000 1.19 +++ ssgVTable.cxx 2 Feb 2004 01:35:15 -0000 1.20 @@ -370,6 +370,9 @@ void ssgVTable::draw_geometry () { + _ssgCurrStatistics . bumpVertexCount ( num_vertices ) ; + _ssgCurrStatistics . bumpLeafCount ( 1 ) ; + if ( indexed ) { glBegin ( gltype ) ; Index: ssgVtxArray.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgVtxArray.cxx,v retrieving revision 1.26 retrieving revision 1.27 diff -u -d -r1.26 -r1.27 --- ssgVtxArray.cxx 29 Jan 2004 21:28:41 -0000 1.26 +++ ssgVtxArray.cxx 2 Feb 2004 01:35:15 -0000 1.27 @@ -186,79 +186,79 @@ // 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; - } [...254 lines suppressed...] return ; @@ -407,14 +396,13 @@ void ssgVtxArray::print ( FILE *fd, char *indent, int how_much ) { - char in [ 100 ] ; + char in [ 100 ] ; - if ( how_much == 0 ) - return; // dont print anything + if ( how_much == 0 ) + return; // dont print anything sprintf ( in, "%s ", indent ); - - // wk: Why were these 2 lines commented out?: + ssgVtxTable::print ( fd, indent, how_much ) ; indices -> print ( fd, in, how_much ) ; } Index: ssgVtxTable.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgVtxTable.cxx,v retrieving revision 1.33 retrieving revision 1.34 diff -u -d -r1.33 -r1.34 --- ssgVtxTable.cxx 14 Dec 2003 14:52:01 -0000 1.33 +++ ssgVtxTable.cxx 2 Feb 2004 01:35:15 -0000 1.34 @@ -625,6 +625,9 @@ glEnableClientState ( GL_VERTEX_ARRAY ) ; glVertexPointer ( 3, GL_FLOAT, 0, vertices->get(0) ) ; + _ssgCurrStatistics . bumpVertexCount ( num_vertices ) ; + _ssgCurrStatistics . bumpLeafCount ( 1 ) ; + glDrawArrays ( gltype, 0, num_vertices ) ; glPopClientAttrib () ; |
From: Steve B. <sj...@us...> - 2004-02-02 01:37:13
|
Update of /cvsroot/plib/plib/src/sg In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12104/plib/src/sg Modified Files: sg.h sgIsect.cxx Log Message: Added ssgStatistics. Fixed bug in sgIsect.cxx that could cause div0 error. Index: sg.h =================================================================== RCS file: /cvsroot/plib/plib/src/sg/sg.h,v retrieving revision 1.56 retrieving revision 1.57 diff -u -d -r1.56 -r1.57 --- sg.h 21 Jan 2004 22:33:46 -0000 1.56 +++ sg.h 2 Feb 2004 01:35:15 -0000 1.57 @@ -1382,8 +1382,14 @@ SGfloat sgIsectLinesegPlane ( sgVec3 dst, sgVec3 v1, sgVec3 v2, sgVec4 plane ) ; -bool sgPointInTriangle ( sgVec3 point, sgVec3 tri[3] ); +bool sgPointInTriangle3 ( sgVec3 point, sgVec3 tri[3] ) ; +bool sgPointInTriangle2 ( sgVec2 point, sgVec2 tri[3] ) ; + +inline bool sgPointInTriangle ( sgVec3 point, sgVec3 tri[3] ) +{ + return sgPointInTriangle3 ( point, tri ) ; +} Index: sgIsect.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/sg/sgIsect.cxx,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- sgIsect.cxx 2 Sep 2002 06:05:46 -0000 1.7 +++ sgIsect.cxx 2 Feb 2004 01:35:15 -0000 1.8 @@ -226,129 +226,165 @@ // return the sign of a value -static inline const int SG_SIGN( const SGfloat x ) { - return x < 0 ? -1 : 1; + +static inline const int SG_SIGN( const SGfloat x ) +{ + return x < 0 ? -1 : 1; } [...234 lines suppressed...] + + sgMake2DLine ( le, a, b ) ; + + if ( SG_SIGN ( le[0]*c[0] + le[1]*c[1] + le[2] ) != + SG_SIGN ( le[0]*point[0] + le[1]*point[1] + le[2] ) ) return false ; + + sgMake2DLine ( le, b, c ) ; + + if ( SG_SIGN ( le[0]*a[0] + le[1]*a[1] + le[2] ) != + SG_SIGN ( le[0]*point[0] + le[1]*point[1] + le[2] ) ) return false ; + + sgMake2DLine ( le, c, a ) ; + + if ( SG_SIGN ( le[0]*b[0] + le[1]*b[1] + le[2] ) != + SG_SIGN ( le[0]*point[0] + le[1]*point[1] + le[2] ) ) return false ; + + return true ; +} + + |
From: Steve B. <sj...@us...> - 2004-02-02 01:37:13
|
Update of /cvsroot/plib/plib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12104/plib Modified Files: configure.in Log Message: Added ssgStatistics. Fixed bug in sgIsect.cxx that could cause div0 error. Index: configure.in =================================================================== RCS file: /cvsroot/plib/plib/configure.in,v retrieving revision 1.52 retrieving revision 1.53 diff -u -d -r1.52 -r1.53 --- configure.in 22 May 2003 11:27:17 -0000 1.52 +++ configure.in 2 Feb 2004 01:35:15 -0000 1.53 @@ -28,7 +28,6 @@ AC_PROG_INSTALL AC_PROG_RANLIB - dnl Command line arguments dnl Don't use AC_HELP_STRING here as old versions of autoconf do not |
From: Steve B. <sj...@us...> - 2004-02-02 01:37:13
|
Update of /cvsroot/plib/plib/src/psl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12104/plib/src/psl Modified Files: psl.h Log Message: Added ssgStatistics. Fixed bug in sgIsect.cxx that could cause div0 error. Index: psl.h =================================================================== RCS file: /cvsroot/plib/plib/src/psl/psl.h,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- psl.h 6 Jan 2003 05:10:13 -0000 1.25 +++ psl.h 2 Feb 2004 01:35:15 -0000 1.26 @@ -179,7 +179,10 @@ case PSL_INT : i = (int) strtol ( v, NULL, 0 ) ; return ; case PSL_FLOAT : f = (float) atof ( v ) ; return ; case PSL_STRING : delete [] s ; - s = ulStrDup ( v ) ; + if ( v == NULL ) + s = ulStrDup ( "" ) ; + else + s = ulStrDup ( v ) ; return ; case PSL_VOID : return ; } @@ -252,7 +255,10 @@ virtual void set ( int v ) { t = PSL_INT ; i = v ; } virtual void set ( float v ) { t = PSL_FLOAT ; f = v ; } virtual void set ( const char *v ) { t = PSL_STRING ; - delete [] s ; + delete [] s ; + if ( v == NULL ) + s = ulStrDup ( "" ) ; + else s = ulStrDup ( v ) ; } virtual void set ( const pslNumber *v ) |
From: Wolfram K. <wol...@us...> - 2004-01-30 06:51:43
|
Update of /cvsroot/plib/plib/src/ssg In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9548 Modified Files: ssgVtxArray.cxx Log Message: Fixed bug in ref-counts after call to removeUnusedVertices Index: ssgVtxArray.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgVtxArray.cxx,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- ssgVtxArray.cxx 2 Sep 2002 06:05:49 -0000 1.25 +++ ssgVtxArray.cxx 29 Jan 2004 21:28:41 -0000 1.26 @@ -205,7 +205,8 @@ doColours = TRUE; long * oldIndex2NewIndex = new long[vertices->getNum()]; - int i, oldIndex, newIndex; + int i; + short oldIndex, newIndex; for(i=0;i<vertices->getNum();i++) oldIndex2NewIndex[i]=-1; // marker for "not used" @@ -224,7 +225,7 @@ for(i=0; i<indices->getNum(); i++) { oldIndex = *indices->get(i); if (oldIndex2NewIndex[ oldIndex ] != -1) - indices->set((short)oldIndex2NewIndex[ oldIndex ], i); + indices->set(static_cast<short>(oldIndex2NewIndex[ oldIndex ]), i); else { newIndex = newVL->getNum(); indices->set(newIndex , i); @@ -238,20 +239,25 @@ newCL->add(colours->get(oldIndex)); } } - vertices->deRef(); + vertices->deRef(); //ssgDeRefDelete(vertices); vertices = newVL; + newVL->ref(); if(doNormals) - { normals->deRef(); + { normals->deRef(); //ssgDeRefDelete(normals); normals = newNL; + newNL->ref(); + } if (doTexCoords) - { texcoords->deRef(); + { texcoords->deRef(); //ssgDeRefDelete(texcoords); texcoords = newTL; + newTL->ref(); } if (doColours) - { colours->deRef(); + { colours->deRef(); //ssgDeRefDelete(colours); colours = newCL; + newCL->ref(); } } |
From: Wolfram K. <wol...@us...> - 2004-01-25 16:53:03
|
Update of /cvsroot/plib/plib/src/ssg In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2174 Modified Files: ssg.h Log Message: Fixed bug: "ssgIndexArray::clone" was missing Index: ssg.h =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssg.h,v retrieving revision 1.166 retrieving revision 1.167 diff -u -d -r1.166 -r1.167 --- ssg.h 13 Dec 2003 21:22:42 -0000 1.166 +++ ssg.h 25 Jan 2004 16:52:19 -0000 1.167 @@ -564,6 +564,7 @@ { public: + virtual ssgBase *clone ( int clone_flags = 0 ) ; ssgIndexArray ( int init = 3, short* things = 0 ) : ssgSimpleList ( sizeof(short), init, (char*)things ) { |
From: Wolfram K. <wol...@us...> - 2004-01-25 16:51:01
|
Update of /cvsroot/plib/plib/src/ssg In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1129 Modified Files: ssgSimpleList.cxx Log Message: Fixed bug: "ssgIndexArray::clone" was missing Index: ssgSimpleList.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgSimpleList.cxx,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- ssgSimpleList.cxx 2 Sep 2002 06:05:48 -0000 1.13 +++ ssgSimpleList.cxx 25 Jan 2004 16:50:04 -0000 1.14 @@ -71,6 +71,13 @@ return b ; } +ssgBase *ssgIndexArray::clone ( int clone_flags ) +{ + ssgIndexArray *b = new ssgIndexArray () ; + b -> copy_from ( this, clone_flags ) ; + return b ; +} + |
From: Wolfram K. <wol...@us...> - 2004-01-24 18:28:01
|
Update of /cvsroot/plib/plib/src/ssg In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12751/ssg Modified Files: ssgLoad.cxx Log Message: Initialising number of LoDs. Index: ssgLoad.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgLoad.cxx,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- ssgLoad.cxx 15 Sep 2002 01:29:11 -0000 1.25 +++ ssgLoad.cxx 24 Jan 2004 18:25:45 -0000 1.26 @@ -214,6 +214,9 @@ return NULL ; } +extern int g_noLoDs; + g_noLoDs = 1; + _ssgModelFormat *f = formats ; for ( int i=0; i<num_formats; i++, f++ ) { |
From: Wolfram K. <wol...@us...> - 2004-01-24 18:23:32
|
Update of /cvsroot/plib/plib/src/ssg In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12288/ssg Modified Files: ssgLoadPCX.cxx Log Message: Fixing a bug that cancelled the bug in pcx.h Index: ssgLoadPCX.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgLoadPCX.cxx,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- ssgLoadPCX.cxx 12 Dec 2003 17:23:51 -0000 1.1 +++ ssgLoadPCX.cxx 24 Jan 2004 18:21:55 -0000 1.2 @@ -95,9 +95,12 @@ "ssgLoadTexture: '%s' - unsupported or broken PCX texture file", fname ) ; return false ; } - + if(*buffer++ != 12) + { ulSetError ( UL_WARNING, "ssgLoadTexture: '%s' - PCX files needs a '12' byte", fname ) ; + return false ; + } assert(bufferorig + file_length - 768 == buffer); - // starting at "buffer", you can find the palette, 256 ebntrys with 3 bytes each + // starting at "buffer", you can find the palette, 256 entrys with 3 bytes each // only true for version 5 (and possible later versions)= UByte *texels = new UByte [size * 4]; // 4 bytes per texel |
From: Wolfram K. <wol...@us...> - 2004-01-24 17:27:59
|
Update of /cvsroot/plib/plib/src/ssg In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4995 Modified Files: pcx.h Log Message: Fixing a major bug that meant it read a pixel too many. Index: pcx.h =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/pcx.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- pcx.h 12 Dec 2003 17:23:51 -0000 1.1 +++ pcx.h 24 Jan 2004 17:26:08 -0000 1.2 @@ -55,13 +55,13 @@ UByte color = READ_BYTE; if ((color &0xC0) != 0xC0) // uncompressed? { + *pBody++ = color; + x++; if (x >= width) { x=0; y++; // next line if(y > ppcxHeader->ymax-ppcxHeader->y) break; } - *pBody++ = color; - x++; } else { @@ -69,16 +69,17 @@ color = READ_BYTE; for (counter=0; counter<length; counter++) { + *pBody++ = color; + x++; if (x >= width) { x=0; y++; // next line + counter=length; if(y > ppcxHeader->ymax-ppcxHeader->y) - break; + break; // breaks for (counter=0; counte... } - x++; - *pBody++ = color; } if(y > ppcxHeader->ymax-ppcxHeader->y) - break; + break; // breaks for(;;) } } return TRUE; |
From: Eric L. <smo...@us...> - 2004-01-21 22:33:49
|
Update of /cvsroot/plib/plib/src/ssgAux In directory sc8-pr-cvs1:/tmp/cvs-serv4204/src/ssgAux Modified Files: ssgaBillboards.cxx Log Message: Added sgHypot(SGfloat,SGfloat) to sg.h. Replaced some instances of fabsf/hypotf with sgAbs/sgHypot. Removed a MAC_OSX compatibility patch which is no longer needed. Index: ssgaBillboards.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssgAux/ssgaBillboards.cxx,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- ssgaBillboards.cxx 21 Jan 2004 16:30:20 -0000 1.2 +++ ssgaBillboards.cxx 21 Jan 2004 22:33:46 -0000 1.3 @@ -25,12 +25,6 @@ #include "ssgaBillboards.h" -#ifdef UL_MAC_OSX -#define fabsf(x) ((x) < 0 ? -(x) : (x)) -#define hypotf(x, y) sqrtf((x)*(x) + (y)*(y)) -#endif - - int ssgaBillboards::total_drawn = 0; @@ -254,7 +248,7 @@ wx = z_axis[1]; wy = -z_axis[0]; - len = hypotf(wx, wy); + len = sgHypot(wx, wy); if (len > 1e-6f) { @@ -359,7 +353,7 @@ // pick any orientation sgVec3 xy, axis = { 0, 0, 0 }; - axis[ fabsf(up[0]) > fabsf(up[1]) ] = 1; + axis[ sgAbs(up[0]) > sgAbs(up[1]) ] = 1; sgVectorProductVec3(xy, up, axis); sgNormaliseVec3(xy); |
From: Eric L. <smo...@us...> - 2004-01-21 22:33:49
|
Update of /cvsroot/plib/plib/src/sg In directory sc8-pr-cvs1:/tmp/cvs-serv4204/src/sg Modified Files: sg.h Log Message: Added sgHypot(SGfloat,SGfloat) to sg.h. Replaced some instances of fabsf/hypotf with sgAbs/sgHypot. Removed a MAC_OSX compatibility patch which is no longer needed. Index: sg.h =================================================================== RCS file: /cvsroot/plib/plib/src/sg/sg.h,v retrieving revision 1.55 retrieving revision 1.56 diff -u -d -r1.55 -r1.56 --- sg.h 30 Nov 2003 21:23:48 -0000 1.55 +++ sg.h 21 Jan 2004 22:33:46 -0000 1.56 @@ -64,6 +64,8 @@ inline SGfloat sgSqrt ( const SGfloat x ) { return (SGfloat) sqrt ( x ) ; } inline SGfloat sgSquare ( const SGfloat x ) { return x * x ; } inline SGfloat sgAbs ( const SGfloat a ) { return (a<SG_ZERO) ? -a : a ; } +inline SGfloat sgHypot ( const SGfloat x, const SGfloat y ) { return sgSqrt( sgSquare(x) + sgSquare(y) ); } + /* Type-casted sin/cos/tan/asin/acos/atan2 ANGLES IN DEGREES |
From: M?rten Str?m. <str...@us...> - 2004-01-21 16:30:24
|
Update of /cvsroot/plib/plib/src/ssgAux In directory sc8-pr-cvs1:/tmp/cvs-serv15870 Modified Files: ssgaBillboards.cxx ssgaBillboards.h Log Message: fabsf and hypotf missing on Mac systems. Index: ssgaBillboards.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssgAux/ssgaBillboards.cxx,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- ssgaBillboards.cxx 30 Nov 2003 20:29:05 -0000 1.1 +++ ssgaBillboards.cxx 21 Jan 2004 16:30:20 -0000 1.2 @@ -21,12 +21,19 @@ $Id$ */ -// $Id$ - #include "ssgaBillboards.h" +#ifdef UL_MAC_OSX +#define fabsf(x) ((x) < 0 ? -(x) : (x)) +#define hypotf(x, y) sqrtf((x)*(x) + (y)*(y)) +#endif + + +int ssgaBillboards::total_drawn = 0; + + inline float max3f(const float v[3]) { float tmp = v[0] >= v[1] ? v[0] : v[1]; @@ -34,9 +41,6 @@ } -int ssgaBillboards::total_drawn = 0; - - inline double random_value() { #ifdef UL_WIN32 @@ -93,7 +97,7 @@ sgSphere sph; sgCopyVec3(sph.center, get(i)); float s = get(i)[3]; - sph.radius = s * width; + sph.radius = 0.5f * s * width; bsphere.extend(&sph); sgAddScaledVec3(sph.center, up, s * height); bsphere.extend(&sph); Index: ssgaBillboards.h =================================================================== RCS file: /cvsroot/plib/plib/src/ssgAux/ssgaBillboards.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- ssgaBillboards.h 30 Nov 2003 20:29:05 -0000 1.1 +++ ssgaBillboards.h 21 Jan 2004 16:30:20 -0000 1.2 @@ -21,8 +21,6 @@ $Id$ */ -// $Id - /* * ssgaBillboards * |
From: James J. <pu...@us...> - 2004-01-21 02:32:43
|
Update of /cvsroot/plib/plib/src/pui In directory sc8-pr-cvs1:/tmp/cvs-serv511 Modified Files: puFileSelector.cxx Log Message: Fixes some size and position problems with the "puFileSelector" widget (John Fay). Index: puFileSelector.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/pui/puFileSelector.cxx,v retrieving revision 1.33 retrieving revision 1.34 diff -u -d -r1.33 -r1.34 --- puFileSelector.cxx 30 Nov 2002 00:41:49 -0000 1.33 +++ puFileSelector.cxx 21 Jan 2004 02:32:40 -0000 1.34 @@ -273,23 +273,23 @@ // Resize and position the slider slider->setPosition ( w-30, 40+20*arrow_count ) ; - slider->setSize ( 20, h-70-40*arrow_count ) ; + slider->setSize ( 20, h-60-40*arrow_count ) ; // Position the arrow buttons if ( up_arrow ) { - up_arrow->setPosition ( w-30, h-30-20*arrow_count ) ; + up_arrow->setPosition ( w-30, h-20-20*arrow_count ) ; down_arrow->setPosition ( w-30, 20+20*arrow_count ) ; } if ( fastup_arrow ) { - fastup_arrow->setPosition ( w-30, h-50 ) ; + fastup_arrow->setPosition ( w-30, h-40 ) ; fastdown_arrow->setPosition ( w-30, 40 ) ; } // Resize the list box - list_box->setSize ( w-40, h-70 ) ; + list_box->setSize ( w-40, h-80 ) ; // Resoze and position the buttons cancel_button->setSize ( (w<170)?(w/2-15):70, 20 ) ; @@ -383,12 +383,12 @@ frame = new puFrame ( 0, 0, w, h ); - slider = new puSlider (w-30,40+20*arrows,h-70-40*arrows,TRUE,20); + slider = new puSlider (w-30,40+20*arrows,h-60-40*arrows,TRUE,20); slider->setValue(1.0f); slider->setSliderFraction (0.2f) ; slider->setCBMode( PUSLIDER_DELTA ); - list_box = new puListBox ( 10, 60, w-40, h-30 ) ; + list_box = new puListBox ( 10, 60, w-40, h-20 ) ; list_box -> setLabel ( title ); list_box -> setLabelPlace ( PUPLACE_TOP_LEFT ) ; list_box -> setStyle ( -PUSTYLE_SMALL_SHADED ) ; @@ -428,7 +428,7 @@ down_arrow->setUserData ( slider ) ; down_arrow->setCallback ( puFileSelectorHandleArrow ) ; - up_arrow = new puArrowButton ( w-30, h-30-20*arrows, w-10, h-10-20*arrows, PUARROW_UP ) ; + up_arrow = new puArrowButton ( w-30, h-20-20*arrows, w-10, h-20*arrows, PUARROW_UP ) ; up_arrow->setUserData ( slider ) ; up_arrow->setCallback ( puFileSelectorHandleArrow ) ; } @@ -439,7 +439,7 @@ fastdown_arrow->setUserData ( slider ) ; fastdown_arrow->setCallback ( puFileSelectorHandleArrow ) ; - fastup_arrow = new puArrowButton ( w-30, h-50, w-10, h-30, PUARROW_FASTUP ) ; + fastup_arrow = new puArrowButton ( w-30, h-40, w-10, h-20, PUARROW_FASTUP ) ; fastup_arrow->setUserData ( slider ) ; fastup_arrow->setCallback ( puFileSelectorHandleArrow ) ; } |
From: Eric L. <smo...@us...> - 2004-01-20 22:21:05
|
Update of /cvsroot/plib/plib/src/ssg In directory sc8-pr-cvs1:/tmp/cvs-serv18222 Modified Files: ssgOptimiser.cxx Log Message: When including other ssg files, better to use local version (double quotes) rather than system installed version (angle braces) which may be be outdated or even non-existent. Index: ssgOptimiser.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgOptimiser.cxx,v retrieving revision 1.33 retrieving revision 1.34 diff -u -d -r1.33 -r1.34 --- ssgOptimiser.cxx 12 Jan 2004 23:57:41 -0000 1.33 +++ ssgOptimiser.cxx 20 Jan 2004 22:21:02 -0000 1.34 @@ -24,7 +24,7 @@ #include "ssgLocal.h" -#include <ssgVertSplitter.h> +#include "ssgVertSplitter.h" static float optimise_vtol [3] = { |