Hay Mr.P. some time a go there was word, that you where helping Andy with RF2, and that you where working on a small demo. any word on the demo, and what you have added to the shell of RF2.
AND if you could update the SVN,with your great work,that would be great,
LOTS OF RF2 LOVE
ARDENTCREST
Mr P and a demo :D
- ardentcrest
- Posts: 735
- Joined: Wed Jan 25, 2006 10:55 pm
- Location: Ireland
Mr P and a demo :D
He's a Bot Jim, But not as we know It.
Re: Mr P and a demo :D
Give me until the end of January. I will release an FPS demo.
Many Bothans died to bring you this signature....
Re: Mr P and a demo :D
Just to show that I have been busy...I am working on some inline assembly math routines for floats. These will be used for collision detection and some physics stuff.
Code: Select all
// Inline Float routines
__inline DWORD F2DW(float f)
{
DWORD retval = 0;
_asm {
fld f
fistp retval
}
return retval;
}
__inline float FloatRoundToInt(float f)
{
_asm {
fld f
frndint
fstp f
}
return f;
}
__inline float FloatSqrt(float f)
{
_asm {
fld f
fsqrt
fstp f
}
return f;
}
__inline float FloatSin(float f)
{
_asm {
fld f
fsin
fstp f
}
return f;
}
__inline float FloatCos(float f)
{
_asm {
fld f
fcos
fstp f
}
return f;
}
Many Bothans died to bring you this signature....
- QuestOfDreams
- Site Admin
- Posts: 1520
- Joined: Sun Jul 03, 2005 11:12 pm
- Location: Austria
- Contact:
Re: Mr P and a demo :D
Sorry for bringing up this old topic again but I just recently played around with these functions myself. Looking at the code generated by VC++ it seems that some instructions get duplicated when returning the float value explicitly via the return function. It seems to me that for example
would be sufficient. Can you confirm this paradoxnj? I'm not that good at assembly.
Code: Select all
__inline float FloatSqrt(float f)
{
__asm
{
fld f
fsqrt
}
}
Re: Mr P and a demo :D
Yes...you can do it that way. It just looks better to the untrained ASM eye if you have a C return value. It won't return duplicate data, the return statement will override the ASM register with its value. So yes...it is an extra step. I sacrifice for readbility.
Many Bothans died to bring you this signature....