Fix enum tables.
Recode files from latin-1 to utf8. Fix incorrect enum annotations.master
parent
58d08ede52
commit
0bd38caa7a
|
@ -360,7 +360,7 @@ def parse_enum(toktype, toktext, tokens, preceding_comment=None):
|
|||
return None
|
||||
|
||||
def write_license_header(fl):
|
||||
fl.write('/* Copyright © 2008-2017 Pioneer Developers. See AUTHORS.txt for details */\n')
|
||||
fl.write('/* Copyright © 2008-2017 Pioneer Developers. See AUTHORS.txt for details */\n')
|
||||
fl.write('/* Licensed under the terms of the GPL v3. See licenses/GPL-3.txt */\n')
|
||||
fl.write('\n')
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
#include "scenegraph/Model.h"
|
||||
#include "DynamicBody.h"
|
||||
|
||||
enum Thruster { // <enum scope='ShipType' name=ShipTypeThruster prefix=THRUSTER_ public>
|
||||
enum Thruster { // <enum scope='Thruster' name=ShipTypeThruster prefix=THRUSTER_ public>
|
||||
THRUSTER_REVERSE,
|
||||
THRUSTER_FORWARD,
|
||||
THRUSTER_UP,
|
||||
|
@ -62,7 +62,7 @@ class Propulsion
|
|||
inline vector3d GetActualAngThrust() const { return m_angThrust * m_angThrusters * m_power_mul; }
|
||||
|
||||
// Fuel
|
||||
enum FuelState { // <enum scope='Ship' name=ShipFuelStatus prefix=FUEL_ public>
|
||||
enum FuelState { // <enum scope='Propulsion' name=PropulsionFuelStatus prefix=FUEL_ public>
|
||||
FUEL_OK,
|
||||
FUEL_WARNING,
|
||||
FUEL_EMPTY,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/// The MIT License (MIT)
|
||||
/// The MIT License (MIT)
|
||||
///
|
||||
/// Copyright (c) 2016 Andrew J Copland
|
||||
///
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/// The MIT License (MIT)
|
||||
/// The MIT License (MIT)
|
||||
///
|
||||
/// Copyright (c) 2016 Andrew J Copland
|
||||
///
|
||||
|
|
20
src/Ship.h
20
src/Ship.h
|
@ -166,19 +166,21 @@ public:
|
|||
};
|
||||
AlertState GetAlertState() { return m_alertState; }
|
||||
|
||||
void AIClearInstructions();
|
||||
void AIClearInstructions(); // Note: defined in Ship-AI.cpp
|
||||
bool AIIsActive() { return m_curAICmd ? true : false; }
|
||||
void AIGetStatusText(char *str);
|
||||
void AIGetStatusText(char *str); // Note: defined in Ship-AI.cpp
|
||||
|
||||
void AIKamikaze(Body *target);
|
||||
void AIKill(Ship *target);
|
||||
void AIKamikaze(Body *target); // Note: defined in Ship-AI.cpp
|
||||
void AIKill(Ship *target); // Note: defined in Ship-AI.cpp
|
||||
//void AIJourney(SystemBodyPath &dest);
|
||||
void AIDock(SpaceStation *target);
|
||||
void AIFlyTo(Body *target);
|
||||
void AIOrbit(Body *target, double alt);
|
||||
void AIHoldPosition();
|
||||
void AIDock(SpaceStation *target); // Note: defined in Ship-AI.cpp
|
||||
void AIFlyTo(Body *target); // Note: defined in Ship-AI.cpp
|
||||
void AIOrbit(Body *target, double alt); // Note: defined in Ship-AI.cpp
|
||||
void AIHoldPosition(); // Note: defined in Ship-AI.cpp
|
||||
|
||||
void AIBodyDeleted(const Body* const body) {}; // todo: signals
|
||||
void AIBodyDeleted(const Body* const body) {}; // Note: defined in Ship-AI.cpp // todo: signals
|
||||
|
||||
const AICommand *GetAICommand() const { return m_curAICmd; }
|
||||
|
||||
virtual void PostLoadFixup(Space *space) override;
|
||||
|
||||
|
|
|
@ -5,11 +5,15 @@
|
|||
/* enum table generated by scan_enums.py */
|
||||
|
||||
#include "enum_table.h"
|
||||
#include "DynamicBody.h"
|
||||
#include "LuaEngine.h"
|
||||
#include "LuaFileSystem.h"
|
||||
#include "Object.h"
|
||||
#include "Polit.h"
|
||||
#include "Propulsion.h"
|
||||
#include "Ship.h"
|
||||
#include "ShipAICmd.h"
|
||||
#include "ShipController.h"
|
||||
#include "ShipType.h"
|
||||
#include "galaxy/Economy.h"
|
||||
#include "galaxy/StarSystem.h"
|
||||
|
@ -26,6 +30,14 @@
|
|||
#include "ui/Table.h"
|
||||
#include "ui/Widget.h"
|
||||
|
||||
const struct EnumItem ENUM_ShipAIError[] = {
|
||||
{ "NONE", int(Ship::AIERROR_NONE) },
|
||||
{ "GRAV_TOO_HIGH", int(Ship::AIERROR_GRAV_TOO_HIGH) },
|
||||
{ "REFUSED_PERM", int(Ship::AIERROR_REFUSED_PERM) },
|
||||
{ "ORBIT_IMPOSSIBLE", int(Ship::AIERROR_ORBIT_IMPOSSIBLE) },
|
||||
{ 0, 0 },
|
||||
};
|
||||
|
||||
const struct EnumItem ENUM_DetailLevel[] = {
|
||||
{ "VERY_LOW", int(LuaEngine::DETAIL_VERY_LOW) },
|
||||
{ "LOW", int(LuaEngine::DETAIL_LOW) },
|
||||
|
@ -83,6 +95,23 @@ const struct EnumItem ENUM_PolitGovType[] = {
|
|||
{ 0, 0 },
|
||||
};
|
||||
|
||||
const struct EnumItem ENUM_ShipTypeThruster[] = {
|
||||
{ "REVERSE", int(Thruster::THRUSTER_REVERSE) },
|
||||
{ "FORWARD", int(Thruster::THRUSTER_FORWARD) },
|
||||
{ "UP", int(Thruster::THRUSTER_UP) },
|
||||
{ "DOWN", int(Thruster::THRUSTER_DOWN) },
|
||||
{ "LEFT", int(Thruster::THRUSTER_LEFT) },
|
||||
{ "RIGHT", int(Thruster::THRUSTER_RIGHT) },
|
||||
{ 0, 0 },
|
||||
};
|
||||
|
||||
const struct EnumItem ENUM_PropulsionFuelStatus[] = {
|
||||
{ "OK", int(Propulsion::FUEL_OK) },
|
||||
{ "WARNING", int(Propulsion::FUEL_WARNING) },
|
||||
{ "EMPTY", int(Propulsion::FUEL_EMPTY) },
|
||||
{ 0, 0 },
|
||||
};
|
||||
|
||||
const struct EnumItem ENUM_ShipFlightState[] = {
|
||||
{ "FLYING", int(Ship::FLYING) },
|
||||
{ "DOCKING", int(Ship::DOCKING) },
|
||||
|
@ -113,28 +142,29 @@ const struct EnumItem ENUM_ShipAlertStatus[] = {
|
|||
{ 0, 0 },
|
||||
};
|
||||
|
||||
const struct EnumItem ENUM_ShipAIError[] = {
|
||||
{ "NONE", int(Ship::AIERROR_NONE) },
|
||||
{ "GRAV_TOO_HIGH", int(Ship::AIERROR_GRAV_TOO_HIGH) },
|
||||
{ "REFUSED_PERM", int(Ship::AIERROR_REFUSED_PERM) },
|
||||
{ "ORBIT_IMPOSSIBLE", int(Ship::AIERROR_ORBIT_IMPOSSIBLE) },
|
||||
const struct EnumItem ENUM_ShipAICmdName[] = {
|
||||
{ "CMD_NONE", int(AICommand::CmdName::CMD_NONE) },
|
||||
{ "CMD_DOCK", int(AICommand::CmdName::CMD_DOCK) },
|
||||
{ "CMD_FLYTO", int(AICommand::CmdName::CMD_FLYTO) },
|
||||
{ "CMD_FLYAROUND", int(AICommand::CmdName::CMD_FLYAROUND) },
|
||||
{ "CMD_KILL", int(AICommand::CmdName::CMD_KILL) },
|
||||
{ "CMD_KAMIKAZE", int(AICommand::CmdName::CMD_KAMIKAZE) },
|
||||
{ "CMD_HOLDPOSITION", int(AICommand::CmdName::CMD_HOLDPOSITION) },
|
||||
{ "CMD_FORMATION", int(AICommand::CmdName::CMD_FORMATION) },
|
||||
{ 0, 0 },
|
||||
};
|
||||
|
||||
const struct EnumItem ENUM_ShipFuelStatus[] = {
|
||||
{ "OK", int(Propulsion::FUEL_OK) },
|
||||
{ "WARNING", int(Propulsion::FUEL_WARNING) },
|
||||
{ "EMPTY", int(Propulsion::FUEL_EMPTY) },
|
||||
{ 0, 0 },
|
||||
};
|
||||
|
||||
const struct EnumItem ENUM_ShipTypeThruster[] = {
|
||||
{ "REVERSE", int(Thruster::THRUSTER_REVERSE) },
|
||||
{ "FORWARD", int(Thruster::THRUSTER_FORWARD) },
|
||||
{ "UP", int(Thruster::THRUSTER_UP) },
|
||||
{ "DOWN", int(Thruster::THRUSTER_DOWN) },
|
||||
{ "LEFT", int(Thruster::THRUSTER_LEFT) },
|
||||
{ "RIGHT", int(Thruster::THRUSTER_RIGHT) },
|
||||
const struct EnumItem ENUM_ShipControllerFlightControlState[] = {
|
||||
{ "CONTROL_MANUAL", int(FlightControlState::CONTROL_MANUAL) },
|
||||
{ "CONTROL_FIXSPEED", int(FlightControlState::CONTROL_FIXSPEED) },
|
||||
{ "CONTROL_FIXHEADING_FORWARD", int(FlightControlState::CONTROL_FIXHEADING_FORWARD) },
|
||||
{ "CONTROL_FIXHEADING_BACKWARD", int(FlightControlState::CONTROL_FIXHEADING_BACKWARD) },
|
||||
{ "CONTROL_FIXHEADING_NORMAL", int(FlightControlState::CONTROL_FIXHEADING_NORMAL) },
|
||||
{ "CONTROL_FIXHEADING_ANTINORMAL", int(FlightControlState::CONTROL_FIXHEADING_ANTINORMAL) },
|
||||
{ "CONTROL_FIXHEADING_RADIALLY_INWARD", int(FlightControlState::CONTROL_FIXHEADING_RADIALLY_INWARD) },
|
||||
{ "CONTROL_FIXHEADING_RADIALLY_OUTWARD", int(FlightControlState::CONTROL_FIXHEADING_RADIALLY_OUTWARD) },
|
||||
{ "CONTROL_FIXHEADING_KILLROT", int(FlightControlState::CONTROL_FIXHEADING_KILLROT) },
|
||||
{ "CONTROL_AUTOPILOT", int(FlightControlState::CONTROL_AUTOPILOT) },
|
||||
{ 0, 0 },
|
||||
};
|
||||
|
||||
|
@ -455,17 +485,19 @@ const struct EnumItem ENUM_UIFont[] = {
|
|||
};
|
||||
|
||||
const struct EnumTable ENUM_TABLES[] = {
|
||||
{ "ShipAIError", ENUM_ShipAIError },
|
||||
{ "DetailLevel", ENUM_DetailLevel },
|
||||
{ "FileSystemRoot", ENUM_FileSystemRoot },
|
||||
{ "PhysicsObjectType", ENUM_PhysicsObjectType },
|
||||
{ "PolitEcon", ENUM_PolitEcon },
|
||||
{ "PolitGovType", ENUM_PolitGovType },
|
||||
{ "ShipTypeThruster", ENUM_ShipTypeThruster },
|
||||
{ "PropulsionFuelStatus", ENUM_PropulsionFuelStatus },
|
||||
{ "ShipFlightState", ENUM_ShipFlightState },
|
||||
{ "ShipJumpStatus", ENUM_ShipJumpStatus },
|
||||
{ "ShipAlertStatus", ENUM_ShipAlertStatus },
|
||||
{ "ShipAIError", ENUM_ShipAIError },
|
||||
{ "ShipFuelStatus", ENUM_ShipFuelStatus },
|
||||
{ "ShipTypeThruster", ENUM_ShipTypeThruster },
|
||||
{ "ShipAICmdName", ENUM_ShipAICmdName },
|
||||
{ "ShipControllerFlightControlState", ENUM_ShipControllerFlightControlState },
|
||||
{ "DualLaserOrientation", ENUM_DualLaserOrientation },
|
||||
{ "ShipTypeTag", ENUM_ShipTypeTag },
|
||||
{ "EconType", ENUM_EconType },
|
||||
|
@ -498,17 +530,19 @@ const struct EnumTable ENUM_TABLES[] = {
|
|||
};
|
||||
|
||||
const struct EnumTable ENUM_TABLES_PUBLIC[] = {
|
||||
{ "ShipAIError", ENUM_ShipAIError },
|
||||
{ "DetailLevel", ENUM_DetailLevel },
|
||||
{ "FileSystemRoot", ENUM_FileSystemRoot },
|
||||
{ "PhysicsObjectType", ENUM_PhysicsObjectType },
|
||||
{ "PolitEcon", ENUM_PolitEcon },
|
||||
{ "PolitGovType", ENUM_PolitGovType },
|
||||
{ "ShipTypeThruster", ENUM_ShipTypeThruster },
|
||||
{ "PropulsionFuelStatus", ENUM_PropulsionFuelStatus },
|
||||
{ "ShipFlightState", ENUM_ShipFlightState },
|
||||
{ "ShipJumpStatus", ENUM_ShipJumpStatus },
|
||||
{ "ShipAlertStatus", ENUM_ShipAlertStatus },
|
||||
{ "ShipAIError", ENUM_ShipAIError },
|
||||
{ "ShipFuelStatus", ENUM_ShipFuelStatus },
|
||||
{ "ShipTypeThruster", ENUM_ShipTypeThruster },
|
||||
{ "ShipAICmdName", ENUM_ShipAICmdName },
|
||||
{ "ShipControllerFlightControlState", ENUM_ShipControllerFlightControlState },
|
||||
{ "DualLaserOrientation", ENUM_DualLaserOrientation },
|
||||
{ "ShipTypeTag", ENUM_ShipTypeTag },
|
||||
{ "EconType", ENUM_EconType },
|
||||
|
|
|
@ -10,17 +10,19 @@
|
|||
struct EnumItem { const char *name; int value; };
|
||||
struct EnumTable { const char *name; const EnumItem *first; };
|
||||
|
||||
extern const struct EnumItem ENUM_ShipAIError[];
|
||||
extern const struct EnumItem ENUM_DetailLevel[];
|
||||
extern const struct EnumItem ENUM_FileSystemRoot[];
|
||||
extern const struct EnumItem ENUM_PhysicsObjectType[];
|
||||
extern const struct EnumItem ENUM_PolitEcon[];
|
||||
extern const struct EnumItem ENUM_PolitGovType[];
|
||||
extern const struct EnumItem ENUM_ShipTypeThruster[];
|
||||
extern const struct EnumItem ENUM_PropulsionFuelStatus[];
|
||||
extern const struct EnumItem ENUM_ShipFlightState[];
|
||||
extern const struct EnumItem ENUM_ShipJumpStatus[];
|
||||
extern const struct EnumItem ENUM_ShipAlertStatus[];
|
||||
extern const struct EnumItem ENUM_ShipAIError[];
|
||||
extern const struct EnumItem ENUM_ShipFuelStatus[];
|
||||
extern const struct EnumItem ENUM_ShipTypeThruster[];
|
||||
extern const struct EnumItem ENUM_ShipAICmdName[];
|
||||
extern const struct EnumItem ENUM_ShipControllerFlightControlState[];
|
||||
extern const struct EnumItem ENUM_DualLaserOrientation[];
|
||||
extern const struct EnumItem ENUM_ShipTypeTag[];
|
||||
extern const struct EnumItem ENUM_EconType[];
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright © 2008-2017 Pioneer Developers. See AUTHORS.txt for details
|
||||
// Copyright © 2008-2017 Pioneer Developers. See AUTHORS.txt for details
|
||||
// Licensed under the terms of the GPL v3. See licenses/GPL-3.txt
|
||||
|
||||
#ifndef GRAPHICS_TYPES_H
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright © 2008-2017 Pioneer Developers. See AUTHORS.txt for details
|
||||
// Copyright © 2008-2017 Pioneer Developers. See AUTHORS.txt for details
|
||||
// Licensed under the terms of the GPL v3. See licenses/GPL-3.txt
|
||||
|
||||
#ifndef _VERTEXARRAY_H
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright © 2008-2017 Pioneer Developers. See AUTHORS.txt for details
|
||||
// Copyright © 2008-2017 Pioneer Developers. See AUTHORS.txt for details
|
||||
// Licensed under the terms of the GPL v3. See licenses/GPL-3.txt
|
||||
|
||||
#ifndef GRAPHICS_VERTEXBUFFER_H
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright © 2008-2017 Pioneer Developers. See AUTHORS.txt for details
|
||||
// Copyright © 2008-2017 Pioneer Developers. See AUTHORS.txt for details
|
||||
// Licensed under the terms of the GPL v3. See licenses/GPL-3.txt
|
||||
|
||||
#ifndef DUMMY_VERTEXBUFFER_H
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright © 2008-2014 Pioneer Developers. See AUTHORS.txt for details
|
||||
// Copyright © 2008-2014 Pioneer Developers. See AUTHORS.txt for details
|
||||
// Licensed under the terms of the GPL v3. See licenses/GPL-3.txt
|
||||
|
||||
#ifndef GL2_VERTEXBUFFER_H
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright © 2008-2015 Pioneer Developers. See AUTHORS.txt for details
|
||||
// Copyright © 2008-2015 Pioneer Developers. See AUTHORS.txt for details
|
||||
// Licensed under the terms of the GPL v3. See licenses/GPL-3.txt
|
||||
|
||||
#pragma once
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright © 2008-2017 Pioneer Developers. See AUTHORS.txt for details
|
||||
// Copyright © 2008-2017 Pioneer Developers. See AUTHORS.txt for details
|
||||
// Licensed under the terms of the GPL v3. See licenses/GPL-3.txt
|
||||
|
||||
#pragma once
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright © 2008-2017 Pioneer Developers. See AUTHORS.txt for details
|
||||
// Copyright © 2008-2017 Pioneer Developers. See AUTHORS.txt for details
|
||||
// Licensed under the terms of the GPL v3. See licenses/GPL-3.txt
|
||||
|
||||
#ifndef OGL_VERTEXBUFFER_H
|
||||
|
|
Loading…
Reference in New Issue