Commit Graph

2234 Commits (35f31a7c1d402c6f0a4c2711b147374b96f146ec)

Author SHA1 Message Date
Nicolas Hake 365d72fee1 Fix incorrect reloading of animations (#837)
Animation nodes accidentally did not have the correct
animation parent set when they were deserialized.

Closes #837, #872, #916.
2013-02-04 19:06:08 +01:00
Nicolas Hake e91d4a4278 Update more various references to clonk.exe 2013-02-03 20:54:34 +01:00
Armin Burgmeier 43a2836279 Implement texture unit blending in material scripts with a shader
This might make the rendering a bit quicker, since the whole texture
environment setup that we do every frame is no longer required --
instead only the shader is bound and a few variables uploaded. However,
this was not the main motivation behind this change.

It also simplifies the code a bit. The texture environment setup is
replaced by GLSL code generation. Another small benefit is that for
texture units in material scripts that do not use an actual texture
image no hardware TIU is being used. This reduces the number of hardware
TIUs required for rendering the Clonk from 3 to 2.

The main benefit of this change, however, is that material specific
and clonk specific color variations can be applied correctly. This mainly
concerns ClrModulation and MOD2 drawing. Before, the ClrModulation was
mixed with the material color, which could lead to incorrect results
depending on what the texture units were doing. Now it is being applied
by the shader after all texture units in the material scripts have been
processed.

Another motivation of this change is to implement support for custom
shaders, which is already foreseen by OGRE material scripts. The
specification has only to be implemented. With this change in place,
both custom shaders and "fixed" processing can share the same code in
the engine, since both end up using a shader for the mesh rendering.

The shader currently works only for directional lights, but should be
easy to extend to also support point lights.
2013-02-03 16:26:01 +01:00
Sven Eberhardt bf8655ab1d Fix Call() in global context (required for ScheduleCall) 2013-01-31 22:38:16 +01:00
Nicolas Hake d20ee02ad6 Abort SimFlight if no more movement can occur (#914)
In no-gravity situations, SimFlight would enter an endless
loop when trying to project an unmoving object, waiting for
a collision that would never happen.

Similarly, in negative gravity, SimFlight would continue
calculating objects that left the top boundary of the land-
scape, only aborting the simulation once the coordinates
underflowed to values below the landscape.
2013-01-30 14:00:08 +01:00
Armin Burgmeier 2a1ba0f8fe Split the mesh drawing into C4DrawMeshGL.cpp 2013-01-27 23:52:57 +01:00
Günther Brammer 9d34c4e30d gtk: Make the window fullscreen even when not changing the resolution 2013-01-24 19:36:59 +01:00
Günther Brammer 1e67a6fb24 Fix missing mouse cursor in fullscreen without resolution change
The mouse cursor was about the only thing affected by fZoom, and fZoom
should have been always 1 at the moment anyway.
2013-01-24 19:36:59 +01:00
Günther Brammer a62e556b63 Script: Reimplement GameCall in C4Script 2013-01-23 21:36:21 +01:00
Günther Brammer f38670abc3 Script: Functions can shadow global variables
Previously, declaring a global variable could break another script that had
a function with the same name.
2013-01-23 21:36:21 +01:00
Günther Brammer 42608c5209 Remove C4DirectExecScript, use an existing scripthost for the eval function
Since the scripthost isn't used to store the bytecode anymore,
Parse_Expression doesn't modify it anymore. So there is no need for a
temporary one.
2013-01-23 21:36:21 +01:00
Günther Brammer 57c01ac537 Rename C4AulParse::a to C4AulParse::Host and add C4AulParse::Engine
C4AulParse::Host is now only used for local variables and named functions.

Global directexec functions have neither, so they won't need a scripthost
at all anymore.
2013-01-23 21:36:21 +01:00
Armin Burgmeier 682e315ea1 mape: Fix an endless loop when enumerating available drives on Windows 2013-01-22 00:28:42 +01:00
Armin Burgmeier 0d4703e6a8 mape: Change "close window" shortcut from alt+F4 to ctrl+q
Alt+F4 will be caught by the window manager and close the program as
well.
2013-01-20 23:56:00 +01:00
Armin Burgmeier 2dcd26521d mape: Fix directory listing for directories with non-readable files 2013-01-20 22:28:30 +01:00
Günther Brammer 211634cf15 mape: Even more windows fixes 2013-01-20 20:36:51 +01:00
Günther Brammer 414cb8a4c7 gtk: GDK_KEY_* constants require at least GTK+ 2.21.8 2013-01-20 18:41:07 +01:00
Günther Brammer bf12980ccb mape: Further windows compilation fix 2013-01-20 18:39:56 +01:00
Günther Brammer cd19aff059 mape: Correct openclonk file extensions some more 2013-01-20 17:54:27 +01:00
Günther Brammer 78c39530a2 mape: Make group.c compile on windows 2013-01-20 17:53:52 +01:00
Günther Brammer 019ea36ee9 Remove unused C4Object::GetActionByName 2013-01-20 17:25:02 +01:00
Sven Eberhardt 4b189cacd1 Added Scenario [Landscape] FlatChunkShapes. If set to true, all chunks are drawn flat. Useful for scenario editing to fix little holes in your static landscape. 2013-01-20 12:51:33 +01:00
Günther Brammer ce87faaf9e Fix #including a definition that has local variables with proplists
The missing break meant that the freshly created copy of the proplist would
get overwritten by the original, which was thankfully caught and announced
with "internal error: constant proplist has the wrong parent".

Thanks to Zapper for the testcase.
2013-01-18 01:45:06 +01:00
Armin Burgmeier 8be7ff42db Merge branch 'mape' 2013-01-16 21:58:07 +01:00
Günther Brammer 263d944d5c mape: Build with debugrecs enabled 2013-01-16 02:13:38 +01:00
Sven Eberhardt 06e70b7b74 Synchronized EditCursor(De)selection, so you can edit scenarios in network mode and/or record it. 2013-01-15 23:30:23 +01:00
Sven Eberhardt f51a085592 Added object callbacks EditCursorSelection and EditCursorDeselection. Useful to show or hide developer stuff in the editor. 2013-01-15 23:10:25 +01:00
Armin Burgmeier 881ebd4b95 Don't show line numbers for error messages not coming from map generator 2013-01-14 02:25:15 +01:00
Armin Burgmeier 9e4d3d9caf Make C4MapCreatorS2 show line numbers in error messages when parsing from mem 2013-01-14 02:25:15 +01:00
Armin Burgmeier 2cd91a56c4 Add support for algo=script overlays 2013-01-14 02:25:15 +01:00
Armin Burgmeier 0b45ac83cf Make sure not to render map before map size configuration has been read 2013-01-14 02:25:14 +01:00
Armin Burgmeier ab66f3ffd5 Fix overload_materials and overload_textures flag being erroneously set to true
since they are not initialized by C4TextureMap::LoadMap in case
materials and/or textures are not overloaded.
2013-01-14 02:25:14 +01:00
Armin Burgmeier f016b07d47 Handle the unsupportedness of algo=script gracefully
at a later point this logic can be used to load the script file if
algo=script occurs somewhere in the Landscape.txt to be rendered.
2013-01-14 02:25:14 +01:00
Armin Burgmeier c8f9bc4252 Fix function namespacing 2013-01-14 02:25:13 +01:00
Armin Burgmeier 9a6d545f94 Use the OpenClonk version as the mape version 2013-01-14 02:25:13 +01:00
Armin Burgmeier 3849972dfd Fix a crash when the water material appears on the map somewhere 2013-01-14 02:25:13 +01:00
Armin Burgmeier 4aca001152 Fix warning about gtk_container_set_border_width being used with GtkBox 2013-01-14 02:25:12 +01:00
Günther Brammer 36e966ba26 mape: Port to GTK+ 3.0 2013-01-14 02:25:11 +01:00
Armin Burgmeier e7be3dc32d Remove some additionally introduced includes and forward declarations
they are no longer needed, the code compiles just fine without.
2013-01-14 02:25:11 +01:00
Armin Burgmeier aa2f3df779 Make mape link only against the part of the Clonk engine that is needed
and not against the whole engine. This avoids pulling in unnecessary
dependencies like SDL or OpenGL.
2013-01-14 02:25:11 +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
Armin Burgmeier 3420b2a9a2 Move C4ScenarioSection code from C4Scenario.cpp into C4ScenatioSection.cpp
This allows compiling and linking with C4Scenario.cpp without having to
pull in whole C4Game.
2013-01-14 02:14:37 +01:00
Armin Burgmeier bab0e4bb3c Show correct material color in preview 2013-01-14 01:41:22 +01:00
Armin Burgmeier 98c9ec7734 When rendering the generated map in a pixbuf, apply rowstride correctly
Current behaviour could lead to crash in case of non-square images whose
width was not a multiple of 4, i.e. rowstride != width.
2013-01-14 01:41:22 +01:00
Armin Burgmeier e8076221df Return the correct image width of the generated map
Before the rowstride was returned as actual image width
2013-01-14 01:41:22 +01:00
Armin Burgmeier cc4f62a327 Fix a memory leak in mape_texture_map_load_textures() 2013-01-14 01:41:22 +01:00
Armin Burgmeier d2729e17e7 Make average texture color available in mape, and set it from loaded textures 2013-01-14 01:41:22 +01:00
Armin Burgmeier b6bcc0d36e Make a texture's average color able to be set externally 2013-01-14 01:41:22 +01:00
Armin Burgmeier 26143ededc Load the default textures for all materials
so that materials without a proper tex= line are rendered correctly
2013-01-14 01:41:21 +01:00
Armin Burgmeier 8ce4b2472b Honor configured map size correctly 2013-01-14 01:41:21 +01:00
Armin Burgmeier 64c78f1674 Show a thumbnail of the textures in the textures view 2013-01-14 01:41:21 +01:00
Armin Burgmeier f8a61b4a00 Adapt for OpenClonk file extensions 2013-01-14 01:41:21 +01:00
Armin Burgmeier b2be39b576 Handle-ify the random seed setting 2013-01-14 01:41:21 +01:00
Armin Burgmeier 4b4da8646b Handle-ify the mapgen call 2013-01-14 01:40:54 +01:00
Armin Burgmeier 662d9bc4f4 Use the icons that come with OC for mape
gdk-pixbuf-csourcing them from the .ico files in a build step.
2013-01-14 01:40:47 +01:00
Armin Burgmeier 257db99165 Merge remote-tracking branch 'new/master' into mape
Conflicts:
	CMakeLists.txt
	src/graphics/C4Draw.h
2013-01-14 01:38:03 +01:00
Tobias Zwick d018920f53 if Crew is not specified, default to Clonk=1 in the scenario.txt 2013-01-13 22:08:30 +01:00
Armin Burgmeier 2d3a4981bf map creator: don't crash when using a template within itself (#534) 2013-01-13 18:19:32 +01:00
Tobias Zwick 28e2bdbb92 fix #724: revers the order in which GetCrew(plr,index) returns the crew 2013-01-13 15:45:51 +01:00
Tobias Zwick 65d50da83f cleaned up obsolete entries in scenario.txt 2013-01-13 15:45:01 +01:00
Martin Plicht 379cd1c210 StdStrBuf::AppendFormatV: Pass copied va_list to vsnprintf so the second iteration of the while loop does not crash 2013-01-13 11:31:13 +01:00
Günther Brammer 864c5c7ea8 copyright notices update 2012 2013-01-12 16:31:40 +01:00
Nicolas Hake a619b4b6ed c4group: Fix incorrect swprintf usage 2013-01-11 23:41:58 +01:00
Tobias Zwick d0a6bb099f fix #792: wouldn't load Overlay.*.png 2013-01-08 23:52:45 +01:00
Günther Brammer 08f86c2038 Script: continue in a do-while loop jumps to test instead of start of loop
This matches C and other languages.
2013-01-08 21:21:11 +01:00
Günther Brammer 41c88ba863 Use _snwprintf instead of swprintf
Apparently the C standard committee and Microsoft couldn't agree on how
swprintf should work.
We previously tried to work around the resulting breakage, but I just got
the following compilation error. It's really better to avoid that function
entirely. Since we only used it in windows-specific code, the
windows-specific _snwprintf is a nicely compiler-independent replacement.

src/platform/PlatformAbstraction.h: In function ‘int swprintf(wchar_t*, size_t, const wchar_t*, ...)’:
src/platform/PlatformAbstraction.h:243:12: error: redefinition of ‘int swprintf(wchar_t*, size_t, const wchar_t*, ...)’
/usr/lib/gcc/i686-w64-mingw32/4.6/../../../../i686-w64-mingw32/include/swprintf.inl:30:5: error: ‘int swprintf(wchar_t*, size_t, const wchar_t*, ...)’ previously defined here
2012-12-31 22:03:12 +01:00
Günther Brammer 6e4b5bd0ca Don't crash on Call() 2012-12-31 22:03:12 +01:00
Günther Brammer 2d05c9501c Make StdSync.h compile with neither windows nor pthreads again 2012-12-31 22:03:12 +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
Sven Eberhardt 6e85a7a5fc Fix SolidMasks not moving objects if the top left of the landscape was solid
A missing fixed conversion let the shape check happen at or around position 1/1 instead of at the actual object position.

Also removed a redundant contact check.
2012-12-31 15:56:02 +01:00
Armin Burgmeier c3c148d53a Add CreateParticleAtBone script function 2012-12-29 00:06:30 +01:00
Armin Burgmeier 84c43f9a1d Draw particles with subpixel precision 2012-12-28 19:28:39 +01:00
Armin Burgmeier e03c980038 Linux: Fix a crash when no primary output is specified 2012-12-28 17:32: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
David Dormagen 8f2058e55b adjusted PathFree2 to return the first point on the line from point1 to point2
before, when point1 was f.e. more to the right, PathFree2 would swap the points and return an unexpected point
2012-12-22 16:48:50 +01:00
Sven Eberhardt 16d4258b09 Added some array sorting functions to C4Script 2012-12-17 16:41:39 +01:00
Sven Eberhardt 548413449d fix material conversion on insertion into converting liquid 2012-12-16 18:52:32 +01:00
Sven Eberhardt 86b20be644 Fix C4Command::Jump, i.e. jumping as part of pathfinder. 2012-12-09 18:44:22 +01:00
Sven Eberhardt 6a4e5b0615 Attached objects with SolidMask (slave elevator case) can carry objects 2012-12-06 20:30:35 +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
Armin Burgmeier dfdd0fba3e Remove debug logs in X11 gamma ramp code 2012-12-02 15:52:29 +01:00
Armin Burgmeier 55b2a15d15 SaveDefaultGammaRamp: Return true if everything worked correctly 2012-12-02 15:52:13 +01:00
Armin Burgmeier fab541798f SaveDefaultGammaRamp: Don't crash if primary output is not connected
Instead, use the first connected output from the list of all outputs.
This happens on my computer, probably because the desktop environment
does not set the correct primary output.
2012-12-02 15:51:06 +01:00
Armin Burgmeier e8a4628d6a Fix xrandr version check for gamma ramp modification 2012-12-02 15:10:27 +01:00
Armin Burgmeier 0556bd6cd7 Initialize all variables in C4X11AppImpl 2012-12-02 15:09:44 +01:00
Günther Brammer 8cfd88f0d2 Make dedicated server compile with fmod 2012-11-30 22:20:16 +01:00
Günther Brammer 327bfa31e7 Remove some superflouos output from the dedicated server 2012-11-30 22:20:16 +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 a1589a48b6 Make network lobby command line processing available to the editor and dedi
Most of the processing was already done by C4MessageInput::ProcessInput and
C4MessageInput::ProcessCommand. Simply move the Lobby-only commands there,
too, and make them work without a Lobby MainDlg. This required almost only
cosmetic changes.
2012-11-30 22:20:15 +01:00
Günther Brammer b5ae4f1f9d Move CStdInProc to its own source file
It should be usable without USE_CONSOLE, even though only the dedicated server
uses it at the moment.
2012-11-30 22:18:38 +01:00
Günther Brammer f13df38ec1 update: Log an error message when extracting the update program fails 2012-11-19 22:45:19 +01:00
Günther Brammer cb74726158 Fix some BSD portability issues
Thanks to mdg on the forum and the Debian buildd.
2012-11-19 17:23:31 +01:00
Günther Brammer 069b36a1bd X11: Finish xf86vidmode removal 2012-11-18 01:07:59 +01:00
Günther Brammer 7967d94a59 Merge StdFont.cpp and C4Fonts.cpp 2012-11-12 02:30:16 +01:00
Günther Brammer 4dffefe8c9 X11: Remove support for the xf86vidmode extension
In practice, only the xrandr code path received any testing. Since Clonk
works fine without changing the resolution, this will not terribly
inconvenience anybody still stuck on old systems without xrandr.

Also only minimize the window when the resolution was changed.
The minimization is there to prevent accidental focus restoration
resulting in unwanted resolution switching.
2012-11-17 18:07:37 +01:00
Günther Brammer 8a001972ab Avoid some false positives on a naive Random-between-sequence-points check
The check was git grep -Ewn -e 'Random\s*\([^;{}]+Random' src
2012-11-17 16:30:12 +01:00
Günther Brammer c439c81362 Remove unused C4D_None 2012-11-12 02:41:20 +01:00
Nicolas Hake 102ac08c2e Don't assume char to be unsigned when generating packet header
OR'ing an enum value and a char with its highest bit set sign-extends the char.
On compilers with signed chars, this means you end up with a negative integer,
which can't be narrowed to uint8_t at initialization (which is what PacketHdr's
first member is).
2012-11-17 22:53:56 +01:00
Sven Eberhardt 99992b6f47 Fix sync loss and missing landscape or objects when joining two consecutive games without restarting the engine inbetween
Caused by an outdated cache of the DirectoryIterator in the main scenario group
2012-11-17 19:44:04 +01:00
Peter Wortmann afe653baae Use uint8_t consistently for UDP status packet byte
Thanks to pkern for spotting this.
2012-11-17 17:40:00 +00:00
Tobias Zwick 348fb8c7a9 clean up mouse controls, reduced cursor graphics to the used ones 2012-11-16 17:29:42 +01:00
Günther Brammer 95de10f6a8 editor: Fix USE_CONSOLE 2012-11-16 00:05:58 +01:00
Günther Brammer a8dfeeaf7e win32: Make USE_CONSOLE compile again
There's even a plausible implementation of CStdInProc::GetEvent.
2012-11-15 23:01:24 +01:00
Günther Brammer af62ab7931 Move script bytecode from C4ScriptHost into C4AulScriptFunc
This makes functions independent of their "Code Owner"s, which removes the
necessity to maintain that connection and carefully reset functions when
their scripthost is cleared.
2012-10-21 18:14:32 +02:00
Peter Wortmann 2c821552e5 Reset default material zoom level to 4
Due to popular demand
2012-11-07 22:14:07 +00:00
Peter Wortmann cc6d138133 Fixed CompileFunc entry for MaterialZoom
oops.
2012-11-05 19:16:33 +00:00
Peter Wortmann 95ad163c29 Fixed warning 2012-11-05 17:17:51 +00:00
Peter Wortmann a4b4065206 Made material zoom configurable
Also set default to 8. This might be a pretty controversial change, but
the amounts of screenshots we have at zoom levels beyond 4 just calls for
a more high-res approach.
2012-11-05 17:17:12 +00:00
Peter Wortmann 41b51907c6 Officially make BROKEN_ARRAYS_WORKAROUND the default
Pretty awkward compromise, but the array version seems to confuse a lot of
drivers, without causing an actual error. So this is probably better in
practice until better drivers are more common.
2012-11-05 16:57:33 +00:00
Günther Brammer cd147525eb Script: Warn when redefining a global constant 2012-10-23 02:05:33 +02:00
Günther Brammer e0aa23c8ba Rename C4PropList::NewAnon to C4PropList::NewStatic
"Anon" referred to the fact that these proplists have neither a number,
like simple proplists, objects and effects, nor an ID like Definitions.

However, they now store the names of the global constant or property they
are in, so "Anon" is no longer appropriate.

There are now three classes of proplists:
- ordinary proplists (C4PropListScript) have a number only in the savegame
- objects and effects (C4PropListNumbered) always have a number
- proplists created during initialization (C4PropListStatic) have a path

So the function could be called NewNamed, but the source of the proplist
has been far more stable than the method used for serialization, and Static
somewhat describes the source.
2012-08-15 19:43:02 +02:00
Günther Brammer 153ecf47a5 Script: GameCall doesn't catch script errors
FnGameCall is the only one that calls C4GameScriptHost::Call with
fPassError=true.
2012-08-19 21:29:43 +02:00
Günther Brammer 8cf2b6adf1 Script: Call can execute functions directly
Call(this["foo"],...) is now the same as Call("foo",...).
2012-08-19 17:34:53 +02:00
Günther Brammer fb9309ec2c Use a pointer to the operator definition instead of an array index
"op->" is a lot shorter than "C4ScriptOpMap[OpID]." Local variables. Use
them.
2012-10-21 16:13:53 +02:00
Günther Brammer a5ac8b341d Remove some superfluous {} from switch-case-constructs
To reduce and unify the indentation levels and reduce the number of lines.
2012-09-04 02:11:16 +02:00
Günther Brammer dc4f3766fe Script: Par(n) needs exactly one parameter, this() exactly zero
Mostly so that Parse_Params doesn't get used for things that are not
functions.
2012-08-13 19:07:56 +02:00
Günther Brammer 791484eb5a Bytecode debug output uses GetDataString for array and proplist constants 2012-10-21 15:51:34 +02:00
Günther Brammer c7e270d9d2 Fix SDL mainloop build 2012-11-01 18:10:38 +01:00
Günther Brammer a5b83665af Store all channels of a color together in CStdPalette
This mostly simplifies things, since most other places use an 32 bit
integer to store colors, but might even improve performance through better
cache locality.
2012-08-16 00:45:27 +02:00
Günther Brammer 4b096d71a0 Do not clip parallax objects (fix disappearing moon, #575) 2012-10-30 22:18:27 +01:00
Sven Eberhardt 5b90f2f39f Fix sequence combo key assignments so they don't break when mouse movment is assigned to a control 2012-10-28 17:47:02 +01:00
Sven Eberhardt 41cff7ad92 Editor: Fix handling of erronous map indices by material picker 2012-10-28 15:23:45 +01:00
Armin Burgmeier db31b53b6c Use floating point numbers for C4Facet coordinates
This fixes the lightbulb symbol from floundering around back and forth when
zoomed in and scrolling. Since C4Facets can be used to specify a target area
to draw into (such as in C4DefGraphics::Draw), and since this area can be
zoomed, sub-pixel precision can be achieved this way in such drawing
operations.
2012-10-28 15:33:58 +01:00
Tobias Zwick 12423b4b4f fix possible problems with several monitors on windows 2012-10-28 02:35:29 +02: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
Tobias Zwick 1ae7d55a21 fix odd cursor jumping on mousewheel use on windows (#439) 2012-10-28 02:11:03 +02:00
Tobias Zwick 9d85a0e79c make script function GetMaterialVal work as documented in the reference 2012-10-27 19:35:25 +02:00
Tobias Zwick d45d767a39 icon button text shall not overlap with icon image (#767) 2012-10-27 18:55:21 +02:00
Tobias Zwick a69c7a3e11 remove some obsolete control-related comments 2012-10-27 18:54:11 +02:00
Nicolas Hake 5a803c6110 Win32: Add dummy fourth FILE/PRODUCTINFO resource component
The FILEVERSION and PRODUCTVERSION components of VERSIONINFO blocks are 32 bit
integers, specified as four 8-bit integers. Apparently MinGW's windres chokes
on the definition if not all values are given.
2012-10-21 12:40:22 +02:00
Philipp Kern 32d66d79aa C4Network2.h: drop unused declaration InitHostResources 2012-10-21 22:21:17 +02:00
Philipp Kern e037300801 Fix spelling mistake: ressource -> resource. 2012-10-21 22:20:43 +02:00
Philipp Kern 4f67f73df2 Fix format string use
C4Aul's Warn uses the format attribute to check for format string correctness.
Passing a dynamic string buffer from FormatString to it will break the build
with -Werror=format-string. Given that Warn already does the formatting itself,
just drop the use of FormatString
2012-10-21 11:21:49 +02:00
Tobias Zwick eb1d2e6e18 remove description from goal in the game over dialog 2012-10-20 18:07:43 +02:00
Armin Burgmeier b4aafdd874 Remove build number aka C4XVER4 2012-10-18 23:54:50 +02:00
Tobias Zwick 89e7d633b0 fix update system - can now update from 3.0 to 3.1 2012-10-18 23:30:12 +02:00
Sven Eberhardt 140dc97b24 Rewrote PropList output string sorting to get rid of C4Set<T>::Sort()
C4Set<T>::Sort() breaks the internals of the class which Guenther doesn't like. Now the sorted list is returned as a list of pointers into the original set.
2012-10-16 15:47:56 +02:00
Günther Brammer a912d98a29 Don't crash when a function is deleted after its Owner
Functions are refcounted now and might outlive their script. Fortunately,
the function destructor didn't really need the Owner. This further damages
the pretense of multiple scriptengines, but that could be repaired by
storing a pointer to the engine in the functions.
2012-10-14 20:45:35 +02:00
Martin Plicht 4f8effcd10 mac: Fix editor window 2012-10-14 19:45:39 +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
Armin Burgmeier e041b790d8 Only send MouseSelection callback when the object was hovered at button press time 2012-10-14 19:35:30 +02:00
Sven Eberhardt c39d76f58c PXS sync error between Win32 MSVC build and Mac build 2012-10-14 19:08:59 +02:00
Sven Eberhardt 219dd68fd1 Some DebugRec on PropLists 2012-10-14 19:06:39 +02:00
Julius Michaelis c4506a2b69 Fix entering fullscreen mode in lobby
Remove a debuglog
2012-10-14 17:45:01 +02:00
Maikel de Vries 22d188466d Changed aspect ratio of title vs text in scenario selection 2012-10-14 16:24:40 +02:00
Armin Burgmeier 4534b8eb4e Make title picture size dependent on available space 2012-10-14 15:58:12 +02:00
Armin Burgmeier b851f4b3fa Fix the build 2012-10-14 15:18:28 +02:00
Sven Eberhardt ec22028640 Some DebugRec fixes 2012-10-14 14:39:22 +02:00
Armin Burgmeier 9c1496178b Load Graphics*.mesh files for use with SetGraphics (#480) 2012-10-14 14:37:45 +02:00
Sven Eberhardt 73120db094 DebugRec: CallEveryDefinition puts def names, not localized names into debug rec 2012-10-14 13:33:32 +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
Armin Burgmeier 7c46cfb110 Fix the "Error at graphics file Cursor" error when moving around the window
or tabbing in/out, or changing its size.
2012-10-13 20:06:15 +02:00
Tobias Zwick 48a7fc7968 make highres landscape default 2012-10-13 18:41:25 +02:00
Sven Eberhardt 31c876afbb Control options dialog: Fix display of multi combo keys 2012-10-13 18:37:40 +02:00
Armin Burgmeier 977cf98f82 Always climb up when pressing the direction key against the wall 2012-10-13 18:03:20 +02:00
Sven Eberhardt 878f8f9927 C4Group: .orig and .svn added to ignore list 2012-10-13 17:18:25 +02:00
Sven Eberhardt 96cb91a2a2 Fix resolution stuff for ScreenX/ScreenY==-1 and automatic switching 2012-10-13 17:17:06 +02:00
Günther Brammer 10dd29ee49 Do not scale or tumble while jumping upwards and hitting the feet
Theoretically, the Clonk shouldn't even hit the feet at the start of the
jump, but that's a quest for another time.
2012-10-13 17:14:13 +02:00
Armin Burgmeier 5274f61bf5 Fix c4script build 2012-10-13 16:32:09 +02:00
Tobias Zwick 42011a9442 fix #757 - waves are blue again now 2012-10-13 16:27:15 +02:00
Armin Burgmeier cf159068b3 Fix warning about undefined backspace key on Linux 2012-10-13 16:15:01 +02:00
Armin Burgmeier 56861e4601 Implement key by scancode in PlayerControls.txt on X11
Unfortunately they seem to be different in linux and windows
2012-10-13 16:03:47 +02:00
Martin Plicht 38256bfaac mac: First startup with no resolution configuration uses desktop resolution, resolution switching from options works correctly 2012-10-13 15:01:13 +02:00
Armin Burgmeier 26e7ae3532 Fix crash when changing AA setting on Linux (#744) 2012-10-13 14:15:09 +02:00
Armin Burgmeier 2ce648e5b5 Fix a GTK warning when changing anti-aliasing 2012-10-13 12:49:53 +02:00
Sven Eberhardt db84b849b1 /sound reenabled. Sound-creating client now shown in client list box (F4). No sounds played when client is ignored. 2012-10-13 13:37:59 +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
Nicolas Hake 27eb5dd65a Allow object interaction with closed borders
Conceptually, the landscape stretches infinitely on both left and right hand
borders of the map. So far, the "closed" part of the border only blocked objects
from passing through. (Additionally, there was a bug where you could scale the
border under certain circumstances.) This patch allows objects to properly
move around on the map borders, including scaling the fake terrain.
2012-10-10 21:28:25 +02:00
Sven Eberhardt 36ce50cdb4 build fix 2012-10-12 20:15:37 +02:00
Sven Eberhardt 4890015537 ! Fix crash on shutdown due to object deinitialization order 2012-10-12 19:00:23 +02:00
Günther Brammer f9afe30d74 Make C4StringTable leak detector not complain about "Global"
Simply put it into the list of internal strings. Its always used anyway.
2012-08-19 22:43:32 +02:00
Tobias Zwick cd498624b7 fix sorting of controls in controls selection dialogue 2012-10-10 23:34:18 +02:00
Tobias Zwick 86cbc2f650 replace boolean Group property in assignments with GUIGroup property 2012-10-09 23:59:32 +02:00
Tobias Zwick 48012aa91d add GUIDisabled property for key assignments 2012-10-09 22:24:48 +02:00
Tobias Zwick ec5f7f5b56 fix GUIName and GUIDescription in the "press button" dialogue 2012-10-09 22:04:01 +02:00
Nicolas Hake 9f83a613dc Always reset C4Action::t_attach when executing action (#808)
Not resetting t_attach leads to strange behavior in liquids since detaching from
the landscape usually happens via the Jump action which generally reverts to its
InLiquidAction before t_attach gets reset. By removing the shortcut return after
entering the InLiquidAction, we make sure t_attach gets reset correctly (as well
as immediately executing the correct action instead of doing so after a delay of
one frame).
2012-10-10 21:28:25 +02:00
Sven Eberhardt 420a91f5fd fix build 2012-10-09 19:04:11 +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
Sven Eberhardt 22c744f72e PlayerControls: Allow GUIName and GUIDesc in assignments. 2012-10-08 22:29:15 +02:00
Armin Burgmeier 1660ed310a Add support for the OGRE 1.8 binary mesh format 2012-10-08 21:50:20 +02:00
Sven Eberhardt 08b495e43d PlayerControls: When the user changes a key assignment in his local config, all derived key assignments (Key=CON_*) change as well (#807).
The "CON_" prefix is now mandatory when referencing other key assignments. Updated PlayerControls.txt to reflect that.
2012-10-08 20:45:04 +02:00
Tobias Zwick 17a59d3b77 tooltips for controls in control assignment dialog 2012-10-07 20:45:14 +02:00
Tobias Zwick ba1a2cbdad add missing strings for localisation of controls definition dialogue 2012-10-07 18:45:50 +02:00
Sven Eberhardt dada37d70e Sound system: Fix leaking channels when using OpenAL. (This caused sounds to stop after playing for a while) 2012-10-07 17:03:46 +02:00
Sven Eberhardt 6e953acc88 Sound system: Fix endless recursion when a sound couldn't be started due to lack of free channels 2012-10-07 16:34:08 +02:00
Sven Eberhardt 00349f045a SoundSystem: Implement non-apple wav loading when using OpenAL 2012-10-07 13:18:28 +02:00
Julius Michaelis 87854916ba Fix fix: cb043bd90678
Quickfixes are bad
2012-10-07 12:42:51 +02:00
Sven Eberhardt 15aa9b961e FIx build using OpenAL in MSVC 2012-10-05 18:02:52 +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 b264612b10 mac: Move C4EditorWindowController from platform to editor 2012-09-02 20:57:49 +02:00
Martin Plicht 562565f865 mac: Move C4OpenGLView.mm/h to graphics/C4DrawGLMac.mm/h and move some C4AbstractApp functions to C4AppMac.mm to better match implementations for the other platforms 2012-09-02 20:51:43 +02:00
Martin Plicht c2c484e70b mac: Rename C4AppDelegate.consoleController to editorWindowController 2012-09-02 16:18:20 +02:00
Martin Plicht 10a328d5ba mac: Change prefix of Objective-C classes/filenames from Clonk to C4, give xib files names that make more sense 2012-09-02 15:39:29 +02:00
Martin Plicht f389fd230c mac: Fix C4FileMonitor implementation by reporting files modified since last 3 seconds 2012-09-02 14:59:30 +02:00
Martin Plicht f6825d073e mac: Compile with Automatic Reference Counting enabled 2012-09-02 13:56:53 +02:00
Martin Plicht f7a26ba1a5 mac: Filter out Cocoa command line arguments that confuse clonk when started from the Xcode debugger 2012-09-02 11:24:49 +02:00
Martin Plicht ee140e4d08 mac: C4Application::SetVideoMode: Use desktop size when passed iXRes=iYRes=-1 2012-09-02 10:51:35 +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 5a2831a1e7 editor: Increase default viewport size to 800x500
This should allow one to place four viewports plus the console and the
property/tool window on a 1920x1080 screen.
2012-08-19 21:01:54 +02:00
Nicolas Hake 58ac553956 Win32: Do not reset graphics mode if no change is required 2012-08-28 00:01:01 +02:00
Nicolas Hake faf0006a6f Win32: Improve error reporting when changing resolution 2012-08-28 00:00:29 +02:00
Günther Brammer c9bcafba56 Simplify DoCon implementation
For example, the solidmask removal is done in
UpdateFace, and might have been needed in Clonk 4 or Clonk Planet, but the
current solidmask code is fine with the call from there.
2012-07-27 16:09:25 +02:00
Günther Brammer 6dac692bd5 DoCon holds the bottom-most vertex in place, not the bottom of the Shape
This makes trees not sink into the landscape when burning.
2012-07-27 17:44:59 +02:00
Günther Brammer 91a6c309a9 Reduce the copies C4Set makes
Mostly by changing functions to take a const reference, but also by using
move constructors. This helps with C4String leak debugging by reducing the
reference count changes.
2012-07-26 01:21:15 +02:00
Günther Brammer 576edc1e23 Fix crash when including a script that nests proplists in a local variable
Previously, only the outer proplist would be copied, but the parser expects
the inner proplists to also be present. Copy proplists deeply instead, as
is already done for functions, and in the linking step.
2012-08-09 01:21:54 +02:00
Günther Brammer bfdc02900c Change C4AulScript::GetPropList() return type to C4PropListStatic*
This doesn't actually change the type of any object, but shifts some casts
around.
2012-08-09 01:17:26 +02:00
Günther Brammer 3635839d12 Remove the disabled /sound command from the help text 2012-07-25 17:02:37 +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 35a0d7b6cd Script: Get/SetGravity use 1/100 px/tick^2 instead of 1/500
The old factor was chosen because the default gravity * 500 was exactly
100. But a lot of other engine interfaces use 1/100 px/tick or px/tick^2,
and that is a common scale for scripts to work in, too.
2012-07-15 22:42:17 +02:00
Günther Brammer 49a0ea7bd2 Support Decel for SCALE, HANGLE and FLIGHT, fall back to Accel
All procedures now use the Accel value if the Decel value is nil, and also
use the default Attach value if that is nil.
2012-07-15 21:47:50 +02:00
Günther Brammer 9f0556250f Clonks don't lose their speed when hitting a wall 2012-07-15 19:05:20 +02:00
Günther Brammer 3aaa37ad41 Store global proplist in a C4Value like the Scenario proplist
Since the script engine doesn't have an appropriate function to create the
proplist in, simply create it in the constructor and arrange for the
string table to be constructed first.
2012-07-26 01:27:52 +02:00
Günther Brammer 4405ce0798 Clear Scenario local variables during script engine cleanup
Other script hosts are simply deleted completely, and the parser would
also clean these up, but this avoids a complaint from the string table at
exit.
2012-07-26 01:24:04 +02:00
Günther Brammer 692fb103f1 DrawVertex uses thinner lines for the cross 2012-06-08 16:19:36 +02:00
Günther Brammer 06cb8b595d win32: Remove obsolete #include multimon.h
multimon.h was only needed for compatibility with Windows 95.
2012-07-18 03:40:19 +02:00
Günther Brammer f41590d71f Merge branch 'movement' 2012-07-13 23:27:14 +02:00
Sven Eberhardt de7b30d82a fix saving of resources loaded in the network lobby 2012-07-12 19:26:45 +02:00
David Dormagen e7ab0bd936 changed assert that was incorrectly triggered by script players 2012-07-07 16:58:52 +02:00
Armin Burgmeier 6661f8b8cb Fix a crash when attaching a mesh by definition fails 2012-06-30 22:04:48 +02:00
Günther Brammer 4985c519c6 Switch from SCALE to Walk on top of slopes
The precise rule is that only CNAT_Bottom vertices connect to the
landscape and connect at the bottom, too. It doesn't quite fit with
the other procedure-transitions because the movement code doesn't
consider the bottom vertex to touch the landscape in that situation,
but this is probably less weird than the old cornerscale teleportation.

Also don't transition from FLIGHT to Scale when the ComDir points
away from the wall. That tended to stop the Clonk in its tracks on
uneven ground.
2012-06-19 01:40:37 +02:00
Günther Brammer 24bfd6345d Use Action.Attach even when Action.Procedure is not nil
But default to the previously used value when Attach is not set. Use 0 to
override the default.
2012-06-16 03:01:47 +02:00
Günther Brammer bb292e828d Attached objects use the nearest available point instead of the farthest
This avoids some teleporting when there's some material behind the object
and in front of it. Especially useful for small bumps of material in front
of a wall with the new left/right attachment of the foot vertex of the
Clonk.
2012-06-08 16:20:26 +02:00
Günther Brammer 944ca60910 Tweak the "corner scale" behaviour
Instead of teleporting from sticking with the left/rightmost vertex to the
want to standing on the lowest one at the same position, the Clonk can now
climb using the lowest vertex alone. That means the teleport only needs to
cover only one pixel each in x and y direction to go from sticking to the
side of the landscape pixel to sticking on top of the same pixel.

Also remove some unnecessary x/ydir resets and make comdir in the direction
of the wall the Clonk is scaling keep the up/down direction instead of only
going up.
2012-06-08 16:17:42 +02:00
Günther Brammer bd371e38c1 Make the child pointers of the scriptengine C4AulScript*s again
The rope will create a C4AulScript for the rope engine functions instead of
putting them into the global scope, and we might want to put C4Object-only
functions into a separate C4AulScript some day, too.
2012-06-07 21:07:31 +02:00
Günther Brammer 6928332a0a Win32: Don't log things before retrieving GetLastError()
That just makes GetLastError return 0 - The operation completed successfully.
2012-06-06 17:13:51 +02:00
Günther Brammer 4c35c34ca4 Win32: Report GetLastError on OpenGL error 2012-06-06 16:49:40 +02:00
Nicolas Hake e843fbab50 Move leak checking behind standard header inclusion
The STL and CRT headers use placement new on certain compilers, so move our
memory debugging code behind the inclusion of those libraries; those are very
unlikely to leak or corrupt memory anyway.
2012-06-04 01:18:28 +02:00
Günther Brammer 4b2ea86726 Script: compare proplists by their contents instead of their identity
Objects, effects and definitions each have unique numbers/ids, so are
compared by identity as a shortcut.
2012-06-02 15:56:20 +02:00
Günther Brammer cdeabedf77 Simplify C4AulFuncMap a bit
The map is currently only used in the parser for some warning heuristics.
Since it uses a hash table with separate chaining and the amount of
functions is fairly predictable, the hash table doesn't have to be
resizable.
2012-05-28 00:53:41 +02:00
Günther Brammer c6fe23729b Replace function list from C4AulScript with proplist enumeration
This finally makes the function list in C4AulScript unnecessary.
2012-05-28 00:50:13 +02:00
Günther Brammer 487a0ea38f Store a copy of the proplist the preparser created for include/appendto
The parser now copies the contents of the proplists in the order of their
source scripts into the final proplist. This way, local variable contents
get properly included, and the list of functions has one user less.
2012-05-28 00:31:55 +02:00
Günther Brammer e26bc8e33a Move some parser implementation details to C4ScriptHost 2012-05-27 23:47:07 +02:00
Günther Brammer 7e00f3b5ad Use printf format instead of two strings for script warnings and errors 2012-05-26 00:22:22 +02:00
Günther Brammer ba1b896ebc Move C4AulFunc implementation to a separate file from C4Aul.cpp 2012-05-14 22:07:33 +02:00
Günther Brammer 9d30869e87 Remove unused C4ScriptFnDef::FunctionC4V
Also move C4AulDefFunc and C4ScriptFnDef to the same header the template
helper classes are in. Like them, these classes are a mostly invisible
implementation detail of the engine script functions.
2012-05-20 02:39:57 +02:00
Günther Brammer 09a5247e9c Convert the remaining classic FunctionC4V engine functions
The Call functions use the FunctionC4V2 style, the others the templates.
2012-05-20 02:04:46 +02:00
Günther Brammer abbfe41632 Use FunctionC4V2 registration style for the various Format()-like functions
The majority of their arguments is essentially a list, so treating
the arguments as an array fits.
2012-05-19 18:34:17 +02:00
Günther Brammer 0ca1c16205 Remove helper macro, types and functions for FunctionC4V2 style functions
The remaining users are variable-argument-count functions not needing them.
2012-05-18 20:02:25 +02:00
Günther Brammer 68c2083f49 Convert most functions in C4Script.cpp to the template registration style
The only exceptions are the logging functions which will use the
single-C4Value-pointer style.
2012-05-18 19:44:53 +02:00
Günther Brammer eb63110e4b Use a macro to shorten the call to register engine functions 2012-05-18 19:41:38 +02:00
Günther Brammer 2fded23a1b Editor: Get function autocomplete names from proplists instead of scripts 2012-05-18 17:49:38 +02:00
Günther Brammer 4e71af5489 Script: Add GetProperties function to get the keys of a proplist 2012-05-26 01:32:43 +02:00
Günther Brammer 62bc721a65 Make the child pointers of the scriptengine C4ScriptHost*s
This only tightens up the types a bit.
2012-05-15 19:32:58 +02:00