menu.cpp File Reference

#include "stdafx.h"

Include dependency graph for menu.cpp:

Go to the source code of this file.

Functions

int MainMenu (gcn::OpenGLGraphics *graphics, gcn::ImageFont *font)
 display main game menu
int OptionsMenu (gcn::OpenGLGraphics *graphics, gcn::ImageFont *font, GameState *State)
 display options menu
int HighScoreMenu (gcn::OpenGLGraphics *graphics, gcn::ImageFont *font)
 display high scores
void DrawMenuBackground (GLfloat top, GLfloat bottom, GLfloat left, GLfloat right)
 draw a nice background
int SaveHighScores (void)
 save high score data to disk
int LoadHighScores (void)
 load high score data from disk
int HighScore (int score, const char *name)
 update high score list
int GetMenuInput (void)
 get player input to control menus

Variables

static char initials [40]
int scores [10]
static char textBuffer [80]


Function Documentation

void DrawMenuBackground ( GLfloat  top,
GLfloat  bottom,
GLfloat  left,
GLfloat  right 
)

Draw a nice background for the menu screens, including a frame for menu text. The parameters passed to this function control the geometry of the frame that is drawn.

Todo:
Decouple this code from CPU dependent timing loops.

Definition at line 575 of file menu.cpp.

References backAccel, backAngle, backDropZ, backZ, GetTexture(), TEXID_MENUBACK, and ticks.

Referenced by HighScoreMenu(), MainMenu(), and OptionsMenu().

Here is the call graph for this function:

Here is the caller graph for this function:

int GetMenuInput ( void   ) 

Take input from the player via the keyboard and/or mouse, and translate it in to menu navigation commands (UP, DOWN, etc.). Note: this function will respond to input from any joystick present.

Definition at line 778 of file menu.cpp.

References event, MENUINPUT_DOWN, MENUINPUT_ESCAPE, MENUINPUT_LEFT, MENUINPUT_NULL, MENUINPUT_RIGHT, MENUINPUT_SELECT, and MENUINPUT_UP.

Referenced by Credits(), HighScoreMenu(), MainMenu(), and OptionsMenu().

Here is the caller graph for this function:

int HighScore ( int  score,
const char *  name 
)

Writes a players three-letter initials and score to the high score data area in memory. The player's initials are converted to lowercase in order to be printed by the text blitter, which has no uppercase font data. If the score parameter is lower than the current 10th place score, this function has no effect and returns an error code.

Definition at line 737 of file menu.cpp.

References DAS_ERROR, initials, and scores.

int HighScoreMenu ( gcn::OpenGLGraphics *  graphics,
gcn::ImageFont *  font 
)

Calls a routine to load the high scores, and then displays them for the Player. Also calls a routine to display an interesting background.

Definition at line 514 of file menu.cpp.

References DrawMenuBackground(), GetMenuInput(), initials, LoadHighScores(), MENUINPUT_ESCAPE, PlaySound(), scores, SCREEN_WIDTH, and SOUNDID_MENUSELECT.

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

int LoadHighScores ( void   ) 

Load the latest high score data from a disk file in to memory.

Definition at line 682 of file menu.cpp.

References DAS_ERROR, initials, and scores.

Referenced by HighScoreMenu().

Here is the caller graph for this function:

int MainMenu ( gcn::OpenGLGraphics *  graphics,
gcn::ImageFont *  font 
)

Display the main menu and take input from the user, in order to make a selection from the menu. Also, call a routine to draw an interesting background to keep the user entertained while pondering the decision.

Definition at line 37 of file menu.cpp.

References backAccel, backZ, DrawMenuBackground(), GetMenuInput(), MENUINPUT_DOWN, MENUINPUT_SELECT, MENUINPUT_UP, PlaySound(), SCREEN_WIDTH, and SOUNDID_MENUSELECT.

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

int OptionsMenu ( gcn::OpenGLGraphics *  graphics,
gcn::ImageFont *  font,
GameState State 
)

Display the options menu and take input from the user, in order to make a selection from the menu. Also, call a routine to draw an interesting background to keep the user entertained while pondering the decision.

Definition at line 102 of file menu.cpp.

References backAccel, backZ, GameState::bAutoAdvanceLevel, GameState::bFullScreen, GameState::cJoystickNames, DrawMenuBackground(), GetMenuInput(), GameState::iBGMLevel, GameState::iBrownHandicap, GameState::iBrownPlayerJoystick, GameState::iCurrentLevel, GameState::iGreenHandicap, GameState::iGreenPlayerJoystick, GameState::iMaxLevel, GameState::iSFXLevel, GameState::iTotalJoysticks, MENUINPUT_DOWN, MENUINPUT_ESCAPE, MENUINPUT_LEFT, MENUINPUT_RIGHT, MENUINPUT_SELECT, MENUINPUT_UP, PlaySound(), SCREEN_WIDTH, SetBGMVolume(), SetSFXVolume(), SOUNDID_MENUSELECT, and ToggleFullScreen().

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

int SaveHighScores ( void   ) 

Save the current high score data to a disk file. This data includes the player's three-letter initials, and the player's score.

Definition at line 645 of file menu.cpp.

References DAS_ERROR, initials, and scores.


Variable Documentation

char initials[40] [static]

Definition at line 26 of file menu.cpp.

Referenced by HighScore(), HighScoreMenu(), LoadHighScores(), and SaveHighScores().

int scores[10]

Definition at line 27 of file menu.cpp.

Referenced by HighScore(), HighScoreMenu(), LoadHighScores(), and SaveHighScores().

char textBuffer[80] [static]

Definition at line 28 of file menu.cpp.

 

Copyright Windsor Schmidt 2006 - All rights reserved.