commit 1753ea2d0a8b30bb88dda44ff9462ef0c9eda865 Author: Les De Ridder Date: Mon Feb 18 23:59:29 2019 +0100 Initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ef651b4 --- /dev/null +++ b/.gitignore @@ -0,0 +1,16 @@ +.dub +docs.json +__dummy.html +docs/ +/cm3d2tool +cm3d2tool.so +cm3d2tool.dylib +cm3d2tool.dll +cm3d2tool.a +cm3d2tool.lib +cm3d2tool-test-* +*.exe +*.o +*.obj +*.lst +out/ diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..e4acabb --- /dev/null +++ b/LICENSE @@ -0,0 +1,31 @@ +University of Illinois/NCSA +Open Source License + +Copyright (c) 2019, Les De Ridder +All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal with +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +* Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimers. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimers in the + documentation and/or other materials provided with the distribution. + +* Neither the name of cm3d2tool nor the names of its contributors may be used + to endorse or promote products derived from this Software without specific + prior written permission. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE +SOFTWARE. diff --git a/dub.sdl b/dub.sdl new file mode 100644 index 0000000..59fa1c3 --- /dev/null +++ b/dub.sdl @@ -0,0 +1,7 @@ +name "cm3d2tool" +description "CM3D2 Modding Tool" +authors "lesderid" +copyright "Copyright © 2019, Les De Ridder" +license "NCSA" +dependency "sdlang-d" version="~>0.10.4" +targetPath "out" diff --git a/dub.selections.json b/dub.selections.json new file mode 100644 index 0000000..15a8934 --- /dev/null +++ b/dub.selections.json @@ -0,0 +1,9 @@ +{ + "fileVersion": 1, + "versions": { + "libinputvisitor": "1.2.2", + "sdlang-d": "0.10.4", + "taggedalgebraic": "0.10.12", + "unit-threaded": "0.7.55" + } +} diff --git a/source/app.d b/source/app.d new file mode 100644 index 0000000..040190a --- /dev/null +++ b/source/app.d @@ -0,0 +1,47 @@ +import std.stdio; + +import cm3d2; + +void main(string[] args) +{ + if (args.length < 2) + { + help(args[0]); + return; + } + + switch (args[1]) + { + case "help": + case "-h": + case "--help": + help(args[0]); + break; + case "menu-to-sdl": + throw new Exception("Not implemented yet"); + case "sdl-to-menu": + throw new Exception("Not implemented yet"); + default: + writeln("Unknown option '" ~ args[1] ~ "'"); + writeln(); + goto case "help"; + } +} + +void help(string toolPath) +{ + writeln("Usage: " ~ toolPath ~ " "); + writeln(); + + void showCommandUsage(string command, string description) + { + writeln(" " ~ toolPath ~ " " ~ command); + writeln(" " ~ description); + } + + showCommandUsage("menu-to-sdl", "Convert .menu to SDL"); + showCommandUsage("sdl-to-menu", "Convert SDL to .menu"); + + writeln(); + writeln("Reads input from stdin and writes output to stdout."); +} diff --git a/source/cm3d2/menu.d b/source/cm3d2/menu.d new file mode 100644 index 0000000..a545dde --- /dev/null +++ b/source/cm3d2/menu.d @@ -0,0 +1,24 @@ +module cm3d2.menu; + +class Menu +{ + public static Menu fromSDL(string sdl) + { + throw new Exception("Not implemented yet"); + } + + public static Menu fromMenu(string menu) + { + throw new Exception("Not implemented yet"); + } + + public string toMenu() + { + throw new Exception("Not implemented yet"); + } + + public string toSDL() + { + throw new Exception("Not implemented yet"); + } +} diff --git a/source/cm3d2/package.d b/source/cm3d2/package.d new file mode 100644 index 0000000..a6edf2e --- /dev/null +++ b/source/cm3d2/package.d @@ -0,0 +1,3 @@ +module cm3d2; + +public import cm3d2.menu;