CREATE_ENGINE: Remove duplicate files from new events style

This commit is contained in:
Paul Gilbert 2023-06-09 19:54:59 -07:00
parent 3f4425fa9e
commit dfec6b497d
11 changed files with 21 additions and 370 deletions

View File

@ -41,19 +41,24 @@ char engineLowercase[MAX_ENGINE_NAME_LENGTH];
// List of files to be copied to create engine
static const char *const FILENAMES[] = {
"configure.engine", "console.cpp", "console.h",
"credits.pl", "detection.cpp", "detection.h",
"detection_tables.h", "metaengine.cpp",
"metaengine.h", "module.mk", "xyzzy.cpp",
"xyzzy.h", "POTFILES", nullptr
"files/configure.engine", "files/console.cpp", "files/console.h",
"files/credits.pl", "files/detection.cpp", "files/detection.h",
"files/detection_tables.h", "files/metaengine.cpp",
"files/metaengine.h", "files/module.mk", "files/xyzzy.cpp",
"files/xyzzy.h", "files/POTFILES", nullptr
};
static const char *const FILENAMES_EVENTS[] = {
"configure.engine", "console.cpp", "console.h",
"credits.pl", "detection.cpp", "detection.h",
"detection_tables.h", "events.cpp", "events.h",
"messages.cpp", "messages.h", "metaengine.cpp",
"metaengine.h", "module.mk", "xyzzy.cpp", "xyzzy.h",
"POTFILES", "views.h", "view1.cpp", "view1.h", nullptr
"files/configure.engine", "files/console.cpp", "files/console.h",
"files/credits.pl", "files/detection.cpp", "files/detection.h",
"files/detection_tables.h",
"files_events/events.cpp", "files_events/events.h",
"files_events/messages.cpp", "files_events/messages.h",
"files/metaengine.cpp", "files/metaengine.h",
"files_events/module.mk", "files_events/xyzzy.cpp",
"files_events/xyzzy.h", "files/POTFILES",
"files_events/views.h", "files_events/view1.cpp",
"files_events/view1.h", nullptr
};
const char *const ENGINES = "create_project ..\\.. --msvc\n";
@ -117,11 +122,11 @@ void process_file(FILE *in, FILE *out) {
}
// Copies and processes the specified file
void process_file(const char *filename, const char *prefix, const char *prefix2,
bool isEvents) {
void process_file(const char *filePath, const char *prefix, const char *prefix2) {
char srcFilename[MAX_LINE_LENGTH], destFilename[MAX_LINE_LENGTH];
const char *srcFormat = isEvents ? "%s/files_events/%s" : "%s/files/%s";
snprintf(srcFilename, MAX_LINE_LENGTH, srcFormat, prefix2, filename);
const char *filename = strchr(filePath, '/') + 1;
snprintf(srcFilename, MAX_LINE_LENGTH, "%s/%s", prefix2, filePath);
if (!strncmp(filename, "xyzzy.", 6))
snprintf(destFilename, MAX_LINE_LENGTH, "%s/engines/%s/%s.%s",
prefix, engineLowercase, engineLowercase, filename + 6);
@ -241,7 +246,7 @@ int main(int argc, char *argv[]) {
// Process the files
const char *const *filenames = isEvents ? FILENAMES_EVENTS : FILENAMES;
for (const char *const *filename = filenames; *filename; ++filename)
process_file(*filename, prefix, prefix2, isEvents);
process_file(*filename, prefix, prefix2);
create_batch_file(prefix);

View File

@ -1 +0,0 @@
engines/xyzzy/metaengine.cpp

View File

@ -1,3 +0,0 @@
# This file is included from the main "configure" script
# add_engine [name] [desc] [build-by-default] [subengines] [base games] [deps]
add_engine xyzzy "Xyzzy" no "" "" ""

View File

@ -1,38 +0,0 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* 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 3 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, see <http://www.gnu.org/licenses/>.
*
*/
#include "xyzzy/console.h"
namespace Xyzzy {
Console::Console() : GUI::Debugger() {
registerCmd("test", WRAP_METHOD(Console, Cmd_test));
}
Console::~Console() {
}
bool Console::Cmd_test(int argc, const char **argv) {
debugPrintf("Test\n");
return true;
}
} // End of namespace Xyzzy

View File

@ -1,40 +0,0 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* 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 3 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, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef XYZZY_CONSOLE_H
#define XYZZY_CONSOLE_H
#include "gui/debugger.h"
namespace Xyzzy {
class Console : public GUI::Debugger {
private:
bool Cmd_test(int argc, const char **argv);
public:
Console();
~Console() override;
};
} // End of namespace Xyzzy
#endif // XYZZY_CONSOLE_H

View File

@ -1,3 +0,0 @@
begin_section("Xyzzy");
add_person("Name 1", "Handle 1", "");
end_section();

View File

@ -1,45 +0,0 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* 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 3 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, see <http://www.gnu.org/licenses/>.
*
*/
#include "base/plugins.h"
#include "common/config-manager.h"
#include "common/file.h"
#include "common/md5.h"
#include "common/str-array.h"
#include "common/translation.h"
#include "common/util.h"
#include "xyzzy/detection.h"
#include "xyzzy/detection_tables.h"
const DebugChannelDef XyzzyMetaEngineDetection::debugFlagList[] = {
{ Xyzzy::kDebugGraphics, "Graphics", "Graphics debug level" },
{ Xyzzy::kDebugPath, "Path", "Pathfinding debug level" },
{ Xyzzy::kDebugFilePath, "FilePath", "File path debug level" },
{ Xyzzy::kDebugScan, "Scan", "Scan for unrecognised games" },
{ Xyzzy::kDebugScript, "Script", "Enable debug script dump" },
DEBUG_CHANNEL_END
};
XyzzyMetaEngineDetection::XyzzyMetaEngineDetection() : AdvancedMetaEngineDetection(Xyzzy::gameDescriptions,
sizeof(ADGameDescription), Xyzzy::xyzzyGames) {
}
REGISTER_PLUGIN_STATIC(XYZZY_DETECTION, PLUGIN_TYPE_ENGINE_DETECTION, XyzzyMetaEngineDetection);

View File

@ -1,69 +0,0 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* 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 3 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, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef XYZZY_DETECTION_H
#define XYZZY_DETECTION_H
#include "engines/advancedDetector.h"
namespace Xyzzy {
enum XyzzyDebugChannels {
kDebugGraphics = 1 << 0,
kDebugPath = 1 << 1,
kDebugScan = 1 << 2,
kDebugFilePath = 1 << 3,
kDebugScript = 1 << 4,
};
extern const PlainGameDescriptor xyzzyGames[];
extern const ADGameDescription gameDescriptions[];
#define GAMEOPTION_ORIGINAL_SAVELOAD GUIO_GAMEOPTIONS1
} // End of namespace Xyzzy
class XyzzyMetaEngineDetection : public AdvancedMetaEngineDetection {
static const DebugChannelDef debugFlagList[];
public:
XyzzyMetaEngineDetection();
~XyzzyMetaEngineDetection() override {}
const char *getName() const override {
return "xyzzy";
}
const char *getEngineName() const override {
return "Xyzzy";
}
const char *getOriginalCopyright() const override {
return "Xyzzy (C)";
}
const DebugChannelDef *getDebugChannels() const override {
return debugFlagList;
}
};
#endif // XYZZY_DETECTION_H

View File

@ -1,43 +0,0 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* 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 3 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, see <http://www.gnu.org/licenses/>.
*
*/
namespace Xyzzy {
const PlainGameDescriptor xyzzyGames[] = {
{ "xyzzy", "Xyzzy" },
{ 0, 0 }
};
const ADGameDescription gameDescriptions[] = {
{
"xyzzy",
nullptr,
AD_ENTRY1s("file1.bin", "00000000000000000000000000000000", 11111),
Common::EN_ANY,
Common::kPlatformDOS,
ADGF_UNSTABLE,
GUIO1(GUIO_NONE)
},
AD_TABLE_END_MARKER
};
} // End of namespace Xyzzy

View File

@ -1,69 +0,0 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* 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 3 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, see <http://www.gnu.org/licenses/>.
*
*/
#include "common/translation.h"
#include "xyzzy/metaengine.h"
#include "xyzzy/detection.h"
#include "xyzzy/xyzzy.h"
namespace Xyzzy {
static const ADExtraGuiOptionsMap optionsList[] = {
{
GAMEOPTION_ORIGINAL_SAVELOAD,
{
_s("Use original save/load screens"),
_s("Use the original save/load screens instead of the ScummVM ones"),
"original_menus",
false,
0,
0
}
},
AD_EXTRA_GUI_OPTIONS_TERMINATOR
};
} // End of namespace Xyzzy
const char *XyzzyMetaEngine::getName() const {
return "xyzzy";
}
const ADExtraGuiOptionsMap *XyzzyMetaEngine::getAdvancedExtraGuiOptions() const {
return Xyzzy::optionsList;
}
Common::Error XyzzyMetaEngine::createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const {
*engine = new Xyzzy::XyzzyEngine(syst, desc);
return Common::kNoError;
}
bool XyzzyMetaEngine::hasFeature(MetaEngineFeature f) const {
return checkExtendedSaves(f) ||
(f == kSupportsLoadingDuringStartup);
}
#if PLUGIN_ENABLED_DYNAMIC(XYZZY)
REGISTER_PLUGIN_DYNAMIC(XYZZY, PLUGIN_TYPE_ENGINE, XyzzyMetaEngine);
#else
REGISTER_PLUGIN_STATIC(XYZZY, PLUGIN_TYPE_ENGINE, XyzzyMetaEngine);
#endif

View File

@ -1,43 +0,0 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* 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 3 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, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef XYZZY_METAENGINE_H
#define XYZZY_METAENGINE_H
#include "engines/advancedDetector.h"
class XyzzyMetaEngine : public AdvancedMetaEngine {
public:
const char *getName() const override;
Common::Error createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const override;
/**
* Determine whether the engine supports the specified MetaEngine feature.
*
* Used by e.g. the launcher to determine whether to enable the Load button.
*/
bool hasFeature(MetaEngineFeature f) const override;
const ADExtraGuiOptionsMap *getAdvancedExtraGuiOptions() const override;
};
#endif // XYZZY_METAENGINE_H