...
 
Commits (2)
Subproject commit 1da6165f3870ddbb1cc916cd04b622711ec727a5
Subproject commit 0a387ab423ddb88a8f3afb2acffe84fe4954c880
......@@ -335,7 +335,7 @@ void CAIGrid::reCreateBuffs()
if (m_useGraphics)
{
m_pTransVertBuf = m_pDXDevice->createVertexBuffer(m_aQuads.size() * sizeof(CAIQuadVertexDataInst), GX_BUFFER_USAGE_STREAM | GX_BUFFER_WRITEONLY);
m_pTransVertBuf = m_pDXDevice->createVertexBuffer(m_aQuads.size() * sizeof(CAIQuadVertexDataInst), GX_BUFFER_USAGE_STREAM);
IGXVertexBuffer *bufs[] = {m_pVertexQuad, m_pTransVertBuf};
m_pRenderBuffer = m_pDXDevice->createRenderBuffer(2, bufs, m_pDecl);
......@@ -372,7 +372,7 @@ void CAIGrid::defInitBuffs(ID id)
if (m_useGraphics)
{
m_pTransVertBuf = m_pDXDevice->createVertexBuffer(m_aQuads.size() * sizeof(CAIQuadVertexDataInst), GX_BUFFER_USAGE_STREAM | GX_BUFFER_WRITEONLY);
m_pTransVertBuf = m_pDXDevice->createVertexBuffer(m_aQuads.size() * sizeof(CAIQuadVertexDataInst), GX_BUFFER_USAGE_STREAM);
IGXVertexBuffer *bufs[] = {m_pVertexQuad, m_pTransVertBuf};
m_pRenderBuffer = m_pDXDevice->createRenderBuffer(2, bufs, m_pDecl);
......@@ -1051,11 +1051,11 @@ void CAIGrid::initGraphics()
{AIGRID_QUAD_SIZEDIV2, 0.0f, AIGRID_QUAD_SIZEDIV2, 1.0, 0.0f},
{AIGRID_QUAD_SIZEDIV2, 0.0f, -AIGRID_QUAD_SIZEDIV2, 1.0, 1.0f}
};
m_pVertexQuad = m_pDXDevice->createVertexBuffer(4 * sizeof(CAIQuadVertexData), GX_BUFFER_USAGE_STATIC | GX_BUFFER_WRITEONLY, &vertices);
m_pVertexQuad = m_pDXDevice->createVertexBuffer(4 * sizeof(CAIQuadVertexData), GX_BUFFER_USAGE_STATIC, &vertices);
USHORT indices[] = {0, 1, 2, 0, 2, 3};
m_pIndexQuad = m_pDXDevice->createIndexBuffer(6 * sizeof(USHORT), GX_BUFFER_USAGE_STATIC | GX_BUFFER_WRITEONLY, GXIT_USHORT, &indices);
m_pIndexQuad = m_pDXDevice->createIndexBuffer(6 * sizeof(USHORT), GX_BUFFER_USAGE_STATIC, GXIT_UINT16, &indices);
}
void CAIGrid::clear()
......
......@@ -527,7 +527,7 @@ bool CAnimatedModelShared::init(UINT uResourceCount, IXResourceModelAnimated **p
for(UINT i = 0; i < m_uLodCount; ++i)
{
m_ppIndexBuffer[i] = m_pDevice->createIndexBuffer(sizeof(UINT) * aLodIndexCount[i], GX_BUFFER_USAGE_STATIC, GXIT_UINT, ppIndices[i]);
m_ppIndexBuffer[i] = m_pDevice->createIndexBuffer(sizeof(UINT) * aLodIndexCount[i], GX_BUFFER_USAGE_STATIC, GXIT_UINT32, ppIndices[i]);
IGXVertexBuffer *pVertexBuffer = m_pDevice->createVertexBuffer(sizeof(XResourceModelAnimatedVertex) * aLodVertexCount[i], GX_BUFFER_USAGE_STATIC, ppVertices[i]);
m_ppRenderBuffer[i] = m_pDevice->createRenderBuffer(1, &pVertexBuffer, m_pProvider->getVertexDeclaration());
mem_release(pVertexBuffer);
......
......@@ -160,7 +160,7 @@ bool CDynamicModelShared::init(IXResourceModelStatic *pResource)
}
}
m_ppIndexBuffer[i] = m_pDevice->createIndexBuffer(sizeof(UINT) * uTotalIndices, GX_BUFFER_USAGE_STATIC, GXIT_UINT, pIndices);
m_ppIndexBuffer[i] = m_pDevice->createIndexBuffer(sizeof(UINT) * uTotalIndices, GX_BUFFER_USAGE_STATIC, GXIT_UINT32, pIndices);
IGXVertexBuffer *pVertexBuffer = m_pDevice->createVertexBuffer(sizeof(XResourceModelStaticVertex) * uTotalVertices, GX_BUFFER_USAGE_STATIC, pVertices);
m_ppRenderBuffer[i] = m_pDevice->createRenderBuffer(1, &pVertexBuffer, m_pProvider->getVertexDeclaration());
mem_release(pVertexBuffer);
......
Subproject commit 0ce3fd9d6fc8d661c7acb2395efb50ffd8d2f6a1
Subproject commit 7c47ff01efd00fd301c9e0b538698147cd8bf7ec
......@@ -112,7 +112,8 @@ CBaseCharacter::CBaseCharacter(CEntityManager * pMgr):
m_flashlight->setOrient(m_pHeadEnt->getOrient() * SMQuaternion(SM_PIDIV2, 'x'));
m_flashlight->setParent(m_pHeadEnt);
m_flashlight->setDist(20.f);
m_flashlight->setAngle(SMToRadian(60));
m_flashlight->setOuterAngle(SMToRadian(60));
m_flashlight->setInnerAngle(SMToRadian(10));
m_flashlight->setColor(float3(3.5, 3.5, 3.5));
//m_flashlight->setShadowType(-1);
m_flashlight->setShadowType(1);
......
......@@ -1126,10 +1126,10 @@ void GameData::render()
if(pDev)
{
const GX_FRAME_STATS *pFrameStats = pDev->getFrameStats();
const GX_MEMORY_STATS *pMemoryStats = pDev->getMemoryStats();
const GX_GPU_MEMORY_STATS *pMemoryStats = pDev->getMemoryStats();
static GX_FRAME_STATS s_oldFrameStats = {0};
static GX_MEMORY_STATS s_oldMemoryStats = {0};
static GX_GPU_MEMORY_STATS s_oldMemoryStats = {0};
static UINT s_uOldFps = 0;
if(s_uOldFps != g_uFPS
......
......@@ -11,8 +11,10 @@ See the license in LICENSE
*/
BEGIN_PROPTABLE(CLightDirectional)
//! Угол
DEFINE_FIELD_FLOAT(m_fAngle, 0, "angle", "Angle", EDITOR_TEXTFIELD)
//! Внешний угол
DEFINE_FIELD_FLOAT(m_fOuterAngle, 0, "angle", "Outer angle", EDITOR_TEXTFIELD)
//! Внутренний угол
DEFINE_FIELD_FLOAT(m_fInnerAngle, 0, "inner_angle", "Inner angle", EDITOR_TEXTFIELD)
//! Верхний радиус
DEFINE_FIELD_FLOAT(m_fRadiusTop, 0, "radius_top", "Radius top", EDITOR_TEXTFIELD)
END_PROPTABLE()
......@@ -21,16 +23,18 @@ REGISTER_ENTITY(CLightDirectional, light_directional);
CLightDirectional::CLightDirectional(CEntityManager *pMgr):BaseClass(pMgr)
{
m_fAngle = SM_PI * 0.4f;
m_fRadiusTop = 0.01f;
if(m_pLightSystem)
{
if(m_fInnerAngle > m_fOuterAngle)
{
m_fInnerAngle = m_fOuterAngle;
}
m_pLight = m_pLightSpot = m_pLightSystem->createSpot();
//m_pLight->setDistance(m_fDist);
m_pLight->setColor(m_vColor);
m_pLightSpot->setDirection(SMQuaternion(-SM_PI, 'z'));
m_pLightSpot->setOuterAngle(m_fAngle);
m_pLightSpot->setInnerAngle(m_fAngle * 0.7f);
m_pLightSpot->setOuterAngle(m_fOuterAngle);
m_pLightSpot->setInnerAngle(m_fInnerAngle);
}
}
......@@ -46,8 +50,8 @@ void CLightDirectional::onSync()
if(m_pLightSpot)
{
m_pLightSpot->setDirection(m_vOrientation);
m_pLightSpot->setOuterAngle(m_fAngle);
m_pLightSpot->setInnerAngle(m_fAngle * 0.7f);
m_pLightSpot->setOuterAngle(m_fOuterAngle);
m_pLightSpot->setInnerAngle(m_fInnerAngle);
}
#if 0
if (SLight_GetTopRadius(m_idLight) != m_fRadiusTop)
......
......@@ -25,8 +25,22 @@ public:
DECLARE_CONSTRUCTOR();
~CLightDirectional();
void setAngle(float fAngle) { m_fAngle = fAngle; };
float getAngle() const { return m_fAngle; };
void setOuterAngle(float fAngle)
{
m_fOuterAngle = fAngle;
}
float getOuterAngle() const
{
return m_fOuterAngle;
}
void setInnerAngle(float fAngle)
{
m_fInnerAngle = fAngle;
}
float getInnerAngle() const
{
return m_fInnerAngle;
}
void setRadiusTop(float fRadiusTop) { m_fRadiusTop = fRadiusTop; };
float getRadiusTop() const { return m_fRadiusTop; };
......@@ -34,8 +48,9 @@ public:
protected:
void onSync();
float m_fAngle;
float m_fRadiusTop;
float m_fOuterAngle = SM_PI * 0.4f;
float m_fInnerAngle = SM_PI * 0.4f * 0.7f;
float m_fRadiusTop = 0.01f;
IXLightSpot *m_pLightSpot = NULL;
};
......
......@@ -45,8 +45,8 @@ CCrosshair::CCrosshair():
m_pVertexDeclaration = m_pDev->createVertexDeclaration(vel);
//@TODO: Change to GX_BUFFER_USAGE_STREAM (can be lost in DX9)
m_pVertexBuffer = m_pDev->createVertexBuffer(sizeof(Vertex)* iVC, GX_BUFFER_USAGE_DYNAMIC | GX_BUFFER_WRITEONLY);
m_pIndexBuffer = m_pDev->createIndexBuffer(sizeof(USHORT)* iIC, GX_BUFFER_USAGE_DYNAMIC | GX_BUFFER_WRITEONLY, GXIT_USHORT);
m_pVertexBuffer = m_pDev->createVertexBuffer(sizeof(Vertex)* iVC, GX_BUFFER_USAGE_DYNAMIC);
m_pIndexBuffer = m_pDev->createIndexBuffer(sizeof(USHORT)* iIC, GX_BUFFER_USAGE_DYNAMIC, GXIT_UINT16);
m_pRenderBuffer = m_pDev->createRenderBuffer(1, &m_pVertexBuffer, m_pVertexDeclaration);
m_idVS = SGCore_ShaderLoad(SHADER_TYPE_VERTEX, "pp_quad_render.vs");
......
......@@ -90,7 +90,7 @@ void InitFullScreenQuad()
};
IGXVertexBuffer *pVB = g_pDevice->createVertexBuffer(sizeof(VERTEX_SCREEN_TEXTURE)* 6, GX_BUFFER_USAGE_STATIC | GX_BUFFER_WRITEONLY, aVertices);
IGXVertexBuffer *pVB = g_pDevice->createVertexBuffer(sizeof(VERTEX_SCREEN_TEXTURE)* 6, GX_BUFFER_USAGE_STATIC, aVertices);
g_pScreenTextureRB = g_pDevice->createRenderBuffer(1, &pVB, pVD);
mem_release(pVD);
mem_release(pVB);
......
......@@ -100,10 +100,10 @@ struct DataStaticModel : public ISXDataStaticModel
mem_release(m_pIndexBuffer);
mem_release(m_pRenderBuffer);
m_pVertexBuffer = g_pDevice->createVertexBuffer(sizeof(vertex_static_ex)* m_uiAllVertexCount, GX_BUFFER_USAGE_STATIC | GX_BUFFER_ALLOWDISCARD, m_pVertices);
m_pVertexBuffer = g_pDevice->createVertexBuffer(sizeof(vertex_static_ex)* m_uiAllVertexCount, GX_BUFFER_USAGE_STATIC, m_pVertices);
m_pRenderBuffer = g_pDevice->createRenderBuffer(1, &m_pVertexBuffer, SGCore_StaticModelGetDecl());
m_pIndexBuffer = g_pDevice->createIndexBuffer(sizeof(UINT)* m_uiAllIndexCount, GX_BUFFER_USAGE_STATIC | GX_BUFFER_ALLOWDISCARD, GXIT_UINT, m_pIndices);
m_pIndexBuffer = g_pDevice->createIndexBuffer(sizeof(UINT)* m_uiAllIndexCount, GX_BUFFER_USAGE_STATIC, GXIT_UINT32, m_pIndices);
}
DataStaticModel::~DataStaticModel()
......
......@@ -179,7 +179,7 @@ struct CShaderCS: public CShader
struct CShaderKit
{
CShaderKit(){ m_idVertexShader = m_idPixelShader = -1; m_pShaderKit = 0; }
CShaderKit(ID idVertexShader, ID idPixelShader, IGXShader *pShaderKit)
CShaderKit(ID idVertexShader, ID idPixelShader, IGXShaderSet *pShaderKit)
{
m_idVertexShader = idVertexShader;
m_idPixelShader = idPixelShader;
......@@ -220,7 +220,7 @@ struct CShaderKit
ID m_idPixelShader = -1;
ID m_idGeometryShader = -1;
ID m_idComputeShader = -1;
IGXShader *m_pShaderKit;
IGXShaderSet *m_pShaderKit;
};
//! кэшированный шейдер
......
......@@ -66,7 +66,7 @@ CSkyBox::CSkyBox()
5,7,2,
};
m_pIndeces = g_pDevice->createIndexBuffer(36 * sizeof(WORD), GX_BUFFER_USAGE_STATIC, GXIT_USHORT, indices_tmp);
m_pIndeces = g_pDevice->createIndexBuffer(36 * sizeof(WORD), GX_BUFFER_USAGE_STATIC, GXIT_UINT16, indices_tmp);
m_pRenderBuffer = g_pDevice->createRenderBuffer(1, &m_pVertices, m_pVertexDeclarationSkyBox);
......@@ -273,7 +273,7 @@ CSkyClouds::CSkyClouds()
0,1,2,
0,2,3
};
m_pIndeces = g_pDevice->createIndexBuffer(6 * sizeof(WORD), GX_BUFFER_USAGE_STATIC, GXIT_USHORT, indices_tmp);
m_pIndeces = g_pDevice->createIndexBuffer(6 * sizeof(WORD), GX_BUFFER_USAGE_STATIC, GXIT_UINT16, indices_tmp);
m_pRenderBuffer = g_pDevice->createRenderBuffer(1, &m_pVertices, m_pVertexDeclarationClouds);
......
......@@ -56,7 +56,7 @@ IGXSamplerState *g_pSamplerFilterLinear = NULL;
void StdDrawIndexedPrimitive(UINT type_primitive, long base_vertexIndex, UINT min_vertex_index, UINT num_vertices, UINT start_index, UINT prim_count)
{
Core_RIntSet(G_RI_INT_COUNT_DIP, Core_RIntGet(G_RI_INT_COUNT_DIP) + 1);
g_pDevice->setPrimitiveTopology((GXPT)type_primitive);
g_pDevice->setPrimitiveTopology((GXPRIMITIVETOPOLOGY)type_primitive);
g_pDevice->drawIndexed(num_vertices, prim_count, start_index, base_vertexIndex);
}
......@@ -1074,7 +1074,7 @@ public:
IGXVertexDeclaration *pVD = g_pDevice->createVertexDeclaration(oLayout);
m_pIB = g_pDevice->createIndexBuffer(sizeof(USHORT) * uIndexCount, GX_BUFFER_USAGE_STATIC, GXIT_USHORT, pIndices);
m_pIB = g_pDevice->createIndexBuffer(sizeof(USHORT) * uIndexCount, GX_BUFFER_USAGE_STATIC, GXIT_UINT16, pIndices);
m_pVB = g_pDevice->createVertexBuffer(sizeof(float) * 3 * uVertexCount, GX_BUFFER_USAGE_STATIC, pVertices);
m_pRB = g_pDevice->createRenderBuffer(1, &m_pVB, pVD);
......
......@@ -37,7 +37,7 @@ void CModels::onResetDevice()
{
for(int i = 0, l = m_aModels.size(); i < l; ++i)
{
// m_aModels[i]->m_pVisibleIndexBuffer = g_pDXDevice->createIndexBuffer(m_aModels[i]->m_pModel->m_uiAllIndexCount * sizeof(UINT), GX_BUFFER_USAGE_STREAM, GXIT_UINT);
// m_aModels[i]->m_pVisibleIndexBuffer = g_pDXDevice->createIndexBuffer(m_aModels[i]->m_pModel->m_uiAllIndexCount * sizeof(UINT), GX_BUFFER_USAGE_STREAM, GXIT_UINT32);
m_aModels[i]->m_pModel->syncBuffers();
}
......@@ -165,10 +165,10 @@ void CModels::CTransparencyModel::syncBuffers(bool bRecreate)
mem_release(m_pIndexBuffer);
mem_release(m_pRenderBuffer);
m_pVertexBuffer = g_pDXDevice->createVertexBuffer(sizeof(vertex_static_ex)* m_iCountVertex, GX_BUFFER_ALLOWDISCARD | GX_BUFFER_USAGE_STATIC, m_pVertices);
m_pVertexBuffer = g_pDXDevice->createVertexBuffer(sizeof(vertex_static_ex)* m_iCountVertex, GX_BUFFER_USAGE_STATIC, m_pVertices);
m_pRenderBuffer = g_pDXDevice->createRenderBuffer(1, &m_pVertexBuffer, SGCore_StaticModelGetDecl());
m_pIndexBuffer = g_pDXDevice->createIndexBuffer(sizeof(UINT)* m_iCountIndex, GX_BUFFER_ALLOWDISCARD | GX_BUFFER_USAGE_STATIC, GXIT_UINT, m_pIndices);
m_pIndexBuffer = g_pDXDevice->createIndexBuffer(sizeof(UINT)* m_iCountIndex, GX_BUFFER_USAGE_STATIC, GXIT_UINT32, m_pIndices);
}
//**************************************************************************
......@@ -2101,7 +2101,7 @@ void CModels::createExternalData4SegmentModel(CModel *pModel)
pModel->m_pVisibleIndeces[i] = new UINT[pModel->m_pModel->m_pIndexCount[i]];
}
pModel->m_pVisibleIndexBuffer = g_pDXDevice->createIndexBuffer(pModel->m_pModel->m_uiAllIndexCount * sizeof(UINT), GX_BUFFER_USAGE_STREAM, GXIT_UINT);
pModel->m_pVisibleIndexBuffer = g_pDXDevice->createIndexBuffer(pModel->m_pModel->m_uiAllIndexCount * sizeof(UINT), GX_BUFFER_USAGE_STREAM, GXIT_UINT32);
}
void CModels::segmentation(CModel *pModel)
......
......@@ -78,7 +78,7 @@ namespace gui
{0, m_iHeight, 0, 0.0f, 1.0f}
};
m_pVertices = GetGUI()->getDevice()->createVertexBuffer(sizeof(point) * 4, GX_BUFFER_USAGE_STATIC | GX_BUFFER_WRITEONLY, a);
m_pVertices = GetGUI()->getDevice()->createVertexBuffer(sizeof(point) * 4, GX_BUFFER_USAGE_STATIC, a);
m_pRenderBuffer = GetGUI()->getDevice()->createRenderBuffer(1, &m_pVertices, GetGUI()->getVertexDeclarations()->m_pXYZTex);
}
void CDesktop::releaseRenderTarget()
......
......@@ -1243,11 +1243,11 @@ namespace gui
}
}
IGXVertexBuffer *pVertBuffer = GetGUI()->getDevice()->createVertexBuffer(sizeof(vertex)* iVertexCount, GX_BUFFER_USAGE_STATIC | GX_BUFFER_WRITEONLY, pVB);
IGXVertexBuffer *pVertBuffer = GetGUI()->getDevice()->createVertexBuffer(sizeof(vertex)* iVertexCount, GX_BUFFER_USAGE_STATIC, pVB);
*ppVertexBuffer = GetGUI()->getDevice()->createRenderBuffer(1, &pVertBuffer, GetGUI()->getVertexDeclarations()->m_pXYZTex);
mem_release(pVertBuffer);
*ppIndexBuffer = GetGUI()->getDevice()->createIndexBuffer(sizeof(UINT)* iIndexCount, GX_BUFFER_USAGE_STATIC | GX_BUFFER_WRITEONLY, GXIT_UINT, pIB);
*ppIndexBuffer = GetGUI()->getDevice()->createIndexBuffer(sizeof(UINT)* iIndexCount, GX_BUFFER_USAGE_STATIC, GXIT_UINT32, pIB);
mem_delete_a(pVB);
mem_delete_a(pIB);
......
......@@ -422,7 +422,7 @@ namespace gui
iCI += l->iIC[0];
memcpy((USHORT*)pData + iCI, pIndices, sizeof(USHORT) * IndexCount);
m_pIndexBuffer = GetGUI()->getDevice()->createIndexBuffer(sizeof(USHORT)* iIndexCount, GX_BUFFER_USAGE_DYNAMIC | GX_BUFFER_WRITEONLY, GXIT_USHORT, pData);
m_pIndexBuffer = GetGUI()->getDevice()->createIndexBuffer(sizeof(USHORT)* iIndexCount, GX_BUFFER_USAGE_DYNAMIC, GXIT_UINT16, pData);
mem_delete_a(pData);
}
......
......@@ -60,7 +60,7 @@ namespace gui
m_depthStencilStates.m_pDefault = m_pDevice->createDepthStencilState(&depthStencilDesc);
depthStencilDesc.bStencilEnable = true;
depthStencilDesc.stencilFunc = GXCOMPARISON_EQUAL;
depthStencilDesc.stencilFunc = GXCMP_EQUAL;
depthStencilDesc.stencilPassOp = GXSTENCIL_OP_INCR;
m_depthStencilStates.m_pStencilIncr = m_pDevice->createDepthStencilState(&depthStencilDesc);
......@@ -108,7 +108,7 @@ namespace gui
USHORT pIdxQuad[] = {
0, 1, 2, 0, 2, 3
};
m_pQuadIndexes = m_pDevice->createIndexBuffer(sizeof(USHORT) * 6, GX_BUFFER_USAGE_STATIC | GX_BUFFER_WRITEONLY, GXIT_USHORT, pIdxQuad);
m_pQuadIndexes = m_pDevice->createIndexBuffer(sizeof(USHORT) * 6, GX_BUFFER_USAGE_STATIC, GXIT_UINT16, pIdxQuad);
m_pQuadVerticesXYZ = m_pDevice->createVertexBuffer(sizeof(float) * 3 * 4, GX_BUFFER_USAGE_STREAM);
m_pQuadVerticesXYZTex16 = m_pDevice->createVertexBuffer(sizeof(float) * 5 * 16, GX_BUFFER_USAGE_STREAM);
......
......@@ -1915,3 +1915,10 @@ void CXLightSpot::updatePSConstants(IGXContext *pDevice)
m_dataPS.vDir = m_qDirection * LIGHTS_DIR_BASE;
m_pPSData->update(&m_dataPS);
}
SMMATRIX CXLightSpot::getWorldTM()
{
float fAngleScale = cosf(m_fInnerAngle * 0.5f) * sqrtf(2.0f);
return(SMMatrixScaling(float3(fAngleScale, 1.0f, fAngleScale)) * SMMatrixScaling(float3(getMaxDistance())) * m_qDirection.GetMatrix() * SMMatrixTranslation(m_vPosition));
}
......@@ -368,6 +368,7 @@ public:
SMQuaternion getDirection();
void setDirection(const SMQuaternion &qDirection);
SMMATRIX getWorldTM();
protected:
void updatePSConstants(IGXContext *pDevice);
......
......@@ -271,7 +271,7 @@ void CEmitter::setCount(int iCount)
m_pArr = new CommonParticle[m_iCount];
m_pTransVertBuf = pe_data::pDXDevice->createVertexBuffer(m_iCount * sizeof(CommonParticleDecl2), GX_BUFFER_USAGE_STREAM | GX_BUFFER_ALLOWDISCARD);
m_pTransVertBuf = pe_data::pDXDevice->createVertexBuffer(m_iCount * sizeof(CommonParticleDecl2), GX_BUFFER_USAGE_STREAM);
createGeomData();
}
......@@ -412,7 +412,7 @@ void CEmitter::createGeomData()
//@FIXME: Consider to make it static
m_pVertexBuff = pe_data::pDXDevice->createVertexBuffer(4 * m_oData.m_iFigureCountQuads * sizeof(CommonParticleDecl), GX_BUFFER_USAGE_DYNAMIC);
m_pIndexBuff = pe_data::pDXDevice->createIndexBuffer(6 * m_oData.m_iFigureCountQuads * sizeof(WORD), GX_BUFFER_USAGE_DYNAMIC, GXIT_USHORT);
m_pIndexBuff = pe_data::pDXDevice->createIndexBuffer(6 * m_oData.m_iFigureCountQuads * sizeof(WORD), GX_BUFFER_USAGE_DYNAMIC, GXIT_UINT16);
IGXVertexBuffer *pvb[] = {m_pVertexBuff, m_pTransVertBuf};
m_pRenderBuff = pe_data::pDXDevice->createRenderBuffer(2, pvb, pe_data::pVertexDeclarationParticles);
......@@ -439,7 +439,7 @@ void CEmitter::createGeomData()
//@FIXME: Consider to make it static
m_pVertexBuffQuad = pe_data::pDXDevice->createVertexBuffer(4 * sizeof(CommonParticleDecl), GX_BUFFER_USAGE_DYNAMIC);
m_pIndexBuffQuad = pe_data::pDXDevice->createIndexBuffer(6 * sizeof(WORD), GX_BUFFER_USAGE_DYNAMIC, GXIT_USHORT);
m_pIndexBuffQuad = pe_data::pDXDevice->createIndexBuffer(6 * sizeof(WORD), GX_BUFFER_USAGE_DYNAMIC, GXIT_UINT16);
IGXVertexBuffer *pvbq[] = {m_pVertexBuffQuad, m_pTransVertBuf};
m_pRenderBuffQuad = pe_data::pDXDevice->createRenderBuffer(2, pvbq, pe_data::pVertexDeclarationParticles);
......
......@@ -329,7 +329,7 @@ void pp_data::Init()
dsDesc.stencilPassOp = GXSTENCIL_OP_REPLACE;
rstates::pDepthStencilEdgeDetect = pDXDevice->createDepthStencilState(&dsDesc);
dsDesc.stencilFunc = GXCOMPARISON_EQUAL;
dsDesc.stencilFunc = GXCMP_EQUAL;
dsDesc.stencilPassOp = GXSTENCIL_OP_KEEP;
rstates::pDepthStencilDLAA = pDXDevice->createDepthStencilState(&dsDesc);
}
......
......@@ -201,18 +201,18 @@ void gdata::shaders_id::InitAllShaders()
gdata::rstates::pDepthStencilStateNoZ = gdata::pDXDevice->createDepthStencilState(&dsDesc);
dsDesc.bStencilEnable = TRUE;
dsDesc.depthFunc = GXCOMPARISON_ALWAYS;
dsDesc.depthFunc = GXCMP_ALWAYS;
dsDesc.stencilPassOp = GXSTENCIL_OP_REPLACE;
gdata::rstates::pDepthStencilStateMrtStage0 = gdata::pDXDevice->createDepthStencilState(&dsDesc);
dsDesc.bDepthEnable = TRUE;
dsDesc.depthFunc = GXCOMPARISON_LESS_EQUAL;
dsDesc.stencilFunc = GXCOMPARISON_NOT_EQUAL;
dsDesc.depthFunc = GXCMP_LESS_EQUAL;
dsDesc.stencilFunc = GXCMP_NOT_EQUAL;
dsDesc.stencilPassOp = GXSTENCIL_OP_DECR;
gdata::rstates::pDepthStencilStateMrtStage1 = gdata::pDXDevice->createDepthStencilState(&dsDesc);
dsDesc.bEnableDepthWrite = FALSE;
dsDesc.stencilFunc = GXCOMPARISON_ALWAYS;
dsDesc.stencilFunc = GXCMP_ALWAYS;
dsDesc.stencilDepthFailOp = GXSTENCIL_OP_INCR;
dsDesc.stencilPassOp = GXSTENCIL_OP_KEEP;
dsDesc.stencilBackDepthFailOp = GXSTENCIL_OP_DECR;
......@@ -220,7 +220,7 @@ void gdata::shaders_id::InitAllShaders()
dsDesc.bDepthEnable = FALSE;
dsDesc.bEnableDepthWrite = FALSE;
dsDesc.stencilFunc = GXCOMPARISON_EQUAL;
dsDesc.stencilFunc = GXCMP_EQUAL;
dsDesc.stencilDepthFailOp = GXSTENCIL_OP_ZERO;
dsDesc.stencilFailOp = GXSTENCIL_OP_ZERO;
dsDesc.stencilPassOp = GXSTENCIL_OP_KEEP;
......
......@@ -236,7 +236,7 @@ CGrid::CGrid(UINT uSize)
dsDesc.stencilPassOp = GXSTENCIL_OP_INCR;
m_pStencilPass0 = m_pDevice->createDepthStencilState(&dsDesc);
dsDesc.stencilFunc = GXCOMPARISON_EQUAL;
dsDesc.stencilFunc = GXCMP_EQUAL;
dsDesc.stencilPassOp = GXSTENCIL_OP_KEEP;
m_pStencilPass1 = m_pDevice->createDepthStencilState(&dsDesc);
......
......@@ -225,7 +225,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLin
GXDECL_END()
};
IGXVertexDeclaration *pVD = pDevice->createVertexDeclaration(oLayout);
g_pBorderVertexBuffer = pDevice->createVertexBuffer(sizeof(XBorderVertex) * 5, GX_BUFFER_USAGE_STREAM | GX_BUFFER_WRITEONLY);
g_pBorderVertexBuffer = pDevice->createVertexBuffer(sizeof(XBorderVertex) * 5, GX_BUFFER_USAGE_STREAM);
g_pBorderRenderBuffer = pDevice->createRenderBuffer(1, &g_pBorderVertexBuffer, pVD);
mem_release(pVD);
......@@ -237,15 +237,15 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLin
GXDECL_END()
};
pVD = pDevice->createVertexDeclaration(oLayoutHandler);
g_xRenderStates.pHandlerVB = pDevice->createVertexBuffer(sizeof(float3_t) * 8, GX_BUFFER_USAGE_STREAM | GX_BUFFER_WRITEONLY);
g_xRenderStates.pHandlerInstanceVB = pDevice->createVertexBuffer(sizeof(float3_t) * X_MAX_HANDLERS_PER_DIP, GX_BUFFER_USAGE_STREAM | GX_BUFFER_WRITEONLY);
g_xRenderStates.pHandlerVB = pDevice->createVertexBuffer(sizeof(float3_t) * 8, GX_BUFFER_USAGE_STREAM);
g_xRenderStates.pHandlerInstanceVB = pDevice->createVertexBuffer(sizeof(float3_t) * X_MAX_HANDLERS_PER_DIP, GX_BUFFER_USAGE_STREAM);
IGXVertexBuffer *ppVB[] = {g_xRenderStates.pHandlerVB, g_xRenderStates.pHandlerInstanceVB};
g_xRenderStates.pHandlerRB = pDevice->createRenderBuffer(2, ppVB, pVD);
mem_release(pVD);
g_xRenderStates.idHandlerShaderVS = SGCore_ShaderLoad(SHADER_TYPE_VERTEX, "terrax_handler.vs");
g_xRenderStates.idHandlerShaderKit = SGCore_ShaderCreateKit(g_xRenderStates.idHandlerShaderVS, g_xRenderStates.idColoredShaderPS);
USHORT pHandlerIndices[] = {0, 1, 2, 3, 4, 5, 6, 7};
g_xRenderStates.pHandlerIB = pDevice->createIndexBuffer(sizeof(USHORT)* 8, GX_BUFFER_USAGE_STATIC | GX_BUFFER_WRITEONLY, GXIT_USHORT, pHandlerIndices);
g_xRenderStates.pHandlerIB = pDevice->createIndexBuffer(sizeof(USHORT)* 8, GX_BUFFER_USAGE_STATIC, GXIT_UINT16, pHandlerIndices);
{
// Transform handlers
......@@ -255,7 +255,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLin
GXDECL_END()
};
pVD = pDevice->createVertexDeclaration(oLayoutHandler);
g_xRenderStates.pTransformHandlerVB = pDevice->createVertexBuffer(sizeof(float3_t)* 32, GX_BUFFER_USAGE_STREAM | GX_BUFFER_WRITEONLY);
g_xRenderStates.pTransformHandlerVB = pDevice->createVertexBuffer(sizeof(float3_t)* 32, GX_BUFFER_USAGE_STREAM);
g_xRenderStates.pTransformHandlerRB = pDevice->createRenderBuffer(1, &g_xRenderStates.pTransformHandlerVB, pVD);
USHORT pHandlerIndices[] = {
0, 1, 2, 0, 2, 3,
......@@ -268,7 +268,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLin
24, 25, 26, 24, 26, 27,
28, 29, 30, 28, 30, 31
};
g_xRenderStates.pTransformHandlerScaleIB = pDevice->createIndexBuffer(sizeof(USHORT)* 48, GX_BUFFER_USAGE_STATIC | GX_BUFFER_WRITEONLY, GXIT_USHORT, pHandlerIndices);
g_xRenderStates.pTransformHandlerScaleIB = pDevice->createIndexBuffer(sizeof(USHORT)* 48, GX_BUFFER_USAGE_STATIC, GXIT_UINT16, pHandlerIndices);
USHORT pHandlerRotateIndices[] = {
0, 1, 2, 0, 2, 3, 0, 3, 4, 0, 4, 5, 0, 5, 6, 0, 6, 7,
......@@ -276,7 +276,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLin
16, 17, 18, 16, 18, 19, 16, 19, 20, 16, 20, 21, 16, 21, 22, 16, 22, 23,
24, 25, 26, 24, 26, 27, 24, 27, 28, 24, 28, 29, 24, 29, 30, 24, 30, 31
};
g_xRenderStates.pTransformHandlerRotateIB = pDevice->createIndexBuffer(sizeof(USHORT)* 72, GX_BUFFER_USAGE_STATIC | GX_BUFFER_WRITEONLY, GXIT_USHORT, pHandlerRotateIndices);
g_xRenderStates.pTransformHandlerRotateIB = pDevice->createIndexBuffer(sizeof(USHORT)* 72, GX_BUFFER_USAGE_STATIC, GXIT_UINT16, pHandlerRotateIndices);
float3_t pVertices[] = {
float3_t(10000.0f, 0.0f, 0.0f), float3_t(-10000.0f, 0.0f, 0.0f),
......