plib-cvs Mailing List for PLIB (Page 61)
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: Sebastian U. <ud...@us...> - 2002-03-05 15:18:59
|
Update of /cvsroot/plib/plib/src/sl In directory usw-pr-cvs1:/tmp/cvs-serv8940 Modified Files: smMixer.cxx Log Message: Corrected smMixer::open / smMixer::smMixer declarations for *BSD Index: smMixer.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/sl/smMixer.cxx,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- smMixer.cxx 5 Mar 2002 14:56:33 -0000 1.6 +++ smMixer.cxx 5 Mar 2002 15:18:56 -0000 1.7 @@ -185,14 +185,14 @@ /* NetBSD or OpenBSD 2.3 */ /* ------------------------------------------------------------ */ -void smMixer::open ( char *device ) +void smMixer::open ( const char *device ) { } void smMixer::close (){} smMixer::smMixer () {} -smMixer::smMixer ( char * ) {} +smMixer::smMixer ( const char * ) {} smMixer::~smMixer () {} int smMixer::notWorking () const |
From: Sebastian U. <ud...@us...> - 2002-03-05 14:56:37
|
Update of /cvsroot/plib/plib/src/sl In directory usw-pr-cvs1:/tmp/cvs-serv31291 Modified Files: smMixer.cxx Log Message: Paul Deppe: Fixed const-correct version of smMixer for *BSD / Win32 Index: smMixer.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/sl/smMixer.cxx,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- smMixer.cxx 3 Mar 2002 15:28:17 -0000 1.5 +++ smMixer.cxx 5 Mar 2002 14:56:33 -0000 1.6 @@ -195,7 +195,7 @@ smMixer::smMixer ( char * ) {} smMixer::~smMixer () {} -int smMixer::notWorking () +int smMixer::notWorking () const { return error ; } @@ -242,7 +242,7 @@ smMixer::smMixer ( const char * ) {} smMixer::~smMixer () {} -int smMixer::notWorking () +int smMixer::notWorking () const { return error ; } |
From: Sebastian U. <ud...@us...> - 2002-03-03 16:03:36
|
Update of /cvsroot/plib/plib/src/sl In directory usw-pr-cvs1:/tmp/cvs-serv19857/sl Modified Files: Makefile.am Log Message: Do not install slMODPrivate.h and slMODfile.h on the user's system Index: Makefile.am =================================================================== RCS file: /cvsroot/plib/plib/src/sl/Makefile.am,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- Makefile.am 3 Oct 2001 10:21:10 -0000 1.5 +++ Makefile.am 3 Mar 2002 16:03:33 -0000 1.6 @@ -1,12 +1,12 @@ lib_LIBRARIES = libplibsl.a libplibsm.a -include_HEADERS = sl.h slPortability.h sm.h slMODPrivate.h slMODfile.h +include_HEADERS = sl.h slPortability.h sm.h libplibsl_a_SOURCES = \ slDSP.cxx slSample.cxx slEnvelope.cxx \ slPlayer.cxx slMODPlayer.cxx slSamplePlayer.cxx \ slScheduler.cxx slMODdacio.cxx slMODfile.cxx \ - slMODinst.cxx slMODnote.cxx + slMODinst.cxx slMODnote.cxx slMODPrivate.h slMODfile.h libplibsm_a_SOURCES = slPortability.h smMixer.cxx |
Update of /cvsroot/plib/plib/src/sl In directory usw-pr-cvs1:/tmp/cvs-serv10997/sl Modified Files: sl.h slDSP.cxx slEnvelope.cxx slMODPlayer.cxx slMODfile.cxx slMODfile.h slSample.cxx slScheduler.cxx sm.h smMixer.cxx Log Message: Made SL/SM const-correct Index: sl.h =================================================================== RCS file: /cvsroot/plib/plib/src/sl/sl.h,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- sl.h 7 Nov 2001 23:51:09 -0000 1.9 +++ sl.h 3 Mar 2002 15:28:16 -0000 1.10 @@ -58,7 +58,7 @@ class slScheduler ; class slDSP ; -extern char *__slPendingError ; +extern const char *__slPendingError ; class slDSP { @@ -146,7 +146,7 @@ #endif [...239 lines suppressed...] + int getMaxConcurrent () const ; void flushCallBacks () ; void addCallBack ( slCallBack c, slSample *s, slEvent e, int m ) ; @@ -699,13 +701,13 @@ int loopSample ( slSample *s, int pri = 0, slPreemptMode mode = SL_SAMPLE_MUTE, int magic = 0, slCallBack cb = NULL ) ; - int loopMusic ( char *fname, int pri = 0, + int loopMusic ( const char *fname, int pri = 0, slPreemptMode mode = SL_SAMPLE_MUTE, int magic = 0, slCallBack cb = NULL ) ; int playSample ( slSample *s, int pri = 1, slPreemptMode mode = SL_SAMPLE_ABORT, int magic = 0, slCallBack cb = NULL ) ; - int playMusic ( char *fname, int pri = 1, + int playMusic ( const char *fname, int pri = 1, slPreemptMode mode = SL_SAMPLE_ABORT, int magic = 0, slCallBack cb = NULL ) ; Index: slDSP.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/sl/slDSP.cxx,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- slDSP.cxx 6 Feb 2002 07:00:41 -0000 1.11 +++ slDSP.cxx 3 Mar 2002 15:28:17 -0000 1.12 @@ -33,7 +33,7 @@ /* OSSAUDIO - Linux, FreeBSD, etc */ /* ------------------------------------------------------------ */ -void slDSP::open ( char *device, int _rate, int _stereo, int _bps ) +void slDSP::open ( const char *device, int _rate, int _stereo, int _bps ) { fd = ::open ( device, O_WRONLY | O_NONBLOCK ) ; @@ -191,7 +191,7 @@ } -void slDSP::open ( char *device, int _rate, int _stereo, int _bps ) +void slDSP::open ( const char *device, int _rate, int _stereo, int _bps ) { MMRESULT result; int i; @@ -414,7 +414,7 @@ /* ------------------------------------------------------------ */ #elif defined(__NetBSD__) || defined(__OpenBSD__) || defined(SOLARIS) -void slDSP::open ( char *device, int _rate, int _stereo, int _bps ) +void slDSP::open ( const char *device, int _rate, int _stereo, int _bps ) { counter = 0; @@ -627,7 +627,7 @@ #elif defined(sgi) -void slDSP::open ( char *device, int _rate, int _stereo, int _bps ) +void slDSP::open ( const char *device, int _rate, int _stereo, int _bps ) { if ( _bps != 8 ) { @@ -861,7 +861,7 @@ #endif } -void slDSP::open ( char *device, int _rate, int _stereo, int _bps ) +void slDSP::open ( const char *device, int _rate, int _stereo, int _bps ) { // Check for valid ranges on inputs Index: slEnvelope.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/sl/slEnvelope.cxx,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- slEnvelope.cxx 7 Nov 2001 23:51:09 -0000 1.3 +++ slEnvelope.cxx 3 Mar 2002 15:28:17 -0000 1.4 @@ -24,7 +24,7 @@ #include "sl.h" -float slEnvelope::getValue ( float _time ) +float slEnvelope::getValue ( float _time ) const { float delta ; int step = getStepDelta ( &_time, &delta ) ; @@ -34,7 +34,7 @@ -int slEnvelope::getStepDelta ( float *_time, float *delta ) +int slEnvelope::getStepDelta ( float *_time, float *delta ) const { float tt ; Index: slMODPlayer.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/sl/slMODPlayer.cxx,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- slMODPlayer.cxx 7 Nov 2001 23:51:09 -0000 1.3 +++ slMODPlayer.cxx 3 Mar 2002 15:28:17 -0000 1.4 @@ -31,7 +31,7 @@ return slPlayer::preempt ( delay ) ; } -void slMODPlayer::init ( char *fname ) +void slMODPlayer::init ( const char *fname ) { mf = new MODfile ( fname, slScheduler::getCurrent()->getRate (), SL_FALSE ) ; } Index: slMODfile.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/sl/slMODfile.cxx,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- slMODfile.cxx 7 Nov 2001 23:51:09 -0000 1.5 +++ slMODfile.cxx 3 Mar 2002 15:28:17 -0000 1.6 @@ -33,9 +33,9 @@ #define u16BigEndian(x) (((unsigned char *)(x))[0]*(unsigned short)256 + \ ((unsigned char *)(x))[1]) -static char *transTab = "JFEGHLKRXODB.C" ; -static char *transTabE = "SFESSSSSSQ..SSSS" ; -static char transTabEX[] = { 0,0xF,0xF,1,3,2,0xB,4,8,0,0,0,0xC,0xD,0xE,0xF } ; +static const char *transTab = "JFEGHLKRXODB.C" ; +static const char *transTabE = "SFESSSSSSQ..SSSS" ; +static const char transTabEX[] = { 0,0xF,0xF,1,3,2,0xB,4,8,0,0,0,0xC,0xD,0xE,0xF } ; static int oct[12] = { 1712, 1616, 1524, 1440, 1356, 1280, 1208, 1140, 1076, 1016, 960, 907 } ; static int freq[16] = { 8363, 8413, 8463, 8529, 8581, 8651, 8723, 8757, @@ -218,9 +218,9 @@ struct MagicInfo { - char *str ; - int off ; - MagicType type ; + const char *str ; + int off ; + MagicType type ; } ; @@ -247,7 +247,8 @@ for (mip = magicInfo; mip->str != 0; mip++) { - char *ss, *sp; + const char *ss ; + char *sp ; if (mip->off + 16 >= size) continue ; /* Magicinfo.str must < 16 */ @@ -576,7 +577,7 @@ -unsigned char *MODfile::read_whole_file ( char *fname, int *len ) +unsigned char *MODfile::read_whole_file ( const char *fname, int *len ) { struct stat statbuf ; @@ -612,7 +613,7 @@ -MODfile::MODfile ( char *fname, int speed, int stereo ) +MODfile::MODfile ( const char *fname, int speed, int stereo ) { p0 = NULL ; songName = NULL ; ord = NULL ; smpInfop = NULL ; smp0p = NULL ; pat = NULL ; Index: slMODfile.h =================================================================== RCS file: /cvsroot/plib/plib/src/sl/slMODfile.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- slMODfile.h 7 Nov 2001 23:51:09 -0000 1.3 +++ slMODfile.h 3 Mar 2002 15:28:17 -0000 1.4 @@ -66,11 +66,11 @@ void makeSampleInfo ( int smp15 ) ; void parseMod ( unsigned char *pp0, int smp15 ) ; void play_one ( int ppat ) ; - unsigned char *read_whole_file ( char *fname, int *len ) ; + unsigned char *read_whole_file ( const char *fname, int *len ) ; public: - MODfile ( char *fname, int speed = 44100, int stereo = 0 ) ; + MODfile ( const char *fname, int speed = 44100, int stereo = 0 ) ; ~MODfile () ; int update () ; Index: slSample.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/sl/slSample.cxx,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- slSample.cxx 1 Mar 2002 17:51:53 -0000 1.5 +++ slSample.cxx 3 Mar 2002 15:28:17 -0000 1.6 @@ -25,7 +25,7 @@ #include "sl.h" #include <math.h> -void slSample::autoMatch ( slDSP *dsp ) +void slSample::autoMatch ( const slDSP *dsp ) { if ( dsp == NULL || dsp->notWorking () ) return ; @@ -222,49 +222,16 @@ ((*i >> 24) & 0x000000FF) ; } -/* - I'm sick of half the machines on the planet supporting - strcasecmp and the other half stricmp - so here is my own - offering: -*/ - -static int _slStrEqual ( char *s1, char *s2 ) -{ - int l1 = (s1==NULL)? 0 : strlen ( s1 ) ; - int l2 = (s2==NULL)? 0 : strlen ( s2 ) ; - - if ( l1 != l2 ) return SL_FALSE ; - - for ( int i = 0 ; i < l1 ; i++ ) - { - char c1 = s1[i] ; - char c2 = s2[i] ; - - if ( c1 == c2 ) - continue ; - - if ( c1 >= 'a' && c1 <= 'z' ) - c1 = c1 - ('a'-'A') ; - if ( c2 >= 'a' && c2 <= 'z' ) - c2 = c2 - ('a'-'A') ; - - if ( c1 != c2 ) - return SL_FALSE ; - } - - return SL_TRUE ; -} - -int slSample::loadFile ( char *fname ) +int slSample::loadFile ( const char *fname ) { - if ( _slStrEqual ( & fname [ strlen ( fname ) - 4 ], ".wav" ) ) + if ( ulStrEqual ( & fname [ strlen ( fname ) - 4 ], ".wav" ) ) return loadWavFile ( fname ) ; - if ( _slStrEqual ( & fname [ strlen ( fname ) - 3 ], ".au" ) ) + if ( ulStrEqual ( & fname [ strlen ( fname ) - 3 ], ".au" ) ) return loadAUFile ( fname ) ; - if ( _slStrEqual ( & fname [ strlen ( fname ) - 3 ], ".ub" ) ) + if ( ulStrEqual ( & fname [ strlen ( fname ) - 3 ], ".ub" ) ) return loadRawFile ( fname ) ; ulSetError ( UL_WARNING, @@ -273,7 +240,7 @@ } -int slSample::loadWavFile ( char *fname ) +int slSample::loadWavFile ( const char *fname ) { int found_header = SL_FALSE ; int needs_swabbing = SL_FALSE ; @@ -418,7 +385,7 @@ return SL_FALSE ; } -int slSample::loadAUFile ( char *fname ) +int slSample::loadAUFile ( const char *fname ) { delete buffer ; buffer = NULL ; @@ -512,7 +479,7 @@ } -int slSample::loadRawFile ( char *fname ) +int slSample::loadRawFile ( const char *fname ) { delete buffer ; buffer = NULL ; Index: slScheduler.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/sl/slScheduler.cxx,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- slScheduler.cxx 7 Nov 2001 23:51:09 -0000 1.6 +++ slScheduler.cxx 3 Mar 2002 15:28:17 -0000 1.7 @@ -24,7 +24,7 @@ #include "sl.h" -char *__slPendingError = NULL ; +const char *__slPendingError = NULL ; slScheduler *slScheduler::current = NULL ; @@ -104,7 +104,7 @@ } } -int slScheduler::getMaxConcurrent ( void ) +int slScheduler::getMaxConcurrent ( void ) const { int mi, mc = 0; for ( mi = 0; mi < SL_MAX_MIXERINPUTS; mi ++ ) @@ -487,7 +487,7 @@ } } -int slScheduler::loopMusic ( char *fname, int pri, +int slScheduler::loopMusic ( const char *fname, int pri, slPreemptMode mode, int magic, slCallBack cb ) { @@ -511,7 +511,7 @@ return -1 ; } -int slScheduler::playMusic ( char *fname, int pri, +int slScheduler::playMusic ( const char *fname, int pri, slPreemptMode mode, int magic, slCallBack cb ) { Index: sm.h =================================================================== RCS file: /cvsroot/plib/plib/src/sl/sm.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- sm.h 7 Nov 2001 23:51:09 -0000 1.3 +++ sm.h 3 Mar 2002 15:28:17 -0000 1.4 @@ -65,7 +65,7 @@ return param ; } #endif - void open ( char *device ) ; + void open ( const char *device ) ; void close () ; public: @@ -73,11 +73,11 @@ /* Tom */ smMixer (); - smMixer ( char *device ); + smMixer ( const char *device ); ~smMixer (); - int notWorking (); - int not_working () { return notWorking () ; } /* Originally a typo! */ + int notWorking () const ; + int not_working () const { return notWorking () ; } /* Originally a typo! */ /* Volume controls are in integer percentages */ Index: smMixer.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/sl/smMixer.cxx,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- smMixer.cxx 7 Nov 2001 23:51:09 -0000 1.4 +++ smMixer.cxx 3 Mar 2002 15:28:17 -0000 1.5 @@ -29,7 +29,7 @@ /* ------------------------------------------------------------ */ -void smMixer::open ( char *device ) +void smMixer::open ( const char *device ) { fd = ::open ( device, O_WRONLY ) ; @@ -56,7 +56,7 @@ open ( SMMIXER_DEFAULT_DEVICE ) ; } -smMixer::smMixer ( char *device ) +smMixer::smMixer ( const char *device ) { open ( device ) ; } @@ -66,7 +66,7 @@ close () ; } -int smMixer::notWorking () +int smMixer::notWorking () const { return error ; } @@ -234,12 +234,12 @@ /* win32 */ /* ------------------------------------------------------------ */ -void smMixer::open ( char * ) {} +void smMixer::open ( const char * ) {} void smMixer::close (){} smMixer::smMixer () {} -smMixer::smMixer ( char * ) {} +smMixer::smMixer ( const char * ) {} smMixer::~smMixer () {} int smMixer::notWorking () |
From: Sebastian U. <ud...@us...> - 2002-03-03 14:17:21
|
Update of /cvsroot/plib/plib/src/util In directory usw-pr-cvs1:/tmp/cvs-serv25359/util Modified Files: ul.h ulList.cxx Log Message: Made ulList const-correct Index: ul.h =================================================================== RCS file: /cvsroot/plib/plib/src/util/ul.h,v retrieving revision 1.33 retrieving revision 1.34 diff -u -d -r1.33 -r1.34 --- ul.h 14 Dec 2001 15:24:40 -0000 1.33 +++ ul.h 3 Mar 2002 14:17:16 -0000 1.34 @@ -652,11 +652,12 @@ replaceEntity ( searchForEntity ( old_entity ), new_entity ) ; } - int getNumEntities (void) { return total ; } void *getNextEntity (void) { return getEntity ( next+1 ) ; } - int searchForEntity ( void *entity ) ; + + int getNumEntities (void) const { return total ; } + int searchForEntity ( void *entity ) const ; } ; - + extern int ulStrNEqual ( const char *s1, const char *s2, int len ); extern int ulStrEqual ( const char *s1, const char *s2 ); Index: ulList.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/util/ulList.cxx,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- ulList.cxx 7 Nov 2001 23:51:10 -0000 1.2 +++ ulList.cxx 3 Mar 2002 14:17:16 -0000 1.3 @@ -76,7 +76,7 @@ } -int ulList::searchForEntity ( void *entity ) +int ulList::searchForEntity ( void *entity ) const { for ( unsigned int i = 0 ; i < total ; i++ ) if ( entity_list [ i ] == entity ) |
From: Sebastian U. <ud...@us...> - 2002-03-02 18:20:13
|
Update of /cvsroot/plib/plib/src/pui In directory usw-pr-cvs1:/tmp/cvs-serv12662/pui Modified Files: pu.h puFont.cxx puObject.cxx Log Message: Changed calculation of vertically centered legend / label positions Index: pu.h =================================================================== RCS file: /cvsroot/plib/plib/src/pui/pu.h,v retrieving revision 1.96 retrieving revision 1.97 diff -u -d -r1.96 -r1.97 --- pu.h 1 Mar 2002 14:54:44 -0000 1.96 +++ pu.h 2 Mar 2002 18:20:09 -0000 1.97 @@ -120,8 +120,8 @@ } int getStringDescender ( void ) const ; - int getStringHeight ( void ) const ; int getStringHeight ( const char *str ) const ; + int getStringHeight ( void ) const { return getStringHeight ( "K" ) ; } int getStringWidth ( const char *str ) const ; void drawString ( const char *str, int x, int y ) ; Index: puFont.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/pui/puFont.cxx,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- puFont.cxx 2 Mar 2002 17:47:25 -0000 1.13 +++ puFont.cxx 2 Mar 2002 18:20:09 -0000 1.14 @@ -151,12 +151,6 @@ } -int puFont::getStringHeight ( void ) const -{ - return getStringHeight ( "K" ) ; -} - - int puFont::getStringDescender ( void ) const { #ifdef _PU_USE_GLUT_FONTS Index: puObject.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/pui/puObject.cxx,v retrieving revision 1.40 retrieving revision 1.41 diff -u -d -r1.40 -r1.41 --- puObject.cxx 1 Mar 2002 14:54:44 -0000 1.40 +++ puObject.cxx 2 Mar 2002 18:20:09 -0000 1.41 @@ -24,26 +24,6 @@ #include "puLocal.h" -static int count_lines( const char *str ) -{ - int k; // counts lines - - if ( str == NULL ) - k = 0; - else if ( strlen( str ) == 0 ) - k = 0; - else - { - k = 1; // there's at least one line here - while ( *str != '\0' ) - { - if ( *str == '\n' ) k++; // add 1 for each EOL - str++; - } - } - return( k ); -} - inline float clamp01 ( float x ) { return (x >= 1.0f) ? 1.0f : x ; @@ -342,10 +322,9 @@ case PUPLACE_LOWER_LEFT : /* Backwards compatibility to PUPLACE_LEFT */ case PUPLACE_LOWER_RIGHT : /* Backwards compatibility to PUPLACE_RIGHT */ default : - //yy = ( abox.max[1] - abox.min[1] - legendFont.getStringHeight () ) / 2 ; yy = ( abox.max[1] - abox.min[1] + - count_lines( legend ) * legendFont.getStringHeight () ) / 2 - - legendFont.getStringHeight() ; + legendFont.getStringHeight ( legend ) ) / 2 - + legendFont.getStringHeight () ; break ; case PUPLACE_BOTTOM_LEFT : @@ -433,10 +412,9 @@ case PUPLACE_CENTERED_LEFT : case PUPLACE_CENTERED_RIGHT : default : - //yy = ( bbox.max[1] - bbox.min[1] - labelFont.getStringHeight () ) / 2 ; yy = ( bbox.max[1] - bbox.min[1] + - count_lines( label ) * labelFont.getStringHeight () ) / 2 - - labelFont.getStringHeight() ; + labelFont.getStringHeight ( label ) ) / 2 - + labelFont.getStringHeight () ; break ; case PUPLACE_LOWER_LEFT : |
From: Sebastian U. <ud...@us...> - 2002-03-02 17:47:30
|
Update of /cvsroot/plib/plib/src/pui In directory usw-pr-cvs1:/tmp/cvs-serv4160 Modified Files: puFont.cxx Log Message: Changed getStringHeight () behaviour with textured fonts Index: puFont.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/pui/puFont.cxx,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- puFont.cxx 2 Mar 2002 14:36:24 -0000 1.12 +++ puFont.cxx 2 Mar 2002 17:47:25 -0000 1.13 @@ -96,6 +96,20 @@ } +static int count_lines ( const char *str ) +{ + int k = 0 ; + + if ( str != NULL ) + { + for ( k = 1 ; *str != '\0' ; str++ ) + if ( *str == '\n' ) + k++ ; + } + + return k ; +} + #ifdef _PU_USE_GLUT_FONTS static int getGLUTStringHeight ( GlutFont glut_font_handle ) { @@ -121,21 +135,16 @@ if ( glut_font_handle != (GlutFont) 0 ) { int i = getGLUTStringHeight ( glut_font_handle ) + getStringDescender () ; - int num_lines = 1 ; - for ( const char *p = s ; *p != '\0' ; p++ ) - if ( *p == '\n' ) - num_lines++ ; - - return ( i * num_lines ) - getStringDescender () ; + return ( i * count_lines ( s ) ) - getStringDescender () ; } #endif // #ifdef _PU_USE_GLUT_FONTS if ( fnt_font_handle != NULL ) { - float t, b ; - fnt_font_handle -> getBBox ( s, pointsize, slant, NULL, NULL, &b, &t ) ; - return (int) t ; + float i = pointsize * 1.333f ; + + return (int) ( ( i * count_lines ( s ) ) - ( 0.333f * pointsize ) ) ; } return 0 ; |
From: Sebastian U. <ud...@us...> - 2002-03-02 14:36:27
|
Update of /cvsroot/plib/plib/src/pui In directory usw-pr-cvs1:/tmp/cvs-serv23103 Modified Files: puFont.cxx Log Message: John F. Fay: Changed line spacing policy; Multiple-line fix for GLUT fonts Index: puFont.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/pui/puFont.cxx,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- puFont.cxx 2 Mar 2002 13:54:17 -0000 1.11 +++ puFont.cxx 2 Mar 2002 14:36:24 -0000 1.12 @@ -70,15 +70,15 @@ { if ( *str == '\n' ) { - if ( res > max_res ) max_res = res; - res = 0; + if ( res > max_res ) max_res = res ; + res = 0 ; } else - { - res += glutBitmapWidth ( glut_font_handle, *str ) ; - } + res += glutBitmapWidth ( glut_font_handle, *str ) ; + str++ ; } + if ( res > max_res ) max_res = res; return max_res ; @@ -120,14 +120,14 @@ #ifdef _PU_USE_GLUT_FONTS if ( glut_font_handle != (GlutFont) 0 ) { - int i = getGLUTStringHeight ( glut_font_handle ) ; + int i = getGLUTStringHeight ( glut_font_handle ) + getStringDescender () ; int num_lines = 1 ; for ( const char *p = s ; *p != '\0' ; p++ ) if ( *p == '\n' ) num_lines++ ; - return i * num_lines ; + return ( i * num_lines ) - getStringDescender () ; } #endif // #ifdef _PU_USE_GLUT_FONTS @@ -188,7 +188,7 @@ { if (*str == '\n') { - y -= getStringHeight() * 4 / 3 ; + y -= getStringHeight () + getStringDescender () ; glRasterPos2f( (float)x, (float)y ) ; } else |
From: Sebastian U. <ud...@us...> - 2002-03-02 13:54:24
|
Update of /cvsroot/plib/plib/src/pui In directory usw-pr-cvs1:/tmp/cvs-serv12872 Modified Files: puFont.cxx Log Message: In puFont::getStringHeight, return height excluding descender for TXF fonts Index: puFont.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/pui/puFont.cxx,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- puFont.cxx 28 Feb 2002 20:32:46 -0000 1.10 +++ puFont.cxx 2 Mar 2002 13:54:17 -0000 1.11 @@ -135,7 +135,7 @@ { float t, b ; fnt_font_handle -> getBBox ( s, pointsize, slant, NULL, NULL, &b, &t ) ; - return (int) ( t - b ) ; + return (int) t ; } return 0 ; |
From: M?rten Str?m. <str...@us...> - 2002-03-01 17:53:22
|
Update of /cvsroot/plib/plib/src/ssg In directory usw-pr-cvs1:/tmp/cvs-serv14808 Modified Files: ssg.h Log Message: Made members of ssgContext "protected". Index: ssg.h =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssg.h,v retrieving revision 1.130 retrieving revision 1.131 diff -u -d -r1.130 -r1.131 --- ssg.h 19 Jan 2002 20:37:21 -0000 1.130 +++ ssg.h 1 Mar 2002 17:53:19 -0000 1.131 @@ -2218,6 +2218,8 @@ class ssgContext { + protected: + int enabledClipPlanes ; sgVec4 clipPlane [ 6 ] ; ssgSimpleState *currentState ; |
From: M?rten Str?m. <str...@us...> - 2002-03-01 17:51:57
|
Update of /cvsroot/plib/plib/src/sl In directory usw-pr-cvs1:/tmp/cvs-serv14290 Modified Files: slSample.cxx Log Message: Fixed 16-bit conversion in WAVE loader. Index: slSample.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/sl/slSample.cxx,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- slSample.cxx 7 Nov 2001 23:51:09 -0000 1.4 +++ slSample.cxx 1 Mar 2002 17:51:53 -0000 1.5 @@ -404,11 +404,6 @@ if ( getBps () == 16 ) { - Ushort *b = (Ushort*) buffer ; - - for ( int i = 0 ; i < length/2 ; i++ ) - b [ i ] = (Ushort) ( (int)((short) b [ i ]) + 32768 ) ; - changeToUnsigned () ; } @@ -416,7 +411,9 @@ return SL_TRUE ; } } - + + ulSetError ( UL_WARNING, "slSample: Premature EOF in '%s'.", fname ) ; + fclose ( fd ) ; return SL_FALSE ; } |
From: Sebastian U. <ud...@us...> - 2002-03-01 14:54:48
|
Update of /cvsroot/plib/plib/src/pui In directory usw-pr-cvs1:/tmp/cvs-serv26624/pui Modified Files: pu.h puObject.cxx puSlider.cxx Log Message: Some more multi-line label / legend fixes Index: pu.h =================================================================== RCS file: /cvsroot/plib/plib/src/pui/pu.h,v retrieving revision 1.95 retrieving revision 1.96 diff -u -d -r1.95 -r1.96 --- pu.h 28 Feb 2002 20:54:10 -0000 1.95 +++ pu.h 1 Mar 2002 14:54:44 -0000 1.96 @@ -969,7 +969,7 @@ puButton ( int minx, int miny, const char *l ) : puObject ( minx, miny, minx + puGetDefaultLegendFont().getStringWidth ( l ) + PUSTR_LGAP + PUSTR_RGAP, - miny + puGetDefaultLegendFont().getStringHeight () + puGetDefaultLegendFont().getStringDescender () + PUSTR_TGAP + PUSTR_BGAP ) + miny + puGetDefaultLegendFont().getStringHeight ( l ) + puGetDefaultLegendFont().getStringDescender () + PUSTR_TGAP + PUSTR_BGAP ) { type |= PUCLASS_BUTTON ; button_type = PUBUTTON_NORMAL ; Index: puObject.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/pui/puObject.cxx,v retrieving revision 1.39 retrieving revision 1.40 diff -u -d -r1.39 -r1.40 --- puObject.cxx 28 Feb 2002 21:22:27 -0000 1.39 +++ puObject.cxx 1 Mar 2002 14:54:44 -0000 1.40 @@ -239,7 +239,7 @@ case PUPLACE_BOTTOM_CENTERED : case PUPLACE_BOTTOM_RIGHT : case PUPLACE_BELOW_RIGHT : - bbox.min[1] -= labelFont.getStringHeight () + labelFont.getStringDescender () + + bbox.min[1] -= labelFont.getStringHeight ( label ) + labelFont.getStringDescender () + PUSTR_BGAP ; break ; } Index: puSlider.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/pui/puSlider.cxx,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- puSlider.cxx 16 Dec 2001 16:30:50 -0000 1.21 +++ puSlider.cxx 1 Mar 2002 14:54:44 -0000 1.22 @@ -52,7 +52,7 @@ if ( isVertical () ) // Vertical slider, text goes to the right of it { xx = bx.max[0] + PUSTR_LGAP ; - yy = ( bx.max[1] + bx.min[1] - legendFont.getStringHeight () ) / 2 ; + yy = ( bx.max[1] + bx.min[1] - legendFont.getStringHeight ( box_label ) ) / 2 ; } else // Horizontal slider, text goes above it { |
From: Sebastian U. <ud...@us...> - 2002-02-28 21:22:34
|
Update of /cvsroot/plib/plib/src/pui In directory usw-pr-cvs1:/tmp/cvs-serv8012 Modified Files: puObject.cxx Log Message: In puObject::draw_[legend|label], avoid calculating size of a NULL string Index: puObject.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/pui/puObject.cxx,v retrieving revision 1.38 retrieving revision 1.39 diff -u -d -r1.38 -r1.39 --- puObject.cxx 28 Feb 2002 20:54:10 -0000 1.38 +++ puObject.cxx 28 Feb 2002 21:22:27 -0000 1.39 @@ -267,6 +267,9 @@ void puObject::draw_legend ( int dx, int dy ) { + if ( legend == NULL ) + return ; + int xx, yy ; int lgap = PUSTR_LGAP ; @@ -358,6 +361,9 @@ void puObject::draw_label ( int dx, int dy ) { + if ( label == NULL ) + return ; + int xx, yy ; /* If greyed out then halve the opacity when drawing the label */ @@ -514,3 +520,4 @@ lowlight () ; return FALSE ; } + |
From: Sebastian U. <ud...@us...> - 2002-02-28 20:54:15
|
Update of /cvsroot/plib/plib/src/pui In directory usw-pr-cvs1:/tmp/cvs-serv32174/pui Modified Files: pu.h puObject.cxx Log Message: Fixed calculation of legend place with PUSTYLE_SPECIAL_UNDERLINED; Cleanups Index: pu.h =================================================================== RCS file: /cvsroot/plib/plib/src/pui/pu.h,v retrieving revision 1.94 retrieving revision 1.95 diff -u -d -r1.94 -r1.95 --- pu.h 16 Jan 2002 17:56:43 -0000 1.94 +++ pu.h 28 Feb 2002 20:54:10 -0000 1.95 @@ -714,16 +714,24 @@ { style = which ; - if ( abs(style) == PUSTYLE_SPECIAL_UNDERLINED ) - border_thickness = 1 ; - else if ( ( abs(style) == PUSTYLE_SMALL_BEVELLED ) || - ( abs(style) == PUSTYLE_SMALL_SHADED ) || - ( abs(style) == PUSTYLE_BOXED ) ) - border_thickness = 2 ; - else if ( ( abs(style) == PUSTYLE_BEVELLED ) || - ( abs(style) == PUSTYLE_SHADED ) || - ( abs(style) == PUSTYLE_DROPSHADOW ) ) - border_thickness = 5 ; + switch ( abs(style) ) + { + case PUSTYLE_SPECIAL_UNDERLINED : + border_thickness = 1 ; + break ; + + case PUSTYLE_SMALL_BEVELLED : + case PUSTYLE_SMALL_SHADED : + case PUSTYLE_BOXED : + border_thickness = 2 ; + break ; + + case PUSTYLE_BEVELLED : + case PUSTYLE_SHADED : + case PUSTYLE_DROPSHADOW : + border_thickness = 5 ; + break ; + } recalc_bbox () ; puPostRefresh () ; Index: puObject.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/pui/puObject.cxx,v retrieving revision 1.37 retrieving revision 1.38 diff -u -d -r1.37 -r1.38 --- puObject.cxx 27 Feb 2002 02:58:34 -0000 1.37 +++ puObject.cxx 28 Feb 2002 20:54:10 -0000 1.38 @@ -76,20 +76,28 @@ static puFont defaultLabelFont ; static float defaultColourScheme [ 4 ] ; -void puSetDefaultStyle ( int style ) +void puSetDefaultStyle ( int style ) { defaultStyle = style ; - if ( abs(style) == PUSTYLE_SPECIAL_UNDERLINED ) - defaultBorderThickness = 1 ; - else if ( ( abs(style) == PUSTYLE_SMALL_BEVELLED ) || - ( abs(style) == PUSTYLE_SMALL_SHADED ) || - ( abs(style) == PUSTYLE_BOXED ) ) - defaultBorderThickness = 2 ; - else if ( ( abs(style) == PUSTYLE_BEVELLED ) || - ( abs(style) == PUSTYLE_SHADED ) || - ( abs(style) == PUSTYLE_DROPSHADOW ) ) - defaultBorderThickness = 5 ; + switch ( abs(style) ) + { + case PUSTYLE_SPECIAL_UNDERLINED : + defaultBorderThickness = 1 ; + break ; + + case PUSTYLE_SMALL_BEVELLED : + case PUSTYLE_SMALL_SHADED : + case PUSTYLE_BOXED : + defaultBorderThickness = 2 ; + break ; + + case PUSTYLE_BEVELLED : + case PUSTYLE_SHADED : + case PUSTYLE_DROPSHADOW : + defaultBorderThickness = 5 ; + break ; + } } int puGetDefaultStyle ( void ) { return defaultStyle ; } @@ -259,22 +267,23 @@ void puObject::draw_legend ( int dx, int dy ) { - if ( getStyle () == PUSTYLE_RADIO ) return ; - int xx, yy ; int lgap = PUSTR_LGAP ; int rgap = PUSTR_RGAP ; int tgap = PUSTR_TGAP ; int bgap = PUSTR_BGAP ; + if ( ( abs(style) != PUSTYLE_NONE ) && ( abs(style) != PUSTYLE_PLAIN ) && - ( abs(style) != PUSTYLE_DROPSHADOW ) && - ( abs(style) != PUSTYLE_SPECIAL_UNDERLINED ) ) + ( abs(style) != PUSTYLE_DROPSHADOW ) ) { - lgap += getBorderThickness () ; - rgap += getBorderThickness () ; - tgap += getBorderThickness () ; + if ( abs(style) != PUSTYLE_SPECIAL_UNDERLINED ) + { + lgap += getBorderThickness () ; + rgap += getBorderThickness () ; + tgap += getBorderThickness () ; + } bgap += getBorderThickness () ; } |
From: Sebastian U. <ud...@us...> - 2002-02-28 20:32:52
|
Update of /cvsroot/plib/plib/src/pui In directory usw-pr-cvs1:/tmp/cvs-serv27015 Modified Files: puFont.cxx Log Message: In puFont::getStringHeight ( char * ), handle NULL pointers Index: puFont.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/pui/puFont.cxx,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- puFont.cxx 27 Feb 2002 02:58:34 -0000 1.9 +++ puFont.cxx 28 Feb 2002 20:32:46 -0000 1.10 @@ -113,7 +113,10 @@ int puFont::getStringHeight ( const char *s ) const { /* Height *excluding* descender */ - + + if ( s == NULL ) + return 0 ; + #ifdef _PU_USE_GLUT_FONTS if ( glut_font_handle != (GlutFont) 0 ) { |
From: Dave M. <mc...@us...> - 2002-02-28 07:54:26
|
Update of /cvsroot/plib/plib/src/ssg In directory usw-pr-cvs1:/tmp/cvs-serv17982 Modified Files: ssgLoadDXF.cxx Log Message: fixed some INSERT bugs Index: ssgLoadDXF.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgLoadDXF.cxx,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- ssgLoadDXF.cxx 7 Nov 2001 23:51:10 -0000 1.23 +++ ssgLoadDXF.cxx 28 Feb 2002 07:54:23 -0000 1.24 @@ -429,8 +429,23 @@ //cvec //scale_vec //rot_angle - sgMat4 mat ; - sgMakeTransMat4 ( mat, cvec ) ; + + sgMat4 mat, tmp; + sgVec3 axis = { 0.0f, 0.0f, 1.0f }; + sgMakeRotMat4 ( mat, rot_angle, axis ) ; + + sgMakeIdentMat4 ( tmp ) ; + sgScaleVec4 ( tmp[0], scale_vec[0] ); + sgScaleVec4 ( tmp[1], scale_vec[1] ); + sgScaleVec4 ( tmp[2], scale_vec[2] ); + sgPostMultMat4 ( mat, tmp ) ; + + sgMakeTransMat4 ( tmp, cvec ) ; + sgPostMultMat4 ( mat, tmp ) ; + + //printf("cvec(%.2f,%.2f,%.2f), scale(%.2f,%.2f,%.2f), rot(%.2f)\n", + // cvec[0], cvec[1], cvec[2], cvec[0], cvec[1], cvec[2], rot_angle ) ; + //found -> print ( stderr, "", 99 ); ssgTransform* block_tr = new ssgTransform ; block_tr -> setName ( block_name ) ; @@ -497,9 +512,9 @@ cvec[0] = 0.0f; cvec[1] = 0.0f; cvec[2] = 0.0f; - scale_vec[0] = 0.0f; - scale_vec[1] = 0.0f; - scale_vec[2] = 0.0f; + scale_vec[0] = 1.0f; + scale_vec[1] = 1.0f; + scale_vec[2] = 1.0f; rot_angle = 0.0f; color_index = 7 ; @@ -826,7 +841,7 @@ else if ( input1[cpos] == '5' ) { char ch = input1[cpos+1]; - if ( ch == 0 || ch == ' ' || ch == '\n' ) { + if ( ch == '0' ) { count = sscanf ( input2, "%e%n", &rot_angle, &width ); } |
From: Dave M. <mc...@us...> - 2002-02-28 00:38:04
|
Update of /cvsroot/plib/plib/examples/src/ssg/viewer/data In directory usw-pr-cvs1:/tmp/cvs-serv18609 Removed Files: default.txf Log Message: remove text-mode font --- default.txf DELETED --- |
From: Dave M. <mc...@us...> - 2002-02-28 00:38:03
|
Update of /cvsroot/plib/plib/examples/src/ssg/viewer/data In directory usw-pr-cvs1:/tmp/cvs-serv18842 Added Files: default.txf Log Message: add binary-mode font |
From: Dave M. <mc...@us...> - 2002-02-28 00:23:31
|
Update of /cvsroot/plib/plib/examples/src/ssg/viewer/data In directory usw-pr-cvs1:/tmp/cvs-serv19408 Modified Files: default.txf Log Message: better font Index: default.txf =================================================================== RCS file: /cvsroot/plib/plib/examples/src/ssg/viewer/data/default.txf,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 Binary files /tmp/cvsC32jhc and /tmp/cvs0yad9d differ |
From: M?rten Str?m. <str...@us...> - 2002-02-27 22:30:14
|
Update of /cvsroot/plib/plib/src/ssg In directory usw-pr-cvs1:/tmp/cvs-serv32630 Modified Files: ssgLoadFLT.cxx Log Message: Minor fix. Index: ssgLoadFLT.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgLoadFLT.cxx,v retrieving revision 1.28 retrieving revision 1.29 diff -u -d -r1.28 -r1.29 --- ssgLoadFLT.cxx 18 Dec 2001 16:35:59 -0000 1.28 +++ ssgLoadFLT.cxx 27 Feb 2002 20:05:11 -0000 1.29 @@ -1138,6 +1138,7 @@ ulSetError(UL_WARNING, "[flt] This file is probably rather old (obsolete opcodes ignored)."); ObsoleteFlag = 1; } + //printf("op %d obsolete\n", op); } static void NotImplemented(int op) @@ -1146,6 +1147,7 @@ ulSetError(UL_WARNING, "[flt] This file contains opcodes that are not implemented."); NotImplementedFlag = 1; } + //printf("op %d not implemented\n", op); } static void ReportBadChunk(const ubyte *ptr, const char *name) @@ -2135,10 +2137,12 @@ sgSetVec2(a->range, (float)v[0], (float)v[1]); get64v(ptr + 40, v, 3); sgSetVec3(a->center, (float)v[0], (float)v[1], (float)v[2]); - /* break; */ + stack[sp] = new ssgBranch; + break; } default: //lint !e616 stack[sp] = new ssgBranch; + break; } if (ptr[4]) stack[sp]->setName((char *)ptr + 4); @@ -2198,6 +2202,7 @@ case 101: /* Light Source Bead */ case 122: /* Push Attribute */ case 123: /* Pop Attribute */ + //printf("op %d ignored\n", op); ptr += len; break; @@ -2482,6 +2487,8 @@ case 93: /* Sound Palette */ case 97: /* Line Style Palette */ case 102: /* Light Source Palette */ + case 103: /* Reserved */ + case 104: /* Reserved */ case 112: /* Texture Mapping */ case 114: /* Name Table */ /* these are safe to ignore */ @@ -2489,6 +2496,7 @@ break; default: + //printf("op %d: end of table chunks\n", op); done = 1; } } |
From: Dave M. <mc...@us...> - 2002-02-27 02:58:37
|
Update of /cvsroot/plib/plib/src/pui In directory usw-pr-cvs1:/tmp/cvs-serv14211/src/pui Modified Files: puFont.cxx puObject.cxx Log Message: Paul Deppe's multi-line fix Index: puFont.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/pui/puFont.cxx,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- puFont.cxx 21 Dec 2001 14:27:36 -0000 1.8 +++ puFont.cxx 27 Feb 2002 02:58:34 -0000 1.9 @@ -64,14 +64,24 @@ if ( glut_font_handle != (GlutFont) 0 ) { int res = 0 ; + int max_res = 0 ; while ( *str != '\0' ) { - res += glutBitmapWidth ( glut_font_handle, *str ) ; - str++ ; + if ( *str == '\n' ) + { + if ( res > max_res ) max_res = res; + res = 0; + } + else + { + res += glutBitmapWidth ( glut_font_handle, *str ) ; + } + str++ ; } + if ( res > max_res ) max_res = res; - return res ; + return max_res ; } #endif // #ifdef _PU_USE_GLUT_FONTS Index: puObject.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/pui/puObject.cxx,v retrieving revision 1.36 retrieving revision 1.37 diff -u -d -r1.36 -r1.37 --- puObject.cxx 21 Dec 2001 14:27:36 -0000 1.36 +++ puObject.cxx 27 Feb 2002 02:58:34 -0000 1.37 @@ -24,6 +24,26 @@ #include "puLocal.h" +static int count_lines( const char *str ) +{ + int k; // counts lines + + if ( str == NULL ) + k = 0; + else if ( strlen( str ) == 0 ) + k = 0; + else + { + k = 1; // there's at least one line here + while ( *str != '\0' ) + { + if ( *str == '\n' ) k++; // add 1 for each EOL + str++; + } + } + return( k ); +} + inline float clamp01 ( float x ) { return (x >= 1.0f) ? 1.0f : x ; @@ -310,7 +330,10 @@ case PUPLACE_LOWER_LEFT : /* Backwards compatibility to PUPLACE_LEFT */ case PUPLACE_LOWER_RIGHT : /* Backwards compatibility to PUPLACE_RIGHT */ default : - yy = ( abox.max[1] - abox.min[1] - legendFont.getStringHeight () ) / 2 ; + //yy = ( abox.max[1] - abox.min[1] - legendFont.getStringHeight () ) / 2 ; + yy = ( abox.max[1] - abox.min[1] + + count_lines( legend ) * legendFont.getStringHeight () ) / 2 - + legendFont.getStringHeight() ; break ; case PUPLACE_BOTTOM_LEFT : @@ -395,7 +418,10 @@ case PUPLACE_CENTERED_LEFT : case PUPLACE_CENTERED_RIGHT : default : - yy = ( bbox.max[1] - bbox.min[1] - labelFont.getStringHeight () ) / 2 ; + //yy = ( bbox.max[1] - bbox.min[1] - labelFont.getStringHeight () ) / 2 ; + yy = ( bbox.max[1] - bbox.min[1] + + count_lines( label ) * labelFont.getStringHeight () ) / 2 - + labelFont.getStringHeight() ; break ; case PUPLACE_LOWER_LEFT : @@ -479,5 +505,3 @@ lowlight () ; return FALSE ; } - - |
From: Norman V. <nh...@us...> - 2002-02-06 07:00:44
|
Update of /cvsroot/plib/plib/src/sl In directory usw-pr-cvs1:/tmp/cvs-serv24535 Modified Files: slDSP.cxx Log Message: irix tweaks from Erik Hofman Index: slDSP.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/sl/slDSP.cxx,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- slDSP.cxx 2001/11/07 23:51:09 1.10 +++ slDSP.cxx 2002/02/06 07:00:41 1.11 @@ -629,22 +629,22 @@ void slDSP::open ( char *device, int _rate, int _stereo, int _bps ) { -#if 0 if ( _bps != 8 ) { perror ( "slDSP: supports only 8bit audio for sgi" ) ; error = SL_TRUE; return; } -#endif - init_bytes = 1024 * 16; + init_bytes = 1024 * 32; + if (_bps == 8) init_bytes /= 2; + if (_stereo) init_bytes /= 2; + config = alNewConfig(); - alSetChannels(config, _stereo ? AL_STEREO : AL_MONO); alSetWidth(config, _bps == 8 ? AL_SAMPLE_8 : AL_SAMPLE_16); alSetQueueSize(config, init_bytes); - init_bytes = alGetQueueSize(config); + // init_bytes = alGetQueueSize(config); port = alOpenPort(device, "w", config); |
From: Sebastian U. <ud...@us...> - 2002-01-29 20:55:29
|
Update of /cvsroot/plib/CVSROOT In directory usw-pr-cvs1:/tmp/cvs-serv2557 Modified Files: syncmail Log Message: Lowered DIFF_TRUNCATE_IF_LARGER from 1000 to 100 Index: syncmail =================================================================== RCS file: /cvsroot/plib/CVSROOT/syncmail,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- syncmail 2002/01/16 15:48:18 1.4 +++ syncmail 2002/01/29 20:55:25 1.5 @@ -73,7 +73,8 @@ # Diff trimming stuff DIFF_HEAD_LINES = 20 DIFF_TAIL_LINES = 20 -DIFF_TRUNCATE_IF_LARGER = 1000 +# DIFF_TRUNCATE_IF_LARGER = 1000 +DIFF_TRUNCATE_IF_LARGER = 100 PROGRAM = sys.argv[0] |
From: M?rten Str?m. <str...@us...> - 2002-01-25 16:46:22
|
Update of /cvsroot/plib/plib/examples/src/ssg/viewer/data In directory usw-pr-cvs1:/tmp/cvs-serv20636 Modified Files: door.ase Log Message: Texture names to lower-case. Index: door.ase =================================================================== RCS file: /cvsroot/plib/plib/examples/src/ssg/viewer/data/door.ase,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- door.ase 2000/09/06 22:18:31 1.1 +++ door.ase 2002/01/25 16:46:19 1.2 @@ -31,7 +31,7 @@ *MAP_CLASS "Bitmap" *MAP_SUBNO 1 *MAP_AMOUNT 1.0000 - *BITMAP "\\SIERRA_ONLINE\DYNAMIX\NETDRIVES\DYN-OUT_MINIGOLF\MG3D\tools\viewer\base\textures\Brown.bmp" + *BITMAP "brown.bmp" *MAP_TYPE Screen *UVW_U_OFFSET 0.0000 *UVW_V_OFFSET 0.0000 @@ -67,7 +67,7 @@ *MAP_CLASS "Bitmap" *MAP_SUBNO 1 *MAP_AMOUNT 1.0000 - *BITMAP "\\SIERRA_ONLINE\DYNAMIX\NETDRIVES\DYN-OUT_MINIGOLF\MG3D\tools\viewer\base\textures\Gray.bmp" + *BITMAP "gray.bmp" *MAP_TYPE Screen *UVW_U_OFFSET 0.0000 *UVW_V_OFFSET 0.0000 |
From: M?rten Str?m. <str...@us...> - 2002-01-25 16:28:04
|
Update of /cvsroot/plib/plib/src/ssg In directory usw-pr-cvs1:/tmp/cvs-serv16016/src/ssg Modified Files: ssgVtxTable.cxx Log Message: Added documentation for sgClassifyMat4. Index: ssgVtxTable.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgVtxTable.cxx,v retrieving revision 1.26 retrieving revision 1.27 diff -u -d -r1.26 -r1.27 --- ssgVtxTable.cxx 2001/12/16 18:45:45 1.26 +++ ssgVtxTable.cxx 2002/01/25 16:28:00 1.27 @@ -313,26 +313,20 @@ sgMat4 w ; - if ( ( flags & ( SG_MIRROR | SG_UNIFORM_SCALE | SG_GENERAL_SCALE | SG_NONORTHO ) ) ) + if ( ( flags & ( SG_SCALE | SG_MIRROR | SG_NONORTHO ) ) ) { - if ( ( flags & ( SG_GENERAL_SCALE | SG_NONORTHO ) ) ) + if ( ( flags & SG_NONORTHO ) ) { // use the transposed adjoint matrix (only the upper 3x3 is needed) - w[0][0] = m[1][1] * m[2][2] - m[1][2] * m[2][1] ; - w[0][1] = m[1][2] * m[2][0] - m[1][0] * m[2][2] ; - w[0][2] = m[1][0] * m[2][1] - m[1][1] * m[2][0] ; - w[1][0] = m[2][1] * m[0][2] - m[2][2] * m[0][1] ; - w[1][1] = m[2][2] * m[0][0] - m[2][0] * m[0][2] ; - w[1][2] = m[2][0] * m[0][1] - m[2][1] * m[0][0] ; - w[2][0] = m[0][1] * m[1][2] - m[0][2] * m[1][1] ; - w[2][1] = m[0][2] * m[1][0] - m[0][0] * m[1][2] ; - w[2][2] = m[0][0] * m[1][1] - m[0][1] * m[1][0] ; + sgVectorProductVec3 ( w[0], m[1], m[2] ) ; + sgVectorProductVec3 ( w[1], m[2], m[0] ) ; + sgVectorProductVec3 ( w[2], m[0], m[1] ) ; } else { SGfloat scale = SG_ONE ; - if ( ( flags & SG_UNIFORM_SCALE ) ) + if ( ( flags & SG_SCALE ) ) { // prescale matrix to avoid renormalisation scale = scale / sgLengthVec3 ( m[0] ) ; @@ -357,7 +351,7 @@ sgXformVec3 ( normals->get(i), normals->get(i), m ) ; - if ( ( flags & ( SG_GENERAL_SCALE | SG_NONORTHO ) ) ) + if ( ( flags & SG_NONORTHO ) ) { for ( i = 0 ; i < getNumNormals() ; i++ ) sgNormaliseVec3 ( normals->get(i) ) ; |