From f78397ffeabee0b4913f97e77071ff62cb1964da Mon Sep 17 00:00:00 2001 From: "BADIM-PC\\Vadim" Date: Fri, 22 Dec 2017 18:26:03 +0300 Subject: [PATCH] TIC as single exe without dlls --- build/windows/tic80/resource.h | 14 ---- build/windows/tic80/tic80.rc | Bin 5218 -> 0 bytes build/windows/tic80/tic80.vcxproj | 38 +++++----- build/windows/tic80/tic80.vcxproj.filters | 13 ---- src/console.c | 83 ---------------------- 5 files changed, 16 insertions(+), 132 deletions(-) delete mode 100644 build/windows/tic80/resource.h delete mode 100644 build/windows/tic80/tic80.rc diff --git a/build/windows/tic80/resource.h b/build/windows/tic80/resource.h deleted file mode 100644 index 991b55e..0000000 --- a/build/windows/tic80/resource.h +++ /dev/null @@ -1,14 +0,0 @@ -//{{NO_DEPENDENCIES}} -// Microsoft Visual C++ generated include file. -// Used by tic80.rc - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 101 -#define _APS_NEXT_COMMAND_VALUE 40001 -#define _APS_NEXT_CONTROL_VALUE 1001 -#define _APS_NEXT_SYMED_VALUE 101 -#endif -#endif diff --git a/build/windows/tic80/tic80.rc b/build/windows/tic80/tic80.rc deleted file mode 100644 index 4e33156a052e16632e0a14b68fef781ec8be87af..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5218 zcmdUzZBH9V5Xa|rq<)8sd6Ouqv4JX0-+?hM!o&zaD3y>b0+?E&82Ld>q<;3MzyGes z_St7bOjTWVy4$_E*_qk@%}+Q=q$X?MI;>IZ~grn2c88T)ob9K|eZk}++h zR*0l7@l@xM+`qVzwIf@|I45c)qfNfO4qEF_KR|8M)=4idB?4B>%7(asZ~OI|h~N5>H|!ko+k;%k)Z9?lUwrz_X24TTdM08jgZTYFK!RFPe6O_L6z9@SS8+GkX$IKCH zQ5ViYF7oZHe2-C>=5oykjH?9?MZF19k`S{EkQFioEEwZ+Rk&Nc)MsWljJU_v!L*{q zQ5u&eZT_{6&s?fzQnL49MxS`b+UUIAJ}%L@I`~nwLKqa#pqla!){`&9*d=c_(3Oz| z-c{E>!Si{I&TOeZ^TRNHz7vR<;L=sOD)yuOymm&9OHb#QOD(bAP!1HW%)Jh)Y{~MJ z_B2CU?Ru8+7~|2aU~iEKyyMFDM7H!gl5c}tq5fcBLZsYM&Brsu)gSZim#|NX`ikg` zUYbm;)5>27>+%jWEZe*9vZFE8t0>hh-CKHF^#1c^dxn+)C{3__yn^JWzE4YiP6Sl3 z>2SJ&M1QSPRFCFa*a4s646RMFI-Pqhq^XXN@PYQyi`k(yHs-uCvCN)M>)GPEGq-l$ z)Auc+%-2VcL)ECwcMo3S^4DsK+3pde`bz(2r>UptX7p!O(M0C0; zitcqdZPD(A7JaXt^=sl&qD}a(m+F?lEGv^;z!e&AM diff --git a/build/windows/tic80/tic80.vcxproj b/build/windows/tic80/tic80.vcxproj index fa9c485..b07f5a0 100644 --- a/build/windows/tic80/tic80.vcxproj +++ b/build/windows/tic80/tic80.vcxproj @@ -52,12 +52,6 @@ {57d2471b-3138-495e-af18-6e290d098ffc} - - - - - - {C4D8BC10-EBF6-42BB-9B5D-6712FB428A50} Win32Proj @@ -66,52 +60,52 @@ - DynamicLibrary + StaticLibrary true v140_xp MultiByte - DynamicLibrary + StaticLibrary true v140_xp MultiByte - DynamicLibrary + StaticLibrary false v140_xp true MultiByte - DynamicLibrary + StaticLibrary false v140_xp true MultiByte - DynamicLibrary + StaticLibrary true v140_xp MultiByte - DynamicLibrary + StaticLibrary true v140_xp MultiByte - DynamicLibrary + StaticLibrary false v140_xp true MultiByte - DynamicLibrary + StaticLibrary false v140_xp true @@ -177,7 +171,7 @@ Level3 Disabled - TIC80_SHARED;WIN32;_DEBUG;_WINDOWS;_USRDLL;TIC80_EXPORTS;%(PreprocessorDefinitions) + WIN32;_DEBUG;_WINDOWS;_USRDLL;TIC80_EXPORTS;%(PreprocessorDefinitions) ..\..\..\include\tic80;..\..\..\include\lua;..\..\..\include\gif MultiThreadedDebug @@ -192,7 +186,7 @@ Level3 Disabled - TIC80_PRO;TIC80_SHARED;WIN32;_DEBUG;_WINDOWS;_USRDLL;TIC80_EXPORTS;%(PreprocessorDefinitions) + TIC80_PRO;WIN32;_DEBUG;_WINDOWS;_USRDLL;TIC80_EXPORTS;%(PreprocessorDefinitions) ..\..\..\include\tic80;..\..\..\include\lua;..\..\..\include\gif MultiThreadedDebug @@ -207,7 +201,7 @@ Level3 Disabled - TIC80_SHARED;_DEBUG;_WINDOWS;_USRDLL;TIC80_EXPORTS;%(PreprocessorDefinitions) + _DEBUG;_WINDOWS;_USRDLL;TIC80_EXPORTS;%(PreprocessorDefinitions) ..\..\..\include\tic80;..\..\..\include\lua;..\..\..\include\gif MultiThreadedDebug @@ -222,7 +216,7 @@ Level3 Disabled - TIC80_PRO;TIC80_SHARED;_DEBUG;_WINDOWS;_USRDLL;TIC80_EXPORTS;%(PreprocessorDefinitions) + TIC80_PRO;_DEBUG;_WINDOWS;_USRDLL;TIC80_EXPORTS;%(PreprocessorDefinitions) ..\..\..\include\tic80;..\..\..\include\lua;..\..\..\include\gif MultiThreadedDebug @@ -239,7 +233,7 @@ MaxSpeed true true - TIC80_SHARED;WIN32;NDEBUG;_WINDOWS;_USRDLL;TIC80_EXPORTS;%(PreprocessorDefinitions) + WIN32;NDEBUG;_WINDOWS;_USRDLL;TIC80_EXPORTS;%(PreprocessorDefinitions) ..\..\..\include\tic80;..\..\..\include\lua;..\..\..\include\gif MultiThreaded @@ -258,7 +252,7 @@ MaxSpeed true true - TIC80_PRO;TIC80_SHARED;WIN32;NDEBUG;_WINDOWS;_USRDLL;TIC80_EXPORTS;%(PreprocessorDefinitions) + TIC80_PRO;WIN32;NDEBUG;_WINDOWS;_USRDLL;TIC80_EXPORTS;%(PreprocessorDefinitions) ..\..\..\include\tic80;..\..\..\include\lua;..\..\..\include\gif MultiThreaded @@ -277,7 +271,7 @@ MaxSpeed true true - TIC80_SHARED;NDEBUG;_WINDOWS;_USRDLL;TIC80_EXPORTS;%(PreprocessorDefinitions) + NDEBUG;_WINDOWS;_USRDLL;TIC80_EXPORTS;%(PreprocessorDefinitions) ..\..\..\include\tic80;..\..\..\include\lua;..\..\..\include\gif MultiThreaded @@ -296,7 +290,7 @@ MaxSpeed true true - TIC80_PRO;TIC80_SHARED;NDEBUG;_WINDOWS;_USRDLL;TIC80_EXPORTS;%(PreprocessorDefinitions) + TIC80_PRO;NDEBUG;_WINDOWS;_USRDLL;TIC80_EXPORTS;%(PreprocessorDefinitions) ..\..\..\include\tic80;..\..\..\include\lua;..\..\..\include\gif MultiThreaded diff --git a/build/windows/tic80/tic80.vcxproj.filters b/build/windows/tic80/tic80.vcxproj.filters index ef9a046..a66d433 100644 --- a/build/windows/tic80/tic80.vcxproj.filters +++ b/build/windows/tic80/tic80.vcxproj.filters @@ -10,9 +10,6 @@ {32b7b251-991e-49bf-b9b3-146483deba38} - - {a8b4fcef-8795-4705-be81-2c4b8e6c439d} - @@ -40,14 +37,4 @@ src - - - res - - - - - res - - \ No newline at end of file diff --git a/src/console.c b/src/console.c index edadb52..c6e0841 100644 --- a/src/console.c +++ b/src/console.c @@ -1828,86 +1828,6 @@ static void* embedCart(Console* console, s32* size) return data; } -#if defined(__WINDOWS__) - -static const char* getFileFolder(const char* path) -{ - static char folder[FILENAME_MAX]; - - const char* pos = strrchr(path, '\\'); - - if(!pos) - pos = strrchr(path, '/'); - - if(pos) - { - s32 size = pos - path; - memcpy(folder, path, size); - folder[size] = 0; - - return folder; - } - - return NULL; -} - -static bool exportToFolder(Console* console, const char* folder, const char* file) -{ - const char* workFolder = getFileFolder(console->appPath); - - if(workFolder) - { - char src[FILENAME_MAX]; - strcpy(src, workFolder); - strcat(src, file); - - char dst[FILENAME_MAX]; - strcpy(dst, folder); - strcat(dst, file); - - return fsCopyFile(src, dst); - } - - return false; -} - -static void onConsoleExportNativeCommand(Console* console, const char* cartName) -{ - const char* folder = folder_dialog(console); - bool done = false; - - if(folder) - { - s32 size = 0; - - void* data = embedCart(console, &size); - - if(data) - { - char path[FILENAME_MAX]; - strcpy(path, folder); - strcat(path, "\\game.exe"); - - done = fsWriteFile(path, data, size); - - SDL_free(data); - } - else - { - printBack(console, "\ngame exporting error :("); - } - } - - if(done && exportToFolder(console, folder, "\\tic80.dll") && - exportToFolder(console, folder, "\\SDL2.dll")) - printBack(console, "\ngame exported :)"); - else printBack(console, "\ngame not exported :|"); - - commandDone(console); -} - -#else - static void onConsoleExportNativeCommand(Console* console, const char* cartName) { s32 size = 0; @@ -1923,9 +1843,6 @@ static void onConsoleExportNativeCommand(Console* console, const char* cartName) } } -#endif - - #endif static const char* getExportName(Console* console, bool html)