summaryrefslogtreecommitdiffhomepage
path: root/Stars45
diff options
context:
space:
mode:
Diffstat (limited to 'Stars45')
-rw-r--r--Stars45/ActiveWindow.h2
-rw-r--r--Stars45/Archive.h2
-rw-r--r--Stars45/Asteroid.h2
-rw-r--r--Stars45/AudDlg.h2
-rw-r--r--Stars45/AudioConfig.h2
-rw-r--r--Stars45/AviFile.h2
-rw-r--r--Stars45/AwardDlg.h2
-rw-r--r--Stars45/AwardShowDlg.h2
-rw-r--r--Stars45/BaseScreen.h2
-rw-r--r--Stars45/Bitmap.h2
-rw-r--r--Stars45/Bmp.h2
-rw-r--r--Stars45/Bolt.h2
-rw-r--r--Stars45/Button.h2
-rw-r--r--Stars45/CMakeLists.txt54
-rw-r--r--Stars45/Callsign.h2
-rw-r--r--Stars45/Camera.h2
-rw-r--r--Stars45/CameraDirector.h2
-rw-r--r--Stars45/CameraView.h2
-rw-r--r--Stars45/Campaign.cpp26
-rw-r--r--Stars45/Campaign.h26
-rw-r--r--Stars45/CampaignMissionFighter.h2
-rw-r--r--Stars45/CampaignMissionRequest.h2
-rw-r--r--Stars45/CampaignMissionStarship.h2
-rw-r--r--Stars45/CampaignPlan.h2
-rw-r--r--Stars45/CampaignPlanAssignment.h2
-rw-r--r--Stars45/CampaignPlanEvent.h2
-rw-r--r--Stars45/CampaignPlanMission.h2
-rw-r--r--Stars45/CampaignPlanMovement.h2
-rw-r--r--Stars45/CampaignPlanStrategic.h2
-rw-r--r--Stars45/CampaignSaveGame.h2
-rw-r--r--Stars45/CampaignSituationReport.h2
-rw-r--r--Stars45/CarrierAI.h2
-rw-r--r--Stars45/CmdDlg.h2
-rw-r--r--Stars45/CmdForceDlg.h2
-rw-r--r--Stars45/CmdIntelDlg.h2
-rw-r--r--Stars45/CmdMissionsDlg.h2
-rw-r--r--Stars45/CmdMsgDlg.h2
-rw-r--r--Stars45/CmdOrdersDlg.h2
-rw-r--r--Stars45/CmdTheaterDlg.h2
-rw-r--r--Stars45/CmdTitleDlg.h2
-rw-r--r--Stars45/CmpCompleteDlg.h2
-rw-r--r--Stars45/CmpFileDlg.h2
-rw-r--r--Stars45/CmpLoadDlg.h2
-rw-r--r--Stars45/CmpSceneDlg.h2
-rw-r--r--Stars45/CmpSelectDlg.h2
-rw-r--r--Stars45/CmpnScreen.h2
-rw-r--r--Stars45/Color.h2
-rw-r--r--Stars45/CombatAction.cpp6
-rw-r--r--Stars45/CombatAction.h12
-rw-r--r--Stars45/CombatAssignment.h2
-rw-r--r--Stars45/CombatEvent.h2
-rw-r--r--Stars45/CombatGroup.h2
-rw-r--r--Stars45/CombatRoster.h2
-rw-r--r--Stars45/CombatUnit.h2
-rw-r--r--Stars45/CombatZone.h2
-rw-r--r--Stars45/Combatant.h2
-rw-r--r--Stars45/ComboBox.h2
-rw-r--r--Stars45/ComboList.cpp6
-rw-r--r--Stars45/ComboList.h2
-rw-r--r--Stars45/Component.h2
-rw-r--r--Stars45/Computer.h2
-rw-r--r--Stars45/ConfirmDlg.h2
-rw-r--r--Stars45/Contact.h2
-rw-r--r--Stars45/ContentBundle.h2
-rw-r--r--Stars45/CtlDlg.h2
-rw-r--r--Stars45/D3DXImage.h2
-rw-r--r--Stars45/DataLoader.h2
-rw-r--r--Stars45/DebriefDlg.h2
-rw-r--r--Stars45/Debris.h2
-rw-r--r--Stars45/DetailSet.h2
-rw-r--r--Stars45/Director.h2
-rw-r--r--Stars45/DisplayView.h2
-rw-r--r--Stars45/Drive.cpp6
-rw-r--r--Stars45/Drive.h2
-rw-r--r--Stars45/DriveSprite.h2
-rw-r--r--Stars45/Drone.h2
-rw-r--r--Stars45/DropShipAI.h2
-rw-r--r--Stars45/EditBox.h2
-rw-r--r--Stars45/Element.h2
-rw-r--r--Stars45/Encrypt.h2
-rw-r--r--Stars45/EngDlg.h2
-rw-r--r--Stars45/EventDispatch.h2
-rw-r--r--Stars45/EventTarget.h2
-rw-r--r--Stars45/ExceptionHandler.cpp5
-rw-r--r--Stars45/ExitDlg.h2
-rw-r--r--Stars45/Explosion.h2
-rw-r--r--Stars45/FadeView.h2
-rw-r--r--Stars45/Farcaster.h2
-rw-r--r--Stars45/FighterAI.h2
-rw-r--r--Stars45/FighterTacticalAI.h2
-rw-r--r--Stars45/FirstTimeDlg.h2
-rw-r--r--Stars45/Fix.h105
-rw-r--r--Stars45/FlightComp.h2
-rw-r--r--Stars45/FlightDeck.h2
-rw-r--r--Stars45/FlightPlanner.h2
-rw-r--r--Stars45/FltDlg.h2
-rw-r--r--Stars45/Font.h2
-rw-r--r--Stars45/FontMgr.h2
-rw-r--r--Stars45/FormDef.h2
-rw-r--r--Stars45/FormWindow.h2
-rw-r--r--Stars45/FormatUtil.h2
-rw-r--r--Stars45/Galaxy.h2
-rw-r--r--Stars45/Game.h2
-rw-r--r--Stars45/GameScreen.h2
-rw-r--r--Stars45/Geometry.h2
-rw-r--r--Stars45/Graphic.h2
-rw-r--r--Stars45/Grid.h2
-rw-r--r--Stars45/GroundAI.h2
-rw-r--r--Stars45/HUDSounds.h2
-rw-r--r--Stars45/HUDView.cpp7
-rw-r--r--Stars45/HUDView.h2
-rw-r--r--Stars45/Hangar.h2
-rw-r--r--Stars45/HardPoint.h2
-rw-r--r--Stars45/Hoop.h2
-rw-r--r--Stars45/ImageBox.h2
-rw-r--r--Stars45/ImgView.h2
-rw-r--r--Stars45/Instruction.h2
-rw-r--r--Stars45/Intel.h2
-rw-r--r--Stars45/JoyDlg.h2
-rw-r--r--Stars45/Joystick.cpp9
-rw-r--r--Stars45/Joystick.h2
-rw-r--r--Stars45/KeyDlg.h2
-rw-r--r--Stars45/KeyMap.h2
-rw-r--r--Stars45/Keyboard.h2
-rw-r--r--Stars45/LandingGear.h2
-rw-r--r--Stars45/Layout.h2
-rw-r--r--Stars45/Light.h2
-rw-r--r--Stars45/ListBox.h2
-rw-r--r--Stars45/LoadDlg.h2
-rw-r--r--Stars45/LoadScreen.h2
-rw-r--r--Stars45/Locale_ss.h2
-rw-r--r--Stars45/MCIWave.cpp4
-rw-r--r--Stars45/MachineInfo.cpp16
-rw-r--r--Stars45/MachineInfo.h2
-rw-r--r--Stars45/MapView.cpp19
-rw-r--r--Stars45/MapView.h2
-rw-r--r--Stars45/Menu.h2
-rw-r--r--Stars45/MenuDlg.h2
-rw-r--r--Stars45/MenuScreen.h2
-rw-r--r--Stars45/MenuView.h2
-rw-r--r--Stars45/Mfd.cpp3
-rw-r--r--Stars45/Mfd.h2
-rw-r--r--Stars45/Mission.h2
-rw-r--r--Stars45/MissionEvent.h2
-rw-r--r--Stars45/MissionTemplate.h2
-rw-r--r--Stars45/ModConfig.h2
-rw-r--r--Stars45/ModDlg.h2
-rw-r--r--Stars45/ModInfo.h2
-rw-r--r--Stars45/ModInfoDlg.h2
-rw-r--r--Stars45/MotionController.h2
-rw-r--r--Stars45/Mouse.h2
-rw-r--r--Stars45/MouseController.h2
-rw-r--r--Stars45/MsnDlg.h2
-rw-r--r--Stars45/MsnEditDlg.h2
-rw-r--r--Stars45/MsnEditNavDlg.h2
-rw-r--r--Stars45/MsnElemDlg.h2
-rw-r--r--Stars45/MsnEventDlg.h2
-rw-r--r--Stars45/MsnNavDlg.h2
-rw-r--r--Stars45/MsnObjDlg.h2
-rw-r--r--Stars45/MsnPkgDlg.h2
-rw-r--r--Stars45/MsnSelectDlg.h2
-rw-r--r--Stars45/MsnWepDlg.h2
-rw-r--r--Stars45/MusicDirector.h2
-rw-r--r--Stars45/MusicTrack.h2
-rw-r--r--Stars45/NavAI.h2
-rw-r--r--Stars45/NavDlg.h2
-rw-r--r--Stars45/NavLight.h2
-rw-r--r--Stars45/NavSystem.h2
-rw-r--r--Stars45/NetAddrDlg.h2
-rw-r--r--Stars45/NetAdminChat.h2
-rw-r--r--Stars45/NetAdminServer.h2
-rw-r--r--Stars45/NetAuth.h2
-rw-r--r--Stars45/NetBrokerClient.h2
-rw-r--r--Stars45/NetChat.h2
-rw-r--r--Stars45/NetClientConfig.h2
-rw-r--r--Stars45/NetClientDlg.h2
-rw-r--r--Stars45/NetData.h2
-rw-r--r--Stars45/NetFileServlet.h2
-rw-r--r--Stars45/NetGame.h2
-rw-r--r--Stars45/NetGameClient.h2
-rw-r--r--Stars45/NetGameServer.h2
-rw-r--r--Stars45/NetLobby.h2
-rw-r--r--Stars45/NetLobbyClient.h2
-rw-r--r--Stars45/NetLobbyDlg.h2
-rw-r--r--Stars45/NetLobbyServer.h2
-rw-r--r--Stars45/NetPacket.h2
-rw-r--r--Stars45/NetPassDlg.h2
-rw-r--r--Stars45/NetPlayer.cpp8
-rw-r--r--Stars45/NetPlayer.h2
-rw-r--r--Stars45/NetServerConfig.h2
-rw-r--r--Stars45/NetServerDlg.h2
-rw-r--r--Stars45/NetUnitDlg.h2
-rw-r--r--Stars45/NetUser.h2
-rw-r--r--Stars45/NetUtil.h2
-rw-r--r--Stars45/OptDlg.h2
-rw-r--r--Stars45/ParseUtil.h2
-rw-r--r--Stars45/Particles.h2
-rw-r--r--Stars45/Physical.h2
-rw-r--r--Stars45/PlanScreen.h2
-rw-r--r--Stars45/Player.h2
-rw-r--r--Stars45/PlayerDlg.h2
-rw-r--r--Stars45/PngImage.h2
-rw-r--r--Stars45/Polygon.h2
-rw-r--r--Stars45/Power.h2
-rw-r--r--Stars45/Projector.cpp8
-rw-r--r--Stars45/Projector.h2
-rw-r--r--Stars45/QuantumFlash.h2
-rw-r--r--Stars45/QuantumView.h2
-rw-r--r--Stars45/QuitView.h2
-rw-r--r--Stars45/RLoc.h2
-rw-r--r--Stars45/RadioHandler.h2
-rw-r--r--Stars45/RadioMessage.h2
-rw-r--r--Stars45/RadioTraffic.h2
-rw-r--r--Stars45/RadioView.h2
-rw-r--r--Stars45/RadioVox.h2
-rw-r--r--Stars45/Random.h2
-rw-r--r--Stars45/Res.h2
-rw-r--r--Stars45/RichTextBox.h2
-rw-r--r--Stars45/Scene.h2
-rw-r--r--Stars45/Screen.h2
-rw-r--r--Stars45/ScrollWindow.h2
-rw-r--r--Stars45/SeekerAI.h2
-rw-r--r--Stars45/Sensor.h2
-rw-r--r--Stars45/Shadow.h2
-rw-r--r--Stars45/Shield.h2
-rw-r--r--Stars45/ShieldRep.h2
-rw-r--r--Stars45/Ship.h2
-rw-r--r--Stars45/ShipAI.h2
-rw-r--r--Stars45/ShipCtrl.h2
-rw-r--r--Stars45/ShipDesign.h2
-rw-r--r--Stars45/ShipKiller.h2
-rw-r--r--Stars45/ShipSolid.h2
-rw-r--r--Stars45/Shot.h2
-rw-r--r--Stars45/Sim.h2
-rw-r--r--Stars45/SimEvent.h2
-rw-r--r--Stars45/SimObject.h2
-rw-r--r--Stars45/Skin.h2
-rw-r--r--Stars45/Sky.h2
-rw-r--r--Stars45/Slider.h2
-rw-r--r--Stars45/Solid.h2
-rw-r--r--Stars45/Sound.h2
-rw-r--r--Stars45/SoundCard.h2
-rw-r--r--Stars45/SoundD3D.h2
-rw-r--r--Stars45/Sprite.h2
-rw-r--r--Stars45/StarServer.h2
-rw-r--r--Stars45/StarSystem.cpp35
-rw-r--r--Stars45/StarSystem.h10
-rw-r--r--Stars45/Starshatter.h2
-rw-r--r--Stars45/StarshipAI.h2
-rw-r--r--Stars45/StarshipTacticalAI.cpp8
-rw-r--r--Stars45/StarshipTacticalAI.h2
-rw-r--r--Stars45/SteerAI.h2
-rw-r--r--Stars45/System.h2
-rw-r--r--Stars45/SystemDesign.h2
-rw-r--r--Stars45/TacRefDlg.h2
-rw-r--r--Stars45/TacticalAI.h2
-rw-r--r--Stars45/TacticalView.h2
-rw-r--r--Stars45/Terrain.h2
-rw-r--r--Stars45/TerrainApron.h2
-rw-r--r--Stars45/TerrainClouds.h2
-rw-r--r--Stars45/TerrainHaze.h2
-rw-r--r--Stars45/TerrainLayer.h2
-rw-r--r--Stars45/TerrainPatch.cpp3
-rw-r--r--Stars45/TerrainPatch.h2
-rw-r--r--Stars45/TerrainRegion.h2
-rw-r--r--Stars45/Thruster.h2
-rw-r--r--Stars45/TimeSnap.h50
-rw-r--r--Stars45/TrackIR.h2
-rw-r--r--Stars45/Trail.h2
-rw-r--r--Stars45/Types.h2
-rw-r--r--Stars45/Universe.h2
-rw-r--r--Stars45/VidDlg.h2
-rw-r--r--Stars45/Video.h2
-rw-r--r--Stars45/VideoDX9.h2
-rw-r--r--Stars45/VideoDX9Enum.h2
-rw-r--r--Stars45/VideoDX9VertexBuffer.h2
-rw-r--r--Stars45/VideoFactory.h2
-rw-r--r--Stars45/VideoSettings.h2
-rw-r--r--Stars45/View.h2
-rw-r--r--Stars45/Water.h2
-rw-r--r--Stars45/Wave.h2
-rw-r--r--Stars45/Weapon.h2
-rw-r--r--Stars45/WeaponDesign.h2
-rw-r--r--Stars45/WeaponGroup.h2
-rw-r--r--Stars45/Weather.h2
-rw-r--r--Stars45/WebBrowser.h2
-rw-r--r--Stars45/WepView.h2
-rw-r--r--Stars45/Window.h2
288 files changed, 439 insertions, 519 deletions
diff --git a/Stars45/ActiveWindow.h b/Stars45/ActiveWindow.h
index 2585e54..37c3d28 100644
--- a/Stars45/ActiveWindow.h
+++ b/Stars45/ActiveWindow.h
@@ -345,5 +345,5 @@ protected:
#define UNREGISTER_CLIENT(eid, ctrl, cname)\
if (ctrl) ctrl->UnregisterClient(eid, this);
-#endif ActiveWindow_h
+#endif // ActiveWindow_h
diff --git a/Stars45/Archive.h b/Stars45/Archive.h
index 5818cf6..d56ad63 100644
--- a/Stars45/Archive.h
+++ b/Stars45/Archive.h
@@ -111,4 +111,4 @@ private:
DWORD nblocks;
};
-#endif Archive_h
+#endif // Archive_h
diff --git a/Stars45/Asteroid.h b/Stars45/Asteroid.h
index 677aa8f..d79006d 100644
--- a/Stars45/Asteroid.h
+++ b/Stars45/Asteroid.h
@@ -55,5 +55,5 @@ public:
static void Close();
};
-#endif Asteroid_h
+#endif // Asteroid_h
diff --git a/Stars45/AudDlg.h b/Stars45/AudDlg.h
index 6e8628a..a360fcb 100644
--- a/Stars45/AudDlg.h
+++ b/Stars45/AudDlg.h
@@ -99,5 +99,5 @@ protected:
bool closed;
};
-#endif AudDlg_h
+#endif // AudDlg_h
diff --git a/Stars45/AudioConfig.h b/Stars45/AudioConfig.h
index a4ba339..6ceec93 100644
--- a/Stars45/AudioConfig.h
+++ b/Stars45/AudioConfig.h
@@ -91,5 +91,5 @@ protected:
bool training;
};
-#endif AudioConfig_h
+#endif // AudioConfig_h
diff --git a/Stars45/AviFile.h b/Stars45/AviFile.h
index 93de964..34de68c 100644
--- a/Stars45/AviFile.h
+++ b/Stars45/AviFile.h
@@ -84,4 +84,4 @@ private:
// +--------------------------------------------------------------------+
-#endif AviFile_h
+#endif // AviFile_h
diff --git a/Stars45/AwardDlg.h b/Stars45/AwardDlg.h
index adca746..c25b2da 100644
--- a/Stars45/AwardDlg.h
+++ b/Stars45/AwardDlg.h
@@ -79,5 +79,5 @@ protected:
bool exit_latch;
};
-#endif AwardDlg_h
+#endif // AwardDlg_h
diff --git a/Stars45/AwardShowDlg.h b/Stars45/AwardShowDlg.h
index 522fec2..ccee315 100644
--- a/Stars45/AwardShowDlg.h
+++ b/Stars45/AwardShowDlg.h
@@ -83,5 +83,5 @@ protected:
int medal;
};
-#endif AwardShowDlg_h
+#endif // AwardShowDlg_h
diff --git a/Stars45/BaseScreen.h b/Stars45/BaseScreen.h
index 0febb2a..5ca10fe 100644
--- a/Stars45/BaseScreen.h
+++ b/Stars45/BaseScreen.h
@@ -103,5 +103,5 @@ public:
// +--------------------------------------------------------------------+
-#endif BaseScreen_h
+#endif // BaseScreen_h
diff --git a/Stars45/Bitmap.h b/Stars45/Bitmap.h
index af9b6cb..654bb34 100644
--- a/Stars45/Bitmap.h
+++ b/Stars45/Bitmap.h
@@ -144,5 +144,5 @@ protected:
char filename[64];
};
-#endif Bitmap_h
+#endif // Bitmap_h
diff --git a/Stars45/Bmp.h b/Stars45/Bmp.h
index 4901d65..9f54621 100644
--- a/Stars45/Bmp.h
+++ b/Stars45/Bmp.h
@@ -97,4 +97,4 @@ struct BmpImage
// +--------------------------------------------------------------------+
-#endif BMP_H
+#endif // BMP_H
diff --git a/Stars45/Bolt.h b/Stars45/Bolt.h
index 9df4eb7..d831f36 100644
--- a/Stars45/Bolt.h
+++ b/Stars45/Bolt.h
@@ -85,5 +85,5 @@ protected:
// +--------------------------------------------------------------------+
-#endif Bolt_h
+#endif // Bolt_h
diff --git a/Stars45/Button.h b/Stars45/Button.h
index 16c71df..20e4430 100644
--- a/Stars45/Button.h
+++ b/Stars45/Button.h
@@ -141,5 +141,5 @@ protected:
Bitmap* transition_image; // state = 2 (if sticky)
};
-#endif Button_h
+#endif // Button_h
diff --git a/Stars45/CMakeLists.txt b/Stars45/CMakeLists.txt
index be5c744..65d7671 100644
--- a/Stars45/CMakeLists.txt
+++ b/Stars45/CMakeLists.txt
@@ -279,13 +279,6 @@ add_executable(
target_include_directories(
Stars45
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}
- PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../Opcode/OpcodeLib # FIXME: Opcode is badly injured.
- PUBLIC $ENV{DXSDK_DIR}/Include
- PUBLIC ${WINDOWSSDK_PATH} # FIXME: Resolve this with a Find module or even find out why is going wrong - most sources say that it should be guaranteed.
- )
-target_precompile_headers(
- Stars45
- PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../Opcode/OpcodeLib/StdAfx.h
)
target_link_libraries(
Stars45
@@ -296,19 +289,44 @@ target_link_libraries(
PUBLIC Vorbis::vorbisfile
PUBLIC Ogg::ogg
PUBLIC Png::png
- PUBLIC Opcode # FIXME: Add opcode to a namespace.
- PUBLIC ${WINDOWSSDK_LIBPATH}/Ws2_32.lib
- PUBLIC ${WINDOWSSDK_LIBPATH}/Vfw32.lib
- PUBLIC ${WINDOWSSDK_LIBPATH}/wsock32.lib
- PUBLIC ${WINDOWSSDK_LIBPATH}/winmm.lib
- PUBLIC ${WINDOWSSDK_LIBPATH}/version.lib
- PUBLIC $ENV{DXSDK_DIR}/Lib/x86/dinput8.lib
- PUBLIC $ENV{DXSDK_DIR}/Lib/x86/dsound.lib
- PUBLIC $ENV{DXSDK_DIR}/Lib/x86/d3d9.lib
- PUBLIC $ENV{DXSDK_DIR}/Lib/x86/d3dx9.lib
- PUBLIC $ENV{DXSDK_DIR}/Lib/x86/dxguid.lib
+ PUBLIC Opcode
)
target_compile_definitions(
Stars45
PRIVATE _ALLOW_KEYWORD_MACROS
)
+if(MSVC)
+ target_include_directories(
+ Stars45
+ PUBLIC $ENV{DXSDK_DIR}/Include
+ PUBLIC ${WINDOWSSDK_PATH}/um
+ PUBLIC ${WINDOWSSDK_PATH}/shared
+ )
+ target_link_libraries(
+ Stars45
+ PUBLIC ${WINDOWSSDK_LIBPATH}/um/x86/Ws2_32.lib
+ PUBLIC ${WINDOWSSDK_LIBPATH}/um/x86/Vfw32.lib
+ PUBLIC ${WINDOWSSDK_LIBPATH}/um/x86/wsock32.lib
+ PUBLIC ${WINDOWSSDK_LIBPATH}/um/x86/winmm.lib
+ PUBLIC ${WINDOWSSDK_LIBPATH}/um/x86/version.lib
+ PUBLIC $ENV{DXSDK_DIR}/Lib/x86/dinput8.lib
+ PUBLIC $ENV{DXSDK_DIR}/Lib/x86/dsound.lib
+ PUBLIC $ENV{DXSDK_DIR}/Lib/x86/d3d9.lib
+ PUBLIC $ENV{DXSDK_DIR}/Lib/x86/d3dx9.lib
+ PUBLIC $ENV{DXSDK_DIR}/Lib/x86/dxguid.lib
+ )
+else()
+ target_link_libraries(
+ Stars45
+ PUBLIC -l:libws2_32.a
+ PUBLIC -l:libvfw32.a
+ PUBLIC -l:libwsock32.a
+ PUBLIC -l:libwinmm.a
+ PUBLIC -l:libversion.a
+ PUBLIC -l:libdinput8.a
+ PUBLIC -l:libdsound.a
+ PUBLIC -l:libd3d9.a
+ PUBLIC -l:libd3dx9.a
+ PUBLIC -l:libdxguid.a
+ )
+endif()
diff --git a/Stars45/Callsign.h b/Stars45/Callsign.h
index 367b185..0c8b558 100644
--- a/Stars45/Callsign.h
+++ b/Stars45/Callsign.h
@@ -49,5 +49,5 @@ public:
static const char* GetCallsign(int IFF=1);
};
-#endif Callsign_h
+#endif // Callsign_h
diff --git a/Stars45/Camera.h b/Stars45/Camera.h
index cd3291a..947f7d6 100644
--- a/Stars45/Camera.h
+++ b/Stars45/Camera.h
@@ -81,5 +81,5 @@ protected:
Matrix orientation;
};
-#endif Camera_h
+#endif // Camera_h
diff --git a/Stars45/CameraDirector.h b/Stars45/CameraDirector.h
index ac3a378..f9678c2 100644
--- a/Stars45/CameraDirector.h
+++ b/Stars45/CameraDirector.h
@@ -176,5 +176,5 @@ protected:
static CameraDirector* instance;
};
-#endif CameraDirector_h
+#endif // CameraDirector_h
diff --git a/Stars45/CameraView.h b/Stars45/CameraView.h
index 2ab133c..20ba474 100644
--- a/Stars45/CameraView.h
+++ b/Stars45/CameraView.h
@@ -134,5 +134,5 @@ protected:
List<Graphic> graphics;
};
-#endif CameraView_h
+#endif // CameraView_h
diff --git a/Stars45/Campaign.cpp b/Stars45/Campaign.cpp
index 499e36a..1b23d14 100644
--- a/Stars45/Campaign.cpp
+++ b/Stars45/Campaign.cpp
@@ -848,7 +848,7 @@ Campaign::ParseAction(TermStruct* val, const char* filename)
int act = 0;
int stat = CombatAction::COMPLETE;
- bool not = false;
+ bool _not = false;
Combatant* c1 = 0;
Combatant* c2 = 0;
@@ -870,7 +870,7 @@ Campaign::ParseAction(TermStruct* val, const char* filename)
stat = CombatAction::StatusFromName(txt);
}
else if (pdef2->name()->value() == "not") {
- GetDefBool(not, pdef2, filename);
+ GetDefBool(_not, pdef2, filename);
}
else if (pdef2->name()->value() == "c1") {
@@ -913,7 +913,7 @@ Campaign::ParseAction(TermStruct* val, const char* filename)
}
if (act)
- action->AddRequirement(act, stat, not);
+ action->AddRequirement(act, stat, _not);
else if (gtype)
action->AddRequirement(c1, gtype, gid, comp, score, intel);
@@ -1871,7 +1871,7 @@ Campaign::SetMissionId(int id)
// +--------------------------------------------------------------------+
-double
+long double
Campaign::Stardate()
{
return StarSystem::Stardate();
@@ -2058,8 +2058,6 @@ Campaign::CheckPlayerGroup()
// +--------------------------------------------------------------------+
-void FPU2Extended();
-void FPURestore();
void
Campaign::StartMission()
@@ -2070,14 +2068,12 @@ Campaign::StartMission()
::Print("\n\nCampaign Start Mission - %d. '%s'\n", m->Identity(), m->Name());
if (!scripted) {
- FPU2Extended();
-
- double gtime = (double) Game::GameTime() / 1000.0;
- double base = startTime + m->Start() - 15 - gtime;
+ long double gtime = (long double) Game::GameTime() / 1000.0;
+ long double base = startTime + m->Start() - 15 - gtime;
StarSystem::SetBaseTime(base);
- double current_time = Stardate() - startTime;
+ long double current_time = Stardate() - startTime;
char buffer[32];
FormatDayTime(buffer, current_time);
@@ -2099,14 +2095,12 @@ Campaign::RollbackMission()
if (m) {
if (!scripted) {
- FPU2Extended();
-
- double gtime = (double) Game::GameTime() / 1000.0;
- double base = startTime + m->Start() - 60 - gtime;
+ long double gtime = (long double) Game::GameTime() / 1000.0;
+ long double base = startTime + m->Start() - 60 - gtime;
StarSystem::SetBaseTime(base);
- double current_time = Stardate() - startTime;
+ long double current_time = Stardate() - startTime;
::Print(" mission start: %d\n", m->Start());
::Print(" current time: %d\n", (int) current_time);
}
diff --git a/Stars45/Campaign.h b/Stars45/Campaign.h
index 4465186..ecfa236 100644
--- a/Stars45/Campaign.h
+++ b/Stars45/Campaign.h
@@ -213,13 +213,13 @@ public:
void SetMissionId(int id);
int GetMissionId() const { return mission_id; }
Bitmap* GetImage(int n) { return &image[n]; }
- double GetTime() const { return time; }
- double GetStartTime() const { return startTime; }
- void SetStartTime(double t) { startTime = t; }
- double GetLoadTime() const { return loadTime; }
- void SetLoadTime(double t) { loadTime = t; }
- double GetUpdateTime() const { return updateTime; }
- void SetUpdateTime(double t) { updateTime = t; }
+ long double GetTime() const { return time; }
+ long double GetStartTime() const { return startTime; }
+ void SetStartTime(long double t) { startTime = t; }
+ long double GetLoadTime() const { return loadTime; }
+ void SetLoadTime(long double t) { loadTime = t; }
+ long double GetUpdateTime() const { return updateTime; }
+ void SetUpdateTime(long double t) { updateTime = t; }
bool InCutscene() const;
bool IsDynamic() const;
@@ -246,7 +246,7 @@ public:
static Campaign* SelectCampaign(const char* name);
static Campaign* CreateCustomCampaign(const char* name, const char* path);
- static double Stardate();
+ static long double Stardate();
protected:
void LoadCampaign(DataLoader* loader, bool full=false);
@@ -295,12 +295,12 @@ protected:
Mission* mission;
Mission* net_mission;
- double time;
- double loadTime;
- double startTime;
- double updateTime;
+ long double time;
+ long double loadTime;
+ long double startTime;
+ long double updateTime;
int lockout;
};
-#endif Campaign_h
+#endif // Campaign_h
diff --git a/Stars45/CampaignMissionFighter.h b/Stars45/CampaignMissionFighter.h
index 84b1906..844d33a 100644
--- a/Stars45/CampaignMissionFighter.h
+++ b/Stars45/CampaignMissionFighter.h
@@ -141,5 +141,5 @@ protected:
int mission_type;
};
-#endif CampaignMissionFighter_h
+#endif // CampaignMissionFighter_h
diff --git a/Stars45/CampaignMissionRequest.h b/Stars45/CampaignMissionRequest.h
index a45dd45..a000428 100644
--- a/Stars45/CampaignMissionRequest.h
+++ b/Stars45/CampaignMissionRequest.h
@@ -104,5 +104,5 @@ private:
Text script;
};
-#endif CampaignMissionRequest_h
+#endif // CampaignMissionRequest_h
diff --git a/Stars45/CampaignMissionStarship.h b/Stars45/CampaignMissionStarship.h
index 8e0e329..d461378 100644
--- a/Stars45/CampaignMissionStarship.h
+++ b/Stars45/CampaignMissionStarship.h
@@ -127,5 +127,5 @@ protected:
int mission_type;
};
-#endif CampaignMissionStarship_h
+#endif // CampaignMissionStarship_h
diff --git a/Stars45/CampaignPlan.h b/Stars45/CampaignPlan.h
index 2cacb3f..6716a79 100644
--- a/Stars45/CampaignPlan.h
+++ b/Stars45/CampaignPlan.h
@@ -78,5 +78,5 @@ protected:
double exec_time;
};
-#endif CampaignPlan_h
+#endif // CampaignPlan_h
diff --git a/Stars45/CampaignPlanAssignment.h b/Stars45/CampaignPlanAssignment.h
index 2037477..fe71d77 100644
--- a/Stars45/CampaignPlanAssignment.h
+++ b/Stars45/CampaignPlanAssignment.h
@@ -70,5 +70,5 @@ protected:
virtual void BuildAssetList(const int* pref, List<CombatGroup>& avail, List<CombatGroup>& assets);
};
-#endif CampaignPlanAssignment_h
+#endif // CampaignPlanAssignment_h
diff --git a/Stars45/CampaignPlanEvent.h b/Stars45/CampaignPlanEvent.h
index ccbf7b0..2ecd874 100644
--- a/Stars45/CampaignPlanEvent.h
+++ b/Stars45/CampaignPlanEvent.h
@@ -92,5 +92,5 @@ protected:
int event_time;
};
-#endif CampaignPlanEvent_h
+#endif // CampaignPlanEvent_h
diff --git a/Stars45/CampaignPlanMission.h b/Stars45/CampaignPlanMission.h
index d61b751..2a43736 100644
--- a/Stars45/CampaignPlanMission.h
+++ b/Stars45/CampaignPlanMission.h
@@ -78,5 +78,5 @@ protected:
int slot;
};
-#endif CampaignPlanMission_h
+#endif // CampaignPlanMission_h
diff --git a/Stars45/CampaignPlanMovement.h b/Stars45/CampaignPlanMovement.h
index c2417fc..8a53b25 100644
--- a/Stars45/CampaignPlanMovement.h
+++ b/Stars45/CampaignPlanMovement.h
@@ -64,5 +64,5 @@ protected:
List<CombatUnit> all_units;
};
-#endif CampaignPlanMovement_h
+#endif // CampaignPlanMovement_h
diff --git a/Stars45/CampaignPlanStrategic.h b/Stars45/CampaignPlanStrategic.h
index c9c98d2..59e3ae7 100644
--- a/Stars45/CampaignPlanStrategic.h
+++ b/Stars45/CampaignPlanStrategic.h
@@ -79,5 +79,5 @@ protected:
void ResolveZoneMovement(CombatGroup* g);
};
-#endif CampaignPlanStrategic_h
+#endif // CampaignPlanStrategic_h
diff --git a/Stars45/CampaignSaveGame.h b/Stars45/CampaignSaveGame.h
index fe8ec3a..b53a918 100644
--- a/Stars45/CampaignSaveGame.h
+++ b/Stars45/CampaignSaveGame.h
@@ -89,5 +89,5 @@ private:
Campaign* campaign;
};
-#endif CampaignSaveGame_h
+#endif // CampaignSaveGame_h
diff --git a/Stars45/CampaignSituationReport.h b/Stars45/CampaignSituationReport.h
index a8e8658..55d3658 100644
--- a/Stars45/CampaignSituationReport.h
+++ b/Stars45/CampaignSituationReport.h
@@ -79,5 +79,5 @@ protected:
Text sitrep;
};
-#endif CampaignSituationReport_h
+#endif // CampaignSituationReport_h
diff --git a/Stars45/CarrierAI.h b/Stars45/CarrierAI.h
index 9f9bd80..6e7c1a0 100644
--- a/Stars45/CarrierAI.h
+++ b/Stars45/CarrierAI.h
@@ -84,5 +84,5 @@ protected:
// +--------------------------------------------------------------------+
-#endif CarrierAI_h
+#endif // CarrierAI_h
diff --git a/Stars45/CmdDlg.h b/Stars45/CmdDlg.h
index 5709d38..0a97663 100644
--- a/Stars45/CmdDlg.h
+++ b/Stars45/CmdDlg.h
@@ -103,5 +103,5 @@ protected:
int mode;
};
-#endif CmdDlg_h
+#endif // CmdDlg_h
diff --git a/Stars45/CmdForceDlg.h b/Stars45/CmdForceDlg.h
index ad9d57f..84613c9 100644
--- a/Stars45/CmdForceDlg.h
+++ b/Stars45/CmdForceDlg.h
@@ -89,5 +89,5 @@ protected:
CombatUnit* current_unit;
};
-#endif CmdForceDlg_h
+#endif // CmdForceDlg_h
diff --git a/Stars45/CmdIntelDlg.h b/Stars45/CmdIntelDlg.h
index f0479b2..9d66c04 100644
--- a/Stars45/CmdIntelDlg.h
+++ b/Stars45/CmdIntelDlg.h
@@ -96,5 +96,5 @@ protected:
Text event_scene;
};
-#endif CmdIntelDlg_h
+#endif // CmdIntelDlg_h
diff --git a/Stars45/CmdMissionsDlg.h b/Stars45/CmdMissionsDlg.h
index 7d449f9..99ea1ca 100644
--- a/Stars45/CmdMissionsDlg.h
+++ b/Stars45/CmdMissionsDlg.h
@@ -85,5 +85,5 @@ protected:
Mission* mission;
};
-#endif CmdMissionsDlg_h
+#endif // CmdMissionsDlg_h
diff --git a/Stars45/CmdMsgDlg.h b/Stars45/CmdMsgDlg.h
index 89c1ab2..9f7592f 100644
--- a/Stars45/CmdMsgDlg.h
+++ b/Stars45/CmdMsgDlg.h
@@ -74,5 +74,5 @@ protected:
bool exit_latch;
};
-#endif CmdMsgDlg_h
+#endif // CmdMsgDlg_h
diff --git a/Stars45/CmdOrdersDlg.h b/Stars45/CmdOrdersDlg.h
index 3aafb98..652dcf8 100644
--- a/Stars45/CmdOrdersDlg.h
+++ b/Stars45/CmdOrdersDlg.h
@@ -76,5 +76,5 @@ protected:
Campaign* campaign;
};
-#endif CmdOrdersDlg_h
+#endif // CmdOrdersDlg_h
diff --git a/Stars45/CmdTheaterDlg.h b/Stars45/CmdTheaterDlg.h
index 7cd8ff3..d42c7e3 100644
--- a/Stars45/CmdTheaterDlg.h
+++ b/Stars45/CmdTheaterDlg.h
@@ -82,5 +82,5 @@ protected:
Campaign* campaign;
};
-#endif CmdTheaterDlg_h
+#endif // CmdTheaterDlg_h
diff --git a/Stars45/CmdTitleDlg.h b/Stars45/CmdTitleDlg.h
index e092a9d..216ebfc 100644
--- a/Stars45/CmdTitleDlg.h
+++ b/Stars45/CmdTitleDlg.h
@@ -76,5 +76,5 @@ protected:
double showTime;
};
-#endif CmdTitleDlg_h
+#endif // CmdTitleDlg_h
diff --git a/Stars45/CmpCompleteDlg.h b/Stars45/CmpCompleteDlg.h
index 5716714..c6b36ef 100644
--- a/Stars45/CmpCompleteDlg.h
+++ b/Stars45/CmpCompleteDlg.h
@@ -70,5 +70,5 @@ protected:
CmpnScreen* manager;
};
-#endif CmpCompleteDlg_h
+#endif // CmpCompleteDlg_h
diff --git a/Stars45/CmpFileDlg.h b/Stars45/CmpFileDlg.h
index 1d21f7a..7e591b2 100644
--- a/Stars45/CmpFileDlg.h
+++ b/Stars45/CmpFileDlg.h
@@ -84,5 +84,5 @@ protected:
bool exit_latch;
};
-#endif CmpFileDlg_h
+#endif // CmpFileDlg_h
diff --git a/Stars45/CmpLoadDlg.h b/Stars45/CmpLoadDlg.h
index 876f13c..3a210ce 100644
--- a/Stars45/CmpLoadDlg.h
+++ b/Stars45/CmpLoadDlg.h
@@ -66,5 +66,5 @@ protected:
DWORD show_time;
};
-#endif CmpLoadDlg_h
+#endif // CmpLoadDlg_h
diff --git a/Stars45/CmpSceneDlg.h b/Stars45/CmpSceneDlg.h
index f06d7d8..19fda11 100644
--- a/Stars45/CmpSceneDlg.h
+++ b/Stars45/CmpSceneDlg.h
@@ -88,5 +88,5 @@ protected:
double subtitles_time;
};
-#endif CmpSceneDlg_h
+#endif // CmpSceneDlg_h
diff --git a/Stars45/CmpSelectDlg.h b/Stars45/CmpSelectDlg.h
index 10274a7..b227eef 100644
--- a/Stars45/CmpSelectDlg.h
+++ b/Stars45/CmpSelectDlg.h
@@ -111,5 +111,5 @@ protected:
Text select_msg;
};
-#endif CmpSelectDlg_h
+#endif // CmpSelectDlg_h
diff --git a/Stars45/CmpnScreen.h b/Stars45/CmpnScreen.h
index 3d557d6..6c589f6 100644
--- a/Stars45/CmpnScreen.h
+++ b/Stars45/CmpnScreen.h
@@ -157,5 +157,5 @@ private:
// +--------------------------------------------------------------------+
-#endif CmpnScreen_h
+#endif // CmpnScreen_h
diff --git a/Stars45/Color.h b/Stars45/Color.h
index 9bca5c9..7788875 100644
--- a/Stars45/Color.h
+++ b/Stars45/Color.h
@@ -315,5 +315,5 @@ private:
inline BYTE Color::IndexedBlend(BYTE dst) const { return ColorIndex::blend_table[dst*256+Index()]; }
-#endif Color_h
+#endif // Color_h
diff --git a/Stars45/CombatAction.cpp b/Stars45/CombatAction.cpp
index 15d17a6..ed2fba7 100644
--- a/Stars45/CombatAction.cpp
+++ b/Stars45/CombatAction.cpp
@@ -108,7 +108,7 @@ CombatAction::IsAvailable() const
CombatAction* a = action.value();
if (a->Identity() == r->action) {
- if (r->not) {
+ if (r->_not) {
if (a->Status() == r->stat)
return false;
}
@@ -230,9 +230,9 @@ CombatAction::FailAction()
// +----------------------------------------------------------------------+
void
-CombatAction::AddRequirement(int action, int stat, bool not)
+CombatAction::AddRequirement(int action, int stat, bool _not)
{
- requirements.append(new(__FILE__,__LINE__) CombatActionReq(action, stat, not));
+ requirements.append(new(__FILE__,__LINE__) CombatActionReq(action, stat, _not));
}
void
diff --git a/Stars45/CombatAction.h b/Stars45/CombatAction.h
index c247d06..a2af69d 100644
--- a/Stars45/CombatAction.h
+++ b/Stars45/CombatAction.h
@@ -87,7 +87,7 @@ public:
bool IsAvailable() const;
void FireAction();
void FailAction();
- void AddRequirement(int action, int stat, bool not = false);
+ void AddRequirement(int action, int stat, bool _not = false);
void AddRequirement(Combatant* c1, Combatant* c2, int comp, int score);
void AddRequirement(Combatant* c1, int group_type, int group_id, int comp, int score, int intel=0);
static int TypeFromName(const char* n);
@@ -200,21 +200,21 @@ public:
};
CombatActionReq(int a, int s, bool n = false)
- : action(a), stat(s), not(n), c1(0), c2(0), comp(0), score(0), intel(0) { }
+ : action(a), stat(s), _not(n), c1(0), c2(0), comp(0), score(0), intel(0) { }
CombatActionReq(Combatant* a1, Combatant* a2, int comparison, int value)
- : action(0), stat(0), not(0), c1(a1), c2(a2), group_type(0), group_id(0),
+ : action(0), stat(0), _not(0), c1(a1), c2(a2), group_type(0), group_id(0),
comp(comparison), score(value), intel(0) { }
CombatActionReq(Combatant* a1, int gtype, int gid, int comparison, int value, int intel_level=0)
- : action(0), stat(0), not(0), c1(a1), c2(0), group_type(gtype), group_id(gid),
+ : action(0), stat(0), _not(0), c1(a1), c2(0), group_type(gtype), group_id(gid),
comp(comparison), score(value), intel(intel_level) { }
static int CompFromName(const char* sym);
int action;
int stat;
- bool not;
+ bool _not;
Combatant* c1;
Combatant* c2;
@@ -225,5 +225,5 @@ public:
int group_id;
};
-#endif CombatAction_h
+#endif // CombatAction_h
diff --git a/Stars45/CombatAssignment.h b/Stars45/CombatAssignment.h
index 549a483..a366af4 100644
--- a/Stars45/CombatAssignment.h
+++ b/Stars45/CombatAssignment.h
@@ -78,4 +78,4 @@ private:
};
-#endif CombatAssignment_h
+#endif // CombatAssignment_h
diff --git a/Stars45/CombatEvent.h b/Stars45/CombatEvent.h
index 63eab6f..bbfec99 100644
--- a/Stars45/CombatEvent.h
+++ b/Stars45/CombatEvent.h
@@ -142,5 +142,5 @@ private:
Bitmap image;
};
-#endif CombatEvent_h
+#endif // CombatEvent_h
diff --git a/Stars45/CombatGroup.h b/Stars45/CombatGroup.h
index ac6fcb1..7a49c1d 100644
--- a/Stars45/CombatGroup.h
+++ b/Stars45/CombatGroup.h
@@ -251,5 +251,5 @@ private:
Text strategic_direction;
};
-#endif CombatGroup_h
+#endif // CombatGroup_h
diff --git a/Stars45/CombatRoster.h b/Stars45/CombatRoster.h
index a7789ff..068ec69 100644
--- a/Stars45/CombatRoster.h
+++ b/Stars45/CombatRoster.h
@@ -69,4 +69,4 @@ private:
};
-#endif CombatRoster_h
+#endif // CombatRoster_h
diff --git a/Stars45/CombatUnit.h b/Stars45/CombatUnit.h
index b80f8dc..6f98227 100644
--- a/Stars45/CombatUnit.h
+++ b/Stars45/CombatUnit.h
@@ -153,5 +153,5 @@ private:
CombatGroup* group;
};
-#endif CombatUnit_h
+#endif // CombatUnit_h
diff --git a/Stars45/CombatZone.h b/Stars45/CombatZone.h
index 360a992..b53c844 100644
--- a/Stars45/CombatZone.h
+++ b/Stars45/CombatZone.h
@@ -123,5 +123,5 @@ private:
// +--------------------------------------------------------------------+
-#endif CombatZone_h
+#endif // CombatZone_h
diff --git a/Stars45/Combatant.h b/Stars45/Combatant.h
index 0a73ae6..e3a79be 100644
--- a/Stars45/Combatant.h
+++ b/Stars45/Combatant.h
@@ -94,4 +94,4 @@ private:
};
-#endif Combatant_h
+#endif // Combatant_h
diff --git a/Stars45/ComboBox.h b/Stars45/ComboBox.h
index 4d50c73..145a156 100644
--- a/Stars45/ComboBox.h
+++ b/Stars45/ComboBox.h
@@ -125,5 +125,5 @@ protected:
Color border_color;
};
-#endif ComboBox_h
+#endif // ComboBox_h
diff --git a/Stars45/ComboList.cpp b/Stars45/ComboList.cpp
index 4bf35cc..d070b9f 100644
--- a/Stars45/ComboList.cpp
+++ b/Stars45/ComboList.cpp
@@ -36,6 +36,10 @@
Drop-down list of Buttons class
*/
+#define NOMINMAX
+
+#include <algorithm>
+
#include "MemDebug.h"
#include "ComboList.h"
#include "ComboBox.h"
@@ -168,7 +172,7 @@ ComboList::Draw()
// opening:
if (scrolling > 0) {
- int limit = min(items.size(), max_entries);
+ int limit = std::min(items.size(), max_entries);
if (scroll < limit) {
if (limit > 6)
diff --git a/Stars45/ComboList.h b/Stars45/ComboList.h
index aea08fc..4d01f15 100644
--- a/Stars45/ComboList.h
+++ b/Stars45/ComboList.h
@@ -112,5 +112,5 @@ protected:
Color border_color;
};
-#endif ComboList_h
+#endif // ComboList_h
diff --git a/Stars45/Component.h b/Stars45/Component.h
index 3c53093..cff50e8 100644
--- a/Stars45/Component.h
+++ b/Stars45/Component.h
@@ -120,5 +120,5 @@ protected:
System* system;
};
-#endif Component_h
+#endif // Component_h
diff --git a/Stars45/Computer.h b/Stars45/Computer.h
index 1eb2f01..a4e23d7 100644
--- a/Stars45/Computer.h
+++ b/Stars45/Computer.h
@@ -61,5 +61,5 @@ public:
protected:
};
-#endif Computer_h
+#endif // Computer_h
diff --git a/Stars45/ConfirmDlg.h b/Stars45/ConfirmDlg.h
index 2b1db43..2edfd53 100644
--- a/Stars45/ConfirmDlg.h
+++ b/Stars45/ConfirmDlg.h
@@ -84,5 +84,5 @@ protected:
ActiveWindow* parent_control;
};
-#endif ConfirmDlg_h
+#endif // ConfirmDlg_h
diff --git a/Stars45/Contact.h b/Stars45/Contact.h
index f4e4000..aed6354 100644
--- a/Stars45/Contact.h
+++ b/Stars45/Contact.h
@@ -111,5 +111,5 @@ private:
bool probe; // scanned by probe
};
-#endif Contact_h
+#endif // Contact_h
diff --git a/Stars45/ContentBundle.h b/Stars45/ContentBundle.h
index d75a817..e7207cf 100644
--- a/Stars45/ContentBundle.h
+++ b/Stars45/ContentBundle.h
@@ -68,5 +68,5 @@ protected:
Dictionary<Text> values;
};
-#endif ContentBundle_h
+#endif // ContentBundle_h
diff --git a/Stars45/CtlDlg.h b/Stars45/CtlDlg.h
index 95ab595..b970c53 100644
--- a/Stars45/CtlDlg.h
+++ b/Stars45/CtlDlg.h
@@ -139,5 +139,5 @@ protected:
bool closed;
};
-#endif CtlDlg_h
+#endif // CtlDlg_h
diff --git a/Stars45/D3DXImage.h b/Stars45/D3DXImage.h
index b6f689d..dbba149 100644
--- a/Stars45/D3DXImage.h
+++ b/Stars45/D3DXImage.h
@@ -64,4 +64,4 @@ struct D3DXImage
// +--------------------------------------------------------------------+
-#endif D3DXImage_h
+#endif // D3DXImage_h
diff --git a/Stars45/DataLoader.h b/Stars45/DataLoader.h
index ca7b050..d6f2845 100644
--- a/Stars45/DataLoader.h
+++ b/Stars45/DataLoader.h
@@ -106,5 +106,5 @@ private:
// +--------------------------------------------------------------------+
-#endif DataLoader_h
+#endif // DataLoader_h
diff --git a/Stars45/DebriefDlg.h b/Stars45/DebriefDlg.h
index 77923e9..f6a4338 100644
--- a/Stars45/DebriefDlg.h
+++ b/Stars45/DebriefDlg.h
@@ -101,5 +101,5 @@ protected:
Ship* ship;
};
-#endif DebriefDlg_h
+#endif // DebriefDlg_h
diff --git a/Stars45/Debris.h b/Stars45/Debris.h
index adf4810..6dc6016 100644
--- a/Stars45/Debris.h
+++ b/Stars45/Debris.h
@@ -63,5 +63,5 @@ public:
virtual double AltitudeAGL() const;
};
-#endif Debris_h
+#endif // Debris_h
diff --git a/Stars45/DetailSet.h b/Stars45/DetailSet.h
index 7e8c21b..3648e7f 100644
--- a/Stars45/DetailSet.h
+++ b/Stars45/DetailSet.h
@@ -93,5 +93,5 @@ protected:
// +--------------------------------------------------------------------+
-#endif DetailSet_h
+#endif // DetailSet_h
diff --git a/Stars45/Director.h b/Stars45/Director.h
index 94f635f..d34805d 100644
--- a/Stars45/Director.h
+++ b/Stars45/Director.h
@@ -64,5 +64,5 @@ public:
// +--------------------------------------------------------------------+
-#endif Director_h
+#endif // Director_h
diff --git a/Stars45/DisplayView.h b/Stars45/DisplayView.h
index 08c31b8..3fec85e 100644
--- a/Stars45/DisplayView.h
+++ b/Stars45/DisplayView.h
@@ -91,5 +91,5 @@ protected:
elements;
};
-#endif DisplayView_h
+#endif // DisplayView_h
diff --git a/Stars45/Drive.cpp b/Stars45/Drive.cpp
index 8cf6dd0..570721d 100644
--- a/Stars45/Drive.cpp
+++ b/Stars45/Drive.cpp
@@ -36,6 +36,10 @@
Weapon class
*/
+#define NOMINMAX
+
+#include <algorithm>
+
#include "MemDebug.h"
#include "Drive.h"
#include "Power.h"
@@ -355,7 +359,7 @@ Drive::GetRequest(double seconds) const
{
if (!power_on) return 0;
- double t_factor = max(throttle + 0.5 * augmenter_throttle, 0.3);
+ double t_factor = std::max(throttle + 0.5 * augmenter_throttle, 0.3);
return t_factor * power_level * sink_rate * seconds;
}
diff --git a/Stars45/Drive.h b/Stars45/Drive.h
index 9a99539..5c858cc 100644
--- a/Stars45/Drive.h
+++ b/Stars45/Drive.h
@@ -113,5 +113,5 @@ protected:
bool show_trail;
};
-#endif Drive_h
+#endif // Drive_h
diff --git a/Stars45/DriveSprite.h b/Stars45/DriveSprite.h
index a07a726..99b774c 100644
--- a/Stars45/DriveSprite.h
+++ b/Stars45/DriveSprite.h
@@ -67,5 +67,5 @@ protected:
// +--------------------------------------------------------------------+
-#endif DriveSprite_h
+#endif // DriveSprite_h
diff --git a/Stars45/Drone.h b/Stars45/Drone.h
index c4e1126..e4b4893 100644
--- a/Stars45/Drone.h
+++ b/Stars45/Drone.h
@@ -89,5 +89,5 @@ protected:
int probe;
};
-#endif Drone_h
+#endif // Drone_h
diff --git a/Stars45/DropShipAI.h b/Stars45/DropShipAI.h
index 13ba5c9..52d480f 100644
--- a/Stars45/DropShipAI.h
+++ b/Stars45/DropShipAI.h
@@ -67,5 +67,5 @@ protected:
// +--------------------------------------------------------------------+
-#endif DropShipAI_h
+#endif // DropShipAI_h
diff --git a/Stars45/EditBox.h b/Stars45/EditBox.h
index ac3186b..add604e 100644
--- a/Stars45/EditBox.h
+++ b/Stars45/EditBox.h
@@ -112,5 +112,5 @@ protected:
Color selected_color;
};
-#endif EditBox_h
+#endif // EditBox_h
diff --git a/Stars45/Element.h b/Stars45/Element.h
index 2207d8a..cc2cc00 100644
--- a/Stars45/Element.h
+++ b/Stars45/Element.h
@@ -192,5 +192,5 @@ protected:
int load[16];
};
-#endif Element_h
+#endif // Element_h
diff --git a/Stars45/Encrypt.h b/Stars45/Encrypt.h
index 16cf400..d4336bf 100644
--- a/Stars45/Encrypt.h
+++ b/Stars45/Encrypt.h
@@ -59,4 +59,4 @@ public:
static Text Decode(Text block);
};
-#endif Encrypt_h \ No newline at end of file
+#endif // Encrypt_h \ No newline at end of file
diff --git a/Stars45/EngDlg.h b/Stars45/EngDlg.h
index cf6d8ed..d191ca1 100644
--- a/Stars45/EngDlg.h
+++ b/Stars45/EngDlg.h
@@ -126,5 +126,5 @@ protected:
Component* selected_component;
};
-#endif EngDlg_h
+#endif // EngDlg_h
diff --git a/Stars45/EventDispatch.h b/Stars45/EventDispatch.h
index 08240d0..460c8d5 100644
--- a/Stars45/EventDispatch.h
+++ b/Stars45/EventDispatch.h
@@ -82,5 +82,5 @@ protected:
static EventDispatch* dispatcher;
};
-#endif EventDispatch_h
+#endif // EventDispatch_h
diff --git a/Stars45/EventTarget.h b/Stars45/EventTarget.h
index fe8d8ed..909d5da 100644
--- a/Stars45/EventTarget.h
+++ b/Stars45/EventTarget.h
@@ -79,5 +79,5 @@ public:
virtual const char* GetDescription() const { return "EventTarget"; }
};
-#endif EventTarget_h
+#endif // EventTarget_h
diff --git a/Stars45/ExceptionHandler.cpp b/Stars45/ExceptionHandler.cpp
index 17519be..6233b7a 100644
--- a/Stars45/ExceptionHandler.cpp
+++ b/Stars45/ExceptionHandler.cpp
@@ -32,6 +32,9 @@
*/
+#define NOMINMAX
+
+#include <algorithm>
#include <windows.h>
#include <imagehlp.h>
@@ -265,7 +268,7 @@ ExceptionHandler::GetLogicalAddress(void* addr, char* mod_name, int len, DWORD&
for (unsigned i = 0; i < pNtHdr->FileHeader.NumberOfSections; i++, pSection++ ) {
DWORD sectionStart = pSection->VirtualAddress;
DWORD sectionEnd = sectionStart
- + max(pSection->SizeOfRawData, pSection->Misc.VirtualSize);
+ + std::max(pSection->SizeOfRawData, pSection->Misc.VirtualSize);
// Is the address in this section???
if ((rva >= sectionStart) && (rva <= sectionEnd)) {
diff --git a/Stars45/ExitDlg.h b/Stars45/ExitDlg.h
index b780d95..c6e9ab0 100644
--- a/Stars45/ExitDlg.h
+++ b/Stars45/ExitDlg.h
@@ -80,5 +80,5 @@ protected:
bool exit_latch;
};
-#endif ExitDlg_h
+#endif // ExitDlg_h
diff --git a/Stars45/Explosion.h b/Stars45/Explosion.h
index 4507f4f..f277131 100644
--- a/Stars45/Explosion.h
+++ b/Stars45/Explosion.h
@@ -104,5 +104,5 @@ protected:
Point mount_rel;
};
-#endif Explosion_h
+#endif // Explosion_h
diff --git a/Stars45/FadeView.h b/Stars45/FadeView.h
index 3b49c70..beddff8 100644
--- a/Stars45/FadeView.h
+++ b/Stars45/FadeView.h
@@ -76,5 +76,5 @@ protected:
FadeState state;
};
-#endif FadeView_h
+#endif // FadeView_h
diff --git a/Stars45/Farcaster.h b/Stars45/Farcaster.h
index cd4bcbf..05324f5 100644
--- a/Stars45/Farcaster.h
+++ b/Stars45/Farcaster.h
@@ -112,5 +112,5 @@ protected:
// +----------------------------------------------------------------------+
-#endif Farcaster_h
+#endif // Farcaster_h
diff --git a/Stars45/FighterAI.h b/Stars45/FighterAI.h
index 4ac5c1c..9c7a92e 100644
--- a/Stars45/FighterAI.h
+++ b/Stars45/FighterAI.h
@@ -105,5 +105,5 @@ protected:
// +--------------------------------------------------------------------+
-#endif FighterAI_h
+#endif // FighterAI_h
diff --git a/Stars45/FighterTacticalAI.h b/Stars45/FighterTacticalAI.h
index ff6169f..244e269 100644
--- a/Stars45/FighterTacticalAI.h
+++ b/Stars45/FighterTacticalAI.h
@@ -76,5 +76,5 @@ protected:
// +--------------------------------------------------------------------+
-#endif FighterTacticalAI_h
+#endif // FighterTacticalAI_h
diff --git a/Stars45/FirstTimeDlg.h b/Stars45/FirstTimeDlg.h
index 4d0fafa..b6c46de 100644
--- a/Stars45/FirstTimeDlg.h
+++ b/Stars45/FirstTimeDlg.h
@@ -76,5 +76,5 @@ protected:
Button* btn_apply;
};
-#endif FirstTimeDlg_h
+#endif // FirstTimeDlg_h
diff --git a/Stars45/Fix.h b/Stars45/Fix.h
index d3aade0..c3aa661 100644
--- a/Stars45/Fix.h
+++ b/Stars45/Fix.h
@@ -49,14 +49,7 @@ const double fix_sixty_five=65536.0;
inline int fast_f2i(double d)
{
- int i;
-
- _asm {
- fld d
- fistp i
- }
-
- return i;
+ return static_cast<int>(d);
}
// +--------------------------------------------------------------------+
@@ -73,18 +66,9 @@ public:
static const fix five;
static const fix ten;
- fix() { }
- fix(int n) : val(n<<Precision) { }
- fix(double d)
- {
- long ival;
- _asm {
- fld fix_sixty_five
- fmul d
- fistp ival
- }
- val=ival;
- }
+ fix() : val(0) { }
+ fix(int n) : val(n<<Precision) { }
+ fix(double d) : val(static_cast<long>(d * fix_sixty_five)) { }
fix(const fix& f) : val(f.val) { }
// conversion operators:
@@ -95,12 +79,7 @@ public:
// assignment operators:
fix& operator=(const fix& f) { val=f.val; return *this; }
fix& operator=(int n) { val=(n<<Precision); return *this; }
- fix& operator=(double d) { long ival;
- _asm { fld fix_sixty_five
- fmul d
- fistp ival }
- val = ival;
- return *this; }
+ fix& operator=(double d) { val = static_cast<long>(d * fix_sixty_five); return *this; }
// comparison operators:
int operator==(const fix& f) const { return val==f.val; }
@@ -113,48 +92,22 @@ public:
// arithmetic operators:
fix operator+(const fix& f) const { fix r; r.val = val+f.val; return r; }
fix operator-(const fix& f) const { fix r; r.val = val-f.val; return r; }
- fix operator*(const fix& f) const { long a=val; long b=f.val;
- _asm {
- mov eax, a
- mov edx, b
- imul edx
- shrd eax, edx, 16
- mov a, eax
- }
- fix r; r.val = a; return r; }
- fix operator/(const fix& f) const { long a=val; long b=f.val;
- _asm {
- mov eax, a
- mov ebx, b
- mov edx, eax
- sar edx, 16
- shl eax, 16
- idiv ebx
- mov a, eax
- }
- fix r; r.val = a; return r; }
+ fix operator*(const fix& f) const {
+ fix r;
+ r.val = (val * f.val) >> Precision;
+ return r; }
+ fix operator/(const fix& f) const {
+ fix r;
+ r.val = (val << Precision) / f.val;
+ return r; }
fix& operator+=(const fix& f) { val+=f.val; return *this; }
fix& operator-=(const fix& f) { val-=f.val; return *this; }
- fix& operator*=(const fix& f) { long a=val; long b=f.val;
- _asm {
- mov eax, a
- mov edx, b
- imul edx
- shrd eax, edx, 16
- mov a, eax
- }
- val=a; return *this; }
- fix& operator/=(const fix& f) { long a=val; long b=f.val;
- _asm {
- mov eax, a
- mov ebx, b
- mov edx, eax
- sar edx, 16
- shl eax, 16
- idiv ebx
- mov a, eax
- }
- val=a; return *this; }
+ fix& operator*=(const fix& f) {
+ val = (val * f.val) >> Precision;
+ return *this; }
+ fix& operator/=(const fix& f) {
+ val = (val << Precision) / f.val;
+ return *this; }
fix operator+(int n) const { fix r; r.val = val+(n<<Precision); return r; }
fix operator-(int n) const { fix r; r.val = val-(n<<Precision); return r; }
@@ -171,10 +124,8 @@ public:
fix operator/(double d) const { fix f(d); return (*this)/f; }
fix& operator+=(double d) { fix f(d); val+=f.val; return *this; }
fix& operator-=(double d) { fix f(d); val-=f.val; return *this; }
- fix& operator*=(double d) { int n; _asm { fld d
- fistp n } val*=n; return *this; }
- fix& operator/=(double d) { int n; _asm { fld d
- fistp n } val/=n; return *this; }
+ fix& operator*=(double d) { val*=static_cast<long>(d); return *this; }
+ fix& operator/=(double d) { val/=static_cast<long>(d); return *this; }
// misc. functions:
fix truncate() const { fix r; r.val = val&IntMask; return r; }
@@ -184,21 +135,11 @@ public:
fix adjust_up() const { fix r; r.val = val+FractMask; return r; }
fix adjust_down() const { fix r; r.val = val-FractMask; return r; }
- fix muldiv(const fix& num, const fix& den) const
- { long a=val, b=num.val, c=den.val;
- _asm {
- mov eax, a
- mov edx, b
- mov ebx, c
- imul edx
- idiv ebx
- mov a, eax
- }
- fix r; r.val = a; return r; }
+ fix muldiv(const fix& num, const fix& den) const { return (*this) * num / den; }
// data:
long val;
};
-#endif Fix_h
+#endif // Fix_h
diff --git a/Stars45/FlightComp.h b/Stars45/FlightComp.h
index 4b6b7a1..4bad97c 100644
--- a/Stars45/FlightComp.h
+++ b/Stars45/FlightComp.h
@@ -83,5 +83,5 @@ protected:
float trans_z_limit;
};
-#endif FLIGHT_COMP_H
+#endif // FLIGHT_COMP_H
diff --git a/Stars45/FlightDeck.h b/Stars45/FlightDeck.h
index 334ff21..f8ead9e 100644
--- a/Stars45/FlightDeck.h
+++ b/Stars45/FlightDeck.h
@@ -215,5 +215,5 @@ protected:
// +----------------------------------------------------------------------+
-#endif FlightDeck_h
+#endif // FlightDeck_h
diff --git a/Stars45/FlightPlanner.h b/Stars45/FlightPlanner.h
index 13bceb9..45b9589 100644
--- a/Stars45/FlightPlanner.h
+++ b/Stars45/FlightPlanner.h
@@ -71,5 +71,5 @@ public:
// +--------------------------------------------------------------------+
-#endif FlightPlanner_h
+#endif // FlightPlanner_h
diff --git a/Stars45/FltDlg.h b/Stars45/FltDlg.h
index 5503fca..14f634a 100644
--- a/Stars45/FltDlg.h
+++ b/Stars45/FltDlg.h
@@ -101,5 +101,5 @@ protected:
int patrol_pattern;
};
-#endif FltDlg_h
+#endif // FltDlg_h
diff --git a/Stars45/Font.h b/Stars45/Font.h
index 5944f30..e8005a6 100644
--- a/Stars45/Font.h
+++ b/Stars45/Font.h
@@ -163,5 +163,5 @@ private:
char kern[256][256];
};
-#endif Font_h
+#endif // Font_h
diff --git a/Stars45/FontMgr.h b/Stars45/FontMgr.h
index e143a2b..f42db12 100644
--- a/Stars45/FontMgr.h
+++ b/Stars45/FontMgr.h
@@ -70,5 +70,5 @@ private:
static List<FontItem> fonts;
};
-#endif FontMgr_h
+#endif // FontMgr_h
diff --git a/Stars45/FormDef.h b/Stars45/FormDef.h
index 0c86743..702a1f9 100644
--- a/Stars45/FormDef.h
+++ b/Stars45/FormDef.h
@@ -352,5 +352,5 @@ protected:
// +--------------------------------------------------------------------+
-#endif FormDef_h
+#endif // FormDef_h
diff --git a/Stars45/FormWindow.h b/Stars45/FormWindow.h
index fb6576d..f935822 100644
--- a/Stars45/FormWindow.h
+++ b/Stars45/FormWindow.h
@@ -97,5 +97,5 @@ protected:
virtual void CreateDefRichText(CtrlDef& def);
};
-#endif FormWindow_h
+#endif // FormWindow_h
diff --git a/Stars45/FormatUtil.h b/Stars45/FormatUtil.h
index f652660..0c717fa 100644
--- a/Stars45/FormatUtil.h
+++ b/Stars45/FormatUtil.h
@@ -67,5 +67,5 @@ Text FormatTextEscape(const char* msg);
// +--------------------------------------------------------------------+
-#endif FormatUtil_h
+#endif // FormatUtil_h
diff --git a/Stars45/Galaxy.h b/Stars45/Galaxy.h
index f8f842c..b3b7594 100644
--- a/Stars45/Galaxy.h
+++ b/Stars45/Galaxy.h
@@ -94,5 +94,5 @@ protected:
List<Star> stars;
};
-#endif Galaxy_h
+#endif // Galaxy_h
diff --git a/Stars45/Game.h b/Stars45/Game.h
index c94a273..378fdc6 100644
--- a/Stars45/Game.h
+++ b/Stars45/Game.h
@@ -240,6 +240,6 @@ protected:
// +--------------------------------------------------------------------+
-#endif Game_h
+#endif // Game_h
diff --git a/Stars45/GameScreen.h b/Stars45/GameScreen.h
index a9411ab..2a618e8 100644
--- a/Stars45/GameScreen.h
+++ b/Stars45/GameScreen.h
@@ -212,5 +212,5 @@ private:
// +--------------------------------------------------------------------+
-#endif GameScreen_h
+#endif // GameScreen_h
diff --git a/Stars45/Geometry.h b/Stars45/Geometry.h
index f6b34cf..f8ddcdf 100644
--- a/Stars45/Geometry.h
+++ b/Stars45/Geometry.h
@@ -324,5 +324,5 @@ int lines_intersect(
// +--------------------------------------------------------------------+
-#endif Geometry_h
+#endif // Geometry_h
diff --git a/Stars45/Graphic.h b/Stars45/Graphic.h
index 1417f48..b0e74e9 100644
--- a/Stars45/Graphic.h
+++ b/Stars45/Graphic.h
@@ -159,5 +159,5 @@ protected:
// +--------------------------------------------------------------------+
-#endif Graphic_h
+#endif // Graphic_h
diff --git a/Stars45/Grid.h b/Stars45/Grid.h
index 71e09f0..b56dad2 100644
--- a/Stars45/Grid.h
+++ b/Stars45/Grid.h
@@ -70,5 +70,5 @@ protected:
// +--------------------------------------------------------------------+
-#endif Grid_h
+#endif // Grid_h
diff --git a/Stars45/GroundAI.h b/Stars45/GroundAI.h
index 8e097f2..bad2143 100644
--- a/Stars45/GroundAI.h
+++ b/Stars45/GroundAI.h
@@ -81,5 +81,5 @@ protected:
// +--------------------------------------------------------------------+
-#endif GroundAI_h
+#endif // GroundAI_h
diff --git a/Stars45/HUDSounds.h b/Stars45/HUDSounds.h
index bc970d4..df2a866 100644
--- a/Stars45/HUDSounds.h
+++ b/Stars45/HUDSounds.h
@@ -66,5 +66,5 @@ public:
static void StopSound(int n);
};
-#endif HUDSounds_h
+#endif // HUDSounds_h
diff --git a/Stars45/HUDView.cpp b/Stars45/HUDView.cpp
index 392ba3e..4521c06 100644
--- a/Stars45/HUDView.cpp
+++ b/Stars45/HUDView.cpp
@@ -201,7 +201,7 @@ static int tgt_status = System::NOMINAL;
// +--------------------------------------------------------------------+
-static enum TXT {
+enum TXT {
MAX_CONTACT = 50,
TXT_CAUTION_TXT = 0,
@@ -1361,7 +1361,10 @@ HUDView::DrawBars()
int align = DT_LEFT;
if (Game::Paused())
- DrawHUDText(TXT_PAUSED, Game::GetText("HUDView.PAUSED"), Rect(cx-128, cy-60, 256, 12), DT_CENTER);
+ {
+ Rect pause_rect = Rect(cx - 128, cy - 60, 256, 12);
+ DrawHUDText(TXT_PAUSED, Game::GetText("HUDView.PAUSED"), pause_rect, DT_CENTER);
+ }
if (ship) {
DrawContactMarkers();
diff --git a/Stars45/HUDView.h b/Stars45/HUDView.h
index ad72b92..3e94480 100644
--- a/Stars45/HUDView.h
+++ b/Stars45/HUDView.h
@@ -238,5 +238,5 @@ struct HUDText {
bool hidden;
};
-#endif HUDView_h
+#endif // HUDView_h
diff --git a/Stars45/Hangar.h b/Stars45/Hangar.h
index aff96e9..511cef6 100644
--- a/Stars45/Hangar.h
+++ b/Stars45/Hangar.h
@@ -147,5 +147,5 @@ protected:
// +--------------------------------------------------------------------+
-#endif Hangar_h
+#endif // Hangar_h
diff --git a/Stars45/HardPoint.h b/Stars45/HardPoint.h
index 1ba0e1a..eba8f7a 100644
--- a/Stars45/HardPoint.h
+++ b/Stars45/HardPoint.h
@@ -102,5 +102,5 @@ protected:
float hull_factor;
};
-#endif HardPoint_h
+#endif // HardPoint_h
diff --git a/Stars45/Hoop.h b/Stars45/Hoop.h
index fe1df73..272f3da 100644
--- a/Stars45/Hoop.h
+++ b/Stars45/Hoop.h
@@ -65,5 +65,5 @@ protected:
// +--------------------------------------------------------------------+
-#endif Hoop_h
+#endif // Hoop_h
diff --git a/Stars45/ImageBox.h b/Stars45/ImageBox.h
index cbfa3c4..8f00bb1 100644
--- a/Stars45/ImageBox.h
+++ b/Stars45/ImageBox.h
@@ -91,5 +91,5 @@ protected:
Rect target_rect;
};
-#endif ImageBox_h
+#endif // ImageBox_h
diff --git a/Stars45/ImgView.h b/Stars45/ImgView.h
index 189877c..fa09d96 100644
--- a/Stars45/ImgView.h
+++ b/Stars45/ImgView.h
@@ -71,5 +71,5 @@ protected:
int blend;
};
-#endif ImgView_h
+#endif // ImgView_h
diff --git a/Stars45/Instruction.h b/Stars45/Instruction.h
index 410792f..9f3e1dc 100644
--- a/Stars45/Instruction.h
+++ b/Stars45/Instruction.h
@@ -186,5 +186,5 @@ protected:
// +--------------------------------------------------------------------+
-#endif Instruction_h
+#endif // Instruction_h
diff --git a/Stars45/Intel.h b/Stars45/Intel.h
index 611c9d8..542d1cf 100644
--- a/Stars45/Intel.h
+++ b/Stars45/Intel.h
@@ -57,5 +57,5 @@ public:
static const char* NameFromIntel(int intel);
};
-#endif Intel_h
+#endif // Intel_h
diff --git a/Stars45/JoyDlg.h b/Stars45/JoyDlg.h
index a4f488f..27ad606 100644
--- a/Stars45/JoyDlg.h
+++ b/Stars45/JoyDlg.h
@@ -76,5 +76,5 @@ protected:
Button* cancel;
};
-#endif JoyDlg_h
+#endif // JoyDlg_h
diff --git a/Stars45/Joystick.cpp b/Stars45/Joystick.cpp
index 3d641dd..5a30f8d 100644
--- a/Stars45/Joystick.cpp
+++ b/Stars45/Joystick.cpp
@@ -65,7 +65,7 @@ static int strikes = 3;
static Joystick* joystick = 0;
void DirectInputError(const char* msg, HRESULT err);
-char* DIErrStr(HRESULT hr);
+const char* DIErrStr(HRESULT hr);
void ReleaseDirectInput();
// +--------------------------------------------------------------------+
@@ -857,11 +857,12 @@ DirectInputError(const char* msg, HRESULT err)
static char errstrbuf[128];
-char* DIErrStr(HRESULT hr)
+const char* DIErrStr(HRESULT hr)
{
- switch (hr) {
+ auto casted = static_cast<long unsigned int>(hr);
+ switch (casted) {
default:
- sprintf_s(errstrbuf, "Unrecognized error value = %08x.", hr);
+ sprintf_s(errstrbuf, "Unrecognized error value = %08x.", casted);
return errstrbuf;
case DI_OK:
diff --git a/Stars45/Joystick.h b/Stars45/Joystick.h
index 263f9a5..64bf552 100644
--- a/Stars45/Joystick.h
+++ b/Stars45/Joystick.h
@@ -102,5 +102,5 @@ protected:
bool inv_axis[4];
};
-#endif Joystick_h
+#endif // Joystick_h
diff --git a/Stars45/KeyDlg.h b/Stars45/KeyDlg.h
index bb464e2..e0ef0f9 100644
--- a/Stars45/KeyDlg.h
+++ b/Stars45/KeyDlg.h
@@ -85,5 +85,5 @@ protected:
ActiveWindow* new_key;
};
-#endif KeyDlg_h
+#endif // KeyDlg_h
diff --git a/Stars45/KeyMap.h b/Stars45/KeyMap.h
index 0ec576f..5826ee1 100644
--- a/Stars45/KeyMap.h
+++ b/Stars45/KeyMap.h
@@ -201,5 +201,5 @@ const int KEY_INC_STARDATE = 120 + KEY_USER_BASE;
const int KEY_DEC_STARDATE = 121 + KEY_USER_BASE;
/***/
-#endif KeyMap_h
+#endif // KeyMap_h
diff --git a/Stars45/Keyboard.h b/Stars45/Keyboard.h
index 5ce09a3..3afaed0 100644
--- a/Stars45/Keyboard.h
+++ b/Stars45/Keyboard.h
@@ -94,5 +94,5 @@ protected:
// +--------------------------------------------------------------------+
-#endif Keyboard_h
+#endif // Keyboard_h
diff --git a/Stars45/LandingGear.h b/Stars45/LandingGear.h
index 7ead819..d1b578f 100644
--- a/Stars45/LandingGear.h
+++ b/Stars45/LandingGear.h
@@ -86,5 +86,5 @@ protected:
Point end[MAX_GEAR];
};
-#endif LandingGear_h
+#endif // LandingGear_h
diff --git a/Stars45/Layout.h b/Stars45/Layout.h
index 715121b..7e42a08 100644
--- a/Stars45/Layout.h
+++ b/Stars45/Layout.h
@@ -85,5 +85,5 @@ protected:
std::vector<float> row_weights;
};
-#endif Layout_h
+#endif // Layout_h
diff --git a/Stars45/Light.h b/Stars45/Light.h
index 8c1bc1b..68bde6c 100644
--- a/Stars45/Light.h
+++ b/Stars45/Light.h
@@ -116,5 +116,5 @@ protected:
// +--------------------------------------------------------------------+
-#endif Light_h
+#endif // Light_h
diff --git a/Stars45/ListBox.h b/Stars45/ListBox.h
index a792017..0523bc8 100644
--- a/Stars45/ListBox.h
+++ b/Stars45/ListBox.h
@@ -190,5 +190,5 @@ protected:
int seln_style;
};
-#endif ListBox_h
+#endif // ListBox_h
diff --git a/Stars45/LoadDlg.h b/Stars45/LoadDlg.h
index f77041e..b59ab31 100644
--- a/Stars45/LoadDlg.h
+++ b/Stars45/LoadDlg.h
@@ -61,5 +61,5 @@ protected:
Slider* progress;
};
-#endif LoadDlg_h
+#endif // LoadDlg_h
diff --git a/Stars45/LoadScreen.h b/Stars45/LoadScreen.h
index f3e3cbe..6b252d9 100644
--- a/Stars45/LoadScreen.h
+++ b/Stars45/LoadScreen.h
@@ -84,5 +84,5 @@ private:
// +--------------------------------------------------------------------+
-#endif LoadScreen_h
+#endif // LoadScreen_h
diff --git a/Stars45/Locale_ss.h b/Stars45/Locale_ss.h
index 29c12cf..f719304 100644
--- a/Stars45/Locale_ss.h
+++ b/Stars45/Locale_ss.h
@@ -73,5 +73,5 @@ protected:
char variant[8];
};
-#endif Locale_h
+#endif // Locale_h
diff --git a/Stars45/MCIWave.cpp b/Stars45/MCIWave.cpp
index 25bfdad..1424b7d 100644
--- a/Stars45/MCIWave.cpp
+++ b/Stars45/MCIWave.cpp
@@ -38,6 +38,7 @@
#include "MemDebug.h"
#include "Types.h"
+#include "Game.h"
// +----------------------------------------------------------------------+
@@ -50,11 +51,10 @@ static char ret_str[MCI_MAX_STR];
static char err_str[MCI_MAX_STR];
static MCIERROR mci_err;
static MMRESULT wav_err;
-extern HWND hwndApp;
static int mci_send_string(const char* cmd_str)
{
- mci_err = mciSendString(cmd_str, ret_str, sizeof(ret_str), hwndApp);
+ mci_err = mciSendString(cmd_str, ret_str, sizeof(ret_str), Game::GetHWND());
if (mci_err) {
if (mciGetErrorString(mci_err, err_str, sizeof(err_str)))
Print("Error (%s): '%s'\n", cmd_str, err_str);
diff --git a/Stars45/MachineInfo.cpp b/Stars45/MachineInfo.cpp
index 6b9e2cd..7485ac3 100644
--- a/Stars45/MachineInfo.cpp
+++ b/Stars45/MachineInfo.cpp
@@ -36,9 +36,10 @@
Collect and Display Machine, OS, and Driver Information
*/
+#include <chrono>
+
#include "MemDebug.h"
#include "MachineInfo.h"
-#include "Timesnap.h"
#define DIRECTINPUT_VERSION 0x0700
@@ -149,16 +150,13 @@ static double SpinWait(double target_time)
static double CalcCpuSpeed()
{
- DWORD clock1 = 0;
- DWORD clock2 = 0;
-
- TIMESNAP(clock1);
+ const auto before = std::chrono::high_resolution_clock::now();
double seconds = SpinWait(0.1);
- TIMESNAP(clock2);
-
- double clocks = clock2 - clock1;
+ const auto after = std::chrono::high_resolution_clock::now();
+ const std::chrono::duration<double> diff = after - before;
+ double clocks = diff.count();
return (clocks/seconds);
}
@@ -682,7 +680,7 @@ static void DescribeDriversNT(const char* sType)
HKEY hkWin;
char sVideo[256] = "";
char sDriver[256] = "";
- DWORD dwSize = NULL;
+ DWORD dwSize = 0;
// find the pointer to the video driver:
if (RegOpenKeyEx(HKEY_LOCAL_MACHINE,
diff --git a/Stars45/MachineInfo.h b/Stars45/MachineInfo.h
index 26b1223..4424ecd 100644
--- a/Stars45/MachineInfo.h
+++ b/Stars45/MachineInfo.h
@@ -63,4 +63,4 @@ public:
// +--------------------------------------------------------------------+
-#endif MachineInfo_h \ No newline at end of file
+#endif // MachineInfo_h \ No newline at end of file
diff --git a/Stars45/MapView.cpp b/Stars45/MapView.cpp
index 7c51089..de7c567 100644
--- a/Stars45/MapView.cpp
+++ b/Stars45/MapView.cpp
@@ -1911,7 +1911,8 @@ MapView::DrawSystem()
sprintf_s(resolution, "%s: %s", Game::GetText("MapView.info.Resolution").data(), r_txt);
active_window->SetFont(font);
- active_window->DrawText(resolution, -1, Rect(4, 4, rect.w-8, 24), DT_SINGLELINE|DT_RIGHT);
+ Rect text_rect(4, 4, rect.w - 8, 24);
+ active_window->DrawText(resolution, -1, text_rect, DT_SINGLELINE|DT_RIGHT);
}
// +--------------------------------------------------------------------+
@@ -2084,7 +2085,8 @@ MapView::DrawRegion()
sprintf_s(resolution, "%s: %s", Game::GetText("MapView.info.Resolution").data(), r_txt);
active_window->SetFont(font);
- active_window->DrawText(resolution, -1, Rect(4, 4, rect.w-8, 24), DT_SINGLELINE|DT_RIGHT);
+ Rect text_rect(4, 4, rect.w - 8, 24);
+ active_window->DrawText(resolution, -1, text_rect, DT_SINGLELINE|DT_RIGHT);
}
// +--------------------------------------------------------------------+
@@ -2822,12 +2824,14 @@ MapView::DrawCombatGroupSystem(CombatGroup* group, Orbital* rgn, int x1, int x2,
case CombatGroup::CARRIER_GROUP:
case CombatGroup::BATTLE_GROUP:
case CombatGroup::DESTROYER_SQUADRON:
+ {
sprintf_s(txt, "%s '%s'", group->GetShortDescription(), group->Name().data());
active_window->SetFont(font);
- active_window->DrawText(txt, 0, Rect(x1, y, x2-x1, 12), a);
+ Rect text_rect(x1, y, x2 - x1, 12);
+ active_window->DrawText(txt, 0, text_rect, a);
y += 10;
break;
-
+ }
case CombatGroup::BATTALION:
case CombatGroup::STATION:
case CombatGroup::STARBASE:
@@ -2835,12 +2839,13 @@ MapView::DrawCombatGroupSystem(CombatGroup* group, Orbital* rgn, int x1, int x2,
case CombatGroup::MINEFIELD:
case CombatGroup::BATTERY:
case CombatGroup::MISSILE:
-
+ {
active_window->SetFont(font);
- active_window->DrawText(group->GetShortDescription(), 0, Rect(x1, y, x2-x1, 12), a);
+ Rect text_rect(x1, y, x2 - x1, 12);
+ active_window->DrawText(group->GetShortDescription(), 0, text_rect, a);
y += 10;
break;
-
+ }
default:
break;
}
diff --git a/Stars45/MapView.h b/Stars45/MapView.h
index 0c49bd8..e6b2abf 100644
--- a/Stars45/MapView.h
+++ b/Stars45/MapView.h
@@ -243,5 +243,5 @@ protected:
MenuView* menu_view;
};
-#endif MapView_h
+#endif // MapView_h
diff --git a/Stars45/Menu.h b/Stars45/Menu.h
index ac142d3..8ce8a94 100644
--- a/Stars45/Menu.h
+++ b/Stars45/Menu.h
@@ -144,5 +144,5 @@ private:
List<Menu> history;
};
-#endif Menu_h
+#endif // Menu_h
diff --git a/Stars45/MenuDlg.h b/Stars45/MenuDlg.h
index d00c233..849e530 100644
--- a/Stars45/MenuDlg.h
+++ b/Stars45/MenuDlg.h
@@ -106,5 +106,5 @@ protected:
Campaign* campaign;
};
-#endif MenuDlg_h
+#endif // MenuDlg_h
diff --git a/Stars45/MenuScreen.h b/Stars45/MenuScreen.h
index c499784..306ae79 100644
--- a/Stars45/MenuScreen.h
+++ b/Stars45/MenuScreen.h
@@ -219,5 +219,5 @@ private:
// +--------------------------------------------------------------------+
-#endif MenuScreen_h
+#endif // MenuScreen_h
diff --git a/Stars45/MenuView.h b/Stars45/MenuView.h
index 65ac625..669efad 100644
--- a/Stars45/MenuView.h
+++ b/Stars45/MenuView.h
@@ -97,5 +97,5 @@ protected:
Color text_color;
};
-#endif MenuView_h
+#endif // MenuView_h
diff --git a/Stars45/Mfd.cpp b/Stars45/Mfd.cpp
index 7c1e704..aaf1d4c 100644
--- a/Stars45/Mfd.cpp
+++ b/Stars45/Mfd.cpp
@@ -1071,7 +1071,8 @@ MFD::Draw3D()
void
MFD::DrawMap()
{
- DrawMFDText(0, Game::GetText("MFD.mode.ground").data(), Rect(rect.x, rect.y, rect.w, 12), DT_CENTER);
+ Rect text_rect(rect.x, rect.y, rect.w, 12);
+ DrawMFDText(0, Game::GetText("MFD.mode.ground").data(), text_rect, DT_CENTER);
}
// +--------------------------------------------------------------------+
diff --git a/Stars45/Mfd.h b/Stars45/Mfd.h
index eabb48b..955e69c 100644
--- a/Stars45/Mfd.h
+++ b/Stars45/Mfd.h
@@ -124,5 +124,5 @@ protected:
bool mouse_in;
};
-#endif MFD_h
+#endif // MFD_h
diff --git a/Stars45/Mission.h b/Stars45/Mission.h
index b36f662..c8c4738 100644
--- a/Stars45/Mission.h
+++ b/Stars45/Mission.h
@@ -446,5 +446,5 @@ protected:
int fuel[4];
};
-#endif Mission_h
+#endif // Mission_h
diff --git a/Stars45/MissionEvent.h b/Stars45/MissionEvent.h
index ab4ccec..1accd5b 100644
--- a/Stars45/MissionEvent.h
+++ b/Stars45/MissionEvent.h
@@ -187,5 +187,5 @@ protected:
};
-#endif MissionEvent_h
+#endif // MissionEvent_h
diff --git a/Stars45/MissionTemplate.h b/Stars45/MissionTemplate.h
index db748f6..11ec7eb 100644
--- a/Stars45/MissionTemplate.h
+++ b/Stars45/MissionTemplate.h
@@ -137,5 +137,5 @@ protected:
};
-#endif MissionTemplate_h
+#endif // MissionTemplate_h
diff --git a/Stars45/ModConfig.h b/Stars45/ModConfig.h
index c0b7634..03d55ce 100644
--- a/Stars45/ModConfig.h
+++ b/Stars45/ModConfig.h
@@ -96,4 +96,4 @@ private:
List<ModInfo> mods;
};
-#endif ModConfig_h \ No newline at end of file
+#endif // ModConfig_h \ No newline at end of file
diff --git a/Stars45/ModDlg.h b/Stars45/ModDlg.h
index 350a16f..a6f95e2 100644
--- a/Stars45/ModDlg.h
+++ b/Stars45/ModDlg.h
@@ -114,5 +114,5 @@ protected:
bool changed;
};
-#endif ModDlg_h
+#endif // ModDlg_h
diff --git a/Stars45/ModInfo.h b/Stars45/ModInfo.h
index 889ad47..b9512e0 100644
--- a/Stars45/ModInfo.h
+++ b/Stars45/ModInfo.h
@@ -143,4 +143,4 @@ private:
Text path;
};
-#endif ModInfo_h \ No newline at end of file
+#endif // ModInfo_h \ No newline at end of file
diff --git a/Stars45/ModInfoDlg.h b/Stars45/ModInfoDlg.h
index 6b91199..5ed2e96 100644
--- a/Stars45/ModInfoDlg.h
+++ b/Stars45/ModInfoDlg.h
@@ -85,5 +85,5 @@ protected:
Bitmap bmp_default;
};
-#endif ModInfoDlg_h
+#endif // ModInfoDlg_h
diff --git a/Stars45/MotionController.h b/Stars45/MotionController.h
index 69938e3..c46fa23 100644
--- a/Stars45/MotionController.h
+++ b/Stars45/MotionController.h
@@ -251,5 +251,5 @@ protected:
int select;
};
-#endif MoCon_h
+#endif // MoCon_h
diff --git a/Stars45/Mouse.h b/Stars45/Mouse.h
index 07bc98f..2eda0a1 100644
--- a/Stars45/Mouse.h
+++ b/Stars45/Mouse.h
@@ -95,5 +95,5 @@ private:
static Window* window;
};
-#endif Mouse_h
+#endif // Mouse_h
diff --git a/Stars45/MouseController.h b/Stars45/MouseController.h
index b8bbe5e..6ecb49b 100644
--- a/Stars45/MouseController.h
+++ b/Stars45/MouseController.h
@@ -90,5 +90,5 @@ protected:
int active_key;
};
-#endif MouseController_h
+#endif // MouseController_h
diff --git a/Stars45/MsnDlg.h b/Stars45/MsnDlg.h
index b257a03..7deb4d0 100644
--- a/Stars45/MsnDlg.h
+++ b/Stars45/MsnDlg.h
@@ -93,5 +93,5 @@ protected:
int pkg_index;
};
-#endif MsnDlg_h
+#endif // MsnDlg_h
diff --git a/Stars45/MsnEditDlg.h b/Stars45/MsnEditDlg.h
index 77e8234..685cdc2 100644
--- a/Stars45/MsnEditDlg.h
+++ b/Stars45/MsnEditDlg.h
@@ -136,5 +136,5 @@ protected:
bool exit_latch;
};
-#endif MsnEditDlg_h
+#endif // MsnEditDlg_h
diff --git a/Stars45/MsnEditNavDlg.h b/Stars45/MsnEditNavDlg.h
index a0430c5..4a7e1a1 100644
--- a/Stars45/MsnEditNavDlg.h
+++ b/Stars45/MsnEditNavDlg.h
@@ -98,5 +98,5 @@ protected:
bool exit_latch;
};
-#endif MsnEditNavDlg_h
+#endif // MsnEditNavDlg_h
diff --git a/Stars45/MsnElemDlg.h b/Stars45/MsnElemDlg.h
index 99c0060..0f3d634 100644
--- a/Stars45/MsnElemDlg.h
+++ b/Stars45/MsnElemDlg.h
@@ -119,5 +119,5 @@ protected:
bool exit_latch;
};
-#endif MsnElemDlg_h
+#endif // MsnElemDlg_h
diff --git a/Stars45/MsnEventDlg.h b/Stars45/MsnEventDlg.h
index e05454c..92c1d49 100644
--- a/Stars45/MsnEventDlg.h
+++ b/Stars45/MsnEventDlg.h
@@ -106,5 +106,5 @@ protected:
MissionEvent* event;
};
-#endif MsnEventDlg_h
+#endif // MsnEventDlg_h
diff --git a/Stars45/MsnNavDlg.h b/Stars45/MsnNavDlg.h
index 2dd37bf..5c14a8c 100644
--- a/Stars45/MsnNavDlg.h
+++ b/Stars45/MsnNavDlg.h
@@ -74,5 +74,5 @@ public:
virtual void OnCancel(AWEvent* event);
};
-#endif MsnNavDlg_h
+#endif // MsnNavDlg_h
diff --git a/Stars45/MsnObjDlg.h b/Stars45/MsnObjDlg.h
index 228f5ba..1b62435 100644
--- a/Stars45/MsnObjDlg.h
+++ b/Stars45/MsnObjDlg.h
@@ -88,5 +88,5 @@ protected:
ShipSolid* ship;
};
-#endif MsnObjDlg_h
+#endif // MsnObjDlg_h
diff --git a/Stars45/MsnPkgDlg.h b/Stars45/MsnPkgDlg.h
index 4bab8fd..8c680b7 100644
--- a/Stars45/MsnPkgDlg.h
+++ b/Stars45/MsnPkgDlg.h
@@ -86,5 +86,5 @@ protected:
ActiveWindow* threat[5];
};
-#endif MsnPkgDlg_h
+#endif // MsnPkgDlg_h
diff --git a/Stars45/MsnSelectDlg.h b/Stars45/MsnSelectDlg.h
index b825a75..c986c2f 100644
--- a/Stars45/MsnSelectDlg.h
+++ b/Stars45/MsnSelectDlg.h
@@ -101,5 +101,5 @@ protected:
bool editable;
};
-#endif MsnSelectDlg_h
+#endif // MsnSelectDlg_h
diff --git a/Stars45/MsnWepDlg.h b/Stars45/MsnWepDlg.h
index 9d1a5e6..f8d2a57 100644
--- a/Stars45/MsnWepDlg.h
+++ b/Stars45/MsnWepDlg.h
@@ -106,5 +106,5 @@ protected:
Bitmap led_on;
};
-#endif MsnWepDlg_h
+#endif // MsnWepDlg_h
diff --git a/Stars45/MusicDirector.h b/Stars45/MusicDirector.h
index bfdd57b..ec4ed87 100644
--- a/Stars45/MusicDirector.h
+++ b/Stars45/MusicDirector.h
@@ -135,4 +135,4 @@ protected:
ThreadSync sync;
};
-#endif MusicDirector_h \ No newline at end of file
+#endif // MusicDirector_h \ No newline at end of file
diff --git a/Stars45/MusicTrack.h b/Stars45/MusicTrack.h
index 0e194c8..48e00a7 100644
--- a/Stars45/MusicTrack.h
+++ b/Stars45/MusicTrack.h
@@ -98,4 +98,4 @@ protected:
double fade_time;
};
-#endif MusicTrack_h \ No newline at end of file
+#endif // MusicTrack_h \ No newline at end of file
diff --git a/Stars45/NavAI.h b/Stars45/NavAI.h
index d920622..ddb0624 100644
--- a/Stars45/NavAI.h
+++ b/Stars45/NavAI.h
@@ -94,5 +94,5 @@ protected:
// +--------------------------------------------------------------------+
-#endif NavAI_h
+#endif // NavAI_h
diff --git a/Stars45/NavDlg.h b/Stars45/NavDlg.h
index 0cd12e5..a37c07a 100644
--- a/Stars45/NavDlg.h
+++ b/Stars45/NavDlg.h
@@ -139,5 +139,5 @@ protected:
bool editor;
};
-#endif NavDlg_h
+#endif // NavDlg_h
diff --git a/Stars45/NavLight.h b/Stars45/NavLight.h
index 9431a83..c194d20 100644
--- a/Stars45/NavLight.h
+++ b/Stars45/NavLight.h
@@ -87,5 +87,5 @@ protected:
DWORD offset;
};
-#endif NavLight_h
+#endif // NavLight_h
diff --git a/Stars45/NavSystem.h b/Stars45/NavSystem.h
index ccf1c13..ad69dbe 100644
--- a/Stars45/NavSystem.h
+++ b/Stars45/NavSystem.h
@@ -75,5 +75,5 @@ protected:
// +--------------------------------------------------------------------+
-#endif NavSystem_h
+#endif // NavSystem_h
diff --git a/Stars45/NetAddrDlg.h b/Stars45/NetAddrDlg.h
index 5f2607f..8ece063 100644
--- a/Stars45/NetAddrDlg.h
+++ b/Stars45/NetAddrDlg.h
@@ -80,5 +80,5 @@ protected:
EditBox* edt_pass;
};
-#endif NetAddrDlg_h
+#endif // NetAddrDlg_h
diff --git a/Stars45/NetAdminChat.h b/Stars45/NetAdminChat.h
index b26e9a9..0793a60 100644
--- a/Stars45/NetAdminChat.h
+++ b/Stars45/NetAdminChat.h
@@ -54,4 +54,4 @@ public:
virtual Text GetContent();
};
-#endif NetAdminChat_h \ No newline at end of file
+#endif // NetAdminChat_h \ No newline at end of file
diff --git a/Stars45/NetAdminServer.h b/Stars45/NetAdminServer.h
index b70fbfa..54c8f77 100644
--- a/Stars45/NetAdminServer.h
+++ b/Stars45/NetAdminServer.h
@@ -112,4 +112,4 @@ protected:
NetUser* user;
};
-#endif NetAdminServer_h \ No newline at end of file
+#endif // NetAdminServer_h \ No newline at end of file
diff --git a/Stars45/NetAuth.h b/Stars45/NetAuth.h
index 1c5ceb7..eb80e3b 100644
--- a/Stars45/NetAuth.h
+++ b/Stars45/NetAuth.h
@@ -72,4 +72,4 @@ public:
// +-------------------------------------------------------------------+
-#endif NetAuth_h \ No newline at end of file
+#endif // NetAuth_h \ No newline at end of file
diff --git a/Stars45/NetBrokerClient.h b/Stars45/NetBrokerClient.h
index 86d6922..0d6c728 100644
--- a/Stars45/NetBrokerClient.h
+++ b/Stars45/NetBrokerClient.h
@@ -64,4 +64,4 @@ protected:
};
-#endif NetBrokerClient_h \ No newline at end of file
+#endif // NetBrokerClient_h \ No newline at end of file
diff --git a/Stars45/NetChat.h b/Stars45/NetChat.h
index 4cad0f8..41943fd 100644
--- a/Stars45/NetChat.h
+++ b/Stars45/NetChat.h
@@ -73,4 +73,4 @@ private:
// +-------------------------------------------------------------------+
-#endif NetChat_h \ No newline at end of file
+#endif // NetChat_h \ No newline at end of file
diff --git a/Stars45/NetClientConfig.h b/Stars45/NetClientConfig.h
index 9865d4f..d55318b 100644
--- a/Stars45/NetClientConfig.h
+++ b/Stars45/NetClientConfig.h
@@ -94,4 +94,4 @@ private:
static NetClientConfig* instance;
};
-#endif NetClientConfig_h
+#endif // NetClientConfig_h
diff --git a/Stars45/NetClientDlg.h b/Stars45/NetClientDlg.h
index 0f88557..cbd644c 100644
--- a/Stars45/NetClientDlg.h
+++ b/Stars45/NetClientDlg.h
@@ -100,5 +100,5 @@ protected:
Button* btn_cancel;
};
-#endif NetClientDlg_h
+#endif // NetClientDlg_h
diff --git a/Stars45/NetData.h b/Stars45/NetData.h
index 0436f5f..8a3e030 100644
--- a/Stars45/NetData.h
+++ b/Stars45/NetData.h
@@ -986,5 +986,5 @@ private:
// +--------------------------------------------------------------------+
-#endif NetData_h
+#endif // NetData_h
diff --git a/Stars45/NetFileServlet.h b/Stars45/NetFileServlet.h
index 66ab7f6..c2228a2 100644
--- a/Stars45/NetFileServlet.h
+++ b/Stars45/NetFileServlet.h
@@ -71,4 +71,4 @@ public:
virtual bool DoGet(HttpRequest& request, HttpResponse& response);
};
-#endif NetFileServlet_h \ No newline at end of file
+#endif // NetFileServlet_h \ No newline at end of file
diff --git a/Stars45/NetGame.h b/Stars45/NetGame.h
index abaf905..9ab5585 100644
--- a/Stars45/NetGame.h
+++ b/Stars45/NetGame.h
@@ -147,5 +147,5 @@ protected:
// +--------------------------------------------------------------------+
-#endif NetGame_h
+#endif // NetGame_h
diff --git a/Stars45/NetGameClient.h b/Stars45/NetGameClient.h
index 1cc8397..879dee3 100644
--- a/Stars45/NetGameClient.h
+++ b/Stars45/NetGameClient.h
@@ -107,5 +107,5 @@ protected:
// +--------------------------------------------------------------------+
-#endif NetGameClient_h
+#endif // NetGameClient_h
diff --git a/Stars45/NetGameServer.h b/Stars45/NetGameServer.h
index afa73ae..b2e2d13 100644
--- a/Stars45/NetGameServer.h
+++ b/Stars45/NetGameServer.h
@@ -110,5 +110,5 @@ protected:
// +--------------------------------------------------------------------+
-#endif NetGameServer_h
+#endif // NetGameServer_h
diff --git a/Stars45/NetLobby.h b/Stars45/NetLobby.h
index 8da024d..4b17182 100644
--- a/Stars45/NetLobby.h
+++ b/Stars45/NetLobby.h
@@ -309,5 +309,5 @@ enum NET_LOBBY_MESSAGES {
// +--------------------------------------------------------------------+
-#endif NetLobby_h
+#endif // NetLobby_h
diff --git a/Stars45/NetLobbyClient.h b/Stars45/NetLobbyClient.h
index ae1ad11..54b5cfd 100644
--- a/Stars45/NetLobbyClient.h
+++ b/Stars45/NetLobbyClient.h
@@ -125,4 +125,4 @@ protected:
// +-------------------------------------------------------------------+
-#endif NetLobbyClient_h \ No newline at end of file
+#endif // NetLobbyClient_h \ No newline at end of file
diff --git a/Stars45/NetLobbyDlg.h b/Stars45/NetLobbyDlg.h
index 3dd75ef..6d66542 100644
--- a/Stars45/NetLobbyDlg.h
+++ b/Stars45/NetLobbyDlg.h
@@ -109,5 +109,5 @@ protected:
// +--------------------------------------------------------------------+
-#endif NetLobbyDlg_h
+#endif // NetLobbyDlg_h
diff --git a/Stars45/NetLobbyServer.h b/Stars45/NetLobbyServer.h
index a2a9803..da2d3f1 100644
--- a/Stars45/NetLobbyServer.h
+++ b/Stars45/NetLobbyServer.h
@@ -140,4 +140,4 @@ protected:
// +-------------------------------------------------------------------+
-#endif NetLobbyServer_h \ No newline at end of file
+#endif // NetLobbyServer_h \ No newline at end of file
diff --git a/Stars45/NetPacket.h b/Stars45/NetPacket.h
index 6e0f528..3eb281f 100644
--- a/Stars45/NetPacket.h
+++ b/Stars45/NetPacket.h
@@ -94,5 +94,5 @@ protected:
// +--------------------------------------------------------------------+
-#endif NetPacket_h
+#endif // NetPacket_h
diff --git a/Stars45/NetPassDlg.h b/Stars45/NetPassDlg.h
index d5645ca..65c55fd 100644
--- a/Stars45/NetPassDlg.h
+++ b/Stars45/NetPassDlg.h
@@ -78,5 +78,5 @@ protected:
ActiveWindow* lbl_name;
};
-#endif NetPassDlg_h
+#endif // NetPassDlg_h
diff --git a/Stars45/NetPlayer.cpp b/Stars45/NetPlayer.cpp
index 1a15527..5bcfccc 100644
--- a/Stars45/NetPlayer.cpp
+++ b/Stars45/NetPlayer.cpp
@@ -36,6 +36,12 @@
Network Player (Director) class
*/
+#ifndef NOMINMAX
+#define NOMINMAX
+#endif
+
+#include <algorithm>
+
#include "MemDebug.h"
#include "NetPlayer.h"
#include "NetGame.h"
@@ -446,7 +452,7 @@ NetPlayer::ExecFrame(double seconds)
if (ship) {
// bleed off the location error:
if (loc_error.length() > 0 && bleed_time > 0) {
- double fragment = min(seconds / BLEED, bleed_time);
+ double fragment = std::min(seconds / BLEED, bleed_time);
ship->MoveTo(ship->Location() + loc_error * fragment);
bleed_time -= fragment;
}
diff --git a/Stars45/NetPlayer.h b/Stars45/NetPlayer.h
index 4de4982..4bed59d 100644
--- a/Stars45/NetPlayer.h
+++ b/Stars45/NetPlayer.h
@@ -118,5 +118,5 @@ protected:
// +--------------------------------------------------------------------+
-#endif NetPlayer_h
+#endif // NetPlayer_h
diff --git a/Stars45/NetServerConfig.h b/Stars45/NetServerConfig.h
index 260ea0c..a81c4fd 100644
--- a/Stars45/NetServerConfig.h
+++ b/Stars45/NetServerConfig.h
@@ -120,4 +120,4 @@ private:
static NetServerConfig* instance;
};
-#endif NetServerConfig_h
+#endif // NetServerConfig_h
diff --git a/Stars45/NetServerDlg.h b/Stars45/NetServerDlg.h
index 24d095d..c11199b 100644
--- a/Stars45/NetServerDlg.h
+++ b/Stars45/NetServerDlg.h
@@ -84,5 +84,5 @@ protected:
Button* btn_cancel;
};
-#endif NetServerDlg_h
+#endif // NetServerDlg_h
diff --git a/Stars45/NetUnitDlg.h b/Stars45/NetUnitDlg.h
index 76f7164..6bda0a5 100644
--- a/Stars45/NetUnitDlg.h
+++ b/Stars45/NetUnitDlg.h
@@ -113,5 +113,5 @@ protected:
// +--------------------------------------------------------------------+
-#endif NetUnitDlg_h
+#endif // NetUnitDlg_h
diff --git a/Stars45/NetUser.h b/Stars45/NetUser.h
index 1aa9cd0..2f86d8e 100644
--- a/Stars45/NetUser.h
+++ b/Stars45/NetUser.h
@@ -133,4 +133,4 @@ protected:
// +-------------------------------------------------------------------+
-#endif NetUser_h \ No newline at end of file
+#endif // NetUser_h \ No newline at end of file
diff --git a/Stars45/NetUtil.h b/Stars45/NetUtil.h
index b89c126..210cfce 100644
--- a/Stars45/NetUtil.h
+++ b/Stars45/NetUtil.h
@@ -77,4 +77,4 @@ public:
static void SendSelfDestruct(Ship* ship, double damage);
};
-#endif NetUtil_h \ No newline at end of file
+#endif // NetUtil_h \ No newline at end of file
diff --git a/Stars45/OptDlg.h b/Stars45/OptDlg.h
index 7a3be9e..b206ffb 100644
--- a/Stars45/OptDlg.h
+++ b/Stars45/OptDlg.h
@@ -107,5 +107,5 @@ protected:
bool closed;
};
-#endif OptDlg_h
+#endif // OptDlg_h
diff --git a/Stars45/ParseUtil.h b/Stars45/ParseUtil.h
index b958e6e..3106144 100644
--- a/Stars45/ParseUtil.h
+++ b/Stars45/ParseUtil.h
@@ -73,4 +73,4 @@ bool GetDefArray(std::vector<float>& array, TermDef* def, const char* file)
// +--------------------------------------------------------------------+
-#endif ParseUtil_h
+#endif // ParseUtil_h
diff --git a/Stars45/Particles.h b/Stars45/Particles.h
index ac0bc2b..428daa1 100644
--- a/Stars45/Particles.h
+++ b/Stars45/Particles.h
@@ -107,4 +107,4 @@ protected:
Sprite* point_sprite;
};
-#endif Particles_h
+#endif // Particles_h
diff --git a/Stars45/Physical.h b/Stars45/Physical.h
index 623d8b6..a986ed4 100644
--- a/Stars45/Physical.h
+++ b/Stars45/Physical.h
@@ -225,5 +225,5 @@ protected:
// +--------------------------------------------------------------------+
-#endif Physical_h
+#endif // Physical_h
diff --git a/Stars45/PlanScreen.h b/Stars45/PlanScreen.h
index 6b96333..6ca3c39 100644
--- a/Stars45/PlanScreen.h
+++ b/Stars45/PlanScreen.h
@@ -128,5 +128,5 @@ private:
// +--------------------------------------------------------------------+
-#endif PlanScreen_h
+#endif // PlanScreen_h
diff --git a/Stars45/Player.h b/Stars45/Player.h
index 086f781..5f1479e 100644
--- a/Stars45/Player.h
+++ b/Stars45/Player.h
@@ -208,4 +208,4 @@ protected:
AwardInfo* award;
};
-#endif Player_h \ No newline at end of file
+#endif // Player_h \ No newline at end of file
diff --git a/Stars45/PlayerDlg.h b/Stars45/PlayerDlg.h
index 29c993e..e6c31a7 100644
--- a/Stars45/PlayerDlg.h
+++ b/Stars45/PlayerDlg.h
@@ -106,5 +106,5 @@ protected:
Button* cancel;
};
-#endif PlayerDlg_h
+#endif // PlayerDlg_h
diff --git a/Stars45/PngImage.h b/Stars45/PngImage.h
index e457723..09d5b58 100644
--- a/Stars45/PngImage.h
+++ b/Stars45/PngImage.h
@@ -67,4 +67,4 @@ struct PngImage
// +--------------------------------------------------------------------+
-#endif PngImage_h
+#endif // PngImage_h
diff --git a/Stars45/Polygon.h b/Stars45/Polygon.h
index fe9c6af..5efded7 100644
--- a/Stars45/Polygon.h
+++ b/Stars45/Polygon.h
@@ -179,5 +179,5 @@ struct VertexSet
// +--------------------------------------------------------------------+
-#endif Polygon_h
+#endif // Polygon_h
diff --git a/Stars45/Power.h b/Stars45/Power.h
index fadd751..b044aa0 100644
--- a/Stars45/Power.h
+++ b/Stars45/Power.h
@@ -82,5 +82,5 @@ protected:
float requested_power_level;
};
-#endif Power_h
+#endif // Power_h
diff --git a/Stars45/Projector.cpp b/Stars45/Projector.cpp
index 6881682..1c2e635 100644
--- a/Stars45/Projector.cpp
+++ b/Stars45/Projector.cpp
@@ -36,6 +36,12 @@
3D Projection Camera class
*/
+#ifndef NOMINMAX
+#define NOMINMAX
+#endif
+
+#include <algorithm>
+
#include "MemDebug.h"
#include "Projector.h"
@@ -101,7 +107,7 @@ Projector::SetFieldOfView(double fov)
xscreenscale = width / fov;
yscreenscale = height / fov;
- maxscale = max(xscreenscale, yscreenscale);
+ maxscale = std::max(xscreenscale, yscreenscale);
xangle = atan(2.0/fov * maxscale/xscreenscale);
yangle = atan(2.0/fov * maxscale/yscreenscale);
diff --git a/Stars45/Projector.h b/Stars45/Projector.h
index d314ec5..96c2b82 100644
--- a/Stars45/Projector.h
+++ b/Stars45/Projector.h
@@ -126,5 +126,5 @@ protected:
float yclip0, yclip1;
};
-#endif Projector_h
+#endif // Projector_h
diff --git a/Stars45/QuantumFlash.h b/Stars45/QuantumFlash.h
index d791370..015a643 100644
--- a/Stars45/QuantumFlash.h
+++ b/Stars45/QuantumFlash.h
@@ -81,4 +81,4 @@ protected:
Matrix orientation;
};
-#endif QuantumFlash_h
+#endif // QuantumFlash_h
diff --git a/Stars45/QuantumView.h b/Stars45/QuantumView.h
index 6073d05..f342ba3 100644
--- a/Stars45/QuantumView.h
+++ b/Stars45/QuantumView.h
@@ -93,5 +93,5 @@ protected:
static QuantumView* quantum_view;
};
-#endif QuantumView_h
+#endif // QuantumView_h
diff --git a/Stars45/QuitView.h b/Stars45/QuitView.h
index 0068564..a7eb688 100644
--- a/Stars45/QuitView.h
+++ b/Stars45/QuitView.h
@@ -84,5 +84,5 @@ protected:
static QuitView* quit_view;
};
-#endif QuitView_h
+#endif // QuitView_h
diff --git a/Stars45/RLoc.h b/Stars45/RLoc.h
index 1803b34..3d68218 100644
--- a/Stars45/RLoc.h
+++ b/Stars45/RLoc.h
@@ -91,5 +91,5 @@ private:
// +--------------------------------------------------------------------+
-#endif RLoc_h
+#endif // RLoc_h
diff --git a/Stars45/RadioHandler.h b/Stars45/RadioHandler.h
index 965d6f5..3fed4ee 100644
--- a/Stars45/RadioHandler.h
+++ b/Stars45/RadioHandler.h
@@ -73,5 +73,5 @@ protected:
// +--------------------------------------------------------------------+
-#endif RadioHandler_h
+#endif // RadioHandler_h
diff --git a/Stars45/RadioMessage.h b/Stars45/RadioMessage.h
index 6ed2bd9..545cec4 100644
--- a/Stars45/RadioMessage.h
+++ b/Stars45/RadioMessage.h
@@ -175,5 +175,5 @@ protected:
// +--------------------------------------------------------------------+
-#endif RadioMessage_h
+#endif // RadioMessage_h
diff --git a/Stars45/RadioTraffic.h b/Stars45/RadioTraffic.h
index 18b854f..ede1510 100644
--- a/Stars45/RadioTraffic.h
+++ b/Stars45/RadioTraffic.h
@@ -85,5 +85,5 @@ protected:
// +--------------------------------------------------------------------+
-#endif RadioTraffic_h
+#endif // RadioTraffic_h
diff --git a/Stars45/RadioView.h b/Stars45/RadioView.h
index 3ddac36..5e38fac 100644
--- a/Stars45/RadioView.h
+++ b/Stars45/RadioView.h
@@ -107,5 +107,5 @@ protected:
static ThreadSync sync;
};
-#endif RadioView_h
+#endif // RadioView_h
diff --git a/Stars45/RadioVox.h b/Stars45/RadioVox.h
index e49a25c..971663b 100644
--- a/Stars45/RadioVox.h
+++ b/Stars45/RadioVox.h
@@ -79,5 +79,5 @@ protected:
int channel;
};
-#endif RadioVox_h
+#endif // RadioVox_h
diff --git a/Stars45/Random.h b/Stars45/Random.h
index 0c12290..c749a3b 100644
--- a/Stars45/Random.h
+++ b/Stars45/Random.h
@@ -56,4 +56,4 @@ int RandomShuffle(int count);
// +----------------------------------------------------------------------+
-#endif Random_h
+#endif // Random_h
diff --git a/Stars45/Res.h b/Stars45/Res.h
index cc911fb..c73762c 100644
--- a/Stars45/Res.h
+++ b/Stars45/Res.h
@@ -57,5 +57,5 @@ protected:
HANDLE id;
};
-#endif Res_h
+#endif // Res_h
diff --git a/Stars45/RichTextBox.h b/Stars45/RichTextBox.h
index 4d382e4..da91218 100644
--- a/Stars45/RichTextBox.h
+++ b/Stars45/RichTextBox.h
@@ -85,5 +85,5 @@ protected:
};
-#endif RichTextBox_h
+#endif // RichTextBox_h
diff --git a/Stars45/Scene.h b/Stars45/Scene.h
index 1c0a894..ebed0de 100644
--- a/Stars45/Scene.h
+++ b/Stars45/Scene.h
@@ -97,4 +97,4 @@ protected:
// +--------------------------------------------------------------------+
-#endif Scene_h
+#endif // Scene_h
diff --git a/Stars45/Screen.h b/Stars45/Screen.h
index d74a759..bd4af55 100644
--- a/Stars45/Screen.h
+++ b/Stars45/Screen.h
@@ -85,5 +85,5 @@ protected:
List<Window> window_list;
};
-#endif Screen_h
+#endif // Screen_h
diff --git a/Stars45/ScrollWindow.h b/Stars45/ScrollWindow.h
index a2259c8..7a1a6b0 100644
--- a/Stars45/ScrollWindow.h
+++ b/Stars45/ScrollWindow.h
@@ -152,5 +152,5 @@ protected:
double smooth_offset;
};
-#endif ScrollWindow_h
+#endif // ScrollWindow_h
diff --git a/Stars45/SeekerAI.h b/Stars45/SeekerAI.h
index 223d77f..791d09b 100644
--- a/Stars45/SeekerAI.h
+++ b/Stars45/SeekerAI.h
@@ -93,5 +93,5 @@ protected:
// +--------------------------------------------------------------------+
-#endif SeekerAI_h
+#endif // SeekerAI_h
diff --git a/Stars45/Sensor.h b/Stars45/Sensor.h
index c0fa301..6e0e4ef 100644
--- a/Stars45/Sensor.h
+++ b/Stars45/Sensor.h
@@ -106,5 +106,5 @@ protected:
List<Contact> contacts;
};
-#endif Sensor_h
+#endif // Sensor_h
diff --git a/Stars45/Shadow.h b/Stars45/Shadow.h
index b6d690c..9f34bbc 100644
--- a/Stars45/Shadow.h
+++ b/Stars45/Shadow.h
@@ -90,5 +90,5 @@ protected:
// +--------------------------------------------------------------------+
-#endif Shadow_h
+#endif // Shadow_h
diff --git a/Stars45/Shield.h b/Stars45/Shield.h
index ac618e5..c70db24 100644
--- a/Stars45/Shield.h
+++ b/Stars45/Shield.h
@@ -97,5 +97,5 @@ protected:
float deflection_cost;
};
-#endif Shield_h
+#endif // Shield_h
diff --git a/Stars45/ShieldRep.h b/Stars45/ShieldRep.h
index e7c0990..250861a 100644
--- a/Stars45/ShieldRep.h
+++ b/Stars45/ShieldRep.h
@@ -68,5 +68,5 @@ protected:
bool bubble;
};
-#endif ShieldRep_h
+#endif // ShieldRep_h
diff --git a/Stars45/Ship.h b/Stars45/Ship.h
index 0ad48d9..8aebf03 100644
--- a/Stars45/Ship.h
+++ b/Stars45/Ship.h
@@ -603,5 +603,5 @@ protected:
static double friendly_fire_level;
};
-#endif Ship_h
+#endif // Ship_h
diff --git a/Stars45/ShipAI.h b/Stars45/ShipAI.h
index d4bb34a..04c8a12 100644
--- a/Stars45/ShipAI.h
+++ b/Stars45/ShipAI.h
@@ -173,5 +173,5 @@ protected:
// +--------------------------------------------------------------------+
-#endif ShipAI_h
+#endif // ShipAI_h
diff --git a/Stars45/ShipCtrl.h b/Stars45/ShipCtrl.h
index 26a33b0..69d4b10 100644
--- a/Stars45/ShipCtrl.h
+++ b/Stars45/ShipCtrl.h
@@ -79,5 +79,5 @@ protected:
bool target_latch;
};
-#endif ShipCtrl_h
+#endif // ShipCtrl_h
diff --git a/Stars45/ShipDesign.h b/Stars45/ShipDesign.h
index cec02b5..a35033b 100644
--- a/Stars45/ShipDesign.h
+++ b/Stars45/ShipDesign.h
@@ -312,5 +312,5 @@ public:
// +--------------------------------------------------------------------+
-#endif ShipDesign_h
+#endif // ShipDesign_h
diff --git a/Stars45/ShipKiller.h b/Stars45/ShipKiller.h
index e564943..aeda90b 100644
--- a/Stars45/ShipKiller.h
+++ b/Stars45/ShipKiller.h
@@ -75,5 +75,5 @@ protected:
int exp_index;
};
-#endif ShipKiller_h
+#endif // ShipKiller_h
diff --git a/Stars45/ShipSolid.h b/Stars45/ShipSolid.h
index be99068..39389c7 100644
--- a/Stars45/ShipSolid.h
+++ b/Stars45/ShipSolid.h
@@ -72,5 +72,5 @@ protected:
// +--------------------------------------------------------------------+
-#endif ShipSolid_h
+#endif // ShipSolid_h
diff --git a/Stars45/Shot.h b/Stars45/Shot.h
index 4ea013c..f655494 100644
--- a/Stars45/Shot.h
+++ b/Stars45/Shot.h
@@ -149,5 +149,5 @@ protected:
Point origin;
};
-#endif Shot_h
+#endif // Shot_h
diff --git a/Stars45/Sim.h b/Stars45/Sim.h
index ddad6a8..1a36d7f 100644
--- a/Stars45/Sim.h
+++ b/Stars45/Sim.h
@@ -350,5 +350,5 @@ protected:
int ai_index;
};
-#endif Sim_h
+#endif // Sim_h
diff --git a/Stars45/SimEvent.h b/Stars45/SimEvent.h
index 54773bb..566768b 100644
--- a/Stars45/SimEvent.h
+++ b/Stars45/SimEvent.h
@@ -183,5 +183,5 @@ private:
List<SimEvent> events;
};
-#endif SimEvent_h
+#endif // SimEvent_h
diff --git a/Stars45/SimObject.h b/Stars45/SimObject.h
index 93b58cf..0313a1e 100644
--- a/Stars45/SimObject.h
+++ b/Stars45/SimObject.h
@@ -119,5 +119,5 @@ protected:
List<SimObject> observe_list;
};
-#endif SimObject_h
+#endif // SimObject_h
diff --git a/Stars45/Skin.h b/Stars45/Skin.h
index 276d9c0..7981900 100644
--- a/Stars45/Skin.h
+++ b/Stars45/Skin.h
@@ -112,5 +112,5 @@ private:
// +--------------------------------------------------------------------+
-#endif Skin_h
+#endif // Skin_h
diff --git a/Stars45/Sky.h b/Stars45/Sky.h
index a7e3e4a..591824c 100644
--- a/Stars45/Sky.h
+++ b/Stars45/Sky.h
@@ -125,5 +125,5 @@ protected:
StarSystem* star_system;
};
-#endif Sky_h
+#endif // Sky_h
diff --git a/Stars45/Slider.h b/Stars45/Slider.h
index e1a5347..4008977 100644
--- a/Stars45/Slider.h
+++ b/Stars45/Slider.h
@@ -127,5 +127,5 @@ protected:
int marker[2];
};
-#endif Slider_h
+#endif // Slider_h
diff --git a/Stars45/Solid.h b/Stars45/Solid.h
index ef745ca..87cc5e0 100644
--- a/Stars45/Solid.h
+++ b/Stars45/Solid.h
@@ -333,5 +333,5 @@ protected:
// +--------------------------------------------------------------------+
-#endif Solid_h
+#endif // Solid_h
diff --git a/Stars45/Sound.h b/Stars45/Sound.h
index d4e0374..31460c0 100644
--- a/Stars45/Sound.h
+++ b/Stars45/Sound.h
@@ -170,5 +170,5 @@ public:
virtual void Update(Sound* s) { }
};
-#endif Sound_h
+#endif // Sound_h
diff --git a/Stars45/SoundCard.h b/Stars45/SoundCard.h
index 295a6e2..2c98d32 100644
--- a/Stars45/SoundCard.h
+++ b/Stars45/SoundCard.h
@@ -96,5 +96,5 @@ protected:
ThreadSync sync;
};
-#endif SoundCard_h
+#endif // SoundCard_h
diff --git a/Stars45/SoundD3D.h b/Stars45/SoundD3D.h
index 3a8e089..ae7b786 100644
--- a/Stars45/SoundD3D.h
+++ b/Stars45/SoundD3D.h
@@ -182,5 +182,5 @@ protected:
DSBUFFERDESC dsbd;
};
-#endif SoundD3D_h
+#endif // SoundD3D_h
diff --git a/Stars45/Sprite.h b/Stars45/Sprite.h
index b28b91c..c120b6a 100644
--- a/Stars45/Sprite.h
+++ b/Stars45/Sprite.h
@@ -110,5 +110,5 @@ protected:
// +--------------------------------------------------------------------+
-#endif Sprite_h
+#endif // Sprite_h
diff --git a/Stars45/StarServer.h b/Stars45/StarServer.h
index dc4b504..46d99a1 100644
--- a/Stars45/StarServer.h
+++ b/Stars45/StarServer.h
@@ -97,4 +97,4 @@ protected:
DWORD minutes;
};
-#endif StarServer_h
+#endif // StarServer_h
diff --git a/Stars45/StarSystem.cpp b/Stars45/StarSystem.cpp
index 8daed31..3c91f99 100644
--- a/Stars45/StarSystem.cpp
+++ b/Stars45/StarSystem.cpp
@@ -54,34 +54,17 @@
#include "Scene.h"
#include "ParseUtil.h"
-const double epoch = 0.5e9;
-double StarSystem::stardate = 0;
+const long double epoch = 0.5e9;
+long double StarSystem::stardate = 0;
// +====================================================================+
-static double base_time = 0;
+static long double base_time = 0;
static WORD oldcw = 0;
static WORD fpcw = 0;
-void FPU2Extended()
+void StarSystem::SetBaseTime(long double t, bool absolute)
{
- _asm { fstcw oldcw }
- fpcw = oldcw | 0x0300; // set 80-bit precision mode
- _asm { fldcw fpcw }
-}
-
-void FPURestore()
-{
- // well, I don't actually WANT single-precision mode
- // so I think I'll just ignore this...
-
- //_asm { fldcw oldcw }
-}
-
-void StarSystem::SetBaseTime(double t, bool absolute)
-{
- FPU2Extended();
-
if (absolute) {
base_time = t;
CalcStardate();
@@ -94,7 +77,7 @@ void StarSystem::SetBaseTime(double t, bool absolute)
}
}
-double StarSystem::GetBaseTime()
+long double StarSystem::GetBaseTime()
{
return base_time;
}
@@ -111,14 +94,10 @@ void StarSystem::CalcStardate()
base_time += epoch;
}
- FPU2Extended();
-
- double gtime = (double) Game::GameTime() / 1000.0;
- double sdate = gtime + base_time + epoch;
+ long double gtime = (long double) Game::GameTime() / 1000.0;
+ long double sdate = gtime + base_time + epoch;
stardate = sdate;
-
- FPURestore();
}
static const double GRAV = 6.673e-11;
diff --git a/Stars45/StarSystem.h b/Stars45/StarSystem.h
index 75a0abe..90b77df 100644
--- a/Stars45/StarSystem.h
+++ b/Stars45/StarSystem.h
@@ -102,9 +102,9 @@ public:
void SetActiveRegion(OrbitalRegion* rgn);
- static void SetBaseTime(double t, bool absolute=false);
- static double GetBaseTime();
- static double Stardate() { return stardate; }
+ static void SetBaseTime(long double t, bool absolute=false);
+ static long double GetBaseTime();
+ static long double Stardate() { return stardate; }
static void CalcStardate();
double Radius() const { return radius; }
@@ -133,7 +133,7 @@ protected:
int affiliation;
int seq;
Point loc;
- static double stardate;
+ static long double stardate;
double radius;
bool instantiated;
@@ -342,5 +342,5 @@ protected:
List<Text> links;
};
-#endif StarSystem_h
+#endif // StarSystem_h
diff --git a/Stars45/Starshatter.h b/Stars45/Starshatter.h
index 939b54b..c5aacf6 100644
--- a/Stars45/Starshatter.h
+++ b/Stars45/Starshatter.h
@@ -246,4 +246,4 @@ protected:
Text chat_text;
};
-#endif Starshatter_h
+#endif // Starshatter_h
diff --git a/Stars45/StarshipAI.h b/Stars45/StarshipAI.h
index a7eedf0..f7457f3 100644
--- a/Stars45/StarshipAI.h
+++ b/Stars45/StarshipAI.h
@@ -82,5 +82,5 @@ protected:
// +--------------------------------------------------------------------+
-#endif StarshipAI_h
+#endif // StarshipAI_h
diff --git a/Stars45/StarshipTacticalAI.cpp b/Stars45/StarshipTacticalAI.cpp
index 977b86b..e00e8d2 100644
--- a/Stars45/StarshipTacticalAI.cpp
+++ b/Stars45/StarshipTacticalAI.cpp
@@ -36,6 +36,12 @@
Starship-specific mid-level (tactical) AI
*/
+#ifndef NOMINMAX
+#define NOMINMAX
+#endif
+
+#include <algorithm>
+
#include "MemDebug.h"
#include "StarshipTacticalAI.h"
#include "ShipAI.h"
@@ -128,7 +134,7 @@ StarshipTacticalAI::FindThreat()
continue;
if (c_ship && c_ship != ship) {
- double basis = max(contact->Range(ship), CELL_SIZE);
+ double basis = std::max(contact->Range(ship), CELL_SIZE);
double ai_value = c_ship->AIValue() / basis;
if (c_ship->GetIFF() == ship->GetIFF()) {
diff --git a/Stars45/StarshipTacticalAI.h b/Stars45/StarshipTacticalAI.h
index b0e7587..2d8231f 100644
--- a/Stars45/StarshipTacticalAI.h
+++ b/Stars45/StarshipTacticalAI.h
@@ -67,5 +67,5 @@ protected:
// +--------------------------------------------------------------------+
-#endif StarshipTacticalAI_h
+#endif // StarshipTacticalAI_h
diff --git a/Stars45/SteerAI.h b/Stars45/SteerAI.h
index 349405e..93dbacd 100644
--- a/Stars45/SteerAI.h
+++ b/Stars45/SteerAI.h
@@ -145,5 +145,5 @@ protected:
// +--------------------------------------------------------------------+
-#endif SteerAI_h
+#endif // SteerAI_h
diff --git a/Stars45/System.h b/Stars45/System.h
index a41712a..62c5b06 100644
--- a/Stars45/System.h
+++ b/Stars45/System.h
@@ -194,5 +194,5 @@ protected:
List<Component> components;
};
-#endif System_h
+#endif // System_h
diff --git a/Stars45/SystemDesign.h b/Stars45/SystemDesign.h
index bfe9f93..b1cb8c0 100644
--- a/Stars45/SystemDesign.h
+++ b/Stars45/SystemDesign.h
@@ -74,5 +74,5 @@ public:
// +--------------------------------------------------------------------+
-#endif SystemDesign_h
+#endif // SystemDesign_h
diff --git a/Stars45/TacRefDlg.h b/Stars45/TacRefDlg.h
index a24f932..9495f27 100644
--- a/Stars45/TacRefDlg.h
+++ b/Stars45/TacRefDlg.h
@@ -121,5 +121,5 @@ protected:
int weap_index;
};
-#endif TacRefDlg_h
+#endif // TacRefDlg_h
diff --git a/Stars45/TacticalAI.h b/Stars45/TacticalAI.h
index 5a54f69..80b4fda 100644
--- a/Stars45/TacticalAI.h
+++ b/Stars45/TacticalAI.h
@@ -111,5 +111,5 @@ protected:
// +--------------------------------------------------------------------+
-#endif TacticalAI_h
+#endif // TacticalAI_h
diff --git a/Stars45/TacticalView.h b/Stars45/TacticalView.h
index 2124737..8210fef 100644
--- a/Stars45/TacticalView.h
+++ b/Stars45/TacticalView.h
@@ -140,5 +140,5 @@ protected:
static TacticalView* tac_view;
};
-#endif TacticalView_h
+#endif // TacticalView_h
diff --git a/Stars45/Terrain.h b/Stars45/Terrain.h
index f591d80..2c69e3c 100644
--- a/Stars45/Terrain.h
+++ b/Stars45/Terrain.h
@@ -139,5 +139,5 @@ protected:
static int detail_level;
};
-#endif Terrain_h
+#endif // Terrain_h
diff --git a/Stars45/TerrainApron.h b/Stars45/TerrainApron.h
index 01739e7..7209ab5 100644
--- a/Stars45/TerrainApron.h
+++ b/Stars45/TerrainApron.h
@@ -91,5 +91,5 @@ protected:
};
-#endif TerrainApron_h
+#endif // TerrainApron_h
diff --git a/Stars45/TerrainClouds.h b/Stars45/TerrainClouds.h
index 6349c1f..e99a0ab 100644
--- a/Stars45/TerrainClouds.h
+++ b/Stars45/TerrainClouds.h
@@ -84,5 +84,5 @@ protected:
};
-#endif TerrainClouds_h
+#endif // TerrainClouds_h
diff --git a/Stars45/TerrainHaze.h b/Stars45/TerrainHaze.h
index ea30f9a..373baab 100644
--- a/Stars45/TerrainHaze.h
+++ b/Stars45/TerrainHaze.h
@@ -66,5 +66,5 @@ protected:
TerrainRegion* tregion;
};
-#endif TerrainHaze_h
+#endif // TerrainHaze_h
diff --git a/Stars45/TerrainLayer.h b/Stars45/TerrainLayer.h
index 8283d70..f3678ef 100644
--- a/Stars45/TerrainLayer.h
+++ b/Stars45/TerrainLayer.h
@@ -83,5 +83,5 @@ private:
};
-#endif TerrainLayer_h
+#endif // TerrainLayer_h
diff --git a/Stars45/TerrainPatch.cpp b/Stars45/TerrainPatch.cpp
index c9108f6..309d376 100644
--- a/Stars45/TerrainPatch.cpp
+++ b/Stars45/TerrainPatch.cpp
@@ -930,7 +930,8 @@ TerrainPatch::Render(Video* video, DWORD flags)
return;
if (water) {
- UpdateSurfaceWaves(Vec3(0,0,0));
+ Vec3 vec(0, 0, 0);
+ UpdateSurfaceWaves(vec);
Illuminate(scene->Ambient(), scene->Lights());
}
else {
diff --git a/Stars45/TerrainPatch.h b/Stars45/TerrainPatch.h
index a2d3797..51f4080 100644
--- a/Stars45/TerrainPatch.h
+++ b/Stars45/TerrainPatch.h
@@ -114,5 +114,5 @@ protected:
float max_height;
};
-#endif TerrainPatch_h
+#endif // TerrainPatch_h
diff --git a/Stars45/TerrainRegion.h b/Stars45/TerrainRegion.h
index 3edd8a0..98230ce 100644
--- a/Stars45/TerrainRegion.h
+++ b/Stars45/TerrainRegion.h
@@ -146,5 +146,5 @@ protected:
List<TerrainLayer> layers;
};
-#endif TerrainRegion_h
+#endif // TerrainRegion_h
diff --git a/Stars45/Thruster.h b/Stars45/Thruster.h
index 11184bd..c78a41d 100644
--- a/Stars45/Thruster.h
+++ b/Stars45/Thruster.h
@@ -117,5 +117,5 @@ protected:
List<ThrusterPort> ports;
};
-#endif Thruster_h
+#endif // Thruster_h
diff --git a/Stars45/TimeSnap.h b/Stars45/TimeSnap.h
deleted file mode 100644
index a8f77d2..0000000
--- a/Stars45/TimeSnap.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/* Starshatter OpenSource Distribution
- Copyright (c) 1997-2004, Destroyer Studios LLC.
- All Rights Reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
- * Neither the name "Destroyer Studios" nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
-
- SUBSYSTEM: nGen.lib
- FILE: TimeSnap.h
- AUTHOR: John DiCamillo
-
-*/
-
-#ifndef TimeSnap_h
-#define TimeSnap_h
-
-// +--------------------------------------------------------------------+
-
-#define TIMESNAP(clock) _asm push eax\
- _asm push edx\
- _asm _emit 0x0F\
- _asm _emit 0x31\
- _asm mov clock, eax\
- _asm pop edx\
- _asm pop eax
-
-// +--------------------------------------------------------------------+
-
-#endif TimeSnap_h \ No newline at end of file
diff --git a/Stars45/TrackIR.h b/Stars45/TrackIR.h
index 866068f..dbbb588 100644
--- a/Stars45/TrackIR.h
+++ b/Stars45/TrackIR.h
@@ -73,5 +73,5 @@ protected:
double z; // vpn (i think)
};
-#endif TrackIR_h
+#endif // TrackIR_h
diff --git a/Stars45/Trail.h b/Stars45/Trail.h
index d2eb260..dc22c42 100644
--- a/Stars45/Trail.h
+++ b/Stars45/Trail.h
@@ -80,5 +80,5 @@ protected:
double last_point_time;
};
-#endif Trail_h
+#endif // Trail_h
diff --git a/Stars45/Types.h b/Stars45/Types.h
index 5798536..cec7fae 100644
--- a/Stars45/Types.h
+++ b/Stars45/Types.h
@@ -86,5 +86,5 @@
// +--------------------------------------------------------------------+
-#endif Types_h
+#endif // Types_h
diff --git a/Stars45/Universe.h b/Stars45/Universe.h
index dae7c58..1c18743 100644
--- a/Stars45/Universe.h
+++ b/Stars45/Universe.h
@@ -52,5 +52,5 @@ public:
virtual void ExecFrame(double seconds) { }
};
-#endif Universe_h
+#endif // Universe_h
diff --git a/Stars45/VidDlg.h b/Stars45/VidDlg.h
index 2b22b52..006fec3 100644
--- a/Stars45/VidDlg.h
+++ b/Stars45/VidDlg.h
@@ -126,5 +126,5 @@ protected:
bool closed;
};
-#endif VidDlg_h
+#endif // VidDlg_h
diff --git a/Stars45/Video.h b/Stars45/Video.h
index db34bcc..e600a3f 100644
--- a/Stars45/Video.h
+++ b/Stars45/Video.h
@@ -262,5 +262,5 @@ protected:
// +--------------------------------------------------------------------+
-#endif Video_h
+#endif // Video_h
diff --git a/Stars45/VideoDX9.h b/Stars45/VideoDX9.h
index fdc37ff..0cabf13 100644
--- a/Stars45/VideoDX9.h
+++ b/Stars45/VideoDX9.h
@@ -215,5 +215,5 @@ private:
VideoDX9LineVertex* line_verts;
};
-#endif VideoDX9_h
+#endif // VideoDX9_h
diff --git a/Stars45/VideoDX9Enum.h b/Stars45/VideoDX9Enum.h
index 80c0b89..99e5c11 100644
--- a/Stars45/VideoDX9Enum.h
+++ b/Stars45/VideoDX9Enum.h
@@ -205,5 +205,5 @@ struct VideoDX9DeviceCombo
// +--------------------------------------------------------------------+
-#endif VideoDX9Enum_h
+#endif // VideoDX9Enum_h
diff --git a/Stars45/VideoDX9VertexBuffer.h b/Stars45/VideoDX9VertexBuffer.h
index 5684dbf..d13943d 100644
--- a/Stars45/VideoDX9VertexBuffer.h
+++ b/Stars45/VideoDX9VertexBuffer.h
@@ -99,5 +99,5 @@ private:
bool is_dynamic;
};
-#endif VideoDX9VertexBuffer_h
+#endif // VideoDX9VertexBuffer_h
diff --git a/Stars45/VideoFactory.h b/Stars45/VideoFactory.h
index a24b2e2..62c6fca 100644
--- a/Stars45/VideoFactory.h
+++ b/Stars45/VideoFactory.h
@@ -62,5 +62,5 @@ private:
SoundCard* audio;
};
-#endif VideoFactory_h
+#endif // VideoFactory_h
diff --git a/Stars45/VideoSettings.h b/Stars45/VideoSettings.h
index ad03222..a3f3a20 100644
--- a/Stars45/VideoSettings.h
+++ b/Stars45/VideoSettings.h
@@ -151,5 +151,5 @@ public:
float depth_bias;
};
-#endif VideoSettings_h
+#endif // VideoSettings_h
diff --git a/Stars45/View.h b/Stars45/View.h
index 3c1eb61..bfa6e63 100644
--- a/Stars45/View.h
+++ b/Stars45/View.h
@@ -72,5 +72,5 @@ protected:
Window* window;
};
-#endif View_h
+#endif // View_h
diff --git a/Stars45/Water.h b/Stars45/Water.h
index b4fe4db..9ad5cc1 100644
--- a/Stars45/Water.h
+++ b/Stars45/Water.h
@@ -74,5 +74,5 @@ protected:
// +--------------------------------------------------------------------+
-#endif Water_h
+#endif // Water_h
diff --git a/Stars45/Wave.h b/Stars45/Wave.h
index 058fc27..ae31e05 100644
--- a/Stars45/Wave.h
+++ b/Stars45/Wave.h
@@ -72,5 +72,5 @@ struct WAVE_DATA
// +--------------------------------------------------------------------+
-#endif Wave_h
+#endif // Wave_h
diff --git a/Stars45/Weapon.h b/Stars45/Weapon.h
index b20237a..468d655 100644
--- a/Stars45/Weapon.h
+++ b/Stars45/Weapon.h
@@ -224,5 +224,5 @@ protected:
Shot** beams;
};
-#endif Weapon_h
+#endif // Weapon_h
diff --git a/Stars45/WeaponDesign.h b/Stars45/WeaponDesign.h
index 2060728..d4a34f6 100644
--- a/Stars45/WeaponDesign.h
+++ b/Stars45/WeaponDesign.h
@@ -207,5 +207,5 @@ private:
static void LoadDesign(const char* path, const char* filename, bool mod=false);
};
-#endif WeaponDesign_h
+#endif // WeaponDesign_h
diff --git a/Stars45/WeaponGroup.h b/Stars45/WeaponGroup.h
index 37092d1..8b379d4 100644
--- a/Stars45/WeaponGroup.h
+++ b/Stars45/WeaponGroup.h
@@ -126,5 +126,5 @@ protected:
float resist;
};
-#endif WeaponGroup_h
+#endif // WeaponGroup_h
diff --git a/Stars45/Weather.h b/Stars45/Weather.h
index 882b451..36a253c 100644
--- a/Stars45/Weather.h
+++ b/Stars45/Weather.h
@@ -87,5 +87,5 @@ protected:
};
-#endif Weather_h
+#endif // Weather_h
diff --git a/Stars45/WebBrowser.h b/Stars45/WebBrowser.h
index 4248e06..43b3da6 100644
--- a/Stars45/WebBrowser.h
+++ b/Stars45/WebBrowser.h
@@ -65,6 +65,6 @@ protected:
// +--------------------------------------------------------------------+
-#endif WebBrowser_h
+#endif // WebBrowser_h
diff --git a/Stars45/WepView.h b/Stars45/WepView.h
index e21e933..c6e515d 100644
--- a/Stars45/WepView.h
+++ b/Stars45/WepView.h
@@ -108,5 +108,5 @@ protected:
static WepView* wep_view;
};
-#endif WepView_h
+#endif // WepView_h
diff --git a/Stars45/Window.h b/Stars45/Window.h
index 6688b44..04d07f3 100644
--- a/Stars45/Window.h
+++ b/Stars45/Window.h
@@ -124,5 +124,5 @@ protected:
List<View> view_list;
};
-#endif Window_h
+#endif // Window_h