mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-13 00:24:12 +00:00
some minor work getting the client side of libQFconsole working, but nowhere
near complete.
This commit is contained in:
parent
6053f1feac
commit
bdf45386f0
2 changed files with 20 additions and 27 deletions
|
@ -43,6 +43,9 @@ typedef struct console_func_s {
|
||||||
} console_funcs_t;
|
} console_funcs_t;
|
||||||
|
|
||||||
typedef struct console_data_s {
|
typedef struct console_data_s {
|
||||||
|
const char *dl_name;
|
||||||
|
int dl_percent;
|
||||||
|
double realtime;
|
||||||
} console_data_t;
|
} console_data_t;
|
||||||
|
|
||||||
#endif // __QF_plugin_console_h_
|
#endif // __QF_plugin_console_h_
|
||||||
|
|
|
@ -54,6 +54,10 @@
|
||||||
|
|
||||||
#include "compat.h"
|
#include "compat.h"
|
||||||
|
|
||||||
|
static general_data_t plugin_info_general_data;
|
||||||
|
static console_data_t plugin_info_console_data;
|
||||||
|
#define con_data plugin_info_console_data
|
||||||
|
|
||||||
int con_ormask;
|
int con_ormask;
|
||||||
console_t con_main;
|
console_t con_main;
|
||||||
console_t con_chat;
|
console_t con_chat;
|
||||||
|
@ -332,10 +336,8 @@ C_Print (const char *fmt, va_list args)
|
||||||
if (!con->x) {
|
if (!con->x) {
|
||||||
Con_Linefeed ();
|
Con_Linefeed ();
|
||||||
// mark time for transparent overlay
|
// mark time for transparent overlay
|
||||||
/*XXX
|
|
||||||
if (con->current >= 0)
|
if (con->current >= 0)
|
||||||
con_times[con->current % NUM_CON_TIMES] = realtime;
|
con_times[con->current % NUM_CON_TIMES] = con_data.realtime;
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (c) {
|
switch (c) {
|
||||||
|
@ -387,10 +389,8 @@ Con_DrawInput (void)
|
||||||
text[i] = ' ';
|
text[i] = ' ';
|
||||||
|
|
||||||
// add the cursor frame
|
// add the cursor frame
|
||||||
/*XXX
|
if ((int) (con_data.realtime * con_cursorspeed) & 1)
|
||||||
if ((int) (realtime * con_cursorspeed) & 1)
|
|
||||||
text[key_linepos] = 11;
|
text[key_linepos] = 11;
|
||||||
*/
|
|
||||||
|
|
||||||
// prestep if horizontally scrolling
|
// prestep if horizontally scrolling
|
||||||
if (key_linepos >= con_linewidth)
|
if (key_linepos >= con_linewidth)
|
||||||
|
@ -422,9 +422,7 @@ Con_DrawNotify (void)
|
||||||
time = con_times[i % NUM_CON_TIMES];
|
time = con_times[i % NUM_CON_TIMES];
|
||||||
if (time == 0)
|
if (time == 0)
|
||||||
continue;
|
continue;
|
||||||
/*XXX
|
time = con_data.realtime - time;
|
||||||
time = realtime - time;
|
|
||||||
*/
|
|
||||||
if (time > con_notifytime->value)
|
if (time > con_notifytime->value)
|
||||||
continue;
|
continue;
|
||||||
text = con->text + (i % con_totallines) * con_linewidth;
|
text = con->text + (i % con_totallines) * con_linewidth;
|
||||||
|
@ -458,10 +456,8 @@ Con_DrawNotify (void)
|
||||||
Draw_Character ((x + skip) << 3, v, s[x]);
|
Draw_Character ((x + skip) << 3, v, s[x]);
|
||||||
x++;
|
x++;
|
||||||
}
|
}
|
||||||
/* XXX
|
|
||||||
Draw_Character ((x + skip) << 3, v,
|
Draw_Character ((x + skip) << 3, v,
|
||||||
10 + ((int) (realtime * con_cursorspeed) & 1));
|
10 + ((int) (con_data.realtime * con_cursorspeed) & 1));
|
||||||
*/
|
|
||||||
v += 8;
|
v += 8;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -525,15 +521,13 @@ void
|
||||||
Con_DrawDownload (int lines)
|
Con_DrawDownload (int lines)
|
||||||
{
|
{
|
||||||
char dlbar[1024];
|
char dlbar[1024];
|
||||||
const char *text = 0; //XXX
|
const char *text;
|
||||||
int i, j, x, y, n = 0; //XXX n
|
int i, j, x, y, n;
|
||||||
|
|
||||||
/*XXX
|
if (!con_data.dl_name)
|
||||||
if (!cls.download)
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
text = COM_SkipPath(cls.downloadname);
|
text = COM_SkipPath(con_data.dl_name);
|
||||||
*/
|
|
||||||
|
|
||||||
x = con_linewidth - ((con_linewidth * 7) / 40);
|
x = con_linewidth - ((con_linewidth * 7) / 40);
|
||||||
y = x - strlen (text) - 8;
|
y = x - strlen (text) - 8;
|
||||||
|
@ -549,12 +543,11 @@ Con_DrawDownload (int lines)
|
||||||
i = strlen (dlbar);
|
i = strlen (dlbar);
|
||||||
dlbar[i++] = '\x80';
|
dlbar[i++] = '\x80';
|
||||||
// where's the dot go?
|
// where's the dot go?
|
||||||
/*XXX
|
if (con_data.dl_percent == 0)
|
||||||
if (cls.downloadpercent == 0)
|
|
||||||
n = 0;
|
n = 0;
|
||||||
else
|
else
|
||||||
n = y * cls.downloadpercent / 100;
|
n = y * con_data.dl_percent / 100;
|
||||||
*/
|
|
||||||
for (j = 0; j < y; j++)
|
for (j = 0; j < y; j++)
|
||||||
if (j == n)
|
if (j == n)
|
||||||
dlbar[i++] = '\x83';
|
dlbar[i++] = '\x83';
|
||||||
|
@ -563,10 +556,9 @@ Con_DrawDownload (int lines)
|
||||||
dlbar[i++] = '\x82';
|
dlbar[i++] = '\x82';
|
||||||
dlbar[i] = 0;
|
dlbar[i] = 0;
|
||||||
|
|
||||||
/*XXX
|
|
||||||
snprintf (dlbar + strlen (dlbar), sizeof (dlbar) - strlen (dlbar),
|
snprintf (dlbar + strlen (dlbar), sizeof (dlbar) - strlen (dlbar),
|
||||||
" %02d%%", cls.downloadpercent);
|
" %02d%%", con_data.dl_percent);
|
||||||
*/
|
|
||||||
// draw it
|
// draw it
|
||||||
y = lines - 22 + 8;
|
y = lines - 22 + 8;
|
||||||
for (i = 0; i < strlen (dlbar); i++)
|
for (i = 0; i < strlen (dlbar); i++)
|
||||||
|
@ -583,8 +575,6 @@ static general_funcs_t plugin_info_general_funcs = {
|
||||||
C_Shutdown,
|
C_Shutdown,
|
||||||
};
|
};
|
||||||
|
|
||||||
static general_data_t plugin_info_general_data;
|
|
||||||
static console_data_t plugin_info_console_data;
|
|
||||||
static console_funcs_t plugin_info_console_funcs = {
|
static console_funcs_t plugin_info_console_funcs = {
|
||||||
C_Print,
|
C_Print,
|
||||||
C_ProcessInput,
|
C_ProcessInput,
|
||||||
|
|
Loading…
Reference in a new issue