summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/stuff.h
blob: bb4433bda22e5c64bc2519c73d2f20f5fd37f342 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/**
 * @file
 * @brief Misc stuff.
**/

#ifndef STUFF_H
#define STUFF_H

#include <map>
#include "player.h"

// time

string make_time_string(time_t abs_time, bool terse = false);
string make_file_time(time_t when);

// redraw

void set_redraw_status(uint64_t flags);

void redraw_screen();

// stepdowns

enum rounding_type
{
    ROUND_DOWN,
    ROUND_CLOSE,
    ROUND_RANDOM
};

double stepdown(double value, double step);
int stepdown(int value, int step, rounding_type = ROUND_CLOSE, int max = 0);
int stepdown_value(int base_value, int stepping, int first_step,
                   int last_step, int ceiling_value);

#endif