ZoriaRPG icon

Colourdata / rgbdata Initial

ZoriaRPG | PRO | 06/07/18 10:21:34 AM UTC | 0 ⭐ | 698 👁️ | Never ⏰ | []
C++ |

1.65 KB

|

None

|

0 👍

/

0 👎

 
void get_cset(int dataset,int row,RGB *pal)
{
    saved=false;
    
    for(int i=0; i<16; i++)
    {
        colordata[(CSET(dataset)+i)*3]   = pal[(row<<4)+i].r;
        colordata[(CSET(dataset)+i)*3+1] = pal[(row<<4)+i].g;
        colordata[(CSET(dataset)+i)*3+2] = pal[(row<<4)+i].b;
    }
}
 
 
/*
 
RAMpal[i+160] = mixRGB(gfx_pal[color*3],gfx_pal[color*3+1],
gfx_pal[color*3+2],gray,gray,gray,i<<1); //saturation
 
RAMpal[edc] = mixRGB(gfx_pal[color*3],gfx_pal[color*3+1],gfx_pal[color*3+2],gray,gray,gray,ratio);
 
++RAMpal[14*16+index].g; //.r .g. .b for each hue
_RGB[] is the palette, too. 
 
set_palette(RAMpal);
 
 
*/
 
void loadfullpal()
{
    for(int i=0; i<240; i++)
        RAMpal[i]=_RGB(colordata+i*3);
        
    for(int i=240; i<255; i++)
        RAMpal[i]=((RGB*)data[PAL_GUI].dat)[i];
        
    refreshpal=true;
}
 
/*
void loadlvlpal(int level)
{
    byte *si = colordata + CSET(level*pdLEVEL+poLEVEL)*3;
    
    for(int i=0; i<16*3; i++)
    {
        RAMpal[CSET(2)+i] = _RGB(si);
        tempgreypal[CSET(2)+i] = _RGB(si); //preserve monochrome
        si+=3;
    }
    
    for(int i=0; i<16; i++)
    {
        RAMpal[CSET(9)+i] = _RGB(si);
        tempgreypal[CSET(9)+i] = _RGB(si); //preserve monochrome
        si+=3;
    }
    
    if(!get_bit(quest_rules,qr_NOLEVEL3FIX) && level==3) {
        RAMpal[CSET(6)+2] = NESpal(0x37);
    tempgreypal[CSET(6)+2] = NESpal(0x37);
    }
        
    create_rgb_table(&rgb_table, RAMpal, NULL);
create_zc_trans_table(&trans_table, RAMpal, 128, 128, 128);
memcpy(&trans_table2, &trans_table, sizeof(COLOR_MAP));
     refreshpal=true;
    
    /*

Comments