diff options
author | Eugene Sandulenko | 2010-09-25 19:48:50 +0000 |
---|---|---|
committer | Eugene Sandulenko | 2010-10-13 00:04:40 +0000 |
commit | 0603a5884577c13f40c91de1ef67dbf245f48df5 (patch) | |
tree | 5f6a0520c64cdab9dfb11c98fac44a6a1e41b1fb /engines/sword25/gfx/image/art.h | |
parent | 91d1d9eb093067628837fb596d8eb4139a814624 (diff) | |
download | scummvm-rg350-0603a5884577c13f40c91de1ef67dbf245f48df5.tar.gz scummvm-rg350-0603a5884577c13f40c91de1ef67dbf245f48df5.tar.bz2 scummvm-rg350-0603a5884577c13f40c91de1ef67dbf245f48df5.zip |
SWORD25: Merged all art* code and cleaned it up
svn-id: r53384
Diffstat (limited to 'engines/sword25/gfx/image/art.h')
-rw-r--r-- | engines/sword25/gfx/image/art.h | 104 |
1 files changed, 102 insertions, 2 deletions
diff --git a/engines/sword25/gfx/image/art.h b/engines/sword25/gfx/image/art.h index 5888814e77..f0d0d7cacc 100644 --- a/engines/sword25/gfx/image/art.h +++ b/engines/sword25/gfx/image/art.h @@ -86,8 +86,6 @@ art_die(const char *fmt, ...) ART_GNUC_PRINTF(1, 2); void art_warn(const char *fmt, ...) ART_GNUC_PRINTF(1, 2); -#define ART_USE_NEW_INTERSECTOR - typedef struct _ArtDRect ArtDRect; typedef struct _ArtIRect ArtIRect; @@ -173,4 +171,106 @@ art_vpath_add_point(ArtVpath **p_vpath, int *pn_points, int *pn_points_max, ArtVpath *art_bez_path_to_vec(const ArtBpath *bez, double flatness); +/* The funky new SVP intersector. */ + +#ifndef ART_WIND_RULE_DEFINED +#define ART_WIND_RULE_DEFINED +typedef enum { + ART_WIND_RULE_NONZERO, + ART_WIND_RULE_INTERSECT, + ART_WIND_RULE_ODDEVEN, + ART_WIND_RULE_POSITIVE +} ArtWindRule; +#endif + +typedef struct _ArtSvpWriter ArtSvpWriter; + +struct _ArtSvpWriter { + int (*add_segment)(ArtSvpWriter *self, int wind_left, int delta_wind, + double x, double y); + void (*add_point)(ArtSvpWriter *self, int seg_id, double x, double y); + void (*close_segment)(ArtSvpWriter *self, int seg_id); +}; + +ArtSvpWriter * +art_svp_writer_rewind_new(ArtWindRule rule); + +ArtSVP * +art_svp_writer_rewind_reap(ArtSvpWriter *self); + +int +art_svp_seg_compare(const void *s1, const void *s2); + +void +art_svp_intersector(const ArtSVP *in, ArtSvpWriter *out); + + +/* Sort vector paths into sorted vector paths. */ + +ArtSVP * +art_svp_from_vpath(ArtVpath *vpath); + +/* Sort vector paths into sorted vector paths. */ + +typedef enum { + ART_PATH_STROKE_JOIN_MITER, + ART_PATH_STROKE_JOIN_ROUND, + ART_PATH_STROKE_JOIN_BEVEL +} ArtPathStrokeJoinType; + +typedef enum { + ART_PATH_STROKE_CAP_BUTT, + ART_PATH_STROKE_CAP_ROUND, + ART_PATH_STROKE_CAP_SQUARE +} ArtPathStrokeCapType; + +ArtSVP * +art_svp_vpath_stroke(ArtVpath *vpath, + ArtPathStrokeJoinType join, + ArtPathStrokeCapType cap, + double line_width, + double miter_limit, + double flatness); + +/* This version may have winding numbers exceeding 1. */ +ArtVpath * +art_svp_vpath_stroke_raw(ArtVpath *vpath, + ArtPathStrokeJoinType join, + ArtPathStrokeCapType cap, + double line_width, + double miter_limit, + double flatness); + + +/* The spiffy antialiased renderer for sorted vector paths. */ + +typedef struct _ArtSVPRenderAAStep ArtSVPRenderAAStep; +typedef struct _ArtSVPRenderAAIter ArtSVPRenderAAIter; + +struct _ArtSVPRenderAAStep { + int x; + int delta; /* stored with 16 fractional bits */ +}; + +ArtSVPRenderAAIter * +art_svp_render_aa_iter(const ArtSVP *svp, + int x0, int y0, int x1, int y1); + +void +art_svp_render_aa_iter_step(ArtSVPRenderAAIter *iter, int *p_start, + ArtSVPRenderAAStep **p_steps, int *p_n_steps); + +void +art_svp_render_aa_iter_done(ArtSVPRenderAAIter *iter); + +void +art_svp_render_aa(const ArtSVP *svp, + int x0, int y0, int x1, int y1, + void (*callback)(void *callback_data, + int y, + int start, + ArtSVPRenderAAStep *steps, int n_steps), + void *callback_data); + + #endif /* __ART_MISC_H__ */ |