Remove wrap_Canvas and wrap_Image files

This commit is contained in:
Alex Szpakowski
2020-02-04 20:09:46 -04:00
parent 61a5f0c7e2
commit c3b77e0a92
8 changed files with 5 additions and 197 deletions
-45
View File
@@ -1,45 +0,0 @@
/**
* Copyright (c) 2006-2020 LOVE Development Team
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
* arising from the use of this software.
*
* Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you must not
* claim that you wrote the original software. If you use this software
* in a product, an acknowledgment in the product documentation would be
* appreciated but is not required.
* 2. Altered source versions must be plainly marked as such, and must not be
* misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution.
**/
#include "wrap_Canvas.h"
#include "Graphics.h"
namespace love
{
namespace graphics
{
Canvas *luax_checkcanvas(lua_State *L, int idx)
{
return luax_checktype<Canvas>(L, idx);
}
static const luaL_Reg w_Canvas_functions[] =
{
{ 0, 0 }
};
extern "C" int luaopen_canvas(lua_State *L)
{
return luax_register_type(L, &Canvas::type, w_Texture_functions, w_Canvas_functions, nullptr);
}
} // graphics
} // love
-38
View File
@@ -1,38 +0,0 @@
/**
* Copyright (c) 2006-2020 LOVE Development Team
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
* arising from the use of this software.
*
* Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you must not
* claim that you wrote the original software. If you use this software
* in a product, an acknowledgment in the product documentation would be
* appreciated but is not required.
* 2. Altered source versions must be plainly marked as such, and must not be
* misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution.
**/
#pragma once
// LOVE
#include "common/runtime.h"
#include "Canvas.h"
#include "wrap_Texture.h"
namespace love
{
namespace graphics
{
//see Canvas.h
Canvas *luax_checkcanvas(lua_State *L, int idx);
extern "C" int luaopen_canvas(lua_State *L);
} // graphics
} // love
+4 -6
View File
@@ -249,7 +249,7 @@ int w_getDPIScale(lua_State *L)
static Graphics::RenderTarget checkRenderTarget(lua_State *L, int idx)
{
lua_rawgeti(L, idx, 1);
Graphics::RenderTarget target(luax_checkcanvas(L, -1), 0);
Graphics::RenderTarget target(luax_checktexture(L, -1), 0);
lua_pop(L, 1);
TextureType type = target.texture->getTextureType();
@@ -292,7 +292,7 @@ int w_setCanvas(lua_State *L)
targets.colors.push_back(checkRenderTarget(L, -1));
else
{
targets.colors.emplace_back(luax_checkcanvas(L, -1), 0);
targets.colors.emplace_back(luax_checktexture(L, -1), 0);
if (targets.colors.back().texture->getTextureType() != TEXTURE_2D)
return luaL_error(L, "Non-2D canvases must use the table-of-tables variant of setCanvas.");
@@ -311,7 +311,7 @@ int w_setCanvas(lua_State *L)
else if (dstype == LUA_TBOOLEAN)
targets.temporaryRTFlags |= luax_toboolean(L, -1) ? (tempdepthflag | tempstencilflag) : 0;
else if (dstype != LUA_TNONE && dstype != LUA_TNIL)
targets.depthStencil.texture = luax_checkcanvas(L, -1);
targets.depthStencil.texture = luax_checktexture(L, -1);
lua_pop(L, 1);
if (targets.depthStencil.texture == nullptr && (targets.temporaryRTFlags & tempdepthflag) == 0)
@@ -324,7 +324,7 @@ int w_setCanvas(lua_State *L)
{
for (int i = 1; i <= lua_gettop(L); i++)
{
Graphics::RenderTarget target(luax_checkcanvas(L, i), 0);
Graphics::RenderTarget target(luax_checktexture(L, i), 0);
TextureType type = target.texture->getTextureType();
if (i == 1 && type != TEXTURE_2D)
@@ -3123,11 +3123,9 @@ static const lua_CFunction types[] =
luaopen_drawable,
luaopen_texture,
luaopen_font,
luaopen_image,
luaopen_quad,
luaopen_spritebatch,
luaopen_particlesystem,
luaopen_canvas,
luaopen_shader,
luaopen_mesh,
luaopen_text,
+1 -2
View File
@@ -23,11 +23,10 @@
// LOVE
#include "common/config.h"
#include "wrap_Font.h"
#include "wrap_Image.h"
#include "wrap_Texture.h"
#include "wrap_Quad.h"
#include "wrap_SpriteBatch.h"
#include "wrap_ParticleSystem.h"
#include "wrap_Canvas.h"
#include "wrap_Shader.h"
#include "wrap_Mesh.h"
#include "wrap_Text.h"
-45
View File
@@ -1,45 +0,0 @@
/**
* Copyright (c) 2006-2020 LOVE Development Team
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
* arising from the use of this software.
*
* Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you must not
* claim that you wrote the original software. If you use this software
* in a product, an acknowledgment in the product documentation would be
* appreciated but is not required.
* 2. Altered source versions must be plainly marked as such, and must not be
* misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution.
**/
// LOVE
#include "wrap_Image.h"
namespace love
{
namespace graphics
{
Image *luax_checkimage(lua_State *L, int idx)
{
return luax_checktype<Image>(L, idx);
}
static const luaL_Reg w_Image_functions[] =
{
{ 0, 0 }
};
extern "C" int luaopen_image(lua_State *L)
{
return luax_register_type(L, &Image::type, w_Texture_functions, w_Image_functions, nullptr);
}
} // graphics
} // love
-37
View File
@@ -1,37 +0,0 @@
/**
* Copyright (c) 2006-2020 LOVE Development Team
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
* arising from the use of this software.
*
* Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you must not
* claim that you wrote the original software. If you use this software
* in a product, an acknowledgment in the product documentation would be
* appreciated but is not required.
* 2. Altered source versions must be plainly marked as such, and must not be
* misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution.
**/
#pragma once
// LOVE
#include "common/runtime.h"
#include "Image.h"
#include "wrap_Texture.h"
namespace love
{
namespace graphics
{
Image *luax_checkimage(lua_State *L, int idx);
extern "C" int luaopen_image(lua_State *L);
} // graphics
} // love