Open source remastering of the Freespace 2 engine
mainhallmenu.cpp File Reference
#include <stdlib.h>
#include <limits.h>
#include "anim/animplay.h"
#include "anim/packunpack.h"
#include "cmdline/cmdline.h"
#include "freespace2/freespace.h"
#include "gamehelp/contexthelp.h"
#include "gamesequence/gamesequence.h"
#include "gamesnd/eventmusic.h"
#include "gamesnd/gamesnd.h"
#include "globalincs/alphacolors.h"
#include "graphics/generic.h"
#include "io/key.h"
#include "io/mouse.h"
#include "io/timer.h"
#include "menuui/fishtank.h"
#include "menuui/mainhallmenu.h"
#include "menuui/playermenu.h"
#include "menuui/snazzyui.h"
#include "mission/missioncampaign.h"
#include "network/multi.h"
#include "network/multi_voice.h"
#include "network/multiui.h"
#include "network/multiutil.h"
#include "palman/palman.h"
#include "parse/parselo.h"
#include "parse/scripting.h"
#include "playerman/player.h"
#include "popup/popup.h"
#include "sound/audiostr.h"
#include "cutscene/movie.h"
#include "mission/missionload.h"

Go to the source code of this file.


struct  main_hall_region_info


#define NUM_REGIONS   7
#define DOOR_TEXT_X   100
#define DOOR_TEXT_Y   450
#define EXIT_REGION   0
#define TECH_ROOM_REGION   3
#define OPTIONS_REGION   4
#define SCRIPT_REGION   14
#define START_REGION   15
#define TOASTER_REGION   3
#define MAIN_HALL_NOTIFY_TIME   3500
#define MAIN_HALL_VERSION_X   630
#define MAIN_HALL_VERSION_Y   467
#define MAIN_HALL_HELP_TIME   5000


void game_process_cheats (int k)
void main_hall_handle_right_clicks ()
void main_hall_handle_random_intercom_sounds ()
void main_hall_render_misc_anims (float frametime, bool over_doors)
void main_hall_render_door_anims (float frametime)
void main_hall_handle_mouse_location (int cur_region)
void main_hall_mouse_release_region (int region)
void main_hall_mouse_grab_region (int region)
void main_hall_cull_door_sounds ()
void main_hall_handle_region_anims ()
void main_hall_set_notify_string (const char *str)
void main_hall_notify_do ()
void main_hall_blit_version ()
void main_hall_maybe_blit_tooltips ()
void main_hall_process_help_stuff ()
void main_hall_do_multi_ready ()
void main_hall_blit_table_status ()
void main_hall_campaign_cheat ()
void main_hall_init (const SCP_string &main_hall_name)
void main_hall_exit_game ()
void main_hall_do (float frametime)
void main_hall_close ()
int main_hall_get_music_index (int main_hall_num)
void main_hall_start_music ()
void main_hall_stop_music (bool fade)
void main_hall_start_ambient ()
void main_hall_stop_ambient ()
void main_hall_reset_ambient_vol ()
main_hall_definesmain_hall_get_pointer (const SCP_string &name_to_find)
int main_hall_get_index (const SCP_string &name_to_find)
int main_hall_get_resolution_index (int main_hall_num)
void main_hall_get_name (SCP_string &name, unsigned int index)
int main_hall_get_overlay_id ()
int main_hall_get_overlay_resolution_index ()
int main_hall_id ()
void intercom_sounds_init (main_hall_defines &m)
void misc_anim_init (main_hall_defines &m)
void door_anim_init (main_hall_defines &m)
void region_info_init (main_hall_defines &m)
void main_hall_table_init ()
void parse_main_hall_table (const char *filename)
void main_hall_vasudan_funny ()
int main_hall_is_vasudan ()
void main_hall_pause ()
void main_hall_unpause ()


SCP_vector< SCP_vector< main_hall_defines > > Main_hall_defines
int Vasudan_funny = 0
int Vasudan_funny_plate = -1
SCP_string Main_hall_cheat = ""
int Main_hall_inited = 0
int Main_hall_music_handle = -1
int Main_hall_bitmap
int Main_hall_bitmap_w
int Main_hall_bitmap_h
int Main_hall_mask
int Main_hall_mask_w
int Main_hall_mask_h
int Main_hall_right_click
int Main_hall_last_clicked_region
int Main_hall_region_linger_stamp = -1
int Main_hall_next_intercom_sound = 0
int Main_hall_next_intercom_sound_stamp = -1
int Main_hall_intercom_sound_handle = -1
SCP_vector< generic_animMain_hall_misc_anim
SCP_vector< generic_animMain_hall_door_anim
main_hall_region_info Main_hall_region_map []
int Main_hall_mouse_region
int Main_hall_frame_skip
SCP_vector< intMain_hall_door_sound_handles
int Main_hall_ambient_loop = -1
int Main_hall_notify_stamp = -1
char Main_hall_notify_text [300] =""
int Main_hall_overlay_id
shader Main_hall_tooltip_shader
int Main_hall_help_stamp = -1
int Recording = 0

Macro Definition Documentation


Definition at line 226 of file mainhallmenu.cpp.


Definition at line 164 of file mainhallmenu.cpp.


Definition at line 168 of file mainhallmenu.cpp.

#define DOOR_TEXT_X   100

Definition at line 147 of file mainhallmenu.cpp.

#define DOOR_TEXT_Y   450

Definition at line 148 of file mainhallmenu.cpp.

#define EXIT_REGION   0

Definition at line 163 of file mainhallmenu.cpp.


Definition at line 170 of file mainhallmenu.cpp.

#define MAIN_HALL_HELP_TIME   5000

Definition at line 291 of file mainhallmenu.cpp.


Definition at line 58 of file mainhallmenu.cpp.

#define MAIN_HALL_NOTIFY_TIME   3500

Definition at line 247 of file mainhallmenu.cpp.


Definition at line 109 of file mainhallmenu.cpp.

#define MAIN_HALL_VERSION_X   630

Definition at line 267 of file mainhallmenu.cpp.

#define MAIN_HALL_VERSION_Y   467

Definition at line 268 of file mainhallmenu.cpp.


Definition at line 55 of file mainhallmenu.cpp.


Definition at line 54 of file mainhallmenu.cpp.


Definition at line 56 of file mainhallmenu.cpp.


Definition at line 169 of file mainhallmenu.cpp.


Definition at line 160 of file mainhallmenu.cpp.

#define NUM_REGIONS   7

Definition at line 57 of file mainhallmenu.cpp.

#define OPTIONS_REGION   4

Definition at line 167 of file mainhallmenu.cpp.


Definition at line 171 of file mainhallmenu.cpp.


Definition at line 165 of file mainhallmenu.cpp.

#define SCRIPT_REGION   14

Definition at line 173 of file mainhallmenu.cpp.


Definition at line 172 of file mainhallmenu.cpp.

#define START_REGION   15

Definition at line 174 of file mainhallmenu.cpp.

#define TECH_ROOM_REGION   3

Definition at line 166 of file mainhallmenu.cpp.

#define TOASTER_REGION   3

Definition at line 223 of file mainhallmenu.cpp.

Function Documentation

void door_anim_init ( main_hall_defines m)

Initialising door anim vectors based on number of anims

To be called after num_door_animations has been parsed
mMain hall defines

Definition at line 1987 of file mainhallmenu.cpp.

void game_process_cheats ( int  k)

Process cheat codes

Definition at line 1487 of file keycontrol.cpp.

void intercom_sounds_init ( main_hall_defines m)

Definition at line 1880 of file mainhallmenu.cpp.

void main_hall_blit_table_status ( )

Definition at line 374 of file mainhallmenu.cpp.

void main_hall_blit_version ( )

Blit the freespace version number

Definition at line 1681 of file mainhallmenu.cpp.

void main_hall_campaign_cheat ( )

Bash the player to a specific mission in a campaign

Definition at line 388 of file mainhallmenu.cpp.

void main_hall_close ( )

Close the main hall proper

Definition at line 1027 of file mainhallmenu.cpp.

void main_hall_cull_door_sounds ( )

Cull any door sounds that have finished playing

Definition at line 1520 of file mainhallmenu.cpp.

void main_hall_do ( float  frametime)

Do a frame for the main hall

frametimeAnimation frame time

Definition at line 653 of file mainhallmenu.cpp.

void main_hall_do_multi_ready ( )

Definition at line 307 of file mainhallmenu.cpp.

void main_hall_exit_game ( )

Exit the game

In Debug mode, the confirmation popup does not get used, and the game usefully exits immediately

Definition at line 628 of file mainhallmenu.cpp.

int main_hall_get_index ( const SCP_string name_to_find)

CommanderDJ - finds the mainhall struct whose name is equal to the passed string

name_to_findName of mainhall we're searching for
index of mainhall in Main_hall_defines if one with a matching name is found
-1 otherwise

Definition at line 1815 of file mainhallmenu.cpp.

int main_hall_get_music_index ( int  main_hall_num)

Return music index

main_hall_numIndex to seek
Index into spooled music

Definition at line 1100 of file mainhallmenu.cpp.

void main_hall_get_name ( SCP_string name,
unsigned int  index 

Definition at line 1841 of file mainhallmenu.cpp.

int main_hall_get_overlay_id ( )

Definition at line 1850 of file mainhallmenu.cpp.

int main_hall_get_overlay_resolution_index ( )

Definition at line 1859 of file mainhallmenu.cpp.

main_hall_defines* main_hall_get_pointer ( const SCP_string name_to_find)

CommanderDJ - finds the mainhall struct whose name is equal to the passed string

name_to_findName of mainhall we're searching for
pointer to mainhall if one with a matching name is found
NULL otherwise

Definition at line 1795 of file mainhallmenu.cpp.

int main_hall_get_resolution_index ( int  main_hall_num)

Definition at line 1827 of file mainhallmenu.cpp.

void main_hall_handle_mouse_location ( int  cur_region)

Any necessary processing based upon the mouse location

cur_regionRegion of current mouse location

Definition at line 1338 of file mainhallmenu.cpp.

void main_hall_handle_random_intercom_sounds ( )

Insert random intercom sounds

Definition at line 1535 of file mainhallmenu.cpp.

void main_hall_handle_region_anims ( )
void main_hall_handle_right_clicks ( )

Handle any right clicks which may have occured

Definition at line 1467 of file mainhallmenu.cpp.

int main_hall_id ( )

Definition at line 1869 of file mainhallmenu.cpp.

void main_hall_init ( const SCP_string main_hall_name)

Initialize the main hall proper

main_hall_nameName of main hall to initialise

Definition at line 407 of file mainhallmenu.cpp.

int main_hall_is_vasudan ( )

Lookup if Vasudan main hall, based upon music name

1 if true, 0 if false

Definition at line 2510 of file mainhallmenu.cpp.

void main_hall_maybe_blit_tooltips ( )

Blit any necessary tooltips

Definition at line 1705 of file mainhallmenu.cpp.

void main_hall_mouse_grab_region ( int  region)

If the mouse has moved on this region, handle it accordingly

regionRegion of current mouse location

Definition at line 1426 of file mainhallmenu.cpp.

void main_hall_mouse_release_region ( int  region)

If the mouse has moved off of the currently active region, handle the anim accordingly

regionRegion of prior mouse location

Definition at line 1387 of file mainhallmenu.cpp.

void main_hall_notify_do ( )

Handle any drawing, culling, etc of notification messages

Definition at line 1607 of file mainhallmenu.cpp.

void main_hall_pause ( )

Silence sounds on mainhall if we hit a pause mode (ie. lost window focus, minimized, etc)

Definition at line 2519 of file mainhallmenu.cpp.

void main_hall_process_help_stuff ( )

Process help messages

Definition at line 1747 of file mainhallmenu.cpp.

void main_hall_render_door_anims ( float  frametime)

Render all playing door animations

frametimeAnimation frame time

Definition at line 1319 of file mainhallmenu.cpp.

void main_hall_render_misc_anims ( float  frametime,
bool  over_doors 

Render all playing misc animations

frametimeAnimation frame time

Definition at line 1182 of file mainhallmenu.cpp.

void main_hall_reset_ambient_vol ( )

Reset the volume of the looping ambient sound.

This is called from the options screen when the looping ambient sound might be playing.

Definition at line 1671 of file mainhallmenu.cpp.

void main_hall_set_notify_string ( const char *  str)

Set the notification string with its decay timeout

strNotification string

Definition at line 1598 of file mainhallmenu.cpp.

void main_hall_start_ambient ( )

Start a looping ambient sound for main hall

Definition at line 1634 of file mainhallmenu.cpp.

void main_hall_start_music ( )

Start the main hall music playing

Definition at line 1129 of file mainhallmenu.cpp.

void main_hall_stop_ambient ( )

Stop a looping ambient sound for the main hall

Definition at line 1658 of file mainhallmenu.cpp.

void main_hall_stop_music ( bool  fade)

Stop the main hall music

Definition at line 1169 of file mainhallmenu.cpp.

void main_hall_table_init ( )

Read in main hall table

Definition at line 2051 of file mainhallmenu.cpp.

void main_hall_unpause ( )

Recover from a paused state (ie. lost window focus, minimized, etc)

Definition at line 2535 of file mainhallmenu.cpp.

void main_hall_vasudan_funny ( )

Make the vasudan main hall funny

Definition at line 2501 of file mainhallmenu.cpp.

void misc_anim_init ( main_hall_defines m)

Iinitialising misc anim vectors based on number of anims

To be called after num_misc_animations has been parsed
mMain hall defines

Definition at line 1915 of file mainhallmenu.cpp.

void parse_main_hall_table ( const char *  filename)

the reason that this is an error is that even if we were to change the names to match it is very likely the user would get the wrong mainhall loaded since their campaign files may still refer to the entry with the incorrect name

Definition at line 2066 of file mainhallmenu.cpp.

void region_info_init ( main_hall_defines m)

Definition at line 2024 of file mainhallmenu.cpp.

Variable Documentation

int Main_hall_ambient_loop = -1

Definition at line 232 of file mainhallmenu.cpp.

int Main_hall_bitmap

Definition at line 81 of file mainhallmenu.cpp.

int Main_hall_bitmap_h

Definition at line 85 of file mainhallmenu.cpp.

int Main_hall_bitmap_w

Definition at line 84 of file mainhallmenu.cpp.

SCP_string Main_hall_cheat = ""

Definition at line 69 of file mainhallmenu.cpp.

SCP_vector< SCP_vector<main_hall_defines> > Main_hall_defines

Definition at line 60 of file mainhallmenu.cpp.

SCP_vector<generic_anim> Main_hall_door_anim

Definition at line 151 of file mainhallmenu.cpp.

SCP_vector<int> Main_hall_door_sound_handles

Definition at line 229 of file mainhallmenu.cpp.

int Main_hall_frame_skip

Definition at line 206 of file mainhallmenu.cpp.

int Main_hall_help_stamp = -1

Definition at line 292 of file mainhallmenu.cpp.

int Main_hall_inited = 0

Definition at line 75 of file mainhallmenu.cpp.

int Main_hall_intercom_sound_handle = -1

Definition at line 127 of file mainhallmenu.cpp.

int Main_hall_last_clicked_region

Definition at line 106 of file mainhallmenu.cpp.

int Main_hall_mask

Definition at line 88 of file mainhallmenu.cpp.

bitmap* Main_hall_mask_bitmap

Definition at line 91 of file mainhallmenu.cpp.

ubyte* Main_hall_mask_data

Definition at line 94 of file mainhallmenu.cpp.

int Main_hall_mask_h

Definition at line 96 of file mainhallmenu.cpp.

int Main_hall_mask_w

Definition at line 96 of file mainhallmenu.cpp.

SCP_vector<generic_anim> Main_hall_misc_anim

Definition at line 138 of file mainhallmenu.cpp.

int Main_hall_mouse_region

Definition at line 203 of file mainhallmenu.cpp.

int Main_hall_music_handle = -1

Definition at line 78 of file mainhallmenu.cpp.

int Main_hall_next_intercom_sound = 0

Definition at line 121 of file mainhallmenu.cpp.

int Main_hall_next_intercom_sound_stamp = -1

Definition at line 124 of file mainhallmenu.cpp.

int Main_hall_notify_stamp = -1

Definition at line 250 of file mainhallmenu.cpp.

char Main_hall_notify_text[300] =""

Definition at line 253 of file mainhallmenu.cpp.

int Main_hall_overlay_id

Definition at line 271 of file mainhallmenu.cpp.

Definition at line 198 of file mainhallmenu.cpp.

int Main_hall_region_linger_stamp = -1

Definition at line 110 of file mainhallmenu.cpp.

main_hall_region_info Main_hall_region_map[]
Initial value:
= {
{ EXIT_REGION, "Exit" },
{ BARRACKS_REGION, "Barracks" },
{ READY_ROOM_REGION, "Readyroom" },
{ TECH_ROOM_REGION, "Techroom" },
{ OPTIONS_REGION, "Options" },
{ CAMPAIGN_ROOM_REGION, "Campaigns" },
{ MULTIPLAYER_REGION, "Multiplayer" },
{ LOAD_MISSION_REGION, "Load Mission" },
{ QUICK_START_REGION, "Quickstart" },
{ SKILL_LEVEL_REGION, "Skilllevel" },
{ SCRIPT_REGION, "Script" },
{ START_REGION, "Start" },
{ -1, NULL }

Definition at line 181 of file mainhallmenu.cpp.

int Main_hall_right_click

Definition at line 103 of file mainhallmenu.cpp.

shader Main_hall_tooltip_shader

Definition at line 280 of file mainhallmenu.cpp.

int Recording = 0

Definition at line 301 of file mainhallmenu.cpp.

int Vasudan_funny = 0

Definition at line 66 of file mainhallmenu.cpp.

int Vasudan_funny_plate = -1

Definition at line 67 of file mainhallmenu.cpp.