summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/base/arena.c10
-rw-r--r--src/base/arena.h2
-rw-r--r--src/base/arenaFile.c72
-rw-r--r--src/base/arenaFile.h30
-rw-r--r--src/base/checkFront.c10
-rw-r--r--src/base/checkFront.h10
-rw-r--r--src/base/downServer.c10
-rw-r--r--src/base/downServer.h8
-rw-r--r--src/base/gun.c8
-rw-r--r--src/base/homeDirector.c4
-rw-r--r--src/base/homeDirector.h4
-rw-r--r--src/base/item.c42
-rw-r--r--src/base/main.c2
-rw-r--r--src/base/modules.c14
-rw-r--r--src/base/modules.h8
-rw-r--r--src/base/net_multiplayer.c10
-rw-r--r--src/base/net_multiplayer.h10
-rw-r--r--src/base/proto.c52
-rw-r--r--src/base/server.c40
-rw-r--r--src/base/serverSendMsg.c4
-rw-r--r--src/base/serverSendMsg.h2
-rw-r--r--src/base/shareFunction.c8
-rw-r--r--src/base/shareFunction.h8
-rw-r--r--src/base/shot.c4
-rw-r--r--src/base/tcp_server.c22
-rw-r--r--src/base/tcp_server.h14
-rw-r--r--src/base/textFile.c12
-rw-r--r--src/base/textFile.h10
-rw-r--r--src/base/tux.c34
-rw-r--r--src/base/udp_server.c16
-rw-r--r--src/base/udp_server.h12
-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
-rw-r--r--src/modules/modAI.c4
-rw-r--r--src/modules/modMove.c14
-rw-r--r--src/modules/modPipe.c10
-rw-r--r--src/modules/modTeleport.c8
-rw-r--r--src/modules/modWall.c2
-rw-r--r--src/screen/analyze.c4
-rw-r--r--src/screen/browser.c8
-rw-r--r--src/screen/choiceArena.c50
-rw-r--r--src/screen/choiceArena.h12
-rw-r--r--src/screen/credits.c8
-rw-r--r--src/screen/downArena.c38
-rw-r--r--src/screen/downArena.h12
-rw-r--r--src/screen/gameType.c108
-rw-r--r--src/screen/gameType.h22
-rw-r--r--src/screen/mainMenu.c20
-rw-r--r--src/screen/mainMenu.h12
-rw-r--r--src/screen/setting.c70
-rw-r--r--src/screen/setting.h6
-rw-r--r--src/screen/settingKeys.c180
-rw-r--r--src/screen/settingKeys.h14
-rw-r--r--src/screen/table.c16
-rw-r--r--src/screen/world.c130
-rw-r--r--src/server/highScore.c20
-rw-r--r--src/server/highScore.h6
-rw-r--r--src/server/publicServer.c56
-rw-r--r--src/server/publicServer.h10
-rw-r--r--src/server/serverConfigFile.c4
-rw-r--r--src/widget/widget_buttonimage.c10
-rw-r--r--src/widget/widget_buttonimage.h10
-rw-r--r--src/widget/widget_catchkey.c12
-rw-r--r--src/widget/widget_catchkey.h12
-rw-r--r--src/widget/widget_choicegroup.c14
-rw-r--r--src/widget/widget_choicegroup.h12
-rw-r--r--src/widget/widget_textfield.c12
-rw-r--r--src/widget/widget_textfield.h12
78 files changed, 811 insertions, 811 deletions
diff --git a/src/base/arena.c b/src/base/arena.c
index e58f8f3..08ee226 100644
--- a/src/base/arena.c
+++ b/src/base/arena.c
@@ -77,12 +77,12 @@ void arena_init()
printf("SCREEN_SPLIT_HORIZONTAL\n");
}
- hotKey_register(SDLK_F3, hotkey_splitArena);
+ hot_key_register(SDLK_F3, hotkey_splitArena);
}
void arena_quit()
{
- unhotKey_register(SDLK_F3);
+ unhot_key_register(SDLK_F3);
}
#endif
@@ -127,7 +127,7 @@ arena_conflict_space(int x1, int y1, int w1, int h1, int x2, int y2, int w2, int
return (x1 < x2 + w2 && x2 < x1 + w1 && y1 < y2 + h2 && y2 < y1 + h1);
}
-int arena__is_free_space(arena_t * arena, int x, int y, int w, int h)
+int arena_is_free_space(arena_t * arena, int x, int y, int w, int h)
{
if (x < 0 || y < 0 || x + w > arena->w || y + h > arena->h) {
return 0;
@@ -162,7 +162,7 @@ void arena_find_free_space(arena_t * arena, int *x, int *y, int w, int h)
do {
z_x = random() % (arena->w - w);
z_y = random() % (arena->h - h);
- } while (arena__is_free_space(arena, z_x, z_y, w, h) == 0);
+ } while (arena_is_free_space(arena, z_x, z_y, w, h) == 0);
*x = z_x;
*y = z_y;
@@ -336,7 +336,7 @@ void drawSimpleArena(arena_t * arena)
void arena_draw(arena_t * arena)
{
if (isBigArena(arena) &&
- netMultiplayer_get_game_type() == NET_GAME_TYPE_NONE && !setting_is_ai()) {
+ net_multiplayer_get_game_type() == NET_GAME_TYPE_NONE && !setting_is_ai()) {
tux_t *tux1;
tux_t *tux2;
diff --git a/src/base/arena.h b/src/base/arena.h
index fbbaede..153fb3b 100644
--- a/src/base/arena.h
+++ b/src/base/arena.h
@@ -45,7 +45,7 @@ extern void arena_quit();
extern arena_t *arena_new(int w, int h);
extern int arena_conflict_space(int x1, int y1, int w1, int h1, int x2, int y2,
int w2, int h2);
-extern int arena__is_free_space(arena_t * arena, int x, int y, int w, int h);
+extern int arena_is_free_space(arena_t * arena, int x, int y, int w, int h);
extern void arena_find_free_space(arena_t * arena, int *x, int *y, int w, int h);
extern void arena_get_center_screen(int *screen_x, int *screen_y, int x, int y,
int screen_size_x, int screen_size_y);
diff --git a/src/base/arenaFile.c b/src/base/arenaFile.c
index a5fa709..4e6ef6f 100644
--- a/src/base/arenaFile.c
+++ b/src/base/arenaFile.c
@@ -29,12 +29,12 @@
static list_t *listArenaFile;
static bool_t isArenaFileInit = FALSE;
-bool_t arenaFile_is_inicialized()
+bool_t arena_file_is_inicialized()
{
return isArenaFileInit;
}
-int arenaFile_get_value(char *line, char *env, char *val, int len)
+int arena_file_get_value(char *line, char *env, char *val, int len)
{
char *offset_env;
char *offset_val_begin;
@@ -73,7 +73,7 @@ int arenaFile_get_value(char *line, char *env, char *val, int len)
#ifndef PUBLIC_SERVER
-image_t *arenaFile_load_image(arenaFile_t * arenaFile, char *filename, char *group, char *name, int alpha)
+image_t *arena_file_load_image(arenaFile_t * arenaFile, char *filename, char *group, char *name, int alpha)
{
char *extractFile;
image_t *image;
@@ -103,13 +103,13 @@ static void cmd_arena(arena_t ** arena, char *line)
char str_w[STR_SIZE];
char str_h[STR_SIZE];
- if (arenaFile_get_value(line, "background", str_image, STR_SIZE) != 0)
+ if (arena_file_get_value(line, "background", str_image, STR_SIZE) != 0)
return;
- if (arenaFile_get_value(line, "w", str_w, STR_SIZE) != 0)
+ if (arena_file_get_value(line, "w", str_w, STR_SIZE) != 0)
return;
- if (arenaFile_get_value(line, "h", str_h, STR_SIZE) != 0)
+ if (arena_file_get_value(line, "h", str_h, STR_SIZE) != 0)
return;
(*arena) = arena_new(atoi(str_w), atoi(str_h));
@@ -127,7 +127,7 @@ static void cmd_module_load(char *line)
{
char str_file[STR_SIZE];
- if (arenaFile_get_value(line, "file", str_file, STR_SIZE) != 0)
+ if (arena_file_get_value(line, "file", str_file, STR_SIZE) != 0)
return;
module_load(str_file);
@@ -141,17 +141,17 @@ static void cmd_loadImage(arenaFile_t * arenaFile, char *line)
char str_name[STR_SIZE];
char str_alpha[STR_SIZE];
- if (arenaFile_get_value(line, "file", str_file, STR_SIZE) != 0)
+ if (arena_file_get_value(line, "file", str_file, STR_SIZE) != 0)
return;
- if (arenaFile_get_value(line, "name", str_name, STR_SIZE) != 0)
+ if (arena_file_get_value(line, "name", str_name, STR_SIZE) != 0)
return;
- if (arenaFile_get_value(line, "alpha", str_alpha, STR_SIZE) != 0)
+ if (arena_file_get_value(line, "alpha", str_alpha, STR_SIZE) != 0)
return;
//printf("str_file=%s str_name=%s str_alpha=%s\n", str_file, str_name, str_alpha);
- arenaFile_load_image(arenaFile, str_file, IMAGE_GROUP_USER, str_name, isYesOrNO(str_alpha));
+ arena_file_load_image(arenaFile, str_file, IMAGE_GROUP_USER, str_name, isYesOrNO(str_alpha));
//image_add(str_file, isYesOrNO(str_alpha), str_name, IMAGE_GROUP_USER);
}
@@ -161,10 +161,10 @@ static void cmd_loadMusic(arenaFile_t * arenaFile, char *line)
char str_file[STR_SIZE];
char str_name[STR_SIZE];
- if (arenaFile_get_value(line, "file", str_file, STR_SIZE) != 0)
+ if (arena_file_get_value(line, "file", str_file, STR_SIZE) != 0)
return;
- if (arenaFile_get_value(line, "name", str_name, STR_SIZE) != 0)
+ if (arena_file_get_value(line, "name", str_name, STR_SIZE) != 0)
return;
#ifndef NO_SOUND
@@ -177,19 +177,19 @@ static void cmd_music_play(arena_t * arena, char *line)
{
char str_music[STR_SIZE];
- if (arenaFile_get_value(line, "music", str_music, STR_SIZE) != 0)
+ if (arena_file_get_value(line, "music", str_music, STR_SIZE) != 0)
return;
strcpy(arena->music, str_music);
}
#endif
-int arenaFile_get_count()
+int arena_file_get_count()
{
return listArenaFile->count;
}
-static char *arenaFile_get_arenaStatus(textFile_t * ts, char *s)
+static char *arena_file_get_arenaStatus(textFile_t * ts, char *s)
{
int len;
int i;
@@ -208,23 +208,23 @@ static char *arenaFile_get_arenaStatus(textFile_t * ts, char *s)
return NULL;
}
-char *arenaFile_get_name(arenaFile_t * arenaFile)
+char *arena_file_get_name(arenaFile_t * arenaFile)
{
char *ret;
- ret = arenaFile_get_arenaStatus(arenaFile->map, "name");
+ ret = arena_file_get_arenaStatus(arenaFile->map, "name");
return (ret != NULL ? ret : "arena_no_name");
}
-char *arenaFile_get_net_name(arenaFile_t * arenaFile)
+char *arena_file_get_net_name(arenaFile_t * arenaFile)
{
char *ret;
- ret = arenaFile_get_arenaStatus(arenaFile->map, "netName");
+ ret = arena_file_get_arenaStatus(arenaFile->map, "netName");
return (ret != NULL ? ret : "arena_no_net_name");
}
-arenaFile_t *arenaFile_get_file_format_net_name(char *s)
+arenaFile_t *arena_file_get_file_format_net_name(char *s)
{
int i;
@@ -233,24 +233,24 @@ arenaFile_t *arenaFile_get_file_format_net_name(char *s)
arenaFile = (arenaFile_t *) listArenaFile->list[i];
- if (strcmp(arenaFile_get_net_name(arenaFile), s) == 0)
+ if (strcmp(arena_file_get_net_name(arenaFile), s) == 0)
return arenaFile;
}
return NULL;
}
-char *arenaFile_get_image(arenaFile_t * arenaFile)
+char *arena_file_get_image(arenaFile_t * arenaFile)
{
- return arenaFile_get_arenaStatus(arenaFile->map, "screen");
+ return arena_file_get_arenaStatus(arenaFile->map, "screen");
}
-arenaFile_t *arenaFile_get(int n)
+arenaFile_t *arena_file_get(int n)
{
return (arenaFile_t *) listArenaFile->list[n];
}
-int arenaFile_get_id(arenaFile_t * arenaFile)
+int arena_file_get_id(arenaFile_t * arenaFile)
{
int i;
@@ -267,7 +267,7 @@ int arenaFile_get_id(arenaFile_t * arenaFile)
return -1;
}
-arena_t *arenaFile_get_arena(arenaFile_t * arenaFile)
+arena_t *arena_file_get_arena(arenaFile_t * arenaFile)
{
textFile_t *ts;
arena_t *arena = NULL; // no warninng
@@ -301,7 +301,7 @@ arena_t *arenaFile_get_arena(arenaFile_t * arenaFile)
return arena;
}
-arenaFile_t *arenaFile_new(char *path)
+arenaFile_t *arena_file_new(char *path)
{
arenaFile_t *new;
char *extractFile;
@@ -310,7 +310,7 @@ arenaFile_t *arenaFile_new(char *path)
new->path = strdup(path);
extractFile = archive_extract_file(path, "arena.map");
- new->map = textFile_load(extractFile);
+ new->map = text_file_load(extractFile);
archive_delete_file(extractFile);
return new;
@@ -318,14 +318,14 @@ arenaFile_t *arenaFile_new(char *path)
void arena_destroyFile(arenaFile_t * p)
{
- textFile_destroy(p->map);
+ text_file_destroy(p->map);
free(p->path);
free(p);
}
-void arenaFile_load(char *path)
+void arena_file_load(char *path)
{
- list_add(listArenaFile, arenaFile_new(path));
+ list_add(listArenaFile, arena_file_new(path));
}
static void load_arenaFromDirector(char *director)
@@ -360,7 +360,7 @@ static void load_arenaFromDirector(char *director)
DEBUG_MSG(_("Loading arena: %s\n"), line);
accessExistFile(path);
- arenaFile_load(path);
+ arena_file_load(path);
}
}
@@ -369,7 +369,7 @@ static void load_arenaFromDirector(char *director)
}
-void arenaFile_init()
+void arena_file_init()
{
#ifndef PUBLIC_SERVER
assert(image_is_inicialized() == TRUE);
@@ -380,11 +380,11 @@ void arenaFile_init()
load_arenaFromDirector(PATH_ARENA);
#ifndef PUBLIC_SERVER
- load_arenaFromDirector(homeDirector_get());
+ load_arenaFromDirector(home_director_get());
#endif
}
-void arenaFile_quit()
+void arena_file_quit()
{
isArenaFileInit = FALSE;
list_destroy_item(listArenaFile, arena_destroyFile);
diff --git a/src/base/arenaFile.h b/src/base/arenaFile.h
index d146664..7de4f3f 100644
--- a/src/base/arenaFile.h
+++ b/src/base/arenaFile.h
@@ -13,23 +13,23 @@ typedef struct {
textFile_t *map;
} arenaFile_t;
-extern bool_t arenaFile_is_inicialized();
-extern int arenaFile_get_value(char *line, char *env, char *val, int len);
-extern int arenaFile_get_count();
-extern char *arenaFile_get_name(arenaFile_t * arenaFile);
-extern char *arenaFile_get_net_name(arenaFile_t * arenaFile);
-extern arenaFile_t *arenaFile_get_file_format_net_name(char *s);
-extern char *arenaFile_get_image(arenaFile_t * arenaFile);
+extern bool_t arena_file_is_inicialized();
+extern int arena_file_get_value(char *line, char *env, char *val, int len);
+extern int arena_file_get_count();
+extern char *arena_file_get_name(arenaFile_t * arenaFile);
+extern char *arena_file_get_net_name(arenaFile_t * arenaFile);
+extern arenaFile_t *arena_file_get_file_format_net_name(char *s);
+extern char *arena_file_get_image(arenaFile_t * arenaFile);
# ifndef PUBLIC_SERVER
-extern image_t *arenaFile_load_image(arenaFile_t * arenaFile, char *filename,
+extern image_t *arena_file_load_image(arenaFile_t * arenaFile, char *filename,
char *group, char *name, int alpha);
# endif
-extern arenaFile_t *arenaFile_get(int n);
-extern int arenaFile_get_id(arenaFile_t * arenaFile);
-extern arena_t *arenaFile_get_arena(arenaFile_t * arenaFile);
-extern arenaFile_t *arenaFile_new(char *path);
-extern void arenaFile_load(char *path);
-extern void arenaFile_init();
-extern void arenaFile_quit();
+extern arenaFile_t *arena_file_get(int n);
+extern int arena_file_get_id(arenaFile_t * arenaFile);
+extern arena_t *arena_file_get_arena(arenaFile_t * arenaFile);
+extern arenaFile_t *arena_file_new(char *path);
+extern void arena_file_load(char *path);
+extern void arena_file_init();
+extern void arena_file_quit();
#endif
diff --git a/src/base/checkFront.c b/src/base/checkFront.c
index 846c3a6..47adda2 100644
--- a/src/base/checkFront.c
+++ b/src/base/checkFront.c
@@ -43,12 +43,12 @@ static void destroyCheck(checkfront_t * p)
free(p);
}
-list_t *checkFront_new()
+list_t *check_front_new()
{
return list_new();
}
-void checkFront_add_msg(list_t * list, char *msg, int type, int id)
+void check_front_add_msg(list_t * list, char *msg, int type, int id)
{
if (type == CHECK_FRONT_TYPE_CHECK)
id_inc(id);
@@ -56,7 +56,7 @@ void checkFront_add_msg(list_t * list, char *msg, int type, int id)
list_add(list, newCheck(msg, type, id));
}
-void checkFront_event(client_t * client)
+void check_front_event(client_t * client)
{
my_time_t currentTime;
int i;
@@ -93,7 +93,7 @@ void checkFront_event(client_t * client)
}
}
-void checkFront_del_msg(list_t * listCheckFront, int id)
+void check_front_del_msg(list_t * listCheckFront, int id)
{
int i;
@@ -110,7 +110,7 @@ void checkFront_del_msg(list_t * listCheckFront, int id)
}
}
-void checkFront_destroy(list_t * p)
+void check_front_destroy(list_t * p)
{
assert(p != NULL);
list_destroy_item(p, destroyCheck);
diff --git a/src/base/checkFront.h b/src/base/checkFront.h
index 4e7781d..2fc73b0 100644
--- a/src/base/checkFront.h
+++ b/src/base/checkFront.h
@@ -12,10 +12,10 @@
# include "list.h"
# include "server.h"
-extern list_t *checkFront_new();
-extern void checkFront_add_msg(list_t * list, char *msg, int type, int id);
-extern void checkFront_event(client_t * client);
-extern void checkFront_del_msg(list_t * listCheckFront, int id);
-extern void checkFront_destroy(list_t * p);
+extern list_t *check_front_new();
+extern void check_front_add_msg(list_t * list, char *msg, int type, int id);
+extern void check_front_event(client_t * client);
+extern void check_front_del_msg(list_t * listCheckFront, int id);
+extern void check_front_destroy(list_t * p);
#endif
diff --git a/src/base/downServer.c b/src/base/downServer.c
index 8575fa5..13bd0ab 100644
--- a/src/base/downServer.c
+++ b/src/base/downServer.c
@@ -65,7 +65,7 @@ static void proto_getarena(client_ds_t *client, char *msg)
arenaName = msg+9;
//printf("arena = >>%s<<\n", arenaName);
- arenaFile = arenaFile_get_file_format_net_name(arenaName);
+ arenaFile = arena_file_get_file_format_net_name(arenaName);
if( arenaFile == NULL )
{
@@ -125,7 +125,7 @@ static void destroyClient(client_ds_t *client)
free(client);
}
-int downServer_init(char *ip4, int port4)
+int down_server_init(char *ip4, int port4)
{
sock_server_tcp = sock_tcp_bind(ip4, port4);
@@ -142,7 +142,7 @@ int downServer_init(char *ip4, int port4)
return 0;
}
-int downServer_set_select()
+int down_server_set_select()
{
int i;
@@ -264,7 +264,7 @@ static void sendFile(client_ds_t *client)
client->send += count;
}
-int downServer_select_socket()
+int down_server_select_socket()
{
int i;
@@ -303,7 +303,7 @@ int downServer_select_socket()
return 0;
}
-int downServer_quit()
+int down_server_quit()
{
sock_tcp_close(sock_server_tcp);
list_destroy_item(listClient, destroyClient);
diff --git a/src/base/downServer.h b/src/base/downServer.h
index 6dea645..da5a698 100644
--- a/src/base/downServer.h
+++ b/src/base/downServer.h
@@ -7,9 +7,9 @@
#include "tcp.h"
#include "buffer.h"
-extern int downServer_init(char *ip4, int port4);
-extern int downServer_set_select();
-extern int downServer_select_socket();
-extern int downServer_quit();
+extern int down_server_init(char *ip4, int port4);
+extern int down_server_set_select();
+extern int down_server_select_socket();
+extern int down_server_quit();
#endif
diff --git a/src/base/gun.c b/src/base/gun.c
index 653a180..6a4ed36 100644
--- a/src/base/gun.c
+++ b/src/base/gun.c
@@ -84,7 +84,7 @@ static void addShot(tux_t * tux, int x, int y, int px, int py)
{
int gun;
- if (netMultiplayer_get_game_type() == NET_GAME_TYPE_CLIENT)
+ if (net_multiplayer_get_game_type() == NET_GAME_TYPE_CLIENT)
return;
if (tux->gun == GUN_BOMBBALL)
@@ -236,17 +236,17 @@ static void putInGunMine(tux_t * tux)
arena = arena_get_current();
- if (arena__is_free_space(arena_get_current(), x, y, ITEM_MINE_WIDTH, ITEM_MINE_HEIGHT)) {
+ if (arena_is_free_space(arena_get_current(), x, y, ITEM_MINE_WIDTH, ITEM_MINE_HEIGHT)) {
item_t *item;
#ifndef NO_SOUND
sound_play("put_mine", SOUND_GROUP_BASE);
#endif
tux->shot[tux->gun]--;
- if (netMultiplayer_get_game_type() != NET_GAME_TYPE_CLIENT) {
+ if (net_multiplayer_get_game_type() != NET_GAME_TYPE_CLIENT) {
item = item_new(x, y, ITEM_MINE, tux->id);
- if (netMultiplayer_get_game_type() == NET_GAME_TYPE_SERVER)
+ if (net_multiplayer_get_game_type() == NET_GAME_TYPE_SERVER)
proto_send_additem_server(PROTO_SEND_ALL, NULL, item);
space_add(arena->spaceItem, item);
diff --git a/src/base/homeDirector.c b/src/base/homeDirector.c
index f78d820..2a7cbfc 100644
--- a/src/base/homeDirector.c
+++ b/src/base/homeDirector.c
@@ -10,7 +10,7 @@
static char homeDirector[STR_PATH_SIZE];
-void homeDirector_create()
+void home_director_create()
{
char *envHome;
#ifndef __WIN32__
@@ -40,7 +40,7 @@ void homeDirector_create()
}
}
-char *homeDirector_get()
+char *home_director_get()
{
return homeDirector;
}
diff --git a/src/base/homeDirector.h b/src/base/homeDirector.h
index f28c7a4..5a9cc98 100644
--- a/src/base/homeDirector.h
+++ b/src/base/homeDirector.h
@@ -5,6 +5,6 @@
# include "main.h"
-extern void homeDirector_create();
-extern char *homeDirector_get();
+extern void home_director_create();
+extern char *home_director_get();
#endif
diff --git a/src/base/item.c b/src/base/item.c
index 0ebeae2..7abdde4 100644
--- a/src/base/item.c
+++ b/src/base/item.c
@@ -180,13 +180,13 @@ void item_add_new_item(space_t * spaceItem, int author_id)
int type;
#ifdef PUBLIC_SERVER
- if (getCountWeaponOrBonusItem(spaceItem) >= atoi(publicServer_get_setting("MAX_ITEM", "--max-item", "100"))) {
+ if (getCountWeaponOrBonusItem(spaceItem) >= atoi(public_server_get_setting("MAX_ITEM", "--max-item", "100"))) {
return;
}
#endif
#ifndef PUBLIC_SERVER
- if (setting_is_any_item() == FALSE || netMultiplayer_get_game_type() == NET_GAME_TYPE_CLIENT) {
+ if (setting_is_any_item() == FALSE || net_multiplayer_get_game_type() == NET_GAME_TYPE_CLIENT) {
return;
}
#endif
@@ -239,16 +239,16 @@ void item_add_new_item(space_t * spaceItem, int author_id)
}
#ifndef PUBLIC_SERVER
} while (setting_is_item(type) == FALSE ||
- (netMultiplayer_get_game_type() == NET_GAME_TYPE_NONE && type == BONUS_HIDDEN));
+ (net_multiplayer_get_game_type() == NET_GAME_TYPE_NONE && type == BONUS_HIDDEN));
#endif
item = item_new(new_x, new_y, type, author_id);
space_add(spaceItem, item);
- if (netMultiplayer_get_game_type() == NET_GAME_TYPE_SERVER)
+ if (net_multiplayer_get_game_type() == NET_GAME_TYPE_SERVER)
proto_send_additem_server(PROTO_SEND_ALL, NULL, item);
#ifndef PUBLIC_SERVER
- if (netMultiplayer_get_game_type() != NET_GAME_TYPE_CLIENT)
+ if (net_multiplayer_get_game_type() != NET_GAME_TYPE_CLIENT)
radar_add(item->id, new_x, new_y, RADAR_TYPE_ITEM);
#endif
}
@@ -326,7 +326,7 @@ void item_event(space_t * spaceItem)
static void mineExplosion(space_t * spaceItem, item_t * item)
{
- if (netMultiplayer_get_game_type() != NET_GAME_TYPE_CLIENT) {
+ if (net_multiplayer_get_game_type() != NET_GAME_TYPE_CLIENT) {
int x, y;
item_t *item_explosion;
@@ -334,16 +334,16 @@ static void mineExplosion(space_t * spaceItem, item_t * item)
y = (item->y + item->h / 2) - ITEM_BIG_EXPLOSION_HEIGHT / 2;
item_explosion = item_new(x, y, ITEM_BIG_EXPLOSION, item->author_id);
- if (netMultiplayer_get_game_type() == NET_GAME_TYPE_SERVER)
+ if (net_multiplayer_get_game_type() == NET_GAME_TYPE_SERVER)
proto_send_additem_server(PROTO_SEND_ALL, NULL, item_explosion);
space_add(spaceItem, item_explosion);
}
- if (netMultiplayer_get_game_type() == NET_GAME_TYPE_SERVER)
+ if (net_multiplayer_get_game_type() == NET_GAME_TYPE_SERVER)
proto_send_del_server(PROTO_SEND_ALL, NULL, item->id);
- if (netMultiplayer_get_game_type() != NET_GAME_TYPE_CLIENT)
+ if (net_multiplayer_get_game_type() != NET_GAME_TYPE_CLIENT)
space_del_with_item(spaceItem, item, item_destroy);
}
@@ -355,7 +355,7 @@ static void action_item(space_t * space, item_t * item, int *isDel)
switch (item->type) {
case ITEM_MINE:
- if (netMultiplayer_get_game_type() != NET_GAME_TYPE_CLIENT)
+ if (net_multiplayer_get_game_type() != NET_GAME_TYPE_CLIENT)
mineExplosion(space, item);
break;
case ITEM_EXPLOSION:
@@ -373,7 +373,7 @@ static void action_shot(space_t * space, shot_t * shot, space_t * spaceItem)
shot->x, shot->y, shot->w, shot->h);
if (isDel) {
- if (netMultiplayer_get_game_type() == NET_GAME_TYPE_SERVER)
+ if (net_multiplayer_get_game_type() == NET_GAME_TYPE_SERVER)
proto_send_del_server(PROTO_SEND_ALL, NULL, shot->id);
space_del_with_item(space, shot, shot_destroy);
@@ -382,7 +382,7 @@ static void action_shot(space_t * space, shot_t * shot, space_t * spaceItem)
void item_event_conglicts_shot_with_item(arena_t * arena)
{
- if (netMultiplayer_get_game_type() == NET_GAME_TYPE_CLIENT)
+ if (net_multiplayer_get_game_type() == NET_GAME_TYPE_CLIENT)
return;
space_action(arena->spaceShot, action_shot, arena->spaceItem);
@@ -401,7 +401,7 @@ static void tux_event_tux_is_deadWithItem(tux_t * tux, item_t * item)
if (item->author_id == tux->id) {
tux->score--;
- if (netMultiplayer_get_game_type() == NET_GAME_TYPE_SERVER)
+ if (net_multiplayer_get_game_type() == NET_GAME_TYPE_SERVER)
proto_send_newtux_server(PROTO_SEND_ALL, NULL, tux);
}
@@ -413,7 +413,7 @@ static void tux_event_tux_is_deadWithItem(tux_t * tux, item_t * item)
if (author != NULL) {
author->score++;
- if (netMultiplayer_get_game_type() == NET_GAME_TYPE_SERVER)
+ if (net_multiplayer_get_game_type() == NET_GAME_TYPE_SERVER)
proto_send_newtux_server(PROTO_SEND_ALL, NULL, author);
}
}
@@ -430,11 +430,11 @@ static void tuxGiveBonus(tux_t * tux, item_t * item)
tux->bonus = item->type;
tux->bonus_time = TUX_MAX_BONUS;
- if (netMultiplayer_get_game_type() == NET_GAME_TYPE_SERVER)
+ if (net_multiplayer_get_game_type() == NET_GAME_TYPE_SERVER)
proto_send_newtux_server(PROTO_SEND_ALL, NULL, tux);
#ifndef PUBLIC_SERVER
- if (netMultiplayer_get_game_type() != NET_GAME_TYPE_CLIENT)
+ if (net_multiplayer_get_game_type() != NET_GAME_TYPE_CLIENT)
radar_del(item->id);
#endif
}
@@ -448,11 +448,11 @@ static void tuxGiveGun(tux_t * tux, item_t * item)
tux->shot[item->type] += GUN_MAX_SHOT;
tux->gun = item->type;
- if (netMultiplayer_get_game_type() == NET_GAME_TYPE_SERVER)
+ if (net_multiplayer_get_game_type() == NET_GAME_TYPE_SERVER)
proto_send_newtux_server(PROTO_SEND_ALL, NULL, tux);
#ifndef PUBLIC_SERVER
- if (netMultiplayer_get_game_type() != NET_GAME_TYPE_CLIENT)
+ if (net_multiplayer_get_game_type() != NET_GAME_TYPE_CLIENT)
radar_del(item->id);
#endif
}
@@ -468,7 +468,7 @@ static void action_giveitem(space_t * space, item_t * item, tux_t * tux)
case GUN_BOMBBALL:
tuxGiveGun(tux, item);
- if (netMultiplayer_get_game_type() == NET_GAME_TYPE_SERVER)
+ if (net_multiplayer_get_game_type() == NET_GAME_TYPE_SERVER)
proto_send_del_server(PROTO_SEND_ALL, NULL, item->id);
space_del_with_item(space, item, item_destroy);
@@ -494,7 +494,7 @@ static void action_giveitem(space_t * space, item_t * item, tux_t * tux)
case BONUS_HIDDEN:
tuxGiveBonus(tux, item);
- if (netMultiplayer_get_game_type() == NET_GAME_TYPE_SERVER)
+ if (net_multiplayer_get_game_type() == NET_GAME_TYPE_SERVER)
proto_send_del_server(PROTO_SEND_ALL, NULL, item->id);
space_del_with_item(space, item, item_destroy);
@@ -512,7 +512,7 @@ void item_tux_give_list_item(tux_t * tux, space_t * spaceItem)
assert(spaceItem != NULL);
assert(tux != NULL);
- if (netMultiplayer_get_game_type() == NET_GAME_TYPE_CLIENT)
+ if (net_multiplayer_get_game_type() == NET_GAME_TYPE_CLIENT)
return;
if (tux->status == TUX_STATUS_DEAD)
diff --git a/src/base/main.c b/src/base/main.c
index b208f2e..9d8600a 100644
--- a/src/base/main.c
+++ b/src/base/main.c
@@ -170,7 +170,7 @@ int main(int argc, char *argv[])
#endif
#ifdef PUBLIC_SERVER
- publicServer_start();
+ public_server_start();
#endif
return 0;
diff --git a/src/base/modules.c b/src/base/modules.c
index 9f2afae..7b0b7c2 100644
--- a/src/base/modules.c
+++ b/src/base/modules.c
@@ -30,11 +30,11 @@ static export_fce_t export_fce = {
.fce_image_get = image_get,
#endif
.fce_module_load_dep = module_load_dep,
- .fce_shareFunction_add = shareFunction_add,
- .fce_shareFunction_get = shareFunction_get,
+ .fce_share_function_add = share_function_add,
+ .fce_share_function_get = share_function_get,
- .fce_getValue = arenaFile_get_value,
- .fce_netMultiplayer_get_game_type = netMultiplayer_get_game_type,
+ .fce_getValue = arena_file_get_value,
+ .fce_net_multiplayer_get_game_type = net_multiplayer_get_game_type,
.fce_tux_get_proportion = tux_get_proportion,
.fce_tux_set_proportion = tux_set_proportion,
.fce_tux_action = tux_action,
@@ -43,7 +43,7 @@ static export_fce_t export_fce = {
.fce_arena_get_current = arena_get_current,
.fce_arena_conflict_space = arena_conflict_space,
- .fce_arena__is_free_space = arena__is_free_space,
+ .fce_arena_is_free_space = arena_is_free_space,
.fce_arena_find_free_space = arena_find_free_space,
.fce_proto_send_module_server = proto_send_module_server,
@@ -189,7 +189,7 @@ static int destroyModule(module_t * p)
void module_init()
{
listModule = list_new();
- shareFunction_init();
+ share_function_init();
}
int isModuleLoaded(char *name)
@@ -304,5 +304,5 @@ int module_recv_msg(char *msg)
void module_quit()
{
list_destroy_item(listModule, destroyModule);
- shareFunction_quit();
+ share_function_quit();
}
diff --git a/src/base/modules.h b/src/base/modules.h
index 95d6e98..152ce14 100644
--- a/src/base/modules.h
+++ b/src/base/modules.h
@@ -28,10 +28,10 @@ typedef struct export_fce_s {
int w, int h, int player);
# endif
- int (*fce_netMultiplayer_get_game_type) ();
+ int (*fce_net_multiplayer_get_game_type) ();
int (*fce_module_load_dep) (char *name);
- void (*fce_shareFunction_add) (char *name, void *function);
- void *(*fce_shareFunction_get) (char *name);
+ void (*fce_share_function_add) (char *name, void *function);
+ void *(*fce_share_function_get) (char *name);
void (*fce_tux_get_proportion) (tux_t * tux, int *x, int *y, int *w, int *h);
void (*fce_tux_set_proportion) (tux_t * tux, int x, int y);
@@ -41,7 +41,7 @@ typedef struct export_fce_s {
arena_t *(*fce_arena_get_current) ();
int (*fce_arena_conflict_space) (int x1, int y1, int w1, int h1, int x2, int y2,
int w2, int h2);
- int (*fce_arena__is_free_space) (arena_t * arena, int x, int y, int w, int h);
+ int (*fce_arena_is_free_space) (arena_t * arena, int x, int y, int w, int h);
void (*fce_arena_find_free_space) (arena_t * arena, int *x, int *y, int w, int h);
void (*fce_proto_send_module_server) (int type, client_t * client,
char *msg);
diff --git a/src/base/net_multiplayer.c b/src/base/net_multiplayer.c
index 62f298b..68b19d7 100644
--- a/src/base/net_multiplayer.c
+++ b/src/base/net_multiplayer.c
@@ -24,12 +24,12 @@
static int netGameType;
-int netMultiplayer_get_game_type()
+int net_multiplayer_get_game_type()
{
return netGameType;
}
-int netMultiplayer_init_for_game_server(char *ip4, int port4, char *ip6, int port6)
+int net_multiplayer_init_for_game_server(char *ip4, int port4, char *ip6, int port6)
{
int ret;
@@ -42,7 +42,7 @@ int netMultiplayer_init_for_game_server(char *ip4, int port4, char *ip6, int por
return ret;
}
-int netMultiplayer_init(int type, char *ip, int port, int proto)
+int net_multiplayer_init(int type, char *ip, int port, int proto)
{
netGameType = type;
@@ -86,7 +86,7 @@ int netMultiplayer_init(int type, char *ip, int port, int proto)
return 0;
}
-void netMultiplayer_event()
+void net_multiplayer_event()
{
switch (netGameType) {
case NET_GAME_TYPE_NONE:
@@ -107,7 +107,7 @@ void netMultiplayer_event()
}
}
-void netMultiplayer_quit()
+void net_multiplayer_quit()
{
switch (netGameType) {
case NET_GAME_TYPE_NONE:
diff --git a/src/base/net_multiplayer.h b/src/base/net_multiplayer.h
index c11a168..8d5ab46 100644
--- a/src/base/net_multiplayer.h
+++ b/src/base/net_multiplayer.h
@@ -28,12 +28,12 @@
# define NET_MASTER_PORT 6800
# ifdef PUBLIC_SERVER
-extern int netMultiplayer_init_for_game_server(char *ip4, int port4, char *ip6, int port6);
+extern int net_multiplayer_init_for_game_server(char *ip4, int port4, char *ip6, int port6);
# endif
-extern int netMultiplayer_init(int type, char *ip, int port, int proto);
-extern int netMultiplayer_get_game_type();
-extern void netMultiplayer_event();
-extern void netMultiplayer_quit();
+extern int net_multiplayer_init(int type, char *ip, int port, int proto);
+extern int net_multiplayer_get_game_type();
+extern void net_multiplayer_event();
+extern void net_multiplayer_quit();
#endif
diff --git a/src/base/proto.c b/src/base/proto.c
index be54593..326e92d 100644
--- a/src/base/proto.c
+++ b/src/base/proto.c
@@ -44,7 +44,7 @@ void proto_send_error_server(int type, client_t * client, int errorcode)
snprintf(msg, STR_PROTO_SIZE, "error %d\n", errorcode);
- sendMsg_to_client(type, client, msg, CHECK_FRONT_TYPE_SIMPLE, CHECK_FRONT_ID_NONE);
+ send_msg_to_client(type, client, msg, CHECK_FRONT_TYPE_SIMPLE, CHECK_FRONT_ID_NONE);
}
#ifndef PUBLIC_SERVER
@@ -157,7 +157,7 @@ void proto_recv_hello_server(client_t * client, char *msg)
if (space_get_count(arena_get_current()->spaceTux) + 1 > server_get_max_clients()) {
proto_send_error_server(PROTO_SEND_ONE, client, PROTO_ERROR_LIMIT_MAX_CLIENT);
- checkFront_event(client);
+ check_front_event(client);
client->status = NET_STATUS_ZOMBIE;
return;
}
@@ -167,7 +167,7 @@ void proto_recv_hello_server(client_t * client, char *msg)
#ifdef PUBLIC_SERVER
if (supportVersion == NULL) {
- supportVersion = publicServer_get_setting("SUPPORT_CLIENTS", "--support-clients", TUXANCI_VERSION);
+ supportVersion = public_server_get_setting("SUPPORT_CLIENTS", "--support-clients", TUXANCI_VERSION);
}
#endif
@@ -185,7 +185,7 @@ void proto_recv_hello_server(client_t * client, char *msg)
if (strstr(supportVersion, version) == NULL) {
proto_send_error_server(PROTO_SEND_ONE, client, PROTO_ERROR_CODE_BAD_VERSION);
- checkFront_event(client);
+ check_front_event(client);
client->status = NET_STATUS_ZOMBIE;
return;
}
@@ -219,14 +219,14 @@ void proto_send_status_server(int type, client_t * client)
#endif
#ifdef PUBLIC_SERVER
- name = publicServer_get_setting("NAME", "--name", "noname");
+ name = public_server_get_setting("NAME", "--name", "noname");
#endif
version = TUXANCI_VERSION;
clients = arena_get_current()->spaceTux->listIndex->count;
maxclients = server_get_max_clients();
uptime = (unsigned int) server_get_update();
- arena = arenaFile_get_net_name(choiceArena_get());
+ arena = arena_file_get_net_name(choice_arena_get());
snprintf(msg, STR_PROTO_SIZE,
"name: %s\n"
@@ -236,7 +236,7 @@ void proto_send_status_server(int type, client_t * client)
"uptime: %d\n"
"arena: %s\n", name, version, clients, maxclients, uptime, arena);
- sendMsg_to_client(type, client, msg, CHECK_FRONT_TYPE_SIMPLE, CHECK_FRONT_ID_NONE);
+ send_msg_to_client(type, client, msg, CHECK_FRONT_TYPE_SIMPLE, CHECK_FRONT_ID_NONE);
//proto_send(type, client, msg);
}
@@ -257,7 +257,7 @@ void proto_send_listscore_server(int type, client_t * client, int max)
strcpy(msg, "");
for (i = 0; i < max; i++) {
- str = highScore_get_table(i);
+ str = high_score_get_table(i);
if (str == NULL) {
break;
@@ -268,7 +268,7 @@ void proto_send_listscore_server(int type, client_t * client, int max)
}
//proto_send(type, client, msg);
- sendMsg_to_client(type, client, msg, CHECK_FRONT_TYPE_SIMPLE, CHECK_FRONT_ID_NONE);
+ send_msg_to_client(type, client, msg, CHECK_FRONT_TYPE_SIMPLE, CHECK_FRONT_ID_NONE);
free(msg);
}
@@ -317,7 +317,7 @@ void proto_recv_check_server(client_t * client, char *msg)
return;
}
- checkFront_del_msg(client->listSendMsg, id);
+ check_front_del_msg(client->listSendMsg, id);
}
void proto_send_init_server(int type, client_t * client, client_t * client2)
@@ -331,17 +331,17 @@ void proto_send_init_server(int type, client_t * client, client_t * client2)
count = WORLD_COUNT_ROUND_UNLIMITED;
#ifndef PUBLIC_SERVER
- publicServer_get_settingCountRound(&count);
+ public_server_get_settingCountRound(&count);
#endif
check_id = id_get_newcount(0);
snprintf(msg, STR_PROTO_SIZE, "init %d %d %d %d %s %d\n",
client2->tux->id, client2->tux->x, client2->tux->y,
- count, arenaFile_get_net_name(choiceArena_get()), check_id);
+ count, arena_file_get_net_name(choice_arena_get()), check_id);
//proto_send(type, client, msg);
- sendMsg_to_client(type, client, msg, CHECK_FRONT_TYPE_CHECK, check_id);
+ send_msg_to_client(type, client, msg, CHECK_FRONT_TYPE_CHECK, check_id);
}
#ifndef PUBLIC_SERVER
@@ -372,7 +372,7 @@ void proto_recv_init_client(char *msg)
return;
}
- word_set_arena(arenaFile_get_file_format_net_name(arena_name));
+ word_set_arena(arena_file_get_file_format_net_name(arena_name));
arena = arena_get_current();
arena->max_countRound = n;
@@ -384,7 +384,7 @@ void proto_recv_init_client(char *msg)
tux->control = TUX_CONTROL_KEYBOARD_RIGHT;
word_set_control_tux(tux, TUX_CONTROL_KEYBOARD_RIGHT);
- publicServer_get_settingNameRight(tux->name);
+ public_server_get_settingNameRight(tux->name);
space_add(arena->spaceTux, tux);
}
@@ -399,7 +399,7 @@ proto_send_event_server(int type, client_t * client, tux_t * tux, int action)
snprintf(msg, STR_PROTO_SIZE, "event %d %d\n", tux->id, action);
//proto_send(type, client, msg);
- sendMsg_to_client(type, client, msg, CHECK_FRONT_TYPE_SIMPLE, CHECK_FRONT_ID_NONE);
+ send_msg_to_client(type, client, msg, CHECK_FRONT_TYPE_SIMPLE, CHECK_FRONT_ID_NONE);
}
#ifndef PUBLIC_SERVER
@@ -491,7 +491,7 @@ void proto_send_newtux_server(int type, client_t * client, tux_t * tux)
tux->shot[GUN_BOMBBALL], tux->bonus_time, tux->pickup_time);
//proto_send(type, client, msg);
- sendMsg_to_client(type, client, msg, CHECK_FRONT_TYPE_SIMPLE,
+ send_msg_to_client(type, client, msg, CHECK_FRONT_TYPE_SIMPLE,
CHECK_FRONT_ID_NONE);
}
@@ -578,7 +578,7 @@ void proto_send_kill_server(int type, client_t * client, tux_t * tux)
snprintf(msg, STR_PROTO_SIZE, "kill %d\n", tux->id);
//proto_send(type, client, msg);
- sendMsg_to_client(type, client, msg, CHECK_FRONT_TYPE_SIMPLE, CHECK_FRONT_ID_NONE);
+ send_msg_to_client(type, client, msg, CHECK_FRONT_TYPE_SIMPLE, CHECK_FRONT_ID_NONE);
}
#ifndef PUBLIC_SERVER
@@ -616,7 +616,7 @@ void proto_send_del_server(int type, client_t * client, int id)
snprintf(msg, STR_PROTO_SIZE, "del %d %d\n", id, check_id);
- sendMsg_to_client(type, client, msg, CHECK_FRONT_TYPE_CHECK, check_id);
+ send_msg_to_client(type, client, msg, CHECK_FRONT_TYPE_CHECK, check_id);
//proto_check(type, client, msg, check_id);
}
@@ -704,7 +704,7 @@ void proto_send_additem_server(int type, client_t * client, item_t * p)
//proto_send(type, client, msg);
//proto_check(type, client, msg, check_id);
- sendMsg_to_client(type, client, msg, CHECK_FRONT_TYPE_CHECK, check_id);
+ send_msg_to_client(type, client, msg, CHECK_FRONT_TYPE_CHECK, check_id);
}
#ifndef PUBLIC_SERVER
@@ -764,7 +764,7 @@ void proto_send_shot_server(int type, client_t * client, shot_t * p)
//proto_send(type, client, msg);
//proto_check(type, client, msg, check_id);
- sendMsg_to_client(type, client, msg, CHECK_FRONT_TYPE_SIMPLE, CHECK_FRONT_ID_NONE);
+ send_msg_to_client(type, client, msg, CHECK_FRONT_TYPE_SIMPLE, CHECK_FRONT_ID_NONE);
}
#ifndef PUBLIC_SERVER
@@ -836,7 +836,7 @@ void proto_recv_chat_server(client_t * client, char *msg)
void proto_send_chat_server(int type, client_t * client, char *msg)
{
- sendMsg_to_client(type, client, msg, CHECK_FRONT_TYPE_SIMPLE, CHECK_FRONT_ID_NONE);
+ send_msg_to_client(type, client, msg, CHECK_FRONT_TYPE_SIMPLE, CHECK_FRONT_ID_NONE);
#ifndef PUBLIC_SERVER
proto_recv_chat_client(msg);
@@ -892,7 +892,7 @@ void proto_send_module_server(int type, client_t * client, char *msg)
strcat(out, "\n");
*/
- sendMsg_to_client(type, client, out, CHECK_FRONT_TYPE_SIMPLE, CHECK_FRONT_ID_NONE);
+ send_msg_to_client(type, client, out, CHECK_FRONT_TYPE_SIMPLE, CHECK_FRONT_ID_NONE);
}
#ifndef PUBLIC_SERVER
@@ -924,7 +924,7 @@ void proto_send_ping_server(int type, client_t * client)
char msg[STR_PROTO_SIZE];
snprintf(msg, STR_PROTO_SIZE, "ping\n");
//proto_send(type, client, msg);
- sendMsg_to_client(type, client, msg, CHECK_FRONT_TYPE_SIMPLE, CHECK_FRONT_ID_NONE);
+ send_msg_to_client(type, client, msg, CHECK_FRONT_TYPE_SIMPLE, CHECK_FRONT_ID_NONE);
}
#ifndef PUBLIC_SERVER
@@ -946,7 +946,7 @@ void proto_send_echo_server(int type, client_t * client, char *s)
snprintf(msg, STR_PROTO_SIZE, "echo%s", s);
//proto_send(type, client, msg);
- sendMsg_to_client(type, client, msg, CHECK_FRONT_TYPE_SIMPLE, CHECK_FRONT_ID_NONE);
+ send_msg_to_client(type, client, msg, CHECK_FRONT_TYPE_SIMPLE, CHECK_FRONT_ID_NONE);
}
void proto_send_end_server(int type, client_t * client)
@@ -955,7 +955,7 @@ void proto_send_end_server(int type, client_t * client)
snprintf(msg, STR_PROTO_SIZE, "end\n");
//proto_send(type, client, msg);
- sendMsg_to_client(type, client, msg, CHECK_FRONT_TYPE_SIMPLE, CHECK_FRONT_ID_NONE);
+ send_msg_to_client(type, client, msg, CHECK_FRONT_TYPE_SIMPLE, CHECK_FRONT_ID_NONE);
}
#ifndef PUBLIC_SERVER
diff --git a/src/base/server.c b/src/base/server.c
index ec1a920..16162d0 100644
--- a/src/base/server.c
+++ b/src/base/server.c
@@ -117,7 +117,7 @@ client_t *server_new_any_client()
new->status = NET_STATUS_OK;
new->listRecvMsg = list_new();
- new->listSendMsg = checkFront_new();
+ new->listSendMsg = check_front_new();
new->listSeesShot = list_new();
new->protect = newProtect();
@@ -128,10 +128,10 @@ void server_destroy_any_client(client_t * p)
{
assert(p != NULL);
- //checkFront_event(p);
+ //check_front_event(p);
list_destroy_item(p->listRecvMsg, free);
list_destroy_item(p->listSeesShot, free);
- checkFront_destroy(p->listSendMsg);
+ check_front_destroy(p->listSendMsg);
destroyProtect(p->protect);
@@ -153,7 +153,7 @@ static void eventDelClientFromListClient(client_t * client)
assert(offset != -1);
- list_del_item(listClient, offset, serverUdp_destroy_client);
+ list_del_item(listClient, offset, server_udp_destroy_client);
}
static void delZombieCLient(void *p_nothink)
@@ -169,7 +169,7 @@ static void delZombieCLient(void *p_nothink)
if (isDown(thisClient->protect) == TRUE) {
proto_send_end_server(PROTO_SEND_ONE, thisClient);
- checkFront_event(thisClient);
+ check_front_event(thisClient);
thisClient->status = NET_STATUS_ZOMBIE;
}
@@ -239,7 +239,7 @@ int server_init(char *ip4, int port4, char *ip6, int port6)
server_set_time();
//printf("%s %d %s %d\n", ip4, port4, ip6, port6);
- ret = serverUdp_init(ip4, port4, ip6, port6);
+ ret = server_udp_init(ip4, port4, ip6, port6);
if (ret == 0) {
return -1;
@@ -247,11 +247,11 @@ int server_init(char *ip4, int port4, char *ip6, int port6)
if( ip4 != NULL )
{
- downServer_init(ip4, port4);
+ down_server_init(ip4, port4);
}
else if( ip6 != NULL )
{
- downServer_init(ip6, port6);
+ down_server_init(ip6, port6);
}
return ret;
@@ -334,7 +334,7 @@ static void porcesListClients()
thisClient = (client_t *) listClient->list[i];
client_eventWorkRecvList(thisClient);
- checkFront_event(thisClient);
+ check_front_event(thisClient);
}
}
@@ -346,13 +346,13 @@ void server_event()
do {
select_restart();
- serverUdp_set_select();
- downServer_set_select();
+ server_udp_set_select();
+ down_server_set_select();
select_action();
- count = serverUdp_select_sock();
- downServer_select_socket();
+ count = server_udp_select_sock();
+ down_server_select_socket();
} while (count > 0);
#endif
@@ -361,14 +361,14 @@ void server_event()
select_restart();
- serverUdp_set_select();
- downServer_set_select();
+ server_udp_set_select();
+ down_server_set_select();
ret = select_action();
if (ret > 0) {
- serverUdp_select_sock();
- downServer_select_socket();
+ server_udp_select_sock();
+ down_server_select_socket();
}
#endif
@@ -382,11 +382,11 @@ void server_quit()
assert(listClient != NULL);
- list_destroy_item(listClient, serverUdp_destroy_client);
+ list_destroy_item(listClient, server_udp_destroy_client);
timer_destroy(listServerTimer);
- serverUdp_quit();
+ server_udp_quit();
- downServer_quit();
+ down_server_quit();
}
diff --git a/src/base/serverSendMsg.c b/src/base/serverSendMsg.c
index 53afb8b..b1a9559 100644
--- a/src/base/serverSendMsg.c
+++ b/src/base/serverSendMsg.c
@@ -20,7 +20,7 @@ static void addMsgClient(client_t * p, char *msg, int type, int id)
assert(msg != NULL);
if (p->status != NET_STATUS_ZOMBIE) {
- checkFront_add_msg(p->listSendMsg, msg, type, id);
+ check_front_add_msg(p->listSendMsg, msg, type, id);
}
}
@@ -106,7 +106,7 @@ static void addMsgAllClientSeesTux(char *msg, tux_t * tux, int type, int id)
list_destroy(listHelp);
}
-void sendMsg_to_client(int type, client_t * client, char *msg, int type2, int id)
+void send_msg_to_client(int type, client_t * client, char *msg, int type2, int id)
{
assert(msg != NULL);
diff --git a/src/base/serverSendMsg.h b/src/base/serverSendMsg.h
index 8239c7d..a4506cd 100644
--- a/src/base/serverSendMsg.h
+++ b/src/base/serverSendMsg.h
@@ -10,7 +10,7 @@
# define PROTO_SEND_BUT 3
# define PROTO_SEND_ALL_SEES_TUX 4
-extern void sendMsg_to_client(int type, client_t * client, char *msg, int type2,
+extern void send_msg_to_client(int type, client_t * client, char *msg, int type2,
int id);
#endif
diff --git a/src/base/shareFunction.c b/src/base/shareFunction.c
index 5d16dd0..52fc48a 100644
--- a/src/base/shareFunction.c
+++ b/src/base/shareFunction.c
@@ -31,19 +31,19 @@ static void destroyShareFce(share_fce_item_t * p)
free(p);
}
-void shareFunction_init()
+void share_function_init()
{
listShareFce = list_new();
}
-void shareFunction_add(char *name, void *function)
+void share_function_add(char *name, void *function)
{
DEBUG_MSG(_("Adding \"%s\" to share function.\n"), name);
list_add(listShareFce, newShareFceItem(name, function));
}
-void *shareFunction_get(char *name)
+void *share_function_get(char *name)
{
int i;
@@ -59,7 +59,7 @@ void *shareFunction_get(char *name)
return NULL;
}
-void shareFunction_quit()
+void share_function_quit()
{
list_destroy_item(listShareFce, destroyShareFce);
}
diff --git a/src/base/shareFunction.h b/src/base/shareFunction.h
index 80384a4..43d2ff3 100644
--- a/src/base/shareFunction.h
+++ b/src/base/shareFunction.h
@@ -2,8 +2,8 @@
#ifndef SHARE_FUNCTION_H
# define SHARE_FUNCTION_H
-extern void shareFunction_init();
-extern void shareFunction_add(char *name, void *function);
-extern void *shareFunction_get(char *name);
-extern void shareFunction_quit();
+extern void share_function_init();
+extern void share_function_add(char *name, void *function);
+extern void *share_function_get(char *name);
+extern void share_function_quit();
#endif
diff --git a/src/base/shot.c b/src/base/shot.c
index 38ebe5e..5d55f82 100644
--- a/src/base/shot.c
+++ b/src/base/shot.c
@@ -213,7 +213,7 @@ void shot_bound_bombBall(shot_t * shot)
shot->py = getRandomCourse(shot->py, +10);
shot->isCanKillAuthor = 1;
- if (netMultiplayer_get_game_type() == NET_GAME_TYPE_SERVER) {
+ if (net_multiplayer_get_game_type() == NET_GAME_TYPE_SERVER) {
proto_send_shot_server(PROTO_SEND_ALL, NULL, shot);
}
}
@@ -309,7 +309,7 @@ void shot_check_is_tux_screen(arena_t * arena)
list_t *listClient;
int i;
- if (netMultiplayer_get_game_type() != NET_GAME_TYPE_SERVER) {
+ if (net_multiplayer_get_game_type() != NET_GAME_TYPE_SERVER) {
return;
}
diff --git a/src/base/tcp_server.c b/src/base/tcp_server.c
index 6910b10..1635c1a 100644
--- a/src/base/tcp_server.c
+++ b/src/base/tcp_server.c
@@ -46,7 +46,7 @@
static sock_tcp_t *sock_server_tcp;
static sock_tcp_t *sock_server_tcp_second;
-client_t *serverTcp_new_client(sock_tcp_t * sock_tcp)
+client_t *server_tcp_new_client(sock_tcp_t * sock_tcp)
{
client_t *new;
@@ -71,7 +71,7 @@ client_t *serverTcp_new_client(sock_tcp_t * sock_tcp)
return new;
}
-void serverTcp_send_client_buffer(client_t * client)
+void server_tcp_send_client_buffer(client_t * client)
{
void *data;
int len;
@@ -96,10 +96,10 @@ void serverTcp_send_client_buffer(client_t * client)
buffer_cut(client->sendBuffer, res);
}
-void serverTcp_destroy_client(client_t * client)
+void server_tcp_destroy_client(client_t * client)
{
- checkFront_event(client);
- serverTcp_send_client_buffer(client);
+ check_front_event(client);
+ server_tcp_send_client_buffer(client);
#ifdef PUBLIC_SERVER
char str_log[STR_LOG_SIZE];
@@ -118,7 +118,7 @@ void serverTcp_destroy_client(client_t * client)
server_destroy_any_client(client);
}
-int serverTcp_init(char *ip4, int port4, char *ip6, int port6)
+int server_tcp_init(char *ip4, int port4, char *ip6, int port6)
{
int ret;
@@ -167,7 +167,7 @@ static void eventNewClient(sock_tcp_t * server_sock)
sock_tcp_diable_nagle(sock);
sock_tcp_set_non_block(sock);
- client = serverTcp_new_client(sock);
+ client = server_tcp_new_client(sock);
list_add(listClient, client);
}
@@ -196,7 +196,7 @@ static void eventTcpClient(client_t * client)
}
}
-void serverTcp_set_select()
+void server_tcp_set_select()
{
list_t *listClient;
int i;
@@ -224,7 +224,7 @@ void serverTcp_set_select()
}
}
-int serverTcp_select_sock()
+int server_tcp_select_sock()
{
list_t *listClient;
int count;
@@ -266,7 +266,7 @@ int serverTcp_select_sock()
if( select_is_change_sock_for_write(client->socket_tcp->sock) )
{
//printf("select_is_change_sock_for_write\n");
- serverTcp_send_client_buffer(client);
+ server_tcp_send_client_buffer(client);
count++;
}
*/
@@ -275,7 +275,7 @@ int serverTcp_select_sock()
return count;
}
-void serverTcp_quit()
+void server_tcp_quit()
{
if (sock_server_tcp != NULL) {
DEBUG_MSG(_("Closing port: \"%d\"\n"), sock_tcp_get_port(sock_server_tcp));
diff --git a/src/base/tcp_server.h b/src/base/tcp_server.h
index 8fdbedf..e206402 100644
--- a/src/base/tcp_server.h
+++ b/src/base/tcp_server.h
@@ -8,12 +8,12 @@
# define SERVER_TCP_BUFFER_LIMIT 4096
-extern client_t *serverTcp_new_client(sock_tcp_t * sock_tcp);
-extern void serverTcp_destroy_client(client_t * p);
-extern int serverTcp_init(char *ip4, int port4, char *ip6, int port6);
-extern void serverTcp_set_select();
-extern int serverTcp_select_sock();
-extern void serverTcp_send_client_buffer(client_t * p);
-extern void serverTcp_quit();
+extern client_t *server_tcp_new_client(sock_tcp_t * sock_tcp);
+extern void server_tcp_destroy_client(client_t * p);
+extern int server_tcp_init(char *ip4, int port4, char *ip6, int port6);
+extern void server_tcp_set_select();
+extern int server_tcp_select_sock();
+extern void server_tcp_send_client_buffer(client_t * p);
+extern void server_tcp_quit();
#endif
diff --git a/src/base/textFile.c b/src/base/textFile.c
index 5420e34..c09c879 100644
--- a/src/base/textFile.c
+++ b/src/base/textFile.c
@@ -9,7 +9,7 @@
#include "main.h"
#include "textFile.h"
-textFile_t *textFile_new(char *s)
+textFile_t *text_file_new(char *s)
{
textFile_t *new;
char path[STR_PATH_SIZE];
@@ -68,7 +68,7 @@ static void createLine(list_t * list, char *p, int len)
* Nacita subor *s a vrati ho f
* formatovany v type textFile_t*
*/
-textFile_t *textFile_load(char *s)
+textFile_t *text_file_load(char *s)
{
FILE *file;
textFile_t *ret;
@@ -99,7 +99,7 @@ textFile_t *textFile_load(char *s)
fclose(file);
- ret = textFile_new(s);
+ ret = text_file_new(s);
createLine(ret->text, p, file_length);
free(p);
@@ -111,7 +111,7 @@ textFile_t *textFile_load(char *s)
* Zobrazi text ulozeny v *p
* do stdout
*/
-void textFile_print(textFile_t * p)
+void text_file_print(textFile_t * p)
{
int i;
@@ -124,7 +124,7 @@ void textFile_print(textFile_t * p)
}
}
-void textFile_save(textFile_t * p)
+void text_file_save(textFile_t * p)
{
int i;
FILE *file;
@@ -144,7 +144,7 @@ void textFile_save(textFile_t * p)
* Uvolni text ulozeny v type textFile_t*
* z pamate.
*/
-void textFile_destroy(textFile_t * p)
+void text_file_destroy(textFile_t * p)
{
assert(p != NULL);
diff --git a/src/base/textFile.h b/src/base/textFile.h
index 5af95e9..1ccad7e 100644
--- a/src/base/textFile.h
+++ b/src/base/textFile.h
@@ -14,11 +14,11 @@ typedef struct str_textFile_t {
list_t *text;
} textFile_t;
-extern textFile_t *textFile_new(char *s);
-extern textFile_t *textFile_load(char *s);
-extern void textFile_print(textFile_t * p);
-extern void textFile_save(textFile_t * p);
-extern void textFile_destroy(textFile_t * p);
+extern textFile_t *text_file_new(char *s);
+extern textFile_t *text_file_load(char *s);
+extern void text_file_print(textFile_t * p);
+extern void text_file_save(textFile_t * p);
+extern void text_file_destroy(textFile_t * p);
#endif
diff --git a/src/base/tux.c b/src/base/tux.c
index 26f8cbb..aafc4fd 100644
--- a/src/base/tux.c
+++ b/src/base/tux.c
@@ -169,7 +169,7 @@ void tux_draw(tux_t * tux)
assert(tux != NULL);
if (tux->bonus == BONUS_HIDDEN &&
- netMultiplayer_get_game_type() != NET_GAME_TYPE_NONE &&
+ net_multiplayer_get_game_type() != NET_GAME_TYPE_NONE &&
tux->control == TUX_CONTROL_NET) {
return;
}
@@ -268,7 +268,7 @@ static void timer_spawnTux(void *p)
item_add_new_item(arena->spaceItem, ID_UNKNOWN);
- if (netMultiplayer_get_game_type() == NET_GAME_TYPE_SERVER) {
+ if (net_multiplayer_get_game_type() == NET_GAME_TYPE_SERVER) {
proto_send_newtux_server(PROTO_SEND_ALL, NULL, tux);
}
}
@@ -327,12 +327,12 @@ void tux_event_tux_is_dead(tux_t * tux)
tux->isCanShot = TRUE;
tux->isCanSwitchGun = TRUE;
- if (netMultiplayer_get_game_type() != NET_GAME_TYPE_CLIENT) {
+ if (net_multiplayer_get_game_type() != NET_GAME_TYPE_CLIENT) {
timer_add_task(arena_get_current()->listTimer, TIMER_ONE,
timer_spawnTux, newInt(tux->id), TUX_TIME_SPAWN);
}
- if (netMultiplayer_get_game_type() == NET_GAME_TYPE_SERVER) {
+ if (net_multiplayer_get_game_type() == NET_GAME_TYPE_SERVER) {
proto_send_kill_server(PROTO_SEND_ALL, NULL, tux);
}
}
@@ -342,7 +342,7 @@ static void tux_event_tux_is_deadWIthShot(tux_t * tux, shot_t * shot)
if (shot->author_id == tux->id) {
tux->score--;
- if (netMultiplayer_get_game_type() == NET_GAME_TYPE_SERVER) {
+ if (net_multiplayer_get_game_type() == NET_GAME_TYPE_SERVER) {
proto_send_newtux_server(PROTO_SEND_ALL, NULL, tux);
}
}
@@ -355,7 +355,7 @@ static void tux_event_tux_is_deadWIthShot(tux_t * tux, shot_t * shot)
if (author != NULL) {
author->score++;
- if (netMultiplayer_get_game_type() == NET_GAME_TYPE_SERVER) {
+ if (net_multiplayer_get_game_type() == NET_GAME_TYPE_SERVER) {
proto_send_newtux_server(PROTO_SEND_ALL, NULL, author);
}
}
@@ -374,13 +374,13 @@ void tux_teleport(tux_t * tux)
sound_play("teleport", SOUND_GROUP_BASE);
#endif
- if (netMultiplayer_get_game_type() != NET_GAME_TYPE_CLIENT) {
+ if (net_multiplayer_get_game_type() != NET_GAME_TYPE_CLIENT) {
arena_find_free_space(arena_get_current(), &x, &y, TUX_WIDTH, TUX_HEIGHT);
space_move_object(arena_get_current()->spaceTux, tux, x, y);
//tux_set_proportion(tux, x, y);
}
- if (netMultiplayer_get_game_type() == NET_GAME_TYPE_SERVER) {
+ if (net_multiplayer_get_game_type() == NET_GAME_TYPE_SERVER) {
proto_send_newtux_server(PROTO_SEND_ALL, NULL, tux);
}
}
@@ -397,7 +397,7 @@ static void bombBallExplosion(shot_t * shot)
space_add(arena_get_current()->spaceItem, item);
- if (netMultiplayer_get_game_type() == NET_GAME_TYPE_SERVER) {
+ if (net_multiplayer_get_game_type() == NET_GAME_TYPE_SERVER) {
proto_send_del_server(PROTO_SEND_ALL, NULL, shot->id);
proto_send_additem_server(PROTO_SEND_ALL, NULL, item);
}
@@ -422,19 +422,19 @@ static void action_tux(space_t * space, tux_t * tux, shot_t * shot)
}
if (shot->gun == GUN_BOMBBALL) {
- if (netMultiplayer_get_game_type() != NET_GAME_TYPE_CLIENT) {
+ if (net_multiplayer_get_game_type() != NET_GAME_TYPE_CLIENT) {
bombBallExplosion(shot);
}
return;
}
- if (netMultiplayer_get_game_type() != NET_GAME_TYPE_CLIENT) {
+ if (net_multiplayer_get_game_type() != NET_GAME_TYPE_CLIENT) {
tux_event_tux_is_deadWIthShot(tux, shot);
}
}
- if (netMultiplayer_get_game_type() == NET_GAME_TYPE_SERVER) {
+ if (net_multiplayer_get_game_type() == NET_GAME_TYPE_SERVER) {
proto_send_del_server(PROTO_SEND_ALL, NULL, shot->id);
}
@@ -448,7 +448,7 @@ static void action_shot(space_t * space, shot_t * shot, space_t * spaceTux)
void tux_conflict_woth_shot(arena_t * arena)
{
- if (netMultiplayer_get_game_type() == NET_GAME_TYPE_CLIENT) { // na skusku
+ if (net_multiplayer_get_game_type() == NET_GAME_TYPE_CLIENT) { // na skusku
return;
}
@@ -607,7 +607,7 @@ static void pickUpGun(tux_t * tux)
tux->pickup_time++;
}
- if (tux->pickup_time == TUX_MAX_PICKUP && netMultiplayer_get_game_type() != NET_GAME_TYPE_CLIENT) {
+ if (tux->pickup_time == TUX_MAX_PICKUP && net_multiplayer_get_game_type() != NET_GAME_TYPE_CLIENT) {
#ifndef NO_SOUND
sound_play("switch_gun", SOUND_GROUP_BASE);
#endif
@@ -616,7 +616,7 @@ static void pickUpGun(tux_t * tux)
tux->shot[tux->gun] = GUN_MAX_SHOT;
tux->pickup_time = 0;
- if (netMultiplayer_get_game_type() == NET_GAME_TYPE_SERVER) {
+ if (net_multiplayer_get_game_type() == NET_GAME_TYPE_SERVER) {
proto_send_newtux_server(PROTO_SEND_ALL, NULL, tux);
}
}
@@ -630,7 +630,7 @@ static void eventBonus(tux_t * tux)
tux->bonus_time--;
}
- if (tux->bonus_time == 0 && netMultiplayer_get_game_type() != NET_GAME_TYPE_CLIENT) {
+ if (tux->bonus_time == 0 && net_multiplayer_get_game_type() != NET_GAME_TYPE_CLIENT) {
if (tux->bonus == BONUS_GHOST) {
int x, y, w, h;
tux_get_proportion(tux, &x, &y, &w, &h);
@@ -646,7 +646,7 @@ static void eventBonus(tux_t * tux)
tux->bonus = BONUS_NONE;
- if (netMultiplayer_get_game_type() == NET_GAME_TYPE_SERVER) {
+ if (net_multiplayer_get_game_type() == NET_GAME_TYPE_SERVER) {
proto_send_newtux_server(PROTO_SEND_ALL, NULL, tux);
}
}
diff --git a/src/base/udp_server.c b/src/base/udp_server.c
index 3128992..5033162 100644
--- a/src/base/udp_server.c
+++ b/src/base/udp_server.c
@@ -46,7 +46,7 @@
static sock_udp_t *sock_server_udp;
static sock_udp_t *sock_server_udp_second;
-client_t *serverUdp_new_client(sock_udp_t * sock_udp)
+client_t *server_udp_new_client(sock_udp_t * sock_udp)
{
client_t *new;
@@ -68,9 +68,9 @@ client_t *serverUdp_new_client(sock_udp_t * sock_udp)
return new;
}
-void serverUdp_destroy_client(client_t * p)
+void server_udp_destroy_client(client_t * p)
{
- checkFront_event(p);
+ check_front_event(p);
#ifdef PUBLIC_SERVER
char str_log[STR_LOG_SIZE];
@@ -86,7 +86,7 @@ void serverUdp_destroy_client(client_t * p)
server_destroy_any_client(p);
}
-int serverUdp_init(char *ip4, int port4, char *ip6, int port6)
+int server_udp_init(char *ip4, int port4, char *ip6, int port6)
{
int ret;
@@ -126,7 +126,7 @@ static void eventCreateNewUdpClient(sock_udp_t * socket_udp)
listClient = server_get_list_clients();
- client = serverUdp_new_client(socket_udp);
+ client = server_udp_new_client(socket_udp);
list_add(listClient, client);
}
@@ -196,7 +196,7 @@ static void client_eventUdpSelect(sock_udp_t * sock_server)
list_add(client->listRecvMsg, strdup(listRecvMsg));
}
-void serverUdp_set_select()
+void server_udp_set_select()
{
if (sock_server_udp != NULL) {
select_add_sock_for_read(sock_server_udp->sock);
@@ -207,7 +207,7 @@ void serverUdp_set_select()
}
}
-int serverUdp_select_sock()
+int server_udp_select_sock()
{
int count;
@@ -230,7 +230,7 @@ int serverUdp_select_sock()
return count;
}
-void serverUdp_quit()
+void server_udp_quit()
{
if (sock_server_udp != NULL) {
DEBUG_MSG(_("Closing port: \"%d\"\n"), sock_udp_get_port(sock_server_udp));
diff --git a/src/base/udp_server.h b/src/base/udp_server.h
index 4d0245c..9565aee 100644
--- a/src/base/udp_server.h
+++ b/src/base/udp_server.h
@@ -6,11 +6,11 @@
# include "server.h"
# include "udp.h"
-extern client_t *serverUdp_new_client(sock_udp_t * sock_udp);
-extern void serverUdp_destroy_client(client_t * p);
-extern int serverUdp_init(char *ip4, int port4, char *ip6, int port6);
-extern void serverUdp_set_select();
-extern int serverUdp_select_sock();
-extern void serverUdp_quit();
+extern client_t *server_udp_new_client(sock_udp_t * sock_udp);
+extern void server_udp_destroy_client(client_t * p);
+extern int server_udp_init(char *ip4, int port4, char *ip6, int port6);
+extern void server_udp_set_select();
+extern int server_udp_select_sock();
+extern void server_udp_quit();
#endif
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);
}
diff --git a/src/modules/modAI.c b/src/modules/modAI.c
index e8b5172..f084933 100644
--- a/src/modules/modAI.c
+++ b/src/modules/modAI.c
@@ -263,7 +263,7 @@ static void tux_eventAI(tux_t * tux)
moveAlternative(this, w * 2);
- if (export_fce->fce_arena__is_free_space(arena, this->x, this->y, w, h) == 1) {
+ if (export_fce->fce_arena_is_free_space(arena, this->x, this->y, w, h) == 1) {
forkAlternative(listFork, this, 2 * w, 2 * h);
countFork++;
continue;
@@ -281,7 +281,7 @@ static void tux_eventAI(tux_t * tux)
break;
}
- if (export_fce->fce_arena__is_free_space(arena, this->x, this->y, w, h) == 0) {
+ if (export_fce->fce_arena_is_free_space(arena, this->x, this->y, w, h) == 0) {
//forkAlternative(listFork, this, w*2, h*2);
list_del_item(listAlternative, my_index, destroyAlternative);
my_index--;
diff --git a/src/modules/modMove.c b/src/modules/modMove.c
index deaf71e..552e6bd 100644
--- a/src/modules/modMove.c
+++ b/src/modules/modMove.c
@@ -29,7 +29,7 @@ static void move_tux(tux_t * tux, int x, int y, int w, int h)
int dist_x = 0, dist_y = 0; // no warnning
if (tux->bonus == BONUS_GHOST ||
- export_fce->fce_netMultiplayer_get_game_type() == NET_GAME_TYPE_CLIENT)
+ export_fce->fce_net_multiplayer_get_game_type() == NET_GAME_TYPE_CLIENT)
return;
switch (tux->position) {
case TUX_UP:
@@ -53,14 +53,14 @@ static void move_tux(tux_t * tux, int x, int y, int w, int h)
break;
}
if (export_fce->
- fce_arena__is_free_space(export_fce->fce_arena_get_current(), dist_x, dist_y,
+ fce_arena_is_free_space(export_fce->fce_arena_get_current(), dist_x, dist_y,
TUX_WIDTH, TUX_HEIGHT)) {
space_move_object(export_fce->fce_arena_get_current()->spaceTux, tux,
dist_x, dist_y);
#ifndef PUBLIC_SERVER
//sound_play("teleport", SOUND_GROUP_BASE);
#endif
- if (export_fce->fce_netMultiplayer_get_game_type() == NET_GAME_TYPE_SERVER) {
+ if (export_fce->fce_net_multiplayer_get_game_type() == NET_GAME_TYPE_SERVER) {
char msg[STR_PROTO_SIZE];
sprintf(msg, "movetux %d %d %d", tux->id, dist_x, dist_y);
if (tux->bonus == BONUS_HIDDEN)
@@ -159,7 +159,7 @@ move_shot(shot_t * shot, int position, int src_x, int src_y,
space_move_object(export_fce->fce_arena_get_current()->spaceShot, shot,
new_x, new_y);
- if (export_fce->fce_netMultiplayer_get_game_type() == NET_GAME_TYPE_SERVER) {
+ if (export_fce->fce_net_multiplayer_get_game_type() == NET_GAME_TYPE_SERVER) {
char msg[STR_PROTO_SIZE];
sprintf(msg, "moveshot %d %d %d %d %d %d",
@@ -172,8 +172,8 @@ move_shot(shot_t * shot, int position, int src_x, int src_y,
int init(export_fce_t * p)
{
export_fce = p;
- export_fce->fce_shareFunction_add("move_tux", (void *) move_tux);
- export_fce->fce_shareFunction_add("move_shot", (void *) move_shot);
+ export_fce->fce_share_function_add("move_tux", (void *) move_tux);
+ export_fce->fce_share_function_add("move_shot", (void *) move_shot);
return 0;
}
@@ -247,7 +247,7 @@ void cmdArena(char *line)
void recvMsg(char *msg)
{
- if (export_fce->fce_netMultiplayer_get_game_type() == NET_GAME_TYPE_SERVER)
+ if (export_fce->fce_net_multiplayer_get_game_type() == NET_GAME_TYPE_SERVER)
return;
if (strncmp(msg, "movetux", 7) == 0)
diff --git a/src/modules/modPipe.c b/src/modules/modPipe.c
index 455bdce..1759fc5 100644
--- a/src/modules/modPipe.c
+++ b/src/modules/modPipe.c
@@ -210,7 +210,7 @@ int init(export_fce_t * p)
return -1;
}
- if ((fce_move_shot = export_fce->fce_shareFunction_get("move_shot")) == NULL) {
+ if ((fce_move_shot = export_fce->fce_share_function_get("move_shot")) == NULL) {
return -1;
}
@@ -277,11 +277,11 @@ static void action_eventpipe(space_t * space, pipe_t * pipe, shot_t * shot)
}
if (negPosition(shot->position) == pipe->position &&
- export_fce->fce_netMultiplayer_get_game_type() != NET_GAME_TYPE_CLIENT) {
+ export_fce->fce_net_multiplayer_get_game_type() != NET_GAME_TYPE_CLIENT) {
moveShotFromPipe(shot, pipe);
} else {
if (shot->gun == GUN_BOMBBALL &&
- export_fce->fce_netMultiplayer_get_game_type() != NET_GAME_TYPE_CLIENT) {
+ export_fce->fce_net_multiplayer_get_game_type() != NET_GAME_TYPE_CLIENT) {
export_fce->fce_shot_bound_bombBall(shot);
} else {
//space_del_with_item(arena->spaceShot, shot, export_fce->fce_shot_destroy);
@@ -323,7 +323,7 @@ action_eventshot(space_t * space, shot_t * shot, space_t * p_spacePipe)
shot->y, shot->w, shot->h);
if (shot->del == TRUE) {
- if (netMultiplayer_get_game_type() == NET_GAME_TYPE_SERVER) {
+ if (net_multiplayer_get_game_type() == NET_GAME_TYPE_SERVER) {
proto_send_del_server(PROTO_SEND_ALL, NULL, shot->id);
}
@@ -338,7 +338,7 @@ int event()
}
// na skusku
- if (export_fce->fce_netMultiplayer_get_game_type() == NET_GAME_TYPE_CLIENT) {
+ if (export_fce->fce_net_multiplayer_get_game_type() == NET_GAME_TYPE_CLIENT) {
return 0;
}
diff --git a/src/modules/modTeleport.c b/src/modules/modTeleport.c
index b7079ee..4d3a9ca 100644
--- a/src/modules/modTeleport.c
+++ b/src/modules/modTeleport.c
@@ -204,7 +204,7 @@ static void teleportTux(tux_t * tux, teleport_t * teleport)
teleport_t *distTeleport;
if (tux->bonus == BONUS_GHOST ||
- export_fce->fce_netMultiplayer_get_game_type() == NET_GAME_TYPE_CLIENT) {
+ export_fce->fce_net_multiplayer_get_game_type() == NET_GAME_TYPE_CLIENT) {
return;
}
@@ -236,11 +236,11 @@ int init(export_fce_t * p)
return -1;
}
- if ((fce_move_tux = export_fce->fce_shareFunction_get("move_tux")) == NULL) {
+ if ((fce_move_tux = export_fce->fce_share_function_get("move_tux")) == NULL) {
return -1;
}
- if ((fce_move_shot = export_fce->fce_shareFunction_get("move_shot")) == NULL) {
+ if ((fce_move_shot = export_fce->fce_share_function_get("move_shot")) == NULL) {
return -1;
}
@@ -316,7 +316,7 @@ int event()
return 0;
}
- if (export_fce->fce_netMultiplayer_get_game_type() == NET_GAME_TYPE_CLIENT) {
+ if (export_fce->fce_net_multiplayer_get_game_type() == NET_GAME_TYPE_CLIENT) {
return 0;
}
diff --git a/src/modules/modWall.c b/src/modules/modWall.c
index b6fb54e..966edcd 100644
--- a/src/modules/modWall.c
+++ b/src/modules/modWall.c
@@ -285,7 +285,7 @@ static void action_eventwall(space_t * space, wall_t * wall, shot_t * shot)
}
if (shot->gun == GUN_BOMBBALL) {
- if (export_fce->fce_netMultiplayer_get_game_type() != NET_GAME_TYPE_CLIENT) {
+ if (export_fce->fce_net_multiplayer_get_game_type() != NET_GAME_TYPE_CLIENT) {
export_fce->fce_shot_bound_bombBall(shot);
}
diff --git a/src/screen/analyze.c b/src/screen/analyze.c
index 306c7bd..eb20faf 100644
--- a/src/screen/analyze.c
+++ b/src/screen/analyze.c
@@ -60,7 +60,7 @@ void analyze_start()
music_play("menu", MUSIC_GROUP_BASE);
#endif
- hotKey_register(SDLK_ESCAPE, hotkey_escape);
+ hot_key_register(SDLK_ESCAPE, hotkey_escape);
}
void analyze_draw()
@@ -94,7 +94,7 @@ void analyze_stop()
label_destroy(widgetLabelMsg);
widgetLabelMsg = label_new("", WINDOW_SIZE_X / 2, 250, WIDGET_LABEL_CENTER);
- unhotKey_register(SDLK_ESCAPE);
+ unhot_key_register(SDLK_ESCAPE);
}
static void eventWidget(void *p)
diff --git a/src/screen/browser.c b/src/screen/browser.c
index 9e4db3a..a971ba4 100644
--- a/src/screen/browser.c
+++ b/src/screen/browser.c
@@ -83,7 +83,7 @@ void browser_start()
music_play("menu", MUSIC_GROUP_BASE);
#endif
- hotKey_register(SDLK_ESCAPE, hotkey_escape);
+ hot_key_register(SDLK_ESCAPE, hotkey_escape);
LoadServers();
}
@@ -124,7 +124,7 @@ void browser_stop()
//select_server->list = list_new();
select_remove_all(select_server);
- unhotKey_register(SDLK_ESCAPE);
+ unhot_key_register(SDLK_ESCAPE);
while (1) {
i = 0;
@@ -175,8 +175,8 @@ static void eventWidget(void *p)
char *address = (char *) inet_ntoa(srv);
setSettingGameType(NET_GAME_TYPE_CLIENT);
- gameType_set_ip(address);
- gameType_set_port(server->port);
+ game_type_set_ip(address);
+ game_type_set_port(server->port);
screen_set("world");
}
diff --git a/src/screen/choiceArena.c b/src/screen/choiceArena.c
index 9e0d72a..4a633be 100644
--- a/src/screen/choiceArena.c
+++ b/src/screen/choiceArena.c
@@ -56,10 +56,10 @@ void screen_startChoiceArena()
music_play("menu", MUSIC_GROUP_BASE);
#endif
- hotKey_register(SDLK_ESCAPE, hotkey_escape);
+ hot_key_register(SDLK_ESCAPE, hotkey_escape);
}
-void choiceArena_draw()
+void choice_arena_draw()
{
int i;
@@ -71,11 +71,11 @@ void choiceArena_draw()
if (show_map_buttons.prev) { button_draw(button_prev); }
for (i = show_map_buttons.min ; i < show_map_buttons.max; i++) {
- buttonImage_draw((widget_t*)listAllWidgetButtonimage->list[i]);
+ button_image_draw((widget_t*)listAllWidgetButtonimage->list[i]);
}
}
-void choiceArena_event()
+void choice_arena_event()
{
int i;
@@ -85,13 +85,13 @@ void choiceArena_event()
if (show_map_buttons.prev) { button_event(button_prev); }
for (i = show_map_buttons.min ; i < show_map_buttons.max; i++) {
- buttonImage_event((widget_t*)listAllWidgetButtonimage->list[i]);
+ button_image_event((widget_t*)listAllWidgetButtonimage->list[i]);
}
}
void stopScreenChoiceArena()
{
- unhotKey_register(SDLK_ESCAPE);
+ unhot_key_register(SDLK_ESCAPE);
}
static void button_eventImage(void *p)
@@ -107,30 +107,30 @@ static void button_eventImage(void *p)
this = (widget_t *) (listAllWidgetButtonimage->list[i]);
if (buttonimage == this) {
- buttonImage_set_active(this, TRUE);
- currentArena = arenaFile_get(i);
+ button_image_set_active(this, TRUE);
+ currentArena = arena_file_get(i);
} else {
- buttonImage_set_active(this, FALSE);
+ button_image_set_active(this, FALSE);
}
}
}
-arenaFile_t *choiceArena_get()
+arenaFile_t *choice_arena_get()
{
return currentArena;
}
-void choiceArena_set(arenaFile_t * arenaFile)
+void choice_arena_set(arenaFile_t * arenaFile)
{
widget_t *widget_buttonimage;
int id;
- id = arenaFile_get_id(arenaFile);
+ id = arena_file_get_id(arenaFile);
currentArena = arenaFile;
if (id >= 0) {
widget_buttonimage = (widget_t *) listAllWidgetButtonimage->list[id];
- buttonImage_set_active(widget_buttonimage, TRUE);
+ button_image_set_active(widget_buttonimage, TRUE);
}
}
@@ -168,18 +168,18 @@ static void eventWidget(void *p)
static void activateHandledMapButtonGroup(void) {
int min = handled_map_button_group * 6;
min = min < 0 ? 0 : min;
- min = min <= arenaFile_get_count() ? min : arenaFile_get_count();
- int max = min+6 <= arenaFile_get_count() ? min+6 : arenaFile_get_count();
+ min = min <= arena_file_get_count() ? min : arena_file_get_count();
+ int max = min+6 <= arena_file_get_count() ? min+6 : arena_file_get_count();
if (min) { show_map_buttons.prev = 1; }
else { show_map_buttons.prev = 0; }
- if (max < arenaFile_get_count()) { show_map_buttons.next = 1; }
+ if (max < arena_file_get_count()) { show_map_buttons.next = 1; }
else { show_map_buttons.next = 0; }
show_map_buttons.min = min;
show_map_buttons.max = max;
}
-void choiceArena_init()
+void choice_arena_init()
{
image_t *image;
int i;
@@ -196,14 +196,14 @@ void choiceArena_init()
listAllWidgetButtonimage = list_new();
currentArena = NULL;
- for (i = 0; i < arenaFile_get_count(); i++) {
+ for (i = 0; i < arena_file_get_count(); i++) {
widget_t *widget_buttonimage;
arenaFile_t *arenaFile;
int x, y;
- arenaFile = arenaFile_get(i);
- //image = image_add(arenaFile_get_image(i), IMAGE_NO_ALPHA, "none", IMAGE_GROUP_BASE);
- image = arenaFile_load_image(arenaFile, arenaFile_get_image(arenaFile),
+ arenaFile = arena_file_get(i);
+ //image = image_add(arena_file_get_image(i), IMAGE_NO_ALPHA, "none", IMAGE_GROUP_BASE);
+ image = arena_file_load_image(arenaFile, arena_file_get_image(arenaFile),
IMAGE_GROUP_BASE, "none", IMAGE_NO_ALPHA);
// only 6 map buttons can be shown at once;
@@ -214,7 +214,7 @@ void choiceArena_init()
x = 100 + 200 * (pos - 3 * (pos / 3));
y = 150 + 200 * (pos / 3);
- widget_buttonimage = buttonImage_new(image, x, y, button_eventImage);
+ widget_buttonimage = button_image_new(image, x, y, button_eventImage);
/*
if( i == choiceArenaId )
{
@@ -227,11 +227,11 @@ void choiceArena_init()
}
screen_register( screen_new("chiceArena", screen_startChoiceArena,
- choiceArena_event, choiceArena_draw,
+ choice_arena_event, choice_arena_draw,
stopScreenChoiceArena));
}
-void choiceArena_quit()
+void choice_arena_quit()
{
wid_image_destroy(image_backgorund);
@@ -241,5 +241,5 @@ void choiceArena_quit()
button_destroy(button_next);
button_destroy(button_prev);
- list_destroy_item(listAllWidgetButtonimage, buttonImage_destroy);
+ list_destroy_item(listAllWidgetButtonimage, button_image_destroy);
}
diff --git a/src/screen/choiceArena.h b/src/screen/choiceArena.h
index 163ab60..b0e1ce4 100644
--- a/src/screen/choiceArena.h
+++ b/src/screen/choiceArena.h
@@ -9,11 +9,11 @@
# define SCREENSHOT_ARENA_WIDTH 160
# define SCREENSHOT_ARENA_HEIGHT 107
-extern void choiceArena_draw();
-extern void choiceArena_event();
-extern arenaFile_t *choiceArena_get();
-extern void choiceArena_set(arenaFile_t * arenaFile);
-extern void choiceArena_init();
-extern void choiceArena_quit();
+extern void choice_arena_draw();
+extern void choice_arena_event();
+extern arenaFile_t *choice_arena_get();
+extern void choice_arena_set(arenaFile_t * arenaFile);
+extern void choice_arena_init();
+extern void choice_arena_quit();
#endif
diff --git a/src/screen/credits.c b/src/screen/credits.c
index c9521b1..52e5959 100644
--- a/src/screen/credits.c
+++ b/src/screen/credits.c
@@ -41,7 +41,7 @@ void scredits_start()
#endif
offset = 0;
- hotKey_register(SDLK_ESCAPE, hotkey_escape);
+ hot_key_register(SDLK_ESCAPE, hotkey_escape);
}
void scredits_draw()
@@ -86,7 +86,7 @@ void scredits_event()
void scredits_stop()
{
- unhotKey_register(SDLK_ESCAPE);
+ unhot_key_register(SDLK_ESCAPE);
}
static void eventWidget(void *p)
@@ -115,7 +115,7 @@ void scredits_init()
if (tryExistFile(PATH_DOC SCREEN_CREDITS_FILE) == 0) {
creditExists = 1;
- textFile = textFile_load(PATH_DOC SCREEN_CREDITS_FILE);
+ textFile = text_file_load(PATH_DOC SCREEN_CREDITS_FILE);
for (i = 0; i < textFile->text->count; i++) {
widget_t *label;
@@ -158,6 +158,6 @@ void scredits_quit()
list_destroy_item(listWidgetLabel, label_destroy);
if (creditExists) {
- textFile_destroy(textFile);
+ text_file_destroy(textFile);
}
}
diff --git a/src/screen/downArena.c b/src/screen/downArena.c
index 7752513..9daf051 100644
--- a/src/screen/downArena.c
+++ b/src/screen/downArena.c
@@ -62,11 +62,11 @@ static void connectToDownServer()
char status[STR_SIZE];
char msg[STR_PROTO_SIZE];
- sock_server_tcp = sock_tcp_connect(publicServer_get_settingIP(), publicServer_get_settingPort());
+ sock_server_tcp = sock_tcp_connect(public_server_get_settingIP(), public_server_get_settingPort());
if( sock_server_tcp == NULL )
{
- sprintf(status, "I do not connect to %s %d TCP down server", publicServer_get_settingIP(), publicServer_get_settingPort());
+ sprintf(status, "I do not connect to %s %d TCP down server", public_server_get_settingIP(), public_server_get_settingPort());
setStatusString(status);
return;
}
@@ -85,7 +85,7 @@ static void connectToDownServer()
buffer_append(sendBuffer, msg, strlen(msg));
- sprintf(status, "Connect to %s %d TCP down server", publicServer_get_settingIP(), publicServer_get_settingPort());
+ sprintf(status, "Connect to %s %d TCP down server", public_server_get_settingIP(), public_server_get_settingPort());
setStatusString(status);
}
@@ -106,7 +106,7 @@ static void sendStatusToGameServer()
if( countSendMsg > DOWN_ARENA_MAX_SEND_MSG_STATUS )
{
char status[STR_SIZE];
- sprintf(status, "Game server %s %d is down", publicServer_get_settingIP(), publicServer_get_settingPort());
+ sprintf(status, "Game server %s %d is down", public_server_get_settingIP(), public_server_get_settingPort());
setStatusString(status);
return;
}
@@ -118,36 +118,36 @@ static void sendStatusToGameServer()
if( sock_udp_write(sock_server_udp, sock_server_udp, msg, strlen(msg)) < 0 )
{
char status[STR_SIZE];
- sprintf(status, "I do not send message to %s %d UDP game server", publicServer_get_settingIP(), publicServer_get_settingPort());
+ sprintf(status, "I do not send message to %s %d UDP game server", public_server_get_settingIP(), public_server_get_settingPort());
setStatusString(status);
}
}
-void downArena_start()
+void down_arena_start()
{
char status[STR_SIZE];
strcpy(str_status, "none");
memset(arenaNetName, 0, STR_SIZE);
- sock_server_udp = sock_udp_connect(publicServer_get_settingIP(), publicServer_get_settingPort());
+ sock_server_udp = sock_udp_connect(public_server_get_settingIP(), public_server_get_settingPort());
if (sock_server_udp == NULL)
{
- sprintf(status, "I do not connect to %s %d UDP game server", publicServer_get_settingIP(), publicServer_get_settingPort());
+ sprintf(status, "I do not connect to %s %d UDP game server", public_server_get_settingIP(), public_server_get_settingPort());
setStatusString(status);
return;
}
sock_udp_set_non_block(sock_server_udp);
- sprintf(status, "Connect to %s %d UDP game server", publicServer_get_settingIP(), publicServer_get_settingPort());
+ sprintf(status, "Connect to %s %d UDP game server", public_server_get_settingIP(), public_server_get_settingPort());
setStatusString(status);
sendStatusToGameServer();
}
-void downArena_draw()
+void down_arena_draw()
{
wid_image_draw(image_backgorund);
label_draw(label_status);
@@ -160,7 +160,7 @@ static void proto_ok(char *line)
fileSize = atoi(line + 3);
fileOffset = 0;
- sprintf(path, "%s/%s.zip", homeDirector_get(), arenaNetName);
+ sprintf(path, "%s/%s.zip", home_director_get(), arenaNetName);
//printf("path = %s\n", path);
file = fopen(path, "wb");
}
@@ -281,7 +281,7 @@ static void readArenaFromStatus()
sock_server_udp = NULL;
strncpy(arenaNetName, offset_begin, offset_end - offset_begin);
- if (arenaFile_get_file_format_net_name(arenaNetName) != NULL) {
+ if (arena_file_get_file_format_net_name(arenaNetName) != NULL) {
screen_set("world");
return;
}
@@ -307,7 +307,7 @@ static void eventStatus()
}
}
-void downArena_event()
+void down_arena_event()
{
int i;
@@ -331,14 +331,14 @@ void downArena_event()
fclose(file);
file = NULL;
closeConnectFromDownServer();
- arenaFile_load(path);
+ arena_file_load(path);
screen_set("world");
}
button_event(button_back);
}
-void downArena_stop()
+void down_arena_stop()
{
if (file != NULL) {
unlink(path);
@@ -365,7 +365,7 @@ static void eventWidget(void *p)
}
}
-void downArena_init()
+void down_arena_init()
{
image_t *image;
@@ -379,11 +379,11 @@ void downArena_init()
label_status =
label_new("none", WINDOW_SIZE_X / 2, 250, WIDGET_LABEL_CENTER);
- screen_register( screen_new("downArena", downArena_start, downArena_event,
- downArena_draw, downArena_stop));
+ screen_register( screen_new("downArena", down_arena_start, down_arena_event,
+ down_arena_draw, down_arena_stop));
}
-void downArena_quit()
+void down_arena_quit()
{
wid_image_destroy(image_backgorund);
button_destroy(button_back);
diff --git a/src/screen/downArena.h b/src/screen/downArena.h
index 2ce5f07..c71a556 100644
--- a/src/screen/downArena.h
+++ b/src/screen/downArena.h
@@ -12,11 +12,11 @@
# define DOWN_ARENA_MAX_TIEMOUT_LIMIT 500
# define DOWN_ARENA_COUNT_READ_SOCKET 100
-extern void downArena_start();
-extern void downArena_draw();
-extern void downArena_event();
-extern void downArena_stop();
-extern void downArena_init();
-extern void downArena_quit();
+extern void down_arena_start();
+extern void down_arena_draw();
+extern void down_arena_event();
+extern void down_arena_stop();
+extern void down_arena_init();
+extern void down_arena_quit();
#endif
diff --git a/src/screen/gameType.c b/src/screen/gameType.c
index f143a2b..87886af 100644
--- a/src/screen/gameType.c
+++ b/src/screen/gameType.c
@@ -62,7 +62,7 @@ static void loadSession(widget_t * p)
director_t *director;
int i;
- director = director_load(homeDirector_get());
+ director = director_load(home_director_get());
select_remove_all(p);
@@ -101,10 +101,10 @@ void screen_startGameType()
loadSession(selectSession);
- hotKey_register(SDLK_ESCAPE, hotkey_escape);
+ hot_key_register(SDLK_ESCAPE, hotkey_escape);
}
-void gameType_draw()
+void game_type_draw()
{
int i;
@@ -114,7 +114,7 @@ void gameType_draw()
widget_t *this;
this = (widget_t *) listChoiceGroup->list[i];
- choiceGroup_draw(this);
+ choice_group_draw(this);
}
label_draw(label_none);
@@ -122,25 +122,25 @@ void gameType_draw()
label_draw(label_client);
label_draw(label_load_session);
- if (choiceGroup_get_status(check_server) == TRUE || choiceGroup_get_status(check_client) == TRUE) {
+ if (choice_group_get_status(check_server) == TRUE || choice_group_get_status(check_client) == TRUE) {
label_draw(label_port);
- textField_draw(textfield_port);
+ text_field_draw(textfield_port);
label_draw(label_ip);
- textField_draw(textfield_ip);
+ text_field_draw(textfield_ip);
}
- if (choiceGroup_get_status(check_load_session) == TRUE) {
+ if (choice_group_get_status(check_load_session) == TRUE) {
label_draw(label_session);
select_draw(selectSession);
}
#if 0
if (check_server->status == TRUE) {
- gameType_set_ip(getParamElse("--ip", "127.0.0.1"));
- gameType_set_port(atoi(getParamElse("--port", "2200")));
+ game_type_set_ip(getParamElse("--ip", "127.0.0.1"));
+ game_type_set_port(atoi(getParamElse("--port", "2200")));
}
#endif
- if (choiceGroup_get_status(check_client) == TRUE)
+ if (choice_group_get_status(check_client) == TRUE)
button_draw(button_browser);
button_draw(button_back);
@@ -148,7 +148,7 @@ void gameType_draw()
}
-void gameType_event()
+void game_type_event()
{
int i;
@@ -156,28 +156,28 @@ void gameType_event()
widget_t *this;
this = (widget_t *) listChoiceGroup->list[i];
- choiceGroup_event(this);
+ choice_group_event(this);
}
- if (choiceGroup_get_status(check_server) == TRUE || choiceGroup_get_status(check_client) == TRUE) {
- textField_event(textfield_ip);
- textField_event(textfield_port);
+ if (choice_group_get_status(check_server) == TRUE || choice_group_get_status(check_client) == TRUE) {
+ text_field_event(textfield_ip);
+ text_field_event(textfield_port);
}
- if (choiceGroup_get_status(check_load_session) == TRUE) {
+ if (choice_group_get_status(check_load_session) == TRUE) {
select_event(selectSession);
}
button_event(button_back);
button_event(button_play);
- if (choiceGroup_get_status(check_client) == TRUE)
+ if (choice_group_get_status(check_client) == TRUE)
button_event(button_browser);
}
void stopScreenGameType()
{
- unhotKey_register(SDLK_ESCAPE);
+ unhot_key_register(SDLK_ESCAPE);
}
static void eventWidget(void *p)
@@ -193,14 +193,14 @@ static void eventWidget(void *p)
if (button == button_play) {
char *str;
- str = gameType_load_session();
+ str = game_type_load_session();
if (str != NULL) {
screen_set("world");
return;
}
- if (publicServer_get_settingGameType() == NET_GAME_TYPE_CLIENT) {
+ if (public_server_get_settingGameType() == NET_GAME_TYPE_CLIENT) {
screen_set("downArena");
//screen_set("world");
} else {
@@ -213,7 +213,7 @@ static void eventWidget(void *p)
}
}
-void gameType_init()
+void game_type_init()
{
image_t *image;
@@ -225,10 +225,10 @@ void gameType_init()
button_browser = button_new(_("browser"), 300, 345, eventWidget);
listChoiceGroup = list_new();
- check_none = choiceGroup_new(100, 150, FALSE, listChoiceGroup, eventWidget);
- check_server = choiceGroup_new(100, 200, FALSE, listChoiceGroup, eventWidget);
- check_client = choiceGroup_new(100, 250, FALSE, listChoiceGroup, eventWidget);
- check_load_session = choiceGroup_new(100, 300, FALSE, listChoiceGroup, eventWidget);
+ check_none = choice_group_new(100, 150, FALSE, listChoiceGroup, eventWidget);
+ check_server = choice_group_new(100, 200, FALSE, listChoiceGroup, eventWidget);
+ check_client = choice_group_new(100, 250, FALSE, listChoiceGroup, eventWidget);
+ check_load_session = choice_group_new(100, 300, FALSE, listChoiceGroup, eventWidget);
if (isParamFlag("--server")) {
choiceGroup_set_status(check_server, TRUE);
@@ -247,17 +247,17 @@ void gameType_init()
label_port = label_new(_("port"), 300, 245, WIDGET_LABEL_LEFT);
label_session = label_new("load session :", 300, 145, WIDGET_LABEL_LEFT);
- textfield_ip = textField_new(getParamElse("--ip", "127.0.0.1"),
+ textfield_ip = text_field_new(getParamElse("--ip", "127.0.0.1"),
WIDGET_TEXTFIELD_FILTER_IP_OR_DOMAIN,
300, 180);
- textfield_port = textField_new(getParamElse("--port", "6800"),
+ textfield_port = text_field_new(getParamElse("--port", "6800"),
WIDGET_TEXTFIELD_FILTER_NUM, 300, 280);
selectSession = select_new(300, 185, eventWidget);
- screen_register( screen_new("gameType", screen_startGameType, gameType_event,
- gameType_draw, stopScreenGameType));
+ screen_register( screen_new("gameType", screen_startGameType, game_type_event,
+ game_type_draw, stopScreenGameType));
}
int setSettingGameType(int status)
@@ -280,17 +280,17 @@ int setSettingGameType(int status)
return -1;
}
-int publicServer_get_settingGameType()
+int public_server_get_settingGameType()
{
- if (choiceGroup_get_status(check_none) == TRUE || choiceGroup_get_status(check_load_session) == TRUE) {
+ if (choice_group_get_status(check_none) == TRUE || choice_group_get_status(check_load_session) == TRUE) {
return NET_GAME_TYPE_NONE;
}
- if (choiceGroup_get_status(check_server) == TRUE) {
+ if (choice_group_get_status(check_server) == TRUE) {
return NET_GAME_TYPE_SERVER;
}
- if (choiceGroup_get_status(check_client) == TRUE) {
+ if (choice_group_get_status(check_client) == TRUE) {
return NET_GAME_TYPE_CLIENT;
}
@@ -299,52 +299,52 @@ int publicServer_get_settingGameType()
return -1;
}
-char *gameType_load_session()
+char *game_type_load_session()
{
- if (choiceGroup_get_status(check_load_session) == TRUE) {
+ if (choice_group_get_status(check_load_session) == TRUE) {
return select_get_item(selectSession);
}
return NULL;
}
-int gameType_set_ip(char *address)
+int game_type_set_ip(char *address)
{
char str[STR_SIZE];
strcpy(str, address);
- textField_set_text(textfield_ip, str);
+ text_field_set_text(textfield_ip, str);
return 1;
}
-char *publicServer_get_settingIP()
+char *public_server_get_settingIP()
{
- return textField_get_text(textfield_ip);
+ return text_field_get_text(textfield_ip);
}
-int gameType_set_port(int port)
+int game_type_set_port(int port)
{
char str[STR_SIZE];
sprintf(str, "%d", port);
- textField_set_text(textfield_port, str);
+ text_field_set_text(textfield_port, str);
return 0;
}
-int publicServer_get_settingPort()
+int public_server_get_settingPort()
{
- return atoi(textField_get_text(textfield_port));
+ return atoi(text_field_get_text(textfield_port));
}
-int publicServer_get_settingProto()
+int public_server_get_settingProto()
{
- if (strstr(textField_get_text(textfield_ip), ".") != NULL) {
+ if (strstr(text_field_get_text(textfield_ip), ".") != NULL) {
return PROTO_UDPv4;
}
- if (strstr(textField_get_text(textfield_ip), ":") != NULL) {
+ if (strstr(text_field_get_text(textfield_ip), ":") != NULL) {
return PROTO_UDPv6;
}
@@ -353,7 +353,7 @@ int publicServer_get_settingProto()
return -1;
}
-void gameType_quit()
+void game_type_quit()
{
wid_image_destroy(image_backgorund);
@@ -366,8 +366,8 @@ void gameType_quit()
label_destroy(label_port);
label_destroy(label_session);
- textField_destroy(textfield_ip);
- textField_destroy(textfield_port);
+ text_field_destroy(textfield_ip);
+ text_field_destroy(textfield_port);
select_destroy(selectSession);
@@ -375,10 +375,10 @@ void gameType_quit()
button_destroy(button_play);
button_destroy(button_browser);
- choiceGroup_destroy(check_none);
- choiceGroup_destroy(check_server);
- choiceGroup_destroy(check_client);
- choiceGroup_destroy(check_load_session);
+ choice_group_destroy(check_none);
+ choice_group_destroy(check_server);
+ choice_group_destroy(check_client);
+ choice_group_destroy(check_load_session);
list_destroy(listChoiceGroup);
}
diff --git a/src/screen/gameType.h b/src/screen/gameType.h
index a2b4457..9e88c60 100644
--- a/src/screen/gameType.h
+++ b/src/screen/gameType.h
@@ -5,17 +5,17 @@
# include "main.h"
-extern void gameType_draw();
-extern void gameType_event();
-extern void gameType_init();
+extern void game_type_draw();
+extern void game_type_event();
+extern void game_type_init();
extern int setSettingGameType(int status);
-extern int publicServer_get_settingGameType();
-extern char *gameType_load_session();
-extern int gameType_set_ip(char *address);
-extern char *publicServer_get_settingIP();
-extern int gameType_set_port(int port);
-extern int publicServer_get_settingPort();
-extern int publicServer_get_settingProto();
-extern void gameType_quit();
+extern int public_server_get_settingGameType();
+extern char *game_type_load_session();
+extern int game_type_set_ip(char *address);
+extern char *public_server_get_settingIP();
+extern int game_type_set_port(int port);
+extern int public_server_get_settingPort();
+extern int public_server_get_settingProto();
+extern void game_type_quit();
#endif
diff --git a/src/screen/mainMenu.c b/src/screen/mainMenu.c
index d9df377..567a1f6 100644
--- a/src/screen/mainMenu.c
+++ b/src/screen/mainMenu.c
@@ -37,16 +37,16 @@ static void hotkey_escape()
game_quit();
}
-void mainMenu_start()
+void main_menu_start()
{
#ifndef NO_SOUND
music_play("menu", MUSIC_GROUP_BASE);
#endif
- hotKey_register(SDLK_ESCAPE, hotkey_escape);
+ hot_key_register(SDLK_ESCAPE, hotkey_escape);
}
-void mainMenu_draw()
+void main_menu_draw()
{
wid_image_draw(image_backgorund);
@@ -57,7 +57,7 @@ void mainMenu_draw()
button_draw(button_end);
}
-void mainMenu_event()
+void main_menu_event()
{
button_event(button_play);
button_event(button_setting);
@@ -66,9 +66,9 @@ void mainMenu_event()
button_event(button_end);
}
-void mainMenu_stop()
+void main_menu_stop()
{
- unhotKey_register(SDLK_ESCAPE);
+ unhot_key_register(SDLK_ESCAPE);
}
static void eventWidget(void *p)
@@ -98,7 +98,7 @@ static void eventWidget(void *p)
}
}
-void mainMenu_init()
+void main_menu_init()
{
image_t *image;
@@ -117,11 +117,11 @@ void mainMenu_init()
music_add("menu.ogg", "menu", MUSIC_GROUP_BASE);
#endif
- screen_register( screen_new("mainMenu", mainMenu_start, mainMenu_event,
- mainMenu_draw, mainMenu_stop));
+ screen_register( screen_new("mainMenu", main_menu_start, main_menu_event,
+ main_menu_draw, main_menu_stop));
}
-void mainMenu_quit()
+void main_menu_quit()
{
wid_image_destroy(image_backgorund);
diff --git a/src/screen/mainMenu.h b/src/screen/mainMenu.h
index 84048a1..ec25150 100644
--- a/src/screen/mainMenu.h
+++ b/src/screen/mainMenu.h
@@ -5,11 +5,11 @@
# include "main.h"
-extern void mainMenu_start();
-extern void mainMenu_draw();
-extern void mainMenu_event();
-extern void mainMenu_stop();
-extern void mainMenu_init();
-extern void mainMenu_quit();
+extern void main_menu_start();
+extern void main_menu_draw();
+extern void main_menu_event();
+extern void main_menu_stop();
+extern void main_menu_init();
+extern void main_menu_quit();
#endif
diff --git a/src/screen/setting.c b/src/screen/setting.c
index d5c5c1a..dfcdcd7 100644
--- a/src/screen/setting.c
+++ b/src/screen/setting.c
@@ -90,7 +90,7 @@ void screen_startSetting()
music_play("menu", MUSIC_GROUP_BASE);
#endif
- hotKey_register(SDLK_ESCAPE, hotkey_escape);
+ hot_key_register(SDLK_ESCAPE, hotkey_escape);
}
void setting_draw()
@@ -108,12 +108,12 @@ void setting_draw()
label_draw(label_sound);
#endif
- textField_draw(textfield_count_cound);
- textField_draw(textfield_name_player1);
+ text_field_draw(textfield_count_cound);
+ text_field_draw(textfield_name_player1);
if (check_get_status(check_ai) == FALSE) {
label_draw(label_name_player2);
- textField_draw(textfield_name_player2);
+ text_field_draw(textfield_name_player2);
}
wid_image_draw(image_gun_dual_revolver);
@@ -153,11 +153,11 @@ void setting_event()
{
int i;
- textField_event(textfield_count_cound);
- textField_event(textfield_name_player1);
+ text_field_event(textfield_count_cound);
+ text_field_event(textfield_name_player1);
if (check_get_status(check_ai) == FALSE) {
- textField_event(textfield_name_player2);
+ text_field_event(textfield_name_player2);
}
#ifndef NO_SOUND
@@ -181,7 +181,7 @@ void setting_event()
void stopScreenSetting()
{
- unhotKey_register(SDLK_ESCAPE);
+ unhot_key_register(SDLK_ESCAPE);
}
static void eventWidget(void *p)
@@ -216,15 +216,15 @@ static void initSettingFile()
char path[STR_PATH_SIZE];
char val[STR_SIZE];
- sprintf(path, "%s/tuxanci.conf", homeDirector_get());
+ sprintf(path, "%s/tuxanci.conf", home_director_get());
- configFile = textFile_load(path);
+ configFile = text_file_load(path);
if (configFile == NULL) {
fprintf(stderr, _("I am unable to load: \"%s\"!\n"), path);
fprintf(stderr, _("Creating: \"%s\"\n"), path);
- configFile = textFile_new(path);
+ configFile = text_file_new(path);
}
if (configFile == NULL) {
@@ -233,15 +233,15 @@ static void initSettingFile()
}
loadValueFromConfigFile(configFile, "COUNT_ROUND", val, STR_SIZE, "15");
- textField_set_text(textfield_count_cound, val);
+ text_field_set_text(textfield_count_cound, val);
loadValueFromConfigFile(configFile, "NAME_PLAYER_RIGHT", val, STR_SIZE,
NAME_PLAYER_RIGHT);
- textField_set_text(textfield_name_player1, val);
+ text_field_set_text(textfield_name_player1, val);
loadValueFromConfigFile(configFile, "NAME_PLAYER_LEFT", val, STR_SIZE,
NAME_PLAYER_LEFT);
- textField_set_text(textfield_name_player2, val);
+ text_field_set_text(textfield_name_player2, val);
loadValueFromConfigFile(configFile, "GUN_DUAL_SIMPLE", val, STR_SIZE,
"YES");
@@ -283,9 +283,9 @@ static void initSettingFile()
#endif
loadValueFromConfigFile(configFile, "ARENA", val, STR_SIZE, "FAGN");
- choiceArena_set(arenaFile_get_file_format_net_name(val));
+ choice_arena_set(arena_file_get_file_format_net_name(val));
- textFile_save(configFile);
+ text_file_save(configFile);
}
static void saveAndDestroyConfigFile()
@@ -295,9 +295,9 @@ static void saveAndDestroyConfigFile()
return;
}
- setValueInConfigFile(configFile, "COUNT_ROUND", textField_get_text(textfield_count_cound));
- setValueInConfigFile(configFile, "NAME_PLAYER_RIGHT", textField_get_text(textfield_name_player1));
- setValueInConfigFile(configFile, "NAME_PLAYER_LEFT", textField_get_text(textfield_name_player2));
+ setValueInConfigFile(configFile, "COUNT_ROUND", text_field_get_text(textfield_count_cound));
+ setValueInConfigFile(configFile, "NAME_PLAYER_RIGHT", text_field_get_text(textfield_name_player1));
+ setValueInConfigFile(configFile, "NAME_PLAYER_LEFT", text_field_get_text(textfield_name_player2));
setValueInConfigFile(configFile, "GUN_DUAL_SIMPLE", getYesOrNo(check_get_status(check[GUN_DUAL_SIMPLE])));
setValueInConfigFile(configFile, "GUN_SCATTER", getYesOrNo(check_get_status(check[GUN_SCATTER])));
setValueInConfigFile(configFile, "GUN_TOMMY", getYesOrNo(check_get_status(check[GUN_TOMMY])));
@@ -317,14 +317,14 @@ static void saveAndDestroyConfigFile()
setValueInConfigFile(configFile, "SOUND", getYesOrNo(check_get_status(check_sound)));
#endif
- if( choiceArena_get() != NULL )
+ if( choice_arena_get() != NULL )
{
- setValueInConfigFile(configFile, "ARENA", arenaFile_get_net_name(choiceArena_get()));
+ setValueInConfigFile(configFile, "ARENA", arena_file_get_net_name(choice_arena_get()));
}
//TODO
- textFile_save(configFile);
- textFile_destroy(configFile);
+ text_file_save(configFile);
+ text_file_destroy(configFile);
}
void setting_init()
@@ -363,16 +363,16 @@ void setting_init()
label_name_player1 = label_new(_("Player 1:"), 100, WINDOW_SIZE_Y - 160, WIDGET_LABEL_LEFT);
label_name_player2 = label_new(_("Player 2:"), 100, WINDOW_SIZE_Y - 120, WIDGET_LABEL_LEFT);
- textfield_count_cound = textField_new(getParamElse("--count", "15"),
+ textfield_count_cound = text_field_new(getParamElse("--count", "15"),
WIDGET_TEXTFIELD_FILTER_NUM,
110 + label_count_round->w,
WINDOW_SIZE_Y - 200);
- textfield_name_player1 = textField_new(getParamElse("--name1", NAME_PLAYER_RIGHT),
+ textfield_name_player1 = text_field_new(getParamElse("--name1", NAME_PLAYER_RIGHT),
WIDGET_TEXTFIELD_FILTER_ALPHANUM,
110 + label_count_round->w, WINDOW_SIZE_Y - 160);
- textfield_name_player2 = textField_new(getParamElse("--name2", NAME_PLAYER_LEFT),
+ textfield_name_player2 = text_field_new(getParamElse("--name2", NAME_PLAYER_LEFT),
WIDGET_TEXTFIELD_FILTER_ALPHANUM,
110 + label_count_round->w, WINDOW_SIZE_Y - 120);
@@ -434,23 +434,23 @@ void setting_init()
#endif
}
-void publicServer_get_settingNameRight(char *s)
+void public_server_get_settingNameRight(char *s)
{
- strcpy(s, textField_get_text(textfield_name_player1));
+ strcpy(s, text_field_get_text(textfield_name_player1));
}
-void publicServer_get_settingNameLeft(char *s)
+void public_server_get_settingNameLeft(char *s)
{
if (check_get_status(check_ai)) {
strcpy(s, NAME_AI);
} else {
- strcpy(s, textField_get_text(textfield_name_player2));
+ strcpy(s, text_field_get_text(textfield_name_player2));
}
}
-void publicServer_get_settingCountRound(int *n)
+void public_server_get_settingCountRound(int *n)
{
- *n = atoi(textField_get_text(textfield_count_cound));
+ *n = atoi(text_field_get_text(textfield_count_cound));
}
bool_t setting_is_ai()
@@ -499,10 +499,10 @@ void setting_quit()
label_destroy(label_sound);
#endif
label_destroy(label_name_player2);
- textField_destroy(textfield_name_player2);
+ text_field_destroy(textfield_name_player2);
- textField_destroy(textfield_name_player1);
- textField_destroy(textfield_count_cound);
+ text_field_destroy(textfield_name_player1);
+ text_field_destroy(textfield_count_cound);
wid_image_destroy(image_gun_dual_revolver);
wid_image_destroy(image_gun_scatter);
diff --git a/src/screen/setting.h b/src/screen/setting.h
index 6c5ec16..b15ab3c 100644
--- a/src/screen/setting.h
+++ b/src/screen/setting.h
@@ -12,9 +12,9 @@
extern void setting_init();
extern void setting_draw();
extern void setting_event();
-extern void publicServer_get_settingNameRight(char *s);
-extern void publicServer_get_settingNameLeft(char *s);
-extern void publicServer_get_settingCountRound(int *n);
+extern void public_server_get_settingNameRight(char *s);
+extern void public_server_get_settingNameLeft(char *s);
+extern void public_server_get_settingCountRound(int *n);
extern bool_t setting_is_ai();
extern bool_t setting_is_any_item();
extern bool_t setting_is_item(int item);
diff --git a/src/screen/settingKeys.c b/src/screen/settingKeys.c
index 2e44339..c24eadb 100644
--- a/src/screen/settingKeys.c
+++ b/src/screen/settingKeys.c
@@ -87,7 +87,7 @@ void screen_startSettingKeys()
music_play("menu", MUSIC_GROUP_BASE);
#endif
- hotKey_register(SDLK_ESCAPE, hotkey_escape);
+ hot_key_register(SDLK_ESCAPE, hotkey_escape);
}
static void setKeytableFromConfigFile(textFile_t * configFile)
{
@@ -158,7 +158,7 @@ keytable[KEY_TUX_LEFT_SWITCH_WEAPON] = atoi(val);
}
void
- keyTable_init()
+ key_table_init()
{
char path[STR_PATH_SIZE];
@@ -166,9 +166,9 @@ char path[STR_PATH_SIZE];
/*
int i;
*/
- sprintf(path, "%s/keycontrol.conf", homeDirector_get());
+ sprintf(path, "%s/keycontrol.conf", home_director_get());
-keycontrolFile = textFile_load(path);
+keycontrolFile = text_file_load(path);
if (keycontrolFile == NULL) {
@@ -176,7 +176,7 @@ fprintf(stderr, _("I was unable to load file: %s\n"), path);
fprintf(stderr, _("I try to create file: %s\n"), path);
-keycontrolFile = textFile_new(path);
+keycontrolFile = text_file_new(path);
}
@@ -198,7 +198,7 @@ setKeytableFromConfigFile(keycontrolFile);
*/
}
-int keyTable_get_key(int n)
+int key_table_get_key(int n)
{
// printf("keytable[n] = %d\n", keytable[n]);
@@ -206,7 +206,7 @@ int keyTable_get_key(int n)
}
-void settingKey_draw()
+void setting_key_draw()
{
wid_image_draw(image_backgorund);
@@ -243,29 +243,29 @@ label_draw(tux_left_keyswitch);
label_draw(tux_left_keyfire);
// key values
- catchKey_draw(tux_right_keyup_val);
+ catch_key_draw(tux_right_keyup_val);
-catchKey_draw(tux_right_keydown_val);
+catch_key_draw(tux_right_keydown_val);
-catchKey_draw(tux_right_keyleft_val);
+catch_key_draw(tux_right_keyleft_val);
-catchKey_draw(tux_right_keyright_val);
+catch_key_draw(tux_right_keyright_val);
-catchKey_draw(tux_right_keyswitch_val);
+catch_key_draw(tux_right_keyswitch_val);
-catchKey_draw(tux_right_keyfire_val);
+catch_key_draw(tux_right_keyfire_val);
-catchKey_draw(tux_left_keyup_val);
+catch_key_draw(tux_left_keyup_val);
-catchKey_draw(tux_left_keydown_val);
+catch_key_draw(tux_left_keydown_val);
-catchKey_draw(tux_left_keyleft_val);
+catch_key_draw(tux_left_keyleft_val);
-catchKey_draw(tux_left_keyright_val);
+catch_key_draw(tux_left_keyright_val);
-catchKey_draw(tux_left_keyswitch_val);
+catch_key_draw(tux_left_keyswitch_val);
-catchKey_draw(tux_left_keyfire_val);
+catch_key_draw(tux_left_keyfire_val);
}
static void
@@ -273,29 +273,29 @@ static void
refreshKeytable()
{
-keytable[6] = catchKey_get(tux_left_keyup_val);
+keytable[6] = catch_key_get(tux_left_keyup_val);
-keytable[9] = catchKey_get(tux_left_keydown_val);
+keytable[9] = catch_key_get(tux_left_keydown_val);
-keytable[8] = catchKey_get(tux_left_keyleft_val);
+keytable[8] = catch_key_get(tux_left_keyleft_val);
-keytable[7] = catchKey_get(tux_left_keyright_val);
+keytable[7] = catch_key_get(tux_left_keyright_val);
-keytable[10] = catchKey_get(tux_left_keyfire_val);
+keytable[10] = catch_key_get(tux_left_keyfire_val);
-keytable[11] = catchKey_get(tux_left_keyswitch_val);
+keytable[11] = catch_key_get(tux_left_keyswitch_val);
-keytable[0] = catchKey_get(tux_right_keyup_val);
+keytable[0] = catch_key_get(tux_right_keyup_val);
-keytable[3] = catchKey_get(tux_right_keydown_val);
+keytable[3] = catch_key_get(tux_right_keydown_val);
-keytable[2] = catchKey_get(tux_right_keyleft_val);
+keytable[2] = catch_key_get(tux_right_keyleft_val);
-keytable[1] = catchKey_get(tux_right_keyright_val);
+keytable[1] = catch_key_get(tux_right_keyright_val);
-keytable[4] = catchKey_get(tux_right_keyfire_val);
+keytable[4] = catch_key_get(tux_right_keyfire_val);
-keytable[5] = catchKey_get(tux_right_keyswitch_val);
+keytable[5] = catch_key_get(tux_right_keyswitch_val);
}
static void eventWidget(void *p)
@@ -337,51 +337,51 @@ screen_set("setting");
}
-void settingKey_event()
+void setting_key_event()
{
button_event(button_back);
-catchKey_event(tux_right_keyup_val);
+catch_key_event(tux_right_keyup_val);
-catchKey_event(tux_right_keydown_val);
+catch_key_event(tux_right_keydown_val);
-catchKey_event(tux_right_keyleft_val);
+catch_key_event(tux_right_keyleft_val);
-catchKey_event(tux_right_keyright_val);
+catch_key_event(tux_right_keyright_val);
-catchKey_event(tux_right_keyswitch_val);
+catch_key_event(tux_right_keyswitch_val);
-catchKey_event(tux_right_keyfire_val);
+catch_key_event(tux_right_keyfire_val);
-catchKey_event(tux_left_keyup_val);
+catch_key_event(tux_left_keyup_val);
-catchKey_event(tux_left_keydown_val);
+catch_key_event(tux_left_keydown_val);
-catchKey_event(tux_left_keyleft_val);
+catch_key_event(tux_left_keyleft_val);
-catchKey_event(tux_left_keyright_val);
+catch_key_event(tux_left_keyright_val);
-catchKey_event(tux_left_keyswitch_val);
+catch_key_event(tux_left_keyswitch_val);
-catchKey_event(tux_left_keyfire_val);
+catch_key_event(tux_left_keyfire_val);
}
void
stopScreenSettingKeys()
{
- unhotKey_register(SDLK_ESCAPE);
+ unhot_key_register(SDLK_ESCAPE);
}
void
- settingKey_int()
+ setting_key_int()
{
image_t * image;
-keyTable_init();
+key_table_init();
image = image_get(IMAGE_GROUP_BASE, "screen_main");
@@ -448,109 +448,109 @@ tux_right_keyswitch =
tux_left_keyfire->y + 20, WIDGET_LABEL_LEFT);
tux_left_keyup_val =
- catchKey_new(keytable[6], tux_left_keyup->x + 200,
+ catch_key_new(keytable[6], tux_left_keyup->x + 200,
tux_left->y + 50, eventWidget);
tux_left_keydown_val =
- catchKey_new(keytable[9], tux_left_keyup_val->x,
+ catch_key_new(keytable[9], tux_left_keyup_val->x,
tux_left_keyup->y + 20, eventWidget);
tux_left_keyleft_val =
- catchKey_new(keytable[8], tux_left_keyup_val->x,
+ catch_key_new(keytable[8], tux_left_keyup_val->x,
tux_left_keydown->y + 20, eventWidget);
tux_left_keyright_val =
- catchKey_new(keytable[7], tux_left_keyup_val->x,
+ catch_key_new(keytable[7], tux_left_keyup_val->x,
tux_left_keyleft->y + 20, eventWidget);
tux_left_keyfire_val =
- catchKey_new(keytable[10], tux_left_keyup_val->x,
+ catch_key_new(keytable[10], tux_left_keyup_val->x,
tux_left_keyright->y + 20, eventWidget);
tux_left_keyswitch_val =
- catchKey_new(keytable[11], tux_left_keyup_val->x,
+ catch_key_new(keytable[11], tux_left_keyup_val->x,
tux_left_keyfire->y + 20, eventWidget);
tux_right_keyup_val =
- catchKey_new(keytable[0],
+ catch_key_new(keytable[0],
WINDOW_SIZE_X / 2 + tux_left_keyup_val->x,
tux_left->y + 50, eventWidget);
tux_right_keydown_val =
- catchKey_new(keytable[3],
+ catch_key_new(keytable[3],
WINDOW_SIZE_X / 2 + tux_left_keyup_val->x,
tux_left_keyup->y + 20, eventWidget);
tux_right_keyleft_val =
- catchKey_new(keytable[2],
+ catch_key_new(keytable[2],
WINDOW_SIZE_X / 2 + tux_left_keyup_val->x,
tux_right_keydown->y + 20, eventWidget);
tux_right_keyright_val =
- catchKey_new(keytable[1],
+ catch_key_new(keytable[1],
WINDOW_SIZE_X / 2 + tux_left_keyup_val->x,
tux_right_keyleft->y + 20, eventWidget);
tux_right_keyfire_val =
- catchKey_new(keytable[4],
+ catch_key_new(keytable[4],
WINDOW_SIZE_X / 2 + tux_left_keyup_val->x,
tux_left_keyright->y + 20, eventWidget);
tux_right_keyswitch_val =
- catchKey_new(keytable[5],
+ catch_key_new(keytable[5],
WINDOW_SIZE_X / 2 + tux_left_keyup_val->x,
tux_left_keyfire->y + 20, eventWidget);
screen_register(screen_new
("settingKeys", screen_startSettingKeys,
- settingKey_event,
-settingKey_draw,
+ setting_key_event,
+setting_key_draw,
stopScreenSettingKeys));
}
-void keyTable_quit()
+void key_table_quit()
{
- textFile_destroy(keycontrolFile);
+ text_file_destroy(keycontrolFile);
}
void saveKeyTable(textFile_t * configFile)
{
char str[STR_SIZE];
- sprintf(str, "%d", catchKey_get(tux_left_keyup_val));
+ sprintf(str, "%d", catch_key_get(tux_left_keyup_val));
setValueInConfigFile(configFile, "TUX_LEFT_MOVE_UP", str);
- sprintf(str, "%d", catchKey_get(tux_left_keydown_val));
+ sprintf(str, "%d", catch_key_get(tux_left_keydown_val));
setValueInConfigFile(configFile, "TUX_LEFT_MOVE_DOWN", str);
- sprintf(str, "%d", catchKey_get(tux_left_keyleft_val));
+ sprintf(str, "%d", catch_key_get(tux_left_keyleft_val));
setValueInConfigFile(configFile, "TUX_LEFT_MOVE_LEFT", str);
- sprintf(str, "%d", catchKey_get(tux_left_keyright_val));
+ sprintf(str, "%d", catch_key_get(tux_left_keyright_val));
setValueInConfigFile(configFile, "TUX_LEFT_MOVE_RIGHT", str);
- sprintf(str, "%d", catchKey_get(tux_left_keyfire_val));
+ sprintf(str, "%d", catch_key_get(tux_left_keyfire_val));
setValueInConfigFile(configFile, "TUX_LEFT_SHOOT", str);
- sprintf(str, "%d", catchKey_get(tux_left_keyswitch_val));
+ sprintf(str, "%d", catch_key_get(tux_left_keyswitch_val));
setValueInConfigFile(configFile, "TUX_LEFT_SWITCH_WEAPON", str);
- sprintf(str, "%d", catchKey_get(tux_right_keyup_val));
+ sprintf(str, "%d", catch_key_get(tux_right_keyup_val));
setValueInConfigFile(configFile, "TUX_RIGHT_MOVE_UP", str);
- sprintf(str, "%d", catchKey_get(tux_right_keydown_val));
+ sprintf(str, "%d", catch_key_get(tux_right_keydown_val));
setValueInConfigFile(configFile, "TUX_RIGHT_MOVE_DOWN", str);
- sprintf(str, "%d", catchKey_get(tux_right_keyleft_val));
+ sprintf(str, "%d", catch_key_get(tux_right_keyleft_val));
setValueInConfigFile(configFile, "TUX_RIGHT_MOVE_LEFT", str);
- sprintf(str, "%d", catchKey_get(tux_right_keyright_val));
+ sprintf(str, "%d", catch_key_get(tux_right_keyright_val));
setValueInConfigFile(configFile, "TUX_RIGHT_MOVE_RIGHT", str);
- sprintf(str, "%d", catchKey_get(tux_right_keyfire_val));
+ sprintf(str, "%d", catch_key_get(tux_right_keyfire_val));
setValueInConfigFile(configFile, "TUX_RIGHT_SHOOT", str);
- sprintf(str, "%d", catchKey_get(tux_right_keyswitch_val));
+ sprintf(str, "%d", catch_key_get(tux_right_keyswitch_val));
setValueInConfigFile(configFile, "TUX_RIGHT_SWITCH_WEAPON", str);
- textFile_save(configFile);
+ text_file_save(configFile);
}
-void settingKey_quit()
+void setting_key_quit()
{
saveKeyTable(keycontrolFile);
- keyTable_quit();
+ key_table_quit();
// key names
wid_image_destroy(image_backgorund);
@@ -571,19 +571,19 @@ void settingKey_quit()
label_destroy(tux_left_keyfire);
// key values
- catchKey_destroy(tux_right_keyup_val);
+ catch_key_destroy(tux_right_keyup_val);
- catchKey_destroy(tux_right_keydown_val);
- catchKey_destroy(tux_right_keyleft_val);
- catchKey_destroy(tux_right_keyright_val);
- catchKey_destroy(tux_right_keyswitch_val);
- catchKey_destroy(tux_right_keyfire_val);
- catchKey_destroy(tux_left_keyup_val);
- catchKey_destroy(tux_left_keydown_val);
- catchKey_destroy(tux_left_keyleft_val);
- catchKey_destroy(tux_left_keyright_val);
- catchKey_destroy(tux_left_keyswitch_val);
- catchKey_destroy(tux_left_keyfire_val);
+ catch_key_destroy(tux_right_keydown_val);
+ catch_key_destroy(tux_right_keyleft_val);
+ catch_key_destroy(tux_right_keyright_val);
+ catch_key_destroy(tux_right_keyswitch_val);
+ catch_key_destroy(tux_right_keyfire_val);
+ catch_key_destroy(tux_left_keyup_val);
+ catch_key_destroy(tux_left_keydown_val);
+ catch_key_destroy(tux_left_keyleft_val);
+ catch_key_destroy(tux_left_keyright_val);
+ catch_key_destroy(tux_left_keyswitch_val);
+ catch_key_destroy(tux_left_keyfire_val);
button_destroy(button_back);
}
diff --git a/src/screen/settingKeys.h b/src/screen/settingKeys.h
index a52a4a8..e0a6793 100644
--- a/src/screen/settingKeys.h
+++ b/src/screen/settingKeys.h
@@ -16,12 +16,12 @@
# define KEY_LENGTH 12
# include "main.h"
- extern void settingKey_int();
- extern void settingKey_draw();
- extern void settingKey_event();
- extern void settingKey_quit();
- extern void keyTable_init();
- extern int keyTable_get_key(int n);
- extern void keyTable_quit();
+ extern void setting_key_int();
+ extern void setting_key_draw();
+ extern void setting_key_event();
+ extern void setting_key_quit();
+ extern void key_table_init();
+ extern int key_table_get_key(int n);
+ extern void key_table_quit();
#endif /* */
diff --git a/src/screen/table.c b/src/screen/table.c
index 7d5771f..a21c20e 100644
--- a/src/screen/table.c
+++ b/src/screen/table.c
@@ -43,7 +43,7 @@ void table_start()
music_play("menu", MUSIC_GROUP_BASE);
#endif
- hotKey_register(SDLK_ESCAPE, hotkey_escape);
+ hot_key_register(SDLK_ESCAPE, hotkey_escape);
}
void table_draw()
@@ -80,7 +80,7 @@ void table_event()
void table_stop()
{
- unhotKey_register(SDLK_ESCAPE);
+ unhot_key_register(SDLK_ESCAPE);
}
static void eventWidget(void *p)
@@ -144,13 +144,13 @@ static void loadHighscoreFile()
char path[STR_PATH_SIZE];
int i;
- sprintf(path, "%s/" SCREEN_TABLE_FILE_HIGHSCORE_NAME, homeDirector_get());
- textFile = textFile_load(path);
+ sprintf(path, "%s/" SCREEN_TABLE_FILE_HIGHSCORE_NAME, home_director_get());
+ textFile = text_file_load(path);
if (textFile == NULL) {
fprintf(stderr, _("I am unable to load: \"%s\"!\n"), path);
fprintf(stderr, _("Creating: \"%s\"\n"), path);
- textFile = textFile_new(path);
+ textFile = text_file_new(path);
} else {
return;
}
@@ -164,7 +164,7 @@ static void loadHighscoreFile()
list_add(textFile->text, strdup("no_name 0"));
}
- textFile_save(textFile);
+ text_file_save(textFile);
}
int table_add(char *name, int score)
@@ -223,7 +223,7 @@ void table_quit()
list_destroy_item(listWidgetLabelScore, label_destroy);
if (textFile != NULL) {
- textFile_save(textFile);
- textFile_destroy(textFile);
+ text_file_save(textFile);
+ text_file_destroy(textFile);
}
}
diff --git a/src/screen/world.c b/src/screen/world.c
index cb0daf6..19f1094 100644
--- a/src/screen/world.c
+++ b/src/screen/world.c
@@ -62,8 +62,8 @@ void setGameType()
{
int ret = 0;
- ret = netMultiplayer_init(publicServer_get_settingGameType(), publicServer_get_settingIP(),
- publicServer_get_settingPort(), publicServer_get_settingProto());
+ ret = net_multiplayer_init(public_server_get_settingGameType(), public_server_get_settingIP(),
+ public_server_get_settingPort(), public_server_get_settingProto());
if (ret != 0) {
fprintf(stderr, _("Network initialization error!\n"));
@@ -73,7 +73,7 @@ void setGameType()
void word_set_arena(arenaFile_t * arenaFile)
{
- arena = arenaFile_get_arena(arenaFile);
+ arena = arena_file_get_arena(arenaFile);
#ifndef NO_SOUND
music_play(arena->music, MUSIC_GROUP_USER);
@@ -87,7 +87,7 @@ void word_do_end()
static void timer_endArena()
{
- if (netMultiplayer_get_game_type() != NET_GAME_TYPE_CLIENT) {
+ if (net_multiplayer_get_game_type() != NET_GAME_TYPE_CLIENT) {
word_do_end();
return;
}
@@ -117,33 +117,33 @@ void prepareArena()
tux_t *tux;
char name[STR_NAME_SIZE];
- //printf("publicServer_get_settingAI = %s\n", publicServer_get_settingAI());
+ //printf("public_server_get_settingAI = %s\n", public_server_get_settingAI());
arena_set_current(NULL);
tuxWithControlRightKeyboard = NULL;
tuxWithControlLeftKeyboard = NULL;
- if (gameType_load_session() != NULL) {
- load_arena(gameType_load_session());
+ if (game_type_load_session() != NULL) {
+ load_arena(game_type_load_session());
return;
}
- switch (netMultiplayer_get_game_type()) {
+ switch (net_multiplayer_get_game_type()) {
case NET_GAME_TYPE_NONE:
- word_set_arena(choiceArena_get());
+ word_set_arena(choice_arena_get());
item_add_new_item(arena->spaceItem, ID_UNKNOWN);
- publicServer_get_settingCountRound(&arena->max_countRound);
+ public_server_get_settingCountRound(&arena->max_countRound);
tux = tux_new();
tux->control = TUX_CONTROL_KEYBOARD_RIGHT;
tuxWithControlRightKeyboard = tux;
- publicServer_get_settingNameRight(name);
+ public_server_get_settingNameRight(name);
tux_set_name(tux, name);
space_add(arena->spaceTux, tux);
tux = tux_new();
tux->control = TUX_CONTROL_KEYBOARD_LEFT;
tuxWithControlLeftKeyboard = tux;
- publicServer_get_settingNameLeft(name);
+ public_server_get_settingNameLeft(name);
tux_set_name(tux, name);
space_add(arena->spaceTux, tux);
@@ -154,19 +154,19 @@ void prepareArena()
tux->control = TUX_CONTROL_KEYBOARD_LEFT;
}
}
- //printf("gameType_load_session = %s\n", gameType_load_session());
+ //printf("game_type_load_session = %s\n", game_type_load_session());
break;
case NET_GAME_TYPE_SERVER:
- word_set_arena(choiceArena_get());
+ word_set_arena(choice_arena_get());
item_add_new_item(arena->spaceItem, ID_UNKNOWN);
- publicServer_get_settingCountRound(&arena->max_countRound);
+ public_server_get_settingCountRound(&arena->max_countRound);
tux = tux_new();
tux->control = TUX_CONTROL_KEYBOARD_RIGHT;
tuxWithControlRightKeyboard = tux;
- publicServer_get_settingNameRight(name);
+ public_server_get_settingNameRight(name);
tux_set_name(tux, name);
space_add(arena->spaceTux, tux);
break;
@@ -190,16 +190,16 @@ void word_draw()
chat_draw();
pauza_draw();
term_draw();
- saveDialog_draw();
+ save_dialog_draw();
}
static void netAction(tux_t * tux, int action)
{
- if (publicServer_get_settingGameType() == NET_GAME_TYPE_SERVER) {
+ if (public_server_get_settingGameType() == NET_GAME_TYPE_SERVER) {
proto_send_event_server(PROTO_SEND_ALL_SEES_TUX, NULL, tux, action);
}
- if (publicServer_get_settingGameType() == NET_GAME_TYPE_CLIENT) {
+ if (public_server_get_settingGameType() == NET_GAME_TYPE_CLIENT) {
proto_send_event_client(action);
}
}
@@ -216,38 +216,38 @@ static void control_keyboard_right(tux_t * tux)
countKey = 0;
- if (mapa[(SDLKey) keyTable_get_key(KEY_TUX_RIGHT_MOVE_UP)] == SDL_PRESSED)
+ if (mapa[(SDLKey) key_table_get_key(KEY_TUX_RIGHT_MOVE_UP)] == SDL_PRESSED)
countKey++;
- if (mapa[(SDLKey) keyTable_get_key(KEY_TUX_RIGHT_MOVE_RIGHT)] == SDL_PRESSED)
+ if (mapa[(SDLKey) key_table_get_key(KEY_TUX_RIGHT_MOVE_RIGHT)] == SDL_PRESSED)
countKey++;
- if (mapa[(SDLKey) keyTable_get_key(KEY_TUX_RIGHT_MOVE_LEFT)] == SDL_PRESSED)
+ if (mapa[(SDLKey) key_table_get_key(KEY_TUX_RIGHT_MOVE_LEFT)] == SDL_PRESSED)
countKey++;
- if (mapa[(SDLKey) keyTable_get_key(KEY_TUX_RIGHT_MOVE_DOWN)] == SDL_PRESSED)
+ if (mapa[(SDLKey) key_table_get_key(KEY_TUX_RIGHT_MOVE_DOWN)] == SDL_PRESSED)
countKey++;
- if (mapa[(SDLKey) keyTable_get_key(KEY_TUX_RIGHT_SWITCH_WEAPON)] == SDL_PRESSED
+ if (mapa[(SDLKey) key_table_get_key(KEY_TUX_RIGHT_SWITCH_WEAPON)] == SDL_PRESSED
&& tux->isCanSwitchGun == TRUE) {
netAction(tux, TUX_SWITCH_GUN);
tux_action(tux, TUX_SWITCH_GUN);
return;
}
- if (mapa[(SDLKey) keyTable_get_key(KEY_TUX_RIGHT_SHOOT)] == SDL_PRESSED
+ if (mapa[(SDLKey) key_table_get_key(KEY_TUX_RIGHT_SHOOT)] == SDL_PRESSED
&& tux->isCanShot == TRUE) {
netAction(tux, TUX_SHOT);
tux_action(tux, TUX_SHOT);
return;
}
- if (mapa[(SDLKey) keyTable_get_key(KEY_TUX_RIGHT_MOVE_UP)] == SDL_PRESSED) {
- if (countKey > 1 && lastKey == keyTable_get_key(KEY_TUX_RIGHT_MOVE_UP))
+ if (mapa[(SDLKey) key_table_get_key(KEY_TUX_RIGHT_MOVE_UP)] == SDL_PRESSED) {
+ if (countKey > 1 && lastKey == key_table_get_key(KEY_TUX_RIGHT_MOVE_UP))
goto tuUp;
if (countKey == 1)
- lastKey = keyTable_get_key(KEY_TUX_RIGHT_MOVE_UP);
+ lastKey = key_table_get_key(KEY_TUX_RIGHT_MOVE_UP);
netAction(tux, TUX_UP);
tux_action(tux, TUX_UP);
return;
@@ -255,12 +255,12 @@ static void control_keyboard_right(tux_t * tux)
tuUp:;
}
- if (mapa[(SDLKey) keyTable_get_key(KEY_TUX_RIGHT_MOVE_RIGHT)] == SDL_PRESSED) {
- if (countKey > 1 && lastKey == keyTable_get_key(KEY_TUX_RIGHT_MOVE_RIGHT))
+ if (mapa[(SDLKey) key_table_get_key(KEY_TUX_RIGHT_MOVE_RIGHT)] == SDL_PRESSED) {
+ if (countKey > 1 && lastKey == key_table_get_key(KEY_TUX_RIGHT_MOVE_RIGHT))
goto tuRight;
if (countKey == 1)
- lastKey = keyTable_get_key(KEY_TUX_RIGHT_MOVE_RIGHT);
+ lastKey = key_table_get_key(KEY_TUX_RIGHT_MOVE_RIGHT);
netAction(tux, TUX_RIGHT);
tux_action(tux, TUX_RIGHT);
return;
@@ -269,12 +269,12 @@ static void control_keyboard_right(tux_t * tux)
}
- if (mapa[(SDLKey) keyTable_get_key(KEY_TUX_RIGHT_MOVE_LEFT)] == SDL_PRESSED) {
- if (countKey > 1 && lastKey == keyTable_get_key(KEY_TUX_RIGHT_MOVE_LEFT))
+ if (mapa[(SDLKey) key_table_get_key(KEY_TUX_RIGHT_MOVE_LEFT)] == SDL_PRESSED) {
+ if (countKey > 1 && lastKey == key_table_get_key(KEY_TUX_RIGHT_MOVE_LEFT))
goto tuLeft;
if (countKey == 1)
- lastKey = keyTable_get_key(KEY_TUX_RIGHT_MOVE_LEFT);
+ lastKey = key_table_get_key(KEY_TUX_RIGHT_MOVE_LEFT);
netAction(tux, TUX_LEFT);
tux_action(tux, TUX_LEFT);
return;
@@ -282,12 +282,12 @@ static void control_keyboard_right(tux_t * tux)
tuLeft:;
}
- if (mapa[(SDLKey) keyTable_get_key(KEY_TUX_RIGHT_MOVE_DOWN)] == SDL_PRESSED) {
- if (countKey > 1 && lastKey == keyTable_get_key(KEY_TUX_RIGHT_MOVE_DOWN))
+ if (mapa[(SDLKey) key_table_get_key(KEY_TUX_RIGHT_MOVE_DOWN)] == SDL_PRESSED) {
+ if (countKey > 1 && lastKey == key_table_get_key(KEY_TUX_RIGHT_MOVE_DOWN))
goto tuDown;
if (countKey == 1)
- lastKey = keyTable_get_key(KEY_TUX_RIGHT_MOVE_DOWN);
+ lastKey = key_table_get_key(KEY_TUX_RIGHT_MOVE_DOWN);
netAction(tux, TUX_DOWN);
tux_action(tux, TUX_DOWN);
return;
@@ -308,49 +308,49 @@ static void control_keyboard_left(tux_t * tux)
countKey = 0;
- if (mapa[(SDLKey) keyTable_get_key(KEY_TUX_LEFT_MOVE_UP)] == SDL_PRESSED)
+ if (mapa[(SDLKey) key_table_get_key(KEY_TUX_LEFT_MOVE_UP)] == SDL_PRESSED)
countKey++;
- if (mapa[(SDLKey) keyTable_get_key(KEY_TUX_LEFT_MOVE_RIGHT)] == SDL_PRESSED)
+ if (mapa[(SDLKey) key_table_get_key(KEY_TUX_LEFT_MOVE_RIGHT)] == SDL_PRESSED)
countKey++;
- if (mapa[(SDLKey) keyTable_get_key(KEY_TUX_LEFT_MOVE_LEFT)] == SDL_PRESSED)
+ if (mapa[(SDLKey) key_table_get_key(KEY_TUX_LEFT_MOVE_LEFT)] == SDL_PRESSED)
countKey++;
- if (mapa[(SDLKey) keyTable_get_key(KEY_TUX_LEFT_MOVE_DOWN)] == SDL_PRESSED)
+ if (mapa[(SDLKey) key_table_get_key(KEY_TUX_LEFT_MOVE_DOWN)] == SDL_PRESSED)
countKey++;
- if (mapa[(SDLKey) keyTable_get_key(KEY_TUX_LEFT_SWITCH_WEAPON)] == SDL_PRESSED) {
+ if (mapa[(SDLKey) key_table_get_key(KEY_TUX_LEFT_SWITCH_WEAPON)] == SDL_PRESSED) {
if (tux->isCanSwitchGun == TRUE) {
tux_action(tux, TUX_SWITCH_GUN);
return;
}
}
- if (mapa[(SDLKey) keyTable_get_key(KEY_TUX_LEFT_SHOOT)] == SDL_PRESSED
+ if (mapa[(SDLKey) key_table_get_key(KEY_TUX_LEFT_SHOOT)] == SDL_PRESSED
&& tux->isCanShot == TRUE) {
tux_action(tux, TUX_SHOT);
return;
}
- if (mapa[(SDLKey) keyTable_get_key(KEY_TUX_LEFT_MOVE_UP)] == SDL_PRESSED) {
- if (countKey > 1 && lastKey == keyTable_get_key(KEY_TUX_LEFT_MOVE_UP))
+ if (mapa[(SDLKey) key_table_get_key(KEY_TUX_LEFT_MOVE_UP)] == SDL_PRESSED) {
+ if (countKey > 1 && lastKey == key_table_get_key(KEY_TUX_LEFT_MOVE_UP))
goto tuUp;
if (countKey == 1)
- lastKey = keyTable_get_key(KEY_TUX_LEFT_MOVE_UP);
+ lastKey = key_table_get_key(KEY_TUX_LEFT_MOVE_UP);
tux_action(tux, TUX_UP);
return;
tuUp:;
}
- if (mapa[(SDLKey) keyTable_get_key(KEY_TUX_LEFT_MOVE_RIGHT)] == SDL_PRESSED) {
- if (countKey > 1 && lastKey == keyTable_get_key(KEY_TUX_LEFT_MOVE_RIGHT))
+ if (mapa[(SDLKey) key_table_get_key(KEY_TUX_LEFT_MOVE_RIGHT)] == SDL_PRESSED) {
+ if (countKey > 1 && lastKey == key_table_get_key(KEY_TUX_LEFT_MOVE_RIGHT))
goto tuRight;
if (countKey == 1)
- lastKey = keyTable_get_key(KEY_TUX_LEFT_MOVE_RIGHT);
+ lastKey = key_table_get_key(KEY_TUX_LEFT_MOVE_RIGHT);
tux_action(tux, TUX_RIGHT);
return;
@@ -358,24 +358,24 @@ static void control_keyboard_left(tux_t * tux)
}
- if (mapa[(SDLKey) keyTable_get_key(KEY_TUX_LEFT_MOVE_LEFT)] == SDL_PRESSED) {
- if (countKey > 1 && lastKey == keyTable_get_key(KEY_TUX_LEFT_MOVE_LEFT))
+ if (mapa[(SDLKey) key_table_get_key(KEY_TUX_LEFT_MOVE_LEFT)] == SDL_PRESSED) {
+ if (countKey > 1 && lastKey == key_table_get_key(KEY_TUX_LEFT_MOVE_LEFT))
goto tuLeft;
if (countKey == 1)
- lastKey = keyTable_get_key(KEY_TUX_LEFT_MOVE_LEFT);
+ lastKey = key_table_get_key(KEY_TUX_LEFT_MOVE_LEFT);
tux_action(tux, TUX_LEFT);
return;
tuLeft:;
}
- if (mapa[(SDLKey) keyTable_get_key(KEY_TUX_LEFT_MOVE_DOWN)] == SDL_PRESSED) {
- if (countKey > 1 && lastKey == keyTable_get_key(KEY_TUX_LEFT_MOVE_DOWN))
+ if (mapa[(SDLKey) key_table_get_key(KEY_TUX_LEFT_MOVE_DOWN)] == SDL_PRESSED) {
+ if (countKey > 1 && lastKey == key_table_get_key(KEY_TUX_LEFT_MOVE_DOWN))
goto tuDown;
if (countKey == 1)
- lastKey = keyTable_get_key(KEY_TUX_LEFT_MOVE_DOWN);
+ lastKey = key_table_get_key(KEY_TUX_LEFT_MOVE_DOWN);
tux_action(tux, TUX_DOWN);
return;
@@ -449,14 +449,14 @@ void word_event()
tux_t *thisTux;
if (arena == NULL) {
- netMultiplayer_event();
+ net_multiplayer_event();
eventEnd();
return;
}
- netMultiplayer_event();
+ net_multiplayer_event();
- if (pauza_is_active() == FALSE && saveDialog_is_active() == FALSE) {
+ if (pauza_is_active() == FALSE && save_dialog_is_active() == FALSE) {
arena_event(arena);
//module_event();
}
@@ -475,7 +475,7 @@ void word_event()
chat_event();
pauza_event();
term_event();
- saveDialog_event();
+ save_dialog_event();
}
@@ -489,13 +489,13 @@ void startWorld()
arena = NULL;
isEndWorld = FALSE;
- hotKey_register(SDLK_ESCAPE, hotkey_escape);
+ hot_key_register(SDLK_ESCAPE, hotkey_escape);
arena_init();
id_init_list();
radar_init();
pauza_init();
term_init();
- saveDialog_init();
+ save_dialog_init();
module_init();
setGameType();
@@ -522,7 +522,7 @@ static void setTable()
tux_t *tuxRight;
tux_t *tuxLeft;
- if (publicServer_get_settingGameType() != NET_GAME_TYPE_NONE) {
+ if (public_server_get_settingGameType() != NET_GAME_TYPE_NONE) {
return;
}
@@ -545,10 +545,10 @@ void stoptWorld()
setAnalyze();
}
- unhotKey_register(SDLK_ESCAPE);
+ unhot_key_register(SDLK_ESCAPE);
arena_quit();
- netMultiplayer_quit();
+ net_multiplayer_quit();
if (arena != NULL) {
arena_destroy(arena);
@@ -557,7 +557,7 @@ void stoptWorld()
radar_quit();
pauza_quit();
term_quit();
- saveDialog_quit();
+ save_dialog_quit();
#ifndef NO_SOUND
diff --git a/src/server/highScore.c b/src/server/highScore.c
index affd28f..50e6a13 100644
--- a/src/server/highScore.c
+++ b/src/server/highScore.c
@@ -11,16 +11,16 @@
static textFile_t *textFile;
-void highScore_init(char *file)
+void high_score_init(char *file)
{
int i;
- textFile = textFile_load(file);
+ textFile = text_file_load(file);
if (textFile == NULL) {
fprintf(stderr, _("I am unable to load: \"%s\"!\n"), file);
fprintf(stderr, _("Creating: \"%s\"\n"), file);
- textFile = textFile_new(file);
+ textFile = text_file_new(file);
} else {
DEBUG_MSG(_("Scorefile: \"%s\"\n"), file);
@@ -36,7 +36,7 @@ void highScore_init(char *file)
list_add(textFile->text, strdup("no_name 0"));
}
- textFile_save(textFile);
+ text_file_save(textFile);
}
int table_add(char *name, int score)
@@ -61,8 +61,8 @@ int table_add(char *name, int score)
sprintf(new, "%s %d", name, score);
list_ins(textFile->text, i, strdup(new));
list_del_item(textFile->text, HIGHSCORE_MAX_PLAYERS, free);
- //textFile_print(textFile);
- textFile_save(textFile);
+ //text_file_print(textFile);
+ text_file_save(textFile);
return 0;
}
@@ -71,7 +71,7 @@ int table_add(char *name, int score)
return -1;
}
-char *highScore_get_table(int index)
+char *high_score_get_table(int index)
{
if (textFile != NULL && index >= 0 && index < textFile->text->count) {
return (char *) textFile->text->list[index];
@@ -80,10 +80,10 @@ char *highScore_get_table(int index)
return NULL;
}
-void highScore_quit()
+void high_score_quit()
{
if (textFile != NULL) {
- textFile_save(textFile);
- textFile_destroy(textFile);
+ text_file_save(textFile);
+ text_file_destroy(textFile);
}
}
diff --git a/src/server/highScore.h b/src/server/highScore.h
index 7326d6d..8c90db5 100644
--- a/src/server/highScore.h
+++ b/src/server/highScore.h
@@ -5,9 +5,9 @@
# define HIGHSCORE_MAX_PLAYERS 100
-extern void highScore_init(char *file);
+extern void high_score_init(char *file);
extern int table_add(char *name, int score);
-extern char *highScore_get_table(int index);
-extern void highScore_quit();
+extern char *high_score_get_table(int index);
+extern void high_score_quit();
#endif
diff --git a/src/server/publicServer.c b/src/server/publicServer.c
index 475c47d..5a89f42 100644
--- a/src/server/publicServer.c
+++ b/src/server/publicServer.c
@@ -51,7 +51,7 @@ void word_inc_round()
{
}
-char *publicServer_get_setting(char *env, char *param, char *default_val)
+char *public_server_get_setting(char *env, char *param, char *default_val)
{
return getParamElse(param, server_configFile_get_value(env, default_val));
}
@@ -161,7 +161,7 @@ static int registerPublicServer()
register_head *head = (register_head *) str;
head->cmd = 'p';
- head->port = atoi(publicServer_get_setting("PORT4", "--port4", "6800"));
+ head->port = atoi(public_server_get_setting("PORT4", "--port4", "6800"));
head->ip = 0; // TODO
/* send request for server list */
@@ -186,7 +186,7 @@ static int registerPublicServer()
return 0;
}
-static int publicServer_initNetwork()
+static int public_server_initNetwork()
{
char ip4[STR_IP_SIZE];
char ip6[STR_IP_SIZE];
@@ -197,8 +197,8 @@ static int publicServer_initNetwork()
ret = -1;
- strcpy(ip4, publicServer_get_setting("IP4", "--ip4", "none"));
- strcpy(ip6, publicServer_get_setting("IP6", "--ip6", "none"));
+ strcpy(ip4, public_server_get_setting("IP4", "--ip4", "none"));
+ strcpy(ip6, public_server_get_setting("IP6", "--ip6", "none"));
p_ip4 = ip4;
@@ -212,68 +212,68 @@ static int publicServer_initNetwork()
p_ip6 = NULL;
}
- port4 = atoi(publicServer_get_setting("PORT4", "--port4", "6800"));
- port6 = atoi(publicServer_get_setting("PORT6", "--port6", "6800"));
+ port4 = atoi(public_server_get_setting("PORT4", "--port4", "6800"));
+ port6 = atoi(public_server_get_setting("PORT6", "--port6", "6800"));
//ret = initNetMulitplayerPublicServer(p_ip4, port4, p_ip6, port6);
- ret = netMultiplayer_init_for_game_server(p_ip4, port4, p_ip6, port6);
+ ret = net_multiplayer_init_for_game_server(p_ip4, port4, p_ip6, port6);
return ret;
}
static void load_arena()
{
- choice_arenaFile = arenaFile_get_file_format_net_name(publicServer_get_setting("ARENA", "--arena", "FAGN"));
+ choice_arenaFile = arena_file_get_file_format_net_name(public_server_get_setting("ARENA", "--arena", "FAGN"));
if (choice_arenaFile == NULL) {
- fprintf(stderr, _("I dont load arena %s!\n"), publicServer_get_setting("ARENA", "--arena", "FAGN"));
+ fprintf(stderr, _("I dont load arena %s!\n"), public_server_get_setting("ARENA", "--arena", "FAGN"));
exit(-1);
}
- arena = arenaFile_get_arena(choice_arenaFile);
+ arena = arena_file_get_arena(choice_arenaFile);
arena_set_current(arena);
}
-int publicServer_init()
+int public_server_init()
{
int ret;
int i;
id_init_list();
module_init();
- arenaFile_init();
+ arena_file_init();
tux_init();
item_init();
shot_init();
server_configFile_init();
- ret = log_init(publicServer_get_setting("LOG_FILE", "--log-file", "/tmp/tuxanci-server.log"));
+ ret = log_init(public_server_get_setting("LOG_FILE", "--log-file", "/tmp/tuxanci-server.log"));
if (ret < 0) {
fprintf(stderr, _("I was unable to open config file!\n"));
return -1;
}
- highScore_init(publicServer_get_setting("SCORE_FILE", "--score-file", "/tmp/highscore.txt"));
+ high_score_init(public_server_get_setting("SCORE_FILE", "--score-file", "/tmp/highscore.txt"));
load_arena();
- for (i = 0; i < atoi(publicServer_get_setting("ITEM", "--item", "10")); i++) {
+ for (i = 0; i < atoi(public_server_get_setting("ITEM", "--item", "10")); i++) {
item_add_new_item(arena->spaceItem, ID_UNKNOWN);
}
isSignalEnd = FALSE;
- ret = publicServer_initNetwork();
+ ret = public_server_initNetwork();
if (ret < 0) {
printf(_("Unable to initialize network socket!\n"));
return -1;
}
- server_set_max_clients(atoi (publicServer_get_setting("MAX_CLIENTS", "--max-clients", "32")));
+ server_set_max_clients(atoi (public_server_get_setting("MAX_CLIENTS", "--max-clients", "32")));
if (registerPublicServer() < 0) {
printf(_("Unable to contact MasterServer!)\n"));
@@ -282,7 +282,7 @@ int publicServer_init()
return 0;
}
-arenaFile_t *choiceArena_get()
+arenaFile_t *choice_arena_get()
{
return choice_arenaFile;
}
@@ -292,10 +292,10 @@ void eventPublicServer()
static my_time_t lastActive = 0;
my_time_t interval;
- netMultiplayer_event();
+ net_multiplayer_event();
if (isSignalEnd == TRUE) {
- publicServer_quit();
+ public_server_quit();
}
if (lastActive == 0) {
@@ -321,36 +321,36 @@ void my_handler_quit(int n)
isSignalEnd = TRUE;
}
-void publicServer_quit()
+void public_server_quit()
{
DEBUG_MSG(_("Quitting public server\n"));
- netMultiplayer_quit();
+ net_multiplayer_quit();
arena_destroy(arena);
tux_quit();
item_quiy();
shot_quit();
- arenaFile_quit();
+ arena_file_quit();
server_configFile_quit();
module_quit();
id_quit_list();
- highScore_quit();
+ high_score_quit();
log_quit();
exit(0);
}
-int publicServer_start()
+int public_server_start()
{
#ifndef __WIN32__
signal(SIGINT, my_handler_quit);
signal(SIGTERM, my_handler_quit);
signal(SIGQUIT, my_handler_quit);
#endif
- if (publicServer_init() < 0) {
- publicServer_quit();
+ if (public_server_init() < 0) {
+ public_server_quit();
return -1;
}
diff --git a/src/server/publicServer.h b/src/server/publicServer.h
index 4a102a8..64ab1b8 100644
--- a/src/server/publicServer.h
+++ b/src/server/publicServer.h
@@ -8,13 +8,13 @@
# define WORLD_COUNT_ROUND_UNLIMITED -1
-extern char *publicServer_get_setting(char *env, char *param, char *default_val);
+extern char *public_server_get_setting(char *env, char *param, char *default_val);
extern void word_inc_round();
-extern int publicServer_init();
-extern arenaFile_t *choiceArena_get();
+extern int public_server_init();
+extern arenaFile_t *choice_arena_get();
extern void eventPublicServer();
extern void my_handler_quit(int n);
-extern void publicServer_quit();
-extern int publicServer_start();
+extern void public_server_quit();
+extern int public_server_start();
#endif
diff --git a/src/server/serverConfigFile.c b/src/server/serverConfigFile.c
index e1331ab..8458de2 100644
--- a/src/server/serverConfigFile.c
+++ b/src/server/serverConfigFile.c
@@ -40,7 +40,7 @@ void server_configFile_init()
printf(_("Loading configuration from: \"%s\"\n"),
getParamElse("--config-file", SERVER_CONFIG));
- serverTextFile = textFile_load(configFile);
+ serverTextFile = text_file_load(configFile);
if (serverTextFile == NULL) {
fprintf(stderr,
@@ -95,6 +95,6 @@ char *server_configFile_get_value(char *env, char *s)
void server_configFile_quit()
{
if (serverTextFile != NULL) {
- textFile_destroy(serverTextFile);
+ text_file_destroy(serverTextFile);
}
}
diff --git a/src/widget/widget_buttonimage.c b/src/widget/widget_buttonimage.c
index a924c5d..ce453fd 100644
--- a/src/widget/widget_buttonimage.c
+++ b/src/widget/widget_buttonimage.c
@@ -10,7 +10,7 @@
#include "widget.h"
#include "widget_buttonimage.h"
-widget_t *buttonImage_new(image_t * image, int x, int y, void (*fce_event) (void *))
+widget_t *button_image_new(image_t * image, int x, int y, void (*fce_event) (void *))
{
widget_buttonimage_t *new;
@@ -24,7 +24,7 @@ widget_t *buttonImage_new(image_t * image, int x, int y, void (*fce_event) (void
return widget_new(WIDGET_TYPE_BUTTONIMAGE, x, y, new->w, new->h, new);
}
-void buttonImage_set_active(widget_t * widget, bool_t active)
+void button_image_set_active(widget_t * widget, bool_t active)
{
widget_buttonimage_t *p;
@@ -35,7 +35,7 @@ void buttonImage_set_active(widget_t * widget, bool_t active)
p->active = active;
}
-void buttonImage_draw(widget_t * widget)
+void button_image_draw(widget_t * widget)
{
widget_buttonimage_t *p;
@@ -46,7 +46,7 @@ void buttonImage_draw(widget_t * widget)
image_draw(p->image, widget->x, widget->y, p->active * p->w, 0, p->w, p->h);
}
-void buttonImage_event(widget_t * widget)
+void button_image_event(widget_t * widget)
{
widget_buttonimage_t *p;
static int my_time = 0;
@@ -72,7 +72,7 @@ void buttonImage_event(widget_t * widget)
}
}
-void buttonImage_destroy(widget_t * widget)
+void button_image_destroy(widget_t * widget)
{
widget_buttonimage_t *p;
diff --git a/src/widget/widget_buttonimage.h b/src/widget/widget_buttonimage.h
index 2b05fe6..58321a4 100644
--- a/src/widget/widget_buttonimage.h
+++ b/src/widget/widget_buttonimage.h
@@ -16,12 +16,12 @@ typedef struct widget_buttonimageimage {
void (*fce_event) (void *);
} widget_buttonimage_t;
-extern widget_t *buttonImage_new(image_t * image, int x, int y,
+extern widget_t *button_image_new(image_t * image, int x, int y,
void (*fce_event) (void *));
-extern void buttonImage_set_active(widget_t * widget, bool_t active);
-extern void buttonImage_draw(widget_t * widget);
-extern void buttonImage_event(widget_t * widget);
-extern void buttonImage_destroy(widget_t * widget);
+extern void button_image_set_active(widget_t * widget, bool_t active);
+extern void button_image_draw(widget_t * widget);
+extern void button_image_event(widget_t * widget);
+extern void button_image_destroy(widget_t * widget);
#endif
diff --git a/src/widget/widget_catchkey.c b/src/widget/widget_catchkey.c
index 6e1268c..b9d1b2d 100644
--- a/src/widget/widget_catchkey.c
+++ b/src/widget/widget_catchkey.c
@@ -9,7 +9,7 @@
#include "widget.h"
#include "widget_catchkey.h"
-widget_t *catchKey_new(int key, int x, int y, void *event)
+widget_t *catch_key_new(int key, int x, int y, void *event)
{
widget_catchkey_t *new;
@@ -21,7 +21,7 @@ widget_t *catchKey_new(int key, int x, int y, void *event)
return widget_new(WIDGET_TYPE_CATCHKEY, x, y, WIDGET_CATCHKEY_WIDTH, WIDGET_CATCHKEY_HEIGHT, new);
}
-int catchKey_get(widget_t * widget)
+int catch_key_get(widget_t * widget)
{
widget_catchkey_t *p;
@@ -33,7 +33,7 @@ int catchKey_get(widget_t * widget)
return p->key;
}
-void catchKey_set(widget_t * widget, int key)
+void catch_key_set(widget_t * widget, int key)
{
widget_catchkey_t *p;
@@ -45,7 +45,7 @@ void catchKey_set(widget_t * widget, int key)
p->key = key;
}
-void catchKey_draw(widget_t * widget)
+void catch_key_draw(widget_t * widget)
{
widget_catchkey_t *p;
char *name;
@@ -93,7 +93,7 @@ static int getPessAnyKey()
return WIDGET_CATCHKEY_NOKEY;
}
-void catchKey_event(widget_t * widget)
+void catch_key_event(widget_t * widget)
{
widget_catchkey_t *p;
int x, y;
@@ -126,7 +126,7 @@ void catchKey_event(widget_t * widget)
}
}
-void catchKey_destroy(widget_t * widget)
+void catch_key_destroy(widget_t * widget)
{
widget_catchkey_t *p;
diff --git a/src/widget/widget_catchkey.h b/src/widget/widget_catchkey.h
index 6a431e4..9a1da1c 100644
--- a/src/widget/widget_catchkey.h
+++ b/src/widget/widget_catchkey.h
@@ -17,11 +17,11 @@ typedef struct widget_catchkey_struct {
void (*fce_event) (void *p);
} widget_catchkey_t;
-extern widget_t *catchKey_new(int key, int x, int y, void *event);
-extern int catchKey_get(widget_t * p);
-extern void catchKey_set(widget_t * p, int key);
-extern void catchKey_draw(widget_t * p);
-extern void catchKey_event(widget_t * p);
-extern void catchKey_destroy(widget_t * p);
+extern widget_t *catch_key_new(int key, int x, int y, void *event);
+extern int catch_key_get(widget_t * p);
+extern void catch_key_set(widget_t * p, int key);
+extern void catch_key_draw(widget_t * p);
+extern void catch_key_event(widget_t * p);
+extern void catch_key_destroy(widget_t * p);
#endif
diff --git a/src/widget/widget_choicegroup.c b/src/widget/widget_choicegroup.c
index 700c043..0f5ba13 100644
--- a/src/widget/widget_choicegroup.c
+++ b/src/widget/widget_choicegroup.c
@@ -9,7 +9,7 @@
#include "widget.h"
#include "widget_choicegroup.h"
-widget_t *choiceGroup_new(int x, int y, bool_t status, list_t * list, void (*fce_event) (void *))
+widget_t *choice_group_new(int x, int y, bool_t status, list_t * list, void (*fce_event) (void *))
{
widget_choicegroup_t *new;
widget_t *widget;
@@ -27,7 +27,7 @@ widget_t *choiceGroup_new(int x, int y, bool_t status, list_t * list, void (*fce
return widget;
}
-void choiceGroup_draw(widget_t * widget)
+void choice_group_draw(widget_t * widget)
{
widget_choicegroup_t *p;
static image_t *g_choicegroup = NULL;
@@ -55,7 +55,7 @@ void choiceGroup_draw(widget_t * widget)
WIDGET_CHOICEGROUP_WIDTH, WIDGET_CHOICEGROUP_HEIGHT);
}
-void choiceGroup_set_active(widget_t * widget)
+void choice_group_set_active(widget_t * widget)
{
widget_choicegroup_t *p;
int i;
@@ -82,7 +82,7 @@ void choiceGroup_set_active(widget_t * widget)
}
}
-bool_t choiceGroup_get_status(widget_t * widget)
+bool_t choice_group_get_status(widget_t * widget)
{
widget_choicegroup_t *p;
@@ -105,7 +105,7 @@ void choiceGroup_set_status(widget_t * widget, bool_t status)
p->status = status;
}
-void choiceGroup_event(widget_t * widget)
+void choice_group_event(widget_t * widget)
{
widget_choicegroup_t *p;
int x, y;
@@ -125,11 +125,11 @@ void choiceGroup_event(widget_t * widget)
if (x >= widget->x && x <= widget->x + WIDGET_CHOICEGROUP_WIDTH &&
y >= widget->y && y <= widget->y + WIDGET_CHOICEGROUP_HEIGHT &&
interface_is_mouse_clicket()) {
- choiceGroup_set_active(widget);
+ choice_group_set_active(widget);
}
}
-void choiceGroup_destroy(widget_t * widget)
+void choice_group_destroy(widget_t * widget)
{
widget_choicegroup_t *p;
int my_index;
diff --git a/src/widget/widget_choicegroup.h b/src/widget/widget_choicegroup.h
index a74b0d8..64f8ce4 100644
--- a/src/widget/widget_choicegroup.h
+++ b/src/widget/widget_choicegroup.h
@@ -19,15 +19,15 @@ typedef struct widget_choicegroup {
list_t *list;
} widget_choicegroup_t;
-extern widget_t *choiceGroup_new(int x, int y, bool_t status,
+extern widget_t *choice_group_new(int x, int y, bool_t status,
list_t * list,
void (*fce_event) (void *));
-extern void choiceGroup_draw(widget_t * p);
-extern void choiceGroup_set_active(widget_t * widget);
-extern bool_t choiceGroup_get_status(widget_t * widget);
+extern void choice_group_draw(widget_t * p);
+extern void choice_group_set_active(widget_t * widget);
+extern bool_t choice_group_get_status(widget_t * widget);
extern void choiceGroup_set_status(widget_t * widget, bool_t status);
-extern void choiceGroup_event(widget_t * p);
-extern void choiceGroup_destroy(widget_t * p);
+extern void choice_group_event(widget_t * p);
+extern void choice_group_destroy(widget_t * p);
#endif
diff --git a/src/widget/widget_textfield.c b/src/widget/widget_textfield.c
index 07481b9..52e2996 100644
--- a/src/widget/widget_textfield.c
+++ b/src/widget/widget_textfield.c
@@ -12,7 +12,7 @@
//#define ZZEEXX86_READKEY
-widget_t *textField_new(char *text, int filter, int x, int y)
+widget_t *text_field_new(char *text, int filter, int x, int y)
{
widget_textfield_t *new;
@@ -88,7 +88,7 @@ static void drawText(widget_t * widget)
widget->y + WIDGET_TEXTFIELD_HEIGHT / 2 - p->h / 2, COLOR_WHITE);
}
-void textField_draw(widget_t * widget)
+void text_field_draw(widget_t * widget)
{
assert(widget != NULL);
assert(widget->type == WIDGET_TYPE_TEXTFILED);
@@ -97,7 +97,7 @@ void textField_draw(widget_t * widget)
drawText(widget);
}
-void textField_set_text(widget_t * widget, char *text)
+void text_field_set_text(widget_t * widget, char *text)
{
widget_textfield_t *p;
@@ -111,7 +111,7 @@ void textField_set_text(widget_t * widget, char *text)
font_text_size(text, &p->w, &p->h);
}
-char *textField_get_text(widget_t * widget)
+char *text_field_get_text(widget_t * widget)
{
widget_textfield_t *p;
@@ -406,7 +406,7 @@ static void readKey(widget_textfield_t * p)
}
#endif
-void textField_event(widget_t * widget)
+void text_field_event(widget_t * widget)
{
widget_textfield_t *p;
int x, y;
@@ -430,7 +430,7 @@ void textField_event(widget_t * widget)
readKey(p);
}
-void textField_destroy(widget_t * widget)
+void text_field_destroy(widget_t * widget)
{
widget_textfield_t *p;
diff --git a/src/widget/widget_textfield.h b/src/widget/widget_textfield.h
index 7f8e198..b255694 100644
--- a/src/widget/widget_textfield.h
+++ b/src/widget/widget_textfield.h
@@ -31,11 +31,11 @@ typedef struct widget_textfield {
bool_t active;
} widget_textfield_t;
-extern widget_t *textField_new(char *text, int filter, int x, int y);
-extern void textField_set_text(widget_t * widget, char *text);
-extern char *textField_get_text(widget_t * widget);
-extern void textField_draw(widget_t * widget);
-extern void textField_event(widget_t * widget);
-extern void textField_destroy(widget_t * widget);
+extern widget_t *text_field_new(char *text, int filter, int x, int y);
+extern void text_field_set_text(widget_t * widget, char *text);
+extern char *text_field_get_text(widget_t * widget);
+extern void text_field_draw(widget_t * widget);
+extern void text_field_event(widget_t * widget);
+extern void text_field_destroy(widget_t * widget);
#endif