ScummVM API documentation
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
debug_pc.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * Additional copyright for this file:
8  * Copyright (C) 1999-2000 Revolution Software Ltd.
9  * This code is based on source code created by Revolution Software,
10  * used with permission.
11  *
12  * This program is free software: you can redistribute it and/or modify
13  * it under the terms of the GNU General Public License as published by
14  * the Free Software Foundation, either version 3 of the License, or
15  * (at your option) any later version.
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU General Public License for more details.
21  *
22  * You should have received a copy of the GNU General Public License
23  * along with this program. If not, see <http://www.gnu.org/licenses/>.
24  *
25  */
26 
27 #ifndef ICB_DEBUG_PC_H
28 #define ICB_DEBUG_PC_H
29 
30 #include "common/system.h"
31 
32 namespace ICB {
33 
34 extern bool8 zdebug;
35 
36 void NORETURN_PRE Fatal_error(const char *format, ...) NORETURN_POST;
37 void Message_box(const char *text, ...);
38 void ExitWithReport(char *format, ...);
39 void Zdebug(const char *, ...);
40 void Zdebug(uint32 stream, const char *format, ...);
41 void Tdebug(const char *file, const char *format, ...);
42 
43 #define Real_Fatal_error Fatal_error
44 #define Real_Message_box Message_box
45 
46 // XXX: FIXME: This function stores the number of elapsed microseconds in an unsigned 32-bit int, which will overflow in just over an
47 // hour...
48 // We should make sure all the client code deals with this properly!
49 inline uint32 GetMicroTimer(void) {
50  static int32 first = 1;
51 
52  static TimeDate startTime;
53  if (first) {
54  g_system->getTimeAndDate(startTime);
55  first = 0;
56  }
57 
58  TimeDate curTime;
59  g_system->getTimeAndDate(curTime);
60  return (uint32)(((curTime.tm_sec - startTime.tm_sec) * 1000000));// + (curTime.tv_usec - startTime.tv_usec)); // TODO: Fix micro-second-precision.
61 }
62 
63 } // End of namespace ICB
64 
65 #endif // #ifndef DEBUG_PC_H
virtual void getTimeAndDate(TimeDate &td, bool skipRecord=false) const =0
Definition: system.h:106
Definition: actor.h:32
OSystem * g_system
int tm_sec
Definition: system.h:107