|
Odamex
Setting the Standard in Multiplayer Doom
|
00001 // Emacs style mode select -*- C++ -*- 00002 //----------------------------------------------------------------------------- 00003 // 00004 // $Id: i_system.h 1788 2010-08-24 04:42:57Z russellrice $ 00005 // 00006 // Copyright (C) 1993-1996 by id Software, Inc. 00007 // Copyright (C) 2006-2010 by The Odamex Team. 00008 // 00009 // This program is free software; you can redistribute it and/or 00010 // modify it under the terms of the GNU General Public License 00011 // as published by the Free Software Foundation; either version 2 00012 // of the License, or (at your option) any later version. 00013 // 00014 // This program is distributed in the hope that it will be useful, 00015 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00017 // GNU General Public License for more details. 00018 // 00019 // DESCRIPTION: 00020 // System specific interface stuff. 00021 // [Odamex] Fitted to work with SDL 00022 // 00023 //----------------------------------------------------------------------------- 00024 00025 00026 #ifndef __I_SYSTEM__ 00027 #define __I_SYSTEM__ 00028 00029 #ifdef WIN32 00030 #include <io.h> 00031 #endif 00032 00033 #include "d_ticcmd.h" 00034 #include "d_event.h" 00035 00036 #include <string> 00037 00038 // Called by DoomMain. 00039 void I_Init (void); 00040 std::string I_GetCWD(); 00041 std::string I_GetBinaryDir(); 00042 std::string I_GetUserFileName (const char *file); 00043 void I_ExpandHomeDir (std::string &path); 00044 00045 // Called by startup code 00046 // to get the ammount of memory to malloc 00047 // for the zone management. 00048 void *I_ZoneBase (size_t *size); 00049 00050 00051 // Called by D_DoomLoop, 00052 // returns current time in tics. 00053 extern QWORD (*I_GetTime) (void); 00054 00055 // like I_GetTime, except it waits for a new tic before returning 00056 extern QWORD (*I_WaitForTic) (QWORD); 00057 00058 QWORD I_GetTimePolled (void); 00059 00060 00061 // 00062 // Called by D_DoomLoop, 00063 // called before processing any tics in a frame 00064 // (just after displaying a frame). 00065 // Time consuming syncronous operations 00066 // are performed here (joystick reading). 00067 // Can call D_PostEvent. 00068 // 00069 void I_StartFrame (void); 00070 00071 00072 // 00073 // Called by D_DoomLoop, 00074 // called before processing each tic in a frame. 00075 // Quick syncronous operations are performed here. 00076 // Can call D_PostEvent. 00077 void I_StartTic (void); 00078 00079 // Asynchronous interrupt functions should maintain private queues 00080 // that are read by the synchronous functions 00081 // to be converted into events. 00082 00083 // Either returns a null ticcmd, 00084 // or calls a loadable driver to build it. 00085 // This ticcmd will then be modified by the gameloop 00086 // for normal input. 00087 ticcmd_t *I_BaseTiccmd (void); 00088 00089 00090 // Called by M_Responder when quit is selected. 00091 // Clean exit, displays sell blurb. 00092 void STACK_ARGS I_Quit (void); 00093 00094 00095 void STACK_ARGS I_Error (const char *error, ...); 00096 void STACK_ARGS I_FatalError (const char *error, ...); 00097 00098 void addterm (void (STACK_ARGS *func)(void), const char *name); 00099 #define atterm(t) addterm (t, #t) 00100 00101 // Repaint the pre-game console 00102 void I_PaintConsole (void); 00103 00104 // Print a console string 00105 void I_PrintStr (int x, const char *str, int count, BOOL scroll); 00106 00107 // Set the title string of the startup window 00108 void I_SetTitleString (const char *title); 00109 00110 std::string I_ConsoleInput (void); 00111 00112 // In i_input.c. Used to release control of the 00113 // mouse to the user when the game is paused in 00114 // windowed modes. 00115 void I_PauseMouse (void); 00116 void I_ResumeMouse (void); 00117 00118 // [RH] Returns millisecond-accurate time 00119 QWORD I_MSTime (void); 00120 00121 void I_Yield(); 00122 00123 // [RH] Title string to display at bottom of console during startup 00124 extern char DoomStartupTitle[256]; 00125 00126 void I_FinishClockCalibration (); 00127 00128 std::string I_GetClipboardText(); 00129 00130 // Directory searching routines 00131 00132 typedef struct _finddata_t findstate_t; 00133 00134 long I_FindFirst (char *filespec, findstate_t *fileinfo); 00135 int I_FindNext (long handle, findstate_t *fileinfo); 00136 int I_FindClose (long handle); 00137 00138 #define I_FindName(a) ((a)->name) 00139 #define I_FindAttr(a) ((a)->attrib) 00140 00141 #define FA_RDONLY _A_RDONLY 00142 #define FA_HIDDEN _A_HIDDEN 00143 #define FA_SYSTEM _A_SYSTEM 00144 #define FA_DIREC _A_SUBDIR 00145 #define FA_ARCH _A_ARCH 00146 00147 #endif