From 80794a6b5aa02be8a8c0e7879c5e3f48ee8a2646 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Fri, 24 Apr 2009 10:47:38 +0000 Subject: SCI: font_nr -> _font svn-id: r40106 --- engines/sci/engine/kgraphics.cpp | 10 +++++----- engines/sci/engine/kmenu.cpp | 2 +- engines/sci/gfx/gfx_gui.cpp | 18 +++++++++--------- engines/sci/gfx/gfx_state_internal.h | 6 +++--- engines/sci/gfx/gfx_widgets.cpp | 12 ++++++------ 5 files changed, 24 insertions(+), 24 deletions(-) (limited to 'engines') diff --git a/engines/sci/engine/kgraphics.cpp b/engines/sci/engine/kgraphics.cpp index 6e3b8ae115..ec086580dd 100644 --- a/engines/sci/engine/kgraphics.cpp +++ b/engines/sci/engine/kgraphics.cpp @@ -457,8 +457,8 @@ void _k_graph_rebuild_port_with_color(EngineState *s, gfx_color_t newbgcolor) { GfxPort *port = s->port; GfxPort *newport; - newport = sciw_new_window(s, port->zone, port->font_nr, port->_color, newbgcolor, - s->titlebar_port->font_nr, s->ega_colors[15], s->ega_colors[8], + newport = sciw_new_window(s, port->zone, port->_font, port->_color, newbgcolor, + s->titlebar_port->_font, s->ega_colors[15], s->ega_colors[8], port->title_text, port->port_flags & ~kWindowTransparent); if (s->dyn_views) { @@ -2529,8 +2529,8 @@ reg_t kNewWindow(EngineState *s, int funct_nr, int argc, reg_t *argv) { lWhite.priority = -1; lWhite.control = -1; - window = sciw_new_window(s, gfx_rect(x, y, xl, yl), s->titlebar_port->font_nr, fgcolor, bgcolor, - s->titlebar_port->font_nr, lWhite, black, argv[4 + argextra].segment ? + window = sciw_new_window(s, gfx_rect(x, y, xl, yl), s->titlebar_port->_font, fgcolor, bgcolor, + s->titlebar_port->_font, lWhite, black, argv[4 + argextra].segment ? kernel_dereference_char_pointer(s, argv[4 + argextra], 0) : NULL, flags); // PQ3 has the interpreter store underBits implicitly. @@ -3143,7 +3143,7 @@ reg_t kDisplay(EngineState *s, int funct_nr, int argc, reg_t *argv) { gfx_alignment_t halign = ALIGN_LEFT; rect_t area = gfx_rect(port->draw_pos.x, port->draw_pos.y, 320 - port->draw_pos.x, 200 - port->draw_pos.y); int gray = port->gray_text; - int font_nr = port->font_nr; + int font_nr = port->_font; GfxText *text_handle; color0 = port->_color; diff --git a/engines/sci/engine/kmenu.cpp b/engines/sci/engine/kmenu.cpp index 2dd7fe8c9d..3fb2a0fd67 100644 --- a/engines/sci/engine/kmenu.cpp +++ b/engines/sci/engine/kmenu.cpp @@ -37,7 +37,7 @@ reg_t kAddMenu(EngineState *s, int funct_nr, int argc, reg_t *argv) { char *contents = kernel_dereference_char_pointer(s, argv[1], 0); s->_menubar->addMenu(s->gfx_state, name, - contents, s->titlebar_port->font_nr, argv[1]); + contents, s->titlebar_port->_font, argv[1]); return s->r_acc; diff --git a/engines/sci/gfx/gfx_gui.cpp b/engines/sci/gfx/gfx_gui.cpp index 81845602a5..da85878281 100644 --- a/engines/sci/gfx/gfx_gui.cpp +++ b/engines/sci/gfx/gfx_gui.cpp @@ -95,7 +95,7 @@ void sciw_set_status_bar(EngineState *s, GfxPort *status_bar, const Common::Stri if (!text.empty()) { GfxText *textw = gfxw_new_text(state, gfx_rect(0, 0, status_bar->_bounds.width, status_bar->_bounds.height), - status_bar->font_nr, text.c_str(), ALIGN_LEFT, ALIGN_CENTER, + status_bar->_font, text.c_str(), ALIGN_LEFT, ALIGN_CENTER, fg, fg, bg, kFontNoNewlines); list = make_titlebar_list(s, status_bar->_bounds, status_bar); @@ -172,7 +172,7 @@ GfxPort *sciw_new_window(EngineState *s, sciw_make_window_fit(&area, s->wm_port); win = gfxw_new_port(visual, s->wm_port, area, color, bgcolor); - win->font_nr = font; + win->_font = font; win->title_text = title; win->port_flags = flags; @@ -502,12 +502,12 @@ GfxList *sciw_new_list_control(GfxPort *port, reg_t ID, rect_t zone, int font_nr // Add up arrow list->add(GFXWC(list), GFXW(gfxw_new_text(port->_visual->gfx_state, gfx_rect(1, 0, zone.width - 2, 8), - port->font_nr, arr_up, ALIGN_CENTER, ALIGN_CENTER, + port->_font, arr_up, ALIGN_CENTER, ALIGN_CENTER, port->_color, port->_color, port->_bgcolor, 0))); // Add down arrow list->add(GFXWC(list), GFXW(gfxw_new_text(port->_visual->gfx_state, gfx_rect(1, zone.height - 9, zone.width - 2, 8), - port->font_nr, arr_down, ALIGN_CENTER, ALIGN_CENTER, + port->_font, arr_down, ALIGN_CENTER, ALIGN_CENTER, port->_color, port->_color, port->_bgcolor, 0))); if (list_top & 1) { // Hack to work around aggressive caching @@ -541,11 +541,11 @@ void sciw_set_menubar(EngineState *s, GfxPort *status_bar, Menubar *menubar, int list->add(GFXWC(list), GFXW(gfxw_new_box(status_bar->_visual->gfx_state, gfx_rect(offset, 0, width, MENU_BAR_HEIGHT), status_bar->_color, status_bar->_color, GFX_BOX_SHADE_FLAT))); list->add(GFXWC(list), GFXW(gfxw_new_text(s->gfx_state, gfx_rect(offset, 0, width, MENU_BAR_HEIGHT), - status_bar->font_nr, menu->_title.c_str(), ALIGN_CENTER, ALIGN_CENTER, + status_bar->_font, menu->_title.c_str(), ALIGN_CENTER, ALIGN_CENTER, status_bar->_bgcolor, status_bar->_bgcolor, status_bar->_color, kFontNoNewlines))); } else list->add(GFXWC(list), GFXW(gfxw_new_text(s->gfx_state, gfx_rect(offset, 0, width, MENU_BAR_HEIGHT), - status_bar->font_nr, menu->_title.c_str(), ALIGN_CENTER, ALIGN_CENTER, + status_bar->_font, menu->_title.c_str(), ALIGN_CENTER, ALIGN_CENTER, status_bar->_color, status_bar->_color, status_bar->_bgcolor, kFontNoNewlines))); offset += width; } @@ -574,7 +574,7 @@ GfxPort *sciw_new_menu(EngineState *s, GfxPort *status_bar, Menubar *menubar, in area.width = menu->_width - 1; area.height = menu->_items.size() * 10; - retval = sciw_new_window(s, area, status_bar->font_nr, status_bar->_color, status_bar->_bgcolor, + retval = sciw_new_window(s, area, status_bar->_font, status_bar->_color, status_bar->_bgcolor, 0, status_bar->_color, status_bar->_bgcolor, NULL, kWindowNoDropShadow | kWindowTransparent); retval->set_visual(GFXW(retval), s->visual); @@ -606,12 +606,12 @@ GfxWidget *_make_menu_entry(MenuItem *item, int offset, int width, GfxPort *port xcolor = gray ? color : bgcolor; list->add(GFXWC(list), GFXW(gfxw_new_box(port->_visual->gfx_state, area, bgcolor, bgcolor, GFX_BOX_SHADE_FLAT))); - list->add(GFXWC(list), GFXW(gfxw_new_text(port->_visual->gfx_state, area, port->font_nr, item->_text.c_str(), ALIGN_LEFT, ALIGN_CENTER, + list->add(GFXWC(list), GFXW(gfxw_new_text(port->_visual->gfx_state, area, port->_font, item->_text.c_str(), ALIGN_LEFT, ALIGN_CENTER, color, xcolor, bgcolor, kFontNoNewlines))); if (!item->_keytext.empty()) { area.width -= MENU_BOX_RIGHT_PADDING; - list->add(GFXWC(list), GFXW(gfxw_new_text(port->_visual->gfx_state, area, port->font_nr, item->_keytext.c_str(), ALIGN_RIGHT, ALIGN_CENTER, + list->add(GFXWC(list), GFXW(gfxw_new_text(port->_visual->gfx_state, area, port->_font, item->_keytext.c_str(), ALIGN_RIGHT, ALIGN_CENTER, color, xcolor, bgcolor, kFontNoNewlines))); } diff --git a/engines/sci/gfx/gfx_state_internal.h b/engines/sci/gfx/gfx_state_internal.h index c064cf7028..6794c13cb4 100644 --- a/engines/sci/gfx/gfx_state_internal.h +++ b/engines/sci/gfx/gfx_state_internal.h @@ -167,7 +167,7 @@ struct GfxDynView : public GfxView { #define GFXW_IS_TEXT(widget) ((widget)->_type == GFXW_TEXT) struct GfxText : public GfxWidget { - int font_nr; + int _font; int lines_nr, lineheight, lastline_width; char *text; gfx_alignment_t halign, valign; @@ -219,7 +219,7 @@ struct GfxList : public GfxContainer { #define GFXW_IS_VISUAL(widget) ((widget)->_type == GFXW_VISUAL) struct GfxVisual : public GfxContainer { Common::Array _portRefs; /* References to ports */ - int font_nr; /* Default font */ + int _font; /* Default font */ gfx_state_t *gfx_state; GfxVisual(gfx_state_t *state, int font); @@ -230,7 +230,7 @@ struct GfxPort : public GfxContainer { GfxList *decorations; /* optional window decorations- drawn before the contents */ GfxWidget *port_bg; /* Port background widget or NULL */ gfx_color_t _color, _bgcolor; - int font_nr; + int _font; Common::Point draw_pos; /* Drawing position */ gfxw_snapshot_t *restore_snap; /* Snapshot to be restored automagically, experimental feature used in the PQ3 interpreter */ diff --git a/engines/sci/gfx/gfx_widgets.cpp b/engines/sci/gfx/gfx_widgets.cpp index 9d0ba2545f..8be8077c88 100644 --- a/engines/sci/gfx/gfx_widgets.cpp +++ b/engines/sci/gfx/gfx_widgets.cpp @@ -917,7 +917,7 @@ static int _gfxwop_text_alloc_and_draw(GfxWidget *widget, Common::Point pos) { GfxText *text = (GfxText *)widget; DRAW_ASSERT(widget, GFXW_TEXT); - text->text_handle = gfxop_new_text(widget->_visual->gfx_state, text->font_nr, text->text, text->_bounds.width, + text->text_handle = gfxop_new_text(widget->_visual->gfx_state, text->_font, text->text, text->_bounds.width, text->halign, text->valign, text->_color1, text->_color2, text->_bgcolor, text->text_flags); text->draw = _gfxwop_text_draw; @@ -948,7 +948,7 @@ static int _gfxwop_text_equals(GfxWidget *widget, GfxWidget *other) { if (wtext->text_flags != otext->text_flags) return 0; - if (wtext->font_nr != otext->font_nr) + if (wtext->_font != otext->_font) return 0; /* if (!(_color_equals(wtext->_color1, otext->_color1) && _color_equals(wtext->_color2, otext->_color2) @@ -990,7 +990,7 @@ GfxText::GfxText(gfx_state_t *state, rect_t area, int font, const char *text_, g : GfxWidget(GFXW_TEXT) { _widgetPriority = _gfxw_color_get_priority(color1_); - font_nr = font; + _font = font; text = (char *)sci_malloc(strlen(text_) + 1); halign = halign_; valign = valign_; @@ -1612,7 +1612,7 @@ GfxVisual *gfxw_new_visual(gfx_state_t *state, int font) { GfxVisual::GfxVisual(gfx_state_t *state, int font) : GfxContainer(gfx_rect(0, 0, 320, 200), GFXW_VISUAL) { - font_nr = font; + _font = font; gfx_state = state; _gfxw_set_ops_VISUAL(this); @@ -1696,7 +1696,7 @@ static int _gfxwop_port_print(GfxWidget *widget, int indentation) { _gfxw_print_widget(widget, indentation); sciprintf("PORT"); - sciprintf(" font=%d drawpos=(%d,%d)", port->font_nr, port->draw_pos.x, port->draw_pos.y); + sciprintf(" font=%d drawpos=(%d,%d)", port->_font, port->draw_pos.x, port->draw_pos.y); if (port->gray_text) sciprintf(" (gray)"); _w_gfxwop_container_print(GFXW(port), indentation); @@ -1794,7 +1794,7 @@ GfxPort::GfxPort(GfxVisual *visual_, rect_t area, gfx_color_t fgcolor, gfx_color gray_text = 0; _color = fgcolor; _bgcolor = bgcolor_; - font_nr = visual_->font_nr; + _font = visual_->_font; _ID = _visual_find_free_ID(visual_); visual_->_portRefs[_ID] = this; -- cgit v1.2.3