mod_sim_gui.cc File Reference

Lightweight GUI inside viewport. More...

#include "base.hh"
#include "base_settings.hh"
#include "gfx.hh"
#include "gfx_gui.hh"
#include "eng.hh"
#include "mod_base.hh"
#include "mod_sim.hh"
#include "mod_sim_gui.hh"
#include "mod_sim_config.hh"

Namespaces

namespace  mod_sim

Defines

#define MOD_SIM_GUI_CC   1
#define SPEED_CAN_DISABLE_GUI   0
#define STR_SIZEOF_ARGS(STR)   STR, sizeof(STR)
#define SET_PSVAR(args...)
#define PSVAR(X, Y, FONTMODE, RGBA)
#define PSVAR2(X, Y, FONTMODE)
#define PSCON(TEXT, X, Y, FONTMODE, RGBA)
#define PSCON2(TEXT, X, Y, FONTMODE)
#define INIT_JOYCAL_BUTTON(X, VAL, BUTTON, STR)
#define JOYCAL_PRINT(X, Y, VAL, STR)
#define SET_JOYCAL_BUTTON(BUTTON, VAL, STR)

Enumerations

enum  

Functions

void mod_sim::ModuleSimGui_GuiButtonCallback (GuiObject *obj, uint buttons)

Variables

const RGBA mod_sim::sColorText (0.10, 0.40, 0.50, 0.45)
const RGBA mod_sim::sColorGauges (0.10, 0.10, 0.80, 0.70)
const RGBA mod_sim::sColorGray (0.40, 0.40, 0.40, 0.70)
const RGBA mod_sim::sColorRed (1.00, 0.10, 0.10, 0.70)
const RGBA mod_sim::sColorBlue (0.10, 0.20, 0.80, 0.70)
const RGBA mod_sim::sColorBlue2 (0.20, 0.40, 0.70, 0.70)
const RGBA mod_sim::sColorBlue3 (0.15, 0.30, 0.60, 0.70)
const RGBA mod_sim::sColorPink (0.60, 0.10, 0.10, 0.70)
const RGBA mod_sim::sColorGreen (0.15, 0.60, 0.30, 0.70)
Zoom mod_sim::sZoom = { 1.0, 0.10, 0.50, 2.00 }
const char mod_sim::JOYCAL_SET_LEFT_MAX_STR [] = "SET ROLL LEFT MAX"
const char mod_sim::JOYCAL_SET_LEFT_MIN_STR [] = "MIN"
const char mod_sim::JOYCAL_SET_RIGHT_MAX_STR [] = "SET ROLL RIGHT MAX"
const char mod_sim::JOYCAL_SET_RIGHT_MIN_STR [] = "MIN"
const char mod_sim::JOYCAL_SET_UP_MAX_STR [] = "SET PITCH UP MAX"
const char mod_sim::JOYCAL_SET_UP_MIN_STR [] = "MIN"
const char mod_sim::JOYCAL_SET_DOWN_MAX_STR [] = "SET PITCH DOWN MAX"
const char mod_sim::JOYCAL_SET_DOWN_MIN_STR [] = "MIN"
const char mod_sim::JOYCAL_SET_SLOW_MAX_STR [] = "SET AXIS3 SLOW MAX"
const char mod_sim::JOYCAL_SET_SLOW_MIN_STR [] = "MIN"
const char mod_sim::JOYCAL_SET_FAST_MAX_STR [] = "SET AXIS3 FAST MAX"
const char mod_sim::JOYCAL_SET_FAST_MIN_STR [] = "MIN"
const fp mod_sim::GUI_PERSPECTIVE_INC = 0.5
const fp mod_sim::GUI_PERSPECTIVE_MIN = 1.0
const fp mod_sim::GUI_PERSPECTIVE_MAX = 30.0
const fp mod_sim::GUI_FOG_DENSITY_INC = 0.05
const fp mod_sim::GUI_FOG_DENSITY_MIN = 0.0
const fp mod_sim::GUI_FOG_DENSITY_MAX = 1.0
uint mod_sim::sTempLen
char mod_sim::sTemp [512]


Detailed Description

Lightweight GUI inside viewport.

Id
LastChangedDate

Author:
Jim E. Brooks http://www.palomino3d.org
 * - This code is tricky.
 *   A known initialization problem is that some GUI methods need to be called
 *   before the GUI is ready (hence a few NULL checks).
 * - Don't confuse the Modules's GUI class with the underlying Gui class from gfx/.
 * - Pointers to screens and other GUI objects should be checked for NULL
 *   because during initialization some GUI objects are created before others are.  
 *   Some of the same Gui*() functions are reused to initialize a GUI object and
 *   also to synchronize with other GUI objects (hence the need to check for NULL).
 * - The dangerous C sprintf() is used instead of C++ ostringstream because
 *   it's 3x to 5x faster.
 * - [2007/08] GUI is started and drawn before Engine/World is ready
 *   in order to print "LOADING..." is case world construction or system is slow.
 *   This requires special care to avoid touching global that aren't fully initialized.
 * 

Define Documentation

#define INIT_JOYCAL_BUTTON ( X,
VAL,
BUTTON,
STR   ) 

Value:

{                                                                                           \
    (BUTTON) = mScreenJoycal->NewButton( (X), y, eFontMode_NW, ModuleSimGui_GuiButtonCallback ); \
    (BUTTON)->SetText( sTemp, sprintf( sTemp, "%s: %05d", STR, ABS(VAL) ) );                \
    (BUTTON)->SetVisi( true );                                                              \
    (BUTTON)->SetSens( false );                                                             \
    y += yi;                                                                                \
}

#define JOYCAL_PRINT ( X,
Y,
VAL,
STR   ) 

Value:

{                                                                           \
    if ( (VAL) == mod_base::Joystick::Values::INVALID )                     \
        sTempLen = sprintf( sTemp, "????? " STR );                          \
    else                                                                    \
        sTempLen = sprintf( sTemp, "%05d " STR, ABS(VAL) );                 \
    screen->Print( sTemp, sTempLen, (X), (Y), eFontMode_NW, sColorGray );   \
}

#define MOD_SIM_GUI_CC   1

#define PSCON ( TEXT,
X,
Y,
FONTMODE,
RGBA   ) 

Value:

{                                                                       \
    PERSISTENT const char str[] = (TEXT);                               \
    screen->Print( str, sizeof(str), (X), (Y), (FONTMODE), (RGBA) );    \
}

#define PSCON2 ( TEXT,
X,
Y,
FONTMODE   ) 

Value:

{                                                                       \
    PERSISTENT const char str[] = (TEXT);                               \
    screen->Print( str, sizeof(str), (X), (Y), (FONTMODE) );            \
}

#define PSVAR ( X,
Y,
FONTMODE,
RGBA   ) 

Value:

{                                                                       \
    ASSERT( sTempLen > 0 );                                             \
    screen->Print( sTemp, sTempLen, (X), (Y), (FONTMODE), (RGBA) );     \
     \
}

#define PSVAR2 ( X,
Y,
FONTMODE   ) 

Value:

{                                                                       \
    ASSERT( sTempLen > 0 );                                             \
    screen->Print( sTemp, sTempLen, (X), (Y), (FONTMODE) );             \
     \
}

#define SET_JOYCAL_BUTTON ( BUTTON,
VAL,
STR   ) 

Value:

{                                                           \
        sTempLen = sprintf( sTemp, "%s: %05d", STR, ABS(VAL) ); \
        (BUTTON)->SetText( sTemp, sTempLen );                   \
        (BUTTON)->SetVisi( true );                              \
        (BUTTON)->SetSens( false );                             \
    }

#define SET_PSVAR ( args...   ) 

Value:

{                                                                       \
    sTempLen = sprintf( sTemp, ## args );                               \
}

#define SPEED_CAN_DISABLE_GUI   0

#define STR_SIZEOF_ARGS ( STR   )     STR, sizeof(STR)


Variable Documentation

fp mCeiling

fp mFloor

fp mInc

fp mZoom

loading ConfigFile may call GuiSetZoom() which assigns this (zoom.zoom).

Palomino 3D Engine documents generated by doxygen 1.5.3 on Fri Nov 23 11:26:16 2007