]> git.rm.cloudns.org Git - xonotic/netradiant.git/commitdiff
Remove pointless static guards
authorMattia Basaglia <mattia.basaglia@gmail.com>
Mon, 13 Mar 2017 07:30:25 +0000 (07:30 +0000)
committerMattia Basaglia <mattia.basaglia@gmail.com>
Mon, 13 Mar 2017 07:30:25 +0000 (07:30 +0000)
88 files changed:
contrib/bkgrnd2d/bkgrnd2d.cpp
contrib/gtkgensurf/gensurf.h
plugins/entity/light.cpp
plugins/entity/targetable.h
plugins/image/jpeg.cpp
plugins/shaders/shaders.cpp
radiant/brush.h
radiant/brush_primit.cpp
radiant/brush_primit.h
radiant/brushmanip.cpp
radiant/csg.cpp
radiant/help.cpp
radiant/patchdialog.cpp
radiant/select.cpp
radiant/selection.cpp
radiant/surfacedialog.cpp
radiant/texwindow.cpp
radiant/timer.cpp
radiant/timer.h
tools/quake2/extra/bsp/qbsp3/csg.c
tools/quake2/extra/bsp/qbsp3/faces.c
tools/quake2/extra/bsp/qbsp3/gldraw.c
tools/quake2/extra/bsp/qbsp3/map.c
tools/quake2/extra/bsp/qbsp3/portals.c
tools/quake2/extra/bsp/qbsp3/writebsp.c
tools/quake2/extra/bsp/qrad3/lightmap.c
tools/quake2/extra/bsp/qrad3/patches.c
tools/quake2/extra/bsp/qrad3/trace.c
tools/quake2/extra/bsp/qvis3/flow.c
tools/quake2/extra/common/cmdlib.c
tools/quake2/extra/qdata/video.c
tools/quake2/extra/qe4/camera.c
tools/quake2/extra/qe4/cmdlib.c
tools/quake2/extra/qe4/eclass.c
tools/quake2/extra/qe4/entity.c
tools/quake2/extra/qe4/win_ent.c
tools/quake2/extra/texpaint/win_skin.c
tools/quake2/q2map/brushbsp.c
tools/quake2/q2map/csg.c
tools/quake2/q2map/faces.c
tools/quake2/q2map/flow.c
tools/quake2/q2map/gldraw.c
tools/quake2/q2map/lightmap.c
tools/quake2/q2map/map.c
tools/quake2/q2map/patches.c
tools/quake2/q2map/portals.c
tools/quake2/q2map/trace.c
tools/quake2/q2map/writebsp.c
tools/quake2/qdata/video.c
tools/quake2/qdata_heretic2/common/cmdlib.c
tools/quake2/qdata_heretic2/common/inout.c
tools/quake2/qdata_heretic2/common/trilib.c
tools/quake2/qdata_heretic2/common/trilib.h
tools/quake2/qdata_heretic2/fmodels.c
tools/quake2/qdata_heretic2/images.c
tools/quake2/qdata_heretic2/joints.h
tools/quake2/qdata_heretic2/models.c
tools/quake2/qdata_heretic2/qcommon/resourcemanager.c
tools/quake2/qdata_heretic2/qd_skeletons.c
tools/quake2/qdata_heretic2/svdcmp.c
tools/quake2/qdata_heretic2/video.c
tools/quake3/common/cmdlib.c
tools/quake3/common/inout.c
tools/quake3/q3data/3dslib.c
tools/quake3/q3data/compress.c
tools/quake3/q3data/md3lib.c
tools/quake3/q3data/models.c
tools/quake3/q3data/oldstuff.c
tools/quake3/q3data/p3dlib.c
tools/quake3/q3data/stripper.c
tools/quake3/q3data/video.c
tools/quake3/q3map2/convert_map.c
tools/quake3/q3map2/decals.c
tools/quake3/q3map2/facebsp.c
tools/quake3/q3map2/image.c
tools/quake3/q3map2/light.c
tools/quake3/q3map2/light_trace.c
tools/quake3/q3map2/light_ydnar.c
tools/quake3/q3map2/lightmaps_ydnar.c
tools/quake3/q3map2/map.c
tools/quake3/q3map2/model.c
tools/quake3/q3map2/portals.c
tools/quake3/q3map2/prtfile.c
tools/quake3/q3map2/q3map2.h
tools/quake3/q3map2/shaders.c
tools/quake3/q3map2/surface.c
tools/quake3/q3map2/surface_meta.c
tools/quake3/q3map2/visflow.c

index b115952550b48e9de09ae19f18477fa0eb6dd7ca..80af5db05b292c840910e75878fdfa5aba105a36 100644 (file)
@@ -119,7 +119,7 @@ void CBackgroundImage::Render(){
 
        g_QglTable.m_pfn_qglPolygonMode( GL_FRONT,GL_FILL );
        // TODO, just so we can tell if we end up going the wrong way
-       // g_QglTable.m_pfn_qglPolygonMode(GL_BACK,GL_LINE);
+
        // TODO any other state we should not assume ?
 
        g_QglTable.m_pfn_qglBindTexture( GL_TEXTURE_2D, m_tex->texture_number );
index 99e4a46b74252e85f8f5b2df61ab1325827396be..57e9458e59c66c52242666573961018487335015 100644 (file)
@@ -58,15 +58,7 @@ extern _QERBrushTable __BRUSHTABLENAME;
 #define PLUGIN
 #define Q3RADIANT
 
-//#if defined(__linux__) || defined(__APPLE__)
-#if 1
 #include <algorithm>
-#else
-template <class T>
-inline T min( T x, T y ) { return ( x < y ) ? x : y; }
-template <class T>
-inline T max( T x, T y ) { return ( x > y ) ? x : y; }
-#endif
 
 typedef struct { long x, y; } Point;
 typedef struct { long left, top, right, bottom; } Rect;
@@ -76,7 +68,6 @@ typedef struct { long left, top, right, bottom; } Rect;
 typedef void* LPVOID;
 typedef char* LPSTR;
 
-//#endif
 inline bool PtInRect( Rect *rc, Point pt ){
        if ( pt.x < rc->left ) {
                return false;
@@ -107,14 +98,7 @@ inline bool PtInRect( Rect *rc, Point pt ){
 #define DegreesToRadians( a ) ( a / 57.2957795 )
 
 #define BOGUS_RANGE 65536
-/*
-   #define DotProduct(x,y) (x[0]*y[0]+x[1]*y[1]+x[2]*y[2])
-   #define VectorAdd(a,b,c) {c[0]=a[0]+b[0];c[1]=a[1]+b[1];c[2]=a[2]+b[2];}
-   #define VectorClear(x) {x[0] = x[1] = x[2] = 0;}
-   #define VectorCopy(a,b) {b[0]=a[0];b[1]=a[1];b[2]=a[2];}
-   #define VectorScale(a,b,c) {c[0]=b*a[0];c[1]=b*a[1];c[2]=b*a[2];}
-   #define VectorSubtract(a,b,c) {c[0]=a[0]-b[0];c[1]=a[1]-b[1];c[2]=a[2]-b[2];}
- */
+
 #define XYZVectorSubtract( a,b,c ) {c[0] = (float)a[0] - (float)b[0]; c[1] = (float)a[1] - (float)b[1]; c[2] = (float)a[2] - (float)b[2]; }
 #define side( u1,v1,u2,v2,u3,v3 ) ( v3 - v1 ) * ( u2 - u1 ) - ( u3 - u1 ) * ( v2 - v1 )
 
index 6c0141b797bce0032849802df4096dc1f39a470c..d65b890498a540826d8810caa5d1d0debf6ab8a0 100644 (file)
@@ -358,55 +358,10 @@ void light_draw( const AABB& aabb_light, RenderStateFlags state ){
                        1, 4, 3,
                        1, 3, 2
                };
-#if 1
                glVertexPointer( 3, GL_FLOAT, 0, points );
                glDrawElements( GL_TRIANGLES, sizeof( indices ) / sizeof( index_t ), RenderIndexTypeID, indices );
-#else
-               glBegin( GL_TRIANGLES );
-               for ( unsigned int i = 0; i < sizeof( indices ) / sizeof( index_t ); ++i )
-               {
-                       glVertex3fv( points[indices[i]] );
-               }
-               glEnd();
-#endif
        }
 
-
-       // NOTE: prolly not relevant until some time..
-       // check for DOOM lights
-#if 0
-       if ( strlen( ValueForKey( e, "light_right" ) ) > 0 ) {
-               vec3_t vRight, vUp, vTarget, vTemp;
-               GetVectorForKey( e, "light_right", vRight );
-               GetVectorForKey( e, "light_up", vUp );
-               GetVectorForKey( e, "light_target", vTarget );
-
-               glColor3f( 0, 1, 0 );
-               glBegin( GL_LINE_LOOP );
-               VectorAdd( vTarget, e->origin, vTemp );
-               VectorAdd( vTemp, vRight, vTemp );
-               VectorAdd( vTemp, vUp, vTemp );
-               glVertex3fv( e->origin );
-               glVertex3fv( vTemp );
-               VectorAdd( vTarget, e->origin, vTemp );
-               VectorAdd( vTemp, vUp, vTemp );
-               VectorSubtract( vTemp, vRight, vTemp );
-               glVertex3fv( e->origin );
-               glVertex3fv( vTemp );
-               VectorAdd( vTarget, e->origin, vTemp );
-               VectorAdd( vTemp, vRight, vTemp );
-               VectorSubtract( vTemp, vUp, vTemp );
-               glVertex3fv( e->origin );
-               glVertex3fv( vTemp );
-               VectorAdd( vTarget, e->origin, vTemp );
-               VectorSubtract( vTemp, vUp, vTemp );
-               VectorSubtract( vTemp, vRight, vTemp );
-               glVertex3fv( e->origin );
-               glVertex3fv( vTemp );
-               glEnd();
-
-       }
-#endif
 }
 
 // These variables are tweakable on the q3map2 console, setting to q3map2
@@ -602,9 +557,7 @@ void render( RenderStateFlags state ) const {
                aabb_draw_wire( m_points );
        }
 
-  #if 1    //disable if you dont want lines going from the center of the light bbox to the corners
        light_draw_box_lines( m_origin, m_points );
-  #endif
 }
 };
 
index 6de382cfabd63b90558e1ffea7016a30d676f233..82bed40032a11e1acf1ad4e4f8b96ecc3452e5c7 100644 (file)
@@ -342,17 +342,10 @@ void erase( const char* key, EntityKeyValue& value ){
 }
 
 const Vector3& world_position() const {
-#if 1
        const AABB& bounds = Instance::worldAABB();
        if ( aabb_valid( bounds ) ) {
                return bounds.origin;
        }
-#else
-       const AABB& childBounds = Instance::childBounds();
-       if ( aabb_valid( childBounds ) ) {
-               return childBounds.origin;
-       }
-#endif
        return vector4_to_vector3( localToWorld().t() );
 }
 
index 138151a2f62c81de5270f9188ff211d53c59a745..22edb0ab7f1a5e48cd6b0a16a99542e3043c5431 100644 (file)
@@ -315,11 +315,7 @@ static void j_putRGBAScanline( unsigned char* jpegline, int widthPix, unsigned c
                *oBlu = iBlu;
 
                //!\todo fix jpeglib, it leaves alpha channel uninitialised
-#if 1
                *oAlp = 255;
-#else
-               *oAlp = iAlp;
-#endif
        }
 }
 
index 3dfc9f6e0baeae9c3f01bfda5bb097b3912f72d9..72757fca8dfef769a24e4870f5693a6d6b54dd46 100644 (file)
@@ -123,7 +123,6 @@ Image& convertHeightmapToNormalmap( Image& heightmap, float scale ){
        byte* in = heightmap.getRGBAPixels();
        byte* out = normalmap.getRGBAPixels();
 
-#if 1
        // no filtering
        const int kernelSize = 2;
        KernelElement kernel_du[kernelSize] = {
@@ -134,26 +133,6 @@ Image& convertHeightmapToNormalmap( Image& heightmap, float scale ){
                { 0, 1, 0.5f },
                { 0,-1,-0.5f }
        };
-#else
-       // 3x3 Prewitt
-       const int kernelSize = 6;
-       KernelElement kernel_du[kernelSize] = {
-               {-1, 1,-1.0f },
-               {-1, 0,-1.0f },
-               {-1,-1,-1.0f },
-               { 1, 1, 1.0f },
-               { 1, 0, 1.0f },
-               { 1,-1, 1.0f }
-       };
-       KernelElement kernel_dv[kernelSize] = {
-               {-1, 1, 1.0f },
-               { 0, 1, 1.0f },
-               { 1, 1, 1.0f },
-               {-1,-1,-1.0f },
-               { 0,-1,-1.0f },
-               { 1,-1,-1.0f }
-       };
-#endif
 
        int x, y = 0;
        while ( y < h )
index 6c0956f5048ad80c6bf498f663826f0c019a8a67..9a41dc24e602ce334251b72e7ba8545cbd14c15d 100644 (file)
@@ -1258,19 +1258,9 @@ class RenderableWireframe : public OpenGLRenderable
 {
 public:
 void render( RenderStateFlags state ) const {
-#if 1
        glColorPointer( 4, GL_UNSIGNED_BYTE, sizeof( PointVertex ), &m_vertices->colour );
        glVertexPointer( 3, GL_FLOAT, sizeof( PointVertex ), &m_vertices->vertex );
        glDrawElements( GL_LINES, GLsizei( m_size << 1 ), RenderIndexTypeID, m_faceVertex.data() );
-#else
-       glBegin( GL_LINES );
-       for ( std::size_t i = 0; i < m_size; ++i )
-       {
-               glVertex3fv( &m_vertices[m_faceVertex[i].first].vertex.x );
-               glVertex3fv( &m_vertices[m_faceVertex[i].second].vertex.x );
-       }
-       glEnd();
-#endif
 }
 
 Array<EdgeRenderIndices> m_faceVertex;
index 9cac7a882999b5324f2f1c28bdd2ffab680c947c..5a02f8fe95da26ea4a0114d67a32f8e59204e3d6 100644 (file)
@@ -883,7 +883,6 @@ void Texdef_transformLocked( TextureProjection& projection, std::size_t width, s
        Texdef_normalise( projection, (float)width, (float)height );
 }
 
-#if 1
 void Q3_to_matrix( const texdef_t& texdef, float width, float height, const Vector3& normal, Matrix4& matrix ){
        Normal_GetTransform( normal, matrix );
 
@@ -912,4 +911,3 @@ void Q3_to_BP( const texdef_t& texdef, float width, float height, const Vector3&
        Q3_to_matrix( texdef, width, height, normal, matrix );
        BP_from_matrix( bp_texdef, normal, matrix );
 }
-#endif
index 79d27f3e98c188e0be76d9da19bca09bd115d859..9c5c546112d22f1a930afb8811087ec7ab049967 100644 (file)
@@ -38,17 +38,14 @@ struct brushprimit_texdef_t
                coords[1][2] = 0.f;
        }
        void removeScale( std::size_t width, std::size_t height ){
-#if 1
                coords[0][0] *= width;
                coords[0][1] *= width;
                coords[0][2] *= width;
                coords[1][0] *= height;
                coords[1][1] *= height;
                coords[1][2] *= height;
-#endif
        }
        void addScale( std::size_t width, std::size_t height ){
-#if 1
                ASSERT_MESSAGE( width > 0, "shader-width is 0" );
                ASSERT_MESSAGE( height > 0, "shader-height is 0" );
                coords[0][0] /= width;
@@ -57,7 +54,6 @@ struct brushprimit_texdef_t
                coords[1][0] /= height;
                coords[1][1] /= height;
                coords[1][2] /= height;
-#endif
        }
        float coords[2][3];
 };
index cf6e932c50d982efa84120cf88802bc4eeb30562..caf20c24f74267fd9672225cfa2185333ff070c3 100644 (file)
@@ -731,15 +731,10 @@ void Scene_BrushGetTexdef_Selected( scene::Graph& graph, TextureProjection& proj
 }
 
 void Scene_BrushGetTexdef_Component_Selected( scene::Graph& graph, TextureProjection& projection ){
-#if 1
        if ( !g_SelectedFaceInstances.empty() ) {
                FaceInstance& faceInstance = g_SelectedFaceInstances.last();
                faceInstance.getFace().GetTexdef( projection );
        }
-#else
-       FaceGetTexdef visitor( projection );
-       Scene_ForEachSelectedBrushFace( graph, visitor );
-#endif
 }
 
 void Scene_BrushGetShaderSize_Component_Selected( scene::Graph& graph, size_t& width, size_t& height ){
@@ -769,27 +764,19 @@ void operator()( Face& face ) const {
 
 
 void Scene_BrushGetFlags_Selected( scene::Graph& graph, ContentsFlagsValue& flags ){
-#if 1
        if ( GlobalSelectionSystem().countSelected() != 0 ) {
                BrushInstance* brush = Instance_getBrush( GlobalSelectionSystem().ultimateSelected() );
                if ( brush != 0 ) {
                        Brush_forEachFace( *brush, FaceGetFlags( flags ) );
                }
        }
-#else
-       Scene_ForEachSelectedBrush_ForEachFace( graph, FaceGetFlags( flags ) );
-#endif
 }
 
 void Scene_BrushGetFlags_Component_Selected( scene::Graph& graph, ContentsFlagsValue& flags ){
-#if 1
        if ( !g_SelectedFaceInstances.empty() ) {
                FaceInstance& faceInstance = g_SelectedFaceInstances.last();
                faceInstance.getFace().GetFlags( flags );
        }
-#else
-       Scene_ForEachSelectedBrushFace( graph, FaceGetFlags( flags ) );
-#endif
 }
 
 
@@ -810,28 +797,19 @@ void operator()( Face& face ) const {
 };
 
 void Scene_BrushGetShader_Selected( scene::Graph& graph, CopiedString& shader ){
-#if 1
        if ( GlobalSelectionSystem().countSelected() != 0 ) {
                BrushInstance* brush = Instance_getBrush( GlobalSelectionSystem().ultimateSelected() );
                if ( brush != 0 ) {
                        Brush_forEachFace( *brush, FaceGetShader( shader ) );
                }
        }
-#else
-       Scene_ForEachSelectedBrush_ForEachFace( graph, FaceGetShader( shader ) );
-#endif
 }
 
 void Scene_BrushGetShader_Component_Selected( scene::Graph& graph, CopiedString& shader ){
-#if 1
        if ( !g_SelectedFaceInstances.empty() ) {
                FaceInstance& faceInstance = g_SelectedFaceInstances.last();
                shader = faceInstance.getFace().GetShader();
        }
-#else
-       FaceGetShader visitor( shader );
-       Scene_ForEachSelectedBrushFace( graph, visitor );
-#endif
 }
 
 
index 5676401eb982d0ce37bbdbde391c8ab67c71f551..7d0d5e35210032ccf71489a97a572e3e102ea1a2 100644 (file)
@@ -240,7 +240,6 @@ typedef Function3<const Face&, const Plane3&, bool, bool, Face_testPlane> FaceTe
 /// \li flipped && brush is FRONT or ON
 bool Brush_testPlane( const Brush& brush, const Plane3& plane, bool flipped ){
        brush.evaluateBRep();
-#if 1
        for ( Brush::const_iterator i( brush.begin() ); i != brush.end(); ++i )
        {
                if ( Face_testPlane( *( *i ), plane, flipped ) ) {
@@ -248,9 +247,6 @@ bool Brush_testPlane( const Brush& brush, const Plane3& plane, bool flipped ){
                }
        }
        return true;
-#else
-       return Brush_findIf( brush, bindArguments( FaceTestPlane(), makeReference( plane ), flipped ) ) == 0;
-#endif
 }
 
 brushsplit_t Brush_classifyPlane( const Brush& brush, const Plane3& plane ){
index d5319f30c0469575d9091c8baa81e483b56c7914..cfd1145c37bfa9d44814730e733c03fcbfc87164 100644 (file)
@@ -117,16 +117,7 @@ void create_game_help_menu( GtkMenu *menu ){
        filename << AppPath_get() << "global.xlink";
        process_xlink( filename.c_str(), "General", AppPath_get(), menu );
 
-#if 1
        filename.clear();
        filename << g_pGameDescription->mGameToolsPath.c_str() << "game.xlink";
        process_xlink( filename.c_str(), g_pGameDescription->getRequiredKeyValue( "name" ), g_pGameDescription->mGameToolsPath.c_str(), menu );
-#else
-       for ( std::list<CGameDescription *>::iterator iGame = g_GamesDialog.mGames.begin(); iGame != g_GamesDialog.mGames.end(); ++iGame )
-       {
-               filename.clear();
-               filename << ( *iGame )->mGameToolsPath.c_str() << "game.xlink";
-               process_xlink( filename.c_str(), ( *iGame )->getRequiredKeyValue( "name" ), ( *iGame )->mGameToolsPath.c_str(), menu );
-       }
-#endif
 }
index 73639e5463756bf4b3686d29b0b48d7662d5b71f..5014e975e05739664e2280079447c19a8dd1fccf 100644 (file)
@@ -133,16 +133,12 @@ void operator()( Patch& patch ){
 };
 
 void Scene_PatchGetFixedSubdivisions( PatchFixedSubdivisions& subdivisions ){
-#if 1
        if ( GlobalSelectionSystem().countSelected() != 0 ) {
                Patch* patch = Node_getPatch( GlobalSelectionSystem().ultimateSelected().path().top() );
                if ( patch != 0 ) {
                        Patch_getFixedSubdivisions( *patch, subdivisions );
                }
        }
-#else
-       Scene_forEachVisibleSelectedPatch( PatchGetFixedSubdivisions( subdivisions ) );
-#endif
 }
 
 class PatchSetFixedSubdivisions
index 49d162c58854d049bc774ed2297082cd7c0f0519..a79004e7361e40f03c398658d112d46f3ef45922 100644 (file)
@@ -477,7 +477,6 @@ inline void matrix4_pivoted_rotate_by_axis90( Matrix4& matrix, axis_t axis, sign
 }
 
 inline Quaternion quaternion_for_axis90( axis_t axis, sign_t sign ){
-#if 1
        switch ( axis )
        {
        case eAxisX:
@@ -505,9 +504,6 @@ inline Quaternion quaternion_for_axis90( axis_t axis, sign_t sign ){
                        return Quaternion( 0, 0, -c_half_sqrt2f, -c_half_sqrt2f );
                }
        }
-#else
-       quaternion_for_matrix4_rotation( matrix4_rotation_for_axis90( (axis_t)axis, ( deg > 0 ) ? eSignPositive : eSignNegative ) );
-#endif
 }
 
 void Select_RotateAxis( int axis, float deg ){
index b55a3864495ca0fc442a319ad80c97c3170ae18f..ccb164924f2c1908210b659188cc980e0b91f140 100644 (file)
@@ -3388,19 +3388,11 @@ typedef Callback1<DeviceVector> MouseEventCallback;
 Single<MouseEventCallback> g_mouseMovedCallback;
 Single<MouseEventCallback> g_mouseUpCallback;
 
-#if 1
 const ButtonIdentifier c_button_select = c_buttonLeft;
 const ModifierFlags c_modifier_manipulator = c_modifierNone;
 const ModifierFlags c_modifier_toggle = c_modifierShift;
 const ModifierFlags c_modifier_replace = c_modifierShift | c_modifierAlt;
 const ModifierFlags c_modifier_face = c_modifierControl;
-#else
-const ButtonIdentifier c_button_select = c_buttonLeft;
-const ModifierFlags c_modifier_manipulator = c_modifierNone;
-const ModifierFlags c_modifier_toggle = c_modifierControl;
-const ModifierFlags c_modifier_replace = c_modifierNone;
-const ModifierFlags c_modifier_face = c_modifierShift;
-#endif
 const ModifierFlags c_modifier_toggle_face = c_modifier_toggle | c_modifier_face;
 const ModifierFlags c_modifier_replace_face = c_modifier_replace | c_modifier_face;
 
index 73312a078fba5435b28649a9680e03ea31efe045..11a423b0d32c835075907f86c2935a97f13814ba 100644 (file)
 #include "grid.h"
 #include "textureentry.h"
 
-//NOTE: Proper functioning of Textool currently requires that the "#if 1" lines in
-//      brush_primit.h be changed to "#if 0". add/removeScale screws this up ATM. :-)
-//      Plus, Radiant seems to work just fine without that stuff. ;-)
-
-#define TEXTOOL_ENABLED 0
-
-#if TEXTOOL_ENABLED
-
-namespace TexTool
-{
-
-//Shamus: Textool function prototypes
-gboolean size_allocate( GtkWidget *, GtkAllocation *, gpointer );
-gboolean expose( GtkWidget *, GdkEventExpose *, gpointer );
-gboolean button_press( GtkWidget *, GdkEventButton *, gpointer );
-gboolean button_release( GtkWidget *, GdkEventButton *, gpointer );
-gboolean motion( GtkWidget *, GdkEventMotion *, gpointer );
-void flipX( GtkToggleButton *, gpointer );
-void flipY( GtkToggleButton *, gpointer );
-
-//End Textool function prototypes
-
-//Shamus: Textool globals
-GtkWidget * g_textoolWin;
-//End Textool globals
-
-void queueDraw(){
-       gtk_widget_queue_draw( g_textoolWin );
-}
-
-}
-
-#endif
-
 inline void spin_button_set_step( GtkSpinButton* spin, gfloat step ){
-#if 1
        gtk_spin_button_get_adjustment( spin )->step_increment = step;
-#else
-       GValue gvalue = GValue_default();
-       g_value_init( &gvalue, G_TYPE_DOUBLE );
-       g_value_set_double( &gvalue, step );
-       g_object_set( G_OBJECT( gtk_spin_button_get_adjustment( spin ) ), "step-increment", &gvalue, NULL );
-#endif
 }
 
 class Increment
index 33e7e5c257d8ef227a6e13f75fffa9cf2868953a..f0fd5d495951f0cb7bc94b6d0b6e0c193b84aa8e 100644 (file)
@@ -103,12 +103,7 @@ typedef std::set<CopiedString> TextureGroups;
 
 void TextureGroups_addWad( TextureGroups& groups, const char* archive ){
        if ( extension_equal( path_get_extension( archive ), "wad" ) ) {
-#if 1
                groups.insert( archive );
-#else
-               CopiedString archiveBaseName( path_get_filename_start( archive ), path_get_filename_base_end( archive ) );
-               groups.insert( archiveBaseName );
-#endif
        }
 }
 typedef ReferenceCaller1<TextureGroups, const char*, TextureGroups_addWad> TextureGroupsAddWadCaller;
index 1c55d93022c7f51ebb82b98e53f3eedda10991f4..96a9066955424dab68df168bbba4cca67fd71b76 100644 (file)
@@ -51,11 +51,7 @@ public:
        }
        else
        {
-#if 1
                return MillisecondTime();
-#else
-               return time_from_ticks( timeGetTime(), 1000 );
-#endif
        }
 }
 
index 53280a8ca81d17aadf2c34d5a31fab58cb92d204..ebbdbcc8b7737f3030fea6ee3c73dcd1997cea29 100644 (file)
@@ -22,7 +22,6 @@
 #if !defined ( INCLUDED_TIMER_H )
 #define INCLUDED_TIMER_H
 
-#if 1
 
 const int msec_per_sec = 1000;
 
@@ -47,36 +46,6 @@ inline MillisecondTime time_from_ticks( tick_type tick_count, tick_type ticks_pe
        return MillisecondTime( static_cast<unsigned int>( tick_count / static_cast<double>( ticks_per_sec / msec_per_sec ) ) );
 }
 
-#else
-
-const unsigned int usec_per_sec = 1000000;
-
-class MillisecondTime
-{
-unsigned int m_sec;
-unsigned int m_usec;
-public:
-MillisecondTime( unsigned int sec, unsigned int usec )
-       : m_sec( sec ), m_usec( usec ){
-}
-MillisecondTime(){
-}
-staticMillisecondTime current();
-
-unsigned int milliseconds_since( const MillisecondTime& other ) const {
-       return static_cast<unsigned int>( ( m_sec * static_cast<double>( usec_per_sec ) + m_usec )
-                                                                         - ( other.m_sec * static_cast<double>( usec_per_sec ) + other.m_usec ) ) / 1000;
-}
-};
-
-template<typename tick_type>
-inline MillisecondTime time_from_ticks( tick_type tick_count, tick_type ticks_per_sec ){
-       return MillisecondTime( static_cast<unsigned int>( tick_count / ticks_per_sec ),
-                                                       static_cast<unsigned int>( ( tick_count % ticks_per_sec ) * ( usec_per_sec / static_cast<double>( ticks_per_sec ) ) ) );
-}
-
-#endif
-
 class Timer
 {
 MillisecondTime m_start;
index 2d69aa220e3d0bc8463a743e73128339aa92daff..f5b50e5d37dcdbf11ff3cd89196addd7cb03c844 100644 (file)
@@ -55,12 +55,6 @@ void SplitBrush2 (bspbrush_t *brush, int planenum,
        bspbrush_t **front, bspbrush_t **back)
 {
        SplitBrush (brush, planenum, front, back);
-#if 0
-       if (*front && (*front)->sides[(*front)->numsides-1].texinfo == -1)
-               (*front)->sides[(*front)->numsides-1].texinfo = (*front)->sides[0].texinfo;     // not -1
-       if (*back && (*back)->sides[(*back)->numsides-1].texinfo == -1)
-               (*back)->sides[(*back)->numsides-1].texinfo = (*back)->sides[0].texinfo;        // not -1
-#endif
 }
 
 /*
@@ -289,10 +283,6 @@ bspbrush_t *MakeBspBrushList (int startbrush, int endbrush,
                for (j=0 ; j<numsides ; j++)
                        if (mb->original_sides[j].visible && mb->original_sides[j].winding)
                                vis++;
-#if 0
-               if (!vis)
-                       continue;       // no faces at all
-#endif
                // if the brush is outside the clip area, skip it
                for (j=0 ; j<3 ; j++)
                        if (mb->mins[j] >= clipmaxs[j]
@@ -462,10 +452,6 @@ bspbrush_t *ChopBrushes (bspbrush_t *head)
        qprintf ("---- ChopBrushes ----\n");
        qprintf ("original brushes: %i\n", CountBrushList (head));
 
-#if 0
-       if (startbrush == 0)
-               WriteBrushList ("before.gl", head, false);
-#endif
        keep = NULL;
 
 newlist:
@@ -555,12 +541,6 @@ newlist:
        }
 
        qprintf ("output brushes: %i\n", CountBrushList (keep));
-#if 0
-       {
-               WriteBrushList ("after.gl", keep, false);
-               WriteBrushMap ("after.map", keep);
-       }
-#endif
        return keep;
 }
 
@@ -580,13 +560,6 @@ bspbrush_t *InitialBrushList (bspbrush_t *list)
        out = NULL;
        for (b=list ; b ; b=b->next)
        {
-#if 0
-               for (i=0 ; i<b->numsides ; i++)
-                       if (b->sides[i].visible)
-                               break;
-               if (i == b->numsides)
-                       continue;
-#endif
                newb = CopyBrush (b);
                newb->next = out;
                out = newb;
@@ -596,7 +569,6 @@ bspbrush_t *InitialBrushList (bspbrush_t *list)
                for (i=0 ; i<b->numsides ; i++)
                {
                        newb->sides[i].original = &b->sides[i];
-//                     newb->sides[i].visible = true;
                        b->sides[i].visible = false;
                }
        }
index 1bbc922bf4d675ef61cdf3868072dc7cd79bf240..537494264a8d5ec0224199391d300096de048caa 100644 (file)
@@ -332,15 +332,6 @@ void FindEdgeVerts (vec3_t v1, vec3_t v2)
        int             x, y;
        int             vnum;
 
-#if 0
-{
-       int             i;
-       num_edge_verts = numvertexes-1;
-       for (i=0 ; i<numvertexes-1 ; i++)
-               edge_verts[i] = i+1;
-}
-#endif
-
        x1 = (4096 + (int)(v1[0]+0.5)) >> 7;
        y1 = (4096 + (int)(v1[1]+0.5)) >> 7;
        x2 = (4096 + (int)(v2[0]+0.5)) >> 7;
@@ -358,20 +349,6 @@ void FindEdgeVerts (vec3_t v1, vec3_t v2)
                y1 = y2;
                y2 = t;
        }
-#if 0
-       x1--;
-       x2++;
-       y1--;
-       y2++;
-       if (x1 < 0)
-               x1 = 0;
-       if (x2 >= HASH_SIZE)
-               x2 = HASH_SIZE;
-       if (y1 < 0)
-               y1 = 0;
-       if (y2 >= HASH_SIZE)
-               y2 = HASH_SIZE;
-#endif
        num_edge_verts = 0;
        for (x=x1 ; x <= x2 ; x++)
        {
@@ -647,13 +624,6 @@ int GetEdge2 (int v1, int v2,  face_t *f)
                                edgefaces[i][1] = f;
                                return -i;
                        }
-       #if 0
-                       if (v1 == edge->v[0] && v2 == edge->v[1])
-                       {
-                               printf ("WARNING: multiple forward edge\n");
-                               return i;
-                       }
-       #endif
                }
        }
 
@@ -910,10 +880,6 @@ void SubdivideFace (node_t *node, face_t *f)
                                if (v > maxs)
                                        maxs = v;
                        }
-#if 0
-                       if (maxs - mins <= 0)
-                               Error ("zero extents");
-#endif
                        if (axis == 2)
                        {       // allow double high walls
                                if (maxs - mins <= subdivide_size/* *2 */)
index 08ab9c450cc75df238c4e2a2ca6b123bdd71a514..0dab2693e3ed315f9cc7952d4b16508b7031de04 100644 (file)
@@ -74,23 +74,11 @@ void Draw_ClearWindow (void)
        gluLookAt (mx, my, draw_maxs[2] + g/2, mx , my, draw_maxs[2], 0, 1, 0);
 
        glColor3f (0,0,0);
-//     glPolygonMode (GL_FRONT_AND_BACK, GL_LINE);
        glPolygonMode (GL_FRONT_AND_BACK, GL_FILL);
        glDisable (GL_DEPTH_TEST);
        glEnable (GL_BLEND);
        glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
 
-#if 0
-       glColor4f (1,0,0,0.5);
-       glBegin (GL_POLYGON);
-
-       glVertex3f (0, 500, 0);
-       glVertex3f (0, 900, 0);
-       glVertex3f (0, 900, 100);
-       glVertex3f (0, 500, 100);
-
-       glEnd ();
-#endif
 
        glFlush ();
 
index 232979c7a946a0343ed92c3fca4a3ded2e40f8ef..ab2d3971c8e5791426cb5bf94e542af720663f80 100644 (file)
@@ -97,20 +97,12 @@ PlaneEqual
 #define        DIST_EPSILON    0.01
 qboolean       PlaneEqual (plane_t *p, vec3_t normal, vec_t dist)
 {
-#if 1
        if (
           fabs(p->normal[0] - normal[0]) < NORMAL_EPSILON
        && fabs(p->normal[1] - normal[1]) < NORMAL_EPSILON
        && fabs(p->normal[2] - normal[2]) < NORMAL_EPSILON
        && fabs(p->dist - dist) < DIST_EPSILON )
                return true;
-#else
-       if (p->normal[0] == normal[0]
-               && p->normal[1] == normal[1]
-               && p->normal[2] == normal[2]
-               && p->dist == dist)
-               return true;
-#endif
        return false;
 }
 
index ef57caeff966e93ea3e24399341f1375faa70efa..d42b40eca268349c5862db31ae83698bccfcf566 100644 (file)
@@ -777,10 +777,6 @@ void FloodAreas_r (node_t *node)
        for (p=node->portals ; p ; p = p->next[s])
        {
                s = (p->nodes[1] == node);
-#if 0
-               if (p->nodes[!s]->occupied)
-                       continue;
-#endif
                if (!Portal_EntityFlood (p, s))
                        continue;
 
index cc5c3266fa49c2eb7272a705608fdfa7443a3618..85c3ae6be7c4ea4fe4f3a5b8d6f7cf4bc481e458 100644 (file)
@@ -507,14 +507,6 @@ void EndBSPFile (void)
        EmitPlanes ();
        UnparseEntities ();
 
-       // load the pop
-#if 0
-       sprintf (path, "%s/pics/pop.lmp", gamedir);
-       len = LoadFile (path, &buf);
-       memcpy (dpop, buf, sizeof(dpop));
-       free (buf);
-#endif
-
        // write the map
        sprintf (path, "%s.bsp", source);
        printf ("Writing %s\n", path);
index e6a5aaaa618e3320d8f79d26e5040e5e0f8d76b0..0a678d51352899c6af0f218f6a6f8478198d3af1 100644 (file)
@@ -1186,11 +1186,6 @@ void FinalLightFace (int facenum)
        lightdatasize += fl->numstyles*(fl->numsamples*3);
 
 // add green sentinals between lightmaps
-#if 0
-lightdatasize += 64*3;
-for (i=0 ; i<64 ; i++)
-dlightdata[lightdatasize-(i+1)*3 + 1] = 255;
-#endif
 
        if (lightdatasize > MAX_MAP_LIGHTING)
                Error ("MAX_MAP_LIGHTING");
index fbae0c32eda4017b5280be5a1410c45bd7721b44..239da13ca1bd40fcf00abd439c549d9c0f7f7068 100644 (file)
@@ -106,11 +106,6 @@ void CalcTextureReflectivity (void)
                        scale *= 2;
                        VectorScale (texture_reflectivity[i], scale, texture_reflectivity[i]);
                }
-#if 0
-texture_reflectivity[i][0] = 0.5;
-texture_reflectivity[i][1] = 0.5;
-texture_reflectivity[i][2] = 0.5;
-#endif
        }
 }
 
index bb5f4949c40f4314373c28cbb390e761d1610615..1b6b8f69050c117d4bc593e36613514d4065503c 100644 (file)
@@ -201,15 +201,6 @@ qboolean _TestLine (vec3_t start, vec3_t stop)
        {
                if (node == CONTENTS_SOLID)
                {
-#if 0
-                       float   d1, d2, d3;
-
-                       d1 = backx - frontx;
-                       d2 = backy - fronty;
-                       d3 = backz - frontz;
-
-                       if (d1*d1 + d2*d2 + d3*d3 > 1)
-#endif
                                return false;   // DONE!
                }
                
index 66af998e02253705a44e0b06ce0e4052ce25aff8..4f6eff68649e06ccc7b474bd60a75447fafa5778 100644 (file)
@@ -283,7 +283,6 @@ winding_t   *ClipToSeperators (winding_t *source, winding_t *pass, winding_t *targ
                // find out which side of the generated seperating plane has the
                // source portal
                //
-#if 1
                        fliptest = false;
                        for (k=0 ; k<source->numpoints ; k++)
                        {
@@ -305,9 +304,6 @@ winding_t   *ClipToSeperators (winding_t *source, winding_t *pass, winding_t *targ
                        }
                        if (k == source->numpoints)
                                continue;               // planar with source portal
-#else
-                       fliptest = flipclip;
-#endif
                //
                // flip the normal if the source portal is backwards
                //
@@ -316,7 +312,6 @@ winding_t   *ClipToSeperators (winding_t *source, winding_t *pass, winding_t *targ
                                VectorSubtract (vec3_origin, plane.normal, plane.normal);
                                plane.dist = -plane.dist;
                        }
-#if 1
                //
                // if all of the pass portal points are now on the positive side,
                // this is the seperating plane
@@ -339,16 +334,6 @@ winding_t  *ClipToSeperators (winding_t *source, winding_t *pass, winding_t *targ
                                
                        if (!counts[0])
                                continue;       // planar with seperating plane
-#else
-                       k = (j+1)%pass->numpoints;
-                       d = DotProduct (pass->points[k], plane.normal) - plane.dist;
-                       if (d < -ON_EPSILON)
-                               continue;
-                       k = (j+pass->numpoints-1)%pass->numpoints;
-                       d = DotProduct (pass->points[k], plane.normal) - plane.dist;
-                       if (d < -ON_EPSILON)
-                               continue;                       
-#endif
                //
                // flip the normal if we want the back side
                //
@@ -443,15 +428,12 @@ void RecursiveLeafFlow (int leafnum, threaddata_t *thread, pstack_t *prevstack)
                VectorSubtract (vec3_origin, p->plane.normal, backplane.normal);
                backplane.dist = -p->plane.dist;
                
-//             c_portalcheck++;
-               
                stack.portal = p;
                stack.next = NULL;
                stack.freewindings[0] = 1;
                stack.freewindings[1] = 1;
                stack.freewindings[2] = 1;
                
-#if 1
 {
 float d;
 
@@ -472,14 +454,8 @@ float d;
                        continue;
        }
 }
-#else
-               stack.pass = ChopWinding (p->winding, &stack, &thread->pstack_head.portalplane);
-               if (!stack.pass)
-                       continue;
-#endif
 
        
-#if 1
 {
 float d;
 
@@ -500,11 +476,6 @@ float d;
                        continue;
        }
 }
-#else
-               stack.source = ChopWinding (prevstack->source, &stack, &backplane);
-               if (!stack.source)
-                       continue;
-#endif
 
                if (!prevstack->pass)
                {       // the second leaf can only be blocked if coplanar
index 60f615a0be05692795716c7c7153798eb68b1c39..0952809366c166b2e20eb2bd5a1a039177b56744 100644 (file)
@@ -285,22 +285,6 @@ double I_FloatTime (void)
        time (&t);
 
        return t;
-#if 0
-// more precise, less portable
-       struct timeval tp;
-       struct timezone tzp;
-       static int              secbase;
-
-       gettimeofday(&tp, &tzp);
-
-       if (!secbase)
-       {
-               secbase = tp.tv_sec;
-               return tp.tv_usec/1000000.0;
-       }
-
-       return (tp.tv_sec - secbase) + tp.tv_usec/1000000.0;
-#endif
 }
 
 void Q_getwd (char *out)
index b2df1493ce3fb67719b01f8374471cbc477b86b0..15cec8ec555098cb5a77d50b9118b248038fb4e2 100644 (file)
@@ -686,7 +686,6 @@ Error ("LZSS: too big");
        for (i=0 ; i<in.count ; )
        {
                val = in.data[i];
-#if 1
 // chained search
                bestlength = 0;
                beststart = 0;
@@ -710,33 +709,6 @@ Error ("LZSS: too big");
                        start = lzss_next[start];
                }
 
-#else
-// slow simple search
-               // search for a match
-               max = FRONT_WINDOW;
-               if (i + max > in.count)
-                       max = in.count - i;
-
-               start = i - BACK_WINDOW;
-               if (start < 0)
-                       start = 0;
-               bestlength = 0;
-               beststart = 0;
-               for ( ; start < i ; start++)
-               {
-                       if (in.data[start] != val)
-                               continue;
-                       // count match length
-                       for (j=0 ; j<max ; j++)
-                               if (in.data[start+j] != in.data[i+j])
-                                       break;
-                       if (j > bestlength)
-                       {
-                               bestlength = j;
-                               beststart = start;
-                       }
-               }
-#endif
                beststart = BACK_WINDOW - (i-beststart);
 
                if (bestlength < 3)
@@ -901,16 +873,6 @@ void Huffman1_Count (cblock_t in)
                order0counts[v]++;
                hnodes1[prev][v].count++;
                prev = v;
-#if 1
-               for (rept=1 ; i+rept < in.count && rept < MAX_REPT ; rept++)
-                       if (in.data[i+rept] != v)
-                               break;
-               if (rept > MIN_REPT)
-               {
-                       hnodes1[prev][255+rept].count++;
-                       i += rept-1;
-               }
-#endif
        }
 }
 
@@ -958,18 +920,6 @@ void Huffman1_Build (FILE *f)
 
                BuildTree1 (i);
        }
-
-#if 0
-       // count up the total bits
-       total = 0;
-       for (i=0 ; i<256 ; i++)
-               for (j=0 ; j<256 ; j++)
-                       total += charbitscount1[i][j] * hnodes1[i][j].count;
-
-       total = (total+7)/8;
-       printf ("%i bytes huffman1 compressed\n", total);
-#endif
-
        fwrite (scaled, 1, sizeof(scaled), f);
 }
 
@@ -1020,27 +970,6 @@ cblock_t Huffman1 (cblock_t in)
                }
 
                prev = v;
-#if 1
-               // check for repeat encodes
-               for (rept=1 ; i+rept < in.count && rept < MAX_REPT ; rept++)
-                       if (in.data[i+rept] != v)
-                               break;
-               if (rept > MIN_REPT)
-               {
-                       c = charbitscount1[prev][255+rept];
-                       bits = charbits1[prev][255+rept];
-                       if (!c)
-                               Error ("!bits");
-                       while (c)
-                       {
-                               c--;
-                               if (bits & (1<<c))
-                                       out_p[outbits>>3] |= 1<<(outbits&7);
-                               outbits++;
-                       }
-                       i += rept-1;
-               }
-#endif
        }
 
        out_p += (outbits+7)>>3;
@@ -1092,14 +1021,6 @@ cblock_t LoadFrame (char *base, int frame, int digits, byte **palette)
        in.count = width*height;
 // FIXME: map 0 and 255!
 
-#if 0
-       // rle compress
-       rle = RLE(in);
-       free (in.data);
-
-       return rle;
-#endif
-
        return in;
 }
 
index 8dd7d5f503e7eeaf599ef489c30c1149e2653246..94e5b6080772842d083767c585f98150b255d8f8 100644 (file)
@@ -181,12 +181,6 @@ void Cam_MouseControl (float dtime)
        yl = camera.height/3;
        yh = yl*2;
 
-#if 0
-       // strafe
-       if (buttony < yl && (buttonx < xl || buttonx > xh))
-               VectorMA (camera.origin, xf*dtime*MOVE_SPEED, camera.right, camera.origin);
-       else
-#endif
        {
                xf *= 1.0 - fabs(yf);
                if (xf < 0)
@@ -453,20 +447,6 @@ void Cam_Draw (void)
                glEnable(GL_DEPTH_TEST);
                glDepthFunc (GL_LEQUAL);
 
-#if 0
-
-               {
-          GLfloat fogColor[4] = {0.0, 1.0, 0.0, 0.25};
-
-               glFogi (GL_FOG_MODE, GL_LINEAR);
-               glHint (GL_FOG_HINT, GL_NICEST);  /*  per pixel   */
-               glFogf (GL_FOG_START, -8192);
-               glFogf (GL_FOG_END, 65536);
-          glFogfv (GL_FOG_COLOR, fogColor);
-
-               }
-
-#endif
                break;
 
        case cd_blend:
index 87565490683498dcc763c804c7616a0e30be68cf..713cfb477273424a95fadeb47f6ae8b178ac0843 100644 (file)
@@ -41,22 +41,6 @@ double I_FloatTime (void)
        time (&t);
 
        return t;
-#if 0
-// more precise, less portable
-       struct timeval tp;
-       struct timezone tzp;
-       static int              secbase;
-
-       gettimeofday(&tp, &tzp);
-
-       if (!secbase)
-       {
-               secbase = tp.tv_sec;
-               return tp.tv_usec/1000000.0;
-       }
-
-       return (tp.tv_sec - secbase) + tp.tv_usec/1000000.0;
-#endif
 }
 
 
index 466d8a48fc2b3b1e1ba7a2dea60a67f248c5f0ae..0fc149986f80cc391c45323e495eb171c28e113b 100644 (file)
@@ -130,13 +130,6 @@ eclass_t *Eclass_InitFromText (char *text)
        len = t-text;
        e->comments = qmalloc (len+1);
        memcpy (e->comments, text, len);
-#if 0
-       for (i=0 ; i<len ; i++)
-               if (text[i] == '\n')
-                       e->comments[i] = '\r';
-               else
-                       e->comments[i] = text[i];
-#endif
        e->comments[len] = 0;
 
        return e;
index 7cbe14ae8e316f6df5daa675205b6d99b0a66528..d6d09cce0cd334139d8f7da9e7caf0bfb041b151 100644 (file)
@@ -223,12 +223,6 @@ entity_t   *Entity_Parse (qboolean onlypairs)
                if (ent->brushes.onext != &ent->brushes)
                {
                        printf ("Warning: Fixed size entity with brushes\n");
-#if 0
-                       while (ent->brushes.onext != &ent->brushes)
-                       {       // FIXME: this will free the entity and crash!
-                               Brush_Free (b);
-                       }
-#endif
 ent->brushes.next = ent->brushes.prev = &ent->brushes;
                }
                // create a custom brush
index 74fa9589a50f1f39922602ff66e2ff0529bcfd74..0477f006051d756dfbb057904e59659d8917ecbd 100644 (file)
@@ -264,21 +264,6 @@ void GetEntityControls(HWND ghwndEntity)
                Error ("CreateWindow failed");
 
        g_qeglobals.d_hwndTexture = CreateTextureWindow ();
-
-#if 0
-       for (i=0 ; i<12 ; i++)
-       {
-               hwndEnt[EntCheck1 + i] = CreateWindow ("button", NULL,
-               BS_AUTOCHECKBOX | WS_CHILD | WS_VISIBLE,
-               5, 100, 180, 99,
-               entwindow,
-               (void *)IDC_E_STATUS,
-               main_instance,
-               NULL);
-               if (!hwndEnt[EntCheck1 + i])
-                       Error ("CreateWindow failed");
-       }
-#endif
 }
 
 
index bffc0d823a0e27859a08900f105fddbc53629439..5e66de4872f2b1fdbe2dae7904547c360c608603 100644 (file)
@@ -780,16 +780,7 @@ void ResampleSkin (void)
        glDisable (GL_DEPTH_TEST);
        glDisable (GL_CULL_FACE);
        BindTextureEXT (GL_TEXTURE_2D, TEXTURE_INDEX);
-#if 0
-       glDisable(GL_TEXTURE_2D);
-       glBegin (GL_LINE_LOOP);
-       glVertex3f (1,1,10);
-       glVertex3f (skin_width-1,0,10);
-       glVertex3f (skin_width-1,skin_height-1,10);
-       glVertex3f (1,skin_height-1,10);
-       glEnd ();
-       glEnable(GL_TEXTURE_2D);
-#endif
+
        glBegin (GL_TRIANGLES);
        for (i=0 ; i<numfaces ; i++)
        {
index 022db65329568a419d21041338024d46bd55f9a2..4558f7da79368b63e35de153d2a523d05a163182 100644 (file)
@@ -603,21 +603,6 @@ int TestBrushToPlanenum( bspbrush_t *brush, int planenum,
                 || ( d_back < 0.0 && d_back > -1.0 ) ) {
                ( *epsilonbrush )++;
        }
-
-#if 0
-       if ( *numsplits == 0 ) { //     didn't really need to be split
-               if ( front ) {
-                       s = PSIDE_FRONT;
-               }
-               else if ( back ) {
-                       s = PSIDE_BACK;
-               }
-               else{
-                       s = 0;
-               }
-       }
-#endif
-
        return s;
 }
 
@@ -633,12 +618,6 @@ int TestBrushToPlanenum( bspbrush_t *brush, int planenum,
  */
 #define EDGE_LENGTH 0.2
 qboolean WindingIsTiny( winding_t *w ){
-#if 0
-       if ( WindingArea( w ) < 1 ) {
-               return true;
-       }
-       return false;
-#else
        int i, j;
        vec_t len;
        vec3_t delta;
@@ -657,7 +636,6 @@ qboolean WindingIsTiny( winding_t *w ){
                }
        }
        return true;
-#endif
 }
 
 /*
@@ -1052,19 +1030,9 @@ void SplitBrush( bspbrush_t *brush, int planenum,
                        if ( !cw[j] ) {
                                continue;
                        }
-#if 0
-                       if ( WindingIsTiny( cw[j] ) ) {
-                               FreeWinding( cw[j] );
-                               continue;
-                       }
-#endif
                        cs = &b[j]->sides[b[j]->numsides];
                        b[j]->numsides++;
                        *cs = *s;
-//                     cs->planenum = s->planenum;
-//                     cs->texinfo = s->texinfo;
-//                     cs->visible = s->visible;
-//                     cs->original = s->original;
                        cs->winding = cw[j];
                        cs->tested = false;
                }
@@ -1336,18 +1304,6 @@ tree_t *BrushBSP( bspbrush_t *brushlist, vec3_t mins, vec3_t maxs ){
        Sys_FPrintf( SYS_VRB, "%5i visible nodes\n", c_nodes / 2 - c_nonvis );
        Sys_FPrintf( SYS_VRB, "%5i nonvis nodes\n", c_nonvis );
        Sys_FPrintf( SYS_VRB, "%5i leafs\n", ( c_nodes + 1 ) / 2 );
-#if 0
-       { // debug code
-               static node_t   *tnode;
-               vec3_t p;
-
-               p[0] = -1469;
-               p[1] = -118;
-               p[2] = 119;
-               tnode = PointInLeaf( tree->headnode, p );
-               Sys_Printf( "contents: %i\n", tnode->contents );
-               p[0] = 0;
-       }
-#endif
+
        return tree;
 }
index 0b0bda93d29f30ca869690a37f293fb466999c5e..321aee2dbb9416c6f83982709aa402cae1dc314e 100644 (file)
 void SplitBrush2( bspbrush_t *brush, int planenum,
                                  bspbrush_t **front, bspbrush_t **back ){
        SplitBrush( brush, planenum, front, back );
-#if 0
-       if ( *front && ( *front )->sides[( *front )->numsides - 1].texinfo == -1 ) {
-               ( *front )->sides[( *front )->numsides - 1].texinfo = ( *front )->sides[0].texinfo; // not -1
-       }
-       if ( *back && ( *back )->sides[( *back )->numsides - 1].texinfo == -1 ) {
-               ( *back )->sides[( *back )->numsides - 1].texinfo = ( *back )->sides[0].texinfo;    // not -1
-       }
-#endif
 }
 
 /*
@@ -293,11 +285,6 @@ bspbrush_t *MakeBspBrushList( int startbrush, int endbrush,
                        if ( mb->original_sides[j].visible && mb->original_sides[j].winding ) {
                                vis++;
                        }
-#if 0
-               if ( !vis ) {
-                       continue;   // no faces at all
-               }
-#endif
                // if the brush is outside the clip area, skip it
                for ( j = 0 ; j < 3 ; j++ )
                        if ( mb->mins[j] >= clipmaxs[j]
@@ -469,11 +456,6 @@ bspbrush_t *ChopBrushes( bspbrush_t *head ){
        Sys_FPrintf( SYS_VRB, "---- ChopBrushes ----\n" );
        Sys_FPrintf( SYS_VRB, "original brushes: %i\n", CountBrushList( head ) );
 
-#if 0
-       if ( startbrush == 0 ) {
-               WriteBrushList( "before.gl", head, false );
-       }
-#endif
        keep = NULL;
 
 newlist:
@@ -565,12 +547,6 @@ newlist:
        }
 
        Sys_FPrintf( SYS_VRB, "output brushes: %i\n", CountBrushList( keep ) );
-#if 0
-       {
-               WriteBrushList( "after.gl", keep, false );
-               WriteBrushMap( "after.map", keep );
-       }
-#endif
        return keep;
 }
 
@@ -589,15 +565,6 @@ bspbrush_t *InitialBrushList( bspbrush_t *list ){
        out = NULL;
        for ( b = list ; b ; b = b->next )
        {
-#if 0
-               for ( i = 0 ; i < b->numsides ; i++ )
-                       if ( b->sides[i].visible ) {
-                               break;
-                       }
-               if ( i == b->numsides ) {
-                       continue;
-               }
-#endif
                newb = CopyBrush( b );
                newb->next = out;
                out = newb;
@@ -607,7 +574,6 @@ bspbrush_t *InitialBrushList( bspbrush_t *list ){
                for ( i = 0 ; i < b->numsides ; i++ )
                {
                        newb->sides[i].original = &b->sides[i];
-//                     newb->sides[i].visible = true;
                        b->sides[i].visible = false;
                }
        }
index 7607dbc218ca2d7ba47a0c3914e06a8ddfe8a766..d57620ddb304a1ffd627df8247d06ff997de4cde 100644 (file)
@@ -337,16 +337,6 @@ void FindEdgeVerts( vec3_t v1, vec3_t v2 ){
        int x1, x2, y1, y2, t;
        int x, y;
        int vnum;
-
-#if 0
-       {
-               int i;
-               num_edge_verts = numvertexes - 1;
-               for ( i = 0 ; i < numvertexes - 1 ; i++ )
-                       edge_verts[i] = i + 1;
-       }
-#endif
-
        x1 = ( 4096 + (int)( v1[0] + 0.5 ) ) >> 7;
        y1 = ( 4096 + (int)( v1[1] + 0.5 ) ) >> 7;
        x2 = ( 4096 + (int)( v2[0] + 0.5 ) ) >> 7;
@@ -362,24 +352,6 @@ void FindEdgeVerts( vec3_t v1, vec3_t v2 ){
                y1 = y2;
                y2 = t;
        }
-#if 0
-       x1--;
-       x2++;
-       y1--;
-       y2++;
-       if ( x1 < 0 ) {
-               x1 = 0;
-       }
-       if ( x2 >= HASH_SIZE ) {
-               x2 = HASH_SIZE;
-       }
-       if ( y1 < 0 ) {
-               y1 = 0;
-       }
-       if ( y2 >= HASH_SIZE ) {
-               y2 = HASH_SIZE;
-       }
-#endif
        num_edge_verts = 0;
        for ( x = x1 ; x <= x2 ; x++ )
        {
@@ -651,12 +623,6 @@ int GetEdge2( int v1, int v2,  face_t *f ){
                                edgefaces[i][1] = f;
                                return -i;
                        }
-       #if 0
-                       if ( v1 == edge->v[0] && v2 == edge->v[1] ) {
-                               Sys_Printf( "WARNING: multiple forward edge\n" );
-                               return i;
-                       }
-       #endif
                }
        }
 
@@ -929,11 +895,6 @@ void SubdivideFace( node_t *node, face_t *f ){
                                        maxs = v;
                                }
                        }
-#if 0
-                       if ( maxs - mins <= 0 ) {
-                               Error( "zero extents" );
-                       }
-#endif
                        if ( axis == 2 ) { // allow double high walls
                                if ( maxs - mins <= subdivide_size /* *2 */ ) {
                                        break;
index 587e19025139c80249533ead727ee148d872d613..199a3be1968c7bbdb98cf1210d957036714cff44 100644 (file)
@@ -283,7 +283,6 @@ winding_t   *ClipToSeperators( winding_t *source, winding_t *pass, winding_t *ta
                        // find out which side of the generated seperating plane has the
                        // source portal
                        //
-#if 1
                        fliptest = false;
                        for ( k = 0 ; k < source->numpoints ; k++ )
                        {
@@ -305,9 +304,7 @@ winding_t   *ClipToSeperators( winding_t *source, winding_t *pass, winding_t *ta
                        if ( k == source->numpoints ) {
                                continue;       // planar with source portal
                        }
-#else
-                       fliptest = flipclip;
-#endif
+
                        //
                        // flip the normal if the source portal is backwards
                        //
@@ -315,7 +312,7 @@ winding_t   *ClipToSeperators( winding_t *source, winding_t *pass, winding_t *ta
                                VectorSubtract( vec3_origin, plane.normal, plane.normal );
                                plane.dist = -plane.dist;
                        }
-#if 1
+
                        //
                        // if all of the pass portal points are now on the positive side,
                        // this is the seperating plane
@@ -344,18 +341,7 @@ winding_t   *ClipToSeperators( winding_t *source, winding_t *pass, winding_t *ta
                        if ( !counts[0] ) {
                                continue;   // planar with seperating plane
                        }
-#else
-                       k = ( j + 1 ) % pass->numpoints;
-                       d = DotProduct( pass->points[k], plane.normal ) - plane.dist;
-                       if ( d < -ON_EPSILON ) {
-                               continue;
-                       }
-                       k = ( j + pass->numpoints - 1 ) % pass->numpoints;
-                       d = DotProduct( pass->points[k], plane.normal ) - plane.dist;
-                       if ( d < -ON_EPSILON ) {
-                               continue;
-                       }
-#endif
+
                        //
                        // flip the normal if we want the back side
                        //
@@ -446,15 +432,12 @@ void RecursiveLeafFlow( int leafnum, threaddata_t *thread, pstack_t *prevstack )
                VectorSubtract( vec3_origin, p->plane.normal, backplane.normal );
                backplane.dist = -p->plane.dist;
 
-//             c_portalcheck++;
-
                stack.portal = p;
                stack.next = NULL;
                stack.freewindings[0] = 1;
                stack.freewindings[1] = 1;
                stack.freewindings[2] = 1;
 
-#if 1
                {
                        float d;
 
@@ -474,15 +457,7 @@ void RecursiveLeafFlow( int leafnum, threaddata_t *thread, pstack_t *prevstack )
                                }
                        }
                }
-#else
-               stack.pass = Vis_ChopWinding( p->winding, &stack, &thread->pstack_head.portalplane );
-               if ( !stack.pass ) {
-                       continue;
-               }
-#endif
-
 
-#if 1
                {
                        float d;
 
@@ -502,12 +477,6 @@ void RecursiveLeafFlow( int leafnum, threaddata_t *thread, pstack_t *prevstack )
                                }
                        }
                }
-#else
-               stack.source = Vis_ChopWinding( prevstack->source, &stack, &backplane );
-               if ( !stack.source ) {
-                       continue;
-               }
-#endif
 
                if ( !prevstack->pass ) { // the second leaf can only be blocked if coplanar
 
index 55c8becf834ac50085959b75bfe654946c21279c..418774b32275ade600a8646934c6f6f15f67be66 100644 (file)
@@ -77,18 +77,6 @@ void Draw_ClearWindow( void ){
        glEnable( GL_BLEND );
        glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
 
-#if 0
-       glColor4f( 1,0,0,0.5 );
-       glBegin( GL_POLYGON );
-
-       glVertex3f( 0, 500, 0 );
-       glVertex3f( 0, 900, 0 );
-       glVertex3f( 0, 900, 100 );
-       glVertex3f( 0, 500, 100 );
-
-       glEnd();
-#endif
-
        glFlush();
 
 }
index 70c04585f7574bd4effdbcd411c97cc8df98166c..abd23d26344f6170c39a7acfc5ae3857ec2f5b15 100644 (file)
@@ -1194,11 +1194,6 @@ void FinalLightFace( int facenum ){
        lightdatasize += fl->numstyles * ( fl->numsamples * 3 );
 
 // add green sentinals between lightmaps
-#if 0
-       lightdatasize += 64 * 3;
-       for ( i = 0 ; i < 64 ; i++ )
-               dlightdata[lightdatasize - ( i + 1 ) * 3 + 1] = 255;
-#endif
 
        if ( lightdatasize > MAX_MAP_LIGHTING ) {
                Error( "MAX_MAP_LIGHTING" );
index ed68ccae676a346317c2faaaa3bce6da45b48ec2..ddfd709a078aaa45e3ede4e7b5b32548e4ebf6c1 100644 (file)
@@ -100,7 +100,6 @@ int PlaneTypeForNormal( vec3_t normal ){
 #define NORMAL_EPSILON  0.00001
 #define DIST_EPSILON    0.01
 qboolean    PlaneEqual( plane_t *p, vec3_t normal, vec_t dist ){
-#if 1
        if (
                fabs( p->normal[0] - normal[0] ) < NORMAL_EPSILON
                && fabs( p->normal[1] - normal[1] ) < NORMAL_EPSILON
@@ -108,14 +107,6 @@ qboolean    PlaneEqual( plane_t *p, vec3_t normal, vec_t dist ){
                && fabs( p->dist - dist ) < DIST_EPSILON ) {
                return true;
        }
-#else
-       if ( p->normal[0] == normal[0]
-                && p->normal[1] == normal[1]
-                && p->normal[2] == normal[2]
-                && p->dist == dist ) {
-               return true;
-       }
-#endif
        return false;
 }
 
@@ -796,11 +787,6 @@ void MoveBrushesToWorld( entity_t *mapent ){
        temp = malloc( newbrushes * sizeof( mapbrush_t ) );
        memcpy( temp, mapbrushes + mapent->firstbrush, newbrushes * sizeof( mapbrush_t ) );
 
-#if 0       // let them keep their original brush numbers
-       for ( i = 0 ; i < newbrushes ; i++ )
-               temp[i].entitynum = 0;
-#endif
-
        // make space to move the brushes (overlapped copy)
        memmove( mapbrushes + worldbrushes + newbrushes,
                         mapbrushes + worldbrushes,
index 1e8b91c88ec566800a180704d5706bed708ef224..bcd2e9514285139c0848c810416e0df88389eaa8 100644 (file)
@@ -102,11 +102,6 @@ void CalcTextureReflectivity_Quake2( void ){
                        scale *= 2;
                        VectorScale( texture_reflectivity[i], scale, texture_reflectivity[i] );
                }
-#if 0
-               texture_reflectivity[i][0] = 0.5;
-               texture_reflectivity[i][1] = 0.5;
-               texture_reflectivity[i][2] = 0.5;
-#endif
        }
 }
 
index 1c83d75d48dd34f1528fef31dd49ebc110dbe74f..c7fae6045c69fe3e7485cb1547fa1c8a737baae8 100644 (file)
@@ -776,12 +776,6 @@ void FloodAreas_r( node_t *node ){
 
        for ( p = node->portals ; p ; p = p->next[s] )
        {
-               s = ( p->nodes[1] == node );
-#if 0
-               if ( p->nodes[!s]->occupied ) {
-                       continue;
-               }
-#endif
                if ( !Portal_EntityFlood( p, s ) ) {
                        continue;
                }
index af1edfa2c4a43fa56c7f900d0e460e659f06a944..00c933a13241048f7cde05fa527f07b3ecebbe7f 100644 (file)
@@ -203,15 +203,6 @@ qboolean _TestLine( vec3_t start, vec3_t stop ){
        while ( 1 )
        {
                if ( node == CONTENTS_SOLID ) {
-#if 0
-                       float d1, d2, d3;
-
-                       d1 = backx - frontx;
-                       d2 = backy - fronty;
-                       d3 = backz - frontz;
-
-                       if ( d1 * d1 + d2 * d2 + d3 * d3 > 1 )
-#endif
                        return false;       // DONE!
                }
 
index 0d3c6a480c371ff5aa09dd36e9a5cbf658c71aef..9a54e090cc65313e37c2cdc601b4d3ab40ac765c 100644 (file)
@@ -502,23 +502,10 @@ void BeginBSPFile( void ){
 void EndBSPFile( void ){
        char path[1024];
 
-#if 0
-       int len;
-       byte    *buf;
-#endif
-
        EmitBrushes();
        EmitPlanes();
        UnparseEntities();
 
-       // load the pop
-#if 0
-       sprintf( path, "%s/pics/pop.lmp", gamedir );
-       len = LoadFile( path, &buf );
-       memcpy( dpop, buf, sizeof( dpop ) );
-       free( buf );
-#endif
-
        // write the map
        sprintf( path, "%s.bsp", source );
        Sys_Printf( "Writing %s\n", path );
index 0fc06757bb5ea48d515887646b669d7c7ae36415..424d04a34782b774e664ff4229425ee8740d1f5d 100644 (file)
@@ -678,7 +678,6 @@ cblock_t LZSS( cblock_t in ){
        for ( i = 0 ; i < in.count ; )
        {
                val = in.data[i];
-#if 1
 // chained search
                bestlength = 0;
                beststart = 0;
@@ -703,36 +702,6 @@ cblock_t LZSS( cblock_t in ){
                        start = lzss_next[start];
                }
 
-#else
-// slow simple search
-               // search for a match
-               max = FRONT_WINDOW;
-               if ( i + max > in.count ) {
-                       max = in.count - i;
-               }
-
-               start = i - BACK_WINDOW;
-               if ( start < 0 ) {
-                       start = 0;
-               }
-               bestlength = 0;
-               beststart = 0;
-               for ( ; start < i ; start++ )
-               {
-                       if ( in.data[start] != val ) {
-                               continue;
-                       }
-                       // count match length
-                       for ( j = 0 ; j < max ; j++ )
-                               if ( in.data[start + j] != in.data[i + j] ) {
-                                       break;
-                               }
-                       if ( j > bestlength ) {
-                               bestlength = j;
-                               beststart = start;
-                       }
-               }
-#endif
                beststart = BACK_WINDOW - ( i - beststart );
 
                if ( bestlength < 3 ) { // output a single char
@@ -899,7 +868,6 @@ void Huffman1_Count( cblock_t in ){
                order0counts[v]++;
                hnodes1[prev][v].count++;
                prev = v;
-#if 1
                for ( rept = 1 ; i + rept < in.count && rept < MAX_REPT ; rept++ )
                        if ( in.data[i + rept] != v ) {
                                break;
@@ -908,7 +876,6 @@ void Huffman1_Count( cblock_t in ){
                        hnodes1[prev][255 + rept].count++;
                        i += rept - 1;
                }
-#endif
        }
 }
 
@@ -960,18 +927,6 @@ void Huffman1_Build( FILE *f ){
 
                BuildTree1( i );
        }
-
-#if 0
-       // count up the total bits
-       total = 0;
-       for ( i = 0 ; i < 256 ; i++ )
-               for ( j = 0 ; j < 256 ; j++ )
-                       total += charbitscount1[i][j] * hnodes1[i][j].count;
-
-       total = ( total + 7 ) / 8;
-       printf( "%i bytes huffman1 compressed\n", total );
-#endif
-
        fwrite( scaled, 1, sizeof( scaled ), f );
 }
 
@@ -1023,7 +978,6 @@ cblock_t Huffman1( cblock_t in ){
                }
 
                prev = v;
-#if 1
                // check for repeat encodes
                for ( rept = 1 ; i + rept < in.count && rept < MAX_REPT ; rept++ )
                        if ( in.data[i + rept] != v ) {
@@ -1045,7 +999,6 @@ cblock_t Huffman1( cblock_t in ){
                        }
                        i += rept - 1;
                }
-#endif
        }
 
        out_p += ( outbits + 7 ) >> 3;
@@ -1097,14 +1050,6 @@ cblock_t LoadFrame( char *base, int frame, int digits, byte **palette ){
        in.count = width * height;
 // FIXME: map 0 and 255!
 
-#if 0
-       // rle compress
-       rle = RLE( in );
-       free( in.data );
-
-       return rle;
-#endif
-
        return in;
 }
 
index 514a1c7b16fd02d9f527a3c41bc42d03f20a7f1f..21c1ef0d7e158e5b42c1dc33cdab97c6efd693b4 100644 (file)
@@ -322,21 +322,6 @@ double I_FloatTime( void ){
        time( &t );
 
        return t;
-#if 0
-// more precise, less portable
-       struct timeval tp;
-       struct timezone tzp;
-       static int secbase;
-
-       gettimeofday( &tp, &tzp );
-
-       if ( !secbase ) {
-               secbase = tp.tv_sec;
-               return tp.tv_usec / 1000000.0;
-       }
-
-       return ( tp.tv_sec - secbase ) + tp.tv_usec / 1000000.0;
-#endif
 }
 
 void Q_getwd( char *out ){
index 30ae39df7ee9026ae3cae5d94afff7083691c9de..ffef9e1086b6596fa3f3a1a8bed00b6eec2db477 100644 (file)
@@ -106,33 +106,6 @@ void xml_SendNode( xmlNodePtr node ){
                        pos += size;
                }
 
-#if 0
-               // NOTE: the NMSG_WriteString is limited to MAX_NETMESSAGE
-               // we will need to split into chunks
-               // (we could also go lower level, in the end it's using send and receiv which are not size limited)
-               //++timo FIXME: MAX_NETMESSAGE is not exactly the max size we can stick in the message
-               //  there's some tweaking to do in l_net for that .. so let's give us a margin for now
-
-               //++timo we need to handle the case of a buffer too big to fit in a single message
-               // try without checks for now
-               if ( xml_buf->use > MAX_NETMESSAGE - 10 ) {
-                       // if we send that we are probably gonna break the stream at the other end..
-                       // and Error will call right there
-                       //Error( "MAX_NETMESSAGE exceeded for XML feedback stream in FPrintf (%d)\n", xml_buf->use);
-                       Sys_FPrintf( SYS_NOXML, "MAX_NETMESSAGE exceeded for XML feedback stream in FPrintf (%d)\n", xml_buf->use );
-                       xml_buf->content[xml_buf->use] = '\0'; //++timo this corrupts the buffer but we don't care it's for printing
-                       Sys_FPrintf( SYS_NOXML, xml_buf->content );
-
-               }
-
-               size = xml_buf->use;
-               memcpy( xmlbuf, xml_buf->content, size );
-               xmlbuf[size] = '\0';
-               NMSG_Clear( &msg );
-               NMSG_WriteString( &msg, xmlbuf );
-               Net_Send( brdcst_socket, &msg );
-#endif
-
                xmlBufferFree( xml_buf );
        }
 }
index 847b80909b89d43e0603f709650616ebcb120c5e..aa7429ab51fdc4017ed79d057c1057ee1a0c840c 100644 (file)
@@ -31,9 +31,7 @@
 #include "token.h"
 #include "l3dslib.h"
 #include "fmodel.h"
-#if 1
 #include "qd_skeletons.h"
-#endif
 
 // on disk representation of a face
 #define FLOAT_START 99999.0
@@ -424,28 +422,12 @@ void HandleHRCModel( triangle_t **triList, int *triangleCount, mesh_node_t **nod
                                tList[i + start_tri].verts[2 - j][0] = vList[tk_IntNumber].v[0];
                                tList[i + start_tri].verts[2 - j][1] = vList[tk_IntNumber].v[1];
                                tList[i + start_tri].verts[2 - j][2] = vList[tk_IntNumber].v[2];
-#if 1
-                               tList[i + start_tri].indicies[2 - j] = tk_IntNumber + vertIndexBase;
-#endif
                                TK_BeyondRequire( TK_UVTEXTURE, TK_FLOATNUMBER );
                                tList[i + start_tri].uv[2 - j][0] = tk_FloatNumber;
                                TK_Fetch();
                                TK_Require( TK_FLOATNUMBER );
                                tList[i + start_tri].uv[2 - j][1] = tk_FloatNumber;
                        }
-
-                       /*              printf("Face %i:\n  v0: %f, %f, %f\n  v1: %f, %f, %f\n"
-                                   "  v2: %f, %f, %f\n", i,
-                                   tList[i].verts[0][0],
-                                   tList[i].verts[0][1],
-                                   tList[i].verts[0][2],
-                                   tList[i].verts[1][0],
-                                   tList[i].verts[1][1],
-                                   tList[i].verts[1][2],
-                                   tList[i].verts[2][0],
-                                   tList[i].verts[2][1],
-                                   tList[i].verts[2][2]);
-                        */
                }
 
                TK_Beyond( TK_RBRACE );
@@ -462,7 +444,6 @@ void HandleHRCModel( triangle_t **triList, int *triangleCount, mesh_node_t **nod
 
                // See if there are any other models belonging to this node
 
-#if 1
                TK_Fetch();
 
                nextToken = tk_Token;
@@ -490,7 +471,6 @@ void HandleHRCModel( triangle_t **triList, int *triangleCount, mesh_node_t **nod
                                meshNode->clustered = false;
                        }
                }
-#endif
 
                nextToken = tk_Token;
                if ( nextToken == TK_SPLINE ) {
@@ -903,7 +883,6 @@ static void LoadHTR( char *fileName, triangle_t **triList, int *triangleCount, m
                        tList[i].verts[2 - j][2] = vList[vertexNum].v[2];
                }
                TK_FetchRequire( TK_RPAREN );
-#if 1
                if ( Version2 ) {
                        TK_FetchRequire( TK_FLOATNUMBER );
                        tList[i].uv[2][0] = fmod( 1000 + tk_FloatNumber,1 );
@@ -922,19 +901,6 @@ static void LoadHTR( char *fileName, triangle_t **triList, int *triangleCount, m
                else{
                        tList[i].HasUV = 0;
                }
-#endif
-/*             printf("Face %i:\n  v0: %f, %f, %f\n  v1: %f, %f, %f\n"
-            "  v2: %f, %f, %f\n", i,
-            tList[i].verts[0][0],
-            tList[i].verts[0][1],
-            tList[i].verts[0][2],
-            tList[i].verts[1][0],
-            tList[i].verts[1][1],
-            tList[i].verts[1][2],
-            tList[i].verts[2][0],
-            tList[i].verts[2][1],
-            tList[i].verts[2][2]);
- */
        }
 
        free( vList );
index 1e3e82c16b31bea9d0d9758b2531a553d39d629a..87105c237d035e829143f920a44e87df144e8d77 100644 (file)
 typedef struct
 {
        vec3_t verts[3];
-#if 1
        int indicies[3];
        float uv[3][2];
        qboolean HasUV;
-#endif
 } triangle_t;
 
 #define NUM_CLUSTERS 8
index a3e06c0b9f29649f91c527accc3728f2767c02e6..ae9a88eec1ae68224d0ae9bb83bcfc339d4736d3 100644 (file)
@@ -2674,7 +2674,6 @@ void Cmd_FMSkin( void ){
                }
                else
                {
-       #if 1
                        miptex_t    *qtex;
                        qtex = CreateMip( cropped, fmheader.skinwidth, fmheader.skinheight, palette, &size, true );
 
@@ -2685,15 +2684,6 @@ void Cmd_FMSkin( void ){
                        CreatePath( savename );
                        SaveFile( savename, (byte *)qtex, size );
                        free( qtex );
-       #else
-                       strcat( g_skins[fmheader.num_skins - 1],".pcx" );
-                       strcat( savename,".pcx" );
-
-                       // save off the new image
-                       printf( "saving %s\n", savename );
-                       CreatePath( savename );
-                       WritePCXfile( savename, cropped, fmheader.skinwidth, fmheader.skinheight, palette );
-       #endif
                }
        }
        else
index 3b07715a8abeb2a7f3ab36d672ffd0131b595ce5..86abaf973fbeed431e8a296792c9ccada94f738a 100644 (file)
@@ -27,9 +27,7 @@
 
 #include <GL/gl.h>
 
-#if 1
 extern char     *g_outputDir;
-#endif // _QDATA
 
 char mip_prefix[1024];              // directory to dump the textures in
 
@@ -42,42 +40,6 @@ unsigned total_textures = 0;
 
 #define MAX_IMAGE_SIZE 512
 
-#if 0
-/*
-   ==============
-   RemapZero
-
-   Replaces all 0 bytes in an image with the closest palette entry.
-   This is because NT won't let us change index 0, so any palette
-   animation leaves those pixels untouched.
-   ==============
- */
-void RemapZero( byte *pixels, byte *palette, int width, int height ){
-       int i, c;
-       int alt_zero;
-       int value, best;
-
-       alt_zero = 0;
-       best = 9999999;
-       for ( i = 1 ; i < 255 ; i++ )
-       {
-               value = palette[i * 3 + 0] + palette[i * 3 + 1] + palette[i * 3 + 2];
-               if ( value < best ) {
-                       best = value;
-                       alt_zero = i;
-               }
-       }
-
-       c = width * height;
-       for ( i = 0 ; i < c ; i++ )
-               if ( pixels[i] == 0 ) {
-                       pixels[i] = alt_zero;
-               }
-}
-
-#endif
-
-
 // ********************************************************************
 // **  Mip Map Pre-Processing Routines
 // ********************************************************************
index 074734e9b9b672bdc6508f5456cb0341dc3c42ec..99e589104447ff6b071167c2c58d5d792b65dab6 100644 (file)
@@ -41,13 +41,11 @@ typedef struct Placement_s
        vec3_t up;
 } Placement_t;
 
-#if 1
 typedef struct QDataJoint_s
 {
        Placement_t placement;
        vec3_t rotation;
 } QDataJoint_t;
-#endif
 
 typedef struct ArrayedListNode_s
 {
index 223368172a1df0a62335ef051e9f4f754fea6589..639c7ab4c6d21772ed96a7e326f897eb05f288fe 100644 (file)
@@ -156,7 +156,6 @@ void H_printf( char *fmt, ... ){
        va_end( argptr );
 }
 
-#if 1
 /*
    ============
    WriteModelFile
@@ -392,126 +391,6 @@ void WriteJointedModelFile( FILE *modelouthandle ){
                }
        }
 }
-#else
-/*
-   ============
-   WriteModelFile
-   ============
- */
-static void WriteModelFile( FILE *modelouthandle ){
-       int i;
-       dmdl_t modeltemp;
-       int j, k;
-       frame_t         *in;
-       daliasframe_t   *out;
-       byte buffer[MAX_VERTS * 4 + 128];
-       float v;
-       int c_on, c_off;
-
-       model.ident = IDALIASHEADER;
-       model.version = ALIAS_VERSION;
-       model.framesize = (int)&( (daliasframe_t *)0 )->verts[model.num_xyz];
-       model.num_glcmds = numcommands;
-       model.ofs_skins = sizeof( dmdl_t );
-       model.ofs_st = model.ofs_skins + model.num_skins * MAX_SKINNAME;
-       model.ofs_tris = model.ofs_st + model.num_st * sizeof( dstvert_t );
-       model.ofs_frames = model.ofs_tris + model.num_tris * sizeof( dtriangle_t );
-       model.ofs_glcmds = model.ofs_frames + model.num_frames * model.framesize;
-       model.ofs_end = model.ofs_glcmds + model.num_glcmds * 4;
-
-       //
-       // write out the model header
-       //
-       for ( i = 0 ; i < sizeof( dmdl_t ) / 4 ; i++ )
-               ( (int *)&modeltemp )[i] = LittleLong( ( (int *)&model )[i] );
-
-       SafeWrite( modelouthandle, &modeltemp, sizeof( modeltemp ) );
-
-       //
-       // write out the skin names
-       //
-       SafeWrite( modelouthandle, g_skins, model.num_skins * MAX_SKINNAME );
-
-       //
-       // write out the texture coordinates
-       //
-       c_on = c_off = 0;
-       for ( i = 0 ; i < model.num_st ; i++ )
-       {
-               base_st[i].s = LittleShort( base_st[i].s );
-               base_st[i].t = LittleShort( base_st[i].t );
-       }
-
-       SafeWrite( modelouthandle, base_st, model.num_st * sizeof( base_st[0] ) );
-
-       //
-       // write out the triangles
-       //
-       for ( i = 0 ; i < model.num_tris ; i++ )
-       {
-               int j;
-               dtriangle_t tri;
-
-               for ( j = 0 ; j < 3 ; j++ )
-               {
-                       tri.index_xyz[j] = LittleShort( triangles[i].index_xyz[j] );
-                       tri.index_st[j] = LittleShort( triangles[i].index_st[j] );
-               }
-
-               SafeWrite( modelouthandle, &tri, sizeof( tri ) );
-       }
-
-       //
-       // write out the frames
-       //
-       for ( i = 0 ; i < model.num_frames ; i++ )
-       {
-               in = &g_frames[i];
-               out = (daliasframe_t *)buffer;
-
-               strcpy( out->name, in->name );
-               for ( j = 0 ; j < 3 ; j++ )
-               {
-                       out->scale[j] = ( in->maxs[j] - in->mins[j] ) / 255;
-                       out->translate[j] = in->mins[j];
-               }
-
-               for ( j = 0 ; j < model.num_xyz ; j++ )
-               {
-                       // all of these are byte values, so no need to deal with endianness
-                       out->verts[j].lightnormalindex = in->v[j].lightnormalindex;
-
-                       for ( k = 0 ; k < 3 ; k++ )
-                       {
-                               // scale to byte values & min/max check
-                               v = Q_rint( ( in->v[j].v[k] - out->translate[k] ) / out->scale[k] );
-
-                               // clamp, so rounding doesn't wrap from 255.6 to 0
-                               if ( v > 255.0 ) {
-                                       v = 255.0;
-                               }
-                               if ( v < 0 ) {
-                                       v = 0;
-                               }
-                               out->verts[j].v[k] = v;
-                       }
-               }
-
-               for ( j = 0 ; j < 3 ; j++ )
-               {
-                       out->scale[j] = LittleFloat( out->scale[j] );
-                       out->translate[j] = LittleFloat( out->translate[j] );
-               }
-
-               SafeWrite( modelouthandle, out, model.framesize );
-       }
-
-       //
-       // write out glcmds
-       //
-       SafeWrite( modelouthandle, commands, numcommands * 4 );
-}
-#endif
 
 /*
    ===============
@@ -560,12 +439,10 @@ void FinishModel( void ){
        CreatePath( name );
        modelouthandle = SafeOpenWrite( name );
 
-#if 1
        if ( jointed != NOT_JOINTED ) {
                WriteJointedModelFile( modelouthandle );
        }
        else
-#endif
        WriteModelFile( modelouthandle );
 
        printf( "%3dx%3d skin\n", model.skinwidth, model.skinheight );
@@ -886,106 +763,6 @@ static void BuildGlCmds( void ){
    ===============================================================
  */
 
-/*
-   ============
-   BuildST
-
-   Builds the triangle_st array for the base frame and
-   model.skinwidth / model.skinheight
-
-   FIXME: allow this to be loaded from a file for
-   arbitrary mappings
-   ============
- */
-#if 0
-static void OldBuildST( triangle_t *ptri, int numtri ){
-       int i, j;
-       int width, height, iwidth, iheight, swidth;
-       float basex, basey;
-       float s_scale, t_scale;
-       float scale;
-       vec3_t mins, maxs;
-       float       *pbasevert;
-       vec3_t vtemp1, vtemp2, normal;
-
-       //
-       // find bounds of all the verts on the base frame
-       //
-       ClearBounds( mins, maxs );
-
-       for ( i = 0 ; i < numtri ; i++ )
-               for ( j = 0 ; j < 3 ; j++ )
-                       AddPointToBounds( ptri[i].verts[j], mins, maxs );
-
-       for ( i = 0 ; i < 3 ; i++ )
-       {
-               mins[i] = floor( mins[i] );
-               maxs[i] = ceil( maxs[i] );
-       }
-
-       width = maxs[0] - mins[0];
-       height = maxs[2] - mins[2];
-
-       if ( !g_fixedwidth ) { // old style
-               scale = 8;
-               if ( width * scale >= 150 ) {
-                       scale = 150.0 / width;
-               }
-               if ( height * scale >= 190 ) {
-                       scale = 190.0 / height;
-               }
-
-               s_scale = t_scale = scale;
-
-               iwidth = ceil( width * s_scale );
-               iheight = ceil( height * t_scale );
-
-               iwidth += 4;
-               iheight += 4;
-       }
-       else
-       {   // new style
-               iwidth = g_fixedwidth / 2;
-               iheight = g_fixedheight;
-
-               s_scale = (float)( iwidth - 4 ) / width;
-               t_scale = (float)( iheight - 4 ) / height;
-       }
-
-//
-// determine which side of each triangle to map the texture to
-//
-       for ( i = 0 ; i < numtri ; i++ )
-       {
-               VectorSubtract( ptri[i].verts[0], ptri[i].verts[1], vtemp1 );
-               VectorSubtract( ptri[i].verts[2], ptri[i].verts[1], vtemp2 );
-               CrossProduct( vtemp1, vtemp2, normal );
-
-               if ( normal[1] > 0 ) {
-                       basex = iwidth + 2;
-               }
-               else
-               {
-                       basex = 2;
-               }
-               basey = 2;
-
-               for ( j = 0 ; j < 3 ; j++ )
-               {
-                       pbasevert = ptri[i].verts[j];
-
-                       triangle_st[i][j][0] = Q_rint( ( pbasevert[0] - mins[0] ) * s_scale + basex );
-                       triangle_st[i][j][1] = Q_rint( ( maxs[2] - pbasevert[2] ) * t_scale + basey );
-               }
-       }
-
-// make the width a multiple of 4; some hardware requires this, and it ensures
-// dword alignment for each scan
-       swidth = iwidth * 2;
-       model.skinwidth = ( swidth + 3 ) & ~3;
-       model.skinheight = iheight;
-}
-#endif
 
 //==========================================================================
 //
@@ -1187,10 +964,6 @@ void Cmd_Base( void ){
        vec3_t base_xyz[MAX_VERTS];
        triangle_t  *ptri;
        int i, j, k;
-#if 1
-#else
-       int time1;
-#endif
        char file1[1024];
        char file2[1024];
 
@@ -1201,26 +974,12 @@ void Cmd_Base( void ){
        }
 
        printf( "---------------------\n" );
-#if 1
        sprintf( file1, "%s/%s", cdpartial, token );
        printf( "%s  ", file1 );
 
        ExpandPathAndArchive( file1 );
 
        sprintf( file1, "%s/%s", cddir, token );
-#else
-       sprintf( file1, "%s/%s.%s", cdarchive, token, trifileext );
-       printf( "%s\n", file1 );
-
-       ExpandPathAndArchive( file1 );
-
-       sprintf( file1, "%s/%s.%s", cddir, token, trifileext );
-
-       time1 = FileTime( file1 );
-       if ( time1 == -1 ) {
-               Error( "%s doesn't exist", file1 );
-       }
-#endif
 //
 // load the base triangles
 //
@@ -1622,26 +1381,9 @@ void Cmd_Skin( void ){
                return;
        }
 
-#if 1
        sprintf( name, "%s/%s.pcx", cddir, token );
        sprintf( savename, "%s/!%s.pcx", g_outputDir, token );
        sprintf( g_skins[model.num_skins], "%s/!%s.pcx", cdpartial, token );
-#else
-       sprintf( name, "%s/%s.lbm", cdarchive, token );
-       strcpy( name, ExpandPathAndArchive( name ) );
-//     sprintf (name, "%s/%s.lbm", cddir, token);
-
-       if ( ScriptTokenAvailable() ) {
-               GetScriptToken( false );
-               sprintf( g_skins[model.num_skins], "%s.pcx", token );
-               sprintf( savename, "%s%s.pcx", g_outputDir, g_skins[model.num_skins] );
-       }
-       else
-       {
-               sprintf( savename, "%s/%s.pcx", g_outputDir, token );
-               sprintf( g_skins[model.num_skins], "%s/%s.pcx", cdpartial, token );
-       }
-#endif
 
        model.num_skins++;
 
index 2b5a40bb3612d77f1dec43728a59f8b2b05b4134..e8dbc4387b8ee1d18bb34b4aa77d8f40a2695d73 100644 (file)
@@ -89,14 +89,6 @@ H2COMMON_API void ResMngr_Con( ResourceManager_t *resource, size_t init_resSize,
 H2COMMON_API void ResMngr_Des( ResourceManager_t *resource ){
        ResMngr_Block_t *toDelete;
 
-#if 0
-       if ( resource->numResourcesAllocated ) {
-               char mess[100];
-               sprintf( mess,"Potential memory leak %d bytes unfreed\n",resource->resSize * resource->numResourcesAllocated );
-               OutputDebugString( mess );
-       }
-#endif
-
        while ( resource->blockList )
        {
                toDelete = resource->blockList;
index 4001078d5adc443c46355cb65ac1996417e5a056..f8c79cde52a50e2b9f3789d59871a3882b96a3d1 100644 (file)
@@ -85,84 +85,7 @@ static void LoadHRCClustered( char *fileName, int **clusterList, int *num_verts,
 //      mesh_node_t *nodesList;
        int num_mesh_nodes = 0, triangleCount = 0;
 
-#if 0
-       int i;
-       int j, numVerts;
-       char stripped[SKELETAL_NAME_MAX];
-
-       for ( i = 1; i < numJointsInSkeleton[skelType] + 1; ++i )
-       {
-               num_verts[i] = 0;
-       }
-
-       TK_OpenSource( fileName );
-       TK_FetchRequire( TK_HRCH );
-       TK_FetchRequire( TK_COLON );
-       TK_FetchRequire( TK_SOFTIMAGE );
-
-       TK_Beyond( TK_CLUSTERS );
-
-       while ( TK_Search( TK_CLUSTER_NAME ) != TK_EOF )
-       {
-               TK_Require( TK_STRING );
-
-               StripTrailingDigits( tk_String, stripped );
-
-               for ( i = 0; i < numJointsInSkeleton[skelType]; ++i )
-               {
-                       if ( stricmp( stripped, skeletonJointNames[skeletonNameOffsets[skelType] + i] ) == 0 ) {
-                               i = -i + numJointsInSkeleton[skelType] - 1;
-
-                               TK_BeyondRequire( TK_NUM_CLUSTER_VERTICES, TK_INTNUMBER );
-
-                               numVerts = tk_IntNumber;
-
-                               if ( !num_verts[i + 1] ) { // first set of verts for cluster
-                                       clusterList[i] = SafeMalloc( numVerts * sizeof( int ), "LoadHRCClustered" );
-                                       assert( clusterList[i] );
-                               }
-                               else                // any later sets of verts need to copy current
-                               {
-                                       int *temp;
-
-                                       temp = SafeMalloc( ( num_verts[i + 1] + numVerts ) * sizeof( int ), "LoadHRCClustered" );
-                                       assert( temp );
-
-                                       memcpy( temp + numVerts, clusterList[i], num_verts[i + 1] * sizeof( int ) );
-
-                                       free( clusterList[i] );
-
-                                       clusterList[i] = temp;
-                               }
-
-                               // currently this function is only called by LoadModelClusters.
-                               // Apparently the matching free has disappeared,
-                               // should probably be free at the end of FMCmd_Base
-
-                               TK_Beyond( TK_LBRACE );
-
-                               for ( j = 0; j < numVerts; ++j )
-                               {
-                                       TK_Require( TK_INTNUMBER );
-                                       clusterList[i][j] = tk_IntNumber;
-                                       TK_Fetch();
-                               }
-
-                               num_verts[i + 1] += numVerts;
-
-                               break;
-                       }
-               }
-       }
-
-       num_verts[0] = numJointsInSkeleton[skelType];
-#endif
-
-#if 1   // get the index number localized to the root
-//     for( i = 1; i < numJointsInSkeleton[skelType] + 1; ++i)
-//     {
-//             g_skelModel.num_verts[i] = 0;
-//     }
+// get the index number localized to the root
 
        TK_OpenSource( fileName );
        TK_FetchRequire( TK_HRCH );
@@ -186,7 +109,6 @@ static void LoadHRCClustered( char *fileName, int **clusterList, int *num_verts,
        free( triList );
 
        num_verts[0] = numJointsInSkeleton[skelType];
-#endif
 }
 
 void ReadHRCClusterList( mesh_node_t *meshNode, int baseIndex ){
@@ -473,70 +395,6 @@ static void LoadHRCJointList( char *fileName, QD_SkeletalJoint_t *jointList, int
 
        stackSize = currentStack;
 
-#if 0
-       // rotate the direction and up vectors to correspond to the rotation
-       for ( i = 0; i < numJointsInSkeleton[skelType]; ++i )
-       {
-               rx = jointList[i].rotation[0] * ANGLE_TO_RAD;
-               ry = jointList[i].rotation[1] * ANGLE_TO_RAD;
-               rz = jointList[i].rotation[2] * ANGLE_TO_RAD;
-
-               cx = cos( rx );
-               sx = sin( rx );
-
-               cy = cos( ry );
-               sy = sin( ry );
-
-               cz = cos( rz );
-               sz = sin( rz );
-
-               // y-axis rotation for direction
-               x2 = jointList[i].placement.direction[0] * cy + jointList[i].placement.direction[2] * sy;
-               z2 = -jointList[i].placement.direction[0] * sy + jointList[i].placement.direction[2] * cy;
-               jointList[i].placement.direction[0] = x2;
-               jointList[i].placement.direction[2] = z2;
-
-               // y-axis rotation for up
-               x2 = jointList[i].placement.up[0] * cy + jointList[i].placement.up[2] * sy;
-               z2 = -jointList[i].placement.up[0] * sy + jointList[i].placement.up[2] * cy;
-               jointList[i].placement.up[0] = x2;
-               jointList[i].placement.up[2] = z2;
-
-               // z-axis rotation for direction
-               x2 = jointList[i].placement.direction[0] * cz - jointList[i].placement.direction[1] * sz;
-               y2 = jointList[i].placement.direction[0] * sz + jointList[i].placement.direction[1] * cz;
-               jointList[i].placement.direction[0] = x2;
-               jointList[i].placement.direction[1] = y2;
-
-               // z-axis rotation for up
-               x2 = jointList[i].placement.up[0] * cz - jointList[i].placement.up[1] * sz;
-               y2 = jointList[i].placement.up[0] * sz + jointList[i].placement.up[1] * cz;
-               jointList[i].placement.up[0] = x2;
-               jointList[i].placement.up[1] = y2;
-
-               // x-axis rotation for direction vector
-               y2 = jointList[i].placement.direction[1] * cx - jointList[i].placement.direction[2] * sx;
-               z2 = jointList[i].placement.direction[1] * sx + jointList[i].placement.direction[2] * cx;
-               jointList[i].placement.direction[1] = y2;
-               jointList[i].placement.direction[2] = z2;
-
-               // x-axis rotation for up vector
-               y2 = jointList[i].placement.up[1] * cx - jointList[i].placement.up[2] * sx;
-               z2 = jointList[i].placement.up[1] * sx + jointList[i].placement.up[2] * cx;
-               jointList[i].placement.up[1] = y2;
-               jointList[i].placement.up[2] = z2;
-
-               // translate direction to a point in the model
-               jointList[i].placement.direction[0] += jointList[i].placement.origin[0];
-               jointList[i].placement.direction[1] += jointList[i].placement.origin[1];
-               jointList[i].placement.direction[2] += jointList[i].placement.origin[2];
-
-               // translate up to a point in the model
-               jointList[i].placement.up[0] += jointList[i].placement.origin[0];
-               jointList[i].placement.up[1] += jointList[i].placement.origin[1];
-               jointList[i].placement.up[2] += jointList[i].placement.origin[2];
-       }
-#endif
 
        for ( i = stackSize - 1; i >= 0; --i )
        {
@@ -553,7 +411,6 @@ static void LoadHRCJointList( char *fileName, QD_SkeletalJoint_t *jointList, int
                cz = cos( rz );
                sz = sin( rz );
 
-#if 1
                for ( j = i; j < stackSize; ++j )
                {
                        if ( curCorrespondingJoint[j] != -1 ) {
@@ -629,83 +486,6 @@ static void LoadHRCJointList( char *fileName, QD_SkeletalJoint_t *jointList, int
                                placement->up[2] += curTranslation[i][2];
                        }
                }
-#else
-               // This screwed up and needs to be sorted out!!!
-               // The stack info needs to be written too instead of the jointList for j > numJoints for Skeleton
-               for ( j = i - 1; j < stackSize - 1; ++j )
-               {
-                       // y-axis rotation for origin
-                       x2 = jointList[j].placement.origin[0] * cy + jointList[j].placement.origin[2] * sy;
-                       z2 = -jointList[j].placement.origin[0] * sy + jointList[j].placement.origin[2] * cy;
-                       jointList[j].placement.origin[0] = x2;
-                       jointList[j].placement.origin[2] = z2;
-
-                       // y-axis rotation for direction
-                       x2 = jointList[j].placement.direction[0] * cy + jointList[j].placement.direction[2] * sy;
-                       z2 = -jointList[j].placement.direction[0] * sy + jointList[j].placement.direction[2] * cy;
-                       jointList[j].placement.direction[0] = x2;
-                       jointList[j].placement.direction[2] = z2;
-
-                       // y-axis rotation for up
-                       x2 = jointList[j].placement.up[0] * cy + jointList[j].placement.up[2] * sy;
-                       z2 = -jointList[j].placement.up[0] * sy + jointList[j].placement.up[2] * cy;
-                       jointList[j].placement.up[0] = x2;
-                       jointList[j].placement.up[2] = z2;
-
-                       // z-axis rotation for origin
-                       x2 = jointList[j].placement.origin[0] * cz - jointList[j].placement.origin[1] * sz;
-                       y2 = jointList[j].placement.origin[0] * sz + jointList[j].placement.origin[1] * cz;
-                       jointList[j].placement.origin[0] = x2;
-                       jointList[j].placement.origin[1] = y2;
-
-                       // z-axis rotation for direction
-                       x2 = jointList[j].placement.direction[0] * cz - jointList[j].placement.direction[1] * sz;
-                       y2 = jointList[j].placement.direction[0] * sz + jointList[j].placement.direction[1] * cz;
-                       jointList[j].placement.direction[0] = x2;
-                       jointList[j].placement.direction[1] = y2;
-
-                       // z-axis rotation for up
-                       x2 = jointList[j].placement.up[0] * cz - jointList[j].placement.up[1] * sz;
-                       y2 = jointList[j].placement.up[0] * sz + jointList[j].placement.up[1] * cz;
-                       jointList[j].placement.up[0] = x2;
-                       jointList[j].placement.up[1] = y2;
-
-                       // x-axis rotation for origin
-                       y2 = jointList[j].placement.origin[1] * cx - jointList[j].placement.origin[2] * sx;
-                       z2 = jointList[j].placement.origin[1] * sx + jointList[j].placement.origin[2] * cx;
-                       jointList[j].placement.origin[1] = y2;
-                       jointList[j].placement.origin[2] = z2;
-
-                       // x-axis rotation for direction vector
-                       y2 = jointList[j].placement.direction[1] * cx - jointList[j].placement.direction[2] * sx;
-                       z2 = jointList[j].placement.direction[1] * sx + jointList[j].placement.direction[2] * cx;
-                       jointList[j].placement.direction[1] = y2;
-                       jointList[j].placement.direction[2] = z2;
-
-                       // x-axis rotation for up vector
-                       y2 = jointList[j].placement.up[1] * cx - jointList[j].placement.up[2] * sx;
-                       z2 = jointList[j].placement.up[1] * sx + jointList[j].placement.up[2] * cx;
-                       jointList[j].placement.up[1] = y2;
-                       jointList[j].placement.up[2] = z2;
-
-                       if ( curCorrespondingJoint[j + 1] != -1 ) {
-                               // translate origin
-                               jointList[j].placement.origin[0] += curTranslation[i - 1][0];
-                               jointList[j].placement.origin[1] += curTranslation[i - 1][1];
-                               jointList[j].placement.origin[2] += curTranslation[i - 1][2];
-
-                               // translate back to local coord
-                               jointList[j].placement.direction[0] += curTranslation[i - 1][0];
-                               jointList[j].placement.direction[1] += curTranslation[i - 1][1];
-                               jointList[j].placement.direction[2] += curTranslation[i - 1][2];
-
-                               // translate back to local coord
-                               jointList[j].placement.up[0] += curTranslation[i - 1][0];
-                               jointList[j].placement.up[1] += curTranslation[i - 1][1];
-                               jointList[j].placement.up[2] += curTranslation[i - 1][2];
-                       }
-               }
-#endif
        }
 }
 
index 63811395b22d0b6c35047c3b631c3c59966d2769..db0f00bd38c2243b2a1dda80dbd3a2a4ab78caf1 100644 (file)
@@ -289,7 +289,6 @@ void svbksb( double** u, double* w, double** v,int m, int n, double* b, double*
 #undef PYTHAG
 
 
-#if 1
 void DOsvd( float *a,float *res,float *comp,float *values,int nframes,int framesize,int compressedsize ){
        int usedfs;
        int *remap;
@@ -377,71 +376,6 @@ void DOsvd( float *a,float *res,float *comp,float *values,int nframes,int frames
        free( remap );
 }
 
-#else
-
-void DOsvd( float *a,float *res,float *comp,float *values,int nframes,int framesize,int compressedsize ){
-       int *remap;
-       int i,j;
-       int nrows;
-       nrows = nframes;
-       if ( nrows < framesize ) {
-               nrows = framesize;
-       }
-       double **da = allocMatrix( nrows,framesize );
-       double **v = allocMatrix( framesize,framesize );
-       double *w = allocVect( framesize );
-       float mx;
-       int bestat;
-
-       for ( j = 0; j < framesize; j++ )
-       {
-               for ( i = 0; i < nframes; i++ )
-                       da[j + 1][i + 1] = a[i * framesize + j];
-               for (; i < nrows; i++ )
-                       da[j + 1][i + 1] = 0.0;
-       }
-
-       svdcmp( da,nrows,framesize,w,v );
-
-       remap = new int[framesize];
-
-
-       for ( i = 0; i < framesize; i++ )
-               remap[i] = -1;
-       for ( j = 0; j < compressedsize; j++ )
-       {
-               mx = -1.0f;
-               for ( i = 0; i < framesize; i++ )
-               {
-                       if ( remap[i] < 0 && fabs( w[i + 1] ) > mx ) {
-                               mx = fabs( w[i + 1] );
-                               bestat = i;
-                       }
-               }
-               assert( mx > -.5f );
-               remap[bestat] = j;
-       }
-       // josh **DO NOT** put your dof>nframes mod here
-       for ( i = 0; i < framesize; i++ )
-       {
-               if ( remap[i] < 0 ) {
-                       w[i + 1] = 0.0;
-               }
-               else
-               {
-                       values[remap[i]] = w[i + 1];
-                       for ( j = 0; j < framesize; j++ )
-                               res[remap[i] * framesize + j] = v[j + 1][i + 1];
-               }
-       }
-       freeVect( w );
-       freeMatrix( v,framesize );
-       freeMatrix( da,nrows );
-       delete[] remap;
-}
-
-#endif
-
 void DOsvdPlane( float *pnts,int npnts,float *n,float *base ){
        int i,j;
        double **da = allocMatrix( npnts,3 );
index 8ebb5fe240c4b7b3fd6e1a0171e1ce422f89d8c7..10566df2b4e01e75c8787e5483d47f3445dbe118 100644 (file)
 // rle b4 huffing
 // adpcm encoding of sound
 
-#if 0
-#include "qdata.h"
-#include "flex.h"
-#include "fc.h"
-#include "adpcm.h"
-
-#define MIN_REPT    15
-#define MAX_REPT    0
-#define HUF_TOKENS  ( 256 + MAX_REPT )
-
-#define BLOCKSIZE   8
-
-#define M_PI        3.14159265358979323846  // matches value in gcc v2 math.h
-#define SQRT2       1.414213562
-
-typedef struct hnode_s
-{
-       int count;
-       qboolean used;
-       int children[2];
-} hnode_t;
-
-typedef struct
-{
-       int rate;
-       int width;
-       int channels;
-       int loopstart;
-       int samples;
-       int dataofs;                // chunk starts this many bytes from file start
-} wavinfo_t;
-
-// These weren`t picked out my ass....
-// They were defined at http://www.rahul.net/jfm/dct.html
-// However, I think he plucked them out of his ass.....
-
-float Quantise[BLOCKSIZE * BLOCKSIZE];
-
-float LUT_Quantise[BLOCKSIZE * BLOCKSIZE] =
-{
-       16.0F / 16.0F, 11.0F / 16.0F, 10.0F / 16.0F, 16.0F / 16.0F, 24.0F / 16.0F, 40.0F / 16.0F, 51.0F / 16.0F, 61.0F / 16.0F,
-       12.0F / 16.0F, 13.0F / 16.0F, 14.0F / 16.0F, 19.0F / 16.0F, 26.0F / 16.0F, 58.0F / 16.0F, 60.0F / 16.0F, 55.0F / 16.0F,
-       14.0F / 16.0F, 13.0F / 16.0F, 16.0F / 16.0F, 24.0F / 16.0F, 40.0F / 16.0F, 57.0F / 16.0F, 69.0F / 16.0F, 56.0F / 16.0F,
-       14.0F / 16.0F, 17.0F / 16.0F, 22.0F / 16.0F, 29.0F / 16.0F, 51.0F / 16.0F, 87.0F / 16.0F, 80.0F / 16.0F, 62.0F / 16.0F,
-       18.0F / 16.0F, 22.0F / 16.0F, 37.0F / 16.0F, 56.0F / 16.0F, 68.0F / 16.0F,109.0F / 16.0F,103.0F / 16.0F, 77.0F / 16.0F,
-       24.0F / 16.0F, 35.0F / 16.0F, 55.0F / 16.0F, 64.0F / 16.0F, 81.0F / 16.0F,104.0F / 16.0F,113.0F / 16.0F, 92.0F / 16.0F,
-       49.0F / 16.0F, 64.0F / 16.0F, 78.0F / 16.0F, 87.0F / 16.0F,103.0F / 16.0F,121.0F / 16.0F,120.0F / 16.0F,101.0F / 16.0F,
-       72.0F / 16.0F, 92.0F / 16.0F, 95.0F / 16.0F, 98.0F / 16.0F,112.0F / 16.0F,100.0F / 16.0F,103.0F / 16.0F, 99.0F / 16.0F
-};
-
-int LUT_ZZ[BLOCKSIZE * BLOCKSIZE] =
-{
-       0,
-       1,  8,
-       16,  9,  2,
-       3, 10, 17, 24,
-       32, 25, 18, 11,  4,
-       5, 12, 19, 26, 33, 40,
-       48, 41, 34, 27, 20, 13, 6,
-       7, 14, 21, 28, 35, 42, 49, 56,
-       57, 50, 43, 36, 29, 22, 15,
-       23, 30, 37, 44, 51, 58,
-       59, 52, 45, 38, 31,
-       39, 46, 53, 60,
-       61, 54, 47,
-       55, 62,
-       63
-};
-
-char base[32];
-
-byte            *soundtrack;
-
-byte scaled[256][HUF_TOKENS];
-unsigned int charbits1[256][HUF_TOKENS];
-int charbitscount1[256][HUF_TOKENS];
-hnode_t hnodes1[256][HUF_TOKENS * 2];
-int numhnodes1[256];
-int order0counts[256];
-int numhnodes;
-hnode_t hnodes[512];
-unsigned charbits[256];
-int charbitscount[256];
-
-CineHead_t cinehead;
-
-byte            *data_p;
-byte            *iff_end;
-byte            *last_chunk;
-byte            *iff_data;
-int iff_chunk_len;
-
-float dctbase[BLOCKSIZE][BLOCKSIZE];
-float red[BLOCKSIZE * BLOCKSIZE];
-float green[BLOCKSIZE * BLOCKSIZE];
-float blue[BLOCKSIZE * BLOCKSIZE];
-float temp[BLOCKSIZE * BLOCKSIZE];
-
-wavinfo_t wavinfo;
-adpcm_t adpcm;
-
-/*
-   ===============================================================================
-
-   WAV loading
-
-   ===============================================================================
- */
-
-/* Intel ADPCM step variation table */
-static int indexTable[16] =
-{
-       -1, -1, -1, -1, 2, 4, 6, 8,
-       -1, -1, -1, -1, 2, 4, 6, 8,
-};
-
-static int stepsizeTable[89] =
-{
-       7, 8, 9, 10, 11, 12, 13, 14, 16, 17,
-       19, 21, 23, 25, 28, 31, 34, 37, 41, 45,
-       50, 55, 60, 66, 73, 80, 88, 97, 107, 118,
-       130, 143, 157, 173, 190, 209, 230, 253, 279, 307,
-       337, 371, 408, 449, 494, 544, 598, 658, 724, 796,
-       876, 963, 1060, 1166, 1282, 1411, 1552, 1707, 1878, 2066,
-       2272, 2499, 2749, 3024, 3327, 3660, 4026, 4428, 4871, 5358,
-       5894, 6484, 7132, 7845, 8630, 9493, 10442, 11487, 12635, 13899,
-       15289, 16818, 18500, 20350, 22385, 24623, 27086, 29794, 32767
-};
-
-#if 0
-static void adpcm_decoder( char *indata, short *outdata, int len, adpcm_state_t *state ){
-       signed char *inp;       /* Input buffer pointer */
-       short *outp;        /* output buffer pointer */
-       int sign;           /* Current adpcm sign bit */
-       int delta;          /* Current adpcm output value */
-       int step;           /* Stepsize */
-       int valpred;        /* Predicted value */
-       int vpdiff;         /* Current change to valpred */
-       int index;          /* Current step change index */
-       int inputbuffer;        /* place to keep next 4-bit value */
-       int bufferstep;     /* toggle between inputbuffer/input */
-
-       outp = outdata;
-       inp = (signed char *)indata;
-
-       valpred = state->valprev;
-       index = state->index;
-       step = stepsizeTable[index];
-
-       bufferstep = 0;
-
-       for (; len > 0; len-- )
-       {
-               /* Step 1 - get the delta value */
-               if ( bufferstep ) {
-                       delta = inputbuffer & 0xf;
-               }
-               else
-               {
-                       inputbuffer = *inp++;
-                       delta = ( inputbuffer >> 4 ) & 0xf;
-               }
-               bufferstep = !bufferstep;
-
-               /* Step 2 - Find new index value (for later) */
-               index += indexTable[delta];
-               if ( index < 0 ) {
-                       index = 0;
-               }
-               if ( index > 88 ) {
-                       index = 88;
-               }
-
-               /* Step 3 - Separate sign and magnitude */
-               sign = delta & 8;
-               delta = delta & 7;
-
-               /* Step 4 - Compute difference and new predicted value */
-               /*
-               ** Computes 'vpdiff = (delta+0.5)*step/4', but see comment
-               ** in adpcm_coder.
-               */
-               vpdiff = step >> 3;
-               if ( delta & 4 ) {
-                       vpdiff += step;
-               }
-               if ( delta & 2 ) {
-                       vpdiff += step >> 1;
-               }
-               if ( delta & 1 ) {
-                       vpdiff += step >> 2;
-               }
-
-               if ( sign ) {
-                       valpred -= vpdiff;
-               }
-               else{
-                       valpred += vpdiff;
-               }
-
-               /* Step 5 - clamp output value */
-               if ( valpred > 32767 ) {
-                       valpred = 32767;
-               }
-               else if ( valpred < -32768 ) {
-                       valpred = -32768;
-               }
-
-               /* Step 6 - Update step value */
-               step = stepsizeTable[index];
-
-               /* Step 7 - Output value */
-               *outp++ = valpred;
-       }
-
-       state->valprev = valpred;
-       state->index = index;
-}
-#endif
-
-void adpcm_coder( short *inp, adpcm_t *adpcm ){
-       int val;                        /* Current input sample value */
-       int sign;                       /* Current adpcm sign bit */
-       int delta;                      /* Current adpcm output value */
-       int diff;                       /* Difference between val and valprev */
-       int step;                       /* Stepsize */
-       int valpred;                    /* Predicted output value */
-       int vpdiff;                     /* Current change to valpred */
-       int index;                      /* Current step change index */
-       int outputbuffer;               /* place to keep previous 4-bit value */
-       int bufferstep;                 /* toggle between outputbuffer/output */
-       adpcm_state_t   *state;
-       char            *outp;
-       int len;
-
-       state = &adpcm->state;
-       len = state->count;
-       outp = adpcm->adpcm;
-
-       valpred = state->in_valprev;
-       index = state->in_index;
-       step = stepsizeTable[index];
-
-       bufferstep = 1;
-       while ( len-- )
-       {
-               val = *inp++;
-
-               /* Step 1 - compute difference with previous value */
-               diff = val - valpred;
-               sign = ( diff < 0 ) ? 8 : 0;
-               if ( sign ) {
-                       diff = -diff;
-               }
-
-               /* Step 2 - Divide and clamp */
-               /* Note:
-               ** This code *approximately* computes:
-               **        delta = diff*4/step;
-               **        vpdiff = (delta+0.5)*step/4;
-               ** but in shift step bits are dropped. The net result of this is
-               ** that even if you have fast mul/div hardware you cannot put it to
-               ** good use since the fixup would be too expensive.
-               */
-               delta = 0;
-               vpdiff = ( step >> 3 );
-
-               if ( diff >= step ) {
-                       delta = 4;
-                       diff -= step;
-                       vpdiff += step;
-               }
-               step >>= 1;
-               if ( diff >= step ) {
-                       delta |= 2;
-                       diff -= step;
-                       vpdiff += step;
-               }
-               step >>= 1;
-               if ( diff >= step ) {
-                       delta |= 1;
-                       vpdiff += step;
-               }
-
-               /* Step 3 - Update previous value */
-               if ( sign ) {
-                       valpred -= vpdiff;
-               }
-               else{
-                       valpred += vpdiff;
-               }
-
-               /* Step 4 - Clamp previous value to 16 bits */
-               if ( valpred > 32767 ) {
-                       valpred = 32767;
-               }
-               else if ( valpred < -32768 ) {
-                       valpred = -32768;
-               }
-
-               /* Step 5 - Assemble value, update index and step values */
-               delta |= sign;
-
-               index += indexTable[delta];
-               if ( index < 0 ) {
-                       index = 0;
-               }
-               if ( index > 88 ) {
-                       index = 88;
-               }
-               step = stepsizeTable[index];
-
-               /* Step 6 - Output value */
-               if ( bufferstep ) {
-                       outputbuffer = ( delta << 4 ) & 0xf0;
-               }
-               else{
-                       *outp++ = ( delta & 0x0f ) | outputbuffer;
-               }
-
-               bufferstep = !bufferstep;
-       }
-
-       /* Output last step, if needed */
-       if ( !bufferstep ) {
-               *outp++ = outputbuffer;
-       }
-
-       state->out_valprev = valpred;
-       state->out_index = index;
-}
-
-void FindNextChunk( char *name ){
-       while ( 1 )
-       {
-               data_p = last_chunk;
-
-               if ( data_p >= iff_end ) {         // didn't find the chunk
-                       data_p = NULL;
-                       return;
-               }
-
-               data_p += 4;
-               iff_chunk_len = *(long *)data_p;
-               data_p += 4;
-               if ( iff_chunk_len < 0 ) {
-                       data_p = NULL;
-                       return;
-               }
-
-               data_p -= 8;
-               last_chunk = data_p + 8 + ( ( iff_chunk_len + 1 ) & ~1 );
-               if ( !strncmp( data_p, name, 4 ) ) {
-                       return;
-               }
-       }
-}
-
-void FindChunk( char *name ){
-       last_chunk = iff_data;
-       FindNextChunk( name );
-}
-
-void DumpChunks( void ){
-       char str[5];
-
-       str[4] = 0;
-       data_p = iff_data;
-       do
-       {
-               memcpy( str, data_p, 4 );
-               data_p += 4;
-               iff_chunk_len = *(long *)data_p;
-               data_p += 4;
-               printf( "0x%x : %s (%d)\n", (int)( data_p - 4 ), str, iff_chunk_len );
-               data_p += ( iff_chunk_len + 1 ) & ~1;
-       }
-       while ( data_p < iff_end );
-}
-
-/*
-   ============
-   GetWavinfo
-   ============
- */
-wavinfo_t GetWavinfo( char *name, byte *wav, int wavlength ){
-       wavinfo_t info;
-       int i;
-       int format;
-       int samples;
-
-       memset( &info, 0, sizeof( info ) );
-
-       if ( !wav ) {
-               return( info );
-       }
-
-       iff_data = wav;
-       iff_end = wav + wavlength;
-
-// find "RIFF" chunk
-       FindChunk( "RIFF" );
-       if ( !( data_p && !strncmp( data_p + 8, "WAVE", 4 ) ) ) {
-               printf( "Missing RIFF/WAVE chunks\n" );
-               return( info );
-       }
-
-// get "fmt " chunk
-       iff_data = data_p + 12;
-
-       FindChunk( "fmt " );
-       if ( !data_p ) {
-               printf( "Missing fmt chunk\n" );
-               return( info );
-       }
-       data_p += 8;
-       format = *(short *)data_p;
-       data_p += 2;
-       if ( format != 1 ) {
-               printf( "Microsoft PCM format only\n" );
-               return( info );
-       }
-
-       info.channels = *(short *)data_p;
-       data_p += 2;
-       info.rate = *(long *)data_p;
-       data_p += 4;
-       data_p += 6;
-       info.width = *(short *)data_p / 8;
-       data_p += 2;
-
-// get cue chunk
-       FindChunk( "cue " );
-       if ( data_p ) {
-               data_p += 32;
-               info.loopstart = *(long *)data_p;
-               data_p += 4;
-
-// if the next chunk is a LIST chunk, look for a cue length marker
-               FindNextChunk( "LIST" );
-               if ( data_p ) {
-// this is not a proper parse, but it works with cooledit...
-                       if ( !strncmp( data_p + 28, "mark", 4 ) ) {
-                               data_p += 24;
-                               i = *(long *)data_p;                    // samples in loop
-                               data_p += 4;
-                               info.samples = info.loopstart + i;
-                       }
-               }
-       }
-       else{
-               info.loopstart = -1;
-       }
-
-// find data chunk
-       FindChunk( "data" );
-       if ( !data_p ) {
-               printf( "Missing data chunk\n" );
-               return( info );
-       }
-
-       data_p += 4;
-       samples = *(long *)data_p;
-       data_p += 4;
-
-       if ( info.samples ) {
-               if ( samples < info.samples ) {
-                       Error( "Sound %s has a bad loop length", name );
-               }
-       }
-       else{
-               info.samples = samples;
-       }
-
-       info.dataofs = data_p - wav;
-       return( info );
-}
-
-// ==============
-// LoadSoundtrack
-// ==============
-
-void LoadSoundtrack(){
-       char name[1024];
-       FILE    *f;
-       int len;
-
-       soundtrack = NULL;
-       sprintf( name, "%svideo/%s/%s.wav", gamedir, base, base );
-       printf( "\nLoading sound    : %s\n", name );
-       f = fopen( name, "rb" );
-       if ( !f ) {
-               printf( "\nNo soundtrack for %s\n", base );
-               return;
-       }
-       len = Q_filelength( f );
-       soundtrack = SafeMalloc( len, "LoadSoundtrack" );
-       fread( soundtrack, 1, len, f );
-       fclose( f );
-
-       wavinfo = GetWavinfo( name, soundtrack, len );
-       adpcm.state.out_valprev = 0;
-       adpcm.state.out_index = 0;
-}
-
-// ==================
-// WriteSound
-// ==================
-
-int WriteSound( FILE *output, int frame, int numframes ){
-       int start, end;
-       int count;
-       int empty = 0;
-       int width;
-       char    *work;
-
-       width = wavinfo.width * wavinfo.channels;
-       start = ( ( frame * wavinfo.rate / 14 ) + 31 ) & 0xffffffe0;                // start sample
-       end = ( ( ( frame + numframes ) * wavinfo.rate / 14 ) + 31 ) & 0xffffffe0;    // end sample
-       count = end - start;
-
-       work = soundtrack + wavinfo.dataofs + ( start * width );
-       adpcm.state.count = count * wavinfo.channels;           // Number of samples
-       adpcm.state.in_valprev = adpcm.state.out_valprev;
-       adpcm.state.in_index = adpcm.state.out_index;
-       adpcm_coder( (short *)work, &adpcm );
-       WriteHeader( output, FC_SOUND_22KMADPCM, FC_ADPCM_VERSION, ( adpcm.state.count / 2 ) + sizeof( adpcm_state_t ), (char *)&adpcm );
-       return( count / 2 );
-}
-// ==============================
-// Basic run length encoder
-// ==============================
-
-char *RLEZZ( char *in, char *out ){
-       int srun;
-       char count;
-       int idx = 0;
-
-       while ( idx < 64 )
-       {
-               srun = idx;                             // Start of run
-
-               while ( idx < 63 )
-               {
-                       if ( in[LUT_ZZ[idx]] != in[LUT_ZZ[idx + 1]] ) {
-                               break;
-                       }
-                       idx++;
-               }
-               count = (char)( idx - srun );             // count of repeated bytes
-
-               if ( !count ) {
-                       while ( idx < 63 )
-                       {
-                               if ( in[LUT_ZZ[idx]] == in[LUT_ZZ[idx + 1]] ) {
-                                       break;
-                               }
-                               idx++;
-                       }
-                       if ( idx == 63 ) {
-                               idx++;
-                       }
-
-                       count = (char)( idx - srun );         // count of unique bytes
-                       *out++ = count;
-                       while ( count-- )
-                               *out++ = in[LUT_ZZ[srun++]];
-               }
-               else
-               {
-                       *out++ = -( count + 1 );
-                       *out++ = in[LUT_ZZ[idx]];
-                       idx++;
-               }
-       }
-       return( out );
-}
-
-// ==============================
-// Discrete Cosine Transformation
-// ==============================
-
-void init_base( float quant ){
-       int y, x;
-
-       for ( y = 0; y < BLOCKSIZE; y++ )
-               for ( x = 0; x < BLOCKSIZE; x++ )
-               {
-                       if ( y == 0 ) {
-                               dctbase[y][x] = 1;
-                       }
-                       else{
-                               dctbase[y][x] = SQRT2 * cos( ( ( x * 2 + 1 ) * y * M_PI ) / ( BLOCKSIZE * 2 ) );
-                       }
-               }
-
-       for ( y = 0; y < BLOCKSIZE * BLOCKSIZE; y++ )
-               Quantise[y] = LUT_Quantise[y] / quant;
-}
-
-void SplitComponents( byte *src, int width, int height ){
-       int i, j;
-       float   *tr = red;
-       float   *tg = green;
-       float   *tb = blue;
-
-       for ( i = 0; i < BLOCKSIZE; i++, src += ( width - BLOCKSIZE ) * 4 )
-               for ( j = 0; j < BLOCKSIZE; j++ )
-               {
-                       *tr++ = ( (float)*src++ ) - 128.0F;
-                       *tg++ = ( (float)*src++ ) - 128.0F;
-                       *tb++ = ( (float)*src++ ) - 128.0F;
-                       src++;
-               }
-}
-
-void transferH( float *src, float *dst ){
-       int y, dx, dy;
-       float sum;
-       float   *work;
-
-       for ( y = 0; y < BLOCKSIZE; y++, src += BLOCKSIZE )
-       {
-               for ( dy = 0; dy < BLOCKSIZE; dy++ )
-               {
-                       sum = 0;
-                       work = src;
-                       for ( dx = 0; dx < BLOCKSIZE; dx++, work++ )
-                               sum += dctbase[dy][dx] * *work;
-
-                       *dst++ = sum / BLOCKSIZE;
-               }
-       }
-}
-
-void transferV( float *src, float *dst ){
-       int x, dy, fy;
-       float sum;
-       float   *work;
-
-       for ( x = 0; x < BLOCKSIZE; x++, src++, dst++ )
-       {
-               for ( fy = 0; fy < BLOCKSIZE; fy++ )
-               {
-                       sum = 0;
-                       work = src;
-                       for ( dy = 0; dy < BLOCKSIZE; dy++, work += BLOCKSIZE )
-                               sum += dctbase[fy][dy] * *work;
-
-                       dst[fy * BLOCKSIZE] = sum / BLOCKSIZE;
-               }
-       }
-}
-
-char *Combine( byte *dst, float *p, float *q ){
-       int i, j;
-       byte rlesrc[BLOCKSIZE * BLOCKSIZE];
-       int c;
-       byte    *work;
-
-       work = rlesrc;
-       for ( j = 0; j < BLOCKSIZE; j++ )
-               for ( i = 0; i < BLOCKSIZE; i++ )
-               {
-                       c = (int)( ( *p++ / *q++ ) + 128.5F );
-                       c -= 128;
-
-                       if ( c < -128 ) {
-                               c = -128;
-                       }
-                       if ( c > 127 ) {
-                               c = 127;
-                       }
-
-                       *work++ = (char)c;
-               }
-
-       dst = RLEZZ( rlesrc, dst );
-       return( dst );
-}
-
-char *CombineComponents( char *dst, int width, int height ){
-       dst = Combine( dst, red, Quantise );
-       dst = Combine( dst, green, Quantise );
-       dst = Combine( dst, blue, Quantise );
-       return( dst );
-}
-
-void DCT( cblock_t *out, cblock_t in, int width, int height ){
-       int x, y;
-       char    *cursrc;
-       char    *curdst;
-
-       curdst = out->data;
-       for ( y = 0; y < height; y += BLOCKSIZE )
-               for ( x = 0; x < width; x += BLOCKSIZE )
-               {
-                       cursrc = in.data + ( ( y * width ) + x ) * 4;
-                       SplitComponents( cursrc, width, height );
-                       transferH( red, temp );
-                       transferV( temp, red );
-                       transferH( green, temp );
-                       transferV( temp, green );
-                       transferH( blue, temp );
-                       transferV( temp, blue );
-                       curdst = CombineComponents( curdst, width, height );
-               }
-       out->count = curdst - out->data;
-}
-
-// ==================
-// BuildChars1
-// ==================
-
-void BuildChars1( int prev, int nodenum, unsigned bits, int bitcount ){
-       hnode_t     *node;
-
-       if ( nodenum < HUF_TOKENS ) {
-               if ( bitcount > 32 ) {
-                       Error( "bitcount > 32" );
-               }
-               charbits1[prev][nodenum] = bits;
-               charbitscount1[prev][nodenum] = bitcount;
-               return;
-       }
-
-       node = &hnodes1[prev][nodenum];
-       bits <<= 1;
-       BuildChars1( prev, node->children[0], bits, bitcount + 1 );
-       bits |= 1;
-       BuildChars1( prev, node->children[1], bits, bitcount + 1 );
-}
-
-// ==================
-// SmallestNode1
-// ==================
-
-int SmallestNode1( hnode_t *hnodes, int numhnodes ){
-       int i;
-       int best, bestnode;
-
-       best = 99999999;
-       bestnode = -1;
-       for ( i = 0; i < numhnodes; i++ )
-       {
-               if ( hnodes[i].used ) {
-                       continue;
-               }
-               if ( !hnodes[i].count ) {
-                       continue;
-               }
-               if ( hnodes[i].count < best ) {
-                       best = hnodes[i].count;
-                       bestnode = i;
-               }
-       }
-
-       if ( bestnode == -1 ) {
-               return( -1 );
-       }
-
-       hnodes[bestnode].used = true;
-       return( bestnode );
-}
-
-// ==================
-// BuildTree1
-// ==================
-
-void BuildTree1( int prev ){
-       hnode_t     *node, *nodebase;
-       int numhnodes;
-
-       // build the nodes
-       numhnodes = HUF_TOKENS;
-       nodebase = hnodes1[prev];
-       while ( 1 )
-       {
-               node = &nodebase[numhnodes];
-
-               // pick two lowest counts
-               node->children[0] = SmallestNode1( nodebase, numhnodes );
-               if ( node->children[0] == -1 ) {
-                       break;  // no more
-
-               }
-               node->children[1] = SmallestNode1( nodebase, numhnodes );
-               if ( node->children[1] == -1 ) {
-                       break;
-               }
-
-               node->count = nodebase[node->children[0]].count +
-                                         nodebase[node->children[1]].count;
-               numhnodes++;
-       }
-       numhnodes1[prev] = numhnodes - 1;
-       BuildChars1( prev, numhnodes - 1, 0, 0 );
-}
-
-// ==================
-// Huffman1_Count
-// ==================
-
-void Huffman1_Count( cblock_t in ){
-       int i;
-       int prev;
-       int v;
-       int rept;
-
-       prev = 0;
-       for ( i = 0; i < in.count; i++ )
-       {
-               v = in.data[i];
-               order0counts[v]++;
-               hnodes1[prev][v].count++;
-               prev = v;
-
-               for ( rept = 1; ( i + rept < in.count ) && ( rept < MAX_REPT ); rept++ )
-                       if ( in.data[i + rept] != v ) {
-                               break;
-                       }
-               if ( rept > MIN_REPT ) {
-                       hnodes1[prev][255 + rept].count++;
-                       i += rept - 1;
-               }
-       }
-}
-
-// ==================
-// Huffman1_Build
-// ==================
-
-void Huffman1_Build(){
-       int i, j, v;
-       int max;
-       int total;
-
-       for ( i = 0; i < 256; i++ )
-       {
-// normalize and save the counts
-               max = 0;
-               for ( j = 0; j < HUF_TOKENS; j++ )
-               {
-                       if ( hnodes1[i][j].count > max ) {
-                               max = hnodes1[i][j].count;
-                       }
-               }
-               if ( max == 0 ) {
-                       max = 1;
-               }
-               total = 0;
-// easy to overflow 32 bits here!
-               for ( j = 0; j < HUF_TOKENS; j++ )
-               {
-                       v = ( hnodes1[i][j].count * (double) 255 + max - 1 ) / max;
-                       if ( v > 255 ) {
-                               Error( "v > 255" );
-                       }
-                       scaled[i][j] = hnodes1[i][j].count = v;
-                       if ( v ) {
-                               total++;
-                       }
-               }
-               if ( total == 1 ) { // must have two tokens
-                       if ( !scaled[i][0] ) {
-                               scaled[i][0] = hnodes1[i][0].count = 1;
-                       }
-                       else{
-                               scaled[i][1] = hnodes1[i][1].count = 1;
-                       }
-               }
-               BuildTree1( i );
-       }
-}
-
-// ==================
-// Huffman1
-// Order 1 compression with pre-built table
-// ==================
-
-cblock_t Huffman1( cblock_t in ){
-       int i;
-       int outbits, c;
-       unsigned bits;
-       byte        *out_p;
-       cblock_t out;
-       int prev;
-       int v;
-       int rept;
-
-       out_p = out.data = SafeMalloc( ( in.count * 2 ) + 1024 + 4, "Huffman" );
-       memset( out_p, 0, ( in.count * 2 ) + 1024 + 4 );
-
-       // leave space for compressed count
-       out_p += 4;
-       // write count
-       *(long *)out_p = in.count;
-       out_p += 4;
-
-       // write bits
-       outbits = 0;
-       prev = 0;
-       for ( i = 0; i < in.count; i++ )
-       {
-               v = in.data[i];
-
-               c = charbitscount1[prev][v];
-               bits = charbits1[prev][v];
-               if ( !c ) {
-                       Error( "!bits" );
-               }
-               while ( c )
-               {
-                       c--;
-                       if ( bits & ( 1 << c ) ) {
-                               out_p[outbits >> 3] |= 1 << ( outbits & 7 );
-                       }
-                       outbits++;
-               }
-
-               prev = v;
-               // check for repeat encodes
-               for ( rept = 1; ( i + rept < in.count ) && ( rept < MAX_REPT ); rept++ )
-                       if ( in.data[i + rept] != v ) {
-                               break;
-                       }
-               if ( rept > MIN_REPT ) {
-                       c = charbitscount1[prev][255 + rept];
-                       bits = charbits1[prev][255 + rept];
-                       if ( !c ) {
-                               Error( "!bits" );
-                       }
-                       while ( c )
-                       {
-                               c--;
-                               if ( bits & ( 1 << c ) ) {
-                                       out_p[outbits >> 3] |= 1 << ( outbits & 7 );
-                               }
-                               outbits++;
-                       }
-                       i += rept - 1;
-               }
-       }
-       out_p += ( outbits + 7 ) >> 3;
-       out.count = out_p - out.data;
-
-       out_p = out.data;
-       *(long *)out_p = out.count;
-       return( out );
-}
-// ===================
-// LoadFrame
-// ===================
-
-void LoadFrame( cblock_t *out, char *base, int frame ){
-       cblock_t in;
-       int width, height;
-       char name[1024];
-       FILE        *f;
-
-       in.data = NULL;
-       in.count = -1;
-       sprintf( name, "%svideo/%s/%s%04i.tga", gamedir, base, base, frame );
-
-       f = fopen( name, "rb" );
-       if ( !f ) {
-               out->data = NULL;
-               return;
-       }
-       fclose( f );
-
-       LoadTGA( name, &in.data, &width, &height );
-       if ( ( width != cinehead.Width ) || ( height != cinehead.Height ) ) {
-               free( in.data );
-               printf( "Invalid picture size\n" );
-               out->data = NULL;
-               return;
-       }
-       out->data = SafeMalloc( width * height * 3, "LoadFrame" );        // rle could possibly expand file so this not 100% safe (however DCT should force a lot of compression)
-       DCT( out, in, width, height );
-       free( in.data );
-}
-
-// ==================================
-// Cmd_Video
-//
-// video <directory> <framedigits>
-// ==================================
-
-void Cmd_Video(){
-       char savename[256];
-       char name[256];
-       FILE        *output;
-       int frame;
-       int width, height;
-       cblock_t in, huffman;
-       int size;
-       float dctconst;
-       int maxsize, ssize;
-       int min_rle_size, warnings;
-       int ave_image, ave_sound;
-
-       GetScriptToken( false );
-       strcpy( base, token );
-       if ( g_release ) {
-               return;
-       }
-
-       GetScriptToken( false );
-       dctconst = atof( token );
-       GetScriptToken( false );
-       maxsize = atoi( token );
-
-       sprintf( savename, "%svideo/%s.cin", gamedir, base );
-
-       // clear stuff
-       memset( charbits1, 0, sizeof( charbits1 ) );
-       memset( charbitscount1, 0, sizeof( charbitscount1 ) );
-       memset( hnodes1, 0, sizeof( hnodes1 ) );
-       memset( numhnodes1, 0, sizeof( numhnodes1 ) );
-       memset( order0counts, 0, sizeof( order0counts ) );
-
-       // load the entire sound wav file if present
-       LoadSoundtrack();
-
-       cinehead.SndRate = wavinfo.rate;
-       cinehead.SndWidth = wavinfo.width;
-       cinehead.SndChannels = wavinfo.channels;
-
-       sprintf( name, "%svideo/%s/%s0000.tga", gamedir, base, base );
-       printf( "Loading sequence : %s\n", name );
-       printf( "DCT constant     : %f\n", dctconst );
-
-       LoadTGA( name, NULL, &width, &height );
-
-       output = fopen( savename, "wb" );
-       if ( !output ) {
-               Error( "Can't open %s", savename );
-       }
-
-       if ( ( width % BLOCKSIZE ) || ( height % BLOCKSIZE ) ) {
-               Error( "Width and height must be a multiple of %d", BLOCKSIZE );
-       }
-
-       cinehead.Width = width;
-       cinehead.Height = height;
-       init_base( dctconst );
-
-       // build the dictionary
-       printf( "Counting         : " );
-       min_rle_size = 0;
-       for ( frame = 0;  ; frame++ )
-       {
-               printf( "." );
-               LoadFrame( &in, base, frame );
-               if ( !in.data ) {
-                       break;
-               }
-               Huffman1_Count( in );
-               if ( in.count > min_rle_size ) {
-                       min_rle_size = in.count;
-               }
-               free( in.data );
-       }
-       printf( "\n" );
-       cinehead.NumFrames = frame;
-       printf( "Num Frames       : %d\n", frame );
-       cinehead.MaxRleSize = ( min_rle_size + 0x1f ) & 0xfffffe0;
-       cinehead.MaxSndSize = ( ( 4 * wavinfo.rate * wavinfo.channels / 14 ) + 0x1f ) & 0xffffffe0;
-
-       WriteHeader( output, FC_HEADER_NAME, FC_HEADER_VERSION, sizeof( CineHead_t ), &cinehead );
-
-       // build nodes and write counts
-       Huffman1_Build();
-       WriteHeader( output, FC_HUFFBITS_NAME, FC_HUFFBITS_VERSION, sizeof( scaled ), scaled );
-       WriteHeader( output, FC_QUANT_NAME, FC_QUANT_VERSION, sizeof( Quantise ), Quantise );
-
-       ave_image = 0;
-       ave_sound = 0;
-       warnings = 0;
-       // compress it with the dictionary
-       if ( soundtrack ) {
-               ssize = WriteSound( output, frame, 4 );
-               ave_sound += ssize;
-       }
-
-       for ( frame = 0; frame < cinehead.NumFrames; frame++ )
-       {
-               // save some sound samples
-               printf( "Packing          : ", frame );
-               LoadFrame( &in, base, frame );
-
-               // save the image
-               huffman = Huffman1( in );
-               printf( "%d bytes rle, %d bytes huffman", in.count, huffman.count );
-               size = ( huffman.count + 3 ) & 0xfffffffc;                    // round up to longwords
-               if ( size > maxsize ) {
-                       printf( " ** WARNING **" );
-                       warnings++;
-               }
-               printf( "\n" );
-               ave_image += huffman.count;
-
-               WriteHeader( output, FC_IMAGE_NAME, FC_IMAGE_VERSION, size, huffman.data );
-               if ( soundtrack ) {
-                       ssize = WriteSound( output, frame + 4, 1 );
-                       ave_sound += ssize;
-               }
-
-               free( in.data );
-               free( huffman.data );
-       }
-       printf( "\nTotal size: %d (headers + %d image + %d sound)\n", ftell( output ), ave_image, ave_sound );
-       printf( "Data rate : %d bytes per sec (image and sound)\n", ( ave_image + ave_sound ) / cinehead.NumFrames );
-       printf( "Cin created ok with %d warnings.\n", warnings );
-       fclose( output );
-
-       if ( soundtrack ) {
-               free( soundtrack );
-       }
-}
-#endif
-
 void Cmd_Video(){
 }
 
index 103047c029eb85e2542c86d7d199bbdff6fc14ab..a010ad09f6c1b931d9159279c5fd800d2e5542a8 100644 (file)
@@ -272,21 +272,6 @@ double I_FloatTime( void ){
        time( &t );
 
        return t;
-#if 0
-// more precise, less portable
-       struct timeval tp;
-       struct timezone tzp;
-       static int secbase;
-
-       gettimeofday( &tp, &tzp );
-
-       if ( !secbase ) {
-               secbase = tp.tv_sec;
-               return tp.tv_usec / 1000000.0;
-       }
-
-       return ( tp.tv_sec - secbase ) + tp.tv_usec / 1000000.0;
-#endif
 }
 
 void Q_getwd( char *out ){
index 14e9eaafe5ffff974579c5bdd946a7a6ef46d755..0953bd85f6454413a5f729ec90c3d74bdc7193e9 100644 (file)
@@ -109,33 +109,6 @@ void xml_SendNode( xmlNodePtr node ){
                        pos += size;
                }
 
-#if 0
-               // NOTE: the NMSG_WriteString is limited to MAX_NETMESSAGE
-               // we will need to split into chunks
-               // (we could also go lower level, in the end it's using send and receiv which are not size limited)
-               //++timo FIXME: MAX_NETMESSAGE is not exactly the max size we can stick in the message
-               //  there's some tweaking to do in l_net for that .. so let's give us a margin for now
-
-               //++timo we need to handle the case of a buffer too big to fit in a single message
-               // try without checks for now
-               if ( xml_buf->use > MAX_NETMESSAGE - 10 ) {
-                       // if we send that we are probably gonna break the stream at the other end..
-                       // and Error will call right there
-                       //Error( "MAX_NETMESSAGE exceeded for XML feedback stream in FPrintf (%d)\n", xml_buf->use);
-                       Sys_FPrintf( SYS_NOXML, "MAX_NETMESSAGE exceeded for XML feedback stream in FPrintf (%d)\n", xml_buf->use );
-                       xml_buf->content[xml_buf->use] = '\0'; //++timo this corrupts the buffer but we don't care it's for printing
-                       Sys_FPrintf( SYS_NOXML, xml_buf->content );
-
-               }
-
-               size = xml_buf->use;
-               memcpy( xmlbuf, xml_buf->content, size );
-               xmlbuf[size] = '\0';
-               NMSG_Clear( &msg );
-               NMSG_WriteString( &msg, xmlbuf );
-               Net_Send( brdcst_socket, &msg );
-#endif
-
                xmlBufferFree( xml_buf );
        }
 }
index 164f9d1b2a1ce7eae8b9c73acdc94999b7048122..a63b1c3befac2af616f77c32f40fd77ca82d3e70 100644 (file)
@@ -644,14 +644,6 @@ void _3DS_LoadPolysets( const char *filename, polyset_t **ppPSET, int *numpsets,
        }
 
        // compute normal data
-#if 0
-       for ( i = 0; i < numPolysets; i++ )
-       {
-               // unique vertices based solely on vertex position
-               ComputeNormals( &_3ds.editChunk.pNamedObjects[i].pTriObjects[0],
-                                               pPSET[i].triangles );
-       }
-#endif
 
        free( _3ds.editChunk.pMaterials );
        free( _3ds.editChunk.pNamedObjects );
index e09975b2378aa62c57cea2365e8735fcf40896eb..7b2a53005823ca6629a2619b72cee29049647ed2 100644 (file)
  */
 
 #include "q3data.h"
-
-#if 0
-/*
-   ==================
-   MTF
-   ==================
- */
-cblock_t MTF( cblock_t in ){
-       int i, j, b, code;
-       byte        *out_p;
-       int index[256];
-       cblock_t out;
-
-       out_p = out.data = malloc( in.count + 4 );
-
-       // write count
-       *out_p++ = in.count & 255;
-       *out_p++ = ( in.count >> 8 ) & 255;
-       *out_p++ = ( in.count >> 16 ) & 255;
-       *out_p++ = ( in.count >> 24 ) & 255;
-
-       for ( i = 0 ; i < 256 ; i++ )
-               index[i] = i;
-
-       for ( i = 0 ; i < in.count ; i++ )
-       {
-               b = in.data[i];
-               code = index[b];
-               *out_p++ = code;
-
-               // shuffle b indexes to 0
-               for ( j = 0 ; j < 256 ; j++ )
-                       if ( index[j] < code ) {
-                               index[j]++;
-                       }
-               index[b] = 0;
-       }
-
-       out.count = out_p - out.data;
-
-       return out;
-}
-
-
-//==========================================================================
-
-int bwt_size;
-byte    *bwt_data;
-
-int bwtCompare( const void *elem1, const void *elem2 ){
-       int i;
-       int i1, i2;
-       int b1, b2;
-
-       i1 = *(int *)elem1;
-       i2 = *(int *)elem2;
-
-       for ( i = 0 ; i < bwt_size ; i++ )
-       {
-               b1 = bwt_data[i1];
-               b2 = bwt_data[i2];
-               if ( b1 < b2 ) {
-                       return -1;
-               }
-               if ( b1 > b2 ) {
-                       return 1;
-               }
-               if ( ++i1 == bwt_size ) {
-                       i1 = 0;
-               }
-               if ( ++i2 == bwt_size ) {
-                       i2 = 0;
-               }
-       }
-
-       return 0;
-}
-
-/*
-   ==================
-   BWT
-   ==================
- */
-cblock_t BWT( cblock_t in ){
-       int     *sorted;
-       int i;
-       byte    *out_p;
-       cblock_t out;
-
-       bwt_size = in.count;
-       bwt_data = in.data;
-
-       sorted = malloc( in.count * sizeof( *sorted ) );
-       for ( i = 0 ; i < in.count ; i++ )
-               sorted[i] = i;
-       qsort( sorted, in.count, sizeof( *sorted ), bwtCompare );
-
-       out_p = out.data = malloc( in.count + 8 );
-
-       // write count
-       *out_p++ = in.count & 255;
-       *out_p++ = ( in.count >> 8 ) & 255;
-       *out_p++ = ( in.count >> 16 ) & 255;
-       *out_p++ = ( in.count >> 24 ) & 255;
-
-       // write head index
-       for ( i = 0 ; i < in.count ; i++ )
-               if ( sorted[i] == 0 ) {
-                       break;
-               }
-       *out_p++ = i & 255;
-       *out_p++ = ( i >> 8 ) & 255;
-       *out_p++ = ( i >> 16 ) & 255;
-       *out_p++ = ( i >> 24 ) & 255;
-
-       // write the L column
-       for ( i = 0 ; i < in.count ; i++ )
-               *out_p++ = in.data[( sorted[i] + in.count - 1 ) % in.count];
-
-       free( sorted );
-
-       out.count = out_p - out.data;
-
-       return out;
-}
-
-//==========================================================================
-
-typedef struct hnode_s
-{
-       int count;
-       qboolean used;
-       int children[2];
-} hnode_t;
-
-int numhnodes;
-hnode_t hnodes[512];
-unsigned charbits[256];
-int charbitscount[256];
-
-int SmallestNode( void ){
-       int i;
-       int best, bestnode;
-
-       best = 99999999;
-       bestnode = -1;
-       for ( i = 0 ; i < numhnodes ; i++ )
-       {
-               if ( hnodes[i].used ) {
-                       continue;
-               }
-               if ( !hnodes[i].count ) {
-                       continue;
-               }
-               if ( hnodes[i].count < best ) {
-                       best = hnodes[i].count;
-                       bestnode = i;
-               }
-       }
-
-       if ( bestnode == -1 ) {
-               return -1;
-       }
-
-       hnodes[bestnode].used = true;
-       return bestnode;
-}
-
-void BuildChars( int nodenum, unsigned bits, int bitcount ){
-       hnode_t *node;
-
-       if ( nodenum < 256 ) {
-               if ( bitcount > 32 ) {
-                       Error( "bitcount > 32" );
-               }
-               charbits[nodenum] = bits;
-               charbitscount[nodenum] = bitcount;
-               return;
-       }
-
-       node = &hnodes[nodenum];
-       bits <<= 1;
-       BuildChars( node->children[0], bits, bitcount + 1 );
-       bits |= 1;
-       BuildChars( node->children[1], bits, bitcount + 1 );
-}
-
-/*
-   ==================
-   Huffman
-   ==================
- */
-cblock_t Huffman( cblock_t in ){
-       int i;
-       hnode_t     *node;
-       int outbits, c;
-       unsigned bits;
-       byte        *out_p;
-       cblock_t out;
-       int max, maxchar;
-
-       // count
-       memset( hnodes, 0, sizeof( hnodes ) );
-       for ( i = 0 ; i < in.count ; i++ )
-               hnodes[in.data[i]].count++;
-
-       // normalize counts
-       max = 0;
-       maxchar = 0;
-       for ( i = 0 ; i < 256 ; i++ )
-       {
-               if ( hnodes[i].count > max ) {
-                       max = hnodes[i].count;
-                       maxchar = i;
-               }
-       }
-       if ( max == 0 ) {
-               Error( "Huffman: max == 0" );
-       }
-
-       for ( i = 0 ; i < 256 ; i++ )
-       {
-               hnodes[i].count = ( hnodes[i].count * 255 + max - 1 ) / max;
-       }
-
-       // build the nodes
-       numhnodes = 256;
-       while ( numhnodes != 511 )
-       {
-               node = &hnodes[numhnodes];
-
-               // pick two lowest counts
-               node->children[0] = SmallestNode();
-               if ( node->children[0] == -1 ) {
-                       break;  // no more
-
-               }
-               node->children[1] = SmallestNode();
-               if ( node->children[1] == -1 ) {
-                       if ( node->children[0] != numhnodes - 1 ) {
-                               Error( "Bad smallestnode" );
-                       }
-                       break;
-               }
-               node->count = hnodes[node->children[0]].count +
-                                         hnodes[node->children[1]].count;
-               numhnodes++;
-       }
-
-       BuildChars( numhnodes - 1, 0, 0 );
-
-       out_p = out.data = malloc( in.count * 2 + 1024 );
-       memset( out_p, 0, in.count * 2 + 1024 );
-
-       // write count
-       *out_p++ = in.count & 255;
-       *out_p++ = ( in.count >> 8 ) & 255;
-       *out_p++ = ( in.count >> 16 ) & 255;
-       *out_p++ = ( in.count >> 24 ) & 255;
-
-       // save out the 256 normalized counts so the tree can be recreated
-       for ( i = 0 ; i < 256 ; i++ )
-               *out_p++ = hnodes[i].count;
-
-       // write bits
-       outbits = 0;
-       for ( i = 0 ; i < in.count ; i++ )
-       {
-               c = charbitscount[in.data[i]];
-               bits = charbits[in.data[i]];
-               while ( c )
-               {
-                       c--;
-                       if ( bits & ( 1 << c ) ) {
-                               out_p[outbits >> 3] |= 1 << ( outbits & 7 );
-                       }
-                       outbits++;
-               }
-       }
-
-       out_p += ( outbits + 7 ) >> 3;
-
-       out.count = out_p - out.data;
-
-       return out;
-}
-
-//==========================================================================
-
-/*
-   ==================
-   RLE
-   ==================
- */
-#define RLE_CODE    0xe8
-#define RLE_TRIPPLE 0xe9
-
-int rle_counts[256];
-int rle_bytes[256];
-
-cblock_t RLE( cblock_t in ){
-       int i;
-       byte    *out_p;
-       int val;
-       int repeat;
-       cblock_t out;
-
-       out_p = out.data = malloc( in.count * 2 );
-
-       // write count
-       *out_p++ = in.count & 255;
-       *out_p++ = ( in.count >> 8 ) & 255;
-       *out_p++ = ( in.count >> 16 ) & 255;
-       *out_p++ = ( in.count >> 24 ) & 255;
-
-       for ( i = 0 ; i < in.count ; )
-       {
-               val = in.data[i];
-               rle_bytes[val]++;
-               repeat = 1;
-               i++;
-               while ( i < in.count && repeat < 255 && in.data[i] == val )
-               {
-                       repeat++;
-                       i++;
-               }
-               if ( repeat < 256 ) {
-                       rle_counts[repeat]++;
-               }
-               if ( repeat > 3 || val == RLE_CODE ) {
-                       *out_p++ = RLE_CODE;
-                       *out_p++ = val;
-                       *out_p++ = repeat;
-               }
-               else
-               {
-                       while ( repeat-- )
-                               *out_p++ = val;
-               }
-       }
-
-       out.count = out_p - out.data;
-       return out;
-}
-
-//==========================================================================
-
-unsigned lzss_head[256];
-unsigned lzss_next[0x20000];
-
-/*
-   ==================
-   LZSS
-   ==================
- */
-#define BACK_WINDOW     0x10000
-#define BACK_BITS       16
-#define FRONT_WINDOW    16
-#define FRONT_BITS      4
-cblock_t LZSS( cblock_t in ){
-       int i;
-       byte    *out_p;
-       cblock_t out;
-       int val;
-       int j, start, max;
-       int bestlength, beststart;
-       int outbits;
-
-       if ( in.count >= sizeof( lzss_next ) / 4 ) {
-               Error( "LZSS: too big" );
-       }
-
-       memset( lzss_head, -1, sizeof( lzss_head ) );
-
-       out_p = out.data = malloc( in.count * 2 );
-       memset( out.data, 0, in.count * 2 );
-
-       // write count
-       *out_p++ = in.count & 255;
-       *out_p++ = ( in.count >> 8 ) & 255;
-       *out_p++ = ( in.count >> 16 ) & 255;
-       *out_p++ = ( in.count >> 24 ) & 255;
-
-       outbits = 0;
-       for ( i = 0 ; i < in.count ; )
-       {
-               val = in.data[i];
-#if 1
-// chained search
-               bestlength = 0;
-               beststart = 0;
-
-               max = FRONT_WINDOW;
-               if ( i + max > in.count ) {
-                       max = in.count - i;
-               }
-
-               start = lzss_head[val];
-               while ( start != -1 && start >= i - BACK_WINDOW )
-               {
-                       // count match length
-                       for ( j = 0 ; j < max ; j++ )
-                               if ( in.data[start + j] != in.data[i + j] ) {
-                                       break;
-                               }
-                       if ( j > bestlength ) {
-                               bestlength = j;
-                               beststart = start;
-                       }
-                       start = lzss_next[start];
-               }
-
-#else
-// slow simple search
-               // search for a match
-               max = FRONT_WINDOW;
-               if ( i + max > in.count ) {
-                       max = in.count - i;
-               }
-
-               start = i - BACK_WINDOW;
-               if ( start < 0 ) {
-                       start = 0;
-               }
-               bestlength = 0;
-               beststart = 0;
-               for ( ; start < i ; start++ )
-               {
-                       if ( in.data[start] != val ) {
-                               continue;
-                       }
-                       // count match length
-                       for ( j = 0 ; j < max ; j++ )
-                               if ( in.data[start + j] != in.data[i + j] ) {
-                                       break;
-                               }
-                       if ( j > bestlength ) {
-                               bestlength = j;
-                               beststart = start;
-                       }
-               }
-#endif
-               beststart = BACK_WINDOW - ( i - beststart );
-
-               if ( bestlength < 3 ) { // output a single char
-                       bestlength = 1;
-
-                       out_p[outbits >> 3] |= 1 << ( outbits & 7 );    // set bit to mark char
-                       outbits++;
-                       for ( j = 0 ; j < 8 ; j++, outbits++ )
-                               if ( val & ( 1 << j ) ) {
-                                       out_p[outbits >> 3] |= 1 << ( outbits & 7 );
-                               }
-               }
-               else
-               {   // output a phrase
-                       outbits++;  // leave a 0 bit to mark phrase
-                       for ( j = 0 ; j < BACK_BITS ; j++, outbits++ )
-                               if ( beststart & ( 1 << j ) ) {
-                                       out_p[outbits >> 3] |= 1 << ( outbits & 7 );
-                               }
-                       for ( j = 0 ; j < FRONT_BITS ; j++, outbits++ )
-                               if ( bestlength & ( 1 << j ) ) {
-                                       out_p[outbits >> 3] |= 1 << ( outbits & 7 );
-                               }
-               }
-
-               while ( bestlength-- )
-               {
-                       val = in.data[i];
-                       lzss_next[i] = lzss_head[val];
-                       lzss_head[val] = i;
-                       i++;
-               }
-       }
-
-       out_p += ( outbits + 7 ) >> 3;
-       out.count = out_p - out.data;
-       return out;
-}
-
-//==========================================================================
-
-#define MIN_REPT    15
-#define MAX_REPT    0
-#define HUF_TOKENS  ( 256 + MAX_REPT )
-
-unsigned charbits1[256][HUF_TOKENS];
-int charbitscount1[256][HUF_TOKENS];
-
-hnode_t hnodes1[256][HUF_TOKENS * 2];
-int numhnodes1[256];
-
-int order0counts[256];
-
-/*
-   ==================
-   SmallestNode1
-   ==================
- */
-int SmallestNode1( hnode_t *hnodes, int numhnodes ){
-       int i;
-       int best, bestnode;
-
-       best = 99999999;
-       bestnode = -1;
-       for ( i = 0 ; i < numhnodes ; i++ )
-       {
-               if ( hnodes[i].used ) {
-                       continue;
-               }
-               if ( !hnodes[i].count ) {
-                       continue;
-               }
-               if ( hnodes[i].count < best ) {
-                       best = hnodes[i].count;
-                       bestnode = i;
-               }
-       }
-
-       if ( bestnode == -1 ) {
-               return -1;
-       }
-
-       hnodes[bestnode].used = true;
-       return bestnode;
-}
-
-
-/*
-   ==================
-   BuildChars1
-   ==================
- */
-void BuildChars1( int prev, int nodenum, unsigned bits, int bitcount ){
-       hnode_t *node;
-
-       if ( nodenum < HUF_TOKENS ) {
-               if ( bitcount > 32 ) {
-                       Error( "bitcount > 32" );
-               }
-               charbits1[prev][nodenum] = bits;
-               charbitscount1[prev][nodenum] = bitcount;
-               return;
-       }
-
-       node = &hnodes1[prev][nodenum];
-       bits <<= 1;
-       BuildChars1( prev, node->children[0], bits, bitcount + 1 );
-       bits |= 1;
-       BuildChars1( prev, node->children[1], bits, bitcount + 1 );
-}
-
-
-/*
-   ==================
-   BuildTree1
-   ==================
- */
-void BuildTree1( int prev ){
-       hnode_t     *node, *nodebase;
-       int numhnodes;
-
-       // build the nodes
-       numhnodes = HUF_TOKENS;
-       nodebase = hnodes1[prev];
-       while ( 1 )
-       {
-               node = &nodebase[numhnodes];
-
-               // pick two lowest counts
-               node->children[0] = SmallestNode1( nodebase, numhnodes );
-               if ( node->children[0] == -1 ) {
-                       break;  // no more
-
-               }
-               node->children[1] = SmallestNode1( nodebase, numhnodes );
-               if ( node->children[1] == -1 ) {
-                       break;
-               }
-
-               node->count = nodebase[node->children[0]].count +
-                                         nodebase[node->children[1]].count;
-               numhnodes++;
-       }
-       numhnodes1[prev] = numhnodes - 1;
-       BuildChars1( prev, numhnodes - 1, 0, 0 );
-}
-
-
-/*
-   ==================
-   Huffman1_Count
-   ==================
- */
-void Huffman1_Count( cblock_t in ){
-       int i;
-       int prev;
-       int v;
-       int rept;
-
-       prev = 0;
-       for ( i = 0 ; i < in.count ; i++ )
-       {
-               v = in.data[i];
-               order0counts[v]++;
-               hnodes1[prev][v].count++;
-               prev = v;
-#if 1
-               for ( rept = 1 ; i + rept < in.count && rept < MAX_REPT ; rept++ )
-                       if ( in.data[i + rept] != v ) {
-                               break;
-                       }
-               if ( rept > MIN_REPT ) {
-                       hnodes1[prev][255 + rept].count++;
-                       i += rept - 1;
-               }
-#endif
-       }
-}
-
-
-/*
-   ==================
-   Huffman1_Build
-   ==================
- */
-byte scaled[256][HUF_TOKENS];
-void Huffman1_Build( FILE *f ){
-       int i, j, v;
-       int max;
-       int total;
-
-       for ( i = 0 ; i < 256 ; i++ )
-       {
-               // normalize and save the counts
-               max = 0;
-               for ( j = 0 ; j < HUF_TOKENS ; j++ )
-               {
-                       if ( hnodes1[i][j].count > max ) {
-                               max = hnodes1[i][j].count;
-                       }
-               }
-               if ( max == 0 ) {
-                       max = 1;
-               }
-               total = 0;
-               for ( j = 0 ; j < HUF_TOKENS ; j++ )
-               {   // easy to overflow 32 bits here!
-                       v = ( hnodes1[i][j].count * (double)255 + max - 1 ) / max;
-                       if ( v > 255 ) {
-                               Error( "v > 255" );
-                       }
-                       scaled[i][j] = hnodes1[i][j].count = v;
-                       if ( v ) {
-                               total++;
-                       }
-               }
-               if ( total == 1 ) { // must have two tokens
-                       if ( !scaled[i][0] ) {
-                               scaled[i][0] = hnodes1[i][0].count = 1;
-                       }
-                       else{
-                               scaled[i][1] = hnodes1[i][1].count = 1;
-                       }
-               }
-
-               BuildTree1( i );
-       }
-
-#if 0
-       // count up the total bits
-       total = 0;
-       for ( i = 0 ; i < 256 ; i++ )
-               for ( j = 0 ; j < 256 ; j++ )
-                       total += charbitscount1[i][j] * hnodes1[i][j].count;
-
-       total = ( total + 7 ) / 8;
-       printf( "%i bytes huffman1 compressed\n", total );
-#endif
-
-       fwrite( scaled, 1, sizeof( scaled ), f );
-}
-
-/*
-   ==================
-   Huffman1
-
-   Order 1 compression with pre-built table
-   ==================
- */
-cblock_t Huffman1( cblock_t in ){
-       int i;
-       int outbits, c;
-       unsigned bits;
-       byte        *out_p;
-       cblock_t out;
-       int prev;
-       int v;
-       int rept;
-
-       out_p = out.data = malloc( in.count * 2 + 1024 );
-       memset( out_p, 0, in.count * 2 + 1024 );
-
-       // write count
-       *out_p++ = in.count & 255;
-       *out_p++ = ( in.count >> 8 ) & 255;
-       *out_p++ = ( in.count >> 16 ) & 255;
-       *out_p++ = ( in.count >> 24 ) & 255;
-
-       // write bits
-       outbits = 0;
-       prev = 0;
-       for ( i = 0 ; i < in.count ; i++ )
-       {
-               v = in.data[i];
-
-               c = charbitscount1[prev][v];
-               bits = charbits1[prev][v];
-               if ( !c ) {
-                       Error( "!bits" );
-               }
-               while ( c )
-               {
-                       c--;
-                       if ( bits & ( 1 << c ) ) {
-                               out_p[outbits >> 3] |= 1 << ( outbits & 7 );
-                       }
-                       outbits++;
-               }
-
-               prev = v;
-#if 1
-               // check for repeat encodes
-               for ( rept = 1 ; i + rept < in.count && rept < MAX_REPT ; rept++ )
-                       if ( in.data[i + rept] != v ) {
-                               break;
-                       }
-               if ( rept > MIN_REPT ) {
-                       c = charbitscount1[prev][255 + rept];
-                       bits = charbits1[prev][255 + rept];
-                       if ( !c ) {
-                               Error( "!bits" );
-                       }
-                       while ( c )
-                       {
-                               c--;
-                               if ( bits & ( 1 << c ) ) {
-                                       out_p[outbits >> 3] |= 1 << ( outbits & 7 );
-                               }
-                               outbits++;
-                       }
-                       i += rept - 1;
-               }
-#endif
-       }
-
-       out_p += ( outbits + 7 ) >> 3;
-
-       out.count = out_p - out.data;
-
-       return out;
-}
-
-#endif
index f2f0eee5501ca6fcb98871d498e24a84cbe8ec84..b45d99976e8421304bb7894b5440f5d4c53a6e1b 100644 (file)
@@ -54,22 +54,7 @@ void MD3_ComputeTagFromTri( md3Tag_t *pTag, const float pTri[3][3] ){
 
                len[j] = ( float ) sqrt( DotProduct( sides[j], sides[j] ) );
        }
-
-#if 0
-       if ( len[0] > len[1] && len[0] > len[2] ) {
-               longestSide = 0; shortestSide = 1; origin = 2;
-       }
-       else if ( len[1] > len[0] && len[1] > len[2] ) {
-               longestSide = 1; shortestSide = 2; origin = 0;
-       }
-       else if ( len[2] > len[0] && len[2] > len[1] ) {
-               longestSide = 2; shortestSide = 0; origin = 1;
-       }
-       else
-       {
-               Error( "invalid tag triangle, must be a right triangle with unequal length sides" );
-       }
-#endif
+       
        if ( len[0] > len[1] && len[0] > len[2] ) {
                hypotSide = 0;
                origin = 2;
index 65fde8580109fbc4e1e5da89aad48f7e095267ee..fd365ae9c6b1d52b9257c1610441a5cc166ea863 100644 (file)
@@ -1445,14 +1445,6 @@ void Cmd_ASEConvert( qboolean grabAnims ){
                        GetToken( qfalse );
                        g_data.lowerSkipFrameStart = atoi( token );
 
-#if 0
-                       if ( !TokenAvailable() ) {
-                               Error( "missing skip end parameter for -playerparms" );
-                       }
-                       GetToken( qfalse );
-                       g_data.lowerSkipFrameEnd = atoi( token );
-#endif
-
                        if ( !TokenAvailable() ) {
                                Error( "missing upper parameter for -playerparms" );
                        }
@@ -1461,13 +1453,6 @@ void Cmd_ASEConvert( qboolean grabAnims ){
 
                        g_data.lowerSkipFrameEnd = g_data.maxUpperFrames - 1;
 
-#if 0
-                       if ( !TokenAvailable() ) {
-                               Error( "missing head parameter for -playerparms" );
-                       }
-                       GetToken( qfalse );
-                       g_data.maxHeadFrames = atoi( token );
-#endif
                        g_data.maxHeadFrames = 1;
 
                        if ( type != TYPE_ITEM ) {
index 00cd5742cc5beb3ef86acd96cb32ffbdba5360da..9bb7511bbfa3bd6e11b417cf8cbd6cc192e69db4 100644 (file)
    along with GtkRadiant; if not, write to the Free Software
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
-
-#if 0
-
-/*
-** ReindexTriangle
-**
-** Given a triangle_t, find which indices match into the associated
-** surface's base triangles.
-*/
-static void ReindexTriangle( int surfno, triangle_t *pTri, int indices[3] ){
-       int t, i;
-       md3SurfaceData_t *pSurfData = &g_data.surfData[surfno];
-       int matches[3][3];
-       int numMatches = 0;
-
-
-       indices[0] = -1;
-       indices[1] = -1;
-       indices[2] = -1;
-
-       for ( i = 0; i < 3; i++ )
-       {
-               numMatches = 0;
-
-               matches[i][0] = -1;
-               matches[i][1] = -1;
-               matches[i][2] = -1;
-
-               for ( t = 0; t < pSurfData->header.numVerts; t++ )
-               {
-                       if ( !VectorCompare( pTri->verts[i], pSurfData->baseVertexes[t].xyz ) ) {
-                               continue;
-                       }
-
-/*
-            if ( !VectorCompare( pTri->normals[i], pSurfData->baseVertexes[t].normal ) )
-                continue;
-            if ( pTri->texcoords[i][0] != pSurfData->baseVertexes[t].st[0] )
-                continue;
-            if ( pTri->texcoords[i][1] != pSurfData->baseVertexes[t].st[1] )
-                continue;
- */
-
-                       matches[i][numMatches++] = t;
-               }
-
-               if ( indices[i] == -1 ) {
-//                     Error( "Could not ReindexTriangle, vertex not found" );
-               }
-       }
-
-#if 0
-       for ( t = 0; t < psets[i].numtriangles; t++ )
-       {
-               int b;
-
-               bTri = &g_data.surfData[i].baseTriangles[t];
-
-               for ( j = 0 ; j < 3 ; j++ )
-               {
-                       bVert = &bTri->v[j];
-
-                       // get the xyz index
-                       for ( k = 0; k < g_data.surfData[i].header.numVerts; k++ )
-                       {
-                               if ( ( g_data.surfData[i].baseVertexes[k].st[0] == bVert->st[0] ) &&
-                                        ( g_data.surfData[i].baseVertexes[k].st[1] == bVert->st[1] ) &&
-                                        ( VectorCompare( bVert->xyz, g_data.surfData[i].baseVertexes[k].xyz ) ) &&
-                                        ( VectorCompare( bVert->normal, g_data.surfData[i].baseVertexes[k].normal ) ) ) {
-                                       break;      // this vertex is already in the base vertex list
-                               }
-                       }
-
-                       if ( k == g_data.surfData[i].header.numVerts ) {      // new index
-                               g_data.surfData[i].baseVertexes[g_data.surfData[i].header.numVerts] = *bVert;
-                               g_data.surfData[i].header.numVerts++;
-                       }
-
-                       bVert->index = k;
-               }
-       }
-#endif
-}
-
-const char  *FindFrameFile( const char *frame ){
-       int time1;
-       char file1[1024];
-       static char retname[1024];
-       char base[32];
-       char suffix[32];
-       const char  *s;
-
-       if ( strstr( frame, "." ) ) {
-               return frame;       // allready in dot format
-
-       }
-       // split 'run1' into 'run' and '1'
-       s = frame + strlen( frame ) - 1;
-
-       while ( s != frame && *s >= '0' && *s <= '9' )
-               s--;
-
-       strcpy( suffix, s + 1 );
-       strcpy( base, frame );
-       base[s - frame + 1] = 0;
-
-       // check for 'run1.tri'
-       sprintf( file1, "%s/%s%s.tri", g_cddir, base, suffix );
-       time1 = FileTime( file1 );
-       if ( time1 != -1 ) {
-               sprintf( retname, "%s%s.tri", base, suffix );
-               return retname;
-       }
-
-       // check for 'run.1'
-       sprintf( file1, "%s/%s.%s",g_cddir, base, suffix );
-       time1 = FileTime( file1 );
-       if ( time1 != -1 ) {
-               sprintf( retname, "%s.%s", base, suffix );
-               return retname;
-       }
-
-       Error( "frame %s could not be found",frame );
-       return NULL;
-}
-
-#endif
index 2da1ae9b6aed31e5b3a64791d518cb2f5709c667..81a1635edca23f910b10d8a33cbf080c345c317b 100644 (file)
@@ -261,10 +261,6 @@ int P3DProcess(){
                                                        strcpy( p3d.polysetNames[p3d.numPairs], s_token );
                                                }
 
-                                               // strip off trailing unused color information
-//                                             if ( strrchr( p3d.polysetNames[p3d.numPairs], '_' ) != 0 )
-//                                                     *strrchr( p3d.polysetNames[p3d.numPairs], '_' ) = 0;
-
                                                p3d.numPairs++;
                                        }
                                        else
@@ -281,54 +277,4 @@ int P3DProcess(){
        return 1;
 }
 
-#if 0
-void SkinFromP3D( const char *file ){
-       char filename[1024];
-       char *psetName, *associatedShader;
-
-       /*
-       ** a P3D file contains a list of polysets, each with a list of associated
-       ** texture names that constitute it's
-       **
-       ** Thus:
-       **
-       ** P3D file -> skin
-       ** polyset  -> polyset
-       **   texture -> texture.SHADER becomes polyset's shader
-       */
-       sprintf( filename, "%s/%s", g_cddir, file );
-
-       if ( !P3DLoad( filename ) ) {
-               Error( "unable to load '%s'", filename );
-       }
-
-       while ( P3DGetNextPair( &psetName, &associatedShader ) )
-       {
-               int i;
-
-               // find the polyset in the object that this particular pset/shader pair
-               // corresponds to and append the shader to it
-               for ( i = 0; i < g_data.model.numSurfaces; i++ )
-               {
-                       if ( !_strcmpi( g_data.surfData[i].header.name, psetName ) ) {
-                               char *p;
-
-                               if ( strstr( associatedShader, gamedir + 1 ) ) {
-                                       p = strstr( associatedShader, gamedir + 1 ) + strlen( gamedir ) - 1;
-                               }
-                               else
-                               {
-                                       p = associatedShader;
-                               }
-
-                               strcpy( g_data.surfData[i].shaders[g_data.surfData[i].header.numShaders].name, p );
-
-                               g_data.surfData[i].header.numShaders++;
-                       }
-               }
-
-       }
 
-       P3DClose();
-}
-#endif
index 2e90bcefb5cbc820abe65ae6f900ba50a954ae79..a70ee6b451e0a69c373dc1e418e639f8d031cd1d 100644 (file)
@@ -262,16 +262,6 @@ void OrderMesh( int input[][3], int output[][3], int numTris ){
 
        memset( s_used, 0, sizeof( s_used ) );
 
-#if 0
-       FILE *fp = fopen( "strip.txt", "wt" );
-
-       for ( i = 0; i < numTris; i++ )
-       {
-               fprintf( fp, "%4d: %3d %3d %3d\n", i, input[i][0], input[i][1], input[i][2] );
-       }
-       fclose( fp );
-#endif
-
        // while there are still triangles that are not part of a strip
        while ( sumStrippedTriangles < numTris )
        {
index b7be982cf0d6599ae0855e9569374489c4c1efe3..b11186c978d87443cd5df52e61581142c3037f89 100644 (file)
@@ -602,14 +602,6 @@ static float BTCCompressBlock( float inBlock[4][4][3], unsigned long out[2] ){
        float bestError = 10000000000;
        unsigned int bestEndPoints[2][2];
 
-#if 0
-       //
-       // find the "ideal" end points for the color vector
-       //
-       BTCFindEndpoints( inBlock, endPoints );
-       error = BTCQuantizeBlock( inBlock, endPoints, btcQuantizedBlock );
-       memcpy( bestEndPoints, endPoints, sizeof( bestEndPoints ) );
-#else
        for ( blockY = 0; blockY < 4; blockY++ )
        {
                for ( blockX = 0; blockX < 4; blockX++ )
@@ -641,7 +633,6 @@ static float BTCCompressBlock( float inBlock[4][4][3], unsigned long out[2] ){
        }
 
        error = BTCQuantizeBlock( inBlock, bestEndPoints, btcQuantizedBlock, -1.0f );
-#endif
 
        //
        // encode the results
@@ -869,20 +860,11 @@ cblock_t LoadFrame( char *base, int frame, int digits, byte **palette ){
        if ( palette ) {
                *palette = 0;
        }
-//     Load256Image (name, &in.data, palette, &width, &height);
        in.count = width * height;
        in.width = width;
        in.height = height;
 // FIXME: map 0 and 255!
 
-#if 0
-       // rle compress
-       rle = RLE( in );
-       free( in.data );
-
-       return rle;
-#endif
-
        return in;
 }
 
index 04c4a4d0872f0a7047a33205ecb5507304fcadfa..8d59a00950344ab960ec61091a10d983c0e0674b 100644 (file)
@@ -542,59 +542,6 @@ static void ConvertBrush( FILE *f, int num, bspBrush_t *brush, vec3_t origin, qb
 }
 #undef FRAC
 
-#if 0
-/* iterate through the brush sides (ignore the first 6 bevel planes) */
-for ( i = 0; i < brush->numSides; i++ )
-{
-       /* get side */
-       side = &bspBrushSides[ brush->firstSide + i ];
-
-       /* get shader */
-       if ( side->shaderNum < 0 || side->shaderNum >= numBSPShaders ) {
-               continue;
-       }
-       shader = &bspShaders[ side->shaderNum ];
-       if ( !Q_stricmp( shader->shader, "default" ) || !Q_stricmp( shader->shader, "noshader" ) ) {
-               continue;
-       }
-
-       /* get texture name */
-       if ( !Q_strncasecmp( shader->shader, "textures/", 9 ) ) {
-               texture = shader->shader + 9;
-       }
-       else{
-               texture = shader->shader;
-       }
-
-       /* get plane */
-       plane = &bspPlanes[ side->planeNum ];
-
-       /* make plane points */
-       {
-               vec3_t vecs[ 2 ];
-
-
-               MakeNormalVectors( plane->normal, vecs[ 0 ], vecs[ 1 ] );
-               VectorMA( vec3_origin, plane->dist, plane->normal, pts[ 0 ] );
-               VectorMA( pts[ 0 ], 256.0f, vecs[ 0 ], pts[ 1 ] );
-               VectorMA( pts[ 0 ], 256.0f, vecs[ 1 ], pts[ 2 ] );
-       }
-
-       /* offset by origin */
-       for ( j = 0; j < 3; j++ )
-               VectorAdd( pts[ j ], origin, pts[ j ] );
-
-       /* print brush side */
-       /* ( 640 24 -224 ) ( 448 24 -224 ) ( 448 -232 -224 ) common/caulk 0 48 0 0.500000 0.500000 0 0 0 */
-       fprintf( f, "\t\t( %.3f %.3f %.3f ) ( %.3f %.3f %.3f ) ( %.3f %.3f %.3f ) %s 0 0 0 0.5 0.5 0 0 0\n",
-                        pts[ 0 ][ 0 ], pts[ 0 ][ 1 ], pts[ 0 ][ 2 ],
-                        pts[ 1 ][ 0 ], pts[ 1 ][ 1 ], pts[ 1 ][ 2 ],
-                        pts[ 2 ][ 0 ], pts[ 2 ][ 1 ], pts[ 2 ][ 2 ],
-                        texture );
-}
-#endif
-
-
 
 /*
    ConvertPatch()
index 86421b95bc387a4464424fb9759d90f34eaa1402..8c9c95a3b20719c7210d2934b346fbd8f3146057 100644 (file)
@@ -114,7 +114,6 @@ static qboolean MakeTextureMatrix( decalProjector_t *dp, vec4_t projection, bspD
        VectorMA( c->xyz, -d, projection, pc );
 
        /* two methods */
-       #if 1
        {
                /* old code */
 
@@ -124,19 +123,6 @@ static qboolean MakeTextureMatrix( decalProjector_t *dp, vec4_t projection, bspD
                        return qfalse;
                }
 
-               /* calculate texture origin */
-               #if 0
-               s = 0.0;
-               t = 0.0;
-               bary[ 0 ] = ( ( b->st[ 0 ] - s ) * ( c->st[ 1 ] - t ) - ( c->st[ 0 ] - s ) * ( b->st[ 1 ] - t ) ) / bb;
-               bary[ 1 ] = ( ( c->st[ 0 ] - s ) * ( a->st[ 1 ] - t ) - ( a->st[ 0 ] - s ) * ( c->st[ 1 ] - t ) ) / bb;
-               bary[ 2 ] = ( ( a->st[ 0 ] - s ) * ( b->st[ 1 ] - t ) - ( b->st[ 0 ] - s ) * ( a->st[ 1 ] - t ) ) / bb;
-
-               origin[ 0 ] = bary[ 0 ] * pa[ 0 ] + bary[ 1 ] * pb[ 0 ] + bary[ 2 ] * pc[ 0 ];
-               origin[ 1 ] = bary[ 0 ] * pa[ 1 ] + bary[ 1 ] * pb[ 1 ] + bary[ 2 ] * pc[ 1 ];
-               origin[ 2 ] = bary[ 0 ] * pa[ 2 ] + bary[ 1 ] * pb[ 2 ] + bary[ 2 ] * pc[ 2 ];
-               #endif
-
                /* calculate s vector */
                s = a->st[ 0 ] + 1.0;
                t = a->st[ 1 ] + 0.0;
@@ -181,61 +167,8 @@ static qboolean MakeTextureMatrix( decalProjector_t *dp, vec4_t projection, bspD
                dp->texMat[ 0 ][ 3 ] = a->st[ 0 ] - DotProduct( a->xyz, dp->texMat[ 0 ] );
                dp->texMat[ 1 ][ 3 ] = a->st[ 1 ] - DotProduct( a->xyz, dp->texMat[ 1 ] );
        }
-       #else
-       {
-               int k;
-               dvec3_t origin, deltas[ 3 ];
-               double texDeltas[ 3 ][ 2 ];
-               double delta, texDelta;
-
-
-               /* new code */
-
-               /* calculate deltas */
-               VectorSubtract( pa, pb, deltas[ 0 ] );
-               VectorSubtract( pa, pc, deltas[ 1 ] );
-               VectorSubtract( pb, pc, deltas[ 2 ] );
-               Vector2Subtract( a->st, b->st, texDeltas[ 0 ] );
-               Vector2Subtract( a->st, c->st, texDeltas[ 1 ] );
-               Vector2Subtract( b->st, c->st, texDeltas[ 2 ] );
-
-               /* walk st */
-               for ( i = 0; i < 2; i++ )
-               {
-                       /* walk xyz */
-                       for ( j = 0; j < 3; j++ )
-                       {
-                               /* clear deltas */
-                               delta = 0.0;
-                               texDelta = 0.0;
-
-                               /* walk deltas */
-                               for ( k = 0; k < 3; k++ )
-                               {
-                                       if ( fabs( deltas[ k ][ j ] ) > delta &&
-                                                fabs( texDeltas[ k ][ i ] ) > texDelta  ) {
-                                               delta = deltas[ k ][ j ];
-                                               texDelta = texDeltas[ k ][ i ];
-                                       }
-                               }
-
-                               /* set texture matrix component */
-                               if ( fabs( delta ) > 0.0 ) {
-                                       dp->texMat[ i ][ j ] = texDelta / delta;
-                               }
-                               else{
-                                       dp->texMat[ i ][ j ] = 0.0;
-                               }
-                       }
-
-                       /* set translation component */
-                       dp->texMat[ i ][ 3 ] = a->st[ i ] - DotProduct( pa, dp->texMat[ i ] );
-               }
-       }
-       #endif
 
        /* debug code */
-       #if 1
        Sys_Printf( "Mat: [ %f %f %f %f ] [ %f %f %f %f ] Theta: %f (%f)\n",
                                dp->texMat[ 0 ][ 0 ], dp->texMat[ 0 ][ 1 ], dp->texMat[ 0 ][ 2 ], dp->texMat[ 0 ][ 3 ],
                                dp->texMat[ 1 ][ 0 ], dp->texMat[ 1 ][ 1 ], dp->texMat[ 1 ][ 2 ], dp->texMat[ 1 ][ 3 ],
@@ -246,7 +179,6 @@ static qboolean MakeTextureMatrix( decalProjector_t *dp, vec4_t projection, bspD
                                a->xyz[ 0 ], a->xyz[ 1 ], a->xyz[ 2 ],
                                a->st[ 0 ], a->st[ 1 ],
                                DotProduct( a->xyz, dp->texMat[ 0 ] ) + dp->texMat[ 0 ][ 3 ], DotProduct( a->xyz, dp->texMat[ 1 ] ) + dp->texMat[ 1 ][ 3 ] );
-       #endif
 
        /* test texture matrix */
        s = DotProduct( a->xyz, dp->texMat[ 0 ] ) + dp->texMat[ 0 ][ 3 ];
@@ -528,11 +460,6 @@ void ProcessDecals( void ){
                        /* remove patch from entity (fixme: leak!) */
                        e->patches = p->next;
 
-                       /* push patch to worldspawn (enable this to debug projectors) */
-                       #if 0
-                       p->next = entities[ 0 ].patches;
-                       entities[ 0 ].patches = p;
-                       #endif
                }
        }
 
index e35f289206b658ba708fa309d244a84edd1dd4fd..a215e69afb5fa923f717b953a9ca9cbd3a29354b 100644 (file)
@@ -197,18 +197,6 @@ static void SelectSplitPlaneNum( node_t *node, face_t *list, int *splitPlaneNum,
        *splitPlaneNum = bestSplit->planenum;
        *compileFlags = bestSplit->compileFlags;
 
-#if 0
-       if ( bestSplit->compileFlags & C_DETAIL ) {
-               for ( split = list; split; split = split->next )
-                       if ( !( split->compileFlags & C_DETAIL ) ) {
-                               Sys_FPrintf( SYS_ERR, "DON'T DO SUCH SPLITS (1)\n" );
-                       }
-       }
-       if ( ( node->compileFlags & C_DETAIL ) && !( bestSplit->compileFlags & C_DETAIL ) ) {
-               Sys_FPrintf( SYS_ERR, "DON'T DO SUCH SPLITS (2)\n" );
-       }
-#endif
-
        if ( *splitPlaneNum > -1 ) {
                mapplanes[ *splitPlaneNum ].counter++;
        }
@@ -248,10 +236,6 @@ void BuildFaceTree_r( node_t *node, face_t *list ){
        winding_t   *frontWinding, *backWinding;
        int i;
        int splitPlaneNum, compileFlags;
-#if 0
-       qboolean isstruct = qfalse;
-#endif
-
 
        /* count faces left */
        i = CountFaceList( list );
@@ -285,13 +269,6 @@ void BuildFaceTree_r( node_t *node, face_t *list ){
                        FreeBspFace( split );
                        continue;
                }
-
-#if 0
-               if ( !( split->compileFlags & C_DETAIL ) ) {
-                       isstruct = 1;
-               }
-#endif
-
                /* determine which side the face falls on */
                side = WindingOnPlaneSide( split->w, plane->normal, plane->dist );
 
@@ -351,25 +328,10 @@ void BuildFaceTree_r( node_t *node, face_t *list ){
                }
        }
 
-#if 0
-       if ( ( node->compileFlags & C_DETAIL ) && isstruct ) {
-               Sys_FPrintf( SYS_ERR, "I am detail, my child is structural, this is a wtf1\n", node->has_structural_children );
-       }
-#endif
-
        for ( i = 0 ; i < 2 ; i++ ) {
                BuildFaceTree_r( node->children[i], childLists[i] );
                node->has_structural_children |= node->children[i]->has_structural_children;
        }
-
-#if 0
-       if ( ( node->compileFlags & C_DETAIL ) && !( node->children[0]->compileFlags & C_DETAIL ) && node->children[0]->planenum != PLANENUM_LEAF ) {
-               Sys_FPrintf( SYS_ERR, "I am detail, my child is structural\n", node->has_structural_children );
-       }
-       if ( ( node->compileFlags & C_DETAIL ) && isstruct ) {
-               Sys_FPrintf( SYS_ERR, "I am detail, my child is structural, this is a wtf2\n", node->has_structural_children );
-       }
-#endif
 }
 
 
index c1c737f51b3282b74d827a80fd9fe06110ec7346..22b8df73cbc201151b5420786ceef605e625912e 100644 (file)
@@ -417,7 +417,6 @@ image_t *ImageLoad( const char *filename ){
                                        LoadDDSBuffer( buffer, size, &image->pixels, &image->width, &image->height );
 
                                        /* debug code */
-                                       #if 1
                                        {
                                                ddsPF_t pf;
                                                DDSGetInfo( (ddsBuffer_t*) buffer, NULL, NULL, &pf );
@@ -428,7 +427,6 @@ image_t *ImageLoad( const char *filename ){
                                                        WriteTGA( "C:\\games\\quake3\\baseq3\\textures\\rad\\dds_converted.tga", image->pixels, image->width, image->height );
                                                }
                                        }
-                                       #endif
                                }
                                else
                                {
index 2571d4d2080cfefb656cd13b5e8e0964f4121fc8..ab1c10a54e5383e6a6d6cadf5457bcb492fbdcd3 100644 (file)
@@ -1759,13 +1759,6 @@ void TraceGrid( int num ){
        /* store off sample */
        for ( i = 0; i < MAX_LIGHTMAPS; i++ )
        {
-#if 0
-               /* do some fudging to keep the ambient from being too low (2003-07-05: 0.25 -> 0.125) */
-               if ( !bouncing ) {
-                       VectorMA( gp->ambient[ i ], 0.125f, gp->directed[ i ], gp->ambient[ i ] );
-               }
-#endif
-
                /* set minimum light and copy off to bytes */
                VectorCopy( gp->ambient[ i ], color );
                for ( j = 0; j < 3; j++ )
@@ -1778,15 +1771,6 @@ void TraceGrid( int num ){
                ColorToBytes( gp->directed[ i ], bgp->directed[ i ], gridScale );
        }
 
-       /* debug code */
-       #if 0
-       //%     Sys_FPrintf( SYS_VRB, "%10d %10d %10d ", &gp->ambient[ 0 ][ 0 ], &gp->ambient[ 0 ][ 1 ], &gp->ambient[ 0 ][ 2 ] );
-       Sys_FPrintf( SYS_VRB, "%9d Amb: (%03.1f %03.1f %03.1f) Dir: (%03.1f %03.1f %03.1f)\n",
-                                num,
-                                gp->ambient[ 0 ][ 0 ], gp->ambient[ 0 ][ 1 ], gp->ambient[ 0 ][ 2 ],
-                                gp->directed[ 0 ][ 0 ], gp->directed[ 0 ][ 1 ], gp->directed[ 0 ][ 2 ] );
-       #endif
-
        /* store direction */
        NormalToLatLong( thisdir, bgp->latLong );
 }
index cb22bb44407cb8bfcc60419296bf8017a4c82c80..1a4ebf237f99feb568cd5197b4edbc1fef1bdbb6 100644 (file)
@@ -1345,39 +1345,6 @@ void SetupTraceNodes( void ){
        numTraceWindings = 0;
        maxTraceWindings = 0;
        deadWinding = -1;
-
-       /* debug code: write out trace triangles to an alias obj file */
-       #if 0
-       {
-               int i, j;
-               FILE            *file;
-               char filename[ 1024 ];
-               traceWinding_t  *tw;
-
-
-               /* open the file */
-               strcpy( filename, source );
-               StripExtension( filename );
-               strcat( filename, ".lin" );
-               Sys_Printf( "Opening light trace file %s...\n", filename );
-               file = fopen( filename, "w" );
-               if ( file == NULL ) {
-                       Error( "Error opening %s for writing", filename );
-               }
-
-               /* walk node list */
-               for ( i = 0; i < numTraceWindings; i++ )
-               {
-                       tw = &traceWindings[ i ];
-                       for ( j = 0; j < tw->numVerts + 1; j++ )
-                               fprintf( file, "%f %f %f\n",
-                                                tw->v[ j % tw->numVerts ].xyz[ 0 ], tw->v[ j % tw->numVerts ].xyz[ 1 ], tw->v[ j % tw->numVerts ].xyz[ 2 ] );
-               }
-
-               /* close it */
-               fclose( file );
-       }
-       #endif
 }
 
 
index e688deb9fd1ddd807a6cc8f0982b93b6acecabc0..17a268c9f47cbf0e9d498c9d63c365de23e01672 100644 (file)
@@ -711,14 +711,6 @@ static void MapTriangle_r( rawLightmap_t *lm, surfaceInfo_t *info, bspDrawVert_t
        bspDrawVert_t mid, *dv2[ 3 ];
        int max;
 
-
-       /* map the vertexes */
-       #if 0
-       MapSingleLuxel( lm, info, dv[ 0 ], plane, 1, stv, ttv );
-       MapSingleLuxel( lm, info, dv[ 1 ], plane, 1, stv, ttv );
-       MapSingleLuxel( lm, info, dv[ 2 ], plane, 1, stv, ttv );
-       #endif
-
        /* subdivide calc */
        {
                int i;
@@ -1091,52 +1083,6 @@ void MapRawLightmap( int rawLightmapNum ){
                        /* get verts */
                        verts = mesh->verts;
 
-                       /* debug code */
-                               #if 0
-                       if ( lm->plane ) {
-                               Sys_Printf( "Planar patch: [%1.3f %1.3f %1.3f] [%1.3f %1.3f %1.3f] [%1.3f %1.3f %1.3f]\n",
-                                                       lm->plane[ 0 ], lm->plane[ 1 ], lm->plane[ 2 ],
-                                                       lm->vecs[ 0 ][ 0 ], lm->vecs[ 0 ][ 1 ], lm->vecs[ 0 ][ 2 ],
-                                                       lm->vecs[ 1 ][ 0 ], lm->vecs[ 1 ][ 1 ], lm->vecs[ 1 ][ 2 ] );
-                       }
-                               #endif
-
-                       /* map the mesh quads */
-                               #if 0
-
-                       for ( mapNonAxial = 0; mapNonAxial < 2; mapNonAxial++ )
-                       {
-                               for ( y = 0; y < ( mesh->height - 1 ); y++ )
-                               {
-                                       for ( x = 0; x < ( mesh->width - 1 ); x++ )
-                                       {
-                                               /* set indexes */
-                                               pw[ 0 ] = x + ( y * mesh->width );
-                                               pw[ 1 ] = x + ( ( y + 1 ) * mesh->width );
-                                               pw[ 2 ] = x + 1 + ( ( y + 1 ) * mesh->width );
-                                               pw[ 3 ] = x + 1 + ( y * mesh->width );
-                                               pw[ 4 ] = x + ( y * mesh->width );      /* same as pw[ 0 ] */
-
-                                               /* set radix */
-                                               r = ( x + y ) & 1;
-
-                                               /* get drawverts and map first triangle */
-                                               dv[ 0 ] = &verts[ pw[ r + 0 ] ];
-                                               dv[ 1 ] = &verts[ pw[ r + 1 ] ];
-                                               dv[ 2 ] = &verts[ pw[ r + 2 ] ];
-                                               MapTriangle( lm, info, dv, mapNonAxial );
-
-                                               /* get drawverts and map second triangle */
-                                               dv[ 0 ] = &verts[ pw[ r + 0 ] ];
-                                               dv[ 1 ] = &verts[ pw[ r + 2 ] ];
-                                               dv[ 2 ] = &verts[ pw[ r + 3 ] ];
-                                               MapTriangle( lm, info, dv, mapNonAxial );
-                                       }
-                               }
-                       }
-
-                               #else
-
                        for ( y = 0; y < ( mesh->height - 1 ); y++ )
                        {
                                for ( x = 0; x < ( mesh->width - 1 ); x++ )
@@ -1175,8 +1121,6 @@ void MapRawLightmap( int rawLightmapNum ){
                                }
                        }
 
-                               #endif
-
                        /* free the mesh */
                        FreeMesh( mesh );
                        break;
@@ -1326,57 +1270,6 @@ void MapRawLightmap( int rawLightmapNum ){
                        luxel[ 3 ] = 1.0f;
                }
        }
-
-       /* debug code */
-       #if 0
-       Sys_Printf( "\n" );
-       for ( y = 0; y < lm->sh; y++ )
-       {
-               for ( x = 0; x < lm->sw; x++ )
-               {
-                       vec3_t mins, maxs;
-
-
-                       cluster = SUPER_CLUSTER( x, y );
-                       origin = SUPER_ORIGIN( x, y );
-                       normal = SUPER_NORMAL( x, y );
-                       luxel = SUPER_LUXEL( x, y );
-
-                       if ( *cluster < 0 ) {
-                               continue;
-                       }
-
-                       /* check if within the bounding boxes of all surfaces referenced */
-                       ClearBounds( mins, maxs );
-                       for ( n = 0; n < lm->numLightSurfaces; n++ )
-                       {
-                               int TOL;
-                               info = &surfaceInfos[ lightSurfaces[ lm->firstLightSurface + n ] ];
-                               TOL = info->sampleSize + 2;
-                               AddPointToBounds( info->mins, mins, maxs );
-                               AddPointToBounds( info->maxs, mins, maxs );
-                               if ( origin[ 0 ] > ( info->mins[ 0 ] - TOL ) && origin[ 0 ] < ( info->maxs[ 0 ] + TOL ) &&
-                                        origin[ 1 ] > ( info->mins[ 1 ] - TOL ) && origin[ 1 ] < ( info->maxs[ 1 ] + TOL ) &&
-                                        origin[ 2 ] > ( info->mins[ 2 ] - TOL ) && origin[ 2 ] < ( info->maxs[ 2 ] + TOL ) ) {
-                                       break;
-                               }
-                       }
-
-                       /* inside? */
-                       if ( n < lm->numLightSurfaces ) {
-                               continue;
-                       }
-
-                       /* report bogus origin */
-                       Sys_Printf( "%6d [%2d,%2d] (%4d): XYZ(%+4.1f %+4.1f %+4.1f) LO(%+4.1f %+4.1f %+4.1f) HI(%+4.1f %+4.1f %+4.1f) <%3.0f>\n",
-                                               rawLightmapNum, x, y, *cluster,
-                                               origin[ 0 ], origin[ 1 ], origin[ 2 ],
-                                               mins[ 0 ], mins[ 1 ], mins[ 2 ],
-                                               maxs[ 0 ], maxs[ 1 ], maxs[ 2 ],
-                                               luxel[ 3 ] );
-               }
-       }
-       #endif
 }
 
 
@@ -2245,15 +2138,6 @@ void IlluminateRawLightmap( int rawLightmapNum ){
                                        normal = SUPER_NORMAL( x, y );
                                        flag = SUPER_FLAG( x, y );
 
-#if 0
-                                       ////////// 27's temp hack for testing edge clipping ////
-                                       if ( origin[0] == 0 && origin[1] == 0 && origin[2] == 0 ) {
-                                               lightLuxel[ 1 ] = 255;
-                                               lightLuxel[ 3 ] = 1.0f;
-                                               totalLighted++;
-                                       }
-                                       else
-#endif
                                        {
                                                /* set contribution count */
                                                lightLuxel[ 3 ] = 1.0f;
@@ -2734,44 +2618,6 @@ void IlluminateRawLightmap( int rawLightmapNum ){
                }
        }
 
-
-#if 0
-       // audit pass
-       for ( lightmapNum = 0; lightmapNum < MAX_LIGHTMAPS; lightmapNum++ )
-       {
-               /* early out */
-               if ( lm->superLuxels[ lightmapNum ] == NULL ) {
-                       continue;
-               }
-               for ( y = 0; y < lm->sh; y++ )
-                       for ( x = 0; x < lm->sw; x++ )
-                       {
-                               /* get cluster */
-                               cluster = SUPER_CLUSTER( x, y );
-                               luxel = SUPER_LUXEL( lightmapNum, x, y );
-                               deluxel = SUPER_DELUXEL( x, y );
-                               if ( !luxel || !deluxel || !cluster ) {
-                                       Sys_FPrintf( SYS_VRB, "WARNING: I got NULL'd.\n" );
-                                       continue;
-                               }
-                               else if ( *cluster < 0 ) {
-                                       // unmapped pixel
-                                       // should have neither deluxemap nor lightmap
-                                       if ( deluxel[3] ) {
-                                               Sys_FPrintf( SYS_VRB, "WARNING: I have written deluxe to an unmapped luxel. Sorry.\n" );
-                                       }
-                               }
-                               else
-                               {
-                                       // mapped pixel
-                                       // should have both deluxemap and lightmap
-                                       if ( deluxel[3] ) {
-                                               Sys_FPrintf( SYS_VRB, "WARNING: I forgot to write deluxe to a mapped luxel. Sorry.\n" );
-                                       }
-                               }
-                       }
-       }
-#endif
 }
 
 
@@ -3997,21 +3843,6 @@ void CreateTraceLightsForBounds( vec3_t mins, vec3_t maxs, vec3_t normal, int nu
                                lightsEnvelopeCulled++;
                                continue;
                        }
-
-                       /* check bounding box against light's pvs envelope (note: this code never eliminated any lights, so disabling it) */
-                       #if 0
-                       skip = qfalse;
-                       for ( i = 0; i < 3; i++ )
-                       {
-                               if ( mins[ i ] > light->maxs[ i ] || maxs[ i ] < light->mins[ i ] ) {
-                                       skip = qtrue;
-                               }
-                       }
-                       if ( skip ) {
-                               lightsBoundsCulled++;
-                               continue;
-                       }
-                       #endif
                }
 
                /* planar surfaces (except twosided surfaces) have a couple more checks */
@@ -4376,61 +4207,6 @@ void FloodLightRawLightmapPass( rawLightmap_t *lm, vec3_t lmFloodLightRGB, float
 
        /* testing no filtering */
        return;
-
-#if 0
-
-       /* filter "dirt" */
-       for ( y = 0; y < lm->sh; y++ )
-       {
-               for ( x = 0; x < lm->sw; x++ )
-               {
-                       /* get luxel */
-                       cluster = SUPER_CLUSTER( x, y );
-                       floodlight = SUPER_FLOODLIGHT( x, y );
-
-                       /* filter dirt by adjacency to unmapped luxels */
-                       average = *floodlight;
-                       samples = 1.0f;
-                       for ( sy = ( y - 1 ); sy <= ( y + 1 ); sy++ )
-                       {
-                               if ( sy < 0 || sy >= lm->sh ) {
-                                       continue;
-                               }
-
-                               for ( sx = ( x - 1 ); sx <= ( x + 1 ); sx++ )
-                               {
-                                       if ( sx < 0 || sx >= lm->sw || ( sx == x && sy == y ) ) {
-                                               continue;
-                                       }
-
-                                       /* get neighboring luxel */
-                                       cluster = SUPER_CLUSTER( sx, sy );
-                                       floodlight2 = SUPER_FLOODLIGHT( sx, sy );
-                                       if ( *cluster < 0 || *floodlight2 <= 0.0f ) {
-                                               continue;
-                                       }
-
-                                       /* add it */
-                                       average += *floodlight2;
-                                       samples += 1.0f;
-                               }
-
-                               /* bail */
-                               if ( samples <= 0.0f ) {
-                                       break;
-                               }
-                       }
-
-                       /* bail */
-                       if ( samples <= 0.0f ) {
-                               continue;
-                       }
-
-                       /* scale dirt */
-                       *floodlight = average / samples;
-               }
-       }
-#endif
 }
 
 void FloodLightRawLightmap( int rawLightmapNum ){
index 462331f1ad79ebdef34173719157122209db6f18..4772c15bcd1bb5a98937d5a23938a85a9851f298 100644 (file)
@@ -357,7 +357,6 @@ void FinishRawLightmap( rawLightmap_t *lm ){
                is = 1.0f / superSample;
 
                /* scale the vectors and shift the origin */
-               #if 1
                /* new code that works for arbitrary supersampling values */
                VectorMA( lm->origin, -0.5, lm->vecs[ 0 ], lm->origin );
                VectorMA( lm->origin, -0.5, lm->vecs[ 1 ], lm->origin );
@@ -365,13 +364,6 @@ void FinishRawLightmap( rawLightmap_t *lm ){
                VectorScale( lm->vecs[ 1 ], is, lm->vecs[ 1 ] );
                VectorMA( lm->origin, is, lm->vecs[ 0 ], lm->origin );
                VectorMA( lm->origin, is, lm->vecs[ 1 ], lm->origin );
-               #else
-               /* old code that only worked with a value of 2 */
-               VectorScale( lm->vecs[ 0 ], is, lm->vecs[ 0 ] );
-               VectorScale( lm->vecs[ 1 ], is, lm->vecs[ 1 ] );
-               VectorMA( lm->origin, -is, lm->vecs[ 0 ], lm->origin );
-               VectorMA( lm->origin, -is, lm->vecs[ 1 ], lm->origin );
-               #endif
        }
 
        /* allocate bsp lightmap storage */
@@ -1733,22 +1725,6 @@ static qboolean ApproximateLightmap( rawLightmap_t *lm ){
                return qfalse;
        }
 
-       /* test for jmonroe */
-       #if 0
-       /* don't approx lightmaps with styled twins */
-       if ( lm->numStyledTwins > 0 ) {
-               return qfalse;
-       }
-
-       /* don't approx lightmaps with styles */
-       for ( i = 1; i < MAX_LIGHTMAPS; i++ )
-       {
-               if ( lm->styles[ i ] != LS_NONE ) {
-                       return qfalse;
-               }
-       }
-       #endif
-
        /* assume reduced until shadow detail is found */
        approximated = qtrue;
 
index d786fc541190ea692d4d7d0ffb521514d020af33..0001fa9cdd15d2f46ee5a6d15979a96a7719d847 100644 (file)
@@ -581,24 +581,10 @@ void AddBrushBevels( void ){
                        // see if the plane is allready present
                        for ( i = 0, s = buildBrush->sides; i < buildBrush->numsides; i++, s++ )
                        {
-                               /* ydnar: testing disabling of mre code */
-                               #if 0
-                               if ( dir > 0 ) {
-                                       if ( mapplanes[s->planenum].normal[axis] >= 0.9999f ) {
-                                               break;
-                                       }
-                               }
-                               else {
-                                       if ( mapplanes[s->planenum].normal[axis] <= -0.9999f ) {
-                                               break;
-                                       }
-                               }
-                               #else
                                if ( ( dir > 0 && mapplanes[ s->planenum ].normal[ axis ] == 1.0f ) ||
                                         ( dir < 0 && mapplanes[ s->planenum ].normal[ axis ] == -1.0f ) ) {
                                        break;
                                }
-                               #endif
                        }
 
                        if ( i == buildBrush->numsides ) {
index 94a80487451e22086c798d2679b1c8e3c0125cb3..40ed72b8b9920777ba39f0beceb9881503e912db 100644 (file)
@@ -175,25 +175,7 @@ picoModel_t *LoadModel( const char *name, int frame ){
                PicoSetModelName( *pm, name );
                PicoSetModelFrameNum( *pm, frame );
        }
-
-       /* debug code */
-       #if 0
-       {
-               int numSurfaces, numVertexes;
-               picoSurface_t   *ps;
-
-
-               Sys_Printf( "Model %s\n", name );
-               numSurfaces = PicoGetModelNumSurfaces( *pm );
-               for ( i = 0; i < numSurfaces; i++ )
-               {
-                       ps = PicoGetModelSurface( *pm, i );
-                       numVertexes = PicoGetSurfaceNumVertexes( ps );
-                       Sys_Printf( "Surface %d has %d vertexes\n", i, numVertexes );
-               }
-       }
-       #endif
-
+       
        /* set count */
        if ( *pm != NULL ) {
                numPicoModels++;
index aee1446ea5a4fb237299f4ac1c11c644ae1438c9..2b77f3d3d376b764ba773f6f8de2cf23a88a97c5 100644 (file)
@@ -345,16 +345,6 @@ void MakeNodePortal( node_t *node ){
                return;
        }
 
-
-       /* ydnar: adding this here to fix degenerate windings */
-       #if 0
-       if ( FixWinding( w ) == qfalse ) {
-               c_badportals++;
-               FreeWinding( w );
-               return;
-       }
-       #endif
-
        if ( WindingIsTiny( w ) ) {
                c_tinyportals++;
                FreeWinding( w );
index 2cd7015c35acb47090c90e996b8121cfcfdb9a25..0998a95aee4843605a204dbf9685a69ce73432eb 100644 (file)
@@ -278,19 +278,11 @@ void WriteFaceFile_r( node_t *node ){
    ================
  */
 void NumberLeafs_r( node_t *node, int c ){
-#if 0
-       portal_t    *p;
-#endif
        if ( node->planenum != PLANENUM_LEAF ) {
                // decision node
                node->cluster = -99;
 
                if ( node->has_structural_children ) {
-#if 0
-                       if ( c >= 0 ) {
-                               Sys_FPrintf( SYS_ERR,"THIS CANNOT HAPPEN\n" );
-                       }
-#endif
                        NumberLeafs_r( node->children[0], c );
                        NumberLeafs_r( node->children[1], c );
                }
@@ -318,29 +310,6 @@ void NumberLeafs_r( node_t *node, int c ){
        }
 
        node->cluster = c;
-
-#if 0
-       // count the portals
-       for ( p = node->portals ; p ; )
-       {
-               if ( p->nodes[0] == node ) {      // only write out from first leaf
-                       if ( PortalPassable( p ) ) {
-                               num_visportals++;
-                       }
-                       else{
-                               num_solidfaces++;
-                       }
-                       p = p->next[0];
-               }
-               else
-               {
-                       if ( !PortalPassable( p ) ) {
-                               num_solidfaces++;
-                       }
-                       p = p->next[1];
-               }
-       }
-#endif
 }
 
 
index 7bbbc42be5e2cf4e5d011b59061152fce98dd1d2..6ec56ee11cd67c1e51f04fb8207a2f6cf0e9e159 100644 (file)
        #define MAC_STATIC
 #endif
 
-#if 1
-       #ifdef WIN32
-               #define Q_stricmp           stricmp
-               #define Q_strncasecmp       strnicmp
-       #else
-               #define Q_stricmp           strcasecmp
-               #define Q_strncasecmp       strncasecmp
-       #endif
+#ifdef WIN32
+       #define Q_stricmp           stricmp
+       #define Q_strncasecmp       strnicmp
+#else
+       #define Q_stricmp           strcasecmp
+       #define Q_strncasecmp       strncasecmp
 #endif
 
 /* macro version */
index 75cab6b0d771503ddf24f9d4fa6fe34c40c89085..58b0157cb6caf8c385ca157486495b8046e3a7ba 100644 (file)
@@ -1975,17 +1975,6 @@ static void ParseShaderFile( const char *filename ){
                                else if ( !Q_stricmp( token, "q3map_styleMarker2" ) ) {  /* uses depthFunc equal */
                                        si->styleMarker = 2;
                                }
-
-                               /* ydnar: default to searching for q3map_<surfaceparm> */
-#if 0
-                               else
-                               {
-                                       Sys_FPrintf( SYS_VRB, "Attempting to match %s with a known surfaceparm\n", token );
-                                       if ( ApplySurfaceParm( &token[ 6 ], &si->contentFlags, &si->surfaceFlags, &si->compileFlags ) == qfalse ) {
-                                               Sys_Printf( "WARNING: Unknown q3map_* directive \"%s\"\n", token );
-                                       }
-                               }
-#endif
                        }
 
 
index 2aeda857975d703cff070dd3c38b39b776c77f5e..20ea6f0eb8127082f5a182bc0c9140bb78f9de53 100644 (file)
@@ -717,36 +717,6 @@ byte GetShaderIndexForPoint( indexMap_t *im, vec3_t eMins, vec3_t eMaxs, vec3_t
                return 0;
        }
 
-       /* this code is really broken */
-       #if 0
-       /* legacy precision fudges for terrain */
-       for ( i = 0; i < 3; i++ )
-       {
-               mins[ i ] = floor( eMins[ i ] + 0.1 );
-               maxs[ i ] = floor( eMaxs[ i ] + 0.1 );
-               size[ i ] = maxs[ i ] - mins[ i ];
-       }
-
-       /* find st (fixme: support more than just z-axis projection) */
-       s = floor( point[ 0 ] + 0.1f - mins[ 0 ] ) / size[ 0 ];
-       t = floor( maxs[ 1 ] - point[ 1 ] + 0.1f ) / size[ 1 ];
-       if ( s < 0.0f ) {
-               s = 0.0f;
-       }
-       else if ( s > 1.0f ) {
-               s = 1.0f;
-       }
-       if ( t < 0.0f ) {
-               t = 0.0f;
-       }
-       else if ( t > 1.0f ) {
-               t = 1.0f;
-       }
-
-       /* make xy */
-       x = ( im->w - 1 ) * s;
-       y = ( im->h - 1 ) * t;
-       #else
        /* get size */
        for ( i = 0; i < 3; i++ )
        {
@@ -774,7 +744,6 @@ byte GetShaderIndexForPoint( indexMap_t *im, vec3_t eMins, vec3_t eMaxs, vec3_t
        else if ( y > ( im->h - 1 ) ) {
                y = ( im->h - 1 );
        }
-       #endif
 
        /* return index */
        return im->pixels[ y * im->w + x ];
@@ -2167,23 +2136,6 @@ int FilterWindingIntoTree_r( winding_t *w, mapDrawSurface_t *ds, node_t *node ){
                        p2 = &mapplanes[ ds->planeNum ];
                        VectorCopy( p2->normal, plane2 );
                        plane2[ 3 ] = p2->dist;
-
-                       #if 0
-                       /* div0: this is the plague (inaccurate) */
-                       vec4_t reverse;
-
-                       /* invert surface plane */
-                       VectorSubtract( vec3_origin, plane2, reverse );
-                       reverse[ 3 ] = -plane2[ 3 ];
-
-                       /* compare planes */
-                       if ( DotProduct( plane1, plane2 ) > 0.999f && fabs( plane1[ 3 ] - plane2[ 3 ] ) < 0.001f ) {
-                               return FilterWindingIntoTree_r( w, ds, node->children[ 0 ] );
-                       }
-                       if ( DotProduct( plane1, reverse ) > 0.999f && fabs( plane1[ 3 ] - reverse[ 3 ] ) < 0.001f ) {
-                               return FilterWindingIntoTree_r( w, ds, node->children[ 1 ] );
-                       }
-                       #else
                        /* div0: this is the cholera (doesn't hit enough) */
 
                        /* the drawsurf might have an associated plane, if so, force a filter here */
@@ -2193,7 +2145,6 @@ int FilterWindingIntoTree_r( winding_t *w, mapDrawSurface_t *ds, node_t *node ){
                        if ( ds->planeNum == ( node->planenum ^ 1 ) ) {
                                return FilterWindingIntoTree_r( w, ds, node->children[ 1 ] );
                        }
-                       #endif
                }
 
                /* clip the winding by this plane */
index 8d4f3c36ffdc009bdab45be92fa8b5600bbfbe49..83832e86acb9214c9722fdf4b759c75c695edcb0 100644 (file)
@@ -1090,14 +1090,6 @@ void FixMetaTJunctions( void ){
                                        continue;
                                }
 
-                               #if 0
-                               dist = DotProduct( pt, edges[ k ].edge ) - edges[ k ].edge[ 3 ];
-                               if ( dist <= -0.0f || dist >= edges[ k ].length ) {
-                                       continue;
-                               }
-                               amount = dist / edges[ k ].length;
-                               #endif
-
                                /* the edge opposite the zero-weighted vertex was hit, so use that as an amount */
                                a = &metaVerts[ tri->indexes[ k % 3 ] ];
                                b = &metaVerts[ tri->indexes[ ( k + 1 ) % 3 ] ];
@@ -1450,14 +1442,6 @@ static int AddMetaTriangleToSurface( mapDrawSurface_t *ds, metaTriangle_t *tri,
        if ( ds->shaderInfo != tri->si || ds->fogNum != tri->fogNum || ds->sampleSize != tri->sampleSize ) {
                return 0;
        }
-       #if 0
-       if ( !( ds->shaderInfo->compileFlags & C_VERTEXLIT ) &&
-            //% VectorCompare( ds->lightmapAxis, tri->lightmapAxis ) == qfalse )
-                DotProduct( ds->lightmapAxis, tri->plane ) < 0.25f ) {
-               return 0;
-       }
-       #endif
-
        /* planar surfaces will only merge with triangles in the same plane */
        if ( npDegrees == 0.0f && ds->shaderInfo->nonplanar == qfalse && ds->planeNum >= 0 ) {
                if ( VectorCompare( mapplanes[ ds->planeNum ].normal, tri->plane ) == qfalse || mapplanes[ ds->planeNum ].dist != tri->plane[ 3 ] ) {
@@ -1817,37 +1801,6 @@ static int CompareMetaTriangles( const void *a, const void *b ){
                return -1;
        }
 
-       /* then plane */
-       #if 0
-       else if ( npDegrees == 0.0f && ( (const metaTriangle_t*) a )->si->nonplanar == qfalse &&
-                         ( (const metaTriangle_t*) a )->planeNum >= 0 && ( (const metaTriangle_t*) a )->planeNum >= 0 ) {
-               if ( ( (const metaTriangle_t*) a )->plane[ 3 ] < ( (const metaTriangle_t*) b )->plane[ 3 ] ) {
-                       return 1;
-               }
-               else if ( ( (const metaTriangle_t*) a )->plane[ 3 ] > ( (const metaTriangle_t*) b )->plane[ 3 ] ) {
-                       return -1;
-               }
-               else if ( ( (const metaTriangle_t*) a )->plane[ 0 ] < ( (const metaTriangle_t*) b )->plane[ 0 ] ) {
-                       return 1;
-               }
-               else if ( ( (const metaTriangle_t*) a )->plane[ 0 ] > ( (const metaTriangle_t*) b )->plane[ 0 ] ) {
-                       return -1;
-               }
-               else if ( ( (const metaTriangle_t*) a )->plane[ 1 ] < ( (const metaTriangle_t*) b )->plane[ 1 ] ) {
-                       return 1;
-               }
-               else if ( ( (const metaTriangle_t*) a )->plane[ 1 ] > ( (const metaTriangle_t*) b )->plane[ 1 ] ) {
-                       return -1;
-               }
-               else if ( ( (const metaTriangle_t*) a )->plane[ 2 ] < ( (const metaTriangle_t*) b )->plane[ 2 ] ) {
-                       return 1;
-               }
-               else if ( ( (const metaTriangle_t*) a )->plane[ 2 ] > ( (const metaTriangle_t*) b )->plane[ 2 ] ) {
-                       return -1;
-               }
-       }
-       #endif
-
        /* then position in world */
 
        /* find mins */
index efbfffdec3323a880f881b38f6e81515540cae4d..d6c922623477329e6551020b3635d42996911c9c 100644 (file)
@@ -301,7 +301,6 @@ fixedWinding_t  *ClipToSeperators( fixedWinding_t *source, fixedWinding_t *pass,
                        // find out which side of the generated seperating plane has the
                        // source portal
                        //
-#if 1
                        fliptest = qfalse;
                        for ( k = 0 ; k < source->numpoints ; k++ )
                        {
@@ -323,9 +322,7 @@ fixedWinding_t  *ClipToSeperators( fixedWinding_t *source, fixedWinding_t *pass,
                        if ( k == source->numpoints ) {
                                continue;       // planar with source portal
                        }
-#else
-                       fliptest = flipclip;
-#endif
+
                        //
                        // flip the normal if the source portal is backwards
                        //
@@ -333,7 +330,6 @@ fixedWinding_t  *ClipToSeperators( fixedWinding_t *source, fixedWinding_t *pass,
                                VectorSubtract( vec3_origin, plane.normal, plane.normal );
                                plane.dist = -plane.dist;
                        }
-#if 1
                        //
                        // if all of the pass portal points are now on the positive side,
                        // this is the seperating plane
@@ -362,18 +358,7 @@ fixedWinding_t  *ClipToSeperators( fixedWinding_t *source, fixedWinding_t *pass,
                        if ( !counts[0] ) {
                                continue;   // planar with seperating plane
                        }
-#else
-                       k = ( j + 1 ) % pass->numpoints;
-                       d = DotProduct( pass->points[k], plane.normal ) - plane.dist;
-                       if ( d < -ON_EPSILON ) {
-                               continue;
-                       }
-                       k = ( j + pass->numpoints - 1 ) % pass->numpoints;
-                       d = DotProduct( pass->points[k], plane.normal ) - plane.dist;
-                       if ( d < -ON_EPSILON ) {
-                               continue;
-                       }
-#endif
+
                        //
                        // flip the normal if we want the back side
                        //
@@ -510,15 +495,12 @@ void RecursiveLeafFlow( int leafnum, threaddata_t *thread, pstack_t *prevstack )
                VectorSubtract( vec3_origin, p->plane.normal, backplane.normal );
                backplane.dist = -p->plane.dist;
 
-//             c_portalcheck++;
-
                stack.portal = p;
                stack.next = NULL;
                stack.freewindings[0] = 1;
                stack.freewindings[1] = 1;
                stack.freewindings[2] = 1;
 
-#if 1
                {
                        float d;
 
@@ -538,15 +520,7 @@ void RecursiveLeafFlow( int leafnum, threaddata_t *thread, pstack_t *prevstack )
                                }
                        }
                }
-#else
-               stack.pass = VisChopWinding( p->winding, &stack, &thread->pstack_head.portalplane );
-               if ( !stack.pass ) {
-                       continue;
-               }
-#endif
 
-
-#if 1
                {
                        float d;
 
@@ -571,12 +545,6 @@ void RecursiveLeafFlow( int leafnum, threaddata_t *thread, pstack_t *prevstack )
                                }
                        }
                }
-#else
-               stack.source = VisChopWinding( prevstack->source, &stack, &backplane );
-               if ( !stack.source ) {
-                       continue;
-               }
-#endif
 
                if ( !prevstack->pass ) { // the second leaf can only be blocked if coplanar
 
@@ -883,15 +851,12 @@ void RecursivePassagePortalFlow( vportal_t *portal, threaddata_t *thread, pstack
                VectorSubtract( vec3_origin, p->plane.normal, backplane.normal );
                backplane.dist = -p->plane.dist;
 
-//             c_portalcheck++;
-
                stack.portal = p;
                stack.next = NULL;
                stack.freewindings[0] = 1;
                stack.freewindings[1] = 1;
                stack.freewindings[2] = 1;
 
-#if 1
                {
                        float d;
 
@@ -911,15 +876,7 @@ void RecursivePassagePortalFlow( vportal_t *portal, threaddata_t *thread, pstack
                                }
                        }
                }
-#else
-               stack.pass = VisChopWinding( p->winding, &stack, &thread->pstack_head.portalplane );
-               if ( !stack.pass ) {
-                       continue;
-               }
-#endif
-
 
-#if 1
                {
                        float d;
 
@@ -944,12 +901,6 @@ void RecursivePassagePortalFlow( vportal_t *portal, threaddata_t *thread, pstack
                                }
                        }
                }
-#else
-               stack.source = VisChopWinding( prevstack->source, &stack, &backplane );
-               if ( !stack.source ) {
-                       continue;
-               }
-#endif
 
                if ( !prevstack->pass ) { // the second leaf can only be blocked if coplanar
 
@@ -1208,7 +1159,6 @@ int AddSeperators( fixedWinding_t *source, fixedWinding_t *pass, qboolean flipcl
                        // find out which side of the generated seperating plane has the
                        // source portal
                        //
-#if 1
                        fliptest = qfalse;
                        for ( k = 0 ; k < source->numpoints ; k++ )
                        {
@@ -1230,9 +1180,7 @@ int AddSeperators( fixedWinding_t *source, fixedWinding_t *pass, qboolean flipcl
                        if ( k == source->numpoints ) {
                                continue;       // planar with source portal
                        }
-#else
-                       fliptest = flipclip;
-#endif
+
                        //
                        // flip the normal if the source portal is backwards
                        //
@@ -1240,7 +1188,7 @@ int AddSeperators( fixedWinding_t *source, fixedWinding_t *pass, qboolean flipcl
                                VectorSubtract( vec3_origin, plane.normal, plane.normal );
                                plane.dist = -plane.dist;
                        }
-#if 1
+
                        //
                        // if all of the pass portal points are now on the positive side,
                        // this is the seperating plane
@@ -1269,18 +1217,7 @@ int AddSeperators( fixedWinding_t *source, fixedWinding_t *pass, qboolean flipcl
                        if ( !counts[0] ) {
                                continue;   // planar with seperating plane
                        }
-#else
-                       k = ( j + 1 ) % pass->numpoints;
-                       d = DotProduct( pass->points[k], plane.normal ) - plane.dist;
-                       if ( d < -ON_EPSILON ) {
-                               continue;
-                       }
-                       k = ( j + pass->numpoints - 1 ) % pass->numpoints;
-                       d = DotProduct( pass->points[k], plane.normal ) - plane.dist;
-                       if ( d < -ON_EPSILON ) {
-                               continue;
-                       }
-#endif
+
                        //
                        // flip the normal if we want the back side
                        //