Commit Graph

2033 Commits (e91d4a42789bfa23945bf7c6aeaefdac48d3b1bb)

Author SHA1 Message Date
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
Günther Brammer a10ebdfabe Remove unused C4AulContext
The C4AulScriptContext is now an implementation detail of C4AulExec.
Also consolidate the C4Object * Obj and C4PropList * Def members to just
C4PropList * Obj and convert that to C4Object * on demand.
2012-06-04 00:03:49 +02:00
Günther Brammer 6815515a00 Consolidate C4AulFunc::Exec into just one virtual function
Deriving classes only need to implement one variant. The second Exec is a
trivial wrapper that doesn't have to be virtual.
2012-05-27 23:35:23 +02:00
Günther Brammer 09d08298bf Replace C4AulContext* this of C4Script engine functions with C4PropList*
This mainly removes some indirection and a superfluous struct.
2012-05-15 03:03:47 +02:00
Günther Brammer 0e6f972de4 Remove unused C4Object* parameter from C4AulExecError 2012-05-15 03:11:23 +02:00
Günther Brammer c86eadf5eb Script: Show the this parameter in callstacks before the function with ->
Also reuse the display code from C4Value instead of yet another format.
2012-05-15 03:51:20 +02:00
Günther Brammer 034ca7d894 Script: constant expressions can use local variables
For example:
local foo = { bar = baz };
local baz = 27;
2012-05-18 17:40:46 +02:00
Günther Brammer 26a470b30f The preparser creates static proplists, the parser looks them up by name
Constant expressions for global constants and for Definition properties are
now treated the same way. The preparser creates the structure that
the parser will fill in. Since the structure will not move, the parser can
refer to it before it is filled in, just like functions can call siblings
defined further down in the script. This will also allow proplists (and later
functions) to refer to each other.
2012-05-27 18:00:45 +02:00
Günther Brammer 2c86f02fc9 GroupReadSurface needs a C4Group to call AccessEntry on 2012-06-23 15:40:01 +02:00
Günther Brammer 7f9ab9ac19 Script: this returns nil after RemoveObject instead of throwing
Because the interpreter throws for every function that is called with a
this parameter that has been removed, this() isn't a function anymore.
The function could stay around so that Call("this") or foo->this()
would still work, but I doubt any script ever did that.
2012-06-18 04:07:36 +02:00
Günther Brammer 23d1246be1 Script: Add === and !== operators
These operators have a stricter definition of equality than the == and !=
operators. Those are already stricter than in some other languages, so the
new ones are probably not needed very often. But if the need does arise,
there's no workaround short of modifying the data structures and checking
whether they are still the same.
2012-06-11 00:47:28 +02:00
Günther Brammer dfebadfd68 Drop Landscape.NewStyleLandscape from the Scenario.txt
The format of the landscape in savegames has changed over time, but for OC
only the newest one is relevant, so the code for the old variants can be
removed.
2012-06-11 00:09:24 +02:00
Günther Brammer a528b0d76e Silence some g++ warnings 2012-06-15 18:16:49 +02:00
Günther Brammer c8907f5204 Shorten C4Value::GetDataString for Objects, Definitions and static proplists
The new output is also more often an expression that returns the value when
evaluated.
2012-05-08 02:24:43 +02:00
Günther Brammer 3a3ed01c89 Savegames: Save readonly proplists by their name
For example, the proplist in Clonk.ActMap.Walk is saved as DClonk.ActMap.Walk.
Should the script defining the proplist change while the savegame is stored,
the proplist will have the new contents instead of the old ones after savegame
load.

Also, save functions as DFlint.Hit instead of fDFlint.Hit. Loading uses the same
code as static proplist loading.

Curiously, this makes g++ 4.4 use the C4RefCntPointer move constructor,
which was broken until now. Fix it to take a mutable rvalue reference.
2012-06-01 17:27:59 +02:00
Günther Brammer ef3078d1d0 Remove unused C4Value constructor 2012-05-14 16:18:20 +02:00
Günther Brammer 9b3c3e067a Script: Remove useless SetLandscapePixel 2012-05-14 23:08:36 +02:00
Günther Brammer 9c3f949142 Point to the beginning of the current token in script error messages 2012-05-16 23:24:40 +02:00
Günther Brammer 15b07ca717 Start counting lines and columns in text files with 1
I checked two text editors, and they did that, too.
Also implement the special rules for tab stops, assuming a tab width of 8.
2012-05-16 23:21:14 +02:00
Günther Brammer 065b100dad Script: eval throws an exception when the script does not end after the expression 2012-05-08 01:03:29 +02:00
Günther Brammer ceb9c45984 Fix Script runtime reload
Just removing the right amount of functions from the proplists is
somewhat tricky, unfortunately.
2012-05-25 17:25:53 +02:00
Günther Brammer 20577f8575 GL: Identifiers starting with GL_ are reserved for the implementation
Some compilers are less strict about this than others, unfortunately.
The Gallium one complains with

preprocessor error: Macro names starting with "GL_" are reserved.
2012-05-30 23:34:08 +02:00
Nicolas Hake a029737811 Display VCS revision instead of build number for pre-release builds (#782)
This assumes that pre-release versions will always have a x.y.90 version (or
higher), and will in those cases display the revision in place of the fourth
version segment.
2012-05-28 16:28:49 +02:00
Nicolas Hake e0bde2256a GL: Make max uniform count available to shader and work around low limits (#786)
beliar reports that his driver doesn't support the number of fragment shader
uniforms that we're using in the landscape scaler. By making the reported limit
available to the GLSL code, it can use a workaround using a 1D texture to
transfer data.
2012-05-28 16:05:30 +02:00
Nicolas Hake 59b48f5069 Win32: Accept dropped definition files
Viewport windows had the required code to hande dropped files, but didn't tell
the window manager they'd accept drag & drop messages.

Also pull a loop invariant out of the loop (drop point can't change while we're
processing the drop message) to save function calls in cases with more than one
dropped file.
2012-05-23 22:37:07 +02:00
Julius Michaelis 9166c770ef <Ringwaul> Soooo I was thinking [\n] The Savegames folder should have the floppy disk icon instead of the standard book 2012-05-22 23:20:01 +02:00
Felix Wagner 918c7cd201 Real fix for GetPlrClonkSkin 2012-05-12 19:49:53 +01:00
Felix Wagner 36e55443e1 GetPlrClonkSkin returns nil on NO_OWNER, fixed clonk's gender setting. 2012-05-12 15:56:41 +01:00
Günther Brammer 830d6093a9 Fix Call error message 2012-05-07 21:28:43 +02:00
Günther Brammer 1a5653d468 Script: Remove DefinitionCall. Use Call instead.
No scripts in the repository use DefinitionCall, but in the unlikely case
that it's needed again, one can now use def->Call() instead.
2012-05-07 21:12:51 +02:00
Günther Brammer 93169c7d33 Script: Make Call() throw again if neither function nor ~ is present
And skip a ~ in the function name again.
2012-05-07 20:49:08 +02:00
Günther Brammer 16f87bbc50 Avoid an assert on Call("") 2012-05-06 18:33:31 +02:00
Günther Brammer 099cd15e56 Script: Remove unused OnBlastIncinerationDamage callback
Scenarios that want to override the default behaviour of BlastObject should
overload the BlastObject function itself. Objects can simply use the Damage
callback and/or set BlastIncinerate to nil.
2012-05-06 15:37:43 +02:00
Günther Brammer 2510734ad3 Script: Damage callback changed to Damage(Change, Cause, CausedByPlr) 2012-05-06 14:45:35 +02:00
Günther Brammer 752e945b8d Call C4PropList::Freeze in Link, remove now empty AfterLink functions
AfterLink was otherwise only used for the TimerCalls, which are now gone.
2012-05-06 00:06:33 +02:00
Günther Brammer 46fd427224 Simplify Fn_this
cthr->Obj is now 0 or == cthr->Def.
2012-04-28 22:02:35 +02:00
Günther Brammer 5e60806439 Move GetNeededMatStr to the other object functions 2012-04-28 22:01:47 +02:00
Günther Brammer fb4bac65be Remove C4AulContext::Caller 2012-04-28 21:32:29 +02:00
Günther Brammer 815d5a895a Replace remaining functions in ObjectScript table with template AddFunc 2012-04-28 22:04:43 +02:00
Günther Brammer 8a4181a3be Replace C4AulObjectContext* with a simple C4Object* parameter 2012-04-28 22:04:36 +02:00
Armin Burgmeier e8a7dc0478 Fix a crash when rendering an untexturized mesh 2012-05-05 23:04:35 +02:00
Maikel de Vries 6fcc0f6d2e Removed TimerCall in favour of AddTimer script implementation 2012-05-05 12:09:44 +02:00
Nicolas Hake 1711b72baf Return U+FFFD REPLACEMENT CHARACTER instead of question mark for invalid utf8
Since U+003F QUESTION MARK is a potentially valid character in a unicode string,
have the text iterator return U+FFFD if it can't decode its input instead. This
way the caller can be certain that the input isn't a proper question mark and
doesn't accidentally use it, e.g. as a wildcard.
2012-05-04 18:12:35 +02:00
Armin Burgmeier 04af38622d Use 64 bit integers to multiply fixpoint numbers
gcc 4.6 generates better code for FIXED_EMULATE_64BIT disablen for both
32 and 64 bit. It properly recognizes that the 32,32->64 multiplication
instruction of the x86 is the right choice for the job whereas the more
complicated FIXED_EMULATE_64BIT version requires multiple multiplications

Thanks Günther for checking this! :)
2012-05-01 23:05:40 +02:00
Armin Burgmeier 5d96ca83c9 Fix overflow in C4Fixed multiplication
This would happen when the product of the lower significant part, which is
between 0 and 65535 (even though C4Fixed is a signed data type!) exceeds
2^31, for example for val=36864, fVal2=61440.
2012-05-01 22:59:55 +02:00
Martin Plicht daabc5be16 mac: Fix compilation 2012-05-01 15:05:43 +02:00
Günther Brammer 133e987902 Script: Throw instead of silently using nil for this after RemoveObject 2012-04-29 16:53:29 +02:00
Maikel de Vries 7857da2c50 Check object rather than def for fire related properties 2012-04-29 10:21:16 +02:00
Günther Brammer 2e9ae057ad Remove obsolete assertion from FnTranslate (#746)
The rules for ctx->Obj and ctx->Def changed recently. The latter is now the
real this pointer, and Obj is Def->GetObject(). There's no need to check
this in FnTranslate.
2012-04-28 20:25:04 +02:00
Günther Brammer 1995b59adc win32: C4Window::SetSize calls AdjustWindowRectEx, GUI::Dialog doesn't need to 2012-04-28 15:09:35 +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 e11e9845d1 Fix Windows build 2012-04-23 21:45:01 +02:00
Martin Plicht cd4db8ebaf mac: Remove KeyMask assignment and inline HandleNSEvent 2012-04-23 20:14:42 +02:00
Armin Burgmeier 206f90adbc Pass through key state handling from event callbacks (#745)
This gets rid of Application.IsAltDown() and friends which was used for
this purpose in C4MouseControl and C4EditCursor. In case non-event
callbacks need to access the state of the modifier keys the state is
now cached in these classes (if it wasn't already).

This new solution is supposed to be more robust, since the key modifier
state comes always directly from the input event. This fixes #745, where
Application.IsAltDown was stuck for some reason.

I updated the Windows and Mac code as well, but wasn't able to test it,
it might not compile and/or not work, in which case please someone fix it :)
2012-04-22 22:09:06 +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
Günther Brammer 075bc3b866 gtk: fix build with glib older than 2.30 2012-04-20 21:09:17 +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
Günther Brammer 7632c823fe gtk: Drop compatibility with GTK versions older than 2.18 2012-04-18 00:37:31 +02:00
Günther Brammer f0c545d773 gtk: Fix build with GTK versions older than 3.4 2012-04-18 00:31:48 +02:00
Günther Brammer 3596daad22 gtk: Make mousewheel scroll again 2012-04-17 22:45:11 +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 d93384beb6 Add forgotten C4Value::operator== case for C4V_Function 2012-04-15 16:33:39 +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
Nicolas Hake 7efd9a9b9a Aul: Add new nil-coalescing operator ??
This short-circuiting operator will evaluate to its first operand if the operand
is not nil, or to its second operand otherwise. Its intended use is to simplify
defaulting expressions that may evaluate to nil to a valid value.
2012-04-15 15:44:01 +02:00
Nicolas Hake 368692b7d8 GTK: Build fix 2012-04-15 13:32:13 +02:00
Nicolas Hake cbbcf200cf win32: Build fix 2012-04-15 13:22:58 +02:00
Tobias Zwick 46156e3f1c show tooltip for C4D_MouseSelect using the property "Tooltip"
+ remove references to the old and obsolete "help mode"
2012-04-15 12:09:54 +02:00
Günther Brammer 456bf32a93 Merge branch 'gtk' 2012-04-15 01:35:00 +02:00
Günther Brammer e125003aa9 gtk: Deactivate the resize grip on the OpenGL-drawn windows 2012-04-15 01:17:50 +02:00
Julius Michaelis 57a07a95ab Add forgotten string for function type values to GetC4VName 2012-04-14 16:53:35 +02:00
Günther Brammer f89f19b2cb Script: No #appendto in Defs or global functions in #appendtos (#734)
So the only thing #appendtos may contain are lokal functions and variables,
which are only reachable via the Definition the script is appended to, and
global constants and variables, which only need to be parsed once. Thus,
#appendto scripts can skip being parsed without a definition, and the
errors that sometimes produces are gone.
2012-04-13 21:43:43 +02:00
Günther Brammer ac02380b58 Script: this->RemoveObject() changes this to nil (#722) 2012-04-13 20:28:30 +02:00
Günther Brammer fe261ffca0 Script: GetType returns C4V_C4Object for objects again 2012-04-13 18:38:30 +02:00
Günther Brammer f245af8972 Rename C4AulParseState to C4AulParse 2012-04-12 21:03:14 +02:00
Günther Brammer 05ef63bf64 Script: Make 0==nil false again
This was probably broken by the C4V_Any/C4V_Nil separation. Also clean
the function up a bit and add an assert that should catch similar stuff in
the future.
2012-04-11 02:25:24 +02:00
Felix Wagner 6aa5050fb0 Disabled /sound (#719) 2012-04-10 14:53:24 +01:00
Julius Michaelis 335a6e0598 Fix C4ValueArray 2012-04-09 22:04:03 +02:00
Armin Burgmeier 6238c1d5be Fix mesh rendering crash when previous GL operation enabled color array (#739) 2012-04-09 22:03:55 +02:00
Julius Michaelis 939f4c69ca Fix array slice setting 2012-04-08 12:44:17 +02:00
Julius Michaelis dcf59a4d61 Disallow cyclic prototyping 2012-04-08 12:43:19 +02:00
Armin Burgmeier 7efd7f9df5 Replaced glInterleavedArrays by gl*Pointer 2012-04-07 16:47:23 +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
Martin Plicht 20343b4628 mac: Fix mouse movement. Again 2012-04-04 08:44:37 +02: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
Benjamin Herr cf0069a3e2 C4MouseControl: don't reset "Drag" before UpdateCursorTarget() 2012-04-01 19:48:11 +02:00
Martin Plicht 26fec4ca89 mac: Lion: More fullscreen/mouse movement fixes, hopefully the mouse now actually works in-game and moving mouse into screen corners does not trigger mission control or whatever else is set as hot corner actions. Remaining problem is that when activating mission control with the clonk window active, the user cannot move the mouse cursor since it's still stunned by CGAssociateMouseAndMouseCursorPosition(FALSE) 2012-03-29 00:43:03 +02:00
Martin Plicht 397557f1e1 mac: Gamma: Don't maintain conversion table (what was I thinking?) 2012-03-29 13:30:36 +02:00
Martin Plicht c02f334d15 mac: Switch to game window when application activated 2012-03-28 22:38:33 +02:00
Martin Plicht 50e6e497b1 mac: Lion: Fix mouse movement when scrolling (grunt) 2012-03-28 15:03:25 +02:00
Martin Plicht e25351ed04 mac: Lion: More mouse shenanigans to suppress hot corner actions when in fullscreen mode 2012-03-28 14:50:50 +02:00
Martin Plicht f1c7ceeb75 mac: Lion: Restore not redrawing the window when in fullscreen mode and inactive 2012-03-24 19:43:50 +01:00
Felix Wagner 2416fa98fb + FnCheckConstructionSite 2012-03-27 19:09:55 +01:00
Martin Plicht ef289a0c60 mac: le typo 2012-03-25 12:52:48 +02:00
Martin Plicht 01530ea3b1 mac: Add key codes for "Backslash", "Comma_US" and "Less" 2012-03-23 18:11:46 +01:00
Martin Plicht db6009d8b1 mac: Fix exclusive dialogs not clickable in game mode 2012-03-25 12:08:06 +02:00
Günther Brammer 40de33ca3c win32: Make sdl-mainloop option work
As it doesn't have the editor, this is only useful for compiling
more of our code on more platforms.
2012-03-23 22:53:56 +01:00
Günther Brammer 25bbaef7d2 sdl-mainloop: Draw things again 2012-03-25 01:54:07 +01:00
Günther Brammer 378029168b Re-enable keyboard configuration dialog (#624) 2012-03-21 21:17:39 +01:00
Martin Plicht 160e214196 mac: Silly pinch gesture in mainmenu to toggle fullscreen mode Lion-compatible 2012-03-23 00:21:03 +01:00
Martin Plicht aaa5a71e4b mac: Support Lion FullScreen 2012-03-23 00:03:05 +01:00
Martin Plicht 30840696c6 C4AulScriptEngine::Clear: Don't create GlobalPropList just to Clear() it 2012-03-22 21:49:55 +01:00
Martin Plicht 62f7540b2d mac: Turns out, shift+mouse actions were never properly processed. Whoops 2012-03-22 21:08:19 +01:00
Martin Plicht 9177c3e515 mac: Fix some Xcode warnings 2012-03-22 01:19:10 +01:00
Bernhard Bonigl 03729bdbf1 Experimental: Added Interaction-Hotkeys on <> to . (the row below the home row).
Made the Keys <> on German Keyboards an \| and ;: on US Keyboards usable
2012-03-21 21:52:32 +01:00
Martin Plicht db73b6ab67 mac: ConsoleWindow.xib: Remove Script Counter display (again) 2012-03-21 11:46:19 +01:00
Bernhard Bonigl 7ab6dde1b3 Fixed Apostrophe beeing mapped to VK_OEM_5 (\| on US) to VK_OEM_7 ('" on US) 2012-03-20 15:14:47 +01:00
Martin Plicht 6d21e74dab elsif shmelsif 2012-03-20 18:32:21 +01:00
Martin Plicht da7b38c263 C4EditCursor.h: Definition of ObjselItemDt contains platform specific thingies again 2012-03-20 17:30:41 +01:00
Martin Plicht a8cadb8723 Amazing fixes to make it compile for Mac again 2012-03-20 16:38:45 +01:00
Günther Brammer ca7c284c85 gtk: Rename C4AppX to C4AppGTK 2012-03-05 00:38:23 +01:00
Günther Brammer 15ebf70ab1 win32: Move C4GUI::DialogWindow platform code to C4WindowWin32.cpp 2012-04-01 22:16:59 +02:00
Günther Brammer 52e0b52ba9 gtk: Remove some obsolete X11 code 2012-04-10 23:39:16 +02:00
Günther Brammer 31b4c1f2fa gtk: Use gtk X11 display connection for glX 2012-04-10 23:39:49 +02:00
Günther Brammer 05cc1490ea gtk: Reimplement C4Window's GetSize, SetSize, SetTitle 2012-04-04 21:05:48 +02:00
Günther Brammer 0a6c9df7f3 gtk: Move the FindInfo functions to C4WindowGtk.cpp 2012-04-01 22:30:55 +02:00
Günther Brammer c102fe19d8 gtk: Use gtk functions to make a window fullscreen 2012-04-10 03:36:09 +02:00
Günther Brammer c865021716 gtk: Fold C4GtkWindow into C4Window 2012-04-11 04:15:33 +02:00
Günther Brammer dc41afded5 gtk: Replace some X11 input event handling
This regresses because IMs aren't used anymore. GTK+ has its own
IM implementations we should use instead, but for now event->string
is simpler.
2012-04-09 01:10:21 +02:00
Günther Brammer 5f93869978 gtk: Replace C4FullScreen.cpp X11 code with gtk in C4WindowGTK.cpp 2012-04-10 01:56:20 +02:00
Günther Brammer feb13288fa gtk: Replace C4GUI::DialogWindow XLib with gtk calls 2012-04-04 03:42:33 +02:00
Günther Brammer 86a99ce458 C4Window: Introduce a separate WindowKind for the console window 2012-03-28 19:37:13 +02:00
Günther Brammer 85a75577e3 gtk: Move some C4ViewportWindow gtk code to C4WindowGTK.cpp 2012-04-09 01:15:30 +02:00
Günther Brammer c5f3cf88ae gtk: Use gtk clipboard functions instead of our own code 2012-03-26 00:43:09 +02:00
Günther Brammer a7330097f6 win32: Move parts of WM_ACTIVATE handling from CStdGL to C4Window 2012-04-07 21:33:39 +02:00
Armin Burgmeier 644f97efd3 GObectify MapeTextureMap; add functions to get texture mapping entry 2012-02-18 21:10:07 +01:00
Martin Plicht 379836f32c cmake: mac: Don't require rt library 2012-02-14 16:25:23 +01:00
Armin Burgmeier 81e04899dc Merge default into mape 2012-02-12 19:41:48 +01:00
Nicolas Hake 08d71bcd74 Drop PIF_HasRes flag from player info read from replays
C4PlayerInfo stores the PIF_HasRes flag for savegames and network synch. The
resource system isn't used in replays however, so the flag is wrong there. Clear
it when loading a replay, so a later assertion in the cleanup code doesn't fail.
2012-02-12 14:01:12 +01:00
Armin Burgmeier f349a97919 Correctly honor game speed if delay is below MaxRefreshDelay (#260) 2012-02-12 13:49:02 +01: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
Günther Brammer 286a32f47d Remove C4GroupEntryCore::(Has)CRC, calculate the CRC on demand
The CRC was basically only used to decide which files to include in update
groups, but calculated for every group and then stored in the file on disc.
And for some unknown reason, updates themself didn't produce the right
numbers in the file.

This means that c4groups with this change cannot reproduce groups written
by older c4groups and vice versa, but this isn't necessary for updates, and
reading is compatible both ways.

Except for the ways that C4Update fails to remove the CRCs.
2012-02-08 00:12:44 +01:00
Armin Burgmeier 2092baaa18 Fix possible double close when attempting to open uncompressed files 2012-02-05 20:00:47 +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
Armin Burgmeier f50ebf6441 Update C4Group packing order
This speeds up loading of packed files significantly. It's not optimal,
though, because the order in which textures are loaded by the engine
is not known by c4group (it depends on their occurence in the Scene.material
file). This could be fixed by specifying custom packing orders for every
object we have. But then again maybe switching to a different format which
allows for random access might be more worth it.
2012-02-04 22:08:38 +01:00
Armin Burgmeier 8e5b9262df Fix a possible file leak in CStdFile::Open
This happened if open() worked but c4_gzdopen failed. This bug prevented
Objects.ocd being packed because of "Too many files open."
2012-02-04 21:28:17 +01:00
Armin Burgmeier 139184c540 Set system data path to exepath for binaries with automatic updates
Updates work only when the game data is at the same location as the binary.
If this is not the case then the game was probably installed differently,
for example via the distribution or with make install. In this case we
cannot do automatic updates but we also want to use a different system path.

This fixes the linux development snapshots and release tarballs. They were
broken in the sense that they didn't find their game data.
2012-02-03 23:43:18 +01:00
Nicolas Hake f3ae992f33 Fix dangling pointer on temporary pack of player file on join (#706)
I hate StdStrBuf. It's just close enough to any sane string class that you think
it does reasonable things, then when you don't look it will turn around and stab
you in the back with a rusty fork.
2012-02-03 14:36:17 +01:00
Günther Brammer fea377f196 win32: Fill in Games Explorer XML data from Version.txt 2011-10-31 01:31:56 +01:00
Günther Brammer d995490137 win32: register with the Game Explorer 2011-10-30 16:16:14 +01:00
Sven Eberhardt 95582747db Fix random team distribution when a player leaves during lobby time
Also allow random/random surprise teams in AutoGenerateTeam mode
(always creates two teams)
2011-11-08 17:27:32 +00:00
Sven Eberhardt 05e7aa1568 Fix EliminatePlayer(..., true) inactive client activation 2011-11-08 16:16:31 +00:00
Martin Plicht 12af060162 ClonkAppDelegate: Config.Load without parameters 2011-10-16 16:25:38 +02:00
Martin Plicht e147248036 C4Reloc: missing method implementation signature change 2011-10-16 16:25:23 +02:00
Martin Plicht 5b67e90830 mac: Game window: Zoom to actual backing store size 2011-10-16 16:14:35 +02:00
Martin Plicht d86b7d36b0 Mac: Handle various quit messages gracefully
*Not quitting immediately when in a game but just showing the Exit dialog
*React to Dock Quit menu item and Tab-Switcher Cmd+Q
2011-10-16 16:12:37 +02:00
Martin Plicht e7878038c8 mac: Use standard localization facility for addon installation dialogs + put addons into preferred installation location (Library/Application Support) 2011-10-16 16:09:05 +02:00
Martin Plicht a62486044e C4Reloc: Each path is associated with a path type, specifying whether a path is a preferred installation location 2011-10-16 16:07:13 +02:00
Peter Wortmann fec07accd7 Save more minimal players on remote clients 2011-08-15 09:25:37 +00:00
Peter Wortmann 8b9ace23c9 Fixed the surrender dialog showing after declined kick vote 2011-05-08 22:36:48 +02:00
Armin Burgmeier 0749dcdb9d Replace std::sort by timsort for Face ordering
The usage of timsort instead of std::sort at this point is twofold.  First,
it's faster in our case where the array is already sorted in many cases
(remember this is called at least once a frame). And it's not just a bit
faster either but a lot. I have measured a factor of 7 on my system.

Second, in our Windows autobuilds there is a crash within std::sort which is
very hard to debug because it's hardly reproducible with anything other than
the autobuilds (I tried hard). If the crash goes away with timsort then
great, if not then maybe it's easier to debug since the code is in our tree.
2012-02-01 22:11:46 +01:00
Armin Burgmeier 18c96d4987 C4MouseControl: Don't set TargetObject to non-selectable objects in crosshair mode
This makes mouse click controls not being delivered to MD_NoClick objects.
2012-01-31 23:46:15 +01: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
Armin Burgmeier dc2ee736d1 Build fix 2012-01-29 14:38:18 +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
Felix Wagner af699844de Removed some old mouse control related stuff 2012-01-29 02:13:55 +00:00
Armin Burgmeier b032b6c3e3 Use std::sort again instead of a custom implemantion for debugging purposes
This was committed accidentally. I blame hg for having a crappy ui.
Fixes the display of trees again.
2012-01-28 21:48:07 +01:00
Armin Burgmeier 86bc3ac417 Don't print an error message for ERROR_PATH_NOT_FOUND in DirectoryIterator::Read
We do the same already for ERROR_FILE_NOT_FOUND. This fixes a harmless warning
when running the engine in a release directory where there is no planet/
directory.
2012-01-28 18:15:51 +01:00
Armin Burgmeier a1370c2954 Rename our custom gz* functions to avoid conflicts with zlib.dll
This fixes the build with native mingw for me.
2012-01-28 17:02:37 +01: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
Armin Burgmeier b2e26700cf Win32: Allow forward slash as separator when loading local definitions
This leads to an obscure error otherwise where local definitions are skipped
from loading when running the scenario as clonk.exe Tutorial.ocf/Tutorial01.ocs.
The scenario loads fine as such but some definitions are missing and therefore
it doesn't work properly. See also http://forum.openclonk.org/topic_show.pl?tid=905.
2012-01-27 23:21:03 +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
Felix Wagner 9c82958fa1 Little tweaks for the player options dialogue 2012-01-25 04:53:59 +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 23d54ea2c9 Implement UPnP for Linux using libupnp 2012-01-21 02:04:14 +01:00
Nicolas Hake 3738069ecd MinGW: Define UPnPNAT CLSID/IID values 2012-01-15 23:22:01 +01:00
Nicolas Hake 33b8fa83d3 Correct file path capitalization 2012-01-15 22:45:04 +01:00
Nicolas Hake cca86151fd Move #include to .h to avoid defining a function with an incomplete type parameter 2012-01-15 22:36:27 +01:00
Nicolas Hake 067456d213 Remove superfluous includes 2012-01-15 22:35:22 +01:00
Nicolas Hake 683800c33c win32: Add UPnP port mapping support 2012-01-15 21:27:16 +01: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
Armin Burgmeier 5195cbe6d4 Fix build against recent zlib 2012-01-09 21:28:07 +01:00
Maikel de Vries d6f936850e Removed all senseless font sizes
These font sizes don't work well ingame and are too ugly to show to the player, all remaining font sizes work well enough with resolutions ranging from 800x600 to 1920x1080.
2012-01-08 20:03:09 +01:00
Nicolas Hake faf62abf9c Aul: Make sure CreateConstruction id parameter is valid (#702) 2012-01-03 21:57:55 +01:00
Armin Burgmeier 98f4b6f1c6 Print a warning instead of a failed assertion if C4Network2IO broadcast fails 2011-12-29 21:51:52 +01:00
Armin Burgmeier c17e272b38 Allow PID_ConnRe packets from not-yet-accepted connections
This fixes joining games in local networks where the PID_ConnRe
packet can arrive earlier than the main thread manages to flag
the connection as accepted.
2011-12-29 19:39:25 +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 7e532c2bd6 Split math functions into StdMeshMath.{h,cpp} 2011-12-29 15:41:52 +01:00
Armin Burgmeier 1f8cd31fa2 Fix a crash when enabling a non-mesh definition picture for drag+drop 2011-12-29 17:32:40 +01:00
Sven Eberhardt c2ccf20509 Some new debugrecs 2011-12-29 00:12:21 +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