From ca403a4c367c10b0263360b71ec3f766a8fa76af Mon Sep 17 00:00:00 2001 From: Pawel Kolodziejski Date: Thu, 12 Jun 2008 20:17:46 +0000 Subject: [PATCH] don't use zlib in common --- common/module.mk | 3 +-- common/zlib.cpp | 41 ------------------------------------ common/zlib.h | 48 ------------------------------------------ configure | 23 ++++++++------------ engine/lua.cpp | 5 +++++ engine/savegame.h | 8 +++++-- engine/smush/smush.cpp | 1 - engine/smush/smush.h | 7 +++++- 8 files changed, 27 insertions(+), 109 deletions(-) delete mode 100644 common/zlib.cpp delete mode 100644 common/zlib.h diff --git a/common/module.mk b/common/module.mk index 3395c7b1977..eaf8a073cc1 100644 --- a/common/module.mk +++ b/common/module.mk @@ -7,8 +7,7 @@ MODULE_OBJS := \ matrix4.o \ memorypool.o \ str.o \ - mutex.o \ - zlib.o + mutex.o # Include common rules include $(srcdir)/rules.mk diff --git a/common/zlib.cpp b/common/zlib.cpp deleted file mode 100644 index cd48bfc449c..00000000000 --- a/common/zlib.cpp +++ /dev/null @@ -1,41 +0,0 @@ -/* Residual - Virtual machine to run LucasArts' 3D adventure games - * Copyright (C) 2003-2008 The ScummVM-Residual Team (www.scummvm.org) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ - */ - -#include "common/zlib.h" - -#if defined(USE_ZLIB) - -#ifdef __SYMBIAN32__ -#include -#else -#include -#endif - -namespace Common { - -int uncompress(byte *dst, unsigned long *dstLen, const byte *src, unsigned long srcLen) { - return ::uncompress(dst, dstLen, src, srcLen); -} - -} // end of namespace Common - -#endif - diff --git a/common/zlib.h b/common/zlib.h deleted file mode 100644 index b2bd7c4e0c8..00000000000 --- a/common/zlib.h +++ /dev/null @@ -1,48 +0,0 @@ -/* Residual - Virtual machine to run LucasArts' 3D adventure games - * Copyright (C) 2003-2008 The ScummVM-Residual Team (www.scummvm.org) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ - */ - -#include "common/sys.h" - -#if defined(USE_ZLIB) - -#ifndef COMMON_ZLIB_H -#define COMMON_ZLIB_H - -#ifdef __SYMBIAN32__ -#include -#else -#include -#endif - -namespace Common { - -enum { - ZLIB_OK = Z_OK -}; - -int uncompress(byte *dst, unsigned long *dstLen, const byte *src, unsigned long srcLen); - -} // end of namespace Common - -#endif - -#endif - diff --git a/configure b/configure index 4166796889a..8d34d8b9ae8 100755 --- a/configure +++ b/configure @@ -61,7 +61,6 @@ _tremor=auto _flac=auto _mad=auto _alsa=auto -_zlib=auto _mpeg2=auto _endian=unknown @@ -322,7 +321,6 @@ Optional Libraries: --disable-flac disable FLAC support [autodetect] --with-zlib-prefix=DIR Prefix where zlib is installed (optional) - --disable-zlib disable zlib (compression) support [autodetect] --with-mpeg2-prefix=DIR Prefix where libmpeg2 is installed (optional) --disable-mpeg2 disable mpeg2 codec for cutscenes [autodetect] @@ -362,8 +360,6 @@ for ac_option in $@; do --disable-flac) _flac=no ;; --enable-mad) _mad=yes ;; --disable-mad) _mad=no ;; - --enable-zlib) _zlib=yes ;; - --disable-zlib) _zlib=no ;; --disable-mpeg2) _mpeg2=no ;; --with-mpeg2-prefix=*) arg=`echo $ac_option | cut -d '=' -f 2` @@ -1033,21 +1029,24 @@ echo "$_alsa" # Check for ZLib # echocheck "zlib" -if test "$_zlib" = auto ; then - _zlib=no - cat > $TMPC << EOF +_zlib=no + +cat > $TMPC << EOF #include #include int main(void) { return strcmp(ZLIB_VERSION, zlibVersion()); } EOF - cc_check $LDFLAGS $CXXFLAGS $ZLIB_CFLAGS $ZLIB_LIBS -lz && _zlib=yes -fi + +cc_check $LDFLAGS $CXXFLAGS $ZLIB_CFLAGS $ZLIB_LIBS -lz && _zlib=yes + if test "$_zlib" = yes ; then _def_zlib='#define USE_ZLIB' LIBS="$LIBS $ZLIB_LIBS -lz" INCLUDES="$INCLUDES $ZLIB_CFLAGS" else - _def_zlib='#undef USE_ZLIB' + echo + echo "zlib library support required" + exit 1 fi echo "$_zlib" @@ -1167,12 +1166,8 @@ $_def_tremor $_def_flac $_def_mad $_def_alsa -$_def_zlib $_def_mpeg2 -/* Plugin settings */ -$_def_plugin - #endif /* CONFIG_H */ EOF diff --git a/engine/lua.cpp b/engine/lua.cpp index 0584fe93c58..d77ebe85259 100644 --- a/engine/lua.cpp +++ b/engine/lua.cpp @@ -53,7 +53,12 @@ #include #include + +#ifdef __SYMBIAN32__ +#include +#else #include +#endif extern Imuse *g_imuse; diff --git a/engine/savegame.h b/engine/savegame.h index c14d86e0426..55aea3f92c4 100644 --- a/engine/savegame.h +++ b/engine/savegame.h @@ -23,12 +23,16 @@ #ifndef SAVEGAME_H #define SAVEGAME_H +#ifdef __SYMBIAN32__ +#include +#else +#include +#endif + #include "common/debug.h" #include "engine/lua.h" -#include - class SaveGame { public: SaveGame(char *filename, bool saving); diff --git a/engine/smush/smush.cpp b/engine/smush/smush.cpp index aba818936e5..b20c2a630da 100644 --- a/engine/smush/smush.cpp +++ b/engine/smush/smush.cpp @@ -34,7 +34,6 @@ #include "mixer/mixer.h" #include -#include #define SMUSH_LOOPMOVIE(x) (x & 0x000001) #define SMUSH_ALTSPEED(x) (x & 0x000004) diff --git a/engine/smush/smush.h b/engine/smush/smush.h index 82fef62ca8b..51b61aa7c76 100644 --- a/engine/smush/smush.h +++ b/engine/smush/smush.h @@ -23,6 +23,12 @@ #ifndef SMUSH_PLAYER_H #define SMUSH_PLAYER_H +#ifdef __SYMBIAN32__ +#include +#else +#include +#endif + #include "common/sys.h" #include "common/debug.h" @@ -31,7 +37,6 @@ #include "mixer/mixer.h" #include "mixer/audiostream.h" -#include #include struct SavePos {