Obscurity
2015-01-30 16:11:02
As the title says. I've not yet needed to do this, but say I have:
Obviously for this example, I'd have to forward obsGetAdrenaline():
Now, what if I had overloaded functions? I would think:
However, I get an error with the second forward:
So I figured I had to change the second forward to:
But this only results in an error with the actual obsGetAdrenaline(adrenalineTexture:glTextureArray):
Ideas? :P.
//~ Etc...
function obsCanThreshold():boolean;
begin
result:=obsGetAdrenaline()>=50;
end;
//~ Etc...
function obsGetAdrenaline():single;
var
adrenalineTexture:glTextureArray;
begin
if (adrenalineTexture:=glGetTextures(79179).extractColourID(14724672,4)).isEmpty() then
exit;
result:=floor(adrenalineTexture[0].width()/103*100);
end;
//~ EtcObviously for this example, I'd have to forward obsGetAdrenaline():
//~ Etc...
function obsGetAdrenaline():single;forward;
function obsCanThreshold():boolean;
begin
result:=obsGetAdrenaline()>=50;
end;
//~ Etc...
function obsGetAdrenaline():single;
var
adrenalineTexture:glTextureArray;
begin
if (adrenalineTexture:=glGetTextures(79179).extractColourID(14724672,4)).isEmpty() then
exit;
result:=floor(adrenalineTexture[0].width()/103*100);
end;
//~ EtcNow, what if I had overloaded functions? I would think:
//~ Etc...
function obsGetAdrenaline():single;forward;
function obsCanThreshold():boolean;
begin
result:=obsGetAdrenaline()>=50;
end;
function obsGetAdrenaline(adrenalineTexture:glTextureArray):single;forward;
function obsCanThreshold(adrenalineTexture:glTextureArray):boolean;overload;
begin
result:=obsGetAdrenaline(adrenalineTexture)>=50;
end;
//~ Etc...
function obsGetAdrenaline():single;
var
adrenalineTexture:glTextureArray;
begin
if (adrenalineTexture:=glGetTextures(79179).extractColourID(14724672,4)).isEmpty() then
exit;
result:=floor(adrenalineTexture[0].width()/103*100);
end;
function obsGetAdrenaline(adrenalineTexture:glTextureArray):single;overload;
begin
if (adrenalineTexture:=adrenalineTexture.extractID(79179).extractColourID(14724672,4)).isEmpty() then
exit;
result:=floor(adrenalineTexture[0].width()/103*100);
end;
//~ Etc...However, I get an error with the second forward:
Error: Forwarded declaration doesn't match at line 2395
Compiling failed.So I figured I had to change the second forward to:
function obsGetAdrenaline(adrenalineTexture:glTextureArray):single;overload;forward;But this only results in an error with the actual obsGetAdrenaline(adrenalineTexture:glTextureArray):
Error: Cannot overload function at line 3616
Compiling failed.Ideas? :P.