From 2e5d0eb1eecc52b20d1e9f7a3ce0317b851442c4 Mon Sep 17 00:00:00 2001 From: Aki Date: Mon, 14 Mar 2022 19:36:33 +0100 Subject: Moved max texture size to GameWinDX9 --- Stars45/GameWinDX9.cpp | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) (limited to 'Stars45/GameWinDX9.cpp') 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; +} -- cgit v1.1