Change RGB32k to a union of BYTE[32][32][32] and BYTE[32*32*32]
- Clang's optional runtime array bounds checking doesn't understand when we
intentionally "overflow" by doing this:
RGB32k[0][0][colorval]
It will warn that it was accessed at an index will past the bounds
of type 'BYTE [32]', which makes it less than useful for catching real
array bounds overflows. So now do this:
RGB32k.All[colorval]
And if you want this:
RGB32k[r][g][b]
Now do this:
RGB32k.RGB[r][g][b]
This commit is contained in:
parent
308a036955
commit
e259087c19
13 changed files with 88 additions and 77 deletions
|
|
@ -303,7 +303,7 @@ bool wipe_doBurn (int ticks)
|
|||
DWORD fg = fg2rgb[fromnew[x]];
|
||||
DWORD bg = bg2rgb[fromold[x]];
|
||||
fg = (fg+bg) | 0x1f07c1f;
|
||||
to[x] = RGB32k[0][0][fg & (fg>>15)];
|
||||
to[x] = RGB32k.All[fg & (fg>>15)];
|
||||
done = false;
|
||||
}
|
||||
}
|
||||
|
|
@ -354,7 +354,7 @@ bool wipe_doFade (int ticks)
|
|||
DWORD fg = fg2rgb[fromnew[x]];
|
||||
DWORD bg = bg2rgb[fromold[x]];
|
||||
fg = (fg+bg) | 0x1f07c1f;
|
||||
to[x] = RGB32k[0][0][fg & (fg>>15)];
|
||||
to[x] = RGB32k.All[fg & (fg>>15)];
|
||||
}
|
||||
fromnew += SCREENWIDTH;
|
||||
fromold += SCREENWIDTH;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue