Advertisement
LuigiBlood

osCapConvertToI8_PaintStudio

Sep 24th, 2022
888
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.93 KB | Gaming | 0 0
  1. /* From Mario Artist Paint Studio */
  2. void osCapConvertToI8(byte *capture,byte *dest)
  3.  
  4. {
  5.   int calc;
  6.   byte *pbVar1;
  7.   int y;
  8.   byte *pbVar2;
  9.   int x;
  10.   byte intensity;
  11.  
  12.   capture = capture + 0x4468;
  13.   y = 0xd0;
  14.   do {
  15.     x = 0xc0;
  16.     pbVar1 = dest;
  17.     pbVar2 = capture;
  18.     do {
  19.       calc = (uint)*pbVar2 + ((int)(uint)*pbVar2 >> 2) +
  20.              (uint)pbVar2[1] + ((int)(uint)pbVar2[1] >> 2) +
  21.              (uint)pbVar2[2] + ((int)(uint)pbVar2[2] >> 2) +
  22.              (uint)pbVar2[3] + ((int)(uint)pbVar2[3] >> 2) + -0x82;
  23.       if (calc < 0) {
  24.         calc = 0;
  25.       }
  26.       intensity = (byte)((uint)calc >> 2);
  27.       if (0xff < (uint)calc >> 2) {
  28.         intensity = 0xff;
  29.       }
  30.       x = x + -1;
  31.       *pbVar1 = intensity;
  32.       pbVar2 = pbVar2 + 4;
  33.       pbVar1 = pbVar1 + 1;
  34.     } while (0 < x);
  35.     y = y + -1;
  36.     capture = capture + 0x400;
  37.     dest = dest + 0xc0;
  38.   } while (0 < y);
  39.   return;
  40. }
  41.  
  42.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement