mirror of
https://github.com/love2d/love.git
synced 2026-08-12 08:30:56 +02:00
Re-added love.graphics.getWidth/getHeight
This commit is contained in:
+1
-1
@@ -28,7 +28,7 @@ LOVE 0.9.0 [Baby Inspector]
|
|||||||
* Added SpriteBatch:getCount and SpriteBatch:getBufferSize.
|
* Added SpriteBatch:getCount and SpriteBatch:getBufferSize.
|
||||||
* Added ParticleSystem:emit.
|
* Added ParticleSystem:emit.
|
||||||
* Added many ParticleSystem getter methods.
|
* Added many ParticleSystem getter methods.
|
||||||
* Added DXT-compressed texture support via love.image.newCompressedData.
|
* Added DXT compressed texture support via love.image.newCompressedData.
|
||||||
* Added love.image.isCompressed and Image:isCompressed.
|
* Added love.image.isCompressed and Image:isCompressed.
|
||||||
* Added Image/Canvas/ImageData:getDimensions.
|
* Added Image/Canvas/ImageData:getDimensions.
|
||||||
* Added anisotropic filtering support for Images, Canvases, and Fonts.
|
* Added anisotropic filtering support for Images, Canvases, and Fonts.
|
||||||
|
|||||||
@@ -62,6 +62,25 @@ int w_isCreated(lua_State *L)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int w_getWidth(lua_State *L)
|
||||||
|
{
|
||||||
|
lua_pushinteger(L, instance->getWidth());
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int w_getHeight(lua_State *L)
|
||||||
|
{
|
||||||
|
lua_pushinteger(L, instance->getHeight());
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int w_getDimensions(lua_State *L)
|
||||||
|
{
|
||||||
|
lua_pushinteger(L, instance->getWidth());
|
||||||
|
lua_pushinteger(L, instance->getHeight());
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
|
|
||||||
int w_setScissor(lua_State *L)
|
int w_setScissor(lua_State *L)
|
||||||
{
|
{
|
||||||
if (lua_gettop(L) == 0)
|
if (lua_gettop(L) == 0)
|
||||||
@@ -1514,6 +1533,9 @@ static const luaL_Reg functions[] =
|
|||||||
{ "printf", w_printf },
|
{ "printf", w_printf },
|
||||||
|
|
||||||
{ "isCreated", w_isCreated },
|
{ "isCreated", w_isCreated },
|
||||||
|
{ "getWidth", w_getWidth },
|
||||||
|
{ "getHeight", w_getHeight },
|
||||||
|
{ "getDimensions", w_getDimensions },
|
||||||
|
|
||||||
{ "setScissor", w_setScissor },
|
{ "setScissor", w_setScissor },
|
||||||
{ "getScissor", w_getScissor },
|
{ "getScissor", w_getScissor },
|
||||||
|
|||||||
@@ -42,6 +42,9 @@ int w_reset(lua_State *L);
|
|||||||
int w_clear(lua_State *L);
|
int w_clear(lua_State *L);
|
||||||
int w_present(lua_State *L);
|
int w_present(lua_State *L);
|
||||||
int w_isCreated(lua_State *L);
|
int w_isCreated(lua_State *L);
|
||||||
|
int w_getWidth(lua_State *L);
|
||||||
|
int w_getHeight(lua_State *L);
|
||||||
|
int w_getDimensions(lua_State *L);
|
||||||
int w_setScissor(lua_State *L);
|
int w_setScissor(lua_State *L);
|
||||||
int w_getScissor(lua_State *L);
|
int w_getScissor(lua_State *L);
|
||||||
int w_setStencil(lua_State *L);
|
int w_setStencil(lua_State *L);
|
||||||
|
|||||||
@@ -775,7 +775,7 @@ function love.errhand(msg)
|
|||||||
|
|
||||||
local function draw()
|
local function draw()
|
||||||
love.graphics.clear()
|
love.graphics.clear()
|
||||||
love.graphics.printf(p, 70, 70, love.window.getWidth() - 70)
|
love.graphics.printf(p, 70, 70, love.graphics.getWidth() - 70)
|
||||||
love.graphics.present()
|
love.graphics.present()
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -826,7 +826,7 @@ function love.releaseerrhand(msg)
|
|||||||
|
|
||||||
local function draw()
|
local function draw()
|
||||||
love.graphics.clear()
|
love.graphics.clear()
|
||||||
love.graphics.printf(p, 70, 70, love.window.getWidth() - 70)
|
love.graphics.printf(p, 70, 70, love.graphics.getWidth() - 70)
|
||||||
love.graphics.present()
|
love.graphics.present()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -1834,8 +1834,8 @@ const unsigned char boot_lua[] =
|
|||||||
0x65, 0x61, 0x72, 0x28, 0x29, 0x0a,
|
0x65, 0x61, 0x72, 0x28, 0x29, 0x0a,
|
||||||
0x09, 0x09, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x73, 0x2e, 0x70, 0x72,
|
0x09, 0x09, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x73, 0x2e, 0x70, 0x72,
|
||||||
0x69, 0x6e, 0x74, 0x66, 0x28, 0x70, 0x2c, 0x20, 0x37, 0x30, 0x2c, 0x20, 0x37, 0x30, 0x2c, 0x20, 0x6c, 0x6f,
|
0x69, 0x6e, 0x74, 0x66, 0x28, 0x70, 0x2c, 0x20, 0x37, 0x30, 0x2c, 0x20, 0x37, 0x30, 0x2c, 0x20, 0x6c, 0x6f,
|
||||||
0x76, 0x65, 0x2e, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x2e, 0x67, 0x65, 0x74, 0x57, 0x69, 0x64, 0x74, 0x68,
|
0x76, 0x65, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x73, 0x2e, 0x67, 0x65, 0x74, 0x57, 0x69, 0x64,
|
||||||
0x28, 0x29, 0x20, 0x2d, 0x20, 0x37, 0x30, 0x29, 0x0a,
|
0x74, 0x68, 0x28, 0x29, 0x20, 0x2d, 0x20, 0x37, 0x30, 0x29, 0x0a,
|
||||||
0x09, 0x09, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x73, 0x2e, 0x70, 0x72,
|
0x09, 0x09, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x73, 0x2e, 0x70, 0x72,
|
||||||
0x65, 0x73, 0x65, 0x6e, 0x74, 0x28, 0x29, 0x0a,
|
0x65, 0x73, 0x65, 0x6e, 0x74, 0x28, 0x29, 0x0a,
|
||||||
0x09, 0x65, 0x6e, 0x64, 0x0a,
|
0x09, 0x65, 0x6e, 0x64, 0x0a,
|
||||||
@@ -1915,8 +1915,8 @@ const unsigned char boot_lua[] =
|
|||||||
0x65, 0x61, 0x72, 0x28, 0x29, 0x0a,
|
0x65, 0x61, 0x72, 0x28, 0x29, 0x0a,
|
||||||
0x09, 0x09, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x73, 0x2e, 0x70, 0x72,
|
0x09, 0x09, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x73, 0x2e, 0x70, 0x72,
|
||||||
0x69, 0x6e, 0x74, 0x66, 0x28, 0x70, 0x2c, 0x20, 0x37, 0x30, 0x2c, 0x20, 0x37, 0x30, 0x2c, 0x20, 0x6c, 0x6f,
|
0x69, 0x6e, 0x74, 0x66, 0x28, 0x70, 0x2c, 0x20, 0x37, 0x30, 0x2c, 0x20, 0x37, 0x30, 0x2c, 0x20, 0x6c, 0x6f,
|
||||||
0x76, 0x65, 0x2e, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x2e, 0x67, 0x65, 0x74, 0x57, 0x69, 0x64, 0x74, 0x68,
|
0x76, 0x65, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x73, 0x2e, 0x67, 0x65, 0x74, 0x57, 0x69, 0x64,
|
||||||
0x28, 0x29, 0x20, 0x2d, 0x20, 0x37, 0x30, 0x29, 0x0a,
|
0x74, 0x68, 0x28, 0x29, 0x20, 0x2d, 0x20, 0x37, 0x30, 0x29, 0x0a,
|
||||||
0x09, 0x09, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x73, 0x2e, 0x70, 0x72,
|
0x09, 0x09, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x73, 0x2e, 0x70, 0x72,
|
||||||
0x65, 0x73, 0x65, 0x6e, 0x74, 0x28, 0x29, 0x0a,
|
0x65, 0x73, 0x65, 0x6e, 0x74, 0x28, 0x29, 0x0a,
|
||||||
0x09, 0x65, 0x6e, 0x64, 0x0a,
|
0x09, 0x65, 0x6e, 0x64, 0x0a,
|
||||||
|
|||||||
Reference in New Issue
Block a user