Commit Graph

8600 Commits (epoxy)
 

Author SHA1 Message Date
Nicolas Hake 506d116c42 WGL: Wrap the temporary context for OpenGL extension detection in a class
Unlike GLX, the OpenGL function pointers are context-dependant. Because we
need an extension function to create the context we're going to use, we
first need to create a temporary context. Since this is independent of the
library used to fetch the function pointers, decouple it from glewInit().
2016-01-29 18:37:32 +01:00
Günther Brammer 5e5d8dd49a GLX: Avoid exiting if glXCreateContextAttribsARB fails
It's not clear that the glXCreateNewContext fallback does anyone any good
because it can't create the Core Profile Context we need, but better a
fallback message followed by Shader compilation errors than an obscure
X11 protocoll error. Probably.
2016-01-29 17:12:44 +01:00
Günther Brammer fd534c430e GL: Move notification about debug context to common code 2016-01-29 16:55:36 +01:00
Günther Brammer 83cf09db1a GL: Replace CStdGLCtx::Reinitialize with parameter to Clear() 2016-01-29 16:52:36 +01:00
Maikel de Vries 707e0ec041 fix kill tracing for exploding compensator 2016-01-29 13:25:46 +01:00
Maikel de Vries 5927e55973 fix script error in power library when a foundry (not really a consumer) is removed 2016-01-29 11:40:08 +01:00
Maikel de Vries 4e73a84d18 make aerobatics intro failsafe
Also start the airship later to allow for a well timed dynamite jump to land on the airship and gain some advantage.
2016-01-29 09:56:17 +01:00
Sven Eberhardt 1b6d3ca770 Raid: Map tweaks to account for ShapeMap changes 2016-01-28 23:52:02 -05:00
Sven Eberhardt 1bb78ecd4f Remove some unnecessery animation weights.
These overwrite the animations in their slots while there are no other references to existing animations in the slot.
2016-01-28 23:47:53 -05:00
Sven Eberhardt 920ae9673f Fix animation leaks in bat, chest, grapple bow and tele glove #1647 2016-01-28 23:46:22 -05:00
Sven Eberhardt 1f81b87c33 PlayAnimation: Delete previous animations in same slot if no weight is given.
This will simplify fixing several animation leaks.
2016-01-28 22:02:27 -05:00
Sven Eberhardt 80b8879805 Fix SolidMask DensityProvider to return C4M_Vehicle, not C4M_Solid.
Fixes attached movement of objects with increased contact density.
2016-01-28 22:00:41 -05:00
Maikel de Vries 5a79eef10a remove airship hitbox in favor of projectile target implementation 2016-01-28 21:53:49 +01:00
Nicolas Hake f12afbc43c Fix some frankly ridiculous indentation
I know you like to think of yourself as something of an artiste, but
this isn't likely to get into MoMA's permanent collection.
2016-01-28 17:26:09 +01:00
Sven Eberhardt 380b6df2ac Make GetModifiedDigSpeed runtime-overloadable 2016-01-28 00:37:25 -05:00
Mark 41f00c6c17 Dig speed refactoring
Extracted the dig speed modification part to a separate function, so that other scenarios can easily overload this. Setting the value to 75% of the input speed provided a good handling in my tests. This is not included in this commit, feel free to experiment with it first.
2016-01-28 06:28:04 +01:00
Clonkonaut 29bfdf73ea Elevator construction preview shows placement of the case (#1534).
Structures can use the definition call ConstructionPreview(Previewer Object, Overlay, Direction) to add any overlay to the previewer. It will be coloured accordingly.
2016-01-28 00:31:22 +01:00
Maikel de Vries 9220c285c6 gui clock: add optional in screen countdown
And use it in Aerobatics.
2016-01-27 20:19:19 +01:00
Mark 931705d339 Change cloud color
Clouds can change their basic color with SetCloudRGB(r, g, b) now, for more ambient effects. This does not mess with the cloud shading, because the color is scaled appropriately.
2016-01-27 05:47:57 +01:00
Sven Eberhardt 88810fbb83 Butterfly: Fix animation leak #1647 2016-01-26 23:14:17 -05:00
Maikel de Vries ef1d7227f6 release rider from balloon earlier when deflating
This allows for a smoother transition into walking and scaling and leads to less annoying and unexpected deaths.
2016-01-26 23:02:32 +01:00
Maikel de Vries 2cc59cb336 change catapult aiming: power is such that trajectory goed through the cursor (if possible) 2016-01-26 22:38:25 +01:00
Maikel de Vries 7e1fe57440 catapult: remove trajectory preview when use is cancelled 2016-01-25 23:22:14 +01:00
Maikel de Vries 0e32757aa9 parkour: allow resetting pb with /resetpb 2016-01-25 22:44:05 +01:00
Maikel de Vries 08dfaeed9e parkour: clear checkpoint for team members by default 2016-01-25 22:44:05 +01:00
David Dormagen 2dc291f8f6 contents menu: fixed possible "use after deletion" error 2016-01-25 20:21:28 +01:00
David Dormagen 9e563e6d8c cannon: fix possible nil pointer access
In boomshire, the cannons are automatically filled with boompacks (and then fired). That means that there is no Clonk to be passed.
2016-01-25 20:13:51 +01:00
Sven Eberhardt 36489145b6 Fix automatic engine detection of melee-like scenarios to allow team selection. 2016-01-24 22:13:21 -05:00
Sven Eberhardt be12ca92c6 FightForGidl: Fix description. 2016-01-24 21:58:14 -05:00
Günther Brammer 79043c8424 Reset the size of a C4Set in Clear()
This bug manifested itself in mysteriously growing PropLists with nil keys.

Some usages of Clear were simply to clean the newly-allocated table, and
need to continue to do so.
2016-01-25 00:54:58 +01:00
Günther Brammer 08f1037866 Add some more C4Script tests 2016-01-25 00:43:24 +01:00
Sven Eberhardt 4257b84f84 Fix HUD script errors when cursor does not include inventory control 2016-01-24 18:16:46 -05:00
Günther Brammer 88185a60f9 Script: Sort the result of GetProperties lexically
Also, deal with non-string values in the C4ValueArray properly.
2016-01-25 00:00:59 +01:00
Günther Brammer 5708ba2e72 Remove superfluous wrapper function C4AulStartTrace 2016-01-25 00:00:58 +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 5be63d1e96 Use macros to reduce duplication in script engine definitions
While at it, make AddFunc take a C4PropList* instead of a C4AulScript*.
2016-01-25 00:00:58 +01:00
Günther Brammer 5287121d86 Use void instead of C4Void for engine functions that always return nil
This allows the removal of quite a few return C4Void();.

Also stop pretending that Nillable<void> is the same class as Nillable<T>.
Its only function was as an implementation detail for C4Void, which doesn't
need any implementation details anymore.
2016-01-25 00:00:58 +01:00
Günther Brammer f78d7712a5 Replace C4AulDefFuncHelper with template functions
This avoids duplication of code in C4AulObjectFunc and C4AulEngineFunc
at the cost of boilerplate code working around the lack of partial
function template spezializations.

Instead of ThisImpl and ExecImpl, we could have multiple C4AulEngineFunc
spezializations deriving from a common template, but that would require
even longer and duplicated boilerplate.
2016-01-25 00:00:58 +01:00
Günther Brammer 22113fd6fc Convert C4AulDefFunc* templates to variadic templates 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 0a8960f969 Reimplement C4AulParSet constructor as a variadic template
This allows the constructor to accept all types there is a C4Value
constructor for.
2016-01-25 00:00:57 +01:00
Günther Brammer ce2b8f45b8 Make FnSetPlrKnowledge(C4Player*) a C4Player member function
The overload with FnSetPlrKnowledge(C4PropList*) will get problematic.
2016-01-25 00:00:57 +01:00
Günther Brammer 6b514893f9 Replace C4ValueConv::ToC4V with C4Value constructors
Also don't rely on int32_t != long and drop now unnecessary MSVC workaround.
2016-01-25 00:00:57 +01:00
Günther Brammer b08f51372a Add more overloads of the C4Value constructor
This allows one to use the C4Value constructor instead of
C4ValueConv. To avoid unintended implicit conversions like
const char * to bool, add a private template constructor that
catches everything not in the list of intended constructors.
2016-01-25 00:00:57 +01:00
Maikel de Vries 1cce689a67 boomrace: fix picking up boompacks (now instantly) 2016-01-24 23:28:05 +01:00
Sven Eberhardt 451ea87ab9 Fix another FoW crash 2016-01-24 17:23:20 -05:00
Sven Eberhardt 42d8885877 Fix crash in FoW rendering #1643 2016-01-24 14:44:00 -05:00
Maikel de Vries 488201181b improve collision detection of deployed balloon with the landscape 2016-01-24 20:36:17 +01:00
Maikel de Vries d1d019ab09 improve the hitbox of the balloon for projectile targets
This prevents the one hanging on the balloon from shooting himself down with e.g. a bow.
2016-01-24 20:36:17 +01:00
Mark 93ba7c5954 Vendor Library
Extracted the buy menu of the flagpole to a library, so that other objects can implement a buy menu without having to duplicate the code. An overview of the changes follows:

Library_Base:
- Moved auto-sell functionality to Library_Vendor
- Moved buy and sell functionality to Library_Vendor
- Removed the old engine menu for buying and selling

Library_Vendor:
- Added proplist for accessing local variables, avoiding variable clashes
- Added interfaces GetBuyValue, GetBuyableItems, GetBuyableAmount, ChangeBuyableAmount, GetSellValue
- Changed DoBuy: it uses the interface functions, instead of hardcoded base material
- Changed / merged the existing sell functionality and the flagpole sell functionality in DoSell:
   * does not sell items if QueryOnSell returns true
   * sell sound only audible to seller
   * the sold object tries selling its contents first (for example a bow, if it ever were sellable. This may not hold in the settlement games, but adventures would allow it)
   * the sold object ejects any contents before it is removed. These are usually unsellable objects. Previously they would just be removed together with the object. It has to be tested whether this places the items on the ground or at the center of the sold object
   * removed the "sell all" functionality on right-click for the moment.
- Still has some functions from the old base selling: CanStack and GetSellableContents, for the auto-sell functionality
- Fixed a logical error in AllowBuyMenuEntries
- Distinguish between buyer/seller and payer more, so that the logic can easily be changed in one line later
- Allow for runtime overloads of interface functions
- Changed inconsistent variable naming to a more consistent one
- Added namespaces to all sounds, the "UnCash" sound still does not exist
- Added localization strings for insufficient wealth
- Fixed property name error (missing 'e')
- Buy menu is active by default

Flagpole:
- Replaced the custom sell functionality (how many of these do we have actually??) with the sell functionality from Library_Vendor
- Buying menu is allowed if the rule is active

System.ocg/Object.c
- global functions Buy and Sell ask the target if it is a vendor, instead of whether it is a base, and do the callback there.
- renamed the argument so that it is no longer called "base", but "vendor"
2016-01-24 20:11:27 +01:00