...
 
Commits (2)
......@@ -182,7 +182,12 @@
<ClCompile Include="..\..\..\source\common\file_utils.cpp" />
<ClCompile Include="..\..\..\source\common\string.cpp" />
<ClCompile Include="..\..\..\source\common\string_utils.cpp" />
<ClCompile Include="..\..\..\source\skyxengine.cpp" />
<ClCompile Include="..\..\..\source\skyxengine.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\..\source\SkyXEngine_Build\SkyXEngine_Build.cpp" />
</ItemGroup>
<ItemGroup>
......
......@@ -102,7 +102,7 @@
</PrecompiledHeader>
<WarningLevel>TurnOffAllWarnings</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;SX_TERRAX;_DEBUG;_WINDOWS;SX_LEVEL_EDITOR;%(PreprocessorDefinitions);SX_LIB_NAME="LEd"</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;SX_TERRAX;_DEBUG;_WINDOWS;%(PreprocessorDefinitions);SX_LIB_NAME="LEd"</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<TreatSpecificWarningsAsErrors>4316</TreatSpecificWarningsAsErrors>
......@@ -122,7 +122,7 @@
</PrecompiledHeader>
<WarningLevel>TurnOffAllWarnings</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN64;SX_TERRAX;_DEBUG;_WINDOWS;SX_LEVEL_EDITOR;%(PreprocessorDefinitions);SX_LIB_NAME="LEd"</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN64;SX_TERRAX;_DEBUG;_WINDOWS;%(PreprocessorDefinitions);SX_LIB_NAME="LEd"</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<TreatSpecificWarningsAsErrors>4316</TreatSpecificWarningsAsErrors>
......@@ -144,7 +144,7 @@
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;SX_TERRAX;NDEBUG;_WINDOWS;SX_LEVEL_EDITOR;%(PreprocessorDefinitions);SX_LIB_NAME="LEd"</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;SX_TERRAX;NDEBUG;_WINDOWS;%(PreprocessorDefinitions);SX_LIB_NAME="LEd"</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<TreatSpecificWarningsAsErrors>4316</TreatSpecificWarningsAsErrors>
</ClCompile>
......@@ -166,7 +166,7 @@
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN64;SX_TERRAX;NDEBUG;_WINDOWS;SX_LEVEL_EDITOR;%(PreprocessorDefinitions);SX_LIB_NAME="LEd"</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN64;SX_TERRAX;NDEBUG;_WINDOWS;%(PreprocessorDefinitions);SX_LIB_NAME="LEd"</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<TreatSpecificWarningsAsErrors>4316</TreatSpecificWarningsAsErrors>
</ClCompile>
......
Subproject commit 0a387ab423ddb88a8f3afb2acffe84fe4954c880
Subproject commit 1b61ddaa21f3f9a943026d04b39fa6cc834436e5
......@@ -387,12 +387,12 @@ QT стиль документирования (!) и QT_AUTOBRIEF - корот
#endif
#include <decals/sxdecals.h>
#if defined(_DEBUG)
#pragma comment(lib, "sxlevel_d.lib")
#else
#pragma comment(lib, "sxlevel.lib")
#endif
#include <level/sxlevel.h>
//#if defined(_DEBUG)
//#pragma comment(lib, "sxlevel_d.lib")
//#else
//#pragma comment(lib, "sxlevel.lib")
//#endif
//#include <level/sxlevel.h>
#if defined(_DEBUG)
#pragma comment(lib, "sxgame_d.lib")
......
......@@ -107,6 +107,11 @@ public:
return(m_pWindowSystem->processMessages());
}
ICamera* XMETHODCALLTYPE getCameraForFrame() override
{
return(SGame_GetActiveCamera());
}
protected:
IXWindowSystem *m_pWindowSystem;
IXWindow *m_pWindow;
......@@ -151,33 +156,4 @@ int main(int argc, char **argv)
mem_release(pWindow);
mem_release(pEngine);
return(ret);
#if 0
//MessageBox(0, 0, 0, 0);
SkyXEngine_PreviewCreate();
SkyXEngine_Init(0, 0, lpCmdLine);
SkyXEngine_PreviewKill();
SGCore_SkyBoxLoadTex("sky_2_cube.dds");
SGCore_SkyCloudsLoadTex("sky_oblaka.dds");
SGCore_SkyBoxSetUse(false);
SGCore_SkyCloudsSetUse(false);
//SGCore_OC_SetEnable(false);
SGreen_0SettSetFreqGrass(100);
SGCore_ShaderAllLoad();
SGCore_LoadTexAllLoad();
SetWindowPos((HWND)SGCore_GetHWND(), HWND_TOP, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE);
SLevel_AmbientSndPlay();
SLevel_WeatherSndPlay();
int result = SkyXEngine_CycleMain();
SkyXEngine_Kill();
return result;
#endif
}
\ No newline at end of file
}
......@@ -2517,13 +2517,13 @@ void CAIGrid::renderQuads(const IFrustum * frustum, const float3 * viewpos, floa
RTGPUArrVerteces[tmpkey].m_vPos = aq->m_vPos;
if(quadSelectedExists(aq->m_id))
RTGPUArrVerteces[tmpkey].m_vColor = GXCOLOR_COLORVECTOR_ARGB(AIGRID_COLOR_SEL_MAIN);
RTGPUArrVerteces[tmpkey].m_vColor = GXCOLOR_COLOR_TO_F4(AIGRID_COLOR_SEL_MAIN);
else if(quadSelectedExistsNeightborDirect(aq->m_id))
RTGPUArrVerteces[tmpkey].m_vColor = GXCOLOR_COLORVECTOR_ARGB(AIGRID_COLOR_SEL_ADD);
RTGPUArrVerteces[tmpkey].m_vColor = GXCOLOR_COLOR_TO_F4(AIGRID_COLOR_SEL_ADD);
else if(m_uiCountSplits > 0 && m_isMarkSplits)
RTGPUArrVerteces[tmpkey].m_vColor = GXCOLOR_COLORVECTOR_ARGB(m_aSplitsColor[aq->m_iSplit - 1]);
RTGPUArrVerteces[tmpkey].m_vColor = GXCOLOR_COLOR_TO_F4(m_aSplitsColor[aq->m_iSplit - 1]);
else
RTGPUArrVerteces[tmpkey].m_vColor = GXCOLOR_COLORVECTOR_ARGB(m_aQuadColors[aq->m_id]);
RTGPUArrVerteces[tmpkey].m_vColor = GXCOLOR_COLOR_TO_F4(m_aQuadColors[aq->m_id]);
/*if (aq->m_iSplit > 1)
{
......@@ -2571,7 +2571,7 @@ void CAIGrid::renderQuads(const IFrustum * frustum, const float3 * viewpos, floa
else
{
RTGPUArrVerteces[tmpkey].m_vTC = float4_t(1, 1, 0, 0);
RTGPUArrVerteces[tmpkey].m_vColor = GXCOLOR_COLORVECTOR_ARGB(GXCOLOR_ARGB(255, 255, 0, 0));
RTGPUArrVerteces[tmpkey].m_vColor = GXCOLOR_COLOR_TO_F4(GXCOLOR_ARGB(255, 255, 0, 0));
}
++tmpkey;
......@@ -2664,7 +2664,7 @@ void CAIGrid::renderGraphPoints(const float3 * viewpos, float dist)
else
RTGPUArrVerteces[tmpkey].m_vTC = float4_t(1, 1, 0, 0);
RTGPUArrVerteces[tmpkey].m_vColor = GXCOLOR_COLORVECTOR_ARGB(GXCOLOR_ARGB(200, 0, 0, 255));
RTGPUArrVerteces[tmpkey].m_vColor = GXCOLOR_COLOR_TO_F4(GXCOLOR_ARGB(200, 0, 0, 255));
++tmpkey;
}
}
......
......@@ -102,13 +102,13 @@ DecalManager::DecalManager():
GXBLEND_DESC blendDesc;
memset(&blendDesc, 0, sizeof(blendDesc));
blendDesc.renderTarget[0].u8RenderTargetWriteMask = GXCOLOR_WRITE_ENABLE_ALL;
blendDesc.renderTarget[0].srcBlend = GXBLEND_DEST_COLOR;
blendDesc.renderTarget[0].destBlend = GXBLEND_SRC_COLOR;
blendDesc.renderTarget[0].srcBlendAlpha = GXBLEND_DEST_ALPHA;
blendDesc.renderTarget[0].destBlendAlpha = GXBLEND_SRC_ALPHA;
blendDesc.renderTarget[0].blendOp = GXBLEND_OP_ADD;
blendDesc.renderTarget[0].blendSrcColor = GXBLEND_DEST_COLOR;
blendDesc.renderTarget[0].blendDestColor = GXBLEND_SRC_COLOR;
blendDesc.renderTarget[0].blendSrcAlpha = GXBLEND_DEST_ALPHA;
blendDesc.renderTarget[0].blendDestAlpha = GXBLEND_SRC_ALPHA;
blendDesc.renderTarget[0].blendOpColor = GXBLEND_OP_ADD;
blendDesc.renderTarget[0].blendOpAlpha = GXBLEND_OP_ADD;
blendDesc.renderTarget[0].bBlendEnable = TRUE;
blendDesc.renderTarget[0].useBlend = TRUE;
m_pBlendState = dev->createBlendState(&blendDesc);
......
......@@ -17,9 +17,9 @@ void CEditable::startup(IGXContext *pDevice)
m_pDevice = pDevice;
GXBLEND_DESC blendDesc;
blendDesc.renderTarget[0].bBlendEnable = true;
blendDesc.renderTarget[0].srcBlend = blendDesc.renderTarget[0].srcBlendAlpha = GXBLEND_BLEND_FACTOR;
blendDesc.renderTarget[0].destBlend = blendDesc.renderTarget[0].destBlendAlpha = GXBLEND_INV_BLEND_FACTOR;
blendDesc.renderTarget[0].useBlend = true;
blendDesc.renderTarget[0].blendSrcColor = blendDesc.renderTarget[0].blendSrcAlpha = GXBLEND_BLEND_FACTOR;
blendDesc.renderTarget[0].blendDestColor = blendDesc.renderTarget[0].blendDestAlpha = GXBLEND_INV_BLEND_FACTOR;
m_pBlendColorFactor = m_pDevice->createBlendState(&blendDesc);
GXRASTERIZER_DESC rsDesc;
......
......@@ -1010,9 +1010,9 @@ GameData::GameData(HWND hWnd, bool isGame):
g_idTextKit = SGCore_ShaderCreateKit(g_idTextVS, g_idTextPS);
GXBLEND_DESC bsDesc;
bsDesc.renderTarget[0].bBlendEnable = true;
bsDesc.renderTarget[0].srcBlend = bsDesc.renderTarget[0].srcBlendAlpha = GXBLEND_SRC_ALPHA;
bsDesc.renderTarget[0].destBlend = bsDesc.renderTarget[0].destBlendAlpha = GXBLEND_INV_SRC_ALPHA;
bsDesc.renderTarget[0].useBlend = true;
bsDesc.renderTarget[0].blendSrcColor = bsDesc.renderTarget[0].blendSrcAlpha = GXBLEND_SRC_ALPHA;
bsDesc.renderTarget[0].blendDestColor = bsDesc.renderTarget[0].blendDestAlpha = GXBLEND_INV_SRC_ALPHA;
g_pTextBlendState = SGCore_GetDXDevice()->createBlendState(&bsDesc);
GXSAMPLER_DESC sampDesc;
......@@ -1023,7 +1023,7 @@ GameData::GameData(HWND hWnd, bool isGame):
g_pTextPSConstantBuffer = SGCore_GetDXDevice()->createConstantBuffer(sizeof(float4));
GXDEPTH_STENCIL_DESC dsDesc;
dsDesc.bDepthEnable = dsDesc.bEnableDepthWrite = false;
dsDesc.useDepthTest = dsDesc.useDepthWrite = false;
g_pTextDepthState = SGCore_GetDXDevice()->createDepthStencilState(&dsDesc);
//m_pStatsUI = m_pGUI->createDesktopA("stats", "sys/stats.html");
......@@ -1156,14 +1156,14 @@ void GameData::render()
, g_uFPS,
pAdapterDesc->szDescription,
pAdapterDesc->uTotalGPUMemory / 1024 / 1024,
(float)(pMemoryStats->uIndexBufferBytes + pMemoryStats->uRenderTargetBytes + pMemoryStats->uShaderConstBytes + pMemoryStats->uTextureBytes + pMemoryStats->uVertexBufferBytes) / 1024.0f / 1024.0f,
(float)pMemoryStats->uTextureBytes / 1024.0f / 1024.0f,
(float)pMemoryStats->uRenderTargetBytes / 1024.0f / 1024.0f,
(float)pMemoryStats->uVertexBufferBytes / 1024.0f / 1024.0f,
(float)pMemoryStats->uIndexBufferBytes / 1024.0f / 1024.0f,
(float)pMemoryStats->uShaderConstBytes / 1024.0f,
pAdapterDesc->sizeTotalGPUmemory / 1024 / 1024,
(float)(pMemoryStats->sizeIndexBufferBytes + pMemoryStats->sizeRenderTargetBytes + pMemoryStats->sizeShaderConstBytes + pMemoryStats->sizeTextureBytes + pMemoryStats->sizeVertexBufferBytes) / 1024.0f / 1024.0f,
(float)pMemoryStats->sizeTextureBytes / 1024.0f / 1024.0f,
(float)pMemoryStats->sizeRenderTargetBytes / 1024.0f / 1024.0f,
(float)pMemoryStats->sizeVertexBufferBytes / 1024.0f / 1024.0f,
(float)pMemoryStats->sizeIndexBufferBytes / 1024.0f / 1024.0f,
(float)pMemoryStats->sizeShaderConstBytes / 1024.0f,
pFrameStats->uUploadedBuffersIndices + pFrameStats->uUploadedBuffersTextures + pFrameStats->uUploadedBuffersVertexes + pFrameStats->uUploadedBuffersShaderConst,
pFrameStats->uUploadedBuffersTextures,
......
......@@ -54,14 +54,14 @@ CCrosshair::CCrosshair():
m_idShaderKit = SGCore_ShaderCreateKit(m_idVS, m_idPS);
GXBLEND_DESC blendDesc;
blendDesc.renderTarget[0].srcBlend = blendDesc.renderTarget[0].srcBlendAlpha = GXBLEND_SRC_ALPHA;
blendDesc.renderTarget[0].destBlend = blendDesc.renderTarget[0].destBlendAlpha = GXBLEND_INV_SRC_ALPHA;
blendDesc.renderTarget[0].bBlendEnable = TRUE;
blendDesc.renderTarget[0].blendSrcColor = blendDesc.renderTarget[0].blendSrcAlpha = GXBLEND_SRC_ALPHA;
blendDesc.renderTarget[0].blendDestColor = blendDesc.renderTarget[0].blendDestAlpha = GXBLEND_INV_SRC_ALPHA;
blendDesc.renderTarget[0].useBlend = TRUE;
m_pBlendState = m_pDev->createBlendState(&blendDesc);
GXDEPTH_STENCIL_DESC dsDesc;
dsDesc.bDepthEnable = FALSE;
dsDesc.bEnableDepthWrite = FALSE;
dsDesc.useDepthTest = FALSE;
dsDesc.useDepthWrite = FALSE;
m_pDepthState = m_pDev->createDepthStencilState(&dsDesc);
}
......
......@@ -20,9 +20,9 @@ void CEditable::startup(IGXContext *pDevice)
m_pDevice = pDevice;
GXBLEND_DESC blendDesc;
blendDesc.renderTarget[0].bBlendEnable = true;
blendDesc.renderTarget[0].srcBlend = blendDesc.renderTarget[0].srcBlendAlpha = GXBLEND_BLEND_FACTOR;
blendDesc.renderTarget[0].destBlend = blendDesc.renderTarget[0].destBlendAlpha = GXBLEND_INV_BLEND_FACTOR;
blendDesc.renderTarget[0].useBlend = true;
blendDesc.renderTarget[0].blendSrcColor = blendDesc.renderTarget[0].blendSrcAlpha = GXBLEND_BLEND_FACTOR;
blendDesc.renderTarget[0].blendDestColor = blendDesc.renderTarget[0].blendDestAlpha = GXBLEND_INV_BLEND_FACTOR;
m_pBlendColorFactor = m_pDevice->createBlendState(&blendDesc);
GXRASTERIZER_DESC rsDesc;
......
......@@ -55,38 +55,38 @@ namespace gui
//@TODO: Release this
GXDEPTH_STENCIL_DESC depthStencilDesc;
depthStencilDesc.bDepthEnable = false;
depthStencilDesc.bEnableDepthWrite = false;
depthStencilDesc.useDepthTest = false;
depthStencilDesc.useDepthWrite = false;
m_depthStencilStates.m_pDefault = m_pDevice->createDepthStencilState(&depthStencilDesc);
depthStencilDesc.bStencilEnable = true;
depthStencilDesc.stencilFunc = GXCMP_EQUAL;
depthStencilDesc.stencilPassOp = GXSTENCIL_OP_INCR;
depthStencilDesc.useStencilTest = true;
depthStencilDesc.stencilTestFront.cmpFuncStencil = GXCMP_EQUAL;
depthStencilDesc.stencilTestFront.stencilOpPass = GXSTENCIL_OP_INCR;
m_depthStencilStates.m_pStencilIncr = m_pDevice->createDepthStencilState(&depthStencilDesc);
depthStencilDesc.stencilPassOp = GXSTENCIL_OP_KEEP;
depthStencilDesc.stencilTestFront.stencilOpPass = GXSTENCIL_OP_KEEP;
m_depthStencilStates.m_pStencilKeep = m_pDevice->createDepthStencilState(&depthStencilDesc);
depthStencilDesc.stencilPassOp = GXSTENCIL_OP_DECR;
depthStencilDesc.stencilTestFront.stencilOpPass = GXSTENCIL_OP_DECR;
m_depthStencilStates.m_pStencilDecr = m_pDevice->createDepthStencilState(&depthStencilDesc);
GXBLEND_DESC blendDesc;
blendDesc.renderTarget[0].bBlendEnable = true;
blendDesc.renderTarget[0].srcBlendAlpha = blendDesc.renderTarget[0].srcBlend = GXBLEND_SRC_ALPHA;
blendDesc.renderTarget[0].destBlendAlpha = blendDesc.renderTarget[0].destBlend = GXBLEND_INV_SRC_ALPHA;
blendDesc.renderTarget[0].useBlend = true;
blendDesc.renderTarget[0].blendSrcAlpha = blendDesc.renderTarget[0].blendSrcColor = GXBLEND_SRC_ALPHA;
blendDesc.renderTarget[0].blendDestAlpha = blendDesc.renderTarget[0].blendDestColor = GXBLEND_INV_SRC_ALPHA;
m_blendStates.m_pDefault = m_pDevice->createBlendState(&blendDesc);
blendDesc.renderTarget[0].u8RenderTargetWriteMask = 0;
m_blendStates.m_pNoColorWrite = m_pDevice->createBlendState(&blendDesc);
blendDesc.renderTarget[0].u8RenderTargetWriteMask = GXCOLOR_WRITE_ENABLE_ALL;
blendDesc.renderTarget[0].srcBlendAlpha = GXBLEND_ONE;
blendDesc.renderTarget[0].blendSrcAlpha = GXBLEND_ONE;
blendDesc.renderTarget[0].blendOpAlpha = GXBLEND_OP_MAX;
m_blendStates.m_pDesktop = m_pDevice->createBlendState(&blendDesc);
GXRASTERIZER_DESC rasterizerDesc;
rasterizerDesc.bMultisampleEnable = true;
rasterizerDesc.bAntialiasedLineEnable = true;
rasterizerDesc.useMultisample = true;
rasterizerDesc.useAntialiasedLine = true;
rasterizerDesc.cullMode = GXCULL_NONE;
m_pDefaultRState = m_pDevice->createRasterizerState(&rasterizerDesc);
......
......@@ -20,8 +20,8 @@ CReflection::CReflection()
}
GXDEPTH_STENCIL_DESC dsDesc;
dsDesc.bDepthEnable = false;
dsDesc.bEnableDepthWrite = false;
dsDesc.useDepthTest = false;
dsDesc.useDepthWrite = false;
m_pDSState = mtrl_data::pDXDevice->createDepthStencilState(&dsDesc);
}
......
......@@ -118,24 +118,24 @@ void pe_data::Init()
//@TODO: Check these states
GXBLEND_DESC blendDesc;
memset(&blendDesc, 0, sizeof(blendDesc));
blendDesc.renderTarget[0].bBlendEnable = TRUE;
blendDesc.renderTarget[0].blendOp = GXBLEND_OP_ADD;
blendDesc.renderTarget[0].useBlend = TRUE;
blendDesc.renderTarget[0].blendOpColor = GXBLEND_OP_ADD;
blendDesc.renderTarget[0].blendOpAlpha = GXBLEND_OP_ADD;
blendDesc.renderTarget[0].destBlend = GXBLEND_INV_SRC_ALPHA;
blendDesc.renderTarget[0].destBlendAlpha = GXBLEND_ZERO;
blendDesc.renderTarget[0].srcBlend = GXBLEND_SRC_ALPHA;
blendDesc.renderTarget[0].srcBlendAlpha = GXBLEND_ONE;
blendDesc.renderTarget[0].blendDestColor = GXBLEND_INV_SRC_ALPHA;
blendDesc.renderTarget[0].blendDestAlpha = GXBLEND_ZERO;
blendDesc.renderTarget[0].blendSrcColor = GXBLEND_SRC_ALPHA;
blendDesc.renderTarget[0].blendSrcAlpha = GXBLEND_ONE;
blendDesc.renderTarget[0].u8RenderTargetWriteMask = GXCOLOR_WRITE_ENABLE_ALL;
pe_data::pBlendStates[PARTICLESTYPE_ALPHABLEND_ALPHA] = pe_data::pDXDevice->createBlendState(&blendDesc);
blendDesc.renderTarget[0].bBlendEnable = TRUE;
blendDesc.renderTarget[0].blendOp = GXBLEND_OP_ADD;
blendDesc.renderTarget[0].useBlend = TRUE;
blendDesc.renderTarget[0].blendOpColor = GXBLEND_OP_ADD;
blendDesc.renderTarget[0].blendOpAlpha = GXBLEND_OP_ADD;
blendDesc.renderTarget[0].destBlend = GXBLEND_ONE;
blendDesc.renderTarget[0].destBlendAlpha = GXBLEND_ZERO;
blendDesc.renderTarget[0].srcBlend = GXBLEND_ONE;
blendDesc.renderTarget[0].srcBlendAlpha = GXBLEND_ONE;
blendDesc.renderTarget[0].blendDestColor = GXBLEND_ONE;
blendDesc.renderTarget[0].blendDestAlpha = GXBLEND_ZERO;
blendDesc.renderTarget[0].blendSrcColor = GXBLEND_ONE;
blendDesc.renderTarget[0].blendSrcAlpha = GXBLEND_ONE;
blendDesc.renderTarget[0].u8RenderTargetWriteMask = GXCOLOR_WRITE_ENABLE_ALL;
pe_data::pBlendStates[PARTICLESTYPE_ALPHABLEND_ADD] = pe_data::pDXDevice->createBlendState(&blendDesc);
......
......@@ -284,16 +284,16 @@ void pp_data::Init()
shaders_id::kit::idSSAO_Q_3 = SGCore_ShaderCreateKit(shaders_id::vs::idResPos, shaders_id::ps::idSSAO_Q_3);
GXBLEND_DESC blendDesc;
blendDesc.renderTarget[0].bBlendEnable = true;
blendDesc.renderTarget[0].srcBlend = blendDesc.renderTarget[0].srcBlendAlpha = GXBLEND_SRC_ALPHA;
blendDesc.renderTarget[0].destBlend = blendDesc.renderTarget[0].destBlendAlpha = GXBLEND_INV_SRC_ALPHA;
blendDesc.renderTarget[0].useBlend = true;
blendDesc.renderTarget[0].blendSrcColor = blendDesc.renderTarget[0].blendSrcAlpha = GXBLEND_SRC_ALPHA;
blendDesc.renderTarget[0].blendDestColor = blendDesc.renderTarget[0].blendDestAlpha = GXBLEND_INV_SRC_ALPHA;
rstates::pBlendAlpha = pDXDevice->createBlendState(&blendDesc);
blendDesc.renderTarget[0].srcBlend = blendDesc.renderTarget[0].srcBlendAlpha = GXBLEND_ONE;
blendDesc.renderTarget[0].destBlend = blendDesc.renderTarget[0].destBlendAlpha = GXBLEND_ONE;
blendDesc.renderTarget[0].blendSrcColor = blendDesc.renderTarget[0].blendSrcAlpha = GXBLEND_ONE;
blendDesc.renderTarget[0].blendDestColor = blendDesc.renderTarget[0].blendDestAlpha = GXBLEND_ONE;
rstates::pBlendAlphaOne = pDXDevice->createBlendState(&blendDesc);
blendDesc.renderTarget[0].bBlendEnable = false;
blendDesc.renderTarget[0].useBlend = false;
blendDesc.renderTarget[0].u8RenderTargetWriteMask = 0;
rstates::pBlendNoColor = pDXDevice->createBlendState(&blendDesc);
......@@ -316,21 +316,21 @@ void pp_data::Init()
GXRASTERIZER_DESC rasterizerDesc;
rasterizerDesc.bScissorEnable = true;
rasterizerDesc.useScissorTest = true;
rstates::pRasterizerScissorsTest = pDXDevice->createRasterizerState(&rasterizerDesc);
GXDEPTH_STENCIL_DESC dsDesc;
dsDesc.bDepthEnable = FALSE;
dsDesc.useDepthTest = FALSE;
rstates::pDepthStencilNoZ = pDXDevice->createDepthStencilState(&dsDesc);
dsDesc.bStencilEnable = true;
dsDesc.stencilPassOp = GXSTENCIL_OP_REPLACE;
dsDesc.useStencilTest = true;
dsDesc.stencilTestFront.stencilOpPass = GXSTENCIL_OP_REPLACE;
rstates::pDepthStencilEdgeDetect = pDXDevice->createDepthStencilState(&dsDesc);
dsDesc.stencilFunc = GXCMP_EQUAL;
dsDesc.stencilPassOp = GXSTENCIL_OP_KEEP;
dsDesc.stencilTestFront.cmpFuncStencil = GXCMP_EQUAL;
dsDesc.stencilTestFront.stencilOpPass = GXSTENCIL_OP_KEEP;
rstates::pDepthStencilDLAA = pDXDevice->createDepthStencilState(&dsDesc);
}
......@@ -356,7 +356,7 @@ void pp_data::InitNoiseTex()
vRnd.z = randf(0, 1);
vRnd = SMVector3Normalize(vRnd);
pData[i] = GXCOLOR_COLORVALUE(vRnd.x, vRnd.y, vRnd.z, 1.0f);
pData[i] = GXCOLOR_FLOAT_RGBA(vRnd.x, vRnd.y, vRnd.z, 1.0f);
}
pRnsSampler = pp_data::pDXDevice->createTexture2D(*r_win_width, *r_win_height, 1, 0, GXFMT_A8R8G8B8, pData);
......
......@@ -87,8 +87,8 @@ CRenderPipeline::CRenderPipeline(IGXContext *pDevice):
GXDEPTH_STENCIL_DESC dsDesc;
dsDesc.bDepthEnable = FALSE;
dsDesc.bEnableDepthWrite = FALSE;
dsDesc.useDepthTest = FALSE;
dsDesc.useDepthWrite = FALSE;
m_pDepthStencilStateNoZ = m_pDevice->createDepthStencilState(&dsDesc);
m_pSceneShaderDataVS = m_pDevice->createConstantBuffer(sizeof(m_sceneShaderData.vs));
......@@ -657,15 +657,15 @@ void CRenderPipeline::renderGI()
m_pDevice->setTextureCS(m_pGIAccumGreen, 1);
m_pDevice->setTextureCS(m_pGIAccumBlue, 2);
m_pDevice->setUnorderedAccessVeiwCS(m_pGIAccumRed2, 0);
m_pDevice->setUnorderedAccessVeiwCS(m_pGIAccumGreen2, 1);
m_pDevice->setUnorderedAccessVeiwCS(m_pGIAccumBlue2, 2);
m_pDevice->setUnorderedAccessViewCS(m_pGIAccumRed2, 0);
m_pDevice->setUnorderedAccessViewCS(m_pGIAccumGreen2, 1);
m_pDevice->setUnorderedAccessViewCS(m_pGIAccumBlue2, 2);
m_pDevice->computeDispatch(2, 16, 32);
m_pDevice->setUnorderedAccessVeiwCS(NULL, 0);
m_pDevice->setUnorderedAccessVeiwCS(NULL, 1);
m_pDevice->setUnorderedAccessVeiwCS(NULL, 2);
m_pDevice->setUnorderedAccessViewCS(NULL, 0);
m_pDevice->setUnorderedAccessViewCS(NULL, 1);
m_pDevice->setUnorderedAccessViewCS(NULL, 2);
m_pDevice->setTextureCS(NULL, 0);
m_pDevice->setTextureCS(NULL, 1);
......@@ -678,15 +678,15 @@ void CRenderPipeline::renderGI()
m_pDevice->setTextureCS(m_pGIAccumGreen2, 1);
m_pDevice->setTextureCS(m_pGIAccumBlue2, 2);
m_pDevice->setUnorderedAccessVeiwCS(m_pGIAccumRed, 0);
m_pDevice->setUnorderedAccessVeiwCS(m_pGIAccumGreen, 1);
m_pDevice->setUnorderedAccessVeiwCS(m_pGIAccumBlue, 2);
m_pDevice->setUnorderedAccessViewCS(m_pGIAccumRed, 0);
m_pDevice->setUnorderedAccessViewCS(m_pGIAccumGreen, 1);
m_pDevice->setUnorderedAccessViewCS(m_pGIAccumBlue, 2);
m_pDevice->computeDispatch(2, 16, 32);
m_pDevice->setUnorderedAccessVeiwCS(NULL, 0);
m_pDevice->setUnorderedAccessVeiwCS(NULL, 1);
m_pDevice->setUnorderedAccessVeiwCS(NULL, 2);
m_pDevice->setUnorderedAccessViewCS(NULL, 0);
m_pDevice->setUnorderedAccessViewCS(NULL, 1);
m_pDevice->setUnorderedAccessViewCS(NULL, 2);
m_pDevice->setTextureCS(NULL, 0);
m_pDevice->setTextureCS(NULL, 1);
......
......@@ -5,6 +5,7 @@ CShadowCache::CShadowCache(IXRenderPipeline *pRenderPipeline, IXMaterialSystem *
m_pRenderPipeline(pRenderPipeline),
m_pMaterialSystem(pMaterialSystem)
{
Core_0RegisterCVarFloat("r_lsm_quality", 1, "Коэфициент размера карты глубины для локальных источников света относительно размеров окна рендера [0.5,4] (низкое, высокое)");
Core_0RegisterCVarFloat("r_sm_max_memory", 0.15f, "Максимальный процент от доступной видеопамяти, отводимый под кэш теней");
m_idRSMPixelShader = SGCore_ShaderLoad(SHADER_TYPE_PIXEL, "sm_rsm_generic.ps");
......@@ -32,7 +33,7 @@ void CShadowCache::setLightsCount(UINT uPoints, UINT uSpots, bool hasGlobal)
static const float *s_pfRSMMaxMemory = GET_PCVAR_FLOAT("r_sm_max_memory");
const UINT uDefaultShadowmapSize = (UINT)(512 * *s_pfRLSMQuality);
size_t stMaxMem = (size_t)(m_pRenderPipeline->getDevice()->getAdapterDesc()->uTotalGPUMemory * *s_pfRSMMaxMemory);
size_t stMaxMem = (size_t)(m_pRenderPipeline->getDevice()->getAdapterDesc()->sizeTotalGPUmemory * *s_pfRSMMaxMemory);
size_t stPointsMemory = 0;
size_t stSpotsMemory = uSpots * CShadowMap::GetMapMemory(uDefaultShadowmapSize);
......
......@@ -196,44 +196,44 @@ void gdata::shaders_id::InitAllShaders()
GXDEPTH_STENCIL_DESC dsDesc;
dsDesc.bDepthEnable = FALSE;
dsDesc.bEnableDepthWrite = FALSE;
dsDesc.useDepthTest = FALSE;
dsDesc.useDepthWrite = FALSE;
gdata::rstates::pDepthStencilStateNoZ = gdata::pDXDevice->createDepthStencilState(&dsDesc);
dsDesc.bStencilEnable = TRUE;
dsDesc.depthFunc = GXCMP_ALWAYS;
dsDesc.stencilPassOp = GXSTENCIL_OP_REPLACE;
dsDesc.useStencilTest = TRUE;
dsDesc.cmpFuncDepth = GXCMP_ALWAYS;
dsDesc.stencilTestFront.stencilOpPass = GXSTENCIL_OP_REPLACE;
gdata::rstates::pDepthStencilStateMrtStage0 = gdata::pDXDevice->createDepthStencilState(&dsDesc);
dsDesc.bDepthEnable = TRUE;
dsDesc.depthFunc = GXCMP_LESS_EQUAL;
dsDesc.stencilFunc = GXCMP_NOT_EQUAL;
dsDesc.stencilPassOp = GXSTENCIL_OP_DECR;
dsDesc.useDepthTest = TRUE;
dsDesc.cmpFuncDepth = GXCMP_LESS_EQUAL;
dsDesc.stencilTestFront.cmpFuncStencil = GXCMP_NOT_EQUAL;
dsDesc.stencilTestFront.stencilOpPass = GXSTENCIL_OP_DECR;
gdata::rstates::pDepthStencilStateMrtStage1 = gdata::pDXDevice->createDepthStencilState(&dsDesc);
dsDesc.bEnableDepthWrite = FALSE;
dsDesc.stencilFunc = GXCMP_ALWAYS;
dsDesc.stencilDepthFailOp = GXSTENCIL_OP_INCR;
dsDesc.stencilPassOp = GXSTENCIL_OP_KEEP;
dsDesc.stencilBackDepthFailOp = GXSTENCIL_OP_DECR;
dsDesc.useDepthWrite = FALSE;
dsDesc.stencilTestFront.cmpFuncStencil = GXCMP_ALWAYS;
dsDesc.stencilTestFront.stencilOpDepthFail = GXSTENCIL_OP_INCR;
dsDesc.stencilTestFront.stencilOpPass = GXSTENCIL_OP_KEEP;
dsDesc.stencilTestBack.stencilOpDepthFail = GXSTENCIL_OP_DECR;
gdata::rstates::pDepthStencilStateLightBound = gdata::pDXDevice->createDepthStencilState(&dsDesc);
dsDesc.bDepthEnable = FALSE;
dsDesc.bEnableDepthWrite = FALSE;
dsDesc.stencilFunc = GXCMP_EQUAL;
dsDesc.stencilDepthFailOp = GXSTENCIL_OP_ZERO;
dsDesc.stencilFailOp = GXSTENCIL_OP_ZERO;
dsDesc.stencilPassOp = GXSTENCIL_OP_KEEP;
dsDesc.useDepthTest = FALSE;
dsDesc.useDepthWrite = FALSE;
dsDesc.stencilTestFront.cmpFuncStencil = GXCMP_EQUAL;
dsDesc.stencilTestFront.stencilOpDepthFail = GXSTENCIL_OP_ZERO;
dsDesc.stencilTestFront.stencilOpFail = GXSTENCIL_OP_ZERO;
dsDesc.stencilTestFront.stencilOpPass = GXSTENCIL_OP_KEEP;
gdata::rstates::pDepthStencilStateLightShadowNonGlobal = gdata::pDXDevice->createDepthStencilState(&dsDesc);
dsDesc.stencilPassOp = GXSTENCIL_OP_ZERO;
dsDesc.stencilTestFront.stencilOpPass = GXSTENCIL_OP_ZERO;
gdata::rstates::pDepthStencilStateLightClear = gdata::pDXDevice->createDepthStencilState(&dsDesc);
dsDesc.bStencilEnable = FALSE;
dsDesc.useStencilTest = FALSE;
gdata::rstates::pDepthStencilStateLightShadowGlobal = gdata::pDXDevice->createDepthStencilState(&dsDesc);
dsDesc.bDepthEnable = TRUE;
dsDesc.bEnableDepthWrite = FALSE;
dsDesc.useDepthTest = TRUE;
dsDesc.useDepthWrite = FALSE;
gdata::rstates::pDepthStencilStateParticles = gdata::pDXDevice->createDepthStencilState(&dsDesc);
......@@ -267,17 +267,17 @@ void gdata::shaders_id::InitAllShaders()
gdata::rstates::pBlendRed = gdata::pDXDevice->createBlendState(&blendDesc);
blendDesc.renderTarget[0].u8RenderTargetWriteMask = GXCOLOR_WRITE_ENABLE_ALL;
blendDesc.renderTarget[0].bBlendEnable = TRUE;
blendDesc.renderTarget[0].srcBlend = blendDesc.renderTarget[0].srcBlendAlpha = GXBLEND_INV_DEST_ALPHA;
blendDesc.renderTarget[0].destBlend = blendDesc.renderTarget[0].destBlendAlpha = GXBLEND_DEST_ALPHA;
blendDesc.renderTarget[0].useBlend = TRUE;
blendDesc.renderTarget[0].blendSrcColor = blendDesc.renderTarget[0].blendSrcAlpha = GXBLEND_INV_DEST_ALPHA;
blendDesc.renderTarget[0].blendDestColor = blendDesc.renderTarget[0].blendDestAlpha = GXBLEND_DEST_ALPHA;
gdata::rstates::pBlendAlpha = gdata::pDXDevice->createBlendState(&blendDesc);
blendDesc.renderTarget[0].srcBlend = blendDesc.renderTarget[0].srcBlendAlpha = GXBLEND_ONE;
blendDesc.renderTarget[0].destBlend = blendDesc.renderTarget[0].destBlendAlpha = GXBLEND_ONE;
blendDesc.renderTarget[0].blendSrcColor = blendDesc.renderTarget[0].blendSrcAlpha = GXBLEND_ONE;
blendDesc.renderTarget[0].blendDestColor = blendDesc.renderTarget[0].blendDestAlpha = GXBLEND_ONE;
gdata::rstates::pBlendAlphaOneOne = gdata::pDXDevice->createBlendState(&blendDesc);
blendDesc.renderTarget[0].srcBlend = blendDesc.renderTarget[0].srcBlendAlpha = GXBLEND_SRC_ALPHA;
blendDesc.renderTarget[0].destBlend = blendDesc.renderTarget[0].destBlendAlpha = GXBLEND_INV_SRC_ALPHA;
blendDesc.renderTarget[0].blendSrcColor = blendDesc.renderTarget[0].blendSrcAlpha = GXBLEND_SRC_ALPHA;
blendDesc.renderTarget[0].blendDestColor = blendDesc.renderTarget[0].blendDestAlpha = GXBLEND_INV_SRC_ALPHA;
gdata::rstates::pBlendAlphaSky = gdata::pDXDevice->createBlendState(&blendDesc);
......
......@@ -220,24 +220,24 @@ CGrid::CGrid(UINT uSize)
m_idShaderKit = SGCore_ShaderCreateKit(m_idVS, m_idPS);
GXBLEND_DESC blendDesc;
blendDesc.renderTarget[0].bBlendEnable = TRUE;
blendDesc.renderTarget[0].srcBlend = blendDesc.renderTarget[0].srcBlendAlpha = GXBLEND_SRC_ALPHA;
blendDesc.renderTarget[0].destBlend = blendDesc.renderTarget[0].destBlendAlpha = GXBLEND_INV_SRC_ALPHA;
blendDesc.renderTarget[0].useBlend = TRUE;
blendDesc.renderTarget[0].blendSrcColor = blendDesc.renderTarget[0].blendSrcAlpha = GXBLEND_SRC_ALPHA;
blendDesc.renderTarget[0].blendDestColor = blendDesc.renderTarget[0].blendDestAlpha = GXBLEND_INV_SRC_ALPHA;
m_pBlendState = m_pDevice->createBlendState(&blendDesc);
blendDesc.renderTarget[0].bBlendEnable = FALSE;
blendDesc.renderTarget[0].useBlend = FALSE;
blendDesc.renderTarget[0].u8RenderTargetWriteMask = 0;
m_pBlendStateNoColor = m_pDevice->createBlendState(&blendDesc);
GXDEPTH_STENCIL_DESC dsDesc;
dsDesc.bDepthEnable = FALSE;
dsDesc.bStencilEnable = TRUE;
dsDesc.stencilPassOp = GXSTENCIL_OP_INCR;
dsDesc.useDepthTest = FALSE;
dsDesc.useStencilTest = TRUE;
dsDesc.stencilTestFront.stencilOpPass = GXSTENCIL_OP_INCR;
m_pStencilPass0 = m_pDevice->createDepthStencilState(&dsDesc);
dsDesc.stencilFunc = GXCMP_EQUAL;
dsDesc.stencilPassOp = GXSTENCIL_OP_KEEP;
dsDesc.stencilTestFront.cmpFuncStencil = GXCMP_EQUAL;
dsDesc.stencilTestFront.stencilOpPass = GXSTENCIL_OP_KEEP;
m_pStencilPass1 = m_pDevice->createDepthStencilState(&dsDesc);
m_pVSConstantBuffer = m_pDevice->createConstantBuffer(sizeof(SMMATRIX));
......
......@@ -22,7 +22,7 @@
#include <render/sxrender.h>
#include <input/sxinput.h>
//#include <sxguiwinapi/sxgui.h>
#include <level/sxlevel.h>
//#include <level/sxlevel.h>
#include "terrax.h"
#include <xcommon/editor/IXEditorObject.h>
......@@ -85,6 +85,8 @@ extern CUndoManager *g_pUndoManager;
extern Array<IXEditable*> g_pEditableSystems;
extern String g_sLevelName;
// Forward declarations of functions included in this code module:
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
LRESULT CALLBACK GuiWndProc(HWND, UINT, WPARAM, LPARAM);
......@@ -492,7 +494,7 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
SetWindowFont(g_hStaticClassesWnd, GetStockObject(DEFAULT_GUI_FONT), FALSE);
}
g_hComboClassesWnd = CreateWindowExA(0, WC_COMBOBOX, "", WS_VISIBLE | WS_CHILD | WS_BORDER | CBS_SORT | CBS_DROPDOWN | CBS_HASSTRINGS, rect.right, rect.top + OBJECT_TREE_HEIGHT + 15 + 15 + 25, MARGIN_RIGHT, OBJECT_TREE_HEIGHT, hWnd, (HMENU)IDC_CMB_CLASS, hInst, NULL);
g_hComboClassesWnd = CreateWindowExA(0, WC_COMBOBOX, "", WS_VISIBLE | WS_CHILD | WS_BORDER | CBS_SORT | CBS_DROPDOWNLIST | CBS_HASSTRINGS, rect.right, rect.top + OBJECT_TREE_HEIGHT + 15 + 15 + 25, MARGIN_RIGHT, OBJECT_TREE_HEIGHT, hWnd, (HMENU)IDC_CMB_CLASS, hInst, NULL);
{
SetWindowFont(g_hComboClassesWnd, GetStockObject(DEFAULT_GUI_FONT), FALSE);
}
......@@ -618,7 +620,7 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
if(g_pUndoManager->isDirty())
{
const char *szLevelName = SLevel_GetName();
const char *szLevelName = g_sLevelName.c_str();
char szPrompt[128];
if(szLevelName[0])
{
......@@ -654,7 +656,7 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
if(g_pUndoManager->isDirty())
{
const char *szLevelName = SLevel_GetName();
const char *szLevelName = g_sLevelName.c_str();
char szPrompt[128];
if(szLevelName[0])
{
......@@ -1161,7 +1163,7 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
if(isTop)
{
// pCamera = g_pTopLeftCamera;
pCamera = SRender_GetCamera();
pCamera = g_xConfig.m_pViewportCamera[XWP_TOP_LEFT];
float3 vLook, vPos;
pCamera->getLook(&vLook);
pCamera->getPosition(&vPos);
......@@ -1252,7 +1254,7 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
case WM_CLOSE:
if(g_pUndoManager->isDirty())
{
const char *szLevelName = SLevel_GetName();
const char *szLevelName = g_sLevelName.c_str();
char szPrompt[128];
if(szLevelName[0])
{
......
......@@ -10,6 +10,8 @@ See the license in LICENSE
#include <skyxengine.h>
#include <io.h>
#include <windowsx.h>
#include <commctrl.h>
#pragma comment(lib, "Comctl32.lib")
#include "resource.h"
#include "terrax.h"
......@@ -48,6 +50,8 @@ static IGXRenderBuffer *g_pBorderRenderBuffer;
CUndoManager *g_pUndoManager = NULL;
extern HWND g_hComboTypesWnd;
String g_sLevelName;
void XUpdateWindowTitle();
HACCEL g_hAccelTable = NULL;
......@@ -70,9 +74,6 @@ void XInitViewports();
class CEngineCallback: public IXEngineCallback
{
public:
CEngineCallback()
{
}
void XMETHODCALLTYPE onGraphicsResize(UINT uWidth, UINT uHeight, bool isFullscreen, bool isBorderless, IXEngine *pEngine) override
{
XReleaseViewports();
......@@ -192,6 +193,11 @@ public:
return(true);
}
ICamera* XMETHODCALLTYPE getCameraForFrame() override
{
return(g_xConfig.m_pViewportCamera[XWP_TOP_LEFT]);
}
protected:
};
......@@ -217,9 +223,6 @@ public:
void renderFrame() override
{
SRender_SetCamera(g_xConfig.m_pViewportCamera[XWP_TOP_LEFT]);
SRender_UpdateView();
m_pOldPipeline->renderFrame();
XRender3D();
......@@ -472,11 +475,12 @@ int main(int argc, char **argv)
switch(pData->type)
{
case XEventLevel::TYPE_LOAD:
g_sLevelName = pData->szLevelName;
XUpdateWindowTitle();
break;
case XEventLevel::TYPE_UNLOAD:
SLevel_Clear();
g_sLevelName = "";
for(UINT i = 0, l = g_pLevelObjects.size(); i < l; ++i)
{
......@@ -491,6 +495,7 @@ int main(int argc, char **argv)
break;
case XEventLevel::TYPE_SAVE:
g_sLevelName = pData->szLevelName;
g_pUndoManager->makeClean();
break;
}
......@@ -535,13 +540,13 @@ int main(int argc, char **argv)
IGXContext *pDevice = SGCore_GetDXDevice();
GXBLEND_DESC blendDesc;
blendDesc.renderTarget[0].bBlendEnable = true;
blendDesc.renderTarget[0].srcBlend = blendDesc.renderTarget[0].srcBlendAlpha = GXBLEND_BLEND_FACTOR;
blendDesc.renderTarget[0].destBlend = blendDesc.renderTarget[0].destBlendAlpha = GXBLEND_INV_BLEND_FACTOR;
blendDesc.renderTarget[0].useBlend = true;
blendDesc.renderTarget[0].blendSrcColor = blendDesc.renderTarget[0].blendSrcAlpha = GXBLEND_BLEND_FACTOR;
blendDesc.renderTarget[0].blendDestColor = blendDesc.renderTarget[0].blendDestAlpha = GXBLEND_INV_BLEND_FACTOR;
g_xRenderStates.pBlendColorFactor = pDevice->createBlendState(&blendDesc);
blendDesc.renderTarget[0].srcBlend = blendDesc.renderTarget[0].srcBlendAlpha = GXBLEND_SRC_ALPHA;
blendDesc.renderTarget[0].destBlend = blendDesc.renderTarget[0].destBlendAlpha = GXBLEND_INV_SRC_ALPHA;
blendDesc.renderTarget[0].blendSrcColor = blendDesc.renderTarget[0].blendSrcAlpha = GXBLEND_SRC_ALPHA;
blendDesc.renderTarget[0].blendDestColor = blendDesc.renderTarget[0].blendDestAlpha = GXBLEND_INV_SRC_ALPHA;
g_xRenderStates.pBlendAlpha = pDevice->createBlendState(&blendDesc);
GXRASTERIZER_DESC rsDesc;
......@@ -627,8 +632,8 @@ int main(int argc, char **argv)
}
GXDEPTH_STENCIL_DESC dsDesc;
dsDesc.bDepthEnable = FALSE;
dsDesc.bEnableDepthWrite = FALSE;
dsDesc.useDepthTest = FALSE;
dsDesc.useDepthWrite = FALSE;
g_pDSNoZ = SGCore_GetDXDevice()->createDepthStencilState(&dsDesc);
XInitViewports();
......@@ -1135,9 +1140,9 @@ bool XSaveLevel(const char *szNewName, bool bForcePrompt)
return(true);
}
if(!bForcePrompt && SLevel_GetName()[0])
if(!bForcePrompt && g_sLevelName[0])
{
return(XSaveLevel(SLevel_GetName()));
return(XSaveLevel(g_sLevelName.c_str()));
}
char szName[1024];
......@@ -1191,7 +1196,7 @@ void XDrawBorder(GXCOLOR color, const float3_t &vA, const float3_t &vB, const fl
SGCore_ShaderBind(g_xRenderStates.idTexturedShaderKit);
static IGXConstantBuffer *s_pColorBuffer = pDevice->createConstantBuffer(sizeof(float4));
s_pColorBuffer->update(&GXCOLOR_COLORVECTOR_ARGB(color));
s_pColorBuffer->update(&GXCOLOR_COLOR_TO_F4(color));
pDevice->setPixelShaderConstant(s_pColorBuffer);
pDevice->setTexture(SGCore_LoadTexGetTex(SRender_EditorGetDashedTex()));
......@@ -1303,7 +1308,7 @@ bool XIsMouseInSelection(X_WINDOW_POS wnd)
void XUpdateWindowTitle()
{
const char *szLevelName = SLevel_GetName();
const char *szLevelName = g_sLevelName.c_str();
char szCaption[256];
bool isDirty = g_pUndoManager->isDirty();
if(szLevelName && szLevelName[0])
......
......@@ -213,7 +213,6 @@ bool CEngine::runFrame()
SSInput_Update();
SRender_SetCamera(SGame_GetActiveCamera());
// draw frame
{
......@@ -239,10 +238,11 @@ bool CEngine::runFrame()
//#############################################################################
SRender_UpdateView();
if(pRenderContext)
{
SRender_SetCamera(m_pCallback->getCameraForFrame());
SRender_UpdateView();
IXRenderPipeline *pRenderPipeline;
m_pCore->getRenderPipeline(&pRenderPipeline);
......
......@@ -17,6 +17,7 @@
#define C extern "C"
class IXEngine;
class ICamera;
class IXEngineCallback
{
......@@ -24,6 +25,8 @@ public:
virtual void XMETHODCALLTYPE onGraphicsResize(UINT uWidth, UINT uHeight, bool isFullscreen, bool isBorderless, IXEngine *pEngine) = 0;
virtual bool XMETHODCALLTYPE processWindowMessages() = 0;
virtual ICamera* XMETHODCALLTYPE getCameraForFrame() = 0;
};
class IXEngine: public IXUnknown
......