summaryrefslogtreecommitdiffhomepage
path: root/StarsEx
diff options
context:
space:
mode:
authorAki <please@ignore.pl>2022-04-03 20:14:44 +0200
committerAki <please@ignore.pl>2022-04-03 20:14:44 +0200
commit8fe1e0179fc4f08c9288c50ba5505fe040dea042 (patch)
tree6bf39a3a842694e29cf7e661c29ba59a210e3b2f /StarsEx
parentcd57c84c5fe34c2ac548d6d119a9828a303923ef (diff)
downloadstarshatter-8fe1e0179fc4f08c9288c50ba5505fe040dea042.zip
starshatter-8fe1e0179fc4f08c9288c50ba5505fe040dea042.tar.gz
starshatter-8fe1e0179fc4f08c9288c50ba5505fe040dea042.tar.bz2
Moved parts of activate and pause methods to GameWinDX9
Diffstat (limited to 'StarsEx')
-rw-r--r--StarsEx/Game.cpp14
-rw-r--r--StarsEx/GameWinDX9.cpp22
-rw-r--r--StarsEx/GameWinDX9.h2
3 files changed, 25 insertions, 13 deletions
diff --git a/StarsEx/Game.cpp b/StarsEx/Game.cpp
index b7a4fb1..56cb115 100644
--- a/StarsEx/Game.cpp
+++ b/StarsEx/Game.cpp
@@ -130,9 +130,6 @@ void
Game::Activate(bool f)
{
active = f;
-
- if (active && video)
- video->InvalidateCache();
}
// +--------------------------------------------------------------------+
@@ -140,16 +137,7 @@ Game::Activate(bool f)
void
Game::Pause(bool f)
{
- if (f) {
- if (soundcard)
- soundcard->Pause();
- paused = true;
- }
- else {
- if (soundcard)
- soundcard->Resume();
- paused = false;
- }
+ paused = f;
}
// +--------------------------------------------------------------------+
diff --git a/StarsEx/GameWinDX9.cpp b/StarsEx/GameWinDX9.cpp
index 671464e..b4f7979 100644
--- a/StarsEx/GameWinDX9.cpp
+++ b/StarsEx/GameWinDX9.cpp
@@ -580,6 +580,28 @@ GameWinDX9::Run()
void
+GameWinDX9::Activate(bool f)
+{
+ Game::Activate(f);
+ if (f && video)
+ video->InvalidateCache();
+}
+
+
+void
+GameWinDX9::Pause(bool f)
+{
+ Game::Pause(f);
+ if (soundcard) {
+ if (f)
+ soundcard->Pause();
+ else
+ soundcard->Resume();
+ }
+}
+
+
+void
GameWinDX9::ShowStats()
{
if (server) return;
diff --git a/StarsEx/GameWinDX9.h b/StarsEx/GameWinDX9.h
index ef86956..88ad113 100644
--- a/StarsEx/GameWinDX9.h
+++ b/StarsEx/GameWinDX9.h
@@ -36,6 +36,8 @@ public:
virtual bool LoadPalette(PALETTEENTRY* pal, BYTE* inv);
virtual int Run() override;
+ virtual void Activate(bool f) override;
+ virtual void Pause(bool f) override;
void ShowStats();
int MaxTexSize() const;