diff options
| author | Dusan Durech <dusan.d@centrum.sk> | 2008-11-15 16:08:21 +0100 |
|---|---|---|
| committer | Dusan Durech <dusan.d@centrum.sk> | 2008-11-15 16:08:21 +0100 |
| commit | 35084eaadf8b37f5c4a325f0d4b01767753ee9c3 (patch) | |
| tree | 8ca9a541783690eb6087a52faafa75e9a53d1521 /src/client | |
| parent | 98875c5a636f50fe89b9394b8193e86094ae14e0 (diff) | |
modification coding stile
Diffstat (limited to 'src/client')
| -rw-r--r-- | src/client/chat.c | 14 | ||||
| -rw-r--r-- | src/client/client.c | 8 | ||||
| -rw-r--r-- | src/client/configFile.c | 11 | ||||
| -rw-r--r-- | src/client/font.c | 2 | ||||
| -rw-r--r-- | src/client/image.c | 4 | ||||
| -rw-r--r-- | src/client/interface.c | 5 | ||||
| -rw-r--r-- | src/client/keyboardBuffer.c | 4 | ||||
| -rw-r--r-- | src/client/layer.c | 22 | ||||
| -rw-r--r-- | src/client/panel.c | 83 | ||||
| -rw-r--r-- | src/client/pauza.c | 9 | ||||
| -rw-r--r-- | src/client/radar.c | 18 | ||||
| -rw-r--r-- | src/client/saveDialog.c | 45 | ||||
| -rw-r--r-- | src/client/screen.c | 5 | ||||
| -rw-r--r-- | src/client/term.c | 60 |
14 files changed, 117 insertions, 173 deletions
diff --git a/src/client/chat.c b/src/client/chat.c index ceb4796..a6cc094 100644 --- a/src/client/chat.c +++ b/src/client/chat.c @@ -47,8 +47,7 @@ static void hotkey_chat() void initChat() { - g_chat = - addImageData("chat.png", IMAGE_NO_ALPHA, "chat", IMAGE_GROUP_USER); + g_chat = addImageData("chat.png", IMAGE_NO_ALPHA, "chat", IMAGE_GROUP_USER); listText = newList(); strcpy(line, ""); @@ -70,8 +69,7 @@ void drawChat() return; } - drawImage(g_chat, - CHAT_LOCATION_X, CHAT_LOCATION_Y, + drawImage(g_chat, CHAT_LOCATION_X, CHAT_LOCATION_Y, 0, 0, CHAT_SIZE_X, CHAT_SIZE_Y); for (i = 0; i < listText->count; i++) { @@ -79,9 +77,8 @@ void drawChat() s = (char *) listText->list[i]; - drawFontMaxSize(s, - CHAT_LOCATION_X + 5, CHAT_LOCATION_Y + 5 + i * 20, - CHAT_SIZE_X - 10, 20, COLOR_WHITE); + drawFontMaxSize(s, CHAT_LOCATION_X + 5, CHAT_LOCATION_Y + 5 + i * 20, + CHAT_SIZE_X - 10, 20, COLOR_WHITE); } strcpy(str, line); @@ -96,8 +93,7 @@ void drawChat() timeBlick = 0; } - drawFont(str, CHAT_LOCATION_X + 5, - (CHAT_LOCATION_Y + 5) + (CHAT_MAX_LINES * 20), COLOR_WHITE); + drawFont(str, CHAT_LOCATION_X + 5, (CHAT_LOCATION_Y + 5) + (CHAT_MAX_LINES * 20), COLOR_WHITE); } static void processMessageKey(SDL_keysym keysym) diff --git a/src/client/client.c b/src/client/client.c index 11d8018..e92a238 100644 --- a/src/client/client.c +++ b/src/client/client.c @@ -157,8 +157,7 @@ void sendServer(char *msg) #endif if (sock_server_udp != NULL) { - ret = - writeUdpSocket(sock_server_udp, sock_server_udp, msg, strlen(msg)); + ret = writeUdpSocket(sock_server_udp, sock_server_udp, msg, strlen(msg)); } if (ret < 0) { @@ -176,15 +175,14 @@ static int eventServerSelect() ret = -1; if (sock_server_udp != NULL) { - ret = - readUdpSocket(sock_server_udp, sock_server_udp, buffer, - STR_PROTO_SIZE - 1); + ret = readUdpSocket(sock_server_udp, sock_server_udp, buffer, STR_PROTO_SIZE - 1); } if (ret < 0) { errorWithServer(); return ret; } + #ifdef SUPPORT_TRAFFIC traffic_down += ret; #endif diff --git a/src/client/configFile.c b/src/client/configFile.c index afdbf9f..74509fe 100644 --- a/src/client/configFile.c +++ b/src/client/configFile.c @@ -30,18 +30,22 @@ int getValue(char *line, char *env, char *val, int len) strcpy(clone_env, env); offset_env = strstr(line, clone_env); + if (offset_env == NULL) return -1; offset_val_begin = strchr(offset_env, '"'); + if (offset_val_begin == NULL) return -1; offset_val_end = strchr(offset_val_begin + 1, '"'); + if (offset_val_end == NULL) return -1; val_len = (int) (offset_val_end - (offset_val_begin + 1)); + if (val_len > len - 1) val_len = len - 1; @@ -63,14 +67,17 @@ char *setValue(char *line, char *env, char *val) strcpy(clone_env, env); offset_env = strstr(line, clone_env); + if (offset_env == NULL) return NULL; offset_val_begin = strchr(offset_env, '"'); + if (offset_val_begin == NULL) return NULL; offset_val_end = strchr(offset_val_begin + 1, '"'); + if (offset_val_end == NULL) return NULL; @@ -124,9 +131,7 @@ int setValueInConfigFile(textFile_t * textFile, char *env, char *val) return -1; } -void -loadValueFromConfigFile(textFile_t * textFile, char *env, char *val, int len, - char *butVal) +void loadValueFromConfigFile(textFile_t * textFile, char *env, char *val, int len, char *butVal) { strcpy(val, butVal); diff --git a/src/client/font.c b/src/client/font.c index 3473a1d..52963b6 100644 --- a/src/client/font.c +++ b/src/client/font.c @@ -74,10 +74,8 @@ void drawFontMaxSize(char *s, int x, int y, int w, int h, int r, int g, int b) assert(s != NULL); - text = TTF_RenderUTF8_Blended(g_font, s, font_color); - my_w = text->w; if (my_w > w) { diff --git a/src/client/image.c b/src/client/image.c index e5b0c3e..711d8b4 100644 --- a/src/client/image.c +++ b/src/client/image.c @@ -53,9 +53,7 @@ static SDL_Surface *loadImage(const char *filename, int alpha) return NULL; } - if ((ret = - (alpha) ? SDL_DisplayFormatAlpha(tmp) : SDL_DisplayFormat(tmp)) == - NULL) { + if ((ret = (alpha) ? SDL_DisplayFormatAlpha(tmp) : SDL_DisplayFormat(tmp)) == NULL) { fprintf(stderr, "%s\n", SDL_GetError()); SDL_FreeSurface(tmp); return NULL; diff --git a/src/client/interface.c b/src/client/interface.c index d64ba36..33c4001 100644 --- a/src/client/interface.c +++ b/src/client/interface.c @@ -70,9 +70,7 @@ void hotkey_screen() fprintf(stderr, _("Unable to switch to FULLSCREEN mode!\n")); SDL_FreeSurface(screen); - screen = - SDL_SetVideoMode(WINDOW_SIZE_X, WINDOW_SIZE_Y, WIN_BPP, - g_win_flags); + screen = SDL_SetVideoMode(WINDOW_SIZE_X, WINDOW_SIZE_Y, WIN_BPP, g_win_flags); if (screen == NULL) { fprintf(stderr, _("Unable to switch to WINDOW mode! Error: %s\n"), @@ -216,7 +214,6 @@ void printPressAnyKey() } - int hack_slow() { static time_t lastTime = 0; diff --git a/src/client/keyboardBuffer.c b/src/client/keyboardBuffer.c index 4c24e9b..0454bdb 100644 --- a/src/client/keyboardBuffer.c +++ b/src/client/keyboardBuffer.c @@ -66,8 +66,7 @@ bool_t pushKeyToKeyboardBuffer(SDL_keysym key) assert(keyboardBuffer != NULL); if (keyboardBuffer->count >= keyboardBuffer->size) { - fprintf(stderr, _("Keyboard Buffer overrun! Dropping key: %02x\n"), - key.sym); + fprintf(stderr, _("Keyboard Buffer overrun! Dropping key: %02x\n"), key.sym); return FALSE; } @@ -100,6 +99,7 @@ SDL_keysym popKeyFromKeyboardBuffer() keyboardBuffer->buff[keyboardBuffer->begin] = emptyKey; keyboardBuffer->begin++; + if (keyboardBuffer->begin >= keyboardBuffer->size) { keyboardBuffer->begin = 0; } diff --git a/src/client/layer.c b/src/client/layer.c index c1ca8db..983a9c8 100644 --- a/src/client/layer.c +++ b/src/client/layer.c @@ -39,8 +39,7 @@ void initLayer() * layer - on which layer to draw * (0 - under tuxanci | 1 - same as tuxanci | 2 - over tuxancami) */ -void -addLayer(image_t * img, int x, int y, int px, int py, int w, int h, int player) +void addLayer(image_t * img, int x, int y, int px, int py, int w, int h, int player) { layer_t *new; layer_t *actual; @@ -89,6 +88,7 @@ addLayer(image_t * img, int x, int y, int px, int py, int w, int h, int player) return; }; }; + if (i >= listLayer->count) break; @@ -134,15 +134,15 @@ void drawLayerCenter(int x, int y) for (i = 0; i < listLayer->count; i++) { this = (layer_t *) listLayer->list[i]; - if (this->x + this->w < screen_x || this->x > screen_x + WINDOW_SIZE_X - || this->y + this->h < screen_y - || this->y > screen_y + WINDOW_SIZE_Y) { + if (this->x + this->w < screen_x || + this->x > screen_x + WINDOW_SIZE_X || + this->y + this->h < screen_y || + this->y > screen_y + WINDOW_SIZE_Y) { continue; } //count++; - drawImage(this->image, - this->x - screen_x, this->y - screen_y, + drawImage(this->image, this->x - screen_x, this->y - screen_y, this->px, this->py, this->w, this->h); //printf("%d %d\n", this->x - screen_x, this->y - screen_y); @@ -164,9 +164,10 @@ void drawLayerSplit(int local_x, int local_y, int x, int y, int w, int h) this = (layer_t *) listLayer->list[i]; if (this->x + this->w < x || this->x > x + w || - this->y + this->h < y || this->y > y + h) { + this->y + this->h < y || this->y > y + h) { continue; } + //count++; if (local_x + (this->x - x) < local_x) { @@ -197,9 +198,8 @@ void drawLayerSplit(int local_x, int local_y, int x, int y, int w, int h) this->h -= (local_y + (this->y - y) + this->h) - (local_y + h); } - drawImage(this->image, - local_x + (this->x - x), local_y + (this->y - y), - this->px, this->py, this->w, this->h); + drawImage(this->image, local_x + (this->x - x), local_y + (this->y - y), + this->px, this->py, this->w, this->h); //printf("%d %d\n", this->x - screen_x, this->y - screen_y); } diff --git a/src/client/panel.c b/src/client/panel.c index ea87c1a..b7d0360 100644 --- a/src/client/panel.c +++ b/src/client/panel.c @@ -29,55 +29,22 @@ void initPanel() assert(isImageInicialized() == TRUE); assert(isInterfaceInicialized() == TRUE); - g_panel = - addImageData("panel.png", IMAGE_ALPHA, "panel", IMAGE_GROUP_BASE); - g_shot = - addImageData("panel_shot.png", IMAGE_ALPHA, "panel_image_shot", - IMAGE_GROUP_BASE); - g_bonus = - addImageData("graf.bonus.png", IMAGE_ALPHA, "panel_graf_bonus", - IMAGE_GROUP_BASE); - - g_icon[GUN_SIMPLE] = - addImageData("icon.gun.simple.png", IMAGE_ALPHA, "panel_gun", - IMAGE_GROUP_BASE); - g_icon[GUN_DUAL_SIMPLE] = - addImageData("icon.gun.dual.simple.png", IMAGE_ALPHA, "panel_dual", - IMAGE_GROUP_BASE); - g_icon[GUN_TOMMY] = - addImageData("icon.gun.tommy.png", IMAGE_ALPHA, "panel_tommy", - IMAGE_GROUP_BASE); - g_icon[GUN_SCATTER] = - addImageData("icon.gun.scatter.png", IMAGE_ALPHA, "panel_scatter", - IMAGE_GROUP_BASE); - g_icon[GUN_LASSER] = - addImageData("icon.gun.lasser.png", IMAGE_ALPHA, "panel_lasser", - IMAGE_GROUP_BASE); - g_icon[GUN_MINE] = - addImageData("icon.gun.mine.png", IMAGE_ALPHA, "panel_mine", - IMAGE_GROUP_BASE); - g_icon[GUN_BOMBBALL] = - addImageData("icon.gun.bombball.png", IMAGE_ALPHA, "panel_bombball", - IMAGE_GROUP_BASE); - - g_icon[BONUS_SPEED] = - addImageData("icon.bonus.speed.png", IMAGE_ALPHA, "panel_speed", - IMAGE_GROUP_BASE); - g_icon[BONUS_SHOT] = - addImageData("icon.bonus.shot.png", IMAGE_ALPHA, "panel_shot", - IMAGE_GROUP_BASE); - g_icon[BONUS_TELEPORT] = - addImageData("icon.bonus.teleport.png", IMAGE_ALPHA, "panel_teleport", - IMAGE_GROUP_BASE); - g_icon[BONUS_GHOST] = - addImageData("icon.bonus.ghost.png", IMAGE_ALPHA, "panel_ghost", - IMAGE_GROUP_BASE); - g_icon[BONUS_4X] = - addImageData("icon.bonus.4x.png", IMAGE_ALPHA, "panel_4x", - IMAGE_GROUP_BASE); - g_icon[BONUS_HIDDEN] = - addImageData("icon.bonus.hidden.png", IMAGE_ALPHA, "panel_hidden", - IMAGE_GROUP_BASE); + g_panel = addImageData("panel.png", IMAGE_ALPHA, "panel", IMAGE_GROUP_BASE); + g_shot = addImageData("panel_shot.png", IMAGE_ALPHA, "panel_image_shot",IMAGE_GROUP_BASE); + g_bonus = addImageData("graf.bonus.png", IMAGE_ALPHA, "panel_graf_bonus", IMAGE_GROUP_BASE); + g_icon[GUN_SIMPLE] = addImageData("icon.gun.simple.png", IMAGE_ALPHA, "panel_gun", IMAGE_GROUP_BASE); + g_icon[GUN_DUAL_SIMPLE] = addImageData("icon.gun.dual.simple.png", IMAGE_ALPHA, "panel_dual", IMAGE_GROUP_BASE); + g_icon[GUN_TOMMY] = addImageData("icon.gun.tommy.png", IMAGE_ALPHA, "panel_tommy", IMAGE_GROUP_BASE); + g_icon[GUN_SCATTER] = addImageData("icon.gun.scatter.png", IMAGE_ALPHA, "panel_scatter", IMAGE_GROUP_BASE); + g_icon[GUN_LASSER] = addImageData("icon.gun.lasser.png", IMAGE_ALPHA, "panel_lasser", IMAGE_GROUP_BASE); + g_icon[GUN_MINE] = addImageData("icon.gun.mine.png", IMAGE_ALPHA, "panel_mine", IMAGE_GROUP_BASE); + g_icon[GUN_BOMBBALL] = addImageData("icon.gun.bombball.png", IMAGE_ALPHA, "panel_bombball", IMAGE_GROUP_BASE); + g_icon[BONUS_SPEED] = addImageData("icon.bonus.speed.png", IMAGE_ALPHA, "panel_speed", IMAGE_GROUP_BASE); + g_icon[BONUS_SHOT] = addImageData("icon.bonus.shot.png", IMAGE_ALPHA, "panel_shot", IMAGE_GROUP_BASE); + g_icon[BONUS_TELEPORT] = addImageData("icon.bonus.teleport.png", IMAGE_ALPHA, "panel_teleport", IMAGE_GROUP_BASE); + g_icon[BONUS_GHOST] = addImageData("icon.bonus.ghost.png", IMAGE_ALPHA, "panel_ghost", IMAGE_GROUP_BASE); + g_icon[BONUS_4X] = addImageData("icon.bonus.4x.png", IMAGE_ALPHA, "panel_4x", IMAGE_GROUP_BASE); + g_icon[BONUS_HIDDEN] = addImageData("icon.bonus.hidden.png", IMAGE_ALPHA, "panel_hidden", IMAGE_GROUP_BASE); isPanelInit = TRUE; } @@ -96,14 +63,12 @@ static void drawScore(tux_t * tux_right, tux_t * tux_left) } getTextSize(strScoreLine, &w, &h); - drawFont(strScoreLine, PANEL_SCORE_LOCATION_X, PANEL_SCORE_LOCATION_Y, - COLOR_WHITE); + drawFont(strScoreLine, PANEL_SCORE_LOCATION_X, PANEL_SCORE_LOCATION_Y, COLOR_WHITE); } static void drawShot(int n, int x, int y) { - drawImage(g_shot, x, y, n * PANEL_SHOT_WIDTH, 0, PANEL_SHOT_WIDTH, - PANEL_SHOT_HEIGHT); + drawImage(g_shot, x, y, n * PANEL_SHOT_WIDTH, 0, PANEL_SHOT_WIDTH, PANEL_SHOT_HEIGHT); } static void drawShotInfo(tux_t * tux, int x, int y) @@ -129,14 +94,12 @@ static void drawShotInfo(tux_t * tux, int x, int y) static void drawGunInfo(tux_t * tux, int x, int y) { - drawImage(g_icon[tux->gun], x, y, 0, 0, - g_icon[tux->gun]->w, g_icon[tux->gun]->h); + drawImage(g_icon[tux->gun], x, y, 0, 0, g_icon[tux->gun]->w, g_icon[tux->gun]->h); } static void drawBonusInfo(tux_t * tux, int x, int y) { - drawImage(g_icon[tux->bonus], x, y, 0, 0, g_icon[tux->bonus]->w, - g_icon[tux->bonus]->h); + drawImage(g_icon[tux->bonus], x, y, 0, 0, g_icon[tux->bonus]->w, g_icon[tux->bonus]->h); } static void drawGrafBonus(tux_t * tux, int x, int y) @@ -180,13 +143,11 @@ static void drawTuxLeft(tux_t * tux) void drawPanel(tux_t * tux_right, tux_t * tux_left) { - drawImage(g_panel, PANEL_LOCATION_X, PANEL_LOCATION_Y, 0, 0, g_panel->w, - g_panel->h); + drawImage(g_panel, PANEL_LOCATION_X, PANEL_LOCATION_Y, 0, 0, g_panel->w, g_panel->h); drawScore(tux_right, tux_left); if (isRecivedNewMsg()) { - drawFont("recived new msg", PANEL_LOCATION_X, PANEL_LOCATION_Y, - COLOR_WHITE); + drawFont("recived new msg", PANEL_LOCATION_X, PANEL_LOCATION_Y, COLOR_WHITE); } drawTuxRight(tux_right); diff --git a/src/client/pauza.c b/src/client/pauza.c index 6003d51..eb346dc 100644 --- a/src/client/pauza.c +++ b/src/client/pauza.c @@ -31,8 +31,7 @@ static void hotkey_pauze() void initPauza() { - g_pauza = - addImageData("pauza.png", IMAGE_ALPHA, "pauza", IMAGE_GROUP_USER); + g_pauza = addImageData("pauza.png", IMAGE_ALPHA, "pauza", IMAGE_GROUP_USER); activePauza = FALSE; registerHotKey(SDLK_p, hotkey_pauze); @@ -42,9 +41,9 @@ void drawPauza() { if (activePauza) { drawImage(g_pauza, - WINDOW_SIZE_X / 2 - g_pauza->w / 2, - WINDOW_SIZE_Y / 2 - g_pauza->h / 2, - 0, 0, g_pauza->w, g_pauza->h); + WINDOW_SIZE_X / 2 - g_pauza->w / 2, + WINDOW_SIZE_Y / 2 - g_pauza->h / 2, + 0, 0, g_pauza->w, g_pauza->h); } } diff --git a/src/client/radar.c b/src/client/radar.c index 990f8cb..b45d80f 100644 --- a/src/client/radar.c +++ b/src/client/radar.c @@ -81,8 +81,7 @@ void initRadar() assert(isImageInicialized() == TRUE); assert(isInterfaceInicialized() == TRUE); - g_radar = - addImageData("radar.png", IMAGE_NO_ALPHA, "radar", IMAGE_GROUP_USER); + g_radar = addImageData("radar.png", IMAGE_NO_ALPHA, "radar", IMAGE_GROUP_USER); listRadar = newList(); } @@ -90,8 +89,7 @@ void drawRadar(arena_t * arena) { int i; - drawImage(g_radar, RADAR_LOCATION_X, RADAR_LOCATION_Y, 0, 0, - RADAR_SIZE_X + 2, RADAR_SIZE_Y + 2); + drawImage(g_radar, RADAR_LOCATION_X, RADAR_LOCATION_Y, 0, 0, RADAR_SIZE_X + 2, RADAR_SIZE_Y + 2); for (i = 0; i < listRadar->count; i++) { radar_item_t *thisRadarItem; @@ -99,15 +97,13 @@ void drawRadar(arena_t * arena) thisRadarItem = (radar_item_t *) listRadar->list[i]; - x = (((float) RADAR_SIZE_X) / ((float) arena->w)) * - ((float) thisRadarItem->x); - y = (((float) RADAR_SIZE_Y) / ((float) arena->h)) * - ((float) thisRadarItem->y); + x = (((float) RADAR_SIZE_X) / ((float) arena->w)) * ((float) thisRadarItem->x); + + y = (((float) RADAR_SIZE_Y) / ((float) arena->h)) * ((float) thisRadarItem->y); if (x >= 0 && x <= RADAR_SIZE_X && y >= 0 && y <= RADAR_SIZE_Y) { - drawImage(g_radar, - RADAR_LOCATION_X + 1 + x, RADAR_LOCATION_Y + 1 + y, - 2 * thisRadarItem->type, RADAR_SIZE_Y + 2, 2, 2); + drawImage(g_radar, RADAR_LOCATION_X + 1 + x, RADAR_LOCATION_Y + 1 + y, + 2 * thisRadarItem->type, RADAR_SIZE_Y + 2, 2, 2); } } } diff --git a/src/client/saveDialog.c b/src/client/saveDialog.c index d154791..1c832e7 100644 --- a/src/client/saveDialog.c +++ b/src/client/saveDialog.c @@ -46,8 +46,7 @@ static void eventWidget(void *p) button = (widget_t *) p; if (button == widgetButtonSave) { - saveArena(getTextFromWidgetTextfield(widgetTextFieldName), - getCurrentArena()); + saveArena(getTextFromWidgetTextfield(widgetTextFieldName), getCurrentArena()); switchTerm(); } @@ -67,27 +66,23 @@ void initSaveDialog() g_background = getImage(IMAGE_GROUP_BASE, "screen_main"); - widgetLabelMsg = newWidgetLabel("name", - SAVE_DIALOG_LOCATIN_X + 20, - SAVE_DIALOG_LOCATIN_Y + 20, - WIDGET_LABEL_LEFT); + widgetLabelMsg = newWidgetLabel("name", SAVE_DIALOG_LOCATIN_X + 20, + SAVE_DIALOG_LOCATIN_Y + 20, + WIDGET_LABEL_LEFT); - widgetTextFieldName = newWidgetTextfield("noname", - WIDGET_TEXTFIELD_FILTER_ALPHANUM, - widgetLabelMsg->x + - widgetLabelMsg->w + 10, - widgetLabelMsg->y); + widgetTextFieldName = newWidgetTextfield("noname", WIDGET_TEXTFIELD_FILTER_ALPHANUM, + widgetLabelMsg->x + + widgetLabelMsg->w + 10, + widgetLabelMsg->y); - widgetButtonSave = newWidgetButton("Save", - SAVE_DIALOG_LOCATIN_X + 20, - SAVE_DIALOG_LOCATIN_Y + 60, - eventWidget); + widgetButtonSave = newWidgetButton("Save", SAVE_DIALOG_LOCATIN_X + 20, + SAVE_DIALOG_LOCATIN_Y + 60, + eventWidget); - widgetButtonBack = newWidgetButton("Back", - SAVE_DIALOG_LOCATIN_X + 20 + - WIDGET_BUTTON_WIDTH + 20, - SAVE_DIALOG_LOCATIN_Y + 60, - eventWidget); + widgetButtonBack = newWidgetButton("Back", SAVE_DIALOG_LOCATIN_X + 20 + + WIDGET_BUTTON_WIDTH + 20, + SAVE_DIALOG_LOCATIN_Y + 60, + eventWidget); registerHotKey(SDLK_F2, hotkey_saveDialog); } @@ -104,10 +99,12 @@ void drawSaveDialog() } drawImage(g_background, - SAVE_DIALOG_LOCATIN_X, - SAVE_DIALOG_LOCATIN_Y, - SAVE_DIALOG_LOCATIN_X, - SAVE_DIALOG_LOCATIN_Y, SAVE_DIALOG_SIZE_X, SAVE_DIALOG_SIZE_Y); + SAVE_DIALOG_LOCATIN_X, + SAVE_DIALOG_LOCATIN_Y, + SAVE_DIALOG_LOCATIN_X, + SAVE_DIALOG_LOCATIN_Y, + SAVE_DIALOG_SIZE_X, + SAVE_DIALOG_SIZE_Y); drawWidgetLabel(widgetLabelMsg); drawWidgetTextfield(widgetTextFieldName); diff --git a/src/client/screen.c b/src/client/screen.c index 52e8e3f..71d48d8 100644 --- a/src/client/screen.c +++ b/src/client/screen.c @@ -24,9 +24,8 @@ bool_t isScreenInicialized() return isScreenInit; } -screen_t *newScreen(char *name, - void (*fce_start) (), void (*fce_event) (), - void (*fce_draw) (), void (*fce_stop) ()) +screen_t *newScreen(char *name, void (*fce_start) (), void (*fce_event) (), + void (*fce_draw) (), void (*fce_stop) ()) { screen_t *new; diff --git a/src/client/term.c b/src/client/term.c index 5266c53..4a1991c 100644 --- a/src/client/term.c +++ b/src/client/term.c @@ -30,22 +30,22 @@ void initTerm() static char *getStrGun(int gun) { switch (gun) { - case GUN_SIMPLE: - return "revolver"; - case GUN_DUAL_SIMPLE: - return "dual revolver"; - case GUN_SCATTER: - return "scatter"; - case GUN_TOMMY: - return "tommy"; - case GUN_LASSER: - return "lasser"; - case GUN_MINE: - return "mine"; - case GUN_BOMBBALL: - return "bombball"; - default: - return "none"; + case GUN_SIMPLE: + return "revolver"; + case GUN_DUAL_SIMPLE: + return "dual revolver"; + case GUN_SCATTER: + return "scatter"; + case GUN_TOMMY: + return "tommy"; + case GUN_LASSER: + return "lasser"; + case GUN_MINE: + return "mine"; + case GUN_BOMBBALL: + return "bombball"; + default: + return "none"; } return "gun_unknow"; @@ -54,20 +54,20 @@ static char *getStrGun(int gun) static char *getStrBonus(int bonus) { switch (bonus) { - case BONUS_SPEED: - return "speed"; - case BONUS_SHOT: - return "shot"; - case BONUS_TELEPORT: - return "teleport"; - case BONUS_GHOST: - return "ghost"; - case BONUS_4X: - return "4X"; - case BONUS_HIDDEN: - return "hidden"; - default: - return "none"; + case BONUS_SPEED: + return "speed"; + case BONUS_SHOT: + return "shot"; + case BONUS_TELEPORT: + return "teleport"; + case BONUS_GHOST: + return "ghost"; + case BONUS_4X: + return "4X"; + case BONUS_HIDDEN: + return "hidden"; + default: + return "none"; } return "bonus_unknow"; |