"@Dick can you make it so that its impossible to pan the floor texture in 2d mode if the texture isnt visible?"

git-svn-id: https://svn.eduke32.com/eduke32@6988 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2018-09-29 01:54:58 +00:00
parent dd1058c767
commit a8cee68a7e

View file

@ -7562,53 +7562,56 @@ static void Keys2d(void)
} }
} }
for (k=0; k<2; k++) // panning/repeat if (graphicsmode)
{ {
if (k==0) for (k=0; k<2; k++) // panning/repeat
j = (keystatus[KEYSC_gLEFT]<<1)|keystatus[KEYSC_gRIGHT]; // 4 & 6 (keypad 2D)
else
j = (keystatus[KEYSC_gUP]<<1)|keystatus[KEYSC_gDOWN]; // 2 & 8 (keypad 2D)
if (j)
{ {
smooshy = keystatus[KEYSC_gKP5]; if (k==0)
j = (keystatus[KEYSC_gLEFT]<<1)|keystatus[KEYSC_gRIGHT]; // 4 & 6 (keypad 2D)
else
j = (keystatus[KEYSC_gUP]<<1)|keystatus[KEYSC_gDOWN]; // 2 & 8 (keypad 2D)
if (repeatcnt[k] == 0 || repeatcnt[k] > 32) if (j)
{ {
changedir = 1-(j&2); smooshy = keystatus[KEYSC_gKP5];
if ((ppointhighlight&0xc000) == 16384 && (sprite[cursprite].cstat & 48)) if (repeatcnt[k] == 0 || repeatcnt[k] > 32)
{ {
uint8_t *repeat = (k==0) ? &sprite[cursprite].xrepeat : &sprite[cursprite].yrepeat; changedir = 1-(j&2);
*repeat = max(4, changechar(*repeat, changedir, smooshy, 1));
silentmessage("Sprite %d repeat: %d, %d", cursprite,
TrackerCast(sprite[cursprite].xrepeat),
TrackerCast(sprite[cursprite].yrepeat));
}
else
{
i = tcursectornum;
if (i >= 0) if ((ppointhighlight&0xc000) == 16384 && (sprite[cursprite].cstat & 48))
{
uint8_t *repeat = (k==0) ? &sprite[cursprite].xrepeat : &sprite[cursprite].yrepeat;
*repeat = max(4, changechar(*repeat, changedir, smooshy, 1));
silentmessage("Sprite %d repeat: %d, %d", cursprite,
TrackerCast(sprite[cursprite].xrepeat),
TrackerCast(sprite[cursprite].yrepeat));
}
else
{
i = tcursectornum;
if (i >= 0)
#ifdef YAX_ENABLE #ifdef YAX_ENABLE
if (k==1 || yax_getbunch(i, YAX_FLOOR) < 0) if (k==1 || yax_getbunch(i, YAX_FLOOR) < 0)
#endif #endif
{ {
uint8_t *panning = (k==0) ? &sector[i].floorxpanning : &sector[i].floorypanning; uint8_t *panning = (k==0) ? &sector[i].floorxpanning : &sector[i].floorypanning;
*panning = changechar(*panning, changedir, smooshy, 0); *panning = changechar(*panning, changedir, smooshy, 0);
silentmessage("Sector %d floor panning: %d, %d", searchsector, silentmessage("Sector %d floor panning: %d, %d", searchsector,
TrackerCast(sector[i].floorxpanning), TrackerCast(sector[i].floorxpanning),
TrackerCast(sector[i].floorypanning)); TrackerCast(sector[i].floorypanning));
} }
} }
asksave = 1; asksave = 1;
repeatcnt[k] = max(1,repeatcnt[k]-2); repeatcnt[k] = max(1, repeatcnt[k]-2);
}
repeatcnt[k] += synctics;
} }
repeatcnt[k] += synctics; else
repeatcnt[k] = 0;
} }
else
repeatcnt[k] = 0;
} }
if (PRESSED_KEYSC(R)) // R (relative alignment, rotation) if (PRESSED_KEYSC(R)) // R (relative alignment, rotation)