mirror of
https://github.com/love2d/love.git
synced 2026-08-12 08:30:56 +02:00
Include int.h to fix windows build
--HG-- branch : dynamiccore2
This commit is contained in:
@@ -524,7 +524,9 @@ T *luax_totype(lua_State *L, int idx, love::Type& /*type*/)
|
||||
return o;
|
||||
}
|
||||
|
||||
uint32_t luax_type(lua_State *L, int idx);
|
||||
|
||||
|
||||
uint32 luax_type(lua_State *L, int idx);
|
||||
|
||||
/**
|
||||
* Converts any exceptions thrown by the passed lambda function into a Lua error.
|
||||
|
||||
@@ -24,26 +24,26 @@
|
||||
namespace love
|
||||
{
|
||||
|
||||
static StringMap<uint32_t, love::Type::MAX_TYPES> types(nullptr, 0);
|
||||
static StringMap<uint32, love::Type::MAX_TYPES> types(nullptr, 0);
|
||||
|
||||
void addTypeName(uint32_t type, const char *name)
|
||||
void addTypeName(uint32 type, const char *name)
|
||||
{
|
||||
const char *n;
|
||||
if (!types.find(type, n))
|
||||
types.add(name, type);
|
||||
}
|
||||
|
||||
bool getTypeName(const char *in, uint32_t &out)
|
||||
bool getTypeName(const char *in, uint32 &out)
|
||||
{
|
||||
return types.find(in, out);
|
||||
}
|
||||
|
||||
bool getTypeName(uint32_t in, const char *&out)
|
||||
bool getTypeName(uint32 in, const char *&out)
|
||||
{
|
||||
return types.find(in, out);
|
||||
}
|
||||
|
||||
uint32_t love::Type::nextId = 1;
|
||||
uint32 love::Type::nextId = 1;
|
||||
|
||||
Type::Type(Type *parent)
|
||||
: inited(false)
|
||||
@@ -64,14 +64,14 @@ void love::Type::init()
|
||||
bits |= parent->bits;
|
||||
}
|
||||
|
||||
uint32_t love::Type::getId()
|
||||
uint32 love::Type::getId()
|
||||
{
|
||||
if (!inited)
|
||||
init();
|
||||
return id;
|
||||
}
|
||||
|
||||
bool love::Type::isa(const uint32_t &other)
|
||||
bool love::Type::isa(const uint32 &other)
|
||||
{
|
||||
if (!inited)
|
||||
init();
|
||||
|
||||
+10
-8
@@ -21,6 +21,8 @@
|
||||
#ifndef LOVE_TYPES_H
|
||||
#define LOVE_TYPES_H
|
||||
|
||||
#include "int.h"
|
||||
|
||||
// STD
|
||||
#include <bitset>
|
||||
#include <vector>
|
||||
@@ -28,31 +30,31 @@
|
||||
namespace love
|
||||
{
|
||||
|
||||
void addTypeName(uint32_t type, const char *name);
|
||||
bool getTypeName(const char *in, uint32_t &out);
|
||||
bool getTypeName(uint32_t in, const char *&out);
|
||||
void addTypeName(uint32 type, const char *name);
|
||||
bool getTypeName(const char *in, uint32 &out);
|
||||
bool getTypeName(uint32 in, const char *&out);
|
||||
|
||||
class Type
|
||||
{
|
||||
public:
|
||||
static const uint32_t MAX_TYPES = 128;
|
||||
static const uint32 MAX_TYPES = 128;
|
||||
|
||||
// TODO: Type-checking templated constructor
|
||||
Type(Type *parent);
|
||||
Type(const Type&) = delete;
|
||||
|
||||
uint32_t getId();
|
||||
bool isa(const uint32_t &other);
|
||||
uint32 getId();
|
||||
bool isa(const uint32 &other);
|
||||
bool isa(Type &other);
|
||||
|
||||
private:
|
||||
static uint32_t nextId;
|
||||
static uint32 nextId;
|
||||
void init();
|
||||
|
||||
bool inited;
|
||||
Type *parent;
|
||||
|
||||
uint32_t id;
|
||||
uint32 id;
|
||||
std::bitset<MAX_TYPES> bits;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user