Commit 30aa86b3 authored by D-AIRY's avatar D-AIRY

Fixed some warnings

parent a63cbdc1
......@@ -161,6 +161,10 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sxaigrid", "..\..\sxaigrid\
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sxlevel", "..\..\sxlevel\vs2013\sxlevel.vcxproj", "{6FE14C5C-6052-4D96-A89F-0843D91F89AD}"
ProjectSection(ProjectDependencies) = postProject
{718C186E-9155-41DF-B8AB-74ED03E204CD} = {718C186E-9155-41DF-B8AB-74ED03E204CD}
{7F0ACED1-6E16-4DD3-800E-0C50150897C2} = {7F0ACED1-6E16-4DD3-800E-0C50150897C2}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sxrender", "..\..\sxrender\vs2013\sxrender.vcxproj", "{7F0ACED1-6E16-4DD3-800E-0C50150897C2}"
EndProject
......
......@@ -62,6 +62,7 @@
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;SXAIGRID_EXPORTS;SX_DLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
......
......@@ -61,7 +61,7 @@
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;SXANIM_EXPORTS;SX_DLL%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;_CRT_SECURE_NO_WARNINGS;_DEBUG;_WINDOWS;_USRDLL;SXANIM_EXPORTS;SX_DLL%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
......@@ -81,7 +81,7 @@
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;SXANIM_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;_CRT_SECURE_NO_WARNINGS;NDEBUG;_WINDOWS;_USRDLL;SXANIM_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
</ClCompile>
<Link>
......
......@@ -58,10 +58,11 @@
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level1</WarningLevel>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;SXLEVEL_EXPORTS;SX_DLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
......
......@@ -58,10 +58,11 @@
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level1</WarningLevel>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;SXRENDER_EXPORTS;SX_DLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;_CRT_SECURE_NO_WARNINGS;_DEBUG;_WINDOWS;_USRDLL;SXRENDER_EXPORTS;SX_DLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
......@@ -78,7 +79,7 @@
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;SXRENDER_EXPORTS;SX_DLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;_CRT_SECURE_NO_WARNINGS;NDEBUG;_WINDOWS;_USRDLL;SXRENDER_EXPORTS;SX_DLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
</ClCompile>
<Link>
......
......@@ -70,8 +70,9 @@
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;SXSCORE_EXPORTS;SX_DLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;_CRT_SECURE_NO_WARNINGS;_DEBUG;_WINDOWS;_USRDLL;SXSCORE_EXPORTS;SX_DLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
......@@ -89,7 +90,7 @@
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;SXSCORE_EXPORTS;SX_DLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;_CRT_SECURE_NO_WARNINGS;NDEBUG;_WINDOWS;_USRDLL;SXSCORE_EXPORTS;SX_DLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
</ClCompile>
<Link>
......
......@@ -15,7 +15,7 @@ public:
void toggleEnable();
void setColor(const float3 &vColor) { m_vColor = vColor; };
const float3& getColor() const { return m_vColor; };
const float3_t& getColor() const { return m_vColor; };
void setDist(float fDist) { m_fDist = fDist; };
float getDist() const { return m_fDist; };
......
......@@ -17,7 +17,7 @@ public:
void toggleEnable();
void setColor(const float3 &vColor) { m_vColor = vColor; };
const float3& getColor() const { return m_vColor; };
const float3_t& getColor() const { return m_vColor; };
void setDist(float fDist) { m_fDist = fDist; };
float getDist() const { return m_fDist; };
......
......@@ -36,22 +36,22 @@ void CAxesStatic::create(float len)
CVertex *pVertices;
m_pVertexBuffer->Lock(0, 0, (void**)&pVertices, 0);
pVertices[0].m_vPos = float3_t(0, 0.001, 0);
pVertices[0].m_vPos = float3_t(0, 0.001f, 0);
pVertices[0].m_dwColor = D3DCOLOR_ARGB(255, 255, 0, 0);
pVertices[1].m_vPos = float3_t(len, 0.001, 0);
pVertices[1].m_vPos = float3_t(len, 0.001f, 0);
pVertices[1].m_dwColor = D3DCOLOR_ARGB(255, 255, 0, 0);
pVertices[2].m_vPos = float3_t(0, 0.001, 0);
pVertices[2].m_vPos = float3_t(0, 0.001f, 0);
pVertices[2].m_dwColor = D3DCOLOR_ARGB(255, 0, 255, 0);
pVertices[3].m_vPos = float3_t(0, len, 0);
pVertices[3].m_dwColor = D3DCOLOR_ARGB(255, 0, 255, 0);
pVertices[4].m_vPos = float3_t(0, 0.001, 0);
pVertices[4].m_vPos = float3_t(0, 0.001f, 0);
pVertices[4].m_dwColor = D3DCOLOR_ARGB(255, 0, 0, 255);
pVertices[5].m_vPos = float3_t(0, 0.001, len);
pVertices[5].m_vPos = float3_t(0, 0.001f, len);
pVertices[5].m_dwColor = D3DCOLOR_ARGB(255, 0, 0, 255);
m_pVertexBuffer->Unlock();
......
......@@ -40,20 +40,20 @@ void CGrid::create(int width, int depth, DWORD color)
for (int x = -(width/2); x < (width/2) + 1; ++x)
{
pVertices[oCountVert].m_vPos = float3_t(x, 0, -(depth / 2));
pVertices[oCountVert].m_vPos = float3_t((float)x, 0.0f, (float)(-(depth / 2)));
pVertices[oCountVert].m_dwColor = color;
++oCountVert;
pVertices[oCountVert].m_vPos = float3_t(x, 0, depth / 2);
pVertices[oCountVert].m_vPos = float3_t((float)x, 0.0f, (float)(depth / 2));
pVertices[oCountVert].m_dwColor = color;
++oCountVert;
}
for (int y = -(depth / 2); y < (depth/2) + 1; ++y)
{
pVertices[oCountVert].m_vPos = float3_t(-(width / 2), 0, y);
pVertices[oCountVert].m_vPos = float3_t((float)(-(width / 2)), 0.0f, (float)y);
pVertices[oCountVert].m_dwColor = color;
++oCountVert;
pVertices[oCountVert].m_vPos = float3_t(width / 2, 0, y);
pVertices[oCountVert].m_vPos = float3_t((float)(width / 2), 0.0f, (float)y);
pVertices[oCountVert].m_dwColor = color;
++oCountVert;
}
......
......@@ -70,7 +70,7 @@ ModelSim::~ModelSim()
mem_release(TransVertBufGreen);
for (int i = 0; i < ArrStaticModel.size(); ++i)
for (UINT i = 0; i < ArrStaticModel.size(); ++i)
{
mem_release(ArrStaticModel[i]->Anim);
mem_release(ArrStaticModel[i]->Model);
......@@ -155,7 +155,7 @@ void ModelSim::Add(const char* path)
Anim->Lock(0, 0, (void**)&pDataAnim, 0);
StaticModel->VertexBuffer->Lock(0, 0, (void**)&pData, 0);
for (int i = 0; i < StaticModel->AllVertexCount; ++i)
for (UINT i = 0; i < StaticModel->AllVertexCount; ++i)
{
pDataAnim[i].Pos = pData[i].Pos;
pDataAnim[i].Norm = pData[i].Norm;
......@@ -194,7 +194,7 @@ void ModelSim::GetCenter(float3_t* center)
void ModelSim::Render(DWORD timeDelta)
{
if (!(CurrRenderModel >= 0 && ArrStaticModel.size() > CurrRenderModel && ArrStaticModel[CurrRenderModel]))
if (!(CurrRenderModel >= 0 && ArrStaticModel.size() > (UINT)CurrRenderModel && ArrStaticModel[CurrRenderModel]))
return;
WorldMat = SMMatrixRotationX(Rotation.x) * SMMatrixRotationY(Rotation.y) * SMMatrixRotationZ(Rotation.z);
......@@ -219,7 +219,7 @@ void ModelSim::Render(DWORD timeDelta)
void ModelSim::RenderStatic(DWORD timeDelta)
{
uint32_t* RTGPUArrIndicesPtrs2;
// uint32_t* RTGPUArrIndicesPtrs2;
GData::DXDevice->SetStreamSource(0, ArrStaticModel[CurrRenderModel]->Model->VertexBuffer, 0, sizeof(vertex_static));
GData::DXDevice->SetIndices(ArrStaticModel[CurrRenderModel]->Model->IndexBuffer);
......
......@@ -46,7 +46,7 @@ inline void SXRenderFunc::SetSamplerFilter(DWORD begin_id, DWORD end_id, DWORD v
{
if (begin_id >= 0 && end_id <= 16)
{
for (int i = begin_id; i<=end_id; i++)
for(DWORD i = begin_id; i <= end_id; i++)
SXRenderFunc::SetSamplerFilter(i, value);
}
}
......
......@@ -20,9 +20,9 @@ int ogg_seek(void *datasource, ogg_int64_t offset, int whence)
FILE* f = (FILE*)datasource;
switch (whence)
{
case SEEK_SET: return fseek(f, offset, SEEK_SET); break;
case SEEK_CUR: return fseek(f, offset, SEEK_CUR); break;
case SEEK_END: return fseek(f, offset, SEEK_END); break;
case SEEK_SET: return fseek(f, offset, SEEK_SET);
case SEEK_CUR: return fseek(f, offset, SEEK_CUR);
case SEEK_END: return fseek(f, offset, SEEK_END);
default: return -1;
}
return 1;
......@@ -52,7 +52,7 @@ MainSound::~MainSound()
void MainSound::Clear()
{
for (int i = 0; i < ArrSounds.size(); ++i)
for(UINT i = 0; i < ArrSounds.size(); ++i)
{
mem_delete(ArrSounds[i]);
}
......@@ -577,7 +577,7 @@ void MainSound::SoundInstancePlay2d(ID id, int volume, int pan)
}
ID id_instance = -1;
for (int i = 0; i < snd->DataInstances.size(); ++i)
for (UINT i = 0; i < snd->DataInstances.size(); ++i)
{
if (!snd->DataInstances[i].busy)
{
......@@ -637,9 +637,9 @@ void MainSound::SoundInstancePlay3d(ID id, const float3* pos)
}
ID id_instance = -1;
for (int i = 0; i < snd->DataInstances.size(); ++i)
for(UINT i = 0; i < snd->DataInstances.size(); ++i)
{
if (!snd->DataInstances[i].busy)
if(!snd->DataInstances[i].busy)
{
id_instance = i;
break;
......@@ -691,7 +691,7 @@ ID MainSound::AddSound(Sound* snd)
bool MainSound::SoundIsInit(ID id)
{
return (ArrSounds.size() > id && ArrSounds[id] != 0);
return ((ID)ArrSounds.size() > id && ArrSounds[id] != 0);
}
void MainSound::SoundDelete(ID id)
......@@ -717,7 +717,7 @@ void MainSound::SoundPlay(ID id, int looping)
Sound* snd = ArrSounds[id];
if (looping >= 0)
snd->IsLooping = looping;
snd->IsLooping = looping != 0;
if (snd->DSBuffer)
{
......@@ -1078,27 +1078,27 @@ void MainSound::Update(const float3* viewpos, const float3* viewdir)
Sound* snd;
DWORD status = 0;
for (int i = 0; i < ArrSounds.size(); ++i)
for(UINT i = 0; i < ArrSounds.size(); ++i)
{
snd = ArrSounds[i];
if (snd)
if(snd)
{
status = 0;
snd->DSBuffer->GetStatus(&status);
if (!(status & DSBSTATUS_PLAYING) && snd->State == SOUND_OBJSTATE_PLAY)
if(!(status & DSBSTATUS_PLAYING) && snd->State == SOUND_OBJSTATE_PLAY)
SoundStateSet(i, SOUND_OBJSTATE_STOP);
++tmpSoundsLoadCount;
if (snd->State == SOUND_OBJSTATE_PLAY)
if(snd->State == SOUND_OBJSTATE_PLAY)
++tmpSoundsPlayCount;
if (snd->Is3d && snd->DSBuffer && viewpos && viewdir)
if(snd->Is3d && snd->DSBuffer && viewpos && viewdir)
{
snd->DSBuffer->SetVolume(SOUND_3D_COM_VOLUME(snd->Position, (*viewpos), snd->DistAudible));
snd->DSBuffer->SetPan(SOUND_3D_COM_PAN(snd->Position, (*viewpos), (*viewdir), snd->DistAudible, snd->ShiftPan));
if (snd->DataInstances.size() > 0)
if(snd->DataInstances.size() > 0)
{
for (int k = 0, l = snd->DataInstances.size(); k < l; ++k)
for(int k = 0, l = snd->DataInstances.size(); k < l; ++k)
{
snd->DSBuffer->SetVolume(SOUND_3D_COM_VOLUME(snd->DataInstances[k].pos, (*viewpos), snd->DistAudible));
snd->DSBuffer->SetPan(SOUND_3D_COM_PAN(snd->DataInstances[k].pos, (*viewpos), (*viewdir), snd->DistAudible, snd->ShiftPan));
......@@ -1106,44 +1106,44 @@ void MainSound::Update(const float3* viewpos, const float3* viewdir)
}
}
for (int k = 0, l = snd->DataInstances.size(); k < l; ++k)
for(int k = 0, l = snd->DataInstances.size(); k < l; ++k)
{
status = 0;
if (SUCCEEDED(snd->DataInstances[k].sbuffer->GetStatus(&status)) && !(status & DSBSTATUS_PLAYING))
if(SUCCEEDED(snd->DataInstances[k].sbuffer->GetStatus(&status)) && !(status & DSBSTATUS_PLAYING))
snd->DataInstances[k].busy = false;
}
if (snd->StreamSize && snd->DSBuffer != 0)
if(snd->StreamSize && snd->DSBuffer != 0)
{
DWORD pos;
snd->DSBuffer->GetCurrentPosition(&pos, 0);
if (pos >= snd->Split1Size && pos < snd->Split2Size && !snd->BF2)
if(pos >= snd->Split1Size && pos < snd->Split2Size && !snd->BF2)
{
ReLoadSplit(i, 0, snd->Split1Size);
snd->BF2 = true;
snd->BF1 = false; snd->BF3 = false; snd->BF4 = false;
snd->SplitActive = 2;
}
else if (pos >= snd->Split2Size && pos < snd->Split3Size && !snd->BF3)
else if(pos >= snd->Split2Size && pos < snd->Split3Size && !snd->BF3)
{
snd->BF3 = true;
snd->BF1 = false; snd->BF2 = false; snd->BF4 = false;
ReLoadSplit(i, snd->Split1Size, snd->Split1Size);
snd->SplitActive = 3;
}
else if (pos >= snd->Split3Size && pos < snd->StreamSize && !snd->BF4)
else if(pos >= snd->Split3Size && pos < snd->StreamSize && !snd->BF4)
{
snd->BF4 = true;
snd->BF1 = false; snd->BF2 = false; snd->BF3 = false;
ReLoadSplit(i, snd->Split2Size, snd->Split1Size);
snd->SplitActive = 4;
}
else if (pos < snd->Split1Size && !snd->BF1)
else if(pos < snd->Split1Size && !snd->BF1)
{
snd->BF1 = true;
snd->BF2 = false; snd->BF3 = false; snd->BF4 = false;
if (!snd->IsStarting)
if(!snd->IsStarting)
{
ReLoadSplit(i, snd->Split3Size, snd->Split1Size);
snd->RePlayCount++;
......@@ -1153,18 +1153,18 @@ void MainSound::Update(const float3* viewpos, const float3* viewdir)
}
if (snd->RePlayCount + 1 == snd->RePlayEndCount)
if(snd->RePlayCount + 1 == snd->RePlayEndCount)
{
if (snd->SizeFull <= (snd->StreamSize * snd->RePlayCount + pos))
if(snd->SizeFull <= (snd->StreamSize * snd->RePlayCount + pos))
{
if (!snd->IsLooping)
if(!snd->IsLooping)
SoundStop(i);
//wav
if (snd->Format == SOUND_FILEFORMAT_WAV)
if(snd->Format == SOUND_FILEFORMAT_WAV)
fseek(snd->StreamFile, sizeof(SoundWaveHeader), SEEK_SET);
//ogg
else if (snd->Format == SOUND_FILEFORMAT_OGG)
else if(snd->Format == SOUND_FILEFORMAT_OGG)
ov_pcm_seek(snd->VorbisFile, 0);
ReLoadSplit(i, 0, snd->StreamSize);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment