Commit Graph

24 Commits (81ba07cc486263e594ac751400ae15d8e0c88428)

Author SHA1 Message Date
Sven Eberhardt 81ba07cc48 reproduce lights assertion in C4Application constructor 2015-02-17 21:03:50 +01:00
Nicolas Hake 4db690b0c6 Add copyright header to files that were missing it 2015-02-16 18:40:52 +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
Peter Wortmann e8bf04840f Fix some refactoring bugs (#1227)
The "b" value returned by the new find_cross function had basically
nothing to do with what the old version did (it was for the other
pair of coordinates *and* sign-switched). This is not cosmetical - the
algorithm depends quite a bit on this being consistent.

Additionally, most of the list modifications in CalculateTriangles were
wrong (didn't reprocess last triangle for ascend shadowing, and the descend
case was removing the wrong triangle). I admit the old code was probably a
bit too tricky with how it handled "i", so I attempted to refactor it to
make it less easy to screw up in future.
2015-01-14 14:23:26 +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
Tobias Zwick 1ad16efe23 fix intermediate fade point sometimes end up overlapping the fan 2014-12-06 01:44:18 +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 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 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
Tobias Zwick 239cd222e5 implement/fix clipping during rendering of light 2014-11-17 23:02:00 +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
Tobias Zwick 7963065eb8 rename C4FoWRay to C4FoWBeam, add some documentation 2014-10-12 12:59:25 +02:00
Tobias Zwick 21e532da23 split up C4FoW header and source file into one file for each class
* added some class and method documentation, removed some superfluous comments like

	void C4FoW::Update(C4Rect r)
	{
		// Update all lights
		...

* added ASK comments that need clarification before proper documentation
2014-10-11 23:13:10 +02:00