diff options
author | Eugene Sandulenko | 2010-09-05 21:15:35 +0000 |
---|---|---|
committer | Eugene Sandulenko | 2010-10-12 23:37:35 +0000 |
commit | 7ad20e33378673b7e4c1c3ebcf602c22cdb95e61 (patch) | |
tree | fed8d7b6e4e8f4ead9accc0d29f214eb5010c99d /engines/sword25 | |
parent | a773c7a84268f7b7a7a1f8ecd00e7a14e1ab667c (diff) | |
download | scummvm-rg350-7ad20e33378673b7e4c1c3ebcf602c22cdb95e61.tar.gz scummvm-rg350-7ad20e33378673b7e4c1c3ebcf602c22cdb95e61.tar.bz2 scummvm-rg350-7ad20e33378673b7e4c1c3ebcf602c22cdb95e61.zip |
SWORD25: Further fixes to vector images. Still not finished.
svn-id: r53322
Diffstat (limited to 'engines/sword25')
-rw-r--r-- | engines/sword25/gfx/image/vectorimage.cpp | 4 | ||||
-rw-r--r-- | engines/sword25/gfx/image/vectorimagerenderer.cpp | 17 |
2 files changed, 14 insertions, 7 deletions
diff --git a/engines/sword25/gfx/image/vectorimage.cpp b/engines/sword25/gfx/image/vectorimage.cpp index 6b8c2bb8be..5e95502748 100644 --- a/engines/sword25/gfx/image/vectorimage.cpp +++ b/engines/sword25/gfx/image/vectorimage.cpp @@ -446,8 +446,8 @@ bool VectorImage::parseDefineShape(uint shapeType, SWFBitStream &bs) { double newX = curX + controlDeltaX; double newY = curY + controlDeltaY; - double anchorX = curX + anchorDeltaX; - double anchorY = curY + anchorDeltaY; + double anchorX = newX + anchorDeltaX; + double anchorY = newY + anchorDeltaY; #define WEIGHT (2.0/3.0) diff --git a/engines/sword25/gfx/image/vectorimagerenderer.cpp b/engines/sword25/gfx/image/vectorimagerenderer.cpp index f6013605d0..715d777c83 100644 --- a/engines/sword25/gfx/image/vectorimagerenderer.cpp +++ b/engines/sword25/gfx/image/vectorimagerenderer.cpp @@ -341,9 +341,16 @@ void drawBez(ArtBpath *bez1, ArtBpath *bez2, art_u8 *buffer, int width, int heig #endif vec1 = art_bez_path_to_vec(bez1, 0.5); - vec2 = art_bez_path_to_vec(bez2, 0.5); - vec2 = art_vpath_reverse_free(vec2); - vec = art_vpath_cat(vec1, vec2); + if (bez2 != 0) { + vec2 = art_bez_path_to_vec(bez2, 0.5); + vec2 = art_vpath_reverse_free(vec2); + vec = art_vpath_cat(vec1, vec2); + + art_free(vec1); + art_free(vec2); + } else { + vec = vec1; + } if (scaleX != 1.0 || scaleY != 1.0) { ArtVpath *vect; @@ -363,7 +370,7 @@ void drawBez(ArtBpath *bez1, ArtBpath *bez2, art_u8 *buffer, int width, int heig vec = vect; } - if (penWidth != -1) { + if (bez2 == 0) { // Line drawing svp = art_svp_vpath_stroke(vec, ART_PATH_STROKE_JOIN_ROUND, ART_PATH_STROKE_CAP_ROUND, penWidth, 1.0, 0.5); } else { svp = art_svp_from_vpath(vec); @@ -427,7 +434,7 @@ void VectorImage::render(int width, int height) { (*fill0pos).code = ART_END; (*fill1pos).code = ART_END; - drawBez(fill0, fill1, _pixelData, width, height, scaleX, scaleY, -1, _elements[e].getFillStyleColor(s)); + drawBez(fill1, fill0, _pixelData, width, height, scaleX, scaleY, -1, _elements[e].getFillStyleColor(s)); art_free(fill0); art_free(fill1); |