diff options
| author | jacob1 <jfu614@gmail.com> | 2013-01-23 21:48:21 (GMT) |
|---|---|---|
| committer | jacob1 <jfu614@gmail.com> | 2013-01-23 21:48:21 (GMT) |
| commit | c5eecff13133bc20987ddc0a52bf133f4dd83d06 (patch) | |
| tree | cb3004debae4be382af56ec6e0113d7ef2aba717 /src/graphics/Renderer.cpp | |
| parent | 7475a49e0b736cd9d710a674bd25dc20bc90e342 (diff) | |
| download | powder-c5eecff13133bc20987ddc0a52bf133f4dd83d06.zip powder-c5eecff13133bc20987ddc0a52bf133f4dd83d06.tar.gz | |
fix "i" argument to graphics functions.
Also, they don't overwrite the default one, you can pass in nil to tpt.element/graphics_func for the function to restore the original.
Diffstat (limited to 'src/graphics/Renderer.cpp')
| -rw-r--r-- | src/graphics/Renderer.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/graphics/Renderer.cpp b/src/graphics/Renderer.cpp index 98b94b1..14a64be 100644 --- a/src/graphics/Renderer.cpp +++ b/src/graphics/Renderer.cpp @@ -15,6 +15,8 @@ #include "simulation/Elements.h" #include "simulation/ElementGraphics.h" #include "simulation/Air.h" +#include "cat/LuaScriptInterface.h" +#include "cat/LuaScriptHelper.h" extern "C" { #include "hmap.h" @@ -1158,7 +1160,11 @@ void Renderer::render_parts() { if (elements[t].Graphics) { - if ((*(elements[t].Graphics))(this, &(sim->parts[i]), nx, ny, &pixel_mode, &cola, &colr, &colg, &colb, &firea, &firer, &fireg, &fireb)) //That's a lot of args, a struct might be better + if (lua_gr_func[t]) + { + luacon_graphicsReplacement(this, &(sim->parts[i]), nx, ny, &pixel_mode, &cola, &colr, &colg, &colb, &firea, &firer, &fireg, &fireb, i); + } + else if ((*(elements[t].Graphics))(this, &(sim->parts[i]), nx, ny, &pixel_mode, &cola, &colr, &colg, &colb, &firea, &firer, &fireg, &fireb)) //That's a lot of args, a struct might be better { graphicscache[t].isready = 1; graphicscache[t].pixel_mode = pixel_mode; |
