aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/gfx
diff options
context:
space:
mode:
authorMax Horn2009-03-15 20:31:15 +0000
committerMax Horn2009-03-15 20:31:15 +0000
commit7df4e2a80f7e6252dc313a2f9b451dca66273112 (patch)
tree00fdbc87dd4131d17f1f94e8633f612ff19c0784 /engines/sci/gfx
parent9cbed926cdab8a450c6000b750b3f16c5a24d583 (diff)
downloadscummvm-rg350-7df4e2a80f7e6252dc313a2f9b451dca66273112.tar.gz
scummvm-rg350-7df4e2a80f7e6252dc313a2f9b451dca66273112.tar.bz2
scummvm-rg350-7df4e2a80f7e6252dc313a2f9b451dca66273112.zip
SCI: Indention changes, changed 'songlib_t' params to 'const songlib_t &'
svn-id: r39429
Diffstat (limited to 'engines/sci/gfx')
-rw-r--r--engines/sci/gfx/menubar.cpp13
-rw-r--r--engines/sci/gfx/menubar.h2
2 files changed, 7 insertions, 8 deletions
diff --git a/engines/sci/gfx/menubar.cpp b/engines/sci/gfx/menubar.cpp
index a9e14bf55e..83067eeac7 100644
--- a/engines/sci/gfx/menubar.cpp
+++ b/engines/sci/gfx/menubar.cpp
@@ -53,10 +53,8 @@ void menubar_free(menubar_t *menubar) {
int j;
for (j = 0; j < menu->items_nr; j++) {
- if (menu->items[j].keytext)
- free(menu->items[j].keytext);
- if (menu->items[j].text)
- free(menu->items[j].text);
+ free(menu->items[j].keytext);
+ free(menu->items[j].text);
}
free(menu->items);
@@ -106,7 +104,8 @@ int _menubar_add_menu_item(gfx_state_t *state, menu_t *menu, int type, char *lef
if (right) {
gfxop_get_text_params(state, font, right, SIZE_INF, &width, &height, 0, NULL, NULL, NULL);
- total_left_size = MENU_BOX_CENTER_PADDING + (item->keytext_size = width);
+ item->keytext_size = width;
+ total_left_size = MENU_BOX_CENTER_PADDING + width;
}
item->enabled = 1;
@@ -323,8 +322,8 @@ int menubar_set_attribute(EngineState *s, int menu_nr, int item_nr, int attribut
break;
case MENU_ATTRIBUTE_KEY:
- if (item->keytext)
- free(item->keytext);
+ free(item->keytext);
+ item->keytext = 0;
if (value.segment) {
diff --git a/engines/sci/gfx/menubar.h b/engines/sci/gfx/menubar.h
index 2ccd6f8a5e..124344e539 100644
--- a/engines/sci/gfx/menubar.h
+++ b/engines/sci/gfx/menubar.h
@@ -88,7 +88,7 @@ struct EngineState;
struct menu_item_t {
int type; /* Normal or hbar */
char *keytext; /* right-centered part of the text (the key) */
- int keytext_size; /* Width of the right-centered text */
+ int keytext_size; // FIXME: Essentially unused
int flags;
byte said[MENU_SAID_SPEC_SIZE]; /* Said spec for this item */