add more functions (not used yet) and fix linux

develop
Warmist 2017-10-21 14:07:07 +03:00
parent e48e2e6534
commit 6a65ad2fcb
1 changed files with 21 additions and 2 deletions

@ -12,6 +12,8 @@
#include "df/init.h"
#include "df/renderer.h"
#include "df/graphic.h"
#include "df/enabler.h"
#include "df/map_renderer.h"
using std::string;
using std::vector;
@ -23,6 +25,7 @@ REQUIRE_GLOBAL(window_x)
REQUIRE_GLOBAL(window_y)
REQUIRE_GLOBAL(window_z)
REQUIRE_GLOBAL_NO_USE(gps)
REQUIRE_GLOBAL_NO_USE(enabler)
#ifdef WIN32
// On Windows there's no convert_magenta parameter. Arguments are pushed onto stack,
@ -34,15 +37,31 @@ REQUIRE_GLOBAL_NO_USE(gps)
typedef void(_stdcall *RENDER_UPDOWN)();
RENDER_MAP _render_map;
RENDER_UPDOWN _render_updown;
LOAD_MULTI_PDIM _load_multi_pdim;
void render_map(){ _render_map(0); }
void render_updown() { _render_updown(); }
void load_tileset(const string &filename, long * tex_pos, long dimx, long dimy, long* disp_x,long* disp_y) {
_load_multi_pdim(tex_pos, filename, &df::global::enabler->textures, dimx, dimy, disp_x, disp_y);
}
#else
REQUIRE_GLOBAL_NO_USE(map_renderer)
typedef void(*LOAD_MULTI_PDIM)(void *tex, const string &filename, long *tex_pos, long dimx, long dimy, bool convert_magenta, long *disp_x, long *disp_y);
typedef void(*RENDER_MAP)(void*, int);
typedef void(*RENDER_UPDOWN)(void*);
RENDER_MAP _render_map;
void render_map(){ _render_map(); }
RENDER_MAP _render_map;
RENDER_UPDOWN _render_updown;
LOAD_MULTI_PDIM _load_multi_pdim;
void render_map(){ _render_map(df::global::map_renderer,0); }
void render_updown() { _render_updown(df::global::map_renderer); }
void load_tileset(const string &filename, long * tex_pos, long dimx, long dimy, long* disp_x, long* disp_y) {
_load_multi_pdim(&df::global::enabler->textures, filename,tex_pos, &df::global::enabler->textures, dimx, dimy,true, disp_x, disp_y);
}
#endif
static int render_map_rect(lua_State* L)
{