Commit Graph
68 Commits
Author SHA1 Message Date
sukibaby 10125caa7f Remove GLU dependency
gluGetString, gluBuild2DMipmaps, and gluErrorString are all functions from the GLU library, which is not part of OpenGL.

This lets the game run without libGLU1 (or whatever it's called on a given distro).

Update README.md
2024-08-10 11:53:09 -07:00
sukibaby b938ac449f Migrate to universal build for macOS
Instruct cmake to generate a universal release, instead of separate executables for ARM64 and x86_64.
2024-08-09 04:25:26 -07:00
sukibaby 36892b4e56 Create RandomSeed.h (mt19937 RNG)
This exists to replace the use of RageTimer as a RNG seed, which results in fewer GetTimeSinceStart() calls and better entropy.
2024-08-07 10:05:13 -07:00
sukibaby 7492793463 Initialize SongPosition variables 2024-08-07 02:00:40 -07:00
sukibaby 6a2de50101 Remove RadianToDegree macro from ModelTypes
We can remove two macros from RageMath which are only used in a single place.
2024-08-07 00:58:18 -07:00
sukibaby 5e00535522 Prevent divide by 0 in calc_mean 2024-08-07 00:56:16 -07:00
sukibaby 3c64940974 Update WinMoveFileInternal 2024-08-07 00:52:34 -07:00
sukibaby a1c316cfc7 Initialize variables in ModelTypes 2024-08-07 00:52:04 -07:00
sukibaby b30bf85399 WaveOut: Reattempt to initialize on failure
If the device suddenly changes, like say an audio cable gets unplugged, this gives the game a chance to recover gracefully instead of just crashing.
2024-08-07 00:17:25 -07:00
sukibaby a0d1198cc1 MixIntoBuffer optimization
Reduced risk of error as well, improved readability as well as improved performance due to removing a repeated calculation.
2024-08-07 00:15:22 -07:00
sukibaby bb5a538026 Range based for loop in GetBPMs 2024-08-07 00:05:50 -07:00
sukibaby 5a0bfed42d Re-order Linux default audio driver list 2024-08-06 23:59:27 -07:00
sukibaby beecd2bd47 Clean up messy GameLoop function 2024-08-06 18:07:21 -07:00
sukibaby e34450fbe8 Prevent overlapping assist tick sounds 2024-08-06 17:34:23 -07:00
sukibaby 5d2667add1 Fix two small RageFile bugs
1) RageFileDriverDirect was failing to assign m_sRoot

2) Improve check if m_sRoot is empty

3) Fix a semi-broken logging method in RageFileManager
2024-08-06 17:17:21 -07:00
sukibaby e60cf2aa0d Use stdlib for trigonometric functions
Profiling showed this performed significantly faster than the RageFast_ implementations.
2024-08-06 16:18:39 -07:00
sukibaby 64fa8e9971 MusicWheel::readyWheelItemsData remove ragetimer 2024-08-06 16:16:47 -07:00
sukibaby bfde995b60 Fix CacheFile 2024-08-06 16:03:40 -07:00
sukibaby d53d1b113b Remove ERASE_SEG macro from TimingData.cpp 2024-08-06 15:37:24 -07:00
sukibaby 091b762f79 Remove macro from public Luna<TimingData> 2024-08-06 15:33:34 -07:00
sukibaby dfa7589345 Revert "Prevent setting the position of a nullptr"
This reverts commit 47ff2cf095
2024-08-06 15:32:11 -07:00
sukibaby 2fd1bff510 Threads_Win32 fixes
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`
2024-08-06 15:31:24 -07:00
sukibaby e2ae82deb2 windows sdk 5.0 -> 10.0 2024-08-05 16:35:05 -07:00
sukibaby 630617ff1e Undefine macro in RageTimer.cpp 2024-08-05 14:52:59 -07:00
sukibaby 81b98c6e34 Remove profiling defines from RageTimer.h 2024-08-05 14:52:14 -07:00
sukibaby 75531a67a0 Update README.md 2024-07-25 11:35:47 -07:00
sukibaby fb5ffb0cc6 Update README.md 2024-07-25 11:35:47 -07:00
sukibaby 7ac77f5b78 Make Pi constexpr in RageMath.h
This is the same value used in the vorbis code.
2024-07-22 10:38:15 -07:00
sukibaby 515090b7f7 Don't log FPS by default 2024-07-15 07:00:27 -07:00
sukibaby 5bb4e04957 Allow building on BSD 2024-07-15 07:00:07 -07:00
sukibaby 06bfbbf15d Make BUF_SIZE constexpr 2024-07-10 22:09:23 -07:00
sukibaby 51e00b2d86 Remove macro from TimingData::GetBeatInternal 2024-07-10 14:57:56 -07:00
sukibaby 963f401c0a Rewrite TimingData::ReleaseLookup 2024-07-10 14:57:10 -07:00
sukibaby 8f5b45f2ca Revert some thread priority level changes 2024-07-10 11:57:37 -07:00
sukibaby 56444b560a Remove macro from TimingData::GetElapsedTimeInternal 2024-07-10 11:41:54 -07:00
sukibaby 264244d6a3 Copy & swap assignment operator 2024-07-10 11:28:43 -07:00
sukibaby dd4f92d289 Remove COMPARE macro from TimingData.h 2024-07-10 10:45:48 -07:00
sukibaby 0447d9ae58 Consistency in Windows ifdefs/windows.h includes
Changing all defined(_WINDOWS) to defined(_WIN32)

Defining WIN32_LEAN_AND_MEAN in all files except those in Archutils/Win32
2024-06-24 15:48:05 -07:00
sukibaby 65fe06bcd3 Prevent need for fallthrough attribute 2024-06-23 21:40:09 -07:00
sukibaby 5e3bc389c3 Fix uninitialized variable in Crash.cpp 2024-06-23 21:39:40 -07:00
sukibaby ae6d7cecb5 Update ActorMultiVertex.cpp
Encapsulate actor resize functionality.

Significant performance improvement on the `UpdateAnimationState` function which was bottlenecking many operations.

See ITGmania PR #253 for more information.
2024-06-18 06:37:44 -07:00
sukibaby 9e3c7fc207 Update RageSoundMixBuffer
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
2024-06-18 06:27:56 -07:00
sukibaby 5b0070f403 Win32 thread priority isolation layer
other changes merged in this commit:
Update RageSoundReader_ThreadedBuffer.h
Update GameLoop.cpp
Update CMakeData-os.cmake
2024-06-11 06:32:27 -07:00
sukibaby 47ff2cf095 Prevent setting the position of a nullptr
Also implemented copy just in case
2024-06-09 21:07:49 -07:00
sukibaby 339aafcd65 Remove bad line from fallback language files 2024-06-09 21:06:49 -07:00
sukibaby 471a92e322 Improve error logging in IniFile.cpp 2024-06-08 20:31:31 -07:00
sukibaby fcb7989a98 Encapsulate input device check to run it less often 2024-06-08 18:10:05 -07:00
sukibaby cb1e2843de Minor RageSound improvements
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.
2024-06-08 17:15:04 -07:00
sukibaby 48c1fe3856 Revert "Windows: Compile with /utf-8 flag"
This reverts commit 58a45d91f4.
2024-06-08 16:20:04 -07:00
sukibaby 829f49f622 Fix NotesLoaderDWI.cpp
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
2024-06-08 16:18:01 -07:00
sukibaby 12ceb7fc7c Clean up DoChangeTheme()
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.
2024-06-08 15:59:48 -07:00
sukibaby de351c7228 Don't change priority if game loses focus
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.
2024-06-08 15:36:18 -07:00
sukibaby c2ac89dcb6 Improve calc_mean function
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).
2024-05-30 17:36:55 -07:00
sukibaby 6f86f3eae5 Restore comment in Actor.cpp 2024-05-29 10:30:49 -07:00
sukibaby e5d7b0db6c Update FFmpeg URL in .gitmodules 2024-05-29 10:30:30 -07:00
sukibaby 03033857c2 Actor optimizations 2024-05-28 10:24:23 -07:00
sukibaby 626e127589 Replace src/archutils/Win32/ddk/hidpi.h
From SDK 10.0.16299
2024-05-28 10:19:50 -07:00
sukibaby b730a5a750 Remove AltiVec code
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.
2024-05-28 09:34:59 -07:00
sukibaby 558d84c37f Remove NTPAD check
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.
2024-05-28 09:14:13 -07:00
sukibaby b6f0da79a4 Change a lrint 2024-05-14 09:35:38 -07:00
sukibaby 705a069400 Resolve the SM5 sync drift issue
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
2024-05-12 08:05:41 -07:00
sukibaby 3f8a7f5fd3 Run as "High Priority" on Windows
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
2024-05-10 00:33:36 -07:00
sukibaby 3d63d80163 Always use CLOCK_MONOTONIC if it's available on Unix 2024-05-08 10:37:17 -07:00
sukibaby eb8b428d0f Use range-based for loops in ScreenManager.cpp
Modernizing some of the old code - improve reliability by replacing traditional iterator loops where they are not needed.

Update ScreenManager.cpp
2024-05-08 01:55:51 -07:00
sukibaby f7a7252dbb Replace timeGetTime() with QueryPerformanceCounter()
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
2024-05-07 17:57:47 -07:00
sukibaby 8d24f61214 Don't warn user if frame size is not a multiple of 2
Disable this common nag warning + log file warning combination.
2024-05-07 10:20:12 -07:00
sukibaby a5bbcebd0c Update BPMDisplay.cpp
Update BPMDisplay.cpp

Replace lrint with static_cast<int>+0.5

Proposed lrint change for the same reason as #235.
2024-05-04 10:52:43 -07:00
sukibaby 2e2d49393b Replace lrint(x) with static_cast(x+0.5)
Update 9 files

Update RageSoundReader_Extend.cpp
Update RageSoundReader_Preload.cpp
Update RageSoundUtil.cpp
Update RageSoundReader_ThreadedBuffer.cpp
Update RageSoundReader_SpeedChange.cpp
Update RageSoundReader_Resample_Good.cpp
Update RageSoundReader_Merge.cpp
Update RageSoundReader_Chain.cpp
Update RageSoundMixBuffer.cpp
2024-05-03 23:17:59 -07:00