Commit Graph

887 Commits (master)

Author SHA1 Message Date
Günther Brammer 59e5a327b2 gtk: Add support for microsoft windows 2016-02-06 16:47:44 +01:00
Günther Brammer 70d25b0b91 gtk: Fold contents of C4AppGTKImpl.h into C4AppGTK.cpp
C4WindowGTK.cpp no longer needs anything from it.
2016-02-03 03:17:16 +01:00
Günther Brammer cc4da38f74 gtk: Remove unused C4X11AppImpl::gammasize 2016-02-03 03:08:53 +01:00
Günther Brammer d0fb24adda Merge epoxy preparation branch
Various changes to make the commit switching to epoxy smaller.
2016-02-02 03:35:13 +01:00
Nicolas Hake e9cf0f6fdc Stop pretending we support 16 bit color
The GTK and OS X platforms already ignored the requested bit depth and
always used 32 bit. Windows and SDL would set a 16 bit color depth for
the screen, but still did all of the rendering short of the final
present in 32 bit.
2016-02-02 00:00:23 +01:00
Nicolas Hake 98c966c7d1 Win32: Don't take/restore copies of all textures on app (de)activation
Even though we (might) change the resolution, that doesn't result in
loss of textures because we don't recreate the OpenGL context. Therefore
we also don't have to restore their data. I believe this code is a relic
from the DirectX renderer, which would lose textures when switching away
from a fullscreen window.
2016-02-01 20:48:17 +01:00
Günther Brammer 83cf09db1a GL: Replace CStdGLCtx::Reinitialize with parameter to Clear() 2016-01-29 16:52:36 +01:00
Sven Eberhardt d9b8de9ea2 Win32: Fix file deletion from scenario selection dialogue 2016-01-24 00:43:09 -05:00
Günther Brammer 7167459f67 win32: Move PIXELFORMATDESCRIPTOR from C4AbstractApp to CStdGLCtx
That is the only user.
2016-01-23 22:02:52 +01:00
Günther Brammer 37fd0a88c6 win32: Rename C4Window::hRenderWindow to renderwnd to match GTK+ 2016-01-23 22:02:52 +01:00
Günther Brammer 9210c65e85 gtk: Hide usages of X11 behind #ifdef GDK_WINDOWING_X11 2016-01-23 22:02:51 +01:00
Günther Brammer aa931ac623 Drop some dead code in C4App.h and C4WindowGTK.cpp 2016-01-23 20:36:34 +01:00
Günther Brammer 1c15b8f661 gtk: Move OpenURL to the other implementations in PlatfromAbstraction 2016-01-23 20:36:34 +01:00
Günther Brammer 8f48f0275d gtk: Remove unnecessary C4Window::wnd
It was only used to specify a screen for randr, which doesn't need a
particular window.
2016-01-23 20:36:34 +01:00
Günther Brammer 93f12150c4 CMake: Remove obsolete USE_X11 option and add USE_WIN32_WINDOWS
USE_WIN32_WINDOWS was previously defined in PlatformAbstraction.h. Move it
to CMakeLists.txt and config.h like its peers. Replace USE_X11 with USE_GTK
or GDK_WINDOWING_X11 as appropriate.
2016-01-23 20:36:34 +01:00
Günther Brammer bc3754b871 Merge branch 'editor' 2016-01-16 16:00:57 +01:00
Armin Burgmeier ef63aa0975 mac: send keydown events for modifier flags change (#1574)
For example, keydown events when pressing/releasing the shift, alt, or control
keys. With this version this is needed ingame e.g. to pick up objects with
Shift.
2016-01-10 18:11:29 -08:00
Günther Brammer 39c2a0e18c gtk: Use glib-compile-resources instead of gdk-pixbuf-csource
Yet another deprecated feature replacement. At least this one makes our
code more concise.
2016-01-11 01:52:49 +01:00
Günther Brammer ab7f4f0bbf gtk editor: Use GTK+ 3 layout widgets
Specifically, GtkGrid. For most cases, this is an increase in lines of
code, but the landscape tools dialog can now be done with just three layout
widgets.

While at it, use a toolbar and move the mode buttons into it, too.
2016-01-10 00:19:07 +01:00
Armin Burgmeier eb83fc96d0 linux: fix scrollwheel in fullscreen (#1535)
Both "normal" and "smooth" scroll events were handled, and undoing the
effects of one another.
2016-01-08 20:55:07 -08:00
Sven Eberhardt 53a6ec3139 Fix thread handle type for Win32 threads. 2016-01-09 00:19:40 -04:00
Nicolas Hake 9b34bf2634 Remove arbitrary inline forward declarations of StdBuf (and derivatives) 2015-12-29 21:42:46 +01:00
Günther Brammer 77a71c39d3 Require some C++14 support (make_unique, index_sequence) 2015-12-29 15:47:55 +01:00
Günther Brammer 6a53066c36 Include config.h only from PlatformAbstraction.h
In order to avoid duplication, PlatformAbstraction.h has to be included at
the start of every source file, so that various headers can rely on it
being there. To avoid confusion, always rely on that, instead of sometimes
randomly including it or parts of it again.
2015-12-28 18:50:31 +01:00
Günther Brammer 30e0cdb418 CMake: Re-enable readline support for openclonk-server 2015-12-28 18:48:45 +01:00
Nicolas Hake d737dc1b05 Remove C4Video, StdVideo
Video recording and playback only worked on Windows, and recording only
handled video, not game audio. As such, it was of fairly limited use,
and there's lots of software available these days that handle both.
2015-12-28 11:43:41 +01:00
Nicolas Hake f7ed26eb9e Make OpenAL extension init log entry slightly less useless
It's still pretty useless because nobody cares in the slightest about
which extensions are available and which ones aren't, but at least now
it doesn't throw an unintelligible list of numbers at you.
2015-12-27 01:54:44 +01:00
Armin Burgmeier d7a5ac373d Fix the console build on Mac
cmake still does not create a nice bundle for it, but at least
the build does not fail anymore.
2015-12-23 16:31:19 -08:00
Nicolas Hake da51a2d8af CMake: Have headless build as a project instead of a separate config
Hardly anyone ever tests the headless build, because it requires you to
run CMake a second time with -DUSE_CONSOLE=On. So now it's an included
project which you'll get whether you want it or not.

I'm well aware that this could be solved more nicely, and that we could
be splitting unchanged files out into a separate support library, but
that's left for a later date.
2015-12-16 00:50:09 +01:00
Sven Eberhardt 171080cbd5 Play frontend music by tag. 2015-12-12 12:08:45 -05:00
David Dormagen 35fe8f8683 sound system: warn about missing sounds (in debug mode only) 2015-12-10 19:35:55 +01:00
Sven Eberhardt 1cf188bb45 Fix music system running into infinite pause after playlist changes #1460 #1485
A playlist change would reset SCounter and eventually cause all songs to be non-eligable.

Since playlists can now select differently sized subsets, the old way of selecting random songs without too much repetition no longer works. Rewrite to use a more robust algorithm.
2015-12-10 00:31:20 -05:00
Sven Eberhardt afac3a4572 Fix music system debug message unit for pause length. 2015-12-08 23:42:08 -05:00
Sven Eberhardt ad2de2e012 Do not interpret all .ocg files in definitions and scenarios as sound subgroups. 2015-12-07 00:11:29 -05:00
Sven Eberhardt 96082569bd Allow sounds in subfolders and create namespaces for them (#1185) 2015-12-06 23:44:41 -05:00
Sven Eberhardt 8b2dd0a8bb Win32: Fix "beep" on handled hotkeys (Alt+[key]) in fullscreen mode #1488 2015-12-06 22:32:47 -05:00
Sven Eberhardt d758c85028 Add max memory time to music resume feature (#1461) 2015-12-03 19:17:41 -05:00
Sven Eberhardt cbb7b0ba2c Log music system info if Config.Sound.Verbose is enabled. 2015-12-02 23:08:50 -05:00
Nicolas Hake eb22e357b1 Win32: Prevent Alt key presses from opening the system menu (#1468)
Pressing the Alt key enters the menu modal loop, which takes control of
the thread that everything happens on. As a quick fix, we'll suppress
this loop for simple Alt key presses, but this will still happen when
the system menu gets opened by Alt+Space or clicking the icon in the
window's title bar.

A more permanent solution would be to detach the message loop from
everything else, by having rendering etc. run in a separate background
thread.
2015-11-30 21:33:36 +01:00
Nicolas Hake 24b54211c5 Drop Min, Max, Swap for std::min, std::max, std::swap
The C++ standard library comes with perfectly fine implementations of
these functions, so there's no point in reimplementing them just for the
hell of it.
2015-11-15 13:53:01 +01:00
Armin Burgmeier ef4ea2d931 Drop support for GTK+ 2
The minimum GTK version is now GTK+ 3.4, which is available since 2012.
It's part of Ubuntu LTS 12.04, and so should be available on any halfway
modern linux distribution.

This should allow getting rid of using deprecated GTK+ API much easier.
2015-10-18 14:45:52 -04:00
Nicolas Hake 9f03209ed7 Stop checking for nullptr
We're already requiring the compiler to implement C++11, so checking for
nullptr support again is useless.
2015-10-12 17:34:28 +02:00
Nicolas Hake 0c1abe69f9 Get rid of FMOD
Not only is FMOD neither free (libre) nor free (gratis), the version we
support(ed) is also impossible to legally obtain anymore. So there's no
reason we should keep code around that (pretends to) support a library
nobody can use or test.
2015-10-12 17:34:26 +02:00
Armin Burgmeier d28913a1cb Optimize loading of ogg files
Try to load the whole data in one go instead of re-allocating a vector every
8K bytes. This otherwise results in a lot of reallocations for O(MB)
(uncompressed) sound data.

This speeds up engine initialization by about a second for me.
2015-10-09 18:43:10 -04:00
Peter Wortmann 1ce2f8fe77 Warning fix 2015-10-04 14:26:00 +01:00
Peter Wortmann f0030e33e0 Warning fixes
Actually pretty sure a few of them were bugs. Hopefully no new
ones were introduced here.
2015-10-03 15:32:39 +01:00
Sven Eberhardt b5fe6ea02a Fix mac build. 2015-10-01 00:22:43 -04:00
Sven Eberhardt 3d7d848eea When fading from running songs, fade out and then start new songs directly instead of fading into them.
For songs that start abruptly, fading into them often ruins the beginning.
2015-10-01 00:08:35 -04:00
Sven Eberhardt 17e0e2f423 Add breaks between music. 2015-09-30 22:50:18 -04:00
Sven Eberhardt fc7d16b2aa Fix mac build (I hope). 2015-09-29 21:31:13 -04:00
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