Goober5000
7058993a2b
fix arrival delays and other mission time wonkiness
...
The `Timestamp_microseconds_at_mission_start` variable should not, in fact, be adjusted when the timer counter variables are adjusted.
Fixes #3946 .
2022-01-22 18:46:35 -05:00
Goober5000
f96ea31253
the variable should be nonzero by the time we get to mission stuff, but best to handle it anyway
2022-01-21 09:48:50 -05:00
Goober5000
a1bc06aeeb
accommodate elapsed time during debugging
...
If a breakpoint is hit in the code, the SDL time will keep running even though FSO doesn't realize things are effectively, if not actually, paused. Detect this situation and adjust the timestamp offset to compensate.
2022-01-20 21:13:52 -05:00
Goober5000
4ee84b71d7
refactor some names
2022-01-17 19:03:23 -05:00
Goober5000
9c7a9a1c20
patch a hole in the pausing and make sure timer pause/unpause is always called
2022-01-16 15:24:43 -05:00
Goober5000
73a408043b
time compression now works
2022-01-16 15:24:43 -05:00
Goober5000
18f4f490d0
time compression outline, static casts
2022-01-16 15:24:43 -05:00
Goober5000
cf6a460422
move some stuff around
2022-01-16 15:24:43 -05:00
Goober5000
00de4c3e7e
timestamps should be running just about all the time
2022-01-16 15:24:43 -05:00
Goober5000
a1dadb1c0b
small refactor
2022-01-16 15:24:43 -05:00
Goober5000
8e33644a8f
since we used to fast-forward at the rate of 1/4 second per frame, simulate the same thing with the timer
2022-01-16 15:20:57 -05:00
Goober5000
88f4163ae3
always give the game priority when starting/stopping time
2022-01-16 15:20:57 -05:00
Goober5000
1b51225c51
convert the FSO timestamp system to use SDL time
...
Previously, the game used a dead-reckoning system for measuring time, where several time counters were incremented as long as time was running. This unfortunately has no way to synchronize time in the long term, and therefore in-game time will tend to run faster or slower than real time by a few percent, depending on various factors.
This PR redesigns the timestamp system to use the SDL time counter which will always keep it in sync with real time. However this necessarily involves a bit of clever handling when the game is paused and unpaused. It also revealed several minor bugs in several places in the code where timestamps were handled.
This PR is currently in draft status until the design can be updated to handle time compression. In all other respects it should be working.
2022-01-16 15:20:57 -05:00
Goober5000
009abe22fe
fix comment
2022-01-02 01:03:52 -05:00
Goober5000
93757bcc61
replace Int3() with UNREACHABLE
2022-01-02 01:03:52 -05:00
JohnAFernandez
186fe51344
Object update packet upgrade ( #2752 )
...
* Object Update Refactor
1. Keeps the object update packet aligned, even if the ship is dying or has not yet arrived on the client.
2. Properly handles model point shields (yes, that's what was causing multi to crash the most!)
3. Reworks positional interpolation timing and adds rotational interpolation, by sending timing information with every object update packet in a header shared between objects.
4. Saves a lot of bandwidth by only sending data that is changing. (no more sending all subsystems once per second!)
5. Better handles out of order packets (but can still use their information if recent enough!)
6. Builds the basis for Rollback by beginning to record the positions and orientations and velocities of ships for the last 30 frames.
7. Adds subsystem rotation -- Yeah, you saw that right, subsystems will now spin in multi.
8. Waypoint movement is now enabled via sexp, and time to arrival of waypoints is updated on the target info gauge.
* Fix edge case crash and Incorporate feedback
* Clean Up Interpolate Angles Quick
* Restrain the client
* How was this still here???
* Make sure every part of OO uses OOC_INDEX_NULLPTR_SUBSYSTEM define
* Fix Way to Store Return Values
* Ok travis, we get it
* Ok travis.........
2020-10-08 15:29:06 -04:00
asarium
0b4ca71eba
Enable modernize-deprecated-headers
2018-04-25 11:12:41 +02:00
asarium
15af2bb1a2
Fix standalone timer overflow
...
If FSO runs for a very long time (5 hours to be exact) then the SDL
performance counter reaches a value so hight that rescaling it to
microseconds causes an overflow which is bad.
This fixes that by implementing the rescaling by computing the factor in
the timer initialization code and then multiplying the SDL time with
that. This uses the same principle as the changes done by @TheMatthew in #1082 .
According to the tests done by @chief1983, this fixes #1237 .
2017-02-18 16:54:58 +01:00
asarium
0ba4e49106
Fix signed/unsigned warnings
2016-12-14 11:12:25 +01:00
Matthew Khouzam
b5b4a88775
timer: Increase precision of timer as well as reducing potential of overflows.
...
This creates a factor that is used to multiply the timestamp. It will
overflow less, (once every 300 years or so) and not lose as much precision
as the previous implementation.
The performance is slightly improved, there are no more branches and one
floating point multiply.
Note: this relies on long double having a 64 bit mantissa. This is the
case on x86 Windows, Linux, and Mac OS. However, it is unconfirmed to
work on other architechtures.
Signed-off-by: Matthew Khouzam <[email protected] >
2016-12-04 05:44:02 -05:00
asarium
d64196eff0
Refactor tracing subsystem
...
The new design is centered around the Event Trace JSON format but it
should still be possible to adapt it for other profiling tools. The old
profiling system has been removed.
2016-11-24 10:26:21 +01:00
asarium
eda4cdffa7
Fix timestamp overflow check
2016-10-17 09:16:01 +02:00
asarium
acbac94685
Add GPU time tracing
...
This also adds nanosecond precision tracing for normal CPU events
2016-09-14 12:26:53 +02:00
asarium
baf7746986
Rename high res timer function to timer_get_microseconds
2016-08-31 14:32:53 +02:00
asarium
e8bd7363c8
Use microsecond precision for timestamps
...
This only increases resolution for the internal ticker but not for the
external timestamps
2016-08-31 14:32:53 +02:00
asarium
0169a5477c
Always use high resolution timers
2016-08-31 14:32:53 +02:00
asarium
2d4d0081cd
Merge branch 'master' into antipodes_/sync
...
Conflicts:
code/cmdline/cmdline.cpp
code/io/timer.cpp
code/network/multi.cpp
configure.ac
projects/MSVC_2005/Fred2.vcproj
projects/MSVC_2005/Freespace2.sln
projects/MSVC_2005/Freespace2.vcproj
projects/MSVC_2005/code.vcproj
projects/MSVC_2008/Fred2.vcproj
projects/MSVC_2008/Freespace2.doxproj
projects/MSVC_2008/Freespace2.vcproj
projects/MSVC_2008/code.vcproj
projects/MSVC_2010/Fred2.vcxproj
projects/MSVC_2012/Fred2.vcxproj
projects/MSVC_2012/Freespace2.vcxproj
projects/MSVC_2012/code.vcxproj
projects/MSVC_2012/code.vcxproj.filters
projects/Xcode4/FS2_Open.xcodeproj/project.pbxproj
projects/Xcode4/Frameworks.tgz
projects/Xcode4/Info.plist
2016-03-11 12:36:52 +01:00
Goober5000
746fe56b32
Merge pull request #525 from asarium/cleanup/timer
...
Remove some unused code from timer.h/.cpp
2016-01-31 16:12:04 -05:00
asarium
fc6bc3a1c6
Remove some unused code from timer.h/.cpp
...
The removed code has been replaced by the profiling subsystem.
2016-01-29 22:00:58 +01:00
asarium
54b2eddc14
Change timestamp integer handling again
2016-01-28 16:39:10 +01:00
asarium
64c4e4d7b4
Use integer math instead of floats for timestamps
2016-01-27 15:34:37 +01:00
asarium
75625270c9
Use the correct type for high resolution timers
2016-01-27 14:27:46 +01:00
asarium
d822f2a467
Merge branch 'master' into antipodes
...
Conflicts:
code/io/timer.cpp
timer conflict was fixed by using the performance counters of SDL instead of what the OS offers directly
2015-05-08 22:24:36 +02:00
Swifty
dd9f9ed921
Improved profiling code to have a timing resolution of microseconds instead of milliseconds.
2015-05-05 20:41:05 -07:00
asarium
7e77b5a67c
Merge branch 'master' into antipodes
...
Conflicts:
.gitignore
code/Makefile.am
code/ai/ai.h
code/ai/ai_profiles.cpp
code/ai/ai_profiles.h
code/ai/aibig.cpp
code/ai/aicode.cpp
code/ai/aiturret.cpp
code/asteroid/asteroid.cpp
code/asteroid/asteroid.h
code/bmpman/bm_internal.h
code/bmpman/bmpman.cpp
code/bmpman/bmpman.h
code/camera/camera.cpp
code/camera/camera.h
code/cfile/cfile.cpp
code/cmdline/cmdline.cpp
code/cmdline/cmdline.h
code/controlconfig/controlsconfig.h
code/controlconfig/controlsconfigcommon.cpp
code/cutscene/movie.cpp
code/cutscene/oggplayer.cpp
code/debugconsole/consoleparse.cpp
code/fred2/campaigneditordlg.cpp
code/fred2/fred.cpp
code/fred2/fred.rc
code/fred2/missionsave.cpp
code/fred2/resource.h
code/fred2/sexp_tree.cpp
code/fred2/sexp_tree.h
code/fred2/shipflagsdlg.cpp
code/fred2/shipflagsdlg.h
code/fred2/shiptexturesdlg.cpp
code/fred2/voiceactingmanager.cpp
code/freespace2/freespace.cpp
code/freespace2/freespace.rc
code/gamehelp/contexthelp.cpp
code/globalincs/alphacolors.cpp
code/globalincs/alphacolors.h
code/globalincs/version.h
code/globalincs/vmallocator.h
code/globalincs/windebug.cpp
code/graphics/2d.cpp
code/graphics/font.cpp
code/graphics/generic.cpp
code/graphics/generic.h
code/graphics/grinternal.h
code/graphics/gropengl.cpp
code/graphics/gropengldraw.cpp
code/graphics/gropenglextension.h
code/graphics/gropenglpostprocessing.cpp
code/graphics/gropenglstate.cpp
code/graphics/gropenglstate.h
code/graphics/gropengltexture.cpp
code/graphics/gropengltnl.cpp
code/hud/hud.cpp
code/hud/hud.h
code/hud/hudconfig.cpp
code/hud/hudlock.cpp
code/hud/hudmessage.cpp
code/hud/hudparse.cpp
code/hud/hudreticle.cpp
code/hud/hudreticle.h
code/hud/hudshield.cpp
code/hud/hudsquadmsg.cpp
code/hud/hudtarget.cpp
code/hud/hudtarget.h
code/hud/hudtargetbox.cpp
code/inetfile/cftp.cpp
code/inetfile/chttpget.cpp
code/io/joy.cpp
code/io/joy_ff.cpp
code/io/key.cpp
code/io/keycontrol.cpp
code/io/mouse.cpp
code/io/timer.cpp
code/localization/localize.cpp
code/localization/localize.h
code/math/fvi.cpp
code/math/vecmat.cpp
code/menuui/credits.cpp
code/menuui/mainhallmenu.cpp
code/menuui/mainhallmenu.h
code/menuui/optionsmenumulti.cpp
code/menuui/playermenu.cpp
code/mission/missionbriefcommon.cpp
code/mission/missioncampaign.cpp
code/mission/missiongoals.h
code/mission/missionmessage.cpp
code/mission/missionparse.cpp
code/mission/missionparse.h
code/missionui/missionbrief.cpp
code/missionui/missioncmdbrief.cpp
code/missionui/missiondebrief.cpp
code/missionui/missionscreencommon.cpp
code/missionui/missionshipchoice.cpp
code/missionui/missionweaponchoice.cpp
code/missionui/redalert.cpp
code/missionui/redalert.h
code/mod_table/mod_table.cpp
code/mod_table/mod_table.h
code/model/model.h
code/model/modelcollide.cpp
code/model/modelinterp.cpp
code/model/modelread.cpp
code/network/multi.cpp
code/network/multi_dogfight.cpp
code/network/multi_ingame.cpp
code/network/multi_log.cpp
code/network/multi_rate.cpp
code/network/multiteamselect.cpp
code/network/multiui.cpp
code/network/multiutil.cpp
code/network/stand_gui-unix.cpp
code/object/collideshipship.cpp
code/object/collideshipweapon.cpp
code/object/object.cpp
code/object/object.h
code/object/objectsnd.cpp
code/object/objectsort.cpp
code/osapi/osapi.cpp
code/osapi/osapi_unix.cpp
code/osapi/outwnd.h
code/parse/generic_log.cpp
code/parse/lua.cpp
code/parse/parselo.cpp
code/parse/parselo.h
code/parse/scripting.cpp
code/parse/scripting.h
code/parse/sexp.cpp
code/parse/sexp.h
code/physics/physics.cpp
code/pilotfile/csg.cpp
code/pilotfile/csg_convert.cpp
code/pilotfile/pilotfile.cpp
code/pilotfile/pilotfile_convert.h
code/playerman/playercontrol.cpp
code/radar/radardradis.cpp
code/radar/radardradis.h
code/radar/radarsetup.cpp
code/radar/radarsetup.h
code/ship/ship.cpp
code/ship/ship.h
code/ship/shipfx.cpp
code/ship/shiphit.cpp
code/sound/audiostr.cpp
code/sound/ds.cpp
code/sound/openal.cpp
code/sound/rtvoice.cpp
code/sound/sound.cpp
code/sound/voicerec.cpp
code/stats/medals.cpp
code/stats/medals.h
code/stats/scoring.cpp
code/ui/ui.h
code/weapon/beam.cpp
code/weapon/weapon.h
code/weapon/weapons.cpp
code/wxfred2/aboutbox.cpp
code/wxfred2/campaigneditor.cpp
code/wxfred2/campaigneditor.h
code/wxfred2/commandbriefingeditor.cpp
code/wxfred2/debriefingeditor.cpp
code/wxfred2/fredframe.cpp
code/wxfred2/fredframe.h
code/wxfred2/missionspecseditor.cpp
code/wxfred2/missionspecseditor.h
code/wxfred2/voiceactingmanagereditor.cpp
code/wxfred2/wxfred.xrc
code/wxfred2/wxfred2.cpp
code/wxfred2/wxfred2.h
configure.ac
fs2open.Doxyfile
jansson/LICENSE
jansson/dump.c
jansson/hashtable.c
jansson/hashtable.h
jansson/jansson.h
jansson/jansson_config.h
jansson/jansson_private.h
jansson/load.c
jansson/memory.c
jansson/pack_unpack.c
jansson/strbuffer.c
jansson/strbuffer.h
jansson/strconv.c
jansson/utf.c
jansson/utf.h
jansson/value.c
libpng/png.c
libpng/png.h
libpng/pngconf.h
libpng/pngdebug.h
libpng/pngerror.c
libpng/pngget.c
libpng/pnginfo.h
libpng/pnglibconf.h
libpng/pngmem.c
libpng/pngpread.c
libpng/pngpriv.h
libpng/pngread.c
libpng/pngrio.c
libpng/pngrtran.c
libpng/pngrutil.c
libpng/pngset.c
libpng/pngstruct.h
libpng/pngtrans.c
libpng/pngwio.c
libpng/pngwrite.c
libpng/pngwtran.c
libpng/pngwutil.c
projects/Eclipse/Freespace2/.project
projects/MSVC_2005/Fred2.vcproj
projects/MSVC_2005/Freespace2.sln
projects/MSVC_2005/Freespace2.vcproj
projects/MSVC_2005/code.vcproj
projects/MSVC_2005/wxFRED2.vcproj
projects/MSVC_2008/Fred2.vcproj
projects/MSVC_2008/Freespace2.doxproj
projects/MSVC_2008/Freespace2.vcproj
projects/MSVC_2008/code.vcproj
projects/MSVC_2010/Fred2.vcxproj
projects/MSVC_2010/Freespace2.vcxproj
projects/MSVC_2010/code.vcxproj
projects/MSVC_2010/code.vcxproj.filters
projects/MSVC_2010/wxFRED2.vcxproj
projects/MSVC_2011/Fred2.vcxproj
projects/MSVC_2011/Freespace2.vcxproj
projects/MSVC_2011/code.vcxproj
projects/MSVC_2011/code.vcxproj.filters
projects/MSVC_2011/wxFRED2.vcxproj
projects/MSVC_2013/Fred2.vcxproj
projects/MSVC_2013/Freespace2.vcxproj
projects/MSVC_2013/code.vcxproj
projects/MSVC_2013/code.vcxproj.filters
projects/MSVC_2013/libjpeg.vcxproj
projects/MSVC_2013/liblua.vcxproj
projects/MSVC_2013/libpng.vcxproj
projects/MSVC_2013/wxFRED2.vcxproj
projects/MSVC_2013/zlib.vcxproj
projects/MSVC_6/Fred2.dsp
projects/MSVC_6/Freespace2.dsp
projects/MSVC_6/code.dsp
projects/MSVC_6/wxFRED2.dsp
projects/Xcode/English.lproj/InfoPlist.strings
projects/Xcode/FS2_Open.xcodeproj/project.pbxproj
projects/Xcode4/English.lproj/InfoPlist.strings
projects/Xcode4/FS2_Open.xcodeproj/project.pbxproj
projects/Xcode4/Frameworks.tgz
projects/codeblocks/Freespace2/Freespace2.cbp
zlib/adler32.c
zlib/compress.c
zlib/crc32.c
zlib/crc32.h
zlib/deflate.c
zlib/deflate.h
zlib/infback.c
zlib/inffast.c
zlib/inffixed.h
zlib/inflate.c
zlib/inftrees.c
zlib/trees.c
zlib/uncompr.c
zlib/zconf.h
zlib/zlib.h
zlib/zutil.c
zlib/zutil.h
2015-04-25 16:48:43 +02:00
Goober5000
435b078157
Yarn's patch for Mantis #3107 (Parts of the interface code assume a font size of 10)
...
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11082 387891d4-d844-0410-90c0-e4c51a9137d3
2014-09-25 16:40:34 +10:00
The_E
88dce29920
Trunk sync r10550
...
git-svn-id: svn://svn.icculus.org/fs2open/branches/antipodes@10551 387891d4-d844-0410-90c0-e4c51a9137d3
2014-09-11 19:22:12 +10:00
The_E
6e91857745
From Yarn: Fixes interface graphics scaling issues. If, for some reason, you want to have the interface graphics stretched, use the -stretch_menu commandline flag.
...
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10544 387891d4-d844-0410-90c0-e4c51a9137d3
2014-03-30 12:39:54 +10:00
The_E
753e82f5c6
Removes the CRITICAL_SECTION macros, as these were just obscuring calls to SDL functions
...
git-svn-id: svn://svn.icculus.org/fs2open/branches/antipodes@10230 387891d4-d844-0410-90c0-e4c51a9137d3
2014-03-06 19:24:13 +10:00
m_m
a8b201beb7
Changed most MessageBox calls to use SCP_Messagebox, also fixed some of the event processing.
...
git-svn-id: svn://svn.icculus.org/fs2open/branches/antipodes@10155 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 18:40:18 +10:00
The_E
25915f6de0
IIt begins!
...
SDL2 Everywhere, from me and Flaming_Sword. Outstanding issues: FRED integration, project file updates, cleanup.
git-svn-id: svn://svn.icculus.org/fs2open/branches/antipodes@10062 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 18:40:16 +10:00
portej05
98f337f701
safe_strings - from Antipodes build #1
2009-07-27 16:06:24 +00:00
portej05
aaf3a9bf09
safe_strings changes
2009-07-26 05:15:24 +00:00
portej05
719825f80d
The big CVS comment removal. This chops approx. 3.5mb off a full checkout.
...
I've tested this through compiling and through hand checking.
Normalises line endings in ALL files to \n.
2009-06-20 08:08:20 +00:00
taylor
3abccfa76c
sync up to current FS2NetD code (fixes so many little problems/issues that it's not even funny)
2008-11-09 05:08:19 +00:00
taylor
aba67f6267
make sure we are locking those vars down in timer_get() to avoid thread issues (may fix hang on "timer rolled" message)
2006-05-30 03:55:09 +00:00
Goober5000
c8029346cd
hehe, grammar
...
--Goober5000
2006-03-30 04:15:20 +00:00
taylor
0a567569b7
new timer code that shouldn't suffer from multi-cpu (or dual core) systems
...
clean out all old Windows timer code since that was just a mess at this point
2005-10-12 05:45:35 +00:00
taylor
ca7a976823
forgot to take into account F1_0 on timer_get_fixed_seconds(), remove those stupid CRs too
2005-05-26 09:21:28 +00:00
taylor
aac663c449
timer changes to fix game_busy() on the loading screen and 100% incorrect values on some machines,
...
don't know if this is going to work that great but it's more like the Linux SDL code now which
has worked for years without major problems
2005-05-26 04:27:11 +00:00