Ticket #8999: dragon2.patch

File dragon2.patch, 9.4 KB (added by SF/dkasak13, 15 years ago)

The real patch, against revision 39948

  • configure

     
    9696add_engine tinsel "Tinsel" no
    9797add_engine touche "Touche: The Adventures of the Fifth Musketeer" yes
    9898add_engine tucker "Bud Tucker in Double Trouble" yes
     99add_engine dragon "Dragon History" yes
    99100
    100101
    101102#
  • engines/engines.mk

     
    3636MODULES += engines/cruise
    3737endif
    3838
     39ifdef ENABLE_DRAGON
     40DEFINES += -DENABLE_DRAGON=$(ENABLE_DRAGON)
     41MODULES += engines/dragon
     42endif
     43
    3944ifdef ENABLE_DRASCULA
    4045DEFINES += -DENABLE_DRASCULA=$(ENABLE_DRASCULA)
    4146MODULES += engines/drascula
  • engines/dragon/detection.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
     26#include "dragon/dragon.h"
     27
     28#include "base/plugins.h"
     29#include "engines/metaengine.h"
     30
     31static const PlainGameDescriptor dragonGames[] = {
     32        { "dragon", "Dragon History" },
     33        { 0, 0 }
     34};
     35
     36namespace Dragon {
     37
     38const ADGameDescription gameDescriptions[] = {
     39       
     40        {
     41                "dragon",
     42                0,
     43                {
     44                        {"init", 0, "ab6473f08497bd592741754647431ca3", -1},
     45                        {NULL, 0, NULL, 0}
     46                },
     47                Common::EN_ANY,
     48                Common::kPlatformPC,
     49                ADGF_NO_FLAGS
     50        },
     51       
     52        {
     53                "dragon",
     54                0,
     55                {
     56                        {"init", 0, "ab6473f08497bd592741754647431ca3", -1},
     57                        {NULL, 0, NULL, 0}
     58                },
     59                Common::CZ_CZE,
     60                Common::kPlatformPC,
     61                ADGF_NO_FLAGS
     62        },
     63
     64        {
     65                "dragon",
     66                0,
     67                {
     68                        {"init", 0, "ab6473f08497bd592741754647431ca3", -1},
     69                        {NULL, 0, NULL, 0}
     70                },
     71                Common::PL_POL,
     72                Common::kPlatformPC,
     73                ADGF_NO_FLAGS
     74        },
     75
     76        AD_TABLE_END_MARKER
     77};
     78
     79} // End of namespace Dragon
     80
     81const ADParams detectionParams = {
     82        // Pointer to ADGameDescription or its superset structure
     83        (const byte *)Dragon::gameDescriptions,
     84        // Size of that superset structure
     85        sizeof(ADGameDescription),
     86        // Number of bytes to compute MD5 sum for
     87        5000,
     88        // List of all engine targets
     89        dragonGames,
     90        // Structure for autoupgrading obsolete targets
     91        0,
     92        // Name of single gameid (optional)
     93        "dragon",
     94        // List of files for file-based fallback detection (optional)
     95        0,
     96        // Flags
     97        0
     98};
     99
     100class DragonMetaEngine : public AdvancedMetaEngine {
     101public:
     102        DragonMetaEngine() : AdvancedMetaEngine(detectionParams) {}
     103       
     104        virtual const char *getName() const {
     105                return "Dragon History Engine";
     106        }
     107
     108        virtual const char *getOriginalCopyright() const {
     109                return "Copyright (C) 1995 NoSense";
     110        }
     111       
     112        virtual bool hasFeature(MetaEngineFeature f) const;
     113        virtual bool createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const;
     114};
     115
     116bool DragonMetaEngine::hasFeature(MetaEngineFeature f) const {
     117        return false;
     118}
     119
     120bool Dragon::DragonEngine::hasFeature(EngineFeature f) const {
     121        return false;
     122}
     123
     124bool DragonMetaEngine::createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const {
     125        if (desc) {
     126                *engine = new Dragon::DragonEngine(syst, Dragon::gameDescriptions);
     127        }
     128        return desc != 0;
     129}
     130
     131#if PLUGIN_ENABLED_DYNAMIC(DRAGON)
     132        REGISTER_PLUGIN_DYNAMIC(DRAGON, PLUGIN_TYPE_ENGINE, DragonMetaEngine);
     133#else
     134        REGISTER_PLUGIN_STATIC(DRAGON, PLUGIN_TYPE_ENGINE, DragonMetaEngine);
     135#endif
  • engines/dragon/dragon.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
     26#ifndef DRAGON_H
     27#define DRAGON_H
     28 
     29#include "common/system.h"
     30#include "engines/engine.h"
     31#include "engines/advancedDetector.h"
     32
     33namespace Dragon {
     34
     35class DragonEngine : public Engine {
     36public:
     37        DragonEngine(OSystem *syst, const ADGameDescription *gameDesc);
     38        ~DragonEngine();
     39
     40        int init();
     41        int go();
     42        Common::Error run();
     43
     44        bool hasFeature(Engine::EngineFeature f) const;
     45
     46private:
     47        Common::RandomSource _rnd;
     48};
     49
     50enum {
     51        kDragonGeneralDebugLevel = 1 << 0
     52};
     53
     54} // End of namespace Dragon
     55
     56#endif // DRAGON_H
     57
  • engines/dragon/dragon.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 
     26#include "common/scummsys.h"
     27 
     28#include "common/config-manager.h"
     29#include "common/events.h"
     30#include "common/file.h"
     31 
     32#include "dragon/dragon.h"
     33
     34namespace Dragon {
     35
     36DragonEngine::DragonEngine(OSystem *syst, const ADGameDescription *gameDesc)
     37 : Engine(syst) {
     38        // Put your engine in a sane state, but do nothing big yet;
     39        // in particular, do not load data from files; rather, if you
     40        // need to do such things, do them from init().
     41 
     42        // Do not initialize graphics here
     43 
     44        // However this is the place to specify all default directories
     45        //Common::File::addDefaultDirectory(_gameDataPath + "sound/");
     46 
     47        // Here is the right place to set up the engine specific debug levels
     48        Common::addDebugChannel(kDragonGeneralDebugLevel, "general", "General debug level");
     49 
     50        // Don't forget to register your random source
     51        syst->getEventManager()->registerRandomSource(_rnd, "dragon");
     52}
     53
     54int DragonEngine::init() {
     55        // Initialize graphics using following:
     56        initGraphics(320, 200, false);
     57 
     58        return 0;
     59}
     60
     61int DragonEngine::go() {
     62        debugC(1, kDragonGeneralDebugLevel, "DragonEngine::go()");
     63 
     64        return 0;
     65}
     66
     67DragonEngine::~DragonEngine() {
     68        // Dispose your resources here
     69 
     70        // Remove all of our debug levels here
     71        Common::clearAllDebugChannels();
     72}
     73
     74Common::Error DragonEngine::run() {
     75        init();
     76        go();
     77        return Common::kNoError;
     78}
     79
     80} // End of namespace Dragon
  • engines/dragon/module.mk

     
     1MODULE := engines/dragon
     2 
     3MODULE_OBJS := \
     4        dragon.o detection.o
     5 
     6MODULE_DIRS += \
     7        engines/dragon
     8 
     9# This module can be built as a plugin
     10ifeq ($(ENABLE_DRAGON), DYNAMIC_PLUGIN)
     11PLUGIN := 1
     12endif
     13 
     14# Include common rules
     15include $(srcdir)/rules.mk
  • base/plugins.cpp

     
    157157                #if PLUGIN_ENABLED_STATIC(TUCKER)
    158158                LINK_PLUGIN(TUCKER)
    159159                #endif
     160                #if PLUGIN_ENABLED_STATIC(DRAGON)
     161                LINK_PLUGIN(DRAGON)
     162                #endif
    160163
    161164                // Music plugins
    162165                // TODO: Use defines to disable or enable each MIDI driver as a