Started work on build system

This commit is contained in:
2025-05-31 00:42:41 +03:00
parent 953cca2aa4
commit ade32c24a6
33 changed files with 369 additions and 498 deletions

View File

@@ -8,8 +8,6 @@ public:
virtual void Spawn( void ) override;
virtual void Destroy( void ) override;
virtual void Think( float fDelta ) override;
IVertexBuffer *vertexBuffer;
IMesh *mesh;
};
void C_Light::Precache()
@@ -19,56 +17,7 @@ void C_Light::Precache()
void C_Light::Spawn()
{
float cubeVertices[] = {
-0.5f, -0.5f, 0.5f, 0.0f, 0.0f,
0.5f, -0.5f, 0.5f, 1.0f, 0.0f,
0.5f, 0.5f, 0.5f, 1.0f, 1.0f,
0.5f, 0.5f, 0.5f, 1.0f, 1.0f,
-0.5f, 0.5f, 0.5f, 0.0f, 1.0f,
-0.5f, -0.5f, 0.5f, 0.0f, 0.0f,
-0.5f, -0.5f, -0.5f, 1.0f, 0.0f,
-0.5f, 0.5f, -0.5f, 1.0f, 1.0f,
0.5f, 0.5f, -0.5f, 0.0f, 1.0f,
0.5f, 0.5f, -0.5f, 0.0f, 1.0f,
0.5f, -0.5f, -0.5f, 0.0f, 0.0f,
-0.5f, -0.5f, -0.5f, 1.0f, 0.0f,
-0.5f, 0.5f, 0.5f, 1.0f, 0.0f,
-0.5f, 0.5f, -0.5f, 1.0f, 1.0f,
-0.5f, -0.5f, -0.5f, 0.0f, 1.0f,
-0.5f, -0.5f, -0.5f, 0.0f, 1.0f,
-0.5f, -0.5f, 0.5f, 0.0f, 0.0f,
-0.5f, 0.5f, 0.5f, 1.0f, 0.0f,
0.5f, 0.5f, 0.5f, 1.0f, 0.0f,
0.5f, -0.5f, -0.5f, 0.0f, 1.0f,
0.5f, 0.5f, -0.5f, 1.0f, 1.0f,
0.5f, -0.5f, -0.5f, 0.0f, 1.0f,
0.5f, 0.5f, 0.5f, 1.0f, 0.0f,
0.5f, -0.5f, 0.5f, 0.0f, 0.0f,
-0.5f, 0.5f, -0.5f, 0.0f, 1.0f,
-0.5f, 0.5f, 0.5f, 0.0f, 0.0f,
0.5f, 0.5f, 0.5f, 1.0f, 0.0f,
0.5f, 0.5f, 0.5f, 1.0f, 0.0f,
0.5f, 0.5f, -0.5f, 1.0f, 1.0f,
-0.5f, 0.5f, -0.5f, 0.0f, 1.0f,
-0.5f, -0.5f, -0.5f, 1.0f, 1.0f,
0.5f, -0.5f, -0.5f, 0.0f, 1.0f,
0.5f, -0.5f, 0.5f, 0.0f, 0.0f,
0.5f, -0.5f, 0.5f, 0.0f, 0.0f,
-0.5f, -0.5f, 0.5f, 1.0f, 0.0f,
-0.5f, -0.5f, -0.5f, 1.0f, 1.0f,
};
vertexBuffer = IRenderer::CreateVertexBuffer(sizeof(cubeVertices));
void *pTriangles = vertexBuffer->Map();
V_memcpy(pTriangles, cubeVertices, sizeof(cubeVertices));
vertexBuffer->Unmap();
mesh = IMeshRenderer::CreateMesh();
mesh->SetVertexBuffer(vertexBuffer);
};
void C_Light::Destroy()
@@ -77,9 +26,7 @@ void C_Light::Destroy()
}
void C_Light::Think( float fDelta )
{
IRenderer::SetMaterial(0);
mesh->SetMatrix(pEntity->m_matrix);
mesh->Draw();
};
LINK_CLIENT_ENTITY(C_Light, CLight)