From 4d351b8d07c25415d5848e9486eb5cb52f02d72e Mon Sep 17 00:00:00 2001 From: Bardur Arantsson Date: Tue, 16 Dec 2014 18:51:06 +0100 Subject: 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. --- src/spells1.cc | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src/spells1.cc') diff --git a/src/spells1.cc b/src/spells1.cc index 1c53fa8e..0f5e83c9 100644 --- a/src/spells1.cc +++ b/src/spells1.cc @@ -11,9 +11,14 @@ */ #include "angband.h" - #include "spell_type.h" +#include +#include + +using std::this_thread::sleep_for; +using std::chrono::milliseconds; + /* 1/x chance of reducing stats (for elemental attacks) */ #define HURT_CHANCE 32 @@ -8436,7 +8441,7 @@ bool_ project(int who, int rad, int y, int x, int dam, int typ, int flg) print_rel(c, a, y, x); move_cursor_relative(y, x); if (fresh_before) Term_fresh(); - Term_xtra(TERM_XTRA_DELAY, msec); + sleep_for(milliseconds(msec)); lite_spot(y, x); if (fresh_before) Term_fresh(); @@ -8462,7 +8467,7 @@ bool_ project(int who, int rad, int y, int x, int dam, int typ, int flg) else if (visual) { /* Delay for consistency */ - Term_xtra(TERM_XTRA_DELAY, msec); + sleep_for(milliseconds(msec)); } } } @@ -8580,7 +8585,7 @@ bool_ project(int who, int rad, int y, int x, int dam, int typ, int flg) /* Delay (efficiently) */ if (visual || drawn) { - Term_xtra(TERM_XTRA_DELAY, msec); + sleep_for(milliseconds(msec)); } } -- cgit v1.2.3