Skip to content

Commit

Permalink
Fixed #47 - building on Windows 10
Browse files Browse the repository at this point in the history
Former-commit-id: eba3ede
  • Loading branch information
mwydmuch committed Jul 8, 2017
1 parent 2891c6b commit 29dd5b3
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 11 deletions.
6 changes: 4 additions & 2 deletions CMakeLists.txt
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,11 @@ if (WIN32)
macro(get_WIN32_WINNT version)
if (WIN32 AND CMAKE_SYSTEM_VERSION)
set(ver ${CMAKE_SYSTEM_VERSION})
string(REPLACE "10" "A" ver ${ver})
string(REPLACE "." "" ver ${ver})
string(REGEX REPLACE "([0-9])" "0\\1" ver ${ver})

string(REGEX REPLACE "([A-F0-9])" "0\\1" ver ${ver})
string(SUBSTRING ${ver} 0 4 ver)

set(${version} "0x${ver}")
endif ()
endmacro()
Expand Down
3 changes: 3 additions & 0 deletions doc/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
#### Python specific
- Added manual GIL management for better performance when used with Python threads.

#### Windows specific
- Fixed building for Windows 10.


## Changes in 1.1.2

Expand Down
3 changes: 3 additions & 0 deletions doc/DoomGame.md
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,7 @@ See also:
| Python | `void add_game_args(str args)` |

Adds a custom argument that will be passed to ViZDoom process during initialization.
Useful for changing additional game settings.

Config key: `gameArgs/game_args`

Expand Down Expand Up @@ -1058,6 +1059,7 @@ Returns true if the depth buffer is enabled.
Added in 1.1.0

Enables rendering of the depth buffer, it will be available in state.
Depth buffer will contain noise if `viz_nocheat` is enabled.

Default value: false

Expand Down Expand Up @@ -1094,6 +1096,7 @@ Returns true if the labels buffer is enabled.
Added in 1.1.0

Enables rendering of the labels buffer, it will be available in state with vector of `Label`s.
LabelsBuffer will contain noise if `viz_nocheat` is enabled.

Default value: false

Expand Down
1 change: 0 additions & 1 deletion examples/python/vizdoom

This file was deleted.

22 changes: 14 additions & 8 deletions src/vizdoom/src/viz_main.cpp
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@
*/

#include <boost/interprocess/ipc/message_queue.hpp>
#include <boost/thread.hpp>
#ifndef VIZ_OS_WIN
#include <boost/thread.hpp>
#endif

#include "viz_main.h"
#include "viz_defines.h"
Expand All @@ -39,7 +41,9 @@
#include "i_system.h"

namespace b = boost;
namespace bt = boost::this_thread;
#ifndef VIZ_OS_WIN
namespace bt = boost::this_thread;
#endif

/* CVARs and CCMDs */
/*--------------------------------------------------------------------------------------------------------------------*/
Expand Down Expand Up @@ -487,10 +491,12 @@ void VIZ_DebugMsg(int level, const char *func, const char *msg, ...){
}

void VIZ_InterruptionPoint(){
try{
bt::interruption_point();
}
catch(b::thread_interrupted &ex){
exit(0);
}
#ifndef VIZ_OS_WIN
try{
bt::interruption_point();
}
catch(b::thread_interrupted &ex){
exit(0);
}
#endif
}

0 comments on commit 29dd5b3

Please sign in to comment.