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:
@ -233,15 +233,17 @@ int main(int argc, char** argv)
|
|||||||
// test player thingo
|
// test player thingo
|
||||||
if (showavatar)
|
if (showavatar)
|
||||||
{
|
{
|
||||||
|
const int plrSz = 32;
|
||||||
|
const int hplrSz = plrSz / 2;
|
||||||
|
|
||||||
plrpos = VecAdd(plrpos, VecScale(stickl.compos, framedelta * 0.5));
|
plrpos = VecAdd(plrpos, VecScale(stickl.compos, framedelta * 0.5));
|
||||||
plrpos.x = pfmod(plrpos.x, rendSize.w);
|
plrpos.x = pfmod(plrpos.x + hplrSz, rendSize.w + plrSz) - hplrSz;
|
||||||
plrpos.y = pfmod(plrpos.y, rendSize.h);
|
plrpos.y = pfmod(plrpos.y + hplrSz, rendSize.h + plrSz) - hplrSz;
|
||||||
|
|
||||||
SetDrawColour(AVATAR);
|
SetDrawColour(AVATAR);
|
||||||
const int plrSz = 32;
|
|
||||||
DrawRect(
|
DrawRect(
|
||||||
(int)plrpos.x - plrSz / 2,
|
(int)plrpos.x - hplrSz,
|
||||||
(int)plrpos.y - plrSz / 2,
|
(int)plrpos.y - hplrSz,
|
||||||
plrSz, plrSz);
|
plrSz, plrSz);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user