plib-cvs Mailing List for PLIB
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: John F. F. <fa...@us...> - 2006-03-22 19:25:32
|
Update of /cvsroot/plib/plib/src/pui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30628 Modified Files: pu.h puInput.cxx puLargeInput.cxx Log Message: Removing the "new" and "delete" from within the input box display function Index: pu.h =================================================================== RCS file: /cvsroot/plib/plib/src/pui/pu.h,v retrieving revision 1.153 retrieving revision 1.154 diff -u -d -r1.153 -r1.154 --- pu.h 20 Mar 2006 15:17:35 -0000 1.153 +++ pu.h 22 Mar 2006 19:25:28 -0000 1.154 @@ -1625,6 +1625,13 @@ { UL_TYPE_DATA + int display_starting_point ; + + char *getDisplayedText ( void ) + { + return ( displayed_text == NULL ? getStringValue () : displayed_text ) ; + } + public: void draw ( int dx, int dy ) ; void doHit ( int button, int updown, int x, int y ) ; @@ -1642,6 +1649,8 @@ { type |= PUCLASS_INPUT ; + display_starting_point = 0 ; + setColourScheme ( colour [ PUCOL_EDITFIELD ][0], colour [ PUCOL_EDITFIELD ][1], colour [ PUCOL_EDITFIELD ][2], Index: puInput.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/pui/puInput.cxx,v retrieving revision 1.36 retrieving revision 1.37 diff -u -d -r1.36 -r1.37 --- puInput.cxx 6 May 2005 18:31:11 -0000 1.36 +++ puInput.cxx 22 Mar 2006 19:25:28 -0000 1.37 @@ -27,7 +27,7 @@ UL_RTTI_DEF2(puInput,puInputBase,puObject) -static char *chop_to_width ( puFont fnt, const char *s, int width, int cursor_position, int *ncut ) +static char *chop_to_width ( puFont fnt, const char *s, int width, int cursor_position, int *display_starting_point ) { int new_len = strlen ( s ) ; char *res = new char [ new_len + 1 ] ; @@ -37,7 +37,7 @@ if ( new_len == 0 ) { [...150 lines suppressed...] highlight () ; + + /* Required because we have pretty much destroyed "displayed_text" */ + delete [] displayed_text ; + displayed_text = chop_to_width ( legendFont, getStringValue(), + abox.max[0]-abox.min[0], getCursor (), &display_starting_point ) ; } else lowlight () ; @@ -411,6 +407,10 @@ setValue ( p ) ; /* Set the widget value to the new string */ delete [] p ; + + /* Since the keystroke has changed the text value, we need to change the displayed text as well. */ + delete [] displayed_text ; + displayed_text = NULL ; } normalizeCursors () ; |
From: John F. F. <fa...@us...> - 2006-03-20 15:17:39
|
Update of /cvsroot/plib/plib/src/pui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8652 Modified Files: pu.h puLargeInput.cxx Log Message: Moving the "wrapped_text" field into "puInputBase" and changing its name to "displayed_text" in preparation for adding it to "puInput" as well Index: pu.h =================================================================== RCS file: /cvsroot/plib/plib/src/pui/pu.h,v retrieving revision 1.152 retrieving revision 1.153 diff -u -d -r1.152 -r1.153 --- pu.h 10 Nov 2005 20:21:22 -0000 1.152 +++ pu.h 20 Mar 2006 15:17:35 -0000 1.153 @@ -1547,6 +1547,8 @@ char *valid_data ; int input_disabled ; + char *displayed_text ; // Pointer to text as it is displayed in the box (chopped or word-wrapped) + puObject *widget ; /* Pointer to associated input box widget */ virtual void normalizeCursors ( void ) ; @@ -1608,13 +1610,14 @@ select_start_position = -1 ; select_end_position = -1 ; valid_data = NULL; + displayed_text = NULL ; widget = (puObject *)NULL ; input_disabled = FALSE ; } - virtual ~puInputBase () { delete [] valid_data ; } + virtual ~puInputBase () { delete [] valid_data ; delete [] displayed_text ; } } ; @@ -1927,8 +1930,6 @@ puSlider *bottom_slider ; // Horizontal slider at bottom of window puScrollBar *right_slider ; // Vertical slider at right of window - char *wrapped_text ; // Pointer to word-wrapped text in the box - int arrow_count ; // Number of up/down arrows above and below the right slider void normalizeCursors ( void ) ; @@ -1940,8 +1941,6 @@ puLargeInput ( int x, int y, int w, int h, int arrows, int sl_width, int wrap_text = FALSE ) ; ~puLargeInput () { - delete [] wrapped_text ; - if ( puActiveWidget() == this ) puDeactivateWidget () ; } @@ -1970,14 +1969,17 @@ void setValue ( const char *s ) ; void setText ( const char *l ) { setValue ( l ) ; } /* DEPRECATED */ char *getText ( void ) { return getStringValue () ; } /* DEPRECATED */ - char *getWrappedText ( void ) - { - return ( wrapped_text == NULL ? getStringValue () : wrapped_text ) ; - } void addNewLine ( const char *l ) ; void addText ( const char *l ) ; void appendText ( const char *l ) ; void removeText ( int start, int end ) ; + + char *getDisplayedText ( void ) + { + return ( displayed_text == NULL ? getStringValue () : displayed_text ) ; + } + char *getWrappedText ( void ) // THIS FUNCTION IS DEPRECATED 3/21/06 + { return getDisplayedText () ; } } ; //************************************************************************************ //* THIS CLASS IS DEPRECATED 1/26/04 -- please link to "puAux" and use puaLargeInput * Index: puLargeInput.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/pui/puLargeInput.cxx,v retrieving revision 1.51 retrieving revision 1.52 diff -u -d -r1.51 -r1.52 --- puLargeInput.cxx 5 Jan 2006 21:01:45 -0000 1.51 +++ puLargeInput.cxx 20 Mar 2006 15:17:35 -0000 1.52 @@ -107,7 +107,6 @@ right_slider->setUserData ( this ) ; right_slider->setCallback ( puLargeInputHandleRightSlider ) ; - wrapped_text = NULL ; setValue ( "\n" ) ; close () ; @@ -145,7 +144,7 @@ { select_start_position = s ; select_end_position = e ; [...117 lines suppressed...] { - wrapped_text_wp += strlen (wrapped_text_wp) ; + displayed_text_wp += strlen (displayed_text_wp) ; if ( space_ptr != NULL ) /* Advance past the NULL since there's more string left */ - wrapped_text_wp += 1 ; + displayed_text_wp += 1 ; } else { @@ -1258,7 +1257,7 @@ *space_ptr = ' ' ; *old_space_ptr = '\n' ; - wrapped_text_wp = old_space_ptr + 1 ; + displayed_text_wp = old_space_ptr + 1 ; } } } |
From: John F. F. <fa...@us...> - 2006-03-20 15:15:36
|
Update of /cvsroot/plib/plib/src/puAux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7581 Modified Files: puAux.h puAuxLargeInput.cxx Log Message: Moving the "wrapped_text" field into "puInputBase" and changing its name to "displayed_text" in preparation for adding it to "puInput" as well Index: puAux.h =================================================================== RCS file: /cvsroot/plib/plib/src/puAux/puAux.h,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- puAux.h 10 Nov 2005 20:07:08 -0000 1.8 +++ puAux.h 20 Mar 2006 15:15:30 -0000 1.9 @@ -151,8 +151,6 @@ puSlider *bottom_slider ; // Horizontal slider at bottom of window puaScrollBar *right_slider ; // Vertical slider at right of window - char *wrapped_text ; // Pointer to word-wrapped text in the box - int arrow_count ; // Number of up/down arrows above and below the right slider void normalizeCursors ( void ) ; @@ -164,8 +162,6 @@ puaLargeInput ( int x, int y, int w, int h, int arrows, int sl_width, int wrap_text = FALSE ) ; ~puaLargeInput () { - delete [] wrapped_text ; - if ( puActiveWidget() == this ) puDeactivateWidget () ; } @@ -194,14 +190,16 @@ void setValue ( const char *s ) ; void setText ( const char *l ) { setValue ( l ) ; } /* DEPRECATED */ char *getText ( void ) { return getStringValue () ; } /* DEPRECATED */ - char *getWrappedText ( void ) - { - return ( wrapped_text == NULL ? getStringValue () : wrapped_text ) ; - } void addNewLine ( const char *l ) ; void addText ( const char *l ) ; void appendText ( const char *l ) ; void removeText ( int start, int end ) ; + char *getDisplayedText ( void ) + { + return ( displayed_text == NULL ? getStringValue () : displayed_text ) ; + } + char *getWrappedText ( void ) // THIS FUNCTION IS DEPRECATED 3/21/06 + { return getDisplayedText () ; } } ; Index: puAuxLargeInput.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/puAux/puAuxLargeInput.cxx,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- puAuxLargeInput.cxx 5 Jan 2006 21:00:26 -0000 1.8 +++ puAuxLargeInput.cxx 20 Mar 2006 15:15:30 -0000 1.9 @@ -107,7 +107,6 @@ right_slider->setUserData ( this ) ; right_slider->setCallback ( puaLargeInputHandleRightSlider ) ; - wrapped_text = NULL ; setValue ( "\n" ) ; close () ; @@ -145,7 +144,7 @@ { select_start_position = s ; select_end_position = e ; [...117 lines suppressed...] { - wrapped_text_wp += strlen (wrapped_text_wp) ; + displayed_text_wp += strlen (displayed_text_wp) ; if ( space_ptr != NULL ) /* Advance past the NULL since there's more string left */ - wrapped_text_wp += 1 ; + displayed_text_wp += 1 ; } else { @@ -1267,7 +1266,7 @@ *space_ptr = ' ' ; *old_space_ptr = '\n' ; - wrapped_text_wp = old_space_ptr + 1 ; + displayed_text_wp = old_space_ptr + 1 ; } } } |
From: Bram S. <br...@us...> - 2006-01-30 07:36:12
|
Update of /cvsroot/plib/plib/src/js In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32730/src/js Modified Files: js.h jsWindows.cxx Log Message: Expose num_buttons Index: js.h =================================================================== RCS file: /cvsroot/plib/plib/src/js/js.h,v retrieving revision 1.33 retrieving revision 1.34 diff -u -d -r1.33 -r1.34 --- js.h 20 Oct 2004 23:49:33 -0000 1.33 +++ js.h 30 Jan 2006 07:36:01 -0000 1.34 @@ -68,6 +68,7 @@ const char* getName () const { return name ; } int getNumAxes () const { return num_axes ; } + int getNumButtons () const { return num_buttons; } int notWorking () const { return error ; } void setError () { error = JS_TRUE ; } Index: jsWindows.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/js/jsWindows.cxx,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- jsWindows.cxx 2 Dec 2004 20:11:56 -0000 1.6 +++ jsWindows.cxx 30 Jan 2006 07:36:01 -0000 1.7 @@ -105,6 +105,7 @@ error = ( joyGetDevCaps( os->js_id, &(os->jsCaps), sizeof(os->jsCaps) ) != JOYERR_NOERROR ) ; + num_buttons = os->jsCaps.wNumButtons ; if ( os->jsCaps.wNumAxes == 0 ) { num_axes = 0 ; |
From: Bram S. <br...@us...> - 2006-01-30 07:36:12
|
Update of /cvsroot/plib/plib/doc/js In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32730/doc/js Modified Files: index.html Log Message: Expose num_buttons Index: index.html =================================================================== RCS file: /cvsroot/plib/plib/doc/js/index.html,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- index.html 1 Sep 2002 01:16:40 -0000 1.9 +++ index.html 30 Jan 2006 07:36:01 -0000 1.10 @@ -52,6 +52,7 @@ const char* getName () const ; int getNumAxes () const ; + int getNumButtons () const ; int notWorking () const ; void setError () ; |
From: John F. F. <fa...@us...> - 2006-01-17 14:28:37
|
Update of /cvsroot/plib/plib/src/js In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4661 Modified Files: Makefile.am Log Message: Backing out the "UL_BSD" dependency. Index: Makefile.am =================================================================== RCS file: /cvsroot/plib/plib/src/js/Makefile.am,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- Makefile.am 5 Jan 2006 21:21:54 -0000 1.11 +++ Makefile.am 17 Jan 2006 14:28:23 -0000 1.12 @@ -1,10 +1,5 @@ if BUILD_JS -# FIXME set the UL_BSD conditional using AM_CONDITIONAL in configure.ac -if UL_BSD -bin_PROGRAMS = plib-jscal -plib_jscal_SOURCES = jsBSDCal.c -endif lib_LIBRARIES = libplibjs.a include_HEADERS = js.h |
From: John F. F. <fa...@us...> - 2006-01-05 21:38:39
|
Update of /cvsroot/plib/plib/src/ssg In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6236 Modified Files: ssgLoadX.cxx Log Message: Adding a patch from Jan Reucker for DirectX writers that don't put a comma where one should be (e-mail 12/18/05, 8:32 AM) Index: ssgLoadX.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgLoadX.cxx,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- ssgLoadX.cxx 5 Jan 2006 20:54:15 -0000 1.24 +++ ssgLoadX.cxx 5 Jan 2006 21:38:31 -0000 1.25 @@ -419,8 +419,11 @@ parser.expectNextToken(";"); if(i==nNoOfVertices-1) parser.expectNextToken(";"); - else - parser.expectNextToken(","); + // Commented out by J. Reucker 2005-12-16 + // Some .x export plugins forget to add the ",", but the + // parser will work with and without "," if it doesn't expect it + //~ else + //~ parser.expectNextToken(","); currentMesh.addPerVertexTextureCoordinate2( tv ) ; } |
From: John F. F. <fa...@us...> - 2006-01-05 21:33:11
|
Update of /cvsroot/plib/plib/src/pui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4967 Modified Files: puButton.cxx Log Message: Drawing disabled menu buttons as truly greyed-out (e-mail from Melchior Franz, 12/6/05, 6:59 AM) Index: puButton.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/pui/puButton.cxx,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- puButton.cxx 6 May 2005 18:31:11 -0000 1.22 +++ puButton.cxx 5 Jan 2006 21:32:59 -0000 1.23 @@ -39,7 +39,8 @@ { if ( parent && ( ( parent->getType() & PUCLASS_POPUPMENU ) || ( parent->getType() & PUCLASS_MENUBAR ) ) ) - abox.draw ( dx, dy, PUSTYLE_SMALL_SHADED, colour, isReturnDefault(), 2 ) ; + abox.draw ( dx, dy, active ? PUSTYLE_SMALL_SHADED : PUSTYLE_PLAIN, colour, + isReturnDefault(), active ? 2 : 0 ) ; else abox.draw ( dx, dy, -style, colour, isReturnDefault(), border_thickness ) ; } |
From: John F. F. <fa...@us...> - 2006-01-05 21:22:04
|
Update of /cvsroot/plib/plib/src/js In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3131 Modified Files: Makefile.am jsBSD.cxx Log Message: Adding Jean-Yves Lefort's patches (e-mail from Jean-Yves Lefort, 12/7/05, 4:36 AM). Note the "FIXME" line in the "Makefile.am" file. Index: Makefile.am =================================================================== RCS file: /cvsroot/plib/plib/src/js/Makefile.am,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- Makefile.am 4 Jan 2003 02:55:53 -0000 1.10 +++ Makefile.am 5 Jan 2006 21:21:54 -0000 1.11 @@ -1,5 +1,10 @@ if BUILD_JS +# FIXME set the UL_BSD conditional using AM_CONDITIONAL in configure.ac +if UL_BSD +bin_PROGRAMS = plib-jscal +plib_jscal_SOURCES = jsBSDCal.c +endif lib_LIBRARIES = libplibjs.a include_HEADERS = js.h Index: jsBSD.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/js/jsBSD.cxx,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- jsBSD.cxx 12 Jan 2005 01:22:26 -0000 1.6 +++ jsBSD.cxx 5 Jan 2006 21:21:55 -0000 1.7 @@ -44,6 +44,8 @@ #define HAVE_USB_JS 1 #endif +#include <string.h> +#include <errno.h> #include <sys/ioctl.h> #if defined(__FreeBSD__) # include <sys/joystick.h> @@ -312,7 +314,7 @@ int buttons [ _JS_MAX_AXES ] ; rawRead ( buttons, axes ) ; - error = axes[0] < -1000000000.0f ; + error = axes[0] < -1000000000.0f && axes[1] < -1000000000.0f ; if ( error ) return ; @@ -321,7 +323,11 @@ joyfile = fopen ( joyfname, "r" ) ; error = ( joyfile == NULL ) ; if ( error ) + { + ulSetError ( UL_WARNING, "unable to open calibration file %s (%s), joystick %i disabled (you can generate the calibration file with the plib-jscal utility)", + joyfname, strerror ( errno ), id + 1 ); return ; + } noargs = fscanf ( joyfile, "%d%f%f%f%f%f%f", &in_no_axes, &min [ 0 ], ¢er [ 0 ], &max [ 0 ], @@ -445,8 +451,13 @@ if ( axes != NULL ) { - axes[0] = (float) os->ajs.x ; - axes[1] = (float) os->ajs.y ; + if ( os->ajs.x >= -1000000000 ) + os->cache_axes[0] = os->ajs.x; + if ( os->ajs.y >= -1000000000 ) + os->cache_axes[1] = os->ajs.y; + + axes[0] = os->cache_axes[0]; + axes[1] = os->cache_axes[1]; } return; |
From: John F. F. <fa...@us...> - 2006-01-05 21:01:58
|
Update of /cvsroot/plib/plib/src/pui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31808 Modified Files: puLargeInput.cxx Log Message: Fixing non-normalized range in large input widget (e-mail, John Fay, 11/19/05, 2:21 PM) Index: puLargeInput.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/pui/puLargeInput.cxx,v retrieving revision 1.50 retrieving revision 1.51 diff -u -d -r1.50 -r1.51 --- puLargeInput.cxx 14 Jul 2005 16:18:14 -0000 1.50 +++ puLargeInput.cxx 5 Jan 2006 21:01:45 -0000 1.51 @@ -172,7 +172,7 @@ if ( top_line_in_window < 0 ) top_line_in_window = 0 ; - right_slider->setValue ( 1.0f - float(top_line_in_window) / float(num_lines - lines_in_window) ) ; + right_slider->setValue ( num_lines - lines_in_window - top_line_in_window ) ; } } |
From: John F. F. <fa...@us...> - 2006-01-05 21:00:34
|
Update of /cvsroot/plib/plib/src/puAux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31572 Modified Files: puAuxLargeInput.cxx Log Message: Fixing non-normalized range in large input widget (e-mail from John Fay, 11/19/05 at 2:21 PM) Index: puAuxLargeInput.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/puAux/puAuxLargeInput.cxx,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- puAuxLargeInput.cxx 14 Jul 2005 16:12:05 -0000 1.7 +++ puAuxLargeInput.cxx 5 Jan 2006 21:00:26 -0000 1.8 @@ -172,7 +172,7 @@ if ( top_line_in_window < 0 ) top_line_in_window = 0 ; - right_slider->setValue ( 1.0f - float(top_line_in_window) / float(num_lines - lines_in_window) ) ; + right_slider->setValue ( num_lines - lines_in_window - top_line_in_window ) ; } } |
From: John F. F. <fa...@us...> - 2006-01-05 20:54:30
|
Update of /cvsroot/plib/plib/src/ssg In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30483 Modified Files: ssgLoadX.cxx ssgLoaderWriterStuff.cxx Log Message: Jan Reucker's DirectX loader patch in an e-mail to plib-devel on 11/21/05, 1:06 PM. Index: ssgLoadX.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgLoadX.cxx,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- ssgLoadX.cxx 2 Dec 2004 21:26:39 -0000 1.23 +++ ssgLoadX.cxx 5 Jan 2006 20:54:15 -0000 1.24 @@ -475,11 +475,16 @@ } } while(TRUE) - { char *nextToken =parser.getNextToken(0); + { + char *nextToken =parser.getNextToken(0); if (0==strcmp("}", nextToken)) { if ( nMaterialsRead < nMaterials ) parser.error("Too few Materials!\n"); //else parser.error("Success! MeshMaterialList!\n"); + for (int i = 0; i < globalMaterialList->getNum(); i++) + { + currentMesh.addMaterial(globalMaterialList->get(i)); + } return TRUE; // Mesh is finished. success } if(ulStrEqual ("{", nextToken) ) Index: ssgLoaderWriterStuff.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgLoaderWriterStuff.cxx,v retrieving revision 1.31 retrieving revision 1.32 diff -u -d -r1.31 -r1.32 --- ssgLoaderWriterStuff.cxx 6 Oct 2004 14:25:11 -0000 1.31 +++ ssgLoaderWriterStuff.cxx 5 Jan 2006 20:54:15 -0000 1.32 @@ -657,7 +657,9 @@ if ( colours == NULL ) { colours = new ssgColourArray ( 1 ) ; - colours -> add ( currentDiffuse ) ; + sgVec4 currentDiffuseColour; + sgCopyVec4(currentDiffuseColour, currentState->getMaterial(GL_DIFFUSE)); + colours -> add ( currentDiffuseColour ) ; } } ssgVtxArray* leaf = new ssgVtxArray ( GL_TRIANGLES, theVertices, normalList, theTextureCoordinates2, colours, indexList ) ; |
From: Bram S. <br...@us...> - 2005-12-16 20:55:39
|
Update of /cvsroot/plib/plib/src/puAux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv391 Modified Files: Makefile.am Log Message: added puAuxList.cxx Index: Makefile.am =================================================================== RCS file: /cvsroot/plib/plib/src/puAux/Makefile.am,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- Makefile.am 5 Aug 2004 01:03:49 -0000 1.3 +++ Makefile.am 16 Dec 2005 20:55:28 -0000 1.4 @@ -11,6 +11,7 @@ puAuxCompass.cxx \ puAuxFileSelector.cxx \ puAuxLargeInput.cxx \ + puAuxList.cxx \ puAuxScrollBar.cxx \ puAuxSelectBox.cxx \ puAuxSliderWithInput.cxx \ |
From: Bram S. <br...@us...> - 2005-12-13 18:12:04
|
Update of /cvsroot/plib/plib/src/puAux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13092 Added Files: puAuxList.cxx Log Message: Added puAuxList for J Fay --- NEW FILE: puAuxList.cxx --- /* PUI Auxiliary Widget Library Derived from PLIB, the Portable Game Library by Steve Baker. Copyright (C) 1998,2002,2004 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 [...184 lines suppressed...] _list_box->setValue(0); _slider = new puSlider(w-30, 30, h-60, true); _slider->setValue(1.0f); _slider->setUserData(_list_box); _slider->setCallback(handle_slider); _slider->setCBMode(PUSLIDER_ALWAYS); _down_arrow = new puArrowButton(w-30, 0, w, 30, PUARROW_DOWN) ; _down_arrow->setUserData(_slider); _down_arrow->setCallback(handle_arrow); _up_arrow = new puArrowButton(w-30, h-30, w, h, PUARROW_UP); _up_arrow->setUserData(_slider); _up_arrow->setCallback(handle_arrow); close(); } // end of puAuxList.cxx |
From: Bram S. <br...@us...> - 2005-12-06 14:25:29
|
Update of /cvsroot/plib/plib/src/ssg In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9937 Modified Files: ssg.h ssgSimpleList.cxx Log Message: Check ownership before delete. Fix by Mathias. Index: ssg.h =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssg.h,v retrieving revision 1.176 retrieving revision 1.177 diff -u -d -r1.176 -r1.177 --- ssg.h 29 Dec 2004 07:19:40 -0000 1.176 +++ ssg.h 6 Dec 2005 14:25:18 -0000 1.177 @@ -444,7 +444,8 @@ void removeAll () { - delete [] list ; + if ( own_mem ) + delete [] list ; list = NULL ; limit = total = 0 ; } Index: ssgSimpleList.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgSimpleList.cxx,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- ssgSimpleList.cxx 25 Jan 2004 16:50:04 -0000 1.14 +++ ssgSimpleList.cxx 6 Dec 2005 14:25:18 -0000 1.15 @@ -28,11 +28,13 @@ { ssgBase::copy_from ( src, clone_flags ) ; - delete [] list ; + if ( own_mem ) + delete [] list ; size_of = src -> getSizeOf () ; total = src -> getNum () ; limit = total ; list = new char [ limit * size_of ] ; + own_mem = true ; memcpy ( list, src->raw_get ( 0 ), limit * size_of ) ; } |
From: Bram S. <br...@us...> - 2005-12-06 14:17:32
|
Update of /cvsroot/plib/plib/src/ssg In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8823 Modified Files: ssgLoadAC.cxx Log Message: Avoid append flag. Fix by Mathias Index: ssgLoadAC.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgLoadAC.cxx,v retrieving revision 1.36 retrieving revision 1.37 diff -u -d -r1.36 -r1.37 --- ssgLoadAC.cxx 15 Jan 2005 20:36:46 -0000 1.36 +++ ssgLoadAC.cxx 6 Dec 2005 14:17:06 -0000 1.37 @@ -895,7 +895,7 @@ sgSetVec2 ( texrep, 1.0, 1.0 ) ; sgSetVec2 ( texoff, 0.0, 0.0 ) ; - loader_fd = fopen ( filename, "ra" ) ; + loader_fd = fopen ( filename, "r" ) ; if ( loader_fd == NULL ) { |
From: Bram S. <br...@us...> - 2005-11-28 18:02:04
|
Update of /cvsroot/plib/plib/doc/sg In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7731 Modified Files: index.html Log Message: Added aspect ratio warning Index: index.html =================================================================== RCS file: /cvsroot/plib/plib/doc/sg/index.html,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- index.html 27 Feb 2005 19:59:35 -0000 1.21 +++ index.html 28 Nov 2005 18:01:55 -0000 1.22 @@ -444,6 +444,10 @@ The constructor for an sgFrustum produces a simple 45 degree by 45 degree frustum with the near clip at one unit and the far clip at one million units. +When using setFOV, the application programmer should be +aware that aspect ratios are not enforced, thus these +ratios can deviate from the window aspect ratio. +If this happens, a sphere will look like an ellipse. <pre> int contains ( sgVec3 p ) ; |
From: Bram S. <br...@us...> - 2005-11-16 15:21:08
|
Update of /cvsroot/plib/plib/src/net In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3433 Modified Files: netSocket.cxx Log Message: Fixed the segm violation in net_echo Index: netSocket.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/net/netSocket.cxx,v retrieving revision 1.31 retrieving revision 1.32 diff -u -d -r1.31 -r1.32 --- netSocket.cxx 10 Nov 2005 20:55:54 -0000 1.31 +++ netSocket.cxx 16 Nov 2005 15:20:57 -0000 1.32 @@ -402,10 +402,6 @@ // which is an unportable feature anyway. retval = ::select (FD_SETSIZE, &r, &w, 0, &tv); - if (retval == 0) // timeout - return (-2); - if (retval == -1)// error - return (-1); //remove sockets that had no activity @@ -439,6 +435,11 @@ writes[k] = NULL ; } + if (retval == 0) // timeout + return (-2); + if (retval == -1)// error + return (-1); + return num ; } |
From: Bram S. <br...@us...> - 2005-11-14 12:12:36
|
Update of /cvsroot/plib/plib/examples/src/ssg/shrubs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8603 Modified Files: shrubs.cxx Log Message: We should not wrap the tree texture Index: shrubs.cxx =================================================================== RCS file: /cvsroot/plib/plib/examples/src/ssg/shrubs/shrubs.cxx,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- shrubs.cxx 30 Nov 2003 21:03:24 -0000 1.1 +++ shrubs.cxx 14 Nov 2005 12:12:25 -0000 1.2 @@ -351,7 +351,7 @@ // now load the shrubs - ssgTexture *tex = new ssgTexture("data/deciduous-tree.rgb"); + ssgTexture *tex = new ssgTexture("data/deciduous-tree.rgb", FALSE, FALSE); ssgaBillboards::initTexAlpha(tex); |
From: John F. F. <fa...@us...> - 2005-11-10 20:56:03
|
Update of /cvsroot/plib/plib/src/net In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17840 Modified Files: netSocket.cxx netSocket.h Log Message: NetSocket patch from Oliver Schroeder (see PLIB-devel e-mail of 10/21/05) Index: netSocket.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/net/netSocket.cxx,v retrieving revision 1.30 retrieving revision 1.31 diff -u -d -r1.30 -r1.31 --- netSocket.cxx 6 Apr 2004 12:42:40 -0000 1.30 +++ netSocket.cxx 10 Nov 2005 20:55:54 -0000 1.31 @@ -117,12 +117,20 @@ return buf; } +unsigned int netAddress::getIP () const +{ + return sin_addr; +} -int netAddress::getPort() const +unsigned int netAddress::getPort() const { [...96 lines suppressed...] { - int fd = writes[i]->getHandle(); - if (FD_ISSET (fd, &w)) { - writes[k++] = writes[i]; - num++; + for ( k=i=0; writes[i]; i++ ) + { + int fd = writes[i]->getHandle(); + if ( FD_ISSET (fd, &w) ) + { + writes[k++] = writes[i]; + num++; + } } + writes[k] = NULL ; } - writes[k] = NULL ; return num ; } Index: netSocket.h =================================================================== RCS file: /cvsroot/plib/plib/src/net/netSocket.h,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- netSocket.h 28 Mar 2004 03:58:24 -0000 1.20 +++ netSocket.h 10 Nov 2005 20:55:54 -0000 1.21 @@ -40,7 +40,6 @@ #ifndef NET_SOCKET_H #define NET_SOCKET_H - #include "ul.h" #include <errno.h> @@ -61,8 +60,9 @@ void set ( const char* host, int port ) ; const char* getHost () const ; - int getPort() const ; - + unsigned int getPort() const ; + unsigned int getIP () const ; + unsigned int getFamily () const ; static const char* getLocalHost () ; bool getBroadcast () const ; @@ -85,7 +85,7 @@ void setHandle (int handle) ; bool open ( bool stream=true ) ; - void close ( void ) ; + void close ( void ) ; int bind ( const char* host, int port ) ; int listen ( int backlog ) ; int accept ( netAddress* addr ) ; |
From: John F. F. <fa...@us...> - 2005-11-10 20:21:31
|
Update of /cvsroot/plib/plib/src/pui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9937 Modified Files: pu.h puComboBox.cxx puObject.cxx puSelectBox.cxx Log Message: Adding the new Edit Field colour to PUI widgets and extending the PUSTRING_MAX from 80 to 256 Index: pu.h =================================================================== RCS file: /cvsroot/plib/plib/src/pui/pu.h,v retrieving revision 1.151 retrieving revision 1.152 diff -u -d -r1.151 -r1.152 --- pu.h 28 Aug 2005 06:25:15 -0000 1.151 +++ pu.h 10 Nov 2005 20:21:22 -0000 1.152 @@ -185,7 +185,8 @@ #define PUCOL_LABEL 3 #define PUCOL_LEGEND 4 #define PUCOL_MISC 5 -#define PUCOL_MAX 6 +#define PUCOL_EDITFIELD 6 +#define PUCOL_MAX 7 #define PUSLIDER_CLICK 0 #define PUSLIDER_ALWAYS 1 @@ -301,7 +302,7 @@ int isEmpty ( void ) const { return min[0]>max[0] || min[1]>max[1] ; } } ; -#define PUSTRING_MAX 80 +#define PUSTRING_MAX 256 /* With many memory managers, allocating powers of two is more efficient */ #define PUSTRING_INITIAL 64 @@ -790,13 +791,13 @@ int getStyle ( void ) const { return style ; } - void setColourScheme ( float r, float g, float b, float a = 1.0f ) ; + virtual void setColourScheme ( float r, float g, float b, float a = 1.0f ) ; void setColorScheme ( float r, float g, float b, float a = 1.0f ) { setColourScheme ( r, g, b, a ) ; } - void setColour ( int which, float r, float g, float b, float a = 1.0f ) + virtual void setColour ( int which, float r, float g, float b, float a = 1.0f ) { puSetColour ( colour [ which ], r, g, b, a ) ; puPostRefresh () ; @@ -1638,7 +1639,10 @@ { type |= PUCLASS_INPUT ; - setColourScheme ( 0.8f, 0.7f, 0.7f ) ; /* Yeukky Pink */ + setColourScheme ( colour [ PUCOL_EDITFIELD ][0], + colour [ PUCOL_EDITFIELD ][1], + colour [ PUCOL_EDITFIELD ][2], + colour [ PUCOL_EDITFIELD ][3] ) ; setColour ( PUCOL_MISC, 0.1f, 0.1f, 1.0f ) ; /* Colour of 'I' bar cursor */ widget = this ; @@ -2035,6 +2039,9 @@ int checkHit ( int button, int updown, int x, int y ) ; int checkKey ( int key, int updown ) ; + virtual void setColourScheme ( float r, float g, float b, float a = 1.0f ) ; + virtual void setColour ( int which, float r, float g, float b, float a = 1.0f ) ; + puComboBox ( int minx, int miny, int maxx, int maxy, char **list, int editable = TRUE ) ; } ; @@ -2084,6 +2091,9 @@ void draw ( int dx, int dy ) ; int checkKey ( int key, int updown ) ; + virtual void setColourScheme ( float r, float g, float b, float a = 1.0f ) ; + virtual void setColour ( int which, float r, float g, float b, float a = 1.0f ) ; + puSelectBox ( int minx, int miny, int maxx, int maxy, char **list ) ; } ; Index: puComboBox.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/pui/puComboBox.cxx,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- puComboBox.cxx 23 Feb 2004 04:16:52 -0000 1.15 +++ puComboBox.cxx 10 Nov 2005 20:21:22 -0000 1.16 @@ -230,6 +230,24 @@ return TRUE ; } +void puComboBox::setColourScheme ( float r, float g, float b, float a ) +{ + puObject::setColourScheme ( r, g, b, a ) ; + setChildColourScheme( PUCLASS_INPUT, + colour [ PUCOL_EDITFIELD ][0], + colour [ PUCOL_EDITFIELD ][1], + colour [ PUCOL_EDITFIELD ][2], + colour [ PUCOL_EDITFIELD ][3] ) ; +} + +void puComboBox::setColour ( int which, float r, float g, float b, float a ) +{ + if (which == PUCOL_EDITFIELD) + input->setColourScheme ( r, g, b, a ) ; + else + puObject::setColour ( which, r, g, b, a ) ; +} + puComboBox::puComboBox ( int minx, int miny, int maxx, int maxy, char **entries, int editable ) : Index: puObject.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/pui/puObject.cxx,v retrieving revision 1.52 retrieving revision 1.53 diff -u -d -r1.52 -r1.53 --- puObject.cxx 6 May 2005 18:46:34 -0000 1.52 +++ puObject.cxx 10 Nov 2005 20:21:22 -0000 1.53 @@ -39,7 +39,8 @@ { 0.7f, 0.7f, 0.7f, 1.0f }, /* PUCOL_HIGHLIGHT */ { 0.0f, 0.0f, 0.0f, 1.0f }, /* PUCOL_LABEL */ { 1.0f, 1.0f, 1.0f, 1.0f }, /* PUCOL_LEGEND */ - { 0.0f, 0.0f, 0.0f, 1.0f } /* PUCOL_MISC */ + { 0.0f, 0.0f, 0.0f, 1.0f }, /* PUCOL_MISC */ + { 0.8f, 0.7f, 0.7f, 1.0f } /* PUCOL_EDITFIELD */ } ; Index: puSelectBox.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/pui/puSelectBox.cxx,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- puSelectBox.cxx 23 Feb 2004 04:16:52 -0000 1.9 +++ puSelectBox.cxx 10 Nov 2005 20:21:22 -0000 1.10 @@ -147,6 +147,24 @@ return TRUE ; } +void puSelectBox::setColourScheme ( float r, float g, float b, float a ) +{ + puObject::setColourScheme ( r, g, b, a ) ; + setChildColourScheme( PUCLASS_INPUT, + colour [ PUCOL_EDITFIELD ][0], + colour [ PUCOL_EDITFIELD ][1], + colour [ PUCOL_EDITFIELD ][2], + colour [ PUCOL_EDITFIELD ][3] ) ; +} + +void puSelectBox::setColour ( int which, float r, float g, float b, float a ) +{ + if (which == PUCOL_EDITFIELD) + input->setColourScheme ( r, g, b, a ) ; + else + puObject::setColour ( which, r, g, b, a ) ; +} + puSelectBox::puSelectBox ( int minx, int miny, int maxx, int maxy, char **entries ) : |
From: John F. F. <fa...@us...> - 2005-11-10 20:07:16
|
Update of /cvsroot/plib/plib/src/puAux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6036 Modified Files: puAux.h puAuxComboBox.cxx puAuxSelectBox.cxx Log Message: More widget colors. I'm not really sure, since I'm not really John Fay. Forgive me! Index: puAux.h =================================================================== RCS file: /cvsroot/plib/plib/src/puAux/puAux.h,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- puAux.h 6 May 2005 19:04:32 -0000 1.7 +++ puAux.h 10 Nov 2005 20:07:08 -0000 1.8 @@ -277,6 +277,9 @@ int getCallbackSource ( void ) const { return callback_source ; } + virtual void setColourScheme ( float r, float g, float b, float a = 1.0f ) ; + virtual void setColour ( int which, float r, float g, float b, float a = 1.0f ) ; + puaComboBox ( int minx, int miny, int maxx, int maxy, char **list, int editable = TRUE ) ; @@ -358,6 +361,9 @@ void draw ( int dx, int dy ) ; int checkKey ( int key, int updown ) ; + virtual void setColourScheme ( float r, float g, float b, float a = 1.0f ) ; + virtual void setColour ( int which, float r, float g, float b, float a = 1.0f ) ; + puaSelectBox ( int minx, int miny, int maxx, int maxy, char **list ) ; } ; @@ -866,6 +872,14 @@ * A scrolling list for PUI. * * Believe it or not, PUI does not have one of these. + * + * This widget consists of a puListBox, a slider and two + * arrow buttons. This makes the ListBox scrollable, + * very handy if the box is too small to show all items + * at once. + * + * (Original code taken from FlightGear 0.9.6 sources, + * modified by Jan Reucker) */ class puaList : public puGroup { @@ -877,19 +891,32 @@ puSlider * _slider; puArrowButton * _up_arrow; puArrowButton * _down_arrow; + int _style; protected: - virtual void init (int w, int h); + virtual void init (int w, int h, short transparent); public: puaList (int x, int y, int w, int h); puaList (int x, int y, int w, int h, char ** contents); + puaList (int x, int y, int w, int h, short transparent); + puaList (int x, int y, int w, int h, short transparent, char ** contents); virtual ~puaList (); virtual void newList (char ** contents); - // TODO: other string value funcs virtual char * getListStringValue (); virtual int getListIntegerValue(); + + virtual char * getStringValue (); + virtual int getIntegerValue (); + virtual void getValue (char **ps); + virtual void getValue (int *i); + + virtual void setStyle (int style); + + int getNumItems ( void ) const ; + int getTopItem ( void ) const ; + void setTopItem ( int item_index ); }; #endif Index: puAuxComboBox.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/puAux/puAuxComboBox.cxx,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- puAuxComboBox.cxx 6 May 2005 19:04:32 -0000 1.5 +++ puAuxComboBox.cxx 10 Nov 2005 20:07:08 -0000 1.6 @@ -304,6 +304,24 @@ return TRUE ; } +void puaComboBox::setColourScheme ( float r, float g, float b, float a ) +{ + puObject::setColourScheme ( r, g, b, a ) ; + setChildColourScheme( PUCLASS_INPUT, + colour [ PUCOL_EDITFIELD ][0], + colour [ PUCOL_EDITFIELD ][1], + colour [ PUCOL_EDITFIELD ][2], + colour [ PUCOL_EDITFIELD ][3] ) ; +} + +void puaComboBox::setColour ( int which, float r, float g, float b, float a ) +{ + if (which == PUCOL_EDITFIELD) + input->setColourScheme ( r, g, b, a ) ; + else + puObject::setColour ( which, r, g, b, a ) ; +} + puaComboBox::puaComboBox ( int minx, int miny, int maxx, int maxy, char **entries, int editable ) : Index: puAuxSelectBox.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/puAux/puAuxSelectBox.cxx,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- puAuxSelectBox.cxx 21 Mar 2004 19:03:23 -0000 1.3 +++ puAuxSelectBox.cxx 10 Nov 2005 20:07:08 -0000 1.4 @@ -148,6 +148,24 @@ return TRUE ; } +void puaSelectBox::setColourScheme ( float r, float g, float b, float a ) +{ + puObject::setColourScheme ( r, g, b, a ) ; + setChildColourScheme( PUCLASS_INPUT, + colour [ PUCOL_EDITFIELD ][0], + colour [ PUCOL_EDITFIELD ][1], + colour [ PUCOL_EDITFIELD ][2], + colour [ PUCOL_EDITFIELD ][3] ) ; +} + +void puaSelectBox::setColour ( int which, float r, float g, float b, float a ) +{ + if (which == PUCOL_EDITFIELD) + input->setColourScheme ( r, g, b, a ) ; + else + puObject::setColour ( which, r, g, b, a ) ; +} + puaSelectBox::puaSelectBox ( int minx, int miny, int maxx, int maxy, char **entries ) : |
From: John F. F. <fa...@us...> - 2005-10-17 16:58:43
|
Update of /cvsroot/plib/plib/src/ssg In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26848 Modified Files: ssgVertSplitter.cxx Log Message: Fixing a memory leak (thank you, Mathias Frohlich Index: ssgVertSplitter.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgVertSplitter.cxx,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- ssgVertSplitter.cxx 18 Mar 2004 22:09:07 -0000 1.4 +++ ssgVertSplitter.cxx 17 Oct 2005 16:58:36 -0000 1.5 @@ -36,6 +36,8 @@ _tris = new Tri[3*_nTris]; _triNorms = new float[3*_nTris]; _geomVerts = new int[_nVerts]; + + _newVertMap = 0; } ssgVertSplitter::~ssgVertSplitter() @@ -44,6 +46,8 @@ delete[] _norms; delete[] _tris; delete[] _triNorms; + delete[] _newVertMap; + delete[] _geomVerts; } void ssgVertSplitter::setTri(int tidx, int va, int vb, int vc) |
From: John F. F. <fa...@us...> - 2005-10-01 04:02:52
|
Update of /cvsroot/plib/plib/examples In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24533 Modified Files: plib_examples.dsw Log Message: Adding the \"pview\" example to the MSVC workspace file Index: plib_examples.dsw =================================================================== RCS file: /cvsroot/plib/plib/examples/plib_examples.dsw,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- plib_examples.dsw 24 Mar 2004 10:52:30 -0000 1.25 +++ plib_examples.dsw 30 Sep 2005 18:07:57 -0000 1.26 @@ -269,6 +269,8 @@ Begin Project Dependency Project_Dep_Name stest End Project Dependency + Project_Dep_Name pview + End Project Dependency }}} ############################################################################### @@ -285,6 +287,18 @@ ############################################################################### +Project: "pview"=".\src\ssg\viewer\pview.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + Project: "pw_demo"=".\src\pw\pw_demo.dsp" - Package Owner=<4> Package=<5> |
From: John F. F. <fa...@us...> - 2005-09-30 18:25:48
|
Update of /cvsroot/plib/plib/examples/src/ssg/viewer In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26047 Modified Files: pview.cxx Added Files: pview.dsp Log Message: Implementing \"pview\" in the MSVC examples --- NEW FILE: pview.dsp --- # Microsoft Developer Studio Project File - Name="pview" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Console Application" 0x0103 CFG=pview - 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 "pview.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 "pview.mak" CFG="pview - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE [...63 lines suppressed...] # Name "pview - Win32 Release" # Name "pview - Win32 Debug" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=.\pview.cxx # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project Index: pview.cxx =================================================================== RCS file: /cvsroot/plib/plib/examples/src/ssg/viewer/pview.cxx,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- pview.cxx 21 Aug 2005 08:47:14 -0000 1.1 +++ pview.cxx 30 Sep 2005 18:14:09 -0000 1.2 @@ -34,6 +34,10 @@ #include <plib/ssg.h> +#ifndef M_PI +#define M_PI 3.14159265358979323846264338327950f +#endif + static float aspectratio=1.0; static int winw, winh; static ssgRoot *scene=0; @@ -91,14 +95,14 @@ if (prevbutton==1) { float curdist = sgLengthVec3(camtrf[3]); - sgAddScaledVec3(camtrf[3], camtrf[2], dy*curdist/200.0); - sgAddScaledVec3(camtrf[3], camtrf[0], -dx*curdist/200.0); + sgAddScaledVec3(camtrf[3], camtrf[2], dy*curdist/200.0f); + sgAddScaledVec3(camtrf[3], camtrf[0], -dx*curdist/200.0f); return; } if (prevbutton==2) { float curdist = sgLengthVec3(camtrf[3]); - sgAddScaledVec3(camtrf[3], camtrf[1], -dy*curdist/80.0); + sgAddScaledVec3(camtrf[3], camtrf[1], -dy*curdist/80.0f); return; } } @@ -110,10 +114,10 @@ aspectratio = w / (float) h; winw=w; winh=h; - float fovy = 60.0 * M_PI / 180.0; - float nearPlaneDistance = 0.4; + float fovy = 60.0f * M_PI / 180.0f; + float nearPlaneDistance = 0.4f; float farPlaneDistance = 2500.0; - float y = tan(0.5 * fovy) * nearPlaneDistance; + float y = (float)tan(0.5 * fovy) * nearPlaneDistance; float x = aspectratio * y; context->setFrustum(-x,x,-y,y,nearPlaneDistance,farPlaneDistance); } @@ -148,12 +152,12 @@ ssgInit(); - glClearColor(0.3,0.3,0.55,1); + glClearColor(0.3f,0.3f,0.55f,1.0f); glEnable(GL_DEPTH_TEST); glEnable(GL_CULL_FACE); scene = new ssgRoot(); - float amb[4]={0.2, 0.2, 0.2, 1}; + float amb[4]={0.2f, 0.2f, 0.2f, 1.0f}; glLightModelfv(GL_LIGHT_MODEL_AMBIENT, amb); ssgTransform *trf = new ssgTransform(); @@ -171,7 +175,7 @@ trf->setTransform(off); SGfloat radius = scene->getBSphere()->getRadius(); - float d = 1.8*radius; + float d = 1.8f*radius; if (d<0.5) d=0.5; // avoid placing near-plane beyond model sgMakeTransMat4(camtrf, 0, -d, 0); @@ -181,5 +185,7 @@ light->on(); glutMainLoop(); + + return 0; } |