mirror of
https://github.com/bsnes-emu/bsnes.git
synced 2025-08-21 05:01:35 +02:00
Update to v094r27 release.
byuu says: Added AWJ's fixes for alt/cpu (Tetris Attack framelines issue) and alt/dsp (Thread::clock reset) Added fix so that the taskbar entry appears when the application first starts on Windows. Fixed checkbox toggling inside of list views on Windows. Updated nall/image to properly protect variables that should not be written externally. New Object syntax for hiro is in. Fixed the backwards-typing on Windows with the state manager. NOTE: the list view isn't redrawing when you change the description text. It does so on the cheat editor because of the resizeColumns call; but that shouldn't be necessary. I'll try and fix this for the next WIP.
This commit is contained in:
@@ -3,57 +3,57 @@
|
||||
|
||||
namespace nall {
|
||||
|
||||
void image::isplit(uint64_t* c, uint64_t color) {
|
||||
c[0] = (color & alpha.mask) >> alpha.shift;
|
||||
c[1] = (color & red.mask ) >> red.shift;
|
||||
c[2] = (color & green.mask) >> green.shift;
|
||||
c[3] = (color & blue.mask ) >> blue.shift;
|
||||
auto image::isplit(uint64_t* c, uint64_t color) -> void {
|
||||
c[0] = (color & _alpha.mask()) >> _alpha.shift();
|
||||
c[1] = (color & _red.mask() ) >> _red.shift();
|
||||
c[2] = (color & _green.mask()) >> _green.shift();
|
||||
c[3] = (color & _blue.mask() ) >> _blue.shift();
|
||||
}
|
||||
|
||||
uint64_t image::imerge(const uint64_t* c) {
|
||||
return c[0] << alpha.shift | c[1] << red.shift | c[2] << green.shift | c[3] << blue.shift;
|
||||
auto image::imerge(const uint64_t* c) -> uint64_t {
|
||||
return c[0] << _alpha.shift() | c[1] << _red.shift() | c[2] << _green.shift() | c[3] << _blue.shift();
|
||||
}
|
||||
|
||||
uint64_t image::interpolate1f(uint64_t a, uint64_t b, double x) {
|
||||
auto image::interpolate1f(uint64_t a, uint64_t b, double x) -> uint64_t {
|
||||
return a * (1.0 - x) + b * x;
|
||||
}
|
||||
|
||||
uint64_t image::interpolate1f(uint64_t a, uint64_t b, uint64_t c, uint64_t d, double x, double y) {
|
||||
auto image::interpolate1f(uint64_t a, uint64_t b, uint64_t c, uint64_t d, double x, double y) -> uint64_t {
|
||||
return a * (1.0 - x) * (1.0 - y) + b * x * (1.0 - y) + c * (1.0 - x) * y + d * x * y;
|
||||
}
|
||||
|
||||
uint64_t image::interpolate1i(int64_t a, int64_t b, uint32_t x) {
|
||||
auto image::interpolate1i(int64_t a, int64_t b, uint32_t x) -> uint64_t {
|
||||
return a + (((b - a) * x) >> 32); //a + (b - a) * x
|
||||
}
|
||||
|
||||
uint64_t image::interpolate1i(int64_t a, int64_t b, int64_t c, int64_t d, uint32_t x, uint32_t y) {
|
||||
auto image::interpolate1i(int64_t a, int64_t b, int64_t c, int64_t d, uint32_t x, uint32_t y) -> uint64_t {
|
||||
a = a + (((b - a) * x) >> 32); //a + (b - a) * x
|
||||
c = c + (((d - c) * x) >> 32); //c + (d - c) * x
|
||||
return a + (((c - a) * y) >> 32); //a + (c - a) * y
|
||||
}
|
||||
|
||||
uint64_t image::interpolate4f(uint64_t a, uint64_t b, double x) {
|
||||
auto image::interpolate4f(uint64_t a, uint64_t b, double x) -> uint64_t {
|
||||
uint64_t o[4], pa[4], pb[4];
|
||||
isplit(pa, a), isplit(pb, b);
|
||||
for(unsigned n = 0; n < 4; n++) o[n] = interpolate1f(pa[n], pb[n], x);
|
||||
return imerge(o);
|
||||
}
|
||||
|
||||
uint64_t image::interpolate4f(uint64_t a, uint64_t b, uint64_t c, uint64_t d, double x, double y) {
|
||||
auto image::interpolate4f(uint64_t a, uint64_t b, uint64_t c, uint64_t d, double x, double y) -> uint64_t {
|
||||
uint64_t o[4], pa[4], pb[4], pc[4], pd[4];
|
||||
isplit(pa, a), isplit(pb, b), isplit(pc, c), isplit(pd, d);
|
||||
for(unsigned n = 0; n < 4; n++) o[n] = interpolate1f(pa[n], pb[n], pc[n], pd[n], x, y);
|
||||
return imerge(o);
|
||||
}
|
||||
|
||||
uint64_t image::interpolate4i(uint64_t a, uint64_t b, uint32_t x) {
|
||||
auto image::interpolate4i(uint64_t a, uint64_t b, uint32_t x) -> uint64_t {
|
||||
uint64_t o[4], pa[4], pb[4];
|
||||
isplit(pa, a), isplit(pb, b);
|
||||
for(unsigned n = 0; n < 4; n++) o[n] = interpolate1i(pa[n], pb[n], x);
|
||||
return imerge(o);
|
||||
}
|
||||
|
||||
uint64_t image::interpolate4i(uint64_t a, uint64_t b, uint64_t c, uint64_t d, uint32_t x, uint32_t y) {
|
||||
auto image::interpolate4i(uint64_t a, uint64_t b, uint64_t c, uint64_t d, uint32_t x, uint32_t y) -> uint64_t {
|
||||
uint64_t o[4], pa[4], pb[4], pc[4], pd[4];
|
||||
isplit(pa, a), isplit(pb, b), isplit(pc, c), isplit(pd, d);
|
||||
for(unsigned n = 0; n < 4; n++) o[n] = interpolate1i(pa[n], pb[n], pc[n], pd[n], x, y);
|
||||
|
Reference in New Issue
Block a user