Skip to content

Commit dc10ffa

Browse files
committed
Adjusted a couple loops
The loops have been adjusted to get their main pointer outside of the loop, and instead just increment to the next slot inside of the loop.
1 parent 29136b0 commit dc10ffa

File tree

3 files changed

+20
-16
lines changed

3 files changed

+20
-16
lines changed

ttyd-tools/rel/source/draw.cpp

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3101,9 +3101,7 @@ void drawCheatsResolveFades()
31013101
{
31023102
// Check if the current fade is active
31033103
ttyd::fadedrv::FadeEntry *FadeEntry = &FadeWork->entry[i];
3104-
bool FadeIsActive = FadeEntry->flags & (1 << 0); // Check if 0 bit is active
3105-
3106-
if (FadeIsActive)
3104+
if (FadeEntry->flags & (1 << 0)) // Check if 0 bit is active
31073105
{
31083106
sprintf(tempDisplayBuffer,
31093107
"%" PRId32,
@@ -3118,7 +3116,6 @@ void drawCheatsResolveFades()
31183116
Color = 0x4B4B4BFF;
31193117
drawText(String, PosX, PosY, Alpha, Color, Scale);
31203118
}
3121-
31223119
PosY -= 20;
31233120
}
31243121
}
@@ -4556,23 +4553,25 @@ void drawActionCommandsTiming()
45564553

45574554
void drawEffsActive()
45584555
{
4559-
uint32_t Color = 0xFFFFFFFF;
4560-
uint8_t Alpha = 0xFF;
4561-
int32_t PosX = -232;
4562-
int32_t PosY = 60;
4563-
float Scale = 0.75;
4556+
uint32_t Color = 0xFFFFFFFF;
4557+
uint8_t Alpha = 0xFF;
4558+
int32_t PosX = -232;
4559+
int32_t PosY = 60;
4560+
float Scale = 0.75;
45644561

45654562
// Get the total amount of effs active
45664563
ttyd::effdrv::EffWork *EffWrk = ttyd::effdrv::effWorkPointer;
45674564
uint32_t MaxEntries = EffWrk->maxEntries;
45684565
uint32_t CurrentCount = 0;
45694566

4567+
ttyd::effdrv::EffEntry *EffEntry = &EffWrk->pEntries[0];
45704568
for (uint32_t i = 0; i < MaxEntries; i++)
45714569
{
4572-
if (EffWrk->pEntries[i].wFlags)
4570+
if (EffEntry->wFlags)
45734571
{
45744572
CurrentCount++;
45754573
}
4574+
EffEntry++;
45764575
}
45774576

45784577
// Draw the total amount of effs active out of the max

ttyd-tools/rel/source/global.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
namespace mod {
55

6-
const char *VersionNumber = "v3.0.45";
6+
const char *VersionNumber = "v3.0.46";
77

88
const char *RootLines[] =
99
{

ttyd-tools/rel/source/menufunctions.cpp

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3749,13 +3749,15 @@ void *initStageEvents()
37493749
const ttyd::event::EventStageDescription *Stage = ttyd::event::eventStgDtPtr(s);
37503750
int32_t lastEvent = (s == StageId ? EventId : (Stage->eventCount - 1));
37513751

3752+
const ttyd::event::EventStageEventDescription *TargetEvent = &Stage->pEvents[0];
37523753
for (int32_t e = 0; e <= lastEvent; ++e)
37533754
{
3754-
void (*initFunction)() = Stage->pEvents[e].pfnInit;
3755+
void (*initFunction)() = TargetEvent->pfnInit;
37553756
if (initFunction)
37563757
{
37573758
initFunction();
37583759
}
3760+
TargetEvent++;
37593761
}
37603762
}
37613763

@@ -4025,16 +4027,19 @@ bool getSequenceStageAndEvent(const char *arrayOut[2], uint32_t sequencePosition
40254027
for (int32_t i = 0; i < NumberOfStages; ++i)
40264028
{
40274029
const ttyd::event::EventStageDescription *StageDesc = ttyd::event::eventStgDtPtr(i);
4028-
for (int32_t j = 0; j < StageDesc->eventCount; ++j)
4030+
int32_t EventCount = StageDesc->eventCount;
4031+
4032+
const ttyd::event::EventStageEventDescription *EventDesc = &StageDesc->pEvents[0];
4033+
for (int32_t j = 0; j < EventCount; ++j)
40294034
{
4030-
const ttyd::event::EventStageEventDescription &EventDesc = StageDesc->pEvents[j];
4031-
if (EventDesc.gsw0 >= tempSequencePosition)
4035+
if (EventDesc->gsw0 >= tempSequencePosition)
40324036
{
40334037
StageName = StageDesc->nameEn;
4034-
EventName = EventDesc.nameEn;
4038+
EventName = EventDesc->nameEn;
40354039
FoundName = true;
40364040
break;
40374041
}
4042+
EventDesc++;
40384043
}
40394044

40404045
if (FoundName)

0 commit comments

Comments
 (0)