[Plib-cvs] plib/src/ssgAux ssgaScreenDump.cxx,NONE,1.1 ssgaScreenDump.h,NONE,1.1 Makefile.am,1.13,1.
Brought to you by:
sjbaker
From: Steve B. <sj...@us...> - 2003-06-27 08:15:19
|
Update of /cvsroot/plib/plib/src/ssgAux In directory sc8-pr-cvs1:/tmp/cvs-serv5328/plib/src/ssgAux Modified Files: Makefile.am ssgAux.h ssgaWaveSystem.cxx ssgaWaveSystem.h Added Files: ssgaScreenDump.cxx ssgaScreenDump.h Log Message: Fixed minor bugs all over, added Screen Dump command to ssgAux. --- NEW FILE: ssgaScreenDump.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 [...76 lines suppressed...] for ( i = 0 ; i < 404 ; i++ ) writeByte ( fd, 0 ) ; /* Dummy field */ for ( int z = 0 ; z < 3 ; z++ ) for ( int y = 0 ; y < ysize ; y++ ) { for ( i = 0 ; i < xsize ; i++ ) row [ i ] = buffer [ ( y * xsize + i ) * 3 + z ] ; fseek ( fd, ( z * ysize + y ) * xsize + 512, SEEK_SET ) ; fwrite ( row, 1, xsize, fd ) ; } fclose ( fd ) ; delete row ; delete buffer ; } --- NEW FILE: ssgaScreenDump.h --- void ssgaScreenDump ( char *filename, int width, int height ) ; Index: Makefile.am =================================================================== RCS file: /cvsroot/plib/plib/src/ssgAux/Makefile.am,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- Makefile.am 31 Aug 2002 22:21:21 -0000 1.13 +++ Makefile.am 27 Jun 2003 08:15:15 -0000 1.14 @@ -7,6 +7,7 @@ ssgaLensFlare.h \ ssgaParticleSystem.h \ ssgaWaveSystem.h \ + ssgaScreenDump.h \ ssgaFire.h libplibssgaux_a_SOURCES = ssgAux.cxx \ @@ -17,6 +18,7 @@ ssgaLensFlare.cxx \ ssgaLensFlareTexture.cxx \ ssgaFire.cxx \ + ssgaScreenDump.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.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- ssgAux.h 2 Sep 2002 06:05:49 -0000 1.17 +++ ssgAux.h 27 Jun 2003 08:15:15 -0000 1.18 @@ -31,6 +31,7 @@ #include "ssgaFire.h" #include "ssgaWaveSystem.h" #include "ssgaLensFlare.h" +#include "ssgaScreenDump.h" #define _SSGA_TYPE_SHAPE 0x00008000 Index: ssgaWaveSystem.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssgAux/ssgaWaveSystem.cxx,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- ssgaWaveSystem.cxx 2 Sep 2002 06:05:49 -0000 1.10 +++ ssgaWaveSystem.cxx 27 Jun 2003 08:15:15 -0000 1.11 @@ -80,16 +80,16 @@ int idx = i * (nstrips+1) + j ; - float x0 = orig_vertices [idx][0] + center[0] ; - float y0 = orig_vertices [idx][1] + center[1] ; - float z0 = vertices [idx][2] ; + float xx = orig_vertices [idx][0] + center[0] ; + float yy = orig_vertices [idx][1] + center[1] ; + float zz = center[2] ; + float x0 = xx + offset[0] ; + float y0 = yy + offset[1] ; + float z0 = vertices [idx][2] ; + float depth = (gridGetter==NULL) ? 1000000.0f : gridGetter ( x0, y0 ) ; - float xx = x0 ; - float yy = y0 ; - float zz = center[2] ; - for ( int t = 0 ; t < num_trains ; t++ ) { float adjHeight = height [ t ] * edge_fade ; @@ -190,6 +190,8 @@ nstrips = nstacks = 0 ; + offset [ 0 ] = offset [ 1 ] = 0.0f ; + normals = NULL ; colours = NULL ; texcoords = NULL ; @@ -256,10 +258,10 @@ float x = (float) j / (float) nstacks ; float y = (float) i / (float) nstrips ; - if ( j == 0 ) x = -500.0f ; - if ( j == nstacks ) x = 500.0f ; - if ( i == 0 ) y = -500.0f ; - if ( i == nstacks ) y = 500.0f ; + // if ( j == 0 ) x = -500.0f ; + // if ( j == nstacks ) x = 500.0f ; + // if ( i == 0 ) y = -500.0f ; + // if ( i == nstacks ) y = 500.0f ; sgSetVec3 ( vertices [idx], (x-0.5f) * size[0], (y-0.5f) * size[1], 0.0f ) ; Index: ssgaWaveSystem.h =================================================================== RCS file: /cvsroot/plib/plib/src/ssgAux/ssgaWaveSystem.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- ssgaWaveSystem.h 2 Sep 2002 06:05:49 -0000 1.5 +++ ssgaWaveSystem.h 27 Jun 2003 08:15:15 -0000 1.6 @@ -65,6 +65,7 @@ { ssgaWSDepthCallback gridGetter ; + sgVec2 offset ; sgVec3 *normals ; sgVec4 *colours ; sgVec2 *texcoords ; @@ -121,6 +122,8 @@ void setWindDirn ( float dirn ) { windHeading = dirn ; } void setEdgeFlatten ( float dist ) { edgeFlatten = dist ; } void setTexScale ( float u, float v ) { tu = u ; tv = v ; } + + void setOffset ( sgVec2 _offset ) { sgCopyVec2 ( offset, _offset ) ; } void updateAnimation ( float t ) ; } ; |