diff --git a/qw/source/sv_progs.c b/qw/source/sv_progs.c index 124a78dd3..84873b352 100644 --- a/qw/source/sv_progs.c +++ b/qw/source/sv_progs.c @@ -608,7 +608,7 @@ SV_Progs_Init_Cvars (void) sv_progs = Cvar_Get ("sv_progs", "", CVAR_NONE, NULL, "Override the default game progs."); sv_progs_zone = Cvar_Get ("sv_progs_zone", "256", CVAR_NONE, NULL, - "size of the zone for progs in kb"); + "size of the zone for progs in kB"); sv_progs_ext = Cvar_Get ("sv_progs_ext", "qf", CVAR_NONE, NULL, "extention mapping to use: " "none, id, qf, qwe, ktpro, cpqw"); diff --git a/qw/source/sv_sbar.c b/qw/source/sv_sbar.c index 81523ee33..e742b1c35 100644 --- a/qw/source/sv_sbar.c +++ b/qw/source/sv_sbar.c @@ -41,6 +41,7 @@ #include "sv_console.h" #include "qw/include/server.h" +#include "qw/include/sv_progs.h" #include "qw/include/sv_recorder.h" static void @@ -80,6 +81,26 @@ draw_rec (view_t *view) *d++ = *s; } +static void +draw_mem (view_t *view) +{ + sv_view_t *sv_view = view->data; + sv_sbar_t *sb = sv_view->obj; + const char *str; + const char *s; + char *d; + size_t used, size; + byte mask = 0; + + Z_MemInfo (sv_pr_state.zone, &used, &size); + str = va (0, "[mem: %4zd / %-4zd]", used / 1024, size / 1024); + if (used / (size / 256) >= 192) { + mask = 0x80; + } + for (s = str, d = sb->text + view->xrel; *s; s++) + *d++ = *s | mask; +} + void SV_Sbar_Init (void) { @@ -99,4 +120,9 @@ SV_Sbar_Init (void) view->draw = draw_rec; view->data = status->data; view_add (status, view); + + view = view_new (19, 0, 18, 1, grav_northwest); + view->draw = draw_mem; + view->data = status->data; + view_add (status, view); }