mirror of
https://github.com/love2d/love.git
synced 2026-08-17 11:00:31 +02:00
Cleaned up some duplicated pixel format-related code in Font files.
--HG-- branch : minor
This commit is contained in:
@@ -27,6 +27,7 @@
|
||||
#include "common/Exception.h"
|
||||
#include "common/StringMap.h"
|
||||
#include "common/int.h"
|
||||
#include "common/pixelformat.h"
|
||||
|
||||
// stdlib
|
||||
#include <string>
|
||||
@@ -57,14 +58,7 @@ public:
|
||||
|
||||
static love::Type type;
|
||||
|
||||
enum Format
|
||||
{
|
||||
FORMAT_LUMINANCE_ALPHA,
|
||||
FORMAT_RGBA,
|
||||
FORMAT_MAX_ENUM
|
||||
};
|
||||
|
||||
GlyphData(uint32 glyph, GlyphMetrics glyphMetrics, Format f);
|
||||
GlyphData(uint32 glyph, GlyphMetrics glyphMetrics, PixelFormat f);
|
||||
virtual ~GlyphData();
|
||||
|
||||
// Implements Data.
|
||||
@@ -139,10 +133,7 @@ public:
|
||||
/**
|
||||
* Gets the format of the glyph data.
|
||||
**/
|
||||
Format getFormat() const;
|
||||
|
||||
static bool getConstant(const char *in, Format &out);
|
||||
static bool getConstant(Format in, const char *&out);
|
||||
PixelFormat getFormat() const;
|
||||
|
||||
private:
|
||||
|
||||
@@ -156,10 +147,7 @@ private:
|
||||
uint8 *data;
|
||||
|
||||
// The format the data's in.
|
||||
Format format;
|
||||
|
||||
static StringMap<Format, FORMAT_MAX_ENUM>::Entry formatEntries[];
|
||||
static StringMap<Format, FORMAT_MAX_ENUM> formats;
|
||||
PixelFormat format;
|
||||
|
||||
}; // GlyphData
|
||||
|
||||
|
||||
Reference in New Issue
Block a user