Commit Graph

2809 Commits (48ae42f87e82f26e696ba62c1f4de82d90949522)

Author SHA1 Message Date
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
Sven Eberhardt 7b8ffd79a4 Make Lava/DuroLava emit ambient light as a material property. (#1205) 2015-01-28 22:35:14 +01:00
Sven Eberhardt e717dd0dab Fix MSVC build. 2015-01-26 18:46:41 +01:00
Günther Brammer 4f9bc068ad Merge #include cleanup and SDL-mainloop fix 2015-01-25 20:47:50 +01:00
Günther Brammer 36ce941e4d cmake: Restore SDL-Mainloop build 2015-01-25 19:05:06 +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 1c4444d5fc Fix memory leaks on definitions without or with invalid bitmap graphics. 2015-01-25 18:24:27 +01:00
Sven Eberhardt 8f866cceee Fix assertion on landscape changes outside landscape rectangle (#1232) 2015-01-25 18:23:43 +01:00
Sven Eberhardt 089b4794a8 Fix a few warnings in Win64 build. 2015-01-25 16:43:51 +01:00
Sven Eberhardt e1a09298d4 Fix a few harmless warnings. 2015-01-25 16:16:06 +01:00
Sven Eberhardt 5e365e5236 Remove deprecated evaluation of CNMT rule in engine. 2015-01-25 14:35:18 +01:00
Sven Eberhardt 6be3796e33 Do DigOutObject callback when digging out new objects from material.
It was already done when blasting free and when digging out existing objects, but the case of digging out new materials was still missing. This helps collect firestones when digging in firestone material.
2015-01-25 14:19:39 +01:00
Nicolas Hake d994b893ba OSX: Fix capitalization of several imports and includes 2015-01-23 18:24:31 +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
Nicolas Hake 2ef2c637a7 Remove several instances of disabled legacy code 2015-01-18 22:59:45 +01:00
Nicolas Hake fef96eca9c Replace C4Surface::ppTex by a vector
This should improve cache coherency by having all surface tiles adjacent
instead of strewn across the heap. This will also remove an indirection
in the common case of only using one tile.
2015-01-18 22:59:44 +01:00
Nicolas Hake 57044a9eeb Move STATUS_ASSERTION_FAILURE definition to where it's actually needed 2015-01-18 21:55:16 +01:00
Sven Eberhardt f815d7ea6c Fix EditCursor selection and deselection callbacks when duplicating objects. 2015-01-17 22:53:21 +01:00
Sven Eberhardt 2cde706611 Object movement in editor respects Def->HorizontalFix and attachment procedure.
When moving attached objects, it will now move the attachment target along with the object. This makes moving elevator cases and wind generators a lot easier.
2015-01-17 21:19:56 +01:00
Sven Eberhardt cf9aca70fe Add callback EditCursorMoved. 2015-01-17 20:53:45 +01:00
Sven Eberhardt c00d8c7a4d Add next_selection parameter to EditCursorDeselection.
If an object is deselected due to a new object selection, that newly selected object is passed as next_selection.
2015-01-17 20:37:54 +01:00
Sven Eberhardt 8dddbe5a10 Allow definitions without graphics. 2015-01-17 18:10:21 +01:00
David Dormagen 7e7bbf17fa fixed additive blitting of particles (#1213)
This was accidentally removed by ck in 526b97c60c
2015-01-17 11:13:08 +01:00
Armin Burgmeier 166b5de519 Fix mape build 2015-01-15 14:42:22 -05:00
Nicolas Hake df7d19c7c5 Improve C4Landscape const correctness 2015-01-15 19:13:36 +01:00
Nicolas Hake f943866d36 Remove unused and unimplemented C4Landscape::FindMatPathPull
The function has been stubbed since we imported the code from CR.
2015-01-15 19:13:33 +01:00
Maikel de Vries 615b26b453 RemoveObject(true) first tries to put contents into parent container before exiting them 2015-01-15 17:46:54 +01:00
Maikel de Vries 4ea0cb0ca6 make ContainBlast a property instead of DefCore entry 2015-01-15 17:46:53 +01:00
Nicolas Hake aa6b1384a7 Fix build with C4NET2IO_DUMP_LEVEL > 1
Instead of using the preprocessor to filter out debugging code, we might
want to make more use of the optimizer's DCE. That way, renaming and
moving a function or variable won't immediately break a rarely tested
configuration.
2015-01-15 16:33:20 +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
Peter Wortmann 1aa8585fa1 Cosmetic light improvements
- Increase light fade-in/fade-out quite a bit (4 times stronger)
- Fixed normal jump when multiple lights intersect (will make things a
  little less nice with only one light, but this takes priority)
- Don't draw objects without light in light-debug mode
2015-01-15 12:30:50 +01:00
Nicolas Hake 8a729b4c6f Crash handler: Use PRIdPTR format where available
Printing pointers from the crash handler has been broken starting
with an update to MinGW at some point in the past, when they stopped
using printf from MSVCRT, instead replacing it with a private
implementation. Fix this by checking for inttypes.h availability, and
using it (and its format macro) when possible.
2015-01-15 10:18:37 +01:00
Armin Burgmeier f2830311a6 Fix crash on scenario section change (#1221) 2015-01-14 12:03:05 -05: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 b2501ed0e5 SetPlrKnowledge(nil, ...) sets/removes knowledge for all players (#1236)
Useful e.g. for ingame scripting when you want to grant extra construction plans. Additionally, this kind of behavior is known from some other functions with per-player parameters like e.g. Sound().
2015-01-14 00:36:44 +01:00
Mark deadfcf099 Initialize newzoom variable (#1217)
Fixes a problem with zoom in debug mode.
2015-01-13 21:29:01 +01: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
Mark 850bf1b9d4 CreateObject/CreateObjectAbove (#1214)
Renamed CreateObject() to CreateObjectAbove() and replaced all occurrences in script files.
Added CreateObject(), the function may need a rewrite though, see comment in code.
Updated documentation
2015-01-11 19:02:03 +01:00
Sven Eberhardt 1c994ad3c7 Windows: Do not deselect GL context when losing focus (#1208).
Fixes engine intialization when tabbing out.
2015-01-11 17:01:27 +01:00
Julius Michaelis 8e7001ba0f Fix self-overwrite in C4ValueArray::SetSlice (#1212: Array manipulation goes wrong ) 2015-01-09 15:09:36 +09:00
Mark 43c924d00e Restructuring of StdMeshSkeleton::MirrorAnimation
Mirroring the name happens in MirrorAnimation now, no double checks anymore, no double copying of buffers.
2015-01-07 22:48:04 +01: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
Armin Burgmeier 31c8c14e73 Fix viewport window size in light coordinate calculations (#1211)
The light rect is made larger than the viewport is by one pixel in
C4Viewport::Draw(), so correct for this.
2015-01-07 14:10:26 +01:00
Armin Burgmeier b8fa1dd191 Fix the mape build 2015-01-07 12:28:10 +01:00
Armin Burgmeier 434eb1c77b Fix Y offset when transforming fragment to light texture coordinates (#1211) 2015-01-07 12:28:10 +01:00
Armin Burgmeier 9580c46056 Fix assertion failure when definition to append/include does not exist 2015-01-06 19:33:33 +01:00
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