Decouple <cstddef>

This commit is contained in:
Martin Natano
2023-04-20 11:21:29 +02:00
parent 093675cdc3
commit 78fb2e9fc3
171 changed files with 2012 additions and 1786 deletions
+21 -19
View File
@@ -5,6 +5,8 @@
#include "RageTypes.h"
#include "ModelTypes.h"
#include <cstddef>
#include <set>
class DisplaySpec;
@@ -12,7 +14,7 @@ typedef std::set<DisplaySpec> DisplaySpecs;
const int REFRESH_DEFAULT = 0;
struct RageSurface;
enum TextureUnit
enum TextureUnit
{
TextureUnit_1,
TextureUnit_2,
@@ -21,7 +23,7 @@ enum TextureUnit
NUM_TextureUnit
};
// RageCompiledGeometry holds vertex data in a format that is most efficient
// RageCompiledGeometry holds vertex data in a format that is most efficient
// for the graphics API.
class RageCompiledGeometry
{
@@ -35,8 +37,8 @@ public:
virtual void Draw( int iMeshIndex ) const = 0;
protected:
size_t GetTotalVertices() const { if( m_vMeshInfo.empty() ) return 0; return m_vMeshInfo.back().iVertexStart + m_vMeshInfo.back().iVertexCount; }
size_t GetTotalTriangles() const { if( m_vMeshInfo.empty() ) return 0; return m_vMeshInfo.back().iTriangleStart + m_vMeshInfo.back().iTriangleCount; }
std::size_t GetTotalVertices() const { if( m_vMeshInfo.empty() ) return 0; return m_vMeshInfo.back().iVertexStart + m_vMeshInfo.back().iVertexCount; }
std::size_t GetTotalTriangles() const { if( m_vMeshInfo.empty() ) return 0; return m_vMeshInfo.back().iTriangleStart + m_vMeshInfo.back().iTriangleCount; }
struct MeshInfo
{
@@ -77,7 +79,7 @@ class VideoModeParams
public:
// Initialize with a constructor so to guarantee all paramters
// are filled (in case new params are added).
VideoModeParams(
VideoModeParams(
bool windowed_,
RString sDisplayId_,
int width_,
@@ -252,17 +254,17 @@ public:
virtual void BeginConcurrentRendering();
virtual void EndConcurrentRendering() { }
/* return 0 if failed or internal texture resource handle
/* return 0 if failed or internal texture resource handle
* (unsigned in OpenGL, texture pointer in D3D) */
virtual uintptr_t CreateTexture(
virtual uintptr_t CreateTexture(
RagePixelFormat pixfmt, // format of img and of texture in video mem
RageSurface* img, // must be in pixfmt
bool bGenerateMipMaps
) = 0;
virtual void UpdateTexture(
uintptr_t iTexHandle,
virtual void UpdateTexture(
uintptr_t iTexHandle,
RageSurface* img,
int xoffset, int yoffset, int width, int height
int xoffset, int yoffset, int width, int height
) = 0;
virtual void DeleteTexture( uintptr_t iTexHandle ) = 0;
/* Return an object to lock pixels for streaming. If not supported, returns nullptr.
@@ -309,7 +311,7 @@ public:
virtual void SetAlphaTest( bool b ) = 0;
virtual void SetMaterial(
virtual void SetMaterial(
const RageColor &emissive,
const RageColor &ambient,
const RageColor &diffuse,
@@ -319,11 +321,11 @@ public:
virtual void SetLighting( bool b ) = 0;
virtual void SetLightOff( int index ) = 0;
virtual void SetLightDirectional(
int index,
const RageColor &ambient,
const RageColor &diffuse,
const RageColor &specular,
virtual void SetLightDirectional(
int index,
const RageColor &ambient,
const RageColor &diffuse,
const RageColor &specular,
const RageVector3 &dir ) = 0;
virtual void SetSphereEnvironmentMapping( TextureUnit tu, bool b ) = 0;
@@ -412,7 +414,7 @@ public:
void TexturePushMatrix();
void TexturePopMatrix();
void TextureTranslate( float x, float y );
void TextureTranslate( const RageVector2 &v ) { this->TextureTranslate( v.x, v.y ); }
void TextureTranslate( const RageVector2 &v ) { this->TextureTranslate( v.x, v.y ); }
// Projection and View matrix stack functions.
void CameraPushMatrix();
@@ -435,8 +437,8 @@ protected:
RageMatrix GetPerspectiveMatrix( float fovy, float aspect, float zNear, float zFar );
// Different for D3D and OpenGL. Not sure why they're not compatible. -Chris
virtual RageMatrix GetOrthoMatrix( float l, float r, float b, float t, float zn, float zf );
virtual RageMatrix GetFrustumMatrix( float l, float r, float b, float t, float zn, float zf );
virtual RageMatrix GetOrthoMatrix( float l, float r, float b, float t, float zn, float zf );
virtual RageMatrix GetFrustumMatrix( float l, float r, float b, float t, float zn, float zf );
// Matrix that adjusts position and scale of image on the screen
RageMatrix GetCenteringMatrix( float fTranslateX, float fTranslateY, float fAddWidth, float fAddHeight ) const;