From ff5f5c50bd2ce931a62b2eb1b0aed97c0fa370c5 Mon Sep 17 00:00:00 2001 From: Markus Mittendrein Date: Sun, 18 Mar 2018 00:40:38 +0100 Subject: Update to newest version DTCallback: Add fast callbacks (only Object/DefinitionCallback() is possible) and restructure CallA() for hopefully better performance DTCallback: Fix all custom calls to allow overriding in Definition- and Object-context DTFilterObjects: new addition DTMenuCompatibility: add Menu_Entry compatibility version due to the new Menu_Entry-API DTObjectSerializing: small progress, still WIP DTPlayers: Fix constant enum definitions (thanks to the preprocessor's precalculator) DTQuickSort: Add custom callback args DTScopedVars: Fix all custom calls to allow overriding in Definition- and Object-context DTScopedVars: CustomScopedVar-implementations must now return another less custom ScopedVar instead of a reference (due to _inherited()) DTTransform: disable MirrorZ DTTransform: fix Matrix3x3Multiply and thus PreTransform DTTransform: fix whitespace DTTransform: update comments DTUTility: Fix indentation and whitespace DTUtility: Add GetShape, InRect and GetPlayerByID DTCallback, DTObjectSerializing: Rely on the preprocessor's precalculator --- DTScopedVars.c | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) (limited to 'DTScopedVars.c') diff --git a/DTScopedVars.c b/DTScopedVars.c index f64ccdc..0cde670 100644 --- a/DTScopedVars.c +++ b/DTScopedVars.c @@ -1,5 +1,4 @@ #strict 2 - // TODO: ScopedVars with temporary target (like a reference to a function local var) static const ScopedVar_Global = 1; @@ -49,11 +48,22 @@ global func &ScopedVar(array variable) } else { - return ScopedVar(CustomScopedVar(variable)); + if(this) + { + return ScopedVar(this->~CustomScopedVar(variable)); + } + else if(GetID()) + { + return ScopedVar(GetID()->~CustomScopedVar(variable)); + } + else + { + return ScopedVar(CustomScopedVar(variable)); + } } } -global func &CustomScopedVar() { return _inherited(...); } // this allows "overloading" this function even if the "overloading" function is loaded before +global func CustomScopedVar() { return _inherited(...); } // this allows "overloading" this function even if the "overloading" function is loaded before global func CheckScopedVar(array variable) { @@ -81,7 +91,18 @@ global func CheckScopedVar(array variable) } } - return CheckCustomScopedVar(variable); + if(this) + { + return this->~CheckCustomScopedVar(variable); + } + else if(GetID()) + { + return GetID()->~CheckCustomScopedVar(variable); + } + else + { + return CheckCustomScopedVar(variable); + } } -global func CheckCustomScopedVar() { return _inherited(...); } +global func CheckCustomScopedVar() { return _inherited(...); } \ No newline at end of file -- cgit v1.2.3-54-g00ecf