openMSX
BaseImage.cc
Go to the documentation of this file.
1 #include "BaseImage.hh"
2 #include "MSXException.hh"
3 
4 namespace openmsx {
5 
6 constexpr int MAX_SIZE = 2048;
7 
9 {
10  auto [w, h] = size;
11  if (w < -MAX_SIZE || w > MAX_SIZE) {
12  throw MSXException("Image width too large: ", w,
13  " (max ", MAX_SIZE, ')');
14  }
15  if (h < -MAX_SIZE || h > MAX_SIZE) {
16  throw MSXException("Image height too large: ", h,
17  " (max ", MAX_SIZE, ')');
18  }
19 }
20 
21 } // namespace openmsx
constexpr int MAX_SIZE
Definition: BaseImage.cc:6
size_t size(std::string_view utf8)
static void checkSize(gl::ivec2 size)
Performs a sanity check on image size.
Definition: BaseImage.cc:8
Thanks to enen for testing this on a real cartridge:
Definition: Autofire.cc:5
gl::ivec2 size
Definition: BaseImage.hh:31