plib-cvs Mailing List for PLIB (Page 47)
Brought to you by:
sjbaker
You can subscribe to this list here.
2002 |
Jan
(25) |
Feb
(10) |
Mar
(60) |
Apr
(49) |
May
(54) |
Jun
(94) |
Jul
(82) |
Aug
(251) |
Sep
(366) |
Oct
(17) |
Nov
(20) |
Dec
(14) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(12) |
Feb
(8) |
Mar
(2) |
Apr
(4) |
May
(5) |
Jun
(8) |
Jul
(23) |
Aug
(8) |
Sep
(7) |
Oct
(5) |
Nov
(20) |
Dec
(20) |
2004 |
Jan
(19) |
Feb
(70) |
Mar
(108) |
Apr
(24) |
May
(6) |
Jun
(5) |
Jul
|
Aug
(8) |
Sep
(18) |
Oct
(27) |
Nov
|
Dec
(13) |
2005 |
Jan
(19) |
Feb
(13) |
Mar
(1) |
Apr
|
May
(10) |
Jun
(1) |
Jul
(10) |
Aug
(5) |
Sep
(2) |
Oct
(2) |
Nov
(6) |
Dec
(4) |
2006 |
Jan
(9) |
Feb
|
Mar
(3) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Steve B. <sj...@us...> - 2002-08-05 23:10:07
|
Update of /cvsroot/plib/plib/src/ssgAux In directory usw-pr-cvs1:/tmp/cvs-serv31480/plib/src/ssgAux Modified Files: ssgaWaveSystem.cxx Log Message: Fixed edge effect. Index: ssgaWaveSystem.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssgAux/ssgaWaveSystem.cxx,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- ssgaWaveSystem.cxx 4 Aug 2002 23:45:31 -0000 1.2 +++ ssgaWaveSystem.cxx 5 Aug 2002 23:10:05 -0000 1.3 @@ -37,6 +37,7 @@ return ; int i; + for ( i = 0 ; i <= nstrips ; i++ ) { float fade_i = (i<2) ? 0.0f : (i<7) ? (float)(i-2)/5.0f : @@ -45,9 +46,9 @@ for ( int j = 0 ; j <= nstacks ; j++ ) { - float fade_j = (j<2) ? 0.0f : (j<7) ? (float)(j-2)/5.0f : - (j>nstacks-2) ? 0.0f : - (j>nstacks-7) ? (float)(nstacks-j-2)/5.0f : 1.0f ; + float fade_j = (j<2) ? 0.0f : (j<7) ? (float)(j-2)/5.0f : + (j>nstacks-2) ? 0.0f : + (j>nstacks-7) ? (float)(nstacks-j-2)/5.0f : 1.0f ; int idx = i * (nstrips+1) + j ; float x0 = orig_vertices [idx][0] + center[0] ; @@ -70,9 +71,9 @@ float phase = k * x0 - omega * t - lambda * dz ; sgSetVec3 ( vertices [idx], - x0 + waveHeight * (float) sin ( phase ), - y0, - z0 - waveHeight * (float) cos ( phase ) * edge_fade ) ; + x0 + waveHeight * (float) sin ( phase ) * edge_fade, + y0, + z0 - waveHeight * (float) cos ( phase ) * edge_fade ) ; sgSetVec2 ( texcoords [idx], tu * x0 / size[0], tv * y0 /size[1] ) ; } |
From: Sebastian U. <ud...@us...> - 2002-08-05 22:47:33
|
Update of /cvsroot/plib/plib/examples In directory usw-pr-cvs1:/tmp/cvs-serv24744/examples Modified Files: AUTHORS Log Message: SCNR Index: AUTHORS =================================================================== RCS file: /cvsroot/plib/plib/examples/AUTHORS,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- AUTHORS 30 Jun 2002 15:13:19 -0000 1.3 +++ AUTHORS 5 Aug 2002 22:47:30 -0000 1.4 @@ -12,7 +12,7 @@ Gil Carter Giancarlo Niccolai James Jones - John Fay + John Fay ("Mr. PUI") Juergen Marquardt Mark Vallevand Marten Stromberg |
From: Sebastian U. <ud...@us...> - 2002-08-05 22:47:33
|
Update of /cvsroot/plib/plib/tools In directory usw-pr-cvs1:/tmp/cvs-serv24744/tools Modified Files: AUTHORS Log Message: SCNR Index: AUTHORS =================================================================== RCS file: /cvsroot/plib/plib/tools/AUTHORS,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- AUTHORS 30 Jun 2002 15:13:19 -0000 1.3 +++ AUTHORS 5 Aug 2002 22:47:29 -0000 1.4 @@ -12,7 +12,7 @@ Gil Carter Giancarlo Niccolai James Jones - John Fay + John Fay ("Mr. PUI") Juergen Marquardt Mark Vallevand Marten Stromberg |
From: Sebastian U. <ud...@us...> - 2002-08-05 22:46:39
|
Update of /cvsroot/plib/plib In directory usw-pr-cvs1:/tmp/cvs-serv24468 Modified Files: AUTHORS Log Message: SCNR Index: AUTHORS =================================================================== RCS file: /cvsroot/plib/plib/AUTHORS,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- AUTHORS 30 Jun 2002 15:11:37 -0000 1.12 +++ AUTHORS 5 Aug 2002 22:46:35 -0000 1.13 @@ -12,7 +12,7 @@ Gil Carter Giancarlo Niccolai James Jones - John Fay + John Fay ("Mr. PUI") Juergen Marquardt Mark Vallevand Marten Stromberg |
From: Steve B. <sj...@us...> - 2002-08-04 23:45:34
|
Update of /cvsroot/plib/plib/src/ssgAux In directory usw-pr-cvs1:/tmp/cvs-serv21433/plib/src/ssgAux Modified Files: ssgaParticleSystem.cxx ssgaWaveSystem.cxx Log Message: Added some MSVC uglifications. Index: ssgaParticleSystem.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssgAux/ssgaParticleSystem.cxx,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- ssgaParticleSystem.cxx 11 Jun 2002 12:40:37 -0000 1.4 +++ ssgaParticleSystem.cxx 4 Aug 2002 23:45:31 -0000 1.5 @@ -53,7 +53,7 @@ for ( i = 0 ; i < initial_num ; i++ ) (*particle_create) ( this, i, & particle [ i ] ) ; - update ( 0.1 ) ; + update ( 0.1f ) ; } Index: ssgaWaveSystem.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssgAux/ssgaWaveSystem.cxx,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- ssgaWaveSystem.cxx 4 Aug 2002 05:53:44 -0000 1.1 +++ ssgaWaveSystem.cxx 4 Aug 2002 23:45:31 -0000 1.2 @@ -36,7 +36,8 @@ orig_vertices == NULL ) return ; - for ( int i = 0 ; i <= nstrips ; i++ ) + int i; + for ( i = 0 ; i <= nstrips ; i++ ) { float fade_i = (i<2) ? 0.0f : (i<7) ? (float)(i-2)/5.0f : (i>nstrips-2) ? 0.0f : @@ -59,25 +60,25 @@ float k ; [...67 lines suppressed...] colours = NULL ; @@ -203,7 +204,8 @@ vertices = new sgVec3 [ (nstacks+1) * (nstrips+1) ] ; orig_vertices = new sgVec3 [ (nstacks+1) * (nstrips+1) ] ; - for ( int i = 0 ; i <= nstrips ; i++ ) + int i; + for ( i = 0 ; i <= nstrips ; i++ ) for ( int j = 0 ; j <= nstacks ; j++ ) { int idx = i * (nstrips+1) + j ; @@ -224,7 +226,7 @@ sgCopyVec3 ( orig_vertices [ idx ], vertices [idx] ) ; } - for ( int i = 0 ; i < nstrips ; i++ ) + for ( i = 0 ; i < nstrips ; i++ ) { ssgVtxTable *vt = new ssgVtxTable ; ssgVertexArray *vv = new ssgVertexArray ( nstacks * 2 + 2 ) ; |
From: Steve B. <sj...@us...> - 2002-08-04 23:45:34
|
Update of /cvsroot/plib/plib/examples/src/ssg/water In directory usw-pr-cvs1:/tmp/cvs-serv21433/plib/examples/src/ssg/water Modified Files: water.cxx Log Message: Added some MSVC uglifications. Index: water.cxx =================================================================== RCS file: /cvsroot/plib/plib/examples/src/ssg/water/water.cxx,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- water.cxx 4 Aug 2002 22:58:48 -0000 1.3 +++ water.cxx 4 Aug 2002 23:45:31 -0000 1.4 @@ -278,7 +278,7 @@ ocean = new ssgaWaveSystem ( 10000 ) ; ocean -> setColour ( WHITE ) ; ocean -> setSize ( 50 ) ; - ocean -> setTexScale ( 6, 6 ) ; + ocean -> setTexScale ( 8, 8 ) ; ocean -> setCenter ( pos ) ; ocean -> setDepthCallback ( getDepth ) ; ocean -> setKidState ( sea_state ) ; |
From: Steve B. <sj...@us...> - 2002-08-04 22:58:52
|
Update of /cvsroot/plib/plib/examples/src/ssg/water/data In directory usw-pr-cvs1:/tmp/cvs-serv12437/plib/examples/src/ssg/water/data Added Files: pattern.rgb Removed Files: Penguin_beak.rgb Penguin_body.rgb pedestal.ac tuxedo.ac Log Message: Remove some unneeded files. --- NEW FILE: pattern.rgb --- (This appears to be a binary file; contents omitted.) --- Penguin_beak.rgb DELETED --- --- Penguin_body.rgb DELETED --- --- pedestal.ac DELETED --- --- tuxedo.ac DELETED --- |
From: Steve B. <sj...@us...> - 2002-08-04 22:58:52
|
Update of /cvsroot/plib/plib/examples/src/ssg/water In directory usw-pr-cvs1:/tmp/cvs-serv12437/plib/examples/src/ssg/water Modified Files: water.cxx Log Message: Remove some unneeded files. Index: water.cxx =================================================================== RCS file: /cvsroot/plib/plib/examples/src/ssg/water/water.cxx,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- water.cxx 4 Aug 2002 21:27:16 -0000 1.2 +++ water.cxx 4 Aug 2002 22:58:48 -0000 1.3 @@ -12,13 +12,18 @@ #include <plib/ssgAux.h> #include <GL/glut.h> -ssgRoot *scene = NULL ; -ssgTransform *penguin = NULL ; -ssgTransform *pedestal = NULL ; -ssgaWaveSystem *ocean = NULL ; -ssgSimpleState *sea_state = NULL ; +ssgRoot *scene = NULL ; +ssgTransform *teapot = NULL ; +ssgTransform *pedestal = NULL ; [...181 lines suppressed...] - scene -> addKid ( ocean ) ; - scene -> addKid ( pedestal ) ; - pedestal -> addKid ( penguin ) ; - penguin -> addKid ( fountain ) ; + teapot = new ssgTransform ; + teapot -> addKid ( tpt_obj ) ; + teapot -> addKid ( fountain ) ; + + pedestal = new ssgTransform ; + pedestal -> setTransform ( & pedpos ) ; + pedestal -> addKid ( ped_obj ) ; + + scene = new ssgRoot ; + scene -> addKid ( ocean ) ; + scene -> addKid ( pedestal ) ; + scene -> addKid ( teapot ) ; } |
From: Steve B. <sj...@us...> - 2002-08-04 21:27:20
|
Update of /cvsroot/plib/plib/examples/src/ssg/water In directory usw-pr-cvs1:/tmp/cvs-serv24902/plib/examples/src/ssg/water Modified Files: water.cxx Log Message: Added a particle system demo. Index: water.cxx =================================================================== RCS file: /cvsroot/plib/plib/examples/src/ssg/water/water.cxx,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- water.cxx 4 Aug 2002 06:01:04 -0000 1.1 +++ water.cxx 4 Aug 2002 21:27:16 -0000 1.2 @@ -12,18 +12,14 @@ #include <plib/ssgAux.h> #include <GL/glut.h> -ssgRoot *scene = NULL ; -ssgTransform *penguin = NULL ; -ssgTransform *pedestal = NULL ; -ssgaWaveSystem *ocean = NULL ; -//ssgaCube *ocean = NULL ; -ssgSimpleState *sea_state = NULL ; - +ssgRoot *scene = NULL ; [...114 lines suppressed...] sgVec4 SEABLUE = { 1.0, 1.0, 1.0, 1.0 } ; sgVec3 pos = { 0, 0, 0 } ; @@ -217,6 +255,8 @@ ocean -> setWindSpeed ( 10.0f ) ; ocean -> regenerate () ; + fountain -> setState ( splash_state ) ; + /* Load the models - optimise them a bit and then add them into the scene. @@ -236,6 +276,7 @@ scene -> addKid ( ocean ) ; scene -> addKid ( pedestal ) ; pedestal -> addKid ( penguin ) ; + penguin -> addKid ( fountain ) ; } |
From: Steve B. <sj...@us...> - 2002-08-04 21:27:20
|
Update of /cvsroot/plib/plib/examples/src/ssg/water/data In directory usw-pr-cvs1:/tmp/cvs-serv24902/plib/examples/src/ssg/water/data Added Files: droplet.rgb Log Message: Added a particle system demo. --- NEW FILE: droplet.rgb --- (This appears to be a binary file; contents omitted.) |
From: Steve B. <sj...@us...> - 2002-08-04 06:01:07
|
Update of /cvsroot/plib/plib/examples/src/ssg/water In directory usw-pr-cvs1:/tmp/cvs-serv2391/plib/examples/src/ssg/water Added Files: Makefile.am water.cxx water.dsp Log Message: Added water waves demo program. --- NEW FILE: Makefile.am --- noinst_PROGRAMS = water water_SOURCES = water.cxx water_LDADD = -lplibssgaux -lplibssg -lplibsg -lplibul $(GLUT_LIBS) $(OGL_LIBS) EXTRA_DIST = water.dsp --- NEW FILE: water.cxx --- #include <stdio.h> #include <stdlib.h> #include <ctype.h> #include <string.h> #ifdef WIN32 #include <windows.h> #else #include <unistd.h> #endif #include <math.h> #include <plib/ssg.h> #include <plib/ssgAux.h> #include <GL/glut.h> ssgRoot *scene = NULL ; ssgTransform *penguin = NULL ; ssgTransform *pedestal = NULL ; ssgaWaveSystem *ocean = NULL ; //ssgaCube *ocean = NULL ; [...217 lines suppressed...] scene -> addKid ( pedestal ) ; pedestal -> addKid ( penguin ) ; } /* The works. */ int main ( int, char ** ) { init_graphics () ; load_database () ; glutMainLoop () ; return 0 ; } --- NEW FILE: water.dsp --- # Microsoft Developer Studio Project File - Name="tux_example" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Console Application" 0x0103 CFG=tux_example - 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 "tux_example.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "tux_example.mak" CFG="tux_example - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "tux_example - Win32 Release" (based on "Win32 (x86) Console Application") !MESSAGE "tux_example - Win32 Debug" (based on "Win32 (x86) Console Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "tux_example" # PROP Scc_LocalPath "." CPP=cl.exe RSC=rc.exe !IF "$(CFG)" == "tux_example - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\..\..\..\\" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" 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 /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 ssg.lib sg.lib ul.lib opengl32.lib glu32.lib glut32.lib /nologo /subsystem:console /machine:I386 /out:"tux_example.exe" /libpath:"..\..\..\..\..\plib" !ELSEIF "$(CFG)" == "tux_example - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "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 /MTd /W3 /Gm /GX /ZI /Od /I "..\..\..\..\..\\" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /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 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 ssg_d.lib sg_d.lib ul_d.lib opengl32.lib glu32.lib glut32.lib /nologo /subsystem:console /debug /machine:I386 /out:"tux_example.exe" /pdbtype:sept /libpath:"..\..\..\..\..\plib" !ENDIF # Begin Target # Name "tux_example - Win32 Release" # Name "tux_example - Win32 Debug" # Begin Source File SOURCE=.\tux_example.cxx # End Source File # End Target # End Project |
Update of /cvsroot/plib/plib/src/ssgAux In directory usw-pr-cvs1:/tmp/cvs-serv1417/plib/src/ssgAux Modified Files: Makefile.am ssgAux.h ssgaPatch.cxx ssgaShapes.cxx ssgaShapes.h ssgaTeapot.cxx Added Files: ssgaWaveSystem.cxx ssgaWaveSystem.h Log Message: Added ssgaWaveSystem Fixed a bug in all ssgaShape's. --- NEW FILE: ssgaWaveSystem.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 [...269 lines suppressed...] } int ssgaWaveSystem::save ( FILE *fp ) { return ( save_field ( fp, windSpeed ) && save_field ( fp, windHeading ) && save_field ( fp, waveHeight ) && save_field ( fp, kappa ) && save_field ( fp, lambda ) && save_field ( fp, omega ) && save_field ( fp, edgeFlatten ) && save_field ( fp, tu ) && save_field ( fp, tv ) && ssgaShape::save ( fp ) ) ; } --- NEW FILE: ssgaWaveSystem.h --- #include "ssgaShapes.h" typedef float (* ssgaWSDepthCallback ) ( float x, float y ) ; class ssgaWaveSystem : public ssgaShape { ssgaWSDepthCallback gridGetter ; sgVec3 *normals ; sgVec4 *colours ; sgVec2 *texcoords ; sgVec3 *vertices ; sgVec3 *orig_vertices ; float windSpeed ; float windHeading ; float waveHeight ; float kappa ; float lambda ; float omega ; float edgeFlatten ; float tu, tv ; int nstrips ; int nstacks ; protected: virtual void copy_from ( ssgaWaveSystem *src, int clone_flags ) ; public: ssgaWaveSystem ( int ntri ) ; virtual ~ssgaWaveSystem () ; virtual ssgBase *clone ( int clone_flags = 0 ) ; virtual void regenerate () ; virtual const char *getTypeName ( void ) ; virtual int load ( FILE * ) ; virtual int save ( FILE * ) ; ssgaWSDepthCallback getDepthCallback () { return gridGetter ; } float getWindSpeed () { return windSpeed ; } float getWindDirn () { return windHeading ; } float getWaveHeight () { return waveHeight ; } float getEdgeFlatten () { return edgeFlatten ; } void setDepthCallback ( ssgaWSDepthCallback cb ) { gridGetter = cb ; } void setWindSpeed ( float speed ) { windSpeed = speed ; } void setWindDirn ( float dirn ) { windHeading = dirn ; } void setWaveHeight ( float height ) { waveHeight = height ; } void setEdgeFlatten ( float dist ) { edgeFlatten = dist ; } void setTexScale ( float u, float v ) { tu = u ; tv = v ; } void updateAnimation ( float t ) ; } ; Index: Makefile.am =================================================================== RCS file: /cvsroot/plib/plib/src/ssgAux/Makefile.am,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- Makefile.am 13 Jan 2002 02:13:15 -0000 1.7 +++ Makefile.am 4 Aug 2002 05:53:44 -0000 1.8 @@ -1,12 +1,13 @@ lib_LIBRARIES = libplibssgaux.a -include_HEADERS = ssgAux.h ssgaShapes.h ssgaParticleSystem.h +include_HEADERS = ssgAux.h ssgaShapes.h ssgaParticleSystem.h ssgaWaveSystem.h libplibssgaux_a_SOURCES = ssgAux.cxx \ ssgaShapes.cxx \ ssgaPatch.cxx \ ssgaParticleSystem.cxx \ + ssgaWaveSystem.cxx \ ssgaTeapot.cxx INCLUDES = -I$(top_srcdir)/src/sg -I$(top_srcdir)/src/ssg Index: ssgAux.h =================================================================== RCS file: /cvsroot/plib/plib/src/ssgAux/ssgAux.h,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- ssgAux.h 13 Jan 2002 02:13:15 -0000 1.10 +++ ssgAux.h 4 Aug 2002 05:53:44 -0000 1.11 @@ -29,6 +29,7 @@ #include "ssg.h" #include "ssgaShapes.h" #include "ssgaParticleSystem.h" +#include "ssgaWaveSystem.h" #define _SSGA_TYPE_SHAPE 0x00008000 @@ -38,6 +39,7 @@ #define _SSGA_TYPE_PATCH 0x00010000 #define _SSGA_TYPE_TEAPOT 0x00020000 #define _SSGA_TYPE_PARTICLESYSTEM 0x00040000 +#define _SSGA_TYPE_WAVESYSTEM 0x00080000 inline int ssgaTypeShape () { return _SSGA_TYPE_SHAPE | ssgTypeBranch ();} inline int ssgaTypeCube () { return _SSGA_TYPE_CUBE | ssgaTypeShape ();} @@ -47,6 +49,8 @@ inline int ssgaTypeTeapot () { return _SSGA_TYPE_TEAPOT | ssgaTypeShape ();} inline int ssgaTypeParticleSystem () { return _SSGA_TYPE_PARTICLESYSTEM | ssgaTypeShape ();} +inline int ssgaTypeWaveSystem () + { return _SSGA_TYPE_WAVESYSTEM | ssgaTypeShape ();} void ssgaInit () ; Index: ssgaPatch.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssgAux/ssgaPatch.cxx,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- ssgaPatch.cxx 7 Nov 2001 23:51:10 -0000 1.3 +++ ssgaPatch.cxx 4 Aug 2002 05:53:44 -0000 1.4 @@ -29,7 +29,9 @@ void ssgaPatch::regenerate () { + if ( kidState != NULL ) kidState -> ref () ; removeAllKids () ; + if ( kidState != NULL ) kidState -> deRef () ; if ( ntriangles <= 2 ) levels = -1 ; else if ( ntriangles <= 18 ) levels = 0 ; else Index: ssgaShapes.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssgAux/ssgaShapes.cxx,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- ssgaShapes.cxx 10 Jun 2002 20:41:46 -0000 1.21 +++ ssgaShapes.cxx 4 Aug 2002 05:53:44 -0000 1.22 @@ -139,7 +139,7 @@ type = ssgaTypeSphere () ; latlong_style = TRUE ; regenerate () ; -} +} ssgaSphere ::ssgaSphere (int nt) : ssgaShape ( nt ) @@ -147,7 +147,7 @@ type = ssgaTypeSphere () ; latlong_style = TRUE ; regenerate () ; -} +} ssgaCylinder::ssgaCylinder ( void ) : ssgaShape () @@ -183,17 +183,24 @@ void ssgaCube ::regenerate () { + if ( kidState != NULL ) kidState -> ref () ; removeAllKids () ; + if ( kidState != NULL ) kidState -> deRef () ; if ( ntriangles == 0 ) return ; - ssgVtxTable *vt0 = new ssgVtxTable () ; ssgVtxTable *vt1 = new ssgVtxTable () ; + ssgVtxTable *vt0 = new ssgVtxTable () ; + ssgVtxTable *vt1 = new ssgVtxTable () ; - ssgVertexArray *v0 = new ssgVertexArray ( 8 ) ; ssgVertexArray *v1 = new ssgVertexArray ( 8 ) ; - ssgNormalArray *n0 = new ssgNormalArray ( 8 ) ; ssgNormalArray *n1 = new ssgNormalArray ( 8 ) ; - ssgColourArray *c0 = new ssgColourArray ( 8 ) ; ssgColourArray *c1 = new ssgColourArray ( 8 ) ; - ssgTexCoordArray *t0 = new ssgTexCoordArray ( 8 ) ; ssgTexCoordArray *t1 = new ssgTexCoordArray ( 8 ) ; + ssgVertexArray *v0 = new ssgVertexArray ( 8 ) ; + ssgVertexArray *v1 = new ssgVertexArray ( 8 ) ; + ssgNormalArray *n0 = new ssgNormalArray ( 8 ) ; + ssgNormalArray *n1 = new ssgNormalArray ( 8 ) ; + ssgColourArray *c0 = new ssgColourArray ( 8 ) ; + ssgColourArray *c1 = new ssgColourArray ( 8 ) ; + ssgTexCoordArray *t0 = new ssgTexCoordArray ( 8 ) ; + ssgTexCoordArray *t1 = new ssgTexCoordArray ( 8 ) ; vt0 -> setPrimitiveType ( GL_TRIANGLE_STRIP ) ; vt1 -> setPrimitiveType ( GL_TRIANGLE_STRIP ) ; @@ -629,7 +636,9 @@ void ssgaSphere::regenerate () { + if ( kidState != NULL ) kidState -> ref () ; removeAllKids () ; + if ( kidState != NULL ) kidState -> deRef () ; if ( ntriangles == 0 ) return ; @@ -644,7 +653,9 @@ void ssgaCylinder::regenerate () { + if ( kidState != NULL ) kidState -> ref () ; removeAllKids () ; + if ( kidState != NULL ) kidState -> deRef () ; if ( ntriangles == 0 ) return ; Index: ssgaShapes.h =================================================================== RCS file: /cvsroot/plib/plib/src/ssgAux/ssgaShapes.h,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- ssgaShapes.h 10 Jun 2002 20:41:49 -0000 1.10 +++ ssgaShapes.h 4 Aug 2002 05:53:44 -0000 1.11 @@ -59,11 +59,12 @@ virtual ~ssgaShape (void) ; virtual const char *getTypeName(void) ; - void makeCorrupt () { corrupted = TRUE ; } - int isCorrupt () { return corrupted ; } + void makeCorrupt () { corrupted = TRUE ; } + int isCorrupt () { return corrupted ; } - float *getCenter () { return center ; } - float *getSize () { return size ; } + float *getCenter () { return center ; } + float *getSize () { return size ; } + int getNumTris () { return ntriangles ; } void setColour ( sgVec4 c ) { sgCopyVec4 ( colour, c ) ; regenerate () ; } void setCenter ( sgVec3 c ) { sgCopyVec3 ( center, c ) ; regenerate () ; } Index: ssgaTeapot.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssgAux/ssgaTeapot.cxx,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- ssgaTeapot.cxx 7 Nov 2001 23:51:10 -0000 1.4 +++ ssgaTeapot.cxx 4 Aug 2002 05:53:44 -0000 1.5 @@ -224,7 +224,9 @@ void ssgaTeapot::regenerate () { + if ( kidState != NULL ) kidState -> ref () ; removeAllKids () ; + if ( kidState != NULL ) kidState -> deRef () ; for ( int i = 0 ; patch[i][0] >= 0 ; i++ ) { |
From: Steve B. <sj...@us...> - 2002-08-04 05:53:47
|
Update of /cvsroot/plib/plib/src/ssg In directory usw-pr-cvs1:/tmp/cvs-serv1417/plib/src/ssg Modified Files: ssg.h ssgEntity.cxx ssgSimpleState.cxx ssgVtxTable.cxx Log Message: Added ssgaWaveSystem Fixed a bug in all ssgaShape's. Index: ssg.h =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssg.h,v retrieving revision 1.141 retrieving revision 1.142 diff -u -d -r1.141 -r1.142 --- ssg.h 27 Jul 2002 12:44:56 -0000 1.141 +++ ssg.h 4 Aug 2002 05:53:44 -0000 1.142 @@ -1399,6 +1399,11 @@ virtual void pick ( int baseName ) ; virtual void transform ( const sgMat4 m ) ; + ssgVertexArray *getVertices () { return vertices ; } + ssgNormalArray *getNormals () { return normals ; } + ssgTexCoordArray *getTexCoords () { return texcoords ; } + ssgColourArray *getColours () { return colours ; } + virtual void setVertices ( ssgVertexArray *vl ) ; virtual void setNormals ( ssgNormalArray *nl ) ; virtual void setTexCoords ( ssgTexCoordArray *tl ) ; @@ -1409,7 +1414,7 @@ int getNumColours () { return colours -> getNum () ; } int getNumTexCoords () { return texcoords -> getNum () ; } - int getNumTriangles () ; + int getNumTriangles () ; void getTriangle ( int n, short *v1, short *v2, short *v3 ) ; int getNumLines () ; void getLine ( int n, short *v1, short *v2 ) ; Index: ssgEntity.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgEntity.cxx,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- ssgEntity.cxx 14 Dec 2001 12:30:22 -0000 1.19 +++ ssgEntity.cxx 4 Aug 2002 05:53:44 -0000 1.20 @@ -102,8 +102,8 @@ { ssgBase::print ( fd, indent, how_much ) ; - if ( how_much > 1 ) - fprintf ( fd, "%s Num Parents=%d\n", indent, parents . getNumEntities () ) ; + if ( how_much > 1 ) + fprintf ( fd, "%s Num Parents=%d\n", indent, parents.getNumEntities () ) ; } Index: ssgSimpleState.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgSimpleState.cxx,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- ssgSimpleState.cxx 17 Dec 2001 04:52:30 -0000 1.23 +++ ssgSimpleState.cxx 4 Aug 2002 05:53:44 -0000 1.24 @@ -487,8 +487,8 @@ { ssgState::print ( fd, indent, how_much ) ; - if ( how_much < 2 ) - return; + if ( how_much < 2 ) + return; fprintf ( fd, "%s Don't Care = ", indent ) ; printStateString ( fd, dont_care ) ; @@ -499,14 +499,15 @@ fprintf ( fd, "%s TexHandle = %d\n", indent, getTextureHandle() ) ; fprintf ( fd, "%s TexFilename = '%s'\n", indent, - (getTextureFilename()==NULL) ? "<none>" : getTextureFilename() ) ; + (getTextureFilename()==NULL) ? "<none>" : getTextureFilename() ) ; fprintf ( fd, "%s Shade Model = %d\n", indent, shade_model ) ; fprintf ( fd, "%s Shininess = %f\n", indent, shininess ) ; fprintf ( fd, "%s AlphaClamp = %f\n", indent, alpha_clamp ) ; fprintf ( fd, "%s ColourMatMode= %s\n", indent, (colour_material_mode == GL_AMBIENT) ? "GL_AMBIENT" : (colour_material_mode == GL_DIFFUSE) ? "GL_DIFFUSE" : - (colour_material_mode == GL_AMBIENT_AND_DIFFUSE) ? "GL_AMBIENT_AND_DIFFUSE" : + (colour_material_mode == GL_AMBIENT_AND_DIFFUSE) ? + "GL_AMBIENT_AND_DIFFUSE" : (colour_material_mode == GL_SPECULAR) ? "GL_SPECULAR" : (colour_material_mode == GL_EMISSION) ? "GL_EMISSION" : "?????" ) ; Index: ssgVtxTable.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgVtxTable.cxx,v retrieving revision 1.28 retrieving revision 1.29 diff -u -d -r1.28 -r1.29 --- ssgVtxTable.cxx 27 Mar 2002 13:51:20 -0000 1.28 +++ ssgVtxTable.cxx 4 Aug 2002 05:53:44 -0000 1.29 @@ -800,10 +800,25 @@ ssgLeaf ::print ( fd, indent, how_much ) ; - vertices -> print ( fd, in, how_much ) ; - normals -> print ( fd, in, how_much ) ; - texcoords -> print ( fd, in, how_much ) ; - colours -> print ( fd, in, how_much ) ; + if ( vertices == NULL ) + fprintf ( fd, "%s No Vertices!\n", indent ) ; + else + vertices -> print ( fd, in, how_much ) ; + + if ( normals == NULL ) + fprintf ( fd, "%s No Normals!\n", indent ) ; + else + normals -> print ( fd, in, how_much ) ; + + if ( texcoords == NULL ) + fprintf ( fd, "%s No Texcoords!\n", indent ) ; + else + texcoords -> print ( fd, in, how_much ) ; + + if ( colours == NULL ) + fprintf ( fd, "%s No Colours!\n", indent ) ; + else + colours -> print ( fd, in, how_much ) ; } |
From: Steve B. <sj...@us...> - 2002-08-04 05:53:47
|
Update of /cvsroot/plib/plib/examples/src/ssg/water/data In directory usw-pr-cvs1:/tmp/cvs-serv1417/plib/examples/src/ssg/water/data Added Files: Penguin_beak.rgb Penguin_body.rgb ocean.rgb pavement.rgb pedestal.ac tuxedo.ac Log Message: Added ssgaWaveSystem Fixed a bug in all ssgaShape's. --- NEW FILE: Penguin_beak.rgb --- (This appears to be a binary file; contents omitted.) --- NEW FILE: Penguin_body.rgb --- (This appears to be a binary file; contents omitted.) --- NEW FILE: ocean.rgb --- (This appears to be a binary file; contents omitted.) --- NEW FILE: pavement.rgb --- (This appears to be a binary file; contents omitted.) --- NEW FILE: pedestal.ac --- AC3Db MATERIAL "ac3dmat1" rgb 1 1 1 amb 0.2 0.2 0.2 emis 0 0 0 spec 0.5 0.5 0.5 shi 10 trans 0 OBJECT world kids 1 OBJECT poly name "box" loc 0 -1 0 texture "pavement.rgb" texrep 1 -6 numvert 36 1 1.6 1 1.3 1 1.3 1.3 1 -1.29808 1 1.6 -1 1.3 1 1.3 1 1.6 1 -1 1.6 1 -1.29808 1 1.3 -1.29808 1 -1.29808 [...72 lines suppressed...] refs 4 24 0 1 25 0 0 26 1 0 27 1 1 SURF 0x0 mat 0 refs 4 28 1 0 29 1 1 30 0 1 31 0 0 SURF 0x0 mat 0 refs 4 32 1 0 33 1 1 34 0 1 35 0 0 kids 0 --- NEW FILE: tuxedo.ac --- AC3Db MATERIAL "" rgb 0 0 0 amb 0.2 0.2 0.2 emis 0 0 0 spec 0.5 0.5 0.5 shi 10 trans 0 MATERIAL "" rgb 1 0.702 0 amb 1 0.702 0 emis 0 0 0 spec 0 0 0 shi 0 trans 0 MATERIAL "" rgb 1 1 1 amb 1 1 1 emis 0 0 0 spec 0 0 0 shi 0 trans 0 OBJECT world kids 1 OBJECT group name "Tuxedo.T.Penguin" kids 3 OBJECT poly name "tuxfeet" loc 0.0203744 -0.479517 0.101666 numvert 14 -0.0744405 0.473224 0.119889 0.100559 0.473224 -0.200111 0.175559 0.473224 0.199889 0.250559 0.473224 -0.200111 0.425559 0.473224 0.119889 0.250559 0.523224 -0.200111 [...1656 lines suppressed...] 8 -0.342865 -0.657135 SURF 0x10 mat 2 refs 3 16 -0.18573 -0.81427 8 -0.342865 -0.657135 15 -0.5 -0.944444 SURF 0x10 mat 2 refs 3 8 -0.342865 -0.657135 16 -0.18573 -0.81427 2 -0.277778 -0.5 SURF 0x10 mat 2 refs 3 9 -0.0555556 -0.5 2 -0.277778 -0.5 16 -0.18573 -0.81427 kids 0 |
From: Steve B. <sj...@us...> - 2002-08-04 05:53:46
|
Update of /cvsroot/plib/plib/examples In directory usw-pr-cvs1:/tmp/cvs-serv1417/plib/examples Modified Files: configure.in Log Message: Added ssgaWaveSystem Fixed a bug in all ssgaShape's. Index: configure.in =================================================================== RCS file: /cvsroot/plib/plib/examples/configure.in,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- configure.in 7 Jul 2002 18:07:50 -0000 1.24 +++ configure.in 4 Aug 2002 05:53:43 -0000 1.25 @@ -200,6 +200,7 @@ src/ssg/state_test/Makefile \ src/ssg/tween_test/Makefile \ src/ssg/viewer/Makefile \ + src/ssg/water/Makefile \ src/fnt/Makefile \ src/net/Makefile \ src/net/client_server/Makefile \ |
From: Steve B. <sj...@us...> - 2002-08-04 05:53:46
|
Update of /cvsroot/plib/plib/examples/src/ssg In directory usw-pr-cvs1:/tmp/cvs-serv1417/plib/examples/src/ssg Modified Files: Makefile.am Log Message: Added ssgaWaveSystem Fixed a bug in all ssgaShape's. Index: Makefile.am =================================================================== RCS file: /cvsroot/plib/plib/examples/src/ssg/Makefile.am,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- Makefile.am 8 May 2002 21:24:24 -0000 1.4 +++ Makefile.am 4 Aug 2002 05:53:44 -0000 1.5 @@ -1,3 +1,3 @@ -SUBDIRS = tux majik load_save state_test viewer tween_test +SUBDIRS = tux majik load_save state_test viewer tween_test water EXTRA_DIST = README |
From: James J. <pu...@us...> - 2002-08-04 04:45:53
|
Update of /cvsroot/plib/plib/demos/p-guide/src In directory usw-pr-cvs1:/tmp/cvs-serv23891 Modified Files: WidgetList.h Log Message: Data storage for options in the structure Index: WidgetList.h =================================================================== RCS file: /cvsroot/plib/plib/demos/p-guide/src/WidgetList.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- WidgetList.h 8 May 2002 22:49:55 -0000 1.1 +++ WidgetList.h 4 Aug 2002 04:45:49 -0000 1.2 @@ -36,8 +36,23 @@ short callbacks ; char object_name [ PUSTRING_MAX ] ; bool visible ; + bool locked ; int layer ; // GUI layer: 0 - in back, positive nubmers - greater in front of lesser WidgetList *next ; + /* Additional data for the extended properties of widgets */ + char *items ; + char *allowed ; + int intval1 ; + int intval2 ; + bool boolval1 ; + bool boolval2 ; + bool boolval3 ; + float floatval1 ; + float floatval2 ; + float floatval3 ; + float floatval4 ; + float floatval5 ; + float floatval6 ; } ; |
From: James J. <pu...@us...> - 2002-08-04 04:44:22
|
Update of /cvsroot/plib/plib/demos/p-guide In directory usw-pr-cvs1:/tmp/cvs-serv23666 Modified Files: AUTHORS ChangeLog TODO Log Message: Updates Index: AUTHORS =================================================================== RCS file: /cvsroot/plib/plib/demos/p-guide/AUTHORS,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- AUTHORS 8 May 2002 22:49:55 -0000 1.1 +++ AUTHORS 4 Aug 2002 04:44:19 -0000 1.2 @@ -1,2 +1,3 @@ P-GUIDE was written by John F. Fay. +Significant improvements were made by James 'J.C.' Jones Index: ChangeLog =================================================================== RCS file: /cvsroot/plib/plib/demos/p-guide/ChangeLog,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- ChangeLog 8 May 2002 22:49:55 -0000 1.1 +++ ChangeLog 4 Aug 2002 04:44:19 -0000 1.2 @@ -0,0 +1 @@ +July, 2002 -- P-Guide functionality increased dramatically -- James 'J.C.' Jones Index: TODO =================================================================== RCS file: /cvsroot/plib/plib/demos/p-guide/TODO,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- TODO 8 May 2002 22:49:55 -0000 1.1 +++ TODO 4 Aug 2002 04:44:19 -0000 1.2 @@ -6,11 +6,25 @@ 2. Make the Active widget's black line go all the way around it. -3. Make the widget creations type-specific. +3. puFileSelector needs options + +4. puScrollBar needs to be added + +5. Menus (Vert and normal) need a method to populate submenus. Upgrades: -1. Allow the user to click a corner of a widget in the main window to extend its size in two directions at once. +1. Improve layer support. -2. +2. Make widgets added to window the real widgets, rather than Frames. + +3. Multiple Window support + +4. Makefile building? + +5. Font viewing / selecting (a font browser and such) + +6. Copy / Cut / Paste + +7. Widget class changes |
From: James J. <pu...@us...> - 2002-08-04 04:37:39
|
Update of /cvsroot/plib/plib/demos/p-guide/src In directory usw-pr-cvs1:/tmp/cvs-serv22513 Modified Files: LoadSave.cxx pGuide.cxx WriteCode.cxx Log Message: Improvments to corner-resizing, misc. linux fixes. Index: LoadSave.cxx =================================================================== RCS file: /cvsroot/plib/plib/demos/p-guide/src/LoadSave.cxx,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- LoadSave.cxx 3 Aug 2002 22:55:29 -0000 1.2 +++ LoadSave.cxx 4 Aug 2002 04:37:36 -0000 1.3 @@ -321,8 +321,9 @@ // Verify file is XML float tver = 0.0f ; + char encversion[PUSTRING_MAX]; fgets( rawbuffer, sizeof(rawbuffer), in) ; - sscanf(rawbuffer,"<?xml version=\"%f\" encoding=\"*%s\" ?>", &tver) ; + sscanf(rawbuffer,"<?xml version=\"%f\" encoding=\"%s\" ?>", &tver, encversion) ; if (!tver) { printf ("File does not contain proper XML headings.\n"); return ; @@ -333,7 +334,7 @@ char tagvalue[PUSTRING_MAX] ; fgets( rawbuffer, sizeof(rawbuffer), in) ; - if (!sscanf(rawbuffer,"<!DOCTYPE %s>", &tag)) { + if (!sscanf(rawbuffer,"<!DOCTYPE %s>", tag)) { printf ("File, though XML, does not contain P-Guide information (or has damaged header information).\n"); return ; } Index: pGuide.cxx =================================================================== RCS file: /cvsroot/plib/plib/demos/p-guide/src/pGuide.cxx,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- pGuide.cxx 3 Aug 2002 22:55:29 -0000 1.3 +++ pGuide.cxx 4 Aug 2002 04:37:36 -0000 1.4 @@ -343,6 +343,26 @@ if ( (w + dist < 5) || (h + dist < 5) ) break ; active_object->setSize ( w + dist, h + dist ) ; break ; + + case 8 : // Resizing top-left + if (y-yo-h>x-xo-w) + dist = y - yo - h ; + else + dist = xo - x ; + if ( (w + dist < 5) || (h + dist < 5) ) break ; + active_object->setPosition ( xo - dist, yo ) ; [...78 lines suppressed...] // Top Left Corner - ( ( ( y - box->max[1] ) < 2*RESIZING_BORDER_WIDTH ) && (abs ( x - box->min[0] ) < 2*RESIZING_BORDER_WIDTH ) ) ) ) - resize_corner = 1 ; - else - resize_corner = 0 ; + if ( ( abs( y - box->max[1] ) < corner_resize_width ) && (abs ( x - box->min[0] ) < corner_resize_width ) ) + activity_flag = 8; + } // TO DO: If the user clicks on a corner, let him resize in both directions at once /* This basically will involve setting "resize_corner" to be 1 */ @@ -669,6 +704,8 @@ if (active_widget->object_type == PUCLASS_DIAL) resize_corner = 1 ; + else + resize_corner = 0; int object_x, object_y ; active_object->getPosition ( &object_x, &object_y ) ; Index: WriteCode.cxx =================================================================== RCS file: /cvsroot/plib/plib/demos/p-guide/src/WriteCode.cxx,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- WriteCode.cxx 3 Aug 2002 22:55:29 -0000 1.3 +++ WriteCode.cxx 4 Aug 2002 04:37:36 -0000 1.4 @@ -205,7 +205,7 @@ fprintf ( out, "//* The Main Program *\n" ) ; fprintf ( out, "//**********************************************************\n\n" ) ; - fprintf ( out, "void main ( int argc, char *argv[] )\n" ) ; + fprintf ( out, "int main ( int argc, char *argv[] )\n" ) ; fprintf ( out, "{\n" ) ; fprintf ( out, " // TODO: Add any non-GLUT functionality you want to\n\n" ) ; @@ -577,7 +577,7 @@ fprintf ( out, " // GLUT Main Loop\n" ) ; fprintf ( out, " glutMainLoop () ;\n" ) ; - fprintf ( out, " return ;\n" ) ; + fprintf ( out, " return 0;\n" ) ; fprintf ( out, "}\n\n" ) ; // Close up shop |
From: James J. <pu...@us...> - 2002-08-03 22:55:32
|
Update of /cvsroot/plib/plib/demos/p-guide/src In directory usw-pr-cvs1:/tmp/cvs-serv31358 Modified Files: LoadSave.cxx pGuide.cxx StatusWindow.cxx WidgetWindow.cxx WriteCode.cxx Makefile.am Added Files: PropertiesWindow.cxx Log Message: Added "Properties", a right-click menu, "Perfect Compile(tm)", corner-resizing, and a whole lot more! --- NEW FILE: PropertiesWindow.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 */ [...559 lines suppressed...] properties_largeinput_arrows->setCallback(cb_int1); puSpinBox *properties_largeinput_sliderwidth = new puSpinBox(300,90,400,110); properties_largeinput_sliderwidth->setLabel("Slider Width:"); properties_largeinput_sliderwidth->setLabelPlace(PUPLACE_TOP_CENTERED); properties_largeinput_sliderwidth->setMinValue(0.0f); properties_largeinput_sliderwidth->setMaxValue(150.0f); properties_largeinput_sliderwidth->setValue(active_widget->intval2); properties_largeinput_sliderwidth->setStepSize(1.0f); properties_largeinput_sliderwidth->setCallback(cb_int2); } properties_group->close () ; return 0 ; } Index: LoadSave.cxx =================================================================== RCS file: /cvsroot/plib/plib/demos/p-guide/src/LoadSave.cxx,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- LoadSave.cxx 12 Jul 2002 03:05:17 -0000 1.1 +++ LoadSave.cxx 3 Aug 2002 22:55:29 -0000 1.2 @@ -33,6 +33,7 @@ #define TAG_COLOR 0x00000040 #define TAG_LEGEND 0x00000080 #define TAG_LABEL 0x00000100 +#define TAG_DATA 0x00000120 #define CALLBACK_UP 0x00000001 #define CALLBACK_ACTIVE 0x00000002 @@ -55,6 +56,9 @@ extern bool main_window_changed ; extern bool currently_loading ; /* Var for the Reshape function to not do its thing */ [...439 lines suppressed...] + puText *text = new puText ( 80, 85 ) ; + text->setLabel ( "ERROR: Name already used." ) ; + text->setLabelFont(PUFONT_TIMES_ROMAN_24); + puText *directions = new puText ( 90, 65 ) ; + directions->setLabel ( "Please type in a new, unique name to continue." ) ; + directions->setLabelFont(PUFONT_HELVETICA_12); + dup_newname = new puInput (20,40,440,60) ; + dup_newname->setValuator(new_wid->object_name); + dup_newname->setValidData("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_012345679"); + puOneShot *ok = new puOneShot ( 200, 10, "Accept" ) ; + ok->setCallback ( chk_dupname_ok_cb ) ; + dup_dialog->close () ; + dup_dialog->reveal () ; + break ; + } + wid = wid->next ; + } +} + Index: pGuide.cxx =================================================================== RCS file: /cvsroot/plib/plib/demos/p-guide/src/pGuide.cxx,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- pGuide.cxx 12 Jul 2002 03:05:17 -0000 1.2 +++ pGuide.cxx 3 Aug 2002 22:55:29 -0000 1.3 @@ -32,10 +32,13 @@ WidgetList *active_widget = (WidgetList *)NULL ; short activity_flag = 0 ; // 0 - inactive; 1 - moving; 2 - resizing xmin, 3 - resizing ymin, 4 - resizing xmax, 5 - resizing ymax int resize_symmetric = 1 ; +int resize_corner = 0 ; int mouse_x_position_in_object = 0 ; int mouse_y_position_in_object = 0 ; +int pguide_last_buttons = 0 ; // Because puMouse isn't called, we have to do our own last_buttons checking + // Main window parameters [...745 lines suppressed...] puInit () ; #ifdef VOODOO @@ -488,6 +845,16 @@ puSetDefaultStyle ( PUSTYLE_SMALL_SHADED ) ; puSetDefaultColourScheme ( 0.8, 0.8, 0.8, 1.0 ) ; + + // Add the properties context menu + context_menu = new puPopupMenu( 0, 0 ) ; + context_menu->add_item("Properties", cb_edit_properties) ; + context_menu->add_item("Lock/Unlock", cb_lock_toggle) ; + context_menu->add_item("Delete", cb_popup_delete) ; + context_menu->add_item("Cut", NULL) ; + context_menu->add_item("Copy", NULL) ; + context_menu->add_item("Change Class", NULL) ; + context_menu->close() ; // Set up the other windows define_widget_window () ; Index: StatusWindow.cxx =================================================================== RCS file: /cvsroot/plib/plib/demos/p-guide/src/StatusWindow.cxx,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- StatusWindow.cxx 12 Jul 2002 03:05:17 -0000 1.2 +++ StatusWindow.cxx 3 Aug 2002 22:55:29 -0000 1.3 @@ -34,6 +34,10 @@ extern bool main_window_changed ; +extern char main_window_name [ PUSTRING_MAX ] ; + +extern bool autolock ; + // Status window parameters int status_window = 0 ; // Window handle extern int main_window ; @@ -71,7 +75,10 @@ [...382 lines suppressed...] + window_color_g->setValue(1.0f); window_color_b = new puSpinBox ( 370, 285, 420, 305 ) ; window_color_b->setMinValue(0.0); @@ -914,6 +1037,7 @@ window_color_b->setLabel ( "Blue" ) ; window_color_b->setLabelPlace ( PUPLACE_TOP_CENTERED ) ; window_color_b->setValuator ( &main_window_color_b ) ; + window_color_b->setValue(1.0f); window_color_a = new puSpinBox ( 420, 285, 470, 305 ) ; window_color_a->setMinValue(0.0); @@ -922,6 +1046,7 @@ window_color_a->setLabel ( "Alpha" ) ; window_color_a->setLabelPlace ( PUPLACE_TOP_CENTERED ) ; window_color_a->setValuator ( &main_window_color_a ) ; + window_color_a->setValue(1.0f); status_group->close () ; Index: WidgetWindow.cxx =================================================================== RCS file: /cvsroot/plib/plib/demos/p-guide/src/WidgetWindow.cxx,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- WidgetWindow.cxx 12 Jul 2002 03:05:17 -0000 1.2 +++ WidgetWindow.cxx 3 Aug 2002 22:55:29 -0000 1.3 @@ -244,7 +244,13 @@ active_button = (puButton *)ob ; } - +void spinbox_cb ( puObject *ob ) +{ + selected_object_sticky = ( glutGetModifiers () & GLUT_ACTIVE_CTRL ) ? 1 : 0 ; + selected_object_type = PUCLASS_SPINBOX ; + strcpy ( selected_type_string, ob->getLegend () ) ; + active_button = (puButton *)ob ; +} // Function to define the window @@ -254,9 +260,10 @@ int ln = 90 ; // Button length int ht = 20 ; // Button height int sp = 20 ; // Button spacing + int total_screen_width = glutGet( GLUT_SCREEN_WIDTH ) ; - glutPositionWindow ( 420, 100 ) ; glutReshapeWindow ( 4 * ln + 5 * sp, 5 * ht + 6 * sp ) ; + glutPositionWindow ( total_screen_width - (4 * ln + 5 * sp) - 20, 20 ) ; glutDisplayFunc ( widget_window_displayfn ) ; glutKeyboardFunc ( widget_window_keyfn ) ; glutSpecialFunc ( widget_window_specialfn ) ; @@ -351,7 +358,9 @@ button->setLegend ( "puTriSlider" ) ; button->setCallback ( trislider_cb ) ; - + button = new puButton ( 4*sp+3*ln, 0*sp+ht, 4*sp+4*ln, 0*sp+2*ht ) ; + button->setLegend ( "puSpinBox" ) ; + button->setCallback ( spinbox_cb ) ; widget_group->close () ; Index: WriteCode.cxx =================================================================== RCS file: /cvsroot/plib/plib/demos/p-guide/src/WriteCode.cxx,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- WriteCode.cxx 12 Jul 2002 03:05:17 -0000 1.2 +++ WriteCode.cxx 3 Aug 2002 22:55:29 -0000 1.3 @@ -34,6 +34,7 @@ extern int main_window_height ; extern char main_window_name [ PUSTRING_MAX ] ; +extern char pguide_current_directory [ PUSTRING_MAX ] ; extern int main_window_x ; extern int main_window_y ; @@ -64,6 +65,15 @@ return ; } [...276 lines suppressed...] + if (wid->boolval1 == false) + fprintf ( out, " %s->rejectInput() ;\n", wid->object_name ) ; + if ( wid->allowed) + fprintf ( out, " %s->setValidData(\"%s\") ;\n", wid->object_name, wid->allowed ) ; + } + + if ( wid->object_type == PUCLASS_LARGEINPUT ) + { + fprintf ( out, " %s = new %s (%d, %d, %d, %d, %d, %d ) ;\n", wid->object_name, wid->object_type_name, x, y, w, h, wid->intval1, wid->intval2 ) ; + if (wid->boolval1 == false) + fprintf ( out, " %s->rejectInput() ;\n", wid->object_name ) ; + if ( wid->allowed) + fprintf ( out, " %s->setValidData(\"%s\") ;\n", wid->object_name, wid->allowed ) ; + + } + /* Done custom constructor and extra details */ + if ( wid->callbacks & 0x01 ) // Up-callback defined fprintf ( out, " %s->setCallback ( %s_cb ) ;\n", wid->object_name, wid->object_name ) ; Index: Makefile.am =================================================================== RCS file: /cvsroot/plib/plib/demos/p-guide/src/Makefile.am,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Makefile.am 12 Jul 2002 03:05:17 -0000 1.2 +++ Makefile.am 3 Aug 2002 22:55:29 -0000 1.3 @@ -1,7 +1,7 @@ bin_PROGRAMS = pguide pguide_SOURCES = CreateWidget.cxx pGuide.cxx StatusWindow.cxx WidgetList.h \ - WidgetWindow.cxx WriteCode.cxx LoadSave.cxx + WidgetWindow.cxx WriteCode.cxx LoadSave.cxx PropertiesWindow.cxx EXTRA_DIST = pGuide.dsp |
From: James J. <pu...@us...> - 2002-08-03 22:44:52
|
Update of /cvsroot/plib/plib/src/pui In directory usw-pr-cvs1:/tmp/cvs-serv28641 Modified Files: Makefile.am puBiSlider.cxx pu.cxx puGroup.cxx puInput.cxx puInterface.cxx puLargeInput.cxx puObject.cxx puPopupMenu.cxx puSpinBox.cxx puTriSlider.cxx pu.h Added Files: puScrollBar.cxx Log Message: John Fay & James Jones - Added puScrollBar, major changes to puLargeInput, passive motion highlighting (requires puMouse to be called for passive movements) --- NEW FILE: puScrollBar.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 [...189 lines suppressed...] case PUSLIDER_DELTA : /* Deprecated! */ if ( fabs ( last_cb_value - next_value ) >= cb_delta ) { last_cb_value = next_value ; puSetActiveWidget ( this, x, y ) ; invokeCallback () ; } break ; case PUSLIDER_ALWAYS : default : last_cb_value = next_value ; puSetActiveWidget ( this, x, y ) ; invokeCallback () ; break ; } } } Index: Makefile.am =================================================================== RCS file: /cvsroot/plib/plib/src/pui/Makefile.am,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- Makefile.am 12 Jul 2002 02:57:19 -0000 1.14 +++ Makefile.am 3 Aug 2002 22:44:48 -0000 1.15 @@ -11,7 +11,7 @@ puValue.cxx puFont.cxx puBiSlider.cxx puTriSlider.cxx \ puDial.cxx puVerticalMenu.cxx puLargeInput.cxx \ puFileSelector.cxx puComboBox.cxx puSelectBox.cxx puRange.cxx \ - puSpinBox.cxx + puSpinBox.cxx puScrollBar.cxx INCLUDES = -I$(top_srcdir)/src/sg -I$(top_srcdir)/src/fnt INCLUDES += -I$(top_srcdir)/src/util Index: puBiSlider.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/pui/puBiSlider.cxx,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- puBiSlider.cxx 14 Jul 2002 16:01:31 -0000 1.19 +++ puBiSlider.cxx 3 Aug 2002 22:44:48 -0000 1.20 @@ -49,7 +49,7 @@ val = 1.0f ; char str_value[10] ; - sprintf (str_value, "%d", getCurrentMax() ) ; + sprintf (str_value, "%g", getCurrentMax() ) ; draw_slider_box ( dx, dy, abox, val, str_value ) ; @@ -60,7 +60,7 @@ else val = 0.0f ; - sprintf (str_value, "%d", getCurrentMin() ) ; + sprintf (str_value, "%g", getCurrentMin() ) ; draw_slider_box ( dx, dy, abox, val, str_value ) ; Index: pu.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/pui/pu.cxx,v retrieving revision 1.53 retrieving revision 1.54 diff -u -d -r1.53 -r1.54 --- pu.cxx 12 Jul 2002 01:01:24 -0000 1.53 +++ pu.cxx 3 Aug 2002 22:44:48 -0000 1.54 @@ -193,30 +193,41 @@ puGroup *parent = ob->getParent () ; - /* Add object to linked list to be deleted */ - - if ( objects_to_delete == NULL ) - objects_to_delete = ob ; - else + if ( !ob->IsItSubWidget() ) { - /* Ensure that objects are deleted in the order of puDeleteObject calls */ - - puObject *last ; - - for ( last = objects_to_delete ; - last -> getNextObject() != NULL ; - last = last -> getNextObject() ) - /* Find last object. */ ; + /* Add object to linked list to be deleted */ + if ( objects_to_delete == NULL ) + objects_to_delete = ob ; + else + { + /* Ensure that objects are deleted in the order of puDeleteObject calls */ - last -> setNextObject ( ob ) ; - } + puObject *last ; - /* Remove from parent interface */ + for ( last = objects_to_delete ; + last -> getNextObject() != NULL ; + last = last -> getNextObject() ) + /* Find last object. */ ; - if ( parent != ob && parent != NULL ) - parent -> remove ( ob ) ; + last -> setNextObject ( ob ) ; + } + /* Remove from parent interface */ + + if ( parent != ob && parent != NULL ) + parent -> remove ( ob ) ; /* Sets object's next and previous pointers to null as well */ - ob -> setNextObject ( NULL ) ; + /* If it is a group, then delete all child objects as well */ + if ( ob->getType () & PUCLASS_GROUP ) + { + puObject *child = ((puGroup *)ob)->getFirstChild () ; + while ( child ) + { + puObject *next = child->getNextObject () ; + puDeleteObject ( child ) ; + child = next ; + } + } + } } @@ -228,7 +239,8 @@ while ( local_objects_to_delete != NULL ) { puObject *next_ob = local_objects_to_delete -> getNextObject() ; - delete local_objects_to_delete ; + //if ( !local_objects_to_delete->IsItSubWidget() ) + delete local_objects_to_delete ; local_objects_to_delete = next_ob ; } } @@ -356,7 +368,6 @@ return last_buttons ; } - int puMouse ( int button, int updown, int x, int y ) { puCursor ( x, y ) ; @@ -415,7 +426,6 @@ affect any other widgets until you release the mouse button. */ - if ( puActiveWidget () ) { puActiveWidget()->doHit(button, PU_DRAG, pu_mouse_x - pu_mouse_offset_x, Index: puGroup.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/pui/puGroup.cxx,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- puGroup.cxx 12 Jul 2002 03:23:33 -0000 1.20 +++ puGroup.cxx 3 Aug 2002 22:44:48 -0000 1.21 @@ -187,8 +187,28 @@ bo = getLastChild () ; for ( ; bo != NULL ; bo = bo -> getPrevObject() ) + { + /* If this is a menu bar and the mouse is over the button, highlight the button, if it's in the right window - JCJ 6 Jun 2002 */ + if ( ( ( getType () & PUCLASS_MENUBAR ) || ( getType () & PUCLASS_VERTMENU ) ) && ( bo->getType () & PUCLASS_ONESHOT ) && ( window == puGetWindow () ) ) + /* + Changing this statement to something like this: + if ( bo->getType () & PUCLASS_ONESHOT ) + Breaks a lot of stuff... like pressing buttons actually working in filepicker. Need + to just define everything that can be pressed passively above, and things should + be fröhlich. + */ + { + puBox *box = bo->getABox () ; + if ( ( x >= box->min[0] ) && ( x <= box->max[0] ) && + ( y >= box->min[1] ) && ( y <= box->max[1] ) ) + bo->highlight () ; + else + bo->lowlight () ; + } + if ( bo -> checkHit ( button, updown, x, y ) ) return TRUE ; + } } /* @@ -331,7 +351,7 @@ { dlist = bo ; bo = bo -> getPrevObject() ; - delete dlist ; + puDeleteObject ( dlist ) ; } } Index: puInput.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/pui/puInput.cxx,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- puInput.cxx 14 Jul 2002 16:03:13 -0000 1.25 +++ puInput.cxx 3 Aug 2002 22:44:48 -0000 1.26 @@ -304,6 +304,8 @@ char *p = NULL ; + int char_used = TRUE ; + switch ( key ) { case PU_KEY_PAGE_UP : @@ -328,9 +330,10 @@ break ; case PU_KEY_LEFT : cursor_position-- ; break ; case PU_KEY_RIGHT : cursor_position++ ; break ; + default : char_used = FALSE ; } - if ( ! input_disabled ) + if ( ! input_disabled && ! char_used ) { switch ( key ) { Index: puInterface.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/pui/puInterface.cxx,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- puInterface.cxx 3 Apr 2002 00:53:54 -0000 1.14 +++ puInterface.cxx 3 Aug 2002 22:44:48 -0000 1.15 @@ -109,7 +109,7 @@ { dlist = bo ; bo = bo -> getPrevObject() ; - delete dlist ; + puDeleteObject ( dlist ) ; } dlist = NULL ; Index: puLargeInput.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/pui/puLargeInput.cxx,v retrieving revision 1.33 retrieving revision 1.34 diff -u -d -r1.33 -r1.34 --- puLargeInput.cxx 12 Jul 2002 01:55:16 -0000 1.33 +++ puLargeInput.cxx 3 Aug 2002 22:44:48 -0000 1.34 @@ -27,43 +27,18 @@ static void puLargeInputHandleRightSlider ( puObject * slider ) { - float val ; - slider->getValue ( &val ) ; - val = 1.0f - val ; - - puLargeInput* text = (puLargeInput*) slider->getUserData () ; - int idx = int ( text->getNumLines () * val ) ; - text->setTopLineInWindow ( idx ) ; -} [...1186 lines suppressed...] + delete [] p ; - break ; + break ; } } @@ -1294,10 +1181,10 @@ { // Wrap the text in "text" and put it in "wrapped_text" - int l_len = strlen (text) ; + int l_len = strlen ( getStringValue () ) ; delete [] wrapped_text ; wrapped_text = new char[l_len + 1] ; - memcpy(wrapped_text, text, l_len + 1) ; + memcpy(wrapped_text, getStringValue (), l_len + 1) ; char *wrapped_text_wp = wrapped_text, *space_ptr, Index: puObject.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/pui/puObject.cxx,v retrieving revision 1.44 retrieving revision 1.45 diff -u -d -r1.44 -r1.45 --- puObject.cxx 12 Jul 2002 03:23:33 -0000 1.44 +++ puObject.cxx 3 Aug 2002 22:44:48 -0000 1.45 @@ -140,6 +140,7 @@ am_default = FALSE ; window = puGetWindow () ; v_status = 0 ; + isSubWidget = FALSE ; cb = NULL ; active_cb = NULL ; Index: puPopupMenu.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/pui/puPopupMenu.cxx,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- puPopupMenu.cxx 12 Jul 2002 03:23:33 -0000 1.12 +++ puPopupMenu.cxx 3 Aug 2002 22:44:48 -0000 1.13 @@ -191,7 +191,7 @@ return FALSE ; puObject *bo ; - + int objecthit ; /* We have to walk the list backwards to ensure that the click order is the same as the DRAW order. @@ -210,8 +210,26 @@ /* Find the last object in our list. */ ; - for ( ; bo != NULL ; bo = bo -> getPrevObject() ) + /* Following code permits highlighting and lowlighting */ + /* of oneshots underneath a PopupMenu. */ + /* - JCJ and Fay 31 May 2002 */ + + for ( ; bo != NULL ; bo = bo -> getPrevObject() ) + { + puBox *box = bo->getABox () ; + if ( ( x >= box->min[0] ) && ( x <= box->max[0] ) && + ( y >= box->min[1] ) && ( y <= box->max[1] ) ) + bo->highlight () ; + else + bo->lowlight () ; + /* Since actually RETURNing here would break the for loop early and kill the */ + /* correct lowlighting, just set a var to check later. - JCJ 3 Jun 2002 */ if ( bo -> checkHit ( button, updown, x, y ) ) + objecthit = TRUE ; + } + + /* If the object was hit in the above for loop, then it.. was hit.*/ + if (objecthit) return TRUE ; return FALSE ; Index: puSpinBox.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/pui/puSpinBox.cxx,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- puSpinBox.cxx 14 Jul 2002 16:01:31 -0000 1.2 +++ puSpinBox.cxx 3 Aug 2002 22:44:48 -0000 1.3 @@ -113,13 +113,24 @@ 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 ; + if ( input_box->checkKey ( key, updown ) ) + { + setValue ( input_box->getFloatValue () ) ; + if ( getFloatValue () > getMaxValue () ) + setValue ( getMaxValue () ) ; + else if ( getFloatValue () < getMinValue () ) + setValue ( getMinValue () ) ; + + invokeCallback () ; + return TRUE ; + } + else + return FALSE ; } +void puSpinBox_handle_input (puObject *ob) +{ + puObject *master = (puObject *)(ob->getUserData()); + master->setValue(ob->getFloatValue()); + master->invokeCallback(); +} Index: puTriSlider.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/pui/puTriSlider.cxx,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- puTriSlider.cxx 14 Jul 2002 16:01:31 -0000 1.20 +++ puTriSlider.cxx 3 Aug 2002 22:44:48 -0000 1.21 @@ -43,12 +43,12 @@ float val; if ( getMaxValue() > getMinValue() ) - val = (float)(getIntegerValue () - getMinValue()) / (float)(getMaxValue() - getMinValue()) ; + val = (float)(getFloatValue () - getMinValue()) / (float)(getMaxValue() - getMinValue()) ; else val = 0.5f ; char str_value[10] ; - sprintf (str_value, "%d", getIntegerValue () ) ; + sprintf (str_value, "%d", getFloatValue () ) ; draw_slider_box ( dx, dy, abox, val, str_value ) ; @@ -62,7 +62,7 @@ else val = 1.0f ; - sprintf (str_value, "%d", getCurrentMax() ) ; + sprintf (str_value, "%g", getCurrentMax() ) ; draw_slider_box ( dx, dy, abox, val, str_value ) ; @@ -73,7 +73,7 @@ else val = 0.0f ; - sprintf (str_value, "%d", getCurrentMin() ) ; + sprintf (str_value, "%g", getCurrentMin() ) ; draw_slider_box ( dx, dy, abox, val, str_value ) ; @@ -139,12 +139,12 @@ { if ( getActiveButton() == 0 ) // No currently-active slider, set whichever is closest { - if ( (new_value-getCurrentMin()) < (getIntegerValue()-new_value) ) // Closest to current_min + if ( (new_value-getCurrentMin()) < (getFloatValue()-new_value) ) // Closest to current_min { setCurrentMin ( checkStep(new_value) ) ; setActiveButton ( 1 ) ; } - else if ( (new_value-getIntegerValue()) > (getCurrentMax()-new_value) ) // Closest to current_max + else if ( (new_value-getFloatValue()) > (getCurrentMax()-new_value) ) // Closest to current_max { setCurrentMax ( checkStep(new_value) ) ; setActiveButton ( 3 ) ; @@ -158,7 +158,7 @@ else if ( getActiveButton() == 1 ) // Currently moving current_min { setCurrentMin ( checkStep(new_value) ) ; - if ( getIntegerValue() < getCurrentMin() ) setValue ( getCurrentMin() ) ; + if ( getFloatValue() < getCurrentMin() ) setValue ( getCurrentMin() ) ; if ( getCurrentMax() < getCurrentMin() ) setCurrentMax ( getCurrentMin() ) ; } else if ( getActiveButton() == 2 ) // Currently moving central value @@ -170,7 +170,7 @@ else if ( getActiveButton() == 3 ) // Currently moving current_max { setCurrentMax ( checkStep(new_value) ) ; - if ( getIntegerValue() > getCurrentMax() ) setValue ( getCurrentMax() ) ; + if ( getFloatValue() > getCurrentMax() ) setValue ( getCurrentMax() ) ; if ( getCurrentMax() < getCurrentMin() ) setCurrentMin ( getCurrentMax() ) ; } } Index: pu.h =================================================================== RCS file: /cvsroot/plib/plib/src/pui/pu.h,v retrieving revision 1.116 retrieving revision 1.117 diff -u -d -r1.116 -r1.117 --- pu.h 14 Jul 2002 16:01:31 -0000 1.116 +++ pu.h 3 Aug 2002 22:44:48 -0000 1.117 @@ -129,11 +129,11 @@ int getStringHeight ( const char *str ) const ; int getStringHeight ( void ) const { return getStringHeight ( "K" ) ; } - float getFloatStringWidth ( const char *str ) const ; - int getStringWidth ( const char *str ) const /* Deprecated ? */ - { - return (int) getFloatStringWidth ( str ) ; - } + float getFloatStringWidth ( const char *str ) const ; + int getStringWidth ( const char *str ) const /* Deprecated ? */ + { [...617 lines suppressed...] void addNewLine ( const char *l ) ; void addText ( const char *l ) ; @@ -1947,6 +1997,8 @@ class puComboBox : public puGroup { + + protected: char ** list ; int num_items ; @@ -2002,6 +2054,8 @@ class puSelectBox : public puGroup { + + protected: char ** list ; int num_items ; |
From: Steve B. <sj...@us...> - 2002-08-03 21:23:39
|
Update of /cvsroot/plib/plib/examples/src/ssg/water/data In directory usw-pr-cvs1:/tmp/cvs-serv11901/data Log Message: Directory /cvsroot/plib/plib/examples/src/ssg/water/data added to the repository |
From: Steve B. <sj...@us...> - 2002-08-03 21:18:43
|
Update of /cvsroot/plib/plib/examples/src/ssg/water In directory usw-pr-cvs1:/tmp/cvs-serv10840/water Log Message: Directory /cvsroot/plib/plib/examples/src/ssg/water added to the repository |
From: Dave M. <mc...@us...> - 2002-07-31 23:15:02
|
Update of /cvsroot/plib/plib/src/net In directory usw-pr-cvs1:/tmp/cvs-serv10506/src/net Modified Files: netSocket.cxx netSocket.h Log Message: curt's broadcast patch Index: netSocket.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/net/netSocket.cxx,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- netSocket.cxx 5 May 2002 23:09:16 -0000 1.20 +++ netSocket.cxx 31 Jul 2002 23:14:59 -0000 1.21 @@ -153,6 +153,10 @@ return "127.0.0.1" ; } +bool netAddress::getBroadcast () const { + return sin_addr == INADDR_BROADCAST; +} + netSocket::netSocket () { handle = -1 ; @@ -199,6 +203,27 @@ #endif } +void +netSocket::setBroadcast ( bool broadcast ) +{ + assert ( handle != -1 ) ; + int result; + if ( broadcast ) { + int one = 1; +#ifdef WIN32 + result = ::setsockopt( handle, SOL_SOCKET, SO_BROADCAST, (char*)&one, sizeof(one) ); +#else + result = ::setsockopt( handle, SOL_SOCKET, SO_BROADCAST, &one, sizeof(one) ); +#endif + } else { + result = ::setsockopt( handle, SOL_SOCKET, SO_BROADCAST, NULL, 0 ); + } + if ( result < 0 ) { + perror("set broadcast:"); + } + assert ( result != -1 ); +} + int netSocket::bind ( cchar* host, int port ) { @@ -227,6 +252,9 @@ { assert ( handle != -1 ) ; netAddress addr ( host, port ) ; + if ( addr.getBroadcast() ) { + setBroadcast( true ); + } return ::connect(handle,(const sockaddr*)&addr,sizeof(netAddress)); } Index: netSocket.h =================================================================== RCS file: /cvsroot/plib/plib/src/net/netSocket.h,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- netSocket.h 2 May 2002 16:50:07 -0000 1.14 +++ netSocket.h 31 Jul 2002 23:14:59 -0000 1.15 @@ -83,6 +83,8 @@ int getPort() const ; static cchar* getLocalHost () ; + + bool getBroadcast () const ; }; @@ -113,6 +115,7 @@ int recvfrom ( void * buffer, int size, int flags, netAddress* from ) ; void setBlocking ( bool blocking ) ; + void setBroadcast ( bool broadcast ) ; static bool isNonBlockingError () ; static int select ( netSocket** reads, netSocket** writes, int timeout ) ; |
From: Sebastian U. <ud...@us...> - 2002-07-31 16:07:42
|
Update of /cvsroot/plib/plib/src/pui In directory usw-pr-cvs1:/tmp/cvs-serv519 Modified Files: puFont.cxx Log Message: John F. Fay: Corrected one return statement in getFloatStringWidth () Index: puFont.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/pui/puFont.cxx,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- puFont.cxx 7 Jul 2002 19:00:48 -0000 1.16 +++ puFont.cxx 31 Jul 2002 16:07:38 -0000 1.17 @@ -92,7 +92,7 @@ return ( r - l ) ; } - return 0 ; + return 0.0f ; } |