2 Copyright (C) 1998 BJ Eirich (aka vecna)
\r
3 This program is free software; you can redistribute it and/or
\r
4 modify it under the terms of the GNU General Public License
\r
5 as published by the Free Software Foundation; either version 2
\r
6 of the License, or (at your option) any later version.
\r
7 This program is distributed in the hope that it will be useful,
\r
8 but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
9 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
\r
10 See the GNU General Public Lic
\r
11 See the GNU General Public License for more details.
\r
12 You should have received a copy of the GNU General Public License
\r
13 along with this program; if not, write to the Free Software
\r
14 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
\r
19 // ================================= Data ====================================
\r
23 char text[44]; // message text
\r
24 int exptime; // message expire time
\r
27 struct message messages[6]; // 5-message buffer
\r
28 byte num_msgs=0; // number of active messages
\r
32 int cputimer=0, frames=0;
\r
34 // -- final numbers --
\r
38 // ================================= Code ====================================
\r
40 void CheckMessageExpirations()
\r
43 for (i=0; i<num_msgs; i++)
\r
44 if (systemtime>messages[i].exptime)
\r
46 memcpy(messages[i].text, messages[i+1].text, (48*(num_msgs-i+1)));
\r
54 CheckMessageExpirations();
\r
55 for (i=0; i<num_msgs; i++)
\r
58 printstring(0,messages[i].text);
\r
61 if (!cpu_watch) return;
\r
66 sprintf(strbuf,"etc:%d",profile[0]);
\r
67 printstring(0,strbuf);
\r
69 sprintf(strbuf,"Render:%d",profile[1]);
\r
70 printstring(0,strbuf);
\r
72 sprintf(strbuf,"PFlip:%d",profile[2]);
\r
73 printstring(0,strbuf);
\r
75 sprintf(strbuf,"FPS:%d",fps);
\r
76 printstring(0,strbuf);
\r
89 profile[0]=runprf[0]; runprf[0]=0;
\r
90 profile[1]=runprf[1]; runprf[1]=0;
\r
91 profile[2]=runprf[2]; runprf[2]=0;
\r
95 void Message(char *text, int duration)
\r
97 Log("Message: %s", text);
\r
101 memcpy(messages[num_msgs].text, text, strlen(text));
\r
102 messages[num_msgs].exptime=systemtime+duration;
\r
107 memcpy(&messages[0].text, &messages[1].text, 192);
\r
108 memcpy(messages[4].text, text, strlen(text));
\r
109 messages[num_msgs].exptime=systemtime+duration;
\r