Removes GL types from regular renderer code after 3ed4eaf247
.
This was SVN commit r26920.
This commit is contained in:
parent
54aae3e6d4
commit
b0c29b8676
@ -700,7 +700,7 @@ typename M::mapped_type& PooledPairGet(M& m, const typename M::key_type& k, Aren
|
||||
}
|
||||
|
||||
// Each multidraw batch has a list of index counts, and a list of pointers-to-first-indexes
|
||||
using BatchElements = std::pair<std::vector<GLint, ProxyAllocator<GLint, Arena>>, std::vector<u32, ProxyAllocator<u32, Arena>>>;
|
||||
using BatchElements = std::pair<std::vector<u32, ProxyAllocator<u32, Arena>>, std::vector<u32, ProxyAllocator<u32, Arena>>>;
|
||||
|
||||
// Group batches by index buffer
|
||||
using IndexBufferBatches = PooledBatchMap<CVertexBuffer*, BatchElements>;
|
||||
@ -1123,7 +1123,7 @@ void CPatchRData::RenderStreams(
|
||||
PROFILE3("render terrain streams");
|
||||
|
||||
// Each batch has a list of index counts, and a list of pointers-to-first-indexes
|
||||
using StreamBatchElements = std::pair<std::vector<GLint>, std::vector<u32>>;
|
||||
using StreamBatchElements = std::pair<std::vector<u32>, std::vector<u32>>;
|
||||
|
||||
// Group batches by index buffer
|
||||
using StreamIndexBufferBatches = std::map<CVertexBuffer*, StreamBatchElements>;
|
||||
@ -1249,7 +1249,7 @@ void CPatchRData::RenderSides(
|
||||
deviceCommandContext->SetVertexBuffer(0, patch->m_VBSides->m_Owner->GetBuffer());
|
||||
}
|
||||
|
||||
deviceCommandContext->Draw(patch->m_VBSides->m_Index, (GLsizei)patch->m_VBSides->m_Count);
|
||||
deviceCommandContext->Draw(patch->m_VBSides->m_Index, patch->m_VBSides->m_Count);
|
||||
|
||||
// bump stats
|
||||
g_Renderer.m_Stats.m_DrawCalls++;
|
||||
@ -1311,13 +1311,13 @@ void CPatchRData::BuildWater()
|
||||
|
||||
// Build data for water
|
||||
std::vector<SWaterVertex> water_vertex_data;
|
||||
std::vector<GLushort> water_indices;
|
||||
std::vector<u16> water_indices;
|
||||
u16 water_index_map[PATCH_SIZE+1][PATCH_SIZE+1];
|
||||
memset(water_index_map, 0xFF, sizeof(water_index_map));
|
||||
|
||||
// Build data for shore
|
||||
std::vector<SWaterVertex> water_vertex_data_shore;
|
||||
std::vector<GLushort> water_indices_shore;
|
||||
std::vector<u16> water_indices_shore;
|
||||
u16 water_shore_index_map[PATCH_SIZE+1][PATCH_SIZE+1];
|
||||
memset(water_shore_index_map, 0xFF, sizeof(water_shore_index_map));
|
||||
|
||||
@ -1461,7 +1461,7 @@ void CPatchRData::BuildWater()
|
||||
m_VBWater->m_Owner->UpdateChunkVertices(m_VBWater.Get(), &water_vertex_data[0]);
|
||||
|
||||
m_VBWaterIndices = g_VBMan.AllocateChunk(
|
||||
sizeof(GLushort), water_indices.size(),
|
||||
sizeof(u16), water_indices.size(),
|
||||
Renderer::Backend::IBuffer::Type::INDEX, false,
|
||||
nullptr, CVertexBufferManager::Group::WATER);
|
||||
m_VBWaterIndices->m_Owner->UpdateChunkVertices(m_VBWaterIndices.Get(), &water_indices[0]);
|
||||
@ -1477,7 +1477,7 @@ void CPatchRData::BuildWater()
|
||||
|
||||
// Construct indices buffer
|
||||
m_VBWaterIndicesShore = g_VBMan.AllocateChunk(
|
||||
sizeof(GLushort), water_indices_shore.size(),
|
||||
sizeof(u16), water_indices_shore.size(),
|
||||
Renderer::Backend::IBuffer::Type::INDEX, false,
|
||||
nullptr, CVertexBufferManager::Group::WATER);
|
||||
m_VBWaterIndicesShore->m_Owner->UpdateChunkVertices(m_VBWaterIndicesShore.Get(), &water_indices_shore[0]);
|
||||
|
@ -616,7 +616,7 @@ void CRenderer::RenderBigScreenShot(const bool needsPresent)
|
||||
AllocateAligned(imageBuffer, headerSize + imageSize, maxSectorSize);
|
||||
|
||||
Tex t;
|
||||
GLvoid* img = imageBuffer.get() + headerSize;
|
||||
void* img = imageBuffer.get() + headerSize;
|
||||
if (t.wrap(imageWidth, imageHeight, bpp, TEX_BOTTOM_UP, imageBuffer, headerSize) < 0)
|
||||
{
|
||||
free(tileData);
|
||||
|
@ -66,7 +66,7 @@
|
||||
|
||||
struct SScreenRect
|
||||
{
|
||||
GLint x1, y1, x2, y2;
|
||||
int x1, y1, x2, y2;
|
||||
};
|
||||
|
||||
/**
|
||||
@ -573,10 +573,10 @@ void CSceneRenderer::RenderReflections(
|
||||
float vpWidth = wm.m_RefTextureSize;
|
||||
|
||||
SScreenRect screenScissor;
|
||||
screenScissor.x1 = (GLint)floor((reflectionScissor[0].X*0.5f+0.5f)*vpWidth);
|
||||
screenScissor.y1 = (GLint)floor((reflectionScissor[0].Y*0.5f+0.5f)*vpHeight);
|
||||
screenScissor.x2 = (GLint)ceil((reflectionScissor[1].X*0.5f+0.5f)*vpWidth);
|
||||
screenScissor.y2 = (GLint)ceil((reflectionScissor[1].Y*0.5f+0.5f)*vpHeight);
|
||||
screenScissor.x1 = static_cast<int>(floor((reflectionScissor[0].X * 0.5f + 0.5f) * vpWidth));
|
||||
screenScissor.y1 = static_cast<int>(floor((reflectionScissor[0].Y * 0.5f + 0.5f) * vpHeight));
|
||||
screenScissor.x2 = static_cast<int>(ceil((reflectionScissor[1].X * 0.5f + 0.5f) * vpWidth));
|
||||
screenScissor.y2 = static_cast<int>(ceil((reflectionScissor[1].Y * 0.5f + 0.5f) * vpHeight));
|
||||
|
||||
Renderer::Backend::IDeviceCommandContext::Rect scissorRect;
|
||||
scissorRect.x = screenScissor.x1;
|
||||
@ -648,10 +648,10 @@ void CSceneRenderer::RenderRefractions(
|
||||
float vpWidth = wm.m_RefTextureSize;
|
||||
|
||||
SScreenRect screenScissor;
|
||||
screenScissor.x1 = (GLint)floor((refractionScissor[0].X*0.5f+0.5f)*vpWidth);
|
||||
screenScissor.y1 = (GLint)floor((refractionScissor[0].Y*0.5f+0.5f)*vpHeight);
|
||||
screenScissor.x2 = (GLint)ceil((refractionScissor[1].X*0.5f+0.5f)*vpWidth);
|
||||
screenScissor.y2 = (GLint)ceil((refractionScissor[1].Y*0.5f+0.5f)*vpHeight);
|
||||
screenScissor.x1 = static_cast<int>(floor((refractionScissor[0].X * 0.5f + 0.5f) * vpWidth));
|
||||
screenScissor.y1 = static_cast<int>(floor((refractionScissor[0].Y * 0.5f + 0.5f) * vpHeight));
|
||||
screenScissor.x2 = static_cast<int>(ceil((refractionScissor[1].X * 0.5f + 0.5f) * vpWidth));
|
||||
screenScissor.y2 = static_cast<int>(ceil((refractionScissor[1].Y * 0.5f + 0.5f) * vpHeight));
|
||||
|
||||
Renderer::Backend::IDeviceCommandContext::Rect scissorRect;
|
||||
scissorRect.x = screenScissor.x1;
|
||||
|
@ -63,7 +63,7 @@ protected:
|
||||
{
|
||||
SVertex(CVector3D pos, float u, float v) : m_Position(pos) { m_UVs[0] = u; m_UVs[1] = v; }
|
||||
CVector3D m_Position;
|
||||
GLfloat m_UVs[2];
|
||||
float m_UVs[2];
|
||||
float padding[3]; // get a pow2 struct size
|
||||
};
|
||||
cassert(sizeof(SVertex) == 32);
|
||||
|
@ -535,13 +535,13 @@ void WaterManager::CreateWaveMeshes()
|
||||
}
|
||||
|
||||
// Fourth step: create waves themselves, using those chains. We basically create subchains.
|
||||
GLushort waveSizes = 14; // maximal size in width.
|
||||
u16 waveSizes = 14; // maximal size in width.
|
||||
|
||||
// Construct indices buffer (we can afford one for all of them)
|
||||
std::vector<GLushort> water_indices;
|
||||
for (GLushort a = 0; a < waveSizes - 1; ++a)
|
||||
std::vector<u16> water_indices;
|
||||
for (u16 a = 0; a < waveSizes - 1; ++a)
|
||||
{
|
||||
for (GLushort rect = 0; rect < 7; ++rect)
|
||||
for (u16 rect = 0; rect < 7; ++rect)
|
||||
{
|
||||
water_indices.push_back(a * 9 + rect);
|
||||
water_indices.push_back(a * 9 + 9 + rect);
|
||||
@ -553,7 +553,7 @@ void WaterManager::CreateWaveMeshes()
|
||||
}
|
||||
// Generic indexes, max-length
|
||||
m_ShoreWavesVBIndices = g_VBMan.AllocateChunk(
|
||||
sizeof(GLushort), water_indices.size(),
|
||||
sizeof(u16), water_indices.size(),
|
||||
Renderer::Backend::IBuffer::Type::INDEX, false,
|
||||
nullptr, CVertexBufferManager::Group::WATER);
|
||||
m_ShoreWavesVBIndices->m_Owner->UpdateChunkVertices(m_ShoreWavesVBIndices.Get(), &water_indices[0]);
|
||||
@ -568,14 +568,14 @@ void WaterManager::CreateWaveMeshes()
|
||||
if (CoastalPointsChains[i].size()- 1 - j < waveSizes)
|
||||
break;
|
||||
|
||||
GLushort width = waveSizes;
|
||||
u16 width = waveSizes;
|
||||
|
||||
// First pass to get some parameters out.
|
||||
float outmost = 0.0f; // how far to move on the shore.
|
||||
float avgDepth = 0.0f;
|
||||
int sign = 1;
|
||||
CVector2D firstPerp(0,0), perp(0,0), lastPerp(0,0);
|
||||
for (GLushort a = 0; a < waveSizes;++a)
|
||||
for (u16 a = 0; a < waveSizes;++a)
|
||||
{
|
||||
lastPerp = perp;
|
||||
perp = CVector2D(0,0);
|
||||
@ -656,7 +656,7 @@ void WaterManager::CreateWaveMeshes()
|
||||
shoreWave->m_TimeDiff = diff;
|
||||
diff += (rand() % 100) / 25.0f + 4.0f;
|
||||
|
||||
for (GLushort a = 0; a < width;++a)
|
||||
for (u16 a = 0; a < width;++a)
|
||||
{
|
||||
perp = CVector2D(0,0);
|
||||
int nb = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user