summaryrefslogtreecommitdiff
path: root/src/client
diff options
context:
space:
mode:
Diffstat (limited to 'src/client')
-rw-r--r--src/client/chat.c32
-rw-r--r--src/client/client.c2
-rw-r--r--src/client/game.c26
-rw-r--r--src/client/hotKey.c14
-rw-r--r--src/client/hotKey.h14
-rw-r--r--src/client/interface.c14
-rw-r--r--src/client/keyboardBuffer.c18
-rw-r--r--src/client/keyboardBuffer.h16
-rw-r--r--src/client/pauza.c4
-rw-r--r--src/client/saveDialog.c24
-rw-r--r--src/client/saveDialog.h10
-rw-r--r--src/client/saveLoad.c18
12 files changed, 96 insertions, 96 deletions
diff --git a/src/client/chat.c b/src/client/chat.c
index e071b17..d039dcc 100644
--- a/src/client/chat.c
+++ b/src/client/chat.c
@@ -38,7 +38,7 @@ static void chat_eventDisable();
static void hotkey_chat_esc()
{
//printf("*** hotkey_chat_esc\n");
- //unhotKey_register(SDLK_ESCAPE);
+ //unhot_key_register(SDLK_ESCAPE);
chat_eventDisable();
}
@@ -52,12 +52,12 @@ static void hotkey_chat_enter()
chat_active = TRUE;
receivedNewMsg = FALSE;
- hotKey_disable(SDLK_RETURN);
- hotKey_disable(SDLK_p);
- hotKey_register(SDLK_ESCAPE, hotkey_chat_esc);
+ hot_key_disable(SDLK_RETURN);
+ hot_key_disable(SDLK_p);
+ hot_key_register(SDLK_ESCAPE, hotkey_chat_esc);
interface_enable_keyboard_buffer();
- keyboardBuffer_clear();
+ keyboard_buffer_clear();
}
void chat_init()
@@ -68,7 +68,7 @@ void chat_init()
strcpy(line, "");
chat_active = FALSE;
- hotKey_register(SDLK_RETURN, hotkey_chat_enter);
+ hot_key_register(SDLK_RETURN, hotkey_chat_enter);
receivedNewMsg = FALSE;
line_time = 0;
@@ -160,11 +160,11 @@ static void processMessageKey(SDL_keysym keysym)
static void sendNewMessage()
{
- if (netMultiplayer_get_game_type() == NET_GAME_TYPE_CLIENT) {
+ if (net_multiplayer_get_game_type() == NET_GAME_TYPE_CLIENT) {
proto_send_chat_client(line);
}
- if (netMultiplayer_get_game_type() == NET_GAME_TYPE_SERVER) {
+ if (net_multiplayer_get_game_type() == NET_GAME_TYPE_SERVER) {
char out[STR_PROTO_SIZE];
snprintf(out, STR_PROTO_SIZE, "chat %s:%s\n",
@@ -179,12 +179,12 @@ static void chat_eventDisable()
chat_active = FALSE;
memset(line, '\0', STR_SIZE);
- hotKey_enable(SDLK_RETURN);
- hotKey_enable(SDLK_p);
- unhotKey_register(SDLK_ESCAPE);
+ hot_key_enable(SDLK_RETURN);
+ hot_key_enable(SDLK_p);
+ unhot_key_register(SDLK_ESCAPE);
interface_disable_keyboard_buffer();
- keyboardBuffer_clear();
+ keyboard_buffer_clear();
}
static void chat_eventEnable()
@@ -193,9 +193,9 @@ static void chat_eventEnable()
* but when ENTER is pressed the chat row is sent to the server
*/
- while (keyboardBuffer_is_any_key() == TRUE) {
+ while (keyboard_buffer_is_any_key() == TRUE) {
SDL_keysym key;
- key = keyboardBuffer_pop();
+ key = keyboard_buffer_pop();
if (key.sym == SDLK_RETURN) {
if (strcmp(line, "") != 0) {
@@ -208,7 +208,7 @@ static void chat_eventEnable()
//chat_eventDisable();
/* turn off key catching into the buffer and clear the buffer */
//interface_disable_keyboard_buffer();
- //keyboardBuffer_clear();
+ //keyboard_buffer_clear();
}
}
@@ -253,6 +253,6 @@ void chat_quit()
{
assert(listText != NULL);
- //unhotKey_register(SDLK_RETURN);
+ //unhot_key_register(SDLK_RETURN);
list_destroy_item(listText, free);
}
diff --git a/src/client/client.c b/src/client/client.c
index 3663264..890869a 100644
--- a/src/client/client.c
+++ b/src/client/client.c
@@ -125,7 +125,7 @@ int client_init(char *ip, int port)
return -1;
}
- publicServer_get_settingNameRight(name);
+ public_server_get_settingNameRight(name);
proto_send_hello_client(name);
return 0;
diff --git a/src/client/game.c b/src/client/game.c
index 310f1cb..ef4bae8 100644
--- a/src/client/game.c
+++ b/src/client/game.c
@@ -44,7 +44,7 @@
static void initGame()
{
- homeDirector_create();
+ home_director_create();
interface_init();
font_init();
@@ -56,20 +56,20 @@ static void initGame()
music_init();
#endif
screen_init();
- arenaFile_init();
+ arena_file_init();
tux_init();
item_init();
shot_init();
panel_init();
word_init();
- mainMenu_init();
+ main_menu_init();
analyze_init();
- choiceArena_init();
+ choice_arena_init();
setting_init();
- settingKey_int();
- gameType_init();
- downArena_init();
+ setting_key_int();
+ game_type_init();
+ down_arena_init();
scredits_init();
table_init();
browser_init();
@@ -79,13 +79,13 @@ void game_quit()
{
interface_quit();
- mainMenu_quit();
+ main_menu_quit();
analyze_quit();
setting_quit();
- settingKey_quit();
- gameType_quit();
- downArena_quit();
- choiceArena_quit();
+ setting_key_quit();
+ game_type_quit();
+ down_arena_quit();
+ choice_arena_quit();
scredits_quit();
table_quit();
browser_quit();
@@ -93,7 +93,7 @@ void game_quit()
layer_quit();
font_quit();
screen_quit();
- arenaFile_quit();
+ arena_file_quit();
item_quiy();
tux_quit();
shot_quit();
diff --git a/src/client/hotKey.c b/src/client/hotKey.c
index bf8cc96..94d4b24 100644
--- a/src/client/hotKey.c
+++ b/src/client/hotKey.c
@@ -53,13 +53,13 @@ static hotKey_t *findHotkey(SDLKey key)
return NULL;
}
-void hotKey_init()
+void hot_key_init()
{
listHotKey = list_new();
lastActive = timer_get_current_time();
}
-void hotKey_register(SDLKey key, void (*handler) ())
+void hot_key_register(SDLKey key, void (*handler) ())
{
hotKey_t *hotkey;
/*
@@ -71,7 +71,7 @@ void hotKey_register(SDLKey key, void (*handler) ())
list_ins(listHotKey, 0, hotkey);
}
-void unhotKey_register(SDLKey key)
+void unhot_key_register(SDLKey key)
{
hotKey_t *hotkey;
int my_index;
@@ -87,7 +87,7 @@ void unhotKey_register(SDLKey key)
list_del_item(listHotKey, my_index, destroyHotKey);
}
-void hotKey_enable(SDLKey key)
+void hot_key_enable(SDLKey key)
{
hotKey_t *hotkey;
@@ -101,7 +101,7 @@ void hotKey_enable(SDLKey key)
hotkey->active = TRUE;
}
-void hotKey_disable(SDLKey key)
+void hot_key_disable(SDLKey key)
{
hotKey_t *hotkey;
@@ -115,7 +115,7 @@ void hotKey_disable(SDLKey key)
hotkey->active = FALSE;
}
-void hotKey_event()
+void hot_key_event()
{
my_time_t currentTime;
Uint8 *mapa;
@@ -144,7 +144,7 @@ void hotKey_event()
}
}
-void hotKey_quit()
+void hot_key_quit()
{
list_destroy_item(listHotKey, destroyHotKey);
}
diff --git a/src/client/hotKey.h b/src/client/hotKey.h
index 33b1491..91d52df 100644
--- a/src/client/hotKey.h
+++ b/src/client/hotKey.h
@@ -5,12 +5,12 @@
# define HOTKEY_ACTIVE_INTERVAL 500
-extern void hotKey_init();
-extern void hotKey_register(SDLKey key, void (*handler) ());
-extern void unhotKey_register(SDLKey key);
-extern void hotKey_enable(SDLKey key);
-extern void hotKey_disable(SDLKey key);
-extern void hotKey_event();
-extern void hotKey_quit();
+extern void hot_key_init();
+extern void hot_key_register(SDLKey key, void (*handler) ());
+extern void unhot_key_register(SDLKey key);
+extern void hot_key_enable(SDLKey key);
+extern void hot_key_disable(SDLKey key);
+extern void hot_key_event();
+extern void hot_key_quit();
#endif
diff --git a/src/client/interface.c b/src/client/interface.c
index ec87e4f..a3fb535 100644
--- a/src/client/interface.c
+++ b/src/client/interface.c
@@ -151,10 +151,10 @@ int interface_init()
SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL);
timer = SDL_AddTimer(INTERVAL, TimerCallback, NULL);
- keyboardBuffer_init(KEYBOARD_BUFFER_SIZE);
+ keyboard_buffer_init(KEYBOARD_BUFFER_SIZE);
- hotKey_init();
- hotKey_register(SDLK_F1, hotkey_screen);
+ hot_key_init();
+ hot_key_register(SDLK_F1, hotkey_screen);
srand((unsigned) time(NULL));
isInterfaceInit = TRUE;
@@ -272,7 +272,7 @@ int eventAction()
default:
//neni potreba vyuzivat frontu stale
if (keyboardBufferEnabled == TRUE)
- keyboardBuffer_push(event.key.keysym);
+ keyboard_buffer_push(event.key.keysym);
break;
}
break;
@@ -287,7 +287,7 @@ int eventAction()
screen_draw();
screen_event();
- hotKey_event();
+ hot_key_event();
screen_switch();
break;
@@ -335,8 +335,8 @@ void interface_quit()
{
DEBUG_MSG(_("Quitting SDL\n"));
- hotKey_quit();
- keyboardBuffer_quit();
+ hot_key_quit();
+ keyboard_buffer_quit();
SDL_Quit();
diff --git a/src/client/keyboardBuffer.c b/src/client/keyboardBuffer.c
index aff7b67..7a694f3 100644
--- a/src/client/keyboardBuffer.c
+++ b/src/client/keyboardBuffer.c
@@ -23,7 +23,7 @@ static SDL_keysym emptyKey;
/*
* Key buffer initializes. The parameter sets the number of keys.
*/
-void keyboardBuffer_init(int size)
+void keyboard_buffer_init(int size)
{
assert(size > 0);
assert(keyboardBuffer == NULL);
@@ -47,7 +47,7 @@ void keyboardBuffer_init(int size)
/*
* Empty the buffer
*/
-void keyboardBuffer_clear()
+void keyboard_buffer_clear()
{
assert(keyboardBuffer != NULL);
@@ -61,7 +61,7 @@ void keyboardBuffer_clear()
* Adds key to the end of the buffer. If the buffer is overrun,
* an error is printed to stderr and the key is dropped.
*/
-bool_t keyboardBuffer_push(SDL_keysym key)
+bool_t keyboard_buffer_push(SDL_keysym key)
{
assert(keyboardBuffer != NULL);
@@ -86,7 +86,7 @@ bool_t keyboardBuffer_push(SDL_keysym key)
* Takes out first key from the buffer and returns it. If the buffer is empty,
* an error is printed to stderr and SDLK_UNKNOWN is returned.
*/
-SDL_keysym keyboardBuffer_pop()
+SDL_keysym keyboard_buffer_pop()
{
assert(keyboardBuffer != NULL);
@@ -112,7 +112,7 @@ SDL_keysym keyboardBuffer_pop()
/*
* The buffer size
*/
-int keyboardBuffer_get_size()
+int keyboard_buffer_get_size()
{
assert(keyboardBuffer != NULL);
return keyboardBuffer->size;
@@ -121,23 +121,23 @@ int keyboardBuffer_get_size()
/*
* Number of keys in the buffer
*/
-int keyboardBuffer_get_count()
+int keyboard_buffer_get_count()
{
assert(keyboardBuffer != NULL);
return keyboardBuffer->count;
}
-bool_t keyboardBuffer_is_any_key()
+bool_t keyboard_buffer_is_any_key()
{
- return keyboardBuffer_get_count() > 0 ? TRUE : FALSE;
+ return keyboard_buffer_get_count() > 0 ? TRUE : FALSE;
}
/*
* Frees the buffer. If it is not empty, information
* about filling is prined to stderr first.
*/
-void keyboardBuffer_quit()
+void keyboard_buffer_quit()
{
assert(keyboardBuffer != NULL);
diff --git a/src/client/keyboardBuffer.h b/src/client/keyboardBuffer.h
index eb4f307..1810223 100644
--- a/src/client/keyboardBuffer.h
+++ b/src/client/keyboardBuffer.h
@@ -22,13 +22,13 @@ typedef struct {
int end; /* ukazatel na konec bufferu (tj. odkud se odebiraji klavesy) */
} keyboardBuffer_t;
-extern void keyboardBuffer_init(int size);
-extern void keyboardBuffer_clear();
-extern bool_t keyboardBuffer_push(SDL_keysym key);
-extern SDL_keysym keyboardBuffer_pop();
-extern int keyboardBuffer_get_size();
-extern int keyboardBuffer_get_count();
-extern bool_t keyboardBuffer_is_any_key();
-extern void keyboardBuffer_quit();
+extern void keyboard_buffer_init(int size);
+extern void keyboard_buffer_clear();
+extern bool_t keyboard_buffer_push(SDL_keysym key);
+extern SDL_keysym keyboard_buffer_pop();
+extern int keyboard_buffer_get_size();
+extern int keyboard_buffer_get_count();
+extern bool_t keyboard_buffer_is_any_key();
+extern void keyboard_buffer_quit();
#endif /* KEYBOARDBUFFER_H_ */
diff --git a/src/client/pauza.c b/src/client/pauza.c
index ae125d2..a2187d1 100644
--- a/src/client/pauza.c
+++ b/src/client/pauza.c
@@ -34,7 +34,7 @@ void pauza_init()
g_pauza = image_add("pauza.png", IMAGE_ALPHA, "pauza", IMAGE_GROUP_USER);
activePauza = FALSE;
- hotKey_register(SDLK_p, hotkey_pauze);
+ hot_key_register(SDLK_p, hotkey_pauze);
}
void pauza_draw()
@@ -58,5 +58,5 @@ bool_t pauza_is_active()
void pauza_quit()
{
- unhotKey_register(SDLK_p);
+ unhot_key_register(SDLK_p);
}
diff --git a/src/client/saveDialog.c b/src/client/saveDialog.c
index 0ae3554..5e17782 100644
--- a/src/client/saveDialog.c
+++ b/src/client/saveDialog.c
@@ -46,7 +46,7 @@ static void eventWidget(void *p)
button = (widget_t *) p;
if (button == widgetButtonSave) {
- save_arena(textField_get_text(widgetTextFieldName), arena_get_current());
+ save_arena(text_field_get_text(widgetTextFieldName), arena_get_current());
switchTerm();
}
@@ -60,7 +60,7 @@ static void hotkey_saveDialog()
switchTerm();
}
-void saveDialog_init()
+void save_dialog_init()
{
activeSaveDialog = FALSE;
@@ -70,7 +70,7 @@ void saveDialog_init()
SAVE_DIALOG_LOCATIN_Y + 20,
WIDGET_LABEL_LEFT);
- widgetTextFieldName = textField_new("noname", WIDGET_TEXTFIELD_FILTER_ALPHANUM,
+ widgetTextFieldName = text_field_new("noname", WIDGET_TEXTFIELD_FILTER_ALPHANUM,
widgetLabelMsg->x +
widgetLabelMsg->w + 10,
widgetLabelMsg->y);
@@ -84,15 +84,15 @@ void saveDialog_init()
SAVE_DIALOG_LOCATIN_Y + 60,
eventWidget);
- hotKey_register(SDLK_F2, hotkey_saveDialog);
+ hot_key_register(SDLK_F2, hotkey_saveDialog);
}
-bool_t saveDialog_is_active()
+bool_t save_dialog_is_active()
{
return activeSaveDialog;
}
-void saveDialog_draw()
+void save_dialog_draw()
{
if (activeSaveDialog == FALSE) {
return;
@@ -107,29 +107,29 @@ void saveDialog_draw()
SAVE_DIALOG_SIZE_Y);
label_draw(widgetLabelMsg);
- textField_draw(widgetTextFieldName);
+ text_field_draw(widgetTextFieldName);
button_draw(widgetButtonSave);
button_draw(widgetButtonBack);
}
-void saveDialog_event()
+void save_dialog_event()
{
if (activeSaveDialog == FALSE) {
return;
}
- textField_event(widgetTextFieldName);
+ text_field_event(widgetTextFieldName);
button_event(widgetButtonSave);
button_event(widgetButtonBack);
}
-void saveDialog_quit()
+void save_dialog_quit()
{
- unhotKey_register(SDLK_F2);
+ unhot_key_register(SDLK_F2);
label_destroy(widgetLabelMsg);
- textField_destroy(widgetTextFieldName);
+ text_field_destroy(widgetTextFieldName);
button_destroy(widgetButtonSave);
button_destroy(widgetButtonBack);
}
diff --git a/src/client/saveDialog.h b/src/client/saveDialog.h
index a126955..4f9ed0e 100644
--- a/src/client/saveDialog.h
+++ b/src/client/saveDialog.h
@@ -12,10 +12,10 @@
# define SAVE_DIALOG_LOCATIN_Y (WINDOW_SIZE_Y/2 - SAVE_DIALOG_SIZE_Y/2)
-extern void saveDialog_init();
-extern bool_t saveDialog_is_active();
-extern void saveDialog_draw();
-extern void saveDialog_event();
-extern void saveDialog_quit();
+extern void save_dialog_init();
+extern bool_t save_dialog_is_active();
+extern void save_dialog_draw();
+extern void save_dialog_event();
+extern void save_dialog_quit();
#endif
diff --git a/src/client/saveLoad.c b/src/client/saveLoad.c
index cd1b94a..8a4acc3 100644
--- a/src/client/saveLoad.c
+++ b/src/client/saveLoad.c
@@ -65,7 +65,7 @@ static void saveContextArenaToTextFile(textFile_t * textFile, arena_t * arena)
char str[STR_PROTO_SIZE];
sprintf(str, "ARENA %s %d %d",
- arenaFile_get_net_name(choiceArena_get()),
+ arena_file_get_net_name(choice_arena_get()),
arena->countRound, arena->max_countRound);
list_add(textFile->text, strdup(str));
@@ -80,16 +80,16 @@ void save_arena(char *filename, arena_t * arena)
textFile_t *textFile;
char path[STR_PATH_SIZE];
- sprintf(path, "%s/%s.sav", homeDirector_get(), filename);
+ sprintf(path, "%s/%s.sav", home_director_get(), filename);
DEBUG_MSG(_("Saving game to: \"%s\"\n"), path);
- textFile = textFile_new(path);
+ textFile = text_file_new(path);
if (textFile != NULL) {
saveContextArenaToTextFile(textFile, arena);
- textFile_save(textFile);
- textFile_destroy(textFile);
+ text_file_save(textFile);
+ text_file_destroy(textFile);
} else {
fprintf(stderr, _("I was unable to save: \"%s\"\n"), path);
}
@@ -105,7 +105,7 @@ static arena_t *load_arenaFromLine(char *line)
sscanf(line, "%s %s %d %d", cmd, name, &countRound, &max_countRound);
- word_set_arena(arenaFile_get_file_format_net_name(name));
+ word_set_arena(arena_file_get_file_format_net_name(name));
arena = arena_get_current();
arena->max_countRound = max_countRound;
@@ -246,15 +246,15 @@ void load_arena(char *filename)
textFile_t *textFile;
char path[STR_PATH_SIZE];
- sprintf(path, "%s/%s", homeDirector_get(), filename);
+ sprintf(path, "%s/%s", home_director_get(), filename);
DEBUG_MSG(_("Loadig game from file: \"%s\"\n"), path);
- textFile = textFile_load(path);
+ textFile = text_file_load(path);
if (textFile != NULL) {
loadContextArenaFromTextFile(textFile);
- textFile_destroy(textFile);
+ text_file_destroy(textFile);
} else {
fprintf(stderr, _("Unable to load save: \"%s\"\n"), path);
}