diff --git a/project/msvc/README.txt b/project/msvc/README.txt index e43f40fa..bc7b7da9 100644 --- a/project/msvc/README.txt +++ b/project/msvc/README.txt @@ -1,6 +1,6 @@ Project files for MS Visual Studio 2010 : -By default the project expect SDL 1.2 SDL Image 1.2 and Lua 5.3 to be installed +By default the project expects SDL 1.2, SDL Image 1.2 and Lua 5.3 to be installed in directories : ..\..\..\..\SDL-1.2.15 ..\..\..\..\SDL_image-1.2.12 @@ -20,3 +20,8 @@ Download precompiled libraries from : http://luabinaries.sourceforge.net/ https://sourceforge.net/projects/luabinaries/files/5.3.4/Windows%20Libraries/Static/ + + +Download recoil-4.2.0.tar.gz from https://sourceforge.net/projects/recoil/files/recoil/4.2.0/ +and copy recoil.c and recoil.h to src subdirectory. +You can also disable RECOIL by defining the NORECOIL macro. diff --git a/project/msvc/grafx2.vcxproj b/project/msvc/grafx2.vcxproj index d565d621..a3fde461 100644 --- a/project/msvc/grafx2.vcxproj +++ b/project/msvc/grafx2.vcxproj @@ -125,6 +125,7 @@ + @@ -161,6 +162,7 @@ + @@ -184,6 +186,7 @@ + diff --git a/project/msvc/grafx2.vcxproj.filters b/project/msvc/grafx2.vcxproj.filters index 59d0f0cd..ba45dc68 100644 --- a/project/msvc/grafx2.vcxproj.filters +++ b/project/msvc/grafx2.vcxproj.filters @@ -174,6 +174,9 @@ Fichiers d%27en-tĂȘte + + Fichiers d%27en-tĂȘte + @@ -340,5 +343,11 @@ Fichiers sources + + Fichiers sources + + + Fichiers sources + \ No newline at end of file diff --git a/src/loadrecoil.c b/src/loadrecoil.c index 5262f81e..f4bbde6d 100644 --- a/src/loadrecoil.c +++ b/src/loadrecoil.c @@ -18,6 +18,12 @@ along with Grafx2; if not, see */ +#ifdef _MSC_VER +#include +#if _MSC_VER < 1900 +#define snprintf _snprintf +#endif +#endif #include "struct.h" #include "global.h" @@ -93,8 +99,25 @@ void Load_Recoil_Image(T_IO_Context *context) recoil = RECOIL_New(); if (recoil) { +#ifdef WIN32 + char tempfilename[MAX_PATH_CHARACTERS]; +#endif + const char * filename = context->File_name; *(const RECOILVtbl **)recoil = &vtbl; // set Vtable - if (RECOIL_Decode(recoil, context->File_name, file_content, file_length)) +#ifdef WIN32 + if (context->File_name_unicode != NULL && context->File_name_unicode[0] != 0) + { + // get the full file extension from the long filename (unicode) + // RECOIL doesn't recognize file if the "short" extension is passed, + // ie .DEE instead of .deep + int i; + for (i = 0; context->File_name_unicode[i] != 0 && i < sizeof(tempfilename) - 1; i++) + tempfilename[i] = (context->File_name_unicode[i] < 256) ? (char)context->File_name_unicode[i] : '_'; + tempfilename[i] = '\0'; + filename = tempfilename; + } +#endif + if (RECOIL_Decode(recoil, filename, file_content, file_length)) { int width, height; int original_width, original_height;