Commit Graph

766 Commits (48ae42f87e82f26e696ba62c1f4de82d90949522)

Author SHA1 Message Date
Nicolas Hake cac94659d0 wGL: Allow OpenGL debugging
This introduces a new command line parameter "--debug-opengl", which
will create special debug OpenGL contexts and attach a callback that the
driver will invoke when it detects a problem. The callback will then
write the error message to the logfile, and break into the debugger if
one is attached.
Currently only works on Windows.
2015-02-16 17:45:10 +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
Sven Eberhardt 91fdb82720 Remove dupliocate sound loading. 2015-02-07 14:01:15 +01:00
Sven Eberhardt a237caa467 Save config to disk at round end (#1260)
This should ensure that MissionAccess gained in this round is always saved even if a crash happens during scenario shutdown or in a following round.
2015-02-03 22:49:55 +01:00
Sven Eberhardt c714e5e3b2 Fix full map screenshots (#1220).
Fixed upperboard, borders when screenshotting while at the side of the map and issues when multiple viewports were open.
2015-02-03 01:00:16 +01:00
Günther Brammer 4f9bc068ad Merge #include cleanup and SDL-mainloop fix 2015-01-25 20:47:50 +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 b00ff573cd Fix leaked light and some possible dead pointers on game end and section switch. 2015-01-25 18:39:34 +01:00
Sven Eberhardt 5e365e5236 Remove deprecated evaluation of CNMT rule in engine. 2015-01-25 14:35:18 +01:00
Sven Eberhardt 3d59e77f48 Do object post-load actions after global prop list denumeration. (#1240)
Post-load would access the action proplist which might have a non-denumerated prototype.
2015-01-21 23:18:07 +01:00
Sven Eberhardt 8dddbe5a10 Allow definitions without graphics. 2015-01-17 18:10:21 +01:00
Nicolas Hake f351e903ee Don't reset gamma with uninitialized graphics
When OC fails while in startup code, resetting the gamma ramp was trying
to use an uninitialized C4Draw, which would result in writes to invalid
memory.
2015-01-15 16:00:01 +01:00
Armin Burgmeier f2830311a6 Fix crash on scenario section change (#1221) 2015-01-14 12:03:05 -05:00
Mark f9369f9eb4 Different implementation of CreateObject() (#1214)
CreateObject() now does not reposition an object after it has been created, but rather grows it around the center of said object.
To that end a new parameter has been added to DoCon() and SetCon() and the documentation has been updated.
2015-01-13 21:03:27 +01:00
Armin Burgmeier a5c2e762f7 Fix memory leak when a viewport is re-initialized 2015-01-13 07:48:43 -05:00
Armin Burgmeier 57878a0604 Fix crash when viewing record with more than 2 players (#1228) 2015-01-12 16:37:51 -05:00
Armin Burgmeier e1d1d540c7 Allow independent viewport and light regions in C4FoWRegion (#1211)
With this change, an additional rectangle is stored in C4FoWRegion that
represents the area covered by the viewport in fractional floating point
coordinates. This allows the light texture to be created for an arbitrary
portion of the landscape, and the coordinate transformations for the
shaders will still work.

Also, since the additional rectangle uses floating point precision, the
computed coordinate transformations do now give the exact same result as for
the landscape pixel-by-pixel, and there should not be any offsets left.

I also hope that this change improves or fixes the single-pixel-lines of sky
that are sometimes seen at the edges of the viewport.
2015-01-07 19:44:31 +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
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 69f8ca27ec Move C4ApplicationSec1Timer to StdScheduler.h
There is nothing "Application" specific about this class.
2015-01-03 21:06:25 +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
Tobias Zwick f5ecd4776d new function SetLightRange (replaces SetPlrViewRange) 2015-01-02 01:06:00 +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 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
Tobias Zwick 4981182cf8 Merge remote-tracking branch '_origin/master' into lights
Conflicts:
	src/c4group/C4Components.h
2014-12-15 21:16:40 +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
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
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
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
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
Sven Eberhardt b310369b64 Initialize C4Game::CheckObjectEnumeration()::Check::maxNumber in ctor.
MSVC2012 build fix.
2014-10-26 20:44:06 +01:00
Martin Plicht e05bdfbcb4 C4Game: Refactor CheckObjectEnumeration to not use manual list traversal 2014-10-25 21:26:07 +02:00
Martin Plicht 03f43f462b C4ObjectList: Replace trivial cases of manual list traversal with iterator usage 2014-10-25 21:25:52 +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
Tobias Zwick b11e8d5d7a Merge branch 'master' into lights
Conflicts:
	planet/Graphics.ocg/LandscapeShader.c
	src/graphics/C4DrawGLMesh.cpp
	src/graphics/C4DrawGL.cpp
	src/landscape/C4Landscape.cpp
	src/landscape/C4Landscape.h
	src/landscape/C4LandscapeRender.cpp
	src/landscape/C4Scenario.cpp
	src/landscape/C4Scenario.h
2014-10-06 23:27:16 +02:00
Sven Eberhardt e740938bbb Fix .ocu updates and allow direct download of installer for future updates. 2014-10-05 14:32:23 +02:00
Sven Eberhardt ffdd2f37eb Fix recursions caused by modal league dialogues during game execution and game end (#1118). 2014-10-04 00:16:03 +02:00
Sven Eberhardt c86ea9ad53 Reset gamma ramp in game deinitialization (#1114). 2014-10-03 23:42:39 +02:00
Sven Eberhardt 828eb7f82a Don't save ControlTick and SyncRate in network savegames (#1058). 2014-10-03 23:12:55 +02:00
Sven Eberhardt 3fc1f02c6d Implement custom scenario parameter selection in startup scenario selection dialogue and by command line. 2014-09-27 16:05:32 +02:00
Sven Eberhardt 378bda5546 Added custom scenario parameters (SCENPAR_*).
Can currently only be set in network games in the lobby. In the future, maybe we can find a place somewhere in the scenario selection dialogue.
2014-09-23 23:02:52 +02:00
Sven Eberhardt cfe242b2b8 Implement ogg file playing for OpenAL-based audio system. (#1096) 2014-08-07 13:46:45 +02:00
Sven Eberhardt 5cd9b915b0 Added some dialogue functions and speaker portraits. UpdatedAddMenuItem and CustomMessage to allow more customization for picture graphics.
I would prefer to render the models for speaker portraits directly. However, it seems like it's not currently possible to clip or render models to offscreen surfaces.
2014-07-05 15:25:30 +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