Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void SDLStub::copyRect(uint16 x, uint16 y, uint16 w, uint16 h, const uint8 *buf, uint32 pitch) {
- buf += y * pitch + x; // Get to data...
- int idx;
- for (idx = 0; idx < h; idx++) {
- memcpy((uint8*)(_offscreen + ((idx + y) * 320) + x), (uint8*)(buf + (idx * pitch)), w);
- }
- // ASK FOR A SCREEN REBUILD!!!
- rebuildGfxScreen();
- return;
- }
- // Rebuild and show screen
- void SDLStub::rebuildGfxScreen(void) {
- Uint16 i,j;
- while (! (dc=lockDisplay()));
- for(i = 0; i < 200; i++)
- for(j = 0; j < 320; j++)
- VI_DrawPixel(&dc->conf, j, i, _pal[_offscreen[(i * 320) + j]]);
- showDisplay(dc);
- dc = 0;
- return;
- }
Add Comment
Please, Sign In to add comment