#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"
Go to the source code of this file.
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 CDVOLUME 3 |
| #define GIVEUPMENU_CONTINUE 28 |
| #define GIVEUPMENU_QUIT 27 |
| #define LINEVOLUME 4 |
| #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 |
| #define MAINMENU_NEWGAME 20 |
| #define MAINMENU_OPTIONS 23 |
| #define MAINMENU_QUIT 22 |
| #define MASTERVOLUME 5 |
| #define MUSICVOLUME 1 |
| #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 |
| #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 |
| #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 |
| 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
| 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
| 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
| 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 | ( | ) |
Used to run the in-game give-up menu
Definition at line 922 of file menu.c.
References cfgfile, copy_screen(), currentTextBank, ConfigFile::Fps, fps_cycles(), frontVideoBuffer, GIVEUPMENU_CONTINUE, GIVEUPMENU_QUIT, GiveUpMenuSettings, GiveUpMenuSettingsWithSave, init_dialogue_bank(), process_menu(), ConfigFile::UseAutoSaving, and workVideoBuffer.
Referenced by show_giveup_menu().
| void main_menu | ( | ) |
Used to run the main menu
Definition at line 865 of file menu.c.
References cfgfile, convert_pal_2_RGBA(), copy_screen(), fade_2_pal(), flip(), ConfigFile::Fps, fps_cycles(), frontVideoBuffer, hqr_get_entry(), HQR_RESS_FILE, init_dialogue_bank(), MAINMENU_BKGIMAGE, MAINMENU_CONTINUEGAME, MAINMENU_NEWGAME, MAINMENU_OPTIONS, MAINMENU_QUIT, MainMenuSettings, new_game_menu(), options_menu(), OPTIONSMENU_RETURNMENU, OptionsMenuSettings, palette, paletteRGBA, PLASMA_EFFECT_FILESIZE, plasmaEffectPtr, play_track_music(), process_menu(), ConfigFile::Quit, RESSHQR_MAINPAL, RESSHQR_MENUIMG, RESSHQR_PLASMAEFFECT, and workVideoBuffer.
Referenced by init_engine().
| int options_menu | ( | ) |
Used to run the options menu
Definition at line 811 of file menu.c.
References advoptions_menu(), copy_screen(), flip(), frontVideoBuffer, OPTIONSMENU_ADVOPTIONS, OPTIONSMENU_RETURNGAME, OPTIONSMENU_RETURNMENU, OPTIONSMENU_SAVEMANAGE, OPTIONSMENU_VOLUME, OptionsMenuSettings, process_menu(), savemanage_menu(), volume_menu(), and workVideoBuffer.
Referenced by main_menu(), and show_game_options().
| 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
| menuSettings | menu settings array with the information to build the menu options |
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
| 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().
| short int AdvOptionsMenuSettings[] |
Initial value:
{
0,
5,
0,
0,
0,
26,
0,
4,
6,
31,
7,
32,
8,
33,
}
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,
}
Used to create the in-game menu.
Definition at line 107 of file menu.c.
Referenced by giveup_menu().
| short int GiveUpMenuSettingsWithSave[] |
Initial value:
{
0,
3,
240,
0,
0,
28,
0,
16,
0,
27,
}
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,
}
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,
}
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().
| short int SaveManageMenuSettings[] |
Initial value:
{
0,
3,
0,
0,
0,
26,
0,
41,
0,
45,
}
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,
}
Used to create the volume menu.
Definition at line 191 of file menu.c.
Referenced by volume_menu().
1.5.5