nel-all
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Nel] GNU/Linux compilation patches


From: Loic Dachary
Subject: [Nel] GNU/Linux compilation patches
Date: Sat, 2 Mar 2002 00:15:28 +0100

        Hi,

        Here is a small patch against todays CVS so that 
nel & snowballs compile on the GNU/Linux operating system.

        - Missing file in 3d/Makefile.am
        - Embeded struct definition that makes gcc-2.95.4 choke
        - s/)/}/ (previously reported on the list)
        - Viewport fix previously sent but apparently not yet applied
        - Spurious inlines that prevent --with-debug compilations
          also reported in a previous patch but apparently forgotten

        Have a nice weekend :-)

Index: nel/src/3d/Makefile.am
===================================================================
RCS file: /home/cvsroot/code/nel/src/3d/Makefile.am,v
retrieving revision 1.69
diff -u -r1.69 Makefile.am
--- nel/src/3d/Makefile.am      19 Feb 2002 11:20:57 -0000      1.69
+++ nel/src/3d/Makefile.am      1 Mar 2002 23:13:56 -0000
@@ -52,6 +52,7 @@
                        cluster.h                                       \
                        coarse_mesh_build.cpp                           \
                        coarse_mesh_build.h                             \
+                       meshvp_wind_tree.cpp                            \
                        coarse_mesh_manager.cpp                         \
                        coarse_mesh_manager.h                           \
                        computed_string.cpp                             \
Index: nel/src/3d/ps_ribbon.cpp
===================================================================
RCS file: /home/cvsroot/code/nel/src/3d/ps_ribbon.cpp,v
retrieving revision 1.4
diff -u -r1.4 ps_ribbon.cpp
--- nel/src/3d/ps_ribbon.cpp    28 Feb 2002 12:59:51 -0000      1.4
+++ nel/src/3d/ps_ribbon.cpp    1 Mar 2002 23:13:56 -0000
@@ -30,6 +30,7 @@
 #include "3d/particle_system.h"
 #include "3d/driver.h"
 #include "3d/ps_util.h"
+#include "3d/ps_located.h"
 #include "3d/texture_mem.h"
 #include "nel/misc/matrix.h"
 
@@ -38,6 +39,11 @@
 
 static NLMISC::CRGBA GradientB2W[] = {NLMISC::CRGBA(0, 0, 0, 0), 
NLMISC::CRGBA(255, 255, 255, 255) };
 
+struct CDummy2DAngle : CPSRotated2DParticle
+{
+  CPSLocated *getAngle2DOwner(void) { return NULL; }
+};
+
 /// private use : this create a gradient texture that goew from black to white
 static ITexture *CreateGradientTexture()
 {
@@ -160,11 +166,6 @@
 
                // we dont use the 2d angle anymore...serial a dummy one
                {
-                       struct CDummy2DAngle : CPSRotated2DParticle
-                       {
-                               CPSLocated *getAngle2DOwner(void) { return 
NULL; }
-                       };
-
                         CDummy2DAngle _Dummy2DAngle;
                        _Dummy2DAngle.serialAngle2DScheme(f); 
                }
Index: nel/src/3d/zone_manager.cpp
===================================================================
RCS file: /home/cvsroot/code/nel/src/3d/zone_manager.cpp,v
retrieving revision 1.5
diff -u -r1.5 zone_manager.cpp
--- nel/src/3d/zone_manager.cpp 28 Feb 2002 12:59:52 -0000      1.5
+++ nel/src/3d/zone_manager.cpp 1 Mar 2002 23:13:57 -0000
@@ -235,6 +235,7 @@
        }
        else
        {
+               nldebug("file not found: %s", zonePath.c_str ());
                _Lz->FileNotFound = true;
                delete _Zm->Zone;
        }
Index: nel/src/3d/driver/opengl/driver_opengl.cpp
===================================================================
RCS file: /home/cvsroot/code/nel/src/3d/driver/opengl/driver_opengl.cpp,v
retrieving revision 1.136
diff -u -r1.136 driver_opengl.cpp
--- nel/src/3d/driver/opengl/driver_opengl.cpp  15 Feb 2002 17:43:03 -0000      
1.136
+++ nel/src/3d/driver/opengl/driver_opengl.cpp  1 Mar 2002 23:14:01 -0000
@@ -1213,13 +1213,23 @@
 
 void CDriverGL::setupViewport (const class CViewport& viewport)
 {
-#ifdef NL_OS_WINDOWS
+#if NL_OS_WINDOWS
        if (_hWnd)
        {
                // Get window rect
                RECT rect;
                GetClientRect (_hWnd, &rect);
-
+               // Setup gl viewport
+               int clientWidth=rect.right-rect.left;
+               int clientHeight=rect.bottom-rect.top;
+#else // NL_OS_WINDOWS
+               XWindowAttributes win_attributes;
+               if (!XGetWindowAttributes(dpy, win, &win_attributes))
+                 throw EBadDisplay("Can't get window attributes.");
+               // Setup gl viewport
+               int clientWidth=win_attributes.width;
+               int clientHeight=win_attributes.height;
+#endif // NL_OS_WINDOWS
                // Get viewport
                float x;
                float y;
@@ -1227,9 +1237,6 @@
                float height;
                viewport.getValues (x, y, width, height);
 
-               // Setup gl viewport
-               int clientWidth=rect.right-rect.left;
-               int clientHeight=rect.bottom-rect.top;
                int ix=(int)((float)clientWidth*x);
                clamp (ix, 0, clientWidth);
                int iy=(int)((float)clientHeight*y);
@@ -1239,6 +1246,7 @@
                int iheight=(int)((float)clientHeight*height);
                clamp (iheight, 0, clientHeight-iy);
                glViewport (ix, iy, iwidth, iheight);
+#if NL_OS_WINDOWS
        }
 #endif // NL_OS_WINDOWS
 }
Index: nel/src/3d/driver/opengl/driver_opengl_material.cpp
===================================================================
RCS file: 
/home/cvsroot/code/nel/src/3d/driver/opengl/driver_opengl_material.cpp,v
retrieving revision 1.57
diff -u -r1.57 driver_opengl_material.cpp
--- nel/src/3d/driver/opengl/driver_opengl_material.cpp 15 Feb 2002 17:43:41 
-0000      1.57
+++ nel/src/3d/driver/opengl/driver_opengl_material.cpp 1 Mar 2002 23:14:01 
-0000
@@ -104,7 +104,7 @@
 
 
 // --------------------------------------------------
-inline void CDriverGL::setTextureEnvFunction(uint stage, CMaterial& mat)
+void CDriverGL::setTextureEnvFunction(uint stage, CMaterial& mat)
 {
        ITexture        *text= mat.getTexture(stage);
        if(text)
@@ -138,7 +138,7 @@
 
 
 //--------------------------------
-inline void CDriverGL::setupUserTextureMatrix(uint numStages, CMaterial& mat)
+void CDriverGL::setupUserTextureMatrix(uint numStages, CMaterial& mat)
 { 
        if (
                (_UserTexMatEnabled != 0 && (mat.getFlags() & 
IDRV_MAT_USER_TEX_MAT_ALL) == 0)          
Index: nel/src/misc/p_thread.cpp
===================================================================
RCS file: /home/cvsroot/code/nel/src/misc/p_thread.cpp,v
retrieving revision 1.8
diff -u -r1.8 p_thread.cpp
--- nel/src/misc/p_thread.cpp   27 Feb 2002 15:38:48 -0000      1.8
+++ nel/src/misc/p_thread.cpp   1 Mar 2002 23:14:05 -0000
@@ -51,7 +51,7 @@
 {
        /// \todo: implement this functionnality for posix thread
        return NULL;
-)
+}
  
 
 /*

-- 
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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]