Guest User

Untitled

a guest
Jul 17th, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. void SDLStub::copyRect(uint16 x, uint16 y, uint16 w, uint16 h, const uint8 *buf, uint32 pitch) {
  2. buf += y * pitch + x; // Get to data...
  3.  
  4. int idx;
  5.  
  6. for (idx = 0; idx < h; idx++) {
  7. memcpy((uint8*)(_offscreen + ((idx + y) * 320) + x), (uint8*)(buf + (idx * pitch)), w);
  8. }
  9.  
  10. // ASK FOR A SCREEN REBUILD!!!
  11. rebuildGfxScreen();
  12.  
  13. return;
  14. }
  15.  
  16. // Rebuild and show screen
  17. void SDLStub::rebuildGfxScreen(void) {
  18. Uint16 i,j;
  19.  
  20. while (! (dc=lockDisplay()));
  21.  
  22. for(i = 0; i < 200; i++)
  23. for(j = 0; j < 320; j++)
  24. VI_DrawPixel(&dc->conf, j, i, _pal[_offscreen[(i * 320) + j]]);
  25.  
  26. showDisplay(dc);
  27. dc = 0;
  28.  
  29. return;
  30. }
Add Comment
Please, Sign In to add comment