22 #ifndef DIRECTOR_UTIL_H 23 #define DIRECTOR_UTIL_H 33 int castNumToNum(
const char *str);
34 char *numToCastNum(
int num);
52 Common::Path findPath(
const Common::Path &path,
bool currentFolder =
true,
bool searchPaths =
true,
bool directory =
false,
const char **exts =
nullptr);
53 Common::Path findPath(
const Common::String &path,
bool currentFolder =
true,
bool searchPaths =
true,
bool directory =
false,
const char **exts =
nullptr);
69 Common::Path dumpScriptName(
const char *prefix,
int type,
int id,
const char *ext);
70 Common::Path dumpFactoryName(
const char *prefix,
const char *name,
const char *ext);
72 bool isButtonSprite(SpriteType spriteType);
81 _seed = _mask = _len = 0;
84 void setSeed(
int seed);
85 uint32 getSeed() {
return _seed; }
86 int32 getRandom(int32 range);
90 int32 genNextRandom();
91 int32 perlin(int32 val);
98 uint16 humanVersion(uint16 ver);
103 Common::CodePage detectFontEncoding(
Common::Platform platform, uint16 fontId);
110 const char *d_strstr(
const char *str,
const char *substr);
120 inline byte lerpByte(byte a, byte b,
int alpha,
int span) {
121 int ai =
static_cast<int>(a);
122 int bi =
static_cast<int>(b);
123 span = CLIP<int>(span, 1, span);
124 alpha = CLIP<int>(alpha, 0, span);
125 return static_cast<byte
>((bi * alpha + ai * (span - alpha)) / span);
128 inline void lerpPalette(byte *target,
const byte *palA,
int palALength,
const byte *palB,
int palBLength,
int alpha,
int span) {
129 for (
int i = 0; i < 768; i++) {
130 target[i] = lerpByte(
131 i < palALength * 3 ? palA[i] : 0,
132 i < palBLength * 3 ? palB[i] : 0,
141 double readAppleFloat80(
void *ptr);
Path
Definition: game.h:75
Definition: algorithm.h:29
char32_t u32char_type_t
Definition: ustr.h:41
Language
Definition: language.h:45