C++Builder with Irrlicht

A forum to store posts deemed exceptionally wise and useful
etcaptor
Posts: 871
Joined: Fri Apr 09, 2004 10:32 pm
Location: Valhalla
Contact:

Post by etcaptor »

linear_search is slower than binary_search, and this is the reason. It is strange, but binary_search works well with BCB in other cases. If I got right work with pk3 will publish here. So, you can read this topic for improvements sometimes :wink:
ImageImage
Site development -Rock and metal online
--- etcaptor.com ------freenetlife.com
Greatwolf

Post by Greatwolf »

Great work etcaptor! I wish there was this kind of support for making Crystal Space(another open source 3d engine) work with a borland compiler.

Slightly off topic but I want to get this out. I've been trying to port that over myself with some degrees of success. Some demo's work with my compiled CS but many don't. And then there's some that crashes on exit. A real pain in the butt to solve. If you can offer any assistance or advise on this it would be greatly appreciated.

On another note is there any change you can create some makefiles for this borland port? Once it works then compiling Irrlicht would just be going into the source directory and typing in make.

Thanks
Greatwolf
Posts: 19
Joined: Thu Mar 17, 2005 8:38 am

Post by Greatwolf »

Have a question for you etcaptor. How did you figure out the borland exception handling problem when porting and how did you know that

_control87((_control87(0, 0) | ~0011), MCW_EM);

Would fix the problem?

Thanks
etcaptor
Posts: 871
Joined: Fri Apr 09, 2004 10:32 pm
Location: Valhalla
Contact:

Post by etcaptor »

There are some lines in BCB help file:

Disabling floating-point exceptions

By default, programs abort if a floating-point overflow or divide-by-zero error occurs. You can mask these floating-point exceptions by a call to _control87 in main, before any floating-point operations are performed.

Example

#include <float.h>
main() {

_control87(MCW_EM,MCW_EM);

.
.
.
}

You can determine whether a floating-point exception occurred after the fact by calling _status87 or _clear87.

Certain math errors can also occur in library functions; for instance, if you try to take the square root of a negative number. The default behavior is to print an error message to the screen, and to return a NAN (an IEEE not-a-number). Use of the NAN is likely to cause a floating-point exception later, which will abort the program if unmasked. If you don’t want the message to be printed, insert the following version of _matherr into your program:

#include <math.h>

int _matherr(struct _exception *e)
{
return 1; /* error has been handled */

}

Any other use of _matherr to intercept math errors is not encouraged; it is considered obsolete and might not be supported in future versions of C++Builder.




float.h

Category

Math Routines

Prototype

unsigned int _control87(unsigned int newcw, unsigned int mask);

unsigned int _controlfp(unsigned int newcw, unsigned int mask);

Description

Manipulates the floating-point control word.

_control87 retrieves or changes the floating-point control word.

The floating-point control word is an unsigned int that, bit by bit, specifies certain modes in the floating-point package; namely, the precision, infinity, and rounding modes. Changing these modes lets you mask or unmask floating-point exceptions.

_control87 matches the bits in mask to the bits in newcw. If a mask bit equals 1, the corresponding bit in newcw contains the new value for the same bit in the floating-point control word, and _control87 sets that bit in the control word to the new value.

Here is a simple illustration:

Original control word: 0100 0011 0110 0011
mask: 1000 0001 0100 1111
newcw: 1110 1001 0000 0101

Changing bits: 1xxx xxx1 x0xx 0101

If mask equals 0, _control87 returns the floating-point control word without altering it.

_controlfp is for Microsoft compatibility. _controlfp is identical to _control87 except that it always removes (turns off) the EM_DEMORMAL bit from the mask parameter.

Return Value

The bits in the value returned reflect the new floating-point control word. For a complete definition of the bits returned by _control87, see the header file float.h.


And also some issues in google :lol:
ImageImage
Site development -Rock and metal online
--- etcaptor.com ------freenetlife.com
etcaptor
Posts: 871
Joined: Fri Apr 09, 2004 10:32 pm
Location: Valhalla
Contact:

BCB6 port for Irrlicht v.010.0

Post by etcaptor »

Hi all, some members send me PM for this port.
I just uploaded files.

dll was compiled with DX8 and DX9 support. There was some problems since v.09 with Cartography shop loader - I got template error in IrrString file and because not use this format, just remove this loader from BCB project. If someone have solution about this can write post here.

http://etcaptor.f2g.net/irrlicht/irr010BCB6.zip

Please inform me if I omit something.
ImageImage
Site development -Rock and metal online
--- etcaptor.com ------freenetlife.com
etcaptor
Posts: 871
Joined: Fri Apr 09, 2004 10:32 pm
Location: Valhalla
Contact:

string<T>& operator=(const B* c) give errors with

Post by etcaptor »

Hi all,
Seems here are only two BCB users with Irrlicht - I and Myth. :lol:

The problem is that string<T>& operator=(const B* c) in file IrrString.h give internal errors if is used somewere in code.

This problem appears first time for me since Irr09.
At now I cannot find good issue. Seems BCB treats templates differently. One issue is rewriting of this part of code. If you want to use BCB yet, we can catch this error. I found this part of code:
in file:

CCSMLoader.cpp

in fuction

code:
--------------------------------------------------------------------------------
void Surface::clear()
{
........
//replace textureName = 0; with
textureName = '/0';
//or textureName = ""
}
--------------------------------------------------------------------------------



I know, this is not ideal issue, but I use it for my purposes.

If you want to use string<T>& operator=(const B* c) somewere in you code, you must write own implementation.
ImageImage
Site development -Rock and metal online
--- etcaptor.com ------freenetlife.com
Myth
Posts: 81
Joined: Wed Apr 13, 2005 5:48 pm

Post by Myth »

Is wtext required for example making a hud with text?
JOIN MY (100mbs 2x 3GHZ CPU) IRRLICHT FORUMS
http://irrlicht.halo4you.com/forums/
For all your programming quesitons and irrlicht ones!.

My fan site: http://www.halo-center.com
etcaptor
Posts: 871
Joined: Fri Apr 09, 2004 10:32 pm
Location: Valhalla
Contact:

Post by etcaptor »

Ale wrote:
etcaptor wrote:I've tested this with many pk3 files and have no problems. Maybe is slowly and second part is strange , but works
Hello etcaptor
I saw your post yesterday and i had a quick try with Irrlicht 0.8 and BCB6.

You are right, with your modification, all triangles/textures are loaded.
However, it is not only slow : It is VERY VERY slow.
With the same computer and the same pk3 file (my wq_fort_west = 6 Mo in size) the loading time is :
- 10 secondes with the original source (FileList.binary_search)
- 95 secondes with the modified source (FileList.linear_search)

In other words, for the time being, BCB6 is not really usable with large pk3 files.
Thank you anyway for your good work on this issue.
Ale
Seems that with Irrlicht v.011 this problem not appears.
ImageImage
Site development -Rock and metal online
--- etcaptor.com ------freenetlife.com
Myth not logged in

Post by Myth not logged in »

Did you get irrlicht .11 to work with BCB?
Caould you please email me the project files, myth.hmbweb@xs4all.nl .
Or just tell me what to modify.

Thank you so much,
- Myth
etcaptor
Posts: 871
Joined: Fri Apr 09, 2004 10:32 pm
Location: Valhalla
Contact:

Post by etcaptor »

Yes, no problems.
BCB6 works with Irr.0.11.0 without problems.
I made many internal modifications in my current version for tets purposes, but will be able to compile sources again and upload only necessary changes for BCB
But I have only one problem. After upgrade of my PC cannot run IrrBCB in directX 9 mode at now. Can't resolve this. Also my old Irr.010 does not work now with DX9, since on my old system was worked. Maybe I have mixed DX files...
ImageImage
Site development -Rock and metal online
--- etcaptor.com ------freenetlife.com
Myth
Posts: 81
Joined: Wed Apr 13, 2005 5:48 pm

Post by Myth »

Ok. I would be happy to recieve it now anyway so that I can implent render to texture to my tag engine.

Just email myth.hmbweb@xs4all.nl

And with 0.9 I also get some dx error if I compile the dll.

Thanks,
- Myth
JOIN MY (100mbs 2x 3GHZ CPU) IRRLICHT FORUMS
http://irrlicht.halo4you.com/forums/
For all your programming quesitons and irrlicht ones!.

My fan site: http://www.halo-center.com
en972
Posts: 27
Joined: Tue Apr 26, 2005 7:58 pm

Post by en972 »

The links for tutorials on the first page do not work (And its not just my browser, I tried diffrent browsers. Could you please help me out here? I need to configure irrlicht with Builder
Myth
Posts: 81
Joined: Wed Apr 13, 2005 5:48 pm

Post by Myth »

His website seems to be down..
JOIN MY (100mbs 2x 3GHZ CPU) IRRLICHT FORUMS
http://irrlicht.halo4you.com/forums/
For all your programming quesitons and irrlicht ones!.

My fan site: http://www.halo-center.com
etcaptor
Posts: 871
Joined: Fri Apr 09, 2004 10:32 pm
Location: Valhalla
Contact:

Post by etcaptor »

Sorry, there are any problems with my hosting. I can only access this site with ftp client. I'll find new hosting and will post new url.

I gonna to make a new site. Here is BCB tutorial:

http://www.etcaptor.bobos.ca/Tutorials/ ... rlicht.htm
ImageImage
Site development -Rock and metal online
--- etcaptor.com ------freenetlife.com
etcaptor
Posts: 871
Joined: Fri Apr 09, 2004 10:32 pm
Location: Valhalla
Contact:

Post by etcaptor »

Hey, do you got success with BCB and Irrlicht?

If you have troubles tomorrow will upload BCB6Irr011.
Sorry for delay Myth.
ImageImage
Site development -Rock and metal online
--- etcaptor.com ------freenetlife.com
Post Reply