D:/WorkAround/prequengine/trunk/src/menu.c File Reference

This file contains main menu create and processing routines. More...

#include "main.h"
#include "menu.h"
#include "menuoptions.h"
#include "resources.h"
#include "music.h"
#include "sound.h"
#include "images.h"
#include "sdlengine.h"
#include "hqrdepack.h"
#include "lbaengine.h"
#include "dialogues.h"
#include "interface.h"

Include dependency graph for menu.c:

Go to the source code of this file.

Defines

#define PLASMA_EFFECT_FILESIZE   262176
#define MAINMENU_NEWGAME   20
#define MAINMENU_CONTINUEGAME   21
#define MAINMENU_OPTIONS   23
#define MAINMENU_QUIT   22
#define GIVEUPMENU_CONTINUE   28
#define GIVEUPMENU_QUIT   27
#define OPTIONSMENU_RETURNGAME   15
#define OPTIONSMENU_RETURNMENU   26
#define OPTIONSMENU_VOLUME   30
#define OPTIONSMENU_SAVEMANAGE   46
#define OPTIONSMENU_ADVOPTIONS   47
#define MAINMENU_BKGIMAGE   9999
#define MAINMENU_BUTTONWIDTH   320
#define MAINMENU_BUTTONSPAN   550
#define MUSICVOLUME   1
#define SOUNDVOLUME   2
#define CDVOLUME   3
#define LINEVOLUME   4
#define MASTERVOLUME   5

Functions

void plasma_effect_init ()
void process_plasma_effect (int top, int color)
void draw_button_box (int left, int top, int right, int bottom)
void draw_button_gfx (int width, int topheight, int id, int value, int mode)
void draw_button (short int *menuSettings, int mode)
int process_menu (short int *menuSettings)
int advoptions_menu ()
int savemanage_menu ()
int volume_menu ()
int options_menu ()
void main_menu ()
int giveup_menu ()

Variables

short int MainMenuSettings []
short int GiveUpMenuSettings []
short int GiveUpMenuSettingsWithSave []
short int OptionsMenuSettings []
short int AdvOptionsMenuSettings []
short int SaveManageMenuSettings []
short int VolumeMenuSettings []
unsigned char * plasmaEffectPtr
unsigned char * plasmaEffectVar1
unsigned char * plasmaEffectVar2


Detailed Description

This file contains main menu create and processing routines.

Prequengine: a Little Big Adventure engine

Copyright (C) 2008 Prequengine team
Copyright (C) 2002-2007 The TwinEngine team

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

Definition in file menu.c.


Define Documentation

#define CDVOLUME   3

CD volume button key

Definition at line 80 of file menu.c.

Referenced by process_menu().

#define GIVEUPMENU_CONTINUE   28

Give up menu continue game key

Definition at line 51 of file menu.c.

Referenced by giveup_menu().

#define GIVEUPMENU_QUIT   27

give up menu quit game key

Definition at line 53 of file menu.c.

Referenced by giveup_menu().

#define LINEVOLUME   4

Line-in volume button key

Definition at line 82 of file menu.c.

Referenced by process_menu().

#define MAINMENU_BKGIMAGE   9999

Main menu background image number

Used when returning from credit sequence to redraw the main menu background image

Definition at line 69 of file menu.c.

Referenced by main_menu(), and process_menu().

#define MAINMENU_BUTTONSPAN   550

Used to calculate the spanning between button and screen

Definition at line 73 of file menu.c.

Referenced by draw_button_gfx().

#define MAINMENU_BUTTONWIDTH   320

Menu buttons width

Definition at line 71 of file menu.c.

Referenced by draw_button(), and process_plasma_effect().

#define MAINMENU_CONTINUEGAME   21

Main menu continue game option key

Definition at line 44 of file menu.c.

Referenced by main_menu().

#define MAINMENU_NEWGAME   20

Main menu new game option key

Definition at line 42 of file menu.c.

Referenced by main_menu().

#define MAINMENU_OPTIONS   23

Main menu option key

Definition at line 46 of file menu.c.

Referenced by main_menu().

#define MAINMENU_QUIT   22

Main menu quit key

Definition at line 48 of file menu.c.

Referenced by main_menu().

#define MASTERVOLUME   5

Master volume button key

Definition at line 84 of file menu.c.

Referenced by process_menu().

#define MUSICVOLUME   1

Music volume button key

Definition at line 76 of file menu.c.

Referenced by process_menu().

#define OPTIONSMENU_ADVOPTIONS   47

options menu advanced options key

Definition at line 64 of file menu.c.

Referenced by options_menu().

#define OPTIONSMENU_RETURNGAME   15

options menu return game key

Definition at line 56 of file menu.c.

Referenced by options_menu().

#define OPTIONSMENU_RETURNMENU   26

options menu return menu key

Definition at line 58 of file menu.c.

Referenced by advoptions_menu(), main_menu(), options_menu(), savemanage_menu(), and volume_menu().

#define OPTIONSMENU_SAVEMANAGE   46

options menu save game management key

Definition at line 62 of file menu.c.

Referenced by options_menu().

#define OPTIONSMENU_VOLUME   30

options menu volume key

Definition at line 60 of file menu.c.

Referenced by options_menu().

#define PLASMA_EFFECT_FILESIZE   262176

Plasma effect file size: RESS.hqr:51

Definition at line 39 of file menu.c.

Referenced by main_menu().

#define SOUNDVOLUME   2

Sound effects volume button key

Definition at line 78 of file menu.c.

Referenced by process_menu().


Function Documentation

int advoptions_menu (  ) 

Used to run the advanced options menu

Definition at line 724 of file menu.c.

References AdvOptionsMenuSettings, copy_screen(), flip(), frontVideoBuffer, OPTIONSMENU_RETURNMENU, process_menu(), and workVideoBuffer.

Referenced by options_menu().

void draw_button ( short int *  menuSettings,
int  mode 
)

Process the menu button draw

Parameters:
data menu settings array
mode flag to know if should draw as a hover button or not

Definition at line 468 of file menu.c.

References draw_button_gfx(), fps_cycles(), and MAINMENU_BUTTONWIDTH.

Referenced by process_menu().

void draw_button_box ( int  left,
int  top,
int  right,
int  bottom 
)

Draw the entire button box

Parameters:
left start width to draw the button
top start height to draw the button
right end width to draw the button
bottom end height to draw the button

Definition at line 335 of file menu.c.

References draw_line().

Referenced by draw_button_gfx().

void draw_button_gfx ( int  width,
int  topheight,
int  id,
int  value,
int  mode 
)

Draws main menu button

Parameters:
width menu button width
topheight is the height between the top of the screen and the first button
id current button identification from menu settings
value current button key pressed value
mode flag to know if should draw as a hover button or not

Definition at line 349 of file menu.c.

References blit_box(), ConfigFile::CDVolume, cfgfile, copy_block_phys(), cross_dot(), dialogue_text_size(), display_dialogue_text(), draw_button_box(), draw_splitted_box(), draw_transparent_box(), frontVideoBuffer, get_menu_text(), ConfigFile::LineVolume, MAINMENU_BUTTONSPAN, ConfigFile::MasterVolume, ConfigFile::MusicVolume, plasmaEffectPtr, process_plasma_effect(), set_font_color(), ConfigFile::WaveVolume, and workVideoBuffer.

Referenced by draw_button().

int giveup_menu (  ) 

void main_menu (  ) 

int options_menu (  ) 

void plasma_effect_init (  ) 

Plasma Effect Initialization

Definition at line 222 of file menu.c.

References plasmaEffectPtr, plasmaEffectVar1, and plasmaEffectVar2.

Referenced by process_plasma_effect().

int process_menu ( short int *  menuSettings  ) 

Where the main menu options are processed

Parameters:
menuSettings menu settings array with the information to build the menu options
Returns:
pressed menu button identification

Definition at line 539 of file menu.c.

References ConfigFile::CDVolume, CDVOLUME, cfgfile, copy_screen(), draw_button(), frontVideoBuffer, key, lbaTime, ConfigFile::LineVolume, LINEVOLUME, MAINMENU_BKGIMAGE, MainMenuSettings, ConfigFile::MasterVolume, MASTERVOLUME, music_volume(), ConfigFile::MusicVolume, MUSICVOLUME, pressedKey, read_keys(), sample_volume(), skipedKey, skipIntro, SOUNDVOLUME, ConfigFile::WaveVolume, and workVideoBuffer.

Referenced by advoptions_menu(), giveup_menu(), main_menu(), options_menu(), savemanage_menu(), and volume_menu().

void process_plasma_effect ( int  top,
int  color 
)

Process the plasma effect

Parameters:
top top height where the effect will be draw in the front buffer
color plasma effect start color

Definition at line 292 of file menu.c.

References frontVideoBuffer, MAINMENU_BUTTONWIDTH, plasma_effect_init(), plasmaEffectVar1, and screenLockupTable.

Referenced by draw_button_gfx().

int savemanage_menu (  ) 

Used to run the save game management menu

Definition at line 753 of file menu.c.

References copy_screen(), flip(), frontVideoBuffer, OPTIONSMENU_RETURNMENU, process_menu(), SaveManageMenuSettings, and workVideoBuffer.

Referenced by options_menu().

int volume_menu (  ) 

Used to run the volume menu

Definition at line 782 of file menu.c.

References copy_screen(), flip(), frontVideoBuffer, OPTIONSMENU_RETURNMENU, process_menu(), VolumeMenuSettings, and workVideoBuffer.

Referenced by options_menu().


Variable Documentation

Initial value:

{
        0,                      
        5,                      
        0,                      
        0,                      
        0,
        26,                     
        0,
        4,                      
        6,
        31,                     
        7,
        32,                     
        8,                      
        33,                     
}
Advanced Options Menu Settings

Used to create the advanced options menu.

Definition at line 155 of file menu.c.

Referenced by advoptions_menu().

short int GiveUpMenuSettings[]

Initial value:

{
        0,                      
        2,                      
        240,            
        0,                      
        0,
        28,                     
        0,
        27,                     
}
Give Up Menu Settings

Used to create the in-game menu.

Definition at line 107 of file menu.c.

Referenced by giveup_menu().

Initial value:

{
        0,                      
        3,                      
        240,            
        0,                      
        0,
        28,                     
        0,
        16,                     
        0,
        27,                     
}
Give Up Menu Settings

Used to create the in-game menu. This menu have one extra item to save the game

Definition at line 121 of file menu.c.

Referenced by giveup_menu().

short int MainMenuSettings[]

Initial value:

{
        0,          
        4,          
        200,        
        0,          
        0,          
        20,         
        0,
        21,         
        0,
        23,         
        0,
        22,         
}
Main Menu Settings

Used to create the game main menu.

Definition at line 89 of file menu.c.

Referenced by main_menu(), and process_menu().

short int OptionsMenuSettings[]

Initial value:

{
        0,                      
        4,                      
        0,              
        0,                      
        0,
        24,                     
        0,
        30,                     
        0,
        46,                     
        0,
        47,                     
}
Options Menu Settings

Used to create the options menu.

Definition at line 137 of file menu.c.

Referenced by main_menu(), options_menu(), and show_game_options().

unsigned char* plasmaEffectPtr

Plasma Effect pointer to file content: RESS.HQR:51

Definition at line 214 of file menu.c.

Referenced by draw_button_gfx(), main_menu(), and plasma_effect_init().

unsigned char* plasmaEffectVar1

Plasma Effect variables 1

Definition at line 216 of file menu.c.

Referenced by plasma_effect_init(), and process_plasma_effect().

unsigned char* plasmaEffectVar2

Plasma Effect variables 2

Definition at line 218 of file menu.c.

Referenced by plasma_effect_init().

Initial value:

{
        0,                      
        3,                      
        0,                      
        0,                      
        0,
        26,                     
        0,
        41,                     
        0,
        45,                     
}
Save Game Management Menu Settings

Used to create the save game management menu.

Definition at line 175 of file menu.c.

Referenced by savemanage_menu().

short int VolumeMenuSettings[]

Initial value:

{
        0,                      
        7,                      
        0,                      
        0,                      
        0,
        26,                     
        1,
        10,                     
        2,
        11,                     
        3,
        12,                     
        4,
        13,                     
        5,
        14,                     
        0,
        16,                     
}
Volume Menu Settings

Used to create the volume menu.

Definition at line 191 of file menu.c.

Referenced by volume_menu().


Generated on Thu Sep 18 14:14:48 2008 for Prequengine by  doxygen 1.5.5