diff options
author | Bardur Arantsson <bardur@scientician.net> | 2014-12-16 18:51:06 +0100 |
---|---|---|
committer | Bardur Arantsson <bardur@scientician.net> | 2014-12-16 18:54:55 +0100 |
commit | 4d351b8d07c25415d5848e9486eb5cb52f02d72e (patch) | |
tree | 0b8045630e146eaa870280e2d3e7f13e50499ad2 /src/spells2.cc | |
parent | ff252acf7f2f38e33017e82881c95825b54c7cee (diff) |
Replace usleep with C++11 this_thread::sleep_for()
Also remove TERM_XTRA_DELAY. The terminal abstraction should
not be used for providing general platform independence. As a
side effect this reintroduces support for "delay" on SDL, not
sure if that's a good idea or not.
Diffstat (limited to 'src/spells2.cc')
-rw-r--r-- | src/spells2.cc | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/spells2.cc b/src/spells2.cc index 4e502d8e..2dbfff43 100644 --- a/src/spells2.cc +++ b/src/spells2.cc @@ -13,8 +13,13 @@ #include "angband.h" #include "hooks.h" +#include <chrono> +#include <thread> #include <vector> +using std::this_thread::sleep_for; +using std::chrono::milliseconds; + #define WEIRD_LUCK 12 #define BIAS_LUCK 20 /* @@ -5080,7 +5085,7 @@ bool_ invoke(int dam, int typee) Term_fresh(); /* Delay */ - Term_xtra(TERM_XTRA_DELAY, msec); + sleep_for(milliseconds(msec)); /* Take note */ result = TRUE; @@ -5156,7 +5161,7 @@ bool_ genocide_aux(bool_ player_cast, char typ) Term_fresh(); /* Delay */ - Term_xtra(TERM_XTRA_DELAY, msec); + sleep_for(milliseconds(msec)); /* Take note */ result = TRUE; @@ -5281,7 +5286,7 @@ bool_ mass_genocide(bool_ player_cast) Term_fresh(); /* Delay */ - Term_xtra(TERM_XTRA_DELAY, msec); + sleep_for(milliseconds(msec)); /* Note effect */ result = TRUE; |