Commit Graph

63 Commits

Author SHA1 Message Date
sukibaby eb35a9b9af Switch from Float to Integer Time Values
- Use fast data types where possible so the compiler can optimize for speed based on platform
    - for example, 128 bits might be fastest on ARM
    - good future-proofing

- Refactor GetTimeSinceStart() to be a bit faster
    - multiplication is much faster than division

- Implement a RageTimer method to get the seconds value as a plain int, for the places which cast the seconds value to an int

- Changing from GetTimeSinceStartFast() to GetTimeSinceStart() where accuracy is important

- Changing from GetTimeSinceStart() to GetUsecsSinceStart() for timestamp diffs

- Adjust RageThreads to accomodate an unsigned timestamp value
   - a constant for the maximum value of `uint_fast64_t` replaces `-1` to accommodate the change from signed to unsigned for the `locked_at` variable
   - i have separate constants for `std::numeric_limits<std::uint_fast64_t>::max()` and `static_cast<std::uint_fast64_t>(-1)`, so the reader understands -1 represents an error code, though they evaluate to the same value, so i could remove one of the two

- Add two methods to calculate the MMSSMsMs / MMSSMsMsMs time value from usecs directly instead of inferring it from a seconds value, in RageUtil

- Use a similar counter/modulo based method for WheelNotifyIcon, similar to what i did for text_glow in NoteField in 2eeee03

- Make `g_iStartTime` static const for safety

Rename two timer functions:
GetUsecsSinceStart -> GetTimeSinceStartMicroseconds
GetMicrosecondsSinceStart -> GetSystemTimeAsMicroseconds

Remove std prefix from uint_fast64_t
2024-09-22 01:27:45 -07:00
Martin Natano bacecae1f7 Decouple <vector> 2023-04-21 22:13:41 +02:00
Michael Sundqvist 0cba3579de Remove global "using namespace std;" declarations, use "std::" prefixes on all std elements
Fix whitespace changes
2022-07-31 22:14:38 +02:00
Martin Natano 551e6344f7 Remove hidden autoplay 2022-06-08 20:12:57 +02:00
teejusb 7e3789b131 Integrate C++11 branch into 5_1-new 2019-06-22 12:35:38 -07:00
Kyzentun d27fae7ed5 Entry in the debug menu that reloads preferences. There may be some preferences that are only checked at startup that are unaffected by the reload. (#1471) 2017-06-06 09:36:24 -07:00
Kyzentun Keeslala d2090081a1 Doing what I should have done a long time ago. 2015-07-09 13:18:51 -06:00
Kyzentun 520432cdff Added docs for xml converter. Added XmlToLua.h. Condition code in xml is now passed through the lua converter to handle renamed things. 2015-05-08 23:55:38 -06:00
Kyzentun 9b6ae296c7 Fixed automagic typing. Added debug overlay line for conversion. 2015-05-05 21:41:15 -06:00
Kyzentun b293a8c073 Added debug key for toggling action sounds off. Touches every place that RageSound::Play is called, hope I didn't miss one. 2015-02-28 06:25:02 -07:00
Kyzentun c3d2b5e1b1 Reset keys debug option changed to save defaults to disk and reset. 2014-11-30 14:58:03 -07:00
Kyzentun d3b5f5eb98 Added debug menu option for resetting key mappings to default. Added sanity checking requirement to ScreenMapControllers. 2014-11-30 14:45:52 -07:00
Kyzentun 2c49ec7380 Change RadarValues internal implementation to not use a union and use the subscript operator instead of the float* operator for subscripting. 2014-08-22 13:19:17 -06:00
Kyzentun a2e6d186e3 Created Def.LogDisplay for displaying messages in a log. Changed error reporting layer to use Def.LogDisplay. Changed engine error reporting to not clip errors to a single line. 2014-07-18 16:29:46 -06:00
Kyzentun 63311ab62f Moved error reporting to ScreenSystemLayer error.lua. ScreenSystemLayer overlay/default.lua restored to previous. Error messages are now broadcast with the ScriptError message instead of SystemMessage. Added show/hide error messages toggle and clear error messages to debug menu. Nuked ScreenConsoleOverlay for being unfinished and duplicating ScreenSystemLayer. Changed Actor:tween and Tween::CreateFromStack to use ReportScriptError on invalid tween params. Changed some OptionRowList things to use ReportScriptError on invalid metrics. 2014-07-08 20:01:33 -06:00
Kyzentun bee284d0c7 Rewrote ScreenSystemOverlay overlay/default.lua to be able to display multiple messages. Added Reload Overlay Screens option to debug menu. 2014-07-08 01:02:36 -06:00
Kyzentun 0dfb131291 Created SongOptions Lua interface with a similar design to the PlayerOptions interface. Moved enums that were inside SongOptions out and made them Lua accessible. Removed sAutosyncType and associated things from AdjustSync.cpp because it was unused. Added DefaultNilArgs and FArgGTEZero to LuaBinding as helpers. Moved INTERFACE defines from PlayerOptions.cpp to OptionsBinding.h. 2014-05-03 19:27:32 -06:00
Devin J. Pohly d07dd295a4 Fix F3+1 handling in Event Mode
Since Event+Pay is treated as Free Play mode, the debug overlay menu
would get stuck on Free if Event Mode was on.
2014-02-22 20:14:20 -05:00
Colby Klein a3de293a4d Add Pay mode back to debug menu 2014-02-02 15:35:48 -08:00
Devin J. Pohly 65450ce530 Remove Pay mode from debug overlay 2013-06-08 16:14:35 -04:00
Devin J. Pohly 1220dbe085 Revert "Round 2-2 of this."
This reverts commit 0ae4183f7b.
2013-06-04 23:47:22 -04:00
Jason Felds 28e5148dec The big NULL replacement party part 5.
Right. ' = NULL' would get a lot of these.
2013-05-03 23:39:52 -04:00
Jason Felds ba59dd1656 The big NULL replacement party part 2.
This may take a bit. Trying to do this by operator/command.
2013-05-03 23:11:42 -04:00
Jason Felds 35f9b78481 Well...this works at least. 2013-05-02 22:06:23 -04:00
Jason Felds fe0c9f4c6f Revert "Loops with unused variables? Wonder why."
This reverts commit c3ae23939a.
2013-05-02 21:48:32 -04:00
Jason Felds 9607f013a0 Revert "These should have been const to begin with."
This reverts commit 15dc12cd0e.
2013-05-02 21:45:13 -04:00
Jason Felds 8a1d137d05 Revert "Now I can apply const appropriately."
This reverts commit 15e9e1d1d4.
2013-05-02 21:44:51 -04:00
Jason Felds 3ac6a08fbe Revert "Loop...and const. Crap."
This reverts commit 4979bf3218.
2013-05-02 21:44:05 -04:00
Jason Felds 1083ffa8cd Another warning fixed.
...any reason why this is a pointer to a vector?
2013-05-02 20:19:37 -04:00
Jason Felds 001769b946 Address one unused warning warning.
...you know what that sentence should say.
2013-05-02 20:07:54 -04:00
Jason Felds bf2f771fd1 More loops here. 2013-05-01 23:17:51 -04:00
Jason Felds 4979bf3218 Loop...and const. Crap.
Oh well. Still, wonder why mutable wouldn't work.
2013-04-30 22:42:47 -04:00
Jason Felds 15e9e1d1d4 Now I can apply const appropriately. 2013-04-30 22:37:36 -04:00
Jason Felds 15dc12cd0e These should have been const to begin with.
Here's another one to transplant.
2013-04-30 22:36:15 -04:00
Jason Felds c3ae23939a Loops with unused variables? Wonder why. 2013-04-30 22:27:25 -04:00
Devin J. Pohly feb919f0bf Revert memory leak commits
5f7001e: "Added a new branch"
01456ed: "Fixed a lot of memory leaks"
dac4493: "Fixed all remaining memory leaks that I could figure out"
0792db7: "Removed the smnew macro and the call to _CrtSetDbgFlag()"

Some of these caused destructor-time problems due to static initialization
order fiasco and related issues.  Notably, the program would no longer exit on
OSX and had to be killed.

There were probably legitimate fixes in here, but since these are monolithic
commits it's too much work to extract them now.  Let's reapply them
individually and in the forward direction.
2013-04-27 00:05:14 -04:00
Shenjoku 0792db752a Removed the smnew macro and the call to _CrtSetDbgFlag() to get ready for
merging with the main branch.
2013-04-19 20:34:11 -07:00
Shenjoku 01456ed0b9 Fixed a lot of memory leaks caused by static globals never getting
deleted and some other objects not getting deleted properly due to missing
destructors.
2013-04-18 21:17:57 -07:00
Shenjoku 5f7001ef0a Added a new branch that implements support for outputting all memory leaks to
the debug output for the Debug and FastDebug project configurations. This
requires replacing all instances of new with a macro, smnew, that defines a
special form of new which outputs file and line number information along with
the memory leak details. This makes finding memory leaks much easier since you
can just double-click the leak in the output window and it will take you to the
line that caused it.
2013-04-17 20:42:29 -07:00
Jason Felds 0ae4183f7b Round 2-2 of this. 2013-04-16 00:16:02 -04:00
Devin J. Pohly 2cf9262afc merge OverlayInput into Input. overlay screens can still intercept input if they want. 2013-01-12 23:19:44 -05:00
Devin J. Pohly f58584c939 allow overlay screens to accept codes 2013-01-11 10:08:27 -05:00
Devin J. Pohly bd0e2074ad replace ASSERT(0) with useful fail messages 2012-12-27 16:59:35 -05:00
Colby Klein e856d42dbc Reloading in the debug menu no longer crashes.
I don't know why it was ever set to reset the game - left it commented in case
this really breaks something I didn't notice, but now it's actually possible
to quickly test different MusicWheel transforms.
2012-12-24 02:21:11 -08:00
AJ Kelly c239e439a0 [ScreenDebugOverlay] Added BackgroundColor metric. 2012-07-26 17:27:45 -05:00
AJ Kelly 4f551cc25d small changes to debug overlay; should not require any theme changes 2012-03-01 17:20:24 -06:00
AJ Kelly 8ae8bab984 [ScreenDebugOverlay] Replaced hardcoded toggle command with ButtonTextToggledCommand metric. 2011-09-22 19:09:58 -05:00
Jason Felds dbdab4759e [Xcode4] May as well fix switch warnings.
Still need some assistance for the linker error.
2011-07-20 11:11:04 -04:00
Jason Felds dd3b0762e5 Restore qwerty, adjust order at the bottom.
I didn't see two zooming keys, though.
2011-07-09 20:37:57 -04:00
AJ Kelly 0038caed2a fuck, I committed this? 2011-07-09 13:12:01 -05:00