summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAki <please@ignore.pl>2022-02-18 23:54:30 +0100
committerAki <please@ignore.pl>2022-02-18 23:54:30 +0100
commit0052edae47d1e6ae613497c524719eff5838f52a (patch)
tree3ba92a7846374ba274cba38d924e65f7c2ceb344
parent2ae135bbe43065978a4659278d18d9533d8a3b27 (diff)
downloadstarshatter-0052edae47d1e6ae613497c524719eff5838f52a.zip
starshatter-0052edae47d1e6ae613497c524719eff5838f52a.tar.gz
starshatter-0052edae47d1e6ae613497c524719eff5838f52a.tar.bz2
Switched to use GetIntance for Game instead of static methods
-rw-r--r--Stars45/Bitmap.cpp4
-rw-r--r--Stars45/Campaign.cpp26
-rw-r--r--Stars45/CampaignMissionFighter.cpp6
-rw-r--r--Stars45/CampaignMissionStarship.cpp6
-rw-r--r--Stars45/CarrierAI.cpp14
-rw-r--r--Stars45/CmdIntelDlg.cpp4
-rw-r--r--Stars45/CmdMissionsDlg.cpp8
-rw-r--r--Stars45/CmdOrdersDlg.cpp4
-rw-r--r--Stars45/CmpLoadDlg.cpp4
-rw-r--r--Stars45/CmpSceneDlg.cpp4
-rw-r--r--Stars45/CmpSelectDlg.cpp26
-rw-r--r--Stars45/CmpnScreen.cpp6
-rw-r--r--Stars45/CombatGroup.cpp122
-rw-r--r--Stars45/CombatUnit.cpp4
-rw-r--r--Stars45/Computer.cpp2
-rw-r--r--Stars45/Contact.cpp14
-rw-r--r--Stars45/CtlDlg.cpp4
-rw-r--r--Stars45/DebriefDlg.cpp12
-rw-r--r--Stars45/Debris.cpp2
-rw-r--r--Stars45/DetailSet.cpp2
-rw-r--r--Stars45/DisplayView.cpp2
-rw-r--r--Stars45/Drive.cpp18
-rw-r--r--Stars45/Drone.cpp2
-rw-r--r--Stars45/EngDlg.cpp26
-rw-r--r--Stars45/ExitDlg.cpp2
-rw-r--r--Stars45/FadeView.cpp4
-rw-r--r--Stars45/Farcaster.cpp4
-rw-r--r--Stars45/FighterAI.cpp64
-rw-r--r--Stars45/FighterTacticalAI.cpp18
-rw-r--r--Stars45/FlightDeck.cpp4
-rw-r--r--Stars45/FltDlg.cpp12
-rw-r--r--Stars45/FormDef.cpp10
-rw-r--r--Stars45/Game.cpp3
-rw-r--r--Stars45/GroundAI.cpp4
-rw-r--r--Stars45/HUDView.cpp130
-rw-r--r--Stars45/Hangar.cpp24
-rw-r--r--Stars45/Instruction.cpp64
-rw-r--r--Stars45/JoyDlg.cpp14
-rw-r--r--Stars45/Joystick.cpp4
-rw-r--r--Stars45/LandingGear.cpp4
-rw-r--r--Stars45/LoadDlg.cpp6
-rw-r--r--Stars45/LoadScreen.cpp2
-rw-r--r--Stars45/MCIWave.cpp2
-rw-r--r--Stars45/MapView.cpp102
-rw-r--r--Stars45/MenuScreen.cpp2
-rw-r--r--Stars45/MenuView.cpp4
-rw-r--r--Stars45/Mfd.cpp90
-rw-r--r--Stars45/Mission.cpp50
-rw-r--r--Stars45/ModConfig.cpp2
-rw-r--r--Stars45/ModDlg.cpp4
-rw-r--r--Stars45/MouseController.cpp8
-rw-r--r--Stars45/MsnDlg.cpp4
-rw-r--r--Stars45/MsnEditDlg.cpp10
-rw-r--r--Stars45/MsnElemDlg.cpp4
-rw-r--r--Stars45/MsnObjDlg.cpp8
-rw-r--r--Stars45/MsnPkgDlg.cpp4
-rw-r--r--Stars45/MsnSelectDlg.cpp22
-rw-r--r--Stars45/MusicTrack.cpp4
-rw-r--r--Stars45/NavAI.cpp12
-rw-r--r--Stars45/NavDlg.cpp86
-rw-r--r--Stars45/NavLight.cpp6
-rw-r--r--Stars45/NavSystem.cpp4
-rw-r--r--Stars45/NetClientDlg.cpp20
-rw-r--r--Stars45/NetGameClient.cpp26
-rw-r--r--Stars45/NetGameServer.cpp22
-rw-r--r--Stars45/NetLobbyServer.cpp6
-rw-r--r--Stars45/NetUnitDlg.cpp8
-rw-r--r--Stars45/Particles.cpp8
-rw-r--r--Stars45/PlanScreen.cpp2
-rw-r--r--Stars45/Player.cpp12
-rw-r--r--Stars45/PlayerDlg.cpp4
-rw-r--r--Stars45/Power.cpp6
-rw-r--r--Stars45/QuantumDrive.cpp4
-rw-r--r--Stars45/QuantumView.cpp4
-rw-r--r--Stars45/QuitView.cpp20
-rw-r--r--Stars45/RadioHandler.cpp14
-rw-r--r--Stars45/RadioTraffic.cpp2
-rw-r--r--Stars45/RadioView.cpp118
-rw-r--r--Stars45/SeekerAI.cpp2
-rw-r--r--Stars45/Sensor.cpp6
-rw-r--r--Stars45/Shield.cpp4
-rw-r--r--Stars45/Ship.cpp60
-rw-r--r--Stars45/ShipAI.cpp34
-rw-r--r--Stars45/ShipCtrl.cpp4
-rw-r--r--Stars45/ShipDesign.cpp2
-rw-r--r--Stars45/Shot.cpp4
-rw-r--r--Stars45/Sim.cpp26
-rw-r--r--Stars45/SimEvent.cpp44
-rw-r--r--Stars45/Sky.cpp2
-rw-r--r--Stars45/SoundD3D.cpp2
-rw-r--r--Stars45/Sprite.cpp4
-rw-r--r--Stars45/StarServer.cpp26
-rw-r--r--Stars45/StarSystem.cpp10
-rw-r--r--Stars45/Starshatter.cpp62
-rw-r--r--Stars45/StarshipAI.cpp40
-rw-r--r--Stars45/StarshipTacticalAI.cpp2
-rw-r--r--Stars45/SteerAI.cpp4
-rw-r--r--Stars45/System.cpp2
-rw-r--r--Stars45/TacRefDlg.cpp60
-rw-r--r--Stars45/TacticalAI.cpp4
-rw-r--r--Stars45/TacticalView.cpp168
-rw-r--r--Stars45/Terrain.cpp4
-rw-r--r--Stars45/Thruster.cpp6
-rw-r--r--Stars45/TrackIR.cpp2
-rw-r--r--Stars45/Trail.cpp2
-rw-r--r--Stars45/VidDlg.cpp14
-rw-r--r--Stars45/Weapon.cpp18
-rw-r--r--Stars45/WeaponDesign.cpp2
-rw-r--r--Stars45/Weather.cpp12
-rw-r--r--Stars45/WepView.cpp6
110 files changed, 1019 insertions, 1018 deletions
diff --git a/Stars45/Bitmap.cpp b/Stars45/Bitmap.cpp
index 5353521..33d8502 100644
--- a/Stars45/Bitmap.cpp
+++ b/Stars45/Bitmap.cpp
@@ -666,8 +666,8 @@ Bitmap::MakeTexture()
}
// check size and aspect ratio:
- int max_tex_size = Game::MaxTexSize();
- int max_tex_aspect = Game::MaxTexAspect();
+ int max_tex_size = Game::GetInstance()->MaxTexSize();
+ int max_tex_aspect = Game::GetInstance()->MaxTexAspect();
int best_width = FindBestTexSize(width, max_tex_size);
int best_height = FindBestTexSize(height, max_tex_size);
diff --git a/Stars45/Campaign.cpp b/Stars45/Campaign.cpp
index dd3f1af..ab65bbe 100644
--- a/Stars45/Campaign.cpp
+++ b/Stars45/Campaign.cpp
@@ -408,7 +408,7 @@ Campaign::Unload()
{
SetStatus(CAMPAIGN_INIT);
- Game::ResetGameTime();
+ Game::GetInstance()->ResetGameTime();
StarSystem::SetBaseTime(0);
startTime = Stardate();
@@ -459,7 +459,7 @@ Campaign::LoadCampaign(DataLoader* loader, bool full)
}
else {
name = def->term()->isText()->value();
- name = Game::GetText(name);
+ name = Game::GetInstance()->GetText(name);
}
}
else if (def->name()->value() == "desc") {
@@ -468,7 +468,7 @@ Campaign::LoadCampaign(DataLoader* loader, bool full)
}
else {
description = def->term()->isText()->value();
- description = Game::GetText(description);
+ description = Game::GetInstance()->GetText(description);
}
}
else if (def->name()->value() == "situation") {
@@ -477,7 +477,7 @@ Campaign::LoadCampaign(DataLoader* loader, bool full)
}
else {
situation = def->term()->isText()->value();
- situation = Game::GetText(situation);
+ situation = Game::GetInstance()->GetText(situation);
}
}
else if (def->name()->value() == "orders") {
@@ -486,7 +486,7 @@ Campaign::LoadCampaign(DataLoader* loader, bool full)
}
else {
orders = def->term()->isText()->value();
- orders = Game::GetText(orders);
+ orders = Game::GetInstance()->GetText(orders);
}
}
else if (def->name()->value() == "scripted") {
@@ -777,7 +777,7 @@ Campaign::ParseAction(TermStruct* val, const char* filename)
}
else if (pdef->name()->value() == "text") {
GetDefText(text, pdef, filename);
- text = Game::GetText(text);
+ text = Game::GetInstance()->GetText(text);
}
else if (pdef->name()->value() == "asset_id") {
GetDefNumber(asset_id, pdef, filename);
@@ -1022,13 +1022,13 @@ Campaign::LoadMissionList(DataLoader* loader)
else if (pdef->name()->value() == "name") {
GetDefText(name, pdef, filename);
- name = Game::GetText(name);
+ name = Game::GetInstance()->GetText(name);
}
else if (pdef->name()->value() == "desc") {
GetDefText(desc, pdef, filename);
if (desc.length() > 0 && desc.length() < 32)
- desc = Game::GetText(desc);
+ desc = Game::GetInstance()->GetText(desc);
}
else if (pdef->name()->value() == "start")
@@ -1137,7 +1137,7 @@ Campaign::LoadCustomMissions(DataLoader* loader)
if (def) {
if (def->name()->value() == "name") {
GetDefText(name, def, filename);
- name = Game::GetText(name);
+ name = Game::GetInstance()->GetText(name);
}
else if (def->name()->value() == "type") {
@@ -1152,7 +1152,7 @@ Campaign::LoadCustomMissions(DataLoader* loader)
else if (def->name()->value() == "desc") {
GetDefText(desc, def, filename);
if (desc.length() > 0 && desc.length() < 32)
- desc = Game::GetText(desc);
+ desc = Game::GetInstance()->GetText(desc);
}
else if (def->name()->value() == "system")
@@ -1941,7 +1941,7 @@ Campaign::ExecFrame()
else
time += 20 * 3600;
- StarSystem::SetBaseTime(startTime + time - Game::GameTime()/1000.0);
+ StarSystem::SetBaseTime(startTime + time - Game::GetInstance()->GameTime()/1000.0);
}
else {
m.reset();
@@ -2043,7 +2043,7 @@ Campaign::StartMission()
::Print("\n\nCampaign Start Mission - %d. '%s'\n", m->Identity(), m->Name());
if (!scripted) {
- long double gtime = (long double) Game::GameTime() / 1000.0;
+ long double gtime = (long double) Game::GetInstance()->GameTime() / 1000.0;
long double base = startTime + m->Start() - 15 - gtime;
StarSystem::SetBaseTime(base);
@@ -2070,7 +2070,7 @@ Campaign::RollbackMission()
if (m) {
if (!scripted) {
- long double gtime = (long double) Game::GameTime() / 1000.0;
+ long double gtime = (long double) Game::GetInstance()->GameTime() / 1000.0;
long double base = startTime + m->Start() - 60 - gtime;
StarSystem::SetBaseTime(base);
diff --git a/Stars45/CampaignMissionFighter.cpp b/Stars45/CampaignMissionFighter.cpp
index bd24077..8c90d5d 100644
--- a/Stars45/CampaignMissionFighter.cpp
+++ b/Stars45/CampaignMissionFighter.cpp
@@ -2108,13 +2108,13 @@ CampaignMissionFighter::DescribeMission()
if (mission_info && mission_info->name.length())
sprintf_s(name, "MSN-%03d %s", mission->Identity(), mission_info->name.data());
else if (ward)
- sprintf_s(name, "MSN-%03d %s %s", mission->Identity(), Game::GetText(mission->TypeName()).data(), ward->Name().data());
+ sprintf_s(name, "MSN-%03d %s %s", mission->Identity(), Game::GetInstance()->GetText(mission->TypeName()).data(), ward->Name().data());
else if (prime_target)
- sprintf_s(name, "MSN-%03d %s %s %s", mission->Identity(), Game::GetText(mission->TypeName()).data(),
+ sprintf_s(name, "MSN-%03d %s %s %s", mission->Identity(), Game::GetInstance()->GetText(mission->TypeName()).data(),
Ship::ClassName(prime_target->GetDesign()->type),
prime_target->Name().data());
else
- sprintf_s(name, "MSN-%03d %s", mission->Identity(), Game::GetText(mission->TypeName()).data());
+ sprintf_s(name, "MSN-%03d %s", mission->Identity(), Game::GetInstance()->GetText(mission->TypeName()).data());
if (player_elem) {
sprintf_s(player_info, "%d x %s %s '%s'",
diff --git a/Stars45/CampaignMissionStarship.cpp b/Stars45/CampaignMissionStarship.cpp
index 0a938cf..d222e37 100644
--- a/Stars45/CampaignMissionStarship.cpp
+++ b/Stars45/CampaignMissionStarship.cpp
@@ -1359,13 +1359,13 @@ CampaignMissionStarship::DescribeMission()
if (mission_info && mission_info->name.length())
sprintf_s(name, "MSN-%03d %s", mission->Identity(), mission_info->name.data());
else if (ward)
- sprintf_s(name, "MSN-%03d %s %s", mission->Identity(), Game::GetText(mission->TypeName()).data(), ward->Name().data());
+ sprintf_s(name, "MSN-%03d %s %s", mission->Identity(), Game::GetInstance()->GetText(mission->TypeName()).data(), ward->Name().data());
else if (prime_target)
- sprintf_s(name, "MSN-%03d %s %s %s", mission->Identity(), Game::GetText(mission->TypeName()).data(),
+ sprintf_s(name, "MSN-%03d %s %s %s", mission->Identity(), Game::GetInstance()->GetText(mission->TypeName()).data(),
Ship::ClassName(prime_target->GetDesign()->type),
prime_target->Name().data());
else
- sprintf_s(name, "MSN-%03d %s", mission->Identity(), Game::GetText(mission->TypeName()).data());
+ sprintf_s(name, "MSN-%03d %s", mission->Identity(), Game::GetInstance()->GetText(mission->TypeName()).data());
if (player) {
strcpy_s(player_info, player->GetCombatGroup()->GetDescription());
diff --git a/Stars45/CarrierAI.cpp b/Stars45/CarrierAI.cpp
index 4f7e1b7..d7194a4 100644
--- a/Stars45/CarrierAI.cpp
+++ b/Stars45/CarrierAI.cpp
@@ -49,7 +49,7 @@ CarrierAI::CarrierAI(Ship* s, int level)
if (ship)
flight_planner = new(__FILE__,__LINE__) FlightPlanner(ship);
- hold_time = (int) Game::GameTime();
+ hold_time = (int) Game::GetInstance()->GameTime();
}
}
@@ -69,13 +69,13 @@ CarrierAI::ExecFrame(double secs)
if (!sim || !ship || !hangar)
return;
- if (((int) Game::GameTime() - hold_time >= INIT_HOLD) &&
- ((int) Game::GameTime() - exec_time > EXEC_PERIOD)) {
+ if (((int) Game::GetInstance()->GameTime() - hold_time >= INIT_HOLD) &&
+ ((int) Game::GetInstance()->GameTime() - exec_time > EXEC_PERIOD)) {
CheckHostileElements();
CheckPatrolCoverage();
- exec_time = (int) Game::GameTime();
+ exec_time = (int) Game::GetInstance()->GameTime();
}
}
@@ -132,7 +132,7 @@ CarrierAI::CheckPatrolCoverage()
}
}
- else if (Game::GameTime() - hangar->GetLastPatrolLaunch() > PATROL_PERIOD ||
+ else if (Game::GetInstance()->GameTime() - hangar->GetLastPatrolLaunch() > PATROL_PERIOD ||
hangar->GetLastPatrolLaunch() == 0) {
Element* patrol = CreatePackage(0, 2, Mission::PATROL, 0, "ACM Medium Range");
if (patrol) {
@@ -141,7 +141,7 @@ CarrierAI::CheckPatrolCoverage()
if (flight_planner)
flight_planner->CreatePatrolRoute(patrol, i);
- hangar->SetLastPatrolLaunch(Game::GameTime());
+ hangar->SetLastPatrolLaunch(Game::GetInstance()->GameTime());
return true;
}
}
@@ -194,7 +194,7 @@ CarrierAI::CheckHostileElements()
// nobody is assigned yet, create an attack package
if (!found && CreateStrike(elem)) {
- hold_time = (int) Game::GameTime() + 30000;
+ hold_time = (int) Game::GetInstance()->GameTime() + 30000;
return true;
}
}
diff --git a/Stars45/CmdIntelDlg.cpp b/Stars45/CmdIntelDlg.cpp
index e7e4fee..5dfceac 100644
--- a/Stars45/CmdIntelDlg.cpp
+++ b/Stars45/CmdIntelDlg.cpp
@@ -168,7 +168,7 @@ CmdIntelDlg::ExecFrame()
lst_news->SetItemText(i, 1, dateline);
lst_news->SetItemText(i, 2, info->Title());
lst_news->SetItemText(i, 3, info->Region());
- lst_news->SetItemText(i, 4, Game::GetText(info->SourceName()));
+ lst_news->SetItemText(i, 4, Game::GetInstance()->GetText(info->SourceName()));
if (!info->Visited())
auto_scroll = true;
@@ -192,7 +192,7 @@ CmdIntelDlg::ExecFrame()
lst_news->SetItemText(j, 1, dateline);
lst_news->SetItemText(j, 2, info->Title());
lst_news->SetItemText(j, 3, info->Region());
- lst_news->SetItemText(j, 4, Game::GetText(info->SourceName()));
+ lst_news->SetItemText(j, 4, Game::GetInstance()->GetText(info->SourceName()));
if (!info->Visited())
auto_scroll = true;
diff --git a/Stars45/CmdMissionsDlg.cpp b/Stars45/CmdMissionsDlg.cpp
index 5f194ee..e378c3d 100644
--- a/Stars45/CmdMissionsDlg.cpp
+++ b/Stars45/CmdMissionsDlg.cpp
@@ -120,7 +120,7 @@ CmdMissionsDlg::Show()
Mission* m = info->mission;
if (m) {
if (m->Type() == Mission::TRAINING && player->HasTrained(m->Identity())) {
- lst_missions->SetItemText(i, 1, Game::GetText("CmdMissionsDlg.training"));
+ lst_missions->SetItemText(i, 1, Game::GetInstance()->GetText("CmdMissionsDlg.training"));
}
else {
lst_missions->SetItemText(i, 1, m->TypeName());
@@ -152,7 +152,7 @@ CmdMissionsDlg::ExecFrame()
Mission* m = info->mission;
if (m) {
if (m->Type() == Mission::TRAINING && player->HasTrained(m->Identity())) {
- lst_missions->SetItemText(i, 1, Game::GetText("CmdMissionsDlg.training"));
+ lst_missions->SetItemText(i, 1, Game::GetInstance()->GetText("CmdMissionsDlg.training"));
}
else {
lst_missions->SetItemText(i, 1, m->TypeName());
@@ -175,7 +175,7 @@ CmdMissionsDlg::ExecFrame()
Mission* m = info->mission;
if (m) {
if (m->Type() == Mission::TRAINING && player->HasTrained(m->Identity())) {
- lst_missions->SetItemText(i, 1, Game::GetText("CmdMissionsDlg.training"));
+ lst_missions->SetItemText(i, 1, Game::GetInstance()->GetText("CmdMissionsDlg.training"));
}
else {
lst_missions->SetItemText(i, 1, m->TypeName());
@@ -213,7 +213,7 @@ CmdMissionsDlg::ExecFrame()
Mission* m = info->mission;
if (m) {
if (m->Type() == Mission::TRAINING && player->HasTrained(m->Identity())) {
- lst_missions->SetItemText(i, 1, Game::GetText("CmdMissionsDlg.training"));
+ lst_missions->SetItemText(i, 1, Game::GetInstance()->GetText("CmdMissionsDlg.training"));
}
else {
lst_missions->SetItemText(i, 1, m->TypeName());
diff --git a/Stars45/CmdOrdersDlg.cpp b/Stars45/CmdOrdersDlg.cpp
index 7abe56b..835aea7 100644
--- a/Stars45/CmdOrdersDlg.cpp
+++ b/Stars45/CmdOrdersDlg.cpp
@@ -92,7 +92,7 @@ CmdOrdersDlg::Show()
if (campaign && lbl_orders) {
Text orders("<font Limerick12><color ffff80>");
- orders += Game::GetText("CmdOrdersDlg.situation");
+ orders += Game::GetInstance()->GetText("CmdOrdersDlg.situation");
orders += "\n<font Verdana><color ffffff>";
if (*campaign->Situation())
orders += campaign->Situation();
@@ -100,7 +100,7 @@ CmdOrdersDlg::Show()
orders += campaign->Description();
orders += "\n\n<font Limerick12><color ffff80>";
- orders += Game::GetText("CmdOrdersDlg.orders");
+ orders += Game::GetInstance()->GetText("CmdOrdersDlg.orders");
orders += "\n<font Verdana><color ffffff>";
orders += campaign->Orders();
diff --git a/Stars45/CmpLoadDlg.cpp b/Stars45/CmpLoadDlg.cpp
index ebd5924..29ba421 100644
--- a/Stars45/CmpLoadDlg.cpp
+++ b/Stars45/CmpLoadDlg.cpp
@@ -68,7 +68,7 @@ CmpLoadDlg::Show()
lbl_title->SetText(campaign->Name());
}
- show_time = Game::RealTime();
+ show_time = Game::GetInstance()->RealTime();
}
// +--------------------------------------------------------------------+
@@ -110,7 +110,7 @@ CmpLoadDlg::MoveTo(const Rect& r)
bool
CmpLoadDlg::IsDone()
{
- if (Game::RealTime() - show_time < 5000)
+ if (Game::GetInstance()->RealTime() - show_time < 5000)
return false;
return true;
diff --git a/Stars45/CmpSceneDlg.cpp b/Stars45/CmpSceneDlg.cpp
index df97396..96c317e 100644
--- a/Stars45/CmpSceneDlg.cpp
+++ b/Stars45/CmpSceneDlg.cpp
@@ -163,7 +163,7 @@ CmpSceneDlg::ExecFrame()
if (begin_scene && end_scene) {
double total_time = end_scene->Time() - begin_scene->Time();
subtitles_delay = total_time / nlines;
- subtitles_time = Game::RealTime() / 1000.0 + subtitles_delay;
+ subtitles_time = Game::GetInstance()->RealTime() / 1000.0 + subtitles_delay;
}
else {
subtitles_delay = -1;
@@ -171,7 +171,7 @@ CmpSceneDlg::ExecFrame()
}
if (subtitles_delay > 0) {
- double seconds = Game::RealTime() / 1000.0;
+ double seconds = Game::GetInstance()->RealTime() / 1000.0;
if (subtitles_time <= seconds) {
subtitles_time = seconds + subtitles_delay;
diff --git a/Stars45/CmpSelectDlg.cpp b/Stars45/CmpSelectDlg.cpp
index 9f24c02..47ce573 100644
--- a/Stars45/CmpSelectDlg.cpp
+++ b/Stars45/CmpSelectDlg.cpp
@@ -54,7 +54,7 @@ selected_mission(-1), show_saved(false), loading(false),
loaded(false), hproc(0)
{
stars = Starshatter::GetInstance();
- select_msg = Game::GetText("CmpSelectDlg.select_msg");
+ select_msg = Game::GetInstance()->GetText("CmpSelectDlg.select_msg");
Init(def);
}
@@ -139,7 +139,7 @@ CmpSelectDlg::ExecFrame()
campaign->Name() +
Text("<font Verdana>\n\n") +
Text("<color ffff80>") +
- Game::GetText("CmpSelectDlg.scenario") +
+ Game::GetInstance()->GetText("CmpSelectDlg.scenario") +
Text("<color ffffff>\n\t") +
campaign->Description());
}
@@ -156,15 +156,15 @@ CmpSelectDlg::ExecFrame()
campaign->Name() +
Text("<font Verdana>\n\n") +
Text("<color ffff80>") +
- Game::GetText("CmpSelectDlg.scenario") +
+ Game::GetInstance()->GetText("CmpSelectDlg.scenario") +
Text("<color ffffff>\n\t") +
campaign->Description() +
Text("\n\n<color ffff80>") +
- Game::GetText("CmpSelectDlg.campaign-time") +
+ Game::GetInstance()->GetText("CmpSelectDlg.campaign-time") +
Text("<color ffffff>\n\t") +
time_buf +
Text("\n\n<color ffff80>") +
- Game::GetText("CmpSelectDlg.assignment") +
+ Game::GetInstance()->GetText("CmpSelectDlg.assignment") +
Text("<color ffffff>\n\t");
if (campaign->GetPlayerGroup())
@@ -173,7 +173,7 @@ CmpSelectDlg::ExecFrame()
desc += "n/a";
desc += Text("\n\n<color ffff80>") +
- Game::GetText("CmpSelectDlg.team-score") +
+ Game::GetInstance()->GetText("CmpSelectDlg.team-score") +
Text("<color ffffff>\n\t") +
score_buf;
@@ -208,7 +208,7 @@ CmpSelectDlg::ShowNewCampaigns()
AutoThreadSync a(sync);
if (loading && description) {
- description->SetText(Game::GetText("CmpSelectDlg.already-loading"));
+ description->SetText(Game::GetInstance()->GetText("CmpSelectDlg.already-loading"));
Button::PlaySound(Button::SND_REJECT);
return;
}
@@ -285,7 +285,7 @@ CmpSelectDlg::ShowSavedCampaigns()
AutoThreadSync a(sync);
if (loading && description) {
- description->SetText(Game::GetText("CmpSelectDlg.already-loading"));
+ description->SetText(Game::GetInstance()->GetText("CmpSelectDlg.already-loading"));
Button::PlaySound(Button::SND_REJECT);
return;
}
@@ -334,7 +334,7 @@ CmpSelectDlg::OnCampaignSelect(AWEvent* event)
AutoThreadSync a(sync);
if (loading) {
- description->SetText(Game::GetText("CmpSelectDlg.already-loading"));
+ description->SetText(Game::GetInstance()->GetText("CmpSelectDlg.already-loading"));
Button::PlaySound(Button::SND_REJECT);
return;
}
@@ -455,9 +455,9 @@ CmpSelectDlg::OnDelete(AWEvent* event)
ConfirmDlg* confirm = manager->GetConfirmDlg();
if (confirm) {
char msg[256];
- sprintf_s(msg, Game::GetText("CmpSelectDlg.are-you-sure"), load_file.data());
+ sprintf_s(msg, Game::GetInstance()->GetText("CmpSelectDlg.are-you-sure"), load_file.data());
confirm->SetMessage(msg);
- confirm->SetTitle(Game::GetText("CmpSelectDlg.confirm"));
+ confirm->SetTitle(Game::GetInstance()->GetText("CmpSelectDlg.confirm"));
manager->ShowConfirmDlg();
}
@@ -495,7 +495,7 @@ CmpSelectDlg::OnAccept(AWEvent* event)
if (btn_new->GetButtonState())
Campaign::GetCampaign()->Load();
else
- Game::ResetGameTime();
+ Game::GetInstance()->ResetGameTime();
Mouse::Show(false);
stars->SetGameMode(Starshatter::CLOD_MODE);
@@ -533,7 +533,7 @@ CmpSelectDlg::StartLoadProc()
loaded = false;
if (description)
- description->SetText(Game::GetText("CmpSelectDlg.loading"));
+ description->SetText(Game::GetInstance()->GetText("CmpSelectDlg.loading"));
DWORD thread_id = 0;
hproc = CreateThread(0, 4096, CmpSelectDlgLoadProc, (LPVOID) this, 0, &thread_id);
diff --git a/Stars45/CmpnScreen.cpp b/Stars45/CmpnScreen.cpp
index a5bdfad..9d33499 100644
--- a/Stars45/CmpnScreen.cpp
+++ b/Stars45/CmpnScreen.cpp
@@ -177,7 +177,7 @@ CmpnScreen::GetFieldOfView() const
void
CmpnScreen::ExecFrame()
{
- Game::SetScreenColor(Color::Black);
+ Game::GetInstance()->SetScreenColor(Color::Black);
if (cmd_orders_dlg && cmd_orders_dlg->IsShown()) {
cmd_orders_dlg->ExecFrame();
@@ -233,8 +233,8 @@ CmpnScreen::ExecFrame()
if (player->Trained() >= all_missions && player->Trained() < 255) {
player->SetTrained(255);
- cmd_msg_dlg->Title()->SetText(Game::GetText("CmpnScreen.training"));
- sprintf_s(msg_info, Game::GetText("CmpnScreen.congrats"),
+ cmd_msg_dlg->Title()->SetText(Game::GetInstance()->GetText("CmpnScreen.training"));
+ sprintf_s(msg_info, Game::GetInstance()->GetText("CmpnScreen.congrats"),
Player::RankName(player->Rank()),
player->Name().data());
diff --git a/Stars45/CombatGroup.cpp b/Stars45/CombatGroup.cpp
index 3b83a0f..767c6a7 100644
--- a/Stars45/CombatGroup.cpp
+++ b/Stars45/CombatGroup.cpp
@@ -440,7 +440,7 @@ CombatGroup::GetOrdinal() const
if (last_two_digits > 10 && last_two_digits < 20) {
sprintf_s(ordinal, "ordinal.%d", last_two_digits);
- Text suffix = Game::GetText(ordinal);
+ Text suffix = Game::GetInstance()->GetText(ordinal);
if (suffix != ordinal)
sprintf_s(ordinal, "%d%s", id, suffix.data());
@@ -450,7 +450,7 @@ CombatGroup::GetOrdinal() const
else {
int last_digit = last_two_digits % 10;
sprintf_s(ordinal, "ordinal.%d", last_digit);
- Text suffix = Game::GetText(ordinal);
+ Text suffix = Game::GetInstance()->GetText(ordinal);
if (suffix != ordinal)
sprintf_s(ordinal, "%d%s", id, suffix.data());
else if (last_digit == 1)
@@ -480,35 +480,35 @@ CombatGroup::GetDescription() const
switch (type) {
case FORCE: strcpy_s(desc, (const char*) name); break;
- case FLEET: sprintf_s(desc, "%s %s%s", GetOrdinal(), Game::GetText("CombatGroup.FLEET").data(), name_desc); break;
- case CARRIER_GROUP: sprintf_s(desc, "%s %s%s", GetOrdinal(), Game::GetText("CombatGroup.CARRIER_GROUP").data(), name_desc); break;
- case BATTLE_GROUP: sprintf_s(desc, "%s %s%s", GetOrdinal(), Game::GetText("CombatGroup.BATTLE_GROUP").data(), name_desc); break;
- case DESTROYER_SQUADRON: sprintf_s(desc, "%s %s%s", GetOrdinal(), Game::GetText("CombatGroup.DESTROYER_SQUADRON").data(), name_desc); break;
-
- case WING: sprintf_s(desc, "%s %s%s", GetOrdinal(), Game::GetText("CombatGroup.WING").data(), name_desc); break;
- case ATTACK_SQUADRON: sprintf_s(desc, "%s %s%s", GetOrdinal(), Game::GetText("CombatGroup.ATTACK_SQUADRON").data(), name_desc); break;
- case FIGHTER_SQUADRON: sprintf_s(desc, "%s %s%s", GetOrdinal(), Game::GetText("CombatGroup.FIGHTER_SQUADRON").data(), name_desc); break;
- case INTERCEPT_SQUADRON: sprintf_s(desc, "%s %s%s", GetOrdinal(), Game::GetText("CombatGroup.INTERCEPT_SQUADRON").data(), name_desc); break;
- case LCA_SQUADRON: sprintf_s(desc, "%s %s%s", GetOrdinal(), Game::GetText("CombatGroup.LCA_SQUADRON").data(), name_desc); break;
-
- case BATTALION: sprintf_s(desc, "%s %s%s", GetOrdinal(), Game::GetText("CombatGroup.BATTALION").data(), name_desc); break;
- case STATION: sprintf_s(desc, "%s %s", Game::GetText("CombatGroup.STATION").data(), name.data()); break;
- case STARBASE: sprintf_s(desc, "%s %d%s", Game::GetText("CombatGroup.STARBASE").data(), id, name_desc); break;
- case MINEFIELD: sprintf_s(desc, "%s %s%s", GetOrdinal(), Game::GetText("CombatGroup.MINEFIELD").data(), name_desc); break;
- case BATTERY: sprintf_s(desc, "%s %s%s", GetOrdinal(), Game::GetText("CombatGroup.BATTERY").data(), name_desc); break;
- case MISSILE: sprintf_s(desc, "%s %s%s", GetOrdinal(), Game::GetText("CombatGroup.MISSILE").data(), name_desc); break;
-
- case C3I: sprintf_s(desc, "%s %s%s", GetOrdinal(), Game::GetText("CombatGroup.C3I").data(), name_desc); break;
- case COMM_RELAY: sprintf_s(desc, "%s %s%s", GetOrdinal(), Game::GetText("CombatGroup.COMM_RELAY").data(), name_desc); break;
- case EARLY_WARNING: sprintf_s(desc, "%s %s%s", GetOrdinal(), Game::GetText("CombatGroup.EARLY_WARNING").data(), name_desc); break;
- case FWD_CONTROL_CTR: sprintf_s(desc, "%s %s%s", GetOrdinal(), Game::GetText("CombatGroup.FWD_CONTROL_CTR").data(), name_desc); break;
- case ECM: sprintf_s(desc, "%s %s%s", GetOrdinal(), Game::GetText("CombatGroup.ECM").data(), name_desc); break;
-
- case SUPPORT: sprintf_s(desc, "%s %s%s", GetOrdinal(), Game::GetText("CombatGroup.SUPPORT").data(), name_desc); break;
- case COURIER: sprintf_s(desc, "%s %s%s", GetOrdinal(), Game::GetText("CombatGroup.COURIER").data(), name_desc); break;
- case SUPPLY: sprintf_s(desc, "%s %s%s", GetOrdinal(), Game::GetText("CombatGroup.SUPPLY").data(), name_desc); break;
- case REPAIR: sprintf_s(desc, "%s %s%s", GetOrdinal(), Game::GetText("CombatGroup.REPAIR").data(), name_desc); break;
- case MEDICAL: sprintf_s(desc, "%s %s%s", GetOrdinal(), Game::GetText("CombatGroup.MEDICAL").data(), name_desc); break;
+ case FLEET: sprintf_s(desc, "%s %s%s", GetOrdinal(), Game::GetInstance()->GetText("CombatGroup.FLEET").data(), name_desc); break;
+ case CARRIER_GROUP: sprintf_s(desc, "%s %s%s", GetOrdinal(), Game::GetInstance()->GetText("CombatGroup.CARRIER_GROUP").data(), name_desc); break;
+ case BATTLE_GROUP: sprintf_s(desc, "%s %s%s", GetOrdinal(), Game::GetInstance()->GetText("CombatGroup.BATTLE_GROUP").data(), name_desc); break;
+ case DESTROYER_SQUADRON: sprintf_s(desc, "%s %s%s", GetOrdinal(), Game::GetInstance()->GetText("CombatGroup.DESTROYER_SQUADRON").data(), name_desc); break;
+
+ case WING: sprintf_s(desc, "%s %s%s", GetOrdinal(), Game::GetInstance()->GetText("CombatGroup.WING").data(), name_desc); break;
+ case ATTACK_SQUADRON: sprintf_s(desc, "%s %s%s", GetOrdinal(), Game::GetInstance()->GetText("CombatGroup.ATTACK_SQUADRON").data(), name_desc); break;
+ case FIGHTER_SQUADRON: sprintf_s(desc, "%s %s%s", GetOrdinal(), Game::GetInstance()->GetText("CombatGroup.FIGHTER_SQUADRON").data(), name_desc); break;
+ case INTERCEPT_SQUADRON: sprintf_s(desc, "%s %s%s", GetOrdinal(), Game::GetInstance()->GetText("CombatGroup.INTERCEPT_SQUADRON").data(), name_desc); break;
+ case LCA_SQUADRON: sprintf_s(desc, "%s %s%s", GetOrdinal(), Game::GetInstance()->GetText("CombatGroup.LCA_SQUADRON").data(), name_desc); break;
+
+ case BATTALION: sprintf_s(desc, "%s %s%s", GetOrdinal(), Game::GetInstance()->GetText("CombatGroup.BATTALION").data(), name_desc); break;
+ case STATION: sprintf_s(desc, "%s %s", Game::GetInstance()->GetText("CombatGroup.STATION").data(), name.data()); break;
+ case STARBASE: sprintf_s(desc, "%s %d%s", Game::GetInstance()->GetText("CombatGroup.STARBASE").data(), id, name_desc); break;
+ case MINEFIELD: sprintf_s(desc, "%s %s%s", GetOrdinal(), Game::GetInstance()->GetText("CombatGroup.MINEFIELD").data(), name_desc); break;
+ case BATTERY: sprintf_s(desc, "%s %s%s", GetOrdinal(), Game::GetInstance()->GetText("CombatGroup.BATTERY").data(), name_desc); break;
+ case MISSILE: sprintf_s(desc, "%s %s%s", GetOrdinal(), Game::GetInstance()->GetText("CombatGroup.MISSILE").data(), name_desc); break;
+
+ case C3I: sprintf_s(desc, "%s %s%s", GetOrdinal(), Game::GetInstance()->GetText("CombatGroup.C3I").data(), name_desc); break;
+ case COMM_RELAY: sprintf_s(desc, "%s %s%s", GetOrdinal(), Game::GetInstance()->GetText("CombatGroup.COMM_RELAY").data(), name_desc); break;
+ case EARLY_WARNING: sprintf_s(desc, "%s %s%s", GetOrdinal(), Game::GetInstance()->GetText("CombatGroup.EARLY_WARNING").data(), name_desc); break;
+ case FWD_CONTROL_CTR: sprintf_s(desc, "%s %s%s", GetOrdinal(), Game::GetInstance()->GetText("CombatGroup.FWD_CONTROL_CTR").data(), name_desc); break;
+ case ECM: sprintf_s(desc, "%s %s%s", GetOrdinal(), Game::GetInstance()->GetText("CombatGroup.ECM").data(), name_desc); break;
+
+ case SUPPORT: sprintf_s(desc, "%s %s%s", GetOrdinal(), Game::GetInstance()->GetText("CombatGroup.SUPPORT").data(), name_desc); break;
+ case COURIER: sprintf_s(desc, "%s %s%s", GetOrdinal(), Game::GetInstance()->GetText("CombatGroup.COURIER").data(), name_desc); break;
+ case SUPPLY: sprintf_s(desc, "%s %s%s", GetOrdinal(), Game::GetInstance()->GetText("CombatGroup.SUPPLY").data(), name_desc); break;
+ case REPAIR: sprintf_s(desc, "%s %s%s", GetOrdinal(), Game::GetInstance()->GetText("CombatGroup.REPAIR").data(), name_desc); break;
+ case MEDICAL: sprintf_s(desc, "%s %s%s", GetOrdinal(), Game::GetInstance()->GetText("CombatGroup.MEDICAL").data(), name_desc); break;
case CIVILIAN:
case WAR_PRODUCTION:
@@ -525,7 +525,7 @@ CombatGroup::GetDescription() const
case PASSENGER:
case PRIVATE: strcpy_s(desc, (const char*) name); break;
- default: sprintf_s(desc, "%s%s", Game::GetText("CombatGroup.default").data(), name_desc); break;
+ default: sprintf_s(desc, "%s%s", Game::GetInstance()->GetText("CombatGroup.default").data(), name_desc); break;
}
return desc;
@@ -539,34 +539,34 @@ CombatGroup::GetShortDescription() const
switch (type) {
case FORCE: strcpy_s(desc, (const char*) name); break;
- case FLEET: sprintf_s(desc, "%s %s", GetOrdinal(), Game::GetText("CombatGroup.abrv.FLEET").data()); break;
- case CARRIER_GROUP: sprintf_s(desc, "%s %s", GetOrdinal(), Game::GetText("CombatGroup.abrv.CARRIER_GROUP").data()); break;
- case BATTLE_GROUP: sprintf_s(desc, "%s %s", GetOrdinal(), Game::GetText("CombatGroup.abrv.BATTLE_GROUP").data()); break;
- case DESTROYER_SQUADRON: sprintf_s(desc, "%s %s", GetOrdinal(), Game::GetText("CombatGroup.abrv.DESTROYER_SQUADRON").data()); break;
-
- case WING: sprintf_s(desc, "%s %s", GetOrdinal(), Game::GetText("CombatGroup.abrv.WING").data()); break;
- case ATTACK_SQUADRON: sprintf_s(desc, "%s %s", GetOrdinal(), Game::GetText("CombatGroup.abrv.ATTACK_SQUADRON").data()); break;
- case FIGHTER_SQUADRON: sprintf_s(desc, "%s %s", GetOrdinal(), Game::GetText("CombatGroup.abrv.FIGHTER_SQUADRON").data()); break;
- case INTERCEPT_SQUADRON: sprintf_s(desc, "%s %s", GetOrdinal(), Game::GetText("CombatGroup.abrv.INTERCEPT_SQUADRON").data()); break;
- case LCA_SQUADRON: sprintf_s(desc, "%s %s", GetOrdinal(), Game::GetText("CombatGroup.abrv.LCA_SQUADRON").data()); break;
-
- case BATTALION: sprintf_s(desc, "%s %s", GetOrdinal(), Game::GetText("CombatGroup.abrv.BATTALION").data()); break;
- case STATION: sprintf_s(desc, "%s %s", GetOrdinal(), Game::GetText("CombatGroup.abrv.STATION").data()); break;
- case STARBASE: sprintf_s(desc, "%s %s", GetOrdinal(), Game::GetText("CombatGroup.abrv.STARBASE").data()); break;
- case MINEFIELD: sprintf_s(desc, "%s %s", GetOrdinal(), Game::GetText("CombatGroup.abrv.MINEFIELD").data()); break;
- case BATTERY: sprintf_s(desc, "%s %s", GetOrdinal(), Game::GetText("CombatGroup.abrv.BATTERY").data()); break;
-
- case C3I: sprintf_s(desc, "%s %s", GetOrdinal(), Game::GetText("CombatGroup.abrv.C3I").data()); break;
- case COMM_RELAY: sprintf_s(desc, "%s %s", GetOrdinal(), Game::GetText("CombatGroup.abrv.COMM_RELAY").data()); break;
- case EARLY_WARNING: sprintf_s(desc, "%s %s", GetOrdinal(), Game::GetText("CombatGroup.abrv.EARLY_WARNING").data()); break;
- case FWD_CONTROL_CTR: sprintf_s(desc, "%s %s", GetOrdinal(), Game::GetText("CombatGroup.abrv.FWD_CONTROL_CTR").data()); break;
- case ECM: sprintf_s(desc, "%s %s", GetOrdinal(), Game::GetText("CombatGroup.abrv.ECM").data()); break;
-
- case SUPPORT: sprintf_s(desc, "%s %s", GetOrdinal(), Game::GetText("CombatGroup.abrv.SUPPORT").data()); break;
- case COURIER: sprintf_s(desc, "%s %s", GetOrdinal(), Game::GetText("CombatGroup.abrv.COURIER").data()); break;
- case MEDICAL: sprintf_s(desc, "%s %s", GetOrdinal(), Game::GetText("CombatGroup.abrv.MEDICAL").data()); break;
- case SUPPLY: sprintf_s(desc, "%s %s", GetOrdinal(), Game::GetText("CombatGroup.abrv.SUPPLY").data()); break;
- case REPAIR: sprintf_s(desc, "%s %s", GetOrdinal(), Game::GetText("CombatGroup.abrv.REPAIR").data()); break;
+ case FLEET: sprintf_s(desc, "%s %s", GetOrdinal(), Game::GetInstance()->GetText("CombatGroup.abrv.FLEET").data()); break;
+ case CARRIER_GROUP: sprintf_s(desc, "%s %s", GetOrdinal(), Game::GetInstance()->GetText("CombatGroup.abrv.CARRIER_GROUP").data()); break;
+ case BATTLE_GROUP: sprintf_s(desc, "%s %s", GetOrdinal(), Game::GetInstance()->GetText("CombatGroup.abrv.BATTLE_GROUP").data()); break;
+ case DESTROYER_SQUADRON: sprintf_s(desc, "%s %s", GetOrdinal(), Game::GetInstance()->GetText("CombatGroup.abrv.DESTROYER_SQUADRON").data()); break;
+
+ case WING: sprintf_s(desc, "%s %s", GetOrdinal(), Game::GetInstance()->GetText("CombatGroup.abrv.WING").data()); break;
+ case ATTACK_SQUADRON: sprintf_s(desc, "%s %s", GetOrdinal(), Game::GetInstance()->GetText("CombatGroup.abrv.ATTACK_SQUADRON").data()); break;
+ case FIGHTER_SQUADRON: sprintf_s(desc, "%s %s", GetOrdinal(), Game::GetInstance()->GetText("CombatGroup.abrv.FIGHTER_SQUADRON").data()); break;
+ case INTERCEPT_SQUADRON: sprintf_s(desc, "%s %s", GetOrdinal(), Game::GetInstance()->GetText("CombatGroup.abrv.INTERCEPT_SQUADRON").data()); break;
+ case LCA_SQUADRON: sprintf_s(desc, "%s %s", GetOrdinal(), Game::GetInstance()->GetText("CombatGroup.abrv.LCA_SQUADRON").data()); break;
+
+ case BATTALION: sprintf_s(desc, "%s %s", GetOrdinal(), Game::GetInstance()->GetText("CombatGroup.abrv.BATTALION").data()); break;
+ case STATION: sprintf_s(desc, "%s %s", GetOrdinal(), Game::GetInstance()->GetText("CombatGroup.abrv.STATION").data()); break;
+ case STARBASE: sprintf_s(desc, "%s %s", GetOrdinal(), Game::GetInstance()->GetText("CombatGroup.abrv.STARBASE").data()); break;
+ case MINEFIELD: sprintf_s(desc, "%s %s", GetOrdinal(), Game::GetInstance()->GetText("CombatGroup.abrv.MINEFIELD").data()); break;
+ case BATTERY: sprintf_s(desc, "%s %s", GetOrdinal(), Game::GetInstance()->GetText("CombatGroup.abrv.BATTERY").data()); break;
+
+ case C3I: sprintf_s(desc, "%s %s", GetOrdinal(), Game::GetInstance()->GetText("CombatGroup.abrv.C3I").data()); break;
+ case COMM_RELAY: sprintf_s(desc, "%s %s", GetOrdinal(), Game::GetInstance()->GetText("CombatGroup.abrv.COMM_RELAY").data()); break;
+ case EARLY_WARNING: sprintf_s(desc, "%s %s", GetOrdinal(), Game::GetInstance()->GetText("CombatGroup.abrv.EARLY_WARNING").data()); break;
+ case FWD_CONTROL_CTR: sprintf_s(desc, "%s %s", GetOrdinal(), Game::GetInstance()->GetText("CombatGroup.abrv.FWD_CONTROL_CTR").data()); break;
+ case ECM: sprintf_s(desc, "%s %s", GetOrdinal(), Game::GetInstance()->GetText("CombatGroup.abrv.ECM").data()); break;
+
+ case SUPPORT: sprintf_s(desc, "%s %s", GetOrdinal(), Game::GetInstance()->GetText("CombatGroup.abrv.SUPPORT").data()); break;
+ case COURIER: sprintf_s(desc, "%s %s", GetOrdinal(), Game::GetInstance()->GetText("CombatGroup.abrv.COURIER").data()); break;
+ case MEDICAL: sprintf_s(desc, "%s %s", GetOrdinal(), Game::GetInstance()->GetText("CombatGroup.abrv.MEDICAL").data()); break;
+ case SUPPLY: sprintf_s(desc, "%s %s", GetOrdinal(), Game::GetInstance()->GetText("CombatGroup.abrv.SUPPLY").data()); break;
+ case REPAIR: sprintf_s(desc, "%s %s", GetOrdinal(), Game::GetInstance()->GetText("CombatGroup.abrv.REPAIR").data()); break;
case CIVILIAN:
case WAR_PRODUCTION:
@@ -583,7 +583,7 @@ CombatGroup::GetShortDescription() const
case PASSENGER:
case PRIVATE: strcpy_s(desc, (const char*) name); break;
- default: sprintf_s(desc, "%s", Game::GetText("CombatGroup.abrv.default").data()); break;
+ default: sprintf_s(desc, "%s", Game::GetInstance()->GetText("CombatGroup.abrv.default").data()); break;
}
return desc;
diff --git a/Stars45/CombatUnit.cpp b/Stars45/CombatUnit.cpp
index b3a11e0..6a25ab5 100644
--- a/Stars45/CombatUnit.cpp
+++ b/Stars45/CombatUnit.cpp
@@ -88,7 +88,7 @@ CombatUnit::GetDescription() const
static char desc[256];
if (!design) {
- strcpy_s(desc, Game::GetText("[unknown]").data());
+ strcpy_s(desc, Game::GetInstance()->GetText("[unknown]").data());
}
else if (count > 1) {
@@ -103,7 +103,7 @@ CombatUnit::GetDescription() const
if (dead_count > 0) {
strcat_s(desc, " ");
- strcat_s(desc, Game::GetText("killed.in.action"));
+ strcat_s(desc, Game::GetInstance()->GetText("killed.in.action"));
}
}
diff --git a/Stars45/Computer.cpp b/Stars45/Computer.cpp
index 66cccb8..a4b9564 100644
--- a/Stars45/Computer.cpp
+++ b/Stars45/Computer.cpp
@@ -26,7 +26,7 @@ static int computer_value[] = {
Computer::Computer(int comp_type, const char* comp_name)
: System(COMPUTER, comp_type, comp_name, 1, 1, 1, 1)
{
- SetAbbreviation(Game::GetText("sys.computer.abrv"));
+ SetAbbreviation(Game::GetInstance()->GetText("sys.computer.abrv"));
power_flags = POWER_WATTS | POWER_CRITICAL;
if (subtype == FLIGHT) {
diff --git a/Stars45/Contact.cpp b/Stars45/Contact.cpp
index d1920b6..97cba6a 100644
--- a/Stars45/Contact.cpp
+++ b/Stars45/Contact.cpp
@@ -34,14 +34,14 @@ Contact::Contact()
: ship(0), shot(0), d_pas(0.0f), d_act(0.0f),
track(0), ntrack(0), time(0), track_time(0), probe(false)
{
- acquire_time = Game::GameTime();
+ acquire_time = Game::GetInstance()->GameTime();
}
Contact::Contact(Ship* s, float p, float a)
: ship(s), shot(0), d_pas(p), d_act(a),
track(0), ntrack(0), time(0), track_time(0), probe(false)
{
- acquire_time = Game::GameTime();
+ acquire_time = Game::GetInstance()->GameTime();
Observe(ship);
}
@@ -49,7 +49,7 @@ Contact::Contact(Shot* s, float p, float a)
: ship(0), shot(s), d_pas(p), d_act(a),
track(0), ntrack(0), time(0), track_time(0), probe(false)
{
- acquire_time = Game::GameTime();
+ acquire_time = Game::GetInstance()->GameTime();
Observe(shot);
}
@@ -116,7 +116,7 @@ Contact::Age() const
if (!ship && !shot)
return age;
- double seconds = (Game::GameTime() - time) / 1000.0;
+ double seconds = (Game::GetInstance()->GameTime() - time) / 1000.0;
age = 1.0 - seconds/DEFAULT_TRACK_AGE;
@@ -293,9 +293,9 @@ Contact::Visible(const Ship* observer) const
void
Contact::Reset()
{
- if (Game::Paused()) return;
+ if (Game::GetInstance()->Paused()) return;
- float step_down = (float) (Game::FrameTime() / 10);
+ float step_down = (float) (Game::GetInstance()->FrameTime() / 10);
if (d_pas > 0)
d_pas -= step_down;
@@ -327,7 +327,7 @@ Contact::ClearTrack()
void
Contact::UpdateTrack()
{
- time = Game::GameTime();
+ time = Game::GetInstance()->GameTime();
if (shot || (ship && ship->IsGroundUnit()))
return;
diff --git a/Stars45/CtlDlg.cpp b/Stars45/CtlDlg.cpp
index 27530a6..33f4e1e 100644
--- a/Stars45/CtlDlg.cpp
+++ b/Stars45/CtlDlg.cpp
@@ -318,7 +318,7 @@ CtlDlg::OnCommand(AWEvent* event)
int list_index = commands->GetListIndex();
// double-click:
- if (list_index == command_index && Game::RealTime() - command_click_time < 350) {
+ if (list_index == command_index && Game::GetInstance()->RealTime() - command_click_time < 350) {
KeyDlg* key_dlg = 0;
if (manager)
@@ -332,7 +332,7 @@ CtlDlg::OnCommand(AWEvent* event)
manager->ShowKeyDlg();
}
- command_click_time = Game::RealTime();
+ command_click_time = Game::GetInstance()->RealTime();
command_index = list_index;
}
diff --git a/Stars45/DebriefDlg.cpp b/Stars45/DebriefDlg.cpp
index 0c13f5d..f19fa16 100644
--- a/Stars45/DebriefDlg.cpp
+++ b/Stars45/DebriefDlg.cpp
@@ -96,7 +96,7 @@ void
DebriefDlg::Show()
{
FormWindow::Show();
- Game::SetTimeCompression(1);
+ Game::GetInstance()->SetTimeCompression(1);
mission = 0;
campaign = Campaign::GetCampaign();
@@ -112,7 +112,7 @@ DebriefDlg::Show()
if (mission)
mission_name->SetText(mission->Name());
else
- mission_name->SetText(Game::GetText("DebriefDlg.mission-name"));
+ mission_name->SetText(Game::GetInstance()->GetText("DebriefDlg.mission-name"));
}
if (mission_system) {
@@ -166,7 +166,7 @@ DebriefDlg::Show()
if (mission)
objectives->SetText(mission->Objective());
else
- objectives->SetText(Game::GetText("DebriefDlg.unspecified"));
+ objectives->SetText(Game::GetInstance()->GetText("DebriefDlg.unspecified"));
}
}
@@ -174,11 +174,11 @@ DebriefDlg::Show()
if (mission)
situation->SetText(mission->Situation());
else
- situation->SetText(Game::GetText("DebriefDlg.unknown"));
+ situation->SetText(Game::GetInstance()->GetText("DebriefDlg.unknown"));
}
if (mission_score) {
- mission_score->SetText(Game::GetText("DebriefDlg.no-stats"));
+ mission_score->SetText(Game::GetInstance()->GetText("DebriefDlg.no-stats"));
if (ship) {
for (int i = 0; i < ShipStats::NumStats(); i++) {
@@ -193,7 +193,7 @@ DebriefDlg::Show()
points = player->GetMissionPoints(stats, sim->StartTime()) + stats->GetCommandPoints();
char score[32];
- sprintf_s(score, "%d %s", points, Game::GetText("DebriefDlg.points").data());
+ sprintf_s(score, "%d %s", points, Game::GetInstance()->GetText("DebriefDlg.points").data());
mission_score->SetText(score);
break;
}
diff --git a/Stars45/Debris.cpp b/Stars45/Debris.cpp
index 3e58a94..680d314 100644
--- a/Stars45/Debris.cpp
+++ b/Stars45/Debris.cpp
@@ -148,7 +148,7 @@ Debris::HitBy(Shot* shot, Point& impact)
double effective_damage = shot->Damage() * dscale;
if (shot->IsBeam()) {
- effective_damage *= Game::FrameTime();
+ effective_damage *= Game::GetInstance()->FrameTime();
}
else {
ApplyTorque(shot->Velocity() * (float) effective_damage * 1e-6f);
diff --git a/Stars45/DetailSet.cpp b/Stars45/DetailSet.cpp
index 4b1503e..5d8c2c6 100644
--- a/Stars45/DetailSet.cpp
+++ b/Stars45/DetailSet.cpp
@@ -162,7 +162,7 @@ DetailSet::GetDetailLevel()
index = 0;
if (rgn == ref_rgn) {
- double screen_width = Game::GetScreenWidth();
+ double screen_width = Game::GetInstance()->GetScreenWidth();
Point delta = loc - ref_loc;
double distance = delta.length();
diff --git a/Stars45/DisplayView.cpp b/Stars45/DisplayView.cpp
index 7584d37..2c55cb6 100644
--- a/Stars45/DisplayView.cpp
+++ b/Stars45/DisplayView.cpp
@@ -157,7 +157,7 @@ DisplayView::Refresh()
void
DisplayView::ExecFrame()
{
- double seconds = Game::GUITime();
+ double seconds = Game::GetInstance()->GUITime();
ListIter<DisplayElement> iter = elements;
while (++iter) {
diff --git a/Stars45/Drive.cpp b/Stars45/Drive.cpp
index 8f33cac..e1aeb0e 100644
--- a/Stars45/Drive.cpp
+++ b/Stars45/Drive.cpp
@@ -75,16 +75,16 @@ Drive::Drive(SUBTYPE drive_type, float max_thrust, float max_aug, bool show)
switch (drive_type) {
default:
- case PLASMA: name = Game::GetText("sys.drive.plasma"); break;
- case FUSION: name = Game::GetText("sys.drive.fusion"); break;
- case GREEN: name = Game::GetText("sys.drive.green"); break;
- case RED: name = Game::GetText("sys.drive.red"); break;
- case BLUE: name = Game::GetText("sys.drive.blue"); break;
- case YELLOW: name = Game::GetText("sys.drive.yellow"); break;
- case STEALTH: name = Game::GetText("sys.drive.stealth"); break;
+ case PLASMA: name = Game::GetInstance()->GetText("sys.drive.plasma"); break;
+ case FUSION: name = Game::GetInstance()->GetText("sys.drive.fusion"); break;
+ case GREEN: name = Game::GetInstance()->GetText("sys.drive.green"); break;
+ case RED: name = Game::GetInstance()->GetText("sys.drive.red"); break;
+ case BLUE: name = Game::GetInstance()->GetText("sys.drive.blue"); break;
+ case YELLOW: name = Game::GetInstance()->GetText("sys.drive.yellow"); break;
+ case STEALTH: name = Game::GetInstance()->GetText("sys.drive.stealth"); break;
}
- abrv = Game::GetText("sys.drive.abrv");
+ abrv = Game::GetInstance()->GetText("sys.drive.abrv");
emcon_power[0] = 0;
emcon_power[1] = 50;
@@ -439,7 +439,7 @@ Drive::Thrust(double seconds)
CameraDirector* cam_dir = CameraDirector::GetInstance();
// no sound when paused!
- if (!Game::Paused() && subtype != STEALTH && cam_dir && cam_dir->GetCamera()) {
+ if (!Game::GetInstance()->Paused() && subtype != STEALTH && cam_dir && cam_dir->GetCamera()) {
if (ship && ship->GetRegion() == Sim::GetSim()->GetActiveRegion()) {
if (!sound) {
int sound_index = 0;
diff --git a/Stars45/Drone.cpp b/Stars45/Drone.cpp
index 2f21e06..ff32d23 100644
--- a/Stars45/Drone.cpp
+++ b/Stars45/Drone.cpp
@@ -181,7 +181,7 @@ Drone::HitBy(Shot* shot, Point& impact)
double effective_damage = shot->Damage() * dscale;
if (shot->IsBeam()) {
- effective_damage *= Game::FrameTime();
+ effective_damage *= Game::GetInstance()->FrameTime();
}
else {
ApplyTorque(shot->Velocity() * (float) effective_damage * 1e-6f);
diff --git a/Stars45/EngDlg.cpp b/Stars45/EngDlg.cpp
index c00ba7d..545b925 100644
--- a/Stars45/EngDlg.cpp
+++ b/Stars45/EngDlg.cpp
@@ -251,7 +251,7 @@ EngDlg::UpdateRouteTables()
PowerSource* reactor = reactor_iter.value();
if (sources[reactor_index] && clients[reactor_index]) {
- sources[reactor_index]->SetText(Game::GetText(reactor->Abbreviation()));
+ sources[reactor_index]->SetText(Game::GetInstance()->GetText(reactor->Abbreviation()));
sources[reactor_index]->Show();
source_levels[reactor_index]->Show();
@@ -264,9 +264,9 @@ EngDlg::UpdateRouteTables()
while (++client) {
char abrv[64], num[20];
FormatNumber(num, client->GetPowerLevel());
- strcpy_s(abrv, Game::GetText(client->Name()));
+ strcpy_s(abrv, Game::GetInstance()->GetText(client->Name()));
- clients[reactor_index]->AddItemWithData(Game::GetText(abrv), index);
+ clients[reactor_index]->AddItemWithData(Game::GetInstance()->GetText(abrv), index);
clients[reactor_index]->SetItemText(index, 1, num);
clients[reactor_index]->SetItemData(index, 1, (DWORD) client->GetPowerLevel());
@@ -357,7 +357,7 @@ EngDlg::UpdateSelection()
// update the detail info:
if (selected_source) {
- selected_name->SetText(Game::GetText(selected_source->Name()));
+ selected_name->SetText(Game::GetInstance()->GetText(selected_source->Name()));
power_off->SetEnabled(true);
power_on->SetEnabled(true);
override->SetEnabled(true);
@@ -409,7 +409,7 @@ EngDlg::UpdateSelection()
case Component::REPAIR: stat = "MAINT"; c = Color::Cyan; break;
}
- stat = Game::GetText(Text("EngDlg.") + stat);
+ stat = Game::GetInstance()->GetText(Text("EngDlg.") + stat);
components->SetItemText(i, 1, stat);
components->SetItemData(i, 1, (int) comp->Status());
@@ -424,7 +424,7 @@ EngDlg::UpdateSelection()
else if (selected_clients.size() == 1) {
System* sink = selected_clients[0];
- selected_name->SetText(Game::GetText(sink->Name()));
+ selected_name->SetText(Game::GetInstance()->GetText(sink->Name()));
power_off->SetEnabled(true);
power_on->SetEnabled(true);
override->SetEnabled(true);
@@ -476,7 +476,7 @@ EngDlg::UpdateSelection()
case Component::REPAIR: stat = "MAINT"; c = Color::Cyan; break;
}
- stat = Game::GetText(Text("EngDlg.") + stat);
+ stat = Game::GetInstance()->GetText(Text("EngDlg.") + stat);
components->SetItemText(i, 1, stat);
components->SetItemData(i, 1, (int) comp->Status());
@@ -491,7 +491,7 @@ EngDlg::UpdateSelection()
else if (selected_clients.size() > 1) {
System* sink = selected_clients[0];
- selected_name->SetText(Game::GetText("[Multiple]"));
+ selected_name->SetText(Game::GetInstance()->GetText("[Multiple]"));
power_off->SetEnabled(true);
power_on->SetEnabled(true);
override->SetEnabled(true);
@@ -527,7 +527,7 @@ EngDlg::UpdateSelection()
}
else {
- selected_name->SetText(Game::GetText("No Selection"));
+ selected_name->SetText(Game::GetInstance()->GetText("No Selection"));
power_off->SetEnabled(false);
power_off->SetButtonState(0);
power_on->SetEnabled(false);
@@ -564,7 +564,7 @@ EngDlg::UpdateSelection()
}
FormatTime(etr, (int) (time_remaining / ship->RepairSpeed()));
- repair_queue->AddItem(Game::GetText(sys->Name()));
+ repair_queue->AddItem(Game::GetInstance()->GetText(sys->Name()));
repair_queue->SetItemText(i, 1, etr);
i++;
}
@@ -649,7 +649,7 @@ EngDlg::OnSource(AWEvent* event)
int index = 0;
ListIter<Component> comp = selected_source->GetComponents();
while (++comp)
- components->AddItemWithData(Game::GetText(comp->Abbreviation()), index++);
+ components->AddItemWithData(Game::GetInstance()->GetText(comp->Abbreviation()), index++);
}
}
}
@@ -702,7 +702,7 @@ EngDlg::OnClient(AWEvent* event)
int index = 0;
ListIter<Component> comp = sink->GetComponents();
while (++comp)
- components->AddItemWithData(Game::GetText(comp->Abbreviation()), index++);
+ components->AddItemWithData(Game::GetInstance()->GetText(comp->Abbreviation()), index++);
}
}
}
@@ -1007,7 +1007,7 @@ EngDlg::OnQueue(AWEvent* event)
int index = 0;
ListIter<Component> comp = selected_repair->GetComponents();
while (++comp)
- components->AddItemWithData(Game::GetText(comp->Abbreviation()), index++);
+ components->AddItemWithData(Game::GetInstance()->GetText(comp->Abbreviation()), index++);
}
}
diff --git a/Stars45/ExitDlg.cpp b/Stars45/ExitDlg.cpp
index 4eac852..548d1cb 100644
--- a/Stars45/ExitDlg.cpp
+++ b/Stars45/ExitDlg.cpp
@@ -65,7 +65,7 @@ void
ExitDlg::ExecFrame()
{
if (credits && credits->GetLineCount() > 0) {
- credits->SmoothScroll(ScrollWindow::SCROLL_DOWN, Game::GUITime());
+ credits->SmoothScroll(ScrollWindow::SCROLL_DOWN, Game::GetInstance()->GUITime());
if (credits->GetTopIndex() >= credits->GetLineCount()-1) {
credits->ScrollTo(0);
diff --git a/Stars45/FadeView.cpp b/Stars45/FadeView.cpp
index bee2579..16575b9 100644
--- a/Stars45/FadeView.cpp
+++ b/Stars45/FadeView.cpp
@@ -55,10 +55,10 @@ FadeView::Refresh()
double msec = 0;
if (state == StateStart) {
- time = Game::RealTime();
+ time = Game::GetInstance()->RealTime();
}
else if (state != StateDone) {
- double new_time = Game::RealTime();
+ double new_time = Game::GetInstance()->RealTime();
msec = new_time - time;
time = new_time;
}
diff --git a/Stars45/Farcaster.cpp b/Stars45/Farcaster.cpp
index 85220bb..33de64c 100644
--- a/Stars45/Farcaster.cpp
+++ b/Stars45/Farcaster.cpp
@@ -33,8 +33,8 @@ Farcaster::Farcaster(double cap, double rate)
ship(0), dest(0), jumpship(0), cycle_time(10),
active_state(QuantumDrive::ACTIVE_READY), warp_fov(1), no_dest(false)
{
- name = Game::GetText("sys.farcaster");
- abrv = Game::GetText("sys.farcaster.abrv");
+ name = Game::GetInstance()->GetText("sys.farcaster");
+ abrv = Game::GetInstance()->GetText("sys.farcaster.abrv");
}
// +----------------------------------------------------------------------+
diff --git a/Stars45/FighterAI.cpp b/Stars45/FighterAI.cpp
index 5292806..409a89b 100644
--- a/Stars45/FighterAI.cpp
+++ b/Stars45/FighterAI.cpp
@@ -211,7 +211,7 @@ FighterAI::FindObjective()
// transform into camera coords:
objective = Transform(obj_w);
- ship->SetDirectorInfo(Game::GetText("ai.launch"));
+ ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.launch"));
return;
}
else {
@@ -226,7 +226,7 @@ FighterAI::FindObjective()
// transform into camera coords:
objective = Transform(obj_w);
- ship->SetDirectorInfo(Game::GetText("ai.takeoff"));
+ ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.takeoff"));
return;
}
@@ -247,14 +247,14 @@ FighterAI::FindObjective()
// transform into camera coords:
objective = Transform(obj_w);
- ship->SetDirectorInfo(Game::GetText("ai.inbound"));
+ ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.inbound"));
return;
}
// final approach
else {
- ship->SetDirectorInfo(Game::GetText("ai.finals"));
+ ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.finals"));
obj_w = deck->StartPoint();
if (inbound->Final()) {
@@ -427,7 +427,7 @@ FighterAI::ReturnToBase(Ship* controller)
// transform into camera coords:
objective = Transform(obj_w);
- ship->SetDirectorInfo(Game::GetText("ai.return-to-base"));
+ ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.return-to-base"));
rtb_code = 1;
}
@@ -626,7 +626,7 @@ FighterAI::Navigator()
}
if (target)
- ship->SetDirectorInfo(Game::GetText("ai.seek-target"));
+ ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.seek-target"));
accumulator.Clear();
magnitude = 0;
@@ -716,7 +716,7 @@ FighterAI::HelmControl()
}
else {
- ship->SetDirectorInfo(Game::GetText("ai.station-keeping"));
+ ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.station-keeping"));
station_keeping = true;
// go into a slow orbit if airborne:
@@ -1121,7 +1121,7 @@ FighterAI::AvoidTerrain()
if (ship->AltitudeMSL() > 25e3) {
if (!navpt || (navpt->Region() == ship->GetRegion() && navpt->Location().z < 27e3)) {
terrain_warning = true;
- ship->SetDirectorInfo(Game::GetText("ai.too-high"));
+ ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.too-high"));
// where will we be?
Point selfpt = ship->Location() + ship->Velocity() + Point(0, -15e3, 0);
@@ -1137,11 +1137,11 @@ FighterAI::AvoidTerrain()
// too low?
else if (ship->AltitudeAGL() < 2500) {
terrain_warning = true;
- ship->SetDirectorInfo(Game::GetText("ai.too-low"));
+ ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.too-low"));
// way too low?
if (ship->AltitudeAGL() < 1500) {
- ship->SetDirectorInfo(Game::GetText("ai.way-too-low"));
+ ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.way-too-low"));
target = 0;
drop_time = 5;
}
@@ -1189,7 +1189,7 @@ FighterAI::SeekTarget()
if (patrol) {
Steer result = Seek(objective);
- ship->SetDirectorInfo(Game::GetText("ai.seek-patrol-point"));
+ ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.seek-patrol-point"));
if (distance < 10 * self->Radius()) {
patrol = 0;
@@ -1209,7 +1209,7 @@ FighterAI::SeekTarget()
result.stop = 1;
}
else {
- ship->SetDirectorInfo(Game::GetText("ai.seek-inbound"));
+ ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.seek-inbound"));
// approach legs:
if (inbound->Approach() > 0) {
@@ -1241,7 +1241,7 @@ FighterAI::SeekTarget()
}
else if (!inbound->Cleared() && distance < 2000) {
- ship->SetDirectorInfo(Game::GetText("ai.hold-final"));
+ ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.hold-final"));
result = Steer();
result.brake = 1;
result.stop = 1;
@@ -1267,7 +1267,7 @@ FighterAI::SeekTarget()
}
else if (navpt && navpt->Action() == Instruction::LAUNCH) {
- ship->SetDirectorInfo(Game::GetText("ai.launch"));
+ ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.launch"));
return Seek(objective);
}
@@ -1276,7 +1276,7 @@ FighterAI::SeekTarget()
if (element_index > 1)
return SeekFormationSlot();
- ship->SetDirectorInfo(Game::GetText("ai.seek-farcaster"));
+ ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.seek-farcaster"));
return Seek(objective);
}
@@ -1338,13 +1338,13 @@ FighterAI::SeekTarget()
return Steer();
}
- ship->SetDirectorInfo(Game::GetText("ai.seek-target"));
+ ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.seek-target"));
return Seek(objective);
}
}
if (navpt) {
- ship->SetDirectorInfo(Game::GetText("ai.seek-navpt"));
+ ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.seek-navpt"));
}
return Seek(objective);
@@ -1414,7 +1414,7 @@ FighterAI::SeekFormationSlot()
}
seeking = 1;
- ship->SetDirectorInfo(Game::GetText("ai.seek-formation"));
+ ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.seek-formation"));
return s;
}
@@ -1497,7 +1497,7 @@ FighterAI::EvadeThreat()
}
// beam the missile
- ship->SetDirectorInfo(Game::GetText("ai.evade-missile"));
+ ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.evade-missile"));
Point beam_line = threat_missile->Velocity().cross(Point(0,1,0));
beam_line.Normalize();
@@ -1530,7 +1530,7 @@ FighterAI::EvadeThreat()
}
if (threat_dist <= threat_range) {
- ship->SetDirectorInfo(Game::GetText("ai.evade-threat"));
+ ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.evade-threat"));
if (ship->IsAirborne()) {
evading = true;
@@ -1553,7 +1553,7 @@ FighterAI::EvadeThreat()
}
if (!target) {
- ship->SetDirectorInfo(Game::GetText("ai.evade-starship"));
+ ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.evade-starship"));
// flee for three seconds:
if ((ship->MissionClock() & 3) != 3) {
@@ -1562,8 +1562,8 @@ FighterAI::EvadeThreat()
// jink for one second:
else {
- if (Game::GameTime() - jink_time > 1500) {
- jink_time = Game::GameTime();
+ if (Game::GetInstance()->GameTime() - jink_time > 1500) {
+ jink_time = Game::GetInstance()->GameTime();
jink = Point(rand() - 16384,
rand() - 16384,
rand() - 16384) * 15e3;
@@ -1577,7 +1577,7 @@ FighterAI::EvadeThreat()
}
else {
- ship->SetDirectorInfo(Game::GetText("ai.evade-and-seek"));
+ ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.evade-and-seek"));
// seek for three seconds:
if ((ship->MissionClock() & 3) < 3) {
@@ -1586,8 +1586,8 @@ FighterAI::EvadeThreat()
// jink for one second:
else {
- if (Game::GameTime() - jink_time > 1000) {
- jink_time = Game::GameTime();
+ if (Game::GetInstance()->GameTime() - jink_time > 1000) {
+ jink_time = Game::GetInstance()->GameTime();
jink = Point(rand() - 16384,
rand() - 16384,
rand() - 16384);
@@ -1622,9 +1622,9 @@ FighterAI::EvadeThreat()
}
if (target)
- ship->SetDirectorInfo(Game::GetText("ai.evade-and-seek"));
+ ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.evade-and-seek"));
else
- ship->SetDirectorInfo(Game::GetText("ai.random-evade"));
+ ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.random-evade"));
// beam the threat
Point beam_line = threat->Velocity().cross(Point(0,1,0));
@@ -1646,8 +1646,8 @@ FighterAI::EvadeThreat()
if (!target) {
DWORD jink_rate = 400 + 200 * (3-ai_level);
- if (Game::GameTime() - jink_time > jink_rate) {
- jink_time = Game::GameTime();
+ if (Game::GetInstance()->GameTime() - jink_time > jink_rate) {
+ jink_time = Game::GetInstance()->GameTime();
jink = Point(rand() - 16384,
rand() - 16384,
rand() - 16384) * 2000;
@@ -1776,7 +1776,7 @@ FighterAI::FireControl()
if (ship->FireSecondary()) {
missile_time = secondary->Design()->salvo_delay + extra_time;
- if (Game::GameTime() - last_call_time > 6000) {
+ if (Game::GetInstance()->GameTime() - last_call_time > 6000) {
// call fox:
int call = RadioMessage::FOX_3; // A2A
@@ -1787,7 +1787,7 @@ FighterAI::FireControl()
call = RadioMessage::FOX_2;
RadioTraffic::SendQuickMessage(ship, call);
- last_call_time = Game::GameTime();
+ last_call_time = Game::GetInstance()->GameTime();
}
}
}
diff --git a/Stars45/FighterTacticalAI.cpp b/Stars45/FighterTacticalAI.cpp
index 3054e92..46aef0b 100644
--- a/Stars45/FighterTacticalAI.cpp
+++ b/Stars45/FighterTacticalAI.cpp
@@ -132,12 +132,12 @@ FighterTacticalAI::CheckFlightPlan()
}
switch (roe) {
- case NONE: ship->SetDirectorInfo(Game::GetText("ai.none")); break;
- case SELF_DEFENSIVE: ship->SetDirectorInfo(Game::GetText("ai.self-defensive")); break;
- case DEFENSIVE: ship->SetDirectorInfo(Game::GetText("ai.defensive")); break;
- case DIRECTED: ship->SetDirectorInfo(Game::GetText("ai.directed")); break;
- case FLEXIBLE: ship->SetDirectorInfo(Game::GetText("ai.flexible")); break;
- default: ship->SetDirectorInfo(Game::GetText("ai.default")); break;
+ case NONE: ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.none")); break;
+ case SELF_DEFENSIVE: ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.self-defensive")); break;
+ case DEFENSIVE: ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.defensive")); break;
+ case DIRECTED: ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.directed")); break;
+ case FLEXIBLE: ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.flexible")); break;
+ default: ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.default")); break;
}
return (navpt != 0);
@@ -153,9 +153,9 @@ FighterTacticalAI::SelectTarget()
SimObject* target = ship_ai->GetTarget();
if (target && (target->Type() == SimObject::SIM_SHIP) &&
- (Game::GameTime() - secondary_selection_time) > THREAT_REACTION_TIME) {
+ (Game::GetInstance()->GameTime() - secondary_selection_time) > THREAT_REACTION_TIME) {
SelectSecondaryForTarget((Ship*) target);
- secondary_selection_time = Game::GameTime();
+ secondary_selection_time = Game::GetInstance()->GameTime();
}
}
@@ -474,7 +474,7 @@ FighterTacticalAI::FindThreat()
Contact* contact = c_iter.value();
if (contact->Threat(ship) &&
- (Game::GameTime() - contact->AcquisitionTime()) > THREAT_REACTION_TIME) {
+ (Game::GetInstance()->GameTime() - contact->AcquisitionTime()) > THREAT_REACTION_TIME) {
double rng = contact->Range(ship);
diff --git a/Stars45/FlightDeck.cpp b/Stars45/FlightDeck.cpp
index d499e6c..d335376 100644
--- a/Stars45/FlightDeck.cpp
+++ b/Stars45/FlightDeck.cpp
@@ -188,8 +188,8 @@ FlightDeck::FlightDeck()
carrier(0), index(0), num_slots(0), slots(0), cycle_time(5), num_hoops(0), hoops(0),
azimuth(0), light(0), num_catsounds(0), num_approach_pts(0)
{
- name = Game::GetText("sys.flight-deck");
- abrv = Game::GetText("sys.flight-deck.abrv");
+ name = Game::GetInstance()->GetText("sys.flight-deck");
+ abrv = Game::GetInstance()->GetText("sys.flight-deck.abrv");
}
// +----------------------------------------------------------------------+
diff --git a/Stars45/FltDlg.cpp b/Stars45/FltDlg.cpp
index a17f90d..a62853e 100644
--- a/Stars45/FltDlg.cpp
+++ b/Stars45/FltDlg.cpp
@@ -140,8 +140,8 @@ FltDlg::SetShip(Ship* s)
filter_list->AddItem(filter);
}
- filter_list->AddItem(Game::GetText("FltDlg.PENDING"));
- filter_list->AddItem(Game::GetText("FltDlg.ACTIVE"));
+ filter_list->AddItem(Game::GetInstance()->GetText("FltDlg.PENDING"));
+ filter_list->AddItem(Game::GetInstance()->GetText("FltDlg.ACTIVE"));
}
flight_planner = new(__FILE__,__LINE__) FlightPlanner(ship);
@@ -291,7 +291,7 @@ FltDlg::UpdateSelection()
}
else {
hangar_list->SetItemText(item, 1, "--");
- hangar_list->SetItemText(item, 2, Game::GetText("FltDlg.Open"));
+ hangar_list->SetItemText(item, 2, Game::GetInstance()->GetText("FltDlg.Open"));
}
FormatTime(txt, time);
@@ -479,7 +479,7 @@ FltDlg::UpdateObjective()
FormatNumber(txt, r);
}
else {
- strcpy_s(txt, Game::GetText("FltDlg.Unknown").data());
+ strcpy_s(txt, Game::GetInstance()->GetText("FltDlg.Unknown").data());
r = 2e9;
}
}
@@ -592,7 +592,7 @@ FltDlg::OnFilter(AWEvent* event)
}
else {
hangar_list->SetItemText(item, 1, "--");
- hangar_list->SetItemText(item, 2, Game::GetText("FltDlg.Open"));
+ hangar_list->SetItemText(item, 2, Game::GetInstance()->GetText("FltDlg.Open"));
}
@@ -993,7 +993,7 @@ FltDlg::OnMissionType(AWEvent* event)
FormatNumber(txt, r);
}
else {
- strcpy_s(txt, Game::GetText("FltDlg.Unknown").data());
+ strcpy_s(txt, Game::GetInstance()->GetText("FltDlg.Unknown").data());
r = 2e9;
}
}
diff --git a/Stars45/FormDef.cpp b/Stars45/FormDef.cpp
index f4aadc4..360217d 100644
--- a/Stars45/FormDef.cpp
+++ b/Stars45/FormDef.cpp
@@ -621,7 +621,7 @@ FormDef::Load(const char* fname)
pdef->name()->value() == "caption") {
GetDefText(buf, pdef, filename);
- form->SetText(Game::GetText(buf));
+ form->SetText(Game::GetInstance()->GetText(buf));
}
else if (pdef->name()->value() == "id") {
@@ -798,7 +798,7 @@ void FormDef::ParseCtrlDef(CtrlDef* ctrl, TermStruct* val)
if (pdef->name()->value() == "text" ||
pdef->name()->value() == "caption") {
GetDefText(buf, pdef, filename);
- ctrl->SetText(Game::GetText(buf));
+ ctrl->SetText(Game::GetInstance()->GetText(buf));
}
else if (pdef->name()->value() == "id") {
@@ -815,7 +815,7 @@ void FormDef::ParseCtrlDef(CtrlDef* ctrl, TermStruct* val)
else if (pdef->name()->value() == "alt") {
GetDefText(buf, pdef, filename);
- ctrl->SetAltText(Game::GetText(buf));
+ ctrl->SetAltText(Game::GetInstance()->GetText(buf));
}
else if (pdef->name()->value() == "type") {
@@ -966,7 +966,7 @@ void FormDef::ParseCtrlDef(CtrlDef* ctrl, TermStruct* val)
else if (pdef->name()->value() == "item") {
GetDefText(buf, pdef, filename);
- ctrl->AddItem(Game::GetText(buf));
+ ctrl->AddItem(Game::GetInstance()->GetText(buf));
}
else if (pdef->name()->value() == "tab") {
@@ -1182,7 +1182,7 @@ void FormDef::ParseColumnDef(CtrlDef* ctrl, TermStruct* val)
if (pdef->name()->value() == "text" ||
pdef->name()->value() == "title") {
GetDefText(buf, pdef, filename);
- text = Game::GetText(buf);
+ text = Game::GetInstance()->GetText(buf);
}
else if (pdef->name()->value() == "width") {
diff --git a/Stars45/Game.cpp b/Stars45/Game.cpp
index c1c4463..4a2e8d8 100644
--- a/Stars45/Game.cpp
+++ b/Stars45/Game.cpp
@@ -29,12 +29,13 @@
Game* game = 0;
+char Game::panicbuf[256];
+
const int VIDEO_FPS = 30;
const double MAX_FRAME_TIME_VIDEO = 1.0 / (double) VIDEO_FPS;
const double MAX_FRAME_TIME_NORMAL = 1.0 / 5.0;
const double MIN_FRAME_TIME_NORMAL = 1.0 / 60.0;
-
static LARGE_INTEGER perf_freq;
static LARGE_INTEGER perf_cnt1;
static LARGE_INTEGER perf_cnt2;
diff --git a/Stars45/GroundAI.cpp b/Stars45/GroundAI.cpp
index a0aa296..5c9150d 100644
--- a/Stars45/GroundAI.cpp
+++ b/Stars45/GroundAI.cpp
@@ -161,8 +161,8 @@ GroundAI::ExecFrame(double secs)
{
const int exec_period = 1000;
- if ((int) Game::GameTime() - exec_time > exec_period) {
- exec_time = (int) Game::GameTime();
+ if ((int) Game::GetInstance()->GameTime() - exec_time > exec_period) {
+ exec_time = (int) Game::GetInstance()->GameTime();
SelectTarget();
}
diff --git a/Stars45/HUDView.cpp b/Stars45/HUDView.cpp
index 232844d..8862241 100644
--- a/Stars45/HUDView.cpp
+++ b/Stars45/HUDView.cpp
@@ -786,7 +786,7 @@ HUDView::SetTacticalMode(int mode)
for (int i = 0; i < 31; i++)
pitch_ladder[i]->Hide();
}
- else if (Game::MaxTexSize() > 128) {
+ else if (Game::GetInstance()->MaxTexSize() > 128) {
hud_left_sprite->Show();
hud_right_sprite->Show();
}
@@ -862,7 +862,7 @@ HUDView::MarkerColor(Contact* contact)
c = Ship::IFFColor(c_iff) * contact->Age();
if (contact->GetShot() && contact->Threat(ship)) {
- if ((Game::RealTime()/500) & 1)
+ if ((Game::GetInstance()->RealTime()/500) & 1)
c = c * 2;
else
c = c * 0.5;
@@ -1069,15 +1069,15 @@ HUDView::DrawContact(Contact* contact, int index)
bool name_crowded = false;
if (x < width-8) {
- char code = *(Game::GetText("HUDView.symbol.fighter").data());
+ char code = *(Game::GetInstance()->GetText("HUDView.symbol.fighter").data());
if (c_ship) {
if (c_ship->Class() > Ship::LCA)
- code = *(Game::GetText("HUDView.symbol.starship").data());
+ code = *(Game::GetInstance()->GetText("HUDView.symbol.starship").data());
}
else if (c_shot) {
- code = *(Game::GetText("HUDView.symbol.torpedo").data());
+ code = *(Game::GetInstance()->GetText("HUDView.symbol.torpedo").data());
}
Sensor* sensor = ship->GetSensor();
@@ -1335,10 +1335,10 @@ HUDView::DrawBars()
int b = cy + bar_height/2;
int align = DT_LEFT;
- if (Game::Paused())
+ if (Game::GetInstance()->Paused())
{
Rect pause_rect = Rect(cx - 128, cy - 60, 256, 12);
- DrawHUDText(TXT_PAUSED, Game::GetText("HUDView.PAUSED"), pause_rect, DT_CENTER);
+ DrawHUDText(TXT_PAUSED, Game::GetInstance()->GetText("HUDView.PAUSED"), pause_rect, DT_CENTER);
}
if (ship) {
@@ -1376,7 +1376,7 @@ HUDView::DrawBars()
if (arcade) {
char arcade_txt[32];
- sprintf_s(arcade_txt, "%s %s", Game::GetText("HUDView.altitude").data(), txt);
+ sprintf_s(arcade_txt, "%s %s", Game::GetInstance()->GetText("HUDView.altitude").data(), txt);
align = (tactical) ? DT_LEFT : DT_RIGHT;
DrawHUDText(TXT_ALTITUDE, arcade_txt, speed_rect, align);
}
@@ -1398,7 +1398,7 @@ HUDView::DrawBars()
// upper left hud quadrant (starships)
else if (ship->IsStarship() && ship->GetFLCSMode() == Ship::FLCS_HELM && !arcade) {
- sprintf_s(txt, "%s: %.1f", Game::GetText("HUDView.Pitch").data(), ship->GetHelmPitch()/DEGREES);
+ sprintf_s(txt, "%s: %.1f", Game::GetInstance()->GetText("HUDView.Pitch").data(), ship->GetHelmPitch()/DEGREES);
speed_rect.y -= 50;
align = (tactical) ? DT_LEFT : DT_RIGHT;
@@ -1407,7 +1407,7 @@ HUDView::DrawBars()
speed_rect.y -= 10;
int heading_degrees = (int) (ship->GetHelmHeading()/DEGREES);
if (heading_degrees < 0) heading_degrees += 360;
- sprintf_s(txt, "%s: %03d", Game::GetText("HUDView.Heading").data(), heading_degrees);
+ sprintf_s(txt, "%s: %03d", Game::GetInstance()->GetText("HUDView.Heading").data(), heading_degrees);
DrawHUDText(TXT_HEADING, txt, speed_rect, align);
speed_rect.y += 60;
@@ -1423,9 +1423,9 @@ HUDView::DrawBars()
}
switch (mode) {
- case HUD_MODE_TAC: strcpy_s(txt, Game::GetText("HUDView.mode.tactical").data()); break;
- case HUD_MODE_NAV: strcpy_s(txt, Game::GetText("HUDView.mode.navigation").data()); break;
- case HUD_MODE_ILS: strcpy_s(txt, Game::GetText("HUDView.mode.landing").data()); break;
+ case HUD_MODE_TAC: strcpy_s(txt, Game::GetInstance()->GetText("HUDView.mode.tactical").data()); break;
+ case HUD_MODE_NAV: strcpy_s(txt, Game::GetInstance()->GetText("HUDView.mode.navigation").data()); break;
+ case HUD_MODE_ILS: strcpy_s(txt, Game::GetInstance()->GetText("HUDView.mode.landing").data()); break;
}
if (tactical) {
@@ -1441,7 +1441,7 @@ HUDView::DrawBars()
// landing gear:
if (ship->IsGearDown()) {
- const char* gear_down = Game::GetText("HUDView.gear-down");
+ const char* gear_down = Game::GetInstance()->GetText("HUDView.gear-down");
Rect gear_rect(l, b+20, box_width, 12);
DrawHUDText(TXT_GEAR_DOWN, gear_down, gear_rect, DT_CENTER, HUD_UPPER_CASE, true);
@@ -1451,18 +1451,18 @@ HUDView::DrawBars()
QuantumDrive* quantum = ship->GetQuantumDrive();
if (threat || (quantum && quantum->JumpTime() > 0)) {
- const char* threat_warn = Game::GetText("HUDView.threat-warn");
+ const char* threat_warn = Game::GetInstance()->GetText("HUDView.threat-warn");
bool show_msg = true;
if (quantum && quantum->JumpTime() > 0) {
static char buf[64];
- sprintf_s(buf, "%s: %d", Game::GetText("HUDView.quantum-jump").data(), (int) quantum->JumpTime());
+ sprintf_s(buf, "%s: %d", Game::GetInstance()->GetText("HUDView.quantum-jump").data(), (int) quantum->JumpTime());
threat_warn = buf;
}
else if (threat > 1) {
- threat_warn = Game::GetText("HUDView.missile-warn");
- show_msg = ((Game::RealTime()/500) & 1) != 0;
+ threat_warn = Game::GetInstance()->GetText("HUDView.missile-warn");
+ show_msg = ((Game::GetInstance()->RealTime()/500) & 1) != 0;
}
if (show_msg) {
@@ -1473,7 +1473,7 @@ HUDView::DrawBars()
if (ship->CanTimeSkip()) {
Rect auto_rect(l, t-40, box_width, 12);
- DrawHUDText(TXT_AUTO, Game::GetText("HUDView.AUTO"), auto_rect, DT_CENTER, HUD_MIXED_CASE, true);
+ DrawHUDText(TXT_AUTO, Game::GetInstance()->GetText("HUDView.AUTO"), auto_rect, DT_CENTER, HUD_MIXED_CASE, true);
}
if (mode == HUD_MODE_NAV) {
@@ -1511,19 +1511,19 @@ HUDView::DrawBars()
// missile range indicator
if (missile->GetSelected()->Locked()) {
Rect shoot_rect(l, b+5, box_width, 12);
- DrawHUDText(TXT_SHOOT, Game::GetText("HUDView.SHOOT"), shoot_rect, DT_CENTER, HUD_MIXED_CASE, true);
+ DrawHUDText(TXT_SHOOT, Game::GetInstance()->GetText("HUDView.SHOOT"), shoot_rect, DT_CENTER, HUD_MIXED_CASE, true);
}
}
if (!arcade && !ship->IsNetObserver()) {
if (ship->GetShield()) {
speed_rect.y = cy-5+40;
- sprintf_s(txt, "%s - %03d +", Game::GetText("HUDView.SHIELD").data(), ship->ShieldStrength());
+ sprintf_s(txt, "%s - %03d +", Game::GetInstance()->GetText("HUDView.SHIELD").data(), ship->ShieldStrength());
DrawHUDText(TXT_SHIELD, txt, speed_rect, align);
}
else if (ship->GetDecoy()) {
speed_rect.y = cy-5+40;
- sprintf_s(txt, "%s %d", Game::GetText("HUDView.DECOY").data(), ship->GetDecoy()->Ammo());
+ sprintf_s(txt, "%s %d", Game::GetInstance()->GetText("HUDView.DECOY").data(), ship->GetDecoy()->Ammo());
DrawHUDText(TXT_DECOY, txt, speed_rect, align);
}
@@ -1555,12 +1555,12 @@ HUDView::DrawBars()
NetGame* netgame = NetGame::GetInstance();
if (netgame && !netgame->IsActive()) {
Rect shoot_rect(l, b+5, box_width, 12);
- DrawHUDText(TXT_SHOOT, Game::GetText("HUDView.NET-GAME-OVER"), shoot_rect, DT_CENTER, HUD_MIXED_CASE, true);
+ DrawHUDText(TXT_SHOOT, Game::GetInstance()->GetText("HUDView.NET-GAME-OVER"), shoot_rect, DT_CENTER, HUD_MIXED_CASE, true);
}
else if (ship->IsNetObserver()) {
Rect shoot_rect(l, b+5, box_width, 12);
- DrawHUDText(TXT_SHOOT, Game::GetText("HUDView.OBSERVER"), shoot_rect, DT_CENTER, HUD_MIXED_CASE, true);
+ DrawHUDText(TXT_SHOOT, Game::GetInstance()->GetText("HUDView.OBSERVER"), shoot_rect, DT_CENTER, HUD_MIXED_CASE, true);
}
DrawTarget();
@@ -1616,7 +1616,7 @@ HUDView::DrawPitchLadder()
for (int i = 0; i < 31; i++)
pitch_ladder[i]->Hide();
- if (ship->IsAirborne() && Game::MaxTexSize() > 128) {
+ if (ship->IsAirborne() && Game::GetInstance()->MaxTexSize() > 128) {
double xtarg = xcenter;
double ytarg = ycenter;
@@ -2058,7 +2058,7 @@ HUDView::DrawTarget()
distance = contact->Range(ship, limit);
if (!contact->ActLock() && !contact->PasLock()) {
- strcpy_s(txt, Game::GetText("HUDView.No-Range").data());
+ strcpy_s(txt, Game::GetInstance()->GetText("HUDView.No-Range").data());
speed = 0;
}
else {
@@ -2103,20 +2103,20 @@ HUDView::DrawTarget()
if (mode != HUD_MODE_ILS) {
if (tgt_ship->IsStarship()) {
range_rect.y += 10;
- sprintf_s(txt, "%s %03d", Game::GetText("HUDView.symbol.shield").data(), (int) tgt_ship->ShieldStrength());
+ sprintf_s(txt, "%s %03d", Game::GetInstance()->GetText("HUDView.symbol.shield").data(), (int) tgt_ship->ShieldStrength());
DrawHUDText(TXT_TARGET_SHIELD, txt, range_rect, DT_RIGHT);
}
range_rect.y += 10;
- sprintf_s(txt, "%s %03d", Game::GetText("HUDView.symbol.hull").data(), (int) (tgt_ship->Integrity() / tgt_ship->Design()->integrity * 100));
+ sprintf_s(txt, "%s %03d", Game::GetInstance()->GetText("HUDView.symbol.hull").data(), (int) (tgt_ship->Integrity() / tgt_ship->Design()->integrity * 100));
DrawHUDText(TXT_TARGET_HULL, txt, range_rect, DT_RIGHT);
System* sys = ship->GetSubTarget();
if (sys) {
Color stat = hud_color;
- static DWORD blink = Game::RealTime();
+ static DWORD blink = Game::GetInstance()->RealTime();
- int blink_delta = Game::RealTime() - blink;
+ int blink_delta = Game::GetInstance()->RealTime() - blink;
sprintf_s(txt, "%s %03d", sys->Abbreviation(), (int) sys->Availability());
switch (sys->Status()) {
@@ -2130,7 +2130,7 @@ HUDView::DrawTarget()
}
if (blink_delta > 500)
- blink = Game::RealTime();
+ blink = Game::GetInstance()->RealTime();
range_rect.y += 10;
DrawHUDText(TXT_TARGET_SUB, txt, range_rect, DT_RIGHT);
@@ -2177,7 +2177,7 @@ HUDView::DrawNavInfo()
if (big_font)
hud_text[TXT_NAV_INDEX].font = big_font;
- DrawHUDText(TXT_NAV_INDEX, Game::GetText("HUDView.Auto-Nav"), info_rect, DT_CENTER);
+ DrawHUDText(TXT_NAV_INDEX, Game::GetInstance()->GetText("HUDView.Auto-Nav"), info_rect, DT_CENTER);
}
return;
@@ -2210,9 +2210,9 @@ HUDView::DrawNavInfo()
info_rect.x = width - info_rect.w - 8;
if (ship->IsAutoNavEngaged())
- sprintf_s(txt, "%s %d", Game::GetText("HUDView.Auto-Nav").data(), index);
+ sprintf_s(txt, "%s %d", Game::GetInstance()->GetText("HUDView.Auto-Nav").data(), index);
else
- sprintf_s(txt, "%s %d", Game::GetText("HUDView.Nav").data(), index);
+ sprintf_s(txt, "%s %d", Game::GetInstance()->GetText("HUDView.Nav").data(), index);
DrawHUDText(TXT_NAV_INDEX, txt, info_rect, DT_RIGHT);
info_rect.y += 10;
@@ -2225,7 +2225,7 @@ HUDView::DrawNavInfo()
if (etr > 3600) {
info_rect.y += 10;
- sprintf_s(txt, "%s XX:XX", Game::GetText("HUDView.time-enroute").data());
+ sprintf_s(txt, "%s XX:XX", Game::GetInstance()->GetText("HUDView.time-enroute").data());
DrawHUDText(TXT_NAV_ETR, txt, info_rect, DT_RIGHT);
}
else if (etr > 0) {
@@ -2233,7 +2233,7 @@ HUDView::DrawNavInfo()
int minutes = (etr/60) % 60;
int seconds = (etr ) % 60;
- sprintf_s(txt, "%s %2d:%02d", Game::GetText("HUDView.time-enroute").data(), minutes, seconds);
+ sprintf_s(txt, "%s %2d:%02d", Game::GetInstance()->GetText("HUDView.time-enroute").data(), minutes, seconds);
DrawHUDText(TXT_NAV_ETR, txt, info_rect, DT_RIGHT);
}
@@ -2243,7 +2243,7 @@ HUDView::DrawNavInfo()
int hold = (int) navpt->HoldTime();
int minutes = (hold/60) % 60;
int seconds = (hold ) % 60;
- sprintf_s(txt, "%s %2d:%02d", Game::GetText("HUDView.HOLD").data(), minutes, seconds);
+ sprintf_s(txt, "%s %2d:%02d", Game::GetInstance()->GetText("HUDView.HOLD").data(), minutes, seconds);
DrawHUDText(TXT_NAV_HOLD, txt, info_rect, DT_RIGHT);
}
}
@@ -2647,7 +2647,7 @@ HUDView::DrawWarningPanel()
}
if (ship) {
- if (Game::MaxTexSize() > 128) {
+ if (Game::GetInstance()->MaxTexSize() > 128) {
warn_left_sprite->Show();
warn_right_sprite->Show();
}
@@ -2656,19 +2656,19 @@ HUDView::DrawWarningPanel()
int y = cockpit_hud_texture ? 410 : height-97;
int c = cockpit_hud_texture ? 3 : 4;
- static DWORD blink = Game::RealTime();
+ static DWORD blink = Game::GetInstance()->RealTime();
for (int index = 0; index < 12; index++) {
int stat = -1;
- Text abrv = Game::GetText("HUDView.UNKNOWN");
+ Text abrv = Game::GetInstance()->GetText("HUDView.UNKNOWN");
switch (index) {
- case 0: stat = GetReactorStatus(ship); abrv = Game::GetText("HUDView.REACTOR"); break;
- case 1: stat = GetDriveStatus(ship); abrv = Game::GetText("HUDView.DRIVE"); break;
- case 2: stat = GetQuantumStatus(ship); abrv = Game::GetText("HUDView.QUANTUM"); break;
- case 3: stat = GetShieldStatus(ship); abrv = Game::GetText("HUDView.SHIELD");
+ case 0: stat = GetReactorStatus(ship); abrv = Game::GetInstance()->GetText("HUDView.REACTOR"); break;
+ case 1: stat = GetDriveStatus(ship); abrv = Game::GetInstance()->GetText("HUDView.DRIVE"); break;
+ case 2: stat = GetQuantumStatus(ship); abrv = Game::GetInstance()->GetText("HUDView.QUANTUM"); break;
+ case 3: stat = GetShieldStatus(ship); abrv = Game::GetInstance()->GetText("HUDView.SHIELD");
if (ship->GetShield() == 0 && ship->GetDecoy())
- abrv = Game::GetText("HUDView.DECOY");
+ abrv = Game::GetInstance()->GetText("HUDView.DECOY");
break;
case 4:
@@ -2681,10 +2681,10 @@ HUDView::DrawWarningPanel()
}
break;
- case 8: stat = GetSensorStatus(ship); abrv = Game::GetText("HUDView.SENSOR"); break;
- case 9: stat = GetComputerStatus(ship); abrv = Game::GetText("HUDView.COMPUTER"); break;
- case 10: stat = GetThrusterStatus(ship); abrv = Game::GetText("HUDView.THRUSTER"); break;
- case 11: stat = GetFlightDeckStatus(ship);abrv = Game::GetText("HUDView.FLTDECK"); break;
+ case 8: stat = GetSensorStatus(ship); abrv = Game::GetInstance()->GetText("HUDView.SENSOR"); break;
+ case 9: stat = GetComputerStatus(ship); abrv = Game::GetInstance()->GetText("HUDView.COMPUTER"); break;
+ case 10: stat = GetThrusterStatus(ship); abrv = Game::GetInstance()->GetText("HUDView.THRUSTER"); break;
+ case 11: stat = GetFlightDeckStatus(ship);abrv = Game::GetInstance()->GetText("HUDView.FLTDECK"); break;
}
Rect warn_rect(x, y, box_width, box_height);
@@ -2697,7 +2697,7 @@ HUDView::DrawWarningPanel()
Color tc = status_color;
if (stat != System::NOMINAL) {
- if (Game::RealTime() - blink < 250) {
+ if (Game::GetInstance()->RealTime() - blink < 250) {
tc = cockpit_hud_texture ? txt_color : Color(8,8,8);
}
}
@@ -2739,8 +2739,8 @@ HUDView::DrawWarningPanel()
}
}
- if (Game::RealTime() - blink > 500)
- blink = Game::RealTime();
+ if (Game::GetInstance()->RealTime() - blink > 500)
+ blink = Game::GetInstance()->RealTime();
// reset for next time
SetStatusColor(System::NOMINAL);
@@ -2754,7 +2754,7 @@ HUDView::DrawInstructions()
{
if (!ship) return;
- if (Game::MaxTexSize() > 128) {
+ if (Game::GetInstance()->MaxTexSize() > 128) {
instr_left_sprite->Show();
instr_right_sprite->Show();
}
@@ -2810,7 +2810,7 @@ HUDView::DrawInstructions()
else {
hud_text[TXT_CAUTION_TXT].color = standard_txt_colors[color];
- DrawHUDText(TXT_CAUTION_TXT, Game::GetText("HUDView.No-Instructions"), r, DT_LEFT, HUD_MIXED_CASE);
+ DrawHUDText(TXT_CAUTION_TXT, Game::GetInstance()->GetText("HUDView.No-Instructions"), r, DT_LEFT, HUD_MIXED_CASE);
}
}
@@ -2875,7 +2875,7 @@ HUDView::DrawMessages()
// age messages:
for (int i = 0; i < MAX_MSG; i++) {
if (msg_time[i] > 0) {
- msg_time[i] -= Game::GUITime();
+ msg_time[i] -= Game::GetInstance()->GUITime();
if (msg_time[i] <= 0) {
msg_time[i] = 0;
@@ -3516,9 +3516,9 @@ HUDView::Refresh()
Rect dock_rect(width/2-100, height/6, 200, 20);
if (ship->IsAirborne())
- DrawHUDText(TXT_AUTO, Game::GetText("HUDView.SUCCESSFUL-LANDING"), dock_rect, DT_CENTER);
+ DrawHUDText(TXT_AUTO, Game::GetInstance()->GetText("HUDView.SUCCESSFUL-LANDING"), dock_rect, DT_CENTER);
else
- DrawHUDText(TXT_AUTO, Game::GetText("HUDView.DOCKING-COMPLETE"), dock_rect, DT_CENTER);
+ DrawHUDText(TXT_AUTO, Game::GetInstance()->GetText("HUDView.DOCKING-COMPLETE"), dock_rect, DT_CENTER);
}
return;
}
@@ -3575,7 +3575,7 @@ HUDView::Refresh()
int fov_degrees = 180 - 2 * (int)(projector->XAngle()*180/PI);
if (fov_degrees > 90)
- DrawHUDText(TXT_CAM_ANGLE, Game::GetText("HUDView.Wide-Angle"), fov_rect, DT_CENTER);
+ DrawHUDText(TXT_CAM_ANGLE, Game::GetInstance()->GetText("HUDView.Wide-Angle"), fov_rect, DT_CENTER);
fov_rect.y = 20;
DrawHUDText(TXT_CAM_MODE, CameraDirector::GetModeName(), fov_rect, DT_CENTER);
@@ -3727,7 +3727,7 @@ HUDView::ExecFrame()
}
if (!tactical) {
- if (Game::MaxTexSize() > 128) {
+ if (Game::GetInstance()->MaxTexSize() > 128) {
hud_left_sprite->Show();
hud_right_sprite->Show();
}
@@ -3938,7 +3938,7 @@ HUDView::RestoreHUD()
icon_target_sprite->Hide();
}
- if (!tactical && Game::MaxTexSize() > 128) {
+ if (!tactical && Game::GetInstance()->MaxTexSize() > 128) {
hud_left_sprite->Show();
hud_right_sprite->Show();
}
@@ -4039,7 +4039,7 @@ HUDView::SetHUDColorSet(int c)
ColorizeBitmap(cross3, cross3_shade, hud_color, true);
ColorizeBitmap(cross4, cross4_shade, hud_color, true);
- if (Game::MaxTexSize() > 128) {
+ if (Game::GetInstance()->MaxTexSize() > 128) {
ColorizeBitmap(hud_left_air, hud_left_shade_air, hud_color);
ColorizeBitmap(hud_right_air, hud_right_shade_air, hud_color);
ColorizeBitmap(hud_left_fighter, hud_left_shade_fighter, hud_color);
@@ -4186,10 +4186,10 @@ HUDView::ColorizeBitmap(Bitmap& img, BYTE* shades, Color color, bool force_alpha
{
if (!shades) return;
- int max_tex_size = Game::MaxTexSize();
+ int max_tex_size = Game::GetInstance()->MaxTexSize();
if (max_tex_size < 128)
- Game::SetMaxTexSize(128);
+ Game::GetInstance()->SetMaxTexSize(128);
if (hud_view && hud_view->cockpit_hud_texture && !force_alpha) {
img.FillColor(Color::Black);
@@ -4216,7 +4216,7 @@ HUDView::ColorizeBitmap(Bitmap& img, BYTE* shades, Color color, bool force_alpha
}
if (max_tex_size < 128)
- Game::SetMaxTexSize(max_tex_size);
+ Game::GetInstance()->SetMaxTexSize(max_tex_size);
}
// +--------------------------------------------------------------------+
@@ -4247,7 +4247,7 @@ HUDView::MouseFrame()
Starshatter* stars = Starshatter::GetInstance();
if (mouse_index == TXT_PAUSED)
- stars->Pause(!Game::Paused());
+ stars->Pause(!Game::GetInstance()->Paused());
if (mouse_index == TXT_GEAR_DOWN)
ship->ToggleGear();
diff --git a/Stars45/Hangar.cpp b/Stars45/Hangar.cpp
index 60f5f34..3aaaddc 100644
--- a/Stars45/Hangar.cpp
+++ b/Stars45/Hangar.cpp
@@ -666,7 +666,7 @@ Hangar::SquadronName(int n) const
if (n >= 0 && n < nsquadrons)
return names[n];
- return Game::GetText("Unknown");
+ return Game::GetInstance()->GetText("Unknown");
}
int
@@ -769,22 +769,22 @@ Hangar::StatusName(const HangarSlot* s) const
{
switch (s->state) {
default:
- case UNAVAIL: return Game::GetText("hangar.UNAVAIL");
- case MAINT: return Game::GetText("hangar.MAINT");
- case STORAGE: return Game::GetText("hangar.STORAGE");
- case PREP: return Game::GetText("hangar.PREP");
- case ALERT: return Game::GetText("hangar.ALERT");
+ case UNAVAIL: return Game::GetInstance()->GetText("hangar.UNAVAIL");
+ case MAINT: return Game::GetInstance()->GetText("hangar.MAINT");
+ case STORAGE: return Game::GetInstance()->GetText("hangar.STORAGE");
+ case PREP: return Game::GetInstance()->GetText("hangar.PREP");
+ case ALERT: return Game::GetInstance()->GetText("hangar.ALERT");
case QUEUED: {
- Text state = Game::GetText("hangar.QUEUED");
+ Text state = Game::GetInstance()->GetText("hangar.QUEUED");
char seq[8];
sprintf_s(seq, " %d", s->deck->Sequence(s->slot));
return state + seq;
}
- case LOCKED: return Game::GetText("hangar.LOCKED");
- case LAUNCH: return Game::GetText("hangar.LAUNCH");
- case ACTIVE: return Game::GetText("hangar.ACTIVE");
- case APPROACH: return Game::GetText("hangar.APPROACH");
- case RECOVERY: return Game::GetText("hangar.RECOVERY");
+ case LOCKED: return Game::GetInstance()->GetText("hangar.LOCKED");
+ case LAUNCH: return Game::GetInstance()->GetText("hangar.LAUNCH");
+ case ACTIVE: return Game::GetInstance()->GetText("hangar.ACTIVE");
+ case APPROACH: return Game::GetInstance()->GetText("hangar.APPROACH");
+ case RECOVERY: return Game::GetInstance()->GetText("hangar.RECOVERY");
}
}
diff --git a/Stars45/Instruction.cpp b/Stars45/Instruction.cpp
index 5569709..368cbf5 100644
--- a/Stars45/Instruction.cpp
+++ b/Stars45/Instruction.cpp
@@ -340,67 +340,67 @@ Instruction::GetShortDescription() const
switch (action) {
case VECTOR:
if (farcast)
- sprintf_s(desc, Game::GetText("instr.short.farcast").data(), rgn_name.data());
+ sprintf_s(desc, Game::GetInstance()->GetText("instr.short.farcast").data(), rgn_name.data());
else
- sprintf_s(desc, Game::GetText("instr.short.vector").data(), rgn_name.data());
+ sprintf_s(desc, Game::GetInstance()->GetText("instr.short.vector").data(), rgn_name.data());
break;
case LAUNCH:
- sprintf_s(desc, Game::GetText("instr.short.launch").data(), tgt_name.data());
+ sprintf_s(desc, Game::GetInstance()->GetText("instr.short.launch").data(), tgt_name.data());
break;
case DOCK:
- sprintf_s(desc, Game::GetText("instr.short.dock").data(), tgt_name.data());
+ sprintf_s(desc, Game::GetInstance()->GetText("instr.short.dock").data(), tgt_name.data());
break;
case RTB:
- sprintf_s(desc, Game::GetText("instr.short.return-to-base").data());
+ sprintf_s(desc, Game::GetInstance()->GetText("instr.short.return-to-base").data());
break;
case DEFEND:
if (priority == PRIMARY) {
- sprintf_s(desc, Game::GetText("instr.short.defend").data(), ActionName(action), tgt_desc.data());
+ sprintf_s(desc, Game::GetInstance()->GetText("instr.short.defend").data(), ActionName(action), tgt_desc.data());
}
else {
- sprintf_s(desc, Game::GetText("instr.short.protect").data(), tgt_desc.data());
+ sprintf_s(desc, Game::GetInstance()->GetText("instr.short.protect").data(), tgt_desc.data());
}
break;
case ESCORT:
if (priority == PRIMARY) {
- sprintf_s(desc, Game::GetText("instr.short.escort").data(), ActionName(action), tgt_desc.data());
+ sprintf_s(desc, Game::GetInstance()->GetText("instr.short.escort").data(), ActionName(action), tgt_desc.data());
}
else {
- sprintf_s(desc, Game::GetText("instr.short.protect").data(), tgt_desc.data());
+ sprintf_s(desc, Game::GetInstance()->GetText("instr.short.protect").data(), tgt_desc.data());
}
break;
case PATROL:
- sprintf_s(desc, Game::GetText("instr.short.patrol").data(),
+ sprintf_s(desc, Game::GetInstance()->GetText("instr.short.patrol").data(),
tgt_desc.data(),
rgn_name.data());
break;
case SWEEP:
- sprintf_s(desc, Game::GetText("instr.short.sweep").data(),
+ sprintf_s(desc, Game::GetInstance()->GetText("instr.short.sweep").data(),
tgt_desc.data(),
rgn_name.data());
break;
case INTERCEPT:
- sprintf_s(desc, Game::GetText("instr.short.intercept").data(), tgt_desc.data());
+ sprintf_s(desc, Game::GetInstance()->GetText("instr.short.intercept").data(), tgt_desc.data());
break;
case STRIKE:
- sprintf_s(desc, Game::GetText("instr.short.strike").data(), tgt_desc.data());
+ sprintf_s(desc, Game::GetInstance()->GetText("instr.short.strike").data(), tgt_desc.data());
break;
case ASSAULT:
- sprintf_s(desc, Game::GetText("instr.short.assault").data(), tgt_desc.data());
+ sprintf_s(desc, Game::GetInstance()->GetText("instr.short.assault").data(), tgt_desc.data());
break;
case RECON:
- sprintf_s(desc, Game::GetText("instr.short.recon").data(), tgt_desc.data());
+ sprintf_s(desc, Game::GetInstance()->GetText("instr.short.recon").data(), tgt_desc.data());
break;
default:
@@ -410,7 +410,7 @@ Instruction::GetShortDescription() const
if (status != PENDING) {
strcat_s(desc, " - ");
- strcat_s(desc, Game::GetText(StatusName(status)));
+ strcat_s(desc, Game::GetInstance()->GetText(StatusName(status)));
}
return desc;
@@ -426,67 +426,67 @@ Instruction::GetDescription() const
switch (action) {
case VECTOR:
if (farcast)
- sprintf_s(desc, Game::GetText("instr.long.farcast").data(), rgn_name.data());
+ sprintf_s(desc, Game::GetInstance()->GetText("instr.long.farcast").data(), rgn_name.data());
else
- sprintf_s(desc, Game::GetText("instr.long.vector").data(), rgn_name.data());
+ sprintf_s(desc, Game::GetInstance()->GetText("instr.long.vector").data(), rgn_name.data());
break;
case LAUNCH:
- sprintf_s(desc, Game::GetText("instr.long.launch").data(), tgt_name.data());
+ sprintf_s(desc, Game::GetInstance()->GetText("instr.long.launch").data(), tgt_name.data());
break;
case DOCK:
- sprintf_s(desc, Game::GetText("instr.long.dock").data(), tgt_name.data());
+ sprintf_s(desc, Game::GetInstance()->GetText("instr.long.dock").data(), tgt_name.data());
break;
case RTB:
- sprintf_s(desc, Game::GetText("instr.long.return-to-base").data());
+ sprintf_s(desc, Game::GetInstance()->GetText("instr.long.return-to-base").data());
break;
case DEFEND:
if (priority == PRIMARY) {
- sprintf_s(desc, Game::GetText("instr.long.defend").data(), ActionName(action), tgt_desc.data());
+ sprintf_s(desc, Game::GetInstance()->GetText("instr.long.defend").data(), ActionName(action), tgt_desc.data());
}
else {
- sprintf_s(desc, Game::GetText("instr.long.protect").data(), tgt_desc.data());
+ sprintf_s(desc, Game::GetInstance()->GetText("instr.long.protect").data(), tgt_desc.data());
}
break;
case ESCORT:
if (priority == PRIMARY) {
- sprintf_s(desc, Game::GetText("instr.long.escort").data(), ActionName(action), tgt_desc.data());
+ sprintf_s(desc, Game::GetInstance()->GetText("instr.long.escort").data(), ActionName(action), tgt_desc.data());
}
else {
- sprintf_s(desc, Game::GetText("instr.long.protect").data(), tgt_desc.data());
+ sprintf_s(desc, Game::GetInstance()->GetText("instr.long.protect").data(), tgt_desc.data());
}
break;
case PATROL:
- sprintf_s(desc, Game::GetText("instr.long.patrol").data(),
+ sprintf_s(desc, Game::GetInstance()->GetText("instr.long.patrol").data(),
tgt_desc.data(),
rgn_name.data());
break;
case SWEEP:
- sprintf_s(desc, Game::GetText("instr.long.sweep").data(),
+ sprintf_s(desc, Game::GetInstance()->GetText("instr.long.sweep").data(),
tgt_desc.data(),
rgn_name.data());
break;
case INTERCEPT:
- sprintf_s(desc, Game::GetText("instr.long.intercept").data(), tgt_desc.data());
+ sprintf_s(desc, Game::GetInstance()->GetText("instr.long.intercept").data(), tgt_desc.data());
break;
case STRIKE:
- sprintf_s(desc, Game::GetText("instr.long.strike").data(), tgt_desc.data());
+ sprintf_s(desc, Game::GetInstance()->GetText("instr.long.strike").data(), tgt_desc.data());
break;
case ASSAULT:
- sprintf_s(desc, Game::GetText("instr.long.assault").data(), tgt_desc.data());
+ sprintf_s(desc, Game::GetInstance()->GetText("instr.long.assault").data(), tgt_desc.data());
break;
case RECON:
- sprintf_s(desc, Game::GetText("instr.long.recon").data(), tgt_desc.data());
+ sprintf_s(desc, Game::GetInstance()->GetText("instr.long.recon").data(), tgt_desc.data());
break;
default:
@@ -496,7 +496,7 @@ Instruction::GetDescription() const
if (status != PENDING) {
strcat_s(desc, " - ");
- strcat_s(desc, Game::GetText(StatusName(status)));
+ strcat_s(desc, Game::GetInstance()->GetText(StatusName(status)));
}
return desc;
diff --git a/Stars45/JoyDlg.cpp b/Stars45/JoyDlg.cpp
index 19a2f20..acb2f93 100644
--- a/Stars45/JoyDlg.cpp
+++ b/Stars45/JoyDlg.cpp
@@ -112,12 +112,12 @@ JoyDlg::ExecFrame()
Button* b = axis_button[selected_axis];
if (sample_axis >= 0) {
- b->SetText(Game::GetText(joy_axis_names[sample_axis]));
+ b->SetText(Game::GetInstance()->GetText(joy_axis_names[sample_axis]));
map_axis[selected_axis] = sample_axis;
}
else
- b->SetText(Game::GetText("JoyDlg.select"));
+ b->SetText(Game::GetInstance()->GetText("JoyDlg.select"));
}
}
}
@@ -136,11 +136,11 @@ JoyDlg::Show()
int inv = Joystick::GetAxisInv(i);
if (map >= 0 && map < 8) {
- b->SetText(Game::GetText(joy_axis_names[map]));
+ b->SetText(Game::GetInstance()->GetText(joy_axis_names[map]));
map_axis[i] = map;
}
else {
- b->SetText(Game::GetText("JoyDlg.unmapped"));
+ b->SetText(Game::GetInstance()->GetText("JoyDlg.unmapped"));
}
b->SetButtonState(0);
@@ -159,11 +159,11 @@ JoyDlg::OnAxis(AWEvent* event)
{
for (int i = 0; i < 4; i++) {
int map = map_axis[i];
- Text name = Game::GetText("JoyDlg.unmapped");
+ Text name = Game::GetInstance()->GetText("JoyDlg.unmapped");
Button* b = axis_button[i];
if (map >= 0 && map < 8)
- name = Game::GetText(joy_axis_names[map]);
+ name = Game::GetInstance()->GetText(joy_axis_names[map]);
if (b) {
if (b == event->window) {
@@ -173,7 +173,7 @@ JoyDlg::OnAxis(AWEvent* event)
selected_axis = -1;
}
else {
- b->SetText(Game::GetText("JoyDlg.select"));
+ b->SetText(Game::GetInstance()->GetText("JoyDlg.select"));
b->SetButtonState(1);
selected_axis = i;
}
diff --git a/Stars45/Joystick.cpp b/Stars45/Joystick.cpp
index 5d1bbdd..916068e 100644
--- a/Stars45/Joystick.cpp
+++ b/Stars45/Joystick.cpp
@@ -86,7 +86,7 @@ Joystick::Joystick()
}
else if (!pdi) {
- HRESULT hr = DirectInput8Create(Game::GetHINST(),
+ HRESULT hr = DirectInput8Create(Game::GetInstance()->GetHINST(),
DIRECTINPUT_VERSION,
IID_IDirectInput7,
(void**)&pdi,
@@ -269,7 +269,7 @@ bool CreateDevice(int select)
}
// Set the coop level:
- hr = pdev->SetCooperativeLevel(Game::GetHWND(), DISCL_NONEXCLUSIVE | DISCL_FOREGROUND);
+ hr = pdev->SetCooperativeLevel(Game::GetInstance()->GetHWND(), DISCL_NONEXCLUSIVE | DISCL_FOREGROUND);
if (hr != DI_OK) {
DirectInputError("Set Cooperative Level failed", hr);
diff --git a/Stars45/LandingGear.cpp b/Stars45/LandingGear.cpp
index b6d14bb..934ac76 100644
--- a/Stars45/LandingGear.cpp
+++ b/Stars45/LandingGear.cpp
@@ -31,8 +31,8 @@ LandingGear::LandingGear()
: System(MISC_SYSTEM, 0, "Landing Gear", 1, 1, 1, 1),
state(GEAR_UP), transit(0), ngear(0), clearance(0)
{
- name = Game::GetText("sys.landing-gear");
- abrv = Game::GetText("sys.landing-gear.abrv");
+ name = Game::GetInstance()->GetText("sys.landing-gear");
+ abrv = Game::GetInstance()->GetText("sys.landing-gear.abrv");
for (int i = 0; i < MAX_GEAR; i++) {
models[i] = 0;
diff --git a/Stars45/LoadDlg.cpp b/Stars45/LoadDlg.cpp
index 8340519..77b5a6f 100644
--- a/Stars45/LoadDlg.cpp
+++ b/Stars45/LoadDlg.cpp
@@ -58,13 +58,13 @@ LoadDlg::ExecFrame()
if (title) {
if (stars->GetGameMode() == Starshatter::CLOD_MODE ||
stars->GetGameMode() == Starshatter::CMPN_MODE)
- title->SetText(Game::GetText("LoadDlg.campaign"));
+ title->SetText(Game::GetInstance()->GetText("LoadDlg.campaign"));
else if (stars->GetGameMode() == Starshatter::MENU_MODE)
- title->SetText(Game::GetText("LoadDlg.tac-ref"));
+ title->SetText(Game::GetInstance()->GetText("LoadDlg.tac-ref"));
else
- title->SetText(Game::GetText("LoadDlg.mission"));
+ title->SetText(Game::GetInstance()->GetText("LoadDlg.mission"));
}
activity->SetText(stars->GetLoadActivity());
diff --git a/Stars45/LoadScreen.cpp b/Stars45/LoadScreen.cpp
index 7fdb1be..e541a36 100644
--- a/Stars45/LoadScreen.cpp
+++ b/Stars45/LoadScreen.cpp
@@ -86,7 +86,7 @@ LoadScreen::TearDown()
void
LoadScreen::ExecFrame()
{
- Game::SetScreenColor(Color::Black);
+ Game::GetInstance()->SetScreenColor(Color::Black);
if (load_dlg && load_dlg->IsShown())
load_dlg->ExecFrame();
diff --git a/Stars45/MCIWave.cpp b/Stars45/MCIWave.cpp
index be72e27..cf92c2f 100644
--- a/Stars45/MCIWave.cpp
+++ b/Stars45/MCIWave.cpp
@@ -26,7 +26,7 @@ static MMRESULT wav_err;
static int mci_send_string(const char* cmd_str)
{
- mci_err = mciSendString(cmd_str, ret_str, sizeof(ret_str), Game::GetHWND());
+ mci_err = mciSendString(cmd_str, ret_str, sizeof(ret_str), Game::GetInstance()->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/MapView.cpp b/Stars45/MapView.cpp
index 3d6145a..a0e2a86 100644
--- a/Stars45/MapView.cpp
+++ b/Stars45/MapView.cpp
@@ -280,7 +280,7 @@ MapView::BuildMenu()
{
ClearMenu();
- map_system_menu = new(__FILE__,__LINE__) Menu(Game::GetText("MapView.menu.STARSYSTEM"));
+ map_system_menu = new(__FILE__,__LINE__) Menu(Game::GetInstance()->GetText("MapView.menu.STARSYSTEM"));
if (system_list.size() > 0) {
int i = 0;
@@ -296,64 +296,64 @@ MapView::BuildMenu()
map_system_menu->AddItem(system->Name(), MAP_SYSTEM);
}
- map_sector_menu = new(__FILE__,__LINE__) Menu(Game::GetText("MapView.menu.SECTOR"));
+ map_sector_menu = new(__FILE__,__LINE__) Menu(Game::GetInstance()->GetText("MapView.menu.SECTOR"));
for (int i = 0; i < regions.size(); i++) {
Orbital* rgn = regions[i];
map_sector_menu->AddItem(rgn->Name(), MAP_SECTOR + i);
}
- map_menu = new(__FILE__,__LINE__) Menu(Game::GetText("MapView.menu.MAP"));
+ map_menu = new(__FILE__,__LINE__) Menu(Game::GetInstance()->GetText("MapView.menu.MAP"));
map_menu->AddMenu("System", map_system_menu);
map_menu->AddMenu("Sector", map_sector_menu);
if (ship || mission) {
- ship_menu = new(__FILE__,__LINE__) Menu(Game::GetText("MapView.menu.SHIP"));
- ship_menu->AddMenu(Game::GetText("MapView.item.Starsystem"), map_system_menu);
- ship_menu->AddMenu(Game::GetText("MapView.item.Sector"), map_sector_menu);
+ ship_menu = new(__FILE__,__LINE__) Menu(Game::GetInstance()->GetText("MapView.menu.SHIP"));
+ ship_menu->AddMenu(Game::GetInstance()->GetText("MapView.item.Starsystem"), map_system_menu);
+ ship_menu->AddMenu(Game::GetInstance()->GetText("MapView.item.Sector"), map_sector_menu);
ship_menu->AddItem("", 0);
- ship_menu->AddItem(Game::GetText("MapView.item.Add-Nav"), MAP_ADDNAV);
- ship_menu->AddItem(Game::GetText("MapView.item.Clear-All"), MAP_CLEAR);
+ ship_menu->AddItem(Game::GetInstance()->GetText("MapView.item.Add-Nav"), MAP_ADDNAV);
+ ship_menu->AddItem(Game::GetInstance()->GetText("MapView.item.Clear-All"), MAP_CLEAR);
- action_menu = new(__FILE__,__LINE__) Menu(Game::GetText("MapView.menu.ACTION"));
+ action_menu = new(__FILE__,__LINE__) Menu(Game::GetInstance()->GetText("MapView.menu.ACTION"));
for (int i = 0; i < Instruction::NUM_ACTIONS; i++) {
- action_menu->AddItem(Game::GetText(Text("MapView.item.") + Instruction::ActionName(i)), MAP_ACTION + i);
+ action_menu->AddItem(Game::GetInstance()->GetText(Text("MapView.item.") + Instruction::ActionName(i)), MAP_ACTION + i);
}
- formation_menu = new(__FILE__,__LINE__) Menu(Game::GetText("MapView.menu.FORMATION"));
+ formation_menu = new(__FILE__,__LINE__) Menu(Game::GetInstance()->GetText("MapView.menu.FORMATION"));
for (int i = 0; i < Instruction::NUM_FORMATIONS; i++) {
- formation_menu->AddItem(Game::GetText(Text("MapView.item.") + Instruction::FormationName(i)), MAP_FORMATION + i);
+ formation_menu->AddItem(Game::GetInstance()->GetText(Text("MapView.item.") + Instruction::FormationName(i)), MAP_FORMATION + i);
}
- speed_menu = new(__FILE__,__LINE__) Menu(Game::GetText("MapView.menu.SPEED"));
+ speed_menu = new(__FILE__,__LINE__) Menu(Game::GetInstance()->GetText("MapView.menu.SPEED"));
speed_menu->AddItem("250", MAP_SPEED + 0);
speed_menu->AddItem("500", MAP_SPEED + 1);
speed_menu->AddItem("750", MAP_SPEED + 2);
speed_menu->AddItem("1000", MAP_SPEED + 3);
- hold_menu = new(__FILE__,__LINE__) Menu(Game::GetText("MapView.menu.HOLD"));
- hold_menu->AddItem(Game::GetText("MapView.item.None"), MAP_HOLD + 0);
- hold_menu->AddItem(Game::GetText("MapView.item.1-Minute"), MAP_HOLD + 1);
- hold_menu->AddItem(Game::GetText("MapView.item.5-Minutes"), MAP_HOLD + 2);
- hold_menu->AddItem(Game::GetText("MapView.item.10-Minutes"), MAP_HOLD + 3);
- hold_menu->AddItem(Game::GetText("MapView.item.15-Minutes"), MAP_HOLD + 4);
-
- farcast_menu = new(__FILE__,__LINE__) Menu(Game::GetText("MapView.menu.FARCAST"));
- farcast_menu->AddItem(Game::GetText("MapView.item.Use-Quantum"), MAP_FARCAST + 0);
- farcast_menu->AddItem(Game::GetText("MapView.item.Use-Farcast"), MAP_FARCAST + 1);
-
- objective_menu = new(__FILE__,__LINE__) Menu(Game::GetText("MapView.menu.OBJECTIVE"));
-
- nav_menu = new(__FILE__,__LINE__) Menu(Game::GetText("MapView.menu.NAVPT"));
- nav_menu->AddMenu(Game::GetText("MapView.item.Action"), action_menu);
- nav_menu->AddMenu(Game::GetText("MapView.item.Objective"), objective_menu);
- nav_menu->AddMenu(Game::GetText("MapView.item.Formation"), formation_menu);
- nav_menu->AddMenu(Game::GetText("MapView.item.Speed"), speed_menu);
- nav_menu->AddMenu(Game::GetText("MapView.item.Hold"), hold_menu);
- nav_menu->AddMenu(Game::GetText("MapView.item.Farcast"), farcast_menu);
+ hold_menu = new(__FILE__,__LINE__) Menu(Game::GetInstance()->GetText("MapView.menu.HOLD"));
+ hold_menu->AddItem(Game::GetInstance()->GetText("MapView.item.None"), MAP_HOLD + 0);
+ hold_menu->AddItem(Game::GetInstance()->GetText("MapView.item.1-Minute"), MAP_HOLD + 1);
+ hold_menu->AddItem(Game::GetInstance()->GetText("MapView.item.5-Minutes"), MAP_HOLD + 2);
+ hold_menu->AddItem(Game::GetInstance()->GetText("MapView.item.10-Minutes"), MAP_HOLD + 3);
+ hold_menu->AddItem(Game::GetInstance()->GetText("MapView.item.15-Minutes"), MAP_HOLD + 4);
+
+ farcast_menu = new(__FILE__,__LINE__) Menu(Game::GetInstance()->GetText("MapView.menu.FARCAST"));
+ farcast_menu->AddItem(Game::GetInstance()->GetText("MapView.item.Use-Quantum"), MAP_FARCAST + 0);
+ farcast_menu->AddItem(Game::GetInstance()->GetText("MapView.item.Use-Farcast"), MAP_FARCAST + 1);
+
+ objective_menu = new(__FILE__,__LINE__) Menu(Game::GetInstance()->GetText("MapView.menu.OBJECTIVE"));
+
+ nav_menu = new(__FILE__,__LINE__) Menu(Game::GetInstance()->GetText("MapView.menu.NAVPT"));
+ nav_menu->AddMenu(Game::GetInstance()->GetText("MapView.item.Action"), action_menu);
+ nav_menu->AddMenu(Game::GetInstance()->GetText("MapView.item.Objective"), objective_menu);
+ nav_menu->AddMenu(Game::GetInstance()->GetText("MapView.item.Formation"), formation_menu);
+ nav_menu->AddMenu(Game::GetInstance()->GetText("MapView.item.Speed"), speed_menu);
+ nav_menu->AddMenu(Game::GetInstance()->GetText("MapView.item.Hold"), hold_menu);
+ nav_menu->AddMenu(Game::GetInstance()->GetText("MapView.item.Farcast"), farcast_menu);
nav_menu->AddItem("", 0);
- nav_menu->AddItem(Game::GetText("MapView.item.Add-Nav"), MAP_ADDNAV);
- nav_menu->AddItem(Game::GetText("MapView.item.Del-Nav"), MAP_DELETE);
+ nav_menu->AddItem(Game::GetInstance()->GetText("MapView.item.Add-Nav"), MAP_ADDNAV);
+ nav_menu->AddItem(Game::GetInstance()->GetText("MapView.item.Del-Nav"), MAP_DELETE);
}
else if (campaign) {
@@ -731,7 +731,7 @@ MapView::SelectNavpt(Instruction* navpt)
case Instruction::PATROL:
case Instruction::SWEEP:
case Instruction::RECON:
- objective_menu->AddItem(Game::GetText("MapView.item.not-available"), 0);
+ objective_menu->AddItem(Game::GetInstance()->GetText("MapView.item.not-available"), 0);
objective_menu->GetItem(0)->SetEnabled(false);
break;
@@ -767,7 +767,7 @@ MapView::SelectNavpt(Instruction* navpt)
}
else {
objective_menu->ClearItems();
- objective_menu->AddItem(Game::GetText("MapView.item.not-available"), 0);
+ objective_menu->AddItem(Game::GetInstance()->GetText("MapView.item.not-available"), 0);
objective_menu->GetItem(0)->SetEnabled(false);
}
}
@@ -1619,7 +1619,7 @@ MapView::Refresh()
if (!system) {
DrawGrid();
- DrawTabbedText(title_font, Game::GetText("MapView.item.no-system"));
+ DrawTabbedText(title_font, Game::GetInstance()->GetText("MapView.item.no-system"));
return;
}
@@ -1694,7 +1694,7 @@ MapView::DrawTitle()
void
MapView::DrawGalaxy()
{
- title = Game::GetText("MapView.title.Galaxy");
+ title = Game::GetInstance()->GetText("MapView.title.Galaxy");
DrawGrid();
double cx = rect.w/2;
@@ -1827,19 +1827,19 @@ MapView::DrawGalaxy()
void
MapView::DrawSystem()
{
- Text caption = Game::GetText("MapView.title.Starsystem");
+ Text caption = Game::GetInstance()->GetText("MapView.title.Starsystem");
caption += " ";
caption += system->Name();
if (current_ship) {
caption += "\n";
- caption += Game::GetText("MapView.title.Ship");
+ caption += Game::GetInstance()->GetText("MapView.title.Ship");
caption += " ";
caption += current_ship->Name();
}
else if (current_elem) {
caption += "\n";
- caption += Game::GetText("MapView.title.Ship");
+ caption += Game::GetInstance()->GetText("MapView.title.Ship");
caption += " ";
caption += current_elem->Name();
}
@@ -1883,7 +1883,7 @@ MapView::DrawSystem()
char r_txt[32];
FormatNumber(r_txt, system->Radius() * zoom);
char resolution[64];
- sprintf_s(resolution, "%s: %s", Game::GetText("MapView.info.Resolution").data(), r_txt);
+ sprintf_s(resolution, "%s: %s", Game::GetInstance()->GetText("MapView.info.Resolution").data(), r_txt);
active_window->SetFont(font);
Rect text_rect(4, 4, rect.w - 8, 24);
@@ -1897,19 +1897,19 @@ MapView::DrawRegion()
{
OrbitalRegion* rgn = (OrbitalRegion*) regions[current_region];
- Text caption = Game::GetText("MapView.title.Sector");
+ Text caption = Game::GetInstance()->GetText("MapView.title.Sector");
caption += " ";
caption += rgn->Name();
if (current_ship) {
caption += "\n";
- caption += Game::GetText("MapView.title.Ship");
+ caption += Game::GetInstance()->GetText("MapView.title.Ship");
caption += " ";
caption += current_ship->Name();
}
else if (current_elem) {
caption += "\n";
- caption += Game::GetText("MapView.title.Ship");
+ caption += Game::GetInstance()->GetText("MapView.title.Ship");
caption += " ";
caption += current_elem->Name();
}
@@ -2057,7 +2057,7 @@ MapView::DrawRegion()
char r_txt[32];
FormatNumber(r_txt, r*2);
char resolution[64];
- sprintf_s(resolution, "%s: %s", Game::GetText("MapView.info.Resolution").data(), r_txt);
+ sprintf_s(resolution, "%s: %s", Game::GetInstance()->GetText("MapView.info.Resolution").data(), r_txt);
active_window->SetFont(font);
Rect text_rect(4, 4, rect.w - 8, 24);
@@ -2652,15 +2652,15 @@ MissionElement* elem)
if (navpt == current_navpt) {
if (navpt->TargetName() && strlen(navpt->TargetName())) {
- sprintf_s(buf, "%s %s", Game::GetText(Text("MapView.item.") + Instruction::ActionName(navpt->Action())).data(), navpt->TargetName());
+ sprintf_s(buf, "%s %s", Game::GetInstance()->GetText(Text("MapView.item.") + Instruction::ActionName(navpt->Action())).data(), navpt->TargetName());
window->Print(x2+3, y1+10, buf);
}
else {
- sprintf_s(buf, "%s", Game::GetText(Text("MapView.item.") + Instruction::ActionName(navpt->Action())).data());
+ sprintf_s(buf, "%s", Game::GetInstance()->GetText(Text("MapView.item.") + Instruction::ActionName(navpt->Action())).data());
window->Print(x2+3, y1+10, buf);
}
- sprintf_s(buf, "%s", Game::GetText(Text("MapView.item.") + Instruction::FormationName(navpt->Formation())).data());
+ sprintf_s(buf, "%s", Game::GetInstance()->GetText(Text("MapView.item.") + Instruction::FormationName(navpt->Formation())).data());
window->Print(x2+3, y1+20, buf);
sprintf_s(buf, "%d", navpt->Speed());
@@ -2670,7 +2670,7 @@ MissionElement* elem)
char hold_time[32];
FormatTime(hold_time, navpt->HoldTime());
- sprintf_s(buf, "%s %s", Game::GetText("MapView.item.Hold").data(), hold_time);
+ sprintf_s(buf, "%s %s", Game::GetInstance()->GetText("MapView.item.Hold").data(), hold_time);
window->Print(x2+3, y1+40, buf);
}
}
diff --git a/Stars45/MenuScreen.cpp b/Stars45/MenuScreen.cpp
index 24ad6b7..9c53699 100644
--- a/Stars45/MenuScreen.cpp
+++ b/Stars45/MenuScreen.cpp
@@ -331,7 +331,7 @@ MenuScreen::TearDown()
void
MenuScreen::ExecFrame()
{
- Game::SetScreenColor(Color::Black);
+ Game::GetInstance()->SetScreenColor(Color::Black);
if (menudlg && menudlg->IsShown())
menudlg->ExecFrame();
diff --git a/Stars45/MenuView.cpp b/Stars45/MenuView.cpp
index 216bbfd..6a261a9 100644
--- a/Stars45/MenuView.cpp
+++ b/Stars45/MenuView.cpp
@@ -78,13 +78,13 @@ MenuView::DoMouseFrame()
if (Mouse::RButton()) {
MouseController* mouse_con = MouseController::GetInstance();
if (!right_down && (!mouse_con || !mouse_con->Active())) {
- rbutton_latch = Game::RealTime();
+ rbutton_latch = Game::GetInstance()->RealTime();
right_down = true;
show_menu = false;
}
}
else {
- if (right_down && (Game::RealTime() - rbutton_latch < 250)) {
+ if (right_down && (Game::GetInstance()->RealTime() - rbutton_latch < 250)) {
right_start.x = Mouse::X() - offset.x;
right_start.y = Mouse::Y() - offset.y;
show_menu = true;
diff --git a/Stars45/Mfd.cpp b/Stars45/Mfd.cpp
index e01e1cb..377eabe 100644
--- a/Stars45/Mfd.cpp
+++ b/Stars45/Mfd.cpp
@@ -326,12 +326,12 @@ MFD::DrawSensorLabels(const char* mfd_mode)
int scan_y = rect.y;
switch (sensor->GetMode()) {
- case Sensor::PAS: strcpy_s(mode_buf, Game::GetText("MFD.mode.passive").data()); break;
- case Sensor::STD: strcpy_s(mode_buf, Game::GetText("MFD.mode.standard").data()); break;
- case Sensor::ACM: strcpy_s(mode_buf, Game::GetText("MFD.mode.auto-combat").data()); break;
- case Sensor::GM: strcpy_s(mode_buf, Game::GetText("MFD.mode.ground").data()); break;
- case Sensor::PST: strcpy_s(mode_buf, Game::GetText("MFD.mode.passive").data()); break;
- case Sensor::CST: strcpy_s(mode_buf, Game::GetText("MFD.mode.combined").data()); break;
+ case Sensor::PAS: strcpy_s(mode_buf, Game::GetInstance()->GetText("MFD.mode.passive").data()); break;
+ case Sensor::STD: strcpy_s(mode_buf, Game::GetInstance()->GetText("MFD.mode.standard").data()); break;
+ case Sensor::ACM: strcpy_s(mode_buf, Game::GetInstance()->GetText("MFD.mode.auto-combat").data()); break;
+ case Sensor::GM: strcpy_s(mode_buf, Game::GetInstance()->GetText("MFD.mode.ground").data()); break;
+ case Sensor::PST: strcpy_s(mode_buf, Game::GetInstance()->GetText("MFD.mode.passive").data()); break;
+ case Sensor::CST: strcpy_s(mode_buf, Game::GetInstance()->GetText("MFD.mode.combined").data()); break;
default: break;
}
@@ -355,7 +355,7 @@ MFD::DrawSensorLabels(const char* mfd_mode)
if (ship->GetProbeLauncher()) {
char probes[32];
- sprintf_s(probes, "%s %02d", Game::GetText("MFD.probe").data(), ship->GetProbeLauncher()->Ammo());
+ sprintf_s(probes, "%s %02d", Game::GetInstance()->GetText("MFD.probe").data(), ship->GetProbeLauncher()->Ammo());
DrawMFDText(3, probes, probe_rect, DT_RIGHT);
}
else {
@@ -411,7 +411,7 @@ MFD::DrawSensorMFD()
Sensor* sensor = ship->GetSensor();
if (!sensor) {
- DrawMFDText(0, Game::GetText("MFD.inactive").data(), rect, DT_CENTER);
+ DrawMFDText(0, Game::GetInstance()->GetText("MFD.inactive").data(), rect, DT_CENTER);
return;
}
@@ -596,7 +596,7 @@ MFD::DrawSensorMFD()
}
}
- DrawSensorLabels(Game::GetText("MFD.mode.field-of-view").data());
+ DrawSensorLabels(Game::GetInstance()->GetText("MFD.mode.field-of-view").data());
}
// +--------------------------------------------------------------------+
@@ -619,7 +619,7 @@ MFD::DrawHSD()
Sensor* sensor = ship->GetSensor();
if (!sensor) {
- DrawMFDText(0, Game::GetText("MFD.inactive").data(), rect, DT_CENTER);
+ DrawMFDText(0, Game::GetInstance()->GetText("MFD.inactive").data(), rect, DT_CENTER);
return;
}
@@ -820,7 +820,7 @@ MFD::DrawHSD()
}
}
- DrawSensorLabels(Game::GetText("MFD.mode.horizontal").data());
+ DrawSensorLabels(Game::GetInstance()->GetText("MFD.mode.horizontal").data());
}
// +--------------------------------------------------------------------+
@@ -843,7 +843,7 @@ MFD::Draw3D()
Sensor* sensor = ship->GetSensor();
if (!sensor) {
- DrawMFDText(0, Game::GetText("MFD.inactive").data(), rect, DT_CENTER);
+ DrawMFDText(0, Game::GetInstance()->GetText("MFD.inactive").data(), rect, DT_CENTER);
return;
}
@@ -1036,7 +1036,7 @@ MFD::Draw3D()
}
}
- DrawSensorLabels(Game::GetText("MFD.mode.3D").data());
+ DrawSensorLabels(Game::GetInstance()->GetText("MFD.mode.3D").data());
}
// +--------------------------------------------------------------------+
@@ -1047,7 +1047,7 @@ void
MFD::DrawMap()
{
Rect text_rect(rect.x, rect.y, rect.w, 12);
- DrawMFDText(0, Game::GetText("MFD.mode.ground").data(), text_rect, DT_CENTER);
+ DrawMFDText(0, Game::GetInstance()->GetText("MFD.mode.ground").data(), text_rect, DT_CENTER);
}
// +--------------------------------------------------------------------+
@@ -1086,7 +1086,7 @@ MFD::DrawGameMFD()
int t = 0;
if (!HUDView::IsArcade() && HUDView::ShowFPS()) {
- sprintf_s(txt, "FPS: %6.2f", Game::FrameRate());
+ sprintf_s(txt, "FPS: %6.2f", Game::GetInstance()->FrameRate());
DrawMFDText(t++, txt, txt_rect, DT_LEFT);
txt_rect.y += 10;
@@ -1105,9 +1105,9 @@ MFD::DrawGameMFD()
if (lines <= 2) return;
- int hours = (Game::GameTime() / 3600000) ;
- int minutes = (Game::GameTime() / 60000) % 60;
- int seconds = (Game::GameTime() / 1000) % 60;
+ int hours = (Game::GetInstance()->GameTime() / 3600000) ;
+ int minutes = (Game::GetInstance()->GameTime() / 60000) % 60;
+ int seconds = (Game::GetInstance()->GameTime() / 1000) % 60;
if (ship) {
DWORD clock = ship->MissionClock();
@@ -1117,8 +1117,8 @@ MFD::DrawGameMFD()
seconds = (clock / 1000) % 60;
}
- if (Game::TimeCompression() > 1)
- sprintf_s(txt, "%02d:%02d:%02d x%d", hours, minutes, seconds, Game::TimeCompression()); //-V576
+ if (Game::GetInstance()->TimeCompression() > 1)
+ sprintf_s(txt, "%02d:%02d:%02d x%d", hours, minutes, seconds, Game::GetInstance()->TimeCompression()); //-V576
else
sprintf_s(txt, "%02d:%02d:%02d", hours, minutes, seconds);
@@ -1134,15 +1134,15 @@ MFD::DrawGameMFD()
if (ship) {
switch (ship->GetFlightPhase()) {
- case Ship::DOCKED: DrawMFDText(t++, Game::GetText("MFD.phase.DOCKED").data(), txt_rect, DT_LEFT); break;
- case Ship::ALERT: DrawMFDText(t++, Game::GetText("MFD.phase.ALERT").data(), txt_rect, DT_LEFT); break;
- case Ship::LOCKED: DrawMFDText(t++, Game::GetText("MFD.phase.LOCKED").data(), txt_rect, DT_LEFT); break;
- case Ship::LAUNCH: DrawMFDText(t++, Game::GetText("MFD.phase.LAUNCH").data(), txt_rect, DT_LEFT); break;
- case Ship::TAKEOFF: DrawMFDText(t++, Game::GetText("MFD.phase.TAKEOFF").data(), txt_rect, DT_LEFT); break;
- case Ship::ACTIVE: DrawMFDText(t++, Game::GetText("MFD.phase.ACTIVE").data(), txt_rect, DT_LEFT); break;
- case Ship::APPROACH: DrawMFDText(t++, Game::GetText("MFD.phase.APPROACH").data(), txt_rect, DT_LEFT); break;
- case Ship::RECOVERY: DrawMFDText(t++, Game::GetText("MFD.phase.RECOVERY").data(), txt_rect, DT_LEFT); break;
- case Ship::DOCKING: DrawMFDText(t++, Game::GetText("MFD.phase.DOCKING").data(), txt_rect, DT_LEFT); break;
+ case Ship::DOCKED: DrawMFDText(t++, Game::GetInstance()->GetText("MFD.phase.DOCKED").data(), txt_rect, DT_LEFT); break;
+ case Ship::ALERT: DrawMFDText(t++, Game::GetInstance()->GetText("MFD.phase.ALERT").data(), txt_rect, DT_LEFT); break;
+ case Ship::LOCKED: DrawMFDText(t++, Game::GetInstance()->GetText("MFD.phase.LOCKED").data(), txt_rect, DT_LEFT); break;
+ case Ship::LAUNCH: DrawMFDText(t++, Game::GetInstance()->GetText("MFD.phase.LAUNCH").data(), txt_rect, DT_LEFT); break;
+ case Ship::TAKEOFF: DrawMFDText(t++, Game::GetInstance()->GetText("MFD.phase.TAKEOFF").data(), txt_rect, DT_LEFT); break;
+ case Ship::ACTIVE: DrawMFDText(t++, Game::GetInstance()->GetText("MFD.phase.ACTIVE").data(), txt_rect, DT_LEFT); break;
+ case Ship::APPROACH: DrawMFDText(t++, Game::GetInstance()->GetText("MFD.phase.APPROACH").data(), txt_rect, DT_LEFT); break;
+ case Ship::RECOVERY: DrawMFDText(t++, Game::GetInstance()->GetText("MFD.phase.RECOVERY").data(), txt_rect, DT_LEFT); break;
+ case Ship::DOCKING: DrawMFDText(t++, Game::GetInstance()->GetText("MFD.phase.DOCKING").data(), txt_rect, DT_LEFT); break;
}
}
}
@@ -1162,7 +1162,7 @@ MFD::DrawStatusMFD()
Drive* drive = ship->GetDrive();
if (drive) {
- DrawMFDText(row++, Game::GetText("MFD.status.THRUST").data(), status_rect, DT_LEFT);
+ DrawMFDText(row++, Game::GetInstance()->GetText("MFD.status.THRUST").data(), status_rect, DT_LEFT);
DrawGauge(status_rect.x+70, status_rect.y, (int) ship->Throttle());
status_rect.y += 10;
}
@@ -1172,7 +1172,7 @@ MFD::DrawStatusMFD()
if (ship->Reactors().size() > 0) {
PowerSource* reactor = ship->Reactors()[0];
if (reactor) {
- DrawMFDText(row++, Game::GetText("MFD.status.FUEL").data(), status_rect, DT_LEFT);
+ DrawMFDText(row++, Game::GetInstance()->GetText("MFD.status.FUEL").data(), status_rect, DT_LEFT);
DrawGauge(status_rect.x+70, status_rect.y, reactor->Charge());
status_rect.y += 10;
}
@@ -1182,7 +1182,7 @@ MFD::DrawStatusMFD()
QuantumDrive* quantum_drive = ship->GetQuantumDrive();
if (quantum_drive) {
- DrawMFDText(row++, Game::GetText("MFD.status.QUANTUM").data(), status_rect, DT_LEFT);
+ DrawMFDText(row++, Game::GetInstance()->GetText("MFD.status.QUANTUM").data(), status_rect, DT_LEFT);
DrawGauge(status_rect.x+70, status_rect.y, (int) quantum_drive->Charge());
status_rect.y += 10;
}
@@ -1197,7 +1197,7 @@ MFD::DrawStatusMFD()
else if (hull > 33)
hull_status = System::DEGRADED;
- DrawMFDText(row++, Game::GetText("MFD.status.HULL").data(), status_rect, DT_LEFT);
+ DrawMFDText(row++, Game::GetInstance()->GetText("MFD.status.HULL").data(), status_rect, DT_LEFT);
DrawGauge(status_rect.x+70, status_rect.y, (int) hull);
status_rect.y += 10;
@@ -1205,7 +1205,7 @@ MFD::DrawStatusMFD()
Shield* shield = ship->GetShield();
if (shield) {
- DrawMFDText(row++, Game::GetText("MFD.status.SHIELD").data(), status_rect, DT_LEFT);
+ DrawMFDText(row++, Game::GetInstance()->GetText("MFD.status.SHIELD").data(), status_rect, DT_LEFT);
DrawGauge(status_rect.x+70, status_rect.y, ship->ShieldStrength());
status_rect.y += 10;
}
@@ -1214,7 +1214,7 @@ MFD::DrawStatusMFD()
Weapon* primary = ship->GetPrimary();
if (primary) {
- DrawMFDText(row++, Game::GetText("MFD.status.GUNS").data(), status_rect, DT_LEFT);
+ DrawMFDText(row++, Game::GetInstance()->GetText("MFD.status.GUNS").data(), status_rect, DT_LEFT);
DrawGauge(status_rect.x+70, status_rect.y, primary->Charge());
status_rect.y += 10;
}
@@ -1244,7 +1244,7 @@ MFD::DrawStatusMFD()
if (ship->GetDecoy()) {
char ammo[8];
sprintf_s(ammo, "%d", ship->GetDecoy()->Ammo());
- DrawMFDText(row++, Game::GetText("MFD.status.DECOY").data(), status_rect, DT_LEFT);
+ DrawMFDText(row++, Game::GetInstance()->GetText("MFD.status.DECOY").data(), status_rect, DT_LEFT);
status_rect.x += 70;
DrawMFDText(row++, ammo, status_rect, DT_LEFT);
status_rect.x -= 70;
@@ -1254,7 +1254,7 @@ MFD::DrawStatusMFD()
if (NetGame::GetInstance()) {
char lives[8];
sprintf_s(lives, "%d", ship->RespawnCount() + 1);
- DrawMFDText(row++, Game::GetText("MFD.status.LIVES").data(), status_rect, DT_LEFT);
+ DrawMFDText(row++, Game::GetInstance()->GetText("MFD.status.LIVES").data(), status_rect, DT_LEFT);
status_rect.x += 70;
DrawMFDText(row++, lives, status_rect, DT_LEFT);
status_rect.x -= 70;
@@ -1267,22 +1267,22 @@ MFD::DrawStatusMFD()
Sensor* sensor = ship->GetSensor();
if (sensor) {
if (ship->GetFlightPhase() != Ship::ACTIVE) {
- DrawMFDText(row++, Game::GetText("MFD.status.SENSOR").data(), status_rect, DT_LEFT);
+ DrawMFDText(row++, Game::GetInstance()->GetText("MFD.status.SENSOR").data(), status_rect, DT_LEFT);
status_rect.x += 70;
- DrawMFDText(row++, Game::GetText("MFD.status.OFFLINE").data(), status_rect, DT_LEFT);
+ DrawMFDText(row++, Game::GetInstance()->GetText("MFD.status.OFFLINE").data(), status_rect, DT_LEFT);
status_rect.x -= 70;
status_rect.y += 10;
}
else {
- DrawMFDText(row++, Game::GetText("MFD.status.EMCON").data(), status_rect, DT_LEFT);
+ DrawMFDText(row++, Game::GetInstance()->GetText("MFD.status.EMCON").data(), status_rect, DT_LEFT);
status_rect.x += 70;
- sprintf_s(txt, "%s %d", Game::GetText("MFD.status.MODE").data(), ship->GetEMCON());
+ sprintf_s(txt, "%s %d", Game::GetInstance()->GetText("MFD.status.MODE").data(), ship->GetEMCON());
if (!sensor->IsPowerOn() || sensor->GetEnergy() == 0) {
- if (!Game::Paused() && (Game::RealTime()/1000) & 2)
- strcpy_s(txt, Game::GetText("MFD.status.SENSOR-OFF").data());
+ if (!Game::GetInstance()->Paused() && (Game::GetInstance()->RealTime()/1000) & 2)
+ strcpy_s(txt, Game::GetInstance()->GetText("MFD.status.SENSOR-OFF").data());
}
DrawMFDText(row++, txt, status_rect, DT_LEFT);
@@ -1293,7 +1293,7 @@ MFD::DrawStatusMFD()
if (lines <= 7) return;
- DrawMFDText(row++, Game::GetText("MFD.status.SYSTEMS").data(), status_rect, DT_LEFT);
+ DrawMFDText(row++, Game::GetInstance()->GetText("MFD.status.SYSTEMS").data(), status_rect, DT_LEFT);
status_rect.x += 70;
DrawMFDText(row++, ship->GetDirectorInfo(), status_rect, DT_LEFT);
@@ -1302,7 +1302,7 @@ MFD::DrawStatusMFD()
sprintf_s(lives, "%d", ship->RespawnCount() + 1);
status_rect.x -= 70;
status_rect.y += 10;
- DrawMFDText(row++, Game::GetText("MFD.status.LIVES").data(), status_rect, DT_LEFT);
+ DrawMFDText(row++, Game::GetInstance()->GetText("MFD.status.LIVES").data(), status_rect, DT_LEFT);
status_rect.x += 70;
DrawMFDText(row++, lives, status_rect, DT_LEFT);
}
diff --git a/Stars45/Mission.cpp b/Stars45/Mission.cpp
index a8f879d..b9fa542 100644
--- a/Stars45/Mission.cpp
+++ b/Stars45/Mission.cpp
@@ -38,8 +38,8 @@ Mission::Mission(int identity, const char* fname, const char* pname)
star_system(0), start(33 * 3600), stardate(0), target(0), ward(0),
current(0), degrees(false)
{
- objective = Game::GetText("Mission.unspecified");
- sitrep = Game::GetText("Mission.unknown");
+ objective = Game::GetInstance()->GetText("Mission.unspecified");
+ sitrep = Game::GetInstance()->GetText("Mission.unknown");
if (fname)
strcpy_s(filename, fname);
@@ -306,13 +306,13 @@ Mission::ParseMission(const char* block)
if (defname == "name") {
GetDefText(name, def, filename);
- name = Game::GetText(name);
+ name = Game::GetInstance()->GetText(name);
}
else if (defname == "desc") {
GetDefText(desc, def, filename);
if (desc.length() > 0 && desc.length() < 32)
- desc = Game::GetText(desc);
+ desc = Game::GetInstance()->GetText(desc);
}
else if (defname == "type") {
@@ -341,13 +341,13 @@ Mission::ParseMission(const char* block)
else if (defname == "objective") {
GetDefText(objective, def, filename);
if (objective.length() > 0 && objective.length() < 32)
- objective = Game::GetText(objective);
+ objective = Game::GetInstance()->GetText(objective);
}
else if (defname == "sitrep") {
GetDefText(sitrep, def, filename);
if (sitrep.length() > 0 && sitrep.length() < 32)
- sitrep = Game::GetText(sitrep);
+ sitrep = Game::GetInstance()->GetText(sitrep);
}
else if (defname == "subtitles") {
@@ -429,14 +429,14 @@ Mission::Save()
Validate();
if (!filename[0] || !path[0]) {
- AddError(Game::GetText("Mission.error.no-file"));
+ AddError(Game::GetInstance()->GetText("Mission.error.no-file"));
return ok;
}
Text content = Serialize();
if (content.length() < 8) {
- AddError(Game::GetText("Mission.error.no-serial"));
+ AddError(Game::GetInstance()->GetText("Mission.error.no-serial"));
return ok;
}
@@ -471,7 +471,7 @@ Mission::Validate()
ok = true;
if (elements.isEmpty()) {
- sprintf_s(err, Game::GetText("Mission.error.no-elem").data(), filename);
+ sprintf_s(err, Game::GetInstance()->GetText("Mission.error.no-elem").data(), filename);
AddError(err);
}
else {
@@ -481,7 +481,7 @@ Mission::Validate()
MissionElement* elem = elements.at(i);
if (elem->Name().length() < 1) {
- sprintf_s(err, Game::GetText("Mission.error.unnamed-elem").data(), filename);
+ sprintf_s(err, Game::GetInstance()->GetText("Mission.error.unnamed-elem").data(), filename);
AddError(err);
}
@@ -490,14 +490,14 @@ Mission::Validate()
found_player = true;
if (elem->Region() != GetRegion()) {
- sprintf_s(err, Game::GetText("Mission.error.wrong-sector").data(),
+ sprintf_s(err, Game::GetInstance()->GetText("Mission.error.wrong-sector").data(),
elem->Name().data(),
GetRegion());
AddError(err);
}
}
else {
- sprintf_s(err, Game::GetText("Mission.error.extra-player").data(),
+ sprintf_s(err, Game::GetInstance()->GetText("Mission.error.extra-player").data(),
elem->Name().data(),
filename);
AddError(err);
@@ -506,7 +506,7 @@ Mission::Validate()
}
if (!found_player) {
- sprintf_s(err, Game::GetText("Mission.error.no-player").data(), filename);
+ sprintf_s(err, Game::GetInstance()->GetText("Mission.error.no-player").data(), filename);
AddError(err);
}
}
@@ -611,14 +611,14 @@ Mission::ParseElement(TermStruct* val)
element->design = ShipDesign::Get(design, element->path);
if (!element->design) {
- sprintf_s(err, Game::GetText("Mission.error.unknown-ship").data(), design.data(), filename);
+ sprintf_s(err, Game::GetInstance()->GetText("Mission.error.unknown-ship").data(), design.data(), filename);
AddError(err);
}
}
else if (defname == "skin") {
if (!element->design) {
- sprintf_s(err, Game::GetText("Mission.error.out-of-order").data(), filename);
+ sprintf_s(err, Game::GetInstance()->GetText("Mission.error.out-of-order").data(), filename);
AddError(err);
}
@@ -628,7 +628,7 @@ Mission::ParseElement(TermStruct* val)
}
else if (pdef->term()->isStruct()) {
- sprintf_s(err, Game::GetText("Mission.error.bad-skin").data(), filename);
+ sprintf_s(err, Game::GetInstance()->GetText("Mission.error.bad-skin").data(), filename);
AddError(err);
}
}
@@ -724,7 +724,7 @@ Mission::ParseElement(TermStruct* val)
else if (defname == "objective") {
if (!pdef->term() || !pdef->term()->isStruct()) {
- sprintf_s(err, Game::GetText("Mission.error.no-objective").data(), element->name.data(), filename);
+ sprintf_s(err, Game::GetInstance()->GetText("Mission.error.no-objective").data(), element->name.data(), filename);
AddError(err);
}
else {
@@ -744,7 +744,7 @@ Mission::ParseElement(TermStruct* val)
else if (defname == "ship") {
if (!pdef->term() || !pdef->term()->isStruct()) {
- sprintf_s(err, Game::GetText("Mission.error.no-ship").data(), element->name.data(), filename);
+ sprintf_s(err, Game::GetInstance()->GetText("Mission.error.no-ship").data(), element->name.data(), filename);
AddError(err);
}
else {
@@ -759,7 +759,7 @@ Mission::ParseElement(TermStruct* val)
else if (defname == "order" || defname == "navpt") {
if (!pdef->term() || !pdef->term()->isStruct()) {
- sprintf_s(err, Game::GetText("Mission.error.no-navpt").data(), element->name.data(), filename);
+ sprintf_s(err, Game::GetInstance()->GetText("Mission.error.no-navpt").data(), element->name.data(), filename);
AddError(err);
}
else {
@@ -771,7 +771,7 @@ Mission::ParseElement(TermStruct* val)
else if (defname == "loadout") {
if (!pdef->term() || !pdef->term()->isStruct()) {
- sprintf_s(err, Game::GetText("Mission.error.no-loadout").data(), element->name.data(), filename);
+ sprintf_s(err, Game::GetInstance()->GetText("Mission.error.no-loadout").data(), element->name.data(), filename);
AddError(err);
}
else {
@@ -783,12 +783,12 @@ Mission::ParseElement(TermStruct* val)
}
if (element->name.length() < 1) {
- sprintf_s(err, Game::GetText("Mission.error.unnamed-elem").data(), filename);
+ sprintf_s(err, Game::GetInstance()->GetText("Mission.error.unnamed-elem").data(), filename);
AddError(err);
}
else if (element->design == 0) {
- sprintf_s(err, Game::GetText("Mission.error.unknown-ship").data(), element->name.data(), filename);
+ sprintf_s(err, Game::GetInstance()->GetText("Mission.error.unknown-ship").data(), element->name.data(), filename);
AddError(err);
}
@@ -883,7 +883,7 @@ Mission::ParseEvent(TermStruct* val)
else if (defname == "event_message" || defname == "message") {
Text raw_msg;
GetDefText(raw_msg, pdef, filename);
- raw_msg = Game::GetText(raw_msg);
+ raw_msg = Game::GetInstance()->GetText(raw_msg);
event->event_message = FormatTextEscape(raw_msg);
}
@@ -948,7 +948,7 @@ Mission::ParseShip(TermStruct* val, MissionElement* element)
else if (defname == "skin") {
if (!element || !element->design) {
- sprintf_s(err, Game::GetText("Mission.error.out-of-order").data(), filename);
+ sprintf_s(err, Game::GetInstance()->GetText("Mission.error.out-of-order").data(), filename);
AddError(err);
}
@@ -958,7 +958,7 @@ Mission::ParseShip(TermStruct* val, MissionElement* element)
}
else if (pdef->term()->isStruct()) {
- sprintf_s(err, Game::GetText("Mission.error.bad-skin").data(), filename);
+ sprintf_s(err, Game::GetInstance()->GetText("Mission.error.bad-skin").data(), filename);
AddError(err);
}
}
diff --git a/Stars45/ModConfig.cpp b/Stars45/ModConfig.cpp
index b03dabd..f91a0dd 100644
--- a/Stars45/ModConfig.cpp
+++ b/Stars45/ModConfig.cpp
@@ -254,7 +254,7 @@ ModConfig::Deploy()
}
Print("\n");
- Game::UseLocale(0);
+ Game::GetInstance()->UseLocale(0);
}
void
diff --git a/Stars45/ModDlg.cpp b/Stars45/ModDlg.cpp
index e2939b3..71eb368 100644
--- a/Stars45/ModDlg.cpp
+++ b/Stars45/ModDlg.cpp
@@ -212,7 +212,7 @@ ModDlg::OnSelectEnabled(AWEvent* event)
btn_decrease->SetEnabled(lst_enabled->GetSelection() < lst_enabled->NumItems() - 1);
// double-click:
- if (Game::RealTime() - click_time < 350) {
+ if (Game::GetInstance()->RealTime() - click_time < 350) {
if (lst_enabled->GetSelCount() == 1) {
int index = lst_enabled->GetSelection();
Text mod_name = lst_enabled->GetItemText(index);
@@ -227,7 +227,7 @@ ModDlg::OnSelectEnabled(AWEvent* event)
}
}
- click_time = Game::RealTime();
+ click_time = Game::GetInstance()->RealTime();
}
void
diff --git a/Stars45/MouseController.cpp b/Stars45/MouseController.cpp
index 6090b45..1cd9504 100644
--- a/Stars45/MouseController.cpp
+++ b/Stars45/MouseController.cpp
@@ -117,11 +117,11 @@ MouseController::Acquire()
roll_enable = 1;
if (!rbutton_latch)
- rbutton_latch = Game::RealTime();
+ rbutton_latch = Game::GetInstance()->RealTime();
}
else {
if (rbutton_latch) {
- rbutton_latch = Game::RealTime() - rbutton_latch;
+ rbutton_latch = Game::GetInstance()->RealTime() - rbutton_latch;
if (rbutton_latch < 250)
action[1] = 1;
}
@@ -131,7 +131,7 @@ MouseController::Acquire()
if (Mouse::MButton()) {
if (!mbutton_latch)
- mbutton_latch = Game::RealTime();
+ mbutton_latch = Game::GetInstance()->RealTime();
}
else {
if (mbutton_latch) {
@@ -187,7 +187,7 @@ MouseController::Acquire()
if (select == 1) {
::SetCursorPos(cx, cy);
- double drain = cx * 4 * Game::FrameTime();
+ double drain = cx * 4 * Game::GetInstance()->FrameTime();
if (dx > drain) {
dx -= drain;
diff --git a/Stars45/MsnDlg.cpp b/Stars45/MsnDlg.cpp
index 110dbf6..2419629 100644
--- a/Stars45/MsnDlg.cpp
+++ b/Stars45/MsnDlg.cpp
@@ -113,7 +113,7 @@ MsnDlg::ShowMsnDlg()
if (mission)
mission_name->SetText(mission->Name());
else
- mission_name->SetText(Game::GetText("MsnDlg.no-mission"));
+ mission_name->SetText(Game::GetInstance()->GetText("MsnDlg.no-mission"));
}
if (mission_system) {
@@ -150,7 +150,7 @@ MsnDlg::ShowMsnDlg()
char txt[32];
FormatDayTime(txt, time_on_target);
mission_time_target->SetText(txt);
- mission_time_target_label->SetText(Game::GetText("MsnDlg.target"));
+ mission_time_target_label->SetText(Game::GetInstance()->GetText("MsnDlg.target"));
}
else {
mission_time_target->SetText("");
diff --git a/Stars45/MsnEditDlg.cpp b/Stars45/MsnEditDlg.cpp
index c66a09c..69b8d61 100644
--- a/Stars45/MsnEditDlg.cpp
+++ b/Stars45/MsnEditDlg.cpp
@@ -341,7 +341,7 @@ MsnEditDlg::DrawPackages()
sprintf_s(txt, "%s %s", design->abrv, design->name);
}
else {
- sprintf_s(txt, "%s", Game::GetText("MsnDlg.undefined").data());
+ sprintf_s(txt, "%s", Game::GetInstance()->GetText("MsnDlg.undefined").data());
}
lst_elem->SetItemText(i, 3, txt);
@@ -636,7 +636,7 @@ MsnEditDlg::OnElemSelect(AWEvent* event)
btn_elem_dec->SetEnabled(selection >= 0 && selection < lst_elem->NumItems() - 1);
// double-click:
- if (Game::RealTime() - click_time < 350) {
+ if (Game::GetInstance()->RealTime() - click_time < 350) {
if (lst_elem->GetSelCount() == 1) {
int index = lst_elem->GetSelection();
MissionElement* elem = mission->GetElements().at(index);
@@ -652,7 +652,7 @@ MsnEditDlg::OnElemSelect(AWEvent* event)
}
}
- click_time = Game::RealTime();
+ click_time = Game::GetInstance()->RealTime();
}
void
@@ -764,7 +764,7 @@ MsnEditDlg::OnEventSelect(AWEvent* event)
btn_event_dec->SetEnabled(selection >= 0 && selection < lst_event->NumItems() - 1);
// double-click:
- if (Game::RealTime() - click_time < 350) {
+ if (Game::GetInstance()->RealTime() - click_time < 350) {
if (lst_event->GetSelCount() == 1) {
int index = lst_event->GetSelection();
MissionEvent* event = mission->GetEvents().at(index);
@@ -780,7 +780,7 @@ MsnEditDlg::OnEventSelect(AWEvent* event)
}
}
- click_time = Game::RealTime();
+ click_time = Game::GetInstance()->RealTime();
}
void
diff --git a/Stars45/MsnElemDlg.cpp b/Stars45/MsnElemDlg.cpp
index 4d33da6..a1e1f69 100644
--- a/Stars45/MsnElemDlg.cpp
+++ b/Stars45/MsnElemDlg.cpp
@@ -497,7 +497,7 @@ MsnElemDlg::OnDesignSelect(AWEvent* event)
cmb_skin->ClearItems();
if (design) {
- cmb_skin->AddItem(Game::GetText("MsnDlg.default"));
+ cmb_skin->AddItem(Game::GetInstance()->GetText("MsnDlg.default"));
cmb_skin->SetSelection(0);
ListIter<Skin> iter = design->skins;
@@ -692,7 +692,7 @@ MsnElemDlg::OnAccept(AWEvent* event)
if (cmb_skin) {
const char* skin_name = cmb_skin->GetSelectedItem();
- if (strcmp(skin_name, Game::GetText("MsnDlg.default").data())) {
+ if (strcmp(skin_name, Game::GetInstance()->GetText("MsnDlg.default").data())) {
elem->SetSkin(d->FindSkin(skin_name));
}
else {
diff --git a/Stars45/MsnObjDlg.cpp b/Stars45/MsnObjDlg.cpp
index 7d23c09..3052495 100644
--- a/Stars45/MsnObjDlg.cpp
+++ b/Stars45/MsnObjDlg.cpp
@@ -141,7 +141,7 @@ MsnObjDlg::Show()
objectives->SetText("");
}
else {
- objectives->SetText(Game::GetText("MsnDlg.no-mission"));
+ objectives->SetText(Game::GetInstance()->GetText("MsnDlg.no-mission"));
}
}
@@ -150,11 +150,11 @@ MsnObjDlg::Show()
if (mission->IsOK())
sitrep->SetText(mission->Situation());
else
- sitrep->SetText(Game::GetText("MsnDlg.found-errors") +
+ sitrep->SetText(Game::GetInstance()->GetText("MsnDlg.found-errors") +
mission->ErrorMessage());
}
else {
- sitrep->SetText(Game::GetText("MsnDlg.no-mission"));
+ sitrep->SetText(Game::GetInstance()->GetText("MsnDlg.no-mission"));
}
}
@@ -220,7 +220,7 @@ MsnObjDlg::Show()
if (cmb_skin && design && design->skins.size()) {
cmb_skin->Show();
- cmb_skin->AddItem(Game::GetText("MsnDlg.default"));
+ cmb_skin->AddItem(Game::GetInstance()->GetText("MsnDlg.default"));
cmb_skin->SetSelection(0);
ListIter<Skin> iter = ((ShipDesign*) design)->skins;
diff --git a/Stars45/MsnPkgDlg.cpp b/Stars45/MsnPkgDlg.cpp
index 8108f43..2dcf608 100644
--- a/Stars45/MsnPkgDlg.cpp
+++ b/Stars45/MsnPkgDlg.cpp
@@ -256,9 +256,9 @@ MsnPkgDlg::DrawThreats()
mission_role == Mission::INTERCEPT ||
mission_role == Mission::FLEET ||
mission_role == Mission::BOMBARDMENT)
- strcpy_s(role, Game::GetText("MsnDlg.ATTACK").data());
+ strcpy_s(role, Game::GetInstance()->GetText("MsnDlg.ATTACK").data());
else
- strcpy_s(role, Game::GetText("MsnDlg.PATROL").data());
+ strcpy_s(role, Game::GetInstance()->GetText("MsnDlg.PATROL").data());
double dist = Point(base_loc - elem->Location()).length();
FormatNumber(rng, dist);
diff --git a/Stars45/MsnSelectDlg.cpp b/Stars45/MsnSelectDlg.cpp
index e8ec685..fff58f2 100644
--- a/Stars45/MsnSelectDlg.cpp
+++ b/Stars45/MsnSelectDlg.cpp
@@ -199,7 +199,7 @@ MsnSelectDlg::Show()
}
if (description)
- description->SetText(Game::GetText("MsnSelectDlg.choose"));
+ description->SetText(Game::GetInstance()->GetText("MsnSelectDlg.choose"));
if (lst_missions) {
lst_missions->ClearItems();
@@ -268,7 +268,7 @@ MsnSelectDlg::OnCampaignSelect(AWEvent* event)
btn_accept->SetEnabled(false);
if (description)
- description->SetText(Game::GetText("MsnSelectDlg.choose"));
+ description->SetText(Game::GetInstance()->GetText("MsnSelectDlg.choose"));
int id = c->GetCampaignId();
editable = (id >= Campaign::MULTIPLAYER_MISSIONS &&
@@ -302,25 +302,25 @@ MsnSelectDlg::OnMissionSelect(AWEvent* event)
Text d("<font Limerick12><color ffffff>");
d += info->name;
d += "<font Verdana>\n\n<color ffff80>";
- d += Game::GetText("MsnSelectDlg.mission-type");
+ d += Game::GetInstance()->GetText("MsnSelectDlg.mission-type");
d += "<color ffffff>\n\t";
d += Mission::RoleName(info->type);
d += "\n\n<color ffff80>";
- d += Game::GetText("MsnSelectDlg.scenario");
+ d += Game::GetInstance()->GetText("MsnSelectDlg.scenario");
d += "<color ffffff>\n\t";
d += info->description;
d += "\n\n<color ffff80>";
- d += Game::GetText("MsnSelectDlg.location");
+ d += Game::GetInstance()->GetText("MsnSelectDlg.location");
d += "<color ffffff>\n\t";
d += info->region;
d += " ";
- d += Game::GetText("MsnSelectDlg.sector");
+ d += Game::GetInstance()->GetText("MsnSelectDlg.sector");
d += " / ";
d += info->system;
d += " ";
- d += Game::GetText("MsnSelectDlg.system");
+ d += Game::GetInstance()->GetText("MsnSelectDlg.system");
d += "\n\n<color ffff80>";
- d += Game::GetText("MsnSelectDlg.start-time");
+ d += Game::GetInstance()->GetText("MsnSelectDlg.start-time");
d += "<color ffffff>\n\t";
d += time_buf;
@@ -332,7 +332,7 @@ MsnSelectDlg::OnMissionSelect(AWEvent* event)
}
else {
- description->SetText(Game::GetText("MsnSelectDlg.choose"));
+ description->SetText(Game::GetInstance()->GetText("MsnSelectDlg.choose"));
btn_accept->SetEnabled(false);
if (btn_edit) btn_edit->SetEnabled(false);
@@ -442,9 +442,9 @@ MsnSelectDlg::OnDel(AWEvent* event)
ConfirmDlg* confirm = manager->GetConfirmDlg();
if (confirm) {
char msg[256];
- sprintf_s(msg, Game::GetText("MsnSelectDlg.are-you-sure").data(), m->Name());
+ sprintf_s(msg, Game::GetInstance()->GetText("MsnSelectDlg.are-you-sure").data(), m->Name());
confirm->SetMessage(msg);
- confirm->SetTitle(Game::GetText("MsnSelectDlg.confirm-delete"));
+ confirm->SetTitle(Game::GetInstance()->GetText("MsnSelectDlg.confirm-delete"));
confirm->SetParentControl(btn_del);
manager->ShowConfirmDlg();
diff --git a/Stars45/MusicTrack.cpp b/Stars45/MusicTrack.cpp
index 18e7b7c..0454b11 100644
--- a/Stars45/MusicTrack.cpp
+++ b/Stars45/MusicTrack.cpp
@@ -83,7 +83,7 @@ MusicTrack::ExecFrame()
Starshatter* stars = Starshatter::GetInstance();
if (stars) {
music_pause = (stars->GetGameMode() == Starshatter::PLAY_MODE) &&
- Game::Paused();
+ Game::GetInstance()->Paused();
}
if (sound && !music_pause) {
@@ -135,7 +135,7 @@ MusicTrack::ExecFrame()
}
if (fade > 0)
- fade -= Game::GUITime();
+ fade -= Game::GetInstance()->GUITime();
if (fade < 0)
fade = 0;
diff --git a/Stars45/NavAI.cpp b/Stars45/NavAI.cpp
index da37c8c..d20ce8b 100644
--- a/Stars45/NavAI.cpp
+++ b/Stars45/NavAI.cpp
@@ -169,7 +169,7 @@ NavAI::FindObjective()
// transform into camera coords:
objective = Transform(obj_w);
- ship->SetDirectorInfo(Game::GetText("ai.takeoff"));
+ ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.takeoff"));
return;
}
@@ -308,15 +308,15 @@ NavAI::Navigator()
if (navpt) {
if (navpt->Status() == Instruction::COMPLETE && navpt->HoldTime() > 0) {
- ship->SetDirectorInfo(Game::GetText("ai.auto-hold"));
+ ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.auto-hold"));
hold = true;
}
else {
- ship->SetDirectorInfo(Game::GetText("ai.auto-nav"));
+ ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.auto-nav"));
}
}
else {
- ship->SetDirectorInfo(Game::GetText("ai.auto-stop"));
+ ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.auto-stop"));
}
Accumulate(AvoidTerrain());
@@ -596,11 +596,11 @@ NavAI::AvoidTerrain()
// too low?
if (ship->AltitudeAGL() < 1000) {
terrain_warning = true;
- ship->SetDirectorInfo(Game::GetText("ai.too-low"));
+ ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.too-low"));
// way too low?
if (ship->AltitudeAGL() < 750) {
- ship->SetDirectorInfo(Game::GetText("ai.way-too-low"));
+ ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.way-too-low"));
}
// where will we be?
diff --git a/Stars45/NavDlg.cpp b/Stars45/NavDlg.cpp
index cfcbe51..6bfbf3c 100644
--- a/Stars45/NavDlg.cpp
+++ b/Stars45/NavDlg.cpp
@@ -358,7 +358,7 @@ NavDlg::ExecFrame()
FormatNumber(y, ship->Location().z);
FormatNumber(z, ship->Location().y);
- strcpy_s(loc_buf, Game::GetText("NavDlg.loc-labels").data());
+ strcpy_s(loc_buf, Game::GetInstance()->GetText("NavDlg.loc-labels").data());
loc_labels->SetText(loc_buf);
if (sim->GetActiveRegion()) {
@@ -379,7 +379,7 @@ NavDlg::ExecFrame()
NavSystem* navsys = ship->GetNavSystem();
if (ship->GetNextNavPoint() == 0 || !navsys) {
- commit_btn->SetText(Game::GetText("NavDlg.commit"));
+ commit_btn->SetText(Game::GetInstance()->GetText("NavDlg.commit"));
commit_btn->SetBackColor(commit_color);
commit_btn->SetEnabled(false);
}
@@ -387,11 +387,11 @@ NavDlg::ExecFrame()
commit_btn->SetEnabled(true);
if (navsys->AutoNavEngaged()) {
- commit_btn->SetText(Game::GetText("NavDlg.cancel"));
+ commit_btn->SetText(Game::GetInstance()->GetText("NavDlg.cancel"));
commit_btn->SetBackColor(cancel_color);
}
else {
- commit_btn->SetText(Game::GetText("NavDlg.commit"));
+ commit_btn->SetText(Game::GetInstance()->GetText("NavDlg.commit"));
commit_btn->SetBackColor(commit_color);
}
}
@@ -416,7 +416,7 @@ NavDlg::ExecFrame()
distance = Point(npt - ship->Location()).length();
FormatNumber(d, distance);
- strcpy_s(loc_buf, Game::GetText("NavDlg.dst-labels").data());
+ strcpy_s(loc_buf, Game::GetInstance()->GetText("NavDlg.dst-labels").data());
dst_labels->SetText(loc_buf);
sprintf_s(loc_buf, "\n%s\n%s\n%s, %s, %s\n%s",
@@ -426,8 +426,8 @@ NavDlg::ExecFrame()
dst_data->SetText(loc_buf);
}
else {
- dst_labels->SetText(Game::GetText("NavDlg.destination"));
- dst_data->SetText(Game::GetText("NavDlg.not-avail"));
+ dst_labels->SetText(Game::GetInstance()->GetText("NavDlg.destination"));
+ dst_data->SetText(Game::GetInstance()->GetText("NavDlg.not-avail"));
}
}
}
@@ -685,8 +685,8 @@ NavDlg::UpdateSelection()
info_list->ClearItems();
- Text units_km = Text(" ") + Game::GetText("NavDlg.units.kilometers");
- Text units_tonnes = Text(" ") + Game::GetText("NavDlg.units.tonnes");
+ Text units_km = Text(" ") + Game::GetInstance()->GetText("NavDlg.units.kilometers");
+ Text units_tonnes = Text(" ") + Game::GetInstance()->GetText("NavDlg.units.tonnes");
if (seln_mode <= SELECT_REGION) {
Orbital* s = star_map->GetSelection();
@@ -701,23 +701,23 @@ NavDlg::UpdateSelection()
double p = s->Period();
if (p < 60) {
- sprintf_s(units, " %s", Game::GetText("NavDlg.units.seconds").data());
+ sprintf_s(units, " %s", Game::GetInstance()->GetText("NavDlg.units.seconds").data());
}
else if (p < 3600) {
p /= 60;
- sprintf_s(units, " %s", Game::GetText("NavDlg.units.minutes").data());
+ sprintf_s(units, " %s", Game::GetInstance()->GetText("NavDlg.units.minutes").data());
}
else if (p < 24 * 3600) {
p /= 3600;
- sprintf_s(units, " %s", Game::GetText("NavDlg.units.hours").data());
+ sprintf_s(units, " %s", Game::GetInstance()->GetText("NavDlg.units.hours").data());
}
else if (p < 365.25 * 24 * 3600) {
p /= 24*3600;
- sprintf_s(units, " %s", Game::GetText("NavDlg.units.days").data());
+ sprintf_s(units, " %s", Game::GetInstance()->GetText("NavDlg.units.days").data());
}
else {
p /= 365.25*24*3600;
- sprintf_s(units, " %s", Game::GetText("NavDlg.units.years").data());
+ sprintf_s(units, " %s", Game::GetInstance()->GetText("NavDlg.units.years").data());
}
FormatNumberExp(radius, s->Radius()/1000);
@@ -731,12 +731,12 @@ NavDlg::UpdateSelection()
strcat_s(period, units);
if (seln_mode >= SELECT_SYSTEM) {
- info_list->AddItem(Game::GetText(Text("NavDlg.filter.") + filter_name[seln_mode]));
- info_list->AddItem(Game::GetText("NavDlg.radius"));
+ info_list->AddItem(Game::GetInstance()->GetText(Text("NavDlg.filter.") + filter_name[seln_mode]));
+ info_list->AddItem(Game::GetInstance()->GetText("NavDlg.radius"));
if (s->Mass() > 0)
- info_list->AddItem(Game::GetText("NavDlg.mass"));
- info_list->AddItem(Game::GetText("NavDlg.orbit"));
- info_list->AddItem(Game::GetText("NavDlg.period"));
+ info_list->AddItem(Game::GetInstance()->GetText("NavDlg.mass"));
+ info_list->AddItem(Game::GetInstance()->GetText("NavDlg.orbit"));
+ info_list->AddItem(Game::GetInstance()->GetText("NavDlg.period"));
int row = 0;
info_list->SetItemText(row++, 1, s->Name());
@@ -757,27 +757,27 @@ NavDlg::UpdateSelection()
MissionElement* sel_elem = star_map->GetSelectedElem();
if (sel_ship) {
- Text order_desc = Game::GetText("NavDlg.none");
+ Text order_desc = Game::GetInstance()->GetText("NavDlg.none");
char shield[16];
char hull[16];
char range[32];
sprintf_s(shield, "%03d", sel_ship->ShieldStrength());
sprintf_s(hull, "%03d", sel_ship->HullStrength());
- sprintf_s(range, "%s", Game::GetText("NavDlg.not-avail").data());
+ sprintf_s(range, "%s", Game::GetInstance()->GetText("NavDlg.not-avail").data());
if (ship) {
FormatNumberExp(range, Point(sel_ship->Location()-ship->Location()).length()/1000);
strcat_s(range, units_km.data());
}
- info_list->AddItem(Game::GetText("NavDlg.name"));
- info_list->AddItem(Game::GetText("NavDlg.class"));
- info_list->AddItem(Game::GetText("NavDlg.sector"));
- info_list->AddItem(Game::GetText("NavDlg.shield"));
- info_list->AddItem(Game::GetText("NavDlg.hull"));
- info_list->AddItem(Game::GetText("NavDlg.range"));
- info_list->AddItem(Game::GetText("NavDlg.orders"));
+ info_list->AddItem(Game::GetInstance()->GetText("NavDlg.name"));
+ info_list->AddItem(Game::GetInstance()->GetText("NavDlg.class"));
+ info_list->AddItem(Game::GetInstance()->GetText("NavDlg.sector"));
+ info_list->AddItem(Game::GetInstance()->GetText("NavDlg.shield"));
+ info_list->AddItem(Game::GetInstance()->GetText("NavDlg.hull"));
+ info_list->AddItem(Game::GetInstance()->GetText("NavDlg.range"));
+ info_list->AddItem(Game::GetInstance()->GetText("NavDlg.orders"));
int row = 0;
info_list->SetItemText(row++, 1, sel_ship->Name());
@@ -790,7 +790,7 @@ NavDlg::UpdateSelection()
}
else if (sel_elem) {
- Text order_desc = Game::GetText("NavDlg.none");
+ Text order_desc = Game::GetInstance()->GetText("NavDlg.none");
char range[32];
MissionElement* self = mission->GetElements()[0];
@@ -801,11 +801,11 @@ NavDlg::UpdateSelection()
strcat_s(range, units_km.data());
- info_list->AddItem(Game::GetText("NavDlg.name"));
- info_list->AddItem(Game::GetText("NavDlg.class"));
- info_list->AddItem(Game::GetText("NavDlg.sector"));
- info_list->AddItem(Game::GetText("NavDlg.range"));
- info_list->AddItem(Game::GetText("NavDlg.orders"));
+ info_list->AddItem(Game::GetInstance()->GetText("NavDlg.name"));
+ info_list->AddItem(Game::GetInstance()->GetText("NavDlg.class"));
+ info_list->AddItem(Game::GetInstance()->GetText("NavDlg.sector"));
+ info_list->AddItem(Game::GetInstance()->GetText("NavDlg.range"));
+ info_list->AddItem(Game::GetInstance()->GetText("NavDlg.orders"));
int row = 0;
info_list->SetItemText(row++, 1, sel_elem->Name());
@@ -813,7 +813,7 @@ NavDlg::UpdateSelection()
if (sel_elem->GetDesign())
info_list->SetItemText(row++, 1, sel_elem->Abbreviation() + Text(" ") + sel_elem->GetDesign()->name);
else
- info_list->SetItemText(row++, 1, Game::GetText("NavDlg.unknown"));
+ info_list->SetItemText(row++, 1, Game::GetInstance()->GetText("NavDlg.unknown"));
info_list->SetItemText(row++, 1, sel_elem->Region());
info_list->SetItemText(row++, 1, range);
@@ -843,7 +843,7 @@ NavDlg::UpdateLists()
switch (seln_mode) {
case SELECT_SYSTEM:
{
- seln_list->SetColumnTitle(0, Game::GetText(Text("NavDlg.filter.") + filter_name[seln_mode]));
+ seln_list->SetColumnTitle(0, Game::GetInstance()->GetText(Text("NavDlg.filter.") + filter_name[seln_mode]));
int i = 0;
ListIter<StarSystem> iter = star_map->GetGalaxy();
while (++iter)
@@ -853,7 +853,7 @@ NavDlg::UpdateLists()
case SELECT_PLANET:
{
- seln_list->SetColumnTitle(0, Game::GetText(Text("NavDlg.filter.") + filter_name[seln_mode]));
+ seln_list->SetColumnTitle(0, Game::GetInstance()->GetText(Text("NavDlg.filter.") + filter_name[seln_mode]));
int i = 0;
ListIter<Orbital> iter = planets;
while (++iter) {
@@ -867,7 +867,7 @@ NavDlg::UpdateLists()
case SELECT_REGION:
{
- seln_list->SetColumnTitle(0, Game::GetText(Text("NavDlg.filter.") + filter_name[seln_mode]));
+ seln_list->SetColumnTitle(0, Game::GetInstance()->GetText(Text("NavDlg.filter.") + filter_name[seln_mode]));
int i = 0;
ListIter<OrbitalRegion> iter = regions;
while (++iter) {
@@ -880,7 +880,7 @@ NavDlg::UpdateLists()
case SELECT_STARSHIP:
case SELECT_FIGHTER:
{
- seln_list->SetColumnTitle(0, Game::GetText(Text("NavDlg.filter.") + filter_name[seln_mode]));
+ seln_list->SetColumnTitle(0, Game::GetInstance()->GetText(Text("NavDlg.filter.") + filter_name[seln_mode]));
int i = 0;
if (mission) {
@@ -960,12 +960,12 @@ NavDlg::OnEngage(AWEvent* event)
if (navsys) {
if (navsys->AutoNavEngaged()) {
navsys->DisengageAutoNav();
- commit_btn->SetText(Game::GetText("NavDlg.commit"));
+ commit_btn->SetText(Game::GetInstance()->GetText("NavDlg.commit"));
commit_btn->SetBackColor(commit_color);
}
else {
navsys->EngageAutoNav();
- commit_btn->SetText(Game::GetText("NavDlg.cancel"));
+ commit_btn->SetText(Game::GetInstance()->GetText("NavDlg.cancel"));
commit_btn->SetBackColor(cancel_color);
hide = true;
}
@@ -1045,7 +1045,7 @@ NavDlg::OnMapClick(AWEvent* event)
CoordinateSelection();
// double-click:
- if (Game::RealTime() - click_time < 350) {
+ if (Game::GetInstance()->RealTime() - click_time < 350) {
MissionElement* elem = star_map->GetSelectedElem();
MsnElemDlg* msn_elem_dlg = manager->GetMsnElemDlg();
@@ -1056,7 +1056,7 @@ NavDlg::OnMapClick(AWEvent* event)
}
}
- click_time = Game::RealTime();
+ click_time = Game::GetInstance()->RealTime();
}
void
diff --git a/Stars45/NavLight.cpp b/Stars45/NavLight.cpp
index 413b338..9461405 100644
--- a/Stars45/NavLight.cpp
+++ b/Stars45/NavLight.cpp
@@ -28,8 +28,8 @@ NavLight::NavLight(double p, double s)
: System(COMPUTER, 32, "Navigation Lights", 1, 0),
period(p), nlights(0), scale(s), enable(true)
{
- name = Game::GetText("sys.nav-light");
- abrv = Game::GetText("sys.nav-light.abrv");
+ name = Game::GetInstance()->GetText("sys.nav-light");
+ abrv = Game::GetInstance()->GetText("sys.nav-light.abrv");
ZeroMemory(beacon, sizeof(beacon));
ZeroMemory(beacon_type, sizeof(beacon_type));
@@ -99,7 +99,7 @@ void
NavLight::ExecFrame(double seconds)
{
if (enable && power_on) {
- double t = (Game::GameTime()+offset) / 1000.0;
+ double t = (Game::GetInstance()->GameTime()+offset) / 1000.0;
DWORD n = (int) (fmod(t, period) * 32 / period);
DWORD code = 1 << n;
diff --git a/Stars45/NavSystem.cpp b/Stars45/NavSystem.cpp
index c0be9ce..bf27dae 100644
--- a/Stars45/NavSystem.cpp
+++ b/Stars45/NavSystem.cpp
@@ -25,8 +25,8 @@ NavSystem::NavSystem()
: System(COMPUTER, 2, "Auto Nav System", 1, 1,1,1),
autonav(0)
{
- name = Game::GetText("sys.nav-system");
- abrv = Game::GetText("sys.nav-system.abrv");
+ name = Game::GetInstance()->GetText("sys.nav-system");
+ abrv = Game::GetInstance()->GetText("sys.nav-system.abrv");
power_flags = POWER_WATTS | POWER_CRITICAL;
}
diff --git a/Stars45/NetClientDlg.cpp b/Stars45/NetClientDlg.cpp
index 38eee72..8b64ca5 100644
--- a/Stars45/NetClientDlg.cpp
+++ b/Stars45/NetClientDlg.cpp
@@ -168,9 +168,9 @@ NetClientDlg::ShowServers()
lst_servers->AddItemWithData(info->name, (DWORD) i);
lst_servers->SetItemText(i, 1, info->type);
lst_servers->SetItemText(i, 2, info->password);
- lst_servers->SetItemText(i, 3, Game::GetText("NetClientDlg.offline"));
+ lst_servers->SetItemText(i, 3, Game::GetInstance()->GetText("NetClientDlg.offline"));
lst_servers->SetItemText(i, 4, "0");
- lst_servers->SetItemText(i, 5, Game::GetText("NetClientDlg.not-avail"));
+ lst_servers->SetItemText(i, 5, Game::GetInstance()->GetText("NetClientDlg.not-avail"));
i++;
}
@@ -199,7 +199,7 @@ NetClientDlg::UpdateServers()
NetServerInfo* info = config->GetServerList().at(n);
lst_servers->SetItemText(i, 0, info->name);
- Text status = Game::GetText("NetClientDlg.offline");
+ Text status = Game::GetInstance()->GetText("NetClientDlg.offline");
if (info->ping_time > 0 && info->ping_time < 10000) {
char buffer[32];
@@ -208,16 +208,16 @@ NetClientDlg::UpdateServers()
switch (info->status) {
default:
- case NetServerInfo::OFFLINE: status = Game::GetText("NetClientDlg.offline"); break;
- case NetServerInfo::LOBBY: status = Game::GetText("NetClientDlg.lobby"); break;
- case NetServerInfo::BRIEFING: status = Game::GetText("NetClientDlg.briefing"); break;
- case NetServerInfo::ACTIVE: status = Game::GetText("NetClientDlg.active"); break;
- case NetServerInfo::DEBRIEFING: status = Game::GetText("NetClientDlg.debriefing"); break;
- case NetServerInfo::PERSISTENT: status = Game::GetText("NetClientDlg.persistent"); break;
+ case NetServerInfo::OFFLINE: status = Game::GetInstance()->GetText("NetClientDlg.offline"); break;
+ case NetServerInfo::LOBBY: status = Game::GetInstance()->GetText("NetClientDlg.lobby"); break;
+ case NetServerInfo::BRIEFING: status = Game::GetInstance()->GetText("NetClientDlg.briefing"); break;
+ case NetServerInfo::ACTIVE: status = Game::GetInstance()->GetText("NetClientDlg.active"); break;
+ case NetServerInfo::DEBRIEFING: status = Game::GetInstance()->GetText("NetClientDlg.debriefing"); break;
+ case NetServerInfo::PERSISTENT: status = Game::GetInstance()->GetText("NetClientDlg.persistent"); break;
}
}
else {
- lst_servers->SetItemText(i, 5, Game::GetText("NetClientDlg.not-avail"));
+ lst_servers->SetItemText(i, 5, Game::GetInstance()->GetText("NetClientDlg.not-avail"));
}
lst_servers->SetItemText(i, 3, status);
diff --git a/Stars45/NetGameClient.cpp b/Stars45/NetGameClient.cpp
index 80d95f7..1871057 100644
--- a/Stars45/NetGameClient.cpp
+++ b/Stars45/NetGameClient.cpp
@@ -159,10 +159,10 @@ NetGameClient::DoJoinAnnounce(NetMsg* msg)
Ship* ship = 0;
char ship_name[128];
- strcpy_s(ship_name, Game::GetText("NetGameClient.no-ship").data());
+ strcpy_s(ship_name, Game::GetInstance()->GetText("NetGameClient.no-ship").data());
if (local_player && player_name == name) {
- HUDView::Message(Game::GetText("NetGameClient.local-accept"), name.data(), local_player->Name());
+ HUDView::Message(Game::GetInstance()->GetText("NetGameClient.local-accept"), name.data(), local_player->Name());
objid = oid;
netid = nid;
@@ -239,7 +239,7 @@ NetGameClient::DoJoinAnnounce(NetMsg* msg)
Print("Remote Player '%s' has joined as '%s' with ID %d\n", name.data(), ship_name, oid);
}
else {
- HUDView::Message(Game::GetText("NetGameClient.remote-join").data(), name.data(), ship_name);
+ HUDView::Message(Game::GetInstance()->GetText("NetGameClient.remote-join").data(), name.data(), ship_name);
}
}
}
@@ -274,7 +274,7 @@ NetGameClient::DoJoinBacklog(NetJoinAnnounce* join_ann)
Ship* ship = 0;
char ship_name[128];
- strcpy_s(ship_name, Game::GetText("NetGameClient.no-ship").data());
+ strcpy_s(ship_name, Game::GetInstance()->GetText("NetGameClient.no-ship").data());
if (nid && oid) {
NetPlayer* remote_player = FindPlayerByObjID(oid);
@@ -322,7 +322,7 @@ NetGameClient::DoJoinBacklog(NetJoinAnnounce* join_ann)
Print("NetGameClient::DoJoinBacklog() Remote Player '%s' has joined as '%s' with ID %d\n", name.data(), ship_name, oid);
}
else {
- HUDView::Message(Game::GetText("NetGameClient.remote-join").data(), name.data(), ship_name);
+ HUDView::Message(Game::GetInstance()->GetText("NetGameClient.remote-join").data(), name.data(), ship_name);
}
}
}
@@ -361,9 +361,9 @@ NetGameClient::DoQuitAnnounce(NetMsg* msg)
}
if (quit_ann.GetDisconnected())
- HUDView::Message(Game::GetText("NetGameClient.remote-discon").data(), zombie->Name());
+ HUDView::Message(Game::GetInstance()->GetText("NetGameClient.remote-discon").data(), zombie->Name());
else
- HUDView::Message(Game::GetText("NetGameClient.remote-quit").data(), zombie->Name());
+ HUDView::Message(Game::GetInstance()->GetText("NetGameClient.remote-quit").data(), zombie->Name());
delete zombie;
}
else {
@@ -376,7 +376,7 @@ NetGameClient::DoGameOver(NetMsg* msg)
{
if (!msg) return;
- HUDView::Message(Game::GetText("NetGameClient.game-over").data());
+ HUDView::Message(Game::GetInstance()->GetText("NetGameClient.game-over").data());
players.destroy();
active = false;
}
@@ -386,8 +386,8 @@ NetGameClient::DoDisconnect(NetMsg* msg)
{
if (!msg) return;
- HUDView::Message(Game::GetText("NetGameClient.discon-detect").data());
- HUDView::Message(Game::GetText("NetGameClient.please-exit").data());
+ HUDView::Message(Game::GetInstance()->GetText("NetGameClient.discon-detect").data());
+ HUDView::Message(Game::GetInstance()->GetText("NetGameClient.please-exit").data());
players.destroy();
active = false;
}
@@ -473,7 +473,7 @@ NetGameClient::DoObjKill(NetMsg* msg)
Ship* ship = FindShipByObjID(obj_kill.GetObjID());
if (ship) {
Ship* killer = FindShipByObjID(obj_kill.GetKillerID());
- Text killer_name = Game::GetText("NetGameClient.unknown");
+ Text killer_name = Game::GetInstance()->GetText("NetGameClient.unknown");
if (killer)
killer_name = killer->Name();
@@ -911,7 +911,7 @@ NetGameClient::DoChatMsg(NetMsg* msg)
Text name = chat_msg.GetName();
if (name.length() < 1)
- name = Game::GetText("NetGameClient.chat.unknown");
+ name = Game::GetInstance()->GetText("NetGameClient.chat.unknown");
HUDView::Message("%s> %s", name.data(), chat_msg.GetText().data());
}
@@ -935,7 +935,7 @@ NetGameClient::DoSelfDestruct(NetMsg* msg)
void
NetGameClient::Send()
{
- DWORD time = Game::GameTime();
+ DWORD time = Game::GetInstance()->GameTime();
// don't flood the network...
if (time - last_send_time < MIN_NET_FRAME)
diff --git a/Stars45/NetGameServer.cpp b/Stars45/NetGameServer.cpp
index 300a61f..10ab73d 100644
--- a/Stars45/NetGameServer.cpp
+++ b/Stars45/NetGameServer.cpp
@@ -140,9 +140,9 @@ NetGameServer::ExecFrame()
static DWORD time_mark = 0;
- if (!time_mark) time_mark = Game::RealTime();
- else if (Game::RealTime() - time_mark > 60000) {
- time_mark = Game::RealTime();
+ if (!time_mark) time_mark = Game::GetInstance()->RealTime();
+ else if (Game::GetInstance()->RealTime() - time_mark > 60000) {
+ time_mark = Game::GetInstance()->RealTime();
if (link && players.size() > 0) {
Print("Server Stats\n-------------\n");
@@ -171,7 +171,7 @@ NetGameServer::CheckSessions()
if (peer && (NetLayer::GetUTC() - peer->LastReceiveTime()) > NET_DISCONNECT_TIME) {
// announce drop:
NetPlayer* zombie = iter.removeItem();
- HUDView::Message(Game::GetText("NetGameServer.remote-discon").data(), zombie->Name());
+ HUDView::Message(Game::GetInstance()->GetText("NetGameServer.remote-discon").data(), zombie->Name());
// tell everyone else:
NetQuitAnnounce quit_ann;
@@ -222,7 +222,7 @@ NetGameServer::DoJoinRequest(NetMsg* msg)
NetJoinRequest join_req;
if (join_req.Unpack(msg->Data())) {
- HUDView::Message(Game::GetText("NetGameServer::join-request").data(), join_req.GetName(), join_req.GetElement(), join_req.GetIndex());
+ HUDView::Message(Game::GetInstance()->GetText("NetGameServer::join-request").data(), join_req.GetName(), join_req.GetElement(), join_req.GetIndex());
DWORD nid = msg->NetID();
Text name = join_req.GetName();
@@ -286,7 +286,7 @@ NetGameServer::DoJoinRequest(NetMsg* msg)
remote_player->SetObjID(ship->GetObjID());
remote_player->SetShip(ship);
- HUDView::Message(Game::GetText("NetGameServer::join-announce").data());
+ HUDView::Message(Game::GetInstance()->GetText("NetGameServer::join-announce").data());
Print("remote player name = %s\n", name.data());
Print(" obj = %d\n", ship->GetObjID());
Print(" ship = %s\n", ship->Name());
@@ -372,7 +372,7 @@ NetGameServer::DoQuitRequest(NetMsg* msg)
if (player) {
NetPlayer* zombie = players.remove(player);
- HUDView::Message(Game::GetText("NetGameServer.remote-quit").data(), zombie->Name());
+ HUDView::Message(Game::GetInstance()->GetText("NetGameServer.remote-quit").data(), zombie->Name());
// tell everyone else:
NetQuitAnnounce quit_ann;
@@ -465,7 +465,7 @@ NetGameServer::DoObjKill(NetMsg* msg)
Ship* ship = FindShipByObjID(obj_kill.GetObjID());
if (ship) {
Ship* killer = FindShipByObjID(obj_kill.GetKillerID());
- Text killer_name = Game::GetText("NetGameServer.unknown");
+ Text killer_name = Game::GetInstance()->GetText("NetGameServer.unknown");
if (killer)
killer_name = killer->Name();
@@ -909,7 +909,7 @@ NetGameServer::RouteChatMsg(NetChatMsg& chat_msg)
if (local_player && (dst_id == 0xffff || dst_id == 0 || local_player->GetIFF() == (int) dst_id-1)) {
Text name = chat_msg.GetName();
if (name.length() < 1)
- name = Game::GetText("NetGameServer.chat.unknown");
+ name = Game::GetInstance()->GetText("NetGameServer.chat.unknown");
// don't echo general messages from the local player.
// they are already displayed by the chat entry code
@@ -924,7 +924,7 @@ NetGameServer::RouteChatMsg(NetChatMsg& chat_msg)
else if (local_player && local_player->GetObjID() == dst_id) {
Text name = chat_msg.GetName();
if (name.length() < 1)
- name = Game::GetText("NetGameServer.chat.unknown");
+ name = Game::GetInstance()->GetText("NetGameServer.chat.unknown");
HUDView::Message("%s> %s", name.data(), chat_msg.GetText().data());
}
@@ -1008,7 +1008,7 @@ NetGameServer::Send()
if (players.isEmpty())
return;
- DWORD time = Game::GameTime();
+ DWORD time = Game::GetInstance()->GameTime();
// don't flood the network...
if (time - last_send_time < MIN_NET_FRAME)
diff --git a/Stars45/NetLobbyServer.cpp b/Stars45/NetLobbyServer.cpp
index f3085d7..eecb5c5 100644
--- a/Stars45/NetLobbyServer.cpp
+++ b/Stars45/NetLobbyServer.cpp
@@ -256,9 +256,9 @@ NetLobbyServer::ExecFrame()
{
NetLobby::ExecFrame();
- if (announce_time == 0 || Game::RealTime() - announce_time > 200000) {
+ if (announce_time == 0 || Game::GetInstance()->RealTime() - announce_time > 200000) {
GameOn();
- announce_time = Game::RealTime();
+ announce_time = Game::GetInstance()->RealTime();
}
if (GetStatus() == NetServerInfo::BRIEFING) {
@@ -377,7 +377,7 @@ NetLobbyServer::CheckSessions()
// announce drop:
char timestr[64];
- FormatTime(timestr, Game::RealTime()/1000);
+ FormatTime(timestr, Game::GetInstance()->RealTime()/1000);
Print("NetLobbyServer: Dropped inactive connection '%s' %s\n",
u->Name().data(), timestr);
diff --git a/Stars45/NetUnitDlg.cpp b/Stars45/NetUnitDlg.cpp
index 339df0c..f0a2b0a 100644
--- a/Stars45/NetUnitDlg.cpp
+++ b/Stars45/NetUnitDlg.cpp
@@ -496,11 +496,11 @@ NetUnitDlg::OnUnit(AWEvent* event)
int list_index = lst_units->GetListIndex();
// double-click:
- if (list_index == unit_index && Game::RealTime() - unit_click_time < 350) {
+ if (list_index == unit_index && Game::GetInstance()->RealTime() - unit_click_time < 350) {
OnSelect(0);
}
- unit_click_time = Game::RealTime();
+ unit_click_time = Game::GetInstance()->RealTime();
unit_index = list_index;
}
@@ -580,9 +580,9 @@ NetUnitDlg::OnBan(AWEvent* event)
ConfirmDlg* confirm = manager->GetConfirmDlg();
if (confirm) {
char msg[512];
- sprintf_s(msg, Game::GetText("NetUnitDlg.are-you-sure").data(), u->Name().data());
+ sprintf_s(msg, Game::GetInstance()->GetText("NetUnitDlg.are-you-sure").data(), u->Name().data());
confirm->SetMessage(msg);
- confirm->SetTitle(Game::GetText("NetUnitDlg.confirm-ban"));
+ confirm->SetTitle(Game::GetInstance()->GetText("NetUnitDlg.confirm-ban"));
confirm->SetParentControl(btn_ban);
manager->ShowConfirmDlg();
diff --git a/Stars45/Particles.cpp b/Stars45/Particles.cpp
index d406e9e..50642f0 100644
--- a/Stars45/Particles.cpp
+++ b/Stars45/Particles.cpp
@@ -57,7 +57,7 @@ blend(a), extra(0.0f), point_sprite(0), emitting(true)
for (int i = 0; i < nverts; i++) {
intensity[i] = 1.0f;
- timestamp[i] = (float) (Game::GameTime() / 1000.0);
+ timestamp[i] = (float) (Game::GetInstance()->GameTime() / 1000.0);
scale[i] = (float) (min_scale);
angle[i] = (float) (Random(0, 2*PI));
frame[i] = 0;
@@ -143,7 +143,7 @@ void Particles::ExecFrame(double seconds)
intensity[i] -= (float) (decay * seconds);
if (point_sprite->NumFrames() > 1) {
- double age = Game::GameTime()/1000.0 - timestamp[i];
+ double age = Game::GetInstance()->GameTime()/1000.0 - timestamp[i];
int n = (int) (age * point_sprite->FrameRate());
if (n >= point_sprite->NumFrames())
@@ -167,7 +167,7 @@ void Particles::ExecFrame(double seconds)
for (int i = nv; i < nverts; i++) {
intensity[i] = 1;
- timestamp[i] = (float) (Game::GameTime() / 1000.0);
+ timestamp[i] = (float) (Game::GetInstance()->GameTime() / 1000.0);
scale[i] = (float) (min_scale);
angle[i] = (float) (Random(0, 2*PI));
frame[i] = 0;
@@ -189,7 +189,7 @@ void Particles::ExecFrame(double seconds)
release[i] = ref_loc;
intensity[i] = 1;
- timestamp[i] = (float) (Game::GameTime() / 1000.0);
+ timestamp[i] = (float) (Game::GetInstance()->GameTime() / 1000.0);
scale[i] = (float) (min_scale);
angle[i] = (float) (PI * rand() / 16384.0);
frame[i] = 0;
diff --git a/Stars45/PlanScreen.cpp b/Stars45/PlanScreen.cpp
index 20fe413..c8aecea 100644
--- a/Stars45/PlanScreen.cpp
+++ b/Stars45/PlanScreen.cpp
@@ -126,7 +126,7 @@ PlanScreen::TearDown()
void
PlanScreen::ExecFrame()
{
- Game::SetScreenColor(Color::Black);
+ Game::GetInstance()->SetScreenColor(Color::Black);
Mission* mission = 0;
Campaign* campaign = Campaign::GetCampaign();
diff --git a/Stars45/Player.cpp b/Stars45/Player.cpp
index 9cf6151..7648fb9 100644
--- a/Stars45/Player.cpp
+++ b/Stars45/Player.cpp
@@ -640,7 +640,7 @@ Player::GetMissionPoints(ShipStats* s, DWORD start_time)
if (s) {
result = s->GetPoints();
- int flight_time = (Game::GameTime() - start_time) / 1000;
+ int flight_time = (Game::GetInstance()->GameTime() - start_time) / 1000;
// if player survived mission, award one experience point
// for each minute of action, in ten point blocks:
@@ -681,7 +681,7 @@ Player::ProcessStats(ShipStats* s, DWORD start_time)
AddLosses(s->GetDeaths());
AddLosses(s->GetColls());
AddMissions(1);
- AddFlightTime((Game::GameTime() - start_time) / 1000);
+ AddFlightTime((Game::GetInstance()->GameTime() - start_time) / 1000);
int rank = Rank();
@@ -1380,24 +1380,24 @@ Player::LoadAwardTables()
if (pdef) {
if (pdef->name()->value() == ("name")) {
GetDefText(award->name, pdef, filename);
- award->name = Game::GetText(award->name);
+ award->name = Game::GetInstance()->GetText(award->name);
}
else if (pdef->name()->value() == ("abrv")) {
GetDefText(award->abrv, pdef, filename);
- award->abrv = Game::GetText(award->abrv);
+ award->abrv = Game::GetInstance()->GetText(award->abrv);
}
else if (pdef->name()->value() == ("desc")) {
GetDefText(award->desc, pdef, filename);
if (award->desc.length() <= 40)
- award->desc = Game::GetText(award->desc);
+ award->desc = Game::GetInstance()->GetText(award->desc);
}
else if (pdef->name()->value() == ("award")) {
GetDefText(award->grant, pdef, filename);
if (award->grant.length() <= 40)
- award->grant = Game::GetText(award->grant);
+ award->grant = Game::GetInstance()->GetText(award->grant);
}
else if (pdef->name()->value() == ("desc_sound"))
diff --git a/Stars45/PlayerDlg.cpp b/Stars45/PlayerDlg.cpp
index 7d78b08..f06fc37 100644
--- a/Stars45/PlayerDlg.cpp
+++ b/Stars45/PlayerDlg.cpp
@@ -294,10 +294,10 @@ PlayerDlg::OnDel(AWEvent* event)
ConfirmDlg* confirm = manager->GetConfirmDlg();
if (confirm) {
char msg[256];
- sprintf_s(msg, Game::GetText("PlayerDlg.are-you-sure").data(),
+ sprintf_s(msg, Game::GetInstance()->GetText("PlayerDlg.are-you-sure").data(),
Player::GetCurrentPlayer()->Name().data());
confirm->SetMessage(msg);
- confirm->SetTitle(Game::GetText("PlayerDlg.confirm-delete"));
+ confirm->SetTitle(Game::GetInstance()->GetText("PlayerDlg.confirm-delete"));
confirm->SetParentControl(btn_del);
manager->ShowConfirmDlg();
diff --git a/Stars45/Power.cpp b/Stars45/Power.cpp
index 34dda34..a4b95c1 100644
--- a/Stars45/Power.cpp
+++ b/Stars45/Power.cpp
@@ -33,8 +33,8 @@ PowerSource::PowerSource(SUBTYPE s, double max_out, double f_ratio)
max_output((float) max_out), fuel_ratio((float) f_ratio),
route_changed(false), requested_power_level(1.0f)
{
- name = Game::GetText(source_type[s]);
- abrv = Game::GetText(Text(source_type[s]) + ".abrv");
+ name = Game::GetInstance()->GetText(source_type[s]);
+ abrv = Game::GetInstance()->GetText(Text(source_type[s]) + ".abrv");
if (fuel_ratio < 1) {
switch (subtype) { // enough to last for [n] hours at full power
@@ -208,7 +208,7 @@ PowerSource::ExecFrame(double seconds)
}
}
- if (IsPowerOn() && capacity > 0 && !Game::Paused()) {
+ if (IsPowerOn() && capacity > 0 && !Game::GetInstance()->Paused()) {
// reactors always burn at least 10% of max (to maintain operating temp):
if (subtype != BATTERY) {
double baseline = 0.1 * max_output * seconds;
diff --git a/Stars45/QuantumDrive.cpp b/Stars45/QuantumDrive.cpp
index 5d6688b..96d37d6 100644
--- a/Stars45/QuantumDrive.cpp
+++ b/Stars45/QuantumDrive.cpp
@@ -33,8 +33,8 @@ QuantumDrive::QuantumDrive(SUBTYPE s, double cap, double rate)
: System(DRIVE, s, "Quantum", drive_value, (float) cap, (float) cap, (float) rate),
dst_rgn(0), active_state(ACTIVE_READY), warp_fov(1), jump_time(0), countdown(5)
{
- name = Game::GetText("sys.quantum");
- abrv = Game::GetText("sys.quantum.abrv");
+ name = Game::GetInstance()->GetText("sys.quantum");
+ abrv = Game::GetInstance()->GetText("sys.quantum.abrv");
emcon_power[0] = 0;
emcon_power[1] = 0;
diff --git a/Stars45/QuantumView.cpp b/Stars45/QuantumView.cpp
index 1bc1c4c..ae6e869 100644
--- a/Stars45/QuantumView.cpp
+++ b/Stars45/QuantumView.cpp
@@ -50,7 +50,7 @@ QuantumView::Initialize()
static int initialized = 0;
if (initialized) return;
- quantum_menu = new(__FILE__,__LINE__) Menu(Game::GetText("QuantumView.menu"));
+ quantum_menu = new(__FILE__,__LINE__) Menu(Game::GetInstance()->GetText("QuantumView.menu"));
initialized = 1;
}
@@ -168,7 +168,7 @@ QuantumView::ExecFrame()
static double time_til_change = 0;
if (time_til_change > 0)
- time_til_change -= Game::GUITime();
+ time_til_change -= Game::GetInstance()->GUITime();
if (time_til_change <= 0) {
time_til_change = 0;
diff --git a/Stars45/QuitView.cpp b/Stars45/QuitView.cpp
index f8e8e9e..4d02836 100644
--- a/Stars45/QuitView.cpp
+++ b/Stars45/QuitView.cpp
@@ -162,7 +162,7 @@ QuitView::ExecFrame()
// exit and accept:
if (action == 1) {
CloseMenu();
- Game::SetTimeCompression(1);
+ Game::GetInstance()->SetTimeCompression(1);
Starshatter* stars = Starshatter::GetInstance();
stars->SetGameMode(Starshatter::PLAN_MODE);
@@ -171,7 +171,7 @@ QuitView::ExecFrame()
// quit and discard results:
else if (action == 2) {
CloseMenu();
- Game::SetTimeCompression(1);
+ Game::GetInstance()->SetTimeCompression(1);
Starshatter* stars = Starshatter::GetInstance();
Campaign* campaign = Campaign::GetCampaign();
@@ -228,8 +228,8 @@ QuitView::CanAccept()
Ship* player_ship = sim->GetPlayerShip();
if (player_ship->MissionClock() < 60000) {
- RadioView::Message(Game::GetText("QuitView.too-soon"));
- RadioView::Message(Game::GetText("QuitView.abort"));
+ RadioView::Message(Game::GetInstance()->GetText("QuitView.too-soon"));
+ RadioView::Message(Game::GetInstance()->GetText("QuitView.abort"));
return false;
}
@@ -240,8 +240,8 @@ QuitView::CanAccept()
int ciff = c->GetIFF(player_ship);
if (c->Threat(player_ship)) {
- RadioView::Message(Game::GetText("QuitView.threats-present"));
- RadioView::Message(Game::GetText("QuitView.abort"));
+ RadioView::Message(Game::GetInstance()->GetText("QuitView.threats-present"));
+ RadioView::Message(Game::GetInstance()->GetText("QuitView.abort"));
return false;
}
@@ -250,14 +250,14 @@ QuitView::CanAccept()
double dist = delta.length();
if (cship->IsDropship() && dist < 50e3) {
- RadioView::Message(Game::GetText("QuitView.threats-present"));
- RadioView::Message(Game::GetText("QuitView.abort"));
+ RadioView::Message(Game::GetInstance()->GetText("QuitView.threats-present"));
+ RadioView::Message(Game::GetInstance()->GetText("QuitView.abort"));
return false;
}
else if (cship->IsStarship() && dist < 100e3) {
- RadioView::Message(Game::GetText("QuitView.threats-present"));
- RadioView::Message(Game::GetText("QuitView.abort"));
+ RadioView::Message(Game::GetInstance()->GetText("QuitView.threats-present"));
+ RadioView::Message(Game::GetInstance()->GetText("QuitView.abort"));
return false;
}
}
diff --git a/Stars45/RadioHandler.cpp b/Stars45/RadioHandler.cpp
index a8622b4..e7ff7f8 100644
--- a/Stars45/RadioHandler.cpp
+++ b/Stars45/RadioHandler.cpp
@@ -393,16 +393,16 @@ RadioHandler::Inbound(RadioMessage* msg, Ship* ship)
if (!deck || !same_rgn || squadron < 0 || slot < 0) {
RadioMessage* wave_off = new(__FILE__,__LINE__) RadioMessage(inbound, ship, RadioMessage::NACK);
if (!hangar)
- wave_off->SetInfo(Game::GetText("RadioHandler.no-hangar"));
+ wave_off->SetInfo(Game::GetInstance()->GetText("RadioHandler.no-hangar"));
else if (!same_rgn) {
char info[256];
- sprintf_s(info, Game::GetText("RadioHandler.too-far-away").data(), ship->GetRegion()->Name());
+ sprintf_s(info, Game::GetInstance()->GetText("RadioHandler.too-far-away").data(), ship->GetRegion()->Name());
wave_off->SetInfo(info);
}
else
- wave_off->SetInfo(Game::GetText("RadioHandler.all-full"));
+ wave_off->SetInfo(Game::GetInstance()->GetText("RadioHandler.all-full"));
RadioTraffic::Transmit(wave_off);
return false;
@@ -425,12 +425,12 @@ RadioHandler::Inbound(RadioMessage* msg, Ship* ship)
if (inbound_slot->Cleared()) {
char info[256];
- sprintf_s(info, Game::GetText("RadioHandler.cleared").data(), deck->Name());
+ sprintf_s(info, Game::GetInstance()->GetText("RadioHandler.cleared").data(), deck->Name());
approach->SetInfo(info);
}
else if (sequence) {
char info[256];
- sprintf_s(info, Game::GetText("RadioHandler.sequenced").data(), sequence, deck->Name());
+ sprintf_s(info, Game::GetInstance()->GetText("RadioHandler.sequenced").data(), sequence, deck->Name());
approach->SetInfo(info);
}
@@ -521,7 +521,7 @@ RadioHandler::Support(RadioMessage* msg, Ship* ship)
escort->TargetList().append(msg->Sender());
RadioTraffic::Transmit(escort);
- Text ok = Game::GetText("RadioHandler.help-enroute");
+ Text ok = Game::GetInstance()->GetText("RadioHandler.help-enroute");
Ship* sender = (Ship*) msg->Sender(); // cast-away const
RadioMessage* response = new(__FILE__,__LINE__) RadioMessage(sender, ship, RadioMessage::ACK);
response->SetInfo(ok);
@@ -530,7 +530,7 @@ RadioHandler::Support(RadioMessage* msg, Ship* ship)
// no help in sight:
else {
- Text nope = Game::GetText("RadioHandler.no-help-for-you");
+ Text nope = Game::GetInstance()->GetText("RadioHandler.no-help-for-you");
Ship* sender = (Ship*) msg->Sender(); // cast-away const
RadioMessage* response = new(__FILE__,__LINE__) RadioMessage(sender, ship, RadioMessage::NACK);
response->SetInfo(nope);
diff --git a/Stars45/RadioTraffic.cpp b/Stars45/RadioTraffic.cpp
index 8db561d..2ce5acb 100644
--- a/Stars45/RadioTraffic.cpp
+++ b/Stars45/RadioTraffic.cpp
@@ -159,7 +159,7 @@ RadioTraffic::TranslateVox(const char* phrase)
Text vox = "vox.";
vox += phrase;
vox.toLower();
- vox = Game::GetText(vox);
+ vox = Game::GetInstance()->GetText(vox);
if (vox.contains("vox.")) // failed to translate
return Text(phrase); // return the original text
diff --git a/Stars45/RadioView.cpp b/Stars45/RadioView.cpp
index d1c2514..9452e34 100644
--- a/Stars45/RadioView.cpp
+++ b/Stars45/RadioView.cpp
@@ -67,59 +67,59 @@ RadioView::Initialize()
static int initialized = 0;
if (initialized) return;
- target_menu = new(__FILE__,__LINE__) Menu(Game::GetText("RadioView.menu.TARGET"));
- target_menu->AddItem(Game::GetText("RadioView.item.attack"), RadioMessage::ATTACK);
- target_menu->AddItem(Game::GetText("RadioView.item.bracket"), RadioMessage::BRACKET);
- target_menu->AddItem(Game::GetText("RadioView.item.escort"), RadioMessage::ESCORT);
-
- combat_menu = new(__FILE__,__LINE__) Menu(Game::GetText("RadioView.menu.COMBAT"));
- combat_menu->AddItem(Game::GetText("RadioView.item.cover"), RadioMessage::COVER_ME);
- combat_menu->AddItem(Game::GetText("RadioView.item.break-attack"), RadioMessage::WEP_FREE);
- combat_menu->AddItem(Game::GetText("RadioView.item.form-up"), RadioMessage::FORM_UP);
-
- formation_menu = new(__FILE__,__LINE__) Menu(Game::GetText("RadioView.menu.FORMATION"));
- formation_menu->AddItem(Game::GetText("RadioView.item.diamond"), RadioMessage::GO_DIAMOND);
- formation_menu->AddItem(Game::GetText("RadioView.item.spread"), RadioMessage::GO_SPREAD);
- formation_menu->AddItem(Game::GetText("RadioView.item.box"), RadioMessage::GO_BOX);
- formation_menu->AddItem(Game::GetText("RadioView.item.trail"), RadioMessage::GO_TRAIL);
-
- sensors_menu = new(__FILE__,__LINE__) Menu(Game::GetText("RadioView.menu.SENSORS"));
- sensors_menu->AddItem(Game::GetText("RadioView.item.emcon-1"), RadioMessage::GO_EMCON1);
- sensors_menu->AddItem(Game::GetText("RadioView.item.emcon-2"), RadioMessage::GO_EMCON2);
- sensors_menu->AddItem(Game::GetText("RadioView.item.emcon-3"), RadioMessage::GO_EMCON3);
- sensors_menu->AddItem(Game::GetText("RadioView.item.probe"), RadioMessage::LAUNCH_PROBE);
-
- mission_menu = new(__FILE__,__LINE__) Menu(Game::GetText("RadioView.menu.MISSION"));
- mission_menu->AddItem(Game::GetText("RadioView.item.skip-navpt"), RadioMessage::SKIP_NAVPOINT);
- mission_menu->AddItem(Game::GetText("RadioView.item.resume"), RadioMessage::RESUME_MISSION);
- mission_menu->AddItem(Game::GetText("RadioView.item.rtb"), RadioMessage::RTB);
-
- wing_menu = new(__FILE__,__LINE__) Menu(Game::GetText("RadioView.menu.WINGMAN"));
- wing_menu->AddMenu(Game::GetText("RadioView.item.target"), target_menu);
- wing_menu->AddMenu(Game::GetText("RadioView.item.combat"), combat_menu);
- wing_menu->AddMenu(Game::GetText("RadioView.item.formation"), formation_menu);
- wing_menu->AddMenu(Game::GetText("RadioView.item.mission"), mission_menu);
- wing_menu->AddMenu(Game::GetText("RadioView.item.sensors"), sensors_menu);
-
- elem_menu = new(__FILE__,__LINE__) Menu(Game::GetText("RadioView.menu.ELEMENT"));
- elem_menu->AddMenu(Game::GetText("RadioView.item.target"), target_menu);
- elem_menu->AddMenu(Game::GetText("RadioView.item.combat"), combat_menu);
- elem_menu->AddMenu(Game::GetText("RadioView.item.formation"), formation_menu);
- elem_menu->AddMenu(Game::GetText("RadioView.item.mission"), mission_menu);
- elem_menu->AddMenu(Game::GetText("RadioView.item.sensors"), sensors_menu);
-
- control_menu = new(__FILE__,__LINE__) Menu(Game::GetText("RadioView.menu.CONTROL"));
- control_menu->AddItem(Game::GetText("RadioView.item.picture"), RadioMessage::REQUEST_PICTURE);
- control_menu->AddItem(Game::GetText("RadioView.item.backup"), RadioMessage::REQUEST_SUPPORT);
- control_menu->AddItem(Game::GetText("RadioView.item.call-inbound"), RadioMessage::CALL_INBOUND);
- control_menu->AddItem(Game::GetText("RadioView.item.call-finals"), RadioMessage::CALL_FINALS);
-
- fighter_menu = new(__FILE__,__LINE__) Menu(Game::GetText("RadioView.menu.RADIO"));
- fighter_menu->AddMenu(Game::GetText("RadioView.item.wingman"), wing_menu);
- fighter_menu->AddMenu(Game::GetText("RadioView.item.element"), elem_menu);
- fighter_menu->AddMenu(Game::GetText("RadioView.item.control"), control_menu);
-
- starship_menu = new(__FILE__,__LINE__) Menu(Game::GetText("RadioView.menu.RADIO"));
+ target_menu = new(__FILE__,__LINE__) Menu(Game::GetInstance()->GetText("RadioView.menu.TARGET"));
+ target_menu->AddItem(Game::GetInstance()->GetText("RadioView.item.attack"), RadioMessage::ATTACK);
+ target_menu->AddItem(Game::GetInstance()->GetText("RadioView.item.bracket"), RadioMessage::BRACKET);
+ target_menu->AddItem(Game::GetInstance()->GetText("RadioView.item.escort"), RadioMessage::ESCORT);
+
+ combat_menu = new(__FILE__,__LINE__) Menu(Game::GetInstance()->GetText("RadioView.menu.COMBAT"));
+ combat_menu->AddItem(Game::GetInstance()->GetText("RadioView.item.cover"), RadioMessage::COVER_ME);
+ combat_menu->AddItem(Game::GetInstance()->GetText("RadioView.item.break-attack"), RadioMessage::WEP_FREE);
+ combat_menu->AddItem(Game::GetInstance()->GetText("RadioView.item.form-up"), RadioMessage::FORM_UP);
+
+ formation_menu = new(__FILE__,__LINE__) Menu(Game::GetInstance()->GetText("RadioView.menu.FORMATION"));
+ formation_menu->AddItem(Game::GetInstance()->GetText("RadioView.item.diamond"), RadioMessage::GO_DIAMOND);
+ formation_menu->AddItem(Game::GetInstance()->GetText("RadioView.item.spread"), RadioMessage::GO_SPREAD);
+ formation_menu->AddItem(Game::GetInstance()->GetText("RadioView.item.box"), RadioMessage::GO_BOX);
+ formation_menu->AddItem(Game::GetInstance()->GetText("RadioView.item.trail"), RadioMessage::GO_TRAIL);
+
+ sensors_menu = new(__FILE__,__LINE__) Menu(Game::GetInstance()->GetText("RadioView.menu.SENSORS"));
+ sensors_menu->AddItem(Game::GetInstance()->GetText("RadioView.item.emcon-1"), RadioMessage::GO_EMCON1);
+ sensors_menu->AddItem(Game::GetInstance()->GetText("RadioView.item.emcon-2"), RadioMessage::GO_EMCON2);
+ sensors_menu->AddItem(Game::GetInstance()->GetText("RadioView.item.emcon-3"), RadioMessage::GO_EMCON3);
+ sensors_menu->AddItem(Game::GetInstance()->GetText("RadioView.item.probe"), RadioMessage::LAUNCH_PROBE);
+
+ mission_menu = new(__FILE__,__LINE__) Menu(Game::GetInstance()->GetText("RadioView.menu.MISSION"));
+ mission_menu->AddItem(Game::GetInstance()->GetText("RadioView.item.skip-navpt"), RadioMessage::SKIP_NAVPOINT);
+ mission_menu->AddItem(Game::GetInstance()->GetText("RadioView.item.resume"), RadioMessage::RESUME_MISSION);
+ mission_menu->AddItem(Game::GetInstance()->GetText("RadioView.item.rtb"), RadioMessage::RTB);
+
+ wing_menu = new(__FILE__,__LINE__) Menu(Game::GetInstance()->GetText("RadioView.menu.WINGMAN"));
+ wing_menu->AddMenu(Game::GetInstance()->GetText("RadioView.item.target"), target_menu);
+ wing_menu->AddMenu(Game::GetInstance()->GetText("RadioView.item.combat"), combat_menu);
+ wing_menu->AddMenu(Game::GetInstance()->GetText("RadioView.item.formation"), formation_menu);
+ wing_menu->AddMenu(Game::GetInstance()->GetText("RadioView.item.mission"), mission_menu);
+ wing_menu->AddMenu(Game::GetInstance()->GetText("RadioView.item.sensors"), sensors_menu);
+
+ elem_menu = new(__FILE__,__LINE__) Menu(Game::GetInstance()->GetText("RadioView.menu.ELEMENT"));
+ elem_menu->AddMenu(Game::GetInstance()->GetText("RadioView.item.target"), target_menu);
+ elem_menu->AddMenu(Game::GetInstance()->GetText("RadioView.item.combat"), combat_menu);
+ elem_menu->AddMenu(Game::GetInstance()->GetText("RadioView.item.formation"), formation_menu);
+ elem_menu->AddMenu(Game::GetInstance()->GetText("RadioView.item.mission"), mission_menu);
+ elem_menu->AddMenu(Game::GetInstance()->GetText("RadioView.item.sensors"), sensors_menu);
+
+ control_menu = new(__FILE__,__LINE__) Menu(Game::GetInstance()->GetText("RadioView.menu.CONTROL"));
+ control_menu->AddItem(Game::GetInstance()->GetText("RadioView.item.picture"), RadioMessage::REQUEST_PICTURE);
+ control_menu->AddItem(Game::GetInstance()->GetText("RadioView.item.backup"), RadioMessage::REQUEST_SUPPORT);
+ control_menu->AddItem(Game::GetInstance()->GetText("RadioView.item.call-inbound"), RadioMessage::CALL_INBOUND);
+ control_menu->AddItem(Game::GetInstance()->GetText("RadioView.item.call-finals"), RadioMessage::CALL_FINALS);
+
+ fighter_menu = new(__FILE__,__LINE__) Menu(Game::GetInstance()->GetText("RadioView.menu.RADIO"));
+ fighter_menu->AddMenu(Game::GetInstance()->GetText("RadioView.item.wingman"), wing_menu);
+ fighter_menu->AddMenu(Game::GetInstance()->GetText("RadioView.item.element"), elem_menu);
+ fighter_menu->AddMenu(Game::GetInstance()->GetText("RadioView.item.control"), control_menu);
+
+ starship_menu = new(__FILE__,__LINE__) Menu(Game::GetInstance()->GetText("RadioView.menu.RADIO"));
initialized = 1;
}
@@ -279,7 +279,7 @@ RadioView::Refresh()
// age messages:
for (int i = 0; i < MAX_MSG; i++) {
if (msg_time[i] > 0) {
- msg_time[i] -= Game::GUITime();
+ msg_time[i] -= Game::GetInstance()->GUITime();
if (msg_time[i] <= 0) {
msg_time[i] = 0;
@@ -369,7 +369,7 @@ RadioView::SendRadioMessage(Ship* ship, MenuItem* item)
dst_elem = 0;
}
- else if (history.Find(Game::GetText("RadioView.menu.WINGMAN"))) { // wingman menu
+ else if (history.Find(Game::GetInstance()->GetText("RadioView.menu.WINGMAN"))) { // wingman menu
int index = ship->GetElementIndex();
int wing = 0;
@@ -393,7 +393,7 @@ RadioView::SendRadioMessage(Ship* ship, MenuItem* item)
}
}
- else if (history.Find(Game::GetText("RadioView.menu.ELEMENT"))) { // element menu
+ else if (history.Find(Game::GetInstance()->GetText("RadioView.menu.ELEMENT"))) { // element menu
RadioMessage* msg = new(__FILE__,__LINE__) RadioMessage(elem, ship, item->GetData());
if (TargetRequired(item))
@@ -402,7 +402,7 @@ RadioView::SendRadioMessage(Ship* ship, MenuItem* item)
RadioTraffic::Transmit(msg);
}
- else if (history.Find(Game::GetText("RadioView.menu.CONTROL"))) { // control menu
+ else if (history.Find(Game::GetInstance()->GetText("RadioView.menu.CONTROL"))) { // control menu
RadioMessage* msg = 0;
Ship* controller = ship->GetController();
@@ -571,7 +571,7 @@ RadioView::GetRadioMenu(Ship* s)
}
else {
strcat_s(text, " ");
- strcat_s(text, Game::GetText("RadioView.item.not-avail").data());
+ strcat_s(text, Game::GetInstance()->GetText("RadioView.item.not-avail").data());
starship_menu->AddItem(text, 0, false);
}
}
@@ -581,7 +581,7 @@ RadioView::GetRadioMenu(Ship* s)
if (num_pages > 1) {
char text[64];
- sprintf_s(text, Game::GetText("RadioView.item.next-page").data(), starship_page + 1, num_pages);
+ sprintf_s(text, Game::GetInstance()->GetText("RadioView.item.next-page").data(), starship_page + 1, num_pages);
starship_menu->AddItem(text);
}
diff --git a/Stars45/SeekerAI.cpp b/Stars45/SeekerAI.cpp
index df86a09..472c419 100644
--- a/Stars45/SeekerAI.cpp
+++ b/Stars45/SeekerAI.cpp
@@ -61,7 +61,7 @@ void
SeekerAI::Navigator()
{
if (delay > 0) {
- delay -= Game::FrameTime();
+ delay -= Game::GetInstance()->FrameTime();
}
else {
Steer s = SeekTarget();
diff --git a/Stars45/Sensor.cpp b/Stars45/Sensor.cpp
index 2e09cdb..ea705e9 100644
--- a/Stars45/Sensor.cpp
+++ b/Stars45/Sensor.cpp
@@ -37,8 +37,8 @@ Sensor::Sensor()
mode(STD), target(0),
nsettings(0), range_index(0)
{
- name = Game::GetText("sys.sensor");
- abrv = Game::GetText("sys.sensor.abrv");
+ name = Game::GetInstance()->GetText("sys.sensor");
+ abrv = Game::GetInstance()->GetText("sys.sensor.abrv");
SetMode(mode);
power_flags = POWER_WATTS;
@@ -169,7 +169,7 @@ Sensor::GetObserverName() const
void
Sensor::ExecFrame(double seconds)
{
- if (Game::Paused())
+ if (Game::GetInstance()->Paused())
return;
System::ExecFrame(seconds);
diff --git a/Stars45/Shield.cpp b/Stars45/Shield.cpp
index f2fffdb..e330ba4 100644
--- a/Stars45/Shield.cpp
+++ b/Stars45/Shield.cpp
@@ -38,8 +38,8 @@ Shield::Shield(SUBTYPE shield_type)
shield_cutoff(0.0f), shield_capacitor(false), shield_bubble(false),
deflection_cost(1.0f), shield_curve(0.05f)
{
- name = Game::GetText(shield_name[shield_type]);
- abrv = Game::GetText("sys.shield.abrv");
+ name = Game::GetInstance()->GetText(shield_name[shield_type]);
+ abrv = Game::GetInstance()->GetText("sys.shield.abrv");
power_flags = POWER_WATTS | POWER_CRITICAL;
energy = 0.0f;
diff --git a/Stars45/Ship.cpp b/Stars45/Ship.cpp
index 24255a5..89b5dda 100644
--- a/Stars45/Ship.cpp
+++ b/Stars45/Ship.cpp
@@ -1041,7 +1041,7 @@ Ship::ClearTrack()
track[0] = Location();
ntrack = 1;
- track_time = Game::GameTime();
+ track_time = Game::GetInstance()->GameTime();
}
void
@@ -1050,7 +1050,7 @@ Ship::UpdateTrack()
const int DEFAULT_TRACK_UPDATE = 500; // milliseconds
const int DEFAULT_TRACK_LENGTH = 20; // 10 seconds
- DWORD time = Game::GameTime();
+ DWORD time = Game::GetInstance()->GameTime();
if (!track) {
track = new(__FILE__,__LINE__) Point[DEFAULT_TRACK_LENGTH];
@@ -1321,7 +1321,7 @@ void
Ship::SetFlightPhase(OP_MODE phase)
{
if (phase == ACTIVE && !launch_time) {
- launch_time = Game::GameTime() + 1;
+ launch_time = Game::GetInstance()->GameTime() + 1;
dock = 0;
if (element)
@@ -1641,8 +1641,8 @@ Ship::HitBy(Shot* shot, Point& impact)
RadioMessage* warn = new(__FILE__,__LINE__) RadioMessage(s, this, RadioMessage::DECLARE_ROGUE);
RadioTraffic::Transmit(warn);
}
- else if (!s->IsRogue() && (Game::GameTime() - ff_warn_time) > 5000) {
- ff_warn_time = Game::GameTime();
+ else if (!s->IsRogue() && (Game::GetInstance()->GameTime() - ff_warn_time) > 5000) {
+ ff_warn_time = Game::GetInstance()->GameTime();
RadioMessage* warn = 0;
if (s->GetTarget() == this)
@@ -1954,7 +1954,7 @@ Ship::CheckFriendlyFire()
return;
// only check once each second
- if (Game::GameTime() - friendly_fire_time < 1000)
+ if (Game::GetInstance()->GameTime() - friendly_fire_time < 1000)
return;
List<Weapon> w_list;
@@ -2011,7 +2011,7 @@ Ship::CheckFriendlyFire()
}
}
- friendly_fire_time = Game::GameTime() + (DWORD) Random(0, 500);
+ friendly_fire_time = Game::GetInstance()->GameTime() + (DWORD) Random(0, 500);
}
// +----------------------------------------------------------------------+
@@ -2611,11 +2611,11 @@ Ship::ExecEvalFrame(double seconds)
static DWORD last_eval_frame = 0; // one ship per game frame
if (element && element->NumObjectives() > 0 &&
- Game::GameTime() - last_eval_time > EVAL_FREQUENCY &&
- last_eval_frame != Game::Frame()) {
+ Game::GetInstance()->GameTime() - last_eval_time > EVAL_FREQUENCY &&
+ last_eval_frame != Game::GetInstance()->Frame()) {
- last_eval_time = Game::GameTime();
- last_eval_frame = Game::Frame();
+ last_eval_time = Game::GetInstance()->GameTime();
+ last_eval_frame = Game::GetInstance()->Frame();
for (int i = 0; i < element->NumObjectives(); i++) {
Instruction* obj = element->GetObjective(i);
@@ -3025,7 +3025,7 @@ Ship::StatFrame(double seconds)
{
if (flight_phase != ACTIVE) {
flight_phase = ACTIVE;
- launch_time = Game::GameTime() + 1;
+ launch_time = Game::GetInstance()->GameTime() + 1;
if (element)
element->SetLaunchTime(launch_time);
@@ -3583,7 +3583,7 @@ Ship::TimeSkip()
{
if (CanTimeSkip()) {
// go back to regular time before performing the skip:
- Game::SetTimeCompression(1);
+ Game::GetInstance()->SetTimeCompression(1);
transition_time = 7.5f;
transition_type = TRANSITION_TIME_SKIP;
@@ -4049,17 +4049,17 @@ Ship::SetFLCSMode(int mode)
if (dir && dir->Type() < SteerAI::SEEKER) {
switch (flcs_mode) {
- case FLCS_MANUAL: director_info = Game::GetText("flcs.manual"); break;
- case FLCS_AUTO: director_info = Game::GetText("flcs.auto"); break;
- case FLCS_HELM: director_info = Game::GetText("flcs.helm"); break;
- default: director_info = Game::GetText("flcs.fault"); break;
+ case FLCS_MANUAL: director_info = Game::GetInstance()->GetText("flcs.manual"); break;
+ case FLCS_AUTO: director_info = Game::GetInstance()->GetText("flcs.auto"); break;
+ case FLCS_HELM: director_info = Game::GetInstance()->GetText("flcs.helm"); break;
+ default: director_info = Game::GetInstance()->GetText("flcs.fault"); break;
}
if (!flcs || !flcs->IsPowerOn())
- director_info = Game::GetText("flcs.offline");
+ director_info = Game::GetInstance()->GetText("flcs.offline");
else if (IsAirborne())
- director_info = Game::GetText("flcs.atmospheric");
+ director_info = Game::GetInstance()->GetText("flcs.atmospheric");
}
if (flcs)
@@ -4493,7 +4493,7 @@ Ship::InflictDamage(double damage, Shot* shot, int hit_type, Point impact)
{
double damage_applied = 0;
- if (Game::Paused() || IsNetObserver() || IsInvulnerable())
+ if (Game::GetInstance()->Paused() || IsNetObserver() || IsInvulnerable())
return damage_applied;
if (Integrity() == 0) // already dead?
@@ -4514,26 +4514,26 @@ Ship::InflictDamage(double damage, Shot* shot, int hit_type, Point impact)
if (shot) {
if (shot->IsBeam()) {
if (design->beam_hit_sound_resource) {
- if (Game::RealTime() - last_beam_time > 400) {
+ if (Game::GetInstance()->RealTime() - last_beam_time > 400) {
Sound* s = design->beam_hit_sound_resource->Duplicate();
s->SetLocation(impact);
s->SetVolume(AudioConfig::EfxVolume());
s->Play();
- last_beam_time = Game::RealTime();
+ last_beam_time = Game::GetInstance()->RealTime();
}
}
}
else {
if (design->bolt_hit_sound_resource) {
- if (Game::RealTime() - last_bolt_time > 400) {
+ if (Game::GetInstance()->RealTime() - last_bolt_time > 400) {
Sound* s = design->bolt_hit_sound_resource->Duplicate();
s->SetLocation(impact);
s->SetVolume(AudioConfig::EfxVolume());
s->Play();
- last_bolt_time = Game::RealTime();
+ last_bolt_time = Game::GetInstance()->RealTime();
}
}
}
@@ -4812,11 +4812,11 @@ Ship::ExecMaintFrame(double seconds)
static DWORD last_repair_frame = 0; // one ship per game frame
if (auto_repair &&
- Game::GameTime() - last_repair_time > REPAIR_FREQUENCY &&
- last_repair_frame != Game::Frame()) {
+ Game::GetInstance()->GameTime() - last_repair_time > REPAIR_FREQUENCY &&
+ last_repair_frame != Game::GetInstance()->Frame()) {
- last_repair_time = Game::GameTime();
- last_repair_frame = Game::Frame();
+ last_repair_time = Game::GetInstance()->GameTime();
+ last_repair_frame = Game::GetInstance()->Frame();
ListIter<System> iter = systems;
while (++iter) {
@@ -5018,7 +5018,7 @@ Ship::SetControls(MotionController* m)
Keyboard::FlushKeys();
m->Acquire();
dir = new(__FILE__,__LINE__) ShipCtrl(this, m);
- director_info = Game::GetText("flcs.auto");
+ director_info = Game::GetInstance()->GetText("flcs.auto");
}
else if (GetIFF() < 100) {
if (IsStatic())
@@ -5197,7 +5197,7 @@ DWORD
Ship::MissionClock() const
{
if (launch_time > 0)
- return Game::GameTime() + 1 - launch_time;
+ return Game::GetInstance()->GameTime() + 1 - launch_time;
return 0;
}
diff --git a/Stars45/ShipAI.cpp b/Stars45/ShipAI.cpp
index b1495f8..71c1abe 100644
--- a/Stars45/ShipAI.cpp
+++ b/Stars45/ShipAI.cpp
@@ -278,12 +278,12 @@ ShipAI::ExecFrame(double secs)
if (target == ship->GetTarget() && target->Type() == SimObject::SIM_SHIP) {
// if this isn't the same ship we last called out:
- if (target->Identity() != engaged_ship_id && Game::GameTime() - last_call_time > 10000) {
+ if (target->Identity() != engaged_ship_id && Game::GetInstance()->GameTime() - last_call_time > 10000) {
// call engaging:
RadioMessage* msg = new(__FILE__,__LINE__) RadioMessage(ship->GetElement(), ship, RadioMessage::CALL_ENGAGING);
msg->AddTarget(target);
RadioTraffic::Transmit(msg);
- last_call_time = Game::GameTime();
+ last_call_time = Game::GetInstance()->GameTime();
engaged_ship_id = target->Identity();
}
@@ -383,7 +383,7 @@ ShipAI::FindObjective()
// if not the element leader, stay in formation:
if (form && element_index > 1) {
- ship->SetDirectorInfo(Game::GetText("ai.formation"));
+ ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.formation"));
if (navpt && navpt->Action() == Instruction::LAUNCH) {
FindObjectiveNavPoint();
@@ -411,7 +411,7 @@ ShipAI::FindObjective()
if (support) {
double d_support = Point(support->Location() - ship->Location()).length();
if (d_support > 35e3) {
- ship->SetDirectorInfo(Game::GetText("ai.regroup"));
+ ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.regroup"));
FindObjectiveTarget(support);
objective = Transform(obj_w);
return;
@@ -420,7 +420,7 @@ ShipAI::FindObjective()
// run away:
else if (threat != target) {
- ship->SetDirectorInfo(Game::GetText("ai.retreat"));
+ ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.retreat"));
obj_w = ship->Location() + Point(ship->Location() - threat->Location()) * 100;
objective = Transform(obj_w);
return;
@@ -429,31 +429,31 @@ ShipAI::FindObjective()
// normal processing:
if (target) {
- ship->SetDirectorInfo(Game::GetText("ai.seek-target"));
+ ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.seek-target"));
FindObjectiveTarget(target);
objective = AimTransform(obj_w);
}
else if (patrol) {
- ship->SetDirectorInfo(Game::GetText("ai.patrol"));
+ ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.patrol"));
FindObjectivePatrol();
objective = Transform(obj_w);
}
else if (ward) {
- ship->SetDirectorInfo(Game::GetText("ai.seek-ward"));
+ ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.seek-ward"));
FindObjectiveFormation();
objective = Transform(obj_w);
}
else if (navpt && form) {
- ship->SetDirectorInfo(Game::GetText("ai.seek-navpt"));
+ ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.seek-navpt"));
FindObjectiveNavPoint();
objective = Transform(obj_w);
}
else if (rumor) {
- ship->SetDirectorInfo(Game::GetText("ai.search"));
+ ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.search"));
FindObjectiveTarget(rumor);
objective = Transform(obj_w);
}
@@ -892,11 +892,11 @@ ShipAI::Navigator()
ship->SetFLCSMode(Ship::FLCS_HELM);
if (target)
- ship->SetDirectorInfo(Game::GetText("ai.seek-target"));
+ ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.seek-target"));
else if (rumor)
- ship->SetDirectorInfo(Game::GetText("ai.seek-rumor"));
+ ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.seek-rumor"));
else
- ship->SetDirectorInfo(Game::GetText("ai.none"));
+ ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.none"));
Accumulate(AvoidCollision());
Accumulate(AvoidTerrain());
@@ -1046,7 +1046,7 @@ ShipAI::AvoidCollision()
last_avoid_time = 0; // check for a new obstacle immediately
}
- if (!other && Game::GameTime() - last_avoid_time < 500)
+ if (!other && Game::GetInstance()->GameTime() - last_avoid_time < 500)
return avoid;
brake = 0;
@@ -1119,11 +1119,11 @@ ShipAI::AvoidCollision()
avoid = Avoid(obstacle, (float) (ship->Radius() + other->Radius() + avoid_dist * 0.9));
avoid.brake = brake;
- ship->SetDirectorInfo(Game::GetText("ai.avoid-collision"));
+ ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.avoid-collision"));
}
}
- last_avoid_time = Game::GameTime();
+ last_avoid_time = Game::GetInstance()->GameTime();
return avoid;
}
@@ -1260,7 +1260,7 @@ ShipAI::AvoidCloseObject(SimObject* obj)
Steer avoid = Flee(obstacle);
avoid.brake = 0.3;
- ship->SetDirectorInfo(Game::GetText("ai.avoid-collision"));
+ ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.avoid-collision"));
return avoid;
}
diff --git a/Stars45/ShipCtrl.cpp b/Stars45/ShipCtrl.cpp
index b3dfc77..0dcb0b9 100644
--- a/Stars45/ShipCtrl.cpp
+++ b/Stars45/ShipCtrl.cpp
@@ -62,8 +62,8 @@ ShipCtrl::Toggled(int action)
static double last_toggle_time = 0;
if (KeyDown(action)) {
- if ((Game::RealTime() - last_toggle_time) > 250) {
- last_toggle_time = Game::RealTime();
+ if ((Game::GetInstance()->RealTime() - last_toggle_time) > 250) {
+ last_toggle_time = Game::GetInstance()->RealTime();
return 1;
}
}
diff --git a/Stars45/ShipDesign.cpp b/Stars45/ShipDesign.cpp
index 8f83566..55e8d41 100644
--- a/Stars45/ShipDesign.cpp
+++ b/Stars45/ShipDesign.cpp
@@ -1513,7 +1513,7 @@ ShipDesign::ParseShip(TermDef* def)
}
if (description.length())
- description = Game::GetText(description);
+ description = Game::GetInstance()->GetText(description);
}
// +--------------------------------------------------------------------+
diff --git a/Stars45/Shot.cpp b/Stars45/Shot.cpp
index 87abbb8..7878569 100644
--- a/Stars45/Shot.cpp
+++ b/Stars45/Shot.cpp
@@ -281,7 +281,7 @@ Shot::ExecFrame(double seconds)
offset -= (float) (seconds * 10);
}
- if (Game::Paused())
+ if (Game::GetInstance()->Paused())
return;
if (beam) {
@@ -504,7 +504,7 @@ Shot::Damage() const
fade = (design->length - len) / (design->length - design->min_range);
}
- damage = base_damage * charge * fade * Game::FrameTime();
+ damage = base_damage * charge * fade * Game::GetInstance()->FrameTime();
}
// energy wep damage based on time:
diff --git a/Stars45/Sim.cpp b/Stars45/Sim.cpp
index 119c0b9..85183f4 100644
--- a/Stars45/Sim.cpp
+++ b/Stars45/Sim.cpp
@@ -302,7 +302,7 @@ Sim::LoadMission(Mission* m, bool preload_textures)
mission->SetActive(true);
if (preload_textures) {
- Video* video = Game::GetVideo();
+ Video* video = Game::GetInstance()->GetVideo();
List<Model> all_models;
//List<Bitmap> all_textures;
@@ -394,7 +394,7 @@ Sim::ExecMission()
}
first_frame = true;
- start_time = Game::GameTime();
+ start_time = Game::GetInstance()->GameTime();
AudioConfig::SetTraining(mission->Type() == Mission::TRAINING);
}
@@ -1895,7 +1895,7 @@ Sim::ProcessEventTrigger(int type, int event_id, const char* ship, int param)
double
Sim::MissionClock() const
{
- return (Game::GameTime() - start_time) / 1000.0;
+ return (Game::GetInstance()->GameTime() - start_time) / 1000.0;
}
// +--------------------------------------------------------------------+
@@ -1932,7 +1932,7 @@ Sim::SkipCutscene()
double skip_time = end_time - MissionClock();
if (skip_time > 0) {
- Game::SkipGameTime(skip_time);
+ Game::GetInstance()->SkipGameTime(skip_time);
}
}
}
@@ -1986,7 +1986,7 @@ Sim::ResolveTimeSkip(double seconds)
player_ship->SetControls(0);
}
- Game::SkipGameTime(skipped);
+ Game::GetInstance()->SkipGameTime(skipped);
CameraDirector::SetCameraMode(CameraDirector::MODE_COCKPIT);
}
@@ -2268,7 +2268,7 @@ SimRegion::SimRegion(Sim* s, OrbitalRegion* r)
}
}
else {
- name = Game::GetText("Unknown");
+ name = Game::GetInstance()->GetText("Unknown");
}
}
@@ -2508,8 +2508,8 @@ SimRegion::ExecFrame(double secs)
// DON'T REALLY KNOW WHAT PURPOSE THIS SERVES....
if (!active) {
- double max_frame = 3 * Game::GetMaxFrameLength();
- long new_time = Game::GameTime();
+ double max_frame = 3 * Game::GetInstance()->GetMaxFrameLength();
+ long new_time = Game::GetInstance()->GameTime();
double delta = new_time - sim_time;
seconds = delta / 1000.0;
@@ -2517,7 +2517,7 @@ SimRegion::ExecFrame(double secs)
seconds = max_frame;
}
- sim_time = Game::GameTime();
+ sim_time = Game::GetInstance()->GameTime();
if (orbital_region)
location = orbital_region->Location();
@@ -2539,7 +2539,7 @@ SimRegion::ExecFrame(double secs)
UpdateShots(seconds);
UpdateExplosions(seconds);
- if (!Game::Paused()) {
+ if (!Game::GetInstance()->Paused()) {
DamageShips();
DockShips();
@@ -3064,7 +3064,7 @@ SimRegion::CollideShips()
if (ship->Integrity() < 1.0f) {
if (!kill_list.contains(ship)) {
ShipStats* r = ShipStats::Find(ship->Name());
- if (r) r->AddEvent(SimEvent::COLLIDE, Game::GetText("DEBRIS"));
+ if (r) r->AddEvent(SimEvent::COLLIDE, Game::GetInstance()->GetText("DEBRIS"));
kill_list.insert(ship);
}
@@ -3088,7 +3088,7 @@ SimRegion::CollideShips()
if (ship->Integrity() < 1.0f) {
if (!kill_list.contains(ship)) {
ShipStats* r = ShipStats::Find(ship->Name());
- if (r) r->AddEvent(SimEvent::COLLIDE, Game::GetText("ASTEROID"));
+ if (r) r->AddEvent(SimEvent::COLLIDE, Game::GetInstance()->GetText("ASTEROID"));
kill_list.insert(ship);
}
@@ -3797,7 +3797,7 @@ const char* FormatGameTime()
{
static char txt[64];
- int t = Game::GameTime();
+ int t = Game::GetInstance()->GameTime();
int h = ( t / 3600000);
int m = ((t - h*3600000) / 60000);
diff --git a/Stars45/SimEvent.cpp b/Stars45/SimEvent.cpp
index 4fc371d..801d75a 100644
--- a/Stars45/SimEvent.cpp
+++ b/Stars45/SimEvent.cpp
@@ -30,7 +30,7 @@ SimEvent::SimEvent(int e, const char* t, const char* i)
time = (int) sim->MissionClock();
}
else {
- time = (int) (Game::GameTime()/1000);
+ time = (int) (Game::GetInstance()->GameTime()/1000);
}
SetTarget(t);
@@ -73,26 +73,26 @@ Text
SimEvent::GetEventDesc() const
{
switch (event) {
- case LAUNCH: return Game::GetText("sim.event.Launch");
- case DOCK: return Game::GetText("sim.event.Dock");
- case LAND: return Game::GetText("sim.event.Land");
- case EJECT: return Game::GetText("sim.event.Eject");
- case CRASH: return Game::GetText("sim.event.Crash");
- case COLLIDE: return Game::GetText("sim.event.Collision With");
- case DESTROYED: return Game::GetText("sim.event.Destroyed By");
- case MAKE_ORBIT: return Game::GetText("sim.event.Make Orbit");
- case BREAK_ORBIT: return Game::GetText("sim.event.Break Orbit");
- case QUANTUM_JUMP: return Game::GetText("sim.event.Quantum Jump");
- case LAUNCH_SHIP: return Game::GetText("sim.event.Launch Ship");
- case RECOVER_SHIP: return Game::GetText("sim.event.Recover Ship");
- case FIRE_GUNS: return Game::GetText("sim.event.Fire Guns");
- case FIRE_MISSILE: return Game::GetText("sim.event.Fire Missile");
- case DROP_DECOY: return Game::GetText("sim.event.Drop Decoy");
- case GUNS_KILL: return Game::GetText("sim.event.Guns Kill");
- case MISSILE_KILL: return Game::GetText("sim.event.Missile Kill");
- case LAUNCH_PROBE: return Game::GetText("sim.event.Launch Probe");
- case SCAN_TARGET: return Game::GetText("sim.event.Scan Target");
- default: return Game::GetText("sim.event.no event");
+ case LAUNCH: return Game::GetInstance()->GetText("sim.event.Launch");
+ case DOCK: return Game::GetInstance()->GetText("sim.event.Dock");
+ case LAND: return Game::GetInstance()->GetText("sim.event.Land");
+ case EJECT: return Game::GetInstance()->GetText("sim.event.Eject");
+ case CRASH: return Game::GetInstance()->GetText("sim.event.Crash");
+ case COLLIDE: return Game::GetInstance()->GetText("sim.event.Collision With");
+ case DESTROYED: return Game::GetInstance()->GetText("sim.event.Destroyed By");
+ case MAKE_ORBIT: return Game::GetInstance()->GetText("sim.event.Make Orbit");
+ case BREAK_ORBIT: return Game::GetInstance()->GetText("sim.event.Break Orbit");
+ case QUANTUM_JUMP: return Game::GetInstance()->GetText("sim.event.Quantum Jump");
+ case LAUNCH_SHIP: return Game::GetInstance()->GetText("sim.event.Launch Ship");
+ case RECOVER_SHIP: return Game::GetInstance()->GetText("sim.event.Recover Ship");
+ case FIRE_GUNS: return Game::GetInstance()->GetText("sim.event.Fire Guns");
+ case FIRE_MISSILE: return Game::GetInstance()->GetText("sim.event.Fire Missile");
+ case DROP_DECOY: return Game::GetInstance()->GetText("sim.event.Drop Decoy");
+ case GUNS_KILL: return Game::GetInstance()->GetText("sim.event.Guns Kill");
+ case MISSILE_KILL: return Game::GetInstance()->GetText("sim.event.Missile Kill");
+ case LAUNCH_PROBE: return Game::GetInstance()->GetText("sim.event.Launch Probe");
+ case SCAN_TARGET: return Game::GetInstance()->GetText("sim.event.Scan Target");
+ default: return Game::GetInstance()->GetText("sim.event.no event");
}
}
@@ -104,7 +104,7 @@ cmd_points(0), gun_shots(0), gun_hits(0), missile_shots(0), missile_hits(0),
combat_group(0), combat_unit(0), player(false), ship_class(0), elem_index(-1)
{
if (!n || !n[0])
- name = Game::GetText("[unknown]");
+ name = Game::GetInstance()->GetText("[unknown]");
}
ShipStats::~ShipStats()
diff --git a/Stars45/Sky.cpp b/Stars45/Sky.cpp
index 6be9368..eb22cc3 100644
--- a/Stars45/Sky.cpp
+++ b/Stars45/Sky.cpp
@@ -132,7 +132,7 @@ Dust::Reset(const Point& ref)
void
Dust::ExecFrame(double factor, const Point& ref)
{
- if (Game::TimeCompression() > 4) {
+ if (Game::GetInstance()->TimeCompression() > 4) {
Hide();
return;
}
diff --git a/Stars45/SoundD3D.cpp b/Stars45/SoundD3D.cpp
index 1fd4f1e..812164d 100644
--- a/Stars45/SoundD3D.cpp
+++ b/Stars45/SoundD3D.cpp
@@ -491,7 +491,7 @@ SoundD3D::Update()
if (sound_check) sound_check->Update(this);
- if (!Game::Paused() || flags & STREAMED) {
+ if (!Game::GetInstance()->Paused() || flags & STREAMED) {
// see if we are done:
if (!(dstat & DSBSTATUS_PLAYING)) {
status = DONE;
diff --git a/Stars45/Sprite.cpp b/Stars45/Sprite.cpp
index df5eeeb..f519bb3 100644
--- a/Stars45/Sprite.cpp
+++ b/Stars45/Sprite.cpp
@@ -169,7 +169,7 @@ Sprite::SetAnimation(Bitmap* animation, int length, int repeat, int share)
life = nframes;
}
- last_time = Game::RealTime() - frame_time;
+ last_time = Game::GetInstance()->RealTime() - frame_time;
}
}
@@ -362,7 +362,7 @@ void
Sprite::Update()
{
if (life > 0 || loop) {
- DWORD time = Game::RealTime();
+ DWORD time = Game::GetInstance()->RealTime();
while (time - last_time > frame_time) {
life--;
frame_index++;
diff --git a/Stars45/StarServer.cpp b/Stars45/StarServer.cpp
index ee65e53..97a0721 100644
--- a/Stars45/StarServer.cpp
+++ b/Stars45/StarServer.cpp
@@ -167,7 +167,7 @@ StarServer::InitGame()
Shot::Initialize();
RadioTraffic::Initialize();
- time_mark = Game::GameTime();
+ time_mark = Game::GetInstance()->GameTime();
minutes = 0;
NetServerConfig* server_config = NetServerConfig::GetInstance();
@@ -385,8 +385,8 @@ StarServer::GameState()
}
else if (game_mode == PLAY_MODE) {
- if (Game::GameTime() - time_mark > 60000) {
- time_mark = Game::GameTime();
+ if (Game::GetInstance()->GameTime() - time_mark > 60000) {
+ time_mark = Game::GetInstance()->GameTime();
minutes++;
if (minutes > 60)
Print(" TIME %2d:%02d:00\n", minutes/60, minutes%60);
@@ -410,7 +410,7 @@ StarServer::OnPaint()
Text txt_title = title_text;
Text txt_mode;
- Text txt_users = Game::GetText("server.no-users");
+ Text txt_users = Game::GetInstance()->GetText("server.no-users");
char buf[256];
txt_title += " ";
@@ -419,35 +419,35 @@ StarServer::OnPaint()
switch (game_mode) {
case LOAD_MODE:
case MENU_MODE:
- txt_mode = Game::GetText("server.mode.lobby");
+ txt_mode = Game::GetInstance()->GetText("server.mode.lobby");
if (lobby_server) {
- sprintf_s(buf, Game::GetText("server.users").data(), lobby_server->NumUsers());
+ sprintf_s(buf, Game::GetInstance()->GetText("server.users").data(), lobby_server->NumUsers());
txt_users = buf;
}
break;
case PLAY_MODE:
- txt_mode = Game::GetText("server.mode.active");
+ txt_mode = Game::GetInstance()->GetText("server.mode.active");
if (lobby_server) {
- sprintf_s(buf, Game::GetText("server.users-and-players").data(), lobby_server->NumUsers(), NetGame::NumPlayers());
+ sprintf_s(buf, Game::GetInstance()->GetText("server.users-and-players").data(), lobby_server->NumUsers(), NetGame::NumPlayers());
}
else {
- sprintf_s(buf, Game::GetText("server.players").data(), NetGame::NumPlayers());
+ sprintf_s(buf, Game::GetInstance()->GetText("server.players").data(), NetGame::NumPlayers());
}
txt_users = buf;
break;
default:
- txt_mode = Game::GetText("server.mode.other");
+ txt_mode = Game::GetInstance()->GetText("server.mode.other");
break;
}
if (lobby_server && lobby_server->GetStatus() == NetServerInfo::PERSISTENT)
- txt_mode += " " + Game::GetText("server.alt.persistent");
+ txt_mode += " " + Game::GetInstance()->GetText("server.alt.persistent");
if (paused)
- txt_mode += " " + Game::GetText("server.alt.paused");
+ txt_mode += " " + Game::GetInstance()->GetText("server.alt.paused");
TextOut(hdc, 4, 4, txt_title, txt_title.length());
TextOut(hdc, 4, 22, txt_mode, txt_mode.length());
@@ -456,7 +456,7 @@ StarServer::OnPaint()
Sim* sim = Sim::GetSim();
if (sim && sim->GetMission()) {
Mission* mission = sim->GetMission();
- Text txt_msn = Game::GetText("server.mission");
+ Text txt_msn = Game::GetInstance()->GetText("server.mission");
txt_msn += mission->Name();
TextOut(hdc, 4, 58, txt_msn, txt_msn.length());
}
diff --git a/Stars45/StarSystem.cpp b/Stars45/StarSystem.cpp
index fac4c7a..77d92c1 100644
--- a/Stars45/StarSystem.cpp
+++ b/Stars45/StarSystem.cpp
@@ -69,7 +69,7 @@ void StarSystem::CalcStardate()
base_time += epoch;
}
- long double gtime = (long double) Game::GameTime() / 1000.0;
+ long double gtime = (long double) Game::GetInstance()->GameTime() / 1000.0;
long double sdate = gtime + base_time + epoch;
stardate = sdate;
@@ -957,7 +957,7 @@ StarSystem::ParseLayer(TerrainRegion* rgn, TermStruct* val)
void
StarSystem::Create()
{
- if (Game::Server())
+ if (Game::GetInstance()->Server())
return;
if (!instantiated) {
@@ -1093,7 +1093,7 @@ StarSystem::CreateBody(OrbitalBody& body)
Text surface = body.tex_name;
Text glow = body.tex_glow;
- if (Game::MaxTexSize() >= 512) {
+ if (Game::GetInstance()->MaxTexSize() >= 512) {
if (body.tex_high_res.length())
surface = body.tex_high_res;
@@ -1408,7 +1408,7 @@ StarSystem::ExecFrame()
if (terrain) {
trgn = (TerrainRegion*) active_region;
Color tmp = trgn->SkyColor();
- Game::SetScreenColor(tmp);
+ Game::GetInstance()->SetScreenColor(tmp);
tvpn = (active_region->Location() - active_region->Primary()->Location());
tvpn.Normalize();
@@ -1456,7 +1456,7 @@ StarSystem::ExecFrame()
}
else {
- Game::SetScreenColor(Color::Black);
+ Game::GetInstance()->SetScreenColor(Color::Black);
}
double star_alt = 0;
diff --git a/Stars45/Starshatter.cpp b/Stars45/Starshatter.cpp
index 29f44c7..59ad3fd 100644
--- a/Stars45/Starshatter.cpp
+++ b/Stars45/Starshatter.cpp
@@ -456,7 +456,7 @@ Starshatter::InitGame()
SetupSplash();
}
- time_mark = Game::GameTime();
+ time_mark = Game::GetInstance()->GameTime();
minutes = 0;
return true;
@@ -567,7 +567,7 @@ Starshatter::OpenTacticalReference()
LoadDlg* load_dlg = menuscreen->GetLoadDlg();
if (load_dlg && load_dlg->IsShown()) {
- load_activity = Game::GetText("Starshatter.load.tac-ref");
+ load_activity = Game::GetInstance()->GetText("Starshatter.load.tac-ref");
load_progress = 1;
catalog_index = 0;
}
@@ -608,14 +608,14 @@ Starshatter::SetGameMode(int m)
if (m == CLOD_MODE || m == PREP_MODE || m == LOAD_MODE) {
load_step = 0;
load_progress = 0;
- load_activity = Game::GetText("Starshatter.load.general");
+ load_activity = Game::GetInstance()->GetText("Starshatter.load.general");
paused = true;
}
else if (m == CMPN_MODE) {
load_step = 0;
load_progress = 100;
- load_activity = Game::GetText("Starshatter.load.complete");
+ load_activity = Game::GetInstance()->GetText("Starshatter.load.complete");
paused = false;
}
@@ -624,7 +624,7 @@ Starshatter::SetGameMode(int m)
player_ship = 0;
load_progress = 100;
- load_activity = Game::GetText("Starshatter.load.complete");
+ load_activity = Game::GetInstance()->GetText("Starshatter.load.complete");
if (!world) {
CreateWorld();
@@ -1107,7 +1107,7 @@ Starshatter::GameState()
}
if (game_mode == EXIT_MODE) {
- exit_time -= Game::GUITime();
+ exit_time -= Game::GetInstance()->GUITime();
if (exit_time <= 0)
Game::Exit();
@@ -1133,7 +1133,7 @@ Starshatter::DoMenuScreenFrame()
}
if (time_til_change > 0)
- time_til_change -= Game::GUITime();
+ time_til_change -= Game::GetInstance()->GUITime();
if (!menuscreen)
return;
@@ -1159,7 +1159,7 @@ Starshatter::DoMenuScreenFrame()
// load all ship designs in the standard catalog
if (catalog_index < ShipDesign::StandardCatalogSize()) {
ShipDesign::PreloadCatalog(catalog_index++);
- load_activity = Game::GetText("Starshatter.load.tac-ref");
+ load_activity = Game::GetInstance()->GetText("Starshatter.load.tac-ref");
if (load_progress < 95)
load_progress++;
@@ -1195,7 +1195,7 @@ Starshatter::DoPlanScreenFrame()
Mouse::SetCursor(Mouse::ARROW);
if (time_til_change > 0)
- time_til_change -= Game::GUITime();
+ time_til_change -= Game::GetInstance()->GUITime();
if (KeyDown(KEY_EXIT)) {
if (time_til_change <= 0) {
@@ -1228,7 +1228,7 @@ Starshatter::DoCmpnScreenFrame()
Mouse::SetCursor(Mouse::ARROW);
if (time_til_change > 0)
- time_til_change -= Game::GUITime();
+ time_til_change -= Game::GetInstance()->GUITime();
exit_latch = KeyDown(KEY_EXIT) ? true : false;
@@ -1313,7 +1313,7 @@ Starshatter::DoLoadScreenFrame()
switch (load_step) {
case 0:
- load_activity = Game::GetText("Starshatter.load.campaign");
+ load_activity = Game::GetInstance()->GetText("Starshatter.load.campaign");
load_progress = 1;
catalog_index = 0;
break;
@@ -1322,7 +1322,7 @@ Starshatter::DoLoadScreenFrame()
// load all ship designs in the standard catalog
if (catalog_index < ShipDesign::StandardCatalogSize()) {
ShipDesign::PreloadCatalog(catalog_index++);
- load_activity = Game::GetText("Starshatter.load.campaign");
+ load_activity = Game::GetInstance()->GetText("Starshatter.load.campaign");
if (load_progress < 80)
load_progress++;
@@ -1330,7 +1330,7 @@ Starshatter::DoLoadScreenFrame()
load_step = 0; // force return to current step on next frame
}
else {
- load_activity = Game::GetText("Starshatter.load.start");
+ load_activity = Game::GetInstance()->GetText("Starshatter.load.start");
load_progress = 80;
}
break;
@@ -1345,7 +1345,7 @@ Starshatter::DoLoadScreenFrame()
load_progress++;
}
else {
- load_activity = Game::GetText("Starshatter.load.ready");
+ load_activity = Game::GetInstance()->GetText("Starshatter.load.ready");
load_progress = 100;
SetGameMode(CMPN_MODE);
}
@@ -1355,40 +1355,40 @@ Starshatter::DoLoadScreenFrame()
else {
switch (load_step) {
case 0:
- load_activity = Game::GetText("Starshatter.load.drives");
+ load_activity = Game::GetInstance()->GetText("Starshatter.load.drives");
load_progress = 0;
break;
case 1:
Drive::Initialize();
LandingGear::Initialize();
- load_activity = Game::GetText("Starshatter.load.explosions");
+ load_activity = Game::GetInstance()->GetText("Starshatter.load.explosions");
load_progress = 5;
break;
case 2:
Explosion::Initialize();
- load_activity = Game::GetText("Starshatter.load.systems");
+ load_activity = Game::GetInstance()->GetText("Starshatter.load.systems");
load_progress = 10;
break;
case 3:
FlightDeck::Initialize();
NavLight::Initialize();
- load_activity = Game::GetText("Starshatter.load.ships");
+ load_activity = Game::GetInstance()->GetText("Starshatter.load.ships");
load_progress = 15;
break;
case 4:
Ship::Initialize();
Shot::Initialize();
- load_activity = Game::GetText("Starshatter.load.hud");
+ load_activity = Game::GetInstance()->GetText("Starshatter.load.hud");
load_progress = 20;
break;
case 5:
MFD::Initialize();
- load_activity = Game::GetText("Starshatter.load.menus");
+ load_activity = Game::GetInstance()->GetText("Starshatter.load.menus");
load_progress = 25;
break;
@@ -1400,7 +1400,7 @@ Starshatter::DoLoadScreenFrame()
if (!gamescreen && game_mode != PREP_MODE)
SetupGameScreen();
- load_activity = Game::GetText("Starshatter.load.mission");
+ load_activity = Game::GetInstance()->GetText("Starshatter.load.mission");
load_progress = 65;
break;
@@ -1409,26 +1409,26 @@ Starshatter::DoLoadScreenFrame()
if (Campaign::GetCampaign())
Campaign::GetCampaign()->GetMission();
SetGameMode(PLAN_MODE);
- load_activity = Game::GetText("Starshatter.load.loaded");
+ load_activity = Game::GetInstance()->GetText("Starshatter.load.loaded");
load_progress = 100;
Button::PlaySound(4);
}
else {
CreateWorld();
- load_activity = Game::GetText("Starshatter.load.simulation");
+ load_activity = Game::GetInstance()->GetText("Starshatter.load.simulation");
load_progress = 75;
}
break;
case 8:
InstantiateMission();
- load_activity = Game::GetText("Starshatter.load.viewscreen");
+ load_activity = Game::GetInstance()->GetText("Starshatter.load.viewscreen");
load_progress = 90;
break;
default:
SetGameMode(PLAY_MODE);
- load_activity = Game::GetText("Starshatter.load.ready");
+ load_activity = Game::GetInstance()->GetText("Starshatter.load.ready");
load_progress = 100;
break;
}
@@ -1522,7 +1522,7 @@ Starshatter::DoGameScreenFrame()
}
if (time_til_change > 0)
- time_til_change -= Game::GUITime();
+ time_til_change -= Game::GetInstance()->GUITime();
if (exit_latch && !KeyDown(KEY_EXIT))
exit_latch = false;
@@ -1590,8 +1590,8 @@ Starshatter::DoGameScreenFrame()
gamescreen->FrameRate(frame_rate);
gamescreen->ExecFrame();
- if (Game::GameTime() - time_mark > 60000) {
- time_mark = Game::GameTime();
+ if (Game::GetInstance()->GameTime() - time_mark > 60000) {
+ time_mark = Game::GetInstance()->GameTime();
minutes++;
if (minutes > 60)
Print(" TIME %2d:%02d:00\n", minutes/60, minutes%60);
@@ -1847,7 +1847,7 @@ Starshatter::DoGameKeys()
}
if (cam_dir) {
- double spin = (PI/2) * Game::FrameTime(); // Game::GUITime();
+ double spin = (PI/2) * Game::GetInstance()->FrameTime(); // Game::GetInstance()->GUITime();
if (KeyDown(KEY_CAM_EXT_PLUS_AZ))
cam_dir->ExternalAzimuth(spin);
@@ -1875,13 +1875,13 @@ Starshatter::DoGameKeys()
if (KeyDown(KEY_CAM_EXT_PLUS_RANGE)){
if (!gamescreen->IsNavShown()) {
- cam_dir->ExternalRange((float) (1 + 1.5 * Game::FrameTime())); // 1.1f);
+ cam_dir->ExternalRange((float) (1 + 1.5 * Game::GetInstance()->FrameTime())); // 1.1f);
}
}
else if (KeyDown(KEY_CAM_EXT_MINUS_RANGE)) {
if (!gamescreen->IsNavShown()) {
- cam_dir->ExternalRange((float) (1 - 1.5 * Game::FrameTime())); // 0.9f);
+ cam_dir->ExternalRange((float) (1 - 1.5 * Game::GetInstance()->FrameTime())); // 0.9f);
}
}
diff --git a/Stars45/StarshipAI.cpp b/Stars45/StarshipAI.cpp
index 2209b09..19de0c6 100644
--- a/Stars45/StarshipAI.cpp
+++ b/Stars45/StarshipAI.cpp
@@ -65,7 +65,7 @@ StarshipAI::StarshipAI(SimObject* s)
tactical = new(__FILE__,__LINE__) StarshipTacticalAI(this);
}
- sub_select_time = Game::GameTime() + (DWORD) Random(0, 2000);
+ sub_select_time = Game::GetInstance()->GameTime() + (DWORD) Random(0, 2000);
point_defense_time = sub_select_time;
}
@@ -101,7 +101,7 @@ StarshipAI::FindObjective()
// if not the element leader, stay in formation:
if (form && element_index > 1) {
- ship->SetDirectorInfo(Game::GetText("ai.formation"));
+ ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.formation"));
if (navpt && navpt->Action() == Instruction::LAUNCH) {
FindObjectiveNavPoint();
@@ -135,7 +135,7 @@ StarshipAI::FindObjective()
if (support) {
double d_support = Point(support->Location() - ship->Location()).length();
if (d_support > 35e3) {
- ship->SetDirectorInfo(Game::GetText("ai.regroup"));
+ ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.regroup"));
FindObjectiveTarget(support);
objective = Transform(obj_w);
return;
@@ -144,7 +144,7 @@ StarshipAI::FindObjective()
// run away:
else if (threat && threat != target) {
- ship->SetDirectorInfo(Game::GetText("ai.retreat"));
+ ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.retreat"));
obj_w = ship->Location() + Point(ship->Location() - threat->Location()) * 100;
objective = Transform(obj_w);
return;
@@ -154,44 +154,44 @@ StarshipAI::FindObjective()
// weapons hold:
if (hold) {
if (navpt) {
- ship->SetDirectorInfo(Game::GetText("ai.seek-navpt"));
+ ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.seek-navpt"));
FindObjectiveNavPoint();
}
else if (patrol) {
- ship->SetDirectorInfo(Game::GetText("ai.patrol"));
+ ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.patrol"));
FindObjectivePatrol();
}
else {
- ship->SetDirectorInfo(Game::GetText("ai.holding"));
+ ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.holding"));
objective = Point();
}
}
// normal processing:
else if (target) {
- ship->SetDirectorInfo(Game::GetText("ai.seek-target"));
+ ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.seek-target"));
FindObjectiveTarget(target);
}
else if (patrol) {
- ship->SetDirectorInfo(Game::GetText("ai.patrol"));
+ ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.patrol"));
FindObjectivePatrol();
}
else if (ward) {
- ship->SetDirectorInfo(Game::GetText("ai.seek-ward"));
+ ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.seek-ward"));
FindObjectiveFormation();
}
else if (navpt) {
- ship->SetDirectorInfo(Game::GetText("ai.seek-navpt"));
+ ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.seek-navpt"));
FindObjectiveNavPoint();
}
else if (rumor) {
- ship->SetDirectorInfo(Game::GetText("ai.search"));
+ ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.search"));
FindObjectiveTarget(rumor);
}
@@ -210,7 +210,7 @@ StarshipAI::Navigator()
{
// signifies this ship is a dead hulk:
if (ship && ship->Design()->auto_roll < 0) {
- ship->SetDirectorInfo(Game::GetText("ai.dead"));
+ ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.dead"));
return;
}
@@ -226,11 +226,11 @@ StarshipAI::Navigator()
if (!ship->GetDirectorInfo()) {
if (target)
- ship->SetDirectorInfo(Game::GetText("ai.seek-target"));
+ ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.seek-target"));
else if (ship->GetWard())
- ship->SetDirectorInfo(Game::GetText("ai.seek-ward"));
+ ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.seek-ward"));
else
- ship->SetDirectorInfo(Game::GetText("ai.patrol"));
+ ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.patrol"));
}
if (farcaster && distance < 25e3) {
@@ -638,7 +638,7 @@ StarshipAI::FireControl()
System*
StarshipAI::SelectSubtarget()
{
- if (Game::GameTime() - sub_select_time < 2345)
+ if (Game::GetInstance()->GameTime() - sub_select_time < 2345)
return subtarget;
subtarget = 0;
@@ -655,7 +655,7 @@ StarshipAI::SelectSubtarget()
double dist = 50e3;
Point svec = ship->Location() - tgt_ship->Location();
- sub_select_time = Game::GameTime();
+ sub_select_time = Game::GetInstance()->GameTime();
// first pass: turrets
ListIter<WeaponGroup> g_iter = tgt_ship->Weapons();
@@ -726,7 +726,7 @@ StarshipAI::SelectSubtarget()
bool
StarshipAI::AssessTargetPointDefense()
{
- if (Game::GameTime() - point_defense_time < 3500)
+ if (Game::GetInstance()->GameTime() - point_defense_time < 3500)
return tgt_point_defense;
tgt_point_defense = false;
@@ -742,7 +742,7 @@ StarshipAI::AssessTargetPointDefense()
Weapon* subtgt = 0;
Point svec = ship->Location() - tgt_ship->Location();
- point_defense_time = Game::GameTime();
+ point_defense_time = Game::GetInstance()->GameTime();
// first pass: turrets
ListIter<WeaponGroup> g_iter = tgt_ship->Weapons();
diff --git a/Stars45/StarshipTacticalAI.cpp b/Stars45/StarshipTacticalAI.cpp
index 597ae52..241a06f 100644
--- a/Stars45/StarshipTacticalAI.cpp
+++ b/Stars45/StarshipTacticalAI.cpp
@@ -124,7 +124,7 @@ StarshipTacticalAI::FindThreat()
}
if (contact->Threat(ship) &&
- (Game::GameTime() - contact->AcquisitionTime()) > THREAT_REACTION_TIME) {
+ (Game::GetInstance()->GameTime() - contact->AcquisitionTime()) > THREAT_REACTION_TIME) {
if (c_shot) {
threat_missile = c_shot;
diff --git a/Stars45/SteerAI.cpp b/Stars45/SteerAI.cpp
index df91890..8d95b73 100644
--- a/Stars45/SteerAI.cpp
+++ b/Stars45/SteerAI.cpp
@@ -429,8 +429,8 @@ SteerAI::Evade(const Point& point, const Point& vel)
{
Steer evade;
- if (Game::GameTime() - evade_time > 1250) {
- evade_time = Game::GameTime();
+ if (Game::GetInstance()->GameTime() - evade_time > 1250) {
+ evade_time = Game::GetInstance()->GameTime();
int direction = (rand()>>9) & 0x07;
diff --git a/Stars45/System.cpp b/Stars45/System.cpp
index 7347a02..51af575 100644
--- a/Stars45/System.cpp
+++ b/Stars45/System.cpp
@@ -378,7 +378,7 @@ System::Distribute(double delivered_energy, double seconds)
energy = (float) (delivered_energy/seconds);
}
- else if (!Game::Paused()) {
+ else if (!Game::GetInstance()->Paused()) {
energy += (float) delivered_energy;
if (energy > capacity)
diff --git a/Stars45/TacRefDlg.cpp b/Stars45/TacRefDlg.cpp
index e6230e6..66906ac 100644
--- a/Stars45/TacRefDlg.cpp
+++ b/Stars45/TacRefDlg.cpp
@@ -204,12 +204,12 @@ TacRefDlg::SelectShip(const ShipDesign* design)
Text desc;
char txt[256];
- sprintf_s(txt, "%s\t\t\t%s\n", Game::GetText("tacref.type").data(), Ship::ClassName(design->type));
+ sprintf_s(txt, "%s\t\t\t%s\n", Game::GetInstance()->GetText("tacref.type").data(), Ship::ClassName(design->type));
desc += txt;
- sprintf_s(txt, "%s\t\t\t%s\n", Game::GetText("tacref.class").data(), design->DisplayName());
+ sprintf_s(txt, "%s\t\t\t%s\n", Game::GetInstance()->GetText("tacref.class").data(), design->DisplayName());
desc += txt;
- desc += Game::GetText("tacref.length");
+ desc += Game::GetInstance()->GetText("tacref.length");
desc += "\t\t";
if (design->type < Ship::STATION)
@@ -219,13 +219,13 @@ TacRefDlg::SelectShip(const ShipDesign* design)
strcat_s(txt, " m\n");
desc += txt;
- desc += Game::GetText("tacref.mass");
+ desc += Game::GetInstance()->GetText("tacref.mass");
desc += "\t\t\t";
FormatNumber(txt, design->mass);
strcat_s(txt, " T\n");
desc += txt;
- desc += Game::GetText("tacref.hull");
+ desc += Game::GetInstance()->GetText("tacref.hull");
desc += "\t\t\t";
FormatNumber(txt, design->integrity);
@@ -233,7 +233,7 @@ TacRefDlg::SelectShip(const ShipDesign* design)
desc += txt;
if (design->weapons.size()) {
- desc += Game::GetText("tacref.weapons");
+ desc += Game::GetInstance()->GetText("tacref.weapons");
WepGroup groups[8];
for (int w = 0; w < design->weapons.size(); w++) {
@@ -273,7 +273,7 @@ TacRefDlg::SelectShip(const ShipDesign* design)
txt_description->SetText(design->description);
}
else {
- txt_description->SetText(Game::GetText("tacref.mass"));
+ txt_description->SetText(Game::GetInstance()->GetText("tacref.mass"));
}
}
}
@@ -304,84 +304,84 @@ TacRefDlg::SelectWeapon(const WeaponDesign* design)
Text desc;
char txt[256];
- desc = Game::GetText("tacref.name");
+ desc = Game::GetInstance()->GetText("tacref.name");
desc += "\t";
desc += design->name;
desc += "\n";
- desc += Game::GetText("tacref.type");
+ desc += Game::GetInstance()->GetText("tacref.type");
desc += "\t\t";
if (design->damage < 1)
- desc += Game::GetText("tacref.wep.other");
+ desc += Game::GetInstance()->GetText("tacref.wep.other");
else if (design->beam)
- desc += Game::GetText("tacref.wep.beam");
+ desc += Game::GetInstance()->GetText("tacref.wep.beam");
else if (design->primary)
- desc += Game::GetText("tacref.wep.bolt");
+ desc += Game::GetInstance()->GetText("tacref.wep.bolt");
else if (design->drone)
- desc += Game::GetText("tacref.wep.drone");
+ desc += Game::GetInstance()->GetText("tacref.wep.drone");
else if (design->guided)
- desc += Game::GetText("tacref.wep.guided");
+ desc += Game::GetInstance()->GetText("tacref.wep.guided");
else
- desc += Game::GetText("tacref.wep.missile");
+ desc += Game::GetInstance()->GetText("tacref.wep.missile");
if (design->turret_model && design->damage >= 1) {
desc += " ";
- desc += Game::GetText("tacref.wep.turret");
+ desc += Game::GetInstance()->GetText("tacref.wep.turret");
desc += "\n";
}
else {
desc += "\n";
}
- desc += Game::GetText("tacref.targets");
+ desc += Game::GetInstance()->GetText("tacref.targets");
desc += "\t";
if ((design->target_type & Ship::DROPSHIPS) != 0) {
if ((design->target_type & Ship::STARSHIPS) != 0) {
if ((design->target_type & Ship::GROUND_UNITS) != 0) {
- desc += Game::GetText("tacref.targets.fsg");
+ desc += Game::GetInstance()->GetText("tacref.targets.fsg");
}
else {
- desc += Game::GetText("tacref.targets.fs");
+ desc += Game::GetInstance()->GetText("tacref.targets.fs");
}
}
else {
if ((design->target_type & Ship::GROUND_UNITS) != 0) {
- desc += Game::GetText("tacref.targets.fg");
+ desc += Game::GetInstance()->GetText("tacref.targets.fg");
}
else {
- desc += Game::GetText("tacref.targets.f");
+ desc += Game::GetInstance()->GetText("tacref.targets.f");
}
}
}
else if ((design->target_type & Ship::STARSHIPS) != 0) {
if ((design->target_type & Ship::GROUND_UNITS) != 0) {
- desc += Game::GetText("tacref.targets.sg");
+ desc += Game::GetInstance()->GetText("tacref.targets.sg");
}
else {
- desc += Game::GetText("tacref.targets.s");
+ desc += Game::GetInstance()->GetText("tacref.targets.s");
}
}
else if ((design->target_type & Ship::GROUND_UNITS) != 0) {
- desc += Game::GetText("tacref.targets.g");
+ desc += Game::GetInstance()->GetText("tacref.targets.g");
}
desc += "\n";
- desc += Game::GetText("tacref.speed");
+ desc += Game::GetInstance()->GetText("tacref.speed");
desc += "\t";
FormatNumber(txt, design->speed);
desc += txt;
desc += "m/s\n";
- desc += Game::GetText("tacref.range");
+ desc += Game::GetInstance()->GetText("tacref.range");
desc += "\t";
FormatNumber(txt, design->max_range);
desc += txt;
desc += "m\n";
- desc += Game::GetText("tacref.damage");
+ desc += Game::GetInstance()->GetText("tacref.damage");
desc += "\t";
if (design->damage > 0) {
@@ -391,13 +391,13 @@ TacRefDlg::SelectWeapon(const WeaponDesign* design)
desc += "/s";
}
else {
- desc += Game::GetText("tacref.none");
+ desc += Game::GetInstance()->GetText("tacref.none");
}
desc += "\n";
if (!design->primary && design->damage > 0) {
- desc += Game::GetText("tacref.kill-radius");
+ desc += Game::GetInstance()->GetText("tacref.kill-radius");
desc += "\t";
FormatNumber(txt, design->lethal_radius);
desc += txt;
@@ -413,7 +413,7 @@ TacRefDlg::SelectWeapon(const WeaponDesign* design)
txt_description->SetText(design->description);
}
else {
- txt_description->SetText(Game::GetText("tacref.no-info"));
+ txt_description->SetText(Game::GetInstance()->GetText("tacref.no-info"));
}
}
}
diff --git a/Stars45/TacticalAI.cpp b/Stars45/TacticalAI.cpp
index a7d5838..b2ad350 100644
--- a/Stars45/TacticalAI.cpp
+++ b/Stars45/TacticalAI.cpp
@@ -80,7 +80,7 @@ TacticalAI::ExecFrame(double secs)
navpt = ship->GetNextNavPoint();
orders = ship->GetRadioOrders();
- if ((int) Game::GameTime() - exec_time > exec_period) {
+ if ((int) Game::GetInstance()->GameTime() - exec_time > exec_period) {
element_index = ship->GetElementIndex();
CheckOrders();
@@ -833,7 +833,7 @@ TacticalAI::FindThreat()
Contact* contact = iter.value();
if (contact->Threat(ship) &&
- (Game::GameTime() - contact->AcquisitionTime()) > THREAT_REACTION_TIME) {
+ (Game::GetInstance()->GameTime() - contact->AcquisitionTime()) > THREAT_REACTION_TIME) {
if (contact->GetShot()) {
threat_missile = contact->GetShot();
diff --git a/Stars45/TacticalView.cpp b/Stars45/TacticalView.cpp
index 5e650d7..2bbf691 100644
--- a/Stars45/TacticalView.cpp
+++ b/Stars45/TacticalView.cpp
@@ -349,8 +349,8 @@ TacticalView::DrawSelectionInfo(Ship* seln)
sprintf_s(name, "%s", seln->Name());
if (show_labels) {
- sprintf_s(shield, "%s %03d", Game::GetText("HUDView.symbol.shield").data(), shield_val);
- sprintf_s(hull, "%s %03d", Game::GetText("HUDView.symbol.hull").data(), hull_val);
+ sprintf_s(shield, "%s %03d", Game::GetInstance()->GetText("HUDView.symbol.shield").data(), shield_val);
+ sprintf_s(hull, "%s %03d", Game::GetInstance()->GetText("HUDView.symbol.hull").data(), hull_val);
}
else {
sprintf_s(shield, "%03d", shield_val);
@@ -359,7 +359,7 @@ TacticalView::DrawSelectionInfo(Ship* seln)
FormatNumberExp(range, Point(seln->Location()-ship->Location()).length()/1000);
strcat_s(range, " km");
- sprintf_s(heading, "%03d %s", (int) (seln->CompassHeading() / DEGREES), Game::GetText("HUDView.symbol.degrees").data());
+ sprintf_s(heading, "%03d %s", (int) (seln->CompassHeading() / DEGREES), Game::GetInstance()->GetText("HUDView.symbol.degrees").data());
double ss = seln->Velocity().length();
if (seln->Velocity() * seln->Heading() < 0)
@@ -377,7 +377,7 @@ TacticalView::DrawSelectionInfo(Ship* seln)
if (c->GetShip() == seln) {
contact = c.value();
if (c->GetIFF(ship) > seln->GetIFF()) {
- sprintf_s(name, "%s %04d", Game::GetText("TacView.contact").data(), seln->GetContactID());
+ sprintf_s(name, "%s %04d", Game::GetInstance()->GetText("TacView.contact").data(), seln->GetContactID());
full_info = false;
}
@@ -390,31 +390,31 @@ TacticalView::DrawSelectionInfo(Ship* seln)
font->SetColor(txt_color);
font->SetAlpha(1);
- font->DrawText(Game::GetText("TacView.name"), 5, label_rect, DT_LEFT);
+ font->DrawText(Game::GetInstance()->GetText("TacView.name"), 5, label_rect, DT_LEFT);
label_rect.y += 10;
- font->DrawText(Game::GetText("TacView.type"), 5, label_rect, DT_LEFT);
+ font->DrawText(Game::GetInstance()->GetText("TacView.type"), 5, label_rect, DT_LEFT);
label_rect.y += 10;
if (full_info) {
- font->DrawText(Game::GetText("TacView.shield"), 5, label_rect, DT_LEFT);
+ font->DrawText(Game::GetInstance()->GetText("TacView.shield"), 5, label_rect, DT_LEFT);
label_rect.y += 10;
- font->DrawText(Game::GetText("TacView.hull"), 5, label_rect, DT_LEFT);
+ font->DrawText(Game::GetInstance()->GetText("TacView.hull"), 5, label_rect, DT_LEFT);
label_rect.y += 10;
}
- font->DrawText(Game::GetText("TacView.range"), 4, label_rect, DT_LEFT);
+ font->DrawText(Game::GetInstance()->GetText("TacView.range"), 4, label_rect, DT_LEFT);
label_rect.y += 10;
if (full_info) {
- font->DrawText(Game::GetText("TacView.speed"), 4, label_rect, DT_LEFT);
+ font->DrawText(Game::GetInstance()->GetText("TacView.speed"), 4, label_rect, DT_LEFT);
label_rect.y += 10;
- font->DrawText(Game::GetText("TacView.heading"), 4, label_rect, DT_LEFT);
+ font->DrawText(Game::GetInstance()->GetText("TacView.heading"), 4, label_rect, DT_LEFT);
label_rect.y += 10;
}
else {
- font->DrawText(Game::GetText("TacView.passive"), 4, label_rect, DT_LEFT);
+ font->DrawText(Game::GetInstance()->GetText("TacView.passive"), 4, label_rect, DT_LEFT);
label_rect.y += 10;
- font->DrawText(Game::GetText("TacView.active"), 4, label_rect, DT_LEFT);
+ font->DrawText(Game::GetInstance()->GetText("TacView.active"), 4, label_rect, DT_LEFT);
label_rect.y += 10;
}
}
@@ -429,9 +429,9 @@ TacticalView::DrawSelectionInfo(Ship* seln)
}
else {
if (seln->IsStarship())
- font->DrawText(Game::GetText("TacView.starship"), 8, info_rect, DT_LEFT);
+ font->DrawText(Game::GetInstance()->GetText("TacView.starship"), 8, info_rect, DT_LEFT);
else
- font->DrawText(Game::GetText("TacView.fighter"), 7, info_rect, DT_LEFT);
+ font->DrawText(Game::GetInstance()->GetText("TacView.fighter"), 7, info_rect, DT_LEFT);
info_rect.y += 10;
}
@@ -470,7 +470,7 @@ TacticalView::DrawSelectionInfo(Ship* seln)
if (*orders) {
if (show_labels) {
- font->DrawText(Game::GetText("TacView.orders"), 5, label_rect, DT_LEFT);
+ font->DrawText(Game::GetInstance()->GetText("TacView.orders"), 5, label_rect, DT_LEFT);
label_rect.y += 10;
}
@@ -516,7 +516,7 @@ TacticalView::DrawSelectionList(ListIter<Ship> seln)
while (++c) {
if (c->GetShip() == seln.value()) {
if (c->GetIFF(ship) > seln->GetIFF()) {
- sprintf_s(name, "%s %04d", Game::GetText("TacView.contact").data(), seln->GetContactID());
+ sprintf_s(name, "%s %04d", Game::GetInstance()->GetText("TacView.contact").data(), seln->GetContactID());
}
break;
@@ -548,12 +548,12 @@ TacticalView::DoMouseFrame()
if (Mouse::RButton()) {
MouseController* mouse_con = MouseController::GetInstance();
if (!right_down && (!mouse_con || !mouse_con->Active())) {
- rbutton_latch = Game::RealTime();
+ rbutton_latch = Game::GetInstance()->RealTime();
right_down = true;
}
}
else {
- if (sim && right_down && (Game::RealTime() - rbutton_latch < 250)) {
+ if (sim && right_down && (Game::GetInstance()->RealTime() - rbutton_latch < 250)) {
Ship* seln = WillSelectAt(Mouse::X(), Mouse::Y());
if (seln && sim->IsSelected(seln) &&
@@ -655,10 +655,10 @@ TacticalView::DoMouseFrame()
if (dx < 3 && dy < 3) {
bool hit = SelectAt(mouse_x, mouse_y);
- if (ship->IsStarship() && Game::RealTime() - click_time < 350)
+ if (ship->IsStarship() && Game::GetInstance()->RealTime() - click_time < 350)
SetHelm(hit);
- click_time = Game::RealTime();
+ click_time = Game::GetInstance()->RealTime();
}
}
}
@@ -917,57 +917,57 @@ TacticalView::Initialize()
static int initialized = 0;
if (initialized) return;
- view_menu = new(__FILE__,__LINE__) Menu(Game::GetText("TacView.menu.view"));
- view_menu->AddItem(Game::GetText("TacView.item.forward"), VIEW_FORWARD);
- view_menu->AddItem(Game::GetText("TacView.item.chase"), VIEW_CHASE);
- view_menu->AddItem(Game::GetText("TacView.item.orbit"), VIEW_ORBIT);
- view_menu->AddItem(Game::GetText("TacView.item.padlock"), VIEW_PADLOCK);
-
- emcon_menu = new(__FILE__,__LINE__) Menu(Game::GetText("TacView.menu.emcon"));
-
- quantum_menu = new(__FILE__,__LINE__) Menu(Game::GetText("TacView.menu.quantum"));
- farcast_menu = new(__FILE__,__LINE__) Menu(Game::GetText("TacView.menu.farcast"));
-
- main_menu = new(__FILE__,__LINE__) Menu(Game::GetText("TacView.menu.main"));
-
- action_menu = new(__FILE__,__LINE__) Menu(Game::GetText("TacView.menu.action"));
- action_menu->AddItem(Game::GetText("TacView.item.engage"), RadioMessage::ATTACK);
- action_menu->AddItem(Game::GetText("TacView.item.bracket"), RadioMessage::BRACKET);
- action_menu->AddItem(Game::GetText("TacView.item.escort"), RadioMessage::ESCORT);
- action_menu->AddItem(Game::GetText("TacView.item.identify"), RadioMessage::IDENTIFY);
- action_menu->AddItem(Game::GetText("TacView.item.hold"), RadioMessage::WEP_HOLD);
-
- formation_menu = new(__FILE__,__LINE__) Menu(Game::GetText("TacView.menu.formation"));
- formation_menu->AddItem(Game::GetText("TacView.item.diamond"), RadioMessage::GO_DIAMOND);
- formation_menu->AddItem(Game::GetText("TacView.item.spread"), RadioMessage::GO_SPREAD);
- formation_menu->AddItem(Game::GetText("TacView.item.box"), RadioMessage::GO_BOX);
- formation_menu->AddItem(Game::GetText("TacView.item.trail"), RadioMessage::GO_TRAIL);
-
- sensors_menu = new(__FILE__,__LINE__) Menu(Game::GetText("TacView.menu.emcon"));
- sensors_menu->AddItem(Game::GetText("TacView.item.emcon-1"), RadioMessage::GO_EMCON1);
- sensors_menu->AddItem(Game::GetText("TacView.item.emcon-2"), RadioMessage::GO_EMCON2);
- sensors_menu->AddItem(Game::GetText("TacView.item.emcon-3"), RadioMessage::GO_EMCON3);
- sensors_menu->AddItem(Game::GetText("TacView.item.probe"), RadioMessage::LAUNCH_PROBE);
-
- fighter_menu = new(__FILE__,__LINE__) Menu(Game::GetText("TacView.menu.context"));
- fighter_menu->AddMenu(Game::GetText("TacView.item.action"), action_menu);
- fighter_menu->AddMenu(Game::GetText("TacView.item.formation"), formation_menu);
- fighter_menu->AddMenu(Game::GetText("TacView.item.sensors"), sensors_menu);
- fighter_menu->AddItem(Game::GetText("TacView.item.patrol"), RadioMessage::MOVE_PATROL);
- fighter_menu->AddItem(Game::GetText("TacView.item.cancel"), RadioMessage::RESUME_MISSION);
+ view_menu = new(__FILE__,__LINE__) Menu(Game::GetInstance()->GetText("TacView.menu.view"));
+ view_menu->AddItem(Game::GetInstance()->GetText("TacView.item.forward"), VIEW_FORWARD);
+ view_menu->AddItem(Game::GetInstance()->GetText("TacView.item.chase"), VIEW_CHASE);
+ view_menu->AddItem(Game::GetInstance()->GetText("TacView.item.orbit"), VIEW_ORBIT);
+ view_menu->AddItem(Game::GetInstance()->GetText("TacView.item.padlock"), VIEW_PADLOCK);
+
+ emcon_menu = new(__FILE__,__LINE__) Menu(Game::GetInstance()->GetText("TacView.menu.emcon"));
+
+ quantum_menu = new(__FILE__,__LINE__) Menu(Game::GetInstance()->GetText("TacView.menu.quantum"));
+ farcast_menu = new(__FILE__,__LINE__) Menu(Game::GetInstance()->GetText("TacView.menu.farcast"));
+
+ main_menu = new(__FILE__,__LINE__) Menu(Game::GetInstance()->GetText("TacView.menu.main"));
+
+ action_menu = new(__FILE__,__LINE__) Menu(Game::GetInstance()->GetText("TacView.menu.action"));
+ action_menu->AddItem(Game::GetInstance()->GetText("TacView.item.engage"), RadioMessage::ATTACK);
+ action_menu->AddItem(Game::GetInstance()->GetText("TacView.item.bracket"), RadioMessage::BRACKET);
+ action_menu->AddItem(Game::GetInstance()->GetText("TacView.item.escort"), RadioMessage::ESCORT);
+ action_menu->AddItem(Game::GetInstance()->GetText("TacView.item.identify"), RadioMessage::IDENTIFY);
+ action_menu->AddItem(Game::GetInstance()->GetText("TacView.item.hold"), RadioMessage::WEP_HOLD);
+
+ formation_menu = new(__FILE__,__LINE__) Menu(Game::GetInstance()->GetText("TacView.menu.formation"));
+ formation_menu->AddItem(Game::GetInstance()->GetText("TacView.item.diamond"), RadioMessage::GO_DIAMOND);
+ formation_menu->AddItem(Game::GetInstance()->GetText("TacView.item.spread"), RadioMessage::GO_SPREAD);
+ formation_menu->AddItem(Game::GetInstance()->GetText("TacView.item.box"), RadioMessage::GO_BOX);
+ formation_menu->AddItem(Game::GetInstance()->GetText("TacView.item.trail"), RadioMessage::GO_TRAIL);
+
+ sensors_menu = new(__FILE__,__LINE__) Menu(Game::GetInstance()->GetText("TacView.menu.emcon"));
+ sensors_menu->AddItem(Game::GetInstance()->GetText("TacView.item.emcon-1"), RadioMessage::GO_EMCON1);
+ sensors_menu->AddItem(Game::GetInstance()->GetText("TacView.item.emcon-2"), RadioMessage::GO_EMCON2);
+ sensors_menu->AddItem(Game::GetInstance()->GetText("TacView.item.emcon-3"), RadioMessage::GO_EMCON3);
+ sensors_menu->AddItem(Game::GetInstance()->GetText("TacView.item.probe"), RadioMessage::LAUNCH_PROBE);
+
+ fighter_menu = new(__FILE__,__LINE__) Menu(Game::GetInstance()->GetText("TacView.menu.context"));
+ fighter_menu->AddMenu(Game::GetInstance()->GetText("TacView.item.action"), action_menu);
+ fighter_menu->AddMenu(Game::GetInstance()->GetText("TacView.item.formation"), formation_menu);
+ fighter_menu->AddMenu(Game::GetInstance()->GetText("TacView.item.sensors"), sensors_menu);
+ fighter_menu->AddItem(Game::GetInstance()->GetText("TacView.item.patrol"), RadioMessage::MOVE_PATROL);
+ fighter_menu->AddItem(Game::GetInstance()->GetText("TacView.item.cancel"), RadioMessage::RESUME_MISSION);
fighter_menu->AddItem("", 0);
- fighter_menu->AddItem(Game::GetText("TacView.item.rtb"), RadioMessage::RTB);
- fighter_menu->AddItem(Game::GetText("TacView.item.dock"), RadioMessage::DOCK_WITH);
- fighter_menu->AddMenu(Game::GetText("TacView.item.farcast"), farcast_menu);
-
- starship_menu = new(__FILE__,__LINE__) Menu(Game::GetText("TacView.menu.context"));
- starship_menu->AddMenu(Game::GetText("TacView.item.action"), action_menu);
- starship_menu->AddMenu(Game::GetText("TacView.item.sensors"), sensors_menu);
- starship_menu->AddItem(Game::GetText("TacView.item.patrol"), RadioMessage::MOVE_PATROL);
- starship_menu->AddItem(Game::GetText("TacView.item.cancel"), RadioMessage::RESUME_MISSION);
+ fighter_menu->AddItem(Game::GetInstance()->GetText("TacView.item.rtb"), RadioMessage::RTB);
+ fighter_menu->AddItem(Game::GetInstance()->GetText("TacView.item.dock"), RadioMessage::DOCK_WITH);
+ fighter_menu->AddMenu(Game::GetInstance()->GetText("TacView.item.farcast"), farcast_menu);
+
+ starship_menu = new(__FILE__,__LINE__) Menu(Game::GetInstance()->GetText("TacView.menu.context"));
+ starship_menu->AddMenu(Game::GetInstance()->GetText("TacView.item.action"), action_menu);
+ starship_menu->AddMenu(Game::GetInstance()->GetText("TacView.item.sensors"), sensors_menu);
+ starship_menu->AddItem(Game::GetInstance()->GetText("TacView.item.patrol"), RadioMessage::MOVE_PATROL);
+ starship_menu->AddItem(Game::GetInstance()->GetText("TacView.item.cancel"), RadioMessage::RESUME_MISSION);
starship_menu->AddItem("", 0);
- starship_menu->AddMenu(Game::GetText("TacView.item.quantum"), quantum_menu);
- starship_menu->AddMenu(Game::GetText("TacView.item.farcast"), farcast_menu);
+ starship_menu->AddMenu(Game::GetInstance()->GetText("TacView.item.quantum"), quantum_menu);
+ starship_menu->AddMenu(Game::GetInstance()->GetText("TacView.item.farcast"), farcast_menu);
initialized = 1;
}
@@ -1154,38 +1154,38 @@ TacticalView::BuildMenu()
}
// build the main menu:
- main_menu->AddMenu(Game::GetText("TacView.item.camera"), view_menu);
+ main_menu->AddMenu(Game::GetInstance()->GetText("TacView.item.camera"), view_menu);
main_menu->AddItem("", 0);
- main_menu->AddItem(Game::GetText("TacView.item.instructions"), VIEW_INS);
- main_menu->AddItem(Game::GetText("TacView.item.navigation"), VIEW_NAV);
+ main_menu->AddItem(Game::GetInstance()->GetText("TacView.item.instructions"), VIEW_INS);
+ main_menu->AddItem(Game::GetInstance()->GetText("TacView.item.navigation"), VIEW_NAV);
if (ship->Design()->repair_screen)
- main_menu->AddItem(Game::GetText("TacView.item.engineering"), VIEW_ENG);
+ main_menu->AddItem(Game::GetInstance()->GetText("TacView.item.engineering"), VIEW_ENG);
if (ship->Design()->wep_screen)
- main_menu->AddItem(Game::GetText("TacView.item.weapons"), VIEW_WEP);
+ main_menu->AddItem(Game::GetInstance()->GetText("TacView.item.weapons"), VIEW_WEP);
if (ship->NumFlightDecks() > 0)
- main_menu->AddItem(Game::GetText("TacView.item.flight"), VIEW_FLT);
+ main_menu->AddItem(Game::GetInstance()->GetText("TacView.item.flight"), VIEW_FLT);
- emcon_menu->AddItem(Game::GetText("TacView.item.emcon-1"), RadioMessage::GO_EMCON1);
- emcon_menu->AddItem(Game::GetText("TacView.item.emcon-2"), RadioMessage::GO_EMCON2);
- emcon_menu->AddItem(Game::GetText("TacView.item.emcon-3"), RadioMessage::GO_EMCON3);
+ emcon_menu->AddItem(Game::GetInstance()->GetText("TacView.item.emcon-1"), RadioMessage::GO_EMCON1);
+ emcon_menu->AddItem(Game::GetInstance()->GetText("TacView.item.emcon-2"), RadioMessage::GO_EMCON2);
+ emcon_menu->AddItem(Game::GetInstance()->GetText("TacView.item.emcon-3"), RadioMessage::GO_EMCON3);
if (ship->GetProbeLauncher())
- emcon_menu->AddItem(Game::GetText("TacView.item.probe"), RadioMessage::LAUNCH_PROBE);
+ emcon_menu->AddItem(Game::GetInstance()->GetText("TacView.item.probe"), RadioMessage::LAUNCH_PROBE);
main_menu->AddItem("", 0);
- main_menu->AddMenu(Game::GetText("TacView.item.sensors"), emcon_menu);
+ main_menu->AddMenu(Game::GetInstance()->GetText("TacView.item.sensors"), emcon_menu);
if (sim && ship->GetQuantumDrive()) {
main_menu->AddItem("", 0);
- main_menu->AddMenu(Game::GetText("TacView.item.quantum"), quantum_menu);
+ main_menu->AddMenu(Game::GetInstance()->GetText("TacView.item.quantum"), quantum_menu);
}
if (ship->IsStarship()) {
main_menu->AddItem("", 0);
- main_menu->AddItem(Game::GetText("TacView.item.command"), VIEW_CMD);
+ main_menu->AddItem(Game::GetInstance()->GetText("TacView.item.command"), VIEW_CMD);
}
}
@@ -1432,7 +1432,7 @@ TacticalView::DrawAction()
}
if (tgt && r) {
- if ((Game::RealTime()/200) & 1)
+ if ((Game::GetInstance()->RealTime()/200) & 1)
r = 20;
else
r = 15;
diff --git a/Stars45/Terrain.cpp b/Stars45/Terrain.cpp
index 1046dd7..2cbdf3b 100644
--- a/Stars45/Terrain.cpp
+++ b/Stars45/Terrain.cpp
@@ -452,7 +452,7 @@ Terrain::SelectDetail(Projector* projector)
if (!patches)
return;
- if (detail_frame >= Game::Frame())
+ if (detail_frame >= Game::GetInstance()->Frame())
return;
// compute detail map:
@@ -500,7 +500,7 @@ Terrain::SelectDetail(Projector* projector)
fog_fade = fog_fade * (1-region->HazeFade()) + region->HazeFade();
- detail_frame = Game::Frame();
+ detail_frame = Game::GetInstance()->Frame();
}
// +--------------------------------------------------------------------+
diff --git a/Stars45/Thruster.cpp b/Stars45/Thruster.cpp
index bc236bf..f8e1af1 100644
--- a/Stars45/Thruster.cpp
+++ b/Stars45/Thruster.cpp
@@ -66,8 +66,8 @@ Thruster::Thruster(int dtype, double max_thrust, float flare_scale)
ship(0), thrust(1.0f), scale(flare_scale),
avail_x(1.0f), avail_y(1.0f), avail_z(1.0f)
{
- name = Game::GetText("sys.thruster");
- abrv = Game::GetText("sys.thruster.abrv");
+ name = Game::GetInstance()->GetText("sys.thruster");
+ abrv = Game::GetInstance()->GetText("sys.thruster.abrv");
power_flags = POWER_WATTS;
@@ -457,7 +457,7 @@ Thruster::ExecTrans(double x, double y, double z)
CameraDirector* cam_dir = CameraDirector::GetInstance();
// no sound when paused!
- if (!Game::Paused() && cam_dir && cam_dir->GetCamera()) {
+ if (!Game::GetInstance()->Paused() && cam_dir && cam_dir->GetCamera()) {
if (!thruster_sound) {
if (thruster_resource)
thruster_sound = thruster_resource->Duplicate();
diff --git a/Stars45/TrackIR.cpp b/Stars45/TrackIR.cpp
index 4b9bf85..6fdebe4 100644
--- a/Stars45/TrackIR.cpp
+++ b/Stars45/TrackIR.cpp
@@ -102,7 +102,7 @@ az(0), el(0), x(0), y(0), z(0)
}
// Register the app's window handle
- result = NP_RegisterWindowHandle(Game::GetHWND());
+ result = NP_RegisterWindowHandle(Game::GetInstance()->GetHWND());
if (result == NP_OK) {
Print("NPClient - Window handle registration successful.\n");
diff --git a/Stars45/Trail.cpp b/Stars45/Trail.cpp
index de4e69c..97e6666 100644
--- a/Stars45/Trail.cpp
+++ b/Stars45/Trail.cpp
@@ -141,7 +141,7 @@ Trail::AddPoint(const Point& v)
{
if (ntrail >= maxtrail-1) return;
- double real_time = Game::RealTime() / 1000.0;
+ double real_time = Game::GetInstance()->RealTime() / 1000.0;
if (ntrail == 0) {
radius = 1000;
diff --git a/Stars45/VidDlg.cpp b/Stars45/VidDlg.cpp
index 95aa8e1..2a68f86 100644
--- a/Stars45/VidDlg.cpp
+++ b/Stars45/VidDlg.cpp
@@ -59,7 +59,7 @@ closed(true)
stars = Starshatter::GetInstance();
Init(def);
- orig_gamma = Game::GammaLevel();
+ orig_gamma = Game::GetInstance()->GammaLevel();
}
VidDlg::~VidDlg()
@@ -150,7 +150,7 @@ VidDlg::Show()
}
}
- Video* video = Game::GetVideo();
+ Video* video = Game::GetInstance()->GetVideo();
if (video) {
if (shadows)
@@ -198,7 +198,7 @@ VidDlg::Show()
if (gamma) {
- orig_gamma = Game::GammaLevel();
+ orig_gamma = Game::GetInstance()->GammaLevel();
gamma->SetValue(orig_gamma);
}
}
@@ -254,7 +254,7 @@ VidDlg::OnGamma(AWEvent* event)
int g = gamma->GetValue();
if (g >= 0 && g <= 255) {
- Game::SetGammaLevel(g);
+ Game::GetInstance()->SetGammaLevel(g);
}
}
@@ -364,7 +364,7 @@ VidDlg::Apply()
bool video_change = false;
- Video* video = Game::GetVideo();
+ Video* video = Game::GetInstance()->GetVideo();
if (video) {
const VideoSettings* vs = video->GetVideoSettings();
@@ -392,7 +392,7 @@ VidDlg::Apply()
d = 32;
}
- if (Game::MaxTexSize() != t)
+ if (Game::GetInstance()->MaxTexSize() != t)
video_change = true;
}
@@ -451,7 +451,7 @@ VidDlg::Apply()
void
VidDlg::Cancel()
{
- Game::SetGammaLevel(orig_gamma);
+ Game::GetInstance()->SetGammaLevel(orig_gamma);
closed = true;
}
diff --git a/Stars45/Weapon.cpp b/Stars45/Weapon.cpp
index 406a151..45483a0 100644
--- a/Stars45/Weapon.cpp
+++ b/Stars45/Weapon.cpp
@@ -45,9 +45,9 @@ Weapon::Weapon(WeaponDesign* d, int nmuz, Vec3* muzzles, double az, double el)
ZeroMemory(visible_stores, sizeof(visible_stores));
if (design->primary)
- abrv = Game::GetText("sys.weapon.primary.abrv");
+ abrv = Game::GetInstance()->GetText("sys.weapon.primary.abrv");
else
- abrv = Game::GetText("sys.weapon.secondary.abrv");
+ abrv = Game::GetInstance()->GetText("sys.weapon.secondary.abrv");
nbarrels = nmuz;
@@ -375,7 +375,7 @@ Weapon::Distribute(double delivered_energy, double seconds)
energy = (float) (delivered_energy/seconds);
}
- else if (!Game::Paused()) {
+ else if (!Game::GetInstance()->Paused()) {
energy += (float) (delivered_energy * 1.25);
if (energy > capacity)
@@ -589,7 +589,7 @@ Weapon::Track(SimObject* targ, System* sub)
Shot*
Weapon::Fire()
{
- if (Game::Paused())
+ if (Game::GetInstance()->Paused())
return 0;
if (ship && ship->CheckFire())
@@ -667,7 +667,7 @@ Weapon::NetFirePrimary(SimObject* tgt, System* sub, int count)
{
Shot* shot = 0;
- if (!IsPrimary() || Game::Paused())
+ if (!IsPrimary() || Game::GetInstance()->Paused())
return shot;
if (active_barrel < 0 || active_barrel >= nbarrels)
@@ -697,7 +697,7 @@ Weapon::NetFireSecondary(SimObject* tgt, System* sub, DWORD objid)
{
Shot* shot = 0;
- if (IsPrimary() || Game::Paused())
+ if (IsPrimary() || Game::GetInstance()->Paused())
return shot;
if (active_barrel < 0 || active_barrel >= nbarrels)
@@ -732,7 +732,7 @@ Weapon::FireBarrel(int n)
Shot* shot = 0;
SimRegion* region = ship->GetRegion();
- if (!region || n < 0 || n >= nbarrels || Game::Paused())
+ if (!region || n < 0 || n >= nbarrels || Game::GetInstance()->Paused())
return 0;
firing = 1;
@@ -1144,7 +1144,7 @@ Weapon::CanLockPoint(const Point& test, double& az, double& el, Point* obj)
void
Weapon::AimTurret(double az, double el)
{
- double seconds = (Game::GameTime() - aim_time) / 1000.0;
+ double seconds = (Game::GetInstance()->GameTime() - aim_time) / 1000.0;
// don't let the weapon turn faster than turret slew rate:
double max_turn = design->slew_rate * seconds;
@@ -1169,7 +1169,7 @@ Weapon::AimTurret(double az, double el)
old_azimuth = (float) az;
old_elevation = (float) el;
- aim_time = Game::GameTime();
+ aim_time = Game::GetInstance()->GameTime();
}
void
diff --git a/Stars45/WeaponDesign.cpp b/Stars45/WeaponDesign.cpp
index 7db74bd..ad9888b 100644
--- a/Stars45/WeaponDesign.cpp
+++ b/Stars45/WeaponDesign.cpp
@@ -466,7 +466,7 @@ WeaponDesign::LoadDesign(const char* path, const char* filename, bool mod)
}
if (design->description.length()) {
- design->description = Game::GetText(design->description);
+ design->description = Game::GetInstance()->GetText(design->description);
}
if (design->anim_length > 0) {
diff --git a/Stars45/Weather.cpp b/Stars45/Weather.cpp
index 4a79a1d..2f626ea 100644
--- a/Stars45/Weather.cpp
+++ b/Stars45/Weather.cpp
@@ -149,27 +149,27 @@ Weather::Description() const
switch (state) {
default:
case CLEAR:
- description = Game::GetText("weather.clear");
+ description = Game::GetInstance()->GetText("weather.clear");
break;
case HIGH_CLOUDS:
- description = Game::GetText("weather.high-clouds");
+ description = Game::GetInstance()->GetText("weather.high-clouds");
break;
case MODERATE_CLOUDS:
- description = Game::GetText("weather.partly-cloudy");
+ description = Game::GetInstance()->GetText("weather.partly-cloudy");
break;
case OVERCAST:
- description = Game::GetText("weather.overcast");
+ description = Game::GetInstance()->GetText("weather.overcast");
break;
case FOG:
- description = Game::GetText("weather.fog");
+ description = Game::GetInstance()->GetText("weather.fog");
break;
case STORM:
- description = Game::GetText("weather.storm");
+ description = Game::GetInstance()->GetText("weather.storm");
break;
}
diff --git a/Stars45/WepView.cpp b/Stars45/WepView.cpp
index 15d3b5e..03363b1 100644
--- a/Stars45/WepView.cpp
+++ b/Stars45/WepView.cpp
@@ -387,11 +387,11 @@ WepView::DrawOverlay()
Text subtxt;
Color stat = hud_color;
- static DWORD blink = Game::RealTime();
+ static DWORD blink = Game::GetInstance()->RealTime();
if (ship->GetTarget()) {
if (ship->GetSubTarget()) {
- int blink_delta = Game::RealTime() - blink;
+ int blink_delta = Game::GetInstance()->RealTime() - blink;
System* sys = ship->GetSubTarget();
subtxt = sys->Abbreviation();
@@ -406,7 +406,7 @@ WepView::DrawOverlay()
}
if (blink_delta > 500)
- blink = Game::RealTime();
+ blink = Game::GetInstance()->RealTime();
}
else