1
0
Fork 0

MacOS changes contributed by Darrell Walisser (12/13/2000)

This commit is contained in:
curt 2000-12-13 23:02:02 +00:00
parent 95d6d93bed
commit e333080388
15 changed files with 60 additions and 29 deletions

View file

@ -139,4 +139,4 @@ public:
}; };
#endif _10520D_HXX_ #endif // _10520D_HXX_

View file

@ -23,7 +23,7 @@
#include <simgear/io/sg_socket.hxx> #include <simgear/io/sg_socket.hxx>
#include "flight.hxx" #include <FDM/flight.hxx>
class FGADA: public FGInterface { class FGADA: public FGInterface {

View file

@ -36,6 +36,9 @@
$Header$ $Header$
$Log$ $Log$
Revision 1.18 2000/12/13 22:02:02 curt
MacOS changes contributed by Darrell Walisser (12/13/2000)
Revision 1.17 2000/09/14 15:36:25 curt Revision 1.17 2000/09/14 15:36:25 curt
Tweaks to ground steering sensitivity. Tweaks to ground steering sensitivity.
@ -95,47 +98,47 @@ Updates from Tony.
#define HEIGHT_AGL_WHEEL d_wheel_rwy_local_v[2] #define HEIGHT_AGL_WHEEL d_wheel_rwy_local_v[2]
static sub3( DATA v1[], DATA v2[], DATA result[] ) static void sub3( DATA v1[], DATA v2[], DATA result[] )
{ {
result[0] = v1[0] - v2[0]; result[0] = v1[0] - v2[0];
result[1] = v1[1] - v2[1]; result[1] = v1[1] - v2[1];
result[2] = v1[2] - v2[2]; result[2] = v1[2] - v2[2];
} }
static add3( DATA v1[], DATA v2[], DATA result[] ) static void add3( DATA v1[], DATA v2[], DATA result[] )
{ {
result[0] = v1[0] + v2[0]; result[0] = v1[0] + v2[0];
result[1] = v1[1] + v2[1]; result[1] = v1[1] + v2[1];
result[2] = v1[2] + v2[2]; result[2] = v1[2] + v2[2];
} }
static cross3( DATA v1[], DATA v2[], DATA result[] ) static void cross3( DATA v1[], DATA v2[], DATA result[] )
{ {
result[0] = v1[1]*v2[2] - v1[2]*v2[1]; result[0] = v1[1]*v2[2] - v1[2]*v2[1];
result[1] = v1[2]*v2[0] - v1[0]*v2[2]; result[1] = v1[2]*v2[0] - v1[0]*v2[2];
result[2] = v1[0]*v2[1] - v1[1]*v2[0]; result[2] = v1[0]*v2[1] - v1[1]*v2[0];
} }
static multtrans3x3by3( DATA m[][3], DATA v[], DATA result[] ) static void multtrans3x3by3( DATA m[][3], DATA v[], DATA result[] )
{ {
result[0] = m[0][0]*v[0] + m[1][0]*v[1] + m[2][0]*v[2]; result[0] = m[0][0]*v[0] + m[1][0]*v[1] + m[2][0]*v[2];
result[1] = m[0][1]*v[0] + m[1][1]*v[1] + m[2][1]*v[2]; result[1] = m[0][1]*v[0] + m[1][1]*v[1] + m[2][1]*v[2];
result[2] = m[0][2]*v[0] + m[1][2]*v[1] + m[2][2]*v[2]; result[2] = m[0][2]*v[0] + m[1][2]*v[1] + m[2][2]*v[2];
} }
static mult3x3by3( DATA m[][3], DATA v[], DATA result[] ) static void mult3x3by3( DATA m[][3], DATA v[], DATA result[] )
{ {
result[0] = m[0][0]*v[0] + m[0][1]*v[1] + m[0][2]*v[2]; result[0] = m[0][0]*v[0] + m[0][1]*v[1] + m[0][2]*v[2];
result[1] = m[1][0]*v[0] + m[1][1]*v[1] + m[1][2]*v[2]; result[1] = m[1][0]*v[0] + m[1][1]*v[1] + m[1][2]*v[2];
result[2] = m[2][0]*v[0] + m[2][1]*v[1] + m[2][2]*v[2]; result[2] = m[2][0]*v[0] + m[2][1]*v[1] + m[2][2]*v[2];
} }
static clear3( DATA v[] ) static void clear3( DATA v[] )
{ {
v[0] = 0.; v[1] = 0.; v[2] = 0.; v[0] = 0.; v[1] = 0.; v[2] = 0.;
} }
c172_gear() void c172_gear()
{ {
char rcsid[] = "$Id$"; char rcsid[] = "$Id$";
#define NUM_WHEELS 4 #define NUM_WHEELS 4

View file

@ -81,47 +81,47 @@ void uiuc_engine( SCALAR dt, int Initialize )
* added later and the choice of the gear model could be specified at * added later and the choice of the gear model could be specified at
* runtime. * runtime.
* ***********************************************************************/ * ***********************************************************************/
static sub3( DATA v1[], DATA v2[], DATA result[] ) static void sub3( DATA v1[], DATA v2[], DATA result[] )
{ {
result[0] = v1[0] - v2[0]; result[0] = v1[0] - v2[0];
result[1] = v1[1] - v2[1]; result[1] = v1[1] - v2[1];
result[2] = v1[2] - v2[2]; result[2] = v1[2] - v2[2];
} }
static add3( DATA v1[], DATA v2[], DATA result[] ) static void add3( DATA v1[], DATA v2[], DATA result[] )
{ {
result[0] = v1[0] + v2[0]; result[0] = v1[0] + v2[0];
result[1] = v1[1] + v2[1]; result[1] = v1[1] + v2[1];
result[2] = v1[2] + v2[2]; result[2] = v1[2] + v2[2];
} }
static cross3( DATA v1[], DATA v2[], DATA result[] ) static void cross3( DATA v1[], DATA v2[], DATA result[] )
{ {
result[0] = v1[1]*v2[2] - v1[2]*v2[1]; result[0] = v1[1]*v2[2] - v1[2]*v2[1];
result[1] = v1[2]*v2[0] - v1[0]*v2[2]; result[1] = v1[2]*v2[0] - v1[0]*v2[2];
result[2] = v1[0]*v2[1] - v1[1]*v2[0]; result[2] = v1[0]*v2[1] - v1[1]*v2[0];
} }
static multtrans3x3by3( DATA m[][3], DATA v[], DATA result[] ) static void multtrans3x3by3( DATA m[][3], DATA v[], DATA result[] )
{ {
result[0] = m[0][0]*v[0] + m[1][0]*v[1] + m[2][0]*v[2]; result[0] = m[0][0]*v[0] + m[1][0]*v[1] + m[2][0]*v[2];
result[1] = m[0][1]*v[0] + m[1][1]*v[1] + m[2][1]*v[2]; result[1] = m[0][1]*v[0] + m[1][1]*v[1] + m[2][1]*v[2];
result[2] = m[0][2]*v[0] + m[1][2]*v[1] + m[2][2]*v[2]; result[2] = m[0][2]*v[0] + m[1][2]*v[1] + m[2][2]*v[2];
} }
static mult3x3by3( DATA m[][3], DATA v[], DATA result[] ) static void mult3x3by3( DATA m[][3], DATA v[], DATA result[] )
{ {
result[0] = m[0][0]*v[0] + m[0][1]*v[1] + m[0][2]*v[2]; result[0] = m[0][0]*v[0] + m[0][1]*v[1] + m[0][2]*v[2];
result[1] = m[1][0]*v[0] + m[1][1]*v[1] + m[1][2]*v[2]; result[1] = m[1][0]*v[0] + m[1][1]*v[1] + m[1][2]*v[2];
result[2] = m[2][0]*v[0] + m[2][1]*v[1] + m[2][2]*v[2]; result[2] = m[2][0]*v[0] + m[2][1]*v[1] + m[2][2]*v[2];
} }
static clear3( DATA v[] ) static void clear3( DATA v[] )
{ {
v[0] = 0.; v[1] = 0.; v[2] = 0.; v[0] = 0.; v[1] = 0.; v[2] = 0.;
} }
uiuc_gear() void uiuc_gear()
{ {
char rcsid[] = "$Id$"; char rcsid[] = "$Id$";

View file

@ -25,6 +25,8 @@
*/ */
#include <simgear/compiler.h>
#include <math.h> #include <math.h>
#include <iostream> #include <iostream>
@ -36,6 +38,10 @@
#include <FDM/LaRCsim/ls_constants.h> #include <FDM/LaRCsim/ls_constants.h>
#include <FDM/LaRCsim/ls_geodesy.h> #include <FDM/LaRCsim/ls_geodesy.h>
FG_USING_STD(cout);
FG_USING_STD(endl);
LaRCsimIC::LaRCsimIC(void) { LaRCsimIC::LaRCsimIC(void) {
vt=vtg=vw=vc=ve=0; vt=vtg=vw=vc=ve=0;
mach=0; mach=0;

View file

@ -8,6 +8,8 @@
#include "uiuc_parsefile.h" #include "uiuc_parsefile.h"
#include "uiuc_aircraft.h" #include "uiuc_aircraft.h"
FG_USING_STD(istrstream);
int uiuc_1DdataFileReader( string file_name, int uiuc_1DdataFileReader( string file_name,
double x[100], double x[100],
double y[100], double y[100],

View file

@ -8,6 +8,8 @@
#include "uiuc_parsefile.h" #include "uiuc_parsefile.h"
#include "uiuc_aircraft.h" #include "uiuc_aircraft.h"
FG_USING_STD(istrstream);
void uiuc_2DdataFileReader( string file_name, void uiuc_2DdataFileReader( string file_name,
double x[100][100], double x[100][100],
double y[100], double y[100],

View file

@ -91,12 +91,21 @@
#include <simgear/compiler.h> #include <simgear/compiler.h>
#include "uiuc_menu.h" #if defined( __MWERKS__ )
// -dw- optimizer chokes (big-time) trying to optimize humongous
// loop/switch statements
#pragma optimization_level 0
#endif
#include <stdlib.h>
#include <iostream> #include <iostream>
#include "uiuc_menu.h"
FG_USING_STD(cerr); FG_USING_STD(cerr);
FG_USING_STD(cout); FG_USING_STD(cout);
FG_USING_STD(endl); FG_USING_STD(endl);
FG_USING_STD(exit);
bool check_float(string &token) bool check_float(string &token)
{ {

View file

@ -72,6 +72,8 @@
#include "uiuc_recorder.h" #include "uiuc_recorder.h"
FG_USING_STD(endl); // -dw
void uiuc_recorder( double dt ) void uiuc_recorder( double dt )
{ {
stack command_list; stack command_list;

View file

@ -74,8 +74,14 @@ for information.
USA or view http://www.gnu.org/copyleft/gpl.html. USA or view http://www.gnu.org/copyleft/gpl.html.
**********************************************************************/ **********************************************************************/
#include <stdlib.h>
#include "uiuc_warnings_errors.h" #include "uiuc_warnings_errors.h"
FG_USING_STD (cerr);
FG_USING_STD (endl);
FG_USING_STD (exit);
void uiuc_warnings_errors(int errorCode, string line) void uiuc_warnings_errors(int errorCode, string line)
{ {
switch (errorCode) switch (errorCode)

View file

@ -113,8 +113,13 @@ struct button {
struct joystick { struct joystick {
virtual ~joystick () { virtual ~joystick () {
delete js; delete js;
#ifndef macintosh
delete axes; delete axes;
delete buttons; delete buttons;
#else
delete[] axes;
delete[] buttons;
#endif
} }
int naxes; int naxes;
int nbuttons; int nbuttons;

View file

@ -123,12 +123,8 @@ int objc=0;
#include "keyboard.hxx" #include "keyboard.hxx"
#include "splash.hxx" #include "splash.hxx"
// -dw- use custom sioux settings so I can see output window
#ifdef macintosh #ifdef macintosh
# ifndef FG_NDEBUG # include <console.h> // -dw- for command line dialog
# include <sioux.h> // settings for output window
# endif
# include <console.h>
#endif #endif
@ -452,7 +448,7 @@ void fgRenderFrame( void ) {
// ssg does to set up the model view matrix // ssg does to set up the model view matrix
glMatrixMode(GL_MODELVIEW); glMatrixMode(GL_MODELVIEW);
glLoadIdentity(); glLoadIdentity();
ssgSetCamera( (sgMat4)globals->get_current_view()->get_VIEW() ); ssgSetCamera( (sgVec4 *)globals->get_current_view()->get_VIEW() );
// set the opengl state to known default values // set the opengl state to known default values
default_state->force(); default_state->force();
@ -1274,7 +1270,7 @@ int fgGlutInit( int *argc, char **argv ) {
general.set_glVersion( (char *)glGetString ( GL_VERSION ) ); general.set_glVersion( (char *)glGetString ( GL_VERSION ) );
FG_LOG( FG_GENERAL, FG_INFO, general.get_glRenderer() ); FG_LOG( FG_GENERAL, FG_INFO, general.get_glRenderer() );
int tmp; GLint tmp;
glGetIntegerv( GL_MAX_TEXTURE_SIZE, &tmp ); glGetIntegerv( GL_MAX_TEXTURE_SIZE, &tmp );
general.set_glMaxTexSize( tmp ); general.set_glMaxTexSize( tmp );
FG_LOG ( FG_GENERAL, FG_INFO, "Max texture size = " << tmp ); FG_LOG ( FG_GENERAL, FG_INFO, "Max texture size = " << tmp );
@ -1685,7 +1681,7 @@ void fgLoadDCS(void) {
char c; char c;
while ( ! in.eof() ) while ( ! in.eof() )
{ {
in >> skipws; in >> ::skipws;
if ( in.get( c ) && c == '#' ) if ( in.get( c ) && c == '#' )
{ {
in >> skipeol; in >> skipeol;

View file

@ -68,7 +68,7 @@ class FGNewCache {
tile_map_iterator current; tile_map_iterator current;
// Free a tile cache entry // Free a tile cache entry
void FGNewCache::entry_free( long cache_index ); void entry_free( long cache_index );
public: public:
@ -85,7 +85,7 @@ public:
bool exists( const SGBucket& b ); bool exists( const SGBucket& b );
// Ensure at least one entry is free in the cache // Ensure at least one entry is free in the cache
void FGNewCache::make_space(); void make_space();
// Fill in a tile cache entry with real data for the specified bucket // Fill in a tile cache entry with real data for the specified bucket
void fill_in( const SGBucket& b ); void fill_in( const SGBucket& b );

View file

@ -313,7 +313,7 @@ int FGTileMgr::update( double lon, double lat ) {
} }
if ( state == Running ) { if ( state == Running ) {
if( current_bucket != previous_bucket) { if ( !(current_bucket == previous_bucket) ) {
// We've moved to a new bucket, we need to schedule any // We've moved to a new bucket, we need to schedule any
// needed tiles for loading. // needed tiles for loading.
schedule_needed(); schedule_needed();

View file

@ -84,7 +84,7 @@ private:
void load_tile( const SGBucket& b ); void load_tile( const SGBucket& b );
// schedule a needed buckets for loading // schedule a needed buckets for loading
void FGTileMgr::schedule_needed(); void schedule_needed();
// see comment at prep_ssg_nodes() // see comment at prep_ssg_nodes()
void prep_ssg_node( int idx ); void prep_ssg_node( int idx );