Skip to content
Low-level programming · Higher-level thinking
Login Register
Forum / Bugs and Fixes

negative float parameter

A community discussion post from the original code:zIRON forum.

Replies

Colin admin
Posts
928
Threads
49
Location
Bulgaria

See post above, this is something like how it is done, it works currently like this. But still that is not the best way to do it.

else you can automate the var

inline procedure asD($x) {
	double d = $x;
	$return $d;
}

myProc(asD(1.5), asD(5.2));

which maybe next update i will add direct casting

myProc((double)1.5, (double)5.2);

i will see :)

EDIT: actually i'm working on a solution right now, check back in 10-15 mins :)

Colin admin
Posts
928
Threads
49
Location
Bulgaria

OK it is complete, re-download from the beta link

debugMB_Single(0, 2.6);
debugMB_Double(0, 2.6);
debugMB_Extended(0, 2.6);

the assembler will check for floats the parameter type and push in respect to the size, no more probs :)

Emil_halim member
Posts
639
Threads
104
Location
Alex, Egypt

thank you very much Mr Colin.

i know you are making a hard work so thanks again.

please do not forget the optional parameters.

http://www.freewebs.com/ogremagic/index.htm

Colin admin
Posts
928
Threads
49
Location
Bulgaria

DONE ;)

check the beta download again.

Emil_halim member
Posts
639
Threads
104
Location
Alex, Egypt

ok thanks.

but got that error

[30,71]: Expected = but found ; in [testprg.zir] Code: function DB_LoadAnimation=('_DB_LoadAnimation@8')(int32 AnimIndex; char* Filename):boolean; stdcall;

this was working well with previous releases.

http://www.freewebs.com/ogremagic/index.htm

Colin admin
Posts
928
Threads
49
Location
Bulgaria

OK check back in 5 mins will check this prob out :)

checked and tried this line but it compiles without error, it is possible it is displaying wrong line of code (a recent problem of Ziron 1 code structure)

the error is most likely somewhere else, can you paste your import block?

Emil_halim member
Posts
639
Threads
104
Location
Alex, Egypt

here it is

imports('MagicPro.dll') 
{  
  procedure z_init = ('_z_init@4')(char* Titel); stdcall;
  procedure Graphics3D = ('_Graphics3D@20')(Dword Width,Height,depth; boolean fullScrn,VSync);  stdcall;
  procedure z_setAmbientLight = ('_z_setAmbientLight@12')(single red,green,blue); stdcall;
  procedure setMediaDir = ('_setMediaDir@8')(char* name;boolean recursive); stdcall;
  function  OIS_isKeyDown = ('_OIS_isKeyDown@4')(int32 key): boolean; stdcall;
  procedure RenderWorld = ('_RenderWorld@4')(single timeSinceLastFrame=0.0); stdcall;
  procedure Sync =('_Sync@0')(); stdcall;
  procedure EndGraphics = ('_EndGraphics@0')(); stdcall;
  function  DB_LoadAnimation=('_DB_LoadAnimation@8')(int32 AnimIndex; char* Filename):boolean; stdcall;
  function  DB_PlayAnimationToImage=('_DB_PlayAnimationToImage@24')(int32 iImageIndex, AnimIndex, x, y, x2, y2):boolean; stdcall;
  function  DB_FreeAnimation=('_DB_FreeAnimation@4')(int32 AnimIndex):boolean; stdcall;
  function  make_hgeSprite=('_make_hgeSprite@20')(int32 image_id; single texx,texy, w, h):Dword; stdcall;
  procedure Screen_Use2DView= ('_Screen_Use2DView@0')(); stdcall;
  procedure Screen_Stop2DView=('_Screen_Stop2DView@0')(); stdcall;
  procedure hgeSprite_Render=('_hgeSprite_Render@12')(pointer spr; single x, y); stdcall;
  procedure defineQueueStarted=('_defineQueueStarted@4')(pointer func); stdcall;
  procedure defineQueueEnded=('_defineQueueEnded@4')(pointer func); stdcall;
  function  CreateCamera=('_CreateCamera@4')(pointer EntityParent):Dword; stdcall;
  procedure CameraClsColor=('_CameraClsColor@16')(pointer Camera; single r,g,b ); stdcall;
  procedure CameraRange=('_CameraRange@12')(pointer Camera; single neer , far); stdcall;
  function  LoadMesh=('_LoadMesh@12')(char* file;pointer EntityParent;char* meshName):Dword; stdcall;
  procedure PositionEntity=('_PositionEntity@16')(pointer Entity; single x,y,z); stdcall;
  function  CreateLight=('_CreateLight@4')(int32 lightType):Dword; stdcall;
  procedure LightColor=('_LightColor@16')(pointer light; single r,g,b ); stdcall;
}  

http://www.freewebs.com/ogremagic/index.htm

Colin admin
Posts
928
Threads
49
Location
Bulgaria

It is now fixed, re-download beta.

Thanks for the bug reports.