Software, Camps, and Music

Hey Folks! Reasonable progress today on the remaining known issues: software item sprites, camp effects redundancy, and sound cut-off.

The software issue turned out to require undoing some of the fixes I tried the other day. That means making the default software rendering value "revealed," so non-hardware items like USB can display them correctly. And as it turns out, hardware items are already checking their contents for revealed status at the end of loading, but were just missing a call to update the sprites accordingly. So that is now working, too. Finally, there was one case in software where the code would try to restore the original sprite before that sprite was defined. I adjusted it not to do this, since it only came up when the sprite was already in original state, so it would've been redundant.

Moving on to camps, I was starting to notice some campsite effects duplicating on the condition screen. This was a bit hard to track down, but appears to be a combo of save/load bugs and switching campsites. Basically, each campsite has a unique condition (different from how conditions usually share a root instance), and this was causing problems with the game removing said unique before adding a new one. In some cases, it would fail to remove and just add another.

I changed the code to keep removing camp conditions until they are gone, instead of relying on the current camp to point to the correct one. This avoids cases where a missing camp causes the code to skip trying to remove that camp's condition.

Coincidentally, there was another bug I found while testing this. Due to the code changes I made the other day to avoid item screen lag, the "available" campsite slot was full of invisible camps. It turns out that I was short-circuiting the slot redraw code too soon, missing the part where it checks if sub-items and stack items need their sprites created. Adjusting this to only skip the slot's sprite generation code, and falling through to the sub-items fixes the issue.

Finally, I started looking at the music cut-off issue. After a bit of testing, it appears that anytime a looped music track reaches the end, the game just stops playing it instead of looping it. This is despite the track having the looped status set to "true."

So far, nothing I do seems to affect it. I'm starting to suspect a bug deep in the audio code. That said, I think the rain and other ambient stuff loops correctly. So it could also just be due to fade-in, or more likely, starting at a non-zero timestamp in the music. I'll have to check that tomorrow.