Commit Graph

866 Commits (544c1cbb4bb6da97d30571ff28772660c7ad5969)

Author SHA1 Message Date
Julius Michaelis b31ca73903 Don't check MissionAccess when running as dedicated 2013-03-03 17:32:51 +01:00
David Dormagen d3dba14323 added support for custom menus and dialogs 2013-02-12 20:39:20 +01:00
Armin Burgmeier 7357125368 Make C4Material.cpp independent of C4Game
This allows compiling and linking with it without pulling in whole
C4Game. This is useful for the mape map editor.

The only place where C4Game was used in C4Material.cpp was in
CrossMapMaterials where the name of the earth material is read from
Game.C4S. The code has been changed such that the earth material name is
now a parameter to the CrossMaterialMap function.
2013-01-14 02:14:39 +01:00
Günther Brammer 864c5c7ea8 copyright notices update 2012 2013-01-12 16:31:40 +01:00
Günther Brammer d5c1cb8c51 Remove some unused variables 2012-12-31 22:03:12 +01:00
Günther Brammer 6a6190564f Remove some forward declarations that are already in C4Prototypes.h 2012-12-31 22:03:12 +01:00
Nicolas Hake 3c9198876c Win32: Mark OC "DPI aware" (#891)
Technically this mark is incorrect; we do not handle things differently
on high DPI settings. On the other hand, marking OC DPI aware means that
Windows won't try to scale our drawing, clipping menus and rendering in
the process.

Somewhere in the future, OpenClonk should also add proper DPI awareness
and change the default zoom and menu scaling to match.
2012-12-24 14:44:41 +01:00
Sven Eberhardt 7a042ecca5 Do not allow debugger connections in league games.
We do not have a league yet and once we do, people might start cheating with customized engines. But at least it shouldn't be that easy.
2012-12-06 17:18:43 +01:00
Günther Brammer d9c3c1d713 The dedicated server command line can now start a scenario
I don't know how useful that is without control over other options, but at
least its something instead of nothing.
2012-11-30 22:20:16 +01:00
Günther Brammer 7967d94a59 Merge StdFont.cpp and C4Fonts.cpp 2012-11-12 02:30:16 +01:00
Tobias Zwick 348fb8c7a9 clean up mouse controls, reduced cursor graphics to the used ones 2012-11-16 17:29:42 +01:00
Peter Wortmann a2820598b2 Added psychedelic lights mode to debug modes
Right behind the other debug display modes - so it's
4 x Ctrl-F7 in debug mode now. Not sure it will become useful,
but it's sort of pretty, so why not.
2012-09-20 12:33:38 +01:00
Peter Wortmann d1c28227f3 Normal map support for lights
- The light direction change isn't really consistent, as I can only give
  GL the vectors at the triangle edges. So for deep rays, the light
  distribution often ends up being significantly different than for short
  rays.

- I *am* distorting the normal map vectors, quite badly actually. I'll leave
  it for the moment, because it definetely looks best for the light vectors,
  but I will have to correct that a bit once I have the time.
2012-09-05 21:51:25 +01:00
Peter Wortmann 56bdeec585 FoW/lights preview
This is pretty much still prototype stage. Lots of bug, lots of stuff missing.
2012-08-19 19:35:10 +01:00
Günther Brammer 77479e4f71 Get the window size fresh from the window instead of storing it
This makes Application.GetConfigWidth/Height simply return the appropriate
configuration value instead of mixing configuration and state in the same
function. The caller needing the state now uses C4Window::GetSize instead.
2012-10-22 23:15:48 +02:00
Philipp Kern e037300801 Fix spelling mistake: ressource -> resource. 2012-10-21 22:20:43 +02:00
Armin Burgmeier b4aafdd874 Remove build number aka C4XVER4 2012-10-18 23:54:50 +02:00
Sven Eberhardt a6d9690afa Fix Win32/MSVC builds losing sync to due to different order of parameter evaluation when multiple calls of Random() were done in the parameters 2012-10-14 21:02:27 +02:00
Julius Michaelis c4506a2b69 Fix entering fullscreen mode in lobby
Remove a debuglog
2012-10-14 17:45:01 +02:00
Julius Michaelis 69bbc6b4d1 Fix resolution reset in editor mode and on tabbing out
Win32's SetVideoMode doesn't enumerate display modes anymore for windowed mode
2012-10-14 13:28:38 +02:00
Armin Burgmeier a1212f8e31 Don't show debug message when zooming with F5/F6 2012-10-14 12:38:23 +02:00
Sven Eberhardt 4c762f57aa Fix viewport zoom reset when a remote player is eliminated (#429) 2012-10-13 21:36:14 +02:00
Sven Eberhardt 96cb91a2a2 Fix resolution stuff for ScreenX/ScreenY==-1 and automatic switching 2012-10-13 17:17:06 +02:00
Sven Eberhardt 8c2a07afa0 Fix broken graphics on first start with empty config
Config.ResX/Config.ResY, were set to -1 on first start. But those values are used frequently e.g. when the GUI screen is initialized
2012-10-13 12:50:15 +02:00
Sven Eberhardt 8bdd761027 PlayerControls: Allow usage of keyboard scan codes instead of virtual key names using $%x format (Win32 only)
Also re-resolves keys if the keyboard layout changed at runtime.
2012-10-09 00:54:34 +02:00
Tobias Zwick 41a33999cd remove video playback feature 2012-10-04 23:03:57 +02:00
Tobias Zwick b5d0af513a remove splash video and option for it 2012-10-02 23:02:52 +02:00
Julius Michaelis ab880d6bd8 Fix 2c9e6ac9f614 (windows + logic) 2012-10-03 00:54:56 +02:00
Julius Michaelis 023aa90c0e Add config option for automatic windowed/fullscreen switching 2012-09-29 23:49:30 +02:00
Martin Plicht f6825d073e mac: Compile with Automatic Reference Counting enabled 2012-09-02 13:56:53 +02:00
Günther Brammer f6db61750e Store the size of the non-fullscreen-window separately
The size of that window can be adjusted by the player, so there is no need
for a GUI option.
2012-08-30 00:13:14 +02:00
Günther Brammer cc25878ba6 Default to not changing the resolution
1. We receive bugreports that changing the resolution doesn't work, but
can't reproduce that
2. Flat screens look best at their natural resolution
2012-08-19 20:59:01 +02:00
Günther Brammer 6a0f9b164c Use a constant for the default gravity instead of triplicating it 2012-07-25 17:02:10 +02:00
Günther Brammer 1a29f8625d Reorder engine source file organization a bit
This mostly consists of flattening the hierarchy, splitting the
graphics stuff out of platform, and a few smaller cleanups.
2012-04-27 19:04:43 +02:00
Maikel de Vries 4a56f8d7c1 Replaced defcore values related to fire with properties 2012-04-28 16:17:38 +02:00
Armin Burgmeier 90dc9abbcd Add Anim_R as a AVP for mesh animations 2012-04-22 00:22:05 +02:00
Bernhard Bonigl 705b19fefd Merged Controls into default 2012-04-21 17:18:37 +02:00
Julius Michaelis 185a338819 Change first parameter of PlaceVegetation and PlaceAnimal, so they accept "overloaded" definitions like PlaceVegetation({Prototype=Mushroom, Placement=1}) 2012-04-18 15:23:35 +02:00
Bernhard Bonigl 293b3f80e8 Merged diverged Controls branches 2012-04-17 18:36:14 +02:00
Bernhard Bonigl 63f0a49614 Added new blitmode: GFX_BLIT_Wireframe 2012-04-17 17:29:29 +02:00
Sven Eberhardt 80d5f01642 Added FnGetPlayerControlAssignment: Get key/button assigned to a control.
To be used by tutorial messages explaining controls.
2012-04-17 17:06:16 +02:00
Maikel de Vries 16fa9cf341 Placement is now a property instead of DefCore value 2012-04-16 22:17:05 +02:00
Günther Brammer bc5e77d9d0 Simplify C4Game::FindObject
It isn't exposed to script anymore, and the internal users don't use most
features. This might even speed up lava-in-oil a bit.
2012-04-15 23:32:37 +02:00
Julius Michaelis d7afaccb11 Fix Fx*Stop being called with reason==nil instead of C4FxCall_Normal 2012-04-15 16:06:04 +02:00
Felix Wagner cce5d109ef no_dig2objects parameter for DigFree / DigFreeRect 2012-04-05 16:49:47 +01:00
Felix Wagner c7f5e11ac8 DigFree & DigFreeRect return amount of pixels dug free 2012-04-05 02:59:45 +01:00
Maikel de Vries 7b8800356a Removed Precipitation from engine
Will be implemented through clouds and definition calls.
2012-04-01 23:03:52 +02:00
Benjamin Herr b7e8ca9263 move logic from OnOwnerRemoved to C4Player
This avoids a previous assert() on player elimination from GetFunc()
being unable to handle the tilde in "~OnOwnerRemoved". FnOnOwnerRemoved
is gone so that shouldn't happen anymore.
2012-04-01 22:06:43 +02:00
Felix Wagner 2416fa98fb + FnCheckConstructionSite 2012-03-27 19:09:55 +01:00
Sven Eberhardt fa2b8489fa Fix menu to scenario script callbacks 2012-03-17 14:26:58 +01:00
Armin Burgmeier 462574f681 Remove debug log in C4ValueProviderLinear::CompileFunc 2012-03-12 23:41:34 +01:00
Armin Burgmeier 2de0a031c4 Fix loading mesh animations in scenario saves 2012-03-11 22:49:59 +01:00
Armin Burgmeier 97cfd81133 Support mesh graphics and ingame objects as menu item graphics 2012-03-11 00:06:44 +01:00
Günther Brammer dfea0914a9 Merge the functions pointer branch 2012-03-09 17:42:48 +01:00
Armin Burgmeier 893fb4bbed Make overlays on picture graphics work again
This was partly broken by 427cf61d729a. However, already before that,
the size of the overlay was depending on the ingame size of the object
on whose picture the overlay was being drawn. This didn't make much sense
and now the size of the overlay is equal to the area on which the picture is
drawn in the first place.
2012-02-26 21:44:00 +01:00
Armin Burgmeier fea6209365 Fix drawing of non-default graphics in picture overlays
This was broken by 427cf61d729a.
2012-02-26 21:09:42 +01:00
Armin Burgmeier 7f5f916e76 Draw only partial set of faces for buildings in construction 2012-02-26 01:09:42 +01:00
Armin Burgmeier de67769065 Fix crash when C4Draw::Blit was called with NULL source surface (#721) 2012-02-26 01:01:55 +01:00
Armin Burgmeier 7f5b7bcdd6 Make a MouseHover callback when the object being hovered by the mouse changes 2012-02-25 21:56:11 +01:00
Armin Burgmeier 9d94b1da6e For scaled sprite graphics, don't interpret Picture coordinates as scaled
Otherwise an object with a scale of 5 and a picture of 64x64 (such as the
Metal and the GoldBar objects) cannot properly set the picture rectangle.
2012-02-25 17:35:24 +01:00
Armin Burgmeier 8eb76cef8c Unify overlay drawing of pictures
Instead of having custom code drawing the picture in C4DefGraphics.cpp,
re-use C4Def::Draw().

This changeset changes the coordinate system on which draw transformations
are applied to sprite picture overlays. The transformation is no longer
applied in the frame of the overlay picture but in the frame of the object on
which the overlay is drawn. This was already the case before for mesh
graphics, so this change unifies the interpretation of draw transformations
for sprite and mesh graphics.

The Tools Workshop has been changed accordingly so that object is production
are properly displayed on the sign. This also fixes the pictures of some
objects being off the sign.
2012-02-25 16:54:51 +01:00
Armin Burgmeier 94f552bbb8 Fix earth material initialization to work when texture is given
This fixes misplaced InEarth objects when the Material= option in Scenario.txt
contains a material-texture combination instead of a material only.
2012-02-19 19:33:35 +01:00
David Dormagen 5341ec1c3d removed the ignore_sky parameter of Draw*Map - now always ignores sky 2012-02-19 17:57:33 +01:00
Günther Brammer ce27d42ac7 Remove unused C4AulScript::Owner
C4AulScript::Translate referenced it, but used it only when called from
eval, which is not done.
2012-02-17 01:04:05 +01:00
Nicolas Hake db9ff85116 Binary mesh loader: Do not reject meshes with multi texturing
We don't support multi texturing in the rendering code, so emit a warning when
this happens
2012-02-16 00:45:48 +01:00
Günther Brammer 04e512fe00 Replace C4AulScript::GetFuncRecursive with C4PropList::GetFunc/Call 2011-10-15 02:27:02 +02:00
Günther Brammer b6fb634bd3 Replace the other C4AulScript::GetSFunc with C4PropList::GetFunc/Call 2011-10-15 02:06:21 +02:00
Günther Brammer db926e3f53 Replace C4AulScript::GetSFunc with C4PropList::GetFunc/Call 2011-10-15 02:05:10 +02:00
Günther Brammer f7b3642bc6 Replace C4DefScriptHost::Call with C4PropList::Call 2011-10-15 02:03:04 +02:00
Günther Brammer f8f588f641 Replace C4Object::Call with C4PropList::Call 2011-10-15 02:00:56 +02:00
Günther Brammer a01bb2cf9c Remove function cache from C4DefScriptHost 2011-10-15 01:59:15 +02:00
Günther Brammer bb3861d4f1 Replace C4AulScript::GetSFuncWarn with C4PropList::GetFunc 2011-10-15 02:11:57 +02:00
Günther Brammer 0403bed306 Put functions into their proplists 2011-10-15 01:38:59 +02:00
Günther Brammer bf86e81aa7 Clean category code up a tiny bit 2011-12-29 15:56:51 +01:00
Günther Brammer b3aff643f3 Script reloading does not clear local variable defaults
The defaults are filled in by the preparser, which is only invoked for
changed scripts.
2011-10-04 22:16:27 +02:00
Günther Brammer 8185d318bf Script: Add a proplist representing the global scope, named "Global" 2011-10-04 22:12:45 +02:00
Günther Brammer 843642271d Script: local variables work for the Scenario and definition calls
This requires replacing C4AulScript::Def with C4AulScript::GetPropList() and
C4DefScriptHost::Def, and making C4GameScriptHost::GetPropList return the
scenario proplist prototype.

Definition calls won't be able to change the local variables, of course.

Other proplists will be able to use local variables once they can have
functions.
2011-09-29 03:49:21 +02:00
Günther Brammer ca4da88137 Script: Scenario functions get the Scenario proplist in "this" 2011-09-25 23:25:13 +02:00
Günther Brammer 9f180dffee Script: Remove ScriptGo, ScriptCounter, goto and the ScriptN callbacks
No scenario uses them, and ScheduleCall provides an alternative.
2011-09-19 21:33:05 +02:00
Günther Brammer b4021015f7 Make C4AulFunc::Exec take a proplist instead of an object 2011-09-25 23:49:17 +02:00
Günther Brammer d723d43d92 Make C4AulContext::Def a proplist 2011-10-13 23:39:35 +02:00
Günther Brammer c63b66e909 Script: Add def and effect parameter types 2011-09-24 18:37:28 +02:00
Günther Brammer 32e7eb2904 Only use C4V_C4Object as typecheck target, tag the values with C4V_Proplist
This simplifies a few places which had to check for both tags before.
2011-09-26 20:22:31 +02:00
Armin Burgmeier 06dc47cb09 Make sure sector list order always matches main list order
So actually be29346165d6 turned out to be an incorrect fix. The actual
problem is much more subtle: the ordering of objects within the same
plane by their ID could cause the sector list order to not match the
main list order anymore. This has been fixed by re-arranging the code in
question.

I hope this really fixes #711.
2012-02-12 04:26:33 +01:00
Armin Burgmeier b16fc0ccf3 Ignore Status==0 objects in C4ObjectList::CheckSort 2012-02-12 04:21:42 +01:00
Armin Burgmeier 612f14016e Also check order of last list entry in C4ObjectList::CheckCategorySort 2012-02-12 04:21:18 +01:00
David Dormagen b359373f5d clearing of landscape is now done in C4Landscape::MapToLandscape instead of MapToSurface 2012-02-11 23:24:53 +01:00
David Dormagen 2a53b55a45 added parameter for DrawMap and DrawDefMap to retain old material if sky is drawn 2012-02-10 21:48:48 +01:00
Armin Burgmeier fb27b9c1c3 Reset Unsorted flag only after sorting has been fully finished
This not only seems more correct but might also fix #711
2012-02-05 17:28:55 +01:00
Sven Eberhardt 05e7aa1568 Fix EliminatePlayer(..., true) inactive client activation 2011-11-08 16:16:31 +00:00
Peter Wortmann fec07accd7 Save more minimal players on remote clients 2011-08-15 09:25:37 +00:00
Julius Michaelis 9b781f9882 Fix ForPolygon scanlining to exclude pixels on right bound 2012-01-30 20:54:17 +01:00
Julius Michaelis b4dba5b255 Add an option to select an arbitrary object under the cursor via context menu to gtk console mode 2012-01-27 23:01:37 +01:00
Felix Wagner c92ca7d766 Typo 2012-01-29 02:17:11 +00:00
Felix Wagner 5a28794482 +GetPlrClonkSkin(iPlr) 2012-01-29 02:17:00 +00:00
Felix Wagner d468862159 Player options dialogue, let the player choose a clonk skin 2012-01-29 02:16:22 +00:00
Armin Burgmeier f4bc45c4a3 Don't do wildcard matching and other fancy stuff in C4DefList::Load
Instead just attempt to load the filename given. This function is only
used from two places: C4Game::InitDefs and C4Game::DropFile. In both
cases segments and wildcard matching is neither needed nor desired.

This fixes a problem with loading definitions when the Clonk installation
resides in a directory with paretheses, such as C:\Program Files (x86)\.
This might well fix the problem in http://forum.openclonk.org/topic_show.pl?tid=905.
2012-01-28 00:33:28 +01:00
David Dormagen 42e5c6cbec The mass mover clears its data when loading fails
Happened in some cases when changing a scenario section.
2011-07-16 21:57:14 +00:00
Peter Wortmann 790b9d6af6 Ensure that even with workarounds #version is always first directive in shader
This fixes workarounds for some drivers. Most notably mine. Now if only
it wouldn't fail silently...
2012-01-24 00:17:37 +00:00
Peter Wortmann 70de47bc1c Cap material store once objects can't be collect any more
This means that if the Clonk digs Earth but has a full inventory at the time
(so we can't generate Earth chunks), digging another material later can never
yield more than one Earth chunk.
2012-01-21 17:33:00 +00:00
Armin Burgmeier 687c1f4920 Print the location of the mesh in the error message when failing to load a mesh 2012-01-13 23:44:05 +01:00
Armin Burgmeier c46f406943 Smoother movements on objects on moving solidmasks
The behavior is still not perfect yet since the attachment of the object
to the SolidMask may re-position the object by 1 pixel. I am not sure
this can be solved correctly since there are three coordinates involved
who can be (and, generally, are) different on a sub-pixel level. These
are the object's position itself the position of the solidmask object
and the position of the solidmask (which is constrained to pixel boundaries).
However, the attachment code only knows the object and the solidmask, not
the solidmask object, so it possibly cannot properly account for this.
2012-01-12 00:49:12 +01:00
Armin Burgmeier 6afadc6397 Allow mesh graphics images in messages 2012-01-10 22:40:46 +01:00
Nicolas Hake bf89f9531d C4FO: Make sure object has an action before testing its properties (#704) 2012-01-10 16:17:37 +01:00
Nicolas Hake faf62abf9c Aul: Make sure CreateConstruction id parameter is valid (#702) 2012-01-03 21:57:55 +01:00
Maikel de Vries 241315762d LandscapeRender: fixed off by one for shader warning
By PeterW
2011-12-29 18:24:55 +01:00
Armin Burgmeier b63adda52f Synchronize the order of Definition() calls 2011-12-29 17:04:57 +01:00
Armin Burgmeier 1eff3d7661 Add another DebugRec for the Definition() call 2011-12-29 17:02:26 +01:00
Armin Burgmeier cc62b169c8 Add "MouseDrag" property for finer control of script-implemented drag+drop 2011-12-28 19:33:19 +01:00
Günther Brammer c49ef4abf9 Add a few missing "new"s to "throw NeedObjectContext" statements
The catch in C4AulExec only catches pointers, so without the new the
exception isn't caught.
2011-10-14 02:51:20 +02:00
Armin Burgmeier dda29e2dcd Remove some dead code 2011-11-20 20:50:23 +01:00
Günther Brammer 0cd46a2ebc Wrap C4AulFunc::Name in C4AulFunc::GetName() 2011-10-14 00:40:55 +02:00
Günther Brammer 39ba48ee54 Rename C4Value::ConvertTo(NoNil) to C4Value::Check(Par)Conversion
The NoNil variant thus has the shorter name, because most code should
use it. Conversion checks mostly secure code that uses the value and would
crash with a nullpointer. The exception are function parameters, which all
also accept nil and 0 and check for nullpointers in the function itself.
2011-08-21 01:47:38 +02:00
Günther Brammer b80315b182 Script: Remove unused PrivateCall and ProtectedCall 2011-09-30 01:47:06 +02:00
Günther Brammer 65a11ef1c3 Script: Remove unused function "descs" 2011-09-29 02:46:26 +02:00
Günther Brammer 5f2f995852 Unify the #include blocks a little bit
One line for C4Include.h, one for the .h corresponding to the .cpp, one
empty line, the other C4* includes, another empty line, external headers.
2011-11-01 23:17:41 +01:00
Günther Brammer 5f5f2f3975 Fix definition drag-n-drop from file manager to editor viewport 2011-10-21 22:56:26 +02:00
Armin Burgmeier e44b216230 Enable face ordering individually for all submeshes 2011-10-15 21:35:39 +02:00
Peter Wortmann 1388591644 Landscape: Dig2ObjectCollect shouldn't stop other materials from spawning [#678]
Thanks to Maikel for the accurate report.
2011-10-10 20:25:35 +01:00
Peter Wortmann 6835b7939d Fixed some warnings, security 2011-10-08 13:02:15 +01:00
Sven Eberhardt 76c2943579 Fix debugrec false alarm on some uninitialized memory 2011-10-08 23:47:07 +02:00
Sven Eberhardt 8ba09ad857 Fix floating point related sync loss in GetAnimationLength 2011-10-08 21:55:12 +02:00
Felix Wagner 1fb605e384 PlaceVegetation now accept C4D_Place_Subsurface for underground placement and
C4D_Place_BothSurface for above- and underground placement.
2011-10-02 23:11:00 +01:00
Günther Brammer c2908d5bd5 Rename CStdDDraw to C4Draw 2011-10-03 16:34:08 +02:00
Günther Brammer 2b6f4432de Rename lpDDraw to pDraw 2011-10-03 16:30:18 +02:00
Günther Brammer ad89e12a2c Rename CTexMgr and CTexRef to C4TexMgr and C4TexRef 2011-10-03 16:16:38 +02:00
Günther Brammer 68d6b34f72 Replace SURFACE with C4Surface * 2011-10-03 16:07:07 +02:00
Günther Brammer 55f6bc8d0f Replace CSurface and C4Surface with just C4Surface
The methods that previously were on C4Surface still are in a separate
file.
2011-10-03 16:06:41 +02:00
Günther Brammer efed250aa7 Rename CMarkup to C4Markup 2011-08-27 21:13:15 +02:00
Günther Brammer 6700bff4de Replace CFacet with C4Facet
The latter is almost a superset of the former.
2011-08-27 17:47:49 +02:00
Günther Brammer 156a502289 Rename CClrModAddMap to C4FogOfWar 2011-08-27 16:41:26 +02:00
Günther Brammer f4ff47239f Rename CBltTransform, CBltVertex, CBltData, CPattern and CGammaControl 2011-09-30 22:15:51 +02:00
Günther Brammer 08dacd878d Rename CBitmap(256)Info to C4BMP(256)Info 2011-08-27 16:32:15 +02:00
Günther Brammer 4bf663c792 Remove unused Landscape.NoSky from the Scenario.txt 2011-09-24 18:17:48 +02:00
Günther Brammer f357570bb1 Use big landscape tiles when classic shaders are enabled 2011-05-31 01:28:31 +02:00
Günther Brammer f055ed27e8 Draw PXS Sprites a little bit smoother 2011-05-26 15:03:51 +02:00
Günther Brammer 562816cfe5 Clean up some unused variables and obsolete FIXMEs 2011-09-28 01:09:56 +02:00
Günther Brammer 5ca85f97c5 CrewMembers are only banned from resurrection during Death callbacks (#532)
This avoids immediate resurrection, but allows Clonks to return later in
the same round, just like they can return later in the next round.
2011-10-02 18:47:21 +02:00
Maikel de Vries d9c431e7e4 Engine: Fix possible crash in C4Landscape::InsertDeadMaterial (#666) 2011-10-01 19:32:16 +02:00
Nicolas Hake b9c0b5dffd Landscape renderer: Cast a variable to int so it matches the format specifier 2011-09-28 19:46:43 +02:00
Nicolas Hake 8d8b087808 Return NULL instead of ((T*)false) from more functions 2011-09-28 19:42:56 +02:00
Nicolas Hake e0610576bd Return NULL instead of ((T*)false) from some functions 2011-09-28 00:48:46 +02:00
Günther Brammer a3ade134fe Savegames: Do not clear player control data immediately after loading (#596) 2011-09-22 20:00:17 +02:00
Günther Brammer 221ffa7524 Rename C4ObjectList::DenumerateRead to DenumeratePointers
It does the same as all the other DenumeratePointers functions: Convert
Object Numbers to Object Pointers after load.
2011-09-19 21:02:28 +02:00
Günther Brammer 952b180ac1 Savegames: Remove outdated assertion
Scenarios are now loaded with the same flags they were saved with. Thus,
the objectlist is told to skip player objects while loading. But this can
be safely ignored, because the scenario shouldn't contain any player
objects that could be ignored in the first place. But checking that loading
and saving is done with the same flag would be nice.
2011-09-19 23:09:42 +02:00
Tobias Zwick 988f05378f Clonk doesn't stop digging automatically when he hits a wall 2011-09-18 18:23:22 +02:00
Günther Brammer 6d6737a022 Add two new Material Shapes Octagon and Smoother, more chunk antialias
Previously, smooth materials would get extra triangles at the top to create
slopes instead of steps. Now those also appear at the bottom.

Smooth also gets generally smoother at the bottom, while Rough gets rougher
at the top. The new Smoother material is somewhere between Flat and Smooth.
Octagon is like Flat but also gets straight slope triangles.
2011-09-07 14:25:32 +02:00
Julius Michaelis c1123cff55 Update the visibility docs.
Very small fix to C4Object::IsVisible
2011-09-05 17:13:44 +02:00
Julius Michaelis f389ee0781 Removed CheckVisibility from Commits.c and made the engine function C4Object::IsVisible available instead. 2011-09-05 13:51:34 +00:00
Tobias Zwick d6a3db3ed8 fixed #639: solidmasks on zoomed graphics 2011-09-05 00:35:01 +02:00
Günther Brammer 04bb45d0fb Make C4Landscape::ChunkyRandom produce somewhat random numbers
Also choose the "cro" seed better.
2011-09-03 01:22:12 +02:00
Maikel de Vries ca1fc50b52 Engine: MapZoom defaults to 8
This goes better with 512x512 textures(brick), we still need to adapt some scenarios. In the future we should release only scenarios with MapZoom = 8
2011-09-02 14:35:43 +02:00
Günther Brammer ec232bbfaf copyright notices update 2011 part II 2011-09-01 20:22:35 +02:00
Günther Brammer 9bc61db360 copyright notices update 2011 2011-09-01 16:58:52 +02:00
Nicolas Hake fe747db554 Clean up copyright notices
Use real names for copyright attribution wherever they are known,
drop duplicates
2011-09-01 12:47:54 +02:00
Peter Wortmann bd400cf7bb Removed special sorting of lines
It causes an assertion and shouldn't really be needed anymore.
In case we want this behaviour, we should just set the plane
directly.
2011-08-29 23:42:13 +01:00
Tobias Zwick 49729a61ae renamed ominous "Smooth" texture to "none", removed reference in docs to Smooth and made it 512x512
In OC, actually every material has its predefined set of textures, so the default texturing of >=CR is obsolete. The "Smooth" texture is a relic of that which is currently only used because of the "Vehicle" material.
2011-08-29 23:41:41 +02:00
Peter Wortmann 6489ff2252 Fixing a stupid mistake disabling shader walkarounds
Yeah, I forgot to test that. How did you know?
2011-08-27 22:04:53 +01:00
Peter Wortmann 60d1d8368b Not giving TextureOverlay defaults to first entry in TexMap
This makes it easier to stay in sync to the TexMap, especially if
using an animated texture. I only changed it for Water, but I
think it would make sense for just about every material.
2011-08-27 17:10:31 +01:00
Peter Wortmann 253c41eebe MassMover tries to use local textures for materials as well 2011-08-27 17:08:46 +01:00
Peter Wortmann 52ca51ae2f Cleaned up shader code a bit (especially logs)
Actually more chatty than ever before, logging exactly what its
internal configuration was, together with some statistics. I feel
we might need them once we release.

Also we now test all *combinations* of workarounds.
2011-08-21 20:58:07 +01:00
Peter Wortmann bba996800e Prefer surface sizes close to power-of-two for landscape texture
This might help prevent rounding issues in the shader for some GPUs
2011-08-21 20:50:57 +01:00
Peter Wortmann b8523eb76f Material objects dug free can be forced to be collected
The idea is that for some materials (e.g. earth chunks) it really
doesn't make sense to not immediately collect them - they would just
collide with something and recreate the material you just dug out.
So instead, this allows materials to specify that they want their
dug out objects to be collected immediately - if not, they simply
don't get created.

Note that this doesn't mean that material is lost, as it will simply
acumulate in the digger's material list instead. We might want to
cap that at some point though.
2011-08-20 15:43:58 +01:00
Peter Wortmann dd43ec8c64 Animated water texture
Just noise, as the previous liquid shader by Günther. It's quite
hard to find the right compromise between making it too subtle and
starting to get a "blinking" look. This is now three phases at
300ms each.
2011-08-20 12:04:04 +01:00
Peter Wortmann c0df3afedc Material texture animation support
Use by having texmap entries of the form "Mat-Tex1-Tex2-...". Right
now the speed is hard-coded to one phase per second.

The general idea is that the 3D texture contains all texture
transitions somewhere in the form of two textures with neighbouring
3D coordinates. There's some room for optimization here, of which
the code exploits some. Being smart can be arbitrarily hard actually.
2011-08-20 01:25:08 +01:00
Armin Burgmeier 6c156a22a7 Implement mesh update on definition reload (#76) 2011-08-20 00:01:08 +02:00
Tobias Zwick 4776c4a949 crlf... 2011-08-19 16:50:58 +02:00
Tobias Zwick b36304221d preliminary: gui zoom dependent on resolution 2011-08-18 19:46:51 +02:00
Armin Burgmeier 333f562721 Some compiler warning fixes 2011-08-17 23:55:24 +02:00
Armin Burgmeier 771163be4b Correctly reload mesh materials on definition reload
This does not fix #76 yet, but it's a first step.
2011-08-17 23:50:33 +02:00
Armin Burgmeier 751ae18ae2 Store full source path in mesh materials
This enables more comprehensive error messages for mesh material related
errors
2011-08-17 20:49:16 +02:00
Tobias Zwick 785ee19825 fixed #620 (Loam bridges sometimes do not update the landscape texture properly) 2011-08-15 00:24:22 +02:00
Tobias Zwick f025edb4a9 removed Portraits
+ CustomMessage now uses a normal picture of a definition/object
+ BigIcon is now the small (and only) "Portrait" the player chan choose
+ In future, one could of course make the max size of the BigIcon bigger
2011-08-05 14:58:16 +02:00
Tobias Zwick 221aae1bf5 fixed some ridiculous formatting of consts 2011-08-04 01:30:37 +02:00
Peter Wortmann fc5c0962af CPU scaler case selection smarter in corner cases
Having the calculation in CPU actually allows us to perform more
clever checks. If we have three materials meeting at one point,
we can select one material and make sure that all others pick a
case that's at least consistent to the edge of that material. This
obviously means that the edges between the remaining materials
won't be scaled properly (essentially falling back to GPU scaling),
but that's less disruptive to the result than having the decisions
of neighbouring pixels in disagreement.
2011-08-03 23:55:24 +01:00
Nicolas Hake 8ac7d336e5 Removed an assertion that no longer holds 2011-08-03 23:04:04 +02:00
Tobias Zwick 258c82604d moved RelaunchPlayer callback to engine 2011-08-02 15:46:24 +02:00
Tobias Zwick 324d66b760 remove "reserved" parameter from Fx*Effect callback 2011-07-31 02:39:51 +02:00
Tobias Zwick 92069bb2f8 removed undocumented ~GetCustomComponents callback and the involved hackery 2011-07-31 02:22:29 +02:00
Tobias Zwick 481a59835c docs: talk about nil for defaults. enclose nil, false and true in <code> tags 2011-07-31 01:32:02 +02:00
Nicolas Hake 6efa0ac05e win32: Correctly read back unicode strings from registry 2011-07-27 17:30:56 +02:00
Peter Wortmann e4945b72af Fixed a few warnings 2011-06-24 00:06:11 +01:00
Peter Wortmann 6394061f3d Calculate scaler coordinate in CPU
Uses up another color component, but might be faster for some GPUs?
We will see.
2011-07-24 22:50:52 +01:00
Sven Eberhardt 36644a1287 Synchronization fixes for Record/DebugRec/Network 2011-07-17 21:23:32 +02:00
Sven Eberhardt aaff190867 Debugrec: Dump landscape 2011-07-17 16:52:36 +02:00
Sven Eberhardt 7696b1a392 Added custom shapes for Map2Landscape zoom 2011-07-16 21:50:49 +02:00
Maikel de Vries e2db1bc85a Actions default to COMD_Stop, Decel for float and swim procedures
With this change everything should behave as normal, still not a fan of these numerous float hacks.
2011-07-06 19:11:12 +02:00
Maikel de Vries d550f7c7da Differentiate between COMD_None and COMD_Stop
Was necessary after 267ebb600481 and current abuse of FLOAT procedure. None keeps the current motion, Stop halts the current motion of a procedure.
2011-07-06 18:13:39 +02:00
Maikel de Vries eb530c6017 Removed Defcore:Prey and OCF_Prey
Had no use in the engine, should therefore be defined in C4Script if deemed necessary.
2011-07-05 13:40:40 +02:00
Maikel de Vries 248f85c2eb Removed Defcore:Edible and OCF_Edible
Had no use in the engine, should therefore be defined in C4Script if deemed necessary.
2011-07-05 13:10:56 +02:00
Maikel de Vries cb1490297a Implemented COMD_Stop for FLOAT procedure
Used the equivalent of the swimming procedure.
2011-07-05 12:47:07 +02:00
Tobias Zwick 1958e1f959 got rid of SkyPar_Keep (now: nil). See docs. 2011-07-02 23:44:53 +02:00
Tobias Zwick 75da7fdc18 removed references to function "Activate" 2011-07-02 22:58:06 +02:00
Peter Wortmann 0a8aa19939 Even more complicated other detection.
Probably the best I can do without having the shader recognize
even more special cases.
2011-06-20 00:15:15 +01:00
Maikel de Vries a10d1ad5ac Script: Removed obsolete Completion callback
Already marked obsolete in the docs for quite a time.
2011-06-10 16:31:00 +02:00
Armin Burgmeier 369aa5591e Fix wrong assertion when saving attached def meshes (#602) 2011-06-05 14:10:37 +02:00
Maikel de Vries 173a95a878 Tutorials: Fixed AI movement for swordman 2011-06-02 17:15:58 +02:00
Peter Wortmann c70bf4b355 Also fallback through workarounds on shader link failure
Apparantly a lot of drivers don't tell you that they don't like your
shader until you try linking.
2011-05-31 22:39:03 +01:00
Peter Wortmann b44a980d5d Honor texture GL 3D texture size limits
For now this will just crop the texture. In theory, we could try to
reduce the size in future, maybe by scaling the texture down? We'll
have to see what works best.
2011-05-31 22:22:42 +01:00
Tobias Zwick 6ce8ab3aac Cleaned up C4Landscape.cpp, fixed bug that pickaxe does not produce any materials 2011-05-31 03:04:38 +02:00
Tobias Zwick 1dad7b2a1e Segfault fix: resize vertices instead of reserve 2011-05-31 00:46:11 +02:00
Tobias Zwick 8c490dca05 Implemented free shapes (=polygons) to be added or cleared from the landscape:
+ Refactored the ShakeFree, BlastFree, DigFree, DrawQuad etc. functions and
  removed unused functions ClearRectDensity, DigFreeMaterial,...
+ Moved the polygon fill algorithm from StdSurface8.cpp to C4Landscape.cpp
+ Clearance functions which used to subtract a circle now subtract something
  that looks more like a chunk
+ Pickaxe works with BlastFree now
+ Removed Dig2ObjectRequest
2011-05-31 00:33:35 +02:00
Tobias Zwick e07761a195 Classic landscape render is not that dark anymore 2011-05-30 21:21:25 +02:00
Tobias Zwick fceefae785 new function DrawMaterialPolygon 2011-05-29 22:37:40 +02:00
Peter Wortmann 1ea024f8c6 Use green color channel for scaler ("JPEG" part 2)
Look at 34f1315bc0b9 for the explanation but the wrong fix.
2011-05-29 16:27:12 +01:00
Peter Wortmann 5738bdb86f Use texture2DLod again, fallback to texture2D
Using the walkaround mechanism we can now safely try whether the
driver has a problem with texture2DLod getting used in the
fragment shader. It might be against the standard, but I see no
reason why I shouldn't try - it did improve things for my old
driver.
2011-05-29 16:13:01 +01:00
Peter Wortmann 30836199de Fixed "JPEG" artefacts
They were actually caused by the scaler texture only rarely truly
reaching RGB(255,255,255), instead maxing out somewhere in the
RGB(248,252,248) region. This caused pixels that had only remote
contact with another material still taking over about 3% of the
material's texture. That was obviously most noticable for high-
contrast edges like Sky.

For now this tries to fix it in pre-processing of the scaler. Might
want to look into the scaler generation sooner or later though. Still
no idea where that color error came from.
2011-05-29 16:07:42 +01:00
Peter Wortmann 3c0c99e553 Fixed sky getting corrupted by mipmapping 2011-05-28 18:24:45 +01:00
Peter Wortmann 7075f00c62 Improved edge handling
Now using the best algorithms I could think of, meaning that quite
a lot of information is stashed into the scaler texture in order to:

1. Reliably find the "other" pixel to interpolate towards using the
   scaler. The approximation used before would use invalid texture
   coordinates when interpolating.

   This now allows us to calculate the shading for this "other"
   pixel as well, which actually caused even more visible artifacts.

2. Decide how to calculate the shader for the point rendered. In
   case we are in the middle of a material, we want GL to interpolate
   the normal so we get a nice smooth sub-pixel gradient. On the
   edges, however, we would get interpolation between normals of
   different materials, which looks ugly.
2011-05-28 18:22:56 +01:00
Peter Wortmann 8204c8d644 Introduced a woraround for missing array support. Some major clearnups.
Now especially has a few debugging options that make it easier to
spot when texture coordinates are not calculated accurately. Use
DEBUG_SEPERATOR_TEXTURES to add nasty stripe textures that should
(in theory) never be visible. Set DEBUG_SOLID_COLOR_TEXTURES on top
of that to replace all materials with dark solid colors to make the
stripes more clearly visible.
2011-05-28 15:18:40 +01:00
Peter Wortmann d672211ef5 Use power-of-two depth for material 3D texture
Otherwise the addressing using floats will not be entirely exact,
maybe leading to some bad implementations trying to interpolate
between 3D texture layers. That would be a very hard-to-spot
performance hog, therefore let's play it safe in exchange for having
to allocate a bit more texture memory.
2011-05-27 20:11:38 +01:00
Peter Wortmann ffc1463b69 Improved mip-map calculation
At least some site on the Internet claims that this is better. I
don't see a difference, but it's probably a bit less blurry, which
should be the right direction.
2011-05-27 01:53:03 +01:00
Peter Wortmann b22fed7364 Choose texture for dead PXS by surroundings where possible 2011-05-27 01:51:07 +01:00
Peter Wortmann 923efaf6f5 Landscape textures mip-mapping
Implemented manually, as 3D textures didn't work here properly with
automatic mip-mapping ones. That's no loss, as we can easily swap out
the full texture set for each drawing call.
2011-05-26 20:27:33 +01:00
Günther Brammer 68cda827f9 Do not disable GL_BLEND
This is generally assumed to be enabled. Code that doesn't need it needs to
disable and re-enable it, not the other way around.
2011-05-26 15:03:31 +02:00
Günther Brammer a533b93f10 Do not print a deleted-object-warning while warning about that object 2011-05-25 20:09:12 +02:00
Peter Wortmann ab618f9d3a Implemented sky - as in stop the shader from drawing over it 2011-05-24 22:00:02 +01:00
Nicolas Hake 15309e1829 GLSL landscape renderer: Tile/crop non-fitting textures 2011-05-24 22:32:24 +02:00
Günther Brammer e5c994b36c Use biggest possible textures for classic landscape renderer
This might speed it up a little bit, and reduces artifacts at the seems.
2011-05-24 19:43:35 +02:00
Günther Brammer 643399c960 Do not delete effects while they still might be in use
For example, deleting an object in an effect callback for that object would
delete the effect, causing some usage of freed memory. Instead, let the
effects get deleted together with the object in ~C4Object(), and only mark
them as dead in AssignRemoval.
2011-05-24 13:23:25 +02:00
Peter Wortmann 27d3869ca3 Shader now only requires GLSL 1.10 instead of 1.30 2011-05-24 01:32:20 +01:00
Günther Brammer 0b8d25eb30 Solidmasks can also move floating objects 2011-05-24 01:46:29 +02:00
Peter Wortmann a02ccafc4d Shader landscape rendering, first simple version (scaler, shading) 2011-05-24 00:12:19 +01:00
Günther Brammer 9271365b18 Use GetRelativePathS in C4SDefinitions::SetModules
This might deal better with doubled path separators, but mostly it's about
using a common library function instead of duplicating logic.
2011-05-09 17:32:14 +02:00
Günther Brammer 432cae134f Remove unused C4DefList::LoadFolderLocal and C4DefList::LoadForScenario 2011-05-15 14:11:12 +02:00
Günther Brammer 06cfc6e4fc Remove unused C4SDefinitions::AssertModules 2011-05-15 14:10:22 +02:00
Günther Brammer f97cde74c3 Split C4V_Any into C4V_Nil for the data type and C4V_Any for the typecheck 2011-05-09 14:37:28 +02:00
Günther Brammer 177b085271 Script: SetPlrExtraData and SetCrewExtraData can store strings 2011-05-02 23:01:19 +02:00
Günther Brammer 1583ad603b Scenario.txt: Definition1 defaults to Objects.ocd
Every scenario in the repository uses that, so it should be the default.
2011-05-03 00:16:20 +02:00
Nicolas Hake a6429bad54 c4group: Remove timestamps from groups, use checksums only 2011-05-01 13:37:36 +02:00
Günther Brammer e2c495e274 Do not append a \0 to the Scenario.txt 2011-04-29 18:16:48 +02:00
Günther Brammer 90a8fa356c Remove some unused script callback names 2011-04-28 20:27:36 +02:00
Günther Brammer 5a64272e3b Optimize multiple Find_AtRect criteria
Find_Or(Find_InRect(), Find_AtRect()) still needs to search the whole
object list, and Find_And(Find_InRect(), Find_AtRect()) simply uses one
of the two bounds to limit the search, though.
2011-04-28 20:24:21 +02:00
Günther Brammer e537296829 editor: Change FileSelect abstraction to use StdStrBuf
Of course, windows still uses a buffer on the stack, but at least the other
versions don't.
2011-04-08 23:52:40 +02:00
Günther Brammer 6768614feb Silence various warnings 2011-03-28 20:58:42 +02:00
Günther Brammer b2b4176745 Undeprecate the Melee rule
The Melee rule is the interface to distinguish Melee- and Cooperative
scenarios for various purposes. Using a separate flag might be cleaner, but
would violate the do-not-repeat-yourself-rule.
2011-03-30 21:17:57 +02:00
Günther Brammer c6751e1620 Undeprecate C4ID::Clonk
The Clonk C4ID is used as a default for scenarios that do not specify a
crew.
2011-03-30 21:15:16 +02:00
Günther Brammer 5b808be269 Remove some unused variables
gcc 4.6 finds variables that are write-only.
2011-03-28 19:31:28 +02:00
Günther Brammer 881e883ecc Script: Remove Bubble engine function in favor of the script implementation 2011-03-30 21:10:05 +02:00
Günther Brammer 3844dc8740 Script: PlayerObjectCommand only takes ints as Tx parameter
C4Object::ObjectCommand was not updated for the C4Value-in-C4Command change
and still exposed the raw pointer values. Given that SetCommand works just
fine for "Call" commands, simply change the Tx parameter to int.
2011-03-28 18:43:59 +02:00
Günther Brammer 7fa761a2a6 Script: AddMenuItem any parameter only accepts object and definition proplists 2011-03-27 18:17:18 +02:00
Günther Brammer 303359f4ab Particles: Remove the unused target coordinates from Face
Particles were always drawn centered around their position, and the
"used because stup" comment explaining the use of C4TargetRect instead of
C4Rect is probably outdated.
2011-03-28 18:36:16 +02:00
Günther Brammer e31e2351c6 Do not update waypoints before transfer zones
Unused variable noticed by gcc 4.6.
2011-03-28 18:38:44 +02:00
Günther Brammer 2031fb0644 Do not enumerate pointers before saving
Instead, retrieve the number on demand during serialization. This saves
lots of unnecessary code and makes serialization actually not modify the
objects. At least with the exception of nInfo, but that should be save.
2011-03-28 00:15:06 +02:00
Günther Brammer f3365ab73b Arrays with multiple references are stored just once
This is done with the new C4ValueNumbers class. Every array and proplist
with the exception of objects, definitions and effects gets a number
when the game is saved and is restored via that number on load.
2011-03-27 18:14:41 +02:00
Günther Brammer c8ad0228b2 Store Objects in the Game.txt instead of a separate Objects.txt 2011-03-27 16:51:14 +02:00
Günther Brammer f582a97998 Add C4ValueNumbers helper class and pass it through to C4Value::CompileFunc
In preparation of using that class to enumerate and denumerate various
pointers.
2011-03-26 23:59:35 +01:00
Sven Eberhardt 269c7b208c control config dialog 2011-03-30 22:11:47 +02:00
Günther Brammer b5dea20dae Remove some dead code 2011-03-27 18:15:10 +02:00
Günther Brammer acac8a01d4 Store the name of an effect in its proplist 2011-03-16 19:07:18 +01:00