From e28439bebce7579eae3d793bc943b9030df80287 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Tue, 17 Feb 2009 19:15:37 +0000 Subject: point_t -> Common::Point svn-id: r38437 --- engines/sci/gfx/gfx_driver.cpp | 6 +-- engines/sci/gfx/gfx_line.cpp | 2 +- engines/sci/gfx/gfx_support.cpp | 4 +- engines/sci/gfx/operations.cpp | 82 +++++++++++++++++----------------- engines/sci/gfx/resource/sci_pic_0.cpp | 8 ++-- engines/sci/gfx/sci_widgets.cpp | 30 ++++++------- engines/sci/gfx/widgets.cpp | 68 ++++++++++++++-------------- 7 files changed, 100 insertions(+), 100 deletions(-) (limited to 'engines/sci/gfx') diff --git a/engines/sci/gfx/gfx_driver.cpp b/engines/sci/gfx/gfx_driver.cpp index 070b4b6e07..618d61ec84 100644 --- a/engines/sci/gfx/gfx_driver.cpp +++ b/engines/sci/gfx/gfx_driver.cpp @@ -162,7 +162,7 @@ lineColor2(byte *dst, int16 x1, int16 y1, int16 x2, int16 y2, uint32 color) { } static int -scummvm_draw_line(struct _gfx_driver *drv, point_t start, point_t end, +scummvm_draw_line(struct _gfx_driver *drv, Common::Point start, Common::Point end, gfx_color_t color, gfx_line_mode_t line_mode, gfx_line_style_t line_style) { uint32 scolor = color.visual.global_index; @@ -170,7 +170,7 @@ scummvm_draw_line(struct _gfx_driver *drv, point_t start, point_t end, int ysize = S->ysize; if (color.mask & GFX_MASK_VISUAL) { - point_t nstart, nend; + Common::Point nstart, nend; nstart.x = start.x; nstart.y = start.y; @@ -284,7 +284,7 @@ scummvm_grab_pixmap(struct _gfx_driver *drv, rect_t src, gfx_pixmap_t *pxm, // Buffer operations static int -scummvm_update(struct _gfx_driver *drv, rect_t src, point_t dest, gfx_buffer_t buffer) { +scummvm_update(struct _gfx_driver *drv, rect_t src, Common::Point dest, gfx_buffer_t buffer) { //TODO int data_source = (buffer == GFX_BUFFER_BACK) ? 2 : 1; int data_dest = data_source - 1; diff --git a/engines/sci/gfx/gfx_line.cpp b/engines/sci/gfx/gfx_line.cpp index 79bb79cef2..e38e7696e5 100644 --- a/engines/sci/gfx/gfx_line.cpp +++ b/engines/sci/gfx/gfx_line.cpp @@ -43,7 +43,7 @@ static inline -void DRAWLINE_FUNC(byte *buffer, int linewidth, point_t start, point_t end, unsigned int color) { +void DRAWLINE_FUNC(byte *buffer, int linewidth, Common::Point start, Common::Point end, unsigned int color) { int dx, dy, incrE, incrNE, d, finalx, finaly; int x = start.x; int y = start.y; diff --git a/engines/sci/gfx/gfx_support.cpp b/engines/sci/gfx/gfx_support.cpp index e88428c29f..a355154a78 100644 --- a/engines/sci/gfx/gfx_support.cpp +++ b/engines/sci/gfx/gfx_support.cpp @@ -61,7 +61,7 @@ int gfx_crossblit_alpha_threshold = 128; #undef DRAWLINE_FUNC inline void -gfx_draw_line_buffer(byte *buffer, int linewidth, int pixelwidth, point_t start, point_t end, unsigned int color) { +gfx_draw_line_buffer(byte *buffer, int linewidth, int pixelwidth, Common::Point start, Common::Point end, unsigned int color) { switch (pixelwidth) { case 1: @@ -91,7 +91,7 @@ gfx_draw_line_buffer(byte *buffer, int linewidth, int pixelwidth, point_t start, void -gfx_draw_line_pixmap_i(gfx_pixmap_t *pxm, point_t start, point_t end, int color) { +gfx_draw_line_pixmap_i(gfx_pixmap_t *pxm, Common::Point start, Common::Point end, int color) { gfx_draw_line_buffer(pxm->index_data, pxm->index_xl, 1, start, end, color); } diff --git a/engines/sci/gfx/operations.cpp b/engines/sci/gfx/operations.cpp index 4050f16d2a..0419257748 100644 --- a/engines/sci/gfx/operations.cpp +++ b/engines/sci/gfx/operations.cpp @@ -89,7 +89,7 @@ _gfxop_scale_rect(rect_t *rect, gfx_mode_t *mode) { } static void -_gfxop_scale_point(point_t *point, gfx_mode_t *mode) { +_gfxop_scale_point(Common::Point *point, gfx_mode_t *mode) { int xfact = mode->xfact; int yfact = mode->yfact; @@ -225,12 +225,12 @@ _gfxop_grab_pixmap(gfx_state_t *state, gfx_pixmap_t **pxmp, int x, int y, } static void -_gfxop_draw_control(gfx_pixmap_t *map, gfx_pixmap_t *pxm, int color, point_t pos) +_gfxop_draw_control(gfx_pixmap_t *map, gfx_pixmap_t *pxm, int color, Common::Point pos) DRAW_LOOP(1) /* Always draw */ #ifdef PRECISE_PRIORITY_MAP static void -_gfxop_draw_priority(gfx_pixmap_t *map, gfx_pixmap_t *pxm, int color, point_t pos) +_gfxop_draw_priority(gfx_pixmap_t *map, gfx_pixmap_t *pxm, int color, Common::Point pos) DRAW_LOOP(map->index_data[offset] < color) /* Draw only lower priority */ #endif @@ -285,7 +285,7 @@ _gfxop_draw_pixmap(gfx_driver_t *driver, gfx_pixmap_t *pxm, int priority, int co rect_t clipped_dest = gfx_rect(dest.x, dest.y, dest.xl, dest.yl); if (control >= 0 || priority >= 0) { - point_t original_pos = gfx_point(dest.x / driver->mode->xfact, + Common::Point original_pos = Common::Point(dest.x / driver->mode->xfact, dest.y / driver->mode->yfact); if (control >= 0) @@ -981,7 +981,7 @@ line_clip(rect_t *line, rect_t clip, int xfact, int yfact) } static int -point_clip(point_t *start, point_t *end, rect_t clip, int xfact, int yfact) { +point_clip(Common::Point *start, Common::Point *end, rect_t clip, int xfact, int yfact) { rect_t line = gfx_rect(start->x, start->y, end->x - start->x, end->y - start->y); int retval = line_clip(&line, clip, xfact, yfact); @@ -997,14 +997,14 @@ point_clip(point_t *start, point_t *end, rect_t clip, int xfact, int yfact) { static void -draw_line_to_control_map(gfx_state_t *state, point_t start, point_t end, gfx_color_t color) { +draw_line_to_control_map(gfx_state_t *state, Common::Point start, Common::Point end, gfx_color_t color) { if (color.mask & GFX_MASK_CONTROL) if (!point_clip(&start, &end, state->clip_zone_unscaled, 0, 0)) gfx_draw_line_pixmap_i(state->control_map, start, end, color.control); } static int -simulate_stippled_line_draw(gfx_driver_t *driver, int skipone, point_t start, point_t end, gfx_color_t color, gfx_line_mode_t line_mode) +simulate_stippled_line_draw(gfx_driver_t *driver, int skipone, Common::Point start, Common::Point end, gfx_color_t color, gfx_line_mode_t line_mode) /* Draws a stippled line if this isn't supported by the driver (skipone is ignored ATM) */ { int xl = end.x - start.x; @@ -1018,12 +1018,12 @@ simulate_stippled_line_draw(gfx_driver_t *driver, int skipone, point_t start, po int length_left; if (!xl) { /* xl = 0, so we move along yl */ - posvar = &start.y; + posvar = (int *) &start.y; length = yl; delta = (yl < 0) ? -dbl_stepwidth : dbl_stepwidth; } else { assert(!yl); /* We don't do diagonals; that's not needed ATM. */ - posvar = &start.x; + posvar = (int *) &start.x; length = xl; delta = (xl < 0) ? -dbl_stepwidth : dbl_stepwidth; } @@ -1046,12 +1046,12 @@ simulate_stippled_line_draw(gfx_driver_t *driver, int skipone, point_t start, po while (length--) { int retval; - point_t nextpos = gfx_point(start.x + xl, start.y + yl); + Common::Point nextpos = Common::Point(start.x + xl, start.y + yl); if ((retval = driver->draw_line(driver, start, nextpos, color, line_mode, GFX_LINE_STYLE_NORMAL))) { GFXERROR("Failed to draw partial stippled line (%d,%d) -- (%d,%d)\n", - GFX_PRINT_POINT(start), GFX_PRINT_POINT(nextpos)); + start.x, start.y, nextpos.x, nextpos.y); return retval; } *posvar += delta; @@ -1059,7 +1059,7 @@ simulate_stippled_line_draw(gfx_driver_t *driver, int skipone, point_t start, po if (length_left) { int retval; - point_t nextpos; + Common::Point nextpos; if (length_left > stepwidth) length_left = stepwidth; @@ -1070,11 +1070,11 @@ simulate_stippled_line_draw(gfx_driver_t *driver, int skipone, point_t start, po if (yl) yl = length_left; - nextpos = gfx_point(start.x + xl, start.y + yl); + nextpos = Common::Point(start.x + xl, start.y + yl); if ((retval = driver->draw_line(driver, start, nextpos, color, line_mode, GFX_LINE_STYLE_NORMAL))) { GFXERROR("Failed to draw partial stippled line (%d,%d) -- (%d,%d)\n", - GFX_PRINT_POINT(start), GFX_PRINT_POINT(nextpos)); + start.x, start.y, nextpos.x, nextpos.y); return retval; } } @@ -1084,7 +1084,7 @@ simulate_stippled_line_draw(gfx_driver_t *driver, int skipone, point_t start, po static int -_gfxop_draw_line_clipped(gfx_state_t *state, point_t start, point_t end, gfx_color_t color, gfx_line_mode_t line_mode, +_gfxop_draw_line_clipped(gfx_state_t *state, Common::Point start, Common::Point end, gfx_color_t color, gfx_line_mode_t line_mode, gfx_line_style_t line_style) { int retval; int skipone = (start.x ^ end.y) & 1; /* Used for simulated line stippling */ @@ -1094,7 +1094,7 @@ _gfxop_draw_line_clipped(gfx_state_t *state, point_t start, point_t end, gfx_col /* First, make sure that the line is normalized */ if (start.y > end.y) { - point_t swap = start; + Common::Point swap = start; start = end; end = swap; } @@ -1110,7 +1110,7 @@ _gfxop_draw_line_clipped(gfx_state_t *state, point_t start, point_t end, gfx_col if (line_style == GFX_LINE_STYLE_STIPPLED) { if (start.x != end.x && start.y != end.y) { GFXWARN("Attempt to draw stippled line which is neither an hbar nor a vbar: (%d,%d) -- (%d,%d)\n", - GFX_PRINT_POINT(start), GFX_PRINT_POINT(end)); + start.x, start.y, end.x, end.y); return GFX_ERROR; } if (!(state->driver->capabilities & GFX_CAPABILITY_STIPPLED_LINES)) @@ -1123,14 +1123,14 @@ _gfxop_draw_line_clipped(gfx_state_t *state, point_t start, point_t end, gfx_col if ((retval = state->driver->draw_line(state->driver, start, end, color, line_mode, line_style))) { GFXERROR("Failed to draw line (%d,%d) -- (%d,%d)\n", - GFX_PRINT_POINT(start), GFX_PRINT_POINT(end)); + start.x, start.y, end.x, end.y); return retval; } return GFX_OK; } int -gfxop_draw_line(gfx_state_t *state, point_t start, point_t end, +gfxop_draw_line(gfx_state_t *state, Common::Point start, Common::Point end, gfx_color_t color, gfx_line_mode_t line_mode, gfx_line_style_t line_style) { int xfact, yfact; @@ -1164,8 +1164,8 @@ gfxop_draw_rectangle(gfx_state_t *state, rect_t rect, gfx_color_t color, gfx_lin int xfact, yfact; int xunit, yunit; int x, y, xl, yl; - point_t upper_left_u, upper_right_u, lower_left_u, lower_right_u; - point_t upper_left, upper_right, lower_left, lower_right; + Common::Point upper_left_u, upper_right_u, lower_left_u, lower_right_u; + Common::Point upper_left, upper_right, lower_left, lower_right; BASIC_CHECKS(GFX_FATAL); REMOVE_POINTER; @@ -1189,15 +1189,15 @@ gfxop_draw_rectangle(gfx_state_t *state, rect_t rect, gfx_color_t color, gfx_lin y = rect.y * yfact; } - upper_left_u = gfx_point(rect.x, rect.y); - upper_right_u = gfx_point(rect.x + rect.xl, rect.y); - lower_left_u = gfx_point(rect.x, rect.y + rect.yl); - lower_right_u = gfx_point(rect.x + rect.xl, rect.y + rect.yl); + upper_left_u = Common::Point(rect.x, rect.y); + upper_right_u = Common::Point(rect.x + rect.xl, rect.y); + lower_left_u = Common::Point(rect.x, rect.y + rect.yl); + lower_right_u = Common::Point(rect.x + rect.xl, rect.y + rect.yl); - upper_left = gfx_point(x, y); - upper_right = gfx_point(x + xl, y); - lower_left = gfx_point(x, y + yl); - lower_right = gfx_point(x + xl, y + yl); + upper_left = Common::Point(x, y); + upper_right = Common::Point(x + xl, y); + lower_left = Common::Point(x, y + yl); + lower_right = Common::Point(x + xl, y + yl); #define PARTIAL_LINE(pt1, pt2) \ retval |= _gfxop_draw_line_clipped(state, pt1, pt2, color, line_mode, line_style); \ @@ -1344,7 +1344,7 @@ _gfxop_buffer_propagate_box(gfx_state_t *state, rect_t box, gfx_buffer_t buffer) if (_gfxop_clip(&box, gfx_rect(0, 0, 320 * state->driver->mode->xfact, 200 * state->driver->mode->yfact))) return GFX_OK; - if ((error = state->driver->update(state->driver, box, gfx_point(box.x, box.y), buffer))) { + if ((error = state->driver->update(state->driver, box, Common::Point(box.x, box.y), buffer))) { GFXERROR("Error occured while updating region (%d,%d,%d,%d) in buffer %d\n", box.x, box.y, box.xl, box.yl, buffer); return error; @@ -1421,7 +1421,7 @@ gfxop_update(gfx_state_t *state) { /* We've been asked to re-draw the active full-screen image, essentially. */ rect_t rect = gfx_rect(0, 0, 320, 200); gfx_xlate_pixmap(state->fullscreen_override, state->driver->mode, GFX_XLATE_FILTER_NONE); - gfxop_draw_pixmap(state, state->fullscreen_override, rect, gfx_point(0, 0)); + gfxop_draw_pixmap(state, state->fullscreen_override, rect, Common::Point(0, 0)); retval |= _gfxop_update_box(state, rect); } @@ -1490,7 +1490,7 @@ _gfxop_full_pointer_refresh(gfx_state_t *state) { if (new_x != state->old_pointer_draw_pos.x || new_y != state->old_pointer_draw_pos.y) { - point_t pp_new = gfx_point(new_x / state->driver->mode->xfact, + Common::Point pp_new = Common::Point(new_x / state->driver->mode->xfact, new_y / state->driver->mode->yfact); if (!_gfxop_get_pointer_bounds(state, &pointer_bounds)) { @@ -1502,7 +1502,7 @@ _gfxop_full_pointer_refresh(gfx_state_t *state) { if (_gfxop_buffer_propagate_box(state, pointer_bounds, GFX_BUFFER_FRONT)) return 1; if (_gfxop_buffer_propagate_box(state, old_pointer_bounds, GFX_BUFFER_FRONT)) return 1; - state->old_pointer_draw_pos = gfx_point(new_x, new_y); + state->old_pointer_draw_pos = Common::Point(new_x, new_y); } else state->pointer_pos = pp_new; } @@ -1636,7 +1636,7 @@ gfxop_set_pointer_cursor(gfx_state_t *state, int nr) { int -gfxop_set_pointer_view(gfx_state_t *state, int nr, int loop, int cel, point_t *hotspot) { +gfxop_set_pointer_view(gfx_state_t *state, int nr, int loop, int cel, Common::Point *hotspot) { int real_loop = loop; int real_cel = cel; gfx_pixmap_t *new_pointer = NULL; @@ -1664,7 +1664,7 @@ gfxop_set_pointer_view(gfx_state_t *state, int nr, int loop, int cel, point_t * } int -gfxop_set_pointer_position(gfx_state_t *state, point_t pos) { +gfxop_set_pointer_position(gfx_state_t *state, Common::Point pos) { BASIC_CHECKS(GFX_ERROR); state->pointer_pos = pos; @@ -1966,7 +1966,7 @@ gfxop_overflow_cel(gfx_state_t *state, int nr, int *loop, int *cel) { int gfxop_get_cel_parameters(gfx_state_t *state, int nr, int loop, int cel, - int *width, int *height, point_t *offset) { + int *width, int *height, Common::Point *offset) { gfxr_view_t *view = NULL; gfx_pixmap_t *pxm = NULL; BASIC_CHECKS(GFX_ERROR); @@ -1988,7 +1988,7 @@ gfxop_get_cel_parameters(gfx_state_t *state, int nr, int loop, int cel, static int _gfxop_draw_cel_buffer(gfx_state_t *state, int nr, int loop, int cel, - point_t pos, gfx_color_t color, int static_buf, + Common::Point pos, gfx_color_t color, int static_buf, int palette) { int priority = (color.mask & GFX_MASK_PRIORITY) ? color.priority : -1; int control = (color.mask & GFX_MASK_CONTROL) ? color.control : -1; @@ -2024,14 +2024,14 @@ _gfxop_draw_cel_buffer(gfx_state_t *state, int nr, int loop, int cel, int -gfxop_draw_cel(gfx_state_t *state, int nr, int loop, int cel, point_t pos, +gfxop_draw_cel(gfx_state_t *state, int nr, int loop, int cel, Common::Point pos, gfx_color_t color, int palette) { return _gfxop_draw_cel_buffer(state, nr, loop, cel, pos, color, 0, palette); } int -gfxop_draw_cel_static(gfx_state_t *state, int nr, int loop, int cel, point_t pos, +gfxop_draw_cel_static(gfx_state_t *state, int nr, int loop, int cel, Common::Point pos, gfx_color_t color, int palette) { int retval; rect_t oldclip = state->clip_zone; @@ -2049,7 +2049,7 @@ gfxop_draw_cel_static(gfx_state_t *state, int nr, int loop, int cel, point_t pos int gfxop_draw_cel_static_clipped(gfx_state_t *state, int nr, int loop, int cel, - point_t pos, gfx_color_t color, int palette) { + Common::Point pos, gfx_color_t color, int palette) { return _gfxop_draw_cel_buffer(state, nr, loop, cel, pos, color, 1, palette); } @@ -2417,7 +2417,7 @@ gfxop_grab_pixmap(gfx_state_t *state, rect_t area) { } int -gfxop_draw_pixmap(gfx_state_t *state, gfx_pixmap_t *pxm, rect_t zone, point_t pos) { +gfxop_draw_pixmap(gfx_state_t *state, gfx_pixmap_t *pxm, rect_t zone, Common::Point pos) { rect_t target; BASIC_CHECKS(GFX_ERROR); diff --git a/engines/sci/gfx/resource/sci_pic_0.cpp b/engines/sci/gfx/resource/sci_pic_0.cpp index 6a574420da..a14f705727 100644 --- a/engines/sci/gfx/resource/sci_pic_0.cpp +++ b/engines/sci/gfx/resource/sci_pic_0.cpp @@ -959,8 +959,8 @@ _gfxr_draw_pattern(gfxr_pic_t *pic, int x, int y, int color, int priority, int c static inline void _gfxr_draw_subline(gfxr_pic_t *pic, int x, int y, int ex, int ey, int color, int priority, int drawenable) { - point_t start; - point_t end; + Common::Point start; + Common::Point end; start.x = x; start.y = y; @@ -969,7 +969,7 @@ _gfxr_draw_subline(gfxr_pic_t *pic, int x, int y, int ex, int ey, int color, int if (ex >= pic->visual_map->index_xl || ey >= pic->visual_map->index_yl || x < 0 || y < 0) { fprintf(stderr, "While drawing pic0: INVALID LINE %d,%d,%d,%d\n", - GFX_PRINT_POINT(start), GFX_PRINT_POINT(end)); + start.x, start.y, end.x, end.y); return; } @@ -1010,7 +1010,7 @@ _gfxr_draw_line(gfxr_pic_t *pic, int x, int y, int ex, int ey, int color, if (drawenable & GFX_MASK_CONTROL) { p0printf(" ctl:%x", control); - gfx_draw_line_pixmap_i(pic->control_map, gfx_point(x, y), gfx_point(x + line.xl, y + line.yl), control); + gfx_draw_line_pixmap_i(pic->control_map, Common::Point(x, y), Common::Point(x + line.xl, y + line.yl), control); } diff --git a/engines/sci/gfx/sci_widgets.cpp b/engines/sci/gfx/sci_widgets.cpp index 9e9174375f..97e2a0acd0 100644 --- a/engines/sci/gfx/sci_widgets.cpp +++ b/engines/sci/gfx/sci_widgets.cpp @@ -63,8 +63,8 @@ finish_titlebar_list(state_t *s, gfxw_list_t *list, gfxw_port_t *status_bar) { gfx_color_t black = s->ega_colors[0]; gfxw_primitive_t *line; - line = gfxw_new_line(gfx_point(0, status_bar->bounds.yl - 1), - gfx_point(status_bar->bounds.xl, status_bar->bounds.yl - 1), + line = gfxw_new_line(Common::Point(0, status_bar->bounds.yl - 1), + Common::Point(status_bar->bounds.xl, status_bar->bounds.yl - 1), black, GFX_LINE_MODE_CORRECT, GFX_LINE_STYLE_NORMAL); list->add((gfxw_container_t *) list, (gfxw_widget_t *) line); @@ -254,8 +254,8 @@ sciw_new_window(state_t *s, rect_t area, int font, gfx_color_t color, gfx_color_ if (flags & WINDOW_FLAG_TITLE) decorations->add((gfxw_container_t *) decorations, (gfxw_widget_t *) - gfxw_new_line(gfx_point(1, 9), - gfx_point(frame.xl - 2, 9), + gfxw_new_line(Common::Point(1, 9), + Common::Point(frame.xl - 2, 9), black, GFX_LINE_MODE_CORRECT, GFX_LINE_STYLE_NORMAL)); } else { decorations->add((gfxw_container_t *) decorations, (gfxw_widget_t *) @@ -277,7 +277,7 @@ sciw_new_window(state_t *s, rect_t area, int font, gfx_color_t color, gfx_color_ /**** Controls ****/ /*----------------*/ static inline rect_t -_move_and_extend_rect(rect_t rect, point_t point, int yplus) { +_move_and_extend_rect(rect_t rect, Common::Point point, int yplus) { return gfx_rect(rect.x + point.x, rect.y + point.y, rect.xl + 1, rect.yl + yplus); } @@ -326,7 +326,7 @@ sciw_new_button_control(gfxw_port_t *port, reg_t ID, rect_t zone, char *text, in zone.xl++; zone.yl++; - list = gfxw_new_list(_move_and_extend_rect(zone, gfx_point(port->zone.x, port->zone.y), 1), 0); + list = gfxw_new_list(_move_and_extend_rect(zone, Common::Point(port->zone.x, port->zone.y), 1), 0); gfxw_set_id(GFXW(list), ID.segment, ID.offset); @@ -361,7 +361,7 @@ sciw_new_button_control(gfxw_port_t *port, reg_t ID, rect_t zone, char *text, in gfxw_list_t * sciw_new_text_control(gfxw_port_t *port, reg_t ID, rect_t zone, char *text, int font, gfx_alignment_t align, char framed, char inverse) { - gfxw_list_t *list = gfxw_new_list(_move_and_extend_rect(zone, gfx_point(port->zone.x, port->zone.y), 2), 0); + gfxw_list_t *list = gfxw_new_list(_move_and_extend_rect(zone, Common::Point(port->zone.x, port->zone.y), 2), 0); gfxw_set_id(GFXW(list), ID.segment, ID.offset); @@ -387,7 +387,7 @@ sciw_new_edit_control(gfxw_port_t *port, reg_t ID, rect_t zone, char *text, int zone.xl++; zone.yl++; - list = gfxw_new_list(_move_and_extend_rect(zone, gfx_point(port->zone.x, port->zone.y), 1), 0); + list = gfxw_new_list(_move_and_extend_rect(zone, Common::Point(port->zone.x, port->zone.y), 1), 0); gfxw_set_id(GFXW(list), ID.segment, ID.offset); zone.x = 1; zone.y = 1; @@ -437,8 +437,8 @@ sciw_new_edit_control(gfxw_port_t *port, reg_t ID, rect_t zone, char *text, int }; if (cursor == strlen(text)) - list->add(GFXWC(list), GFXW(gfxw_new_line(gfx_point(zone.x, zone.y), - gfx_point(zone.x, zone.y + cursor_height - 1), + list->add(GFXWC(list), GFXW(gfxw_new_line(Common::Point(zone.x, zone.y), + Common::Point(zone.x, zone.y + cursor_height - 1), port->color, GFX_LINE_MODE_FAST, GFX_LINE_STYLE_NORMAL))); free(textdup); } @@ -456,7 +456,7 @@ sciw_new_edit_control(gfxw_port_t *port, reg_t ID, rect_t zone, char *text, int gfxw_list_t * sciw_new_icon_control(gfxw_port_t *port, reg_t ID, rect_t zone, int view, int loop, int cel, char frame, char inverse) { - gfxw_list_t *list = gfxw_new_list(_move_and_extend_rect(zone, gfx_point(port->zone.x, port->zone.y), 1), 0); + gfxw_list_t *list = gfxw_new_list(_move_and_extend_rect(zone, Common::Point(port->zone.x, port->zone.y), 1), 0); gfxw_widget_t *icon; gfxw_set_id(GFXW(list), ID.segment, ID.offset); @@ -468,7 +468,7 @@ sciw_new_icon_control(gfxw_port_t *port, reg_t ID, rect_t zone, int view, int lo zone.x = 0; zone.y = 0; - icon = GFXW(gfxw_new_view(port->visual->gfx_state, gfx_point(zone.x, zone.y), view, loop, cel, 0, -1, -1, + icon = GFXW(gfxw_new_view(port->visual->gfx_state, Common::Point(zone.x, zone.y), view, loop, cel, 0, -1, -1, ALIGN_LEFT, ALIGN_TOP, GFXW_VIEW_FLAG_DONT_MODIFY_OFFSET)); if (!icon) { @@ -500,7 +500,7 @@ sciw_new_list_control(gfxw_port_t *port, reg_t ID, rect_t zone, int font_nr, cha zone.xl++; zone.yl++; - list = gfxw_new_list(_move_and_extend_rect(zone, gfx_point(port->zone.x, port->zone.y), 1), 0); + list = gfxw_new_list(_move_and_extend_rect(zone, Common::Point(port->zone.x, port->zone.y), 1), 0); font_height = gfxop_get_font_height(port->visual->gfx_state, font_nr); columns = (zone.yl - 20); @@ -693,8 +693,8 @@ _make_menu_hbar(int offset, int width, gfxw_port_t *port, gfx_color_t color, gfx bgcolor = un_prioritize(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_line(gfx_point(0, 5), - gfx_point(width, 5), + list->add(GFXWC(list), GFXW(gfxw_new_line(Common::Point(0, 5), + Common::Point(width, 5), color, GFX_LINE_MODE_FAST, GFX_LINE_STYLE_STIPPLED))); diff --git a/engines/sci/gfx/widgets.cpp b/engines/sci/gfx/widgets.cpp index 41d3dc3c62..fc0a177a50 100644 --- a/engines/sci/gfx/widgets.cpp +++ b/engines/sci/gfx/widgets.cpp @@ -34,7 +34,7 @@ # define DDIRTY if (0) fprintf #endif -point_t gfxw_point_zero = {0, 0}; +Common::Point gfxw_point_zero(0, 0); #define MAX_SERIAL_NUMBER 0x7fffffff static int widget_serial_number_counter = 0x10000; /* Avoid confusion with IDs */ @@ -412,25 +412,25 @@ _gfxwop_basic_superarea_of(gfxw_widget_t *widget, gfxw_widget_t *other) { /*-------------*/ static inline rect_t -_move_rect(rect_t rect, point_t point) { +_move_rect(rect_t rect, Common::Point point) { return gfx_rect(rect.x + point.x, rect.y + point.y, rect.xl, rect.yl); } static inline void -_split_rect(rect_t rect, point_t *p1, point_t *p2) { +_split_rect(rect_t rect, Common::Point *p1, Common::Point *p2) { p1->x = rect.x; p1->y = rect.y; p2->x = rect.x + rect.xl; p2->y = rect.y + rect.yl; } -static inline point_t -_move_point(rect_t rect, point_t point) { - return gfx_point(rect.x + point.x, rect.y + point.y); +static inline Common::Point +_move_point(rect_t rect, Common::Point point) { + return Common::Point(rect.x + point.x, rect.y + point.y); } static int -_gfxwop_box_draw(gfxw_widget_t *widget, point_t pos) { +_gfxwop_box_draw(gfxw_widget_t *widget, Common::Point pos) { gfxw_box_t *box = (gfxw_box_t *) widget; DRAW_ASSERT(widget, GFXW_BOX); GFX_ASSERT(gfxop_draw_box(box->visual->gfx_state, _move_rect(box->bounds, pos), box->color1, @@ -568,7 +568,7 @@ _gfxwop_primitive_equals(gfxw_widget_t *widget, gfxw_widget_t *other) { } static int -_gfxwop_rect_draw(gfxw_widget_t *widget, point_t pos) { +_gfxwop_rect_draw(gfxw_widget_t *widget, Common::Point pos) { gfxw_primitive_t *rect = (gfxw_primitive_t *) widget; DRAW_ASSERT(widget, GFXW_RECT); @@ -616,10 +616,10 @@ gfxw_new_rect(rect_t rect, gfx_color_t color, gfx_line_mode_t line_mode, gfx_lin /*-------------*/ static int -_gfxwop_line_draw(gfxw_widget_t *widget, point_t pos) { +_gfxwop_line_draw(gfxw_widget_t *widget, Common::Point pos) { gfxw_primitive_t *line = (gfxw_primitive_t *) widget; rect_t linepos = widget->bounds; - point_t p1, p2; + Common::Point p1, p2; linepos.xl--; linepos.yl--; @@ -662,7 +662,7 @@ _gfxw_set_ops_LINE(gfxw_widget_t *prim) { } gfxw_primitive_t * -gfxw_new_line(point_t start, point_t end, gfx_color_t color, gfx_line_mode_t line_mode, gfx_line_style_t line_style) { +gfxw_new_line(Common::Point start, Common::Point end, gfx_color_t color, gfx_line_mode_t line_mode, gfx_line_style_t line_style) { gfxw_primitive_t *prim; /* Encode into internal representation */ rect_t line = gfx_rect(start.x, start.y, end.x - start.x, end.y - start.y); @@ -698,11 +698,11 @@ gfxw_new_line(point_t start, point_t end, gfx_color_t color, gfx_line_mode_t lin gfxw_view_t * -_gfxw_new_simple_view(gfx_state_t *state, point_t pos, int view, int loop, int cel, int palette, int priority, int control, +_gfxw_new_simple_view(gfx_state_t *state, Common::Point pos, int view, int loop, int cel, int palette, int priority, int control, gfx_alignment_t halign, gfx_alignment_t valign, int size, gfxw_widget_type_t type) { gfxw_view_t *widget; int width, height; - point_t offset; + Common::Point offset; if (!state) { GFXERROR("Attempt to create view widget with NULL state!\n"); @@ -747,19 +747,19 @@ _gfxw_new_simple_view(gfx_state_t *state, point_t pos, int view, int loop, int c } int -_gfxwop_view_draw(gfxw_widget_t *widget, point_t pos) { +_gfxwop_view_draw(gfxw_widget_t *widget, Common::Point pos) { gfxw_view_t *view = (gfxw_view_t *) widget; DRAW_ASSERT(widget, GFXW_VIEW); GFX_ASSERT(gfxop_draw_cel(view->visual->gfx_state, view->view, view->loop, - view->cel, gfx_point(view->pos.x + pos.x, view->pos.y + pos.y), + view->cel, Common::Point(view->pos.x + pos.x, view->pos.y + pos.y), view->color, view->palette)); return 0; } static int -_gfxwop_static_view_draw(gfxw_widget_t *widget, point_t pos) { +_gfxwop_static_view_draw(gfxw_widget_t *widget, Common::Point pos) { gfxw_view_t *view = (gfxw_view_t *) widget; DRAW_ASSERT(widget, GFXW_VIEW); @@ -805,13 +805,13 @@ _gfxw_set_ops_VIEW(gfxw_widget_t *view, char stat) { } gfxw_view_t * -gfxw_new_view(gfx_state_t *state, point_t pos, int view_nr, int loop, int cel, int palette, int priority, int control, +gfxw_new_view(gfx_state_t *state, Common::Point pos, int view_nr, int loop, int cel, int palette, int priority, int control, gfx_alignment_t halign, gfx_alignment_t valign, int flags) { gfxw_view_t *view; if (flags & GFXW_VIEW_FLAG_DONT_MODIFY_OFFSET) { int foo; - point_t offset; + Common::Point offset; gfxop_get_cel_parameters(state, view_nr, loop, cel, &foo, &foo, &offset); pos.x += offset.x; pos.y += offset.y; @@ -830,7 +830,7 @@ gfxw_new_view(gfx_state_t *state, point_t pos, int view_nr, int loop, int cel, i /*---------------------*/ static int -_gfxwop_dyn_view_draw(gfxw_widget_t *widget, point_t pos) { +_gfxwop_dyn_view_draw(gfxw_widget_t *widget, Common::Point pos) { gfxw_dyn_view_t *view = (gfxw_dyn_view_t *) widget; DRAW_ASSERT(widget, GFXW_DYN_VIEW); @@ -852,12 +852,12 @@ _gfxwop_dyn_view_draw(gfxw_widget_t *widget, point_t pos) { } static int -_gfxwop_draw_nop(gfxw_widget_t *widget, point_t pos) { +_gfxwop_draw_nop(gfxw_widget_t *widget, Common::Point pos) { return 0; } static int -_gfxwop_pic_view_draw(gfxw_widget_t *widget, point_t pos) { +_gfxwop_pic_view_draw(gfxw_widget_t *widget, Common::Point pos) { gfxw_dyn_view_t *view = (gfxw_dyn_view_t *) widget; DRAW_ASSERT(widget, GFXW_PIC_VIEW); @@ -980,12 +980,12 @@ _gfxw_set_ops_PICVIEW(gfxw_widget_t *widget) { } gfxw_dyn_view_t * -gfxw_new_dyn_view(gfx_state_t *state, point_t pos, int z, int view, int loop, int cel, int palette, int priority, int control, +gfxw_new_dyn_view(gfx_state_t *state, Common::Point pos, int z, int view, int loop, int cel, int palette, int priority, int control, gfx_alignment_t halign, gfx_alignment_t valign, int sequence) { gfxw_dyn_view_t *widget; int width, height; int xalignmod, yalignmod; - point_t offset; + Common::Point offset; if (!state) { GFXERROR("Attempt to create view widget with NULL state!\n"); @@ -1062,7 +1062,7 @@ _gfxwop_text_free(gfxw_widget_t *widget) { } static int -_gfxwop_text_draw(gfxw_widget_t *widget, point_t pos) { +_gfxwop_text_draw(gfxw_widget_t *widget, Common::Point pos) { gfxw_text_t *text = (gfxw_text_t *) widget; DRAW_ASSERT(widget, GFXW_TEXT); @@ -1072,7 +1072,7 @@ _gfxwop_text_draw(gfxw_widget_t *widget, point_t pos) { } static int -_gfxwop_text_alloc_and_draw(gfxw_widget_t *widget, point_t pos) { +_gfxwop_text_alloc_and_draw(gfxw_widget_t *widget, Common::Point pos) { gfxw_text_t *text = (gfxw_text_t *) widget; DRAW_ASSERT(widget, GFXW_TEXT); @@ -1220,7 +1220,7 @@ gfxw_text_info(gfx_state_t *state, gfxw_text_t *text, int *lines, static int _gfxwop_container_add_dirty_rel(gfxw_container_t *cont, rect_t rect, int propagate) { DDIRTY(stderr, "->container_add_dirty_rel(%d,%d,%d,%d, %d)\n", GFX_PRINT_RECT(rect), propagate); - return cont->add_dirty_abs(cont, _move_rect(rect, gfx_point(cont->zone.x, cont->zone.y)), propagate); + return cont->add_dirty_abs(cont, _move_rect(rect, Common::Point(cont->zone.x, cont->zone.y)), propagate); } static inline void @@ -1384,7 +1384,7 @@ _gfxwop_container_draw_contents(gfxw_widget_t *widget, gfxw_widget_t *contents) ** descend into containers. ** Doing this is relatively cheap, though. */ if (draw_noncontainers || GFXW_IS_CONTAINER(seeker)) - seeker->draw(seeker, gfx_point(container->zone.x, container->zone.y)); + seeker->draw(seeker, Common::Point(container->zone.x, container->zone.y)); if (!dirty->next) seeker->flags &= ~GFXW_FLAG_DIRTY; @@ -1581,7 +1581,7 @@ _gfxwop_container_add(gfxw_container_t *container, gfxw_widget_t *widget) { /*------------------------------*/ static int -_gfxwop_list_draw(gfxw_widget_t *list, point_t pos) { +_gfxwop_list_draw(gfxw_widget_t *list, Common::Point pos) { DRAW_ASSERT(list, GFXW_LIST); _gfxwop_container_draw_contents(list, ((gfxw_list_t *)list)->contents); @@ -1592,7 +1592,7 @@ _gfxwop_list_draw(gfxw_widget_t *list, point_t pos) { } static int -_gfxwop_sorted_list_draw(gfxw_widget_t *list, point_t pos) { +_gfxwop_sorted_list_draw(gfxw_widget_t *list, Common::Point pos) { DRAW_ASSERT(list, GFXW_SORTED_LIST); _gfxwop_container_draw_contents(list, ((gfxw_list_t *)list)->contents); @@ -1788,7 +1788,7 @@ gfxw_new_list(rect_t area, int sorted) { /*---------------*/ static int -_gfxwop_visual_draw(gfxw_widget_t *widget, point_t pos) { +_gfxwop_visual_draw(gfxw_widget_t *widget, Common::Point pos) { gfxw_visual_t *visual = (gfxw_visual_t *) widget; gfx_dirty_rect_t *dirty = visual->dirty; DRAW_ASSERT(widget, GFXW_VISUAL); @@ -1936,7 +1936,7 @@ _gfxwop_add_dirty_rects(gfxw_container_t *dest, gfx_dirty_rect_t *src) { /*-------------*/ static int -_gfxwop_port_draw(gfxw_widget_t *widget, point_t pos) { +_gfxwop_port_draw(gfxw_widget_t *widget, Common::Point pos) { gfxw_port_t *port = (gfxw_port_t *) widget; DRAW_ASSERT(widget, GFXW_PORT); @@ -2098,7 +2098,7 @@ gfxw_new_port(gfxw_visual_t *visual, gfxw_port_t *predecessor, rect_t area, gfx_ widget->parent = NULL; widget->decorations = NULL; widget->title_text = NULL; - widget->draw_pos = gfx_point(0, 0); + widget->draw_pos = Common::Point(0, 0); widget->gray_text = 0; widget->color = fgcolor; widget->bgcolor = bgcolor; @@ -2409,7 +2409,7 @@ gfxw_widget_intersects_chrono(gfxw_list_t *tw, gfxw_widget_t *widget) { seeker = tw->contents; while (seeker) { - point_t origin; + Common::Point origin; rect_t bounds = widget->bounds; bounds = widget->bounds; @@ -2437,7 +2437,7 @@ gfxw_widget_reparent_chrono(gfxw_visual_t *visual, gfxw_widget_t *view, gfxw_lis intersector = gfxw_widget_intersects_chrono(tw, view); if (intersector) { - point_t origin = gfx_point(intersector->parent->zone.x, + Common::Point origin = Common::Point(intersector->parent->zone.x, intersector->parent->zone.y); gfxw_remove_widget_from_container(GFXWC(chrono), GFXW(tw)); -- cgit v1.2.3