mirror of
https://github.com/jamessanford/kegs.git
synced 2025-03-06 14:30:09 +00:00
Try using RGB_565 bitmap.
This commit is contained in:
parent
b023e66caf
commit
bd3836e409
@ -188,13 +188,13 @@ x_push_kimage(Kimage *kimage_ptr, int destx, int desty, int srcx, int srcy,
|
||||
int x, y;
|
||||
|
||||
indata += (srcy * in_width) + srcx;
|
||||
pixels = ((char *)pixels + (g_bitmap_info.stride * desty)) + (destx * 4);
|
||||
pixels = ((char *)pixels + (g_bitmap_info.stride * desty)) + (destx * 2);
|
||||
|
||||
for (y=0; y<height; y++) {
|
||||
uint32_t *line = (uint32_t*)pixels;
|
||||
uint16_t *line = (uint16_t*)pixels;
|
||||
inptr = indata;
|
||||
for (x=0; x<width; x++) {
|
||||
line++[0] = palptr[*inptr++];
|
||||
line++[0] = (uint16_t)(palptr[*inptr++]);
|
||||
}
|
||||
pixels = (char *)pixels + g_bitmap_info.stride;
|
||||
indata += in_width;
|
||||
@ -294,8 +294,8 @@ Java_com_froop_app_kegs_KegsView_00024KegsThread_mainLoop( JNIEnv* env, jobject
|
||||
return;
|
||||
}
|
||||
|
||||
if (g_bitmap_info.format != ANDROID_BITMAP_FORMAT_RGBA_8888) {
|
||||
LOGE("Bitmap format must be RGBA_8888");
|
||||
if (g_bitmap_info.format != ANDROID_BITMAP_FORMAT_RGB_565) {
|
||||
LOGE("Bitmap format must be RGB_565");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -3508,12 +3508,18 @@ video_update_color_raw(int col_num, int a2_color)
|
||||
newgreen = green >> g_green_right_shift;
|
||||
newblue = blue >> g_blue_right_shift;
|
||||
|
||||
|
||||
#if 1
|
||||
// jsanford TESTING FIXME
|
||||
// can be even shorter, see above...
|
||||
tmp = 0 + ((red & 0xF8) << (11 - 3)) + ((green & 0xFC) << (5 - 2)) + ((blue & 0xF8) >> 3);
|
||||
#else
|
||||
|
||||
tmp = ((newred & g_red_mask) << g_red_left_shift) +
|
||||
((newgreen & g_green_mask) << g_green_left_shift) +
|
||||
((newblue & g_blue_mask) << g_blue_left_shift);
|
||||
#ifdef __ANDROID__
|
||||
tmp |= 0xFF000000; // Alpha FF.
|
||||
#endif
|
||||
#endif
|
||||
|
||||
g_palette_8to1624[col_num] = tmp;
|
||||
|
@ -45,7 +45,7 @@ class KegsView extends SurfaceView implements SurfaceHolder.Callback {
|
||||
|
||||
mBitmap = Bitmap.createBitmap(BitmapSize.Const.A2Width,
|
||||
BitmapSize.Const.A2Height,
|
||||
Bitmap.Config.ARGB_8888);
|
||||
Bitmap.Config.RGB_565);
|
||||
mBitmap.setHasAlpha(false);
|
||||
|
||||
mBitmapThread.setBitmap(surfaceHolder, mBitmap);
|
||||
|
Loading…
x
Reference in New Issue
Block a user