Commit 21f47f61 authored by Byurrrer's avatar Byurrrer

Переделал свою часть в игровой либе под новые стандарты оформления кода,...

Переделал свою часть в игровой либе под новые стандарты оформления кода, подключил все файлы в ядре, выкинул переменные путей, теперь все либы работают с путями только через регистры, также в инициализаторах либ выкинул все лишние аргументы.
parent 0d3e3f30
......@@ -132,6 +132,7 @@
<ResourceCompile Include="..\..\..\source\SkyXEngine_Build\SkyXEngine.rc" />
</ItemGroup>
<ItemGroup>
<Image Include="..\..\..\source\favicon.ico" />
<Image Include="..\..\..\source\SkyXEngine_preview.bmp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
......
......@@ -75,5 +75,8 @@
<Image Include="..\..\..\source\SkyXEngine_preview.bmp">
<Filter>Resource Files</Filter>
</Image>
<Image Include="..\..\..\source\favicon.ico">
<Filter>Resource Files</Filter>
</Image>
</ItemGroup>
</Project>
\ No newline at end of file
......@@ -12,23 +12,38 @@
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\source\core\concmd.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\..\source\core\cvars.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\..\source\core\file.cpp" />
<ClCompile Include="..\..\..\source\core\loaderconfig.cpp" />
<ClCompile Include="..\..\..\source\core\sxcore.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\..\source\core\sxcore_dll.cpp" />
<ClCompile Include="..\..\..\source\core\Task.cpp" />
<ClCompile Include="..\..\..\source\core\TaskManager.cpp" />
<ClCompile Include="..\..\..\source\core\time.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\..\source\core\concmd.h" />
<ClInclude Include="..\..\..\source\core\concurrent_queue.h" />
<ClInclude Include="..\..\..\source\core\cvars.h" />
<ClInclude Include="..\..\..\source\core\eventbridge.h" />
<ClInclude Include="..\..\..\source\core\eventchannel.h" />
<ClInclude Include="..\..\..\source\core\eventhandler.h" />
<ClInclude Include="..\..\..\source\core\eventhandlerqueue.h" />
<ClInclude Include="..\..\..\source\core\File.h" />
<ClInclude Include="..\..\..\source\core\LoaderConfig.h" />
<ClInclude Include="..\..\..\source\core\sxcore.h" />
<ClInclude Include="..\..\..\source\core\Task.h" />
<ClInclude Include="..\..\..\source\core\TaskManager.h" />
<ClInclude Include="..\..\..\source\core\time.h" />
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{C1C1F046-C839-4602-AF70-923CDD237C1B}</ProjectGuid>
......@@ -80,7 +95,7 @@
</PrecompiledHeader>
<WarningLevel>Level1</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;SXCORE_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;SXCORE_EXPORTS;SX_DLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
......
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<ClCompile Include="..\..\..\source\core\sxcore_dll.cpp" />
<ClCompile Include="..\..\..\source\core\concmd.cpp">
<Filter>Source</Filter>
</ClCompile>
......@@ -11,6 +10,24 @@
<ClCompile Include="..\..\..\source\core\cvars.cpp">
<Filter>Source</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\core\sxcore_dll.cpp">
<Filter>Source</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\core\time.cpp">
<Filter>Source</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\core\file.cpp">
<Filter>Source</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\core\loaderconfig.cpp">
<Filter>Source</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\core\Task.cpp">
<Filter>Source</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\core\TaskManager.cpp">
<Filter>Source</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<Filter Include="Source">
......@@ -30,5 +47,35 @@
<ClInclude Include="..\..\..\source\core\cvars.h">
<Filter>Header</Filter>
</ClInclude>
<ClInclude Include="..\..\..\source\core\LoaderConfig.h">
<Filter>Header</Filter>
</ClInclude>
<ClInclude Include="..\..\..\source\core\Task.h">
<Filter>Header</Filter>
</ClInclude>
<ClInclude Include="..\..\..\source\core\TaskManager.h">
<Filter>Header</Filter>
</ClInclude>
<ClInclude Include="..\..\..\source\core\time.h">
<Filter>Header</Filter>
</ClInclude>
<ClInclude Include="..\..\..\source\core\concurrent_queue.h">
<Filter>Header</Filter>
</ClInclude>
<ClInclude Include="..\..\..\source\core\eventbridge.h">
<Filter>Header</Filter>
</ClInclude>
<ClInclude Include="..\..\..\source\core\eventchannel.h">
<Filter>Header</Filter>
</ClInclude>
<ClInclude Include="..\..\..\source\core\eventhandler.h">
<Filter>Header</Filter>
</ClInclude>
<ClInclude Include="..\..\..\source\core\eventhandlerqueue.h">
<Filter>Header</Filter>
</ClInclude>
<ClInclude Include="..\..\..\source\core\File.h">
<Filter>Header</Filter>
</ClInclude>
</ItemGroup>
</Project>
\ No newline at end of file
......@@ -90,13 +90,13 @@
</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\AmbientSounds.cpp" />
<ClCompile Include="..\..\..\source\game\EntityFactory.cpp" />
<ClCompile Include="..\..\..\source\game\EntityManager.cpp" />
<ClCompile Include="..\..\..\source\game\FuncTrain.cpp" />
<ClCompile Include="..\..\..\source\game\GameData.cpp" />
<ClCompile Include="..\..\..\source\game\LightDirectional.cpp" />
<ClCompile Include="..\..\..\source\game\LightPoint.cpp" />
<ClCompile Include="..\..\..\source\game\NPCBase.cpp" />
<ClCompile Include="..\..\..\source\game\NPCZombie.cpp" />
<ClCompile Include="..\..\..\source\game\PathCorner.cpp" />
......@@ -110,23 +110,21 @@
<ClCompile Include="..\..\..\source\game\SXbaseTool.cpp" />
<ClCompile Include="..\..\..\source\game\SXbaseWeapon.cpp" />
<ClCompile Include="..\..\..\source\game\sxgame_dll.cpp" />
<ClCompile Include="..\..\..\source\game\SXLightDirectional.cpp" />
<ClCompile Include="..\..\..\source\game\SXLightPoint.cpp" />
<ClCompile Include="..\..\..\source\game\SXplayer.cpp" />
<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>
<ClCompile Include="..\..\..\source\game\Weather.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\..\source\common\AAString.h" />
<ClInclude Include="..\..\..\source\game\ambient_sounds.h" />
<ClInclude Include="..\..\..\source\game\AmbientSounds.h" />
<ClInclude Include="..\..\..\source\game\EntityFactory.h" />
<ClInclude Include="..\..\..\source\game\EntityManager.h" />
<ClInclude Include="..\..\..\source\game\FuncTrain.h" />
<ClInclude Include="..\..\..\source\game\GameData.h" />
<ClInclude Include="..\..\..\source\game\LightDirectional.h" />
<ClInclude Include="..\..\..\source\game\LightPoint.h" />
<ClInclude Include="..\..\..\source\game\NPCBase.h" />
<ClInclude Include="..\..\..\source\game\NPCZombie.h" />
<ClInclude Include="..\..\..\source\game\PathCorner.h" />
......@@ -142,13 +140,11 @@
<ClInclude Include="..\..\..\source\game\SXbaseTool.h" />
<ClInclude Include="..\..\..\source\game\SXbaseWeapon.h" />
<ClInclude Include="..\..\..\source\game\sxgame.h" />
<ClInclude Include="..\..\..\source\game\SXLightDirectional.h" />
<ClInclude Include="..\..\..\source\game\SXLightPoint.h" />
<ClInclude Include="..\..\..\source\game\SXplayer.h" />
<ClInclude Include="..\..\..\source\game\SXplayerSpawn.h" />
<ClInclude Include="..\..\..\source\game\SXpointCamera.h" />
<ClInclude Include="..\..\..\source\game\SXpointEntity.h" />
<ClInclude Include="..\..\..\source\game\weather.h" />
<ClInclude Include="..\..\..\source\game\Weather.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
......
......@@ -99,24 +99,24 @@
<ClCompile Include="..\..\..\source\game\SXbaseWeapon.cpp">
<Filter>Source Files\ents\items\tools</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\game\SXLightPoint.cpp">
<ClCompile Include="..\..\..\source\game\NPCBase.cpp">
<Filter>Source Files\ents</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\game\SXLightDirectional.cpp">
<ClCompile Include="..\..\..\source\game\NPCZombie.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>
<ClCompile Include="..\..\..\source\game\NPCBase.cpp">
<ClCompile Include="..\..\..\source\game\LightDirectional.cpp">
<Filter>Source Files\ents</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\game\NPCZombie.cpp">
<ClCompile Include="..\..\..\source\game\LightPoint.cpp">
<Filter>Source Files\ents</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\game\AmbientSounds.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\game\Weather.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\..\source\game\sxgame.h">
......@@ -185,23 +185,23 @@
<ClInclude Include="..\..\..\source\game\SXbaseWeapon.h">
<Filter>Header Files\ents\items\tools</Filter>
</ClInclude>
<ClInclude Include="..\..\..\source\game\SXLightPoint.h">
<ClInclude Include="..\..\..\source\game\NPCBase.h">
<Filter>Header Files\ents</Filter>
</ClInclude>
<ClInclude Include="..\..\..\source\game\SXLightDirectional.h">
<ClInclude Include="..\..\..\source\game\NPCZombie.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>
<ClInclude Include="..\..\..\source\game\NPCBase.h">
<ClInclude Include="..\..\..\source\game\LightDirectional.h">
<Filter>Header Files\ents</Filter>
</ClInclude>
<ClInclude Include="..\..\..\source\game\NPCZombie.h">
<ClInclude Include="..\..\..\source\game\LightPoint.h">
<Filter>Header Files\ents</Filter>
</ClInclude>
<ClInclude Include="..\..\..\source\game\AmbientSounds.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\source\game\Weather.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
</Project>
\ No newline at end of file
......@@ -60,4 +60,24 @@ See the license in LICENSE
#define G_RI_INT_TIME_DELTA 6 /*!< время рендера кадра */
//! @}
/*! @name string register */
//! @{
#define G_RI_STRING_PATH_EXE 0 /*!< путь до исполняемого файла */
#define G_RI_STRING_PATH_WORKTEX 1 /*!< путь до сохранения рабочих текстур */
#define G_RI_STRING_PATH_SCREENSHOTS 2 /*!< путь до скриншотов */
#define G_RI_STRING_PATH_GAMESOURCE 3 /*!< путь до игровых ресурсов */
#define G_RI_STRING_PATH_GS_CONFIGS 4 /*!< путь до конфигураций */
#define G_RI_STRING_PATH_GS_LEVELS 5 /*!< путь до уровней */
#define G_RI_STRING_PATH_GS_MESHES 6 /*!< путь до статический моделей */
#define G_RI_STRING_PATH_GS_MODELS 7 /*!< путь до анимационных моделей */
#define G_RI_STRING_PATH_GS_SHADERS 8 /*!< путь до шейдеров */
#define G_RI_STRING_PATH_GS_SOUNDS 9 /*!< путь до звуков */
#define G_RI_STRING_PATH_GS_SCRIPTS 10 /*!< путь до скриптов */
#define G_RI_STRING_PATH_GS_TEXTURES 11 /*!< путь до текстур */
#define G_RI_STRING_PATH_GS_MTRLS 12 /*!< путь до материалов */
#define G_RI_STRING_PATH_GS_GUI 13 /*!< путь до gui */
//! @}
#endif
......@@ -226,7 +226,6 @@ QT стиль документирования (!) и QT_AUTOBRIEF - корот
#include <windows.h>
#include <ctime>
#include <gdefines.h>
#include <cdata.h>
#include <common\\array.h>
#include <common\\string.cpp>
......@@ -373,6 +372,7 @@ QT стиль документирования (!) и QT_AUTOBRIEF - корот
//! инициализация движка
void SkyXEngine_Init();
void SkyXEngine_InitPaths();
//! рендер
void SkyXEngine_Render(DWORD timeDelta);
......
B// Microsoft Visual C++ generated resource script.
......
......@@ -18,8 +18,8 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLin
SkyXEngine_Init();
SkyXEngine_PreviewKill();
SGCore_SkyBoxLoadTex("sky_2_cube.dds");
SGCore_SkyCloudsLoadTex("sky_oblaka.dds");
SGCore_SkyBoxLoadTex("sky/sky_2_cube.dds");
SGCore_SkyCloudsLoadTex("sky/sky_oblaka.dds");
SGCore_SkyCloudsSetWidthHeightPos(2000, 2000, &float3(0, 0, 0));
Level::Load("stalker_atp");
......@@ -36,6 +36,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLin
bEnt->SetFlags(bEnt->GetFlags() | EF_EXPORT | EF_LEVEL);
char pos[256];
//sprintf(pos, "%f %f %f", randf(-0.1, 0.1), randf(-0.1, 0.1), randf(-0.1, 0.1));
//bEnt->SetKV("origin", "14.90 0.36 25.56");
bEnt->SetKV("origin", "0 0 0");
}
......@@ -53,7 +54,6 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLin
/*ID tmpid = SPE_EffectGetByName("test");
SPE_EffectEnableSet(tmpid, true);*/
SGCore_LoadTexStdPath(GData::Pathes::Textures);
SGCore_LoadTexLoadTextures();
/*ID tmpids = SSCore_SndCreate3d("Exclusion_zone.ogg", false, 0, 100, 0.1);
......
source/SkyXEngine_preview.bmp

129 KB | W: | H:

source/SkyXEngine_preview.bmp

768 KB | W: | H:

source/SkyXEngine_preview.bmp
source/SkyXEngine_preview.bmp
source/SkyXEngine_preview.bmp
source/SkyXEngine_preview.bmp
  • 2-up
  • Swipe
  • Onion skin
......@@ -468,6 +468,23 @@ ID AIGrid::QuadGetStateWho(ID id)
return ArrStateWho[id];
}
bool AIGrid::QuadIs2Neighbors(ID id, ID idn1, ID idn2)
{
AIGRID_QUAD_PRECOND(id, false);
AIGRID_QUAD_PRECOND(idn1, false);
AIGRID_QUAD_PRECOND(idn2, false);
AIQuad* aq = ArrQuads[id];
int concurrence = 0;
for (int i = 0; i < 8; ++i)
{
if (aq->Arr[i] == idn1 || aq->Arr[i] == idn2)
++concurrence;
}
return (concurrence == 2);
}
void AIGrid::QuadSetPosY(ID id, float posy)
{
AIGRID_QUAD_PRECOND(id, _VOID);
......@@ -1996,8 +2013,8 @@ ID AIGrid::QuadGet(const float3* pos, bool isnear_or_permissible) const
{
if (
(isnear_or_permissible && ((heightmin > -1 && heightmin > abs(abs(ArrLongCoordQuads[ArrBound[i]->ArrIdsQuads[k]].y) - abs(tmpy))) || heightmin == -1)) ||
(!isnear_or_permissible && (abs(abs(ArrLongCoordQuads[ArrBound[i]->ArrIdsQuads[k]].y) - abs(tmpy)) < LAIGRID_QUADS_CENTERS_MAXHEIGHT))
(isnear_or_permissible && ((heightmin > -1 && heightmin > abs((ArrLongCoordQuads[ArrBound[i]->ArrIdsQuads[k]].y) - (tmpy))) || heightmin == -1)) ||
(!isnear_or_permissible && (abs((ArrLongCoordQuads[ArrBound[i]->ArrIdsQuads[k]].y) - (tmpy)) <= LAIGRID_QUADS_CENTERS_MAXHEIGHT))
)
{
//int3 l3 = ArrLongCoordQuads[ArrBound[i]->ArrIdsQuads[k]];
......@@ -2733,7 +2750,7 @@ bool AIGrid::GridFindPath(ID beginq, ID endq)
CountInitOpen2 = 0;
NumLastKeyOpenList = 0;
memset(&(ArrColor[0]), 0, ArrColor.size() * sizeof(uint32_t));
//memset(&(ArrColor[0]), 0, ArrColor.size() * sizeof(uint32_t));
memset(&(ArrIDsInOpen[0]), -1, ArrIDsInOpen.size() * sizeof(ID));
memset(&(ArrOpenIDs[0]), -1, ArrOpenIDs.size() * sizeof(ID));
memset(&(ArrParentIDs[0]), -1, ArrParentIDs.size() * sizeof(ID));
......
......@@ -163,6 +163,9 @@ public:
inline AIQUAD_STATE QuadGetState(ID id) const;
inline void QuadSetStateWho(ID id, ID who);
inline ID QuadGetStateWho(ID id);
//проверка квада: является ли квад id соседом и idn1 кваду и idn2 кваду
inline bool QuadIs2Neighbors(ID id, ID idn1, ID idn2);
//установка/возвращение позиции по оси Y для квада
inline void QuadSetPosY(ID id, float posy);
......
......@@ -189,6 +189,13 @@ ID SAIG_QuadGetStateWho(ID id)
return ObjAIGrid->QuadGetStateWho(id);
}
bool SAIG_QuadIs2Neighbors(ID id, ID idn1, ID idn2)
{
AIG_PRECOND(false);
return ObjAIGrid->QuadIs2Neighbors(id, idn1, idn2);
}
ID SAIG_QuadGet(const float3* pos, bool isnear_or_permissible)
{
AIG_PRECOND(-1);
......
......@@ -153,8 +153,9 @@ SX_LIB_API void SAIG_GridSetNullColor(); //!< обнуление увета
SX_LIB_API void SAIG_QuadSetState(ID id, AIQUAD_STATE state); //!< устанавливает состояние для квада
SX_LIB_API AIQUAD_STATE SAIG_QuadGetState(ID id); //!< возвращает текущее состояние квада
SX_LIB_API void SAIG_QuadSetStateWho(ID id, ID who);
SX_LIB_API ID SAIG_QuadGetStateWho(ID id);
SX_LIB_API void SAIG_QuadSetStateWho(ID id, ID who); //!< устанавливает id объекта который занял квад
SX_LIB_API ID SAIG_QuadGetStateWho(ID id); //!< возвращает id объекта который занял квад
SX_LIB_API bool SAIG_QuadIs2Neighbors(ID id, ID idn1, ID idn2); //!< проверка квада: является ли квад id соседом и idn1 кваду и idn2 кваду
SX_LIB_API ID SAIG_QuadGet(const float3* pos, bool isnear_or_permissible); //!< получить id квада по позиции, isnear_or_permissible - самый ближний квад (true), или самый ближний в пределах допустимой разницы начальной точки (false)?
SX_LIB_API bool SAIG_QuadGetPos(ID id, float3* pos);
......
/******************************************************
Copyright Vitaliy Buturlin, Evgeny Danilovich, 2017
See the license in LICENSE
******************************************************/
/*!
\file
( ) .
*/
#ifndef __cdata_h
#define __cdata_h
#include <common/sxtypes.h>
/*! \name
@{
*/
static ID G_Timer_Render_Scene = -1; //!<
static ID G_Timer_Game = -1; //!<
//!@}
#endif
\ No newline at end of file
......@@ -2,6 +2,7 @@
#ifndef SXFILE_H
#define SXFILE_H
#include "sxcore.h"
#include <fstream>
class SXFile : public ISXFile
......
#ifndef LOADER_CONFIG_H
#define LOADER_CONFIG_H
#pragma once
#include "sxcore.h"
#include <gdefines.h>
#include <common/String.h>
#include <common/Array.h>
#include <common/AssotiativeArray.h>
class ConfigString : public String
{
......
#ifndef _SXTask_H_
#define _SXTask_H_
#include "sxcore.h"
#include <memory>
#define _NTASKMANAGER
......
......@@ -453,9 +453,6 @@ void ConsoleRecv(void*)
}
bool CommandConnect();
void CommandDisconnect();
int hOut;
FILE * fOut = NULL;
......
......@@ -29,6 +29,10 @@ struct ConCmd
char * szDesc;
};
bool ConsoleConnect();
void ConsoleDisconnect();
void ConsoleRegisterCmds();
bool CommandConnect();
void CommandDisconnect();
#endif
#include "cvars.h"
AssotiativeArray<String, CVar> g_mCVars;
......
......@@ -4,6 +4,7 @@
#include "sxcore.h"
#include <common/AssotiativeArray.h>
#include <common/String.h>
//!
enum CVAR_TYPE
......
......@@ -4,24 +4,21 @@ Copyright © Vitaliy Buturlin, Evgeny Danilovich, 2017
See the license in LICENSE
******************************************************/
#pragma once
#define CORE_VERSION 1
#include <core/sxcore.h>
#include <common/Array.h>
#include <core/loaderconfig.cpp>
#include <core/loaderconfig.h>
#include <core/file.cpp>
#include <core/file.h>
#include <core/Task.cpp>
#include <core/TaskManager.cpp>
#include <core/Task.h>
#include <core/TaskManager.h>
#include <core/concmd.cpp>
#include <core/cvars.cpp>
#include <core/concmd.h>
#include <core/cvars.h>
#include <core/time.cpp>
#include <core/time.h>
char CoreName[CORE_NAME_MAX_LEN];
......@@ -39,6 +36,7 @@ int32_t GRegistersInt[CORE_REGISTRY_SIZE];
float32_t GRegistersFloat[CORE_REGISTRY_SIZE];
float4x4 GRegistersMatrix[CORE_REGISTRY_SIZE];
float3 GRegistersFloat3[CORE_REGISTRY_SIZE];
String GRegistersString[CORE_REGISTRY_SIZE];
#define CORE_REGUSTRY_PRE_COND_ID(id,stdval) \
if (!(id >= 0 && id < CORE_REGISTRY_SIZE))\
......@@ -272,6 +270,19 @@ void Core_RFloat3Get(int id, float3* val)
memcpy(val, &GRegistersFloat3[id], sizeof(float3));
}
void Core_RStringSet(int id, const char *val)
{
CORE_REGUSTRY_PRE_COND_ID(id, _VOID);
if (val)
GRegistersString[id] = val;
}
const char* Core_RStringGet(int id)
{
CORE_REGUSTRY_PRE_COND_ID(id, 0);
return GRegistersString[id].c_str();
}
////
......
......@@ -98,6 +98,9 @@ SX_LIB_API void Core_RMatrixGet(int id, float4x4* val); //!< получение
SX_LIB_API void Core_RFloat3Set(int id, float3* val); //!< установка значения в регистр float3 типа
SX_LIB_API void Core_RFloat3Get(int id, float3* val); //!< получение значения из регистра float3 типа
SX_LIB_API void Core_RStringSet(int id, const char *val); //!< установка значения в регистр string типа
SX_LIB_API const char* Core_RStringGet(int id); //!< получение значения из регистра string типа
//! @}
/*! \name Таймеры
......
......@@ -4,13 +4,8 @@ Copyright
See the license in LICENSE
******************************************************/
#define SX_DLL
#pragma once
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <gdefines.h>
#include <core\\sxcore.cpp>
BOOL APIENTRY DllMain(HMODULE hModule,
DWORD ul_reason_for_call,
......
......@@ -2,8 +2,12 @@
#ifndef __time_h
#define __time_h
#include <chrono>
#include <gdefines.h>
extern report_func reportf;
#include <common/Array.h>
#include <chrono>
typedef std::chrono::system_clock::time_point time_point;
#define TIMEMANAGER_PRECOND_ID(id,stdval) \
......@@ -35,18 +39,18 @@ public:
ID TimeAdd();
inline void TimeSpeedSet(ID id, float speed);
inline float TimeSpeedGet(ID id);
void TimeSpeedSet(ID id, float speed);
float TimeSpeedGet(ID id);
inline void TimeWorkingSet(ID id, bool working);
inline bool TimeWorkingGet(ID id);
void TimeWorkingSet(ID id, bool working);
bool TimeWorkingGet(ID id);
inline void TimeUnixStartSet(ID id, int64_t start_time);
inline int64_t TimeUnixStartGet(ID id);
inline int64_t TimeUnixCurrGet(ID id);
void TimeUnixStartSet(ID id, int64_t start_time);
int64_t TimeUnixStartGet(ID id);
int64_t TimeUnixCurrGet(ID id);
inline int64_t TimeTotalMcsGet(ID id);
inline int64_t TimeTotalMcsGetU(ID id);
int64_t TimeTotalMcsGet(ID id);
int64_t TimeTotalMcsGetU(ID id);
protected:
Array<Time*> ArrTimes;
......
#include <game/AmbientSounds.h>
CAmbientSounds::CAmbientSounds()
{
m_isPlaying = false;
m_iPlayingLast = 0;
}
CAmbientSounds::~CAmbientSounds()
{
clear();
}
void CAmbientSounds::add(const char *szPath)
{
ID id = SSCore_SndCreate2d(szPath);
if (id >= 0)
m_aIDSnds.push_back(id);
}
void CAmbientSounds::get(ID id, char *szPath)
{
if (id >= 0 && id < m_aIDSnds.size())
{
SSCore_SndFileGet(m_aIDSnds[id], szPath);
}
}
UINT CAmbientSounds::getCount()
{
return m_aIDSnds.size();
}
void CAmbientSounds::clear()
{
for (int i = 0; i < m_aIDSnds.size(); ++i)
{
SSCore_SndDelete(m_aIDSnds[i]);
}
m_aIDSnds.clear();
}
void CAmbientSounds::play()
{
if (m_iPlayingLast >= 0 && m_iPlayingLast < m_aIDSnds.size())
{
SSCore_SndVolumeSet(m_aIDSnds[m_iPlayingLast], 100);
SSCore_SndPlay(m_aIDSnds[m_iPlayingLast]);
m_isPlaying = true;
}
}