diff options
author | Filippos Karapetis | 2009-02-17 19:15:37 +0000 |
---|---|---|
committer | Filippos Karapetis | 2009-02-17 19:15:37 +0000 |
commit | e28439bebce7579eae3d793bc943b9030df80287 (patch) | |
tree | ddaeaacee4eb16554b6336a9536fcff2a9d018e7 /engines/sci/include | |
parent | a113102d52486c3650b8f5105b4d2bf2a514f54a (diff) | |
download | scummvm-rg350-e28439bebce7579eae3d793bc943b9030df80287.tar.gz scummvm-rg350-e28439bebce7579eae3d793bc943b9030df80287.tar.bz2 scummvm-rg350-e28439bebce7579eae3d793bc943b9030df80287.zip |
point_t -> Common::Point
svn-id: r38437
Diffstat (limited to 'engines/sci/include')
-rw-r--r-- | engines/sci/include/gfx_driver.h | 10 | ||||
-rw-r--r-- | engines/sci/include/gfx_operations.h | 38 | ||||
-rw-r--r-- | engines/sci/include/gfx_state_internal.h | 6 | ||||
-rw-r--r-- | engines/sci/include/gfx_system.h | 27 | ||||
-rw-r--r-- | engines/sci/include/gfx_tools.h | 12 | ||||
-rw-r--r-- | engines/sci/include/gfx_widgets.h | 18 |
6 files changed, 45 insertions, 66 deletions
diff --git a/engines/sci/include/gfx_driver.h b/engines/sci/include/gfx_driver.h index 1bb74847d4..a3ea66a9b2 100644 --- a/engines/sci/include/gfx_driver.h +++ b/engines/sci/include/gfx_driver.h @@ -206,13 +206,13 @@ typedef struct _gfx_driver { /* Graphics driver */ /*** Drawing operations ***/ int (*draw_line)(struct _gfx_driver *drv, - point_t start, point_t end, + Common::Point start, Common::Point end, gfx_color_t color, gfx_line_mode_t line_mode, gfx_line_style_t line_style); /* Draws a single line to the back buffer. ** Parameters: (gfx_driver_t *) drv: The driver affected - ** (point_t) start: Starting point of the line to draw - ** (point_t) end: End point of the line to draw + ** (Common::Point) start: Starting point of the line to draw + ** (Common::Point) end: End point of the line to draw ** (gfx_color_t *) color: The color to draw with ** (int) line_mode: Any of the line modes ** (int) line_style: Any of the line styles @@ -297,12 +297,12 @@ typedef struct _gfx_driver { /* Graphics driver */ /*** Buffer operations ***/ - int (*update)(struct _gfx_driver *drv, rect_t src, point_t dest, + int (*update)(struct _gfx_driver *drv, rect_t src, Common::Point dest, gfx_buffer_t buffer); /* Updates the front buffer or the back buffers ** Parameters: (gfx_driver_t *) drv: The affected driver ** (rect_t) src: Source rectangle - ** (point_t) dest: Destination point + ** (Common::Point) dest: Destination point ** (int) buffer: One of GFX_BUFFER_FRONT or GFX_BUFFER_BACK ** Returns : (int) GFX_OK, GFX_ERROR or GFX_FATAL ** This function updates either the visual front buffer, or the two back diff --git a/engines/sci/include/gfx_operations.h b/engines/sci/include/gfx_operations.h index db4d9fad54..a5c53a7e0e 100644 --- a/engines/sci/include/gfx_operations.h +++ b/engines/sci/include/gfx_operations.h @@ -95,7 +95,7 @@ typedef struct { gfx_options_t *options; - point_t pointer_pos; /* Mouse pointer coordinates */ + Common::Point pointer_pos; /* Mouse pointer coordinates */ rect_t clip_zone_unscaled; /* The current UNSCALED clipping zone */ rect_t clip_zone; /* The current SCALED clipping zone; a cached scaled version of clip_zone_unscaled */ @@ -114,7 +114,7 @@ typedef struct { int mouse_pointer_visible; /* Whether the pointer is drawn right now */ - point_t old_pointer_draw_pos; /* Mouse pointer draw coordinates */ + Common::Point old_pointer_draw_pos; /* Mouse pointer draw coordinates */ rect_t pointer_bg_zone; /* old-pointer-draw-pos relative zone inside the pointer ** pixmap that was drawn */ @@ -244,13 +244,13 @@ gfxop_have_mouse(gfx_state_t *state); int gfxop_draw_line(gfx_state_t *state, - point_t start, point_t end, + Common::Point start, Common::Point end, gfx_color_t color, gfx_line_mode_t line_mode, gfx_line_style_t line_style); /* Renders a clipped line to the back buffer ** Parameters: (gfx_state_t *) state: The state affected -** (point_t) start: Starting point of the line -** (point_t) end: End point of the line +** (Common::Point) start: Starting point of the line +** (Common::Point) end: End point of the line ** (gfx_color_t) color: The color to use for drawing ** (gfx_line_mode_t) line_mode: Any valid line mode to use ** (gfx_line_style_t) line_style: The line style to use @@ -418,23 +418,23 @@ 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); /* Sets the mouse pointer to a view resource ** Parameters: (gfx_state_t *) state: The affected state ** (int) nr: Number of the view resource to use ** (int) loop: View loop to use ** (int) cel: View cel to use -** (point_t *) hotspot: Manually set hotspot to use, or NULL for default. +** (Common::Point *) hotspot: Manually set hotspot to use, or NULL for default. ** Returns : (int) GFX_OK or GFX_FATAL ** Use gfxop_set_pointer_cursor(state, GFXOP_NO_POINTER) to disable the ** pointer. */ int -gfxop_set_pointer_position(gfx_state_t *state, point_t pos); +gfxop_set_pointer_position(gfx_state_t *state, Common::Point pos); /* Teleports the mouse pointer to a specific position ** Parameters: (gfx_state_t *) state: The state the pointer is in -** (point_t) pos: The position to teleport it to +** (Common::Point) pos: The position to teleport it to ** Returns : (int) Any error code or GFX_OK ** Depending on the graphics driver, this operation may be without ** any effect @@ -503,7 +503,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); /* Retreives the width and height of a cel ** Parameters: (gfx_state_t *) state: The state to use ** (int) nr: Number of the view @@ -511,20 +511,20 @@ gfxop_get_cel_parameters(gfx_state_t *state, int nr, int loop, int cel, ** (int) cel: The cel (inside the loop) to look up ** (int *) width: The variable the width will be stored in ** (int *) height: The variable the height will be stored in -** (point_t *) offset: The variable the cel's x/y offset will be stored in +** (Common::Point *) offset: The variable the cel's x/y offset will be stored in ** Returns : (int) GFX_OK if the lookup succeeded, GFX_ERROR if the nr/loop/cel ** combination was invalid */ 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); /* Draws (part of) a cel to the back buffer ** Parameters: (gfx_state_t *) state: The state encapsulating the driver to draw with ** (int) nr: Number of the view to draw ** (int) loop: Loop of the cel to draw ** (int) cel: The cel number of the cel to draw -** (point_t) pos: The positino the cel is to be drawn to +** (Common::Point) pos: The positino the cel is to be drawn to ** (gfx_color_t color): The priority and control values to use for drawing ** (int) palette: The palette to use ** Returns : (int) GFX_OK or GFX_FATAL @@ -532,14 +532,14 @@ gfxop_draw_cel(gfx_state_t *state, int nr, int loop, int cel, point_t pos, 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); /* Draws a cel to the static buffer; no clipping is performed ** Parameters: (gfx_state_t *) state: The state encapsulating the driver to draw with ** (int) nr: Number of the view to draw ** (int) loop: Loop of the cel to draw ** (int) cel: The cel number of the cel to draw -** (point_t) pos: The positino the cel is to be drawn to +** (Common::Point) pos: The positino the cel is to be drawn to ** (gfx_color_t color): The priority and control values to use for drawing ** (int) palette: The palette to use ** Returns : (int) GFX_OK or GFX_FATAL @@ -548,14 +548,14 @@ 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, +gfxop_draw_cel_static_clipped(gfx_state_t *state, int nr, int loop, int cel, Common::Point pos, gfx_color_t color, int palette); /* Draws (part of) a clipped cel to the static buffer ** Parameters: (gfx_state_t *) state: The state encapsulating the driver to draw with ** (int) nr: Number of the view to draw ** (int) loop: Loop of the cel to draw ** (int) cel: The cel number of the cel to draw -** (point_t) pos: The positino the cel is to be drawn to +** (Common::Point) pos: The positino the cel is to be drawn to ** (gfx_color_t color): The priority and control values to use for drawing ** (int) palette: The palette to use ** Returns : (int) GFX_OK or GFX_FATAL @@ -691,12 +691,12 @@ 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); /* Draws part of a pixmap to the screen ** Parameters: (gfx_state_t *) state: The affected state ** (gfx_pixmap_t *) pxm: The pixmap to draw ** (rect_t) zone: The segment of the pixmap to draw -** (point_t) pos: The position the pixmap should be drawn to +** (Common::Point) pos: The position the pixmap should be drawn to ** Returns : (int) GFX_OK or any error code */ diff --git a/engines/sci/include/gfx_state_internal.h b/engines/sci/include/gfx_state_internal.h index 6b61347adf..92bb62fc79 100644 --- a/engines/sci/include/gfx_state_internal.h +++ b/engines/sci/include/gfx_state_internal.h @@ -80,7 +80,7 @@ struct _gfxw_widget; struct _gfxw_container_widget; struct _gfxw_visual; -typedef int gfxw_point_op(struct _gfxw_widget *, point_t); +typedef int gfxw_point_op(struct _gfxw_widget *, Common::Point); typedef int gfxw_visual_op(struct _gfxw_widget *, struct _gfxw_visual *); typedef int gfxw_op(struct _gfxw_widget *); typedef int gfxw_op_int(struct _gfxw_widget *, int); @@ -133,7 +133,7 @@ typedef struct { #define VIEW_COMMON \ WIDGET_COMMON; \ - point_t pos; /* Implies the value of 'bounds' in WIDGET_COMMON */ \ + Common::Point pos; /* Implies the value of 'bounds' in WIDGET_COMMON */ \ gfx_color_t color; \ int view, loop, cel; \ int palette @@ -221,7 +221,7 @@ typedef struct _gfxw_port { gfx_color_t color, bgcolor; int chrono_port; int font_nr; - point_t draw_pos; /* Drawing position */ + Common::Point draw_pos; /* Drawing position */ gfxw_snapshot_t *restore_snap; /* Snapshot to be restored automagically, experimental feature used in the PQ3 interpreter */ int port_flags; /* interpreter-dependant flags */ diff --git a/engines/sci/include/gfx_system.h b/engines/sci/include/gfx_system.h index bf3539239d..07888b832f 100644 --- a/engines/sci/include/gfx_system.h +++ b/engines/sci/include/gfx_system.h @@ -27,6 +27,7 @@ #define _SCI_GFX_SYSTEM_ #include "common/scummsys.h" +#include "common/rect.h" #include "sci/include/sci_memory.h" #include "sci/include/resource.h" @@ -232,35 +233,13 @@ gfx_rect_equals(rect_t a, rect_t b) { /* gfx_rect_fullscreen is declared in gfx/gfx_tools.c */ extern rect_t gfx_rect_fullscreen; -/*** points ***/ - -typedef struct { - int x, y; -} point_t; - -#define GFX_PRINT_POINT(p) (p).x, (p).y - -/* Generates a point_t from index data -** Parameters: (int x int) x,y: Indicated point -** Returns : (point_t) The resulting structure -*/ -static inline point_t -gfx_point(int x, int y) { - point_t point; - - point.x = x; - point.y = y; - - return point; -} - /* Translation operation for rects ** Parameters: (rect_t) rect: The rect to translate -** (point_t) offset: The offset to translate it by +** (Common::Point) offset: The offset to translate it by ** Returns : (rect_t) The translated rect */ static inline rect_t -gfx_rect_translate(rect_t rect, point_t offset) { +gfx_rect_translate(rect_t rect, Common::Point offset) { rect.x += offset.x; rect.y += offset.y; diff --git a/engines/sci/include/gfx_tools.h b/engines/sci/include/gfx_tools.h index 813117d633..8a36b4d9e9 100644 --- a/engines/sci/include/gfx_tools.h +++ b/engines/sci/include/gfx_tools.h @@ -147,11 +147,11 @@ gfx_free_pixmap(gfx_driver_t *driver, gfx_pixmap_t *pxm); */ 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); /* Draws a line to a pixmap's index data buffer ** Parameters: (gfx_pixmap_t *) pxm: The pixmap to draw to -** (point_t) start: Starting point of the line to draw -** (point_t) end: End point of the line to draw +** (Common::Point) start: Starting point of the line to draw +** (Common::Point) end: End point of the line to draw ** (int) color: The byte value to write ** Returns : (void) ** Remember, this only draws to the /index/ buffer, not to the drawable buffer. @@ -160,13 +160,13 @@ gfx_draw_line_pixmap_i(gfx_pixmap_t *pxm, point_t start, point_t end, int color) void gfx_draw_line_buffer(byte *buffer, int linewidth, int pixelwidth, - point_t start, point_t end, unsigned int color); + Common::Point start, Common::Point end, unsigned int color); /* Draws a line to a linear pixel buffer ** Parameters: (byte *) buffer: Pointer to the start of the buffer to draw to ** (int) linewidth: Number of bytes per pixel line in the buffer ** (int) pixelwidth: Number of bytes per pixel -** (point_t) start: Starting point of the line to draw -** (point_t) end: End point of the line to draw +** (Common::Point) start: Starting point of the line to draw +** (Common::Point) end: End point of the line to draw ** (rect_t) Coordinates: the line should be drawn to (must be clipped already) ** xl and yl describe relative offsets, as usual. ** (unsigned int) color: The color to draw (only the lowest 8 * pixelwidth bits are relevant) diff --git a/engines/sci/include/gfx_widgets.h b/engines/sci/include/gfx_widgets.h index b29562e722..1da0b91a81 100644 --- a/engines/sci/include/gfx_widgets.h +++ b/engines/sci/include/gfx_widgets.h @@ -79,7 +79,7 @@ /* Typecasts a container widget to gfxw_container_widget_t *. */ /* gfxw_point_zero is declared in gfx/widgets.c */ -extern point_t gfxw_point_zero; +extern Common::Point gfxw_point_zero; /*********************/ /* Widget operations */ @@ -90,10 +90,10 @@ extern point_t gfxw_point_zero; ** ** ** -** -- draw(gfxw_widget_t *self, point_t pos) +** -- draw(gfxw_widget_t *self, Common::Point pos) ** Draws the widget. ** Parameters: (gfxw_widget_t *) self: self reference -** (point_t) pos: The position to draw to (added to the widget's +** (Common::Point) pos: The position to draw to (added to the widget's ** internal position) ** Returns : (int) 0 ** The widget is drawn iff it is flagged as dirty. Invoking this operation on @@ -261,9 +261,9 @@ gfxw_new_rect(rect_t rect, gfx_color_t color, gfx_line_mode_t line_mode, gfx_lin */ 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); /* Creates a new line -** Parameters: (point_t * point_t) (start, line): The line origin and end point +** Parameters: (Common::Point * Common::Point) (start, line): The line origin and end point ** (gfx_color_t) color: The line's color ** (gfx_line_mode_t) line_mode: The line mode to use for drawing ** (gfx_line_style_t) line_style: The line style @@ -278,11 +278,11 @@ gfxw_new_line(point_t start, point_t end, gfx_color_t color, gfx_line_mode_t lin #define GFXW_VIEW_FLAG_DONT_MODIFY_OFFSET (1 << 1) gfxw_view_t * -gfxw_new_view(gfx_state_t *state, point_t pos, int view, int loop, int cel, int palette, int priority, int control, +gfxw_new_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 flags); /* Creates a new view (a cel, actually) ** Parameters: (gfx_state_t *) state: The graphics state -** (point_t) pos: The position to place the view at +** (Common::Point) pos: The position to place the view at ** (int x int x int) view, loop, cel: The global cel ID ** (int) priority: The priority to use for drawing, or -1 for none ** (int) control: The value to write to the control map, or -1 for none @@ -293,12 +293,12 @@ gfxw_new_view(gfx_state_t *state, point_t pos, int view, int loop, int cel, int */ 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, +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); /* Creates a new dyn view ** Parameters: (gfx_state_t *) state: The graphics state -** (point_t) pos: The position to place the dynamic view at +** (Common::Point) pos: The position to place the dynamic view at ** (int) z: The z coordinate ** (int x int x int) view, loop, cel: The global cel ID ** (int) priority: The priority to use for drawing, or -1 for none |