plib-cvs Mailing List for PLIB (Page 20)
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: James J. <pu...@us...> - 2003-05-22 11:48:45
|
Update of /cvsroot/plib/plib In directory sc8-pr-cvs1:/tmp/cvs-serv30767 Modified Files: configure.in Log Message: Fix sgi MipsPro compiliation - Erik Hofman ---------------------------------------------------------------------- Index: configure.in =================================================================== RCS file: /cvsroot/plib/plib/configure.in,v retrieving revision 1.51 retrieving revision 1.52 diff -u -d -r1.51 -r1.52 --- configure.in 11 Mar 2003 13:19:23 -0000 1.51 +++ configure.in 22 May 2003 11:27:17 -0000 1.52 @@ -376,8 +376,8 @@ CFLAGS="-pthread $CFLAGS" AC_CHECK_LIB(c_r, pthread_exit) if test "x$ac_cv_lib_c_r_pthread_exit" != "xyes"; then - CFLAGS="$CFLAGS -pthread" - CXXFLAGS="$CXXFLAGS -pthread" + CFLAGS=$save_CFLAGS + CXXFLAGS=$save_CXXFLAGS fi LIBS=$save_LIBS |
From: James J. <pu...@us...> - 2003-05-21 23:42:03
|
Update of /cvsroot/plib/plib/src/ssg In directory sc8-pr-cvs1:/tmp/cvs-serv10645 Modified Files: ssgEntity.cxx Log Message: John Fay's optimizations to the Line of Sight code ---------------------------------------------------------------------- Index: ssgEntity.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgEntity.cxx,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- ssgEntity.cxx 29 Nov 2002 19:39:48 -0000 1.23 +++ ssgEntity.cxx 21 May 2003 23:41:59 -0000 1.24 @@ -302,13 +302,14 @@ ssgCullResult ssgEntity::hot_test ( sgVec3 s, sgMat4 m, int test_needed ) { + /* Height-Off-Terrain Test */ stats_hot_test++ ; if ( !test_needed ) -{ -stats_hot_triv_accept++ ; + { + stats_hot_triv_accept++ ; [...85 lines suppressed...] -stats_los_straddle++ ; + /* Calculate the distance from the line to the center of the sphere */ + sgVec3 oc ; + sgSubVec3 ( oc, p1, center ) ; + + float dmin2 = sgSquare ( oc[0] ) + sgSquare ( oc[1] ) + sgSquare ( oc[2] ) + - sgSquare ( oc[0] * s[0] + oc[1] * s[1] + oc[2] * s[2] ) / + ( sgSquare ( s[0] ) + sgSquare ( s[1] ) + sgSquare ( s[2] ) ) ; + + /* Compare minimum distance squared with sphere radius squared */ + if ( dmin2 > sgSquare ( tmp.getRadius () ) ) + { + stats_los_radius_reject++; + return SSG_OUTSIDE; + } + + stats_los_straddle++ ; return SSG_STRADDLE ; } |
From: James J. <pu...@us...> - 2003-05-18 13:49:36
|
Update of /cvsroot/plib/plib/src/js In directory sc8-pr-cvs1:/tmp/cvs-serv28770 Modified Files: js.dsp Log Message: Modified by John Fay with new .cxx source files. ---------------------------------------------------------------------- Index: js.dsp =================================================================== RCS file: /cvsroot/plib/plib/src/js/js.dsp,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- js.dsp 1 Sep 2002 13:19:17 -0000 1.16 +++ js.dsp 18 May 2003 13:49:33 -0000 1.17 @@ -1,104 +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". [...201 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: James J. <pu...@us...> - 2003-05-18 13:45:09
|
Update of /cvsroot/plib/plib/src/sl In directory sc8-pr-cvs1:/tmp/cvs-serv23894 Modified Files: slDSP.cxx slScheduler.cxx sl.h slPortability.h Log Message: Patches by Bert Driehuis and Melchior Franz. Improved FreeBSD support. ---------------------------------------------------------------------- Index: slDSP.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/sl/slDSP.cxx,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- slDSP.cxx 4 Jan 2003 02:55:55 -0000 1.20 +++ slDSP.cxx 18 May 2003 13:45:04 -0000 1.21 @@ -413,7 +413,7 @@ /* NetBSD/OpenBSD 2.3 this should be very close to SUN Audio */ /* ------------------------------------------------------------ */ -#elif defined(UL_BSD) || defined(UL_SOLARIS) +#elif (defined(UL_BSD) && !defined(__FreeBSD__)) || defined(UL_SOLARIS) void slDSP::open ( const char *device, int _rate, int _stereo, int _bps ) { Index: slScheduler.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/sl/slScheduler.cxx,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- slScheduler.cxx 2 Sep 2002 06:05:47 -0000 1.9 +++ slScheduler.cxx 18 May 2003 13:45:04 -0000 1.10 @@ -36,7 +36,7 @@ mixer_buffer = NULL ; /* Note there is a required null element on the end of array */ for ( mi=0; mi <= SL_MAX_MIXERINPUTS; mi++ ) - mixer_inputs[mi] = NULL ; + mixer_inputs[mi] = NULL ; current = this ; mixer_gain = 0x100 ; /* When we have to make sound quieter */ @@ -84,6 +84,10 @@ setMaxConcurrent ( 0 ); mixer_buffer_size = getDriverBufferSize () ; + int div = 1; + if ( getStereo() ) div *= 2 ; + if ( getBps() == 16 ) div *= 2 ; + seconds_per_buffer = (float)mixer_buffer_size / ( div * getRate() ) ; mixer_buffer = new Uchar [ mixer_buffer_size ] ; memset ( mixer_buffer, 0x80, mixer_buffer_size ) ; @@ -132,7 +136,7 @@ int i ; - while ( secondsUsed() <= safety_margin ) + while ( ( secondsUsed() <= safety_margin ) && ( secondsRemaining() >= seconds_per_buffer ) ) { slPlayer *psp [ SL_MAX_MIXERINPUTS ] ; int pri [ SL_MAX_MIXERINPUTS ] ; @@ -146,7 +150,7 @@ /* Ignore non-existent channels */ if ( player [ i ] == NULL ) - continue ; + continue ; /* Clean up dead sample players */ @@ -155,15 +159,15 @@ if ( player [ i ] == music ) music = NULL ; - delete player [ i ] ; - player [ i ] = NULL ; - continue ; + delete player [ i ] ; + player [ i ] = NULL ; + continue ; } /* Skip paused players, but leave them alone */ if ( player [ i ] -> isPaused () ) - continue ; + continue ; /* This one is viable, make sure we have room */ @@ -174,9 +178,11 @@ ( mypri > pri[lowest] ) ) { /* Not enough room; get rid of someone */ - player[lowest] -> preempt ( mixer_buffer_size ) ; - psp[lowest] = player[i] ; - pri[lowest] = mypri ; + if ( player[lowest] != NULL ) + player[lowest] -> preempt ( mixer_buffer_size ) ; + + psp[lowest] = player[i] ; + pri[lowest] = mypri ; int j; for ( j = 0; j < inputsused; j++ ) if ( pri[lowest] < pri[j] ) @@ -186,7 +192,7 @@ { /* Ok, we've got room, presumably, for another item */ psp[inputsused] = player[i]; pri[inputsused] = mypri; - if ( ( ( inputsused ++ ) == 0 ) || + if ( ( ( inputsused ++ ) == 0 ) || ( pri[lowest] > mypri ) ) lowest = inputsused; } @@ -258,7 +264,7 @@ /* We compute one value in here, in the loop below */ register int t ; /* We need to determine the maximum range of values */ - int tmax = 0x80, tmin = 0x80; + int tmax = 0x80, tmin = 0x80; /* A pointer to the element about to be added to "t" */ register Uchar **p ; /* Sound cards use offset binary, so do zero adjustment */ Index: sl.h =================================================================== RCS file: /cvsroot/plib/plib/src/sl/sl.h,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- sl.h 4 Jan 2003 02:55:55 -0000 1.22 +++ sl.h 18 May 2003 13:45:04 -0000 1.23 @@ -73,15 +73,15 @@ int error ; int fd ; -#ifdef UL_BSD +#if defined(SL_USING_OSS_AUDIO) + audio_buf_info buff_info ; +#elif defined(UL_BSD) audio_info_t ainfo; // ioctl structure audio_offset_t audio_offset; // offset in audiostream long counter; // counter-written packets #elif defined(UL_SOLARIS) audio_info_t ainfo; long counter; -#elif defined(SL_USING_OSS_AUDIO) - audio_buf_info buff_info ; #elif defined(UL_IRIX) ALconfig config; // configuration stuff ALport port; // .. we are here @@ -645,6 +645,7 @@ float safety_margin ; int mixer_buffer_size, mixer_gain ; + float seconds_per_buffer; Uchar *mixer_buffer ; Uchar *mixer_inputs [ SL_MAX_MIXERINPUTS + 1 ] ; Index: slPortability.h =================================================================== RCS file: /cvsroot/plib/plib/src/sl/slPortability.h,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- slPortability.h 30 Nov 2002 13:18:56 -0000 1.13 +++ slPortability.h 18 May 2003 13:45:04 -0000 1.14 @@ -75,7 +75,9 @@ #endif #ifdef UL_BSD +#ifndef __FreeBSD__ # include <sys/audioio.h> +#endif #endif /* Tom */ |
From: James J. <pu...@us...> - 2003-04-28 20:28:38
|
Update of /cvsroot/plib/plib/src/pui In directory sc8-pr-cvs1:/tmp/cvs-serv19877 Modified Files: puLargeInput.cxx Log Message: Fix for scrolling left on an empty widget if wrapping is enabled by Simon <sickz6sickz AT hotmail DOT com> Index: puLargeInput.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/pui/puLargeInput.cxx,v retrieving revision 1.46 retrieving revision 1.47 diff -u -d -r1.46 -r1.47 --- puLargeInput.cxx 7 Feb 2003 16:04:24 -0000 1.46 +++ puLargeInput.cxx 28 Apr 2003 20:28:28 -0000 1.47 @@ -1025,25 +1025,37 @@ cursor_position++ ; select_start_position = select_end_position = cursor_position ; break ; + case PU_KEY_LEFT : case PU_KEY_RIGHT : - if ( key == PU_KEY_LEFT ) { - cursor_position-- ; /* Left key pressed */ - if (old_text [ cursor_position ] == '\n') - bottom_slider->setValue( ( (prev_line_width - box_width)<0 ) ? 0.0f : float(prev_line_width+10) / max_width); - /* If the cursor is going off the left edge of the box, scroll left. */ - else if ((bottom_value*max_width) > line_width_to_cursor+5) { - bottom_slider->setValue( ((bottom_value*max_width)-(box_width/2)-5)<0 ? 0.0f : - ((bottom_value*max_width)-(box_width/2)-5)/max_width ) ; - } - } else { - cursor_position++ ; /* Right key pressed */ - if (old_text [ cursor_position-1 ] == '\n') - bottom_slider->setValue(0.0f) ; - else if ((bottom_value*max_width)+(box_width) < line_width_to_cursor+5) { - bottom_slider->setValue( ((bottom_value*max_width)+(box_width/2)+5)/max_width ) ; - } - } + if ( key == PU_KEY_LEFT ) + { + /* This stops it crashing out sometimes when wrappable text is used. + * Since there is no bottom scrollbar when wrapped text is turned on, the bottom + * slider code could make the application die when the user pressed the left + * cursor key before they began the first line. + * Fix by Simon <sickz6sickz AT hotmail DOT com> */ + cursor_position-- ; /* Left key pressed */ + if ( bottom_slider ) + { + if (old_text [ cursor_position ] == '\n') + bottom_slider->setValue( ( (prev_line_width - box_width)<0 ) ? 0.0f : float(prev_line_width+10) /max_width); + /* If the cursor is going off the left edge of the box, scroll left. */ + else if ((bottom_value*max_width) > line_width_to_cursor+5) { + bottom_slider->setValue( ((bottom_value*max_width)-(box_width/2)-5)<0 ? 0.0f : + ((bottom_value*max_width)-(box_width/2)-5)/max_width ) ; + } + } + } else { + cursor_position++ ; /* Right key pressed */ + if ( bottom_slider ) { + if (old_text [ cursor_position-1 ] == '\n') + bottom_slider->setValue(0.0f) ; + else if ((bottom_value*max_width)+(box_width) < line_width_to_cursor+5) { + bottom_slider->setValue( ((bottom_value*max_width)+(box_width/2)+5)/max_width ) ; + } + } + } select_start_position = select_end_position = cursor_position ; break ; |
From: M?rten Str?m. <str...@us...> - 2003-04-17 13:10:16
|
Update of /cvsroot/plib/plib/src/ssg In directory sc8-pr-cvs1:/tmp/cvs-serv29482 Modified Files: ssgLoadFLT.cxx Log Message: Windows fixes from Paolo Leoncini Index: ssgLoadFLT.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgLoadFLT.cxx,v retrieving revision 1.38 retrieving revision 1.39 diff -u -d -r1.38 -r1.39 --- ssgLoadFLT.cxx 1 Feb 2003 11:46:11 -0000 1.38 +++ ssgLoadFLT.cxx 17 Apr 2003 13:10:12 -0000 1.39 @@ -2715,7 +2715,27 @@ static struct snode *FltCache; -#define win32_perror(s) perror(s) /* no idea if this is appropriate.. */ +#ifdef UL_WIN32 + +static void win32_perror(const char *s) +{ + LPVOID lpMsgBuf; + FormatMessage( + FORMAT_MESSAGE_ALLOCATE_BUFFER | + FORMAT_MESSAGE_FROM_SYSTEM | + FORMAT_MESSAGE_IGNORE_INSERTS, + NULL, + GetLastError(), + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), + (LPTSTR) &lpMsgBuf, + 0, + NULL + ); + fprintf(stderr, "%s: %s\n", s, lpMsgBuf); + LocalFree( lpMsgBuf ); +} + +#endif static ssgEntity *LoadFLT(const char *file) { @@ -2755,7 +2775,7 @@ #ifdef USE_WIN32_MMAP - fd = CreateFile(path, GENERIC_READ, 0, NULL, OPEN_EXISTING, + fd = CreateFile(path, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0); if (fd == INVALID_HANDLE_VALUE) { win32_perror(path); |
From: James J. <pu...@us...> - 2003-04-10 12:36:32
|
Update of /cvsroot/plib/plib/src/js In directory sc8-pr-cvs1:/tmp/cvs-serv14286 Modified Files: jsLinux.cxx Log Message: remove trailing spaces. ---------------------------------------------------------------------- Index: jsLinux.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/js/jsLinux.cxx,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- jsLinux.cxx 10 Apr 2003 11:47:19 -0000 1.2 +++ jsLinux.cxx 10 Apr 2003 12:36:27 -0000 1.3 @@ -57,9 +57,9 @@ */ unsigned char u ; ioctl ( fd, JSIOCGAXES , &u ) ; - num_axes = u ; + num_axes = u ; ioctl ( fd, JSIOCGBUTTONS, &u ) ; - num_buttons = u ; + num_buttons = u ; ioctl ( fd, JSIOCGNAME ( sizeof(name) ), name ) ; fcntl ( fd, F_SETFL , O_NONBLOCK ) ; |
From: James J. <pu...@us...> - 2003-04-10 11:47:23
|
Update of /cvsroot/plib/plib/src/js In directory sc8-pr-cvs1:/tmp/cvs-serv22678 Modified Files: jsLinux.cxx Log Message: Melchior Franz's fixes for big-endian Linuxes and the new js code. ---------------------------------------------------------------------- Index: jsLinux.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/js/jsLinux.cxx,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- jsLinux.cxx 29 Nov 2002 19:39:48 -0000 1.1 +++ jsLinux.cxx 10 Apr 2003 11:47:19 -0000 1.2 @@ -51,8 +51,15 @@ Set the correct number of axes for the linux driver */ - ioctl ( fd, JSIOCGAXES , &num_axes ) ; - ioctl ( fd, JSIOCGBUTTONS, &num_buttons ) ; + /* Melchior Franz's fixes for big-endian Linuxes since writing + * to the upper byte of an uninitialized word doesn't work. + * 9 April 2003 + */ + unsigned char u ; + ioctl ( fd, JSIOCGAXES , &u ) ; + num_axes = u ; + ioctl ( fd, JSIOCGBUTTONS, &u ) ; + num_buttons = u ; ioctl ( fd, JSIOCGNAME ( sizeof(name) ), name ) ; fcntl ( fd, F_SETFL , O_NONBLOCK ) ; |
From: James J. <pu...@us...> - 2003-03-11 13:19:26
|
Update of /cvsroot/plib/plib In directory sc8-pr-cvs1:/tmp/cvs-serv21939 Modified Files: configure.in Log Message: Bert Driehuis / Fixes for FreeBSD's pthread compiler switch Index: configure.in =================================================================== RCS file: /cvsroot/plib/plib/configure.in,v retrieving revision 1.50 retrieving revision 1.51 diff -u -d -r1.50 -r1.51 --- configure.in 13 Dec 2002 14:40:07 -0000 1.50 +++ configure.in 11 Mar 2003 13:19:23 -0000 1.51 @@ -367,6 +367,19 @@ CFLAGS="$CFLAGS $WFLAG" CXXFLAGS="$CXXFLAGS $WFLAG" +dnl FreeBSD requires the -pthread switch to enable pthreads. Look for this +dnl weirdness. +save_CXXFLAGS="$CXXFLAGS" +save_CFLAGS="$CFLAGS" +save_LIBS=$LIBS +CXXFLAGS="-pthread $CXXFLAGS" +CFLAGS="-pthread $CFLAGS" +AC_CHECK_LIB(c_r, pthread_exit) +if test "x$ac_cv_lib_c_r_pthread_exit" != "xyes"; then + CFLAGS="$CFLAGS -pthread" + CXXFLAGS="$CXXFLAGS -pthread" +fi +LIBS=$save_LIBS dnl Checks for typedefs, structures, and compiler characteristics. |
From: Per L. <li...@us...> - 2003-03-08 15:32:02
|
Update of /cvsroot/plib/plib/src/ssg In directory sc8-pr-cvs1:/tmp/cvs-serv11790 Modified Files: ssgSave3ds.cxx Log Message: Fixed issue which made it impossible to save transformation nodes correctly. Added a simple check for not creating too many materials. Index: ssgSave3ds.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgSave3ds.cxx,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- ssgSave3ds.cxx 15 Sep 2002 01:29:12 -0000 1.8 +++ ssgSave3ds.cxx 8 Mar 2003 15:31:59 -0000 1.9 @@ -198,7 +198,7 @@ } static _ssgSave3dsChunk* create_vertex_chunk( ssgLeaf* leaf, - sgMat4 transform ) { + sgMat4 transform ) { _ssgSave3dsChunk* vertexlist = new _ssgSave3dsChunk( CHUNK_VERTLIST ); unsigned short *num_verts; @@ -208,10 +208,10 @@ num_verts = new unsigned short; *num_verts = leaf->getNumVertices(); nverts = new _ssgSave3dsData(num_verts, 2, 1); - + vdata = new float[ *num_verts * 3]; for (int i = 0; i < *num_verts; i++) { - sgXformVec3(&vdata[i*3], leaf->getVertex(i), transform); + sgXformPnt3(&vdata[i*3], leaf->getVertex(i), transform); } _ssgSave3dsData *vertices = new _ssgSave3dsData(vdata, 4, *num_verts * 3); @@ -304,7 +304,7 @@ } static _ssgSave3dsChunk* create_transform_chunk() { - // creates and identity transform + // creates an identity transform _ssgSave3dsChunk* transform = new _ssgSave3dsChunk( CHUNK_TRMATRIX ); float* matrix = new float[12]; @@ -434,7 +434,7 @@ sprintf(matname, "Material #%d", mat_count); } _ssgSave3dsData *matname_data = new _ssgSave3dsData(matname, 1, - strlen(matname) + 1); + strlen(matname) + 1); matname_chunk->addData(matname_data); mat->addKid(matname_chunk); @@ -446,6 +446,13 @@ state->getMaterial(GL_SPECULAR) ) ); mat->addKid( create_shininess_chunk( state->getShininess() ) ); + if (state->isEnabled(GL_COLOR_MATERIAL)) { + ulSetError(UL_WARNING, + "State \"%s\" has GL_COLOR_MATERIAL enabled, which " \ + "is not supported by 3DS format. Data will be lost.", + matname); + } + if (state->getTextureFilename() != NULL) { mat->addKid( create_map_chunk(state) ); } @@ -468,6 +475,8 @@ if (state == mat[i]) return; } + + assert(mat_count < MAX_MATERIALS); mat[mat_count++] = state; parent->addKid( create_material_chunk(state) ); |
From: M?rten Str?m. <str...@us...> - 2003-02-26 19:12:12
|
Update of /cvsroot/plib/plib/src/ssg In directory sc8-pr-cvs1:/tmp/cvs-serv12064 Modified Files: ssg.dsp Log Message: Added ssgLoadDOF.cxx and ssgSaveFLT.cxx (hopefully correct). Index: ssg.dsp =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssg.dsp,v retrieving revision 1.43 retrieving revision 1.44 diff -u -d -r1.43 -r1.44 --- ssg.dsp 15 Oct 2002 19:42:46 -0000 1.43 +++ ssg.dsp 26 Feb 2003 19:12:00 -0000 1.44 @@ -194,6 +194,10 @@ # End Source File # Begin Source File +SOURCE=.\ssgLoadDOF.cxx +# End Source File +# Begin Source File + SOURCE=.\ssgLoadDXF.cxx # End Source File # Begin Source File @@ -331,6 +335,10 @@ # Begin Source File SOURCE=.\ssgSaveDXF.cxx +# End Source File +# Begin Source File + +SOURCE=.\ssgSaveFLT.cxx # End Source File # Begin Source File |
From: M?rten Str?m. <str...@us...> - 2003-02-26 19:11:15
|
Update of /cvsroot/plib/plib/src/ssg In directory sc8-pr-cvs1:/tmp/cvs-serv11333 Modified Files: ssg.h Log Message: Static variables must not be _SSG_PUBLIC. Index: ssg.h =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssg.h,v retrieving revision 1.161 retrieving revision 1.162 diff -u -d -r1.161 -r1.162 --- ssg.h 29 Jan 2003 19:33:40 -0000 1.161 +++ ssg.h 26 Feb 2003 19:10:53 -0000 1.162 @@ -1822,6 +1822,7 @@ int start ; int end ; +protected: ssgAnimTimeMode time_mode ; static ulClock ck ; @@ -1833,7 +1834,6 @@ loop_time += times [ k ] ; } -protected: virtual void copy_from ( ssgTimedSelector *src, int clone_flags ) ; double get_time() const |
From: Norman V. <nh...@us...> - 2003-02-07 17:41:11
|
Update of /cvsroot/plib/plib/src/pui In directory sc8-pr-cvs1:/tmp/cvs-serv20522 Modified Files: puButton.cxx Log Message: from John Fay - Fix a highlighting/lowlighting problem and remove a couple of compiler warnings. Index: puButton.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/pui/puButton.cxx,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- puButton.cxx 2 Sep 2002 06:05:45 -0000 1.20 +++ puButton.cxx 7 Feb 2003 17:41:07 -0000 1.21 @@ -115,8 +115,8 @@ glBegin ( GL_POLYGON ) ; for ( theta = -SG_PI ; theta <= SG_PI ; theta += dtheta ) - glVertex2f ( dx + abox.min[0] + rad + (rad * cos ( theta )), - dy + abox.min[1] + rad + (rad * sin ( theta )) ) ; + glVertex2f ( dx + abox.min[0] + rad + (rad * float(cos ( theta ))), + dy + abox.min[1] + rad + (rad * float(sin ( theta ))) ) ; glEnd () ; if ( getIntegerValue () ^ highlighted ) @@ -137,8 +137,8 @@ glBegin ( GL_POLYGON ) ; for ( theta = -SG_PI ; theta <= SG_PI ; theta += dtheta ) - glVertex2f ( dx + abox.min[0] + rad*2 + (rad * cos ( theta )), - dy + abox.min[1] + rad*2 + (rad * sin ( theta )) ) ; + glVertex2f ( dx + abox.min[0] + rad*2 + (rad * float(cos ( theta ))), + dy + abox.min[1] + rad*2 + (rad * float(sin ( theta ))) ) ; glEnd () ; } @@ -220,7 +220,13 @@ invokeCallback () ; } else - highlight () ; + { + /* If the mouse is over the widget, highlight it; otherwise lowlight it */ + if ( ( abox.min[0] <= x ) && ( abox.max[0] >= x ) && ( abox.min[1] <= y ) && ( abox.max[1] >= y ) ) + highlight () ; + else + lowlight () ; + } } else lowlight () ; |
From: Norman V. <nh...@us...> - 2003-02-07 17:01:12
|
Update of /cvsroot/plib/plib/src/pui In directory sc8-pr-cvs1:/tmp/cvs-serv28867 Modified Files: pu.h puGroup.cxx puMenuBar.cxx puSpinBox.cxx puValue.cxx Log Message: from John Fay - this batch of changes fixes a bug in the spin box arrow button sizing and label printing and declares the 'floating' variable deprecated. It also adds an active callback capability to the spin box. Index: pu.h =================================================================== RCS file: /cvsroot/plib/plib/src/pui/pu.h,v retrieving revision 1.138 retrieving revision 1.139 diff -u -d -r1.138 -r1.139 --- pu.h 7 Feb 2003 16:04:23 -0000 1.138 +++ pu.h 7 Feb 2003 17:01:02 -0000 1.139 @@ -842,7 +842,7 @@ void doHit ( int button, int updown, int x, int y ) ; - int floating; // Flag telling whether the interface floats in the window or stays put + int floating; // DEPRECATED! -- Flag telling whether the interface floats in the window or stays put public: @@ -854,7 +854,7 @@ mouse_x = 0 ; mouse_y = 0 ; [...79 lines suppressed...] + input_box->setPosition ( ibox.min[0], ibox.min[1] ) ; + abox.min[0] += xpos ; + xpos = 0 ; + } + + if ( height > 0.5f ) /* Adjust the input box to be up from the bottom */ + { + input_box->setPosition ( ibox.min[0], ibox.min[1] + size - ymid ) ; + abox.min[1] += ymid - size ; + ymid = size ; + } + else /* Input box is at the bottom of the group area */ + { + input_box->setPosition ( ibox.min[0], 0 ) ; + abox.min[1] += ibox.min[1] ; + } + up_arrow->setPosition ( xpos, ymid ) ; down_arrow->setPosition ( xpos, ymid - size ) ; recalc_bbox() ; Index: puGroup.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/pui/puGroup.cxx,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- puGroup.cxx 7 Feb 2003 15:02:50 -0000 1.24 +++ puGroup.cxx 7 Feb 2003 17:01:03 -0000 1.25 @@ -220,7 +220,7 @@ */ if ( mouse_active || ( isHit ( x+abox.min[0], y+abox.min[1]) && - floating && ( button == PU_RIGHT_BUTTON ) ) ) + floating && ( button == PU_RIGHT_BUTTON ) ) ) // DEPRECATED! -- we need to replace this code. { puMoveToLast ( this ); @@ -313,6 +313,8 @@ bo -> draw ( xdraw, ydraw ) ; } + + if ( getWindow () == puGetWindow () ) draw_label ( dx, dy ) ; } Index: puMenuBar.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/pui/puMenuBar.cxx,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- puMenuBar.cxx 2 Sep 2002 06:05:46 -0000 1.19 +++ puMenuBar.cxx 7 Feb 2003 17:01:03 -0000 1.20 @@ -49,7 +49,7 @@ #ifndef PU_NOT_USING_GLUT puGroup *parent = p -> getParent () ; - if ( ( parent != parent -> getParent () ) && parent -> getFloating () ) + if ( ( parent != parent -> getParent () ) && parent -> getFloating () ) // DEPRECATED! -- we need to replace this code. { int temp_window = puGetWindow () ; glutSetWindow ( parent -> getWindow () ) ; Index: puSpinBox.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/pui/puSpinBox.cxx,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- puSpinBox.cxx 21 Sep 2002 15:59:56 -0000 1.6 +++ puSpinBox.cxx 7 Feb 2003 17:01:03 -0000 1.7 @@ -31,6 +31,7 @@ puRange ( 1.0f, 10.0f, 1.0f ), puGroup ( minx, miny ) { extern void puSpinBox_handle_input ( puObject* ob ) ; + extern void puSpinBox_handle_input_active ( puObject* ob ) ; extern void puSpinBox_handle_arrow ( puObject* ob ) ; type |= PUCLASS_SPINBOX ; arrow_position = arrow_pos ; @@ -41,6 +42,7 @@ input_box = new puInput ( arrow_size, 0, maxx - minx, maxy - miny ) ; input_box->setCallback ( puSpinBox_handle_input ) ; + input_box->setActiveCallback ( puSpinBox_handle_input_active ) ; input_box->setDownCallback ( puSpinBox_handle_input ) ; input_box->setUserData ( this ) ; @@ -80,5 +82,15 @@ if ( val < master->getMinValue () ) val = master->getMinValue () ; master->setValue ( val ) ; master->invokeCallback () ; +} + +void puSpinBox_handle_input_active ( puObject *ob ) +{ + puSpinBox *master = (puSpinBox *)(ob->getUserData ()) ; + float val = ob->getFloatValue () ; + if ( val > master->getMaxValue () ) val = master->getMaxValue () ; + if ( val < master->getMinValue () ) val = master->getMinValue () ; + master->setValue ( val ) ; + master->invokeActiveCallback () ; } Index: puValue.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/pui/puValue.cxx,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- puValue.cxx 15 Sep 2002 00:56:38 -0000 1.23 +++ puValue.cxx 7 Feb 2003 17:01:04 -0000 1.24 @@ -162,6 +162,8 @@ { int i = getType () ; + if ( i & PUCLASS_SCROLLBAR ) return "puScrollBar" ; + if ( i & PUCLASS_SPINBOX ) return "puSpinBox" ; if ( i & PUCLASS_SELECTBOX ) return "puSelectBox" ; if ( i & PUCLASS_COMBOBOX ) return "puComboBox" ; if ( i & PUCLASS_LARGEINPUT ) return "puLargeInput" ; |
From: Norman V. <nh...@us...> - 2003-02-07 16:04:29
|
Update of /cvsroot/plib/plib/src/pui In directory sc8-pr-cvs1:/tmp/cvs-serv26203 Modified Files: pu.h puInput.cxx puLargeInput.cxx Log Message: changes from John Fay fix some compiler warnings in 'puInput' and 'puLargeInput'. It also fixes a couple of bugs dealing with order of operations. Finally, it keeps the 'puInput' cursor visible by scrolling the text. Index: pu.h =================================================================== RCS file: /cvsroot/plib/plib/src/pui/pu.h,v retrieving revision 1.137 retrieving revision 1.138 diff -u -d -r1.137 -r1.138 --- pu.h 7 Feb 2003 15:02:49 -0000 1.137 +++ pu.h 7 Feb 2003 16:04:23 -0000 1.138 @@ -1522,7 +1522,7 @@ void setValidData ( const char *data ) { delete [] valid_data ; - valid_data = data != NULL ? ulStrDup ( data ) : NULL ; + valid_data = ( data != NULL ) ? ulStrDup ( data ) : NULL ; } void addValidData ( const char *data ) ; @@ -1538,7 +1538,7 @@ void disableInput ( void ) { input_disabled = TRUE ; } int inputDisabled ( void ) const { return input_disabled ; } - puInputBase ( puObject *wgt ) + puInputBase ( void ) { accepting = FALSE ; cursor_position = 0 ; @@ -1546,7 +1546,7 @@ select_end_position = -1 ; valid_data = NULL; - widget = wgt ; + widget = (puObject *)NULL ; input_disabled = FALSE ; } @@ -1572,12 +1572,14 @@ } puInput ( int minx, int miny, int maxx, int maxy ) : - puInputBase ( this ), puObject ( minx, miny, maxx, maxy ) + puInputBase (), puObject ( minx, miny, maxx, maxy ) { type |= PUCLASS_INPUT ; setColourScheme ( 0.8f, 0.7f, 0.7f ) ; /* Yeukky Pink */ setColour ( PUCOL_MISC, 0.1f, 0.1f, 1.0f ) ; /* Colour of 'I' bar cursor */ + + widget = this ; } } ; Index: puInput.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/pui/puInput.cxx,v retrieving revision 1.31 retrieving revision 1.32 diff -u -d -r1.31 -r1.32 --- puInput.cxx 27 Sep 2002 23:53:52 -0000 1.31 +++ puInput.cxx 7 Feb 2003 16:04:24 -0000 1.32 @@ -27,20 +27,32 @@ UL_RTTI_DEF2(puInput,puInputBase,puObject) -static char *chop_to_width ( puFont fnt, const char *s, int width, int *ncut ) +static char *chop_to_width ( puFont fnt, const char *s, int width, int cursor_position, int *ncut ) { - char *res = new char [ strlen ( s ) + 1 ] ; + int new_len = strlen ( s ) ; + char *res = new char [ new_len + 1 ] ; int n = 0 ; int w ; do { - strcpy ( res, & s[n] ) ; + memcpy ( res, s + n, new_len + 1 ) ; n++ ; + new_len -- ; w = fnt.getStringWidth ( res ) + 2 * PUSTR_RGAP + PUSTR_LGAP ; - } while ( w >= width ) ; + } while ( ( w >= width ) && ( n < cursor_position - 1 ) ) ; - if ( ncut != NULL ) *ncut = n-1 ; + if ( ncut != NULL ) *ncut = n - 1 ; + + n = 0 ; + + while ( w >= width ) + { + res[new_len] = '\0' ; + n++ ; + new_len -- ; + w = fnt.getStringWidth ( res ) + 2 * PUSTR_RGAP + PUSTR_LGAP ; + } return res ; } @@ -74,7 +86,7 @@ if ( select_end_position > 0 && select_end_position != select_start_position ) { - s2 = chop_to_width ( legendFont, getStringValue(), abox.max[0]-abox.min[0], &ncut ) ; + s2 = chop_to_width ( legendFont, getStringValue(), abox.max[0]-abox.min[0], getCursor (), &ncut ) ; int sep = select_end_position - ncut ; int ssp = select_start_position - ncut ; @@ -115,7 +127,7 @@ colour [ PUCOL_LEGEND ][3] / 2.0f ) ; /* 50% more transp */ s2 = chop_to_width ( legendFont, getStringValue(), - abox.max[0]-abox.min[0], &ncut ) ; + abox.max[0]-abox.min[0], getCursor (), &ncut ) ; legendFont.drawString ( s2, dx + abox.min[0] + xx, @@ -178,7 +190,7 @@ int ncut ; char *s2 = chop_to_width ( legendFont, getStringValue(), - abox.max[0]-abox.min[0], &ncut ) ; + abox.max[0]-abox.min[0], getCursor (), &ncut ) ; int i = strlen ( s2 ) ; int length, prev_length ; Index: puLargeInput.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/pui/puLargeInput.cxx,v retrieving revision 1.45 retrieving revision 1.46 diff -u -d -r1.45 -r1.46 --- puLargeInput.cxx 27 Sep 2002 23:53:53 -0000 1.45 +++ puLargeInput.cxx 7 Feb 2003 16:04:24 -0000 1.46 @@ -66,7 +66,7 @@ // Public functions from the widget itself puLargeInput::puLargeInput ( int x, int y, int w, int h, int arrows, int sl_width, int wrap_text ) : - puInputBase ( this ), puGroup ( x, y ) + puInputBase (), puGroup ( x, y ) { setColour ( PUCOL_MISC, 0.1f, 0.1f, 1.0f ) ; // Colour of the 'I' bar cursor @@ -79,6 +79,8 @@ ( getLegendFont().getStringHeight() + getLegendFont().getStringDescender() + 1 ) ; top_line_in_window = 0 ; max_width = 0 ; + + widget = this ; // Set up the widgets |
From: Norman V. <nh...@us...> - 2003-02-07 15:25:48
|
Update of /cvsroot/plib/plib/src/util In directory sc8-pr-cvs1:/tmp/cvs-serv6161 Modified Files: ul.cxx Log Message: '_stat()' vs 'stat()' related changes from John Fay Index: ul.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/util/ul.cxx,v retrieving revision 1.31 retrieving revision 1.32 diff -u -d -r1.31 -r1.32 --- ul.cxx 29 Nov 2002 19:39:48 -0000 1.31 +++ ul.cxx 7 Feb 2003 15:25:44 -0000 1.32 @@ -162,14 +162,19 @@ bool ulFileExists ( const char *fileName ) { - struct stat buf ; +#ifdef UL_MSVC + struct _stat buf ; - if ( stat ( fileName, &buf ) < 0 ) + if ( _stat ( fileName, &buf ) < 0 ) return false ; -#ifdef UL_MSVC return ((S_IFREG & buf.st_mode ) !=0) ; #else + struct stat buf ; + + if ( stat ( fileName, &buf ) < 0 ) + return false ; + return ((S_ISREG ( buf.st_mode )) != 0) ; #endif } @@ -195,24 +200,24 @@ static int recursiveFindFileInSubDirs ( char * filenameOutput, - const char * tPath, const char * tfnameInput ) + const char * tPath, const char * tfnameInput ) { int bFound = FALSE; char tempString [ 1024 ]; - ulMakePath ( filenameOutput, tPath, tfnameInput ) ; + ulMakePath ( filenameOutput, tPath, tfnameInput ) ; - if ( ulFileExists ( filenameOutput ) ) - return TRUE; + if ( ulFileExists ( filenameOutput ) ) + return TRUE; - ulDir* dirp = ulOpenDir(tPath); + ulDir* dirp = ulOpenDir(tPath); - if ( dirp != NULL ) - { - ulDirEnt* dp; + if ( dirp != NULL ) + { + ulDirEnt* dp; - while ( ! bFound && ((dp = ulReadDir(dirp)) != NULL ) ) - { + while ( ! bFound && ((dp = ulReadDir(dirp)) != NULL ) ) + { // I am doing recursive ulOpenDir/ulReadDirs here. // I know this works under Windo$. if ( dp->d_isdir && @@ -224,17 +229,17 @@ tempString, tfnameInput ); } - } - ulCloseDir ( dirp ) ; - } + } + ulCloseDir ( dirp ) ; + } - return bFound ; + return bFound; } void ulFindFile( char *filenameOutput, const char *path, - const char * tfnameInput, const char *sAPOM ) + const char * tfnameInput, const char *sAPOM ) /* adds tfnameInput to the path and puts this into the buffer filenameOutput. sAPOM is used iff path contains "$(APOM)" |
From: Norman V. <nh...@us...> - 2003-02-07 15:02:54
|
Update of /cvsroot/plib/plib/src/pui In directory sc8-pr-cvs1:/tmp/cvs-serv26704 Modified Files: pu.cxx pu.h puGroup.cxx puInterface.cxx Log Message: changes from John Fay allowing PUI to shut down gracefully Index: pu.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/pui/pu.cxx,v retrieving revision 1.63 retrieving revision 1.64 diff -u -d -r1.63 -r1.64 --- pu.cxx 1 Dec 2002 18:21:47 -0000 1.63 +++ pu.cxx 7 Feb 2003 15:02:49 -0000 1.64 @@ -207,7 +207,7 @@ } -static void puCleanUpJunk ( void ) +void puCleanUpJunk ( void ) { puObject * local_objects_to_delete = objects_to_delete ; objects_to_delete = NULL ; @@ -215,8 +215,17 @@ while ( local_objects_to_delete != NULL ) { puObject *next_ob = local_objects_to_delete -> getNextObject() ; - delete local_objects_to_delete ; + delete local_objects_to_delete ; local_objects_to_delete = next_ob ; + + /* If we've reached the end of the list, start over (in case we've deleted a group and + * it has put new widgets on the delete list) + */ + if ( local_objects_to_delete == NULL ) + { + local_objects_to_delete = objects_to_delete ; + objects_to_delete = NULL ; + } } } @@ -224,10 +233,10 @@ static puObject *active_widget ; /* Widget which is currently receiving user input */ static char *input_paste_buffer ; /* Cut/Copy/Paste buffer for input widgets */ +static int firsttime = TRUE ; + void puInit ( void ) { - static int firsttime = TRUE ; - if ( firsttime ) { if ( ! glIsValidContext () ) @@ -256,6 +265,15 @@ #endif } +} + +void puExit ( void ) +{ + if ( firsttime ) + ulSetError ( UL_FATAL, "puExit called without a previous call to puInit." ) ; + + delete puGetBaseLiveInterface () ; + firsttime = TRUE ; } static void puSetOpenGLState ( void ) Index: pu.h =================================================================== RCS file: /cvsroot/plib/plib/src/pui/pu.h,v retrieving revision 1.136 retrieving revision 1.137 diff -u -d -r1.136 -r1.137 --- pu.h 27 Sep 2002 23:53:52 -0000 1.136 +++ pu.h 7 Feb 2003 15:02:49 -0000 1.137 @@ -344,8 +344,9 @@ void puInit ( void ) ; +void puExit ( void ) ; void puDisplay ( void ) ; -void puDisplay ( int window_number ) ; +void puDisplay ( int window_number ) ; /* Deprecated */ int puMouse ( int button, int updown, int x, int y ) ; int puMouse ( int x, int y ) ; int puKeyboard ( int key, int updown ) ; Index: puGroup.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/pui/puGroup.cxx,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- puGroup.cxx 2 Sep 2002 06:05:45 -0000 1.23 +++ puGroup.cxx 7 Feb 2003 15:02:50 -0000 1.24 @@ -348,6 +348,8 @@ puGroup::~puGroup () { + void puCleanUpJunk ( void ) ; + puObject *bo = getLastChild () ; while ( bo != NULL ) @@ -356,6 +358,9 @@ bo = bo -> getPrevObject() ; puDeleteObject ( dlist ) ; } + + // Since this is an object destructor, it should be okay to delete the child objects as well. + puCleanUpJunk () ; } Index: puInterface.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/pui/puInterface.cxx,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- puInterface.cxx 2 Sep 2002 06:05:45 -0000 1.17 +++ puInterface.cxx 7 Feb 2003 15:02:50 -0000 1.18 @@ -106,6 +106,8 @@ puInterface::~puInterface () { + void puCleanUpJunk ( void ) ; + puObject *bo = getLastChild () ; while ( bo != NULL ) @@ -114,6 +116,9 @@ bo = bo -> getPrevObject() ; puDeleteObject ( dlist ) ; } + + // Since this is an object destructor, it should be okay to delete the child objects as well. + puCleanUpJunk () ; dlist = NULL ; |
From: M?rten Str?m. <str...@us...> - 2003-02-01 11:46:15
|
Update of /cvsroot/plib/plib/src/ssg In directory sc8-pr-cvs1:/tmp/cvs-serv17209 Modified Files: ssgLoadFLT.cxx Log Message: Fixed bug in instance definition/reference. Index: ssgLoadFLT.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgLoadFLT.cxx,v retrieving revision 1.37 retrieving revision 1.38 diff -u -d -r1.37 -r1.38 --- ssgLoadFLT.cxx 4 Jan 2003 02:55:55 -0000 1.37 +++ ssgLoadFLT.cxx 1 Feb 2003 11:46:11 -0000 1.38 @@ -167,6 +167,7 @@ #if !defined(BYTE_ORDER) || BYTE_ORDER != BIG_ENDIAN +#if !defined(BYTE_ORDER) static void _swab16(const void *src, void *dst, int n) { ushort *s = (ushort *)src; @@ -177,6 +178,7 @@ ((t & 0x00ffU) << 8)); } } [...186 lines suppressed...] ptr += len; break; case 63: /* External Reference */ /*ulSetError(UL_DEBUG, "external reference %s", ptr + 4);*/ - PostLink(stack + sp - 1, attr + sp - 1); + PostLink(stack + sp - 1, attr + sp - 1, instance[sp], state); + instance[sp] = -1; if (!NoExternals) { char *file = (char *)ptr + 4, *p; if ((p = strrchr(file, '/'))) @@ -2272,7 +2315,7 @@ /* pop stack (expected one iteration but may be more for incomplete databases) */ while (sp-- > 0) - PostLink(stack + sp, attr + sp); + PostLink(stack + sp, attr + sp, -1, 0); if (stack[0]) stack[0] = PostClean(stack[0], attr[0]); |
From: M?rten Str?m. <str...@us...> - 2003-01-30 00:52:02
|
Update of /cvsroot/plib/plib/src/ssg In directory sc8-pr-cvs1:/tmp/cvs-serv5928 Modified Files: ssgLoadTGA.cxx Log Message: Added RLE support. Index: ssgLoadTGA.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgLoadTGA.cxx,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- ssgLoadTGA.cxx 2 Sep 2002 06:05:48 -0000 1.9 +++ ssgLoadTGA.cxx 30 Jan 2003 00:51:59 -0000 1.10 @@ -26,14 +26,317 @@ #ifdef SSG_LOAD_TGA_SUPPORTED -#include <sys/stat.h> +//#include <sys/stat.h> /* * Submitted by Sam Stickland : sa...@sp... * Targe loading code based on code written Dave Gay : f0...@bi..., http://personal.nbnet.nb.ca/daveg/ + * + * Jan 29, 2003: [...297 lines suppressed...] + + return ssgMakeMipMaps ( pixels, xsize, ysize, zsize ); + + +#else // old loader: + + #define DEF_targaHeaderLength 12 #define DEF_targaHeaderContent "\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00" @@ -132,6 +435,9 @@ info -> alpha = is32Bit? 1: 0 ; } return ssgMakeMipMaps ( texels, width, height, 4) ; + + +#endif } #else |
From: Steve B. <sj...@us...> - 2003-01-29 19:33:44
|
Update of /cvsroot/plib/plib/src/ssg In directory sc8-pr-cvs1:/tmp/cvs-serv26555/plib/src/ssg Modified Files: Makefile.am ssg.cxx ssg.h Added Files: ssgLoadDOF.cxx Log Message: Added DOF loader for 'racer' files. --- NEW FILE: ssgLoadDOF.cxx --- /* PLIB - A Suite of Portable Game Libraries Copyright (C) 1998,2003 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 [...599 lines suppressed...] break ; case TOKEN_EDOF : cleanUp () ; return model ; case TOKEN_EOF : cleanUp () ; return NULL ; default : ulSetError ( UL_WARNING, "ssgLoadDOF: '%s' contains an unrecognised token?!?", filename ) ; cleanUp () ; return NULL ; } } } Index: Makefile.am =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/Makefile.am,v retrieving revision 1.40 retrieving revision 1.41 diff -u -d -r1.40 -r1.41 --- Makefile.am 17 Oct 2002 12:05:00 -0000 1.40 +++ Makefile.am 29 Jan 2003 19:33:40 -0000 1.41 @@ -7,7 +7,8 @@ libplibssg_a_SOURCES = ssg.cxx ssgAnimation.cxx ssgBase.cxx \ ssgBaseTransform.cxx ssgBranch.cxx ssgContext.cxx ssgCutout.cxx \ ssgDList.cxx ssgEntity.cxx ssgIsect.cxx ssgLeaf.cxx ssgList.cxx \ - ssgLoadAC.cxx ssgLocal.h ssgOptimiser.cxx ssgRoot.cxx ssgSaveAC.cxx \ + ssgLoadDOF.cxx ssgLoadAC.cxx \ + ssgLocal.h ssgOptimiser.cxx ssgRoot.cxx ssgSaveAC.cxx \ ssgSelector.cxx ssgSimpleState.cxx ssgState.cxx ssgStateTables.cxx \ ssgStats.cxx ssgTween.cxx ssgTweenController.cxx \ ssgTexTrans.cxx ssgTexture.cxx ssgTransform.cxx \ Index: ssg.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssg.cxx,v retrieving revision 1.62 retrieving revision 1.63 diff -u -d -r1.62 -r1.63 --- ssg.cxx 1 Dec 2002 18:21:47 -0000 1.62 +++ ssg.cxx 29 Jan 2003 19:33:40 -0000 1.63 @@ -129,6 +129,7 @@ ssgAddModelFormat ( ".3ds", ssgLoad3ds , ssgSave3ds ) ; ssgAddModelFormat ( ".ac" , ssgLoadAC3D , ssgSaveAC ) ; ssgAddModelFormat ( ".ase", ssgLoadASE , ssgSaveASE ) ; + ssgAddModelFormat ( ".dof", ssgLoadDOF , NULL ) ; ssgAddModelFormat ( ".dxf", ssgLoadDXF , ssgSaveDXF ) ; ssgAddModelFormat ( ".obj", ssgLoadOBJ , ssgSaveOBJ ) ; ssgAddModelFormat ( ".tri", ssgLoadTRI , ssgSaveTRI ) ; Index: ssg.h =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssg.h,v retrieving revision 1.160 retrieving revision 1.161 diff -u -d -r1.160 -r1.161 --- ssg.h 4 Dec 2002 20:15:21 -0000 1.160 +++ ssg.h 29 Jan 2003 19:33:40 -0000 1.161 @@ -1536,7 +1536,7 @@ ssgNormalArray *nl, ssgTexCoordArray *tl, ssgColourArray *cl, - ssgIndexArray *il ) ; + ssgIndexArray *il ) ; virtual void drawHighlight ( sgVec4 colour ) ; virtual void drawHighlight ( sgVec4 colour, int i ) ; @@ -2687,6 +2687,7 @@ ssgEntity *ssgLoadAC3D ( const char *fname, const ssgLoaderOptions *options = NULL ) ; ssgEntity *ssgLoadSSG ( const char *fname, const ssgLoaderOptions *options = NULL ) ; ssgEntity *ssgLoadASE ( const char *fname, const ssgLoaderOptions *options = NULL ) ; +ssgEntity *ssgLoadDOF ( const char *fname, const ssgLoaderOptions *options = NULL ) ; ssgEntity *ssgLoadDXF ( const char *fname, const ssgLoaderOptions *options = NULL ) ; ssgEntity *ssgLoadTRI ( const char *fname, const ssgLoaderOptions *options = NULL ) ; ssgEntity *ssgLoadOBJ ( const char *fname, const ssgLoaderOptions *options = NULL ) ; |
From: James J. <pu...@us...> - 2003-01-23 22:07:56
|
Update of /cvsroot/plib/plib/demos/p-guide/src In directory sc8-pr-cvs1:/tmp/cvs-serv15535 Modified Files: StatusWindow.cxx pGuide.cxx Log Message: Improved layer support, re-done layout of StatusWindow. Fixed indent in pGuide.cxx... oops! Index: StatusWindow.cxx =================================================================== RCS file: /cvsroot/plib/plib/demos/p-guide/src/StatusWindow.cxx,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- StatusWindow.cxx 1 Sep 2002 11:40:10 -0000 1.9 +++ StatusWindow.cxx 23 Jan 2003 22:07:53 -0000 1.10 @@ -50,6 +50,8 @@ puInput *object_position_x ; puInput *object_position_y ; +static puFrame *widget_section_frame ; + static puInput *object_label ; static puComboBox *object_vert_label_place ; static puComboBox *object_horz_label_place ; @@ -60,9 +62,20 @@ static puInput *object_name ; static puButtonBox *object_callbacks ; [...215 lines suppressed...] window_size_x->setCallback ( window_size_cb ) ; window_size_x->setDownCallback ( window_size_cb ) ; @@ -1000,7 +1090,7 @@ extern int main_window_x, main_window_y ; window_position_x = new puInput ( 130, 285, 180 , 305 ) ; - window_position_x->setLabel ( "Position :" ) ; + window_position_x->setLabel ( "Position:" ) ; window_position_x->setLabelPlace ( PUPLACE_CENTERED_LEFT ) ; window_position_x->setValuator ( &main_window_x ) ; @@ -1011,7 +1101,7 @@ main_window_color_b, main_window_color_a ; window_color_label = new puText (340, 320) ; - window_color_label->setLabel ( "Color: " ) ; + window_color_label->setLabel ( "Color:" ) ; window_color_r = new puSpinBox ( 270, 285, 320, 305 ) ; window_color_r->setMinValue(0.0); Index: pGuide.cxx =================================================================== RCS file: /cvsroot/plib/plib/demos/p-guide/src/pGuide.cxx,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- pGuide.cxx 23 Jan 2003 18:46:03 -0000 1.11 +++ pGuide.cxx 23 Jan 2003 22:07:53 -0000 1.12 @@ -81,8 +81,8 @@ extern int properties_window; // Definitions - #define RESIZING_BORDER_WIDTH 5 - #define RESIZING_CORNER_BORDER_WIDTH 4 +#define RESIZING_BORDER_WIDTH 5 +#define RESIZING_CORNER_BORDER_WIDTH 4 /** 4 seems to be the best number for this define... this makes sure * * that the default widget size allows you to still resize along the * * X axis without difficulty - 23 Jan 03 JCJ **/ |
From: James J. <pu...@us...> - 2003-01-23 18:46:08
|
Update of /cvsroot/plib/plib/demos/p-guide/src In directory sc8-pr-cvs1:/tmp/cvs-serv3581 Modified Files: LoadSave.cxx WriteCode.cxx pGuide.cxx Log Message: Fixed symmetric resize issue where the corners were being calculated too big (resulting in corner resizes when you intended to do a single-border resize) - pGuide.cxx Fixed load problem with a file containing "widget0" not incrementing the widget_count variable - LoadSave.cxx Added trueOrFalse() to WriteCode.cxx and call it for all boolean values being written to the exported code. Now "TRUE" or "FALSE" are written instead of "1" or "0". - WriteCode.cxx ---------------------------------------------------------------------- Index: LoadSave.cxx =================================================================== RCS file: /cvsroot/plib/plib/demos/p-guide/src/LoadSave.cxx,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- LoadSave.cxx 31 Aug 2002 08:14:39 -0000 1.7 +++ LoadSave.cxx 23 Jan 2003 18:46:02 -0000 1.8 @@ -498,7 +498,7 @@ /* widget_number to it. */ int tmp_wid_num = 0; sscanf(tagvalue, "widget%d", &tmp_wid_num) ; - if (tmp_wid_num > widget_number) widget_number = tmp_wid_num + 1; + if (tmp_wid_num >= widget_number) widget_number = tmp_wid_num + 1; } if ( strstr(tag,"type") ) { Index: WriteCode.cxx =================================================================== RCS file: /cvsroot/plib/plib/demos/p-guide/src/WriteCode.cxx,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- WriteCode.cxx 18 Oct 2002 16:22:57 -0000 1.9 +++ WriteCode.cxx 23 Jan 2003 18:46:02 -0000 1.10 @@ -56,6 +56,12 @@ extern int status_window ; extern puFileSelector *file_selector ; +const char* trueOrFalse(bool tf) +{ + if (tf) return "TRUE"; + else return "FALSE"; +} + // The function itself void write_code ( puObject *ob ) @@ -406,10 +412,10 @@ if (wid->object_type == PUCLASS_LISTBOX) fprintf ( out, " %s = new %s (%d, %d, %d, %d, %s_entries ) ;\n", wid->object_name, wid->object_type_name, x, y, x+w, y+h, wid->object_name) ; if (wid->object_type == PUCLASS_BUTTONBOX) - fprintf ( out, " %s = new %s (%d, %d, %d, %d, %s_entries, %d ) ;\n", wid->object_name, wid->object_type_name, x, y, x+w, y+h, wid->object_name, wid->boolval1) ; + fprintf ( out, " %s = new %s (%d, %d, %d, %d, %s_entries, %s ) ;\n", wid->object_name, wid->object_type_name, x, y, x+w, y+h, wid->object_name, trueOrFalse(wid->boolval1)) ; if (wid->object_type == PUCLASS_COMBOBOX) { - fprintf ( out, " %s = new %s (%d, %d, %d, %d, %s_entries, %d ) ;\n", wid->object_name, wid->object_type_name, x, y, x+w, y+h, wid->object_name, wid->boolval1) ; + fprintf ( out, " %s = new %s (%d, %d, %d, %d, %s_entries, %s ) ;\n", wid->object_name, wid->object_type_name, x, y, x+w, y+h, wid->object_name, trueOrFalse(wid->boolval1)) ; fprintf ( out, " %s->setCurrentItem(%d) ;\n", wid->object_name, wid->intval1) ; } if (wid->object_type == PUCLASS_SELECTBOX) @@ -441,12 +447,7 @@ (wid->object_type == PUCLASS_SCROLLBAR ) ) { /* Sliders */ - char orientation[10]; - if (wid->boolval2) - strcpy(orientation,"true"); /* Vertical */ - else - strcpy(orientation,"false"); /* Horizontal */ - fprintf ( out, " %s = new %s (%d, %d, %d, %s, %d ) ;\n", wid->object_name, wid->object_type_name, x, y, (wid->boolval2==1)?h:w, orientation, (wid->boolval2==1)?w:h) ; + fprintf ( out, " %s = new %s (%d, %d, %d, %s, %d ) ;\n", wid->object_name, wid->object_type_name, x, y, (wid->boolval2==1)?h:w, trueOrFalse(wid->boolval2), (wid->boolval2==1)?w:h) ; /* Slider value options */ if (wid->object_type == PUCLASS_SLIDER ) fprintf ( out, " %s->setValue(%ff) ;\n", wid->object_name, wid->floatval4) ; @@ -457,7 +458,7 @@ if (wid->object_type == PUCLASS_TRISLIDER ) { if (!wid->boolval3) - fprintf ( out, " %s->setFreezeEnds(false) ;\n", wid->object_name ) ; + fprintf ( out, " %s->setFreezeEnds(FALSE) ;\n", wid->object_name ) ; fprintf ( out, " %s->setValue(%ff) ;\n", wid->object_name, wid->floatval6) ; fprintf ( out, " %s->setSliderFraction(0.1f) ;\n", wid->object_name) ; /*Allow setting the slider fraction?*/ @@ -466,11 +467,11 @@ } else if (wid->object_type == PUCLASS_DIAL ) { fprintf ( out, " %s = new %s (%d, %d, %d ) ;\n", wid->object_name, wid->object_type_name, x, y, (h+w)/2) ; - fprintf ( out, " %s->setWrap(%d) ;\n", wid->object_name, wid->boolval2) ; + fprintf ( out, " %s->setWrap(%s) ;\n", wid->object_name, trueOrFalse(wid->boolval2)) ; } else if (wid->object_type == PUCLASS_SPINBOX ) { - fprintf ( out, " %s = new %s (%d, %d, %d, %d, %d ) ;\n", wid->object_name, wid->object_type_name, x, y, x+w, y+h, wid->boolval2 ) ; + fprintf ( out, " %s = new %s (%d, %d, %d, %d, %s ) ;\n", wid->object_name, wid->object_type_name, x, y, x+w, y+h, trueOrFalse(wid->boolval2) ) ; fprintf ( out, " %s->setArrowHeight(%ff) ;\n", wid->object_name, wid->floatval4 ) ; } /* All puRange options */ Index: pGuide.cxx =================================================================== RCS file: /cvsroot/plib/plib/demos/p-guide/src/pGuide.cxx,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- pGuide.cxx 31 Aug 2002 08:14:39 -0000 1.10 +++ pGuide.cxx 23 Jan 2003 18:46:03 -0000 1.11 @@ -80,6 +80,14 @@ // From the properties window: extern int properties_window; +// Definitions + #define RESIZING_BORDER_WIDTH 5 + #define RESIZING_CORNER_BORDER_WIDTH 4 + /** 4 seems to be the best number for this define... this makes sure * + * that the default widget size allows you to still resize along the * + * X axis without difficulty - 23 Jan 03 JCJ **/ + + // Properties Callback static void cb_edit_properties ( puObject *ob ) @@ -660,9 +668,6 @@ if ( wid->visible && ( x >= box->min[0] ) && ( x <= box->max[0] ) && ( y >= box->min[1] ) && ( y <= box->max[1] ) ) { - #define RESIZING_BORDER_WIDTH 5 - #define RESIZING_CORNER_BORDER_WIDTH 8 - active_widget = wid ; active_object = wid->obj ; if ( abs ( x - box->min[0] ) < RESIZING_BORDER_WIDTH ) @@ -676,11 +681,10 @@ else activity_flag = 1 ; // Away from edges, we're moving it - // bottom left 6 - // top right 7 - // top left 8 - // bottom right 9 - + /* Now we check and see if we're clicking on a corner - the sensitivity for + the determiniation of whether we're clicking a corner or not is held by the + definition of "RESIZING_CORNER_BORDER_WIDTH" which is at the top of this file */ + int corner_resize_width = RESIZING_CORNER_BORDER_WIDTH + (((box->max[0] - box->min[0]) + (box->max[1] - box->min[1]) / 2 ) / 50 ) * 2 ; if ( activity_flag != 1 ) @@ -702,8 +706,7 @@ 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 */ + /* If CTRL is held down, symmetric resize is forced. */ resize_symmetric = ctrl_key_down ? 2 : 1 ; |
From: Steve B. <sj...@us...> - 2003-01-06 05:10:16
|
Update of /cvsroot/plib/plib/src/psl In directory sc8-pr-cvs1:/tmp/cvs-serv11734/plib/src/psl Modified Files: psl.h pslCompiler.cxx pslCompiler.h pslFileIO.cxx pslFileIO.h pslProgram.cxx Log Message: Added ability to compile from string variables. Index: psl.h =================================================================== RCS file: /cvsroot/plib/plib/src/psl/psl.h,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- psl.h 27 Sep 2002 21:19:59 -0000 1.24 +++ psl.h 6 Jan 2003 05:10:13 -0000 1.25 @@ -322,6 +322,7 @@ void dump () const ; int compile ( const char *fname ) ; + int compile ( const char *memptr, const char *fname ) ; int compile ( FILE *fd ) ; void reset () ; pslResult step () ; Index: pslCompiler.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/psl/pslCompiler.cxx,v retrieving revision 1.28 retrieving revision 1.29 diff -u -d -r1.28 -r1.29 --- pslCompiler.cxx 27 Sep 2002 15:45:06 -0000 1.28 +++ pslCompiler.cxx 6 Jan 2003 05:10:13 -0000 1.29 @@ -45,16 +45,34 @@ } -int pslCompiler::compile ( FILE *fd, const char *fname ) +int pslCompiler::compile ( const char *memptr, const char *fname ) { - const char *dump_env = getenv ( "PSL_DUMP" ) ; + init () ; + + _pslPushDefaultFile ( memptr, (fname == NULL) ? progName : fname ) ; + genProgram () ; + _pslPopDefaultFile () ; + + return cleanup () ; +} + +int pslCompiler::compile ( FILE *fd, const char *fname ) +{ init () ; _pslPushDefaultFile ( fd, (fname == NULL) ? progName : fname ) ; genProgram () ; _pslPopDefaultFile () ; + return cleanup () ; +} + + +int pslCompiler::cleanup () +{ + const char *dump_env = getenv ( "PSL_DUMP" ) ; + if ( num_errors != 0 || num_warnings != 0 ) fprintf ( stderr, "PSL: '%s' Compiled with %d Warnings, %d Fatal Errors\n", progName, num_warnings, num_errors ) ; Index: pslCompiler.h =================================================================== RCS file: /cvsroot/plib/plib/src/psl/pslCompiler.h,v retrieving revision 1.32 retrieving revision 1.33 diff -u -d -r1.32 -r1.33 --- pslCompiler.h 30 Oct 2002 12:32:58 -0000 1.32 +++ pslCompiler.h 6 Jan 2003 05:10:13 -0000 1.33 @@ -236,6 +236,8 @@ void addFwdRef ( const char *s, pslAddress where ) ; void checkUnresolvedSymbols () ; + int cleanup () ; /* Report errors, etc after a compile */ + void pushLocality () { if ( locality_sp >= MAX_NESTING-1 ) @@ -388,6 +390,7 @@ void dump () const ; int compile ( const char *fname ) ; int compile ( FILE *fd, const char *fname = NULL ) ; + int compile ( const char *memptr, const char *prog_name ) ; } ; Index: pslFileIO.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/psl/pslFileIO.cxx,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- pslFileIO.cxx 9 Nov 2002 21:43:58 -0000 1.7 +++ pslFileIO.cxx 6 Jan 2003 05:10:13 -0000 1.8 @@ -31,6 +31,7 @@ class pslFile { FILE *fd ; + const char *memptr ; char *fname ; int ungetStack [ MAX_UNGET_CHAR ] ; @@ -38,14 +39,9 @@ int line_no ; [...67 lines suppressed...] + + if ( c == '\0' ) + { + memptr = NULL ; + c = -1 ; + } + } + else + c = -1 ; if ( c == '\n' ) line_no++ ; @@ -117,6 +151,7 @@ void _pslPopDefaultFile () { delete defaultFileStack [ fileStackPointer - 1 ] ; } void _pslPushDefaultFile ( FILE *fd, const char *fname ) { new pslFile ( fd, fname ) ; } +void _pslPushDefaultFile ( const char *memptr, const char *fname ) { new pslFile ( memptr, fname ) ; } void _pslPushDefaultFile ( const char *fname ) { Index: pslFileIO.h =================================================================== RCS file: /cvsroot/plib/plib/src/psl/pslFileIO.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- pslFileIO.h 15 Sep 2002 14:32:53 -0000 1.3 +++ pslFileIO.h 6 Jan 2003 05:10:14 -0000 1.4 @@ -26,6 +26,7 @@ void _pslPopDefaultFile () ; void _pslPushDefaultFile ( FILE *fd, const char *fname ) ; +void _pslPushDefaultFile ( const char *memptr, const char *fname ) ; void _pslPushDefaultFile ( const char *fname ) ; void _pslUnGetChar ( int c ) ; Index: pslProgram.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/psl/pslProgram.cxx,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- pslProgram.cxx 30 Oct 2002 12:32:59 -0000 1.16 +++ pslProgram.cxx 6 Jan 2003 05:10:14 -0000 1.17 @@ -101,6 +101,15 @@ +int pslProgram::compile ( const char *memptr, const char *fname ) +{ + if ( strcmp ( getProgName(), "PSLprogram" ) == 0 ) + setProgName ( fname ) ; + + return compiler -> compile ( memptr, fname ) ; +} + + int pslProgram::compile ( const char *fname ) { if ( strcmp ( getProgName(), "PSLprogram" ) == 0 ) |
From: Steve B. <sj...@us...> - 2003-01-06 05:10:16
|
Update of /cvsroot/plib/plib/examples/src/psl In directory sc8-pr-cvs1:/tmp/cvs-serv11734/plib/examples/src/psl Modified Files: psl_demo.cxx Log Message: Added ability to compile from string variables. Index: psl_demo.cxx =================================================================== RCS file: /cvsroot/plib/plib/examples/src/psl/psl_demo.cxx,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- psl_demo.cxx 13 Sep 2002 17:37:26 -0000 1.14 +++ psl_demo.cxx 6 Jan 2003 05:10:13 -0000 1.15 @@ -96,17 +96,26 @@ pslProgram *prog_2 = new pslProgram ( prog_1, "code2" ) ; + /* Make program 3 from inline strings. */ + + pslProgram *prog_3 = new pslProgram ( extensions, "inline" ) ; + + prog_3 -> compile ( "int main () { printf ( \"Hello World.\\n\" ) ; }\n", + "HelloProgram" ) ; + /* Make them unique by assigning user data to them */ prog_1 -> setUserData ( (void *) "Program 1" ) ; prog_2 -> setUserData ( (void *) "Program 2" ) ; + prog_3 -> setUserData ( (void *) "Program 3" ) ; ck.update () ; while ( 1 ) { - if ( prog_1 -> step () == PSL_PROGRAM_END || - prog_2 -> step () == PSL_PROGRAM_END ) + if ( prog_1 -> step () == PSL_PROGRAM_END && + prog_2 -> step () == PSL_PROGRAM_END && + prog_3 -> step () == PSL_PROGRAM_END ) break ; } ck.update () ; |
From: Steve B. <sj...@us...> - 2003-01-06 05:10:16
|
Update of /cvsroot/plib/plib/doc/psl In directory sc8-pr-cvs1:/tmp/cvs-serv11734/plib/doc/psl Modified Files: appl_guide.html Log Message: Added ability to compile from string variables. Index: appl_guide.html =================================================================== RCS file: /cvsroot/plib/plib/doc/psl/appl_guide.html,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- appl_guide.html 27 Sep 2002 15:45:06 -0000 1.7 +++ appl_guide.html 6 Jan 2003 05:10:13 -0000 1.8 @@ -102,6 +102,7 @@ pslResult step () ; pslResult trace () ; + int compile ( const char *memptr, const char *fname ) ; int compile ( const char *fname ) ; int compile ( FILE *fd ) ; } ; @@ -143,10 +144,18 @@ choose to ignore any compilation errors - but executing the resulting program will immediately produce a PSL_PROGRAM_END. <p> -You can pass either a filename or a 'FILE *' descriptor to the compiler, -if you do the former, then error messages will refer to the name of the -file - if you do the latter then the program name that you passed to the -constructor function will be reported. +You can pass to the compiler either: +<ol> +<li> The filename of the file containing the PSL source code...or... +<li> A 'FILE *' descriptor for the file containing the PSL source...or... +<li> The address of a null terminated string containing the + program source PLUS a name to use for the program when reporting + errors, etc. +</ol> +If you pass the filename (1) or the address of the source with a name (3), +then error messages from PSL will refer to that name. But if you pass a +file destriptor then the program name that you passed to the constructor +function will be reported. <p> Applications that would like to report scripting errors in a more elegant way, may register a callback function that will be called whenever there @@ -186,7 +195,7 @@ <li> The 'message' parameter is the actual text of the error message. </ul> Notice that at compiletime, the 'progname' parameter is the name of the -file being compiled (if that's known to the compiler). Since it's +file or string being compiled (if that's known to the compiler). Since it's possible for one PSL source file to '#include' another, you should always use the 'progName' parameter in your error messages in preference to <code>prog->getProgName()</code> member function. |