From 5ecc63f3948bc813e3945ec2f44c5364b42df815 Mon Sep 17 00:00:00 2001 From: zeromus Date: Tue, 13 Nov 2012 19:28:27 +0000 Subject: [PATCH] mednafen-remove zlib dep (but keep using it in libmednahawk for PSF loading) --- mednafen/libmednahawk/libmednahawk.vcxproj | 6 +++--- mednafen/src/PSFLoader.cpp | 1 + mednafen/src/file.cpp | 2 ++ mednafen/src/settings.cpp | 1 + mednafen/src/state.cpp | 9 ++++++++- mednafen/src/state.h | 5 ++++- 6 files changed, 19 insertions(+), 5 deletions(-) diff --git a/mednafen/libmednahawk/libmednahawk.vcxproj b/mednafen/libmednahawk/libmednahawk.vcxproj index cefcd53de3..9096bceed9 100644 --- a/mednafen/libmednahawk/libmednahawk.vcxproj +++ b/mednafen/libmednahawk/libmednahawk.vcxproj @@ -85,7 +85,7 @@ true - ..\zlib123/zlib-vc8-Win32.lib;winmm.lib;%(AdditionalDependencies) + ..\zlib123\zlib-vc8-Win32.lib true Console MachineX86 @@ -112,7 +112,7 @@ true - ..\zlib123/zlib-vc8-Win32.lib;winmm.lib;%(AdditionalDependencies) + ..\zlib123\zlib-vc8-Win32.lib true Console true @@ -140,7 +140,7 @@ Speed - ..\zlib123/zlib-vc8-Win32.lib;winmm.lib;%(AdditionalDependencies) + ..\zlib123\zlib-vc8-Win32.lib true Console true diff --git a/mednafen/src/PSFLoader.cpp b/mednafen/src/PSFLoader.cpp index d41ee2d4e0..f2c2c8b7ba 100644 --- a/mednafen/src/PSFLoader.cpp +++ b/mednafen/src/PSFLoader.cpp @@ -30,6 +30,7 @@ #include //#include +#include PSFTags::PSFTags() { diff --git a/mednafen/src/file.cpp b/mednafen/src/file.cpp index 646f6e7d47..30ec2d95f3 100644 --- a/mednafen/src/file.cpp +++ b/mednafen/src/file.cpp @@ -723,6 +723,7 @@ static INLINE bool MDFN_DumpToFileReal(const char *filename, int compress, const if(MDFN_GetSettingB("filesys.disablesavegz")) compress = 0; +#ifdef WANT_DEARCHIVE if(compress) { char mode[64]; @@ -762,6 +763,7 @@ static INLINE bool MDFN_DumpToFileReal(const char *filename, int compress, const } } else +#endif //WANT_DEARCHIVE { FILE *fp = fopen(filename, "wb"); if(!fp) diff --git a/mednafen/src/settings.cpp b/mednafen/src/settings.cpp index 31f6b02dfd..fd7459dc3f 100644 --- a/mednafen/src/settings.cpp +++ b/mednafen/src/settings.cpp @@ -29,6 +29,7 @@ #include "string/escape.h" #include "FileStream.h" #include "MemoryStream.h" +#include typedef struct { diff --git a/mednafen/src/state.cpp b/mednafen/src/state.cpp index 1aa675cad1..4dbe0fe546 100644 --- a/mednafen/src/state.cpp +++ b/mednafen/src/state.cpp @@ -32,6 +32,10 @@ #include "video.h" #include "video/resize.h" +#ifndef HEADLESS +#include +#endif + static int SaveStateStatus[10]; #define RLSB MDFNSTATE_RLSB //0x80000000 @@ -654,6 +658,7 @@ int MDFNSS_SaveSM(StateMem *st, int wantpreview_and_ts, int data_only, const MDF return(1); } +#ifndef HEADLESS int MDFNSS_Save(const char *fname, const char *suffix, const MDFN_Surface *surface, const MDFN_Rect *DisplayRect, const MDFN_Rect *LineWidths) { StateMem st; @@ -724,7 +729,7 @@ int MDFNSS_SaveFP(gzFile fp, const MDFN_Surface *surface, const MDFN_Rect *Displ return(1); } - +#endif int MDFNSS_LoadSM(StateMem *st, int haspreview, int data_only) { @@ -765,6 +770,7 @@ int MDFNSS_LoadSM(StateMem *st, int haspreview, int data_only) return(MDFNGameInfo->StateAction(st, stateversion, data_only)); } +#ifndef HEADLESS int MDFNSS_LoadFP(gzFile fp) { uint8 header[32]; @@ -845,6 +851,7 @@ int MDFNSS_Load(const char *fname, const char *suffix) return(0); } } +#endif //here we have a whole bunch of UI-related savestate functionality which isnt needed in headless #ifndef HEADLESS diff --git a/mednafen/src/state.h b/mednafen/src/state.h index 83aa674a32..f3c98ad082 100644 --- a/mednafen/src/state.h +++ b/mednafen/src/state.h @@ -1,7 +1,6 @@ #ifndef _STATE_H #define _STATE_H -#include #include "video.h" #include "state-common.h" @@ -10,8 +9,12 @@ void MDFNSS_GetStateInfo(const char *filename, StateStatusStruct *status); int MDFNSS_Save(const char *, const char *suffix, const MDFN_Surface *surface = (MDFN_Surface *)NULL, const MDFN_Rect *DisplayRect = (MDFN_Rect*)NULL, const MDFN_Rect *LineWidths = (MDFN_Rect *)NULL); int MDFNSS_Load(const char *, const char *suffix); + +#ifdef WANT_MOVIE +#include int MDFNSS_SaveFP(gzFile fp, const MDFN_Surface *surface = (MDFN_Surface *)NULL, const MDFN_Rect *DisplayRect = (MDFN_Rect*)NULL, const MDFN_Rect *LineWidths = (MDFN_Rect *)NULL); int MDFNSS_LoadFP(gzFile fp); +#endif typedef struct {