This commit properly returns you to the correct pack when leaving a folder or returning from another screen.
This is achieved by returning you to your last open section. Previously behavior searched for the first instance of the song in your sort and put you in that section.
Encapsulate actor resize functionality.
Significant performance improvement on the `UpdateAnimationState` function which was bottlenecking many operations.
See ITGmania PR #253 for more information.
1) Set a buffer of 2MB instead of setting the buffer to nullptr and depend on it being grown by assets being loaded at the game launch
2) Update some C style code to C++ style
3) Improve Extend feature to support handling a larger number of samples, and error handling in case of a memory allocation failure
Dynamic linking against libbz2 was problematic on some distributions.
We only needed it for pcre's CLI (which we don't use) and ffmpeg's mkv
decompression in case a user forced encoder to use it, because its usage
is discouraged by the standard.
See https://github.com/itgmania/itgmania/issues/217 for the related
discussion.
When any scaling other than 100% is set for a display, Windows will
automatically scale any DPI unaware applications. This leads to ITGmania being
unusable in fullscreen mode, as parts of the screen are cut off. Add a DPI
aware indication to the manifest to prevent this from happening. Note that
ITGmania won't actually adjust its rendering to the new DPI, it will just
prevent the automatic scaling.
Since the ShowMouseCursor preference exists we don't want to force hiding the mouse cursor when full screened. Instead let the user/theme decide with ShowMouseCursor.
Nothing major here - updating C style casts, moving repeated function calls into variables, changing lrint's...
**RageSound.cpp**
- Initialize m_pSource to nullptr in the member initializer list, rather than in the body of the constructor
- Define an undefined variable `iSourceFrame`
- Change a `lrint` to a `static_cast<int>+0.5`
- Implement missing error handling in `SetStopModeFromString` with a log message
**RageSoundManager**
- Combined the iterator increment and the erase operation for `Update` into one line to prevent needing to create the `next` variable, since GameLoop calls this method frequently
**RageSoundReader**
- This method is called from RageSound just after making sure iFrames isn't equal to 0, so it's not needed for RageSoundReader to do it again.
- We will never fail to read a file 100 times. If we do, it's because of I/O errors, so make that more clear.
This resolves the following issues with DWI format simfiles:
- DWI files containing valid charts may fail to load and appear to have 0 or 1 notes
- DWI files opened in the editor would not save the original contents of the chart into a new file
I moved the logic for getting the new screen name into a separate function GetNewScreenName(), for the sake of containing the logic for getting the new screen name in one place.
I tried some different optimizations for GetNewScreenName(), however none of them were much of a performance savings over the original code, if any, when viewed in a disassembler, so I ultimately chose to keep the original code.
This is what really causes problems when alt-tabbing in and out of the game, with OBS, etc.
ITGmania uses less than 5% CPU usage on my 10 year old CPU. I can leave ITGmania running in the background with assist tick going and no notes are getting lost or stuttering.
It's not really worth shifting all the threads to a lower priority in the name of saving resources, considering how few resources the game consumes.
A problem with using std::accumulate to calculate the mean is that small numbers get rounded down to zero when dealing with floating point numbers. This is solved by implementing the Kahan summation algorithm (https://en.wikipedia.org/wiki/Kahan_summation_algorithm).
The content of src/archutils/Darwin/VectorHelper.cpp is very old, these are AltiVec and SSE2 instructions. This is only actually used in RageSoundMixBuffer.cpp. This level of micro-optimization is not needed since platforms this old are not supported by ITGm.
NTpad is a driver for Windows 2000/XP which enables the use of a controller via the parallel port. This is not needed anymore and is just causing lag by constantly scanning the list of input devices on Windows.
Summary of changes
1) Fix issues in RageTimer and RageSoundPosMap
2) Calculate seconds from microseconds more accurately
3) Replace lrint(x) with static_cast<int>(x+0.5) for better performance
4) Replace C style casting with C++ style casting
5) Make important values 64-bit wide
6) Update RageUtil.cpp (timer conversion RStrings had some math which needed to be fixed after fixing RageTimer's math)
7) Ensure floating point math is done as floating point
8) Improve code commentary all around
9) Improve clarity and efficiency of RageSoundPosMap "return closest position" error logging
Mainloop lock needs to be held to access PulseAudio object from outside the
event loop thread, in particular in GetPosition() calls. Otherwise we might hit
a race condition and have the call fail. There's also a possibility that the
call might randomly fail if it's called before first timing data is received
for the stream, so handle that case as well.
Also fix the stream write callback to call Mix() with correct parameters, as
well as do the work in a loop in case pa_stream_begin_write() returns smaller
memory buffer than was requested.
Enforcing HIGH_PRIORITY_CLASS is best for Win10+ where Windows Update can interrupt the game and it also prevents streaming apps (OBS/Discord) from causing stutter by taking rendering priority away from ITGMania.
Update ArchHooks_Win32.cpp
Update ArchHooks_Win32Static.cpp
This code provided a 7x accuracy improvement over timeGetTime(). (0.2ms vs 1.4ms std dev*3)
Rename variables to fit with existing naming mechanism