Skip to content

Commit

Permalink
split OS name and version for LuaConstPlatform
Browse files Browse the repository at this point in the history
update WinVersion util beyond 6.1 (Windows 7)

Conflicts:
	doc/changelog.txt
  • Loading branch information
rt committed Oct 30, 2018
1 parent b19d7ba commit 4cfc937
Show file tree
Hide file tree
Showing 7 changed files with 316 additions and 258 deletions.
55 changes: 55 additions & 0 deletions doc/changelog.txt
Expand Up @@ -12,6 +12,8 @@ Sim:
- allow CEG trails for crashing aircraft (engine will randomly select from any generators listed in sfxTypes.crashExplosionGenerators)

Lua:
- add Platform.osVersion; complements Platform.osName
- add Platform.hwConfig
! remove Game.mapHumanName
! remove UnitDefs[i].moveDef.{family,type}
- let Spring.SelectUnitArray select enemy units with godmode enabled
Expand Down Expand Up @@ -112,8 +114,61 @@ Misc:
by either nested tables or 'parent' key.
- IME editing support for those with the proper SDL2 version/IME tool combination
! Made lockluaui.txt obsolete: no longer necessary for it to exists in order to enable VFS for LuaUI
- use SHA2 content hashes rather than CRC32

Fixes:
- fix #6059 (units with high turnRate/brakeRate/acceleration moving unexpectedly)
- fix #4268 (add Spring.AddObjectDecal)
- fix #4755 (wrong usage of addr2line on FreeBSD)
- fix #4945 (add Spring.GetMapStartPositions)
- fix #4724 (Spring.SetUnitNeutral not informing any attackers)
- fix #5864 (gunships not limited by maxVelocity when climbing)
- fix #4515 (aircraft jitter when moving and turning)
- fix #6048 (falling features shaking on the ground instead of fully stopping)
- fix #6046 #5326 #5222 #4663 (false camera movement if entering MMB mode while moving cursor)
- fix #6019 (Spring.IsAABBInView bug)
- fix #6038 (noExplode weapons not obeying SetUnitWeaponState("range"))
- fix #6036 (no method to detect MMB camera-pan mode)
- fix #5956 (inverted mouse camera panning for Windows 10 Pro users)
- fix #6022 (uniformArray not initializing array-uniforms in gl.CreateShader)
- fix #6012 (air-transports not unloading properly)
- fix #6010 (HoverAirMoveType aircraft ignoring smooth-mesh when idle)
- fix #6009 (aircraft landing on damage-dealing water when idle)
- fix #6007 / #5989 (desyncs on CMD_UNLOAD_UNITS)
- fix #5993 (voidwater triggering water explosion effects)
- fix #5247 (maximized minimap producing graphical glitches)
- fix #5962 (minimap viewport rectangle larger than what actual screen shows)
- fix #5965
- fix #5977 (log-system memory corruption)
- fix #5964 (shields occasionally letting projectiles pass)
- fix #5948 (memory corruption with LoadingMT=1)
- fix #5947 (PFS failure if starting square inside concave corner)
- fix #5934 (crash on malformed build-commands)
- fix #5923 (wrong external format passed to gl{BuildMipmaps,TexImage2D})
- fix #5927 (memory corruption in text-wrapping)
- fix #2127 (units chasing after full transports)
- fix #4972 (builders doing redundant movement to clear build-sites)
- fix #5207 (units not following waypoints)
- fix #2354 (Spring.GetUnitWeaponState not matching Spring.SetUnitWeaponState due to experience)
- fix #5841 (allow setting colour of area selection for custom commands)
- fix #5884 (treat collidee as attacker on unit <-> unit collisions for UnitPreDamaged)
- fix #5716 (add Weapon::{avoid,collision}Flags to Spring.{Get,Set}UnitWeaponState)
- fix #5652 (maneuverBlockTime aircraft control parameter)
- fix #1225 (inaccurate preview range-rings)
- fix #5870 (zero-based months in rotating infolog filenames)
- fix #5862 (Spring.DestroyUnit + Spring.CreateUnit not supporting persistent ID's)
- fix #5860 (units failing to aim uphill at targets near cliff edges)
- fix #5863 (too strict matrix orthonormality check)
- fix #5855 (memory corruption when loading models)
- fix #5852 (units chasing after auto-generated targets going out of range even on hold-pos)
- fix #5854 (broken default formation-move visualization)
- fix #5851 (DynamicWater crash if foamTexture specified as .dds file)
- fix #5850 (squished loadscreens with BumpWater enabled)
- fix #5806 (CEG spikes from underwater explosions drawn on water surface)
- fix #5820 (broken by 3bd78acb00cab732af4278ed324c7ee5dbc7c517)
- fix #5805 (broken water reflections in FPS camera mode)
- fix infinite backtracking loop in PFS
- fix #5814 (broken slopemap indexing for terrain buildability tests)
- fix #5803 (move goals cancelled when issued onto blocked terrain)
- fix Spring.{G,S}etConfigFloat not being callable
- fix Spring.GetPlayerRoster sometimes excluding active players
Expand Down
4 changes: 2 additions & 2 deletions rts/Lua/LuaConstPlatform.cpp
Expand Up @@ -34,10 +34,10 @@ bool LuaConstPlatform::PushEntries(lua_State* L)
LuaPushNamedBool(L, "glSupportClipSpaceControl", globalRendering->supportClipSpaceControl);
LuaPushNamedBool(L, "glSupportFragDepthLayout" , globalRendering->supportFragDepthLayout);

LuaPushNamedString(L, "osName", Platform::GetOSVersionStr());
LuaPushNamedString(L, "osName", Platform::GetOSNameStr());
LuaPushNamedString(L, "osVersion", Platform::GetOSVersionStr());
LuaPushNamedString(L, "osFamily", Platform::GetOSFamilyStr());
LuaPushNamedString(L, "hwInfo", Platform::GetHardwareStr());
LuaPushNamedString(L, "hwConfig", Platform::GetHardwareStr());

return true;
}
4 changes: 2 additions & 2 deletions rts/System/LogOutput.cpp
Expand Up @@ -281,8 +281,8 @@ void CLogOutput::LogSystemInfo()
LOG(" Spring %s", SpringVersion::GetFull().c_str());
LOG(" Build Environment: %s", SpringVersion::GetBuildEnvironment().c_str());
LOG(" Compiler Version: %s", SpringVersion::GetCompiler().c_str());
LOG(" Operating System: %s", Platform::GetOSVersionStr().c_str());
LOG(" Platform Hardware: %s", Platform::GetHardwareStr().c_str());
LOG(" Operating System: %s", Platform::GetOSDisplayStr().c_str());
LOG(" Hardware Config: %s", Platform::GetHardwareStr().c_str());
LOG(" Binary Word Size: %s", Platform::GetWordSizeStr().c_str());
LOG(" Process Clock: %s", spring_clock::GetName());
LOG(" Physical CPU Cores: %d", Threading::GetPhysicalCpuCores());
Expand Down
43 changes: 27 additions & 16 deletions rts/System/Platform/Misc.cpp
Expand Up @@ -340,28 +340,39 @@ namespace Platform



std::string GetOSVersionStr()
std::string GetOSNameStr()
{
#if defined(WIN32)
return (GetOSDisplayString());
#else
#if defined(WIN32)
// "Windows Vista"
return (windows::GetDisplayString(true, false, false));
#else
// "Linux 3.16.0-45-generic"
// "Darwin 17.7.0"
struct utsname info;
if (uname(&info) == 0)
return (std::string(info.sysname) + " " + info.release + " " + info.version + " " + info.machine);
return (std::string(info.sysname) + " " + info.release);
#endif

#if defined(__linux__)
return "Linux";
#elif defined(__FreeBSD__)
return "FreeBSD";
#elif defined(__APPLE__)
return "Mac OS X";
return {};
}

std::string GetOSVersionStr()
{
#if defined(WIN32)
// "Ultimate Edition, 32-bit Service Pack 1 (build 7601)"
return (windows::GetDisplayString(false, true, true));
#else
#warning improve this
return "unknown OS";
struct utsname info;
// "#60~14.04.1-Ubuntu SMP Fri Jul 24 21:16:23 UTC 2015 (x86_64)"
// "Darwin Kernel Version 17.7.0: Wed Sep 19 21:20:59 PDT 2018; root:xnu-4570.71.8~4/RELEASE_X86_64 (x86_64)"
if (uname(&info) == 0)
return (std::string(info.version) + " (" + info.machine + ")");

return {};
#endif
#endif
}

std::string GetOSDisplayStr() { return (GetOSNameStr() + " " + GetOSVersionStr()); }
std::string GetOSFamilyStr()
{
#if defined(WIN32)
Expand All @@ -371,7 +382,7 @@ namespace Platform
#elif defined(__FreeBSD__)
return "FreeBSD";
#elif defined(__APPLE__)
return "MacOSX";
return "MacOS";
#else
return "Unknown";
#endif
Expand All @@ -391,7 +402,7 @@ namespace Platform
}

#if (defined(WIN32))
std::string GetHardwareStr() { return (GetHardwareInfoString()); }
std::string GetHardwareStr() { return (windows::GetHardwareString()); }
#else
std::string GetHardwareStr() {
std::string ret;
Expand Down
2 changes: 2 additions & 0 deletions rts/System/Platform/Misc.h
Expand Up @@ -79,7 +79,9 @@ std::string GetModuleFile(std::string moduleName = "");
*/
std::string GetModulePath(const std::string& moduleName = "");

std::string GetOSNameStr();
std::string GetOSVersionStr();
std::string GetOSDisplayStr(); // name + version
std::string GetOSFamilyStr();
std::string GetWordSizeStr();
std::string GetPlatformStr(); // OS family + wordsize
Expand Down

0 comments on commit 4cfc937

Please sign in to comment.