Commit Graph

2809 Commits (48ae42f87e82f26e696ba62c1f4de82d90949522)

Author SHA1 Message Date
Mark af3efead76 Fix reloading of skeletons (#1180) 2015-01-06 18:35:16 +01:00
Mark 10b343dba9 Append and include skeletons (#1180)
Appending and including skeletons works now. Documentation updated.
Skins such as appendto.Clonk.Farmer.skeleton are handled as if the skin name were not included: appendto.Clonk.skeleton

This also changes a bit the structure of how meshes are reloaded in general,
in particular mesh materials are only reloaded once and not once per
C4DefGraphics instance. (Fix crash on reload with included skeletons, cherry picked from commit 2f69aa4850ab7a4b621e5f30cbc537d40f32c0df)

Fix linking of C4Script standalone tool (cherry picked from commit b03a332b73463b378c94e4e92b66d45b923b3b9c)
2015-01-06 18:25:08 +01:00
Mark fc402c18ab Central skeleton loader (#1180)
C4DefList now creates one StdMeshSkeletonLoader and stores all skeletons in this loader. Before this change every definition created its own loader.
2015-01-06 18:24:30 +01:00
Armin Burgmeier dffed48b3d Fix crash on ambient map update outside landscape bounds (#1216) 2015-01-06 11:47:25 +01:00
Martin Plicht b9c68f2208 mac: Fix build (C4Viewport ViewX/Y accessors) 2015-01-05 01:38:35 +01:00
Tobias Zwick 6cf5ba325a use true/false instead of 0/1 as return for a FnSetViewOffset 2015-01-04 22:09:01 +01:00
Armin Burgmeier d4ac1d0694 Fix possible crash after a mesh has been reloaded 2015-01-04 18:29:44 +01:00
Armin Burgmeier 039e03824a Fix buffer underflow in GetExtension() 2015-01-04 18:29:36 +01:00
Sven Eberhardt c2d9e1b46e Change MouseAutoScroll default to off for now. 2015-01-04 15:49:11 +01:00
Sven Eberhardt cce2eaa389 Fix emergency mode of MapLayer->FindPosition() finding positions outside search rect. 2015-01-04 15:43:51 +01:00
Armin Burgmeier 1c68526440 Remove unused function C4DrawGL::EnsureAnyContext() 2015-01-04 13:36:29 +01:00
Armin Burgmeier 338910949d Fix build with GTK+ 2015-01-04 12:13:48 +01:00
Sven Eberhardt 42b9ca4577 Add custom EditCursorCommands available in editor context menu.
Example: this.EditCursorCommands = ["Explode(20)"] on an item will offer a menu entry to explode the object. Commands may be either strings or function pointers, but function pointers will always be called by name.
2015-01-03 23:21: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 a0bddb92a3 Use size_t for a loop variable that is compared with a sizeof() result
src/script/C4Script.cpp:159:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for (long i = 0; i < sizeof(values) / sizeof(*values); ++i) \
                     ^
2015-01-03 20:58:07 +01:00
Günther Brammer d9e3d9db3d Require filenames to be in unicode, remove iconv usage
Every modern operating system and Clonk uses UTF-8, and windows uses UTF-16
and has its own conversion code.
2015-01-03 20:41:03 +01:00
Sven Eberhardt ec7540e404 Fix ICONV build 2015-01-03 19:06:19 +01:00
Sven Eberhardt fed6f8d65f Fix Linux/Mac build. 2015-01-03 19:03:18 +01:00
Sven Eberhardt 98093961ec Add packet logging option.
This should reduce log spam in network games.
2015-01-03 18:15:41 +01:00
Sven Eberhardt 49f991c819 Move shader logging into separate file and log only in editor mode (#1209) 2015-01-03 17:53:59 +01:00
Armin Burgmeier 1e77de1044 Merge branch 'lights'
Conflicts:
	src/c4group/C4Components.h
2015-01-03 16:00:20 +01:00
Sven Eberhardt f25edc64df Do not render lights of hostile objects on player-owned viewports. 2015-01-02 01:42:24 +01:00
Tobias Zwick f5ecd4776d new function SetLightRange (replaces SetPlrViewRange) 2015-01-02 01:06:00 +01:00
Günther Brammer 8889aeb128 win32: Compile Win32 scheduler for other GUI toolkits, too 2015-01-01 22:13:56 +01:00
Günther Brammer 0dc87f761f Remove unused SDLMain.nib/objects.nib (was from CR Macosx port) 2015-01-01 22:13:55 +01:00
Tobias Zwick 3e307fc843 fix previous commit 2015-01-01 17:27:41 +01:00
Tobias Zwick 2a4b268087 fix the same bug as Sven2 10 minutes ago, but also clean up the update function, rename variables, add comments, etc. 2015-01-01 16:08:32 +01:00
Sven Eberhardt 9a87240d47 Fix off-by-one error in landscape X bias calculation. 2015-01-01 15:52:15 +01:00
Armin Burgmeier 61b05f92c3 Remove unused FoW tracking in C4Player
The FoW decay mechanism is not needed anymore, either, because the light
system itself is already slowly fading out when the light changes.
2014-12-29 23:09:31 +01:00
Armin Burgmeier 748b565259 Remove objects from light sources when dead or removed 2014-12-29 23:09:04 +01:00
Armin Burgmeier ae505e3c6b Render FoW only if active for player
This allows to enable or disable FoW individually for each player with
SetFoW().
2014-12-29 23:08:17 +01:00
Armin Burgmeier a508fb38e7 Remove GL shade model changes
This gets rid of GL state changes for questionable gain. It also fixes drawing
of fade sky backgrounds in global viewports (where, for some reason, the shade
model was set to GL_FLAT instead of GL_SMOOTH).
2014-12-29 22:27:49 +01:00
Armin Burgmeier 2f08918393 Add FoWEnabled entry in Scenario.txt [Game] section (#1178) 2014-12-29 12:29:43 +01:00
Armin Burgmeier a3049207c9 Use full ambient lighting in global viewports
This allows to see the whole landscape without any areas covered by FoW
in the global viewport. Basically the ambient lighting is set to 1.0
independent of the ambient light map. In the course of this, a second
shader for the landscape has been introduced.
2014-12-28 15:07:42 +01:00
Armin Burgmeier c687ea4040 C4Viewport: Fix memory leak of C4FoWRegion object 2014-12-28 14:07:50 +01:00
Armin Burgmeier 2ebb15c5db Fix crash on player elimination (#1191) 2014-12-28 12:28:25 +01:00
Armin Burgmeier 3306d9163c Use default lighting for picture mesh graphics
Instead of flat shading.
2014-12-27 20:05:28 +01:00
Armin Burgmeier 8116a96ed4 Fix fragment coordinate transforms (#1192)
There were two problems with the previous transforms:
  1) For inverting the Y axis for the ambient map, the total height of the
     output window is needed, not only the viewport region.
  2) The Y offset to only use the part of the light texture that is being
     rendered to was not applied.

In order to keep the transformations more readable, a new lightweight class
C4FragTransform has been introduced which can only handle translations
and scales in x and y.
2014-12-26 16:16:09 +01:00
Armin Burgmeier 8686441d45 Make mesh shaders use the C4Shader slice machinery 2014-12-22 22:56:30 +01:00
Armin Burgmeier fdd94a3311 Add named slice positions for vertex shaders 2014-12-22 22:56:30 +01:00
Armin Burgmeier 574149e289 Pick up a shader slice only after a newline
Otherwise a workaround such as "#define slice(x)" would not work for non-OC
shader code.
2014-12-22 22:56:30 +01:00
Armin Burgmeier 5c98fdccec Make C4ShaderCall use a const C4Shader* 2014-12-22 22:56:30 +01:00
Armin Burgmeier d6bdf9a6e0 Add possibility to add vertex slices from the parser 2014-12-22 22:56:30 +01:00
Armin Burgmeier 8c42704181 Rename some shader files and add basic shader for meshes 2014-12-22 22:56:30 +01:00
Armin Burgmeier 7f1cf15274 Change slice syntax such that positions appear in parentheses
This allows to ignore slice declarations using `#define slice(x)`, which
mill be useful for custom mesh material shaders, allowing to write them
such that they can be used standalone in a mesh viewer but also as slices
for OpenClonk, in which case lighting and color modulation will be applied
automatically.
2014-12-22 22:56:30 +01:00
Mark 305637b246 Loading skeletons separately (#1180)
Animations are now part of the skeleton, and skeletons are loaded before meshes. They are stored in a map in StdMeshSkeletonLoader. This is only the first part of changes for #1180.
2014-12-20 23:11:33 +01:00
Tobias Zwick 4981182cf8 Merge remote-tracking branch '_origin/master' into lights
Conflicts:
	src/c4group/C4Components.h
2014-12-15 21:16:40 +01:00
Armin Burgmeier e0bfc3211c Fix definition packing order (#1189)
To match the changed loading order from previous commit
2014-12-15 09:07:50 -05:00
Mark 99acc31098 More readable C4Def::Load
The load function now calls several functions for loading specific files, even if these functions may be very short. The behaviour changed slightly: Sounds are now always loaded before the graphics. Enables loading sounds even if the graphics are invalid.

Conflicts:
	src/object/C4Def.cpp
2014-12-14 22:09:55 -05: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
Sven Eberhardt bd1f59cb2d Fix Win32 MinGW build.
I hope...
2014-12-14 13:43:58 +01:00
Sven Eberhardt 296a1b8f8d Auto-select nVidia GPU on Optimus laptops.
Since we're no longer using DirectX, nVidia's automatic detection no longer works classifies OpenClonk as a game to use the high performance GPU. Note that this flag does not work on some old drivers (version<302 according to specs). To support these old drivers, we would have to link against DirectX despite not using it.
2014-12-14 13:24:16 +01:00
Sven Eberhardt dd9fdbb159 Log information about GPU used by OpenGL on startup. 2014-12-14 12:35:22 +01:00
Sven Eberhardt 9db21442b7 Fix assertion when drawing boxes on non render targets.
This doesn't fix material preview in editor mode yet but at least there's no more assertion. We should probably create a proper render target surface for that.
2014-12-13 15:14:51 +01:00
Nicolas Hake 9089f6857f Remove Sort field from C4FolderHead
This field apparently was intended to be used in folder maps, but was
already unused in Clonk Rage, and has never been used in OC either.
2014-12-12 22:54:42 +01:00
Tobias Zwick d59b1e5e5b reduce version numbering from x.y.z (x does never changes) to y.z 2014-12-12 21:57:52 +01:00
Kevin Zheng 4fae398672 Fix build on 32-bit architectures 2014-12-10 21:45:41 +01:00
Sven Eberhardt b641650443 Do not fade out music on scenario section loading.
Instead, scripters can use SetPlayList() or Music() to fade music by script if desired.
2014-12-09 23:48:19 +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
Armin Burgmeier ab4de05b4f Fix light/ambient drawing offset when upperboard is active 2014-12-07 21:54:12 -05:00
Armin Burgmeier ffed845849 Build fix 2014-12-07 14:59:38 -05:00
Sven Eberhardt 612a05fe40 New script function: GetPXSCount.
Counts number of loose pixels of a material in an area.
2014-12-07 19:52:05 +01:00
Mark 3971d60614 Match partial skeletons (#1177)
When using AttachMesh() with the flag AM_MatchSkeleton the behaviour was changed. The child mesh no longer uses the transformation of the bone in the parent skeleton by order, but by name.
2014-12-07 01:11:04 +01:00
Mark 1f4f280539 Bugfix: Missing AttachParent in AttachedMesh
On loading a savegame with attached meshes, the AttachParent of their child is NULL.
2014-12-07 01:11:02 +01:00
Armin Burgmeier 7a8778acca Make sure graphics resources are loaded before drawing anything
This was not required before, but now most drawing operations require
the shaders to be loaded from Graphics.ocg. Therefore, move the graphics
resource loading earlier in the startup sequence, and make sure we don't
initialize the message board prematurely in OnResolutionChanged().
2014-12-06 17:16:36 -05:00
Sven Eberhardt bbe01335d9 Fail scenario saving if object saving returned nil (#1182).
This usually means there was a script error in the scenario saving function. Better abort instead of overwriting the existing scenario with garbage data.
2014-12-06 22:45:38 +01:00
Armin Burgmeier e46c558671 Fix a delete / delete[] mismatch in C4ParticleSystem 2014-12-06 15:42:42 -05:00
Armin Burgmeier 377d8ab1d0 Set pack alignment to 1 before reading the GL pixel buffer (#1181)
Otherwise the default pack alignment is 4, and when the horizontal window dimension
is not a multiple of 4, glReadPixels() would read past the end of the buffer we
provided.
2014-12-06 15:42:42 -05:00
Armin Burgmeier f58f7ad770 Initialize all structures when writing BMP file
Otherwise, we would partly write files with uninitialized data, such as the
padding bytes in a BMP, or the palette if not specified explicitly. This
mostly fixes corresponding valgrind warnings, but also makes sure we obtain
the same BMP files everytime we store the same StdSurface8 object, bit-by-bit.
2014-12-06 15:42:42 -05:00
Armin Burgmeier dd16b2d588 Set useful name for in-memory CStdFiles
This fixes a valgrind warning when creating a savegame, since in that case
the file name is filled with uninitialized junk. It is not used at other
places, since it is an in-memory file, and therefore was probably harmless.

Now we give a useful name to in-memory files based on the address of the
StdBuf object, which might actually be useful when debugging.
2014-12-06 15:42:42 -05: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
Tobias Zwick 1ad16efe23 fix intermediate fade point sometimes end up overlapping the fan 2014-12-06 01:44:18 +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
Mark d0a74d9af3 Merge remote-tracking branch 'origin/master' 2014-12-03 20:08:41 +01:00
Mark 0e9c0e9be4 AttachMesh with added functionality (#1177)
Simple implementation of matching skeletons/animations. Short description added to the documentation. More functionality to follow.
2014-12-03 20:05:36 +01:00
Mark dda9599003 Extracted skeleton from StdMesh.
Skeleton is now represented by the class StdMeshSkeleton.
2014-12-03 20:04:54 +01:00
Armin Burgmeier a792a1c6a2 Fix possible race condition in C4ParticleSystem construction
Previously, the calculation thread was initialized before the event it was
going to wait for after it is launched. However, since the thread starts its
execution in its constructor, it might access the event before the event
itself has been constructed.

This is fixed by making sure the event is fully constructed before the thread
is constructed (and launched).
2014-12-03 11:03:51 -05:00
Armin Burgmeier 254e1e4631 Apply drawtransform on sprite normal map
This makes the normals point into the correct direction for transformed
objects, which is for example the case when they are rotated with SetR.
2014-11-26 17:56:43 -05:00
Armin Burgmeier e58b62920c Change extension of shader files from .c to .glsl 2014-11-25 11:54:36 -05:00
Armin Burgmeier 5054322b6d Enable lighting shaders for particle rendering 2014-11-25 11:42:17 -05:00
Armin Burgmeier 56b19ac065 Fix brush preview in GTK+ developer mode
This looks like an artifact from when the alpha channel was inverted.
2014-11-24 16:32:25 -05:00
Armin Burgmeier 192dddec6f Use the new shader system for rendering sprites
This now also avoids the use of conditionals in shaders by using different
shaders instead.
2014-11-24 14:51:08 -05:00
Armin Burgmeier a06e5a4aee Add some more variants of the uniform setters 2014-11-24 14:51:08 -05:00
Armin Burgmeier 5c6ed34a3a C4Shader: Deactivate shader units in reverse order
This makes sure that GL_TEXTURE0 is the active texture unit
after the shader call. Some parts of the engine such as the
particle system rely on that.
2014-11-24 14:51:08 -05:00
Armin Burgmeier 292f8e8191 Improve GL error outputs 2014-11-24 14:51:08 -05:00
Armin Burgmeier a7f9ba1e91 Compute ambient texture coordinate based on fragment coordinate
This will allow to use the same shader slice also for the sprite and mesh
shaders.
2014-11-24 14:51:08 -05:00
Armin Burgmeier f550fcdf43 Add C4Draw::GetClipRect()
This will allow to avoid some code duplication when computing the coordinate
transform from fragment coordinates to ambient and light texture coordinates.
2014-11-24 14:51:08 -05:00
Tobias Zwick 3483d1f367 fix clipping problem for real 2014-11-23 22:50:49 +01:00
Tobias Zwick 117758848c Revert "fix clipping bug during the raytracing phase" (no fix after all)
This reverts commit 7a47c95c08.
2014-11-23 21:33:28 +01:00
Tobias Zwick 7a47c95c08 fix clipping bug during the raytracing phase 2014-11-23 21:23:58 +01:00
Tobias Zwick 43d7bbfa73 make Peter's change conform to the naming scheme 2014-11-23 18:39:24 +01:00
Tobias Zwick 256c86fccd Merge remote-tracking branch '_origin/lights' into lights
Conflicts:
	src/landscape/fow/C4FoWLight.cpp
	src/landscape/fow/C4FoWLight.h
2014-11-23 18:06:10 +01:00
Tobias Zwick 3a8fb34bea shorten and make intermediate fade triangle render code more performant 2014-11-23 17:50:21 +01:00
Tobias Zwick a1794359cc squash and simplify function to find cross-intersection again 2014-11-23 17:49:29 +01:00
Tobias Zwick e33ef90bba fix a bug in the intermediate fade triangle render code 2014-11-23 17:46:59 +01:00
Tobias Zwick 8850d2e755 replace algorithm to calculate the intermediate fade point with a more failsafe version 2014-11-23 17:45:53 +01:00
Tobias Zwick 294838e0a4 outsource translating coordinates of triangles into a function 2014-11-23 17:42:09 +01:00
Tobias Zwick 800885a21b add const keyword to some methods 2014-11-23 17:40:24 +01:00
Peter Wortmann 7dd4d1900b Split fan where the normal maxes out
This gives a more consistent normal distribution across directions.
I actually had to make the "normal region" of the light bigger, because
now the Clonk's face would be all dark otherwise. In the end,
everything looks smoother and less flashy now, which is probably as
it should be.

Also slight refactoring.
2014-11-21 15:32:33 +01:00
Tobias Zwick 6bd5beafde make certain fades a bit smoother by reimplementing PeterW's NEWER_INTERFADE_CODE. This is only a very slight effect, but visible 2014-11-20 23:43:14 +01:00
Tobias Zwick 1b96eaabf2 move find_cross function to a different class, reimplement 2014-11-20 23:43:13 +01:00
Tobias Zwick 815a61c540 fix a bug in intermediate fade generation 2014-11-20 23:43:12 +01:00
Armin Burgmeier db6df15377 Add SetAmbientBrightness and GetAmbientBrightness script functions 2014-11-20 17:07:31 -05:00
Armin Burgmeier d60c74c6b6 Fix viewport offset for lightmap lookup 2014-11-20 16:45:34 -05:00
Peter Wortmann 9672ae8947 Framebuffer update improvements
Now we use the shader to do a proper blend - this avoids some artefacts
that were visible before. Also after some hair-pulling the coordinate
transformation now seems to be more correct than before. Maybe even
with zoom. We'll see.
2014-11-20 21:48:46 +01:00
Peter Wortmann 7fea618221 Collected trivial bug-fixes
Turns out we actually can't optimise out the second texture normal
lookup - it makes a noticeable difference in-game. Also there was
possible slice collision, it might be worth warning about this kind
of stuff.

Also removed unused variable, and made error messages more consistent
in terms of whitespace.
2014-11-20 21:44:11 +01:00
Peter Wortmann 72289713f9 Modular shader system
The idea here is that we compose shaders out of "slices", which can
come from the engine ("built-in"), from files or possibly even from
models. This should allow us to more easily share the code between
different rendering shaders (e.g. for lights / normals).

TODO: Workarounds not yet implemented, so this might degrade less
gracefully.
2014-11-20 11:52:14 +01:00
Armin Burgmeier b43e1a9369 Fix ambient texture coords when viewport is smaller than full render target 2014-11-18 16:44:06 -05:00
Armin Burgmeier 48456f5f99 Fix transparency in regions with no ambient and low dynamic light 2014-11-18 16:33:27 -05:00
Armin Burgmeier 2df2ee22d6 Update ambient map on landscape changes 2014-11-18 15:42:53 -05:00
Armin Burgmeier 643ca7fd0a Add functionality to update the ambient map at runtime 2014-11-18 15:42:39 -05:00
Armin Burgmeier 39f5b6f15a Apply landscape re-lighting again in every frame
This was accidentally removed in commit
56bdeec585. It fixes the landscape being
only updated once every second when digging.
2014-11-18 15:42:22 -05:00
Armin Burgmeier ac75c7041b Remove two unused declarations in C4Landscape
There are no implementations anymore for these.
2014-11-18 15:42:22 -05:00
Armin Burgmeier 5ac6ea6a3c Fix FoW deinitialization in C4Landscape 2014-11-18 15:42:22 -05:00
Armin Burgmeier c8ea5d1f85 Explain the one-second relights in a comment
Should make it a bit quicker for the next person to figure out what is
going on there...
2014-11-18 15:42:22 -05:00
Armin Burgmeier 72255a7e04 Optimize generation of the ambient map
The new algorithm is ~25% faster
2014-11-18 11:06:26 -05:00
Armin Burgmeier ee33c58cfe Don't apply the dot product to transparency in lighting calculation
This fixes the transparency issue with the coconut tree.
2014-11-17 20:51:18 -05:00
Armin Burgmeier 86d2ba7d68 Fix the build 2014-11-17 20:30:41 -05:00
Tobias Zwick e7c9c176b1 fix clipping 2014-11-18 00:30:27 +01:00
Armin Burgmeier 0520c5fcdf Use a named enum for the internalformat parameter of glTexImage2D 2014-11-17 17:53:06 -05:00
Armin Burgmeier 34e100aeb6 ambient: fix some debug code 2014-11-17 17:53:06 -05:00
Armin Burgmeier 5ae426e7bf Fix too large radius when converting radius from landscape to ambient coords
This is basically a leftover to do rounding when the radius was an integer
and not a floating point number.
2014-11-17 17:53:06 -05:00
Armin Burgmeier fc67eca754 ambient: Clamp sample values outside the landscape to the landscape border
GetPix() already has some handling for outside values, however that does not
always give the desired result.
2014-11-17 17:53:06 -05:00
Tobias Zwick 239cd222e5 implement/fix clipping during rendering of light 2014-11-17 23:02:00 +01:00
Tobias Zwick 96729ef57c refactor C4FoWLightSection::CalculateTriangles to also use the C4FoWBeamTriangle data structure; refactor the variable names 2014-11-17 23:01:59 +01:00
Armin Burgmeier 88f8f75441 Add ambient lighting
This introduces a new texture, an ambient light map, that is generated
automatically at the beginning of the round by the sky portion of the
landscape. This basically makes everything that is close to sky visible
by default.

The shaders have been adapted so that they deploy direction-independent
lighting for the ambient component, and the current (diffuse) behaviour
for the diffuse component. This makes the shaders use an additional
texture unit that represents the ambient light. We can think about merging
this information into the light texture, but the coordinate systems are
different at the moment, so this could be performed at the stage of light
texture generation.

For meshes, the ambient material is not actually used, but instead a
diffuse light from the front is used. This makes many meshes look more
interesting, maybe also because the ambient material setting of most
meshes are not set correctly at the moment.
2014-11-17 09:35:50 -05:00
Armin Burgmeier e64875d1c7 C4Landscape: Make GetPix and _GetPix const 2014-11-17 09:13:01 -05:00
Tobias Zwick 7f1ca342c2 another build fix 2014-11-16 20:36:12 +01:00
Tobias Zwick eb6bba9c4e fix linker error for G++ and clang 2014-11-16 20:18:09 +01:00
Tobias Zwick fd0163ebc6 refactor and document: C4FoWLightSection only calculates the triangles now, C4FoWLight stitches everything together and renders
* intermediate fade triangles are now calculated in C4FoWLight
* rendering takes also place in C4FoWLight, using different C4FoWDrawStrategies
* solved an old TODO from Peter (int -> int32_t)
* refactor and simplify portions of the light vertex calculation code
2014-11-16 18:57:42 +01:00
Armin Burgmeier 00447dd524 Merge branch 'master' into lights 2014-11-12 08:47:43 -05:00
Armin Burgmeier fb5365c2b1 Fix possible crash when drawing empty pix or line PXS 2014-11-12 08:46:53 -05:00
Armin Burgmeier c3bcedfbf9 Don't attempt mouse hover callbacks when mouse control is passive (github #5) 2014-11-07 20:16:30 -05:00
Armin Burgmeier ebeeb534ce CreateParticleAtBone: Take object rotation into account (#1173) 2014-11-07 19:57:04 -05:00
Armin Burgmeier 137abb89df Implement normal maps for sprite graphics 2014-11-07 15:29:09 -05:00
Armin Burgmeier 672e343b84 Remove C4DefGraphics::CopyGraphicsFrom()
It is not used.
2014-11-07 15:28:13 -05:00
Armin Burgmeier 5b54a3d6ea Remove fixed-function lighting for meshes
The light direction is now taken from the light texture, so the only thing that is
still needed is the material definitions.
2014-11-07 12:08:06 -05:00
Armin Burgmeier aed907e30d Remove old fog of war 2014-11-07 11:53:10 -05:00
Armin Burgmeier 219fa8597c Implement light calculations for meshes 2014-11-06 15:56:19 -05:00
Armin Burgmeier 0795715465 Apply lighting on sprites 2014-11-06 15:56:19 -05:00
Armin Burgmeier a6d949d313 Merge branch 'master' into lights 2014-11-04 11:26:45 -05:00
Armin Burgmeier 73e4f5a89c Remove some unused code in C4Draw 2014-11-04 11:24:55 -05:00
Armin Burgmeier a1bafb937f Implement DrawQuadDw with PerformMultiTris
This simplifies the code further.
2014-11-04 11:02:40 -05:00
Armin Burgmeier 9e9f0cee9d Avoid setting oc_ClrModMap shader parameter when clrmodmap is not used
Otherwise, ResolveAutoParameter() does not set the correct parameter type, and
the code would try to set a sampler2D parameter as a float4. It does not matter
in principle since the shader would not use the texture anyway, but it
generates a GL error that is avoid this way.
2014-11-03 14:39:17 -05:00
Armin Burgmeier f89058f094 Remove config entries that are no longer used 2014-11-02 16:57:50 -05:00
Armin Burgmeier fe7897539a Remove unused code 2014-11-02 16:57:28 -05:00