mirror of
https://github.com/love2d/love.git
synced 2026-08-16 00:02:12 +02:00
Error when invalid setting names are used in the tables passed to love.graphics.newCanvas and newImage. See issue #1312.
This commit is contained in:
@@ -46,6 +46,14 @@ public:
|
||||
MIPMAPS_GENERATED,
|
||||
};
|
||||
|
||||
enum SettingType
|
||||
{
|
||||
SETTING_MIPMAPS,
|
||||
SETTING_LINEAR,
|
||||
SETTING_DPI_SCALE,
|
||||
SETTING_MAX_ENUM
|
||||
};
|
||||
|
||||
struct Settings
|
||||
{
|
||||
bool mipmaps = false;
|
||||
@@ -94,6 +102,11 @@ public:
|
||||
|
||||
static int imageCount;
|
||||
|
||||
static bool getConstant(const char *in, SettingType &out);
|
||||
static bool getConstant(SettingType in, const char *&out);
|
||||
static const char *getConstant(SettingType in);
|
||||
static std::vector<std::string> getConstants(SettingType);
|
||||
|
||||
protected:
|
||||
|
||||
Image(const Slices &data, const Settings &settings);
|
||||
@@ -122,6 +135,9 @@ private:
|
||||
|
||||
void init(PixelFormat fmt, int w, int h, const Settings &settings);
|
||||
|
||||
static StringMap<SettingType, SETTING_MAX_ENUM>::Entry settingTypeEntries[];
|
||||
static StringMap<SettingType, SETTING_MAX_ENUM> settingTypes;
|
||||
|
||||
}; // Image
|
||||
|
||||
} // graphics
|
||||
|
||||
Reference in New Issue
Block a user