Skip to content

Commit

Permalink
[ShipTemplate] Use import values for getSystemName() enum conversion (#…
Browse files Browse the repository at this point in the history
…1834)

getLocaleSystemName() still returns the long string for the given
language, so getSystemName()'s values should use the short system
names that scripts use via shipTemplate.hpp.
  • Loading branch information
oznogon authored Apr 12, 2023
1 parent 34b3b0e commit 9b4e050
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
18 changes: 9 additions & 9 deletions src/shipTemplate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -555,15 +555,15 @@ string getSystemName(ESystem system)
{
switch(system)
{
case SYS_Reactor: return "Reactor";
case SYS_BeamWeapons: return "Beam Weapons";
case SYS_MissileSystem: return "Missile System";
case SYS_Maneuver: return "Maneuvering";
case SYS_Impulse: return "Impulse Engines";
case SYS_Warp: return "Warp Drive";
case SYS_JumpDrive: return "Jump Drive";
case SYS_FrontShield: return "Front Shield Generator";
case SYS_RearShield: return "Rear Shield Generator";
case SYS_Reactor: return "reactor";
case SYS_BeamWeapons: return "beamweapons";
case SYS_MissileSystem: return "missilesystem";
case SYS_Maneuver: return "maneuvering";
case SYS_Impulse: return "impulse";
case SYS_Warp: return "warp";
case SYS_JumpDrive: return "jumpdrive";
case SYS_FrontShield: return "frontshield";
case SYS_RearShield: return "rearshield";
default:
return "UNKNOWN";
}
Expand Down
8 changes: 4 additions & 4 deletions src/spaceObjects/playerSpaceship.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2281,22 +2281,22 @@ string PlayerSpaceship::getExportLine()
auto difference = std::fabs(current_factor - default_factor) > std::numeric_limits<float>::epsilon();
if (difference)
{
result += ":setSystemPowerFactor(" + string(system) + ", " + string(current_factor, 1) + ")";
result += ":setSystemPowerFactor(\"" + getSystemName(system) + "\", " + string(current_factor, 1) + ")";
}

if (std::fabs(getSystemCoolantRate(system) - ShipSystem::default_coolant_rate_per_second) > std::numeric_limits<float>::epsilon())
{
result += ":setSystemCoolantRate(" + string(system) + ", " + string(getSystemCoolantRate(system), 2) + ")";
result += ":setSystemCoolantRate(\"" + getSystemName(system) + "\", " + string(getSystemCoolantRate(system), 2) + ")";
}

if (std::fabs(getSystemHeatRate(system) - ShipSystem::default_heat_rate_per_second) > std::numeric_limits<float>::epsilon())
{
result += ":setSystemHeatRate(" + string(system) + ", " + string(getSystemHeatRate(system), 2) + ")";
result += ":setSystemHeatRate(\"" + getSystemName(system) + "\", " + string(getSystemHeatRate(system), 2) + ")";
}

if (std::fabs(getSystemPowerRate(system) - ShipSystem::default_power_rate_per_second) > std::numeric_limits<float>::epsilon())
{
result += ":setSystemPowerRate(" + string(system) + ", " + string(getSystemPowerRate(system), 2) + ")";
result += ":setSystemPowerRate(\"" + getSystemName(system) + "\", " + string(getSystemPowerRate(system), 2) + ")";
}
}
}
Expand Down

2 comments on commit 9b4e050

@daid-tinyci
Copy link

@daid-tinyci daid-tinyci bot commented on 9b4e050 Apr 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TinyCI build failure:

[cmake .. -G Ninja -DSERIOUS_PROTON_DIR=../../SeriousProton -DCMAKE_TOOLCHAIN_FILE=../cmake/android.toolchain -DCMAKE_BUILD_TYPE=Release -DANDROID_ABI=arm64-v8a] returned [1]:

  Could not find toolchain file:

  /data/tinyci_build/daid/EmptyEpsilon/cmake/android/sdk/ndk/23.2.8568313/build/cmake/android.toolchain.cmake

Call Stack (most recent call first):

  CMakeLists.txt:6 (project)





CMake Error: CMake was unable to find a build program corresponding to "Ninja".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.

CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage

CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage

-- Configuring incomplete, errors occurred!

No such file or directory

CMake Error: Generator: execution of make failed. Make command was: "" "install"

CMake Error at cmake/android.toolchain:193 (include):

  include could not find load file:



    /data/tinyci_build/daid/EmptyEpsilon/cmake/android/sdk/ndk/23.2.8568313/build/cmake/android.toolchain.cmake

Call Stack (most recent call first):

  _build_android64/CMakeFiles/3.13.4/CMakeSystem.cmake:6 (include)

  CMakeLists.txt:36 (project)





-- The CXX compiler identification is GNU 8.3.0

-- The C compiler identification is GNU 8.3.0

-- Check for working CXX compiler: /usr/bin/c++

Warning: Failed to read or create install properties file.

CMake Error at /data/tinyci_build/daid/EmptyEpsilon/cmake/android.toolchain:40 (message):

  Failed to execute:

  COMMAND;/data/tinyci_build/daid/EmptyEpsilon/cmake/android/sdk/cmdline-tools/bin/sdkmanager;--sdk_root=/data/tinyci_build/daid/EmptyEpsilon/cmake/android/sdk;ndk\;23.2.8568313

Call Stack (most recent call first):

  /data/tinyci_build/daid/EmptyEpsilon/cmake/android.toolchain:66 (execute_process_ex)

  /data/tinyci_build/daid/EmptyEpsilon/_build_android64/CMakeFiles/3.13.4/CMakeSystem.cmake:6 (include)

  /data/tinyci_build/daid/EmptyEpsilon/_build_android64/CMakeFiles/CMakeTmp/CMakeLists.txt:3 (project)





CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage

CMake Error at /usr/share/cmake-3.13/Modules/CMakeTestCXXCompiler.cmake:30 (try_compile):

  Failed to configure test project build system.

Call Stack (most recent call first):

  CMakeLists.txt:36 (project)





Loading package information...                                                  
Loading local repository...                                                     
[                                       ] 3% Loading local repository...        
[                                       ] 3% Fetch remote repository...         
[=                                      ] 3% Fetch remote repository...         
[=                                      ] 4% Fetch remote repository...         
[=                                      ] 5% Fetch remote repository...         
[==                                     ] 5% Fetch remote repository...         
[==                                     ] 6% Fetch remote repository...         
[==                                     ] 7% Fetch remote repository...         
[==                                     ] 7% Computing updates...               
[===                                    ] 8% Computing updates...               
[===                                    ] 10% Computing updates...              
[===                                    ] 10% Installing NDK (Side by side) 23.2
                                                                                
[===                                    ] 10% Installing NDK (Side by side) 23.2
-- Configuring incomplete, errors occurred!

See also "/data/tinyci_build/daid/EmptyEpsilon/_build_android64/CMakeFiles/CMakeOutput.log".

@daid-tinyci
Copy link

@daid-tinyci daid-tinyci bot commented on 9b4e050 Apr 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TinyCI build failure:

[ninja -j 2 package] returned [1]:


[2/170] Building CXX object CMakeFiles/EE_GuiLIB.dir/src/gui/hotkeyConfig.cpp.o

FAILED: CMakeFiles/EE_GuiLIB.dir/src/gui/hotkeyConfig.cpp.o 

/usr/bin/c++   -I../src -Iinclude -I/data/tinyci_build/daid/SeriousProton/src -ISeriousProton/include -I/usr/include/SDL2 -I/usr/include/freetype2 -I/data/tinyci_build/daid/SeriousProton/libs/Box2D/.. -I/data/tinyci_build/daid/SeriousProton/libs/glad -I/data/tinyci_build/daid/SeriousProton/libs/lua/.. -I_deps/glm-src/glm/.. -I_deps/basis-src -I/data/tinyci_build/daid/SeriousProton/libs/libopus/include -I_deps/meshoptimizer-src/src -O2 -g -DNDEBUG   -fdiagnostics-color -g1 -O3 -flto -funsafe-math-optimizations -Wall -Wextra -Woverloaded-virtual -Wdouble-promotion -Wsuggest-override -Werror=return-type -Wno-unused-parameter -Wno-unused-but-set-parameter -std=gnu++17 -MD -MT CMakeFiles/EE_GuiLIB.dir/src/gui/hotkeyConfig.cpp.o -MF CMakeFiles/EE_GuiLIB.dir/src/gui/hotkeyConfig.cpp.o.d -o CMakeFiles/EE_GuiLIB.dir/src/gui/hotkeyConfig.cpp.o -c ../src/gui/hotkeyConfig.cpp

In file included from ../src/shipTemplate.h:13,

                 from ../src/gui/hotkeyConfig.cpp:4:

../src/missileWeaponData.h:25:41: error: expected constructor, destructor, or type conversion before ‘;’ token

 REGISTER_MULTIPLAYER_ENUM(EMissileSizes);

                                         ^

In file included from ../src/gui/hotkeyConfig.cpp:4:

../src/shipTemplate.h:209:35: error: expected constructor, destructor, or type conversion before ‘;’ token

 REGISTER_MULTIPLAYER_ENUM(ESystem);

                                   ^

[3/170] Building CXX object CMakeFiles/EE_GuiLIB.dir/src/gui/gui2_rotationdial.cpp.o

ninja: build stopped: subcommand failed.

Please sign in to comment.