Need help with new display mode...

  • me4502
    2nd Jul 2011 Member 0 Permalink
    I am trying to make a clone display where the clone is the colour of its seleted element... this is my code

    if (cmode == CM_CLONE){
    if (t==PT_CLNE||t==PT_BCLN||t==PT_PCLN||t==PT_PBCN||t==PT_GSCL||t==PT_LQCL||t==PT_PDCL){
    if (parts[i].ctype){
    int r = ( ptypes[parts[i].ctype].pcolors >> 16 ) & 0xFF;
    int g = ( ptypes[parts[i].ctype].pcolors >> 8 ) & 0xFF;
    int b = ptypes[parts[i].ctype].pcolors & 0xFF;
    parts[i].dcolour = (r,g,b); - Is usually blendpixel but I tested this...
    }
    }
    }

    nothing happens...

    Thanks
    Edited by me4502, 2011-06-30 13:40:46
  • boxmein
    2nd Jul 2011 Former Staff 0 Permalink
    Is parts[i].ctype a boolean? Cause I think this may be it.
  • airstrike52
    2nd Jul 2011 Member 0 Permalink
    Comment deleted by user
  • me4502
    2nd Jul 2011 Member 0 Permalink
    @boxmein

    it didnt work even without it... i just added it so that it wont run useless code... also that will return true if the integer has a value and 0 is not a value so it shoudl work anyway...
  • boxmein
    2nd Jul 2011 Former Staff 0 Permalink
    Hm. Has it worked before? If yes, then I don't know about it. If no, try if(parts[i].ctype != 0)
  • me4502
    2nd Jul 2011 Member 0 Permalink
    @boxmein (View Post)
    I've used it before and it's in clne's code... It doesn't work without it though...
  • boxmein
    2nd Jul 2011 Former Staff 0 Permalink
    As I see, it doesn't work with it aswell.
  • DerpLord
    2nd Jul 2011 Member 0 Permalink
    Sorry, but is that all the code? "parts" doesn't seem to be declared anywhere, nor does "i".

    i Appears to be some kind of index, yet I don't see any loops.
  • boxmein
    2nd Jul 2011 Former Staff 0 Permalink
    @DerpLord
    The main loop takes care of this.
    I is an index.
    Parts is declared in the main powder source file.
  • me4502
    2nd Jul 2011 Member 0 Permalink
    parts is a struct in powder.h that stores the particle variables
    Ptypes is another struct

    I am getting the colour of the particles ctype in this code but it is not displaying