Ticket #8999: dragon.patch

File dragon.patch, 9.0 KB (added by SF/dkasak13, 15 years ago)

Dragon History engine detection/stub

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