Browse Source

增加RCC支持

master
hejl 2 months ago
parent
commit
6f117ee7c5
  1. 6
      uft_dev_server/CMakeLists.txt
  2. 4
      uft_dev_server/cmd.txt
  3. 8
      uft_dev_server/rccpp_config.h
  4. 3
      uft_dev_server/src/controllers/ApiController.cpp
  5. 2
      uft_dev_server/src/controllers/HelloWorldController.cpp
  6. 10
      uft_dev_server/src/controllers/HelloWorldController.h
  7. 31
      uft_dev_server/src/main.cpp
  8. BIN
      uft_dev_server/third_party/RCCPP/Assets/GUI/Anonymous.ttf
  9. BIN
      uft_dev_server/third_party/RCCPP/Assets/GUI/Delicious-Bold.otf
  10. BIN
      uft_dev_server/third_party/RCCPP/Assets/GUI/Delicious-BoldItalic.otf
  11. BIN
      uft_dev_server/third_party/RCCPP/Assets/GUI/Delicious-Italic.otf
  12. BIN
      uft_dev_server/third_party/RCCPP/Assets/GUI/Delicious-Roman.otf
  13. 32
      uft_dev_server/third_party/RCCPP/Assets/GUI/compiling-notification.rcss
  14. 10
      uft_dev_server/third_party/RCCPP/Assets/GUI/compiling-notification.rml
  15. 515
      uft_dev_server/third_party/RCCPP/Assets/GUI/console.rcss
  16. 28
      uft_dev_server/third_party/RCCPP/Assets/GUI/console.rml
  17. BIN
      uft_dev_server/third_party/RCCPP/Assets/GUI/console.tga
  18. 44
      uft_dev_server/third_party/RCCPP/Assets/GUI/default.rcss
  19. 27
      uft_dev_server/third_party/RCCPP/Assets/GUI/fps-counter.rcss
  20. 10
      uft_dev_server/third_party/RCCPP/Assets/GUI/fps-counter.rml
  21. BIN
      uft_dev_server/third_party/RCCPP/Assets/GUI/immunewin.tga
  22. BIN
      uft_dev_server/third_party/RCCPP/Assets/GUI/infectionwin.tga
  23. 34
      uft_dev_server/third_party/RCCPP/Assets/GUI/input.rcss
  24. 11
      uft_dev_server/third_party/RCCPP/Assets/GUI/input.rml
  25. BIN
      uft_dev_server/third_party/RCCPP/Assets/GUI/invader.tga
  26. 582
      uft_dev_server/third_party/RCCPP/Assets/GUI/menu.rcss
  27. 56
      uft_dev_server/third_party/RCCPP/Assets/GUI/menu.rml
  28. 17
      uft_dev_server/third_party/RCCPP/Assets/GUI/splashscreen.rcss
  29. 10
      uft_dev_server/third_party/RCCPP/Assets/GUI/splashscreen.rml
  30. BIN
      uft_dev_server/third_party/RCCPP/Assets/GUI/title.tga
  31. BIN
      uft_dev_server/third_party/RCCPP/Assets/Models/infected_cell.aml
  32. BIN
      uft_dev_server/third_party/RCCPP/Assets/Models/red_blood_cell.aml
  33. BIN
      uft_dev_server/third_party/RCCPP/Assets/Models/virus.aml
  34. BIN
      uft_dev_server/third_party/RCCPP/Assets/Models/white_blood_cell.aml
  35. BIN
      uft_dev_server/third_party/RCCPP/Assets/Sounds/62912_Benboncan_Heartbeat_Mono_shortloop.wav
  36. 12
      uft_dev_server/third_party/RCCPP/Assets/Sounds/SoundFileAttributions.txt
  37. 157
      uft_dev_server/third_party/RCCPP/Aurora_VS2010.sln
  38. 26
      uft_dev_server/third_party/RCCPP/Aurora_x64.props
  39. 26
      uft_dev_server/third_party/RCCPP/Aurora_x86.props
  40. 179
      uft_dev_server/third_party/RCCPP/CMakeLists.txt
  41. 11
      uft_dev_server/third_party/RCCPP/Common/.project
  42. 55
      uft_dev_server/third_party/RCCPP/Common/AUColor.inl
  43. 184
      uft_dev_server/third_party/RCCPP/Common/AUOrientation3D.inl
  44. 211
      uft_dev_server/third_party/RCCPP/Common/AUVec3f.inl
  45. 146
      uft_dev_server/third_party/RCCPP/Common/Common_2010.vcxproj
  46. 46
      uft_dev_server/third_party/RCCPP/Common/Math.inl
  47. 45
      uft_dev_server/third_party/RCCPP/Examples/ConsoleExample/ConsoleExample.cpp
  48. 183
      uft_dev_server/third_party/RCCPP/Examples/ConsoleExample/ConsoleExample.vcxproj
  49. 27
      uft_dev_server/third_party/RCCPP/Examples/ConsoleExample/ConsoleExample.vcxproj.filters
  50. 175
      uft_dev_server/third_party/RCCPP/Examples/ConsoleExample/ConsoleGame.cpp
  51. 64
      uft_dev_server/third_party/RCCPP/Examples/ConsoleExample/ConsoleGame.h
  52. 30
      uft_dev_server/third_party/RCCPP/Examples/ConsoleExample/IUpdateable.h
  53. 41
      uft_dev_server/third_party/RCCPP/Examples/ConsoleExample/InterfaceIds.h
  54. 18
      uft_dev_server/third_party/RCCPP/Examples/ConsoleExample/RuntimeObject01.cpp
  55. 66
      uft_dev_server/third_party/RCCPP/Examples/ConsoleExample/StdioLogSystem.cpp
  56. 45
      uft_dev_server/third_party/RCCPP/Examples/ConsoleExample/StdioLogSystem.h
  57. 3
      uft_dev_server/third_party/RCCPP/Examples/SimpleTest/.gitignore
  58. 63
      uft_dev_server/third_party/RCCPP/Examples/SimpleTest/BB_Global.h
  59. 52
      uft_dev_server/third_party/RCCPP/Examples/SimpleTest/BB_Group_Infected.h
  60. 52
      uft_dev_server/third_party/RCCPP/Examples/SimpleTest/BB_Group_RBC.h
  61. 51
      uft_dev_server/third_party/RCCPP/Examples/SimpleTest/BB_Group_Virus.h
  62. 52
      uft_dev_server/third_party/RCCPP/Examples/SimpleTest/BB_Group_WBC.h
  63. 69
      uft_dev_server/third_party/RCCPP/Examples/SimpleTest/BB_Individual_Common.h
  64. 58
      uft_dev_server/third_party/RCCPP/Examples/SimpleTest/BB_Individual_Infected.h
  65. 60
      uft_dev_server/third_party/RCCPP/Examples/SimpleTest/BB_Individual_RBC.h
  66. 58
      uft_dev_server/third_party/RCCPP/Examples/SimpleTest/BB_Individual_Virus.h
  67. 58
      uft_dev_server/third_party/RCCPP/Examples/SimpleTest/BB_Individual_WBC.h
  68. 52
      uft_dev_server/third_party/RCCPP/Examples/SimpleTest/BB_Team_Immune.h
  69. 52
      uft_dev_server/third_party/RCCPP/Examples/SimpleTest/BB_Team_Infection.h
  70. 213
      uft_dev_server/third_party/RCCPP/Examples/SimpleTest/BehaviorCommon.h
  71. 138
      uft_dev_server/third_party/RCCPP/Examples/SimpleTest/BehaviorTreeManager.cpp
  72. 92
      uft_dev_server/third_party/RCCPP/Examples/SimpleTest/BehaviorTree_Infected.cpp
  73. 87
      uft_dev_server/third_party/RCCPP/Examples/SimpleTest/BehaviorTree_RBC.cpp
  74. 94
      uft_dev_server/third_party/RCCPP/Examples/SimpleTest/BehaviorTree_Virus.cpp
  75. 92
      uft_dev_server/third_party/RCCPP/Examples/SimpleTest/BehaviorTree_WBC.cpp
  76. 60
      uft_dev_server/third_party/RCCPP/Examples/SimpleTest/Behavior_Infected_Approach.cpp
  77. 76
      uft_dev_server/third_party/RCCPP/Examples/SimpleTest/Behavior_Infected_Base.h
  78. 108
      uft_dev_server/third_party/RCCPP/Examples/SimpleTest/Behavior_Infected_Combat.cpp
  79. 121
      uft_dev_server/third_party/RCCPP/Examples/SimpleTest/Behavior_Infected_HuntRBC.cpp
  80. 96
      uft_dev_server/third_party/RCCPP/Examples/SimpleTest/Behavior_Infected_HuntWBC.cpp
  81. 31
      uft_dev_server/third_party/RCCPP/Examples/SimpleTest/Behavior_Infected_Idle.cpp
  82. 60
      uft_dev_server/third_party/RCCPP/Examples/SimpleTest/Behavior_RBC_Approach.cpp
  83. 78
      uft_dev_server/third_party/RCCPP/Examples/SimpleTest/Behavior_RBC_Base.h
  84. 85
      uft_dev_server/third_party/RCCPP/Examples/SimpleTest/Behavior_RBC_Combat.cpp
  85. 78
      uft_dev_server/third_party/RCCPP/Examples/SimpleTest/Behavior_RBC_Evade.cpp
  86. 31
      uft_dev_server/third_party/RCCPP/Examples/SimpleTest/Behavior_RBC_Idle.cpp
  87. 60
      uft_dev_server/third_party/RCCPP/Examples/SimpleTest/Behavior_Virus_Approach.cpp
  88. 76
      uft_dev_server/third_party/RCCPP/Examples/SimpleTest/Behavior_Virus_Base.h
  89. 88
      uft_dev_server/third_party/RCCPP/Examples/SimpleTest/Behavior_Virus_Combat.cpp
  90. 121
      uft_dev_server/third_party/RCCPP/Examples/SimpleTest/Behavior_Virus_HuntRBC.cpp
  91. 96
      uft_dev_server/third_party/RCCPP/Examples/SimpleTest/Behavior_Virus_HuntWBC.cpp
  92. 31
      uft_dev_server/third_party/RCCPP/Examples/SimpleTest/Behavior_Virus_Idle.cpp
  93. 60
      uft_dev_server/third_party/RCCPP/Examples/SimpleTest/Behavior_WBC_Approach.cpp
  94. 76
      uft_dev_server/third_party/RCCPP/Examples/SimpleTest/Behavior_WBC_Base.h
  95. 85
      uft_dev_server/third_party/RCCPP/Examples/SimpleTest/Behavior_WBC_Combat.cpp
  96. 31
      uft_dev_server/third_party/RCCPP/Examples/SimpleTest/Behavior_WBC_Idle.cpp
  97. 97
      uft_dev_server/third_party/RCCPP/Examples/SimpleTest/Behavior_WBC_Patrol.cpp
  98. 391
      uft_dev_server/third_party/RCCPP/Examples/SimpleTest/BlackboardManager.cpp
  99. 177
      uft_dev_server/third_party/RCCPP/Examples/SimpleTest/CameraControl.cpp
  100. 50
      uft_dev_server/third_party/RCCPP/Examples/SimpleTest/CompilerLogger.cpp
  101. Some files were not shown because too many files have changed in this diff Show More

6
uft_dev_server/CMakeLists.txt

@ -14,6 +14,7 @@ set(SOURCE_DIR src) @@ -14,6 +14,7 @@ set(SOURCE_DIR src)
#
find_package(Drogon CONFIG REQUIRED)
find_package(RapidJSON CONFIG REQUIRED)
find_package(RCCPP REQUIRED)
#
add_executable(${PROJECT_NAME}
@ -27,6 +28,7 @@ add_executable(${PROJECT_NAME} @@ -27,6 +28,7 @@ add_executable(${PROJECT_NAME}
target_link_libraries(${PROJECT_NAME} PRIVATE
Drogon::Drogon
${CMAKE_DL_LIBS} #
RCCPP::RCCPP
)
#
@ -36,6 +38,10 @@ target_include_directories(${PROJECT_NAME} PRIVATE @@ -36,6 +38,10 @@ target_include_directories(${PROJECT_NAME} PRIVATE
${SOURCE_DIR}/filters
)
# RCC++
set(RCCPP_SOURCE_DIR ${SOURCE_DIR})
set(RCCPP_INCLUDE_DIRS ${SOURCE_DIR} ${SOURCE_DIR}/controllers ${SOURCE_DIR}/filters)
#
set(CONFIG_SRC "${CMAKE_CURRENT_SOURCE_DIR}/src/config/config.json")
set(CONFIG_DEST "${CMAKE_CURRENT_BINARY_DIR}/Debug/config.json")

4
uft_dev_server/cmd.txt

@ -1,3 +1,5 @@ @@ -1,3 +1,5 @@
cd D:/aigc/manta/uft_dev_server
rm -Path build -Recurse -Force
cmake -B build -DCMAKE_TOOLCHAIN_FILE="D:/aigc/vcpkg/scripts/buildsystems/vcpkg.cmake"
cmake --build build
cmake --build build

8
uft_dev_server/rccpp_config.h

@ -0,0 +1,8 @@ @@ -0,0 +1,8 @@
#pragma once
#define RCCPPUSER_USE_PRECOMPILED_HEADER 0
#define RCCPPUSER_USE_EXCEPTIONS 1
#define RCCPPUSER_USE_RTTI 1
#define RCCPPUSER_USE_DEBUG_NEW 0
#define RCCPPUSER_USE_VLD 0
#define RCCPPUSER_USE_IMGUI 0

3
uft_dev_server/src/controllers/ApiController.cpp

@ -1,5 +1,4 @@ @@ -1,5 +1,4 @@
#pragma once
#include <drogon/HttpController.h>
#include <drogon/HttpController.h>
#include <drogon/HttpResponse.h>
#include <json/json.h>

2
uft_dev_server/src/controllers/HelloWorldController.cpp

@ -7,6 +7,6 @@ void HelloWorldController::asyncHandleHttpRequest( @@ -7,6 +7,6 @@ void HelloWorldController::asyncHandleHttpRequest(
std::function<void(const HttpResponsePtr &)> &&callback)
{
auto resp = HttpResponse::newHttpResponse();
resp->setBody("Hello, World!");
resp->setBody("Hello, World! 欢迎访问 UFT C++ Server 开发 Project!");
callback(resp);
}

10
uft_dev_server/src/controllers/HelloWorldController.h

@ -1,9 +1,13 @@ @@ -1,9 +1,13 @@
// HelloWorldController.h
#pragma once
#include <drogon/HttpSimpleController.h>
#include <rccpp/RuntimeObject.h>
using namespace drogon;
class HelloWorldController : public HttpSimpleController<HelloWorldController>
class HelloWorldController :
public HttpSimpleController<HelloWorldController>,
public RCCPP::RuntimeObject<HelloWorldController>
{
public:
PATH_LIST_BEGIN
@ -12,4 +16,8 @@ public: @@ -12,4 +16,8 @@ public:
void asyncHandleHttpRequest(const HttpRequestPtr &req,
std::function<void(const HttpResponsePtr &)> &&callback) override;
// RCC++需要的接口
virtual void Construct() {}
virtual void Serialize(ISimpleSerializer* pSerializer) {}
};

31
uft_dev_server/src/main.cpp

@ -1,20 +1,45 @@ @@ -1,20 +1,45 @@
#include <drogon/drogon.h>
#include <drogon/drogon.h>
#include <rccpp/RuntimeObjectSystem.h>
#include <rccpp/RuntimeCompiler.h>
#include <rccpp/FileChangeNotifier.h>
#include <iostream>
using namespace drogon;
class MyAppSystem : public RCCPP::ISystem
{
public:
virtual bool Initialise() { return true; }
virtual void Shutdown() {}
virtual void Update(float deltaTime) {}
};
int main()
{
try
{
// 初始化RCC++
RCCPP::RuntimeObjectSystem runtimeObjectSystem;
runtimeObjectSystem.Initialise(new MyAppSystem, ".");
// 设置日志级别
drogon::app().setLogLevel(trantor::Logger::kTrace);
drogon::app().registerBeginningAdvice([]()
{ LOG_INFO << "Drogon application starting..."; });
drogon::app().registerBeginningAdvice([]() {
LOG_INFO << "Drogon application starting...";
});
// 加载配置
drogon::app().loadConfigFile("./config.json");
// 启动文件监视器
auto& fileChangeNotifier = runtimeObjectSystem.GetFileChangeNotifier();
fileChangeNotifier.AddWatch(".", true);
// 主循环中检查文件变化
drogon::app().registerBeginningAdvice([&]() {
runtimeObjectSystem.GetRuntimeCompiler()->Update(0.1f);
});
// 启动服务
drogon::app().run();
}

BIN
uft_dev_server/third_party/RCCPP/Assets/GUI/Anonymous.ttf vendored

Binary file not shown.

BIN
uft_dev_server/third_party/RCCPP/Assets/GUI/Delicious-Bold.otf vendored

Binary file not shown.

BIN
uft_dev_server/third_party/RCCPP/Assets/GUI/Delicious-BoldItalic.otf vendored

Binary file not shown.

BIN
uft_dev_server/third_party/RCCPP/Assets/GUI/Delicious-Italic.otf vendored

Binary file not shown.

BIN
uft_dev_server/third_party/RCCPP/Assets/GUI/Delicious-Roman.otf vendored

Binary file not shown.

32
uft_dev_server/third_party/RCCPP/Assets/GUI/compiling-notification.rcss vendored

@ -0,0 +1,32 @@ @@ -0,0 +1,32 @@
body
{
font-family: Delicious;
font-weight: normal;
font-style: normal;
font-size: 20;
color: white;
z-index: -3;
}
body
{
height: 100%;
width: 100%;
}
div#compiling
{
font-size: 16;
font-weight: bold;
background-color: #303030;
text-align: left;
position:absolute;
bottom: 9px;
right: 40px;
width: 200px;
}

10
uft_dev_server/third_party/RCCPP/Assets/GUI/compiling-notification.rml vendored

@ -0,0 +1,10 @@ @@ -0,0 +1,10 @@
<rml>
<head>
<link type="text/rcss" href="default.rcss"/>
<link type="text/rcss" href="compiling-notification.rcss"/>
<title>CompilingNotification</title>
</head>
<body>
<div id="compiling"></div>
</body>
</rml>

515
uft_dev_server/third_party/RCCPP/Assets/GUI/console.rcss vendored

@ -0,0 +1,515 @@ @@ -0,0 +1,515 @@
body
{
font-family: Delicious;
font-weight: normal;
font-style: normal;
font-size: 15pt;
color: white;
top: 100px;
left: 30px;
}
div#title_bar
{
z-index: 2;
position: absolute;
top: -33px;
text-align: left;
}
div#title_bar span
{
padding-left: 30px;
padding-right: 20px;
padding-top: 12px;
padding-bottom: 35px;
font-size: 18pt;
font-weight: bold;
outline-font-effect: outline;
outline-width: 1px;
outline-color: black;
background-decorator: tiled-horizontal;
background-left-image: console.tga 147px 0px 229px 85px;
background-center-image: console.tga stretch 229px 0px 230px 85px;
background-right-image: console.tga 231px 0px 246px 85px;
}
div#window
{
z-index: 2;
width: 600px;
height: auto;
background-decorator: tiled-box;
background-top-left-image: console.tga 0px 0px 133px 15px;
background-top-right-image: console.tga 136px 0px 146px 15px;
background-top-image: console.tga stretch 134px 0px 135px 15px;
background-bottom-left-image: console.tga 0px 16px 11px 31px;
background-bottom-right-image: console.tga 136px 16px 146px 31px;
background-bottom-image: console.tga stretch 11px 16px 12px 31px;
background-left-image: console.tga stretch 0px 15px 10px 16px;
background-center-image: console.tga stretch 11px 15px 12px 16px;
}
div#content
{
z-index: 2;
overflow: hidden auto;
text-align: left;
padding-left: 7px;
padding-right: 7px;
padding-bottom: 3px;
}
div#controls
{
z-index: 2;
margin-top: 8px;
margin-right: 10px;
text-align: right;
}
select,
dataselect
{
margin-left: 20px;
}
input.text,
textarea
{
font-family: Anonymous;
font-size: 16pt;
}
input.submit
{
margin-left: 7px;
margin-bottom: 4px;
}
button,
input.submit
{
display: inline-block;
width: 80px;
height: 28px;
padding-top: 5px;
vertical-align: -18px;
font-size: 14pt;
font-weight: bold;
text-align: center;
tab-index: auto;
background-decorator: image;
background-image: console.tga 247px 0px 406px 45px;
}
button:focus,
input.submit:focus
{
font-weight: bold;
shadow-font-effect: shadow;
shadow-offset: 1px 1px;
shadow-color: black;
}
button:hover,
input.submit:hover
{
background-image-t: 45px 90px;
}
button:active,
input.submit:active
{
background-image-t: 90px 135px;
}
button:disabled,
input.submit:disabled
{
background-image-t: 90px 135px;
color: grey;
font-weight: normal;
}
input.text,
textarea
{
padding: 5px;
padding-left: 10px;
padding-top: 10px;
margin: 5px;
margin-bottom: 0px;
background-decorator: tiled-box;
background-top-left-image: console.tga 281px 272px 292px 284px;
background-top-right-image: console.tga 294px 272px 305px 284px;
background-top-image: console.tga stretch 292px 272px 293px 284px;
background-bottom-left-image: console.tga 281px 285px 292px 296px;
background-bottom-right-image: console.tga 294px 285px 305px 296px;
background-bottom-image: console.tga stretch 292px 285px 293px 296px;
background-left-image: console.tga stretch 281px 283px 292px 284px;
background-center-image: console.tga stretch 292px 283px 293px 284px;
}
input.text
{
height: 35px;
width: 677px;
}
textarea
{
height: 155px;
width: 677px;
}
input.text,
select,
dataselect,
textarea
{
color: black;
font-size: 13pt;
}
datagrid input.text
{
width: 100%;
height: auto;
margin: 0px;
padding: 0px 2px 0px;
border-width: 1px;
border-color: black;
background-color: white;
font-size: 15pt;
background-decorator: none;
}
select,
dataselect
{
width: 175px;
height: 37px;
}
select selectvalue,
dataselect selectvalue
{
width: auto;
margin-right: 30px;
height: 28px;
padding: 9px 10px 0px 10px;
background-decorator: image;
background-image: console.tga 162px 192px 307px 229px;
}
select selectvalue:hover,
dataselect selectvalue:hover
{
background-image-t: 230px 267px;
}
select selectarrow,
dataselect selectarrow
{
width: 30px;
height: 37px;
icon-decorator: image;
icon-image: console.tga 307px 192px 337px 229px;
}
select selectarrow:hover,
dataselect selectarrow:hover
{
icon-image-t: 230px 267px;
}
select selectarrow:active,
select selectarrow:checked,
dataselect selectarrow:active,
dataselect selectarrow:checked
{
icon-image-t: 268px 305px;
}
select selectbox,
dataselect selectbox
{
margin-left: 1px;
margin-top: -7px;
width: 162px;
padding: 1px 4px 4px 4px;
}
select selectbox,
dataselect selectbox,
datagrid datagridbody
{
background-decorator: tiled-box;
background-top-left-image: console.tga 281px 275px 292px 284px;
background-top-right-image: console.tga 294px 275px 305px 284px;
background-top-image: console.tga stretch 292px 275px 293px 284px;
background-bottom-left-image: console.tga 281px 285px 292px 296px;
background-bottom-right-image: console.tga 294px 285px 305px 296px;
background-bottom-image: console.tga stretch 292px 285px 293px 296px;
background-left-image: console.tga stretch 281px 283px 292px 284px;
background-center-image: console.tga stretch 292px 283px 293px 284px;
}
select selectbox option,
dataselect selectbox option
{
width: auto;
padding-left: 3px;
}
select selectbox option:nth-child(even),
dataselect selectbox option:nth-child(even),
datagrid datagridrow:nth-child(even)
{
background: #FFFFFFA0;
}
select selectbox option:hover,
dataselect selectbox option:hover
{
background: #FF5D5D;
}
input.radio,
input.checkbox
{
width: 30px;
height: 30px;
vertical-align: -11px;
}
input.radio
{
icon-decorator: image;
icon-image: console.tga 407px 0px 437px 30px;
}
input.radio:hover
{
icon-image-s: 437px 467px;
}
input.radio:active
{
icon-image-s: 467px 497px;
}
input.radio:checked
{
icon-image-t: 30px 60px;
}
input.radio:checked:hover
{
icon-image-s: 437px 467px;
icon-image-t: 30px 60px;
}
input.radio:checked:active
{
icon-image-s: 467px 497px;
icon-image-t: 30px 60px;
}
input.checkbox
{
icon-decorator: image;
icon-image: console.tga 407px 60px 437px 90px;
}
input.checkbox:hover
{
icon-image-s: 437px 467px;
}
input.checkbox:active
{
icon-image-s: 467px 497px;
}
input.checkbox:checked
{
icon-image-t: 90px 120px;
}
input.checkbox:checked:hover
{
icon-image-s: 437px 467px;
icon-image-t: 90px 120px;
}
input.checkbox:checked:active
{
icon-image-s: 467px 497px;
icon-image-t: 90px 120px;
}
datagrid datagridheader
{
width: auto;
height: 25px;
padding: 5px 10px 0px 10px;
background-decorator: tiled-horizontal;
background-left-image: console.tga 127px 192px 143px 223px;
background-center-image: console.tga stretch 143px 192px 145px 223px;
background-right-image: console.tga 145px 192px 160px 223px;
}
datagrid datagridbody
{
color: black;
margin-left: 4px;
margin-right: 3px;
padding: 0px 4px 4px 4px;
}
datagridexpand
{
display: block;
margin: 1px 0px 1px 5px;
height: 17px;
width: 17px;
icon-decorator: image;
icon-image: console.tga 3px 232px 20px 249px;
}
datagridexpand:hover
{
icon-image-s: 21px 38px;
}
datagridexpand:active
{
icon-image-s: 39px 56px;
}
datagridexpand.collapsed
{
icon-image-t: 250px 267px;
}
scrollbarvertical
{
margin-top: 1px;
margin-bottom: 3px;
margin-right: 3px;
width: 27px;
}
scrollbarvertical slidertrack
{
background-decorator: tiled-vertical;
background-top-image: console.tga 70px 199px 97px 201px;
background-center-image: console.tga stretch 70px 201px 97px 202px;
background-bottom-image: console.tga 70px 203px 97px 204px;
}
scrollbarvertical sliderbar
{
margin-left: 4px;
width: 23px;
min-height: 46px;
background-decorator: tiled-vertical;
background-top-image: console.tga 56px 152px 79px 175px;
background-center-image: console.tga stretch 56px 175px 79px 175px;
background-bottom-image: console.tga 56px 176px 79px 198px;
}
scrollbarvertical sliderbar:hover
{
background-top-image-s: 80px 103px;
background-center-image-s: 80px 103px;
background-bottom-image-s: 80px 103px;
}
scrollbarvertical sliderbar:active
{
background-top-image-s: 104px 127px;
background-center-image-s: 104px 127px;
background-bottom-image-s: 104px 127px;
}
scrollbarvertical sliderarrowdec
{
width: 27px;
height: 24px;
icon-decorator: image;
icon-image: console.tga 0px 152px 27px 176px;
}
scrollbarvertical sliderarrowdec:hover,
scrollbarvertical sliderarrowinc:hover
{
icon-image-t: 177px 201px;
}
scrollbarvertical sliderarrowdec:active,
scrollbarvertical sliderarrowinc:active
{
icon-image-t: 202px 226px;
}
scrollbarvertical sliderarrowinc
{
width: 27px;
height: 24px;
icon-decorator: image;
icon-image: console.tga 28px 152px 55px 176px;
}
scrollbarhorizontal
{
width: 0px;
height: 0px;
}

28
uft_dev_server/third_party/RCCPP/Assets/GUI/console.rml vendored

@ -0,0 +1,28 @@ @@ -0,0 +1,28 @@
<rml>
<head>
<link type="text/rcss" href="default.rcss"/>
<link type="text/rcss" href="console.rcss"/>
<title>Title</title>
</head>
<body>
<div id="title_bar">
<handle move_target="#document">
<span id="title">Console</span>
</handle>
</div>
<div id="window">
<div id="controls">
<button id="ViewButton">Multi</button>
<button id="ClearButton">Clear</button>
<button id="BackButton">&lt;</button>
<button id="ForwardButton">&gt;</button>
<button id="CloseButton">Close</button>
</div>
<div id="content">
<input id="SingleLineArea" name="oneline" type="text" maxlength="256"/>
<textarea id="MultiLineArea" name="multiline" />
<button id="ExecuteButton">Execute</button>
</div>
</div>
</body>
</rml>

BIN
uft_dev_server/third_party/RCCPP/Assets/GUI/console.tga vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

44
uft_dev_server/third_party/RCCPP/Assets/GUI/default.rcss vendored

@ -0,0 +1,44 @@ @@ -0,0 +1,44 @@
/*
* Default styles for all the basic elements.
*/
div
{
display: block;
}
p
{
display: block;
}
h1
{
display: block;
}
em
{
font-style: italic;
}
strong
{
font-weight: bold;
}
datagrid
{
display: block;
}
select, dataselect, datacombo
{
text-align: left;
}
tabset tabs
{
display: block;
}

27
uft_dev_server/third_party/RCCPP/Assets/GUI/fps-counter.rcss vendored

@ -0,0 +1,27 @@ @@ -0,0 +1,27 @@
body
{
font-family: Delicious;
font-weight: normal;
font-style: normal;
font-size: 20;
color: white;
}
div#fps
{
font-size: 20;
font-weight: bold;
outline-font-effect: outline;
outline-width: 1px;
outline-color: black;
text-align: right;
position:absolute;
top: 5px;
right: 10px;
width: 100px;
}

10
uft_dev_server/third_party/RCCPP/Assets/GUI/fps-counter.rml vendored

@ -0,0 +1,10 @@ @@ -0,0 +1,10 @@
<rml>
<head>
<link type="text/rcss" href="default.rcss"/>
<link type="text/rcss" href="fps-counter.rcss"/>
<title>FPS Counter</title>
</head>
<body>
<div id ="fps"></div>
</body>
</rml>

BIN
uft_dev_server/third_party/RCCPP/Assets/GUI/immunewin.tga vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

BIN
uft_dev_server/third_party/RCCPP/Assets/GUI/infectionwin.tga vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

34
uft_dev_server/third_party/RCCPP/Assets/GUI/input.rcss vendored

@ -0,0 +1,34 @@ @@ -0,0 +1,34 @@
body
{
font-family: Delicious;
font-weight: normal;
font-style: normal;
font-size: 20;
color: white;
z-index: -2;
}
textarea#info
{
font-size: 13;
position: absolute;
width: 220px;
height: 170px;
bottom: 0px;
left: 0px;
color: black;
padding: 12px;
background-decorator: tiled-box;
background-top-left-image: console.tga 281px 272px 292px 284px;
background-top-right-image: console.tga 294px 272px 305px 284px;
background-top-image: console.tga stretch 292px 272px 293px 284px;
background-bottom-left-image: console.tga 281px 285px 292px 296px;
background-bottom-right-image: console.tga 294px 285px 305px 296px;
background-bottom-image: console.tga stretch 292px 285px 293px 296px;
background-left-image: console.tga stretch 281px 283px 292px 284px;
background-center-image: console.tga stretch 292px 283px 293px 284px;
}

11
uft_dev_server/third_party/RCCPP/Assets/GUI/input.rml vendored

@ -0,0 +1,11 @@ @@ -0,0 +1,11 @@
<rml>
<head>
<link type="text/rcss" href="default.rcss"/>
<link type="text/rcss" href="input.rcss"/>
<title>Input Manager Window</title>
</head>
<body>
<div id="input"></div>
<textarea id="info" />
</body>
</rml>

BIN
uft_dev_server/third_party/RCCPP/Assets/GUI/invader.tga vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

582
uft_dev_server/third_party/RCCPP/Assets/GUI/menu.rcss vendored

@ -0,0 +1,582 @@ @@ -0,0 +1,582 @@
body
{
z-index: top;
font-family: Delicious;
font-weight: normal;
font-style: normal;
font-size: 15;
color: white;
display: inline;
height: 0px;
}
body.window
{
padding-top: 43px;
padding-bottom: 20px;
min-width: 250px;
max-width: 800px;
min-height: 135px;
max-height: 700px;
}
div#title_bar
{
z-index: 1;
position: absolute;
top: 0px;
left: 0px;
text-align: left;
}
div#title_bar div#icon
{
position: absolute;
left: 20px;
top: 2px;
width: 51px;
height: 39px;
icon-decorator: image;
icon-image-src: invader.tga;
}
div#title_bar span
{
padding-left: 85px;
padding-right: 25px;
padding-top: 17px;
padding-bottom: 48px;
font-size: 22;
font-weight: bold;
outline-font-effect: outline;
outline-width: 1px;
outline-color: black;
background-decorator: tiled-horizontal;
background-left-image: invader.tga 147px 0px 229px 85px;
background-center-image: invader.tga stretch 229px 0px 230px 85px;
background-right-image: invader.tga 231px 0px 246px 85px;
}
div.window
{
padding-top: 10px;
padding-left: 20px;
padding-bottom: 10px;
margin-left: auto;
margin-right: auto;
width: 500px;
background-decorator: tiled-box;
background-top-left-image: invader.tga 0px 0px 133px 140px;
background-top-right-image: invader.tga 136px 0px 146px 140px;
background-top-image: invader.tga stretch 134px 0px 135px 140px;
background-bottom-left-image: invader.tga 0px 140px 11px 151px;
background-bottom-right-image: invader.tga 136px 140px 146px 151px;
background-bottom-image: invader.tga stretch 11px 140px 12px 151px;
background-left-image: invader.tga stretch 0px 139px 10px 140px;
background-center-image: invader.tga stretch 11px 139px 12px 140px;
}
div.options
{
padding-left: 25px;
}
input.range
{
vertical-align: -3px;
}
input.range slidertrack
{
width: 150px;
height: 20px;
background-color: black;
}
input.range sliderbar
{
width: 20px;
height: 16px;
background-decorator: image;
background-image: invader.tga 247px 5px 406px 40px;
}
div#content
{
z-index: 2;
width: auto;
height: 100%;
overflow: hidden auto;
text-align: center;
}
div#toggle-group
{
display: inline;
width: auto;
}
div#menu-group
{
display: inline;
width: auto;
}
p
{
text-align: left;
margin-bottom: 1em;
}
h1
{
margin-left: 0.2em;
margin-bottom: 0.4em;
text-align: left;
font-size: 16;
font-weight: bold;
shadow-font-effect: shadow;
shadow-offset: 1px 1px;
shadow-color: black;
}
input,
select,
dataselect
{
margin-left: 20px;
}
input.submit
{
margin-left: 0px;
}
button,
input.submit
{
display: inline-block;
height: 37px;
width: 100px;
padding-top: 8px;
vertical-align: -18px;
font-size: 18;
text-align: center;
tab-index: auto;
background-decorator: image;
background-image: invader.tga 247px 0px 406px 45px;
}
button:focus,
input.submit:focus
{
font-weight: bold;
shadow-font-effect: shadow;
shadow-offset: 1px 1px;
shadow-color: black;
}
button:hover,
input.submit:hover
{
background-image-t: 45px 90px;
}
button:active,
input.submit:active
{
background-image-t: 90px 135px;
}
button.square
{
width: 45px;
background-decorator: image;
background-image: invader.tga 454px 188px 499px 233px;
}
button.square:hover,
{
background-image-t: 233px 278px;
}
button.square:active,
{
background-image-t: 278px 323px;
}
input.text
{
height: 31px;
padding: 10px 10px 0px;
background-decorator: tiled-horizontal;
background-left-image: invader.tga 162px 192px 176px 223px;
background-center-image: invader.tga stretch 176px 192px 177px 223px;
}
input.text,
select,
dataselect
{
color: black;
font-size: 13;
}
datagrid input.text
{
width: 100%;
height: auto;
margin: 0px;
padding: 0px 2px 0px;
border-width: 1px;
border-color: black;
background-color: white;
font-size: 15;
background-decorator: none;
}
select,
dataselect
{
width: 175px;
height: 37px;
}
select selectvalue,
dataselect selectvalue
{
width: auto;
margin-right: 30px;
height: 28px;
padding: 9px 10px 0px 10px;
background-decorator: image;
background-image: invader.tga 162px 192px 307px 229px;
}
select selectvalue:hover,
dataselect selectvalue:hover
{
background-image-t: 230px 267px;
}
select selectarrow,
dataselect selectarrow
{
width: 30px;
height: 37px;
icon-decorator: image;
icon-image: invader.tga 307px 192px 337px 229px;
}
select selectarrow:hover,
dataselect selectarrow:hover
{
icon-image-t: 230px 267px;
}
select selectarrow:active,
select selectarrow:checked,
dataselect selectarrow:active,
dataselect selectarrow:checked
{
icon-image-t: 268px 305px;
}
select selectbox,
dataselect selectbox
{
margin-left: 1px;
margin-top: -7px;
width: 162px;
padding: 1px 4px 4px 4px;
}
select selectbox,
dataselect selectbox,
datagrid datagridbody
{
background-decorator: tiled-box;
background-top-left-image: invader.tga 281px 275px 292px 284px;
background-top-right-image: invader.tga 294px 275px 305px 284px;
background-top-image: invader.tga stretch 292px 275px 293px 284px;
background-bottom-left-image: invader.tga 281px 285px 292px 296px;
background-bottom-right-image: invader.tga 294px 285px 305px 296px;
background-bottom-image: invader.tga stretch 292px 285px 293px 296px;
background-left-image: invader.tga stretch 281px 283px 292px 284px;
background-center-image: invader.tga stretch 292px 283px 293px 284px;
}
select selectbox option,
dataselect selectbox option
{
width: auto;
padding-left: 3px;
}
select selectbox option:nth-child(even),
dataselect selectbox option:nth-child(even),
datagrid datagridrow:nth-child(even)
{
background: #FFFFFFA0;
}
select selectbox option:hover,
dataselect selectbox option:hover
{
background: #FF5D5D;
}
input.radio,
input.checkbox
{
width: 30px;
height: 30px;
vertical-align: -11px;
}
input.radio
{
icon-decorator: image;
icon-image: invader.tga 407px 0px 437px 30px;
}
input.radio:hover
{
icon-image-s: 437px 467px;
}
input.radio:active
{
icon-image-s: 467px 497px;
}
input.radio:checked
{
icon-image-t: 30px 60px;
}
input.radio:checked:hover
{
icon-image-s: 437px 467px;
icon-image-t: 30px 60px;
}
input.radio:checked:active
{
icon-image-s: 467px 497px;
icon-image-t: 30px 60px;
}
input.checkbox
{
icon-decorator: image;
icon-image: invader.tga 407px 60px 437px 90px;
}
input.checkbox:hover
{
icon-image-s: 437px 467px;
}
input.checkbox:active
{
icon-image-s: 467px 497px;
}
input.checkbox:checked
{
icon-image-t: 90px 120px;
}
input.checkbox:checked:hover
{
icon-image-s: 437px 467px;
icon-image-t: 90px 120px;
}
input.checkbox:checked:active
{
icon-image-s: 467px 497px;
icon-image-t: 90px 120px;
}
datagrid datagridheader
{
width: auto;
height: 25px;
padding: 5px 10px 0px 10px;
background-decorator: tiled-horizontal;
background-left-image: invader.tga 127px 192px 143px 223px;
background-center-image: invader.tga stretch 143px 192px 145px 223px;
background-right-image: invader.tga 145px 192px 160px 223px;
}
datagrid datagridbody
{
color: black;
margin-left: 4px;
margin-right: 3px;
padding: 0px 4px 4px 4px;
}
datagridexpand
{
display: block;
margin: 1px 0px 1px 5px;
height: 17px;
width: 17px;
icon-decorator: image;
icon-image: invader.tga 3px 232px 20px 249px;
}
datagridexpand:hover
{
icon-image-s: 21px 38px;
}
datagridexpand:active
{
icon-image-s: 39px 56px;
}
datagridexpand.collapsed
{
icon-image-t: 250px 267px;
}
scrollbarvertical
{
margin-top: -6px;
margin-bottom: -6px;
margin-right: -11px;
width: 27px;
}
scrollbarvertical slidertrack
{
background-decorator: tiled-vertical;
background-top-image: invader.tga 70px 199px 97px 201px;
background-center-image: invader.tga stretch 70px 201px 97px 202px;
background-bottom-image: invader.tga 70px 203px 97px 204px;
}
scrollbarvertical sliderbar
{
margin-left: 4px;
width: 23px;
min-height: 46px;
background-decorator: tiled-vertical;
background-top-image: invader.tga 56px 152px 79px 175px;
background-center-image: invader.tga stretch 56px 175px 79px 175px;
background-bottom-image: invader.tga 56px 176px 79px 198px;
}
scrollbarvertical sliderbar:hover
{
background-top-image-s: 80px 103px;
background-center-image-s: 80px 103px;
background-bottom-image-s: 80px 103px;
}
scrollbarvertical sliderbar:active
{
background-top-image-s: 104px 127px;
background-center-image-s: 104px 127px;
background-bottom-image-s: 104px 127px;
}
scrollbarvertical sliderarrowdec
{
width: 27px;
height: 24px;
icon-decorator: image;
icon-image: invader.tga 0px 152px 27px 176px;
}
scrollbarvertical sliderarrowdec:hover,
scrollbarvertical sliderarrowinc:hover
{
icon-image-t: 177px 201px;
}
scrollbarvertical sliderarrowdec:active,
scrollbarvertical sliderarrowinc:active
{
icon-image-t: 202px 226px;
}
scrollbarvertical sliderarrowinc
{
width: 27px;
height: 24px;
icon-decorator: image;
icon-image: invader.tga 28px 152px 55px 176px;
}
scrollbarhorizontal
{
width: 0px;
height: 0px;
}

56
uft_dev_server/third_party/RCCPP/Assets/GUI/menu.rml vendored

@ -0,0 +1,56 @@ @@ -0,0 +1,56 @@
<rml>
<head>
<link type="text/rcss" href="default.rcss"/>
<link type="text/rcss" href="menu.rcss"/>
<title>Title</title>
</head>
<body>
<div id="toggle-group">
<button id="ToggleButton" class="square"></button>
</div>
<div id="menu-group">
<button id="ConsoleButton">Console</button>
<button id="NewButton">New Game</button>
<button id="RestartButton">Restart</button>
<button id="ToggleOptions">Options</button>
</div>
<div id="Options" class="window">
<form id="test">
<div>
<h1>Runtime Compiler:</h1>
</div>
<div class="options">
<p>
Auto Compile:<input type="checkbox" id="autocompilecheckbox" value="checked" checked="y"/>
Fast Compile:<input type="checkbox" id="fastcompilecheckbox" value="checked"/>
Optimize for Debug:<input type="checkbox" id="optimizefordebug" value="checked"/>
</p>
<p>
<button id="TestRCCpp">Test RCC++</button>
Test File Tracking:<input type="checkbox" id="TestFileTracking" value="checked" checked="y"/>
</p>
<p>Testing RCC++ will touch each RCC++ file in turn to test compilation. This can take significant time.</p>
<button id="UndoRCCpp">Undo RCC++</button>
<button id="RedoRCCpp">Redo RCC++</button>
</div>
<div>
<h1>Game:</h1>
</div>
<div class="options">
<p>
Speed:&nbsp;&nbsp; <input type="range" id="speedslider" name="speed" value="1" min="0" max="5" step="0.05" />
&nbsp;&nbsp;&nbsp;Pause:<input type="checkbox" id="pausecheckbox" value="checked"/>
</p>
</div>
</form>
</div>
</body>
</rml>

17
uft_dev_server/third_party/RCCPP/Assets/GUI/splashscreen.rcss vendored

@ -0,0 +1,17 @@ @@ -0,0 +1,17 @@
body
{
font-family: Delicious;
font-weight: normal;
font-style: normal;
font-size: 20;
color: white;
}
img#splash
{
z-index: -1;
position: absolute;
}

10
uft_dev_server/third_party/RCCPP/Assets/GUI/splashscreen.rml vendored

@ -0,0 +1,10 @@ @@ -0,0 +1,10 @@
<rml>
<head>
<link type="text/rcss" href="default.rcss"/>
<link type="text/rcss" href="splashscreen.rcss"/>
<title>SplashScreen</title>
</head>
<body>
<img id="splash" src=""/>
</body>
</rml>

BIN
uft_dev_server/third_party/RCCPP/Assets/GUI/title.tga vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

BIN
uft_dev_server/third_party/RCCPP/Assets/Models/infected_cell.aml vendored

Binary file not shown.

BIN
uft_dev_server/third_party/RCCPP/Assets/Models/red_blood_cell.aml vendored

Binary file not shown.

BIN
uft_dev_server/third_party/RCCPP/Assets/Models/virus.aml vendored

Binary file not shown.

BIN
uft_dev_server/third_party/RCCPP/Assets/Models/white_blood_cell.aml vendored

Binary file not shown.

BIN
uft_dev_server/third_party/RCCPP/Assets/Sounds/62912_Benboncan_Heartbeat_Mono_shortloop.wav vendored

Binary file not shown.

12
uft_dev_server/third_party/RCCPP/Assets/Sounds/SoundFileAttributions.txt vendored

@ -0,0 +1,12 @@ @@ -0,0 +1,12 @@
Following sound files from sources downloaded from freesound.org:
62912_Benboncan_Heartbeat_Mono_shortloop.wav
Source: 62912_Benboncan_Heartbeat_Mono.wav
Author: Benboncan
The work is licensed under a Creative Commons Sampling Plus 1.0 License.
http://creativecommons.org/licenses/sampling+/1.0/

157
uft_dev_server/third_party/RCCPP/Aurora_VS2010.sln vendored

@ -0,0 +1,157 @@ @@ -0,0 +1,157 @@

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "RuntimeCompiler_VS2010", "RuntimeCompiler\RuntimeCompiler_VS2010.vcxproj", "{790D95ED-C6E6-24E5-345B-37FB1E098082}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SimpleTest", "Examples\SimpleTest\SimpleTest.vcxproj", "{D80E22AA-64AF-4542-A583-DC0AE69CC88B}"
ProjectSection(ProjectDependencies) = postProject
{1AAC0B29-AEB9-4E3F-8EDF-B46F8949C41B} = {1AAC0B29-AEB9-4E3F-8EDF-B46F8949C41B}
{1AAC0B29-AEC9-4E3F-9EDF-B56F8949C41A} = {1AAC0B29-AEC9-4E3F-9EDF-B56F8949C41A}
{1AAC0B29-AEC9-4E3F-9EDF-B56F8949C41B} = {1AAC0B29-AEC9-4E3F-9EDF-B56F8949C41B}
{BD166836-4A63-47F6-A8A7-A535D99A5F75} = {BD166836-4A63-47F6-A8A7-A535D99A5F75}
{2947A63C-A245-4853-B4CC-476354188AEE} = {2947A63C-A245-4853-B4CC-476354188AEE}
{26DDDB96-4A8E-4A1B-997C-970DE0CCCE37} = {26DDDB96-4A8E-4A1B-997C-970DE0CCCE37}
{790D95ED-C6E6-24E5-345B-37FB1E098082} = {790D95ED-C6E6-24E5-345B-37FB1E098082}
{FA4E24F1-885C-406B-89A8-436F28D090B2} = {FA4E24F1-885C-406B-89A8-436F28D090B2}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Systems", "Systems\Systems.vcxproj", "{BD166836-4A63-47F6-A8A7-A535D99A5F75}"
ProjectSection(ProjectDependencies) = postProject
{1AAC0B29-AEB9-4E3F-8EDF-B46F8949C41B} = {1AAC0B29-AEB9-4E3F-8EDF-B46F8949C41B}
{1AAC0B29-AEC9-4E3F-9EDF-B56F8949C41A} = {1AAC0B29-AEC9-4E3F-9EDF-B56F8949C41A}
{1AAC0B29-AEC9-4E3F-9EDF-B56F8949C41B} = {1AAC0B29-AEC9-4E3F-9EDF-B56F8949C41B}
{2947A63C-A245-4853-B4CC-476354188AEE} = {2947A63C-A245-4853-B4CC-476354188AEE}
{26DDDB96-4A8E-4A1B-997C-970DE0CCCE37} = {26DDDB96-4A8E-4A1B-997C-970DE0CCCE37}
{790D95ED-C6E6-24E5-345B-37FB1E098082} = {790D95ED-C6E6-24E5-345B-37FB1E098082}
{FA4E24F1-885C-406B-89A8-436F28D090B2} = {FA4E24F1-885C-406B-89A8-436F28D090B2}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Renderer_VS2010", "Renderer\Renderer_VS2010.vcxproj", "{26DDDB96-4A8E-4A1B-997C-970DE0CCCE37}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Common_2010", "Common\Common_2010.vcxproj", "{2947A63C-A245-4853-B4CC-476354188AEE}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "RocketCore", "External\libRocket\Build\RocketCore.vcxproj", "{1AAC0B29-AEB9-4E3F-8EDF-B46F8949C41B}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "RocketControls", "External\libRocket\Build\RocketControls.vcxproj", "{1AAC0B29-AEC9-4E3F-9EDF-B56F8949C41B}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "RocketDebugger", "External\libRocket\Build\RocketDebugger.vcxproj", "{1AAC0B29-AEC9-4E3F-9EDF-B56F8949C41A}"
ProjectSection(ProjectDependencies) = postProject
{1AAC0B29-AEC9-4E3F-9EDF-B56F8949C41B} = {1AAC0B29-AEC9-4E3F-9EDF-B56F8949C41B}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ConsoleExample", "Examples\ConsoleExample\ConsoleExample.vcxproj", "{B95544FF-96D5-4395-8E62-C02A512534D7}"
ProjectSection(ProjectDependencies) = postProject
{BD166836-4A63-47F6-A8A7-A535D99A5F75} = {BD166836-4A63-47F6-A8A7-A535D99A5F75}
{2947A63C-A245-4853-B4CC-476354188AEE} = {2947A63C-A245-4853-B4CC-476354188AEE}
{790D95ED-C6E6-24E5-345B-37FB1E098082} = {790D95ED-C6E6-24E5-345B-37FB1E098082}
{FA4E24F1-885C-406B-89A8-436F28D090B2} = {FA4E24F1-885C-406B-89A8-436F28D090B2}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "RuntimeObjectSystem", "RuntimeObjectSystem\RuntimeObjectSystem.vcxproj", "{FA4E24F1-885C-406B-89A8-436F28D090B2}"
ProjectSection(ProjectDependencies) = postProject
{790D95ED-C6E6-24E5-345B-37FB1E098082} = {790D95ED-C6E6-24E5-345B-37FB1E098082}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "glfw", "External\glfw\projects\glfw.vcxproj", "{C00481F6-9574-41A5-990F-1F1C30B7AD6F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Debug|x64 = Debug|x64
Release|Win32 = Release|Win32
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{790D95ED-C6E6-24E5-345B-37FB1E098082}.Debug|Win32.ActiveCfg = Debug|Win32
{790D95ED-C6E6-24E5-345B-37FB1E098082}.Debug|Win32.Build.0 = Debug|Win32
{790D95ED-C6E6-24E5-345B-37FB1E098082}.Debug|x64.ActiveCfg = Debug|x64
{790D95ED-C6E6-24E5-345B-37FB1E098082}.Debug|x64.Build.0 = Debug|x64
{790D95ED-C6E6-24E5-345B-37FB1E098082}.Release|Win32.ActiveCfg = Release|Win32
{790D95ED-C6E6-24E5-345B-37FB1E098082}.Release|Win32.Build.0 = Release|Win32
{790D95ED-C6E6-24E5-345B-37FB1E098082}.Release|x64.ActiveCfg = Release|x64
{790D95ED-C6E6-24E5-345B-37FB1E098082}.Release|x64.Build.0 = Release|x64
{D80E22AA-64AF-4542-A583-DC0AE69CC88B}.Debug|Win32.ActiveCfg = Debug|Win32
{D80E22AA-64AF-4542-A583-DC0AE69CC88B}.Debug|Win32.Build.0 = Debug|Win32
{D80E22AA-64AF-4542-A583-DC0AE69CC88B}.Debug|x64.ActiveCfg = Debug|x64
{D80E22AA-64AF-4542-A583-DC0AE69CC88B}.Debug|x64.Build.0 = Debug|x64
{D80E22AA-64AF-4542-A583-DC0AE69CC88B}.Release|Win32.ActiveCfg = Release|Win32
{D80E22AA-64AF-4542-A583-DC0AE69CC88B}.Release|Win32.Build.0 = Release|Win32
{D80E22AA-64AF-4542-A583-DC0AE69CC88B}.Release|x64.ActiveCfg = Release|x64
{D80E22AA-64AF-4542-A583-DC0AE69CC88B}.Release|x64.Build.0 = Release|x64
{BD166836-4A63-47F6-A8A7-A535D99A5F75}.Debug|Win32.ActiveCfg = Debug|Win32
{BD166836-4A63-47F6-A8A7-A535D99A5F75}.Debug|Win32.Build.0 = Debug|Win32
{BD166836-4A63-47F6-A8A7-A535D99A5F75}.Debug|x64.ActiveCfg = Debug|x64
{BD166836-4A63-47F6-A8A7-A535D99A5F75}.Debug|x64.Build.0 = Debug|x64
{BD166836-4A63-47F6-A8A7-A535D99A5F75}.Release|Win32.ActiveCfg = Release|Win32
{BD166836-4A63-47F6-A8A7-A535D99A5F75}.Release|Win32.Build.0 = Release|Win32
{BD166836-4A63-47F6-A8A7-A535D99A5F75}.Release|x64.ActiveCfg = Release|x64
{BD166836-4A63-47F6-A8A7-A535D99A5F75}.Release|x64.Build.0 = Release|x64
{26DDDB96-4A8E-4A1B-997C-970DE0CCCE37}.Debug|Win32.ActiveCfg = Debug|Win32
{26DDDB96-4A8E-4A1B-997C-970DE0CCCE37}.Debug|Win32.Build.0 = Debug|Win32
{26DDDB96-4A8E-4A1B-997C-970DE0CCCE37}.Debug|x64.ActiveCfg = Debug|x64
{26DDDB96-4A8E-4A1B-997C-970DE0CCCE37}.Debug|x64.Build.0 = Debug|x64
{26DDDB96-4A8E-4A1B-997C-970DE0CCCE37}.Release|Win32.ActiveCfg = Release|Win32
{26DDDB96-4A8E-4A1B-997C-970DE0CCCE37}.Release|Win32.Build.0 = Release|Win32
{26DDDB96-4A8E-4A1B-997C-970DE0CCCE37}.Release|x64.ActiveCfg = Release|x64
{26DDDB96-4A8E-4A1B-997C-970DE0CCCE37}.Release|x64.Build.0 = Release|x64
{2947A63C-A245-4853-B4CC-476354188AEE}.Debug|Win32.ActiveCfg = Debug|Win32
{2947A63C-A245-4853-B4CC-476354188AEE}.Debug|Win32.Build.0 = Debug|Win32
{2947A63C-A245-4853-B4CC-476354188AEE}.Debug|x64.ActiveCfg = Debug|x64
{2947A63C-A245-4853-B4CC-476354188AEE}.Debug|x64.Build.0 = Debug|x64
{2947A63C-A245-4853-B4CC-476354188AEE}.Release|Win32.ActiveCfg = Release|Win32
{2947A63C-A245-4853-B4CC-476354188AEE}.Release|Win32.Build.0 = Release|Win32
{2947A63C-A245-4853-B4CC-476354188AEE}.Release|x64.ActiveCfg = Release|x64
{2947A63C-A245-4853-B4CC-476354188AEE}.Release|x64.Build.0 = Release|x64
{1AAC0B29-AEB9-4E3F-8EDF-B46F8949C41B}.Debug|Win32.ActiveCfg = Debug|Win32
{1AAC0B29-AEB9-4E3F-8EDF-B46F8949C41B}.Debug|Win32.Build.0 = Debug|Win32
{1AAC0B29-AEB9-4E3F-8EDF-B46F8949C41B}.Debug|x64.ActiveCfg = Debug|x64
{1AAC0B29-AEB9-4E3F-8EDF-B46F8949C41B}.Debug|x64.Build.0 = Debug|x64
{1AAC0B29-AEB9-4E3F-8EDF-B46F8949C41B}.Release|Win32.ActiveCfg = Release|Win32
{1AAC0B29-AEB9-4E3F-8EDF-B46F8949C41B}.Release|Win32.Build.0 = Release|Win32
{1AAC0B29-AEB9-4E3F-8EDF-B46F8949C41B}.Release|x64.ActiveCfg = Release|x64
{1AAC0B29-AEB9-4E3F-8EDF-B46F8949C41B}.Release|x64.Build.0 = Release|x64
{1AAC0B29-AEC9-4E3F-9EDF-B56F8949C41B}.Debug|Win32.ActiveCfg = Debug|Win32
{1AAC0B29-AEC9-4E3F-9EDF-B56F8949C41B}.Debug|Win32.Build.0 = Debug|Win32
{1AAC0B29-AEC9-4E3F-9EDF-B56F8949C41B}.Debug|x64.ActiveCfg = Debug|x64
{1AAC0B29-AEC9-4E3F-9EDF-B56F8949C41B}.Debug|x64.Build.0 = Debug|x64
{1AAC0B29-AEC9-4E3F-9EDF-B56F8949C41B}.Release|Win32.ActiveCfg = Release|Win32
{1AAC0B29-AEC9-4E3F-9EDF-B56F8949C41B}.Release|Win32.Build.0 = Release|Win32
{1AAC0B29-AEC9-4E3F-9EDF-B56F8949C41B}.Release|x64.ActiveCfg = Release|x64
{1AAC0B29-AEC9-4E3F-9EDF-B56F8949C41B}.Release|x64.Build.0 = Release|x64
{1AAC0B29-AEC9-4E3F-9EDF-B56F8949C41A}.Debug|Win32.ActiveCfg = Debug|Win32
{1AAC0B29-AEC9-4E3F-9EDF-B56F8949C41A}.Debug|Win32.Build.0 = Debug|Win32
{1AAC0B29-AEC9-4E3F-9EDF-B56F8949C41A}.Debug|x64.ActiveCfg = Debug|x64
{1AAC0B29-AEC9-4E3F-9EDF-B56F8949C41A}.Debug|x64.Build.0 = Debug|x64
{1AAC0B29-AEC9-4E3F-9EDF-B56F8949C41A}.Release|Win32.ActiveCfg = Release|Win32
{1AAC0B29-AEC9-4E3F-9EDF-B56F8949C41A}.Release|Win32.Build.0 = Release|Win32
{1AAC0B29-AEC9-4E3F-9EDF-B56F8949C41A}.Release|x64.ActiveCfg = Release|x64
{1AAC0B29-AEC9-4E3F-9EDF-B56F8949C41A}.Release|x64.Build.0 = Release|x64
{B95544FF-96D5-4395-8E62-C02A512534D7}.Debug|Win32.ActiveCfg = Debug|Win32
{B95544FF-96D5-4395-8E62-C02A512534D7}.Debug|Win32.Build.0 = Debug|Win32
{B95544FF-96D5-4395-8E62-C02A512534D7}.Debug|x64.ActiveCfg = Debug|x64
{B95544FF-96D5-4395-8E62-C02A512534D7}.Debug|x64.Build.0 = Debug|x64
{B95544FF-96D5-4395-8E62-C02A512534D7}.Release|Win32.ActiveCfg = Release|Win32
{B95544FF-96D5-4395-8E62-C02A512534D7}.Release|Win32.Build.0 = Release|Win32
{B95544FF-96D5-4395-8E62-C02A512534D7}.Release|x64.ActiveCfg = Release|x64
{B95544FF-96D5-4395-8E62-C02A512534D7}.Release|x64.Build.0 = Release|x64
{FA4E24F1-885C-406B-89A8-436F28D090B2}.Debug|Win32.ActiveCfg = Debug|Win32
{FA4E24F1-885C-406B-89A8-436F28D090B2}.Debug|Win32.Build.0 = Debug|Win32
{FA4E24F1-885C-406B-89A8-436F28D090B2}.Debug|x64.ActiveCfg = Debug|x64
{FA4E24F1-885C-406B-89A8-436F28D090B2}.Debug|x64.Build.0 = Debug|x64
{FA4E24F1-885C-406B-89A8-436F28D090B2}.Release|Win32.ActiveCfg = Release|Win32
{FA4E24F1-885C-406B-89A8-436F28D090B2}.Release|Win32.Build.0 = Release|Win32
{FA4E24F1-885C-406B-89A8-436F28D090B2}.Release|x64.ActiveCfg = Release|x64
{FA4E24F1-885C-406B-89A8-436F28D090B2}.Release|x64.Build.0 = Release|x64
{C00481F6-9574-41A5-990F-1F1C30B7AD6F}.Debug|Win32.ActiveCfg = Debug|Win32
{C00481F6-9574-41A5-990F-1F1C30B7AD6F}.Debug|Win32.Build.0 = Debug|Win32
{C00481F6-9574-41A5-990F-1F1C30B7AD6F}.Debug|x64.ActiveCfg = Debug|x64
{C00481F6-9574-41A5-990F-1F1C30B7AD6F}.Debug|x64.Build.0 = Debug|x64
{C00481F6-9574-41A5-990F-1F1C30B7AD6F}.Release|Win32.ActiveCfg = Release|Win32
{C00481F6-9574-41A5-990F-1F1C30B7AD6F}.Release|Win32.Build.0 = Release|Win32
{C00481F6-9574-41A5-990F-1F1C30B7AD6F}.Release|x64.ActiveCfg = Release|x64
{C00481F6-9574-41A5-990F-1F1C30B7AD6F}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

26
uft_dev_server/third_party/RCCPP/Aurora_x64.props vendored

@ -0,0 +1,26 @@ @@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Label="PropertySheets" />
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<IncludePath>$(VC_IncludePath);$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSdkDir)include;$(FrameworkSDKDir)\include;$(WindowsSDK_IncludePath)</IncludePath>
<LibraryPath>$(VC_LibraryPath_x64);$(WindowsSDK_LibraryPath_x64);$(VCInstallDir)lib\amd64;$(VCInstallDir)atlmfc\lib\amd64;$(WindowsSdkDir)lib\x64;$(FrameworkSDKDir)\lib\amd64</LibraryPath>
</PropertyGroup>
<ItemDefinitionGroup>
<Lib>
<AdditionalDependencies>
</AdditionalDependencies>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup>
<Lib>
<AdditionalLibraryDirectories>
</AdditionalLibraryDirectories>
</Lib>
<ClCompile>
<AdditionalIncludeDirectories>$(SolutionDir)\External\libRocket\Include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup />
</Project>

26
uft_dev_server/third_party/RCCPP/Aurora_x86.props vendored

@ -0,0 +1,26 @@ @@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Label="PropertySheets" />
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<IncludePath>$(VC_IncludePath);$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSdkDir)include;$(FrameworkSDKDir)\include;$(WindowsSDK_IncludePath)</IncludePath>
<LibraryPath>$(VC_LibraryPath_x86);$(WindowsSDK_LibraryPath_x86);$(VCInstallDir)lib;$(VCInstallDir)atlmfc\lib;$(WindowsSdkDir)lib;$(FrameworkSDKDir)\lib</LibraryPath>
</PropertyGroup>
<ItemDefinitionGroup>
<Lib>
<AdditionalDependencies>
</AdditionalDependencies>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup>
<Lib>
<AdditionalLibraryDirectories>
</AdditionalLibraryDirectories>
</Lib>
<ClCompile>
<AdditionalIncludeDirectories>$(SolutionDir)\External\libRocket\Include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup />
</Project>

179
uft_dev_server/third_party/RCCPP/CMakeLists.txt vendored

@ -0,0 +1,179 @@ @@ -0,0 +1,179 @@
cmake_minimum_required(VERSION 3.12)
project( RuntimeCompiledCPlusPlus )
#
# Options
#
option(BUILD_EXAMPLES "Build example applications" ON)
option(GLFW_SYSTEM "Use the operating system glfw library" OFF)
if(UNIX AND NOT APPLE)
set(BUILD_TYPE SHARED)
else()
set(BUILD_TYPE STATIC)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
endif()
include(cmake/ProjectFiles.cmake)
#
# RuntimeCompiler
#
add_library(RuntimeCompiler ${BUILD_TYPE} ${RuntimeCompiler_SRCS})
#
# RuntimeObjectSystem
#
add_library(RuntimeObjectSystem ${BUILD_TYPE} ${RuntimeObjectSystem_SRCS})
target_link_libraries(RuntimeObjectSystem RuntimeCompiler)
if(UNIX)
target_link_libraries(RuntimeObjectSystem dl)
endif()
if(MSVC)
# ensure the files are compiled with full paths and utf-8 so that __FILE__ macros are in utf-8 encoding
set_target_properties(RuntimeCompiler RuntimeObjectSystem PROPERTIES COMPILE_FLAGS "/FC /utf-8")
endif()
#
# Make Install
#
install(DIRECTORY RuntimeObjectSystem/ DESTINATION ${CMAKE_INSTALL_PREFIX}/include/RuntimeObjectSystem
FILES_MATCHING PATTERN "*.h")
install(DIRECTORY RuntimeCompiler/ DESTINATION ${CMAKE_INSTALL_PREFIX}/include/RuntimeCompiler
FILES_MATCHING PATTERN "*.h")
install(TARGETS RuntimeObjectSystem RuntimeCompiler
DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/)
if(BUILD_EXAMPLES)
#
# ConsoleExample
#
add_executable(ConsoleExample ${ConsoleExample_SRCS})
target_link_libraries(ConsoleExample RuntimeCompiler RuntimeObjectSystem)
find_package(OpenGL)
if(OpenGL_FOUND)
#
# Renderer
#
add_library(Renderer ${BUILD_TYPE} ${Renderer_SRCS})
target_link_libraries(Renderer ${OPENGL_LIBRARIES} ${ASSIMP_LIBRARIES})
#
# Systems
#
add_library(Systems ${BUILD_TYPE} ${Systems_SRCS})
#
# Freetype WIN32
#
if(WIN32)
set(FREETYPE_INCLUDE_DIR_freetype2 ${CMAKE_SOURCE_DIR}/External/support/freetype/include/freetype)
set(FREETYPE_INCLUDE_DIR_ft2build ${CMAKE_SOURCE_DIR}/External/support/freetype/include)
if(${CMAKE_CL_64})
set(FREETYPE_LIBRARY ${CMAKE_SOURCE_DIR}/External/support/lib/freetype2410MTx64.lib)
else()
set(FREETYPE_LIBRARY ${CMAKE_SOURCE_DIR}/External/support/lib/freetype2410MT.lib)
endif()
elseif(APPLE)
set(FREETYPE_INCLUDE_DIR_freetype2 ${CMAKE_SOURCE_DIR}/External/support/freetype/include/freetype)
set(FREETYPE_INCLUDE_DIR_ft2build ${CMAKE_SOURCE_DIR}/External/support/freetype/include)
FIND_LIBRARY(ZLIB_LIBRARY libs)
MARK_AS_ADVANCED(ZLIB_LIBRARY)
set(FREETYPE_LIBRARY ${CMAKE_SOURCE_DIR}/External/support/lib/MacOSX/libfreetype.a ${ZLIB_LIBRARY})
endif()
#
# glfw
#
if(GLFW_SYSTEM)
set(GLFW_LIBRARIES glfw)
else()
include_directories(External/glfw/include)
if(WIN32)
set(GLFW_LIBRARIES glfw winmm)
add_subdirectory( ${CMAKE_SOURCE_DIR}/External/glfw/projects )
else()
add_library( glfw STATIC IMPORTED )
if(APPLE)
FIND_LIBRARY(COCOA_LIBRARY Cocoa)
FIND_LIBRARY(IOKIT_LIBRARY IOKit)
MARK_AS_ADVANCED(COCOA_LIBRARY IOKIT_LIBRARY)
set_target_properties( glfw PROPERTIES IMPORTED_LOCATION ${CMAKE_SOURCE_DIR}/External/glfw/libOSX/libglfw.a )
set(GLFW_LIBRARIES glfw ${COCOA_LIBRARY} ${IOKIT_LIBRARY})
else()
set_target_properties( glfw PROPERTIES IMPORTED_LOCATION ${CMAKE_SOURCE_DIR}/External/glfw/libX11/libglfw.a )
set(GLFW_LIBRARIES glfw X11 pthread)
endif()
endif()
endif()
#
# assimp
#
if(WIN32)
add_library( assimp STATIC IMPORTED )
set(ASSIMP_LIBRARIES assimp)
if(${CMAKE_CL_64})
set_target_properties( assimp PROPERTIES IMPORTED_LOCATION ${CMAKE_SOURCE_DIR}/External/assimp/lib/assimp_release-dll_x64/assimp.lib )
set(ASSIMP_DLL ${CMAKE_SOURCE_DIR}/External/assimp/bin/assimp_release-dll_win32/Assimp64.dll)
else()
set_target_properties( assimp PROPERTIES IMPORTED_LOCATION ${CMAKE_SOURCE_DIR}/External/assimp/lib/assimp_release-dll_win32/assimp.lib )
set(ASSIMP_DLL ${CMAKE_SOURCE_DIR}/External/assimp/bin/assimp_release-dll_win32/Assimp32.dll)
endif()
if(CMAKE_GENERATOR STREQUAL "NMake Makefiles")
file(COPY ${ASSIMP_DLL} DESTINATION ${CMAKE_LIBRARY_OUTPUT_DIRECTORY})
else()
foreach( OUTPUTCONFIG ${CMAKE_CONFIGURATION_TYPES} )
file(COPY ${ASSIMP_DLL} DESTINATION ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${OUTPUTCONFIG})
endforeach( OUTPUTCONFIG CMAKE_CONFIGURATION_TYPES )
endif()
endif()
#
# SimpleTest
#
add_subdirectory(External/libRocket/Build)
include_directories(
${OPENGL_INCLUDE_DIR}
External/libRocket/Include
External/assimp/include
)
if(WIN32)
add_executable(SimpleTest WIN32 ${SimpleTest_SRCS})
else()
add_executable(SimpleTest ${SimpleTest_SRCS})
endif()
target_link_libraries(SimpleTest
RuntimeCompiler
RuntimeObjectSystem
Renderer
Systems
RocketCore
RocketControls
RocketDebugger
${OPENGL_LIBRARIES}
${GLFW_LIBRARIES}
${ASSIMP_LIBRARIES}
)
if(MSVC)
set_target_properties(SimpleTest ConsoleExample PROPERTIES COMPILE_FLAGS "/FC /utf-8")
else()
add_compile_definitions(COMPILE_PATH="${CMAKE_BINARY_DIR}")
endif()
else() # OpenGL_FOUND
message(WARNING "OpenGL not found, not creating graphical example")
endif() # OpenGL_FOUND
endif()

11
uft_dev_server/third_party/RCCPP/Common/.project vendored

@ -0,0 +1,11 @@ @@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>Common</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
</buildSpec>
<natures>
</natures>
</projectDescription>

55
uft_dev_server/third_party/RCCPP/Common/AUColor.inl vendored

@ -0,0 +1,55 @@ @@ -0,0 +1,55 @@
//
// Copyright (c) 2010-2011 Matthew Jack and Doug Binks
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
#pragma once
#ifndef AUCOLOR_DEF
#define AUCOLOR_DEF
#include <string.h> // for memcpy on linux
class AUColor
{
public:
AUColor(float Red = 0.0f, float Green = 0.0f, float Blue = 0.0f, float Alpha = 0.0f)
{
m_Color.r = Red;
m_Color.g = Green;
m_Color.b = Blue;
m_Color.a = Alpha;
}
AUColor( const float rgba[4] )
{
memcpy( m_Color.rgba, rgba, sizeof( m_Color.rgba ) );
}
union ColorUnion
{
struct
{
float r;
float g;
float b;
float a;
};
float rgba[4];
} m_Color;
};
#endif //AUCOLOR_DEF

184
uft_dev_server/third_party/RCCPP/Common/AUOrientation3D.inl vendored

@ -0,0 +1,184 @@ @@ -0,0 +1,184 @@
//
// Copyright (c) 2010-2011 Matthew Jack and Doug Binks
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
#pragma once
#ifndef AUDORIENTATION3D_DEFINED
#define AUDORIENTATION3D_DEFINED
#include "AUVec3f.inl" //interface relies on class AUVec3f
#include <limits> //for numerical limits
class AUOrientation3D
{
public:
AUOrientation3D() :
m_v3dForwards( 1.0f, 0.0f, 0.0f ),
m_v3dUp( 0.0f, 1.0f, 0.0f ),
m_v3dRight( 0.0f, 0.0f, 1.0f )
{
}
AUOrientation3D( const AUVec3f& v3dForwards_, const AUVec3f& v3dUp_) :
m_v3dForwards( v3dForwards_ ),
m_v3dUp( v3dUp_ )
{
OrthoNormalise();
}
//Inspectors
const AUVec3f& GetForwards() const { return m_v3dForwards; }
const AUVec3f& GetUp() const { return m_v3dUp; }
const AUVec3f& GetRight() const { return m_v3dRight; }
void LoadglViewMatrix( float *const fglMatrix_ ) const
{
//note: OpenGL camera defaults to looking down -z, thus orient z with Forwards
fglMatrix_[0] = m_v3dRight.x;
fglMatrix_[1] = m_v3dUp.x;
fglMatrix_[2] = -m_v3dForwards.x;
fglMatrix_[3] = 0.0f;
fglMatrix_[4] = m_v3dRight.y;
fglMatrix_[5] = m_v3dUp.y;
fglMatrix_[6] = -m_v3dForwards.y;
fglMatrix_[7] = 0.0f;
fglMatrix_[8] = m_v3dRight.z;
fglMatrix_[9] = m_v3dUp.z;
fglMatrix_[10] = -m_v3dForwards.z;
fglMatrix_[11] = 0.0f;
fglMatrix_[12] = 0.0f;
fglMatrix_[13] = 0.0f;
fglMatrix_[14] = 0.0f;
fglMatrix_[15] = 1.0f;
}
void LoadglObjectMatrix( float *const fglMatrix_ ) const
{
//note: OpenGL camera defaults to looking down -z, thus orient z with Forwards
fglMatrix_[0] = m_v3dForwards.x;
fglMatrix_[1] = m_v3dForwards.y;
fglMatrix_[2] = m_v3dForwards.z;
fglMatrix_[3] = 0.0f;
fglMatrix_[4] = m_v3dUp.x;
fglMatrix_[5] = m_v3dUp.y;
fglMatrix_[6] = m_v3dUp.z;
fglMatrix_[7] = 0.0f;
fglMatrix_[8] = m_v3dRight.x;
fglMatrix_[9] = m_v3dRight.y;
fglMatrix_[10] = m_v3dRight.z;
fglMatrix_[11] = 0.0f;
fglMatrix_[12] = 0.0f;
fglMatrix_[13] = 0.0f;
fglMatrix_[14] = 0.0f;
fglMatrix_[15] = 1.0f;
}
//Mutators
AUVec3f& GetForwards() { return m_v3dForwards; }
AUVec3f& GetUp() { return m_v3dUp; }
AUVec3f& GetRight() { return m_v3dRight; }
void Set( const AUVec3f& v3dForwards_, const AUVec3f& v3dUp_)
{
m_v3dForwards = v3dForwards_;
m_v3dUp = v3dUp_;
OrthoNormalise();
}
void Rotate( const AUVec3f& v3dAxis_, float fTheta_)
{
float fCosTheta = static_cast<float>( cos(fTheta_ ) );
float fSinTheta = static_cast<float>( sin(fTheta_ ) );
AUVec3f v3dtemp = v3dAxis_.Cross( m_v3dForwards );
m_v3dForwards += fSinTheta * v3dtemp +
( fCosTheta - 1.0f ) * v3dAxis_.Cross( v3dtemp );
v3dtemp = v3dAxis_.Cross( m_v3dUp );
m_v3dUp += fSinTheta * v3dtemp +
( fCosTheta - 1.0f ) * v3dAxis_.Cross( v3dtemp );
//orthonormalise coordinate system
OrthoNormalise();
}
protected:
void OrthoNormalise()
{
if( true == m_v3dForwards.Normalise() )
{
//have a normalised forwards vector
m_v3dRight = m_v3dForwards.Cross( m_v3dUp );
if( true == m_v3dRight.Normalise() )
{
//and now have a normalised right vector so safe to generate cross.
m_v3dUp = m_v3dRight.Cross( m_v3dForwards );
}
else
{
//have a forwards vector only, so generate an arbitary `up'.
m_v3dUp.SetX( m_v3dForwards.z );
m_v3dUp.SetY( m_v3dForwards.x );
m_v3dUp.SetZ( m_v3dForwards.y );
//will now get a 'guaranteed' right from this
m_v3dRight = m_v3dForwards.Cross( m_v3dUp );
//and so can generate a true up
m_v3dUp = m_v3dRight.Cross( m_v3dForwards );
}
}
else
{
//can't use forwards as our main vector, so try up
if( true == m_v3dUp.Normalise() )
{
//have a up vector only, so generate an arbitary `up'.
m_v3dForwards.SetX( m_v3dUp.z );
m_v3dForwards.SetY( m_v3dUp.x );
m_v3dForwards.SetZ( m_v3dUp.y );
//will now get a 'guaranteed' right from this
m_v3dRight = m_v3dForwards.Cross( m_v3dUp );
//and so can generate a true forwards
m_v3dForwards = m_v3dUp.Cross( m_v3dRight );
}
else
{
//have no appropriate starting vectors, so fake it.
m_v3dForwards.Set( 1.0f, 0.0f, 0.0f );
m_v3dUp.Set( 0.0f, 1.0f, 0.0f );
m_v3dRight.Set( 0.0f, 0.0f, 1.0f );
}
}
}
private:
AUVec3f m_v3dForwards;
AUVec3f m_v3dUp;
AUVec3f m_v3dRight;
};
#endif //AUDORIENTATION3D_DEFINED

211
uft_dev_server/third_party/RCCPP/Common/AUVec3f.inl vendored

@ -0,0 +1,211 @@ @@ -0,0 +1,211 @@
//
// Copyright (c) 2010-2011 Matthew Jack and Doug Binks
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
#pragma once
#ifndef AUVEC3F_DEFINED
#define AUVEC3F_DEFINED
#include <cmath>
#include <limits>
class AUVec3f
{
public:
AUVec3f(float fX_ = 0.0f, float fY_ = 0.0f, float fZ_ = 0.0f) :
x( fX_ ),
y( fY_ ),
z( fZ_ )
{
}
AUVec3f( const AUVec3f& v3din_ ) :
x( v3din_.x ),
y( v3din_.y ),
z( v3din_.z )
{
}
//Mutators
void SetX( float fX_ ) { x = fX_; }
void SetY( float fY_ ) { y = fY_; }
void SetZ( float fZ_ ) { z = fZ_; }
void Set( float fX_, float fY_, float fZ_ )
{
x = fX_;
y = fY_;
z = fZ_;
}
float Dot( const AUVec3f& V_ ) const
{
return x * V_.x
+ y * V_.y
+ z * V_.z;
}
AUVec3f Cross( const AUVec3f& V_ ) const
{
AUVec3f newV( y * V_.z - z * V_.y,
z * V_.x - x * V_.z,
x * V_.y - y * V_.x );
return newV;
}
bool Normalise()
{
float fMagnitude = Magnitude();
if(fMagnitude != 0.0f)
{
x /= fMagnitude;
y /= fMagnitude;
z /= fMagnitude;
return true;
}
else
{
return false;
}
}
AUVec3f GetNormalised() const
{
AUVec3f v = *this;
v.Normalise();
return v;
}
AUVec3f Lerp( const AUVec3f& V_, float t ) const
{
return (*this + (V_ - *this) * t);
}
bool IsInfinite() const
{
float inf = std::numeric_limits<float>::infinity();
return ( x == inf || y == inf || z == inf );
}
void SetInfinite()
{
x = y = z = std::numeric_limits<float>::infinity();
}
bool IsZero() const
{
return (x == 0.0f && y == 0.0f && z == 0.0f);
}
//Operators
AUVec3f& operator+=( const AUVec3f& V_ )
{
x += V_.x;
y += V_.y;
z += V_.z;
return *this;
}
AUVec3f& operator-=( const AUVec3f& V_ )
{
x -= V_.x;
y -= V_.y;
z -= V_.z;
return *this;
}
AUVec3f& operator*=( const float& fScalar_ )
{
x *= fScalar_;
y *= fScalar_;
z *= fScalar_;
return *this;
}
AUVec3f& operator/=( const float& fScalar_ )
{
x /= fScalar_;
y /= fScalar_;
z /= fScalar_;
return *this;
}
bool operator==( const AUVec3f& V_ ) const
{
return ( x == V_.x ) && ( y == V_.y ) && ( z == V_.z );
}
bool operator!=( const AUVec3f& V_ ) const
{
return !(*this == V_);
}
float Magnitude() const
{
return static_cast<float>( sqrt( Dot( *this ) ) );
}
float MagnitudeSqr() const
{
return static_cast<float>( Dot( *this ) );
}
AUVec3f operator+( const AUVec3f& V2_ ) const
{
AUVec3f newV_( *this );
return ( newV_ += V2_ );
}
AUVec3f operator-( const AUVec3f& V2_ ) const
{
AUVec3f newV_( *this );
return ( newV_ -= V2_ );
}
AUVec3f operator*( const float& fScalar_ ) const
{
AUVec3f newV_( *this );
return ( newV_ *= fScalar_ );
}
AUVec3f operator/( const float& fScalar_ )
{
AUVec3f newV_( *this );
return ( newV_ /= fScalar_ );
}
AUVec3f operator-()
{
AUVec3f newV_( -x, -y, -z );
return newV_;
}
float x;
float y;
float z;
};
//functions which do not have to be members
inline AUVec3f operator*( const float& fScalar_, const AUVec3f& V1_ )
{
return V1_ * fScalar_;
}
#endif //AUVEC3F_DEFINED

146
uft_dev_server/third_party/RCCPP/Common/Common_2010.vcxproj vendored

@ -0,0 +1,146 @@ @@ -0,0 +1,146 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<ItemGroup>
<None Include="AUOrientation3D.inl" />
<None Include="AUVec3f.inl" />
<None Include="Math.inl" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="AUColor.inl" />
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{2947A63C-A245-4853-B4CC-476354188AEE}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>Common</RootNamespace>
<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v140_xp</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v140_xp</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v140_xp</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v140_xp</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup />
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeaderFile>
</PrecompiledHeaderFile>
<PrecompiledHeaderOutputFile>
</PrecompiledHeaderOutputFile>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeaderFile>
</PrecompiledHeaderFile>
<PrecompiledHeaderOutputFile>
</PrecompiledHeaderOutputFile>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>Use</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>Use</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

46
uft_dev_server/third_party/RCCPP/Common/Math.inl vendored

@ -0,0 +1,46 @@ @@ -0,0 +1,46 @@
//
// Copyright (c) 2010-2011 Matthew Jack and Doug Binks
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
#pragma once
#ifndef AUMATH_DEFINED
#define AUMATH_DEFINED
#define _USE_MATH_DEFINES
#include <math.h>
/* Adds some helpful macros and exposes the non-standard constants available in math.h (may not be portable):
* M_E - e
* M_LOG2E - log2(e)
* M_LOG10E - log10(e)
* M_LN2 - ln(2)
* M_LN10 - ln(10)
* M_PI - pi
* M_PI_2 - pi/2
* M_PI_4 - pi/4
* M_1_PI - 1/pi
* M_2_PI - 2/pi
* M_2_SQRTPI - 2/sqrt(pi)
* M_SQRT2 - sqrt(2)
* M_SQRT1_2 - 1/sqrt(2)
*/
#define DEG2RAD(deg) ((deg)*((PI)/(180.0)))
#define RAD2DEG(rad) ((rad)*((180.0)/(PI)))
#define LERP(a, b, t) ((a) + (t) * ((b) - (a)))
#endif // AUMATH_DEFINED

45
uft_dev_server/third_party/RCCPP/Examples/ConsoleExample/ConsoleExample.cpp vendored

@ -0,0 +1,45 @@ @@ -0,0 +1,45 @@
//
// Copyright (c) 2010-2011 Matthew Jack and Doug Binks
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
// ConsoleExample.cpp : simple example using console command line
#include "ConsoleGame.h"
#include <iostream>
#ifdef _WIN32
#include <conio.h>
#endif
int main(int argc, char* argv[])
{
ConsoleGame game;
if( game.Init() )
{
while( game.MainLoop() )
{
}
}
else
{
std::cout << "\nFailed Initialisation, press a key to exit.\n";
_getche();
}
std::cout << "Exiting...\n";
return 0;
}

183
uft_dev_server/third_party/RCCPP/Examples/ConsoleExample/ConsoleExample.vcxproj vendored

@ -0,0 +1,183 @@ @@ -0,0 +1,183 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{B95544FF-96D5-4395-8E62-C02A512534D7}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>ConsoleExample</RootNamespace>
<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v140_xp</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v140_xp</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v140_xp</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v140_xp</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\Aurora_x86.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\Aurora_x64.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\Aurora_x86.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\Aurora_x64.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeaderFile>
</PrecompiledHeaderFile>
<AdditionalIncludeDirectories>
</AdditionalIncludeDirectories>
<UseFullPaths>true</UseFullPaths>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>RuntimeObjectSystem.lib;RuntimeCompiler_VS2010.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(SolutionDir)$(Configuration);</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeaderFile>
</PrecompiledHeaderFile>
<AdditionalIncludeDirectories>
</AdditionalIncludeDirectories>
<UseFullPaths>true</UseFullPaths>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>RuntimeObjectSystem.lib;RuntimeCompiler_VS2010.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(SolutionDir)$(Platform)\$(Configuration)\</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>
</AdditionalIncludeDirectories>
<UseFullPaths>true</UseFullPaths>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalDependencies>RuntimeObjectSystem.lib;RuntimeCompiler_VS2010.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(SolutionDir)$(Configuration);</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>
</AdditionalIncludeDirectories>
<UseFullPaths>true</UseFullPaths>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalDependencies>RuntimeObjectSystem.lib;RuntimeCompiler_VS2010.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(SolutionDir)$(Platform)\$(Configuration)\</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="ConsoleExample.cpp" />
<ClCompile Include="ConsoleGame.cpp" />
<ClCompile Include="RuntimeObject01.cpp" />
<ClCompile Include="StdioLogSystem.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="ConsoleGame.h" />
<ClInclude Include="InterfaceIds.h" />
<ClInclude Include="IUpdateable.h" />
<ClInclude Include="StdioLogSystem.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

27
uft_dev_server/third_party/RCCPP/Examples/ConsoleExample/ConsoleExample.vcxproj.filters vendored

@ -0,0 +1,27 @@ @@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
<Filter Include="Runtime Modifiable">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="ConsoleExample.cpp" />
<ClCompile Include="RuntimeObject01.cpp">
<Filter>Runtime Modifiable</Filter>
</ClCompile>
<ClCompile Include="StdioLogSystem.cpp" />
<ClCompile Include="ConsoleGame.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="StdioLogSystem.h" />
<ClInclude Include="ConsoleGame.h" />
<ClInclude Include="InterfaceIds.h" />
<ClInclude Include="IUpdateable.h" />
</ItemGroup>
</Project>

175
uft_dev_server/third_party/RCCPP/Examples/ConsoleExample/ConsoleGame.cpp vendored

@ -0,0 +1,175 @@ @@ -0,0 +1,175 @@
//
// Copyright (c) 2010-2011 Matthew Jack and Doug Binks
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
#include "ConsoleGame.h"
#include "../../RuntimeCompiler/AUArray.h"
#include "../../RuntimeCompiler/BuildTool.h"
#include "../../RuntimeCompiler/ICompilerLogger.h"
#include "../../RuntimeCompiler/FileChangeNotifier.h"
#include "../../RuntimeObjectSystem/IObjectFactorySystem.h"
#include "../../RuntimeObjectSystem/ObjectFactorySystem/ObjectFactorySystem.h"
#include "../../RuntimeObjectSystem/RuntimeObjectSystem.h"
#include "StdioLogSystem.h"
#include "../../RuntimeObjectSystem/IObject.h"
#include "IUpdateable.h"
#include "InterfaceIds.h"
#include <iostream>
#ifdef WIN32
#include <conio.h>
#include <tchar.h>
#else
#include <unistd.h>
int _getche()
{
int ret = getchar();
return ret;
}
int _kbhit()
{
std::cout << "This port needs a fix, CTRL-C to quit\n";
return 0;
}
int Sleep( int msecs )
{
return usleep( msecs * 1000);
}
#endif
#include <sstream>
#include <vector>
#include <algorithm>
#include <string>
#include <stdarg.h>
// Remove windows.h define of GetObject which conflicts with EntitySystem GetObject
#if defined _WINDOWS_ && defined GetObject
#undef GetObject
#endif
using FileSystemUtils::Path;
ConsoleGame::ConsoleGame()
: m_pCompilerLogger(0)
, m_pRuntimeObjectSystem(0)
, m_pUpdateable(0)
{
}
ConsoleGame::~ConsoleGame()
{
if( m_pRuntimeObjectSystem )
{
// clean temp object files
m_pRuntimeObjectSystem->CleanObjectFiles();
}
if( m_pRuntimeObjectSystem && m_pRuntimeObjectSystem->GetObjectFactorySystem() )
{
m_pRuntimeObjectSystem->GetObjectFactorySystem()->RemoveListener(this);
// delete object via correct interface
IObject* pObj = m_pRuntimeObjectSystem->GetObjectFactorySystem()->GetObject( m_ObjectId );
delete pObj;
}
delete m_pRuntimeObjectSystem;
delete m_pCompilerLogger;
}
bool ConsoleGame::Init()
{
//Initialise the RuntimeObjectSystem
m_pRuntimeObjectSystem = new RuntimeObjectSystem;
m_pCompilerLogger = new StdioLogSystem();
if( !m_pRuntimeObjectSystem->Initialise(m_pCompilerLogger, 0) )
{
m_pRuntimeObjectSystem = 0;
return false;
}
m_pRuntimeObjectSystem->GetObjectFactorySystem()->AddListener(this);
// construct first object
IObjectConstructor* pCtor = m_pRuntimeObjectSystem->GetObjectFactorySystem()->GetConstructor( "RuntimeObject01" );
if( pCtor )
{
IObject* pObj = pCtor->Construct();
pObj->GetInterface( &m_pUpdateable );
if( 0 == m_pUpdateable )
{
delete pObj;
m_pCompilerLogger->LogError("Error - no updateable interface found\n");
return false;
}
m_ObjectId = pObj->GetObjectId();
}
return true;
}
void ConsoleGame::OnConstructorsAdded()
{
// This could have resulted in a change of object pointer, so release old and get new one.
if( m_pUpdateable )
{
IObject* pObj = m_pRuntimeObjectSystem->GetObjectFactorySystem()->GetObject( m_ObjectId );
pObj->GetInterface( &m_pUpdateable );
if( 0 == m_pUpdateable )
{
delete pObj;
m_pCompilerLogger->LogError( "Error - no updateable interface found\n");
}
}
}
bool ConsoleGame::MainLoop()
{
//check status of any compile
if( m_pRuntimeObjectSystem->GetIsCompiledComplete() )
{
// load module when compile complete
m_pRuntimeObjectSystem->LoadCompiledModule();
}
if( !m_pRuntimeObjectSystem->GetIsCompiling() )
{
static int numUpdates = 0;
std::cout << "\nMain Loop - press q to quit. Updates every second. Update: " << numUpdates++ << "\n";
if( _kbhit() )
{
int ret = _getche();
if( 'q' == ret )
{
return false;
}
}
const float deltaTime = 1.0f;
m_pRuntimeObjectSystem->GetFileChangeNotifier()->Update( deltaTime );
m_pUpdateable->Update( deltaTime );
Sleep(1000);
}
return true;
}

64
uft_dev_server/third_party/RCCPP/Examples/ConsoleExample/ConsoleGame.h vendored

@ -0,0 +1,64 @@ @@ -0,0 +1,64 @@
//
// Copyright (c) 2010-2011 Matthew Jack and Doug Binks
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
#pragma once
#ifndef CONSOLEGAME_INCLUDED
#define CONSOLEGAME_INCLUDED
#include "../../RuntimeObjectSystem/IObjectFactorySystem.h"
#include "../../RuntimeObjectSystem/ObjectInterface.h"
#include "../../RuntimeCompiler/AUArray.h"
#ifndef _WIN32
int _getche();
#endif
struct IUpdateable;
struct IRuntimeObjectSystem;
class ConsoleGame : public IObjectFactoryListener
{
public:
ConsoleGame();
virtual ~ConsoleGame();
bool Init();
bool MainLoop();
// IObjectFactoryListener
virtual void OnConstructorsAdded();
// ~IObjectFactoryListener
private:
// Runtime Systems
ICompilerLogger* m_pCompilerLogger;
IRuntimeObjectSystem* m_pRuntimeObjectSystem;
// Runtime object
IUpdateable* m_pUpdateable;
ObjectId m_ObjectId;
};
#endif // CONSOLEGAME_INCLUDED

30
uft_dev_server/third_party/RCCPP/Examples/ConsoleExample/IUpdateable.h vendored

@ -0,0 +1,30 @@ @@ -0,0 +1,30 @@
//
// Copyright (c) 2010-2011 Matthew Jack and Doug Binks
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
#pragma once
#ifndef IUPDATEABLE_INCLUDED
#define IUPDATEABLE_INCLUDED
#include "../../RuntimeObjectSystem/IObject.h"
struct IUpdateable : public IObject
{
virtual void Update( float deltaTime ) = 0;
};
#endif // IUPDATEABLE_INCLUDED

41
uft_dev_server/third_party/RCCPP/Examples/ConsoleExample/InterfaceIds.h vendored

@ -0,0 +1,41 @@ @@ -0,0 +1,41 @@
//
// Copyright (c) 2010-2011 Matthew Jack and Doug Binks
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// InterfaceId header file.
//
// Specifys interface ids for getting hold of interfaces
//
////////////////////////////////////////////////////////////////////////////////////////////////////////
#pragma once
#ifndef INTERFACEIDS_INCLUDED
#define INTERFACEIDS_INCLUDED
#include "../../RuntimeObjectSystem/IObject.h"
enum InterfaceIDEnumConsoleExample
{
IID_IUPDATEABLE = IID_ENDInterfaceID,
IID_ENDInterfaceIDEnumConsoleExample
};
#endif //INTERFACEIDS_INCLUDED

18
uft_dev_server/third_party/RCCPP/Examples/ConsoleExample/RuntimeObject01.cpp vendored

@ -0,0 +1,18 @@ @@ -0,0 +1,18 @@
#include "../../RuntimeObjectSystem/ObjectInterfacePerModule.h"
#include "../../RuntimeObjectSystem/IObject.h"
#include "IUpdateable.h"
#include "InterfaceIds.h"
#include <iostream>
class RuntimeObject01 : public TInterface<IID_IUPDATEABLE,IUpdateable>
{
public:
virtual void Update( float deltaTime )
{
std::cout << "Runtime Object 01 update called!\n";
}
};
REGISTERCLASS(RuntimeObject01);

66
uft_dev_server/third_party/RCCPP/Examples/ConsoleExample/StdioLogSystem.cpp vendored

@ -0,0 +1,66 @@ @@ -0,0 +1,66 @@
//
// Copyright (c) 2010-2011 Matthew Jack and Doug Binks
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
#include "StdioLogSystem.h"
// Currently we create the file on first real output, and only close it on shutdown
#include <stdarg.h>
#include <assert.h>
#include <iostream>
#ifdef _WIN32
#include "../../RuntimeCompiler/FileSystemUtils.h"
#include "Windows.h"
#pragma warning( disable : 4996 4800 )
#endif
void StdioLogSystem::LogError(const char * format, ...)
{
va_list args;
va_start(args, format);
LogInternal(format, args);
}
void StdioLogSystem::LogWarning(const char * format, ...)
{
va_list args;
va_start(args, format);
LogInternal(format, args);
}
void StdioLogSystem::LogInfo(const char * format, ...)
{
va_list args;
va_start(args, format);
LogInternal(format, args);
}
void StdioLogSystem::LogInternal(const char * format, va_list args)
{
int result = vsnprintf(m_buff, LOGSYSTEM_MAX_BUFFER-1, format, args);
// Make sure there's a limit to the amount of rubbish we can output
m_buff[LOGSYSTEM_MAX_BUFFER-1] = '\0';
std::cout << m_buff;
#ifdef _WIN32
std::string temp = m_buff;
// convert from utf-8 to Wide char
std::wstring tempW = FileSystemUtils::_Win32Utf8ToUtf16( temp );
OutputDebugStringW( tempW.c_str() );
#endif
}

45
uft_dev_server/third_party/RCCPP/Examples/ConsoleExample/StdioLogSystem.h vendored

@ -0,0 +1,45 @@ @@ -0,0 +1,45 @@
//
// Copyright (c) 2010-2011 Matthew Jack and Doug Binks
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
#pragma once
#ifndef STDIOLOGSYSTEM_INCLUDED
#define STDIOLOGSYSTEM_INCLUDED
#include "../../RuntimeCompiler/ICompilerLogger.h"
#include <string>
#include <stdio.h>
// StdioLogSystem for compiler
const size_t LOGSYSTEM_MAX_BUFFER = 4096;
class StdioLogSystem : public ICompilerLogger
{
public:
virtual void LogError(const char * format, ...);
virtual void LogWarning(const char * format, ...);
virtual void LogInfo(const char * format, ...);
protected:
void LogInternal(const char * format, va_list args);
char m_buff[LOGSYSTEM_MAX_BUFFER];
};
#endif //STDIOLOGSYSTEM_INCLUDED

3
uft_dev_server/third_party/RCCPP/Examples/SimpleTest/.gitignore vendored

@ -0,0 +1,3 @@ @@ -0,0 +1,3 @@
# ignore this specific file because it's a runtime generated temp file
ConsoleContext.cpp
consolecontext.cpp

63
uft_dev_server/third_party/RCCPP/Examples/SimpleTest/BB_Global.h vendored

@ -0,0 +1,63 @@ @@ -0,0 +1,63 @@
//
// Copyright (c) 2010-2011 Matthew Jack and Doug Binks
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
#pragma once
#ifndef BB_GLOBAL_INCLUDED
#define BB_GLOBAL_INCLUDED
#include "../../RuntimeObjectSystem/RuntimeInclude.h"
RUNTIME_MODIFIABLE_INCLUDE; //adds this include to runtime tracking
#include "IBlackboard.h"
#include "../../RuntimeObjectSystem/ISimpleSerializer.h"
#include <assert.h>
struct BB_Global : public IBlackboard
{
BB_Global()
{
gameTimeElapsed = 0.0f;
immune_count = 0;
infection_count = 0;
immune_team_strength = 0;
infection_team_strength = 0;
}
virtual void Serialize(ISimpleSerializer *pSerializer)
{
AU_ASSERT(pSerializer);
SERIALIZE(gameTimeElapsed);
SERIALIZE(immune_count);
SERIALIZE(infection_count);
SERIALIZE(immune_team_strength);
SERIALIZE(infection_team_strength);
}
// Members
float gameTimeElapsed;
int immune_count;
int infection_count;
float immune_team_strength;
float infection_team_strength;
};
// Registered inside BlackboardManager.cpp
// REGISTERCLASS(BB_Global);
#endif // BB_GLOBAL_INCLUDED

52
uft_dev_server/third_party/RCCPP/Examples/SimpleTest/BB_Group_Infected.h vendored

@ -0,0 +1,52 @@ @@ -0,0 +1,52 @@
//
// Copyright (c) 2010-2011 Matthew Jack and Doug Binks
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
#pragma once
#ifndef BB_GROUP_INFECTED_INCLUDED
#define BB_GROUP_INFECTED_INCLUDED
#include "../../RuntimeObjectSystem/RuntimeInclude.h"
RUNTIME_MODIFIABLE_INCLUDE; //adds this include to runtime tracking
#include "IBlackboard.h"
#include "../../RuntimeObjectSystem/ISimpleSerializer.h"
#include <assert.h>
struct BB_Group_Infected : public IBlackboard
{
BB_Group_Infected()
{
group_size = 0;
}
virtual void Serialize(ISimpleSerializer *pSerializer)
{
AU_ASSERT(pSerializer);
SERIALIZE(group_size);
}
// Members
int group_size;
};
// Registered inside BlackboardManager.cpp
// REGISTERCLASS(BB_Group_Infected);
#endif // BB_GROUP_INFECTED_INCLUDED

52
uft_dev_server/third_party/RCCPP/Examples/SimpleTest/BB_Group_RBC.h vendored

@ -0,0 +1,52 @@ @@ -0,0 +1,52 @@
//
// Copyright (c) 2010-2011 Matthew Jack and Doug Binks
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
#pragma once
#ifndef BB_GROUP_RBC_INCLUDED
#define BB_GROUP_RBC_INCLUDED
#include "../../RuntimeObjectSystem/RuntimeInclude.h"
RUNTIME_MODIFIABLE_INCLUDE; //adds this include to runtime tracking
#include "IBlackboard.h"
#include "../../RuntimeObjectSystem/ISimpleSerializer.h"
#include <assert.h>
struct BB_Group_RBC : public IBlackboard
{
BB_Group_RBC()
{
group_size = 0;
}
virtual void Serialize(ISimpleSerializer *pSerializer)
{
AU_ASSERT(pSerializer);
SERIALIZE(group_size);
}
// Members
int group_size;
};
// Registered inside BlackboardManager.cpp
// REGISTERCLASS(BB_Group_RBC);
#endif // BB_GROUP_RBC_INCLUDED

51
uft_dev_server/third_party/RCCPP/Examples/SimpleTest/BB_Group_Virus.h vendored

@ -0,0 +1,51 @@ @@ -0,0 +1,51 @@
//
// Copyright (c) 2010-2011 Matthew Jack and Doug Binks
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
#pragma once
#ifndef BB_GROUP_VIRUS_INCLUDED
#define BB_GROUP_VIRUS_INCLUDED
#include "../../RuntimeObjectSystem/RuntimeInclude.h"
RUNTIME_MODIFIABLE_INCLUDE; //adds this include to runtime tracking
#include "IBlackboard.h"
#include "../../RuntimeObjectSystem/ISimpleSerializer.h"
#include <assert.h>
struct BB_Group_Virus : public IBlackboard
{
BB_Group_Virus()
{
group_size = 0;
}
virtual void Serialize(ISimpleSerializer *pSerializer)
{
AU_ASSERT(pSerializer);
SERIALIZE(group_size);
}
// Members
int group_size;
};
// Registered inside BlackboardManager.cpp
// REGISTERCLASS(BB_Group_Virus);
#endif // BB_GROUP_VIRUS_INCLUDED

52
uft_dev_server/third_party/RCCPP/Examples/SimpleTest/BB_Group_WBC.h vendored

@ -0,0 +1,52 @@ @@ -0,0 +1,52 @@
//
// Copyright (c) 2010-2011 Matthew Jack and Doug Binks
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
#pragma once
#ifndef BB_GROUP_WBC_INCLUDED
#define BB_GROUP_WBC_INCLUDED
#include "../../RuntimeObjectSystem/RuntimeInclude.h"
RUNTIME_MODIFIABLE_INCLUDE; //adds this include to runtime tracking
#include "IBlackboard.h"
#include "../../RuntimeObjectSystem/ISimpleSerializer.h"
#include <assert.h>
struct BB_Group_WBC : public IBlackboard
{
BB_Group_WBC()
{
group_size = 0;
}
virtual void Serialize(ISimpleSerializer *pSerializer)
{
AU_ASSERT(pSerializer);
SERIALIZE(group_size);
}
// Members
int group_size;
};
// Registered inside BlackboardManager.cpp
// REGISTERCLASS(BB_Group_WBC);
#endif // BB_GROUP_WBC_INCLUDED

69
uft_dev_server/third_party/RCCPP/Examples/SimpleTest/BB_Individual_Common.h vendored

@ -0,0 +1,69 @@ @@ -0,0 +1,69 @@
//
// Copyright (c) 2010-2011 Matthew Jack and Doug Binks
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
#pragma once
#ifndef BB_INDIVIDUAL_COMMON_INCLUDED
#define BB_INDIVIDUAL_COMMON_INCLUDED
#include "../../RuntimeObjectSystem/RuntimeInclude.h"
RUNTIME_MODIFIABLE_INCLUDE; //adds this include to runtime tracking
#include "IBlackboard.h"
#include "../../Common/AUVec3f.inl"
#include "../../RuntimeObjectSystem/ISimpleSerializer.h"
#include <assert.h>
struct BB_Individual_Common : public IBlackboard
{
BB_Individual_Common()
{
current_health = 0;
max_speed = 0;
target_position.SetInfinite();
time_to_next_attack = 0.0f;
}
virtual void Serialize(ISimpleSerializer *pSerializer)
{
AU_ASSERT(pSerializer);
SERIALIZE(current_health);
SERIALIZE(max_speed);
SERIALIZE(current_velocity);
SERIALIZE(current_position);
SERIALIZE(target_position);
SERIALIZE(enemy_collision_objectid);
SERIALIZE(time_to_next_attack);
}
// Members
float current_health;
float max_speed;
AUVec3f current_velocity;
AUVec3f current_position;
AUVec3f target_position; // Infinity if none
ObjectId enemy_collision_objectid; // 0 if none
float time_to_next_attack;
};
// Registered inside BlackboardManager.cpp
// REGISTERCLASS(BB_Individual_Common);
#endif // BB_INDIVIDUAL_COMMON_INCLUDED

58
uft_dev_server/third_party/RCCPP/Examples/SimpleTest/BB_Individual_Infected.h vendored

@ -0,0 +1,58 @@ @@ -0,0 +1,58 @@
//
// Copyright (c) 2010-2011 Matthew Jack and Doug Binks
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
#pragma once
#ifndef BB_INDIVIDUAL_INFECTED_INCLUDED
#define BB_INDIVIDUAL_INFECTED_INCLUDED
#include "../../RuntimeObjectSystem/RuntimeInclude.h"
RUNTIME_MODIFIABLE_INCLUDE; //adds this include to runtime tracking
#include "IBlackboard.h"
#include "../../RuntimeObjectSystem/ISimpleSerializer.h"
#include <assert.h>
struct BB_Individual_Infected : public IBlackboard
{
BB_Individual_Infected()
{
patrol_change_frequency = 10.0f;
}
virtual void Serialize(ISimpleSerializer *pSerializer)
{
AU_ASSERT(pSerializer);
SERIALIZE(visible_wbc);
SERIALIZE(visible_rbc);
SERIALIZE(patrol_change_frequency);
}
// Members
AUDynArray<ObjectId> visible_wbc;
AUDynArray<ObjectId> visible_rbc;
float patrol_change_frequency;
};
// Registered inside BlackboardManager.cpp
// REGISTERCLASS(BB_Individual_Infected);
#endif // BB_INDIVIDUAL_INFECTED_INCLUDED

60
uft_dev_server/third_party/RCCPP/Examples/SimpleTest/BB_Individual_RBC.h vendored

@ -0,0 +1,60 @@ @@ -0,0 +1,60 @@
//
// Copyright (c) 2010-2011 Matthew Jack and Doug Binks
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
#pragma once
#ifndef BB_INDIVIDUAL_RBC_INCLUDED
#define BB_INDIVIDUAL_RBC_INCLUDED
#include "../../RuntimeObjectSystem/RuntimeInclude.h"
RUNTIME_MODIFIABLE_INCLUDE; //adds this include to runtime tracking
#include "IBlackboard.h"
#include "../../RuntimeObjectSystem/ISimpleSerializer.h"
#include <assert.h>
struct BB_Individual_RBC : public IBlackboard
{
BB_Individual_RBC()
{
// Init members here
}
virtual void Serialize(ISimpleSerializer *pSerializer)
{
AU_ASSERT(pSerializer);
// Serialize members here
//SERIALIZE(visible_dangerous); // Demo [Tutorial03]
}
// Members
//AUDynArray<ObjectId> visible_dangerous; // Demo [Tutorial03]
};
// Registered inside BlackboardManager.cpp
// REGISTERCLASS(BB_Individual_RBC);
#endif // BB_INDIVIDUAL_RBC_INCLUDED

58
uft_dev_server/third_party/RCCPP/Examples/SimpleTest/BB_Individual_Virus.h vendored

@ -0,0 +1,58 @@ @@ -0,0 +1,58 @@
//
// Copyright (c) 2010-2011 Matthew Jack and Doug Binks
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
#pragma once
#ifndef BB_INDIVIDUAL_VIRUS_INCLUDED
#define BB_INDIVIDUAL_VIRUS_INCLUDED
#include "../../RuntimeObjectSystem/RuntimeInclude.h"
RUNTIME_MODIFIABLE_INCLUDE; //adds this include to runtime tracking
#include "IBlackboard.h"
#include "../../RuntimeObjectSystem/ISimpleSerializer.h"
#include <assert.h>
struct BB_Individual_Virus : public IBlackboard
{
BB_Individual_Virus()
{
patrol_change_frequency = 10.0f;
}
virtual void Serialize(ISimpleSerializer *pSerializer)
{
AU_ASSERT(pSerializer);
SERIALIZE(visible_wbc);
SERIALIZE(visible_rbc);
SERIALIZE(patrol_change_frequency);
}
// Members
AUDynArray<ObjectId> visible_wbc;
AUDynArray<ObjectId> visible_rbc;
float patrol_change_frequency;
};
// Registered inside BlackboardManager.cpp
// REGISTERCLASS(BB_Individual_Virus);
#endif // BB_INDIVIDUAL_VIRUS_INCLUDED

58
uft_dev_server/third_party/RCCPP/Examples/SimpleTest/BB_Individual_WBC.h vendored

@ -0,0 +1,58 @@ @@ -0,0 +1,58 @@
//
// Copyright (c) 2010-2011 Matthew Jack and Doug Binks
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
#pragma once
#ifndef BB_INDIVIDUAL_WBC_INCLUDED
#define BB_INDIVIDUAL_WBC_INCLUDED
#include "../../RuntimeObjectSystem/RuntimeInclude.h"
RUNTIME_MODIFIABLE_INCLUDE; //adds this include to runtime tracking
#include "IBlackboard.h"
#include "../../RuntimeObjectSystem/ISimpleSerializer.h"
#include <assert.h>
struct BB_Individual_WBC : public IBlackboard
{
BB_Individual_WBC()
{
patrol_change_frequency = 10.0f;
}
virtual void Serialize(ISimpleSerializer *pSerializer)
{
AU_ASSERT(pSerializer);
SERIALIZE(visible_viruses);
SERIALIZE(visible_infected);
SERIALIZE(patrol_change_frequency);
}
// Members
AUDynArray<ObjectId> visible_viruses;
AUDynArray<ObjectId> visible_infected;
float patrol_change_frequency;
};
// Registered inside BlackboardManager.cpp
// REGISTERCLASS(BB_Individual_WBC);
#endif // BB_INDIVIDUAL_WBC_INCLUDED

52
uft_dev_server/third_party/RCCPP/Examples/SimpleTest/BB_Team_Immune.h vendored

@ -0,0 +1,52 @@ @@ -0,0 +1,52 @@
//
// Copyright (c) 2010-2011 Matthew Jack and Doug Binks
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
#pragma once
#ifndef BB_TEAM_IMMUNE_INCLUDED
#define BB_TEAM_IMMUNE_INCLUDED
#include "../../RuntimeObjectSystem/RuntimeInclude.h"
RUNTIME_MODIFIABLE_INCLUDE; //adds this include to runtime tracking
#include "IBlackboard.h"
#include "../../RuntimeObjectSystem/ISimpleSerializer.h"
#include <assert.h>
struct BB_Team_Immune : public IBlackboard
{
BB_Team_Immune()
{
team_size = 0;
}
virtual void Serialize(ISimpleSerializer *pSerializer)
{
AU_ASSERT(pSerializer);
SERIALIZE(team_size);
}
// Members
int team_size;
};
// Registered inside BlackboardManager.cpp
// REGISTERCLASS(BB_Team_Immune);
#endif // BB_TEAM_IMMUNE_INCLUDED

52
uft_dev_server/third_party/RCCPP/Examples/SimpleTest/BB_Team_Infection.h vendored

@ -0,0 +1,52 @@ @@ -0,0 +1,52 @@
//
// Copyright (c) 2010-2011 Matthew Jack and Doug Binks
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
#pragma once
#ifndef BB_TEAM_INFECTION_INCLUDED
#define BB_TEAM_INFECTION_INCLUDED
#include "../../RuntimeObjectSystem/RuntimeInclude.h"
RUNTIME_MODIFIABLE_INCLUDE; //adds this include to runtime tracking
#include "IBlackboard.h"
#include "../../RuntimeObjectSystem/ISimpleSerializer.h"
#include <assert.h>
struct BB_Team_Infection : public IBlackboard
{
BB_Team_Infection()
{
team_size = 0;
}
virtual void Serialize(ISimpleSerializer *pSerializer)
{
AU_ASSERT(pSerializer);
SERIALIZE(team_size);
}
// Members
int team_size;
};
// Registered inside BlackboardManager.cpp
// REGISTERCLASS(BB_Team_Infection);
#endif // BB_TEAM_INFECTION_INCLUDED

213
uft_dev_server/third_party/RCCPP/Examples/SimpleTest/BehaviorCommon.h vendored

@ -0,0 +1,213 @@ @@ -0,0 +1,213 @@
//
// Copyright (c) 2010-2011 Matthew Jack and Doug Binks
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
#pragma once
#ifndef BEHAVIORCOMMON_INCLUDED
#define BEHAVIORCOMMON_INCLUDED
#include "../../RuntimeObjectSystem/RuntimeInclude.h"
RUNTIME_MODIFIABLE_INCLUDE; //adds this include to runtime tracking
#include "IBehavior.h"
#include "IObjectUtils.h"
#include "IGameObject.h"
#include "IGameManager.h"
#include "IPerceptionManager.h"
#include "IBlackboardManager.h"
#include "IPhysicsManager.h"
#include "GlobalParameters.h"
#include "IObjectUtils.h"
#include "BB_Global.h"
#include "BB_Individual_Common.h"
#include "../../RuntimeObjectSystem/ObjectInterfacePerModule.h"
#include "../../Systems/SystemTable.h"
#include "../../Systems/IEntitySystem.h"
#include "../../Systems/IAssetSystem.h"
#include "../../Systems/ILogSystem.h"
#include "../../RuntimeObjectSystem/ISimpleSerializer.h"
#include <assert.h>
#include <algorithm>
class BehaviorCommon : public IBehavior
{
public:
BehaviorCommon()
: m_pOwner(0)
, m_pGameManager(0)
, m_pPerception(0)
, m_pPhysics(0)
, m_pGlobalParameters(0)
, m_pGameObjectParams(0)
, m_pBBGlobal(0)
, m_pBBCommon(0)
{
}
// IObject
virtual void Serialize(ISimpleSerializer *pSerializer)
{
SERIALIZEIOBJPTR(m_pOwner);
}
virtual void Init( bool isFirstInit )
{
m_pGameManager = (IGameManager*)IObjectUtils::GetUniqueInterface( "GameManager", IID_IGAMEMANAGER );
m_pPerception = (IPerceptionManager*)IObjectUtils::GetUniqueInterface( "PerceptionManager", IID_IPERCEPTIONMANAGER );
m_pPhysics = (IPhysicsManager*)IObjectUtils::GetUniqueInterface( "PhysicsManager", IID_IPHYSICSMANAGER );
m_pGlobalParameters = m_pGameManager->GetGlobalParameters();
if (m_pOwner)
{
if (m_pOwner->GetBehavior() != this)
{
// We've become orphaned, so delete ourselves
delete this;
}
else
{
InitGameObjectSpecificPointers();
}
}
}
// ~IObject
// IBehavior
virtual void StartBehavior() {}
virtual void EndBehavior() {}
virtual void Update( float timeDelta )
{
UpdatePerception(timeDelta);
UpdateBlackboards(timeDelta);
UpdateBehavior(timeDelta);
AUVec3f desiredPosition = CalculateDesiredPosition(timeDelta);
UpdatePosition(desiredPosition, timeDelta);
}
virtual AUVec3f CalculateDesiredPosition( float timeDelta )
{
return m_pOwner->GetEntity()->GetPosition();
}
virtual void OnCollision( IGameObject* pCollider )
{
if (pCollider->GetGameTeam() != m_pOwner->GetGameTeam())
{
m_pBBCommon->enemy_collision_objectid = pCollider->GetObjectId();
}
}
virtual float ReceiveDamage( float fAmount )
{
m_pBBCommon->current_health -= fAmount;
if ( m_pBBCommon->current_health <= 0.0f )
{
m_pGameManager->DestroyGameObject( m_pOwner->GetObjectId() );
return 0.0f;
}
return m_pBBCommon->current_health;
}
virtual void SetGameObject( IGameObject* pOwner )
{
m_pOwner = pOwner;
if (m_pOwner)
{
InitGameObjectSpecificPointers();
}
}
// ~IBehavior
protected:
virtual void InitGameObjectSpecificPointers()
{
IBlackboardManager* m_pBBManager = (IBlackboardManager*)IObjectUtils::GetUniqueInterface( "BlackboardManager", IID_IBLACKBOARDMANAGER );
m_pBBGlobal = (BB_Global*)m_pBBManager->GetBlackboardGlobal();
m_pBBCommon = (BB_Individual_Common*)m_pBBManager->GetBlackboardIndividualCommon( m_pOwner );
m_pGameObjectParams = &(m_pGlobalParameters->go[m_pOwner->GetGameObjectType()]);
}
void UpdatePosition( const AUVec3f& desiredPosition, float timeDelta )
{
AUVec3f currentPosition = m_pOwner->GetEntity()->GetPosition();
AUVec3f dir = desiredPosition - currentPosition;
float dist = dir.Magnitude();
if (dist > 0.0f)
{
dir /= dist;
}
dist = std::min( m_pBBCommon->max_speed * timeDelta, dist );
AUVec3f requestPos = currentPosition + dir * dist;
m_pPhysics->RequestPositionUpdate( m_pOwner, requestPos, timeDelta );
const AUVec3f& newPosition = m_pOwner->GetEntity()->GetPosition();
m_pBBCommon->current_position = newPosition;
m_pBBCommon->current_velocity = (newPosition - currentPosition) / timeDelta;
}
void GetClosestTarget( const AUDynArray<ObjectId>& list, const AUVec3f& refPos, float& dist, IGameObject** pTarget )
{
for (size_t i=0; i<list.Size(); ++i)
{
IGameObject* pTest = 0;
IObjectUtils::GetObject( &pTest, list[i] );
if (pTest)
{
float testDist = (refPos - pTest->GetEntity()->GetPosition()).MagnitudeSqr();
if (testDist < dist)
{
dist = testDist;
*pTarget = pTest;
}
}
}
}
// Protected Members
IGameObject* m_pOwner;
IGameManager* m_pGameManager;
IPerceptionManager* m_pPerception;
IPhysicsManager* m_pPhysics;
GlobalParameters* m_pGlobalParameters;
GameObjectParams* m_pGameObjectParams;
BB_Global* m_pBBGlobal;
BB_Individual_Common* m_pBBCommon;
};
#endif // BEHAVIORCOMMON_INCLUDED

138
uft_dev_server/third_party/RCCPP/Examples/SimpleTest/BehaviorTreeManager.cpp vendored

@ -0,0 +1,138 @@ @@ -0,0 +1,138 @@
//
// Copyright (c) 2010-2011 Matthew Jack and Doug Binks
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
#include "IBehaviorTreeManager.h"
#include "IBehaviorTree.h"
#include "IObjectUtils.h"
#include "../../RuntimeObjectSystem/ObjectInterfacePerModule.h"
#include "../../Systems/SystemTable.h"
#include "../../Systems/IEntitySystem.h"
#include "../../Systems/IAssetSystem.h"
#include "../../Systems/ILogSystem.h"
#include "../../RuntimeObjectSystem/ISimpleSerializer.h"
#include <assert.h>
#include <map>
#include <string>
class BehaviorTreeManager : public IBehaviorTreeManager
{
public:
BehaviorTreeManager()
{
}
virtual ~BehaviorTreeManager()
{
if( m_pEntity )
{
m_pEntity->SetUpdateable(NULL);
}
if (!IsRuntimeDelete())
{
DestroyAllTrees();
}
}
// IEntityObject
virtual void Serialize(ISimpleSerializer *pSerializer)
{
AU_ASSERT(pSerializer);
IEntityObject::Serialize(pSerializer);
SERIALIZE(m_trees);
}
virtual void Init( bool isFirstInit )
{
m_pEntity->SetUpdateable( this );
}
// ~IEntityObject
// IAUUpdateable
virtual void Update( float deltaTime )
{
// Do nothing for now
}
// ~IAUUpdateable
// IBehaviorTreeManager
virtual IBehaviorTree* GetTree( const char* name )
{
IBehaviorTree* pTree = NULL;
TTreeMap::iterator it = m_trees.find(name);
if (it != m_trees.end())
{
IObjectUtils::GetObject( &pTree, it->second );
}
else
{
IObject* pObj = IObjectUtils::CreateUniqueObject( name );
if (pObj)
{
IObjectUtils::GetObject( &pTree, pObj->GetObjectId() );
}
if (pTree)
{
m_trees[name] = pTree->GetObjectId();
}
}
return pTree;
}
// ~IBehaviorTreeManager
private:
void DestroyAllTrees()
{
IObjectFactorySystem* pFactory = PerModuleInterface::g_pSystemTable->pObjectFactorySystem;
TTreeMap::iterator it = m_trees.begin();
TTreeMap::iterator itEnd = m_trees.end();
while (it != itEnd)
{
IObject* pObj = pFactory->GetObject(it->second);
delete pObj;
++it;
}
}
// Private Members
typedef std::map<std::string, ObjectId> TTreeMap;
TTreeMap m_trees;
};
REGISTERCLASS(BehaviorTreeManager);

92
uft_dev_server/third_party/RCCPP/Examples/SimpleTest/BehaviorTree_Infected.cpp vendored

@ -0,0 +1,92 @@ @@ -0,0 +1,92 @@
//
// Copyright (c) 2010-2011 Matthew Jack and Doug Binks
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
#include "IBehaviorTree.h"
#include "IGameObject.h"
#include "IBlackboard.h"
#include "IBlackboardManager.h"
#include "IObjectUtils.h"
#include "BB_Global.h"
#include "BB_Team_Infection.h"
#include "BB_Group_Infected.h"
#include "BB_Individual_Infected.h"
#include "BB_Individual_Common.h"
#include "../../RuntimeObjectSystem/ObjectInterfacePerModule.h"
#include "../../Systems/SystemTable.h"
#include "../../Systems/IEntitySystem.h"
#include "../../Systems/IAssetSystem.h"
#include "../../Systems/ILogSystem.h"
#include "../../RuntimeObjectSystem/ISimpleSerializer.h"
#include <assert.h>
class BehaviorTree_Infected : public IBehaviorTree
{
public:
virtual void Execute( IGameObject* pGameObject )
{
BB_Global* pBBGlobal = (BB_Global*)m_pBBManager->GetBlackboardGlobal();
BB_Group_Infected* pBBGroup = (BB_Group_Infected*)m_pBBManager->GetBlackboardGroup( pGameObject->GetGameObjectType() );
BB_Individual_Common* pBBCommon = (BB_Individual_Common*)m_pBBManager->GetBlackboardIndividualCommon( pGameObject );
if ( pBBCommon->enemy_collision_objectid.IsValid() )
{
pGameObject->SetBehavior( m_Behavior_Infected_Combat );
}
else if ( !pBBCommon->target_position.IsInfinite() )
{
pGameObject->SetBehavior( m_Behavior_Infected_Approach );
}
else if ( pBBGlobal->infection_team_strength > pBBGlobal->immune_team_strength * 1.2f && pBBGroup->group_size > 1 )
{
pGameObject->SetBehavior( m_Behavior_Infected_HuntWBC );
}
else if ( pBBGlobal->immune_count > 0 )
{
pGameObject->SetBehavior( m_Behavior_Infected_HuntRBC );
}
else
{
pGameObject->SetBehavior( m_Behavior_Infected_Idle );
}
}
virtual void Init( bool isFirstInit )
{
m_pBBManager = (IBlackboardManager*)IObjectUtils::GetUniqueInterface( "BlackboardManager", IID_IBLACKBOARDMANAGER );
m_Behavior_Infected_Combat = IObjectUtils::GetConstructorId( "Behavior_Infected_Combat" );
m_Behavior_Infected_Approach = IObjectUtils::GetConstructorId( "Behavior_Infected_Approach" );
m_Behavior_Infected_HuntWBC = IObjectUtils::GetConstructorId( "Behavior_Infected_HuntWBC" );
m_Behavior_Infected_HuntRBC = IObjectUtils::GetConstructorId( "Behavior_Infected_HuntRBC" );
m_Behavior_Infected_Idle = IObjectUtils::GetConstructorId( "Behavior_Infected_Idle" );
}
private:
IBlackboardManager* m_pBBManager;
ConstructorId m_Behavior_Infected_Combat;
ConstructorId m_Behavior_Infected_Approach;
ConstructorId m_Behavior_Infected_HuntWBC;
ConstructorId m_Behavior_Infected_HuntRBC;
ConstructorId m_Behavior_Infected_Idle;
};
REGISTERCLASS(BehaviorTree_Infected);

87
uft_dev_server/third_party/RCCPP/Examples/SimpleTest/BehaviorTree_RBC.cpp vendored

@ -0,0 +1,87 @@ @@ -0,0 +1,87 @@
//
// Copyright (c) 2010-2011 Matthew Jack and Doug Binks
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
#include "IBehaviorTree.h"
#include "IGameObject.h"
#include "IBlackboard.h"
#include "IBlackboardManager.h"
#include "IObjectUtils.h"
#include "BB_Global.h"
#include "BB_Team_Immune.h"
#include "BB_Group_RBC.h"
#include "BB_Individual_RBC.h"
#include "BB_Individual_Common.h"
#include "../../RuntimeObjectSystem/ObjectInterfacePerModule.h"
#include "../../Systems/SystemTable.h"
#include "../../Systems/IEntitySystem.h"
#include "../../Systems/IAssetSystem.h"
#include "../../Systems/ILogSystem.h"
#include "../../RuntimeObjectSystem/ISimpleSerializer.h"
#include <assert.h>
class BehaviorTree_RBC : public IBehaviorTree
{
public:
virtual void Execute( IGameObject* pGameObject )
{
BB_Individual_RBC* pBBIndividual = (BB_Individual_RBC*)m_pBBManager->GetBlackboardIndividual( pGameObject );
BB_Individual_Common* pBBCommon = (BB_Individual_Common*)m_pBBManager->GetBlackboardIndividualCommon( pGameObject );
if ( pBBCommon->enemy_collision_objectid.IsValid() )
{
pGameObject->SetBehavior( m_Behavior_RBC_Combat );
}
else if ( !pBBCommon->target_position.IsInfinite() )
{
pGameObject->SetBehavior( m_Behavior_RBC_Approach );
}
/* Demo [Tutorial03]
else if ( pBBIndividual->visible_dangerous.Size() > 0 )
{
pGameObject->SetBehavior( m_Behavior_RBC_Evade );
}
//*/
else
{
pGameObject->SetBehavior( m_Behavior_RBC_Idle );
}
}
virtual void Init( bool isFirstInit )
{
m_pBBManager = (IBlackboardManager*)IObjectUtils::GetUniqueInterface( "BlackboardManager", IID_IBLACKBOARDMANAGER );
m_Behavior_RBC_Combat = IObjectUtils::GetConstructorId( "Behavior_RBC_Combat" );
m_Behavior_RBC_Approach = IObjectUtils::GetConstructorId( "Behavior_RBC_Approach" );
// m_Behavior_RBC_Evade = IObjectUtils::GetConstructorId( "Behavior_RBC_Evade" ); /// Demo [Tutorial03]
m_Behavior_RBC_Idle = IObjectUtils::GetConstructorId( "Behavior_RBC_Idle" );
}
private:
IBlackboardManager* m_pBBManager;
ConstructorId m_Behavior_RBC_Combat;
ConstructorId m_Behavior_RBC_Approach;
// ConstructorId m_Behavior_RBC_Evade; /// Demo [Tutorial03]
ConstructorId m_Behavior_RBC_Idle;
};
REGISTERCLASS(BehaviorTree_RBC);

94
uft_dev_server/third_party/RCCPP/Examples/SimpleTest/BehaviorTree_Virus.cpp vendored

@ -0,0 +1,94 @@ @@ -0,0 +1,94 @@
//
// Copyright (c) 2010-2011 Matthew Jack and Doug Binks
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
#include "IBehaviorTree.h"
#include "IGameObject.h"
#include "IBlackboard.h"
#include "IBlackboardManager.h"
#include "IObjectUtils.h"
#include "BB_Global.h"
#include "BB_Team_Infection.h"
#include "BB_Group_Virus.h"
#include "BB_Individual_Virus.h"
#include "BB_Individual_Common.h"
#include "../../RuntimeObjectSystem/ObjectInterfacePerModule.h"
#include "../../Systems/SystemTable.h"
#include "../../Systems/IEntitySystem.h"
#include "../../Systems/IAssetSystem.h"
#include "../../Systems/ILogSystem.h"
#include "../../RuntimeObjectSystem/ISimpleSerializer.h"
#include <assert.h>
class BehaviorTree_Virus : public IBehaviorTree
{
public:
virtual void Execute( IGameObject* pGameObject )
{
BB_Global* pBBGlobal = (BB_Global*)m_pBBManager->GetBlackboardGlobal();
BB_Team_Infection* pBBTeam = (BB_Team_Infection*)m_pBBManager->GetBlackboardTeam( pGameObject->GetGameTeam() );
BB_Group_Virus* pBBGroup = (BB_Group_Virus*)m_pBBManager->GetBlackboardGroup( pGameObject->GetGameObjectType() );
BB_Individual_Virus* pBBIndividual = (BB_Individual_Virus*)m_pBBManager->GetBlackboardIndividual( pGameObject );
BB_Individual_Common* pBBCommon = (BB_Individual_Common*)m_pBBManager->GetBlackboardIndividualCommon( pGameObject );
if ( pBBCommon->enemy_collision_objectid.IsValid() )
{
pGameObject->SetBehavior( m_Behavior_Virus_Combat );
}
else if ( !pBBCommon->target_position.IsInfinite() )
{
pGameObject->SetBehavior( m_Behavior_Virus_Approach );
}
else if ( pBBGlobal->infection_team_strength > pBBGlobal->immune_team_strength * 1.2f && pBBGlobal->infection_count > 3 )
{
pGameObject->SetBehavior( m_Behavior_Virus_HuntWBC );
}
else if ( pBBGlobal->immune_count > 0 )
{
pGameObject->SetBehavior( m_Behavior_Virus_HuntRBC );
}
else
{
pGameObject->SetBehavior( m_Behavior_Virus_Idle );
}
}
virtual void Init( bool isFirstInit )
{
m_pBBManager = (IBlackboardManager*)IObjectUtils::GetUniqueInterface( "BlackboardManager", IID_IBLACKBOARDMANAGER );
m_Behavior_Virus_Combat = IObjectUtils::GetConstructorId( "Behavior_Virus_Combat" );
m_Behavior_Virus_Approach = IObjectUtils::GetConstructorId( "Behavior_Virus_Approach" );
m_Behavior_Virus_HuntWBC = IObjectUtils::GetConstructorId( "Behavior_Virus_HuntWBC" );
m_Behavior_Virus_HuntRBC = IObjectUtils::GetConstructorId( "Behavior_Virus_HuntRBC" );
m_Behavior_Virus_Idle = IObjectUtils::GetConstructorId( "Behavior_Virus_Idle" );
}
private:
IBlackboardManager* m_pBBManager;
ConstructorId m_Behavior_Virus_Combat;
ConstructorId m_Behavior_Virus_Approach;
ConstructorId m_Behavior_Virus_HuntWBC;
ConstructorId m_Behavior_Virus_HuntRBC;
ConstructorId m_Behavior_Virus_Idle;
};
REGISTERCLASS(BehaviorTree_Virus);

92
uft_dev_server/third_party/RCCPP/Examples/SimpleTest/BehaviorTree_WBC.cpp vendored

@ -0,0 +1,92 @@ @@ -0,0 +1,92 @@
//
// Copyright (c) 2010-2011 Matthew Jack and Doug Binks
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
#include "IBehaviorTree.h"
#include "IGameObject.h"
#include "IBlackboard.h"
#include "IBlackboardManager.h"
#include "IObjectUtils.h"
#include "BB_Global.h"
#include "BB_Team_Immune.h"
#include "BB_Group_WBC.h"
#include "BB_Individual_WBC.h"
#include "BB_Individual_Common.h"
#include "../../RuntimeObjectSystem/ObjectInterfacePerModule.h"
#include "../../Systems/SystemTable.h"
#include "../../Systems/IEntitySystem.h"
#include "../../Systems/IAssetSystem.h"
#include "../../Systems/ILogSystem.h"
#include "../../RuntimeObjectSystem/ISimpleSerializer.h"
#include <assert.h>
class BehaviorTree_WBC : public IBehaviorTree
{
public:
virtual void Execute( IGameObject* pGameObject )
{
BB_Global* pBBGlobal = (BB_Global*)m_pBBManager->GetBlackboardGlobal();
BB_Team_Immune* pBBTeam = (BB_Team_Immune*)m_pBBManager->GetBlackboardTeam( pGameObject->GetGameTeam() );
BB_Group_WBC* pBBGroup = (BB_Group_WBC*)m_pBBManager->GetBlackboardGroup( pGameObject->GetGameObjectType() );
BB_Individual_WBC* pBBIndividual = (BB_Individual_WBC*)m_pBBManager->GetBlackboardIndividual( pGameObject );
BB_Individual_Common* pBBCommon = (BB_Individual_Common*)m_pBBManager->GetBlackboardIndividualCommon( pGameObject );
if ( pBBCommon->enemy_collision_objectid.IsValid() )
{
pGameObject->SetBehavior( m_Behavior_WBC_Combat );
}
else if ( !pBBCommon->target_position.IsInfinite() )
{
pGameObject->SetBehavior( m_Behavior_WBC_Approach );
}
else if ( pBBGlobal->infection_count > 0 )
{
pGameObject->SetBehavior( m_Behavior_WBC_Patrol );
}
else
{
pGameObject->SetBehavior( m_Behavior_WBC_Idle );
}
}
virtual void Init( bool isFirstInit )
{
m_pBBManager = (IBlackboardManager*)IObjectUtils::GetUniqueInterface( "BlackboardManager", IID_IBLACKBOARDMANAGER );
m_Behavior_WBC_Combat = IObjectUtils::GetConstructorId( "Behavior_WBC_Combat" );
m_Behavior_WBC_Approach = IObjectUtils::GetConstructorId( "Behavior_WBC_Approach" );
m_Behavior_WBC_Patrol = IObjectUtils::GetConstructorId( "Behavior_WBC_Patrol" );
m_Behavior_WBC_Idle = IObjectUtils::GetConstructorId( "Behavior_WBC_Idle" );
}
private:
IBlackboardManager* m_pBBManager;
ConstructorId m_Behavior_WBC_Combat;
ConstructorId m_Behavior_WBC_Approach;
ConstructorId m_Behavior_WBC_Patrol;
ConstructorId m_Behavior_WBC_Idle;
};
REGISTERCLASS(BehaviorTree_WBC);

60
uft_dev_server/third_party/RCCPP/Examples/SimpleTest/Behavior_Infected_Approach.cpp vendored

@ -0,0 +1,60 @@ @@ -0,0 +1,60 @@
//
// Copyright (c) 2010-2011 Matthew Jack and Doug Binks
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
#include "Behavior_Infected_Base.h"
class Behavior_Infected_Approach : public Behavior_Infected_Base
{
public:
virtual void EndBehavior()
{
m_pBBCommon->target_position.SetInfinite();
}
virtual void UpdateBehavior( float timeDelta )
{
if ( !m_pBBCommon->target_position.IsInfinite() )
{
AUVec3f targetVec = m_pBBCommon->target_position - m_pBBCommon->current_position;
float distSqr = targetVec.MagnitudeSqr();
if ( distSqr < 1.0f )
{
m_pBBCommon->target_position.SetInfinite();
}
}
}
virtual AUVec3f CalculateDesiredPosition( float timeDelta )
{
AUVec3f pos = m_pOwner->GetEntity()->GetPosition();
if ( !m_pBBCommon->target_position.IsInfinite() )
{
AUVec3f targetVec = m_pBBCommon->target_position - m_pBBCommon->current_position;
AUVec3f targetDir = targetVec.GetNormalised();
float dist = std::min( targetVec.Magnitude(), m_pOwner->GetMaxSpeed() * timeDelta );
pos += targetDir * dist;
}
return pos;
}
};
REGISTERCLASS(Behavior_Infected_Approach);

76
uft_dev_server/third_party/RCCPP/Examples/SimpleTest/Behavior_Infected_Base.h vendored

@ -0,0 +1,76 @@ @@ -0,0 +1,76 @@
//
// Copyright (c) 2010-2011 Matthew Jack and Doug Binks
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
#pragma once
#ifndef BEHAVIOR_INFECTED_BASE_INCLUDED
#define BEHAVIOR_INFECTED_BASE_INCLUDED
#include "../../RuntimeObjectSystem/RuntimeInclude.h"
RUNTIME_MODIFIABLE_INCLUDE; //adds this include to runtime tracking
#include "BehaviorCommon.h"
#include "BB_Team_Infection.h"
#include "BB_Group_Infected.h"
#include "BB_Individual_Infected.h"
class Behavior_Infected_Base : public BehaviorCommon
{
public:
Behavior_Infected_Base()
: m_pBBTeam(0)
, m_pBBGroup(0)
, m_pBBIndividual(0)
{
}
virtual void UpdatePerception( float timeDelta )
{
m_pPerception->GetPerceived( m_pOwner, EGO_WBC, m_pBBIndividual->visible_wbc );
m_pPerception->GetPerceived( m_pOwner, EGO_RBC, m_pBBIndividual->visible_rbc );
}
virtual void UpdateBlackboards( float timeDelta )
{
// TODO
}
protected:
virtual void InitGameObjectSpecificPointers()
{
BehaviorCommon::InitGameObjectSpecificPointers();
IBlackboardManager* m_pBBManager = (IBlackboardManager*)IObjectUtils::GetUniqueInterface( "BlackboardManager", IID_IBLACKBOARDMANAGER );
m_pBBTeam = (BB_Team_Infection*)m_pBBManager->GetBlackboardTeam( m_pOwner->GetGameTeam() );
m_pBBGroup = (BB_Group_Infected*)m_pBBManager->GetBlackboardGroup( m_pOwner->GetGameObjectType() );
m_pBBIndividual = (BB_Individual_Infected*)m_pBBManager->GetBlackboardIndividual( m_pOwner );
}
// Private Members
BB_Team_Infection* m_pBBTeam;
BB_Group_Infected* m_pBBGroup;
BB_Individual_Infected* m_pBBIndividual;
};
#endif // BEHAVIOR_INFECTED_BASE_INCLUDED

108
uft_dev_server/third_party/RCCPP/Examples/SimpleTest/Behavior_Infected_Combat.cpp vendored

@ -0,0 +1,108 @@ @@ -0,0 +1,108 @@
//
// Copyright (c) 2010-2011 Matthew Jack and Doug Binks
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
#include "Behavior_Infected_Base.h"
#include "../../Common/Math.inl"
class Behavior_Infected_Combat : public Behavior_Infected_Base
{
public:
virtual void StartBehavior()
{
m_pEntitySystem = PerModuleInterface::g_pSystemTable->pEntitySystem;
m_pBBCommon->time_to_next_attack = m_pGameObjectParams->attack_speed;
}
virtual void EndBehavior()
{
m_pBBCommon->enemy_collision_objectid.SetInvalid();
m_pBBCommon->time_to_next_attack = 0.0f;
}
virtual void UpdateBehavior( float timeDelta )
{
IGameObject* pGameObject = 0;
IObjectUtils::GetObject( &pGameObject, m_pBBCommon->enemy_collision_objectid );
m_pBBCommon->time_to_next_attack -= timeDelta;
if ( m_pBBCommon->time_to_next_attack <= 0.0f )
{
m_pBBCommon->time_to_next_attack += m_pGameObjectParams->attack_speed;
if (pGameObject && pGameObject->GetBehavior())
{
float enemyHealth = pGameObject->GetBehavior()->ReceiveDamage( m_pGameObjectParams->attack_damage );
if ( enemyHealth <= 0.0f && pGameObject->GetGameObjectType() == EGO_RBC )
{
ConsumeRBC();
pGameObject = 0;
}
}
}
if (!pGameObject || pGameObject->GetGameTeam() == EGT_INFECTION)
{
m_pBBCommon->enemy_collision_objectid.SetInvalid();
}
}
void ConsumeRBC()
{
m_pBBCommon->current_health += m_pGlobalParameters->infected_health_gain_from_eating;
if (m_pBBCommon->current_health >= m_pGlobalParameters->infected_max_health)
{
// Passed max health, so explode and convert into several viruses
m_pGameManager->DestroyGameObject( m_pOwner->GetObjectId() );
float radius = m_pOwner->GetCollisionRadius() * 0.7f;
int count = m_pGlobalParameters->infected_num_viruses_on_explode;
for (int i=0; i<count; ++i)
{
AUVec3f pos = m_pBBCommon->current_position + AUVec3f(
radius * (float)cos( M_PI * 2 * i / count ),
0.0f,
radius * (float)sin( M_PI * 2 * i / count )
);
m_pGameManager->SpawnGameObject( EGO_VIRUS, pos );
}
}
}
virtual AUVec3f CalculateDesiredPosition( float timeDelta )
{
AUVec3f pos = m_pOwner->GetEntity()->GetPosition();
IGameObject* pGameObject = 0;
IObjectUtils::GetObject( &pGameObject, m_pBBCommon->enemy_collision_objectid );
if (pGameObject)
{
AUVec3f targetVec = pGameObject->GetEntity()->GetPosition() - m_pBBCommon->current_position;
AUVec3f targetDir = targetVec.GetNormalised();
float dist = std::min( targetVec.Magnitude(), m_pOwner->GetMaxSpeed() * timeDelta );
pos += targetDir * dist;
}
return pos;
}
private:
IEntitySystem* m_pEntitySystem;
};
REGISTERCLASS(Behavior_Infected_Combat);

121
uft_dev_server/third_party/RCCPP/Examples/SimpleTest/Behavior_Infected_HuntRBC.cpp vendored

@ -0,0 +1,121 @@ @@ -0,0 +1,121 @@
//
// Copyright (c) 2010-2011 Matthew Jack and Doug Binks
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
#include "Behavior_Infected_Base.h"
#include <float.h>
class Behavior_Infected_HuntRBC : public Behavior_Infected_Base
{
public:
Behavior_Infected_HuntRBC()
: m_pApproachTarget(0)
, m_pAvoidTarget(0)
, m_TimeToNextDirChange(0.0f)
{}
virtual void Serialize(ISimpleSerializer *pSerializer)
{
BehaviorCommon::Serialize(pSerializer);
SERIALIZE(m_TimeToNextDirChange);
SERIALIZE(m_PatrolDir);
SERIALIZEIOBJPTR(m_pApproachTarget);
SERIALIZEIOBJPTR(m_pAvoidTarget);
}
virtual void UpdateBehavior( float timeDelta )
{
// Always look for the closest possible target
m_pApproachTarget = 0;
if ( m_pBBIndividual->visible_rbc.Size() > 0 )
{
GetClosestApproachTarget();
}
m_pAvoidTarget = 0;
if ( m_pBBIndividual->visible_wbc.Size() > 0 )
{
GetClosestAvoidTarget();
}
if (!m_pApproachTarget && !m_pAvoidTarget)
{
bool bBadHeading = m_pPhysics->IsHeadingToGameBounds( m_pBBCommon->current_position, m_pBBCommon->current_velocity );
m_TimeToNextDirChange -= timeDelta;
if ( bBadHeading || m_TimeToNextDirChange <= 0.0f )
{
m_TimeToNextDirChange = m_pBBIndividual->patrol_change_frequency;
m_PatrolDir = AUVec3f((float)rand()/RAND_MAX - 0.5f, 0.0f, (float)rand()/RAND_MAX - 0.5f).GetNormalised();
}
}
}
virtual AUVec3f CalculateDesiredPosition( float timeDelta )
{
AUVec3f pos = m_pOwner->GetEntity()->GetPosition();
AUVec3f targetVec;
if (m_pAvoidTarget)
{
targetVec = pos -m_pAvoidTarget->GetEntity()->GetPosition();
}
else if (m_pApproachTarget)
{
targetVec = m_pApproachTarget->GetEntity()->GetPosition() - pos;
}
else
{
targetVec = m_PatrolDir * m_pOwner->GetMaxSpeed();
}
AUVec3f targetDir = targetVec.GetNormalised();
float dist = std::min( targetVec.Magnitude(), m_pOwner->GetMaxSpeed() * timeDelta );
pos += targetDir * dist;
return pos;
}
void GetClosestApproachTarget()
{
float dist = FLT_MAX;
const AUVec3f& refPos = m_pOwner->GetEntity()->GetPosition();
GetClosestTarget( m_pBBIndividual->visible_rbc, refPos, dist, &m_pApproachTarget );
}
void GetClosestAvoidTarget()
{
float dist = FLT_MAX;
const AUVec3f& refPos = m_pOwner->GetEntity()->GetPosition();
GetClosestTarget( m_pBBIndividual->visible_wbc, refPos, dist, &m_pAvoidTarget );
if ( m_pAvoidTarget && m_pAvoidTarget->GetThreatRating() < m_pOwner->GetThreatRating() )
{
m_pAvoidTarget = 0;
}
}
private:
float m_TimeToNextDirChange;
AUVec3f m_PatrolDir;
IGameObject* m_pApproachTarget;
IGameObject* m_pAvoidTarget;
};
REGISTERCLASS(Behavior_Infected_HuntRBC);

96
uft_dev_server/third_party/RCCPP/Examples/SimpleTest/Behavior_Infected_HuntWBC.cpp vendored

@ -0,0 +1,96 @@ @@ -0,0 +1,96 @@
//
// Copyright (c) 2010-2011 Matthew Jack and Doug Binks
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
#include "Behavior_Infected_Base.h"
#include <float.h>
class Behavior_Infected_HuntWBC : public Behavior_Infected_Base
{
public:
Behavior_Infected_HuntWBC()
: m_pApproachTarget(0)
, m_TimeToNextDirChange(0.0f)
{}
virtual void Serialize(ISimpleSerializer *pSerializer)
{
BehaviorCommon::Serialize(pSerializer);
SERIALIZE(m_TimeToNextDirChange);
SERIALIZE(m_PatrolDir);
SERIALIZEIOBJPTR(m_pApproachTarget);
}
virtual void UpdateBehavior( float timeDelta )
{
// Always look for the closest possible target
m_pApproachTarget = 0;
if ( m_pBBIndividual->visible_wbc.Size() > 0 )
{
GetClosestApproachTarget();
}
if (!m_pApproachTarget)
{
bool bBadHeading = m_pPhysics->IsHeadingToGameBounds( m_pBBCommon->current_position, m_pBBCommon->current_velocity );
m_TimeToNextDirChange -= timeDelta;
if ( bBadHeading || m_TimeToNextDirChange <= 0.0f )
{
m_TimeToNextDirChange = m_pBBIndividual->patrol_change_frequency;
m_PatrolDir = AUVec3f((float)rand()/RAND_MAX - 0.5f, 0.0f, (float)rand()/RAND_MAX - 0.5f).GetNormalised();
}
}
}
virtual AUVec3f CalculateDesiredPosition( float timeDelta )
{
AUVec3f pos = m_pOwner->GetEntity()->GetPosition();
AUVec3f targetPos;
if (m_pApproachTarget)
{
targetPos = m_pApproachTarget->GetEntity()->GetPosition();
}
else
{
targetPos = pos + m_PatrolDir * m_pOwner->GetMaxSpeed();
}
AUVec3f targetVec = targetPos - pos;
AUVec3f targetDir = targetVec.GetNormalised();
float dist = std::min( targetVec.Magnitude(), m_pOwner->GetMaxSpeed() * timeDelta );
pos += targetDir * dist;
return pos;
}
void GetClosestApproachTarget()
{
float dist = FLT_MAX;
const AUVec3f& refPos = m_pOwner->GetEntity()->GetPosition();
GetClosestTarget( m_pBBIndividual->visible_wbc, refPos, dist, &m_pApproachTarget );
}
private:
float m_TimeToNextDirChange;
AUVec3f m_PatrolDir;
IGameObject* m_pApproachTarget;
};
REGISTERCLASS(Behavior_Infected_HuntWBC);

31
uft_dev_server/third_party/RCCPP/Examples/SimpleTest/Behavior_Infected_Idle.cpp vendored

@ -0,0 +1,31 @@ @@ -0,0 +1,31 @@
//
// Copyright (c) 2010-2011 Matthew Jack and Doug Binks
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
#include "Behavior_Infected_Base.h"
class Behavior_Infected_Idle : public Behavior_Infected_Base
{
public:
virtual void UpdateBehavior( float timeDelta )
{
// Do nothing
}
};
REGISTERCLASS(Behavior_Infected_Idle);

60
uft_dev_server/third_party/RCCPP/Examples/SimpleTest/Behavior_RBC_Approach.cpp vendored

@ -0,0 +1,60 @@ @@ -0,0 +1,60 @@
//
// Copyright (c) 2010-2011 Matthew Jack and Doug Binks
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
#include "Behavior_RBC_Base.h"
class Behavior_RBC_Approach : public Behavior_RBC_Base
{
public:
virtual void EndBehavior()
{
m_pBBCommon->target_position.SetInfinite();
}
virtual void UpdateBehavior( float timeDelta )
{
if ( !m_pBBCommon->target_position.IsInfinite() )
{
AUVec3f targetVec = m_pBBCommon->target_position - m_pBBCommon->current_position;
float distSqr = targetVec.MagnitudeSqr();
if ( distSqr < 1.0f )
{
m_pBBCommon->target_position.SetInfinite();
}
}
}
virtual AUVec3f CalculateDesiredPosition( float timeDelta )
{
AUVec3f pos = m_pOwner->GetEntity()->GetPosition();
if ( !m_pBBCommon->target_position.IsInfinite() )
{
AUVec3f targetVec = m_pBBCommon->target_position - m_pBBCommon->current_position;
AUVec3f targetDir = targetVec.GetNormalised();
float dist = std::min( targetVec.Magnitude(), m_pOwner->GetMaxSpeed() * timeDelta );
pos += targetDir * dist;
}
return pos;
}
};
REGISTERCLASS(Behavior_RBC_Approach);

78
uft_dev_server/third_party/RCCPP/Examples/SimpleTest/Behavior_RBC_Base.h vendored

@ -0,0 +1,78 @@ @@ -0,0 +1,78 @@
//
// Copyright (c) 2010-2011 Matthew Jack and Doug Binks
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
#pragma once
#ifndef BEHAVIOR_RBC_BASE_INCLUDED
#define BEHAVIOR_RBC_BASE_INCLUDED
#include "../../RuntimeObjectSystem/RuntimeInclude.h"
RUNTIME_MODIFIABLE_INCLUDE; //adds this include to runtime tracking
#include "BehaviorCommon.h"
#include "BB_Team_Immune.h"
#include "BB_Group_RBC.h"
#include "BB_Individual_RBC.h"
class Behavior_RBC_Base : public BehaviorCommon
{
public:
Behavior_RBC_Base()
: m_pBBTeam(0)
, m_pBBGroup(0)
, m_pBBIndividual(0)
{
}
virtual void UpdatePerception( float timeDelta )
{
/* Demo [Tutorial03]
m_pPerception->GetPerceived( m_pOwner, EGO_VIRUS, m_pBBIndividual->visible_dangerous ); // Demo [Tutorial03]
m_pPerception->AddPerceived( m_pOwner, EGO_INFECTED, m_pBBIndividual->visible_dangerous ); // Demo [Tutorial03]
//*/
}
virtual void UpdateBlackboards( float timeDelta )
{
// TODO
}
protected:
virtual void InitGameObjectSpecificPointers()
{
BehaviorCommon::InitGameObjectSpecificPointers();
IBlackboardManager* m_pBBManager = (IBlackboardManager*)IObjectUtils::GetUniqueInterface( "BlackboardManager", IID_IBLACKBOARDMANAGER );
m_pBBTeam = (BB_Team_Immune*)m_pBBManager->GetBlackboardTeam( m_pOwner->GetGameTeam() );
m_pBBGroup = (BB_Group_RBC*)m_pBBManager->GetBlackboardGroup( m_pOwner->GetGameObjectType() );
m_pBBIndividual = (BB_Individual_RBC*)m_pBBManager->GetBlackboardIndividual( m_pOwner );
}
// Private Members
BB_Team_Immune* m_pBBTeam;
BB_Group_RBC* m_pBBGroup;
BB_Individual_RBC* m_pBBIndividual;
};
#endif // BEHAVIOR_RBC_BASE_INCLUDED

85
uft_dev_server/third_party/RCCPP/Examples/SimpleTest/Behavior_RBC_Combat.cpp vendored

@ -0,0 +1,85 @@ @@ -0,0 +1,85 @@
//
// Copyright (c) 2010-2011 Matthew Jack and Doug Binks
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
#include "Behavior_RBC_Base.h"
class Behavior_RBC_Combat : public Behavior_RBC_Base
{
public:
virtual void StartBehavior()
{
m_pEntitySystem = PerModuleInterface::g_pSystemTable->pEntitySystem;
m_pBBCommon->time_to_next_attack = m_pGameObjectParams->attack_speed;
}
virtual void EndBehavior()
{
m_pBBCommon->enemy_collision_objectid.SetInvalid();
m_pBBCommon->time_to_next_attack = 0.0f;
}
virtual void UpdateBehavior( float timeDelta )
{
IGameObject* pGameObject = 0;
IObjectUtils::GetObject( &pGameObject, m_pBBCommon->enemy_collision_objectid );
m_pBBCommon->time_to_next_attack -= timeDelta;
if ( m_pBBCommon->time_to_next_attack <= 0.0f )
{
m_pBBCommon->time_to_next_attack += m_pGameObjectParams->attack_speed;
if (pGameObject && pGameObject->GetBehavior())
{
float enemyHealth = pGameObject->GetBehavior()->ReceiveDamage( m_pGameObjectParams->attack_damage );
if (enemyHealth <= 0.0f)
{
pGameObject = 0;
}
}
}
if (!pGameObject)
{
m_pBBCommon->enemy_collision_objectid.SetInvalid();
}
}
virtual AUVec3f CalculateDesiredPosition( float timeDelta )
{
AUVec3f pos = m_pOwner->GetEntity()->GetPosition();
IGameObject* pGameObject = 0;
IObjectUtils::GetObject( &pGameObject, m_pBBCommon->enemy_collision_objectid );
if (pGameObject)
{
AUVec3f targetVec = pGameObject->GetEntity()->GetPosition() - m_pBBCommon->current_position;
AUVec3f targetDir = targetVec.GetNormalised();
float dist = std::min( targetVec.Magnitude(), m_pOwner->GetMaxSpeed() * timeDelta );
pos += targetDir * dist;
}
return pos;
}
private:
IEntitySystem* m_pEntitySystem;
};
REGISTERCLASS(Behavior_RBC_Combat);

78
uft_dev_server/third_party/RCCPP/Examples/SimpleTest/Behavior_RBC_Evade.cpp vendored

@ -0,0 +1,78 @@ @@ -0,0 +1,78 @@
//
// Copyright (c) 2010-2011 Matthew Jack and Doug Binks
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
#include "Behavior_RBC_Base.h"
#include <float.h>
/* Demo [Tutorial03]
class Behavior_RBC_Evade : public Behavior_RBC_Base
{
public:
virtual void StartBehavior()
{
}
virtual void EndBehavior()
{
}
virtual void UpdateBehavior( float timeDelta )
{
}
virtual AUVec3f CalculateDesiredPosition( float timeDelta )
{
AUVec3f pos = m_pOwner->GetEntity()->GetPosition();
float dist = FLT_MAX;
IGameObject* pGameObject = 0;
GetClosestTarget( m_pBBIndividual->visible_dangerous, pos, dist, &pGameObject );
if (pGameObject)
{
AUVec3f targetVec = pGameObject->GetEntity()->GetPosition() - m_pBBCommon->current_position;
AUVec3f targetDir = targetVec.GetNormalised() * -1.0f;
float dist = std::min( targetVec.Magnitude(), m_pOwner->GetMaxSpeed() * timeDelta );
pos += targetDir * dist;
}
return pos;
}
};
REGISTERCLASS(Behavior_RBC_Evade);
//*/
class CDummy : public IObject
{
virtual void Serialize(ISimpleSerializer *pSerializer) {}
};
REGISTERCLASS(CDummy);

31
uft_dev_server/third_party/RCCPP/Examples/SimpleTest/Behavior_RBC_Idle.cpp vendored

@ -0,0 +1,31 @@ @@ -0,0 +1,31 @@
//
// Copyright (c) 2010-2011 Matthew Jack and Doug Binks
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
#include "Behavior_RBC_Base.h"
class Behavior_RBC_Idle : public Behavior_RBC_Base
{
public:
virtual void UpdateBehavior( float timeDelta )
{
// Do nothing
}
};
REGISTERCLASS(Behavior_RBC_Idle);

60
uft_dev_server/third_party/RCCPP/Examples/SimpleTest/Behavior_Virus_Approach.cpp vendored

@ -0,0 +1,60 @@ @@ -0,0 +1,60 @@
//
// Copyright (c) 2010-2011 Matthew Jack and Doug Binks
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
#include "Behavior_Virus_Base.h"
class Behavior_Virus_Approach : public Behavior_Virus_Base
{
public:
virtual void EndBehavior()
{
m_pBBCommon->target_position.SetInfinite();
}
virtual void UpdateBehavior( float timeDelta )
{
if ( !m_pBBCommon->target_position.IsInfinite() )
{
AUVec3f targetVec = m_pBBCommon->target_position - m_pBBCommon->current_position;
float distSqr = targetVec.MagnitudeSqr();
if ( distSqr < 1.0f )
{
m_pBBCommon->target_position.SetInfinite();
}
}
}
virtual AUVec3f CalculateDesiredPosition( float timeDelta )
{
AUVec3f pos = m_pOwner->GetEntity()->GetPosition();
if ( !m_pBBCommon->target_position.IsInfinite() )
{
AUVec3f targetVec = m_pBBCommon->target_position - m_pBBCommon->current_position;
AUVec3f targetDir = targetVec.GetNormalised();
float dist = std::min( targetVec.Magnitude(), m_pOwner->GetMaxSpeed() * timeDelta );
pos += targetDir * dist;
}
return pos;
}
};
REGISTERCLASS(Behavior_Virus_Approach);

76
uft_dev_server/third_party/RCCPP/Examples/SimpleTest/Behavior_Virus_Base.h vendored

@ -0,0 +1,76 @@ @@ -0,0 +1,76 @@
//
// Copyright (c) 2010-2011 Matthew Jack and Doug Binks
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
#pragma once
#ifndef BEHAVIOR_VIRUS_BASE_INCLUDED
#define BEHAVIOR_VIRUS_BASE_INCLUDED
#include "../../RuntimeObjectSystem/RuntimeInclude.h"
RUNTIME_MODIFIABLE_INCLUDE; //adds this include to runtime tracking
#include "BehaviorCommon.h"
#include "BB_Team_Infection.h"
#include "BB_Group_Virus.h"
#include "BB_Individual_Virus.h"
class Behavior_Virus_Base : public BehaviorCommon
{
public:
Behavior_Virus_Base()
: m_pBBTeam(0)
, m_pBBGroup(0)
, m_pBBIndividual(0)
{
}
virtual void UpdatePerception( float timeDelta )
{
m_pPerception->GetPerceived( m_pOwner, EGO_WBC, m_pBBIndividual->visible_wbc );
m_pPerception->GetPerceived( m_pOwner, EGO_RBC, m_pBBIndividual->visible_rbc );
}
virtual void UpdateBlackboards( float timeDelta )
{
// TODO
}
protected:
virtual void InitGameObjectSpecificPointers()
{
BehaviorCommon::InitGameObjectSpecificPointers();
IBlackboardManager* m_pBBManager = (IBlackboardManager*)IObjectUtils::GetUniqueInterface( "BlackboardManager", IID_IBLACKBOARDMANAGER );
m_pBBTeam = (BB_Team_Infection*)m_pBBManager->GetBlackboardTeam( m_pOwner->GetGameTeam() );
m_pBBGroup = (BB_Group_Virus*)m_pBBManager->GetBlackboardGroup( m_pOwner->GetGameObjectType() );
m_pBBIndividual = (BB_Individual_Virus*)m_pBBManager->GetBlackboardIndividual( m_pOwner );
}
// Private Members
BB_Team_Infection* m_pBBTeam;
BB_Group_Virus* m_pBBGroup;
BB_Individual_Virus* m_pBBIndividual;
};
#endif // BEHAVIOR_VIRUS_BASE_INCLUDED

88
uft_dev_server/third_party/RCCPP/Examples/SimpleTest/Behavior_Virus_Combat.cpp vendored

@ -0,0 +1,88 @@ @@ -0,0 +1,88 @@
//
// Copyright (c) 2010-2011 Matthew Jack and Doug Binks
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
#include "Behavior_Virus_Base.h"
class Behavior_Virus_Combat : public Behavior_Virus_Base
{
public:
virtual void StartBehavior()
{
m_pEntitySystem = PerModuleInterface::g_pSystemTable->pEntitySystem;
m_pBBCommon->time_to_next_attack = m_pGameObjectParams->attack_speed;
}
virtual void EndBehavior()
{
m_pBBCommon->enemy_collision_objectid.SetInvalid();
m_pBBCommon->time_to_next_attack = 0.0f;
}
virtual void UpdateBehavior( float timeDelta )
{
IGameObject* pGameObject = 0;
IObjectUtils::GetObject( &pGameObject, m_pBBCommon->enemy_collision_objectid );
m_pBBCommon->time_to_next_attack -= timeDelta;
if ( m_pBBCommon->time_to_next_attack <= 0.0f )
{
m_pBBCommon->time_to_next_attack += m_pGameObjectParams->attack_speed;
if (pGameObject && pGameObject->GetBehavior())
{
float enemyHealth = pGameObject->GetBehavior()->ReceiveDamage( m_pGameObjectParams->attack_damage );
if ( enemyHealth <= 0.0f && pGameObject->GetGameObjectType() == EGO_RBC )
{
// Just consumed RBC, convert into an infected cell now
m_pGameManager->DestroyGameObject( m_pOwner->GetObjectId() );
m_pGameManager->SpawnGameObject( EGO_INFECTED, m_pBBCommon->current_position );
pGameObject = 0;
}
}
}
if (!pGameObject || pGameObject->GetGameTeam() == EGT_INFECTION)
{
m_pBBCommon->enemy_collision_objectid.SetInvalid();
}
}
virtual AUVec3f CalculateDesiredPosition( float timeDelta )
{
AUVec3f pos = m_pOwner->GetEntity()->GetPosition();
IGameObject* pGameObject = 0;
IObjectUtils::GetObject( &pGameObject, m_pBBCommon->enemy_collision_objectid );
if (pGameObject)
{
AUVec3f targetVec = pGameObject->GetEntity()->GetPosition() - m_pBBCommon->current_position;
AUVec3f targetDir = targetVec.GetNormalised();
float dist = std::min( targetVec.Magnitude(), m_pOwner->GetMaxSpeed() * timeDelta );
pos += targetDir * dist;
}
return pos;
}
private:
IEntitySystem* m_pEntitySystem;
};
REGISTERCLASS(Behavior_Virus_Combat);

121
uft_dev_server/third_party/RCCPP/Examples/SimpleTest/Behavior_Virus_HuntRBC.cpp vendored

@ -0,0 +1,121 @@ @@ -0,0 +1,121 @@
//
// Copyright (c) 2010-2011 Matthew Jack and Doug Binks
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
#include "Behavior_Virus_Base.h"
#include <float.h>
class Behavior_Virus_HuntRBC : public Behavior_Virus_Base
{
public:
Behavior_Virus_HuntRBC()
: m_pApproachTarget(0)
, m_pAvoidTarget(0)
, m_TimeToNextDirChange(0.0f)
{}
virtual void Serialize(ISimpleSerializer *pSerializer)
{
BehaviorCommon::Serialize(pSerializer);
SERIALIZE(m_TimeToNextDirChange);
SERIALIZE(m_PatrolDir);
SERIALIZEIOBJPTR(m_pApproachTarget);
SERIALIZEIOBJPTR(m_pAvoidTarget);
}
virtual void UpdateBehavior( float timeDelta )
{
// Always look for the closest possible target
m_pApproachTarget = 0;
if ( m_pBBIndividual->visible_rbc.Size() > 0 )
{
GetClosestApproachTarget();
}
m_pAvoidTarget = 0;
if ( m_pBBIndividual->visible_wbc.Size() > 0 )
{
GetClosestAvoidTarget();
}
if (!m_pApproachTarget && !m_pAvoidTarget)
{
bool bBadHeading = m_pPhysics->IsHeadingToGameBounds( m_pBBCommon->current_position, m_pBBCommon->current_velocity );
m_TimeToNextDirChange -= timeDelta;
if ( bBadHeading || m_TimeToNextDirChange <= 0.0f )
{
m_TimeToNextDirChange = m_pBBIndividual->patrol_change_frequency;
m_PatrolDir = AUVec3f((float)rand()/RAND_MAX - 0.5f, 0.0f, (float)rand()/RAND_MAX - 0.5f).GetNormalised();
}
}
}
virtual AUVec3f CalculateDesiredPosition( float timeDelta )
{
AUVec3f pos = m_pOwner->GetEntity()->GetPosition();
AUVec3f targetVec;
if (m_pAvoidTarget)
{
targetVec = pos -m_pAvoidTarget->GetEntity()->GetPosition();
}
else if (m_pApproachTarget)
{
targetVec = m_pApproachTarget->GetEntity()->GetPosition() - pos;
}
else
{
targetVec = m_PatrolDir * m_pOwner->GetMaxSpeed();
}
AUVec3f targetDir = targetVec.GetNormalised();
float dist = std::min( targetVec.Magnitude(), m_pOwner->GetMaxSpeed() * timeDelta );
pos += targetDir * dist;
return pos;
}
void GetClosestApproachTarget()
{
float dist = FLT_MAX;
const AUVec3f& refPos = m_pOwner->GetEntity()->GetPosition();
GetClosestTarget( m_pBBIndividual->visible_rbc, refPos, dist, &m_pApproachTarget );
}
void GetClosestAvoidTarget()
{
float dist = FLT_MAX;
const AUVec3f& refPos = m_pOwner->GetEntity()->GetPosition();
GetClosestTarget( m_pBBIndividual->visible_wbc, refPos, dist, &m_pAvoidTarget );
if ( m_pAvoidTarget && m_pAvoidTarget->GetThreatRating() < m_pOwner->GetThreatRating() )
{
m_pAvoidTarget = 0;
}
}
private:
float m_TimeToNextDirChange;
AUVec3f m_PatrolDir;
IGameObject* m_pApproachTarget;
IGameObject* m_pAvoidTarget;
};
REGISTERCLASS(Behavior_Virus_HuntRBC);

96
uft_dev_server/third_party/RCCPP/Examples/SimpleTest/Behavior_Virus_HuntWBC.cpp vendored

@ -0,0 +1,96 @@ @@ -0,0 +1,96 @@
//
// Copyright (c) 2010-2011 Matthew Jack and Doug Binks
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
#include "Behavior_Virus_Base.h"
#include <float.h>
class Behavior_Virus_HuntWBC : public Behavior_Virus_Base
{
public:
Behavior_Virus_HuntWBC()
: m_pApproachTarget(0)
, m_TimeToNextDirChange(0.0f)
{}
virtual void Serialize(ISimpleSerializer *pSerializer)
{
BehaviorCommon::Serialize(pSerializer);
SERIALIZE(m_TimeToNextDirChange);
SERIALIZE(m_PatrolDir);
SERIALIZEIOBJPTR(m_pApproachTarget);
}
virtual void UpdateBehavior( float timeDelta )
{
// Always look for the closest possible target
m_pApproachTarget = 0;
if ( m_pBBIndividual->visible_wbc.Size() > 0 )
{
GetClosestApproachTarget();
}
if (!m_pApproachTarget)
{
bool bBadHeading = m_pPhysics->IsHeadingToGameBounds( m_pBBCommon->current_position, m_pBBCommon->current_velocity );
m_TimeToNextDirChange -= timeDelta;
if ( bBadHeading || m_TimeToNextDirChange <= 0.0f )
{
m_TimeToNextDirChange = m_pBBIndividual->patrol_change_frequency;
m_PatrolDir = AUVec3f((float)rand()/RAND_MAX - 0.5f, 0.0f, (float)rand()/RAND_MAX - 0.5f).GetNormalised();
}
}
}
virtual AUVec3f CalculateDesiredPosition( float timeDelta )
{
AUVec3f pos = m_pOwner->GetEntity()->GetPosition();
AUVec3f targetPos;
if (m_pApproachTarget)
{
targetPos = m_pApproachTarget->GetEntity()->GetPosition();
}
else
{
targetPos = pos + m_PatrolDir * m_pOwner->GetMaxSpeed();
}
AUVec3f targetVec = targetPos - pos;
AUVec3f targetDir = targetVec.GetNormalised();
float dist = std::min( targetVec.Magnitude(), m_pOwner->GetMaxSpeed() * timeDelta );
pos += targetDir * dist;
return pos;
}
void GetClosestApproachTarget()
{
float dist = FLT_MAX;
const AUVec3f& refPos = m_pOwner->GetEntity()->GetPosition();
GetClosestTarget( m_pBBIndividual->visible_wbc, refPos, dist, &m_pApproachTarget );
}
private:
float m_TimeToNextDirChange;
AUVec3f m_PatrolDir;
IGameObject* m_pApproachTarget;
};
REGISTERCLASS(Behavior_Virus_HuntWBC);

31
uft_dev_server/third_party/RCCPP/Examples/SimpleTest/Behavior_Virus_Idle.cpp vendored

@ -0,0 +1,31 @@ @@ -0,0 +1,31 @@
//
// Copyright (c) 2010-2011 Matthew Jack and Doug Binks
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
#include "Behavior_Virus_Base.h"
class Behavior_Virus_Idle : public Behavior_Virus_Base
{
public:
virtual void UpdateBehavior( float timeDelta )
{
// Do nothing
}
};
REGISTERCLASS(Behavior_Virus_Idle);

60
uft_dev_server/third_party/RCCPP/Examples/SimpleTest/Behavior_WBC_Approach.cpp vendored

@ -0,0 +1,60 @@ @@ -0,0 +1,60 @@
//
// Copyright (c) 2010-2011 Matthew Jack and Doug Binks
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
#include "Behavior_WBC_Base.h"
class Behavior_WBC_Approach : public Behavior_WBC_Base
{
public:
virtual void EndBehavior()
{
m_pBBCommon->target_position.SetInfinite();
}
virtual void UpdateBehavior( float timeDelta )
{
if ( !m_pBBCommon->target_position.IsInfinite() )
{
AUVec3f targetVec = m_pBBCommon->target_position - m_pBBCommon->current_position;
float distSqr = targetVec.MagnitudeSqr();
if ( distSqr < 1.0f )
{
m_pBBCommon->target_position.SetInfinite();
}
}
}
virtual AUVec3f CalculateDesiredPosition( float timeDelta )
{
AUVec3f pos = m_pOwner->GetEntity()->GetPosition();
if ( !m_pBBCommon->target_position.IsInfinite() )
{
AUVec3f targetVec = m_pBBCommon->target_position - m_pBBCommon->current_position;
AUVec3f targetDir = targetVec.GetNormalised();
float dist = std::min( targetVec.Magnitude(), m_pOwner->GetMaxSpeed() * timeDelta );
pos += targetDir * dist;
}
return pos;
}
};
REGISTERCLASS(Behavior_WBC_Approach);

76
uft_dev_server/third_party/RCCPP/Examples/SimpleTest/Behavior_WBC_Base.h vendored

@ -0,0 +1,76 @@ @@ -0,0 +1,76 @@
//
// Copyright (c) 2010-2011 Matthew Jack and Doug Binks
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
#pragma once
#ifndef BEHAVIOR_WBC_BASE_INCLUDED
#define BEHAVIOR_WBC_BASE_INCLUDED
#include "../../RuntimeObjectSystem/RuntimeInclude.h"
RUNTIME_MODIFIABLE_INCLUDE; //adds this include to runtime tracking
#include "BehaviorCommon.h"
#include "BB_Team_Immune.h"
#include "BB_Group_WBC.h"
#include "BB_Individual_WBC.h"
class Behavior_WBC_Base : public BehaviorCommon
{
public:
Behavior_WBC_Base()
: m_pBBTeam(0)
, m_pBBGroup(0)
, m_pBBIndividual(0)
{
}
virtual void UpdatePerception( float timeDelta )
{
m_pPerception->GetPerceived( m_pOwner, EGO_VIRUS, m_pBBIndividual->visible_viruses );
m_pPerception->GetPerceived( m_pOwner, EGO_INFECTED, m_pBBIndividual->visible_infected );
}
virtual void UpdateBlackboards( float timeDelta )
{
// TODO
}
protected:
virtual void InitGameObjectSpecificPointers()
{
BehaviorCommon::InitGameObjectSpecificPointers();
IBlackboardManager* m_pBBManager = (IBlackboardManager*)IObjectUtils::GetUniqueInterface( "BlackboardManager", IID_IBLACKBOARDMANAGER );
m_pBBTeam = (BB_Team_Immune*)m_pBBManager->GetBlackboardTeam( m_pOwner->GetGameTeam() );
m_pBBGroup = (BB_Group_WBC*)m_pBBManager->GetBlackboardGroup( m_pOwner->GetGameObjectType() );
m_pBBIndividual = (BB_Individual_WBC*)m_pBBManager->GetBlackboardIndividual( m_pOwner );
}
// Private Members
BB_Team_Immune* m_pBBTeam;
BB_Group_WBC* m_pBBGroup;
BB_Individual_WBC* m_pBBIndividual;
};
#endif // BEHAVIOR_WBC_BASE_INCLUDED

85
uft_dev_server/third_party/RCCPP/Examples/SimpleTest/Behavior_WBC_Combat.cpp vendored

@ -0,0 +1,85 @@ @@ -0,0 +1,85 @@
//
// Copyright (c) 2010-2011 Matthew Jack and Doug Binks
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
#include "Behavior_WBC_Base.h"
class Behavior_WBC_Combat : public Behavior_WBC_Base
{
public:
virtual void StartBehavior()
{
m_pEntitySystem = PerModuleInterface::g_pSystemTable->pEntitySystem;
m_pBBCommon->time_to_next_attack = m_pGameObjectParams->attack_speed;
}
virtual void EndBehavior()
{
m_pBBCommon->enemy_collision_objectid.SetInvalid();
m_pBBCommon->time_to_next_attack = 0.0f;
}
virtual void UpdateBehavior( float timeDelta )
{
IGameObject* pGameObject = 0;
IObjectUtils::GetObject( &pGameObject, m_pBBCommon->enemy_collision_objectid );
m_pBBCommon->time_to_next_attack -= timeDelta;
if ( m_pBBCommon->time_to_next_attack <= 0.0f )
{
m_pBBCommon->time_to_next_attack += m_pGameObjectParams->attack_speed;
if (pGameObject && pGameObject->GetBehavior())
{
float enemyHealth = pGameObject->GetBehavior()->ReceiveDamage( m_pGameObjectParams->attack_damage );
if (enemyHealth <= 0.0f)
{
pGameObject = 0;
}
}
}
if (!pGameObject)
{
m_pBBCommon->enemy_collision_objectid.SetInvalid();
}
}
virtual AUVec3f CalculateDesiredPosition( float timeDelta )
{
AUVec3f pos = m_pOwner->GetEntity()->GetPosition();
IGameObject* pGameObject = 0;
IObjectUtils::GetObject( &pGameObject, m_pBBCommon->enemy_collision_objectid );
if (pGameObject)
{
AUVec3f targetVec = pGameObject->GetEntity()->GetPosition() - m_pBBCommon->current_position;
AUVec3f targetDir = targetVec.GetNormalised();
float dist = std::min( targetVec.Magnitude(), m_pOwner->GetMaxSpeed() * timeDelta );
pos += targetDir * dist;
}
return pos;
}
private:
IEntitySystem* m_pEntitySystem;
};
REGISTERCLASS(Behavior_WBC_Combat);

31
uft_dev_server/third_party/RCCPP/Examples/SimpleTest/Behavior_WBC_Idle.cpp vendored

@ -0,0 +1,31 @@ @@ -0,0 +1,31 @@
//
// Copyright (c) 2010-2011 Matthew Jack and Doug Binks
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
#include "Behavior_WBC_Base.h"
class Behavior_WBC_Idle : public Behavior_WBC_Base
{
public:
virtual void UpdateBehavior( float timeDelta )
{
// Do nothing
}
};
REGISTERCLASS(Behavior_WBC_Idle);

97
uft_dev_server/third_party/RCCPP/Examples/SimpleTest/Behavior_WBC_Patrol.cpp vendored

@ -0,0 +1,97 @@ @@ -0,0 +1,97 @@
//
// Copyright (c) 2010-2011 Matthew Jack and Doug Binks
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
#include "Behavior_WBC_Base.h"
#include <float.h>
class Behavior_WBC_Patrol : public Behavior_WBC_Base
{
public:
Behavior_WBC_Patrol()
: m_pApproachTarget(0)
, m_TimeToNextDirChange(0.0f)
{}
virtual void Serialize(ISimpleSerializer *pSerializer)
{
BehaviorCommon::Serialize(pSerializer);
SERIALIZE(m_TimeToNextDirChange);
SERIALIZE(m_PatrolDir);
SERIALIZEIOBJPTR(m_pApproachTarget);
}
virtual void UpdateBehavior( float timeDelta )
{
// Always look for the closest possible target
m_pApproachTarget = 0;
if ( m_pBBIndividual->visible_infected.Size() > 0 || m_pBBIndividual->visible_viruses.Size() > 0 )
{
GetClosestApproachTarget();
}
if (!m_pApproachTarget)
{
bool bBadHeading = m_pPhysics->IsHeadingToGameBounds( m_pBBCommon->current_position, m_pBBCommon->current_velocity );
m_TimeToNextDirChange -= timeDelta;
if ( bBadHeading || m_TimeToNextDirChange <= 0.0f )
{
m_TimeToNextDirChange = m_pBBIndividual->patrol_change_frequency;
m_PatrolDir = AUVec3f((float)rand()/RAND_MAX - 0.5f, 0.0f, (float)rand()/RAND_MAX - 0.5f).GetNormalised();
}
}
}
virtual AUVec3f CalculateDesiredPosition( float timeDelta )
{
AUVec3f pos = m_pOwner->GetEntity()->GetPosition();
AUVec3f targetPos;
if (m_pApproachTarget)
{
targetPos = m_pApproachTarget->GetEntity()->GetPosition();
}
else
{
targetPos = pos + m_PatrolDir * m_pOwner->GetMaxSpeed();
}
AUVec3f targetVec = targetPos - pos;
AUVec3f targetDir = targetVec.GetNormalised();
float dist = std::min( targetVec.Magnitude(), m_pOwner->GetMaxSpeed() * timeDelta );
pos += targetDir * dist;
return pos;
}
virtual void GetClosestApproachTarget()
{
float dist = FLT_MAX;
const AUVec3f& refPos = m_pOwner->GetEntity()->GetPosition();
GetClosestTarget( m_pBBIndividual->visible_infected, refPos, dist, &m_pApproachTarget );
GetClosestTarget( m_pBBIndividual->visible_viruses, refPos, dist, &m_pApproachTarget );
}
private:
float m_TimeToNextDirChange;
AUVec3f m_PatrolDir;
IGameObject* m_pApproachTarget;
};
REGISTERCLASS(Behavior_WBC_Patrol);

391
uft_dev_server/third_party/RCCPP/Examples/SimpleTest/BlackboardManager.cpp vendored

@ -0,0 +1,391 @@ @@ -0,0 +1,391 @@
//
// Copyright (c) 2010-2011 Matthew Jack and Doug Binks
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
#include "IBlackboardManager.h"
#include "IGameObject.h"
#include "IGameManager.h"
#include "IObjectUtils.h"
#include "GlobalParameters.h"
#include "IObjectUtils.h"
#include "BB_Individual_WBC.h"
#include "BB_Individual_RBC.h"
#include "BB_Individual_Virus.h"
#include "BB_Individual_Infected.h"
#include "BB_Individual_Common.h"
#include "BB_Team_Immune.h"
#include "BB_Team_Infection.h"
#include "BB_Group_WBC.h"
#include "BB_Group_RBC.h"
#include "BB_Group_Virus.h"
#include "BB_Group_Infected.h"
#include "BB_Global.h"
#include "../../RuntimeObjectSystem/ObjectInterfacePerModule.h"
#include "../../Systems/SystemTable.h"
#include "../../RuntimeObjectSystem/IObjectFactorySystem.h"
#include "../../Systems/ILogSystem.h"
#include "../../RuntimeObjectSystem/ISimpleSerializer.h"
#include <assert.h>
#include <map>
#include <vector>
class BlackboardManager: public IBlackboardManager, public IGameEventListener
{
public:
BlackboardManager()
{
m_pGameManager = 0;
m_pGlobalParameters = 0;
m_pBlackboardGlobal = 0;
m_BlackboardTeam.resize(EGT_COUNT);
m_BlackboardGroup.resize(EGO_COUNT);
}
virtual ~BlackboardManager()
{
((IGameManager*)IObjectUtils::GetUniqueInterface( "GameManager", IID_IGAMEMANAGER ))->RemoveListener(this);
if (!IsRuntimeDelete())
{
DestroyAllBlackboards();
}
}
// IObject
virtual void Serialize(ISimpleSerializer *pSerializer)
{
SERIALIZEIOBJPTR(m_pBlackboardGlobal);
SERIALIZE(m_BlackboardTeam);
SERIALIZE(m_BlackboardGroup);
SERIALIZE(m_BlackboardIndividual);
SERIALIZE(m_BlackboardIndividualCommon);
}
virtual void Init( bool isFirstInit )
{
IGameManager* pGameManager = (IGameManager*)IObjectUtils::GetUniqueInterface( "GameManager", IID_IGAMEMANAGER );
pGameManager->AddListener(this);
m_pGlobalParameters = pGameManager->GetGlobalParameters();
if (isFirstInit)
{
CreateSharedBlackboards();
}
}
// ~IObject
// IGameEventListener
virtual void OnGameObjectCreated( IGameObject* pGameObject )
{
EGameTeam team = pGameObject->GetGameTeam();
EGameObject type = pGameObject->GetGameObjectType();
CreateIndividualBlackboards(pGameObject);
// Set/Modify appropriate blackboard values
SetInitialCommonValues( pGameObject );
ModifyGlobalTeamCount( team, 1 );
ModifyTeamCount( team, 1 );
ModifyGroupCount( type, 1 );
}
virtual void OnGameObjectAboutToDestroy( IGameObject* pGameObject )
{
EGameTeam team = pGameObject->GetGameTeam();
EGameObject type = pGameObject->GetGameObjectType();
ModifyGlobalTeamCount( team, -1 );
ModifyTeamCount( team, -1 );
ModifyGroupCount( type, -1 );
DestroyBlackboardIndividual(pGameObject->GetObjectId());
DestroyBlackboardIndividualCommon(pGameObject->GetObjectId());
}
// ~IGameEventListener
// IBlackboardManager
virtual IBlackboard* GetBlackboardGlobal() const
{
return m_pBlackboardGlobal;
}
virtual IBlackboard* GetBlackboardTeam( EGameTeam team ) const
{
IBlackboard* pBlackboard = 0;
if (m_BlackboardTeam[team].IsValid())
{
IObjectUtils::GetObject( &pBlackboard, m_BlackboardTeam[team] );
}
return pBlackboard;
}
virtual IBlackboard* GetBlackboardGroup( EGameObject type ) const
{
IBlackboard* pBlackboard = 0;
if (m_BlackboardGroup[type].IsValid())
{
IObjectUtils::GetObject( &pBlackboard, m_BlackboardGroup[type] );
}
return pBlackboard;
}
virtual IBlackboard* GetBlackboardIndividual( const IGameObject* pGameObject ) const
{
IBlackboard* pBlackboard = 0;
TIndividualMap::const_iterator it = m_BlackboardIndividual.find( pGameObject->GetObjectId() );
if (it != m_BlackboardIndividual.end())
{
IObjectUtils::GetObject( &pBlackboard, it->second );
}
return pBlackboard;
}
virtual IBlackboard* GetBlackboardIndividualCommon( const IGameObject* pGameObject ) const
{
IBlackboard* pBlackboard = 0;
TIndividualMap::const_iterator it = m_BlackboardIndividualCommon.find( pGameObject->GetObjectId() );
if (it != m_BlackboardIndividualCommon.end())
{
IObjectUtils::GetObject( &pBlackboard, it->second );
}
return pBlackboard;
}
virtual void ResetBlackboards()
{
DestroyAllBlackboards();
CreateSharedBlackboards();
}
// ~IBlackboardManager
private:
void CreateSharedBlackboards()
{
// Global
AU_ASSERT(!m_pBlackboardGlobal);
IObjectUtils::CreateObject( &m_pBlackboardGlobal, "BB_Global" );
// Team
m_BlackboardTeam[EGT_IMMUNE] = IObjectUtils::CreateObject( "BB_Team_Immune" )->GetObjectId();
m_BlackboardTeam[EGT_INFECTION] = IObjectUtils::CreateObject( "BB_Team_Infection" )->GetObjectId();
// Group
m_BlackboardGroup[EGO_WBC] = IObjectUtils::CreateObject( "BB_Group_WBC" )->GetObjectId();
m_BlackboardGroup[EGO_RBC] = IObjectUtils::CreateObject( "BB_Group_RBC" )->GetObjectId();
m_BlackboardGroup[EGO_VIRUS] = IObjectUtils::CreateObject( "BB_Group_Virus" )->GetObjectId();
m_BlackboardGroup[EGO_INFECTED] = IObjectUtils::CreateObject( "BB_Group_Infected" )->GetObjectId();
}
void CreateIndividualBlackboards( IGameObject* pGameObject )
{
ObjectId id = pGameObject->GetObjectId();
// Individual
TIndividualMap::iterator it = m_BlackboardIndividual.find(id);
AU_ASSERT(it == m_BlackboardIndividual.end());
if (it == m_BlackboardIndividual.end())
{
const char* text = 0;
switch (pGameObject->GetGameObjectType())
{
case EGO_WBC: text = "BB_Individual_WBC"; break;
case EGO_RBC: text = "BB_Individual_RBC"; break;
case EGO_VIRUS: text = "BB_Individual_Virus"; break;
case EGO_INFECTED: text = "BB_Individual_Infected"; break;
default: AU_ASSERT(false);
}
m_BlackboardIndividual[id] = IObjectUtils::CreateObject( text )->GetObjectId();
}
// IndividualCommon
it = m_BlackboardIndividualCommon.find(id);
AU_ASSERT(it == m_BlackboardIndividualCommon.end());
if (it == m_BlackboardIndividualCommon.end())
{
m_BlackboardIndividualCommon[id] = IObjectUtils::CreateObject( "BB_Individual_Common" )->GetObjectId();
}
}
void DestroyBlackboardIndividual( ObjectId id )
{
TIndividualMap::iterator it = m_BlackboardIndividual.find(id);
if (it != m_BlackboardIndividual.end())
{
IObjectFactorySystem* pFactory = PerModuleInterface::g_pSystemTable->pObjectFactorySystem;
IObject* pObj = pFactory->GetObject(it->second);
delete pObj;
m_BlackboardIndividual.erase(it);
}
}
void DestroyBlackboardIndividualCommon( ObjectId id )
{
TIndividualMap::iterator it = m_BlackboardIndividualCommon.find(id);
if (it != m_BlackboardIndividualCommon.end())
{
IObjectFactorySystem* pFactory = PerModuleInterface::g_pSystemTable->pObjectFactorySystem;
IObject* pObj = pFactory->GetObject(it->second);
delete pObj;
m_BlackboardIndividualCommon.erase(it);
}
}
void DestroyAllBlackboards()
{
IObjectFactorySystem* pFactory = PerModuleInterface::g_pSystemTable->pObjectFactorySystem;
IObject* pObj = 0;
delete m_pBlackboardGlobal;
m_pBlackboardGlobal = 0;
for (int i=0; i<EGT_COUNT; ++i)
{
pObj = pFactory->GetObject(m_BlackboardTeam[i]);
delete pObj;
m_BlackboardTeam[i] = ObjectId();
}
for (int i=0; i<EGO_COUNT; ++i)
{
pObj = pFactory->GetObject(m_BlackboardGroup[i]);
delete pObj;
m_BlackboardGroup[i] = ObjectId();
}
TIndividualMap::iterator it = m_BlackboardIndividual.begin();
TIndividualMap::iterator itEnd = m_BlackboardIndividual.end();
while (it != itEnd)
{
pObj = pFactory->GetObject(it->second);
delete pObj;
++it;
}
m_BlackboardIndividual.clear();
it = m_BlackboardIndividualCommon.begin();
itEnd = m_BlackboardIndividualCommon.end();
while (it != itEnd)
{
pObj = pFactory->GetObject(it->second);
delete pObj;
++it;
}
m_BlackboardIndividualCommon.clear();
}
void ModifyTeamCount( EGameTeam team, int delta )
{
IBlackboard* pTeam = GetBlackboardTeam(team);
switch (team)
{
case EGT_IMMUNE: ((BB_Team_Immune*)pTeam)->team_size += delta; break;
case EGT_INFECTION: ((BB_Team_Infection*)pTeam)->team_size += delta; break;
default: AU_ASSERT(false);
}
}
void ModifyGroupCount( EGameObject type, int delta )
{
IBlackboard* pGroup = GetBlackboardGroup(type);
switch (type)
{
case EGO_WBC: ((BB_Group_WBC*)pGroup)->group_size += delta; break;
case EGO_RBC: ((BB_Group_RBC*)pGroup)->group_size += delta; break;
case EGO_VIRUS: ((BB_Group_Virus*)pGroup)->group_size += delta; break;
case EGO_INFECTED: ((BB_Group_Infected*)pGroup)->group_size += delta; break;
default: AU_ASSERT(false);
}
}
void ModifyGlobalTeamCount( EGameTeam team, int delta )
{
BB_Global* pBBGlobal = (BB_Global*)GetBlackboardGlobal();
if (team == EGT_IMMUNE)
{
pBBGlobal->immune_count += delta;
}
else
{
pBBGlobal->infection_count += delta;
}
}
void SetInitialCommonValues( IGameObject* pGameObject )
{
BB_Individual_Common* pCommon = (BB_Individual_Common*)GetBlackboardIndividualCommon( pGameObject );
GameObjectParams& params = m_pGlobalParameters->go[pGameObject->GetGameObjectType()];
pCommon->current_health = params.initial_health;
pCommon->max_speed = params.max_speed;
pCommon->current_position = pGameObject->GetEntity()->GetPosition();
}
// Private Members
typedef std::map<ObjectId, ObjectId> TIndividualMap;
typedef std::vector<ObjectId> TObjectList;
IGameManager* m_pGameManager;
GlobalParameters* m_pGlobalParameters;
IBlackboard* m_pBlackboardGlobal;
TObjectList m_BlackboardTeam;
TObjectList m_BlackboardGroup;
TIndividualMap m_BlackboardIndividual;
TIndividualMap m_BlackboardIndividualCommon;
};
REGISTERCLASS(BlackboardManager);
// Register all blackboard classes here, since they're defined in headers
// And we get a link error if they get registered in more than one place
REGISTERCLASS(BB_Global);
REGISTERCLASS(BB_Team_Infection);
REGISTERCLASS(BB_Team_Immune);
REGISTERCLASS(BB_Group_WBC);
REGISTERCLASS(BB_Group_Virus);
REGISTERCLASS(BB_Group_RBC);
REGISTERCLASS(BB_Group_Infected);
REGISTERCLASS(BB_Individual_Common);
REGISTERCLASS(BB_Individual_WBC);
REGISTERCLASS(BB_Individual_RBC);
REGISTERCLASS(BB_Individual_Virus);
REGISTERCLASS(BB_Individual_Infected);

177
uft_dev_server/third_party/RCCPP/Examples/SimpleTest/CameraControl.cpp vendored

@ -0,0 +1,177 @@ @@ -0,0 +1,177 @@
//
// Copyright (c) 2010-2011 Matthew Jack and Doug Binks
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
#include "ICameraControl.h"
#include "../../Common/Math.inl"
#include "../../RuntimeObjectSystem/ObjectInterfacePerModule.h"
#include "../../Systems/SystemTable.h"
#include "../../Systems/IEntitySystem.h"
#include "../../Systems/IAssetSystem.h"
#include "../../Systems/ILogSystem.h"
#include "../../RuntimeObjectSystem/ISimpleSerializer.h"
#include "../../Systems/IGame.h"
#include <cmath>
#include <assert.h>
#include <algorithm>
//////////////////////////////////////////////////////////////////////////
// We serialize all the current camera values if any have been changed
// via ICameraControl interface, otherwise we reload the initial values
// below, allowing them to be experimented with at runtime
//////////////////////////////////////////////////////////////////////////
// Initial Values
static const AUVec3f initialPos = AUVec3f( 0.0f, -1000.0f, 0.0f );
static const float initialMoveSpeed = 10.0f;
class CameraControl: public ICameraControl
{
public:
CameraControl()
{
m_bModified = false;
m_currentPos = initialPos;
m_targetPos = initialPos;
m_fMoveSpeed = initialMoveSpeed;
m_fWindowWidth = 0;
m_fWindowHeight = 0;
}
virtual ~CameraControl()
{
if( m_pEntity )
{
m_pEntity->SetUpdateable(NULL);
}
}
// IEntityObject
virtual void Serialize(ISimpleSerializer *pSerializer)
{
AU_ASSERT(pSerializer);
IEntityObject::Serialize(pSerializer);
SERIALIZE(m_bModified);
if (m_bModified)
{
SERIALIZE(m_currentPos);
SERIALIZE(m_targetPos);
SERIALIZE(m_fMoveSpeed);
}
}
virtual void Init( bool isFirstInit )
{
m_pEntity->SetUpdateable( this );
PerModuleInterface::g_pSystemTable->pGame->GetWindowSize( m_fWindowWidth, m_fWindowHeight );
}
// ~IEntityObject
// IAUUpdateable
virtual void Update( float deltaTime )
{
if (m_currentPos != m_targetPos)
{
float fDist = (m_targetPos - m_currentPos).Magnitude();
float fFrameDist = std::min(fDist, m_fMoveSpeed * deltaTime);
float fInterp = fFrameDist / fDist;
m_currentPos = m_currentPos.Lerp(m_targetPos, fInterp);
}
}
// ~IAUUpdateable
// ICameraControl
virtual AUVec3f GetCurrentPos() const
{
return m_currentPos;
}
virtual AUVec3f GetTargetPos() const
{
return m_targetPos;
}
virtual void SetTargetPos(const AUVec3f& pos)
{
m_targetPos = pos;
m_bModified = true;
}
virtual float GetMoveSpeed() const
{
return m_fMoveSpeed;
}
virtual void SetMoveSpeed(float fSpeed)
{
m_fMoveSpeed = std::max(0.f, fSpeed);
m_bModified = true;
}
virtual AUVec3f Project( const AUVec3f& worldPos ) const
{
// Camera is simple orthographic, so projection operation is just a translation
// and a conversion of +z to -y (due to the flip of world space Z to screen space y)
AUVec3f screenPos = AUVec3f( worldPos.x + m_fWindowWidth * 0.5f - m_currentPos.x,
-( worldPos.z - m_fWindowHeight * 0.5f - m_currentPos.z ),
0.0f );
return screenPos;
}
virtual AUVec3f Unproject( const AUVec3f& screenPos ) const
{
// Camera is simple orthographic, so unprojection operation is just a translation
// and a conversion of +y to -z (due to the flip of screen space y to world space Z)
AUVec3f worldPos = AUVec3f( screenPos.x - m_fWindowWidth * 0.5f + m_currentPos.x,
0.0f,
-( screenPos.y - m_fWindowHeight * 0.5f - m_currentPos.z ) );
return worldPos;
}
// ~ICameraControl
private:
bool m_bModified;
AUVec3f m_currentPos;
AUVec3f m_targetPos;
float m_fMoveSpeed;
float m_fWindowWidth;
float m_fWindowHeight;
};
REGISTERCLASS(CameraControl);

50
uft_dev_server/third_party/RCCPP/Examples/SimpleTest/CompilerLogger.cpp vendored

@ -0,0 +1,50 @@ @@ -0,0 +1,50 @@
//
// Copyright (c) 2010-2011 Matthew Jack and Doug Binks
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
#include "CompilerLogger.h"
#include "Environment.h"
#include "../../Systems/SystemTable.h"
#include "../../Systems/ILogSystem.h"
#include <string>
#include <stdio.h>
#include <stdarg.h>
void CompilerLogger::LogError(const char * format, ...)
{
va_list args;
va_start(args, format);
m_pEnv->sys->pLogSystem->LogVa(args, eLV_ERRORS, format);
}
void CompilerLogger::LogWarning(const char * format, ...)
{
va_list args;
va_start(args, format);
m_pEnv->sys->pLogSystem->LogVa(args, eLV_WARNINGS, format);
}
void CompilerLogger::LogInfo(const char * format, ...)
{
va_list args;
va_start(args, format);
m_pEnv->sys->pLogSystem->LogVa(args, eLV_COMMENTS, format);
}

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save