Having issues adding a TMP display

  • Alexwall
    7th Jul 2017 Member 0 Permalink

    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

    Edited 4 times by ajloveslily. Last: 8th Jul 2017
  • zaccybot2
    27th Jul 2017 Member 0 Permalink

    If there is no heat gradient (No difference in the heat between the particles), then of course heat gradient mode is gonna be all grey.

  • jacob2
    27th Jul 2017 Member 0 Permalink
    @zaccybot2 (View Post)
    You are right. But some elements do have tmp gradients. Also, he already figured it out on IRC
  • Alexwall
    27th Jul 2017 Member 0 Permalink

    Yeah sorry to leave the thread hanging, I figured it out with the help of jacob1, I'm dumb and didnt know that 0x08 * 2 is 0x10 not 0x16  derp

    requesting close!

Locked by jacob1: Lock requested