Added the next two functions based on Charles Bloom's rant at http://cbloomrants.blogspot.com/2008/12/12-08-08-dxtc-summary.html. This code is by ryg and from the Molly Rocket forums: https://mollyrocket.com/forums/viewtopic.php?t=392.
| 368 | // This code is by ryg and from the Molly Rocket forums: |
| 369 | // https://mollyrocket.com/forums/viewtopic.php?t=392. |
| 370 | static ILint Mul8Bit(ILint a, ILint b) |
| 371 | { |
| 372 | ILint t = a*b + 128; |
| 373 | return (t + (t >> 8)) >> 8; |
| 374 | } |
| 375 | |
| 376 | ILushort As16Bit(ILint r, ILint g, ILint b) |
| 377 | { |