So I want to make a display mode like the Life Gradient mode for TMP instead, so I edited the files Renderer.cpp, ElementGraphics.h, RenderView.cpp, and LuaScriptInterface.cpp and added the following code to add the display mode:
In renderer.cpp I added:
else if(colour_mode & COLOUR_TMP)
{
gradv = 0.4f;
if (!(sim->parts[i].tmp<5))
q = sqrt((float)sim->parts[i].tmp);
else
q = sim->parts[i].tmp;
colr = colg = colb = sin(gradv*q) * 100 + 128;
cola = 255;
if(pixel_mode & (FIREMODE | PMODE_GLOW))
pixel_mode = (pixel_mode & ~(FIREMODE|PMODE_GLOW)) | PMODE_BLUR;
else if ((pixel_mode & (PMODE_BLEND | PMODE_ADD)) == (PMODE_BLEND | PMODE_ADD))
pixel_mode = (pixel_mode & ~(PMODE_BLEND|PMODE_ADD)) | PMODE_FLAT;
else if (!pixel_mode)
pixel_mode |= PMODE_FLAT;
}
then further down
renderModePresets[11].Name = "TMP Gradient Display";
renderModePresets[11].RenderModes.push_back(RENDER_BASC);
renderModePresets[11].ColourMode = COLOUR_TMP;
which is just the life gradient display mode edited for TMP, in ElementGraphics.h I added:
#define COLOUR_TMP0x00000016
because if I don't add that, I get a not defined error on compile. In RenderView.cpp I added:
renderModePresets[11].Name = "TMP Gradient Display";
renderModePresets[11].RenderModes.push_back(RENDER_BASC);
renderModePresets[11].ColourMode = COLOUR_TMP;
then finally in LuaScriptInterface.cpp i added:
SETCONST(l, COLOUR_TMP);
then it compiles just fine, no errors. However when i go to launch the game, it opens and instantly closes with no errors. So i went and opened it in command like and got this error:
C:/users/alexander/desktop/tpt/build/powder.exe: error while loading shared libraries: ?: cannot open shared object file: No such file or directory
I have no clue what is wrong, any help?
EDIT: I got it working!!!
I forgot:
renderModePresets = new RenderPreset[11];
well i was trying to make a 12 entry, so it got mad!!
Edit 2:
now I have run into another problem: for somereason hitting 9 is turning to heat gradiant mode, however it's not colored anymore. its all grey