mirror of
https://github.com/GayPizzaSpecifications/padlab.git
synced 2025-08-03 05:10:56 +00:00
improve avatar wrapping
This commit is contained in:
parent
065fa979f3
commit
505e7b78d1
@ -233,15 +233,17 @@ int main(int argc, char** argv)
|
||||
// test player thingo
|
||||
if (showavatar)
|
||||
{
|
||||
const int plrSz = 32;
|
||||
const int hplrSz = plrSz / 2;
|
||||
|
||||
plrpos = VecAdd(plrpos, VecScale(stickl.compos, framedelta * 0.5));
|
||||
plrpos.x = pfmod(plrpos.x, rendSize.w);
|
||||
plrpos.y = pfmod(plrpos.y, rendSize.h);
|
||||
plrpos.x = pfmod(plrpos.x + hplrSz, rendSize.w + plrSz) - hplrSz;
|
||||
plrpos.y = pfmod(plrpos.y + hplrSz, rendSize.h + plrSz) - hplrSz;
|
||||
|
||||
SetDrawColour(AVATAR);
|
||||
const int plrSz = 32;
|
||||
DrawRect(
|
||||
(int)plrpos.x - plrSz / 2,
|
||||
(int)plrpos.y - plrSz / 2,
|
||||
(int)plrpos.x - hplrSz,
|
||||
(int)plrpos.y - hplrSz,
|
||||
plrSz, plrSz);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user