TexGen
ShinyTools.h
Go to the documentation of this file.
1/*
2The zlib/libpng License
3
4Copyright (c) 2007 Aidin Abedi (www.*)
5
6This software is provided 'as-is', without any express or implied warranty. In no event will
7the authors be held liable for any damages arising from the use of this software.
8
9Permission is granted to anyone to use this software for any purpose, including commercial
10applications, and to alter it and redistribute it freely, subject to the following
11restrictions:
12
13 1. The origin of this software must not be misrepresented; you must not claim that
14 you wrote the original software. If you use this software in a product,
15 an acknowledgment in the product documentation would be appreciated but is
16 not required.
17
18 2. Altered source versions must be plainly marked as such, and must not be
19 misrepresented as being the original software.
20
21 3. This notice may not be removed or altered from any source distribution.
22*/
23
24#ifndef SHINY_TOOLS_H
25#define SHINY_TOOLS_H
26
27#include "ShinyPrereqs.h"
28
29
30namespace Shiny {
31
32
33//-----------------------------------------------------------------------------
34
35 struct TimeUnit {
36 float tickFreq;
38 const char* suffix;
39 };
40
41 const TimeUnit* GetTimeUnit(float ticks);
42
43
44//-----------------------------------------------------------------------------
45
46 void GetTicks(tick_t *p);
47
49
50 float GetTickInvFreq(void);
51
52
53//-----------------------------------------------------------------------------
54
55#if SHINY_COMPILER == SHINY_COMPILER_MSVC
56# pragma warning(disable: 4311)
57#endif
58
59 inline uint32_t ptr32(const void *a_Ptr) {
60 return reinterpret_cast<uint32_t>(a_Ptr);
61 }
62
63#if SHINY_COMPILER == SHINY_COMPILER_MSVC
64# pragma warning(default: 4311)
65#endif
66
67
68} // namespace Shiny
69
70#endif // ifndef SHINY_*_H
uint64_t tick_t
Definition: ShinyPrereqs.h:77
uint32_t ptr32(const void *a_Ptr)
Definition: ShinyTools.h:59
tick_t GetTickFreq(void)
float GetTickInvFreq(void)
void GetTicks(tick_t *p)
const TimeUnit * GetTimeUnit(float ticks)
const char * suffix
Definition: ShinyTools.h:38
float invTickFreq
Definition: ShinyTools.h:37