ScummVM API documentation
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
misc.h
1 
2 /* ScummVM - Graphic Adventure Engine
3  *
4  * ScummVM is the legal property of its developers, whose names
5  * are too numerous to list here. Please refer to the COPYRIGHT
6  * file distributed with this source distribution.
7  *
8  * This program is free software: you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation, either version 3 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program. If not, see <http://www.gnu.org/licenses/>.
20  *
21  */
22 
23 #ifndef BAGEL_BOFLIB_MISC_H
24 #define BAGEL_BOFLIB_MISC_H
25 
26 #include "bagel/boflib/stdinc.h"
27 
28 namespace Bagel {
29 
30 extern int mapWindowsPointSize(int pointSize);
31 
35 extern void timerStart();
36 
41 extern uint32 timerStop();
42 
46 extern uint32 getTimer();
47 
52 extern void bofSleep(uint32 milli);
53 
54 extern Fixed fixedDivide(Fixed Dividend, Fixed Divisor);
55 extern Fixed fixedMultiply(Fixed Multiplicand, Fixed Multiplier);
56 
57 #define intToFixed(i) (Fixed)(((long)(i)) << 16)
58 #define fixedToInt(f) (int)(((long)(f)) >> 16)
59 
61 //
62 // Memory allocation routines (Should be put into their own MEMORY module)
63 //
65 
66 
75 extern void *bofMemAlloc(uint32 nSize, const char *pFile, int nLine, bool bClear);
76 
81 extern void bofMemFree(void *pBuf);
82 
83 #define bofAlloc(n) bofMemAlloc((n), __FILE__, __LINE__, false)
84 #define bofCleanAlloc(n) bofMemAlloc((n), __FILE__, __LINE__, true)
85 #define bofFree(p) bofMemFree((p))
86 
87 inline uint32 getFreePhysMem() {
88  return 999999;
89 }
90 
97 void encrypt(void *pBuf, int32 lSize, const char *pszPassword = nullptr);
98 #define decrypt encrypt
99 
100 extern void encryptPartial(void *, int32, int32, const char *pPassword = nullptr);
101 #define decryptPartial encryptPartial
102 
103 } // namespace Bagel
104 
105 #endif
Definition: bagel.h:31