mirror of
https://github.com/love2d/love.git
synced 2026-08-20 12:40:20 +02:00
Merged default into minor
--HG-- branch : minor
This commit is contained in:
Binary file not shown.
@@ -17,11 +17,11 @@
|
|||||||
<key>CFBundlePackageType</key>
|
<key>CFBundlePackageType</key>
|
||||||
<string>FMWK</string>
|
<string>FMWK</string>
|
||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
<string>0.9.1</string>
|
<string>0.9.2</string>
|
||||||
<key>CFBundleSignature</key>
|
<key>CFBundleSignature</key>
|
||||||
<string>LoVe</string>
|
<string>LoVe</string>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>0.9.1</string>
|
<string>0.9.2</string>
|
||||||
<key>NSPrincipalClass</key>
|
<key>NSPrincipalClass</key>
|
||||||
<string></string>
|
<string></string>
|
||||||
</dict>
|
</dict>
|
||||||
|
|||||||
@@ -46,7 +46,7 @@
|
|||||||
<key>CFBundlePackageType</key>
|
<key>CFBundlePackageType</key>
|
||||||
<string>APPL</string>
|
<string>APPL</string>
|
||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
<string>0.9.1</string>
|
<string>0.9.2</string>
|
||||||
<key>CFBundleSignature</key>
|
<key>CFBundleSignature</key>
|
||||||
<string>LoVe</string>
|
<string>LoVe</string>
|
||||||
<key>LSApplicationCategoryType</key>
|
<key>LSApplicationCategoryType</key>
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
Name=LÖVE
|
Name=LÖVE
|
||||||
Comment=The unquestionably awesome 2D game engine
|
Comment=The unquestionably awesome 2D game engine
|
||||||
MimeType=application/x-love-game;
|
MimeType=application/x-love-game;
|
||||||
Exec=@bindir@/love
|
Exec=@bindir@/love %f
|
||||||
Type=Application
|
Type=Application
|
||||||
Categories=Development;Game;
|
Categories=Development;Game;
|
||||||
Terminal=false
|
Terminal=false
|
||||||
|
|||||||
@@ -27,9 +27,9 @@ namespace love
|
|||||||
// Version stuff.
|
// Version stuff.
|
||||||
const int VERSION_MAJOR = 0;
|
const int VERSION_MAJOR = 0;
|
||||||
const int VERSION_MINOR = 9;
|
const int VERSION_MINOR = 9;
|
||||||
const int VERSION_REV = 1;
|
const int VERSION_REV = 2;
|
||||||
const char *VERSION = "0.9.1";
|
const char *VERSION = "0.9.2";
|
||||||
const char *VERSION_COMPATIBILITY[] = { VERSION, "0.9.0", 0 };
|
const char *VERSION_COMPATIBILITY[] = { VERSION, "0.9.1", "0.9.0", 0 };
|
||||||
const char *VERSION_CODENAME = "Baby Inspector";
|
const char *VERSION_CODENAME = "Baby Inspector";
|
||||||
|
|
||||||
} // love
|
} // love
|
||||||
|
|||||||
@@ -89,16 +89,6 @@ bool Graphics::getConstant(Support in, const char *&out)
|
|||||||
return support.find(in, out);
|
return support.find(in, out);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Graphics::getConstant(const char *in, RendererInfo &out)
|
|
||||||
{
|
|
||||||
return rendererInfo.find(in, out);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Graphics::getConstant(RendererInfo in, const char *&out)
|
|
||||||
{
|
|
||||||
return rendererInfo.find(in, out);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Graphics::getConstant(const char *in, SystemLimit &out)
|
bool Graphics::getConstant(const char *in, SystemLimit &out)
|
||||||
{
|
{
|
||||||
return systemLimits.find(in, out);
|
return systemLimits.find(in, out);
|
||||||
@@ -169,16 +159,6 @@ StringMap<Graphics::Support, Graphics::SUPPORT_MAX_ENUM>::Entry Graphics::suppor
|
|||||||
|
|
||||||
StringMap<Graphics::Support, Graphics::SUPPORT_MAX_ENUM> Graphics::support(Graphics::supportEntries, sizeof(Graphics::supportEntries));
|
StringMap<Graphics::Support, Graphics::SUPPORT_MAX_ENUM> Graphics::support(Graphics::supportEntries, sizeof(Graphics::supportEntries));
|
||||||
|
|
||||||
StringMap<Graphics::RendererInfo, Graphics::RENDERER_INFO_MAX_ENUM>::Entry Graphics::rendererInfoEntries[] =
|
|
||||||
{
|
|
||||||
{ "name", Graphics::RENDERER_INFO_NAME },
|
|
||||||
{ "version", Graphics::RENDERER_INFO_VERSION },
|
|
||||||
{ "vendor", Graphics::RENDERER_INFO_VENDOR },
|
|
||||||
{ "device", Graphics::RENDERER_INFO_DEVICE },
|
|
||||||
};
|
|
||||||
|
|
||||||
StringMap<Graphics::RendererInfo, Graphics::RENDERER_INFO_MAX_ENUM> Graphics::rendererInfo(Graphics::rendererInfoEntries, sizeof(Graphics::rendererInfoEntries));
|
|
||||||
|
|
||||||
StringMap<Graphics::SystemLimit, Graphics::LIMIT_MAX_ENUM>::Entry Graphics::systemLimitEntries[] =
|
StringMap<Graphics::SystemLimit, Graphics::LIMIT_MAX_ENUM>::Entry Graphics::systemLimitEntries[] =
|
||||||
{
|
{
|
||||||
{"pointsize", Graphics::LIMIT_POINT_SIZE},
|
{"pointsize", Graphics::LIMIT_POINT_SIZE},
|
||||||
|
|||||||
@@ -25,6 +25,9 @@
|
|||||||
#include "common/Module.h"
|
#include "common/Module.h"
|
||||||
#include "common/StringMap.h"
|
#include "common/StringMap.h"
|
||||||
|
|
||||||
|
// C++
|
||||||
|
#include <string>
|
||||||
|
|
||||||
namespace love
|
namespace love
|
||||||
{
|
{
|
||||||
namespace graphics
|
namespace graphics
|
||||||
@@ -88,15 +91,6 @@ public:
|
|||||||
SUPPORT_MAX_ENUM
|
SUPPORT_MAX_ENUM
|
||||||
};
|
};
|
||||||
|
|
||||||
enum RendererInfo
|
|
||||||
{
|
|
||||||
RENDERER_INFO_NAME,
|
|
||||||
RENDERER_INFO_VERSION,
|
|
||||||
RENDERER_INFO_VENDOR,
|
|
||||||
RENDERER_INFO_DEVICE,
|
|
||||||
RENDERER_INFO_MAX_ENUM
|
|
||||||
};
|
|
||||||
|
|
||||||
enum SystemLimit
|
enum SystemLimit
|
||||||
{
|
{
|
||||||
LIMIT_POINT_SIZE,
|
LIMIT_POINT_SIZE,
|
||||||
@@ -106,6 +100,14 @@ public:
|
|||||||
LIMIT_MAX_ENUM
|
LIMIT_MAX_ENUM
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct RendererInfo
|
||||||
|
{
|
||||||
|
std::string name;
|
||||||
|
std::string version;
|
||||||
|
std::string vendor;
|
||||||
|
std::string device;
|
||||||
|
};
|
||||||
|
|
||||||
virtual ~Graphics();
|
virtual ~Graphics();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -144,9 +146,6 @@ public:
|
|||||||
static bool getConstant(const char *in, Support &out);
|
static bool getConstant(const char *in, Support &out);
|
||||||
static bool getConstant(Support in, const char *&out);
|
static bool getConstant(Support in, const char *&out);
|
||||||
|
|
||||||
static bool getConstant(const char *in, RendererInfo &out);
|
|
||||||
static bool getConstant(RendererInfo in, const char *&out);
|
|
||||||
|
|
||||||
static bool getConstant(const char *in, SystemLimit &out);
|
static bool getConstant(const char *in, SystemLimit &out);
|
||||||
static bool getConstant(SystemLimit in, const char *&out);
|
static bool getConstant(SystemLimit in, const char *&out);
|
||||||
|
|
||||||
@@ -170,9 +169,6 @@ private:
|
|||||||
static StringMap<Support, SUPPORT_MAX_ENUM>::Entry supportEntries[];
|
static StringMap<Support, SUPPORT_MAX_ENUM>::Entry supportEntries[];
|
||||||
static StringMap<Support, SUPPORT_MAX_ENUM> support;
|
static StringMap<Support, SUPPORT_MAX_ENUM> support;
|
||||||
|
|
||||||
static StringMap<RendererInfo, RENDERER_INFO_MAX_ENUM>::Entry rendererInfoEntries[];
|
|
||||||
static StringMap<RendererInfo, RENDERER_INFO_MAX_ENUM> rendererInfo;
|
|
||||||
|
|
||||||
static StringMap<SystemLimit, LIMIT_MAX_ENUM>::Entry systemLimitEntries[];
|
static StringMap<SystemLimit, LIMIT_MAX_ENUM>::Entry systemLimitEntries[];
|
||||||
static StringMap<SystemLimit, LIMIT_MAX_ENUM> systemLimits;
|
static StringMap<SystemLimit, LIMIT_MAX_ENUM> systemLimits;
|
||||||
|
|
||||||
|
|||||||
@@ -1051,31 +1051,30 @@ love::image::ImageData *Graphics::newScreenshot(love::image::Image *image, bool
|
|||||||
return img;
|
return img;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string Graphics::getRendererInfo(Graphics::RendererInfo infotype) const
|
Graphics::RendererInfo Graphics::getRendererInfo() const
|
||||||
{
|
{
|
||||||
const char *infostr = 0;
|
RendererInfo info;
|
||||||
|
info.name = "OpenGL";
|
||||||
|
|
||||||
switch (infotype)
|
const char *str = (const char *) glGetString(GL_VERSION);
|
||||||
{
|
if (str)
|
||||||
case Graphics::RENDERER_INFO_NAME:
|
info.version = str;
|
||||||
default:
|
else
|
||||||
infostr = "OpenGL";
|
throw love::Exception("Cannot retrieve renderer version information.");
|
||||||
break;
|
|
||||||
case Graphics::RENDERER_INFO_VERSION:
|
|
||||||
infostr = (const char *) glGetString(GL_VERSION);
|
|
||||||
break;
|
|
||||||
case Graphics::RENDERER_INFO_VENDOR:
|
|
||||||
infostr = (const char *) glGetString(GL_VENDOR);
|
|
||||||
break;
|
|
||||||
case Graphics::RENDERER_INFO_DEVICE:
|
|
||||||
infostr = (const char *) glGetString(GL_RENDERER);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!infostr)
|
str = (const char *) glGetString(GL_VENDOR);
|
||||||
throw love::Exception("Cannot retrieve renderer information.");
|
if (str)
|
||||||
|
info.vendor = str;
|
||||||
|
else
|
||||||
|
throw love::Exception("Cannot retrieve renderer vendor information.");
|
||||||
|
|
||||||
return std::string(infostr);
|
str = (const char *) glGetString(GL_RENDERER);
|
||||||
|
if (str)
|
||||||
|
info.device = str;
|
||||||
|
else
|
||||||
|
throw love::Exception("Cannot retrieve renderer device information.");
|
||||||
|
|
||||||
|
return info;
|
||||||
}
|
}
|
||||||
|
|
||||||
double Graphics::getSystemLimit(SystemLimit limittype) const
|
double Graphics::getSystemLimit(SystemLimit limittype) const
|
||||||
|
|||||||
@@ -431,12 +431,11 @@ public:
|
|||||||
love::image::ImageData *newScreenshot(love::image::Image *image, bool copyAlpha = true);
|
love::image::ImageData *newScreenshot(love::image::Image *image, bool copyAlpha = true);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a string containing system-dependent renderer information.
|
* Returns system-dependent renderer information.
|
||||||
* Returned string can vary greatly between systems! Do not rely on it for
|
* Returned string s can vary greatly between systems! Do not rely on it for
|
||||||
* anything!
|
* anything!
|
||||||
* @param infotype The type of information to return.
|
|
||||||
**/
|
**/
|
||||||
std::string getRendererInfo(Graphics::RendererInfo infotype) const;
|
RendererInfo getRendererInfo() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the system-dependent numeric limit for the specified parameter.
|
* Gets the system-dependent numeric limit for the specified parameter.
|
||||||
|
|||||||
@@ -79,6 +79,9 @@ Mesh::Mesh(int vertexcount, Mesh::DrawMode mode)
|
|||||||
|
|
||||||
Mesh::~Mesh()
|
Mesh::~Mesh()
|
||||||
{
|
{
|
||||||
|
if (texture)
|
||||||
|
texture->release();
|
||||||
|
|
||||||
delete vbo;
|
delete vbo;
|
||||||
delete ibo;
|
delete ibo;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,8 +46,8 @@ SpriteBatch::SpriteBatch(Texture *texture, int size, int usage)
|
|||||||
, size(size)
|
, size(size)
|
||||||
, next(0)
|
, next(0)
|
||||||
, color(0)
|
, color(0)
|
||||||
, array_buf(0)
|
, array_buf(nullptr)
|
||||||
, element_buf(0)
|
, element_buf(nullptr)
|
||||||
, buffer_used_offset(0)
|
, buffer_used_offset(0)
|
||||||
, buffer_used_size(0)
|
, buffer_used_size(0)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -21,18 +21,12 @@
|
|||||||
#include "VertexBuffer.h"
|
#include "VertexBuffer.h"
|
||||||
|
|
||||||
#include "common/Exception.h"
|
#include "common/Exception.h"
|
||||||
#include "common/config.h"
|
|
||||||
|
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <limits>
|
#include <limits>
|
||||||
|
|
||||||
// Conflicts with std::numeric_limits<GLushort>::max() (Windows).
|
|
||||||
#ifdef max
|
|
||||||
# undef max
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace love
|
namespace love
|
||||||
{
|
{
|
||||||
namespace graphics
|
namespace graphics
|
||||||
@@ -55,7 +49,7 @@ VertexBuffer::VertexBuffer(size_t size, GLenum target, GLenum usage, MemoryBacki
|
|||||||
, usage(usage)
|
, usage(usage)
|
||||||
, backing(backing)
|
, backing(backing)
|
||||||
, vbo(0)
|
, vbo(0)
|
||||||
, memory_map(0)
|
, memory_map(nullptr)
|
||||||
, is_dirty(true)
|
, is_dirty(true)
|
||||||
{
|
{
|
||||||
if (getMemoryBacking() == BACKING_FULL)
|
if (getMemoryBacking() == BACKING_FULL)
|
||||||
@@ -207,7 +201,7 @@ bool VertexBuffer::load(bool restore)
|
|||||||
VertexBuffer::Bind bind(*this);
|
VertexBuffer::Bind bind(*this);
|
||||||
|
|
||||||
// Copy the old buffer only if 'restore' was requested.
|
// Copy the old buffer only if 'restore' was requested.
|
||||||
const GLvoid *src = restore ? memory_map : 0;
|
const GLvoid *src = restore ? memory_map : nullptr;
|
||||||
|
|
||||||
while (GL_NO_ERROR != glGetError())
|
while (GL_NO_ERROR != glGetError())
|
||||||
/* clear error messages */;
|
/* clear error messages */;
|
||||||
|
|||||||
@@ -23,6 +23,7 @@
|
|||||||
#define LOVE_GRAPHICS_OPENGL_VERTEX_BUFFER_H
|
#define LOVE_GRAPHICS_OPENGL_VERTEX_BUFFER_H
|
||||||
|
|
||||||
// LOVE
|
// LOVE
|
||||||
|
#include "common/config.h"
|
||||||
#include "graphics/Volatile.h"
|
#include "graphics/Volatile.h"
|
||||||
|
|
||||||
// OpenGL
|
// OpenGL
|
||||||
|
|||||||
@@ -1018,20 +1018,13 @@ int w_hasCanvasFormat(lua_State *L)
|
|||||||
|
|
||||||
int w_getRendererInfo(lua_State *L)
|
int w_getRendererInfo(lua_State *L)
|
||||||
{
|
{
|
||||||
std::string name, version, vendor, device;
|
Graphics::RendererInfo info;
|
||||||
|
luax_catchexcept(L, [&](){ info = instance->getRendererInfo(); });
|
||||||
luax_catchexcept(L, [&]() {
|
|
||||||
name = instance->getRendererInfo(Graphics::RENDERER_INFO_NAME);
|
|
||||||
version = instance->getRendererInfo(Graphics::RENDERER_INFO_VERSION);
|
|
||||||
vendor = instance->getRendererInfo(Graphics::RENDERER_INFO_VENDOR);
|
|
||||||
device = instance->getRendererInfo(Graphics::RENDERER_INFO_DEVICE);
|
|
||||||
});
|
|
||||||
|
|
||||||
luax_pushstring(L, name);
|
|
||||||
luax_pushstring(L, version);
|
|
||||||
luax_pushstring(L, vendor);
|
|
||||||
luax_pushstring(L, device);
|
|
||||||
|
|
||||||
|
luax_pushstring(L, info.name);
|
||||||
|
luax_pushstring(L, info.version);
|
||||||
|
luax_pushstring(L, info.vendor);
|
||||||
|
luax_pushstring(L, info.device);
|
||||||
return 4;
|
return 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -131,6 +131,8 @@ bool World::ContactFilter::process(Fixture *a, Fixture *b)
|
|||||||
|
|
||||||
if (ref != 0)
|
if (ref != 0)
|
||||||
{
|
{
|
||||||
|
a->retain();
|
||||||
|
b->retain();
|
||||||
lua_State *L = ref->getL();
|
lua_State *L = ref->getL();
|
||||||
ref->push();
|
ref->push();
|
||||||
luax_pushtype(L, "Fixture", PHYSICS_FIXTURE_T, a);
|
luax_pushtype(L, "Fixture", PHYSICS_FIXTURE_T, a);
|
||||||
@@ -318,11 +320,9 @@ bool World::ShouldCollide(b2Fixture *fixtureA, b2Fixture *fixtureB)
|
|||||||
Fixture *a = (Fixture *)Memoizer::find(fixtureA);
|
Fixture *a = (Fixture *)Memoizer::find(fixtureA);
|
||||||
if (!a)
|
if (!a)
|
||||||
throw love::Exception("A fixture has escaped Memoizer!");
|
throw love::Exception("A fixture has escaped Memoizer!");
|
||||||
a->retain();
|
|
||||||
Fixture *b = (Fixture *)Memoizer::find(fixtureB);
|
Fixture *b = (Fixture *)Memoizer::find(fixtureB);
|
||||||
if (!b)
|
if (!b)
|
||||||
throw love::Exception("A fixture has escaped Memoizer!");
|
throw love::Exception("A fixture has escaped Memoizer!");
|
||||||
b->retain();
|
|
||||||
return filter.process(a, b);
|
return filter.process(a, b);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user