Skip to content

Commit 2995e48

Browse files
committed
Adding a GetDrawLayer function
1 parent 01fb52b commit 2995e48

5 files changed

Lines changed: 16 additions & 0 deletions

File tree

engine/render.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ class r_IRenderer {
6969
virtual void SetClearColor(const col4_t col) = 0;
7070
virtual void SetDrawLayer(int layer, int subLayer = 0) = 0;
7171
virtual void SetDrawSubLayer(int subLayer) = 0;
72+
virtual int GetDrawLayer() = 0;
7273
virtual void SetViewport(int x = 0, int y = 0, int width = 0, int height = 0) = 0;
7374
virtual void DrawColor(const col4_t col = NULL) = 0;
7475
virtual void DrawColor(dword col) = 0;

engine/render/r_main.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -600,6 +600,11 @@ void r_renderer_c::SetDrawSubLayer(int subLayer)
600600
SetDrawLayer(curLayer->layer, subLayer);
601601
}
602602

603+
int r_renderer_c::GetDrawLayer()
604+
{
605+
return curLayer->subLayer;
606+
}
607+
603608
void r_renderer_c::SetViewport(int x, int y, int width, int height)
604609
{
605610
if (height == 0) {

engine/render/r_main.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ class r_renderer_c: public r_IRenderer, public conCmdHandler_c {
6767
void SetClearColor(const col4_t col);
6868
void SetDrawLayer(int layer, int subLayer = 0);
6969
void SetDrawSubLayer(int subLayer);
70+
int GetDrawLayer();
7071
void SetViewport(int x = 0, int y = 0, int width = 0, int height = 0);
7172
void DrawColor(const col4_t col = NULL);
7273
void DrawColor(dword col);

engine/tiff.lib

32.7 KB
Binary file not shown.

ui_api.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
** width, height = GetScreenSize()
3434
** SetClearColor(red, green, blue[, alpha])
3535
** SetDrawLayer({layer|nil}[, subLayer)
36+
** GetDrawLayer()
3637
** SetViewport([x, y, width, height])
3738
** SetDrawColor(red, green, blue[, alpha]) / SetDrawColor("<escapeStr>")
3839
** DrawImage({imgHandle|nil}, left, top, width, height[, tcLeft, tcTop, tcRight, tcBottom])
@@ -308,6 +309,13 @@ static int l_SetDrawLayer(lua_State* L)
308309
return 0;
309310
}
310311

312+
static int l_GetDrawLayer(lua_State* L)
313+
{
314+
ui_main_c* ui = GetUIPtr(L);
315+
lua_pushinteger(L, ui->renderer->GetDrawLayer());
316+
return 1;
317+
}
318+
311319
static int l_SetViewport(lua_State* L)
312320
{
313321
ui_main_c* ui = GetUIPtr(L);
@@ -1175,6 +1183,7 @@ int ui_main_c::InitAPI(lua_State* L)
11751183
ADDFUNC(GetScreenSize);
11761184
ADDFUNC(SetClearColor);
11771185
ADDFUNC(SetDrawLayer);
1186+
ADDFUNC(GetDrawLayer);
11781187
ADDFUNC(SetViewport);
11791188
ADDFUNC(SetDrawColor);
11801189
ADDFUNC(DrawImage);

0 commit comments

Comments
 (0)