diff options
author | Aki <please@ignore.pl> | 2022-03-14 19:36:33 +0100 |
---|---|---|
committer | Aki <please@ignore.pl> | 2022-03-14 19:36:33 +0100 |
commit | 2e5d0eb1eecc52b20d1e9f7a3ce0317b851442c4 (patch) | |
tree | a1e7873c9086e5d1f4be8092d775e6127f5c388c /Stars45/GameWinDX9.cpp | |
parent | 92f7c58068c6a7bfe0b32af5c1ace6bdde2f3951 (diff) | |
download | starshatter-2e5d0eb1eecc52b20d1e9f7a3ce0317b851442c4.zip starshatter-2e5d0eb1eecc52b20d1e9f7a3ce0317b851442c4.tar.gz starshatter-2e5d0eb1eecc52b20d1e9f7a3ce0317b851442c4.tar.bz2 |
Moved max texture size to GameWinDX9
Diffstat (limited to 'Stars45/GameWinDX9.cpp')
-rw-r--r-- | Stars45/GameWinDX9.cpp | 38 |
1 files changed, 37 insertions, 1 deletions
diff --git a/Stars45/GameWinDX9.cpp b/Stars45/GameWinDX9.cpp index efc825a..5afff31 100644 --- a/Stars45/GameWinDX9.cpp +++ b/Stars45/GameWinDX9.cpp @@ -27,7 +27,8 @@ GameWinDX9::GetInstance() } -GameWinDX9::GameWinDX9() +GameWinDX9::GameWinDX9() : + max_tex_size {2048} { if (instance != nullptr) Panic::Panic("Multiple instances of GameWinDX9"); @@ -279,3 +280,38 @@ GameWinDX9::LoadPalette(PALETTEENTRY* pal, BYTE* inv) return true; } + + +int +GameWinDX9::MaxTexSize() const +{ + if (video) { + int max_from_video = video->MaxTexSize(); + if (max_from_video < max_tex_size) + return max_from_video; + return max_tex_size; + } + else if (Video* video = Video::GetInstance()) { + return video->MaxTexSize(); + } + return 256; +} + + +int +GameWinDX9::MaxTexAspect() const +{ + if (video) + return video->MaxTexAspect(); + else if (Video* video = Video::GetInstance()) + return video->MaxTexAspect(); + return 1; +} + + +void +GameWinDX9::SetMaxTexSize(int n) +{ + if (n >= 64 && n <= 4096) + max_tex_size = n; +} |