Rigs of Rods 2026.01
Soft-body Physics Simulation
Loading...
Searching...
No Matches
EngineAngelscriptCommon.cpp
Go to the documentation of this file.
1/*
2 This source file is part of Rigs of Rods
3 Copyright 2005-2012 Pierre-Michel Ricordel
4 Copyright 2007-2012 Thomas Fischer
5 Copyright 2013-2023 Petr Ohlidal
6
7 For more information, see http://www.rigsofrods.org/
8
9 Rigs of Rods is free software: you can redistribute it and/or modify
10 it under the terms of the GNU General Public License version 3, as
11 published by the Free Software Foundation.
12
13 Rigs of Rods is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with Rigs of Rods. If not, see <http://www.gnu.org/licenses/>.
20*/
21
23
24#include "AngelScriptBindings.h"
25#include "Engine.h"
26
27#include <angelscript.h>
28
29using namespace AngelScript;
30
31void RoR::RegisterEngineCommon(asIScriptEngine* engine)
32{
33 int r;
34
35 r = engine->RegisterEnum("autoswitch"); ROR_ASSERT(r >= 0);
36 r = engine->RegisterEnumValue("autoswitch", "AUTOSWITCH_REAR", Engine::REAR); ROR_ASSERT(r >= 0);
37 r = engine->RegisterEnumValue("autoswitch", "AUTOSWITCH_NEUTRAL", Engine::NEUTRAL); ROR_ASSERT(r >= 0);
38 r = engine->RegisterEnumValue("autoswitch", "AUTOSWITCH_DRIVE", Engine::DRIVE); ROR_ASSERT(r >= 0);
39 r = engine->RegisterEnumValue("autoswitch", "AUTOSWITCH_TWO", Engine::TWO); ROR_ASSERT(r >= 0);
40 r = engine->RegisterEnumValue("autoswitch", "AUTOSWITCH_ONE", Engine::ONE); ROR_ASSERT(r >= 0);
41 r = engine->RegisterEnumValue("autoswitch", "AUTOSWITCH_MANUALMODE", Engine::MANUALMODE); ROR_ASSERT(r >= 0);
42
43 r = engine->RegisterEnum("SimGearboxMode"); ROR_ASSERT(r >= 0);
44 r = engine->RegisterEnumValue("SimGearboxMode", "AUTO", static_cast<int>(SimGearboxMode::AUTO)); ROR_ASSERT(r >= 0);
45 r = engine->RegisterEnumValue("SimGearboxMode", "SEMI_AUTO", static_cast<int>(SimGearboxMode::SEMI_AUTO)); ROR_ASSERT(r >= 0);
46 r = engine->RegisterEnumValue("SimGearboxMode", "MANUAL", static_cast<int>(SimGearboxMode::MANUAL)); ROR_ASSERT(r >= 0);
47 r = engine->RegisterEnumValue("SimGearboxMode", "MANUAL_STICK", static_cast<int>(SimGearboxMode::MANUAL_STICK)); ROR_ASSERT(r >= 0);
48 r = engine->RegisterEnumValue("SimGearboxMode", "MANUAL_RANGES", static_cast<int>(SimGearboxMode::MANUAL_RANGES)); ROR_ASSERT(r >= 0);
49}
#define ROR_ASSERT(_EXPR)
Definition Application.h:40
void RegisterEngineCommon(AngelScript::asIScriptEngine *engine)
Register class Engine and related enums, defined in EngineAngelscript.cpp.