Quake II RTX doxygen
1.0 dev
|
|
#include "ui.h"
#include "common/files.h"
#include "common/mdfour.h"
Go to the source code of this file.
◆ COL_DATE
◆ COL_MAP
◆ COL_MAX
◆ COL_NAME
◆ COL_POV
◆ COL_SIZE
◆ DEMO_DIR_SIZE
#define DEMO_DIR_SIZE "\x90\xc4\xc9\xd2\x91" |
◆ DEMO_EXTENSIONS
#define DEMO_EXTENSIONS ".dm2;.dm2.gz;.mvd2;.mvd2.gz" |
◆ DEMO_EXTRASIZE
◆ DEMO_MVD_POV
#define DEMO_MVD_POV "\x90\xcd\xd6\xc4\x91" |
◆ ENTRY_DEMO
◆ ENTRY_DN
◆ ENTRY_UP
◆ m_demos_t
◆ Activate()
◆ BuildDir()
static void BuildDir |
( |
const char * |
name, |
|
|
int |
type |
|
) |
| |
|
static |
◆ BuildList()
Definition at line 275 of file demos.c.
277 int numDirs, numDemos;
278 void **dirlist, **demolist;
293 FS_SEARCH_DIRSONLY, &numDirs);
295 FS_SEARCH_EXTRAINFO, &numDemos);
316 for (i = 0; i < numDirs; i++) {
327 if ((cache =
LoadCache(demolist)) != NULL) {
329 for (i = 0; i < numDemos; i++) {
334 for (i = 0; i < numDemos; i++) {
358 "%d demo%s, ", i, i == 1 ?
"" :
"s");
Referenced by EnterDirectory(), Expose(), and LeaveDirectory().
◆ BuildName()
static void BuildName |
( |
const file_info_t * |
info, |
|
|
char ** |
cache |
|
) |
| |
|
static |
Definition at line 74 of file demos.c.
76 char buffer[MAX_OSPATH];
83 memset(&demo, 0,
sizeof(demo));
84 strcpy(demo.map,
"???");
85 strcpy(demo.pov,
"???");
89 char *p = strchr(s,
'\\');
111 len = strlen(demo.map);
119 len = strlen(demo.pov);
126 if ((tm = localtime(&info->mtime)) != NULL) {
128 len = strftime(date,
sizeof(date),
"%b %d %H:%M", tm);
130 len = strftime(date,
sizeof(date),
"%b %d %Y", tm);
140 info->name, date, buffer, demo.map, demo.pov, NULL);
142 e->
size = info->size;
143 e->
mtime = info->mtime;
Referenced by BuildList().
◆ CalcHash()
Definition at line 238 of file demos.c.
247 len =
sizeof(*info) + strlen(info->name) - 1;
Referenced by BuildList().
◆ Change()
◆ Draw()
◆ EnterDirectory()
◆ Expose()
Definition at line 586 of file demos.c.
588 time_t now = time(NULL);
589 struct tm *tm = localtime(&now);
Referenced by M_Menu_Demos().
◆ Free()
◆ FreeList()
◆ Keydown()
◆ LeaveDirectory()
◆ LoadCache()
static char* LoadCache |
( |
void ** |
list | ) |
|
|
static |
Definition at line 161 of file demos.c.
163 char buffer[MAX_OSPATH], *cache;
169 if (len >=
sizeof(buffer)) {
172 len =
FS_LoadFileEx(buffer, (
void **)&cache, FS_TYPE_REAL | FS_PATH_GAME, TAG_FILESYSTEM);
180 for (i = 0; i < 16; i++) {
181 int c1 = Q_charhex(cache[i * 2 + 0]);
182 int c2 = Q_charhex(cache[i * 2 + 1]);
183 hash[i] = (c1 << 4) | c2;
186 if (cache[32] !=
'\\') {
194 Com_DPrintf(
"%s: loading from cache\n", __func__);
Referenced by BuildList().
◆ M_Menu_Demos()
◆ namecmp()
static int namecmp |
( |
const void * |
p1, |
|
|
const void * |
p2 |
|
) |
| |
|
static |
◆ PlayDemo()
Definition at line 435 of file demos.c.
437 char buffer[MAX_STRING_CHARS];
440 len =
Q_snprintf(buffer,
sizeof(buffer),
"demo \"%s/%s\"\n",
443 if (len >=
sizeof(buffer)) {
Referenced by Activate().
◆ Pop()
◆ Size()
◆ sizecmp()
static int sizecmp |
( |
const void * |
p1, |
|
|
const void * |
p2 |
|
) |
| |
|
static |
◆ Sort()
◆ timecmp()
static int timecmp |
( |
const void * |
p1, |
|
|
const void * |
p2 |
|
) |
| |
|
static |
◆ ui_sortdemos_changed()
static void ui_sortdemos_changed |
( |
cvar_t * |
self | ) |
|
|
static |
◆ WriteCache()
Definition at line 202 of file demos.c.
204 char buffer[MAX_OSPATH];
216 if (len >=
sizeof(buffer)) {
224 for (i = 0; i < 16; i++) {
Referenced by BuildList().
◆ m_demos
Definition at line 69 of file demos.c.
Referenced by Activate(), BuildDir(), BuildList(), BuildName(), CalcHash(), Change(), Draw(), EnterDirectory(), Expose(), Free(), FreeList(), LeaveDirectory(), LoadCache(), M_Menu_Demos(), namecmp(), PlayDemo(), Pop(), Size(), sizecmp(), Sort(), timecmp(), ui_sortdemos_changed(), and WriteCache().
◆ ui_listalldemos
◆ ui_sortdemos
static int timecmp(const void *p1, const void *p2)
static cvar_t * ui_listalldemos
static char * LoadCache(void **list)
static int namecmp(const void *p1, const void *p2)
size_t Q_snprintf(char *dest, size_t size, const char *fmt,...)
static void Size(menuFrameWork_t *self)
size_t Com_FormatSizeLong(char *dest, size_t destsize, off_t bytes)
demoInfo_t * CL_GetDemoInfo(const char *path, demoInfo_t *info)
void S_StopAllSounds(void)
cvar_t * Cvar_Get(const char *var_name, const char *var_value, int flags)
static menuSound_t Activate(menuCommon_t *self)
static menuSound_t LeaveDirectory(void)
void FS_FreeList(void **list)
void SCR_UpdateScreen(void)
static void FreeList(void)
ssize_t FS_FPrintf(qhandle_t f, const char *format,...)
static int sizecmp(const void *p1, const void *p2)
static void ui_sortdemos_changed(cvar_t *self)
char * UI_GetColumn(char *s, int n)
void * UI_FormatColumns(int extrasize,...)
static void Expose(menuFrameWork_t *self)
static menuSound_t Keydown(menuFrameWork_t *self, int key)
#define MLIST_SCROLLBAR_WIDTH
ssize_t FS_FOpenFile(const char *name, qhandle_t *f, unsigned mode)
static void Draw(menuFrameWork_t *self)
static void Pop(menuFrameWork_t *self)
static void CalcHash(void **list)
void Cbuf_AddText(cmdbuf_t *buf, const char *text)
char * va(const char *format,...)
static menuSound_t Sort(menuList_t *self)
void UI_DrawString(int x, int y, int flags, const char *string)
void ** FS_ListFiles(const char *path, const char *filter, unsigned flags, int *count_p)
size_t Q_strlcpy(char *dst, const char *src, size_t size)
void mdfour_result(struct mdfour *md, uint8_t *out)
static void Free(menuFrameWork_t *self)
struct uiStatic_s::@9 color
static void BuildList(void)
static void BuildDir(const char *name, int type)
int Cvar_ClampInteger(cvar_t *var, int min, int max)
size_t Com_FormatSize(char *dest, size_t destsize, off_t bytes)
static void WriteCache(void)
static menuSound_t PlayDemo(demoEntry_t *e)
qhandle_t backgroundHandle
static menuSound_t Change(menuCommon_t *self)
void FS_FCloseFile(qhandle_t f)
size_t Q_concat(char *dest, size_t size,...)
static void BuildName(const file_info_t *info, char **cache)
size_t Q_scnprintf(char *dest, size_t size, const char *fmt,...)
char fs_gamedir[MAX_OSPATH]
ssize_t FS_LoadFileEx(const char *path, void **buffer, unsigned flags, memtag_t tag)
void mdfour_update(struct mdfour *md, uint8_t *in, size_t n)
static cvar_t * ui_sortdemos
void mdfour_begin(struct mdfour *md)
static menuSound_t EnterDirectory(demoEntry_t *e)