summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorscuri <scuri>2010-06-11 21:53:47 +0000
committerscuri <scuri>2010-06-11 21:53:47 +0000
commitb96555cd065542fba0379750c87122e54f398313 (patch)
tree5d419eebdcf395cc32dc23997f0038dec72b22a3
parentbff340f8ea36e31b199132100007bdc66519c7a3 (diff)
*** empty log message ***
-rw-r--r--mak.vc9/cdcore.vcproj220
-rw-r--r--src/drv/cdcgm.c8
-rw-r--r--src/drv/cdpicture.c66
-rw-r--r--src/drv/cdps.c2
-rw-r--r--src/svg/cdsvg.c4
5 files changed, 185 insertions, 115 deletions
diff --git a/mak.vc9/cdcore.vcproj b/mak.vc9/cdcore.vcproj
index 2fdfe8e..93c3a77 100644
--- a/mak.vc9/cdcore.vcproj
+++ b/mak.vc9/cdcore.vcproj
@@ -89,98 +89,6 @@
</References>
<Files>
<Filter
- Name="INTCGM"
- >
- <File
- RelativePath="..\src\intcgm\bparse.c"
- >
- </File>
- <File
- RelativePath="..\src\intcgm\circle.c"
- >
- </File>
- <File
- RelativePath="..\src\intcgm\ellipse.c"
- >
- </File>
- <File
- RelativePath="..\src\intcgm\intcgm1.c"
- >
- </File>
- <File
- RelativePath="..\src\intcgm\intcgm2.c"
- >
- </File>
- <File
- RelativePath="..\src\intcgm\intcgm4.c"
- >
- </File>
- <File
- RelativePath="..\src\intcgm\intcgm6.c"
- >
- </File>
- <File
- RelativePath="..\src\intcgm\list.c"
- >
- </File>
- <File
- RelativePath="..\src\intcgm\sism.c"
- >
- </File>
- <File
- RelativePath="..\src\intcgm\tparse.c"
- >
- </File>
- <Filter
- Name="INC"
- >
- <File
- RelativePath="..\src\intcgm\bparse.h"
- >
- </File>
- <File
- RelativePath="..\src\intcgm\circle.h"
- >
- </File>
- <File
- RelativePath="..\src\intcgm\ellipse.h"
- >
- </File>
- <File
- RelativePath="..\src\intcgm\intcgm.h"
- >
- </File>
- <File
- RelativePath="..\src\intcgm\intcgm2.h"
- >
- </File>
- <File
- RelativePath="..\src\intcgm\intcgm4.h"
- >
- </File>
- <File
- RelativePath="..\src\intcgm\intcgm6.h"
- >
- </File>
- <File
- RelativePath="..\src\intcgm\list.h"
- >
- </File>
- <File
- RelativePath="..\src\intcgm\sism.h"
- >
- </File>
- <File
- RelativePath="..\src\intcgm\tparse.h"
- >
- </File>
- <File
- RelativePath="..\src\intcgm\types.h"
- >
- </File>
- </Filter>
- </Filter>
- <Filter
Name="SIM"
>
<File
@@ -319,22 +227,6 @@
RelativePath="..\src\svg\cdsvg.c"
>
</File>
- <File
- RelativePath="..\src\drv\cgm.c"
- >
- <FileConfiguration
- Name="Debug|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- WarningLevel="4"
- />
- </FileConfiguration>
- </File>
- <File
- RelativePath="..\src\drv\cgm.h"
- >
- </File>
<Filter
Name="SVG"
>
@@ -355,6 +247,118 @@
>
</File>
</Filter>
+ <Filter
+ Name="CGM"
+ >
+ <File
+ RelativePath="..\src\drv\cgm.c"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ WarningLevel="4"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\src\drv\cgm.h"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="INTCGM"
+ >
+ <File
+ RelativePath="..\src\intcgm\bparse.c"
+ >
+ </File>
+ <File
+ RelativePath="..\src\intcgm\circle.c"
+ >
+ </File>
+ <File
+ RelativePath="..\src\intcgm\ellipse.c"
+ >
+ </File>
+ <File
+ RelativePath="..\src\intcgm\intcgm1.c"
+ >
+ </File>
+ <File
+ RelativePath="..\src\intcgm\intcgm2.c"
+ >
+ </File>
+ <File
+ RelativePath="..\src\intcgm\intcgm4.c"
+ >
+ </File>
+ <File
+ RelativePath="..\src\intcgm\intcgm6.c"
+ >
+ </File>
+ <File
+ RelativePath="..\src\intcgm\list.c"
+ >
+ </File>
+ <File
+ RelativePath="..\src\intcgm\sism.c"
+ >
+ </File>
+ <File
+ RelativePath="..\src\intcgm\tparse.c"
+ >
+ </File>
+ <Filter
+ Name="INC"
+ >
+ <File
+ RelativePath="..\src\intcgm\bparse.h"
+ >
+ </File>
+ <File
+ RelativePath="..\src\intcgm\circle.h"
+ >
+ </File>
+ <File
+ RelativePath="..\src\intcgm\ellipse.h"
+ >
+ </File>
+ <File
+ RelativePath="..\src\intcgm\intcgm.h"
+ >
+ </File>
+ <File
+ RelativePath="..\src\intcgm\intcgm2.h"
+ >
+ </File>
+ <File
+ RelativePath="..\src\intcgm\intcgm4.h"
+ >
+ </File>
+ <File
+ RelativePath="..\src\intcgm\intcgm6.h"
+ >
+ </File>
+ <File
+ RelativePath="..\src\intcgm\list.h"
+ >
+ </File>
+ <File
+ RelativePath="..\src\intcgm\sism.h"
+ >
+ </File>
+ <File
+ RelativePath="..\src\intcgm\tparse.h"
+ >
+ </File>
+ <File
+ RelativePath="..\src\intcgm\types.h"
+ >
+ </File>
+ </Filter>
+ </Filter>
</Filter>
<Filter
Name="include"
diff --git a/src/drv/cdcgm.c b/src/drv/cdcgm.c
index 94b1619..19f6ad7 100644
--- a/src/drv/cdcgm.c
+++ b/src/drv/cdcgm.c
@@ -567,10 +567,10 @@ static void cdpoly(cdCtxCanvas *ctxcanvas, int mode, cdPoint* poly, int n)
cgm_polygon( ctxcanvas->cgm, n, fpoly);
break;
case CD_BEZIER:
- cdfSimPolyBezier(ctxcanvas->canvas, fpoly, n);
+ cdfSimPolyBezier(ctxcanvas->canvas, (cdfPoint*)fpoly, n);
break;
case CD_PATH:
- cdfSimPolyPath(ctxcanvas->canvas, fpoly, n);
+ cdfSimPolyPath(ctxcanvas->canvas, (cdfPoint*)fpoly, n);
break;
}
@@ -602,10 +602,10 @@ static void cdfpoly(cdCtxCanvas *ctxcanvas, int mode, cdfPoint* poly, int n)
cgm_polygon( ctxcanvas->cgm, n, fpoly);
break;
case CD_BEZIER:
- cdfSimPolyBezier(ctxcanvas->canvas, fpoly, n);
+ cdfSimPolyBezier(ctxcanvas->canvas, poly, n);
break;
case CD_PATH:
- cdfSimPolyPath(ctxcanvas->canvas, fpoly, n);
+ cdfSimPolyPath(ctxcanvas->canvas, poly, n);
break;
}
}
diff --git a/src/drv/cdpicture.c b/src/drv/cdpicture.c
index 4cbc5d5..8cd586e 100644
--- a/src/drv/cdpicture.c
+++ b/src/drv/cdpicture.c
@@ -1243,6 +1243,72 @@ static int cdplay(cdCanvas* canvas, int xmin, int xmax, int ymin, int ymax, void
cdfCanvasVertex(canvas, prim->param.polyf.points[p].x, prim->param.polyf.points[p].y);
cdCanvasEnd(canvas);
break;
+ case CDPIC_PATH:
+ if (prim->param.path.fill)
+ primUpdateAttrib_Fill(prim, canvas);
+ else
+ primUpdateAttrib_Line(prim, canvas);
+ cdCanvasBegin(canvas, CD_PATH);
+ n = 0;
+ for (p=0; p<prim->param.path.path_n; p++)
+ {
+ cdCanvasPathSet(canvas, prim->param.path.path[p]);
+
+ switch(prim->param.path.path[p])
+ {
+ case CD_PATH_MOVETO:
+ case CD_PATH_LINETO:
+ if (n+1 > n) break;
+ cdCanvasVertex(canvas, prim->param.path.points[n].x, prim->param.path.points[n].y);
+ n++;
+ break;
+ case CD_PATH_CURVETO:
+ case CD_PATH_ARC:
+ {
+ if (n+3 > n) break;
+ cdCanvasVertex(canvas, prim->param.path.points[n].x, prim->param.path.points[n].y);
+ cdCanvasVertex(canvas, prim->param.path.points[n+1].x, prim->param.path.points[n+1].y);
+ cdCanvasVertex(canvas, prim->param.path.points[n+2].x, prim->param.path.points[n+2].y);
+ n += 3;
+ }
+ break;
+ }
+ }
+ cdCanvasEnd(canvas);
+ break;
+ case CDPIC_FPATH:
+ if (prim->param.path.fill)
+ primUpdateAttrib_Fill(prim, canvas);
+ else
+ primUpdateAttrib_Line(prim, canvas);
+ cdCanvasBegin(canvas, CD_PATH);
+ n = 0;
+ for (p=0; p<prim->param.pathf.path_n; p++)
+ {
+ cdCanvasPathSet(canvas, prim->param.pathf.path[p]);
+
+ switch(prim->param.pathf.path[p])
+ {
+ case CD_PATH_MOVETO:
+ case CD_PATH_LINETO:
+ if (n+1 > n) break;
+ cdfCanvasVertex(canvas, prim->param.pathf.points[n].x, prim->param.pathf.points[n].y);
+ n++;
+ break;
+ case CD_PATH_CURVETO:
+ case CD_PATH_ARC:
+ {
+ if (n+3 > n) break;
+ cdfCanvasVertex(canvas, prim->param.pathf.points[n].x, prim->param.pathf.points[n].y);
+ cdfCanvasVertex(canvas, prim->param.pathf.points[n+1].x, prim->param.pathf.points[n+1].y);
+ cdfCanvasVertex(canvas, prim->param.pathf.points[n+2].x, prim->param.pathf.points[n+2].y);
+ n += 3;
+ }
+ break;
+ }
+ }
+ cdCanvasEnd(canvas);
+ break;
case CDPIC_IMAGERGB:
cdCanvasPutImageRectRGB(canvas, prim->param.imagergba.iw, prim->param.imagergba.ih, prim->param.imagergba.r, prim->param.imagergba.g, prim->param.imagergba.b, prim->param.imagergba.x, prim->param.imagergba.y, prim->param.imagergba.w, prim->param.imagergba.h, 0, 0, 0, 0);
break;
diff --git a/src/drv/cdps.c b/src/drv/cdps.c
index 5c40103..abd061c 100644
--- a/src/drv/cdps.c
+++ b/src/drv/cdps.c
@@ -1893,7 +1893,7 @@ static cdAttribute rotate_attrib =
static void set_cmd_attrib(cdCtxCanvas *ctxcanvas, char* data)
{
- fprintf(ctxcanvas->file, data);
+ fprintf(ctxcanvas->file, "%s", data);
}
static cdAttribute cmd_attrib =
diff --git a/src/svg/cdsvg.c b/src/svg/cdsvg.c
index 677a91f..a1fdf8e 100644
--- a/src/svg/cdsvg.c
+++ b/src/svg/cdsvg.c
@@ -1196,7 +1196,7 @@ static void set_opacity_attrib(cdCtxCanvas *ctxcanvas, char* data)
static char* get_opacity_attrib(cdCtxCanvas *ctxcanvas)
{
static char data[50];
- sprintf(data, "%d", ctxcanvas->opacity);
+ sprintf(data, "%d", cdRound(ctxcanvas->opacity*255.0));
return data;
}
@@ -1209,7 +1209,7 @@ static cdAttribute opacity_attrib =
static void set_cmd_attrib(cdCtxCanvas *ctxcanvas, char* data)
{
- fprintf(ctxcanvas->file, data);
+ fprintf(ctxcanvas->file, "%s", data);
}
static cdAttribute cmd_attrib =