Skip to content

Commit

Permalink
Fix issue not pulling in new data if blitting similar images.
Browse files Browse the repository at this point in the history
  • Loading branch information
cnlohr committed May 12, 2024
1 parent ce81fa8 commit b4ed509
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
3 changes: 2 additions & 1 deletion CNFGXDriver.c
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,7 @@ void CNFGBlitImage( uint32_t * data, int x, int y, int w, int h )
lw = w;
lh = h;
}
xi->data = (char*)data;
//Draw image to pixmap (not a screen flip)
XPutImage(CNFGDisplay, CNFGPixmap, CNFGGC, xi, 0, 0, x, y, w, h );
}
Expand All @@ -556,7 +557,7 @@ void CNFGUpdateScreenWithBitmap( uint32_t * data, int w, int h )
lw = w;
lh = h;
}

xi->data = (char*)data;
//Directly write image to screen (effectively a flip)
XPutImage(CNFGDisplay, CNFGWindow, CNFGWindowGC, xi, 0, 0, 0, 0, w, h );
}
Expand Down
13 changes: 7 additions & 6 deletions rawdraw_sf.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//This file was automatically generated by Makefile at https://github.com/cntools/rawdraw
//Generated from files git hash d810add50f84bb8dd81b456d81c68c483d58aa70 on Mon Apr 29 05:11:01 PM EDT 2024 (This is not the git hash of this file)
//Generated from files git hash ce81fa80a8ae034546fa93b392b282fe9815319c on Sat May 11 07:49:24 PM PDT 2024 (This is not the git hash of this file)
// Copyright 2010-2021 <>< CNLohr, et. al. (Several other authors, many but not all mentioned)
// Licensed under the MIT/x11 or NewBSD License you choose.
//
Expand Down Expand Up @@ -4887,7 +4887,7 @@ int CNFGSetup( const char * WindowName, int w, int h )
while( !OGLESStarted )
{
struct android_poll_source* source;
if (ALooper_pollAll( 0, 0, &events, (void**)&source) >= 0)
if (ALooper_pollOnce( 0, 0, &events, (void**)&source) >= 0)
{
if (source != NULL) source->process(gapp, source);
}
Expand Down Expand Up @@ -5121,7 +5121,7 @@ int CNFGHandleInput()
#ifdef ANDROID
int events;
struct android_poll_source* source;
while( ALooper_pollAll( 0, 0, &events, (void**)&source) >= 0 )
while( ALooper_pollOnce( 0, 0, &events, (void**)&source) >= 0 )
{
if (source != NULL)
{
Expand Down Expand Up @@ -5161,8 +5161,8 @@ void handle_cmd(struct android_app* app, int32_t cmd)
{
case APP_CMD_DESTROY:
//This gets called initially after back.
if( !HandleDestroy() )
ANativeActivity_finish( gapp->activity );
HandleDestroy();
ANativeActivity_finish( gapp->activity );
break;
case APP_CMD_INIT_WINDOW:
//When returning from a back button suspension, this isn't called.
Expand Down Expand Up @@ -6071,6 +6071,7 @@ void CNFGBlitImage( uint32_t * data, int x, int y, int w, int h )
lw = w;
lh = h;
}
xi->data = (char*)data;
//Draw image to pixmap (not a screen flip)
XPutImage(CNFGDisplay, CNFGPixmap, CNFGGC, xi, 0, 0, x, y, w, h );
}
Expand All @@ -6087,7 +6088,7 @@ void CNFGUpdateScreenWithBitmap( uint32_t * data, int w, int h )
lw = w;
lh = h;
}

xi->data = (char*)data;
//Directly write image to screen (effectively a flip)
XPutImage(CNFGDisplay, CNFGWindow, CNFGWindowGC, xi, 0, 0, 0, 0, w, h );
}
Expand Down

0 comments on commit b4ed509

Please sign in to comment.