[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Nel] GNU/Linux ... snowballs is running
From: |
Loic Dachary |
Subject: |
Re: [Nel] GNU/Linux ... snowballs is running |
Date: |
Wed, 13 Feb 2002 15:52:48 +0100 |
Vianney Lecroart writes:
> Hi Loic,
>
> First of all, thank you for your help that is very useful for us.
Your code is also very helpful to me ;-)
> The problem about dynamic_cast seems to be a gcc bug (???) because the cast
> works fine on windows.
I think this definitely is a gcc bug. I acknowledged this
by doing the following:
Index: nel/src/3d/scene.cpp
===================================================================
RCS file: /home/cvsroot/code/nel/src/3d/scene.cpp,v
retrieving revision 1.62
diff -u -r1.62 scene.cpp
--- nel/src/3d/scene.cpp 6 Feb 2002 16:54:56 -0000 1.62
+++ nel/src/3d/scene.cpp 13 Feb 2002 14:39:00 -0000
@@ -463,7 +463,11 @@
#endif
// Look if this instance get lightmap information
- CMeshBase *pMB = dynamic_cast<CMeshBase*>( (IShape*)(pTShp->Shape) );
+#if defined(__GNUC__) && __GNUC__ < 3
+ CMeshBase *pMB = (CMeshBase*)((IShape*)(pTShp->Shape));
+#else // not GNUC
+ CMeshBase *pMB = dynamic_cast<CMeshBase*>((IShape*)(pTShp->Shape));
+#endif // not GNUC
CMeshBaseInstance *pMBI = dynamic_cast<CMeshBaseInstance*>( pTShp );
if( ( pMB != NULL ) && ( pMBI != NULL ) )
{ // Try to bind to automatic animation
I intentionaly made this hack specific to gcc-2 so that it
blows again on gcc-3 when we eventually switch to it and if the bug
is still there. For now I guess we'll have to live with it.
> dynamic_cast *can* return a pointer that is different from C style cast in
> the case a virtual multi inheritence.
Yes, forgot this one. But in this very specific case, there is no
reason for it to return a different pointer.
> For the frame rate, snowballs is slow perhaps because you don't have a good
> video card (geforce or better) or because the driver is software.
Oh, you mean my Matrox G200 is not as powerfull as a geforce
?-) I'm kidding. The issue here is to find a card that runs on
GNU/Linux and has a Free Software driver. All nVidia based products
are discarded right away, thanks to their address@hidden@$ non free software
policy. The worst of all is that they provide a gratis driver that
runs on GNU/Linux, therefore nobody is apparently motivated to write a
Free Software alternative.
I figured that an ATI RADEON 7500 / 64 Mo is probably the best
I can get. I'll have to recompile XFree-4.2.0 to take advantage of the
accelerated drivers, though. But not too far in the future it will pop
automagically on my Debian unstable, therefore it's acceptable. From the
benchmarks I saw, it more or less compares to a geforce 2 but is vastly
outperformed by geforce 3. Any input/experience on this subject would be
welcome.
Who is pressuring nVidia to release their drivers under a Free
Software license ? I'd gladly add my 0.2 euro advocacy bit ;-)
> Anyway, you have to know that there s visual bug that we never fix on linux.
> For example, the NeL 3d logo that should be small in the top left of the
> screen is very big in the center of the screen on linus (perhaps a Viewport
> problem).
Good to know. I was wondering why this huge logo would not go away
after a while. I'll first try to improve the frame rate as much as I can.
> For gcc-3, we tried, quickly, a compilation but there are some error about
> throw() qualifier and cast problem. If you fix them, we ll be glad to add
> them :)
I fixed the minor errors missing throw() in destructors but
finaly ran into a more embarassing problem (gcc aborting on
error). I'm probably playing with fire (using gcc-3.0.4
snapshot). Anyways, I guess it's too early for this and won't
insist. Here are the fixes. One of them is important since there is a
scope mismatch (uint i below).
Index: nel/include/nel/misc/common.h
===================================================================
RCS file: /home/cvsroot/code/nel/include/nel/misc/common.h,v
retrieving revision 1.33
diff -u -r1.33 common.h
--- nel/include/nel/misc/common.h 25 Oct 2001 14:58:23 -0000 1.33
+++ nel/include/nel/misc/common.h 13 Feb 2002 14:38:49 -0000
@@ -239,6 +239,7 @@
Exception();
Exception(const std::string &reason);
Exception(const char *format, ...);
+ virtual ~Exception() throw() {};
virtual const char *what() const throw();
};
Index: nel/include/nel/misc/stream.h
===================================================================
RCS file: /home/cvsroot/code/nel/include/nel/misc/stream.h,v
retrieving revision 1.50
diff -u -r1.50 stream.h
--- nel/include/nel/misc/stream.h 27 Nov 2001 15:59:55 -0000 1.50
+++ nel/include/nel/misc/stream.h 13 Feb 2002 14:38:49 -0000
@@ -77,6 +77,8 @@
EStream( const IStream &f, const std::string& str );
+ virtual ~EStream() throw() {}
+
// May Not be Filled...
std::string StreamName;
};
Index: nel/include/nel/net/buf_net_base.h
===================================================================
RCS file: /home/cvsroot/code/nel/include/nel/net/buf_net_base.h,v
retrieving revision 1.5
diff -u -r1.5 buf_net_base.h
--- nel/include/nel/net/buf_net_base.h 21 Jun 2001 12:35:16 -0000 1.5
+++ nel/include/nel/net/buf_net_base.h 13 Feb 2002 14:38:49 -0000
@@ -135,7 +135,7 @@
protected:
- friend CBufSock;
+ friend class NLNET::CBufSock;
/// Constructor
CBufNetBase();
Index: nel/src/3d/cube_grid.h
===================================================================
RCS file: /home/cvsroot/code/nel/src/3d/cube_grid.h,v
retrieving revision 1.1
diff -u -r1.1 cube_grid.h
--- nel/src/3d/cube_grid.h 6 Feb 2002 16:54:56 -0000 1.1
+++ nel/src/3d/cube_grid.h 13 Feb 2002 14:38:54 -0000
@@ -244,8 +244,8 @@
// Clear the Selection
_Selection= NULL;
- _CurSel= NULL;
- _NumSels= NULL;
+ _CurSel= 0;
+ _NumSels= 0;
}
// ***************************************************************************
Index: nel/src/3d/cube_map_builder.h
===================================================================
RCS file: /home/cvsroot/code/nel/src/3d/cube_map_builder.h,v
retrieving revision 1.1
diff -u -r1.1 cube_map_builder.h
--- nel/src/3d/cube_map_builder.h 4 Feb 2002 10:42:31 -0000 1.1
+++ nel/src/3d/cube_map_builder.h 13 Feb 2002 14:38:54 -0000
@@ -57,4 +57,4 @@
}
-#endif
\ No newline at end of file
+#endif
Index: nel/src/3d/landscape.h
===================================================================
RCS file: /home/cvsroot/code/nel/src/3d/landscape.h,v
retrieving revision 1.31
diff -u -r1.31 landscape.h
--- nel/src/3d/landscape.h 6 Feb 2002 16:54:56 -0000 1.31
+++ nel/src/3d/landscape.h 13 Feb 2002 14:38:54 -0000
@@ -104,6 +104,7 @@
public:
EBadBind() {}
+ ~EBadBind() throw () {}
virtual const char *what() const throw();
};
Index: nel/src/3d/point_light_named_array.cpp
===================================================================
RCS file: /home/cvsroot/code/nel/src/3d/point_light_named_array.cpp,v
retrieving revision 1.1
diff -u -r1.1 point_light_named_array.cpp
--- nel/src/3d/point_light_named_array.cpp 6 Feb 2002 16:54:56 -0000
1.1
+++ nel/src/3d/point_light_named_array.cpp 13 Feb 2002 14:38:58 -0000
@@ -96,7 +96,8 @@
bool first= true;
string precName;
// for all sorted pointLights
- for(uint i=0;i<_PointLights.size();i++)
+ uint i;
+ for(i=0;i<_PointLights.size();i++)
{
const std::string &curName=
_PointLights[i].LightGroupName;
if(first || precName!=curName )
Index: nel/src/3d/ps_misc.h
===================================================================
RCS file: /home/cvsroot/code/nel/src/3d/ps_misc.h,v
retrieving revision 1.1
diff -u -r1.1 ps_misc.h
--- nel/src/3d/ps_misc.h 2 Oct 2001 16:35:39 -0000 1.1
+++ nel/src/3d/ps_misc.h 13 Feb 2002 14:38:58 -0000
@@ -82,4 +82,4 @@
} // NL3D
-#endif
\ No newline at end of file
+#endif
Cheers,
--
Loic Dachary http://www.dachary.org/ address@hidden
12 bd Magenta http://www.senga.org/ address@hidden
75010 Paris T: 33 1 42 45 07 97 address@hidden
GPG Public Key: http://www.dachary.org/loic/gpg.txt