From top to bottom,
- Fix incorrect gcc implementation in `SetThreadName`
- Static Cast in `StartThread`
- Fix `MutexImpl_Win32::Lock()`
- Remove unnecessary pre-winXP methods in PortableSignalObjectAndWait()
- Static Cast in `EventImpl_Win32::Wait`
These functions are based on "DecodePacket" and "ReadPacket". This
PR does not consume the new buffer or decoding functions yet. It also
preps the class for adding a fast cancel to decoding, in the case that
the movie texture is destroyed while decoding is still happening.
The old implementation relied on the tricks that no longer seem to
optimize anything and break strict aliasing rule, which in turn is an
undefined behavior:
/var/storage/rf/proj/itgmania/src/RageTypes.h: In function ‘unsigned char FTOC(float)’:
/var/storage/rf/proj/itgmania/src/RageTypes.h:300:42: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
300 | int ret = reinterpret_cast<int&>(base);
| ^~~~
Compiler explorer summary: https://godbolt.org/z/5857747P3
It's also possible to eliminate this strict aliasing violation with a union,
while leaving all the tricky code (also included in the link above).
Online build of the test code that's suggested for FTOC: https://onlinegdb.com/O7N0Orl0r
ARM version of the code wasn't correct -- as in not passing the attached test.
It didn't perform accurately around the end of the input range.
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.