Raydium 3D Game Engine

Official forum for everything about Raydium, ManiaDrive, MeMak, ...
It is currently Thu Mar 28, 2024 5:15 pm

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Fri Oct 03, 2008 3:56 pm 
Offline

Joined: Wed Oct 01, 2008 11:53 pm
Posts: 6
Hello people,
I am writing pascal-wrapper for raydium. i have some questions about C language. I programmed in C last time in 1999.
1. I see some definitons in raydium-headerfiles.
#define RAYDIUM_ODE_AUTODETECT -1.f :
What means -1.f? Is it float, when i declare it as variable can i write it as:
float RAYDIUM_ODE_AUTODETECT = -1.0 ;

#define RAYDIUM_ODE_MATERIAL_HARD 0.9,0.1
Is this array? Like:
float RAYDIUM_ODE_MATERIAL_HARD[]={0.9,0.1};

#define RAYDIUM_ODE_JOINT_AXE_X 1,0,0
Is this array too? Like:
int RAYDIUM_ODE_JOINT_AXE_X[]={1,0,0};

2. I am converting raydium-sdk-example test6.c to pascal. I see in test6.c following:
Code:
int e1
...
char *c1,*c2;
int explo=-1;
......
if((c1 && *c1==29))
    explo=e1;

I can not understand this comparison: (c1 && *c1==29)
What compared here value and adress of c1? Can anyone tell me more, maybe in pascal?

Best Regards!


Last edited by sunji on Sat Oct 04, 2008 10:28 pm, edited 1 time in total.

Top
 Profile  
 
PostPosted: Fri Oct 03, 2008 5:51 pm 
Offline

Joined: Tue Jul 08, 2008 2:37 am
Posts: 181
Hi sunji,

nice to see you're working hard on the Raydium wrapper for Pascal! :D
Regarding to your questions, this articles will probably answer all of them.

English:
Comparison of Pascal and C

Deutsch:
C und Pascal - ein Vergleich
Kurzer Vergleich zwischen Pascal und C

I would prefer the english article regarding to this topic, because it's more complete in the technical part than the german ones.

1. Your code should work out of the box using constants.
2. That should be something like this:
Code:
var e1: Integer;
...
c1, c2: PChar;
explo: Integer;

begin
  explo := -1;
  ......
  if (Assigned(c1) and Ord(c1) = 29)
  begin
    explo := e1;
  end;
end;

Best regards,
st


Last edited by st on Wed Feb 15, 2012 6:45 pm, edited 1 time in total.

Top
 Profile  
 
PostPosted: Sat Oct 04, 2008 10:27 pm 
Offline

Joined: Wed Oct 01, 2008 11:53 pm
Posts: 6
Thanks st,
I translated other example. I have to write wrapper for ode before i can translate test6.c.
I released in other thread first version of my simple wrapper.


Top
 Profile  
 
PostPosted: Sat Oct 04, 2008 10:58 pm 
Offline

Joined: Tue Jul 08, 2008 2:37 am
Posts: 181
sunji wrote:
I have to write wrapper for ode before i can translate test6.c.
I don't know for what do you need the ODE header exactly, but feel free to use an existing unit, e. g. the one from Project JEDI: ODE.pp.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 34 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group