Game Development Reference
In-Depth Information
(*env)->CallStaticVoidMethod(env, jNativesCls
, jSendImageMethod
, jImage
, (jint)x, (jint)y, (jint)w, (jint)h);
}
}
// In file vi_null.c
/****************************************************
* Class XColor
***************************************************/
typedef struct Color XColor;
struct Color
{
int red;
int green;
int blue;
//int pixel;
};
// Pallete
XColor pal[256];
void VL_SetPalette(const byte *palette)
{
int i;
VL_WaitVBL(1);
for (i = 0; i < 256; i++)
{
pal[i].red = palette[i*3+0] << 2;
pal[i].green = palette[i*3+1] << 2;
pal[i].blue = palette[i*3+2] << 2;
}
}
void VW_UpdateScreen()
{
// screen size
int size = vwidth * vheight;
// ARGB pixels
int pixels[size], i;
for ( i = 0 ; i < size ; i ++) {
byte colIdx = gfxbuf[i];
pixels[i] = (0xFF << 24)
| (pal[colIdx].red << 16)
| (pal[colIdx].green << 8)
Search WWH ::




Custom Search