Advertisement
Guest User

Untitled

a guest
Sep 1st, 2015
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.05 KB | None | 0 0
  1. int AGS_EngineOnEvent (int event, int data) {
  2.   if (event == AGSE_POSTSCREENDRAW) {
  3.     if (clutslot > 0)
  4.     {
  5.         // Get a reference to the screen we'll draw onto
  6.         BITMAP *virtsc = engine->GetVirtualScreen();
  7.         BITMAP *clutspr = engine->GetSpriteGraphic (clutslot);
  8.         BITMAP *rain = engine->GetSpriteGraphic (920);
  9.         // Get its surface, in both 8-bit and 16-bit flavours
  10.         unsigned char **charbuffer = engine->GetRawBitmapSurface (virtsc);
  11.         unsigned char **clutarray = engine->GetRawBitmapSurface (clutspr);
  12.         unsigned char **rainarray = engine->GetRawBitmapSurface (rain);
  13.         // Find out the screen width and colour depth
  14.         int x = 0;
  15.         int y = 0;
  16.         int transamount = 256 * 4;
  17.         while (y < 200)
  18.         {
  19.             while (x < 320)
  20.             {
  21.                 charbuffer[x][y] = clutarray [charbuffer[x][y]][rainarray [x][y+transamount]]; 
  22.                 x++;
  23.             }
  24.             x=0;
  25.             y++;
  26.         }
  27.  
  28.         // Release the screen so that the engine can continue
  29.         engine->ReleaseBitmapSurface (virtsc);
  30.         engine->ReleaseBitmapSurface (clutspr);
  31.         engine->ReleaseBitmapSurface (rain);
  32.     }
  33.     }
  34.   return 0;
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement