Ticket #8763: plugin-v1.patch

File plugin-v1.patch, 6.0 KB (added by lordhoto, 17 years ago)
  • configure

     
    11831183BUILD_PLUGINS := 1
    11841184PLUGIN_PREFIX := lib
    11851185PLUGIN_SUFFIX := .so
    1186 PLUGIN_EXTRA_DEPS = $(EXECUTABLE)
     1186PLUGIN_EXTRA_DEPS =
    11871187CXXFLAGS        += -DDYNAMIC_MODULES
    11881188CXXFLAGS        += -fpic
    11891189PLUGIN_LDFLAGS  += -shared
     
    12011201BUILD_PLUGINS := 1
    12021202PLUGIN_PREFIX := lib
    12031203PLUGIN_SUFFIX := .so
    1204 PLUGIN_EXTRA_DEPS = $(EXECUTABLE)
     1204PLUGIN_EXTRA_DEPS =
    12051205CXXFLAGS        += -DDYNAMIC_MODULES
    12061206CXXFLAGS        += -fpic
    12071207PLUGIN_LDFLAGS  += -shared
     
    12371237PLUGIN_SUFFIX           := .dll
    12381238PLUGIN_EXTRA_DEPS       = $(EXECUTABLE)
    12391239CXXFLAGS                        += -DDYNAMIC_MODULES
    1240 PLUGIN_LDFLAGS          := -shared ./libscummvm.a $(LIBS) $(LDFLAGS)
     1240PLUGIN_LDFLAGS          := -shared ./libscummvm.a
    12411241PRE_OBJS_FLAGS          := -Wl,--whole-archive
    12421242POST_OBJS_FLAGS         := -Wl,--export-all-symbols -Wl,--no-whole-archive -Wl,--out-implib,./libscummvm.a
    12431243'
  • engines/scumm/smush/smush_player.cpp

     
    5959#include <png.h>
    6060#endif
    6161
    62 #ifdef USE_ZLIB
    63 #include <zlib.h>
    64 #endif
     62#include "common/zlib.h"
    6563
    6664namespace Scumm {
    6765
     
    820818
    821819        unsigned long decompressedSize = READ_BE_UINT32(chunkBuffer);
    822820        byte *fobjBuffer = (byte *)malloc(decompressedSize);
    823         int result = uncompress(fobjBuffer, &decompressedSize, chunkBuffer + 4, chunkSize - 4);
    824         if (result != Z_OK)
     821        int result = Common::uncompress(fobjBuffer, &decompressedSize, chunkBuffer + 4, chunkSize - 4);
     822        if (result != Common::ZLIB_OK)
    825823                error("SmushPlayer::handleZlibFrameObject() Zlib uncompress error");
    826824        free(chunkBuffer);
    827825
  • engines/scumm/module.mk

     
    116116# This module can be built as a plugin
    117117ifdef BUILD_PLUGINS
    118118PLUGIN := 1
    119 # HACK HACK evil HACK HACK
    120 PLUGIN_LDFLAGS += -lz
    121119endif
    122120
    123121# Include common rules
  • engines/agos/res.cpp

     
    3232#include "agos/intern.h"
    3333#include "agos/sound.h"
    3434
     35#include "common/zlib.h"
    3536
    36 #ifdef USE_ZLIB
    37 #include <zlib.h>
    38 #endif
    39 
    4037using Common::File;
    4138
    4239namespace AGOS {
     
    7774                                error("decompressData: Read failed");
    7875
    7976                        unsigned long decompressedSize = dstSize;
    80                         int result = uncompress(dst, &decompressedSize, srcBuffer, srcSize);
    81                         if (result != Z_OK)
     77                        int result = Common::uncompress(dst, &decompressedSize, srcBuffer, srcSize);
     78                        if (result != Common::ZLIB_OK)
    8279                                error("decompressData: Zlib uncompress error");
    8380                        free(srcBuffer);
    8481                } else {
  • common/zlib.cpp

     
     1/* ScummVM - Graphic Adventure Engine
     2 *
     3 * ScummVM is the legal property of its developers, whose names
     4 * are too numerous to list here. Please refer to the COPYRIGHT
     5 * file distributed with this source distribution.
     6 *
     7 * This program is free software; you can redistribute it and/or
     8 * modify it under the terms of the GNU General Public License
     9 * as published by the Free Software Foundation; either version 2
     10 * of the License, or (at your option) any later version.
     11 *
     12 * This program is distributed in the hope that it will be useful,
     13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
     14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     15 * GNU General Public License for more details.
     16 *
     17 * You should have received a copy of the GNU General Public License
     18 * along with this program; if not, write to the Free Software
     19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
     20 *
     21 * $URL$
     22 * $Id$
     23 */
     24
     25#include "common/zlib.h"
     26
     27#if defined(USE_ZLIB)
     28#include <zlib.h>
     29
     30namespace Common {
     31
     32int uncompress(byte *dst, unsigned long *dstLen, const byte *src, unsigned long srcLen) {
     33        return ::uncompress(dst, dstLen, src, srcLen);
     34}
     35
     36} // end of namespace Common
     37
     38#endif
     39
  • common/module.mk

     
    1313        stream.o \
    1414        util.o \
    1515        system.o \
    16         unzip.o
     16        unzip.o \
     17        zlib.o
    1718
    1819# Include common rules
    1920include $(srcdir)/rules.mk
  • common/zlib.h

     
     1/* ScummVM - Graphic Adventure Engine
     2 *
     3 * ScummVM is the legal property of its developers, whose names
     4 * are too numerous to list here. Please refer to the COPYRIGHT
     5 * file distributed with this source distribution.
     6 *
     7 * This program is free software; you can redistribute it and/or
     8 * modify it under the terms of the GNU General Public License
     9 * as published by the Free Software Foundation; either version 2
     10 * of the License, or (at your option) any later version.
     11 *
     12 * This program is distributed in the hope that it will be useful,
     13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
     14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     15 * GNU General Public License for more details.
     16 *
     17 * You should have received a copy of the GNU General Public License
     18 * along with this program; if not, write to the Free Software
     19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
     20 *
     21 * $URL$
     22 * $Id$
     23 */
     24
     25#include "common/scummsys.h"
     26
     27#if defined(USE_ZLIB)
     28
     29#ifndef COMMON_ZLIB_H
     30#define COMMON_ZLIB_H
     31
     32#include <zlib.h>
     33
     34namespace Common {
     35
     36enum {
     37        ZLIB_OK = Z_OK
     38};
     39
     40int uncompress(byte *dst, unsigned long *dstLen, const byte *src, unsigned long srcLen);
     41
     42} // end of namespace Common
     43
     44#endif
     45
     46#endif
     47