diff options
author | Eugene Sandulenko | 2010-09-03 23:14:34 +0000 |
---|---|---|
committer | Eugene Sandulenko | 2010-10-12 23:34:47 +0000 |
commit | bd3c4f2ae54d78fe7a37d51a8159f5587810d556 (patch) | |
tree | 1302f1cb651e6e74cec8578746906f437641b231 | |
parent | 7032c209a7e8bbd77bc7638f1a173a992bdb5e81 (diff) | |
download | scummvm-rg350-bd3c4f2ae54d78fe7a37d51a8159f5587810d556.tar.gz scummvm-rg350-bd3c4f2ae54d78fe7a37d51a8159f5587810d556.tar.bz2 scummvm-rg350-bd3c4f2ae54d78fe7a37d51a8159f5587810d556.zip |
SWORD25: Fix crashes with vector renderer. Still no gfx.
svn-id: r53315
-rw-r--r-- | engines/sword25/gfx/image/vectorimagerenderer.cpp | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/engines/sword25/gfx/image/vectorimagerenderer.cpp b/engines/sword25/gfx/image/vectorimagerenderer.cpp index 5031123b3c..a4c33bc777 100644 --- a/engines/sword25/gfx/image/vectorimagerenderer.cpp +++ b/engines/sword25/gfx/image/vectorimagerenderer.cpp @@ -293,19 +293,26 @@ void VectorImage::render(float scaleFactorX, float scaleFactorY, uint &width, ui ArtSVP *svp1 = art_svp_from_vpath(vec); - int penWidth = _elements[j].getLineStyleWidth(_elements[j].getPathInfo(i).getLineStyle()); - ArtSVP *svp2 = art_svp_vpath_stroke(vec, ART_PATH_STROKE_JOIN_ROUND, ART_PATH_STROKE_CAP_ROUND, penWidth, 1.0, 0.5); - if (needfree) - art_free(vec); + + if (_elements[j].getPathInfo(i).getFillStyle0()) { + int color1 = _elements[j].getFillStyleColor(_elements[j].getPathInfo(i).getFillStyle0() - 1); + art_rgb_svp_alpha1(svp1, 0, 0, width, height, color1, _pixelData, width * 4, NULL); + art_free(svp1); + } + + if (_elements[j].getPathInfo(i).getLineStyle()) { + int penWidth = _elements[j].getLineStyleWidth(_elements[j].getPathInfo(i).getLineStyle() - 1); + ArtSVP *svp2 = art_svp_vpath_stroke(vec, ART_PATH_STROKE_JOIN_ROUND, ART_PATH_STROKE_CAP_ROUND, penWidth, 1.0, 0.5); + int color2 = _elements[j].getLineStyleColor(_elements[j].getPathInfo(i).getLineStyle() - 1); - int color1 = _elements[j].getFillStyleColor(_elements[j].getPathInfo(i).getFillStyle0()); - int color2 = _elements[j].getLineStyleColor(_elements[j].getPathInfo(i).getLineStyle()); + art_rgb_svp_alpha1(svp2, 0, 0, width, height, color2, _pixelData, width * 4, NULL); - art_rgb_svp_alpha1(svp1, 0, 0, width, height, color1, _pixelData, width * 4, NULL); - art_rgb_svp_alpha1(svp2, 0, 0, width, height, color2, _pixelData, width * 4, NULL); + art_free(svp2); + } + + if (needfree) + art_free(vec); - art_free(svp2); - art_free(svp1); } } |