1
0
Fork 0

Updated 3dfx.sh to allow window vs. full screen via command line.

Added 3dfx.sh to distribution.
Updated rul serial output.
Updated runfgfs.bat files.
This commit is contained in:
curt 1999-04-19 20:19:36 +00:00
parent a69c27895f
commit 61f6b4ff35
4 changed files with 28 additions and 23 deletions

View file

@ -1,6 +1,14 @@
#!/bin/sh
WINDOW=YES
if [ $1 = "--full" ]; then
echo "Running full screen ..."
shift
WINDOW=NO
else
echo "Running in a window, use --full to run full screen."
WINDOW=YES
fi
echo
if [ $WINDOW = "YES" ]; then
# in a window (slow hack)

View file

@ -27,7 +27,7 @@ else
SERIAL_LIBS =
endif
EXTRA_DIST = runfgfs.in runfgfs.bat.in
EXTRA_DIST = 3dfx.sh runfgfs.in runfgfs.bat.in
bin_PROGRAMS = fgfs

View file

@ -478,28 +478,30 @@ static void send_rul_out( fgIOCHANNEL *p ) {
// get roll and pitch, convert to degrees
double roll_deg = f->get_Phi() * RAD_TO_DEG;
while ( roll_deg < 0.0 ) {
while ( roll_deg < -180.0 ) {
roll_deg += 360.0;
}
while ( roll_deg > 360.0 ) {
while ( roll_deg > 180.0 ) {
roll_deg -= 360.0;
}
double pitch_deg = f->get_Theta() * RAD_TO_DEG;
while ( pitch_deg < 0.0 ) {
while ( pitch_deg < -180.0 ) {
pitch_deg += 360.0;
}
while ( pitch_deg > 360.0 ) {
while ( pitch_deg > 180.0 ) {
pitch_deg -= 360.0;
}
// scale roll and pitch to output format (1 - 255)
int roll = (int)(roll_deg * 254.0 / 359.0) + 1;
int pitch = (int)(pitch_deg * 254.0 / 359.0) + 1;
// straight && level == (128, 128)
int roll = (int)( (roll_deg+180.0) * 255.0 / 360.0) + 1;
int pitch = (int)( (pitch_deg+180.0) * 255.0 / 360.0) + 1;
sprintf( rul, "p%c%c\n", roll, pitch);
FG_LOG( FG_SERIAL, FG_DEBUG, "p " << roll << " " << pitch );
FG_LOG( FG_SERIAL, FG_INFO, "p " << roll << " " << pitch );
string rul_sentence = rul;
p->port.write_port(rul_sentence);

View file

@ -1,28 +1,23 @@
REM @ECHO OFF
REM Skip ahead to RUN1 if %FG_ROOT%\BIN\FGFS.EXE exists
IF EXIST %FG_ROOT%\BIN\FGFS.EXE GOTO RUN1
REM Skip ahead to CONT1 if FG_ROOT has a value
IF NOT %FG_ROOT%.==. GOTO CONT1
REM %FG_ROOT% wasn't set right so let's try "."
SET FG_ROOT=.
IF EXIST %FG_ROOT%\BIN\FGFS.EXE GOTO RUN1
REM %FG_ROOT% wasn't set right so let's try ".."
SET FG_ROOT=..
IF EXIST %FG_ROOT%\BIN\FGFS.EXE GOTO RUN1
:CONT1
REM %FG_ROOT% wasn't set right so let's try "@prefix@"
SET FG_ROOT=@prefix@
IF EXIST %FG_ROOT%\BIN\FGFS.EXE GOTO RUN1
REM Check for the existance of the executable
IF NOT EXIST %FG_ROOT%\BIN\FGFS.EXE GOTO ERROR1
ECHO Cannot find %FG_ROOT%\BIN\FGFS.EXE
GOTO END
:RUN1
REM Now that FG_ROOT has been set, run the program
ECHO FG_ROOT = %FG_ROOT%
%FG_ROOT%\BIN\FGFS.EXE %1 %2 %3 %4 %5 %6 %7 %8 %9
GOTO END
:ERROR1
ECHO Cannot find %FG_ROOT%\BIN\FGFS.EXE
GOTO END
:END