summaryrefslogtreecommitdiff
path: root/src/FLD.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/FLD.hpp')
-rw-r--r--src/FLD.hpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/FLD.hpp b/src/FLD.hpp
index d4bf4bf..329cc72 100644
--- a/src/FLD.hpp
+++ b/src/FLD.hpp
@@ -3,6 +3,7 @@
#include <string>
#include <map>
#include <optional>
+#include <climits>
#define READONLY(T, X, V) private: T _##X = V; public: decltype(_##X) const& X = _##X
@@ -40,22 +41,24 @@ public:
const Point& p;
int ix = 0;
int iy = 0;
- int w = -1;
- int h = -1;
+ int w = INT_MIN;
+ int h = INT_MIN;
float r = 0.0f;
float sx = 1.0f;
float sy = 1.0f;
Uint f = NONE;
};
struct Image {
+ FLD *fld = nullptr;
std::string path = "";
bool valid = true;
SDL_Texture *ptr = nullptr;
int width = 0;
int height = 0;
- Error invalid() const;
+ [[nodiscard]] Error invalid() const;
Error draw(const DrawImageOpts& opts) const;
+ Error setScaleMode(SDL_ScaleMode scale_mode) const;
};
enum DrawFlag {
NONE = 0,
@@ -97,7 +100,7 @@ public:
Error drawLine(const Point& p0, const Point& p1) const;
Error drawRectangle(const Rectangle& rect, Uint flags=NONE) const;
- Image& image(const std::string& path);
+ [[nodiscard]] Image& image(const std::string& path);
private:
bool shouldQuit = false;
struct {