Commit Graph

887 Commits (master)

Author SHA1 Message Date
Sven Eberhardt 737b1fd8fd Save screenshots in background thread (#998, #1104).
Also ensure music keeps streaming while collecting data for full map screenshot.
2015-09-29 20:48:34 -04:00
Julius Michaelis ee859d85e0 Remove boost any usage of boost libraries 2015-09-30 00:16:12 +02:00
Sven Eberhardt edf66783aa Announce the name of each music piece only once. 2015-09-28 16:29:36 -04:00
Sven Eberhardt d6f16a0890 Change music switch due to playlist change to prefer to resume pieces that were recently played. 2015-09-28 16:29:36 -04:00
Sven Eberhardt 3f6cacade4 Add parameters to Music and SetPlayList to resume a piece from where it was last interrupted. 2015-09-27 20:58:37 -04:00
Julius Michaelis d57a8fd62c Fix two small memleaks 2015-09-24 14:35:50 +02:00
Julius Michaelis 6755a11c39 Fix dedicated server build 2015-09-22 16:43:05 +02:00
Nicolas Hake 6a11e3e811 Stop checking for rvalue ref support
We already require support for std::unique_ptr, which itself requires
support for rvalue references. As such, we know we can use rvalue
references, and thus don't have to keep carrying dead code around.
2015-09-20 13:27:14 +02:00
Nicolas Hake d1313f622f Drop hack that allowed taking a reference to a temporary value
This has never been legal C++, and the compilers where it was necessary
are no longer supported.
2015-09-20 13:27:13 +02:00
Nicolas Hake ab4f1d7258 Win32: Update crash handler for MSVC 2015 2015-09-18 15:02:33 +02:00
Sven Eberhardt e229090141 Fix memory leak in GetWorkingDirectory.
It was just one leak per engine launch so it's not relevant. But there's no reason to do manual buffer management when StdStrBuf is used anyway.
2015-09-12 03:05:16 -04:00
Sven Eberhardt 5f0b96d11b Fix empty controlled statement on undefined BREAKPOINT_HERE. 2015-09-06 22:56:14 -04:00
Sven Eberhardt 283277ac82 Do not pre-load file contents from unpacked music folders ($1378).
Removes several seconds from startup time and ~150MB memory usage. Note that tags are still loaded so all file headers do have to be accessed.
2015-09-06 00:02:17 -04:00
Martin Plicht b15f6bfb38 mac: Sprinkle some #include <GL/glew.h> onto 2 .mm files to make compiler happy
Also a break in a switch because clang told me so!
2015-09-04 18:28:57 +02:00
Sven Eberhardt 20d3de46cd Fix some unused variables. 2015-09-03 21:26:49 -04:00
Sven Eberhardt 3e2e9d5ed4 Fix some warnings. 2015-09-03 00:16:25 -04:00
David Dormagen ac738735b2 Merge branch 'master' into Controls
Conflicts:
	planet/Objects.ocd/Vehicles.ocd/Airplane.ocd/Script.c
	src/game/C4Game.cpp
	src/game/C4GraphicsSystem.cpp
	src/gamescript/C4GameScript.cpp
2015-09-02 08:19:34 +02:00
Sven Eberhardt 43165e24cd Change C4AbstractApp:SetVideoMode spatial resolution parameters to signed int.
The magic value -1 is used to denote "current screen mode", but it has trouble fitting into the unsigned concept. An alternative would be to use 0 as the magic value, but that would include quite a few places (including existing configuration settings) to change.
2015-09-01 22:51:32 -04:00
Sven Eberhardt 7d9f7aee02 Fix some unused variables and integer type conversions. 2015-09-01 22:18:39 -04:00
Sven Eberhardt e5814f8841 Silence some spurious compiler warnings about partially initialized structures. 2015-09-01 21:37:16 -04:00
Peter Wortmann 38806f4c0b Define left + right control for Mac
Higher wizardry.
2015-09-01 19:11:31 +01:00
Sven Eberhardt 0b37c96490 Fix Windows builds.
Removed some leftover gamma ramp functionality from Win32 AbstractApp.
2015-09-01 08:20:34 -04:00
Sven Eberhardt 95baaa7934 Enable usage of LeftControl, RightControl, LeftShift and RightShift as player control keys. 2015-08-31 20:50:54 -04:00
Peter Wortmann a45c865be1 Fixed preprocessor for AUDIO_TK != AUDIO_TK_OPENAL 2015-08-31 17:35:08 +01:00
Peter Wortmann 30857e835e Shader gamma implementation
In comparison to the old system, this is a downgrade - instead of being
able to set a full color mapping by gamma ramp, we now get just a value
per colour channel.

Upside is that we do not need to play around with the global gamma ramps
any more, which was arguably the wrong way to do it.

This commit will likely break everything that has been using gamma so far.
2015-08-31 17:35:08 +01:00
Sven Eberhardt 7813d87338 Fix prop list leak on game end when a sound with a modifier is currently playing. 2015-08-29 13:20:51 -04:00
Sven Eberhardt 535fc79c0f Silence a few compiler warnings. 2015-08-29 08:33:00 -04:00
Sven Eberhardt ca3ae81658 Play OpenAL sounds in front instead of rear for 5.1 surround setups [Win]. 2015-08-29 07:26:36 -04:00
Sven Eberhardt bc2259d197 MSVC/Apple CMake: Search for alext.h separately and make OpenAL extensions optional if only al.h is found. 2015-08-28 20:11:59 -04:00
Sven Eberhardt b73689fc33 Make C4SoundModifier destructor virtual.
It shouldn't matter because the derived classes have no on fields or custom destruction, but silences a warning.
2015-08-27 21:51:10 -04:00
Sven Eberhardt 6ab6a1ac3c Add script interface for some EFX sound modifiers. 2015-08-27 21:44:23 -04:00
Sven Eberhardt 134fc2799b Do not remove looping sounds on inaudibility in OpenAL.
This caused some sounds to not play at all when the object was inaudible at the position the sound was initially launched, but then moved into view (e.g. elevator cases or the planes in The Raid).
2015-08-09 21:28:29 -04:00
Sven Eberhardt d92df758a8 Added pitch parameter to Sound() script function and allow pitch and sound level to be modified for sounds that have already been started.
Sound() called when the instance is already running used to fail. Now, it always succeeds (also for script sync safety) but updates the sound level and pitch parameters. SoundAt has not been modified since it allows creation of multiple concurrent sound instance of the same effect without object context.
2015-08-09 18:40:42 -04:00
Sven Eberhardt 8ca07b7bc4 Fix left/right audio pan in OpenAL build. 2015-08-09 17:36:54 -04:00
David Dormagen 36544bd56c Merge branch 'master' into Controls
Conflicts:
	planet/Objects.ocd/Libraries.ocd/Producer.ocd/Script.c
	planet/Objects.ocd/Structures.ocd/Foundry.ocd/Script.c
	planet/Objects.ocd/Vegetation.ocd/Branch.ocd/Script.c
	planet/Objects.ocd/Vegetation.ocd/Trunk.ocd/Script.c
	planet/System.ocg/FindLocation.c
2015-08-02 19:24:04 +02:00
Nicolas Hake 79b702ac4b GLX: Don't crash when multisampling is supported
std::copy'ing into an empty vector doesn't work, and wasn't what was
intended in the first place. Assigning the full range should work better.
2015-06-15 07:03:49 +02:00
David Dormagen 196f528201 Merge branch 'master' into Controls
Conflicts:
	planet/Objects.ocd/HUD.ocd/FancyGridMenu.ocd/DefCore.txt
	planet/Objects.ocd/HUD.ocd/GridMenu.ocd/DefCore.txt
	planet/Objects.ocd/Helpers.ocd/Dummy.ocd/Graphics.png
	planet/Objects.ocd/Items.ocd/Tools.ocd/WindBag.ocd/Script.c
	planet/Objects.ocd/Items.ocd/Weapons.ocd/Javelin.ocd/Script.c
	planet/Objects.ocd/Libraries.ocd/ClonkControl.ocd/Script.c
	planet/Objects.ocd/Libraries.ocd/Constructor.ocd/ConstructionMenu.ocd/Script.c
	planet/Objects.ocd/Libraries.ocd/Constructor.ocd/Script.c
	planet/Objects.ocd/Libraries.ocd/Flag.ocd/Marker.ocd/Script.c
	planet/Objects.ocd/Libraries.ocd/Producer.ocd/Script.c
	planet/Objects.ocd/Structures.ocd/Flagpole.ocd/Script.c
	planet/Objects.ocd/Structures.ocd/Pump.ocd/Script.c
	src/game/C4Game.cpp
	src/gamescript/C4GameScript.cpp
	src/gui/C4GameMessage.cpp
	src/landscape/C4Landscape.cpp
2015-06-03 22:32:36 +02:00
Nicolas Hake 36d348d94d GLX: Allow creating debug contexts
To create debug contexts, we have to use glXCreateContextAttribsARB. To use
that, we have to initialize GLEW, which means creating a dummy GL context. To
create a dummy context with the same FB config as the final one, we need to...
initialize GLEW, because it suppresses the GLX 1.4 function declarations.
So instead we'll just manually initialize the three function pointers we're
going to need.
2015-05-28 21:34:11 +02:00
Nicolas Hake d18f7b9fa4 Correctly wrap multi-statement macro
A multi-statement macro requires the user to wrap its invocation in
curly braces if it's used as body of a conditional or loop. This is
confusing and leads to strange errors (like in lines 550f).
2015-05-25 16:16:22 +02:00
Sven Eberhardt 593723e687 Windows: Fix saving of custom keys (#1313)
The registry compiler couldn't handle strings beginning with a separator, which was used for marking keys defined by scan code.
2015-05-22 21:20:36 +02:00
Misty De Meo 5768410a83 StdSchedulerMac: don't call setTolerance:
respondsToSelector isn't properly guarding against calling this method
on unsupported platforms, possibly because it existed as a private
method in OS X before 10.9. For example, attempting to build this on
OS X 10.8 fails with the error:
no visible @interface for 'NSTimer' declares the selector 'setTolerance:'

Since the default tolerance is 0 anyway, this can be removed without
adverse effect.
2015-04-26 12:08:02 -07:00
Nicolas Hake c58e474f76 win32/GL: Reuse the same rendering context for everything
Some resources can't be shared across different rendering contexts while
others can. Additionally, the standard GLEW library does not support
multiple rendering contexts (that's what GLEX MX is for), even though it
might work on some (or even most) cards. WGL supports reuse of a
rendering context across multiple windows as long as the pixel formats
are the same.
2015-03-26 15:51:01 +01:00
Nicolas Hake 5562b09dc4 Remove a lot of disabled legacy code, round 2
Maybe at some point we'll be rid of all the commented-out code that
nobody has looked at in years.
2015-03-25 20:02:53 +01:00
Nicolas Hake db295b8678 Add emulation of C++14's std::make_unique
Unlike std::make_shared, std::make_unique was unfortunately missing from
C++11. It's a useful utility though.
Technically, declaring a new name in the std namespace is undefined, but
the other way to make make_unique available to all callers regardless of
C++ version, putting it into a distinct utility namespace and importing
the declaration from std if available, makes for more ugly code.
2015-02-25 23:37:04 +01:00
Nicolas Hake 39bbcbb9ee Win32: Don't hook assertion handler when debugging
Sven2 reports he can't get reliable stack traces from his debugger when
the assertion handler is installed. Since there's no need for the hook
when we're already running under a debugger, don't install it.
2015-02-21 19:40:35 +01:00
Nicolas Hake 4db690b0c6 Add copyright header to files that were missing it 2015-02-16 18:40:52 +01:00
Nicolas Hake 04df02c9df Win: Don't write a text crash dump if the log is already closed
Assertion failures or crashes during process shutdown must not write to
the log file if it is already closed, or the debugging CRT will raise
another assertion.
2015-02-16 18:14:29 +01:00
Nicolas Hake e21a5bdd44 Rename BoundBy to Clamp
"BoundBy" sounds like a predicate. "Clamp" is a common function name for
the operation in graphics processing, so it should be familiar to users.
2015-02-12 23:05:55 +01:00
Nicolas Hake 1a1cecadd4 Update license texts
Some files, most notably ObjC and test cases, hadn't been updated to use
the new license header. Fix this.
2015-02-08 15:05:11 +01:00
Sven Eberhardt c94814f374 Fix signed/unsigned comparison warning. 2015-02-07 14:01:14 +01:00
Nicolas Hake e2a8f6d303 Reorder some declarations and initializations to avoid order mismatch
While none of the mismatches were having a side-effect, this silences a
number of -Wreorder warnings which were drowning out potentially
important diagnostics.
2015-02-04 22:12:42 +01:00
Martin Plicht 2ca9a77cc4 mac: Do #include guessing dance until compile success 2015-02-04 21:52:04 +01:00
Günther Brammer 36ce941e4d cmake: Restore SDL-Mainloop build 2015-01-25 19:05:06 +01:00
Günther Brammer 5bcedb5bbf Remove some redundant #includes 2015-01-25 18:53:48 +01:00
Günther Brammer a92c22a7b3 Merge various build system fixes and cleanups 2015-01-25 18:50:29 +01:00
Sven Eberhardt e1a09298d4 Fix a few harmless warnings. 2015-01-25 16:16:06 +01:00
Nicolas Hake d994b893ba OSX: Fix capitalization of several imports and includes 2015-01-23 18:24:31 +01:00
Nicolas Hake 2ef2c637a7 Remove several instances of disabled legacy code 2015-01-18 22:59:45 +01:00
Nicolas Hake 57044a9eeb Move STATUS_ASSERTION_FAILURE definition to where it's actually needed 2015-01-18 21:55:16 +01:00
David Dormagen bd04722553 Merge branch 'master' into Controls
Conflicts:
	planet/Objects.ocd/HUD.ocd/Controller.ocd/Script.c
	planet/Objects.ocd/Libraries.ocd/ClonkControl.ocd/Script.c
	planet/Objects.ocd/Libraries.ocd/Constructor.ocd/ConstructionMenu.ocd/Script.c
	planet/Objects.ocd/Libraries.ocd/Constructor.ocd/Script.c
	src/game/C4GraphicsSystem.cpp
	src/game/C4GraphicsSystem.h
	src/game/C4Viewport.cpp
	src/gui/C4GameMessage.cpp
2015-01-15 19:57:01 +01:00
Nicolas Hake 8a729b4c6f Crash handler: Use PRIdPTR format where available
Printing pointers from the crash handler has been broken starting
with an update to MinGW at some point in the past, when they stopped
using printf from MSVCRT, instead replacing it with a private
implementation. Fix this by checking for inttypes.h availability, and
using it (and its format macro) when possible.
2015-01-15 10:18:37 +01:00
Sven Eberhardt 1c994ad3c7 Windows: Do not deselect GL context when losing focus (#1208).
Fixes engine intialization when tabbing out.
2015-01-11 17:01:27 +01:00
Martin Plicht b9c68f2208 mac: Fix build (C4Viewport ViewX/Y accessors) 2015-01-05 01:38:35 +01:00
Armin Burgmeier 039e03824a Fix buffer underflow in GetExtension() 2015-01-04 18:29:36 +01:00
Tobias Zwick 5e188aafb3 Fix setting small ViewOffsets. Refactor neighbouring code, enable a slight MouseAutoScroll by default
* make ViewX,ViewY,ViewOffsetX and Y private, add getters and setters that update variables that are dependent on these
2015-01-03 22:53:02 +01:00
Günther Brammer 86842da9bd Remove implementation details from C4SoundSystem.h
This eliminates the need to include Audio toolkit headers from there.
2015-01-03 22:01:08 +01:00
Günther Brammer 69f8ca27ec Move C4ApplicationSec1Timer to StdScheduler.h
There is nothing "Application" specific about this class.
2015-01-03 21:06:25 +01:00
Günther Brammer 8889aeb128 win32: Compile Win32 scheduler for other GUI toolkits, too 2015-01-01 22:13:56 +01:00
David Dormagen f89b8c8319 Merge branch 'master' into Controls
Conflicts:
	planet/Objects.ocd/Environment.ocd/Cloud.ocd/DefCore.txt
	planet/Objects.ocd/Libraries.ocd/ClonkControl.ocd/Script.c
	planet/Objects.ocd/Libraries.ocd/Constructor.ocd/ConstructionMenu.ocd/DefCore.txt
	planet/Objects.ocd/Libraries.ocd/PowerConsumer.ocd/Script.c
	planet/Objects.ocd/Libraries.ocd/PowerProducer.ocd/Script.c
	planet/Objects.ocd/Libraries.ocd/Producer.ocd/Script.c
	planet/System.ocg/ClonkControl.c
	src/gui/C4MouseControl.cpp
	src/landscape/C4PXS.cpp
2014-12-25 15:24:19 +01:00
Sven Eberhardt f50e2e9e3a Fix scroll bars in zoomed editor viewports on Windows. 2014-12-14 16:08:56 +01:00
Sven Eberhardt 8df39d06e4 Fix texture preview in editor tools dialogue on Windows. 2014-12-14 15:20:57 +01:00
Kevin Zheng 4fae398672 Fix build on 32-bit architectures 2014-12-10 21:45:41 +01:00
Sven Eberhardt ac41e9a6eb Fix music fading when fading back to the same piece that is currently fading out. 2014-12-09 23:37:39 +01:00
Sven Eberhardt 35b65cd78c Use COMMENT (not COMMENTS) as the category field to select songs when using SetPlayList. 2014-12-09 23:37:34 +01:00
Sven Eberhardt baf05264d1 Implement music fading.
Moved music system execution from game tick execution into main application execution so music fading works when the game is paused or lagging.
2014-12-06 18:04:55 +01:00
Sven Eberhardt 62e6da2f23 Add categories for .ogg music files that can be referenced in SetPlayList. 2014-12-06 00:06:08 +01:00
Martin Plicht 1ddb8ebf39 mac: Quit from main menu also calls Application.Clear() 2014-11-01 15:47:04 +01:00
David Dormagen bb2ec10afd fixed incorrect type of handle for some WIN32 file operations
The return type is intptr_t which may be 64bit. Stuffing that into an int can lead to an overflow, which then can lead to the error check (if handle < 0) failing.
Which has caused me to need to restart the game soooo many times already... Like some sort of old car with a broken starter.
2014-10-18 09:22:56 +02:00
Sven Eberhardt e23c009fd9 Fix thread guards to use thread IDs instead of handles (#1161)
GetCurrentThread() returns the same pseudo-handle for every thread. It cannot be used to determine if two calls were made from the same thread.
2014-10-16 20:22:38 +02:00
Martin Plicht cf474e99aa mac: Rearrange sound toolkit includes and FindAudio.cmake so that sound+music works for OSX 2014-09-21 22:16:54 +02:00
Sven Eberhardt 144c8f8388 Implement music volume setting for OpenAL 2014-08-07 17:30:36 +02:00
Sven Eberhardt 271ef8ca09 Implement looping for OpenAL music.
Also added some error logging.
2014-08-07 15:51:58 +02:00
Sven Eberhardt cfe242b2b8 Implement ogg file playing for OpenAL-based audio system. (#1096) 2014-08-07 13:46:45 +02:00
Nicolas Hake 642ce2eb9c Merge all of the audio provider switches into one
There's no point in splitting the audio library selection into multiple
CPP macros, since there can always only be one anyway. Merge all of them
into a single macro AUDIO_TK (for "toolkit") and have CMake select one
for the user, instead of making him choose (and potentially failing).
2014-08-01 23:37:42 +02:00
Günther Brammer 8780a69b51 Improve the messages for path problems
C4Group::Open would sometimes overwrite more specific error messages or
not mention the problematic path. DirectoryIterator::Read also now mentions
more detail. Two superfluous messages were removed to make space.
2014-06-09 04:17:17 +02:00
Günther Brammer 8b927d142c win32: Use stdint.h instead of windows-only compiler extensions 2014-04-19 19:02:22 +02:00
Günther Brammer eed5836838 X11: Get the randr primary output only once
Not that its remotely likely that it changed in the millisecond between the
two requests, but the code is slightly clearer this way.
2014-04-19 19:02:21 +02:00
Julius Michaelis 67a99a88d9 Proper shutdown on SIGINT/SIGTERM/SIGHUP 2014-04-01 18:03:36 +02:00
Nicolas Hake 802cc8ece9 Fix some uses-after-free due to terrible StdBuf semantics 2014-03-19 14:21:23 +01:00
Martin Plicht 46df9d758c StdScheduler: Make DoScheduleProcs virtual, override it in C4AbstractApp and set isInManualLoop flag around the DoScheduleProcs call so the FlushMessages() of C4AbstractApp will happen when isInManualLoop is true 2014-02-16 14:54:32 +01:00
Martin Plicht c3dd3a08ce StdScheduler::Added is not necessarily called from the thread the
procedure is meant to be run on, so introduce yet another StdScheduler
extra method StartOnCurrentThread which on Mac OS X does the actual run
loop registration stuff and needs to be called from the actual thread
the scheduler is supposed to run on

StdSchedulerMac: Remove SCHAdditions objects again
2014-02-16 10:18:38 +01:00
Martin Plicht 4299faefd4 StdSchedulerMac: Was crashy because of faulty memory management which is now hopefully better 2014-01-29 22:57:19 +01:00
Martin Plicht 3ce7d7ae7f StdSchedulerMac: Only add NSRunLoop additions for main thread 2014-01-27 14:22:22 +01:00
Sven Eberhardt 32104f6bbe Change StdScheduler loop to work in MSVC2010. 2014-01-26 16:26:27 +01:00
Martin Plicht 911c9b7713 C4AbstractApp: ScheduleProcs timeout parameter defaults to 1000/36 instead of -1 so the timeout is not determined to be infinity down the road, leading to mac version not getting out of the poll call anymore 2014-01-23 17:53:40 +01:00
Martin Plicht d504626a40 StdScheduler: Split into StdSchedulerWin32/StdSchedulerPoll/StdSchedulerMac 2014-01-23 17:53:40 +01:00
Nicolas Hake e0dc30c59a Update copyright notices
As discussed in http://forum.openclonk.org/topic_show.pl?tid=2917, I
have merged all copyright notices into a single file and referenced that
merged file from each source file.

For the updated source files, the timeline has been split into three
parts:
 1. Pre-RWD code (before 2001)
 2. RWD code (2001 through 2009)
 3. OpenClonk code (2009 and later)
All pre-RWD copyright notices have been left intact, as have RWD-era
copyright notices where the file did not have a RedWolf design copyright
notice but only individual author ones. All copyright notices of the
OpenClonk era have been replaced by a single notice ranging from the
first recorded year to the current year (2013). Mape code did not get a
OpenClonk Team copyright notice because it is somewhat separate from the
main OpenClonk codebase and has only been touched by Armin Burgmeier.
2013-12-23 13:03:19 +01:00
Tobias Zwick 33f99bd361 buildfix for linux 2013-12-09 21:21:41 +07:00
Tobias Zwick a3c641b6fc fix error on negative timeouts in the scheduler for linux 2013-12-09 00:50:02 +07:00
Tobias Zwick 74087e2fc2 remove superfluous IsScheduledExecution
use C4TimeMilliseconds::PositiveInfinity instead to denote that the next tick should not be executed.
2013-12-09 00:50:01 +07:00
Tobias Zwick b97d250aef adapt C4TimeMilliseconds usage in C4AppGTKImpl to the infinity-usage 2013-12-09 00:49:59 +07:00
Tobias Zwick 5bcd762206 C4TimeMilliseconds returns a StdCopyStrBuf to avoid memory errors 2013-12-09 00:49:58 +07:00
Tobias Zwick e9eea97864 make rest of the code not use C4TimeMilliseconds-pointers but instead use the infinity field. 2013-12-09 00:49:57 +07:00
Nicolas Hake 71dbd5bcfb Use std::numeric_limits<> instead of INT32_MIN/INT32_MAX
We're implementing parts of <stdint.h> ourselves for old compilers, and
these macros aren't part of our compatibility interface.

Additionally, [C99 §7.18.2] (unfortunately, MSVC ignores this):
"226) C++ implementations should define these macros only when
__STDC_LIMIT_MACROS is defined before <stdint.h> is included.", which it
wasn't, so it wasn't portable in the first place.
2013-12-08 14:13:15 +01:00
Tobias Zwick b73eabd4fd add infinity-field to C4TimeMilliseconds, add linker error (*cough*) 2013-12-08 19:11:28 +07:00
Tobias Zwick bdc895655d add AsString method to C4TimeMilliseconds 2013-12-08 16:28:58 +07:00
Tobias Zwick f5592a49e6 build fix 2013-12-08 04:05:56 +07:00
Tobias Zwick fe2a400c02 replace global function GetTime() with class function C4TimeMilliseconds::Now() 2013-12-07 21:27:01 +07:00
Julius Michaelis ebff82641c Linux build fix for Newton 2013-12-04 19:19:33 +01:00
Tobias Zwick 3e5268ab19 buildfix for linux (missed out on a Linux-specific StdSchedulerProc) 2013-12-04 20:47:12 +07:00
Tobias Zwick 94c618d153 add new type C4TimeMilliseconds for time measurements to solve problems when GetTime() overflows (#251)
The new type C4TimeMilliseconds behaves for the most part like a uint32_t but is overflow-proof in comparisons.
In some places, a 0-value (or uint_max) of the variable storing the time had the special meaning "not set yet". This has been resolved by having it as a pointer to C4TimeMilliseconds with NULL meaning that it has not been set yet.
2013-12-04 19:35:07 +07:00
Nicolas Hake 15fcd8c51d Add missing <time.h> include 2013-12-01 13:09:39 +01:00
Nicolas Hake 52fd2679cd Fix line endings broken by ecf538c, 7b9c1d5, and ceca8b8 2013-11-29 14:18:48 +01:00
Tobias Zwick ceca8b8fc7 add SoundAt function in C4Script (part of #238), document
also, extend the documentation for Sound with previously undocumented parameters; threw out undocumented and also unused "multiple" parameter.
2013-11-29 18:20:36 +07:00
Tobias Zwick 7b9c1d5a9e refactor: consistently use time_t t... variables for times in network system, scheduler, gui
The network used to cast GetTime() to int, but GetTime() is an unsigned long. This might cause problems if GetTime() returns big integers (see #251). To solve this, the StdSchedulerProc interface had to be extended with another function in order to eliminate the magic return value -1 of GetNextTick for "no scheduled execution".
2013-11-29 17:28:04 +07:00
Tobias Zwick ecf538cd1f refactor: consistently use time_t t... variables for times in sound system, stats, application and player controls 2013-11-29 14:16:14 +07:00
Nicolas Hake 6399d7f4a4 win32: Dump crashes to UserDataPath instead of cwd (#996)
The working directory on windows is very likely to be the directory of
the binary itself. If we've installed to Program Files, that means we
cannot actually write there. That means we have to find a better place
to write dumps, and the user directory is a better place.
2013-11-10 19:35:56 +01:00
Nicolas Hake f1d9abee68 win32: Disable callback crash filter on Vista
We're already disabling that filter on Windows 7 and up using the
application manifest, but Vista doesn't know about Windows 7
compatibility. Turn off the filter on Vista as well.
2013-11-10 19:22:27 +01:00
Martin Plicht 60bafd6b3b Change remaining #ifdef USE_GL blocks into #ifndef USE_CONSOLE blocks (this makes Linux version work again) 2013-11-09 00:20:14 +01:00
Martin Plicht 59742510d9 linux/mac: Fix compilation after D3D removal 2013-11-03 11:44:20 +01:00
Tim Blume 240193ad5a Remove remains of Direct3D support
Direct3D hasn't worked for more than a year now, and there don't seem to
be any efforts to revive it. Remove it and concentrate on better OpenGL
support.
2013-11-02 21:39:34 +01:00
Nicolas Hake 82b15553a1 C4AppGTK: Avoid SEGV on quit during initialization
When C4AbstractApp is destroyed, it will try to reset the current
video mode. This includes switching off the fullscreen flag of the
render window. When no render window has been created yet, for
example during the application initialization phase, this led to a
null pointer dereference due to a missing check.
2013-10-31 23:27:52 +01:00
Martin Plicht cc11006f22 mac: Fix build 2013-10-04 22:34:57 +02:00
Martin Plicht fb4117307b mac: Fix Screen::rcBounds <> window size discrepancy + fullscreen windows still fill screen with less than fullscreen resolution in settings 2013-09-02 23:10:32 +02:00
Martin Plicht 8e387dd05a mac: Make Screenshot (of whole map) in main menu 2013-09-02 23:09:48 +02:00
Martin Plicht 41926866cc mac: Remove mouse-warping silliness (it doesn't work with tablets and I'm stupid D:) 2013-07-05 23:14:16 +02:00
Tobias Zwick a6adc2465f fix scancodes convert on windows for non-fullscreen 2013-05-30 21:51:34 +02:00
Tobias Zwick 61ee6d393f Correct the scancode numbers for windows
Also reduce the duplication of these numbers in C4Window.h and C4KeyboardInput.cpp.
2013-05-26 18:07:09 +02:00
Martin Plicht 1d829361f7 mac: Minimal fix after scancode merge 2013-05-24 19:55:56 +02:00
Günther Brammer 9506c5ad97 Merge branch 'scancodes' 2013-05-24 17:47:59 +02:00
Sven Eberhardt 451f11bd37 Fix looping sounds under OpenAL 2013-04-09 22:31:02 +02:00
Sven Eberhardt 6250ff1766 Silence a few MSVC warnings 2013-04-01 12:48:02 +02:00
Günther Brammer 71d9e3c9e3 editor: Recognize pressing shift and alt in viewport again 2013-03-24 22:10:11 +01:00
Sven Eberhardt 3a7eb5bcd6 oops. remove superfluous debug log. 2013-02-27 00:27:14 +01:00
Sven Eberhardt f5647d05fe Fix sound volume when using OpenAL 2013-02-27 00:20:49 +01:00
Nicolas Hake e33521c7ab Win32: Fix build without -fpermissive 2013-02-21 00:28:58 +01:00
Nicolas Hake ca6e474a15 Win32: optionally embed a build ID into crash dumps/minidump files
In order to get an embedded build ID, add a new CMake cache variable
named OC_BUILD_ID. This variable can contain an arbitrary string, but
it is suggested that you use a hierarchical string starting with your
DNS domain, reversed, as in "com.example.openclonk.arbitrarystring"
(think java packages).
2013-02-21 00:06:34 +01:00
Nicolas Hake 0c04606707 Win32: clean up crash handler pointer string format selection 2013-02-21 00:06:34 +01:00
Nicolas Hake d2719bedd6 Win32: Make crash handler show the full EFLAGS register 2013-02-21 00:06:33 +01:00
Nicolas Hake 041016d087 Win32: Make crash handler properly show modules in stack traces 2013-02-21 00:06:32 +01:00
Günther Brammer 2a9d63cb2a gtk: Use higher-resolution logo as window icon
Metacity started to display bigger icons in the window list, so the higher
resolution is now actually useful for me. While at it, use gdk-pixbuf-csource
to generate the .h at build time from the .ico instead of duplicating the
data in the repository.
2013-02-12 01:08:02 +01:00
Martin Plicht f9863f2b1b mac: Change type of K_* constants from int to C4KeyCode (int <-> long discrepancy) 2013-02-11 11:39:40 +01:00
Oliver Schneider 582e75d3da Use scancodes instead of localized key (#729)
The options dialog still shows localized keys, but the config files use US-Layout keys (when loading default files) and scancodes when saving player changes.
2013-02-09 01:05:27 +01:00
Günther Brammer 9d34c4e30d gtk: Make the window fullscreen even when not changing the resolution 2013-01-24 19:36:59 +01:00
Günther Brammer 414cb8a4c7 gtk: GDK_KEY_* constants require at least GTK+ 2.21.8 2013-01-20 18:41:07 +01:00
Günther Brammer 864c5c7ea8 copyright notices update 2012 2013-01-12 16:31:40 +01:00
Günther Brammer 41c88ba863 Use _snwprintf instead of swprintf
Apparently the C standard committee and Microsoft couldn't agree on how
swprintf should work.
We previously tried to work around the resulting breakage, but I just got
the following compilation error. It's really better to avoid that function
entirely. Since we only used it in windows-specific code, the
windows-specific _snwprintf is a nicely compiler-independent replacement.

src/platform/PlatformAbstraction.h: In function ‘int swprintf(wchar_t*, size_t, const wchar_t*, ...)’:
src/platform/PlatformAbstraction.h:243:12: error: redefinition of ‘int swprintf(wchar_t*, size_t, const wchar_t*, ...)’
/usr/lib/gcc/i686-w64-mingw32/4.6/../../../../i686-w64-mingw32/include/swprintf.inl:30:5: error: ‘int swprintf(wchar_t*, size_t, const wchar_t*, ...)’ previously defined here
2012-12-31 22:03:12 +01:00
Günther Brammer 2d05c9501c Make StdSync.h compile with neither windows nor pthreads again 2012-12-31 22:03:12 +01:00
Armin Burgmeier e03c980038 Linux: Fix a crash when no primary output is specified 2012-12-28 17:32:12 +01:00
Armin Burgmeier dfdd0fba3e Remove debug logs in X11 gamma ramp code 2012-12-02 15:52:29 +01:00
Armin Burgmeier 55b2a15d15 SaveDefaultGammaRamp: Return true if everything worked correctly 2012-12-02 15:52:13 +01:00
Armin Burgmeier fab541798f SaveDefaultGammaRamp: Don't crash if primary output is not connected
Instead, use the first connected output from the list of all outputs.
This happens on my computer, probably because the desktop environment
does not set the correct primary output.
2012-12-02 15:51:06 +01:00
Armin Burgmeier e8a4628d6a Fix xrandr version check for gamma ramp modification 2012-12-02 15:10:27 +01:00
Armin Burgmeier 0556bd6cd7 Initialize all variables in C4X11AppImpl 2012-12-02 15:09:44 +01:00
Günther Brammer 8cfd88f0d2 Make dedicated server compile with fmod 2012-11-30 22:20:16 +01:00
Günther Brammer 327bfa31e7 Remove some superflouos output from the dedicated server 2012-11-30 22:20:16 +01:00
Günther Brammer b5ae4f1f9d Move CStdInProc to its own source file
It should be usable without USE_CONSOLE, even though only the dedicated server
uses it at the moment.
2012-11-30 22:18:38 +01:00
Günther Brammer cb74726158 Fix some BSD portability issues
Thanks to mdg on the forum and the Debian buildd.
2012-11-19 17:23:31 +01:00
Günther Brammer 069b36a1bd X11: Finish xf86vidmode removal 2012-11-18 01:07:59 +01:00
Günther Brammer 7967d94a59 Merge StdFont.cpp and C4Fonts.cpp 2012-11-12 02:30:16 +01:00
Günther Brammer 4dffefe8c9 X11: Remove support for the xf86vidmode extension
In practice, only the xrandr code path received any testing. Since Clonk
works fine without changing the resolution, this will not terribly
inconvenience anybody still stuck on old systems without xrandr.

Also only minimize the window when the resolution was changed.
The minimization is there to prevent accidental focus restoration
resulting in unwanted resolution switching.
2012-11-17 18:07:37 +01:00
Sven Eberhardt 99992b6f47 Fix sync loss and missing landscape or objects when joining two consecutive games without restarting the engine inbetween
Caused by an outdated cache of the DirectoryIterator in the main scenario group
2012-11-17 19:44:04 +01:00
Günther Brammer a8dfeeaf7e win32: Make USE_CONSOLE compile again
There's even a plausible implementation of CStdInProc::GetEvent.
2012-11-15 23:01:24 +01:00
Günther Brammer c7e270d9d2 Fix SDL mainloop build 2012-11-01 18:10:38 +01:00
Tobias Zwick 12423b4b4f fix possible problems with several monitors on windows 2012-10-28 02:35:29 +02:00
Günther Brammer 77479e4f71 Get the window size fresh from the window instead of storing it
This makes Application.GetConfigWidth/Height simply return the appropriate
configuration value instead of mixing configuration and state in the same
function. The caller needing the state now uses C4Window::GetSize instead.
2012-10-22 23:15:48 +02:00
Tobias Zwick 1ae7d55a21 fix odd cursor jumping on mousewheel use on windows (#439) 2012-10-28 02:11:03 +02:00
Julius Michaelis c4506a2b69 Fix entering fullscreen mode in lobby
Remove a debuglog
2012-10-14 17:45:01 +02:00
Julius Michaelis 69bbc6b4d1 Fix resolution reset in editor mode and on tabbing out
Win32's SetVideoMode doesn't enumerate display modes anymore for windowed mode
2012-10-14 13:28:38 +02:00
Martin Plicht 38256bfaac mac: First startup with no resolution configuration uses desktop resolution, resolution switching from options works correctly 2012-10-13 15:01:13 +02:00
Armin Burgmeier 26e7ae3532 Fix crash when changing AA setting on Linux (#744) 2012-10-13 14:15:09 +02:00
Armin Burgmeier 2ce648e5b5 Fix a GTK warning when changing anti-aliasing 2012-10-13 12:49:53 +02:00
Sven Eberhardt 8bdd761027 PlayerControls: Allow usage of keyboard scan codes instead of virtual key names using $%x format (Win32 only)
Also re-resolves keys if the keyboard layout changed at runtime.
2012-10-09 00:54:34 +02:00
Sven Eberhardt dada37d70e Sound system: Fix leaking channels when using OpenAL. (This caused sounds to stop after playing for a while) 2012-10-07 17:03:46 +02:00
Sven Eberhardt 6e953acc88 Sound system: Fix endless recursion when a sound couldn't be started due to lack of free channels 2012-10-07 16:34:08 +02:00
Sven Eberhardt 00349f045a SoundSystem: Implement non-apple wav loading when using OpenAL 2012-10-07 13:18:28 +02:00
Julius Michaelis 87854916ba Fix fix: cb043bd90678
Quickfixes are bad
2012-10-07 12:42:51 +02:00
Sven Eberhardt 15aa9b961e FIx build using OpenAL in MSVC 2012-10-05 18:02:52 +02:00
Tobias Zwick 41a33999cd remove video playback feature 2012-10-04 23:03:57 +02:00
Julius Michaelis ab880d6bd8 Fix 2c9e6ac9f614 (windows + logic) 2012-10-03 00:54:56 +02:00
Julius Michaelis 023aa90c0e Add config option for automatic windowed/fullscreen switching 2012-09-29 23:49:30 +02:00
Martin Plicht b264612b10 mac: Move C4EditorWindowController from platform to editor 2012-09-02 20:57:49 +02:00
Martin Plicht 562565f865 mac: Move C4OpenGLView.mm/h to graphics/C4DrawGLMac.mm/h and move some C4AbstractApp functions to C4AppMac.mm to better match implementations for the other platforms 2012-09-02 20:51:43 +02:00
Martin Plicht c2c484e70b mac: Rename C4AppDelegate.consoleController to editorWindowController 2012-09-02 16:18:20 +02:00
Martin Plicht 10a328d5ba mac: Change prefix of Objective-C classes/filenames from Clonk to C4, give xib files names that make more sense 2012-09-02 15:39:29 +02:00
Martin Plicht f389fd230c mac: Fix C4FileMonitor implementation by reporting files modified since last 3 seconds 2012-09-02 14:59:30 +02:00
Martin Plicht f6825d073e mac: Compile with Automatic Reference Counting enabled 2012-09-02 13:56:53 +02:00
Martin Plicht f7a26ba1a5 mac: Filter out Cocoa command line arguments that confuse clonk when started from the Xcode debugger 2012-09-02 11:24:49 +02:00
Martin Plicht ee140e4d08 mac: C4Application::SetVideoMode: Use desktop size when passed iXRes=iYRes=-1 2012-09-02 10:51:35 +02:00
Günther Brammer f6db61750e Store the size of the non-fullscreen-window separately
The size of that window can be adjusted by the player, so there is no need
for a GUI option.
2012-08-30 00:13:14 +02:00
Günther Brammer cc25878ba6 Default to not changing the resolution
1. We receive bugreports that changing the resolution doesn't work, but
can't reproduce that
2. Flat screens look best at their natural resolution
2012-08-19 20:59:01 +02:00
Nicolas Hake 58ac553956 Win32: Do not reset graphics mode if no change is required 2012-08-28 00:01:01 +02:00
Nicolas Hake faf0006a6f Win32: Improve error reporting when changing resolution 2012-08-28 00:00:29 +02:00
Günther Brammer 06cb8b595d win32: Remove obsolete #include multimon.h
multimon.h was only needed for compatibility with Windows 95.
2012-07-18 03:40:19 +02:00
Nicolas Hake 59b48f5069 Win32: Accept dropped definition files
Viewport windows had the required code to hande dropped files, but didn't tell
the window manager they'd accept drag & drop messages.

Also pull a loop invariant out of the loop (drop point can't change while we're
processing the drop message) to save function calls in cases with more than one
dropped file.
2012-05-23 22:37:07 +02:00
Günther Brammer 1995b59adc win32: C4Window::SetSize calls AdjustWindowRectEx, GUI::Dialog doesn't need to 2012-04-28 15:09:35 +02:00
Günther Brammer 1a29f8625d Reorder engine source file organization a bit
This mostly consists of flattening the hierarchy, splitting the
graphics stuff out of platform, and a few smaller cleanups.
2012-04-27 19:04:43 +02:00
Armin Burgmeier e11e9845d1 Fix Windows build 2012-04-23 21:45:01 +02:00
Martin Plicht cd4db8ebaf mac: Remove KeyMask assignment and inline HandleNSEvent 2012-04-23 20:14:42 +02:00
Armin Burgmeier 206f90adbc Pass through key state handling from event callbacks (#745)
This gets rid of Application.IsAltDown() and friends which was used for
this purpose in C4MouseControl and C4EditCursor. In case non-event
callbacks need to access the state of the modifier keys the state is
now cached in these classes (if it wasn't already).

This new solution is supposed to be more robust, since the key modifier
state comes always directly from the input event. This fixes #745, where
Application.IsAltDown was stuck for some reason.

I updated the Windows and Mac code as well, but wasn't able to test it,
it might not compile and/or not work, in which case please someone fix it :)
2012-04-22 22:09:06 +02:00