mirror of
https://github.com/aimrebirth/tools.git
synced 2026-04-15 01:43:25 +00:00
Respect -a flag in mod converter.
This commit is contained in:
parent
c8da06be5c
commit
541c3a0a89
3 changed files with 58 additions and 19 deletions
|
|
@ -64,6 +64,7 @@ try
|
||||||
{
|
{
|
||||||
args::ArgumentParser parser("mmo extractor");
|
args::ArgumentParser parser("mmo extractor");
|
||||||
args::HelpFlag help(parser, "help", "Display this help menu", { 'h', "help" });
|
args::HelpFlag help(parser, "help", "Display this help menu", { 'h', "help" });
|
||||||
|
args::Flag af(parser, "a", "All formats", { 'a' });
|
||||||
args::Flag mr(parser, "mr", "AIM Racing MOD file", { "mr" });
|
args::Flag mr(parser, "mr", "AIM Racing MOD file", { "mr" });
|
||||||
args::Positional<std::string> file_path(parser, "file or directory", "MOD_ file or directory with MOD_ files");
|
args::Positional<std::string> file_path(parser, "file or directory", "MOD_ file or directory with MOD_ files");
|
||||||
parser.Prog(argv[0]);
|
parser.Prog(argv[0]);
|
||||||
|
|
@ -72,6 +73,8 @@ try
|
||||||
|
|
||||||
if (mr)
|
if (mr)
|
||||||
gameType = GameType::AimR;
|
gameType = GameType::AimR;
|
||||||
|
if (af)
|
||||||
|
all_formats = true;
|
||||||
|
|
||||||
p = file_path.Get();
|
p = file_path.Get();
|
||||||
if (fs::is_regular_file(p))
|
if (fs::is_regular_file(p))
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,22 @@
|
||||||
%{
|
%{
|
||||||
|
/*
|
||||||
|
* AIM tm_converter
|
||||||
|
* Copyright (C) 2015 lzwdgc
|
||||||
|
*
|
||||||
|
* 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 <assert.h>
|
#include <assert.h>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
@ -28,16 +46,16 @@
|
||||||
%define api.token.constructor // C++ style of handling variants
|
%define api.token.constructor // C++ style of handling variants
|
||||||
%define parse.assert // check C++ variant types
|
%define parse.assert // check C++ variant types
|
||||||
|
|
||||||
%code requires // forward decl of C++ driver (our parser) in HPP
|
%code requires // forward decl of C++ driver (our parser) in HPP
|
||||||
{
|
{
|
||||||
#include <Polygon4/DataManager/Schema/Context.h>
|
#include <Polygon4/DataManager/Schema/Context.h>
|
||||||
|
|
||||||
class ParserDriver;
|
class ParserDriver;
|
||||||
}
|
}
|
||||||
|
|
||||||
// param to yy::parser() constructor
|
// param to yy::parser() constructor
|
||||||
// the parsing context
|
// the parsing context
|
||||||
%param { ParserDriver &driver }
|
%param { ParserDriver &driver }
|
||||||
|
|
||||||
////////////////////////////////////////
|
////////////////////////////////////////
|
||||||
|
|
||||||
|
|
@ -310,7 +328,7 @@ integer: INTEGER
|
||||||
|
|
||||||
%%
|
%%
|
||||||
|
|
||||||
void yy::parser::error(const location_type& l, const std::string& m)
|
void yy::parser::error(const location_type& l, const std::string& m)
|
||||||
{
|
{
|
||||||
driver.error(l, m);
|
driver.error(l, m);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,22 @@
|
||||||
%{
|
%{
|
||||||
|
/*
|
||||||
|
* AIM tm_converter
|
||||||
|
* Copyright (C) 2015 lzwdgc
|
||||||
|
*
|
||||||
|
* 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/>.
|
||||||
|
*/
|
||||||
|
|
||||||
#pragma warning(disable: 4005)
|
#pragma warning(disable: 4005)
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
|
|
@ -34,11 +52,11 @@ STRING [[:alpha:]_-][[:alnum:]_-]*
|
||||||
%x user_string
|
%x user_string
|
||||||
|
|
||||||
|
|
||||||
%%
|
%%
|
||||||
|
|
||||||
%{
|
%{
|
||||||
// Code run each time yylex is called.
|
// Code run each time yylex is called.
|
||||||
loc.step();
|
loc.step();
|
||||||
%}
|
%}
|
||||||
|
|
||||||
#.*/\n ; // ignore comments
|
#.*/\n ; // ignore comments
|
||||||
|
|
@ -49,7 +67,7 @@ STRING [[:alpha:]_-][[:alnum:]_-]*
|
||||||
loc.lines(yyleng);
|
loc.lines(yyleng);
|
||||||
loc.step();
|
loc.step();
|
||||||
}
|
}
|
||||||
|
|
||||||
";" return MAKE(SEMICOLON);
|
";" return MAKE(SEMICOLON);
|
||||||
":" return MAKE(COLON);
|
":" return MAKE(COLON);
|
||||||
"(" return MAKE(L_BRACKET);
|
"(" return MAKE(L_BRACKET);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue