diff --git a/include/graphics/cairo/CairoContext.h b/include/graphics/cairo/CairoContext.h deleted file mode 100644 index d7512686b..000000000 --- a/include/graphics/cairo/CairoContext.h +++ /dev/null @@ -1,66 +0,0 @@ -#ifndef LIME_CAIRO_CONTEXT_H -#define LIME_CAIRO_CONTEXT_H - - -#include -#include - - -typedef struct _cairo cairo_t; - - -namespace lime { - - - struct CairoContext { - - CairoContext (cairo_t *ptr = NULL) { - m_ptr = ptr; - } - - static CairoContext create (CairoSurface target); - - void destroy (); - - void clip (); - void closePath (); - void fill (); - void fillPreserve (); - void lineTo (double x, double y); - void moveTo (double x, double y); - void newPath (); - void mask (CairoPattern pattern); - void paint (); - void paintWithAlpha (double alpha); - void pushGroup (); - void pushGroupWithContent (int content); - CairoPattern popGroup (); - void popGroupToSource (); - void rectangle (double x, double y, double w, double h); - void resetClip (); - void restore (); - void save (); - void setLineCap (int cap); - void setLineJoin (int join); - void setLineWidth (double width); - void setMatrix (double xx, double yx, double xy, double yy, double x0, double y0); - void setMiterLimit (double miterLimit); - void setOperator (int op); - void setSource (CairoPattern pattern); - void setSourceRGBA (double r, double g, double b, double a); - void setSourceSurface (CairoSurface surface, double x, double y); - void stroke (); - void strokePreserve (); - void transform (double xx, double yx, double xy, double yy, double x0, double y0); - - private: - - cairo_t *m_ptr; - - }; - - -} - - -#endif diff --git a/include/graphics/cairo/CairoPattern.h b/include/graphics/cairo/CairoPattern.h deleted file mode 100644 index 233c443d3..000000000 --- a/include/graphics/cairo/CairoPattern.h +++ /dev/null @@ -1,40 +0,0 @@ -#ifndef LIME_CAIRO_PATTERN_H -#define LIME_CAIRO_PATTERN_H - - -#include - - -typedef struct _cairo_pattern cairo_pattern_t; - - -namespace lime { - - - struct CairoPattern { - - CairoPattern (cairo_pattern_t *ptr = NULL) { - m_ptr = ptr; - } - - static CairoPattern createForSurface (CairoSurface target); - - void destroy (); - - inline cairo_pattern_t *ptr () { return m_ptr; } - - void setExtend (int extend); - void setFilter (int filter); - void setMatrix (double xx, double yx, double xy, double yy, double x0, double y0); - - private: - - cairo_pattern_t *m_ptr; - - }; - - -} - - -#endif diff --git a/include/graphics/cairo/CairoSurface.h b/include/graphics/cairo/CairoSurface.h deleted file mode 100644 index 2e8d63edd..000000000 --- a/include/graphics/cairo/CairoSurface.h +++ /dev/null @@ -1,39 +0,0 @@ -#ifndef LIME_CAIRO_SURFACE_H -#define LIME_CAIRO_SURFACE_H - - -typedef struct _cairo_surface cairo_surface_t; - - -namespace lime { - - - struct CairoSurface { - - CairoSurface (cairo_surface_t *ptr = NULL) { - m_ptr = ptr; - } - - static CairoSurface createForData ( - uint8_t *data, - int format, - int width, - int height, - int stride - ); - - void destroy (); - - inline cairo_surface_t *ptr () { return m_ptr; } - - private: - - cairo_surface_t *m_ptr; - - }; - - -} - - -#endif diff --git a/lime/IncludePaths.hx b/lime/IncludePaths.hx deleted file mode 100644 index 21d75b069..000000000 --- a/lime/IncludePaths.hx +++ /dev/null @@ -1,9 +0,0 @@ -package lime; - -@:buildXml(" - - - -") -@:keep -class IncludePaths {} diff --git a/lime/graphics/cairo/Cairo.hx b/lime/graphics/cairo/Cairo.hx index 130df02e6..30dc1ab65 100644 --- a/lime/graphics/cairo/Cairo.hx +++ b/lime/graphics/cairo/Cairo.hx @@ -964,4 +964,4 @@ class Cairo { #end -} +} \ No newline at end of file diff --git a/lime/graphics/cairo/Context.hx b/lime/graphics/cairo/Context.hx deleted file mode 100644 index de4bd9163..000000000 --- a/lime/graphics/cairo/Context.hx +++ /dev/null @@ -1,115 +0,0 @@ -package lime.graphics.cairo; - - -import lime.IncludePaths; -import lime.graphics.cairo.Surface; - - -@:enum abstract Content(Int) { - - // must match cairo_content_t in cairo.h - var Color = 0x1000; - var Alpha = 0x2000; - var ColorAndAlpha = 0x3000; - -} - - -@:enum abstract Operator(Int) { - - // must match cairo_operator_t in cairo.h - var Clear = 0; - var Source = 1; - var Over = 2; - var In = 3; - var Out = 4; - var Atop = 5; - var Dest = 6; - var DestOver = 7; - var DestIn = 8; - var DestOut = 9; - var DestAtop = 10; - var Xor = 11; - var Add = 12; - var Saturate = 13; - var Multiply = 14; - var Screen = 15; - var Overlay = 16; - var Darken = 17; - var Lighten = 18; - var ColorDodge = 19; - var ColorBurn = 20; - var HardLight = 21; - var SoftLight = 22; - var Difference = 23; - var Exclusion = 24; - var HSLHue = 25; - var HSLSaturation = 26; - var HSLColor = 27; - var HSLLuminosity = 28; - -} - - -@:enum abstract LineCap(Int) { - - // must match cairo_line_cap_t in cairo.h - var Butt = 0; - var Round = 1; - var Square = 2; - -} - - -@:enum abstract LineJoin(Int) { - - // must match cairo_line_join_t in cairo.h - var Miter = 0; - var Round = 1; - var Bevel = 2; - -} - - -@:include("graphics/cairo/CairoContext.h") -@:native("cpp::Struct") -extern class Context { - - @:native("lime::CairoContext::create") - public static function create (surface:Surface):Context; - - public function destroy ():Void; - - public function clip ():Void; - public function closePath ():Void; - public function fill ():Void; - public function fillPreserve ():Void; - public function lineTo (x:Float, y:Float):Void; - public function moveTo (x:Float, y:Float):Void; - public function mask (pattern:Pattern):Void; - public function newPath ():Void; - public function paint ():Void; - public function paintWithAlpha (alpha:Float):Void; - public function pushGroup ():Void; - public function pushGroupWithContent (content:Content):Void; - public function popGroup ():Pattern; - public function popGroupToSource ():Void; - public function rectangle (x:Float, y:Float, w:Float, h:Float):Void; - public function resetClip ():Void; - public function restore ():Void; - public function save ():Void; - public function setLineCap (cap:LineCap):Void; - public function setLineJoin (cap:LineJoin):Void; - public function setLineWidth (width:Float):Void; - public function setMatrix (xx:Float, yx:Float, xy:Float, yy:Float, x0:Float, y0:Float):Void; - public function setMiterLimit (miterLimit:Float):Void; - public function setOperator (op:Operator):Void; - public function setSource (pattern:Pattern):Void; - public function setSourceRGBA (r:Float, g:Float, b:Float, a:Float):Void; - public function setSourceSurface (surface:Surface, x:Float, y:Float):Void; - public function stroke ():Void; - public function strokePreserve ():Void; - public function transform (xx:Float, yx:Float, xy:Float, yy:Float, x0:Float, y0:Float):Void; - -} - diff --git a/lime/graphics/cairo/Format.hx b/lime/graphics/cairo/Format.hx deleted file mode 100644 index 32ad4f81b..000000000 --- a/lime/graphics/cairo/Format.hx +++ /dev/null @@ -1,15 +0,0 @@ -package lime.graphics.cairo; - - -@:enum abstract Format(Int) { - - // must match cairo_format_t in cairo.h - var ARGB32 = 0; - var RGB24 = 1; - var A8 = 2; - var A1 = 3; - var RGB16_565 = 4; - var RGB30 = 5; - -} - diff --git a/lime/graphics/cairo/Pattern.hx b/lime/graphics/cairo/Pattern.hx deleted file mode 100644 index 7c9471fe6..000000000 --- a/lime/graphics/cairo/Pattern.hx +++ /dev/null @@ -1,45 +0,0 @@ -package lime.graphics.cairo; - - -import lime.IncludePaths; -import lime.graphics.cairo.Surface; - - -@:enum abstract Extend(Int) { - - // must match cairo_extend_t in cairo.h - var None = 0; - var Repeat = 1; - var Reflect = 2; - var Pad = 3; - -} - - -@:enum abstract Filter(Int) { - - // must match cairo_filter_t in cairo.h - var Fast = 0; - var Good = 1; - var Best = 2; - var Nearest = 3; - var Bilinear = 4; - var Gaussian = 5; - -} - - -@:include("graphics/cairo/CairoPattern.h") -@:native("cpp::Struct") -extern class Pattern { - - @:native("lime::CairoPattern::createForSurface") - public static function createForSurface (surface:Surface):Pattern; - - public function destroy ():Void; - - public function setExtend (extend:Extend):Void; - public function setFilter (filter:Filter):Void; - public function setMatrix (xx:Float, yx:Float, xy:Float, yy:Float, x0:Float, y0:Float):Void; - -} diff --git a/lime/graphics/cairo/Surface.hx b/lime/graphics/cairo/Surface.hx deleted file mode 100644 index 39ae92f7f..000000000 --- a/lime/graphics/cairo/Surface.hx +++ /dev/null @@ -1,23 +0,0 @@ -package lime.graphics.cairo; - - -import lime.IncludePaths; -import lime.graphics.cairo.Format; - - -@:include("graphics/cairo/CairoSurface.h") -@:native("cpp::Struct") -extern class Surface { - - @:native("lime::CairoSurface::createForData") - public static function createForData ( - data:cpp.Pointer, - format:Format, - width:Int, - height:Int, - stride:Int - ):Surface; - - public function destroy ():Void; - -} diff --git a/lime/graphics/utils/ImageDataUtil.hx b/lime/graphics/utils/ImageDataUtil.hx index 30951cf7a..1d2de9616 100644 --- a/lime/graphics/utils/ImageDataUtil.hx +++ b/lime/graphics/utils/ImageDataUtil.hx @@ -1006,7 +1006,7 @@ class ImageDataUtil { default: pixel = color; } - + if (!image.transparent) pixel.a = 0xFF; pixel.writeUInt8 (image.buffer.data, (4 * (y + image.offsetY) * image.buffer.width + (x + image.offsetX) * 4), image.buffer.format, image.buffer.premultiplied); @@ -1181,4 +1181,4 @@ private class ImageDataView { } -} +} \ No newline at end of file diff --git a/lime/tools/helpers/DeploymentHelper.hx b/lime/tools/helpers/DeploymentHelper.hx index 82c8a359e..1598dd352 100644 --- a/lime/tools/helpers/DeploymentHelper.hx +++ b/lime/tools/helpers/DeploymentHelper.hx @@ -14,12 +14,6 @@ class DeploymentHelper { ZipHelper.compress (PathHelper.combine (targetDirectory, "bin"), targetPath); - var cwd = Sys.getCwd(); - if (targetPath.indexOf(cwd) == -1) - { - targetPath = PathHelper.combine(cwd, targetPath); - } - if (targetFlags.exists ("gdrive")) { var parent = targetFlags.get ("parent"); diff --git a/lime/tools/helpers/ZipHelper.hx b/lime/tools/helpers/ZipHelper.hx index 010b5bb1e..943d18c0d 100644 --- a/lime/tools/helpers/ZipHelper.hx +++ b/lime/tools/helpers/ZipHelper.hx @@ -20,12 +20,6 @@ class ZipHelper { } - var cwd = Sys.getCwd(); - if (targetPath.indexOf(cwd) == -1) - { - targetPath = PathHelper.combine(cwd, targetPath); - } - PathHelper.mkdir (Path.directory (targetPath)); if (PlatformHelper.hostPlatform == WINDOWS || !FileSystem.isDirectory (path)) { @@ -105,17 +99,10 @@ class ZipHelper { private static function readFile (basePath:String, path:String, files:List):Void { - var cwd = Sys.getCwd(); - if (Path.extension (path) != "zip" && Path.extension (path) != "crx" && Path.extension (path) != "wgt") { var fullPath = PathHelper.combine (basePath, path); - if (fullPath.indexOf(cwd) == -1) - { - fullPath = PathHelper.combine(cwd, fullPath); - } - var name = path; //var date = FileSystem.stat (directory + "/" + file).ctime; var date = Date.now (); diff --git a/lime/tools/platforms/WindowsPlatform.hx b/lime/tools/platforms/WindowsPlatform.hx index f6e11c1bc..a0a3414c7 100644 --- a/lime/tools/platforms/WindowsPlatform.hx +++ b/lime/tools/platforms/WindowsPlatform.hx @@ -137,6 +137,7 @@ class WindowsPlatform extends PlatformTarget { haxeArgs.push ("-D"); haxeArgs.push ("no_console"); flags.push ("-Dno_console"); + } if (!project.targetFlags.exists ("static")) { diff --git a/project/src/ExternalInterface.cpp b/project/src/ExternalInterface.cpp index a73732f9c..c36a9fd8d 100644 --- a/project/src/ExternalInterface.cpp +++ b/project/src/ExternalInterface.cpp @@ -186,10 +186,10 @@ namespace lime { void lime_font_destroy (value handle) { -#ifdef LIME_FREETYPE + #ifdef LIME_FREETYPE Font *font = (Font*)(intptr_t)val_float (handle); delete font; -#endif + #endif } @@ -742,38 +742,30 @@ namespace lime { value lime_lzma_decode (value buffer) { #ifdef LIME_LZMA - Bytes data = Bytes (buffer); Bytes result; LZMA::Decode (&data, &result); return result.Value (); - #else - return alloc_null (); - #endif } value lime_lzma_encode (value buffer) { - - #ifdef LIME_LZMA + #ifdef LIME_LZMA Bytes data = Bytes (buffer); Bytes result; LZMA::Encode (&data, &result); return result.Value (); - #else - return alloc_null (); - #endif } @@ -1308,17 +1300,8 @@ namespace lime { } -#ifdef LIME_CAIRO -extern "C" int lime_cairo_register_prims (); -#endif - -// prevents elimination of translation units during static linking extern "C" int lime_register_prims () { return 0 - #ifdef LIME_CAIRO - + lime_cairo_register_prims () - #endif - ; -} +} \ No newline at end of file diff --git a/project/src/graphics/cairo/Cairo.cpp b/project/src/graphics/cairo/Cairo.cpp deleted file mode 100644 index 8d8784ec1..000000000 --- a/project/src/graphics/cairo/Cairo.cpp +++ /dev/null @@ -1,318 +0,0 @@ -#include -#include -#include -#include - - -namespace lime { - - - CairoContext CairoContext::create (CairoSurface target) { - - cairo_t *c = cairo_create (target.ptr ()); - return CairoContext (c); - - } - - - void CairoContext::destroy () { - - cairo_destroy (m_ptr); - - } - - - void CairoContext::clip () { - - cairo_clip (m_ptr); - - } - - - void CairoContext::closePath () { - - cairo_close_path (m_ptr); - - } - - - void CairoContext::fill () { - - cairo_fill (m_ptr); - - } - - - void CairoContext::fillPreserve () { - - cairo_fill_preserve (m_ptr); - - } - - - void CairoContext::lineTo (double x, double y) { - - cairo_line_to (m_ptr, x, y); - - } - - - void CairoContext::moveTo (double x, double y) { - - cairo_move_to (m_ptr, x, y); - - } - - - void CairoContext::mask (CairoPattern pattern) { - - cairo_mask (m_ptr, pattern.ptr ()); - - } - - - void CairoContext::newPath () { - - cairo_new_path (m_ptr); - - } - - - void CairoContext::paint () { - - cairo_paint (m_ptr); - - } - - - void CairoContext::paintWithAlpha (double alpha) { - - cairo_paint_with_alpha (m_ptr, alpha); - - } - - - void CairoContext::pushGroup () { - - cairo_push_group (m_ptr); - - } - - - void CairoContext::pushGroupWithContent (int content) { - - cairo_push_group_with_content (m_ptr, (cairo_content_t)content); - - } - - - CairoPattern CairoContext::popGroup () { - - return cairo_pop_group (m_ptr); - - } - - - void CairoContext::popGroupToSource () { - - cairo_pop_group_to_source (m_ptr); - - } - - - void CairoContext::rectangle (double x, double y, double w, double h) { - - cairo_rectangle (m_ptr, x, y, w, h); - - } - - - void CairoContext::resetClip () { - - cairo_reset_clip (m_ptr); - - } - - - void CairoContext::restore () { - - cairo_restore (m_ptr); - - } - - - void CairoContext::save () { - - cairo_save (m_ptr); - - } - - - void CairoContext::setLineCap (int cap) { - - cairo_set_line_cap (m_ptr, (cairo_line_cap_t)cap); - - } - - - void CairoContext::setLineJoin (int join) { - - cairo_set_line_join (m_ptr, (cairo_line_join_t)join); - - } - - - void CairoContext::setLineWidth (double width) { - - cairo_set_line_width (m_ptr, width); - - } - - - void CairoContext::setMatrix (double xx, double yx, double xy, double yy, double x0, double y0) { - - cairo_matrix_t m; - m.xx = xx; - m.yx = yx; - m.xy = xy; - m.yy = yy; - m.x0 = x0; - m.y0 = y0; - cairo_set_matrix (m_ptr, &m); - - } - - - void CairoContext::setMiterLimit (double miterLimit) { - - cairo_set_miter_limit (m_ptr, miterLimit); - - } - - - void CairoContext::setOperator (int op) { - - cairo_set_operator (m_ptr, (cairo_operator_t)op); - - } - - - void CairoContext::setSource (CairoPattern pattern) { - - cairo_set_source (m_ptr, pattern.ptr ()); - - } - - - void CairoContext::setSourceRGBA (double r, double g, double b, double a) { - - cairo_set_source_rgba (m_ptr, r, g, b, a); - - } - - - void CairoContext::setSourceSurface (CairoSurface surface, double x, double y) { - - cairo_set_source_surface (m_ptr, surface.ptr (), x, y); - - } - - - void CairoContext::stroke () { - - cairo_stroke (m_ptr); - - } - - - void CairoContext::strokePreserve () { - - cairo_stroke_preserve (m_ptr); - - } - - - void CairoContext::transform (double xx, double yx, double xy, double yy, double x0, double y0) { - - cairo_matrix_t m; - m.xx = xx; - m.yx = yx; - m.xy = xy; - m.yy = yy; - m.x0 = x0; - m.y0 = y0; - cairo_transform (m_ptr, &m); - - } - - - - CairoPattern CairoPattern::createForSurface (CairoSurface surface) { - - cairo_pattern_t *p = cairo_pattern_create_for_surface (surface.ptr ()); - return CairoPattern (p); - - } - - - void CairoPattern::destroy () { - - cairo_pattern_destroy (m_ptr); - - } - - - void CairoPattern::setExtend (int extend) { - - cairo_pattern_set_extend (m_ptr, (cairo_extend_t)extend); - - } - - - void CairoPattern::setFilter (int filter) { - - cairo_pattern_set_filter (m_ptr, (cairo_filter_t)filter); - - } - - - void CairoPattern::setMatrix (double xx, double yx, double xy, double yy, double x0, double y0) { - - cairo_matrix_t m; - m.xx = xx; - m.yx = yx; - m.xy = xy; - m.yy = yy; - m.x0 = x0; - m.y0 = y0; - cairo_pattern_set_matrix (m_ptr, &m); - - } - - - - CairoSurface CairoSurface::createForData ( - uint8_t *data, - int format, - int width, - int height, - int stride - ) { - - cairo_surface_t *s = cairo_image_surface_create_for_data ( - data, (cairo_format_t)format, width, height, stride - ); - return CairoSurface (s); - - } - - - void CairoSurface::destroy () { - - cairo_surface_destroy (m_ptr); - - } - - -} -