Commit Graph

985 Commits (master)

Author SHA1 Message Date
Nicolas Hake 735f9cc06b C4Landscape: Pull everything private out of the header
Since LTCG is enabled now, we don't have to define every function inside
the headers for ~xXx super speed xXx~, which means we can strip the
headers down to their bare minimum and reduce interdependencies and
therefore recompilation times by a lot.
2016-04-03 13:24:24 +02:00
Lukas Werling a12e485458 Qt Editor: Add scroll bars to the viewports 2016-03-28 22:07:43 +02:00
Lukas Werling 6d9aef33c2 Merge branch 'qteditor-sdl' into qteditor 2016-03-26 20:57:10 +01:00
Sven Eberhardt f2daa51fa7 Qt Editor: Add "Welcome" dock widget 2016-03-26 01:36:40 -04:00
Maikel de Vries dc1e828cfb add callback OnLineChange when line changes its vertices or vertex positions 2016-03-22 21:53:32 +01:00
Maikel de Vries fc008241cd rename LineBreak callback to OnLineBreak 2016-03-22 18:58:55 +01:00
Lukas Werling eefa8749a8 Fix viewport Zoom getting set to NaN 2016-03-22 16:49:39 +01:00
Lukas Werling 19caa65b7b Merge branch 'sdl-gamecontroller' (pull request GH-17) 2016-03-21 16:39:28 +01:00
Lukas Werling 75f62e52f2 Make Qt editor work with the SDL engine
Viewport rendering doesn't quite work yet, though.
2016-03-20 21:16:52 +01:00
Sven Eberhardt ed0647866e Qt Editor: Add preview for new object placement 2016-03-19 14:40:22 -04:00
Sven Eberhardt 4f70fdbfc8 Qt Editor landscape drawing fixes and improvements. Add brush size preview. 2016-03-18 00:26:14 -04:00
Sven Eberhardt f6ce50e9e7 Qt Editor: Use qt widgets for viewports 2016-03-10 00:07:17 -05:00
Sven Eberhardt 80549ca2cc Qt Editor: Add object creator 2016-03-06 13:06:29 -05:00
Günther Brammer b54ddc7663 Merge branch script 2016-03-01 03:04:17 +01:00
Lukas Werling e52bf6962b Fix gamepads only working after game start
This affected all platforms other than SDL.
2016-02-23 20:20:41 +01:00
Lukas Werling 9e0143b998 Remove gamepad ids from key codes
We want one gamepad key mapping to work with multiple gamepads, so
including the id there doesn't make sense.

Additionally, the gamepad id may change during the game (controller
hot-plugging).
2016-02-21 18:27:02 +01:00
Lukas Werling 9f69c650d6 Use icons for all controller buttons
The icons currently only show Xbox 360 controller labeling. The icon set
also includes icons for PlayStation controllers, so we could extend this
in the future.
2016-02-21 18:27:02 +01:00
Lukas Werling 24622f3a9c Update main menu GUI gamepad control bindings
It is now possible to control all GUI menus using the left stick or the
dpad, along with the A and B buttons on the controller.

This also doubles the button emulation dead zone to make navigating the
menus with the stick easier.
2016-02-21 18:26:44 +01:00
Lukas Werling 24ef8b43af Grab the mouse while in-game (#1637)
This only implements this for the SDL port for now.
2016-02-12 21:09:40 +01:00
David Dormagen 91391c64af draw global particles on plane 900
Previously, global particles would be drawn even in front of Plane 1000+ (GUI) objects. Additionally, it was impossible to specify particles that were supposed to always be in front of all other particles (e.g. fog, clouds, emulated FoW, ...).
Now, you can attach particles to an object on plane 901+ and have them be in front of everything else.
2016-02-09 20:43:23 +01:00
Sven Eberhardt 439b1f481c Register Objects.c script as global constant to make it accessible from outside 2016-02-06 21:12:22 -05:00
Günther Brammer 2fe0beebdb Move contents of src/gamescript into other directories
C4Effect will get moved into the ScriptEngine, and just three source files
is a bit too little for one directory.
2016-02-02 02:57:46 +01:00
Nicolas Hake e9cf0f6fdc Stop pretending we support 16 bit color
The GTK and OS X platforms already ignored the requested bit depth and
always used 32 bit. Windows and SDL would set a 16 bit color depth for
the screen, but still did all of the rendering short of the final
present in 32 bit.
2016-02-02 00:00:23 +01:00
Nicolas Hake 0c3811fe66 Keep rendering while unfocused (#1638)
In windowed mode, we shouldn't stop rendering just because we have lost
focus. However, we don't need to render at full framerate; throttling to
5 fps should be sufficient. Note though that we still have to calculate
game ticks at full speed so network games don't slow down when a player
tabs out of the game.
2016-02-01 20:48:17 +01:00
Günther Brammer 03d11cd596 Merge script branch 2016-01-31 21:51:58 +01:00
Maikel de Vries 4bcdfc451e block construction sites based on Exclusive and not on planes (#1534)
This makes more sense, exclusive object block all other construction sites, irrespective of their planes.
2016-01-30 14:46:14 +01:00
Günther Brammer 9dadfba5af Move GlobalNamed.SetNameList call after Link() into Link()
It isn't clear whether that call is necessary since the C4AulScriptEngine
constructor already does this, but it is clear that duplicating the call
all over is a bad idea.
2016-01-25 00:00:58 +01:00
Günther Brammer 68c436576e Simplify construction of C4AulParSets 2016-01-25 00:00:57 +01:00
Günther Brammer 6b6dd96719 Move GameScript.GRBroadCast to Game.GRBroadCast
This avoids a dependency on ::Objects from C4ScriptHost.
2016-01-24 02:09:14 +01:00
Günther Brammer e1a38ee010 Move references to ::Objects and ::MaterialMap from C4AulLink to C4Game
This changes the order in which the various parts of the engine are updated
after a definition reload, but they should not interfere with each other.
2016-01-24 02:09:14 +01:00
Günther Brammer 93f12150c4 CMake: Remove obsolete USE_X11 option and add USE_WIN32_WINDOWS
USE_WIN32_WINDOWS was previously defined in PlatformAbstraction.h. Move it
to CMakeLists.txt and config.h like its peers. Replace USE_X11 with USE_GTK
or GDK_WINDOWING_X11 as appropriate.
2016-01-23 20:36:34 +01:00
Günther Brammer 11bbeb2a5b Rename WITH_DEVELOPER_MODE to USE_GTK
This mirrors USE_WIN32_WINDOWS, USE_SDL_MAINLOOP and USE_COCOA.
2016-01-23 20:36:33 +01:00
Armin Burgmeier e13cda4bd0 Use an IBO for the particle system
glDrawElements needs an IBO when using a core profile. The particle
system's IBO is actually quite static since it's always a triangle
strip with 2 triangles followed by a PRI. Therefore, this reduces the
amount of data we have to send to the GPU compared to the previous
solution.

Also, remove the workaround when glPrimitiveRestartIndex is not
available since it is always available with OpenGL 3.1 and when using
a core profile we are guaranteed to have OpenGL 3.1 anyway.
2016-01-17 11:37:17 -08:00
Sven Eberhardt 148073a956 Fix black NO_OWNER viewport in network mode. 2016-01-16 16:29:23 -05:00
Sven Eberhardt 4eddeba9aa Fix crash when drawing zero-sized viewports (may happen during editor viewport initialization) 2016-01-15 08:53:00 -05:00
Sven Eberhardt c569036d1d Make NO_OWNER viewports black in fullscreen+non-debug for non-observers #1557 2016-01-10 09:50:21 -05:00
Sven Eberhardt 6ea51e9f7a Fix order of initialization of C4Game/C4GraphicsSystem.
Game.GraphicsSystem could be constructed after Game, but was accessed in C4Game::Default.
2016-01-07 23:42:18 -04:00
Günther Brammer 16ef28e05f Drop unused C4VERSIONBUILDNAME and C4ENGINEINFO
This was used to name snapshot releases of the Network2 branch, and has
seen almost no use since.

C4ENGINEINFO(LONG) was a duplicate of C4ENGINENAME and C4ENGINECAPTION.
2015-12-29 15:47:55 +01:00
Nicolas Hake ddd068c830 C4Viewport: Turn some owned pointers into std::unique_ptr 2015-12-28 21:45:14 +01:00
Nicolas Hake 3590dda85a C4Viewport: Merge ctor/Default, dtor/Clear 2015-12-28 21:43:03 +01:00
Nicolas Hake d737dc1b05 Remove C4Video, StdVideo
Video recording and playback only worked on Windows, and recording only
handled video, not game audio. As such, it was of fairly limited use,
and there's lots of software available these days that handle both.
2015-12-28 11:43:41 +01:00
Nicolas Hake 7475b89bd2 C4MessageBoard: Merge Default/Clear into ctor/dtor 2015-12-28 11:43:40 +01:00
Nicolas Hake fc1189dfe4 C4UpperBoard: Remove empty Default/Clear 2015-12-28 11:43:38 +01:00
Nicolas Hake d65af91694 C4GraphicsSystem: Remove unused function 2015-12-28 11:43:37 +01:00
Nicolas Hake 3c625a00dd C4Game: Turn some owned pointers into std::unique_ptr
Using std::unique_ptr instead of raw pointers makes ownership clear and
avoids leaks.
2015-12-28 11:43:37 +01:00
Nicolas Hake d063e02a3c C4FullScreen: Remove several unimplemented function declarations 2015-12-27 16:49:41 +01:00
Nicolas Hake 4980572c79 C4Game: Remove several unimplemented function declarations 2015-12-27 16:49:41 +01:00
Nicolas Hake 33e2626649 Win32: Stop trying to steal focus from other apps
If the user switched away from OC while it was loading, there was
probably a reason for that. We'll no longer assume we're the most
important app in the world and steal the focus away from whatever the
user was doing.
2015-12-27 13:22:18 +01:00
Nicolas Hake f0eeb3f6b3 Make headless build compile again 2015-12-15 19:45:32 +01:00
David Dormagen dcfb986e34 moved sounds into subfolders
This completes http://forum.openclonk.org/topic_show.pl?tid=3215
2015-12-13 22:14:55 +01:00
Sven Eberhardt 171080cbd5 Play frontend music by tag. 2015-12-12 12:08:45 -05:00
David Dormagen fa10a214b5 replaced two missing sounds
..which were easy to find due to the new missing-sound-warning. Hah!
We have cool wind now.
2015-12-10 19:36:54 +01:00
Sven Eberhardt d736b613b3 Keep and compile Objects.c file in savegames #1077
Just don't call the InitializeObjects() function. But the file should be left there because it may contain static variables required in scripts.
2015-12-08 22:22:52 -05:00
Nicolas Hake 96fcf1389a Aul: Make engine not automatically log error summary
Getting the error summary written to the log/console automatically may
be useful for general game usage, but when testing Aul we just end up
with thousands of useless messages in the output. Let the caller log the
message if it's really desired.
2015-12-08 13:17:39 +01:00
Sven Eberhardt 96082569bd Allow sounds in subfolders and create namespaces for them (#1185) 2015-12-06 23:44:41 -05:00
Sven Eberhardt cc12230d56 Add "immediate" parameter to SetPlrView and ResetCursorView script functions to force viewport scroll position to the target. 2015-12-02 22:11:28 -05:00
Sven Eberhardt 3fdf7142b5 Fix custom viewport zoom initialization done in InitilizePlayer in fullscreen mode. 2015-12-02 21:24:57 -05:00
Sven Eberhardt 8c3e61c3da Fix NO_OWNER global sound modifier on savegame resume (#1462) 2015-12-02 20:27:38 -05:00
Nicolas Hake 6738ef1f4c Clear object pointers in inactive objects (#1238, #1452)
Instead of iterating through the main object list twice to check for
pointers, iterate through both the main list and the inactive list.
2015-12-01 23:46:46 +01:00
Nicolas Hake a3b7b66386 Drop "Toggle" helper function
Toggling a boolean is trivial enough to not really warrant a helper
function.
2015-11-15 16:15:25 +01:00
Nicolas Hake 24b54211c5 Drop Min, Max, Swap for std::min, std::max, std::swap
The C++ standard library comes with perfectly fine implementations of
these functions, so there's no point in reimplementing them just for the
hell of it.
2015-11-15 13:53:01 +01:00
Armin Burgmeier 4addc62467 Open Graphics.ocg before reloading a definition (#1428)
We might need to load shader slices when reloading mesh materials.
2015-10-17 19:05:23 -04:00
Armin Burgmeier 70fd6d20bf Keep parallax objects fixed on full map screenshots (#1042) 2015-10-17 17:38:50 -04:00
Sven Eberhardt 2a31fe72f8 Initialize new player viewports with proper zoom and zoom limits (#1419). 2015-10-10 21:47:09 -04:00
Sven Eberhardt f49dc93d44 Fix full map screenshot saving.
It was partly overwritten by a regular screenshot being saved in parallel.
2015-10-09 23:06:02 -04:00
Sven Eberhardt cc5d43d0b0 Localize loading message for scenario local player control definitions. 2015-10-05 22:38:45 -04:00
Sven Eberhardt 17e0e2f423 Add breaks between music. 2015-09-30 22:50:18 -04:00
Sven Eberhardt 737b1fd8fd Save screenshots in background thread (#998, #1104).
Also ensure music keeps streaming while collecting data for full map screenshot.
2015-09-29 20:48:34 -04:00
Sven Eberhardt 8614ce46c4 Create default ambience controller in all scenarios.
Can be overloaded by providing a custom function InitializeAmbience either globally or in the Scenario proplist.
2015-09-28 20:20:31 -04:00
Sven Eberhardt 59d7c761fc Screenshot fixes and optimizations.
* There was an off-by-one-error causing a blank line at the screen upper screen border.
* Remove ApplyGamma. It is always applied because Gamma is just part of the drawing shaders now.
* Save by copying rows instead of pixels for whole map screenshots.
2015-09-28 18:54:34 -04:00
Sven Eberhardt 1f46a9004c Fix some erroneous file orders causing group rewinds. 2015-09-22 23:47:06 -04:00
Armin Burgmeier b750ac6537 Remove outdated comment 2015-09-22 22:28:38 -04:00
Armin Burgmeier f4a87d5d2f Fix image aspect of meshes embedded in messages (#1380) 2015-09-22 22:26:12 -04:00
Sven Eberhardt e4eedf3c45 Unify directory separators of filenames given on command line (#1066) 2015-09-19 00:06:42 -04:00
Armin Burgmeier fd285f6656 Create mipmaps only for static textures that are expected to be zoomed
Hopefully fixes #1403.
2015-09-18 21:10:39 -04:00
Sven Eberhardt 73a42fef92 Suppress warning messages for undefined fields when returning to main section in LoadScenarioSection. 2015-09-14 23:01:09 -04:00
Armin Burgmeier 20eb0615ee Custom shader for drawing sky
Add a C4ShaderCall parameter to tho most important drawing functions, and
make C4DrawGL's CreateSpriteShader public with additional parameters to
specify additional defines and shader slices. C4Sky uses this to compile its
own shader with OC_SKY defined.
2015-09-12 18:15:34 -04:00
Sven Eberhardt e3213812a9 Implement GetStartupTeamCount() script function (#1246).
Returns number of teams containing active players at game start.
2015-09-06 23:29:22 -04:00
Sven Eberhardt c22157c04b Simplified implementation of StartupPlayerCount.
Setting it by player filenames in the beginning is not necessery (and wrong for invalid files). Also copying it through C4S.Head didn't serve any purpose because PlayerInfo is synchronized in network and replays and startup player count can be deduced from that.

Tested in standalone, network, savegames, runtime join and replays from standalone, savegames and runtime join (Some replays of network games were bugged but that's an unrelated error).
2015-09-06 22:31:04 -04:00
Sven Eberhardt 0ceda6734b Fix memory leak in TextureMap initialization.
The Default call from C4Game is issued before construction of all members, which causes a memory leak when TextureMap is actually constructed.

Just merge Default() into Clear(). The separation into two calls serves no other purpose than putting the class into an inconsistent state between them.

It actually does that in almost all other subclasses as well but they don't allocate memory.
2015-09-04 21:49:36 -04:00
Sven Eberhardt 0b308e75fe Remove duplicate sound system initialization. 2015-09-03 23:47:41 -04:00
David Dormagen ac738735b2 Merge branch 'master' into Controls
Conflicts:
	planet/Objects.ocd/Vehicles.ocd/Airplane.ocd/Script.c
	src/game/C4Game.cpp
	src/game/C4GraphicsSystem.cpp
	src/gamescript/C4GameScript.cpp
2015-09-02 08:19:34 +02:00
Sven Eberhardt 7d9f7aee02 Fix some unused variables and integer type conversions. 2015-09-01 22:18:39 -04:00
Sven Eberhardt 15a1a62521 Automatically deduce shift state in combo keys with Control/Shift combo. 2015-09-01 19:11:13 -04:00
Sven Eberhardt 95baaa7934 Enable usage of LeftControl, RightControl, LeftShift and RightShift as player control keys. 2015-08-31 20:50:54 -04:00
Peter Wortmann 30857e835e Shader gamma implementation
In comparison to the old system, this is a downgrade - instead of being
able to set a full color mapping by gamma ramp, we now get just a value
per colour channel.

Upside is that we do not need to play around with the global gamma ramps
any more, which was arguably the wrong way to do it.

This commit will likely break everything that has been using gamma so far.
2015-08-31 17:35:08 +01:00
Sven Eberhardt 7813d87338 Fix prop list leak on game end when a sound with a modifier is currently playing. 2015-08-29 13:20:51 -04:00
Sven Eberhardt 41fd8c38b0 Ignore mission access in editor mode. 2015-08-27 22:19:09 -04:00
Sven Eberhardt 6ab6a1ac3c Add script interface for some EFX sound modifiers. 2015-08-27 21:44:23 -04:00
Sven Eberhardt cf940d639b Fix memory leak caused by circular prop list chains.
The shapes library has such pointer chains. The leaks were getting pretty heavy because they included pointers to C4AulFuncs, which kept a lot of parts of the script engine and string tables in memory.
2015-08-20 20:19:38 -04:00
Sven Eberhardt 5ec9999d4c Fix crash on global or scenario script reload.
The string table of System.ocg scripts (except the global System.ocg) pointed to nowhere after the initial load phase, but is still required for reload. Added a ref counting option to keep these string tables alive.
2015-08-20 13:15:11 -04:00
Armin Burgmeier 08ae643c2c Add a draw mode which shows the background 8-bit surface 2015-08-04 21:21:24 -04:00
Armin Burgmeier 92f3a3e749 Remove GBackIFT in favor of a lookup in the background surface 2015-08-04 21:21:23 -04:00
David Dormagen f05345375c fixed wrong offset in scripted GUIs when upper-board is active 2015-08-02 23:19:28 +02:00
David Dormagen 36544bd56c Merge branch 'master' into Controls
Conflicts:
	planet/Objects.ocd/Libraries.ocd/Producer.ocd/Script.c
	planet/Objects.ocd/Structures.ocd/Foundry.ocd/Script.c
	planet/Objects.ocd/Vegetation.ocd/Branch.ocd/Script.c
	planet/Objects.ocd/Vegetation.ocd/Trunk.ocd/Script.c
	planet/System.ocg/FindLocation.c
2015-08-02 19:24:04 +02:00
Sven Eberhardt 0d48105b46 Added shape library.
Also fixed some coconut tree reproduction issues.
2015-07-31 00:42:01 -04:00
Armin Burgmeier 5f63e9d4b3 Skip mission access check in debug builds 2015-06-30 22:08:37 -04:00
David Dormagen 196f528201 Merge branch 'master' into Controls
Conflicts:
	planet/Objects.ocd/HUD.ocd/FancyGridMenu.ocd/DefCore.txt
	planet/Objects.ocd/HUD.ocd/GridMenu.ocd/DefCore.txt
	planet/Objects.ocd/Helpers.ocd/Dummy.ocd/Graphics.png
	planet/Objects.ocd/Items.ocd/Tools.ocd/WindBag.ocd/Script.c
	planet/Objects.ocd/Items.ocd/Weapons.ocd/Javelin.ocd/Script.c
	planet/Objects.ocd/Libraries.ocd/ClonkControl.ocd/Script.c
	planet/Objects.ocd/Libraries.ocd/Constructor.ocd/ConstructionMenu.ocd/Script.c
	planet/Objects.ocd/Libraries.ocd/Constructor.ocd/Script.c
	planet/Objects.ocd/Libraries.ocd/Flag.ocd/Marker.ocd/Script.c
	planet/Objects.ocd/Libraries.ocd/Producer.ocd/Script.c
	planet/Objects.ocd/Structures.ocd/Flagpole.ocd/Script.c
	planet/Objects.ocd/Structures.ocd/Pump.ocd/Script.c
	src/game/C4Game.cpp
	src/gamescript/C4GameScript.cpp
	src/gui/C4GameMessage.cpp
	src/landscape/C4Landscape.cpp
2015-06-03 22:32:36 +02:00
David Dormagen 9968b0000c custom GUIs: restrict the maximum size of a menu window to 100em x ~62em
Fullscreen GUIs on wide-screen monitors look stupid. This patch tackles this by restricting the maximum size to something that can still be seen with a glance.
For very high-DPI or low-DPI screens, the user would most likely adjust the font size in the options (todo) anyway and thus also change the maximum menu size.
2015-03-27 11:33:57 +01:00
Nicolas Hake 5562b09dc4 Remove a lot of disabled legacy code, round 2
Maybe at some point we'll be rid of all the commented-out code that
nobody has looked at in years.
2015-03-25 20:02:53 +01:00
David Dormagen d07893dadc fixed player names, clonk names and selector info being zoomed (#687) 2015-03-22 09:58:43 +01:00
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
David Dormagen bd04722553 Merge branch 'master' into Controls
Conflicts:
	planet/Objects.ocd/HUD.ocd/Controller.ocd/Script.c
	planet/Objects.ocd/Libraries.ocd/ClonkControl.ocd/Script.c
	planet/Objects.ocd/Libraries.ocd/Constructor.ocd/ConstructionMenu.ocd/Script.c
	planet/Objects.ocd/Libraries.ocd/Constructor.ocd/Script.c
	src/game/C4GraphicsSystem.cpp
	src/game/C4GraphicsSystem.h
	src/game/C4Viewport.cpp
	src/gui/C4GameMessage.cpp
2015-01-15 19:57:01 +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
David Dormagen f89b8c8319 Merge branch 'master' into Controls
Conflicts:
	planet/Objects.ocd/Environment.ocd/Cloud.ocd/DefCore.txt
	planet/Objects.ocd/Libraries.ocd/ClonkControl.ocd/Script.c
	planet/Objects.ocd/Libraries.ocd/Constructor.ocd/ConstructionMenu.ocd/DefCore.txt
	planet/Objects.ocd/Libraries.ocd/PowerConsumer.ocd/Script.c
	planet/Objects.ocd/Libraries.ocd/PowerProducer.ocd/Script.c
	planet/Objects.ocd/Libraries.ocd/Producer.ocd/Script.c
	planet/System.ocg/ClonkControl.c
	src/gui/C4MouseControl.cpp
	src/landscape/C4PXS.cpp
2014-12-25 15:24:19 +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
David Dormagen 6476b0b026 Script GUIs: fixed saving & loading 2014-10-23 23:29:14 +02:00
David Dormagen c09e9880e2 Merge branch 'master' into Controls
Conflicts:
	planet/Objects.ocd/Libraries.ocd/ClonkControl.ocd/Script.c
2014-10-13 18:54:05 +02:00
David Dormagen 2a78b77bda renamed C4GuiWindow to C4ScriptGuiWindow to increase expressivness and reduce similarity with C4Gui* 2014-10-13 18:48:03 +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
David Dormagen 049088be78 CustomGUIs: major rework of layouting & controls; better integration of C4GUI 2014-10-11 11:29:02 +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
David Dormagen 7319f7b3cc rewrite of C4GuiWindow to use C4GUI stuff wherever possible 2014-10-05 16:46:14 +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