123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373 |
- #include "Precompiled.h"
- #include "globaldata.h"
- #include <sys/stat.h>
- #include <sys/types.h>
- #include <fcntl.h>
- #include <stdlib.h>
- #include <ctype.h>
- #include "doomdef.h"
- #include "g_game.h"
- #include "z_zone.h"
- #include "m_swap.h"
- #include "m_argv.h"
- #include "w_wad.h"
- #include "i_system.h"
- #include "i_video.h"
- #include "v_video.h"
- #include "hu_stuff.h"
- #include "doomstat.h"
- #include "dstrings.h"
- #include "m_misc.h"
- #include "d3xp/Game_local.h"
- int
- M_DrawText
- ( int x,
- int y,
- qboolean direct,
- char* string )
- {
- int c;
- int w;
- while (*string)
- {
- c = toupper(*string) - HU_FONTSTART;
- string++;
- if (c < 0 || c> HU_FONTSIZE)
- {
- x += 4;
- continue;
- }
-
- w = SHORT (::g->hu_font[c]->width);
- if (x+w > SCREENWIDTH)
- break;
- if (direct)
- V_DrawPatchDirect(x, y, 0, ::g->hu_font[c]);
- else
- V_DrawPatch(x, y, 0, ::g->hu_font[c]);
- x+=w;
- }
- return x;
- }
- boolean M_WriteFile ( char const* name, void* source, int length ) {
-
- idFile * handle = NULL;
- int count;
- handle = fileSystem->OpenFileWrite( name, "fs_savepath" );
- if (handle == NULL )
- return false;
- count = handle->Write( source, length );
- fileSystem->CloseFile( handle );
- if (count < length)
- return false;
- return true;
- }
- int M_ReadFile ( char const* name, byte** buffer ) {
- int count, length;
- idFile * handle = NULL;
- byte *buf;
- handle = fileSystem->OpenFileRead( name, false );
- if (handle == NULL ) {
- I_Error ("Couldn't read file %s", name);
- }
- length = handle->Length();
- buf = ( byte* )Z_Malloc ( handle->Length(), PU_STATIC, NULL);
- count = handle->Read( buf, length );
- if (count < length ) {
- I_Error ("Couldn't read file %s", name);
- }
- fileSystem->CloseFile( handle );
- *buffer = buf;
- return length;
- }
- static qboolean SaveGame( void* source, DWORD length )
- {
- return false;
- }
- qboolean M_WriteSaveGame( void* source, int length )
- {
- return SaveGame( source, length );
- }
- int M_ReadSaveGame( byte** buffer )
- {
- return 0;
- }
- #ifdef SNDSERV
- #endif
- #ifdef LINUX
- #endif
- extern const char* const temp_chat_macros[];
- void M_SaveDefaults (void)
- {
- }
- void M_LoadDefaults (void)
- {
- int i;
-
-
-
-
-
-
-
-
-
- ::g->numdefaults = sizeof(::g->defaults)/sizeof(::g->defaults[0]);
- for (i=0 ; i < ::g->numdefaults ; i++)
- *::g->defaults[i].location = ::g->defaults[i].defaultvalue;
-
-
- i = M_CheckParm ("-config");
- if (i && i < ::g->myargc-1)
- {
- ::g->defaultfile = ::g->myargv[i+1];
- I_Printf (" default file: %s\n",::g->defaultfile);
- }
- else
- ::g->defaultfile = ::g->basedefault;
- }
- void
- WritePCXfile
- ( char* filename,
- byte* data,
- int width,
- int height,
- byte* palette )
- {
- I_Error( "depreciated" );
- }
- void M_ScreenShot (void)
- {
- }
|