Commit Graph

3486 Commits (544c1cbb4bb6da97d30571ff28772660c7ad5969)

Author SHA1 Message Date
Lukas Werling 97f06fd0cd Fix openclonk-server build 2016-02-12 22:40:55 +01:00
Günther Brammer c332fe940b Merge branch 'sdl-mouse' 2016-02-12 21:11:21 +01:00
Lukas Werling 24ef8b43af Grab the mouse while in-game (#1637)
This only implements this for the SDL port for now.
2016-02-12 21:09:40 +01:00
Günther Brammer 92217e51e0 GLX: Use gdk instead of XLib to make glXCreateContextAttribsARB not exit 2016-02-12 20:39:39 +01:00
Günther Brammer 0c0c64642a Remove unused #define in C4AulParse 2016-02-12 17:15:46 +01:00
Lukas Werling f505b31032 SDL: Fix mouse button handling
- The right mouse button didn't work at all.

 - The left mouse button stopped working when clicking multiple times
   without moving the cursor.
2016-02-11 22:29:10 +01:00
Lukas Werling 392b7bab72 SDL: Add support for the mouse wheel
Fixes #0001682
2016-02-11 22:17:42 +01:00
Nicolas Hake 5f895c14fc Materials: Fix misspelling of "Incendiary" (#1680)
The wrong spelling will still be accepted as a material value, as long
as no value with the correct spelling exists.
2016-02-09 23:45:02 +01:00
David Dormagen 91391c64af draw global particles on plane 900
Previously, global particles would be drawn even in front of Plane 1000+ (GUI) objects. Additionally, it was impossible to specify particles that were supposed to always be in front of all other particles (e.g. fog, clouds, emulated FoW, ...).
Now, you can attach particles to an object on plane 901+ and have them be in front of everything else.
2016-02-09 20:43:23 +01:00
Armin Burgmeier 582cba01ed Build Fix 2016-02-08 21:28:44 -08:00
Nicolas Hake 43aa11623a Fix off-by-one error in FoW renderer (#1678)
The FoW renderer would try drawing to texture coordinates one pixel
too high (i.e. if the texture was 256 pixels high, it would draw to
pixels with 1 <= y <= 256 instead of 0..255).
2016-02-08 22:58:18 +01:00
Nicolas Hake a204439f80 C4FontLoader: Stop manually managing memory
Instead of implementing a dynamically growable array with new and delete
and memcpy like cavemen, we'll use a vector of smart pointers.
2016-02-08 22:58:17 +01:00
Maikel de Vries 159dbf071f make ContactCalls a property instead of DefCore entry
This allows for useful runtime changes, like disabling contact calls when an animal dies.
2016-02-08 21:25:43 +01:00
Nicolas Hake 142b7ea7c3 RegCreateKeyEx: Pass NULL as lpClass
The lpClass parameter isn't used, and it is valid to pass NULL for it.
It is, however, not valid to pass a string literal, because the
conversion to nonconst char* has been deprecated in C++ for a long time
and doesn't exist anymore in C++11.
2016-02-08 17:36:50 +01:00
Nicolas Hake d5dbcb71da ShowGfxErrorDialog: Fix handle leak
CreateProcessW will return a handle the main thread and a process handle
to the child process. These handles must be closed to avoid a resource
leak.
2016-02-08 17:36:50 +01:00
Nicolas Hake 3d9b322f51 Fix incorrect CreateProcessW call
Quoth MSDN: "The Unicode version of this function, CreateProcessW, can
modify the contents of this string. Therefore, this parameter cannot be
a pointer to read-only memory (such as a const variable or a literal
string). If this parameter is a constant string, the function may cause
an access violation."

It can, however, be NULL, which does the right thing automatically.
2016-02-08 17:36:50 +01:00
Nicolas Hake 64a5388d4d C4Surface: Remove broken "support" for split textures
Most code already didn't handle textures larger than GL_MAX_TEXTURE_SIZE
and only used the first one in case of a split texture.
2016-02-08 17:36:50 +01:00
Nicolas Hake 7b04914fc4 C4Surface: Make dbg_index unsigned int instead of int*
It seems like an odd decision to add a layer of indirection to this,
especially since it's just a pointer to int instead of a pointer to a
larger structure.
2016-02-08 17:36:50 +01:00
Nicolas Hake 059e9e7060 C4Surface: Explicitly mark copy ctor/assignment op deleted 2016-02-08 17:36:50 +01:00
Nicolas Hake 5fe327663f Fix signed int overflow in BltAlpha (#1661)
The red color channel calculation could overflow into the sign bit,
which is undefined behavior. At least one compiler takes advantage of
this and assumes it cannot happen, resulting in incorrect results.

BltAlphaAdd looks similar, but does in fact not have this bug because it
shifts the color channel far enough that multiplication can't overflow.
2016-02-08 02:39:54 +01:00
Nicolas Hake 4fdafbc78a Move StdColors.h ref from C4Surface.h to files that actually need it
C4Surface.h doesn't require anything from StdColors.h, so there's no
reason to reference the latter there.
2016-02-08 02:13:18 +01:00
David Dormagen 59739b5cf6 script GUIs: do not catch mouse-up without prior mouse-down (#1327)
Otherwise, you could open a menu on mouse-down, which would then block the mouse-up event. The control system (not the script but the engine!) would then never know that the button was released and issue a key event with repeated=1 when you pressed the button the next time.
This could lead to issues.
2016-02-07 10:47:33 +01:00
Sven Eberhardt 439b1f481c Register Objects.c script as global constant to make it accessible from outside 2016-02-06 21:12:22 -05:00
Günther Brammer b129e5f210 gtk: Remove unused variable 2016-02-06 23:48:13 +01:00
Günther Brammer 23d34f75ec Remove some dead graphics code 2016-02-06 23:46:58 +01:00
Günther Brammer 2434b22b20 Improve SDL2 OpenGL context error message 2016-02-06 23:46:58 +01:00
Sven Eberhardt 44121a00eb MAPALGO_Scale: Fix scaling coordinates for common case of blitting scaled surfaces from one surface to another. 2016-02-06 16:10:34 -05:00
Günther Brammer 4b4b8781a0 Make GTK+ and SDL2 work together
If the gamepad code initialized the SDL video subsystem, GTK+ crashed in
libX11. Or something along those lines.

Making the optional subsystems using SDL for gamepads and audio use
SDL_InitSubSystem and only the SDL Application port do the full SDL_Init
is the proper way to do things in any case.
2016-02-06 21:12:56 +01:00
Günther Brammer 32d8d0db76 Finish the update from SDL_Mixer to SDL2_Mixer 2016-02-06 17:28:15 +01:00
Günther Brammer 408dfff96e Fix indentation of the KeyCodeMap table
It used a mix of tabs and spaces for indentation, and tabs to separate the
columns, which doesn't work with variable tab sizes and variable column
widths. Use tabs for indentation and spaces for column separation.
2016-02-06 16:50:47 +01:00
Günther Brammer 934b519bb4 Update the SDL port to SDL2
SDL2 is a much closer match to the other platform code, and
allows the creation of OpenGL 3 core contexts, which is
now required.
2016-02-06 16:48:21 +01:00
Günther Brammer 1010732ba8 Fix the SDL build 2016-02-06 16:47:56 +01:00
Günther Brammer 59e5a327b2 gtk: Add support for microsoft windows 2016-02-06 16:47:44 +01:00
Günther Brammer 487277b58d WGL: Stop caching the window handle in the GL context 2016-02-06 15:54:47 +01:00
Sven Eberhardt 92e03d8fdd Remove unused variable in C4ControlScript::Execute() 2016-02-02 21:51:51 -05:00
Günther Brammer e5f75c5a44 Remove a bunch of dead code, mostly player control related 2016-02-03 03:17:23 +01:00
Günther Brammer 52de8900dd Script: Remove PlayerObjectCommand 2016-02-03 03:17:22 +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 cd01561d65 Remove Config.Graphics.RenderInactiveEM 2016-02-02 00:25:57 +01:00
Nicolas Hake 301a088ebc StdColors: Remove several orphaned functions 2016-02-02 00:00:26 +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 0c3811fe66 Keep rendering while unfocused (#1638)
In windowed mode, we shouldn't stop rendering just because we have lost
focus. However, we don't need to render at full framerate; throttling to
5 fps should be sufficient. Note though that we still have to calculate
game ticks at full speed so network games don't slow down when a player
tabs out of the game.
2016-02-01 20:48:17 +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
Maikel de Vries e7c296104f set controller of dig2material objects when the digger exists
This ensures correct kill tracing for example a piece of coal falling on an enemy after being dug out.
2016-02-01 20:20:26 +01:00
David Dormagen 6c5294a05f fixed invisible UI elements accepting player input
When an UI element was only visible to a player (via the Player property), it still allowed ALL players to click on buttons.
I am wondering why noone else noticed that bug before. It's possible that it didn't show when the visibility was set via the menu's Target (instead of the Player property).

Maybe this was the cause of the "clicks sometimes do nothing" bug?
2016-01-31 23:36:06 +01:00
Günther Brammer 03d11cd596 Merge script branch 2016-01-31 21:51:58 +01:00
Günther Brammer a6b1ee79e9 Fix assertion failure when rendering mesh with degenerate transform
It isn't enough to check the top-level mesh, because attached meshes also
get a transformation from script. At least cotton branches sometimes do
that.

So check the matrix directly before using it and skip rendering.
2016-01-31 21:51:50 +01:00
Sven Eberhardt 6e251832b8 Fix league signup with usernames containing non-ascii characters 2016-01-31 12:26:07 -05:00