Commit 80f2a309 authored by Byurrrer's avatar Byurrrer

Переделал освещение, также немного поправил шейдеры освщеения, добавил к...

Переделал освещение, также немного поправил шейдеры освщеения, добавил к партиклам возможность изменнеия цвета, также партиклы теперь могут оставлять след (если есть физичность), в игровую либу добавил фоновые эмбиент звуки, погоду, и много чего по мелочам
parent d0e31166
/*
lighting_blend.ps
Cмешивание всех текстур длz финального изображени¤
Cмешивание всех текстур для финального изображения
*/
#include <../struct.h>
......@@ -10,7 +10,7 @@ sampler2D ColorSampler:register(s0);
sampler2D AmbientSampler:register(s1);
sampler2D SpecDiffSampler:register(s2);
sampler2D NormalSampler:register(s3);
//sampler2D AdaptedLumSampler:register(s4);
sampler2D AdaptedLumSampler:register(s4);
sampler2D ParamSampler:register(s5);
half4 main(vs_out_pp IN):COLOR0
......@@ -22,16 +22,16 @@ half4 main(vs_out_pp IN):COLOR0
half4 ambient = tex2D(AmbientSampler,IN.TexUV);
//return float4(ambient.w,ambient.w,ambient.w,1);;
half spec = tex2D(SpecDiffSampler,IN.TexUV).r;
//half fAdaptedLum = tex2D(AdaptedLumSampler, half2(0.5f, 0.5f));
half fAdaptedLum = tex2D(AdaptedLumSampler, half2(0.5f, 0.5f));
if(isunlit != SURFACE_NOTLIGHTING_NOTTRANSPARENCY && isunlit != SURFACE_NOTLIGHTING_TRANSPARENCY)
color.xyz = ((sqrt(ambient.xyz * ambient.w)*color.xyz)) + sqrt(spec*ambient.xyz);
color.xyz = (((ambient.xyz * sqrt(ambient.w))*color.xyz)) + spec*(ambient.xyz);
if(int(layer * 255.f) == 1)
color.a = 1.f;
/*color.rgb *= TONE_MAPPING_DENOMENATOR/(fAdaptedLum + TONE_MAPPING_ADAPT_ADD_BIAS);
color.rgb /= (fAdaptedLum + color.rgb);*/
color.rgb *= TONE_MAPPING_DENOMENATOR/(fAdaptedLum + TONE_MAPPING_ADAPT_ADD_BIAS);
color.rgb /= (fAdaptedLum + color.rgb);
return color;
}
\ No newline at end of file
......@@ -22,6 +22,7 @@ sampler2D ParamSampler:register(s2);
sampler2D DepthSampler:register(s3);
sampler2D ShadowSampler:register(s4);
sampler2D AdaptedLumSampler:register(s5);
//#############################################################################
......@@ -71,7 +72,7 @@ ps_out_com_lighting main(vs_out_res_pos IN)
}
half depth = GetDepthLinearR(tex2D(DepthSampler,IN.TexUV).r,NearFar);
half fAdaptedLum = tex2D(AdaptedLumSampler, half2(0.5f, 0.5f));
#ifdef IS_SHADOWED
half shadow = tex2D(ShadowSampler,IN.TexUV).r;
half originshadow = shadow;
......@@ -120,13 +121,16 @@ ps_out_com_lighting main(vs_out_res_pos IN)
if(Param.z < 1.f)
diffuse *= max(originshadow,0.2);
else
diffuse *= max(shadow,0.2);
{
diffuse *= max(shadow,lerp(0.01,0.2,LightColor.w));
}
#endif
half lighting = saturate(max((Param.y) * 0.5f, 0.1f));
OUT.Amdient.xyz = lerp(1,LightColor.xyz*0.3,(1-lighting)) * LightPowerDist.x * attenuation;
//LightColor.xyz *= max(diffuse,0.2);
OUT.Amdient.xyz = lerp(LightPowerDist.x,LightColor.xyz,0.5f) * max(diffuse,0.5) * LightPowerDist.x * attenuation;
OUT.Amdient.w = diffuse * LightPowerDist.x * attenuation;
OUT.Spec = (specular*absdiffuse * saturate(attenuation * 2) * LightPowerDist.x);
return OUT;
......
......@@ -14,8 +14,8 @@ half4 main(vs_out_pp IN):COLOR0
half4 color = tex2D(ColorSampler,IN.TexUV);
half fAdaptedLum = tex2D(AdaptedLumSampler, TexUV_Center);
color.rgb *= TONE_MAPPING_DENOMENATOR/(fAdaptedLum + TONE_MAPPING_ADAPT_ADD_BIAS);
color.rgb /= (fAdaptedLum + color.rgb);
//color.rgb *= TONE_MAPPING_DENOMENATOR/(fAdaptedLum + TONE_MAPPING_ADAPT_ADD_BIAS);
//color.rgb /= (fAdaptedLum + color.rgb);
return color;
}
\ No newline at end of file
......@@ -13,11 +13,13 @@ sampler2D SceneSampler:register(s2);
half RefractCoef;
half SoftCoef;
half ColorCoef;
half4 Color;
half2 NearFar;
half4 main(vs_out_particles IN):COLOR0
{
half4 color = tex2D(BaseSampler,IN.TexUV);
color.rgb = lerp(color.rgb, Color.rgb, Color.a);
color.rgb *= ColorCoef;
color.a *= IN.Alpha.x;
#if defined(PART_SOFT) || defined(PART_REFRACTION)
......
/*
particles_main.ps
Рендер партиклов
*/
#include <../struct.h>
sampler2D BaseSampler:register(s0);
half ColorCoef;
half4 Color;
half4 main(vs_out_particles IN):COLOR0
{
half4 color = tex2D(BaseSampler,IN.TexUV);
color.rgb = lerp(color.rgb, Color.rgb, Color.a);
color.rgb *= ColorCoef;
color.a *= IN.Alpha.x;
return color;
}
\ No newline at end of file
/*
particles_main.vs
Рендер партиклов
*/
#include <../struct.h>
half4x4 WorldViewProjection;
half3 RotateVec(half4 q, half3 p)
{
half xxzz = q.x*q.x - q.z*q.z;
half wwyy = q.w*q.w - q.y*q.y;
half xw2 = q.x*q.w*2.0;
half xy2 = q.x*q.y*2.0;
half xz2 = q.x*q.z*2.0;
half yw2 = q.y*q.w*2.0;
half yz2 = q.y*q.z*2.0;
half zw2 = q.z*q.w*2.0;
half3 oout = half3((xxzz + wwyy)*p.x + (xy2 + zw2)*p.y + (xz2 - yw2)*p.z,
(xy2 - zw2)*p.x + (q.y*q.y+q.w*q.w-q.x*q.x-q.z*q.z)*p.y + (yz2 + xw2)*p.z,
(xz2 + yw2)*p.x + (yz2 - xw2)*p.y + (wwyy - xxzz)*p.z);
return(oout);
}
void main(in vs_in_particles IN, out vs_out_particles OUT)
{
half2 tvec;
IN.Position.xyz *= IN.InstanceSize;
IN.Position.xyz = RotateVec(IN.InstanceTex,IN.Position.xyz);
OUT.Position.xyz = IN.Position + IN.InstancePos;
OUT.Position.w = 1.f;
OUT.Position = mul(OUT.Position, WorldViewProjection);
OUT.Pos = OUT.Position;
OUT.TexUV = IN.TexUV;
OUT.Alpha = IN.InstanceAlpha;
}
\ No newline at end of file
......@@ -45,6 +45,9 @@ r_s_filter 2
r_s_max_anisotropy 16
r_s_max_miplevel 0
main_rain_density 1
main_thunderbolt true
spawn
//cl_grab_cursor 0
......@@ -90,6 +90,9 @@
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\..\source\common\string.cpp" />
<ClCompile Include="..\..\..\source\game\ambient_sounds.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\..\source\game\EntityFactory.cpp" />
<ClCompile Include="..\..\..\source\game\EntityManager.cpp" />
<ClCompile Include="..\..\..\source\game\FuncTrain.cpp" />
......@@ -111,9 +114,13 @@
<ClCompile Include="..\..\..\source\game\SXplayerSpawn.cpp" />
<ClCompile Include="..\..\..\source\game\SXpointCamera.cpp" />
<ClCompile Include="..\..\..\source\game\SXpointEntity.cpp" />
<ClCompile Include="..\..\..\source\game\weather.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\..\source\common\AAString.h" />
<ClInclude Include="..\..\..\source\game\ambient_sounds.h" />
<ClInclude Include="..\..\..\source\game\EntityFactory.h" />
<ClInclude Include="..\..\..\source\game\EntityManager.h" />
<ClInclude Include="..\..\..\source\game\FuncTrain.h" />
......@@ -137,6 +144,7 @@
<ClInclude Include="..\..\..\source\game\SXplayerSpawn.h" />
<ClInclude Include="..\..\..\source\game\SXpointCamera.h" />
<ClInclude Include="..\..\..\source\game\SXpointEntity.h" />
<ClInclude Include="..\..\..\source\game\weather.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
......
......@@ -105,6 +105,12 @@
<ClCompile Include="..\..\..\source\game\SXLightDirectional.cpp">
<Filter>Source Files\ents</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\game\weather.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\game\ambient_sounds.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\..\source\game\sxgame.h">
......@@ -179,5 +185,11 @@
<ClInclude Include="..\..\..\source\game\SXLightDirectional.h">
<Filter>Header Files\ents</Filter>
</ClInclude>
<ClInclude Include="..\..\..\source\game\weather.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\source\game\ambient_sounds.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
</Project>
\ No newline at end of file
......@@ -336,6 +336,7 @@ QT стиль документирования (!) и QT_AUTOBRIEF - корот
//#############################################################################
#include <managed_render\\handler_out_log.cpp>
#include <managed_render\\gdata.h>
#include <common\\string_api.cpp>
#include <managed_render\\camera_update.h>
......@@ -360,8 +361,7 @@ QT стиль документирования (!) и QT_AUTOBRIEF - корот
#include <sxparticleseditor/resource.h>
#include <sxparticleseditor\\particles_editor.cpp>
#endif
#include <managed_render\\handler_out_log.cpp>
#include <managed_render\\render_func.h>
#include <managed_render\\gdata.cpp>
#include <managed_render\\camera_update.cpp>
......
......@@ -19,6 +19,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLin
SkyXEngine_PreviewCreate();
SkyXEngine_Init();
SkyXEngine_PreviewKill();
SGCore_SkyBoxLoadTex("sky_2_cube.dds");
SGCore_SkyCloudsLoadTex("sky_oblaka.dds");
SGCore_SkyCloudsSetWidthHeightPos(2000, 2000, &float3(0, 0, 0));
......
......@@ -33,7 +33,6 @@ GameData::GameData()
Core_0RegisterConcmd("spawn", ccmd_spawn);
Core_0RegisterConcmd("observe", ccmd_observe);
Core_0RegisterCVarFloat("cl_mousesense", 0.001f, "Mouse sense value");
Core_0RegisterCVarFloat("r_default_fov", 45.0f, "Default FOV value");
Core_0RegisterCVarBool("cl_mode_editor", false, "Editor control mode");
Core_0RegisterCVarBool("cl_grab_cursor", true, "Grab cursor on move");
......
......@@ -5,7 +5,6 @@
BEGIN_PROPTABLE(SXLightDirectional)
DEFINE_FIELD_VECTOR(m_color, 0, "color", "Color", EDITOR_TEXTFIELD)
DEFINE_FIELD_FLOAT(m_power, 0, "power", "Power", EDITOR_TEXTFIELD)
DEFINE_FIELD_FLOAT(m_dist, 0, "dist", "Distance", EDITOR_TEXTFIELD)
DEFINE_FIELD_FLOAT(m_light_far, 0, "light_far", "Light far", EDITOR_TEXTFIELD)
......@@ -27,13 +26,12 @@ BaseClass(pMgr)
{
m_color = float3(1, 1, 1);
m_vPosition = float3_t(0, 0, 0);
m_power = 10;
m_dist = 10;
m_light_far = m_dist;
m_typeshadow = 1;
m_angle = SM_PI * 0.4f;
m_topradius = 0.01f;
IDLight = SML_LigthsCreateDirection(&float3(0, 0, 0), m_power, m_dist, &m_color, &float3(0, -1, 0), m_topradius, m_angle, true);
IDLight = SML_LigthsCreateDirection(&float3(0, 0, 0), m_dist, &m_color, &float3(0, -1, 0), m_topradius, m_angle, true);
float3 f = LIGHTS_DIR_BASE;
float3 a = SMVector3Cross(f, f);
......@@ -57,7 +55,6 @@ void SXLightDirectional::OnSync()
SML_LigthsSetPos(IDLight, &(float3)m_vPosition, false);
SML_LigthsSetColor(IDLight, &m_color);
SML_LigthsSetPower(IDLight, m_power);
if (SML_LigthsGetDist(IDLight) != m_dist)
{
......
......@@ -16,7 +16,6 @@ protected:
ID IDLight;
float3 m_color;
float m_power;
float m_dist;
float m_light_far;
int m_typeshadow;
......
......@@ -5,7 +5,6 @@
BEGIN_PROPTABLE(SXLightPoint)
DEFINE_FIELD_VECTOR(m_color, 0, "color", "Color", EDITOR_TEXTFIELD)
DEFINE_FIELD_FLOAT(m_power, 0, "power", "Power", EDITOR_TEXTFIELD)
DEFINE_FIELD_FLOAT(m_dist, 0, "dist", "Distance", EDITOR_TEXTFIELD)
DEFINE_FIELD_FLOAT(m_light_far, 0, "light_far", "Light far", EDITOR_TEXTFIELD)
......@@ -24,11 +23,10 @@ BaseClass(pMgr)
{
m_color = float3(1, 1, 1);
m_vPosition = float3_t(0, 0, 0);
m_power = 10;
m_dist = 10;
m_light_far = m_dist;
m_typeshadow = 1;
IDLight = SML_LigthsCreatePoint(&float3(0, 0, 0), m_power, m_dist, &m_color, false, true);
IDLight = SML_LigthsCreatePoint(&float3(0, 0, 0), m_dist, &m_color, false, true);
}
SXLightPoint::~SXLightPoint()
......@@ -47,7 +45,6 @@ void SXLightPoint::OnSync()
SML_LigthsSetPos(IDLight, &(float3)m_vPosition, false);
SML_LigthsSetColor(IDLight, &m_color);
SML_LigthsSetPower(IDLight, m_power);
if (SML_LigthsGetDist(IDLight) != m_dist)
{
......
......@@ -16,7 +16,6 @@ protected:
ID IDLight;
float3 m_color;
float m_power;
float m_dist;
float m_light_far;
int m_typeshadow;
......
#include <managed_render/level_ambient_sounds.h>
#include <game/ambient_sounds.h>
LevelAmbientSounds::LevelAmbientSounds()
AmbientSounds::AmbientSounds()
{
playing = false;
PlayingLast = 0;
}
LevelAmbientSounds::~LevelAmbientSounds()
AmbientSounds::~AmbientSounds()
{
Clear();
}
void LevelAmbientSounds::Add(const char* path)
void AmbientSounds::Add(const char* path)
{
ID id = SSCore_SndCreate2d(path);
if (id >= 0)
ArrIDsSnds.push_back(id);
}
void LevelAmbientSounds::Get(ID id, char* path)
void AmbientSounds::Get(ID id, char* path)
{
if (id >= 0 && id < ArrIDsSnds.size())
{
......@@ -27,12 +27,12 @@ void LevelAmbientSounds::Get(ID id, char* path)
}
}
UINT LevelAmbientSounds::GetCount()
UINT AmbientSounds::GetCount()
{
return ArrIDsSnds.size();
}
void LevelAmbientSounds::Clear()
void AmbientSounds::Clear()
{
for (int i = 0; i < ArrIDsSnds.size(); ++i)
{
......@@ -42,7 +42,7 @@ void LevelAmbientSounds::Clear()
ArrIDsSnds.clear();
}
void LevelAmbientSounds::Play()
void AmbientSounds::Play()
{
if (PlayingLast >= 0 && PlayingLast < ArrIDsSnds.size())
{
......@@ -52,11 +52,14 @@ void LevelAmbientSounds::Play()
}
}
void LevelAmbientSounds::Update()
void AmbientSounds::Update()
{
if (!playing)
return;
static const float * ambient_snd_volume = GET_PCVAR_FLOAT("ambient_snd_volume");
static float ambient_snd_volume_old = 1.f;
if (SSCore_SndStateGet(ArrIDsSnds[PlayingLast]) != SoundObjState::sos_play)
{
if (PlayingLast + 1 < ArrIDsSnds.size())
......@@ -64,12 +67,19 @@ void LevelAmbientSounds::Update()
else
PlayingLast = 0;
SSCore_SndVolumeSet(ArrIDsSnds[PlayingLast], 100);
SSCore_SndVolumeSet(ArrIDsSnds[PlayingLast], ambient_snd_volume_old*100.f);
SSCore_SndPlay(ArrIDsSnds[PlayingLast]);
}
if (ambient_snd_volume && ambient_snd_volume_old != (*ambient_snd_volume))
{
ambient_snd_volume_old = *ambient_snd_volume;
if (PlayingLast >= 0)
SSCore_SndVolumeSet(ArrIDsSnds[PlayingLast], ambient_snd_volume_old*100.f);
}
}
void LevelAmbientSounds::Pause()
void AmbientSounds::Pause()
{
if (!playing)
return;
......@@ -79,7 +89,7 @@ void LevelAmbientSounds::Pause()
playing = false;
}
bool LevelAmbientSounds::IsPlaying()
bool AmbientSounds::IsPlaying()
{
return playing;
}
\ No newline at end of file
#ifndef __level_ambient_sounds_h
#define __level_ambient_sounds_h
#ifndef __ambient_sounds_h
#define __ambient_sounds_h
class LevelAmbientSounds
class AmbientSounds
{
public:
LevelAmbientSounds();
~LevelAmbientSounds();
AmbientSounds();
~AmbientSounds();
void Add(const char* path);
void Get(ID id, char* path);
......
......@@ -102,7 +102,115 @@ SX_LIB_API int SXGame_EntGetCount();
*/
SX_LIB_API SXbaseEntity * SXGame_EntGet(ID id);
//#############################################################################
/*! defgroup sxgame_ambient_snd
\ingroup sxgame
\note
\note
@{
*/
//!
SX_LIB_API void SGame_AmbientSndAdd(const char* path);
//!
SX_LIB_API UINT SGame_AmbientSndGetCount();
//! path id
SX_LIB_API void SGame_AmbientSndGet(ID id, char* path);
//!
SX_LIB_API void SGame_AmbientSndClear();
//!
SX_LIB_API void SGame_AmbientSndPlay();
//!
SX_LIB_API void SGame_AmbientSndUpdate();
//!
SX_LIB_API void SGame_AmbientSndPause();
//! " "
SX_LIB_API bool SGame_AmbientSndIsPlaying();
//!@} sxgame_ambient_snd
//#############################################################################
/*! defgroup sxgame_weather
\ingroup sxgame
\note
\note , #SGame_WeatherUpdate ( )
- :
- (sections) , 01:11:12 1 11 12
- ( )
- , \n
:
- sky_texture -
- sky_rotation - ( )
- sky_color - float4 [0-1] ,
- clouds_texture -
- clouds_color - float4 [0-1] ,
- clouds_rotate - ( )
- clouds_transparency - [0-1]
- clouds_speed -
- sun_texture - , 0
- sun_color - float3 [0-1]
- sun_pos - X Z
- far -
- rain_density [0-1]
- rain_color - float4 [0-1] ,
- thunderbolt -
- thunder_period -
- fog_color - float3 [0-1]
- fog_density -
- env_ambient - \n
, env_ambient \n
\n
:
- period - ( ) UINT2 ( ),
- volume - ( ) UINT2 ( ),
- sounds -
@{
*/
#define WEATHER_RAIN_VOL_SND_UPDATE 1000 /*!< () */
#define WEATHER_RAIN_VOL_SND_DIST 20.f /*!< , */
#define WEATHER_RAIN_MIN_Y_OBSERVER 5.f /*!< */
#define WEATHER_RAIN_RECREATE_COUNT 500 /*!< ( ) */
#define WEATHER_THUNDERBOLT_LIGHT_TIME 500 /*!< ()*/
#define WEATHER_THUNDERBOLT_WIDTH 100.f /*!< */
#define WEATHER_THUNDERBOLT_LENGTH 10.f /*!< */
#define WEATHER_THUNDERBOLT_HEIGHT 100.f /*!< */
//!
SX_LIB_API void SGame_WeatherLoad(const char* path);
//!
SX_LIB_API void SGame_WeatherUpdate();
//!
SX_LIB_API float SGame_WeatherGetCurrRainDensity();
//!
SX_LIB_API void SGame_WeatherSndPlay();
//!
SX_LIB_API void SGame_WeatherSndPause();
//! " "
SX_LIB_API bool SGame_WeatherSndIsPlaying();
//!@} sxgame_weather
#endif
/*! @} */
/*! @} sxgame*/
......@@ -8,10 +8,12 @@ See the license in LICENSE
#include <windows.h>
#include "sxgame.h"
#include <cdata.h>
#include <core/sxcore.h>
#include <gcore/sxgcore.h>
#include <particles/sxparticles.h>
#include <score/sxscore.h>
#include <pp/sxpp.h>
#include "EntityManager.h"
......@@ -29,6 +31,7 @@ See the license in LICENSE
# pragma comment(lib, "sxanim_d.lib")
# pragma comment(lib, "sxparticles_d.lib")
# pragma comment(lib, "sxscore_d.lib")
# pragma comment(lib, "sxpp_d.lib")
#else
# pragma comment(lib, "sxcore.lib")
# pragma comment(lib, "sxgcore.lib")
......@@ -38,6 +41,7 @@ See the license in LICENSE
# pragma comment(lib, "sxanim.lib")
# pragma comment(lib, "sxparticles.lib")
# pragma comment(lib, "sxscore.lib")
# pragma comment(lib, "sxpp.lib")
#endif
#if !defined(DEF_STD_REPORT)
......@@ -45,10 +49,17 @@ See the license in LICENSE
report_func reportf = def_report;
#endif
#include "weather.cpp"
#include "ambient_sounds.cpp"
GameData * g_pGameData = NULL;
ID3DXMesh* FigureBox = 0;
Weather* ObjWeather = 0;
AmbientSounds* ObjAmbientSounds = 0;
#define SG_PRECOND(ret) if(!g_pGameData){reportf(-1, "%s - sxgame is not init", gen_msg_location);return ret;}
#define SG_PRECOND_WEATHER(ret) if(!ObjWeather){reportf(-1, "%s - sxgame weather is not init", gen_msg_location);return ret;}
#define SG_PRECOND_AMBIENTSND(ret) if(!ObjAmbientSounds){reportf(-1, "%s - sxgame ambient sounds is not init", gen_msg_location);return ret;}
BOOL APIENTRY DllMain(HMODULE hModule,
DWORD ul_reason_for_call,
......@@ -109,6 +120,11 @@ SX_LIB_API void SXGame_0Create()
Core_SetOutPtr();
g_pGameData = new GameData();
ObjWeather = new Weather();
ObjAmbientSounds = new AmbientSounds();
G_Timer_Render_Scene = Core_RIntGet(G_RI_INT_TIMER_RENDER);
G_Timer_Game = Core_RIntGet(G_RI_INT_TIMER_GAME);
//g_pPlayer->Spawn();
D3DXCreateBox(SGCore_GetDXDevice(), 1, 1, 1, &FigureBox, 0);
......@@ -335,3 +351,93 @@ SX_LIB_API SXbaseEntity * SXGame_EntGet(ID id)
SG_PRECOND(NULL);
return(GameData::m_pMgr->GetById(id));
}
//#############################################################################
SX_LIB_API void SGame_AmbientSndAdd(const char* path)
{
SG_PRECOND_AMBIENTSND(_VOID);
ObjAmbientSounds->Add(path);
}
SX_LIB_API void SGame_AmbientSndGet(ID id, char* path)
{
SG_PRECOND_AMBIENTSND(_VOID);
ObjAmbientSounds->Get(id, path);
}
SX_LIB_API UINT SGame_AmbientSndGetCount()
{
SG_PRECOND_AMBIENTSND(0);
return ObjAmbientSounds->GetCount();
}
SX_LIB_API void SGame_AmbientSndClear()
{
SG_PRECOND_AMBIENTSND(_VOID);
ObjAmbientSounds->Clear();
}
SX_LIB_API void SGame_AmbientSndPlay()
{
SG_PRECOND_AMBIENTSND(_VOID);
ObjAmbientSounds->Play();
}
SX_LIB_API void SGame_AmbientSndUpdate()
{
SG_PRECOND_AMBIENTSND(_VOID);
ObjAmbientSounds->Update();
}
SX_LIB_API void SGame_AmbientSndPause()
{
SG_PRECOND_AMBIENTSND(_VOID);
ObjAmbientSounds->Pause();
}
SX_LIB_API bool SGame_AmbientSndIsPlaying()
{
SG_PRECOND_AMBIENTSND(false);
return ObjAmbientSounds->IsPlaying();
}
//#############################################################################
SX_LIB_API void SGame_WeatherLoad(const char* path)
{
SG_PRECOND_WEATHER(_VOID);
ObjWeather->Load(path);
}
SX_LIB_API void SGame_WeatherUpdate()
{
SG_PRECOND_WEATHER(_VOID);
ObjWeather->Update();
}
SX_LIB_API float SGame_WeatherGetCurrRainDensity()
{
SG_PRECOND_WEATHER(0.f);
return ObjWeather->GetCurrRainDensity();
}
SX_LIB_API void SGame_WeatherSndPlay()
{
SG_PRECOND_WEATHER(_VOID);
ObjWeather->SndPlay();
}
SX_LIB_API void SGame_WeatherSndPause()
{
SG_PRECOND_WEATHER(_VOID);
ObjWeather->SndPause();
}
SX_LIB_API bool SGame_WeatherSndIsPlaying()