|
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 // 00022 //----------------------------------------------------------------------------- 00023 00024 #ifndef __I_SYSTEM__ 00025 #define __I_SYSTEM__ 00026 00027 #ifdef UNIX 00028 #include <dirent.h> 00029 #endif 00030 00031 #include "d_ticcmd.h" 00032 #include "d_event.h" 00033 00034 /*extern "C" 00035 { 00036 extern byte CPUFamily, CPUModel, CPUStepping; 00037 }*/ 00038 00039 // Called by DoomMain. 00040 void I_Init (void); 00041 std::string I_GetCWD(); 00042 std::string I_GetBinaryDir(); 00043 std::string I_GetUserFileName (const char *file); 00044 void I_ExpandHomeDir (std::string &path); 00045 00046 // Called by startup code 00047 // to get the ammount of memory to malloc 00048 // for the zone management. 00049 void *I_ZoneBase (size_t *size); 00050 00051 00052 // Called by D_DoomLoop, 00053 // returns current time in tics. 00054 extern QWORD (*I_GetTime) (void); 00055 00056 // like I_GetTime, except it waits for a new tic before returning 00057 extern QWORD (*I_WaitForTic) (QWORD); 00058 00059 QWORD I_GetTimePolled (void); 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 void STACK_ARGS I_Error (const char *error, ...); 00095 void STACK_ARGS I_FatalError (const char *error, ...); 00096 00097 void addterm (void (STACK_ARGS *func)(void), const char *name); 00098 #define atterm(t) addterm (t, #t) 00099 00100 // Repaint the pre-game console 00101 void I_PaintConsole (void); 00102 00103 // Print a console string 00104 void I_PrintStr (int x, const char *str, int count, BOOL scroll); 00105 00106 // Set the title string of the startup window 00107 void I_SetTitleString (const char *title); 00108 00109 std::string I_ConsoleInput (void); 00110 00111 // In i_input.c. Used to release control of the 00112 // mouse to the user when the game is paused in 00113 // windowed modes. 00114 void I_PauseMouse (void); 00115 void I_ResumeMouse (void); 00116 00117 // [RH] Returns millisecond-accurate time 00118 QWORD I_MSTime (void); 00119 00120 void I_Yield(void); 00121 00122 // [RH] Title string to display at bottom of console during startup 00123 extern char DoomStartupTitle[256]; 00124 00125 void I_FinishClockCalibration (); 00126 00127 // Directory searching routines 00128 00129 typedef struct 00130 { 00131 int count; 00132 struct dirent **namelist; 00133 int current; 00134 } findstate_t; 00135 00136 long I_FindFirst (char *filespec, findstate_t *fileinfo); 00137 int I_FindNext (long handle, findstate_t *fileinfo); 00138 int I_FindClose (long handle); 00139 int I_FindAttr (findstate_t *fileinfo); 00140 00141 #define I_FindName(a) ((a)->namelist[(a)->current]->d_name) 00142 00143 #define FA_RDONLY 1 00144 #define FA_HIDDEN 2 00145 #define FA_SYSTEM 4 00146 #define FA_DIREC 8 00147 #define FA_ARCH 16 00148 00149 #endif 00150 00151 00152