22 #ifndef DIRECTOR_UTIL_H 23 #define DIRECTOR_UTIL_H 33 int castNumToNum(
const char *str);
34 char *numToCastNum(
int num);
51 Common::Path findPath(
const Common::Path &path,
bool currentFolder =
true,
bool searchPaths =
true,
bool directory =
false,
const char **exts =
nullptr);
52 Common::Path findPath(
const Common::String &path,
bool currentFolder =
true,
bool searchPaths =
true,
bool directory =
false,
const char **exts =
nullptr);
68 Common::Path dumpScriptName(
const char *prefix,
int type,
int id,
const char *ext);
69 Common::Path dumpFactoryName(
const char *prefix,
const char *name,
const char *ext);
71 bool isButtonSprite(SpriteType spriteType);
80 _seed = _mask = _len = 0;
83 void setSeed(
int seed);
84 uint32 getSeed() {
return _seed; }
85 int32 getRandom(int32 range);
89 int32 genNextRandom();
90 int32 perlin(int32 val);
97 uint16 humanVersion(uint16 ver);
102 Common::CodePage detectFontEncoding(
Common::Platform platform, uint16 fontId);
109 const char *d_strstr(
const char *str,
const char *substr);
119 inline byte lerpByte(byte a, byte b,
int alpha,
int span) {
120 int ai =
static_cast<int>(a);
121 int bi =
static_cast<int>(b);
122 span = CLIP<int>(span, 1, span);
123 alpha = CLIP<int>(alpha, 0, span);
124 return static_cast<byte
>((bi * alpha + ai * (span - alpha)) / span);
127 inline void lerpPalette(byte *target, byte *palA,
int palALength, byte *palB,
int palBLength,
int alpha,
int span) {
128 for (
int i = 0; i < 768; i++) {
129 target[i] = lerpByte(
130 i < palALength * 3 ? palA[i] : 0,
131 i < palBLength * 3 ? palB[i] : 0,
140 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