- [CHG] surf.target() i surf.source() sense paràmetres ara el que fan es tornar les surfaces actuals de target i de source
This commit is contained in:
8
lua.cpp
8
lua.cpp
@@ -97,8 +97,8 @@ extern "C" {
|
|||||||
const int numargs = lua_gettop(L);
|
const int numargs = lua_gettop(L);
|
||||||
switch (numargs) {
|
switch (numargs) {
|
||||||
case 0: {
|
case 0: {
|
||||||
setdest(0);
|
lua_pushinteger(L, getdest());
|
||||||
return 0;
|
return 1;
|
||||||
}
|
}
|
||||||
case 1: {
|
case 1: {
|
||||||
uint8_t surface = luaL_checkinteger(L, 1);
|
uint8_t surface = luaL_checkinteger(L, 1);
|
||||||
@@ -114,8 +114,8 @@ extern "C" {
|
|||||||
const int numargs = lua_gettop(L);
|
const int numargs = lua_gettop(L);
|
||||||
switch (numargs) {
|
switch (numargs) {
|
||||||
case 0: {
|
case 0: {
|
||||||
setsource(0);
|
lua_pushinteger(L, getsource());
|
||||||
return 0;
|
return 1;
|
||||||
}
|
}
|
||||||
case 1: {
|
case 1: {
|
||||||
uint8_t surface = luaL_checkinteger(L, 1);
|
uint8_t surface = luaL_checkinteger(L, 1);
|
||||||
|
|||||||
12
mini.cpp
12
mini.cpp
@@ -359,6 +359,18 @@ void setmap(uint8_t surface) {
|
|||||||
map_surface = &surfaces[surface];
|
map_surface = &surfaces[surface];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint8_t getdest()
|
||||||
|
{
|
||||||
|
for (unsigned int i=0; i<MAX_SURFACES; ++i) if (dest_surface == &surfaces[i]) return i;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint8_t getsource()
|
||||||
|
{
|
||||||
|
for (unsigned int i=0; i<MAX_SURFACES; ++i) if (source_surface == &surfaces[i]) return i;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
uint8_t getmap()
|
uint8_t getmap()
|
||||||
{
|
{
|
||||||
for (unsigned int i=0; i<MAX_SURFACES; ++i) if (map_surface == &surfaces[i]) return i;
|
for (unsigned int i=0; i<MAX_SURFACES; ++i) if (map_surface == &surfaces[i]) return i;
|
||||||
|
|||||||
2
mini.h
2
mini.h
@@ -134,6 +134,8 @@ int surfh(uint8_t surface);
|
|||||||
void setdest(uint8_t surface);
|
void setdest(uint8_t surface);
|
||||||
void setsource(uint8_t surface);
|
void setsource(uint8_t surface);
|
||||||
void setmap(uint8_t surface);
|
void setmap(uint8_t surface);
|
||||||
|
uint8_t getdest();
|
||||||
|
uint8_t getsource();
|
||||||
uint8_t getmap();
|
uint8_t getmap();
|
||||||
|
|
||||||
void shader_init(const char* vshader, const char* fshader);
|
void shader_init(const char* vshader, const char* fshader);
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#define MINI_VERSION "1.3.15"
|
#define MINI_VERSION "1.3.16"
|
||||||
|
|||||||
@@ -37,10 +37,18 @@ function surf.free(surface) end
|
|||||||
---Retrieve width and height of surface
|
---Retrieve width and height of surface
|
||||||
function surf.size(surface) end
|
function surf.size(surface) end
|
||||||
|
|
||||||
|
---@return number surface
|
||||||
|
---Get current target surface
|
||||||
|
function surf.target() end
|
||||||
|
|
||||||
---@param surface number
|
---@param surface number
|
||||||
---Set surface as target
|
---Set surface as target
|
||||||
function surf.target(surface) end
|
function surf.target(surface) end
|
||||||
|
|
||||||
|
---@return number surface
|
||||||
|
---Get current source surface
|
||||||
|
function surf.source() end
|
||||||
|
|
||||||
---@param surface number
|
---@param surface number
|
||||||
---Set surface as source
|
---Set surface as source
|
||||||
function surf.source(surface) end
|
function surf.source(surface) end
|
||||||
|
|||||||
Reference in New Issue
Block a user