Advertisement
ZoriaRPG

Colourdata / rgbdata Initial

Jun 7th, 2018
330
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.65 KB | None | 0 0
  1.  
  2. void get_cset(int dataset,int row,RGB *pal)
  3. {
  4.     saved=false;
  5.    
  6.     for(int i=0; i<16; i++)
  7.     {
  8.         colordata[(CSET(dataset)+i)*3]   = pal[(row<<4)+i].r;
  9.         colordata[(CSET(dataset)+i)*3+1] = pal[(row<<4)+i].g;
  10.         colordata[(CSET(dataset)+i)*3+2] = pal[(row<<4)+i].b;
  11.     }
  12. }
  13.  
  14.  
  15. /*
  16.  
  17. RAMpal[i+160] = mixRGB(gfx_pal[color*3],gfx_pal[color*3+1],
  18. gfx_pal[color*3+2],gray,gray,gray,i<<1); //saturation
  19.  
  20. RAMpal[edc] = mixRGB(gfx_pal[color*3],gfx_pal[color*3+1],gfx_pal[color*3+2],gray,gray,gray,ratio);
  21.  
  22. ++RAMpal[14*16+index].g; //.r .g. .b for each hue
  23. _RGB[] is the palette, too.
  24.  
  25. set_palette(RAMpal);
  26.  
  27.  
  28. */
  29.  
  30. void loadfullpal()
  31. {
  32.     for(int i=0; i<240; i++)
  33.         RAMpal[i]=_RGB(colordata+i*3);
  34.        
  35.     for(int i=240; i<255; i++)
  36.         RAMpal[i]=((RGB*)data[PAL_GUI].dat)[i];
  37.        
  38.     refreshpal=true;
  39. }
  40.  
  41. /*
  42. void loadlvlpal(int level)
  43. {
  44.     byte *si = colordata + CSET(level*pdLEVEL+poLEVEL)*3;
  45.    
  46.     for(int i=0; i<16*3; i++)
  47.     {
  48.         RAMpal[CSET(2)+i] = _RGB(si);
  49.         tempgreypal[CSET(2)+i] = _RGB(si); //preserve monochrome
  50.         si+=3;
  51.     }
  52.    
  53.     for(int i=0; i<16; i++)
  54.     {
  55.         RAMpal[CSET(9)+i] = _RGB(si);
  56.         tempgreypal[CSET(9)+i] = _RGB(si); //preserve monochrome
  57.         si+=3;
  58.     }
  59.    
  60.     if(!get_bit(quest_rules,qr_NOLEVEL3FIX) && level==3) {
  61.         RAMpal[CSET(6)+2] = NESpal(0x37);
  62.     tempgreypal[CSET(6)+2] = NESpal(0x37);
  63.     }
  64.        
  65.     create_rgb_table(&rgb_table, RAMpal, NULL);
  66. create_zc_trans_table(&trans_table, RAMpal, 128, 128, 128);
  67. memcpy(&trans_table2, &trans_table, sizeof(COLOR_MAP));
  68.      refreshpal=true;
  69.    
  70.     /*
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement