-
Notifications
You must be signed in to change notification settings - Fork 0
/
GPU_osd.h
118 lines (92 loc) · 2.53 KB
/
GPU_osd.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
/* Copyright (C) 2006 yopyop
yopyop156.ifrance.com
Copyright (C) 2006-2008 DeSmuME team
This file is part of DeSmuME
DeSmuME is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
DeSmuME is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with DeSmuME; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef __GPU_OSD_
#define __GPU_OSD_
#include <stdlib.h>
#include <time.h>
#include "types.h"
#include "aggdraw.h"
#define OSD_MAX_LINES 4
#define OSD_TIMER_SECS 2
struct HudCoordinates{
int x;
int y;
int xsize;
int ysize;
int storedx;
int storedy;
int clicked;
};
struct HudStruct
{
public:
HudStruct()
: fps(0)
, fps3d(0)
{}
HudCoordinates SavestateSlots;
HudCoordinates FpsDisplay;
HudCoordinates FrameCounter;
HudCoordinates InputDisplay;
HudCoordinates LagFrameCounter;
HudCoordinates Microphone;
HudCoordinates Dummy;
bool ShowInputDisplay;
bool FrameCounterDisplay;
bool ShowLagFrameCounter;
bool DisplayStateSlots;
HudCoordinates &hud(int i) { return ((HudCoordinates*)this)[i]; }
void reset();
int fps, fps3d;
};
void EditHud(s32 x, s32 y, HudStruct *hudstruct);
void HudClickRelease(HudStruct *hudstruct);
void DrawHUD();
extern HudStruct Hud;
extern bool HudEditorMode;
class OSDCLASS
{
private:
u64 offset;
u8 mode;
u16 rotAngle;
u16 lineText_x;
u16 lineText_y;
AggColor lineText_color;
u8 lastLineText;
char *lineText[OSD_MAX_LINES+1];
time_t lineTimer[OSD_MAX_LINES+1];
AggColor lineColor[OSD_MAX_LINES+1];
bool needUpdate;
bool checkTimers();
public:
char name[7]; // for debuging
OSDCLASS(u8 core);
~OSDCLASS();
void setOffset(u16 ofs);
void setRotate(u16 angle);
void update();
void clear();
void setListCoord(u16 x, u16 y);
void setLineColor(u8 r, u8 b, u8 g);
void addLine(const char *fmt, ...);
void addFixed(u16 x, u16 y, const char *fmt, ...);
void border(bool enabled);
};
extern OSDCLASS *osd;
#endif