Atrinik Client 2.5
Data Structures | Defines | Typedefs | Enumerations | Variables
include/main.h File Reference

Go to the source code of this file.

Data Structures

struct  server_struct
struct  msg_anim_struct
struct  _face_struct
struct  spell_entry_struct
struct  skill_entry_struct
struct  _fire_mode
struct  help_files_struct
struct  _bitmap_name

Defines

#define HUGE_BUF   4096
#define MAX_BUF   256
#define FRAMES_PER_SECOND   30
#define COLOR_BUF   7
#define SDL_DEFAULT_REPEAT_INTERVAL   30
#define MAXSTRING   20
#define FILE_ATRINIK_P0   "data/atrinik.p0"
#define FACE_REQUESTED   16
#define NUM_STATS   7
#define SPELL_PATH_NUM   21
#define SKILL_LIST_TYPES   7
#define FIRE_ITEM_NO   -1
#define SURFACE_FLAG_PALETTE   1
#define SURFACE_FLAG_COLKEY_16M   2
#define SURFACE_FLAG_DISPLAYFORMAT   4
#define SURFACE_FLAG_DISPLAYFORMATALPHA   8

Typedefs

typedef struct server_struct server_struct
typedef struct msg_anim_struct msg_anim_struct
typedef struct _face_struct _face_struct
typedef struct spell_entry_struct spell_entry_struct
typedef struct skill_entry_struct skill_entry_struct
typedef struct _fire_mode _fire_mode
typedef struct help_files_struct help_files_struct
typedef enum _fire_mode_id _fire_mode_id
typedef enum _game_status _game_status
typedef enum _pic_type _pic_type
typedef struct _bitmap_name _bitmap_name
typedef enum _bitmap_index _bitmap_index

Enumerations

enum  _fire_mode_id {
  FIRE_MODE_BOW, FIRE_MODE_SPELL, FIRE_MODE_WAND, FIRE_MODE_SKILL,
  FIRE_MODE_THROW, FIRE_MODE_INIT
}
enum  _game_status {
  GAME_STATUS_INIT, GAME_STATUS_META, GAME_STATUS_START, GAME_STATUS_WAITLOOP,
  GAME_STATUS_STARTCONNECT, GAME_STATUS_CONNECT, GAME_STATUS_VERSION, GAME_STATUS_SETUP,
  GAME_STATUS_WAITSETUP, GAME_STATUS_REQUEST_FILES, GAME_STATUS_ADDME, GAME_STATUS_LOGIN,
  GAME_STATUS_NAME, GAME_STATUS_PSWD, GAME_STATUS_VERIFYPSWD, GAME_STATUS_NEW_CHAR,
  GAME_STATUS_WAITFORPLAY, GAME_STATUS_QUIT, GAME_STATUS_PLAY
}
enum  {
  ESC_MENU_KEYS, ESC_MENU_SETTINGS, ESC_MENU_LOGOUT, ESC_MENU_BACK,
  ESC_MENU_INDEX
}
enum  _pic_type { PIC_TYPE_DEFAULT, PIC_TYPE_PALETTE, PIC_TYPE_TRANS, PIC_TYPE_ALPHA }
enum  _bitmap_index {
  BITMAP_INTRO, BITMAP_DOLL, BITMAP_LOGIN_INP, BITMAP_INVSLOT,
  BITMAP_HP, BITMAP_SP, BITMAP_GRACE, BITMAP_FOOD,
  BITMAP_HP_BACK, BITMAP_SP_BACK, BITMAP_GRACE_BACK, BITMAP_FOOD_BACK,
  BITMAP_APPLY, BITMAP_UNPAID, BITMAP_CURSED, BITMAP_DAMNED,
  BITMAP_LOCK, BITMAP_MAGIC, BITMAP_FIRE_READY, BITMAP_RANGE,
  BITMAP_RANGE_MARKER, BITMAP_RANGE_SKILL, BITMAP_RANGE_SKILL_NO, BITMAP_RANGE_THROW,
  BITMAP_RANGE_THROW_NO, BITMAP_RANGE_TOOL, BITMAP_RANGE_TOOL_NO, BITMAP_RANGE_WIZARD,
  BITMAP_RANGE_WIZARD_NO, BITMAP_CMARK_START, BITMAP_CMARK_END, BITMAP_CMARK_MIDDLE,
  BITMAP_TWIN_SCROLL, BITMAP_INV_SCROLL, BITMAP_BELOW_SCROLL, BITMAP_NUMBER,
  BITMAP_INVSLOT_U, BITMAP_DEATH, BITMAP_SLEEP, BITMAP_CONFUSE,
  BITMAP_PARALYZE, BITMAP_SCARED, BITMAP_BLIND, BITMAP_QUICKSLOTS,
  BITMAP_QUICKSLOTSV, BITMAP_INVENTORY, BITMAP_INV_BG, BITMAP_EXP_BORDER,
  BITMAP_EXP_SLIDER, BITMAP_EXP_BUBBLE1, BITMAP_EXP_BUBBLE2, BITMAP_STATS_BG,
  BITMAP_BELOW, BITMAP_TARGET_ATTACK, BITMAP_TARGET_TALK, BITMAP_TARGET_NORMAL,
  BITMAP_WARN_HP, BITMAP_WARN_FOOD, BITMAP_RANGE_BUTTONS_OFF, BITMAP_RANGE_BUTTONS_LEFT,
  BITMAP_RANGE_BUTTONS_RIGHT, BITMAP_TARGET_HP, BITMAP_TARGET_HP_B, BITMAP_TEXTWIN_MASK,
  BITMAP_SLIDER_UP, BITMAP_SLIDER_DOWN, BITMAP_SLIDER, BITMAP_EXP_SKILL_BORDER,
  BITMAP_EXP_SKILL_LINE, BITMAP_EXP_SKILL_BUBBLE, BITMAP_TRAPPED, BITMAP_PRAY,
  BITMAP_BOOK, BITMAP_REGION_MAP, BITMAP_SLIDER_LONG, BITMAP_INVSLOT_MARKED,
  BITMAP_MSCURSOR_MOVE, BITMAP_RESIST_BG, BITMAP_MAIN_LVL_BG, BITMAP_SKILL_EXP_BG,
  BITMAP_REGEN_BG, BITMAP_SKILL_LVL_BG, BITMAP_MENU_BUTTONS, BITMAP_PLAYER_INFO,
  BITMAP_TARGET_BG, BITMAP_TEXTINPUT, BITMAP_SQUARE_HIGHLIGHT, BITMAP_SERVERS_BG,
  BITMAP_SERVERS_BG_OVER, BITMAP_NEWS_BG, BITMAP_EYES, BITMAP_POPUP,
  BITMAP_ARROW_UP, BITMAP_ARROW_UP2, BITMAP_ARROW_DOWN, BITMAP_ARROW_DOWN2,
  BITMAP_BUTTON_ROUND, BITMAP_BUTTON_ROUND_DOWN, BITMAP_BUTTON_RECT, BITMAP_BUTTON_RECT_HOVER,
  BITMAP_BUTTON_RECT_DOWN, BITMAP_MAP_MARKER, BITMAP_LOADING_OFF, BITMAP_LOADING_ON,
  BITMAP_BUTTON, BITMAP_BUTTON_DOWN, BITMAP_CHECKBOX, BITMAP_CHECKBOX_ON,
  BITMAP_CONTENT, BITMAP_ICON_MUSIC, BITMAP_ICON_MAGIC, BITMAP_ICON_SKILL,
  BITMAP_ICON_PARTY, BITMAP_ICON_MAP, BITMAP_ICON_COGS, BITMAP_ICON_QUEST,
  BITMAP_FPS, BITMAP_INIT
}
enum  { MSCURSOR_MOVE = 1 }

Variables

struct msg_anim_struct msg_anim
help_files_structhelp_files
int f_custom_cursor
int x_custom_cursor
int y_custom_cursor
_game_status GameStatus
uint32 LastTick
server_structselected_server
int map_udate_flag
int map_redraw_flag
char text_input_string [MAX_INPUT_STRING]
int text_input_count
int text_input_string_flag
int text_input_string_end_flag
int text_input_string_esc_flag
uint32 text_input_opened
struct _fire_mode fire_mode_tab [FIRE_MODE_INIT]
int RangeFireMode
struct _SpriteBitmaps []
_face_struct FaceList [MAX_FACE_TILES]
SDL_Surface * ScreenSurface
struct sockaddr_in insock

Detailed Description

Header file for things that are generally used in many places.

Definition in file main.h.


Define Documentation

#define FIRE_ITEM_NO   -1

If no fire item

Definition at line 220 of file main.h.

#define FRAMES_PER_SECOND   30

Maximum frames per second.

Definition at line 36 of file main.h.

#define SPELL_PATH_NUM   21

Maximum number of spell paths. The last one is always 'all' and holds pointers to spells in the other spell paths.

Definition at line 141 of file main.h.

#define SURFACE_FLAG_COLKEY_16M   2

Use this when you want a colkey in a true color picture - color should be 0

Definition at line 310 of file main.h.

#define SURFACE_FLAG_PALETTE   1

Surface must stay in palette mode, not in vid mode

Definition at line 308 of file main.h.


Typedef Documentation

typedef struct _bitmap_name _bitmap_name

Bitmap name structure

typedef struct _fire_mode _fire_mode

Fire mode structure

typedef enum _game_status _game_status

Game statuses.

typedef enum _pic_type _pic_type

Types of pictures.

Help files structure.

Message animation structure. Used when NDI_ANIM is passed to DrawInfoCmd2().

typedef struct server_struct server_struct

The servers list, as given by the metaserver.


Enumeration Type Documentation

Game statuses.

Enumerator:
GAME_STATUS_INIT 

Call this add start to autoinit

GAME_STATUS_META 

To to connect to meta server

GAME_STATUS_START 

Start all up without full reset or meta calling

GAME_STATUS_WAITLOOP 

We are NOT connected to anything

GAME_STATUS_STARTCONNECT 

We have a server + port, init and start

GAME_STATUS_CONNECT 

If this is set, we start connecting

GAME_STATUS_VERSION 

Now the steps: Connect, we send version

GAME_STATUS_SETUP 

We ready to send setup commands

GAME_STATUS_WAITSETUP 

We wait for server response

GAME_STATUS_REQUEST_FILES 

After we get response from setup, we request files if needed

GAME_STATUS_ADDME 

All setup is done, now try to enter game

GAME_STATUS_LOGIN 

Now we wait for LOGIN request of the server

GAME_STATUS_NAME 

All this here is tricky

GAME_STATUS_PSWD 

Server will trigger this when asking for password

GAME_STATUS_VERIFYPSWD 

Client will then show input panel or so

GAME_STATUS_NEW_CHAR 

Show new char creation screen and send /nc command when finished

GAME_STATUS_WAITFORPLAY 

We simply wait for game start. Means, this is not a serial stepping here

GAME_STATUS_QUIT 

We are in quit menu

GAME_STATUS_PLAY 

We play now.

Definition at line 223 of file main.h.

enum _pic_type

Types of pictures.

Definition at line 315 of file main.h.


Variable Documentation

struct _Sprite* Bitmaps[]

The actual bitmaps.

Definition at line 225 of file main.c.

_face_struct FaceList[MAX_FACE_TILES]

Face data

Definition at line 74 of file main.c.

Global status identifier.

Definition at line 63 of file main.c.

All the loaded help files.

Definition at line 61 of file main.c.

struct sockaddr_in insock

Server's attributes

Definition at line 35 of file main.c.

System time counter in ms since program start.

Definition at line 51 of file main.c.

The message animation structure.

Definition at line 77 of file main.c.

SDL_Surface* ScreenSurface

The main screen surface.

Definition at line 33 of file main.c.

Our selected server that we want to connect to.

Definition at line 43 of file main.c.

Number of characters in the text input string.

Definition at line 35 of file text_input.c.

char text_input_string[MAX_INPUT_STRING]

Current text input string.

Definition at line 33 of file text_input.c.

If 1, we submitted some text using the console.

Definition at line 51 of file text_input.c.

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

Definition at line 53 of file text_input.c.

If 1, we have an open console.

Definition at line 49 of file text_input.c.