Quake II RTX doxygen
1.0 dev
|
|
#include "client.h"
#include "common/cvar.h"
#include "common/field.h"
#include "common/prompt.h"
#include <mmsystem.h>
Go to the source code of this file.
|
void | Sys_Error (const char *error,...) |
|
void | Sys_Quit (void) |
|
void | Sys_DebugBreak (void) |
|
unsigned | Sys_Milliseconds (void) |
|
void | Sys_AddDefaultConfig (void) |
|
void | Sys_Sleep (int msec) |
|
qboolean | Sys_IsDir (const char *path) |
|
qboolean | Sys_IsFile (const char *path) |
|
void | Sys_Init (void) |
|
void | Sys_FreeLibrary (void *handle) |
|
void * | Sys_LoadLibrary (const char *path, const char *sym, void **handle) |
|
void * | Sys_GetProcAddress (void *handle, const char *sym) |
|
static time_t | file_time_to_unix (FILETIME *f) |
|
static void * | copy_info (const char *name, const LPWIN32_FIND_DATAA data) |
|
void | Sys_ListFiles_r (const char *path, const char *filter, unsigned flags, size_t baselen, int *count_p, void **files, int depth) |
|
static BOOL | fix_current_directory (void) |
|
static int | Sys_Main (int argc, char **argv) |
|
int | main (int argc, char **argv) |
|
◆ should_exit_t
Enumerator |
---|
SE_NOT | |
SE_YES | |
SE_FULL | |
Definition at line 41 of file system.c.
◆ copy_info()
static void* copy_info |
( |
const char * |
name, |
|
|
const LPWIN32_FIND_DATAA |
data |
|
) |
| |
|
static |
◆ file_time_to_unix()
static time_t file_time_to_unix |
( |
FILETIME * |
f | ) |
|
|
inlinestatic |
Definition at line 844 of file system.c.
846 ULARGE_INTEGER u = *(ULARGE_INTEGER *)f;
847 return (time_t)((u.QuadPart - 116444736000000000ULL) / 10000000);
Referenced by copy_info().
◆ fix_current_directory()
static BOOL fix_current_directory |
( |
void |
| ) |
|
|
static |
◆ main()
int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Definition at line 1174 of file system.c.
1183 for (i = 1; i < argc; i++) {
1184 if (!strcmp(argv[i],
"-service")) {
1188 if (StartServiceCtrlDispatcher(serviceTable)) {
1191 if (GetLastError() == ERROR_FAILED_SERVICE_CONTROLLER_CONNECT) {
◆ Sys_AddDefaultConfig()
◆ Sys_DebugBreak()
◆ Sys_Error()
void Sys_Error |
( |
const char * |
error, |
|
|
|
... |
|
) |
| |
Definition at line 574 of file system.c.
577 char text[MAXERRORMSG];
579 va_start(argptr, error);
590 Sys_SetConsoleColor(COLOR_RED);
591 Sys_Printf(
"********************\n"
593 "********************\n", text);
594 Sys_SetConsoleColor(COLOR_NONE);
606 MessageBoxA(NULL, text, PRODUCT
" Fatal Error", MB_ICONERROR | MB_OK);
Referenced by Com_Error(), Qcommon_Init(), and Sys_Init().
◆ Sys_FreeLibrary()
◆ Sys_GetProcAddress()
void* Sys_GetProcAddress |
( |
void * |
handle, |
|
|
const char * |
sym |
|
) |
| |
Definition at line 824 of file system.c.
828 entry = GetProcAddress(
handle, sym);
831 sym, GetLastError()));
◆ Sys_Init()
Definition at line 695 of file system.c.
700 BOOL (WINAPI * pSetProcessDEPPolicy)(DWORD);
707 vinfo.dwOSVersionInfoSize =
sizeof(vinfo);
708 #pragma warning(push)
709 #pragma warning(disable: 4996) // warning C4996: 'GetVersionExA': was declared deprecated
710 if (!GetVersionEx(&vinfo)) {
714 if (vinfo.dwPlatformId != VER_PLATFORM_WIN32_NT) {
715 Sys_Error(PRODUCT
" requires Windows NT");
717 if (vinfo.dwMajorVersion < 5) {
718 Sys_Error(PRODUCT
" requires Windows 2000 or greater");
738 houtput = GetStdHandle(STD_OUTPUT_HANDLE);
740 sys_viewlog =
Cvar_Get(
"sys_viewlog",
"0", CVAR_NOSET);
742 if (
dedicated->integer || sys_viewlog->integer)
748 var =
Cvar_Get(
"sys_disablecrashdump",
"0", CVAR_NOSET);
752 mainProcessThread = GetCurrentThread();
753 prevExceptionFilter = SetUnhandledExceptionFilter(
759 module = GetModuleHandle(
"kernel32.dll");
761 pSetProcessDEPPolicy = (PVOID)GetProcAddress(module,
762 "SetProcessDEPPolicy");
763 if (pSetProcessDEPPolicy) {
764 var =
Cvar_Get(
"sys_disabledep",
"0", CVAR_NOSET);
768 pSetProcessDEPPolicy(
771 }
else if (var->integer == 2) {
772 pSetProcessDEPPolicy(0);
Referenced by Qcommon_Init().
◆ Sys_IsDir()
qboolean Sys_IsDir |
( |
const char * |
path | ) |
|
Definition at line 659 of file system.c.
661 WCHAR wpath[MAX_OSPATH] = { 0 };
662 MultiByteToWideChar(CP_UTF8, 0, path, -1, wpath, MAX_OSPATH);
664 DWORD fileAttributes = GetFileAttributesW(wpath);
665 if (fileAttributes == INVALID_FILE_ATTRIBUTES)
670 return (fileAttributes & FILE_ATTRIBUTE_DIRECTORY) != 0;
Referenced by OGG_InitTrackList().
◆ Sys_IsFile()
qboolean Sys_IsFile |
( |
const char * |
path | ) |
|
Definition at line 674 of file system.c.
676 WCHAR wpath[MAX_OSPATH] = { 0 };
677 MultiByteToWideChar(CP_UTF8, 0, path, -1, wpath, MAX_OSPATH);
679 DWORD fileAttributes = GetFileAttributesW(wpath);
680 if (fileAttributes == INVALID_FILE_ATTRIBUTES)
687 return (fileAttributes & (FILE_ATTRIBUTE_DIRECTORY | FILE_ATTRIBUTE_DEVICE)) == 0;
Referenced by OGG_InitTrackList().
◆ Sys_ListFiles_r()
void Sys_ListFiles_r |
( |
const char * |
path, |
|
|
const char * |
filter, |
|
|
unsigned |
flags, |
|
|
size_t |
baselen, |
|
|
int * |
count_p, |
|
|
void ** |
files, |
|
|
int |
depth |
|
) |
| |
Definition at line 868 of file system.c.
876 WIN32_FIND_DATAA data;
878 char fullpath[MAX_OSPATH], *name;
884 if (!(flags & FS_SEARCH_BYFILTER) &&
885 filter && !strchr(filter,
';')) {
886 if (*filter ==
'.') {
889 len =
Q_concat(fullpath,
sizeof(fullpath),
890 path,
"\\*.", filter, NULL);
893 len =
Q_concat(fullpath,
sizeof(fullpath),
897 if (len >=
sizeof(fullpath)) {
908 if (
handle == INVALID_HANDLE_VALUE) {
913 pathlen = strlen(path) + 1;
916 if (!strcmp(data.cFileName,
".") ||
917 !strcmp(data.cFileName,
"..")) {
922 len = strlen(data.cFileName);
923 if (pathlen + len >=
sizeof(fullpath)) {
927 memcpy(fullpath + pathlen, data.cFileName, len + 1);
929 if (data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
930 mask = FS_SEARCH_DIRSONLY;
936 if ((flags & FS_SEARCH_BYFILTER) && mask &&
937 depth < MAX_LISTED_DEPTH) {
939 count_p, files, depth + 1);
942 if (*count_p >= MAX_LISTED_FILES) {
948 if ((flags & FS_SEARCH_DIRSONLY) != mask) {
954 if (flags & FS_SEARCH_BYFILTER) {
955 if (!
FS_WildCmp(filter, fullpath + baselen)) {
959 if (!
FS_ExtCmp(filter, data.cFileName)) {
966 if (flags & FS_SEARCH_SAVEPATH) {
967 name = fullpath + baselen;
969 name = data.cFileName;
976 if (flags & FS_SEARCH_STRIPEXT) {
985 if (flags & FS_SEARCH_EXTRAINFO) {
988 info = FS_CopyString(name);
991 files[(*count_p)++] = info;
992 }
while (*count_p < MAX_LISTED_FILES &&
Referenced by FS_ListFiles(), and q_printf().
◆ Sys_LoadLibrary()
void* Sys_LoadLibrary |
( |
const char * |
path, |
|
|
const char * |
sym, |
|
|
void ** |
handle |
|
) |
| |
◆ Sys_Main()
static int Sys_Main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
|
static |
Definition at line 1034 of file system.c.
1041 #if (_MSC_VER >= 1400)
1044 _set_invalid_parameter_handler(msvcrt_sucks);
Referenced by main().
◆ Sys_Milliseconds()
unsigned Sys_Milliseconds |
( |
void |
| ) |
|
Definition at line 644 of file system.c.
646 return timeGetTime();
Referenced by BSP_Test_f(), CL_CleanupDemos(), CL_FirstDemoFrame(), CL_Frame(), Com_Freeze_f(), MVD_Spawn(), Netchan_Init(), PingServers(), process_gamepad_input(), Qcommon_Frame(), Qcommon_Init(), R_PrintTimes(), R_RenderFrame(), R_RenderFrame_RTX(), SCR_BeginLoadingPlaque(), SCR_DrawSelectedItemName(), SCR_TimeRefresh_f(), SCR_UpdateScreen(), SV_RunGameFrame(), SV_SpawnServer(), and vkpt_bloom_update().
◆ Sys_Quit()
◆ Sys_Sleep()
◆ currentDirectory
char currentDirectory[MAX_OSPATH] |
|
static |
◆ errorEntered
volatile qboolean errorEntered |
|
static |
◆ hGlobalInstance
HINSTANCE hGlobalInstance |
◆ shouldExit
◆ sys_basedir
◆ sys_forcegamelib
◆ sys_homedir
◆ sys_libdir
file_info_t * FS_CopyInfo(const char *name, size_t size, time_t ctime, time_t mtime)
static time_t file_time_to_unix(FILETIME *f)
void Sys_ListFiles_r(const char *path, const char *filter, unsigned flags, size_t baselen, int *count_p, void **files, int depth)
void Com_AbortFrame(void)
qboolean FS_ExtCmp(const char *ext, const char *name)
void Cmd_AddCommand(const char *name, xcommand_t function)
cvar_t * Cvar_Get(const char *var_name, const char *var_value, int flags)
char * FS_ReplaceSeparators(char *s, int separator)
static volatile should_exit_t shouldExit
LONG WINAPI Sys_ExceptionFilter(LPEXCEPTION_POINTERS exceptionInfo)
size_t Q_vsnprintf(char *dest, size_t size, const char *fmt, va_list argptr)
BOOL WINAPI FindNextFileA(HANDLE handle, LPWIN32_FIND_DATAA data)
static int Sys_Main(int argc, char **argv)
void Sys_Error(const char *error,...)
BOOL(WINAPI *qwglSetPixelFormat)(HDC
static BOOL fix_current_directory(void)
HINSTANCE hGlobalInstance
void Com_Error(error_type_t type, const char *fmt,...)
static volatile qboolean errorEntered
static char currentDirectory[MAX_OSPATH]
char * va(const char *format,...)
#define PROCESS_DEP_ENABLE
qboolean FS_WildCmp(const char *filter, const char *string)
static void * copy_info(const char *name, const LPWIN32_FIND_DATAA data)
HANDLE WINAPI FindFirstFileA(LPCSTR path, LPWIN32_FIND_DATAA data)
DWORD WINAPI GetModuleFileNameA(HMODULE hModule, LPSTR lpFileName, DWORD nSize)
cvar_t * sys_forcegamelib
void Com_Quit(const char *reason, error_type_t type)
int WINAPI MessageBoxA(HWND hWnd, LPCSTR lpText, LPCSTR lpCaption, UINT uType)
void Com_SetLastError(const char *msg)
void Qcommon_Init(int argc, char **argv)
size_t Q_concat(char *dest, size_t size,...)
char * COM_FileExtension(const char *in)
#define PROCESS_DEP_DISABLE_ATL_THUNK_EMULATION
HINSTANCE WINAPI LoadLibraryA(LPCSTR path)