devilutionX/Source/qol/common.cpp
Gleb Mazovetskiy 7e1fea6f76 clang-format all files in {Source,test}/
Also includes a few manual tweaks to comments and newlines for better results.

Co-authored-by: Anders Jenbo <anders@jenbo.dk>
2021-11-24 23:44:12 +01:00

40 lines
707 B
C++

/**
* @file common.h
*
* Common functions for QoL features
*/
#include <SDL.h>
#include "common.h"
#include "engine.h"
#include "engine/render/text_render.hpp"
#include "qol/monhealthbar.h"
#include "qol/xpbar.h"
#include "utils/language.h"
namespace devilution {
char *PrintWithSeparator(char *out, int n)
{
if (n < 1000) {
return out + sprintf(out, "%d", n);
}
char *append = PrintWithSeparator(out, n / 1000);
return append + sprintf(append, _(/* TRANSLATORS: Decimal separator */ ",%03d"), n % 1000);
}
void FreeQol()
{
FreeMonsterHealthBar();
FreeXPBar();
}
void InitQol()
{
InitMonsterHealthBar();
InitXPBar();
}
} // namespace devilution