remove unused code (more Software renderer code)

This commit is contained in:
Edu García 2024-05-08 16:23:12 +01:00
parent 9cb68c2e74
commit a1900bc85b
13 changed files with 0 additions and 192 deletions

View File

@ -1,79 +0,0 @@
/*
* Descent 3
* Copyright (C) 2024 Parallax Software
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __IMESH_BUILDER_H__
#define __IMESH_BUILDER_H__
#include "IMeshHandle.h"
namespace RZ {
namespace Renderer {
class IMeshBuilder {
public:
enum PrimitiveType {
kTriangle,
kTriangleFan,
kTriangleStrip,
};
enum VertexType {
kPosition = 0x01,
kColor = 0x02,
kTexture1 = 0x04,
// kTexture2 = 0x08,
kNormal = 0x10,
};
virtual ~IMeshBuilder() {}
// Begin
// Begins the generation of a mesh. You must supply
// the primitive type, size of the vertex buffer, and
// the number of primitives.
// vertexFlags are a combination of VertexType values
// that represent what data should be stored in the verts.
virtual void Begin(PrimitiveType type, unsigned int vertexFlags, unsigned int numPrims, unsigned int numVerts,
bool autogenNormals) = 0;
// End
// Ends the build process which will cause the generation of the mesh data.
// Returned will be a handle to the mesh
virtual MeshHandle End(void) = 0;
// SetStreamData
// Stores stream data for one or more vertex fields.
// streamId: Which field we are setting data for
// startVertIndex: Which vertex in vertex buffer are we starting at
// numVerts: How many full verts of data are we processing
// dataPtr: Incoming data. All data is float based.
// elementsPerField: How many floats-per-field for this data.
// NOTE: This is for verification purposes. Positions and
// Normals are 3 elements. Texture UVs are 2 elements. Colors
// are 4 elements.
// stride: The number of bytes from the START of one field to the next on the incoming stream.
virtual void SetStreamData(VertexType streamId, unsigned int startVertIndex, unsigned int numVerts,
const float *dataPtr, unsigned int elementsPerField, unsigned int stride) = 0;
// AddPrimitive
// Adds another primitive to the buffer.
virtual void AddPrimitive(unsigned int numVerts, unsigned int *vertexIndices) = 0;
};
} // namespace Renderer
} // namespace RZ
#endif

View File

@ -1,36 +0,0 @@
/*
* Descent 3
* Copyright (C) 2024 Parallax Software
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __IMESH_HANDLE_H__
#define __IMESH_HANDLE_H__
#include <boost/config.hpp>
#include <boost/smart_ptr.hpp>
namespace RZ {
namespace Renderer {
class IMeshHandle {
public:
virtual ~IMeshHandle() {}
};
typedef boost::shared_ptr<IMeshHandle> MeshHandle;
} // namespace Renderer
} // namespace RZ
#endif

View File

@ -686,12 +686,4 @@ void *rend_RetrieveDirectDrawObj(void **frontsurf, void **backsurf);
#endif
#endif
///////////////////////////////////////////////////////////////
#include "../renderer/RendererConfig.h"
#ifdef USE_SOFTWARE_TNL
#include "IMeshBuilder.h"
RZ::Renderer::IMeshBuilder *rend_CreateMeshBuilder(void);
#endif
#endif

View File

@ -1,7 +1,6 @@
set(HEADERS
dyna_gl.h
HardwareInternal.h
RendererConfig.h
)
set(CPPS
HardwareClipper.cpp

View File

@ -16,9 +16,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "RendererConfig.h"
#ifndef USE_SOFTWARE_TNL
#include "pserror.h"
#include "3d.h"
#include "HardwareInternal.h"
@ -389,5 +386,3 @@ void g3_SetCustomClipPlane(ubyte state, vector *pnt, vector *normal) {
vm_NormalizeVector(&Clip_plane);
}
}
#endif

View File

@ -16,9 +16,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "RendererConfig.h"
#ifndef USE_SOFTWARE_TNL
#include "3d.h"
#include "HardwareInternal.h"
#include "renderer.h"
@ -435,5 +432,3 @@ void g3_DrawBox(ddgr_color color, g3Point *pnt, float rad) {
// Sets the triangulation test to on or off
void g3_SetTriangulationTest(int state) { Triangulate_test = state; }
#endif

View File

@ -16,9 +16,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "RendererConfig.h"
#ifndef USE_SOFTWARE_TNL
#include "3d.h"
#include "HardwareInternal.h"
#include <float.h>
@ -47,5 +44,3 @@ float gTransformViewPort[4][4];
float gTransformProjection[4][4];
float gTransformModelView[4][4];
float gTransformFull[4][4];
#endif

View File

@ -16,9 +16,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "RendererConfig.h"
#ifndef USE_SOFTWARE_TNL
#include "3d.h"
#include "HardwareInternal.h"
#include <string.h>
@ -91,5 +88,3 @@ void g3_DoneInstance() {
memcpy(gTransformModelView, sInstanceStack[sInstanceDepth].m_modelView, sizeof(gTransformModelView));
g3_UpdateFullTransform();
}
#endif

View File

@ -16,9 +16,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "RendererConfig.h"
#ifndef USE_SOFTWARE_TNL
#include "byteswap.h"
#if defined(WIN32)
#include <windows.h>
@ -3204,5 +3201,3 @@ void rend_TransformSetModelView(float trans[4][4]) {
dglMatrixMode(GL_MODELVIEW);
dglLoadMatrixf(&trans[0][0]);
}
#endif

View File

@ -16,9 +16,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "RendererConfig.h"
#ifndef USE_SOFTWARE_TNL
#include "3d.h"
#include "HardwareInternal.h"
#include <string.h>
@ -149,5 +146,3 @@ float g3_CalcPointDepth(vector *pnt) {
return ((pnt->x - View_position.x) * View_matrix.fvec.x) + ((pnt->y - View_position.y) * View_matrix.fvec.y) +
((pnt->z - View_position.z) * View_matrix.fvec.z);
}
#endif

View File

@ -16,9 +16,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "RendererConfig.h"
#ifndef USE_SOFTWARE_TNL
#include <stdlib.h>
#include <string.h>
#include "3d.h"
@ -162,5 +159,3 @@ void g3_GetUnscaledMatrix(matrix *mat) { *mat = Unscaled_matrix; }
// Gets the matrix scale vector
void g3_GetMatrixScale(vector *matrix_scale) { *matrix_scale = Matrix_scale; }
#endif

View File

@ -16,9 +16,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "RendererConfig.h"
#ifndef USE_SOFTWARE_TNL
#include "3d.h"
#include "pserror.h"
#include "HardwareInternal.h"
@ -115,5 +112,3 @@ void g3_RefreshTransforms(bool usePassthru) {
// store the pass-thru
sUseTransformPassthru = (usePassthru) ? 1 : 0;
}
#endif

View File

@ -1,28 +0,0 @@
/*
* Descent 3
* Copyright (C) 2024 Parallax Software
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __RENDERER_CONFIG_H__
#define __RENDERER_CONFIG_H__
// use this to toggle "Hardware T&L" vs. "Software"
// #define USE_SOFTWARE_TNL
// JEFF: I PUT THIS IN TO MAKE THINGS A LITTLE BRIGHTER SO I CAN SEE WHILE TESTING
// #define BRIGHTNESS_HACK 1.6f
#endif