Use fopen on Windows for now
This commit is contained in:
@@ -12,17 +12,17 @@ namespace lime {
|
|||||||
|
|
||||||
typedef unsigned char uint8;
|
typedef unsigned char uint8;
|
||||||
|
|
||||||
#if HX_WINDOWS
|
/*#if HX_WINDOWS
|
||||||
|
|
||||||
typedef wchar_t OSChar;
|
typedef wchar_t OSChar;
|
||||||
#define val_os_string val_wstring
|
#define val_os_string val_wstring
|
||||||
|
|
||||||
#else
|
#else*/
|
||||||
|
|
||||||
typedef char OSChar;
|
typedef char OSChar;
|
||||||
#define val_os_string val_string
|
#define val_os_string val_string
|
||||||
|
|
||||||
#endif
|
//#endif
|
||||||
|
|
||||||
|
|
||||||
// If you put this structure on the stack, then you do not have to worry about GC.
|
// If you put this structure on the stack, then you do not have to worry about GC.
|
||||||
@@ -51,15 +51,15 @@ namespace lime {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#ifdef HX_WINDOWS
|
/*#ifdef HX_WINDOWS
|
||||||
typedef wchar_t OSChar;
|
typedef wchar_t OSChar;
|
||||||
#define val_os_string val_wstring
|
#define val_os_string val_wstring
|
||||||
#define OpenRead(x) _wfopen(x,L"rb")
|
#define OpenRead(x) _wfopen(x,L"rb")
|
||||||
#define OpenOverwrite(x) _wfopen(x,L"wb") // [ddc]
|
#define OpenOverwrite(x) _wfopen(x,L"wb") // [ddc]
|
||||||
|
|
||||||
#else
|
#else*/
|
||||||
typedef char OSChar;
|
//typedef char OSChar;
|
||||||
#define val_os_string val_string
|
//#define val_os_string val_string
|
||||||
|
|
||||||
#if defined(IPHONE)
|
#if defined(IPHONE)
|
||||||
FILE *OpenRead(const char *inName);
|
FILE *OpenRead(const char *inName);
|
||||||
@@ -76,7 +76,7 @@ namespace lime {
|
|||||||
#define OpenRead(x) fopen(x,"rb")
|
#define OpenRead(x) fopen(x,"rb")
|
||||||
#define OpenOverwrite(x) fopen(x,"wb") // [ddc]
|
#define OpenOverwrite(x) fopen(x,"wb") // [ddc]
|
||||||
#endif
|
#endif
|
||||||
#endif
|
//#endif
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,16 +15,16 @@ namespace lime {
|
|||||||
|
|
||||||
|
|
||||||
bool JPEG::Decode (const char *path, Image *image) {
|
bool JPEG::Decode (const char *path, Image *image) {
|
||||||
|
|
||||||
struct jpeg_decompress_struct cinfo;
|
struct jpeg_decompress_struct cinfo;
|
||||||
struct jpeg_error_mgr jerr;
|
struct jpeg_error_mgr jerr;
|
||||||
|
|
||||||
FILE *file = OpenRead (path);
|
FILE *file = OpenRead (path);
|
||||||
|
|
||||||
cinfo.err = jpeg_std_error (&jerr);
|
cinfo.err = jpeg_std_error (&jerr);
|
||||||
jpeg_create_decompress (&cinfo);
|
jpeg_create_decompress (&cinfo);
|
||||||
jpeg_stdio_src (&cinfo, file);
|
jpeg_stdio_src (&cinfo, file);
|
||||||
|
|
||||||
if (jpeg_read_header (&cinfo, TRUE) == JPEG_HEADER_OK) {
|
if (jpeg_read_header (&cinfo, TRUE) == JPEG_HEADER_OK) {
|
||||||
|
|
||||||
jpeg_start_decompress (&cinfo);
|
jpeg_start_decompress (&cinfo);
|
||||||
|
|||||||
Reference in New Issue
Block a user