mirror of
https://github.com/melonDS-emu/melonDS.git
synced 2025-07-23 14:19:55 -06:00
texcoord wrap modes
This commit is contained in:
@ -108,8 +108,35 @@ vec4 TextureLookup()
|
|||||||
int vramaddr = int(attr & 0xFFFF) << 3;
|
int vramaddr = int(attr & 0xFFFF) << 3;
|
||||||
ivec2 st = ivec2(fTexcoord);
|
ivec2 st = ivec2(fTexcoord);
|
||||||
|
|
||||||
st.x &= (tw-1);
|
if ((attr & (1<<16)) != 0)
|
||||||
st.y &= (th-1);
|
{
|
||||||
|
if ((attr & (1<<18)) != 0)
|
||||||
|
{
|
||||||
|
if ((st.x & tw) != 0)
|
||||||
|
st.x = (tw-1) - (st.x & (tw-1));
|
||||||
|
else
|
||||||
|
st.x = (st.x & (tw-1));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
st.x &= (tw-1);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
st.x = clamp(st.x, 0, tw-1);
|
||||||
|
|
||||||
|
if ((attr & (1<<17)) != 0)
|
||||||
|
{
|
||||||
|
if ((attr & (1<<19)) != 0)
|
||||||
|
{
|
||||||
|
if ((st.y & th) != 0)
|
||||||
|
st.y = (th-1) - (st.y & (th-1));
|
||||||
|
else
|
||||||
|
st.y = (st.y & (th-1));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
st.y &= (th-1);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
st.y = clamp(st.y, 0, th-1);
|
||||||
|
|
||||||
uint type = (attr >> 26) & 0x7;
|
uint type = (attr >> 26) & 0x7;
|
||||||
if (type == 4)
|
if (type == 4)
|
||||||
|
Reference in New Issue
Block a user