Defines | Functions | Variables

client/main.c File Reference

#include <include.h>

Go to the source code of this file.

Defines

#define BITMAP_MAX   (sizeof(bitmap_name) / sizeof(_bitmap_name))

Functions

static void init_game_data ()
static void flip_screen ()
static void show_intro (char *text)
static void delete_player_lists ()
static void reset_input_mode ()
static int load_bitmap (int index)
static void free_faces ()
static void free_bitmaps ()
static void load_options_dat ()
void save_options_dat ()
static void init_signals ()
static int game_status_chain ()
static void load_bitmaps ()
void open_input_mode (int maxchar)
static void play_action_sounds ()
void list_vid_modes ()
static void show_option (int x, int y)
static void display_layer1 ()
static void display_layer2 ()
static void display_layer3 ()
static void display_layer4 ()
static void DisplayCustomCursor ()
int main (int argc, char *argv[])

Variables

_server_charfirst_server_char = NULL
_server_char new_character
SDL_Surface * ScreenSurface
SDL_Surface * ScreenSurfaceMap
SDL_Surface * zoomed
_Font MediumFont
_Font SystemFont
_Font SystemFontOut
_Font BigFont
_Font Font6x3Out
struct sockaddr_in insock
ClientSocket csocket
Uint32 sdl_dgreen
Uint32 sdl_gray1
Uint32 sdl_gray2
Uint32 sdl_gray3
Uint32 sdl_gray4
Uint32 sdl_blue1
int music_global_fade = 0
int mb_clicked = 0
int bmaptype_table_size
_srv_client_files srv_client_files [SRV_CLIENT_FILES]
struct _options options
Uint32 videoflags_full
Uint32 videoflags_win
struct _fire_mode fire_mode_tab [FIRE_MODE_INIT]
int RangeFireMode
int current_intro = 0
int CacheStatus
int SoundStatus
int MapStatusX
int MapStatusY
server_structselected_server = NULL
static char argServerName [2048]
static int argServerPort
uint32 LastTick
static uint32 GameTicksSec
uint32 tmpGameTick
uint32 FrameCount = 0
int esc_menu_flag
int esc_menu_index
int f_custom_cursor = 0
int x_custom_cursor = 0
int y_custom_cursor = 0
_bmaptypebmap_table [BMAPTABLE]
int map_udate_flag
int map_transfer_flag
int map_redraw_flag
int request_file_chain
int ToggleScreenFlag
char InputString [MAX_INPUT_STRING]
char InputHistory [MAX_HISTORY_LINES][MAX_INPUT_STRING]
int HistoryPos
int CurrentCursorPos
int InputCount
int InputMax
int InputStringFlag
int InputStringEndFlag
int InputStringEscFlag
struct gui_book_structgui_interface_book
struct gui_party_structgui_interface_party
help_files_structhelp_files
_game_status GameStatus
_anim_tableanim_table = NULL
Animationsanimations = NULL
size_t animations_num = 0
struct screensizeScreensize
_face_struct FaceList [MAX_FACE_TILES]
server_structstart_server
int metaserver_sel
int metaserver_count = 0
struct msg_anim_struct msg_anim
static _bitmap_name bitmap_name [BITMAP_INIT]
_SpriteBitmaps [BITMAP_MAX]

Detailed Description

Client main related functions.

Definition in file main.c.


Define Documentation

#define BITMAP_MAX   (sizeof(bitmap_name) / sizeof(_bitmap_name))

Number of bitmaps.

Definition at line 320 of file main.c.


Function Documentation

static void delete_player_lists (  )  [static]

Clear player lists like skill list, spell list, etc.

Definition at line 336 of file main.c.

static void display_layer1 (  )  [static]

Map, animations and other effects.

Definition at line 1304 of file main.c.

static void display_layer2 (  )  [static]

Inventory.

Definition at line 1360 of file main.c.

static void display_layer3 (  )  [static]

Process the widgets if we're playing.

Definition at line 1376 of file main.c.

static void display_layer4 (  )  [static]

Dialogs, highest priority layer.

Definition at line 1388 of file main.c.

static void DisplayCustomCursor (  )  [static]

Show a custom cursor.

Definition at line 1418 of file main.c.

static void flip_screen (  )  [static]

Flip the screen.

Definition at line 1927 of file main.c.

static void free_bitmaps (  )  [static]

Free the bitmaps.

Definition at line 1072 of file main.c.

static void free_faces (  )  [static]

Free all loaded faces.

Definition at line 1111 of file main.c.

static int game_status_chain (  )  [static]

Game status chain.

Returns:
1.

Definition at line 717 of file main.c.

static void init_game_data (  )  [static]

Initialize game data.

Definition at line 379 of file main.c.

static void init_signals (  )  [static]

Initialize the signal handlers.

Definition at line 704 of file main.c.

void list_vid_modes (  ) 

List video modes available.

Definition at line 1206 of file main.c.

static int load_bitmap ( int  index  )  [static]

Load a single bitmap.

Parameters:
index ID of the bitmap to load.
Returns:
1 on success, 0 on failure.

Definition at line 1037 of file main.c.

static void load_bitmaps (  )  [static]

Load the necessary bitmaps.

Definition at line 1016 of file main.c.

static void load_options_dat (  )  [static]

Load the options file.

Definition at line 532 of file main.c.

int main ( int  argc,
char *  argv[] 
)

The main function.

Parameters:
argc Number of arguments.
argv[] Arguments.
Returns:
0

Definition at line 1431 of file main.c.

void open_input_mode ( int  maxchar  ) 

Open input mode.

Parameters:
maxchar Maximum number of allowed characters.

Definition at line 1150 of file main.c.

static void play_action_sounds (  )  [static]

Play various action sounds.

Definition at line 1169 of file main.c.

static void reset_input_mode (  )  [static]

Reset input mode.

Definition at line 1135 of file main.c.

void save_options_dat (  ) 

Save the options file.

Definition at line 469 of file main.c.

static void show_intro ( char *  text  )  [static]

Draws the intro bitmap and updates progress bar.

Parameters:
text Text to show.

Definition at line 1885 of file main.c.

static void show_option ( int  x,
int  y 
) [static]

Show the options window (the 'ESC' menu).

Parameters:
x X position.
y Y position.

Definition at line 1257 of file main.c.


Variable Documentation

The stored "anim commands" we created out of anims.tmp.

Definition at line 139 of file main.c.

size_t animations_num = 0

Number of animations.

Definition at line 142 of file main.c.

char argServerName[2048] [static]

Used with -server command line option.

Definition at line 88 of file main.c.

int argServerPort [static]

Used with -server command line option.

Definition at line 90 of file main.c.

_bitmap_name bitmap_name[BITMAP_INIT] [static]

All the bitmaps.

Definition at line 158 of file main.c.

_Sprite* Bitmaps[BITMAP_MAX]

The actual bitmaps.

Definition at line 322 of file main.c.

_bmaptype* bmap_table[BMAPTABLE]

The bitmap table.

Definition at line 111 of file main.c.

Bitmaps table size.

Definition at line 64 of file main.c.

Client socket.

Definition at line 55 of file main.c.

Is the esc menu open?

Definition at line 102 of file main.c.

ID of the selected option in esc menu.

Definition at line 104 of file main.c.

_face_struct FaceList[MAX_FACE_TILES]

Face data

Definition at line 148 of file main.c.

uint32 FrameCount = 0

Number of frames drawn.

Definition at line 99 of file main.c.

Global status identifier.

Definition at line 137 of file main.c.

uint32 GameTicksSec [static]

Ticks since this second frame in ms.

Definition at line 95 of file main.c.

The book GUI.

Definition at line 131 of file main.c.

The party GUI.

Definition at line 133 of file main.c.

All the loaded help files.

Definition at line 135 of file main.c.

If 1, we submitted some text using the console.

Definition at line 127 of file main.c.

If 1, ESC was pressed while entering some text to console.

Definition at line 129 of file main.c.

If 1, we have an open console.

Definition at line 125 of file main.c.

struct sockaddr_in insock

Server's attributes

Definition at line 53 of file main.c.

uint32 LastTick

System time counter in ms since program start.

Definition at line 93 of file main.c.

int mb_clicked = 0

Whether the mouse button was clicked.

Definition at line 61 of file main.c.

The message animation structure.

Definition at line 155 of file main.c.

struct _options options

Settings.

Definition at line 68 of file main.c.

Size of the screen.

Definition at line 145 of file main.c.

SDL_Surface* ScreenSurface

The main screen surface.

Definition at line 38 of file main.c.

SDL_Surface* ScreenSurfaceMap

Map surface.

Definition at line 40 of file main.c.

Our selected server that we want to connect to.

Definition at line 85 of file main.c.

The srv/client files.

Definition at line 66 of file main.c.

The list of the servers.

Definition at line 151 of file main.c.

uint32 tmpGameTick

Used from several functions, just to store real ticks.

Definition at line 97 of file main.c.

SDL_Surface* zoomed

Zoomed map surface.

Definition at line 42 of file main.c.