Commit Graph

6912 Commits (8e5aed4bea1da6bd6ce3fd7d682df03cf9479574)
 

Author SHA1 Message Date
Sven Eberhardt 90cca08d63 Add /todo message board command.
Adds text to local TODO.txt file. Useful for taking notes quickly e.g. when testing new scenarios in a network game.

TODO filenames are configurable. Default file is TODO.txt in the scenario file (if it's unpacked) and TODO.txt on the current path if access to the first location failed.
2015-03-05 16:04:07 +01:00
Nicolas Hake 179498984d Upload dummy bone for boneless meshes (#1278)
As long as we're not actually using a different shader for meshes
without bones, we need to upload an identity matrix so there's defined
data in the bone slot.
2015-03-05 13:09:40 +01:00
Nicolas Hake 4639ce1675 Merge GPU skinning
Doing skinning on the GPU shows a noticeable performance improvement in
pretty much any situation, but especially so in scenes with lots of
animated objects with high polygon counts.
2015-03-04 12:26:51 +01:00
Maikel de Vries 650447ff19 Fix category of wind generator wheel helper object 2015-03-02 22:35:10 +01:00
Maikel de Vries 599d57c33a in c4script: SetCategory(0) -> SetCategory(C4D_None) 2015-03-02 22:24:25 +01:00
Maikel de Vries 5e456cda8a flag marker category none
This ensures no interactions with other objects, also note a Plane needs to be set for a C4D_None object.
2015-03-02 20:46:48 +01:00
Maikel de Vries ee0bc7b7ff introduce a constant for no category 2015-03-02 20:42:34 +01:00
Nicolas Hake 2db2992f85 Don't check for errors in C4ShaderCall::Finish
Calling CStdGL::CheckGLError calls glGetError, which is really, really
slow because it has to flush the pipeline to check whether there's an
error or not. Plus it's not like we can do anything about it anyway. If
you want to be notified when an error happens, pass --debug-opengl to
the executable.
2015-03-01 22:42:23 +01:00
Maikel de Vries 46d9dfbf88 option for Branch/Trunk for underground-only placement 2015-03-01 21:33:52 +01:00
Maikel de Vries c303b745f5 remove unused pInventory variable in clonk script 2015-03-01 21:22:40 +01:00
Sven Eberhardt 12d4fbb51b Fix documentation on new_color parameter in Layer.SetPixel to include option to set it as string.
e.g. SetPixel(x, y, "Granite") is possible.
2015-03-01 21:06:18 +01:00
Maikel de Vries 6af6348a32 clean up dummy object 2015-03-01 14:02:16 +01:00
Maikel de Vries 96af2bb84c GetActiveSequence function for sequence object
Can be used to test whether a sequence is already running, and did some clean ups as well.
2015-03-01 14:02:16 +01:00
Maikel de Vries 5e685be1cd make GetBases a single function in base respawn rule
This allows for more easy overloading.
2015-03-01 14:02:16 +01:00
Nicolas Hake d13af4dadd Work around g++'s dislike of nonconstant offsetof 2015-02-28 13:42:33 +01:00
Nicolas Hake d2563fe345 Do skinning in hardware
Instead of transforming all vertices on the CPU every time an animation
progresses, we now only recalculate the skeleton, leaving the heavy
lifting for the GPU. This also means we no longer have to push all
vertices onto the bus every frame, because the mesh isn't changing and
can therefore be stored in a GL_STATIC_DRAW VBO when it's first loaded.
The downside of this approach is that there's only a limited number of
uniforms and vertex attributes we can pass to the shader. At the moment
these limits are a maximum of 128 bones per skeleton, and no vertex can
be influenced by more than 8 bones at once. So far this is no problem,
as the most complex skeleton in the base game uses less than 64 bones
and no more than 6 bone weights per vertex.
2015-02-27 21:51:58 +01:00
Nicolas Hake 517e4e6e85 Load default object vertex shader from Graphics.ocg
Instead of having the default vertex shader hard-coded into the engine,
allow to load it from Graphics.ocg. There's still a fall-back version
wired into the engine because we can't return an error from
GetVertexShaderCodeForPass.
2015-02-26 21:04:12 +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
Maikel de Vries e5e5665294 add callback to object when it gets controlled by tele glove 2015-02-25 18:44:31 +01:00
Nicolas Hake c66833e2db GL: Render meshes out of a VBO
While we're still not doing skinning on the GPU, copying the vertex data
to a VBO immediately after updating the animation allows us to re-use
that data for unanimated meshes. It also allows us to store unanimated
data on the GPU, instead of transferring it over the bus for each frame.
2015-02-24 18:36:58 +01:00
Nicolas Hake 5b0759952e Make C4Landscape::ForPolygon private 2015-02-23 14:00:24 +01:00
Nicolas Hake 344962797d Make ForLine take a functor instead of a raw pointer
This means we can drop the opaque parameter. Where additional data is
required, a lambda is the way to go here. It also means we don't have to
put half of the parameters into a global variable.
2015-02-23 14:00:22 +01:00
Nicolas Hake a2f06c6ac5 Move ForLine function into C4Landscape.cpp
C4Landscape is the sole consumer of this function, so there's no reason
to make it available outside.
2015-02-23 13:39:51 +01:00
Nicolas Hake 3e85419d02 Add Travis CI integration
This will make it easier to see breaking changes for pull requests
received on GitHub.
2015-02-23 13:39:50 +01:00
Peter Wortmann 65d9953d32 Some clean-ups
Nothing spectacular. Main thing is that the light debug view is now even
more colourful.
2015-02-23 11:54:41 +01:00
Peter Wortmann fc5698444f Make light shine through material that's closer than its size
Makes the whole thing more robust in corner cases. Also means that the
terrain a Clonk walks over doesn't matter that much anymore, which is
probably good.

On the other hand, now walls can be "partially invisible", which can
cause strange light effects. We'll have to see whether this is looks bad
in practice.
2015-02-23 11:54:40 +01:00
Peter Wortmann 48ae42f87e Hard-code line endings of shell scripts to LF
No idea whether this is the right way to do this.
2015-02-23 11:54:37 +01:00
Maikel de Vries bd9da84fcb allow developers to also let airplane face left 2015-02-23 11:13:02 +01:00
Peter Wortmann d976a4b2a7 Reworked CalculateTriangles, fixed descend collision
Descend collision was broken because of two reasons - one complicated and
one easy. Firstly, we would not re-visit beams after eliminations if they
were closer to the light source than the remaining beam. Especially nasty
because the comments claimed the opposite. Secondly, the coordinates
passed to find_cross were actually flipped.

I took the opportunity to clean up the control structure a bit, update
the comments (brr), and fix the bug in one swoop.
2015-02-22 23:12:12 +01:00
Peter Wortmann 52a2f4bb8e Added (optional) debug logging to CalculateTriangles
Sadly it's virtually impossible to tell what's going on without this kind
of thing.
2015-02-22 23:11:44 +01:00
Peter Wortmann 696ebb083f Decrease threshold for eliminating small rays
There's no point in having rays smaller than 1/10 px. This also, again,
prevents floating point rounding causing consistency problems.
2015-02-22 23:11:44 +01:00
Maikel de Vries 94019dd335 callback for projuct ejection in producer library 2015-02-22 19:03:30 +01:00
Nicolas Hake 72beae8100 Shortcut C4Surface::GetTexAt for unsplit texture
In the very common case where the C4Surface only uses a single texture
to store its data, a lot of work GetTexAt is actually unnecessary. Split
it up so we can inline the fast path and only fallback to the slow path
when the surface is split up into multiple textures.
2015-02-22 17:06:35 +01:00
Nicolas Hake 32ecf51029 Don't use std::auto_ptr
Ever.
2015-02-22 17:05:41 +01:00
Nicolas Hake 75c2b8e61c GL: Dump list of supported extensions with --debug-opengl
glGetString(GL_EXTENSIONS) is deprecated starting with OpenGL 3.0.
Instead, you're now supposed to retrieve the list of extensions one by
one with glGetStringi.
2015-02-22 15:52:38 +01:00
Nicolas Hake bc6ce0251f Make private funcs in C4ParticleValueProvider, well, private
We're not inheriting from C4PVP, and all of these internal functions
really shouldn't be called from outside the class. So private is what
they should be.
2015-02-22 11:30:12 +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 0b55cea227 Disable assertions in non-debug builds
Making the engine terminate when an assertion fails is a good thing in
debug builds, but keeping them enabled in release builds only hurts our
users.
2015-02-20 23:36:36 +01:00
Nicolas Hake 6e41694495 GL: Check for OpenGL 2.1 on startup
We've been using OpenGL 2.1 features for some time now, and hardware has
started supporting OpenGL 2.1 in 2005. I doubt this will make anyone
unable to run the game, and it's certainly better than crashing because
of a nullpointer dereference when some GL function we use can't be
found.
2015-02-19 13:36:01 +01:00
Nicolas Hake bd4e772b7d Win32: Correctly deselect OpenGL context
The MSDN reference for wglMakeCurrent states that the first (hdc)
parameter is ignored when the second one is NULL. This is incorrect: it
checks validity of the hdc parameter before doing any work. Since we
have a DC anyway, it's no problem to pass that to wglMakeCurrent.
2015-02-19 13:04:30 +01:00
Nicolas Hake c1bb56e1f1 Win32: Don't write log to stdout in GUI apps
In applications targeting the GUI subsystem, stdout and stderr aren't
valid file handles, and trying to write to them sets the system error
code to ERROR_INVALID_HANDLE.
2015-02-19 13:02:16 +01:00
Nicolas Hake ceeb322a87 Win32: Keep GL error dialog from immediately closing
GL startup failures call Application.Clear(), which will at some point
before creating the error dialog post a WM_QUIT. When the dialog box's
message loop retrieves that message, it will shut down the dialog box,
thus ensuring that the user will never see it.
So before showing the dialog box, we have to dispatch any pending
messages, then retrieve the WM_QUIT ourselves, run the dialog box, then
re-post the WM_QUIT.
2015-02-18 23:02:34 +01:00
Maikel de Vries ba9a5fd757 fix fire spreading (#1276) thanks to Armin 2015-02-18 21:52:39 +01:00
Maikel de Vries 40e0ea7bfc fix door control for wooden cabin 2015-02-18 18:25:49 +01:00
Sven Eberhardt fe1ecd2424 Implement loading of serialized light sections. 2015-02-17 21:05:52 +01:00
Maikel de Vries 1687b34fd3 fix script runtime error in fire effect when object is deleted on incineration 2015-02-17 20:55:17 +01:00
Nicolas Hake 26043e7e81 GL: Return a reasonable string for GL_DEBUG_SEVERITY_NOTIFICATION 2015-02-17 19:45:08 +01:00
Sven Eberhardt 68eb45732e Log all relevant data for reproduction on tri.fanRY > tri.fanLY assertion.
Just compiling the logged light section and calling CalculateTriangles on it should be used to reproduce the assertion.
2015-02-17 01:31:10 +01:00
Nicolas Hake 9bfd232ab5 Test whether GLDEBUGPROCARB's userParam is const or not
Depending on how current your headers are, the userParam parameter to
GLDEBUGPROCARB may be const, or it may not. The ARB has added the const
qualifier at some point after publishing the specs. Hooray for breaking
API changes.
2015-02-16 21:21:31 +01:00
Maikel de Vries 15f75f072b show exit interaction when inside object (#1169) 2015-02-16 20:31:29 +01:00