Skip to content
Permalink
Browse files

Update RLBotCPP submodule.

  • Loading branch information...
kipje13 committed Aug 21, 2019
1 parent 870b2f4 commit 36df5e444103323f75fdc01e7cf617994c7e3158
Showing with 6 additions and 46 deletions.
  1. +0 −16 CMakeLists.txt
  2. +1 −1 RLBotCPP
  3. +0 −9 dlls/copy-dlls.py
  4. +5 −20 main.cc
@@ -8,22 +8,6 @@ target_link_libraries(CPPExampleBot RLBotCPP)
target_include_directories(CPPExampleBot PRIVATE RLBotCPP/inc RLBotCPP/lib/inc)
target_compile_features(CPPExampleBot PRIVATE cxx_std_17)

# Copy interface dll to output folder
add_custom_command(TARGET CPPExampleBot POST_BUILD
COMMAND python ${PROJECT_SOURCE_DIR}/dlls/copy-dlls.py)

if(CMAKE_SIZEOF_VOID_P EQUAL 8)
add_custom_command(TARGET CPPExampleBot POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${PROJECT_SOURCE_DIR}/dlls/RLBot_Core_Interface.dll"
$<TARGET_FILE_DIR:CPPExampleBot>)
elseif(CMAKE_SIZEOF_VOID_P EQUAL 4)
add_custom_command(TARGET CPPExampleBot POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${PROJECT_SOURCE_DIR}/dlls/RLBot_Core_Interface_32.dll"
$<TARGET_FILE_DIR:CPPExampleBot>)
endif()

# Copy port config to output folder
add_custom_command(TARGET CPPExampleBot POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different

This file was deleted.

25 main.cc
@@ -23,28 +23,13 @@ uint16_t getPortFromFile(std::string filename) {
}

int main(int argc, char **argv) {
// Set the working directory to the directory of this executable so we can use
// relative paths.
rlbot::platform::SetWorkingDirectory(
rlbot::platform::GetExecutableDirectory());
uint16_t port = getPortFromFile("port.cfg");

std::string interface_dll = std::string(DLLNAME);

// parse arguments
for (int i = 1; i < argc; ++i) {
std::string arg(argv[i]);
rlbot::platform::GetExecutableDirectory());

if ((arg == "-dll-path") && i + 1 < argc) {
interface_dll = std::string(argv[++i]) + "\\" + DLLNAME;
} else {
std::cerr << "Bad option: '" << arg << "'" << std::endl;
}
}

rlbot::Interface::LoadInterface(interface_dll);

while (!rlbot::Interface::IsInitialized()) {
rlbot::platform::SleepMilliseconds(1);
}
// Read the port that we use for receiving bot spawn messages.
uint16_t port = getPortFromFile("port.cfg");

rlbot::BotManager<ExampleBot> botmanager;
botmanager.StartBotServer(port);

0 comments on commit 36df5e4

Please sign in to comment.
You can’t perform that action at this time.