-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathEngineAPI.cpp
More file actions
1313 lines (1000 loc) · 39.1 KB
/
EngineAPI.cpp
File metadata and controls
1313 lines (1000 loc) · 39.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
//
// Copyright (c) 2012, Wei Mingzhi <whistler_wmz@users.sf.net>.
// All Rights Reserved.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, see <http://www.gnu.org/licenses/>.
//
#include "Main.h"
static idSysLocal sysLocal; // non-portable system services
static idCommonLocal commonLocal; // common
static idCmdSystemLocal cmdSystemLocal; // console command system
static idCVarSystemLocal cvarSystemLocal; // console variable system
static idFileSystemLocal fileSystemLocal; // file system
static idNetworkSystemLocal networkSystemLocal; // network system
static idRenderSystemLocal renderSystemLocal; // render system
static idSoundSystemLocal soundSystemLocal; // sound system
static idRenderModelManagerLocal renderModelManagerLocal; // render model manager
static idUserInterfaceManagerLocal uiManagerLocal; // user interface manager
static idDeclManagerLocal declManagerLocal; // declaration manager
static idAASFileManagerLocal AASFileManagerLocal; // AAS file manager
static idCollisionModelManagerLocal collisionModelManagerLocal; // collision model manager
gameImport_t importLocal = {
GAME_API_VERSION,
&sysLocal,
&commonLocal,
&cmdSystemLocal,
&cvarSystemLocal,
&fileSystemLocal,
&networkSystemLocal,
&renderSystemLocal,
&soundSystemLocal,
&renderModelManagerLocal,
&uiManagerLocal,
&declManagerLocal,
&AASFileManagerLocal,
&collisionModelManagerLocal
};
void idSysLocal::DebugPrintf( const char *fmt, ... ) {
va_list argptr;
va_start( argptr, fmt );
sys->DebugVPrintf( fmt, argptr );
va_end( argptr );
}
void idSysLocal::DebugVPrintf( const char *fmt, va_list arg ) {
sys->DebugVPrintf( fmt, arg );
}
double idSysLocal::GetClockTicks( void ) {
return sys->GetClockTicks();
}
double idSysLocal::ClockTicksPerSecond( void ) {
return sys->ClockTicksPerSecond();
}
cpuid_t idSysLocal::GetProcessorId( void ) {
return sys->GetProcessorId();
}
const char * idSysLocal::GetProcessorString( void ) {
return sys->GetProcessorString();
}
const char * idSysLocal::FPU_GetState( void ) {
return sys->FPU_GetState();
}
bool idSysLocal::FPU_StackIsEmpty( void ) {
return sys->FPU_StackIsEmpty();
}
void idSysLocal::FPU_SetFTZ( bool enable ) {
sys->FPU_SetFTZ( enable );
}
void idSysLocal::FPU_SetDAZ( bool enable ) {
sys->FPU_SetDAZ( enable );
}
void idSysLocal::FPU_EnableExceptions( int exceptions ) {
sys->FPU_EnableExceptions( exceptions );
}
bool idSysLocal::LockMemory( void *ptr, int bytes ) {
return sys->LockMemory( ptr, bytes );
}
bool idSysLocal::UnlockMemory( void *ptr, int bytes ) {
return sys->UnlockMemory( ptr, bytes );
}
void idSysLocal::GetCallStack( address_t *callStack, const int callStackSize ) {
sys->GetCallStack( callStack, callStackSize );
}
const char * idSysLocal::GetCallStackStr( const address_t *callStack, const int callStackSize ) {
return sys->GetCallStackStr( callStack, callStackSize );
}
const char * idSysLocal::GetCallStackCurStr( int depth ) {
return sys->GetCallStackCurStr( depth );
}
void idSysLocal::ShutdownSymbols( void ) {
sys->ShutdownSymbols();
}
int idSysLocal::DLL_Load( const char *dllName ) {
return sys->DLL_Load( dllName );
}
void * idSysLocal::DLL_GetProcAddress( int dllHandle, const char *procName ) {
return sys->DLL_GetProcAddress( dllHandle, procName );
}
void idSysLocal::DLL_Unload( int dllHandle ) {
sys->DLL_Unload(dllHandle);
}
void idSysLocal::DLL_GetFileName( const char *baseName, char *dllName, int maxLength ) {
sys->DLL_GetFileName( baseName, dllName, maxLength );
}
sysEvent_t idSysLocal::GenerateMouseButtonEvent( int button, bool down ) {
return sys->GenerateMouseButtonEvent( button, down );
}
sysEvent_t idSysLocal::GenerateMouseMoveEvent( int deltax, int deltay ) {
return sys->GenerateMouseMoveEvent( deltax, deltay );
}
void idSysLocal::OpenURL( const char *url, bool quit ) {
sys->OpenURL( url, quit );
}
void idSysLocal::StartProcess( const char *exePath, bool quit ) {
sys->StartProcess( exePath, quit );
}
void idCommonLocal::Init( int argc, const char **argv, const char *cmdline ) {
common->Init( argc, argv, cmdline );
}
void idCommonLocal::Shutdown( void ) {
common->Shutdown();
}
void idCommonLocal::Quit( void ) {
common->Quit();
}
bool idCommonLocal::IsInitialized( void ) const {
return common->IsInitialized();
}
void idCommonLocal::Frame( void ) {
common->Frame();
}
void idCommonLocal::GUIFrame( bool execCmd, bool network ) {
common->GUIFrame( execCmd, network );
}
void idCommonLocal::Async( void ) {
common->Async();
}
void idCommonLocal::StartupVariable( const char *match, bool once ) {
common->StartupVariable( match, once );
}
void idCommonLocal::InitTool( const toolFlag_t tool, const idDict *dict ) {
common->InitTool( tool, dict );
}
void idCommonLocal::ActivateTool( bool active ) {
common->ActivateTool( active );
}
void idCommonLocal::WriteConfigToFile( const char *filename ) {
common->WriteConfigToFile( filename );
}
void idCommonLocal::WriteFlaggedCVarsToFile( const char *filename, int flags, const char *setCmd ) {
common->WriteFlaggedCVarsToFile( filename, flags, setCmd );
}
void idCommonLocal::BeginRedirect( char *buffer, int buffersize, void (*flush)( const char * ) ) {
common->BeginRedirect( buffer, buffersize, flush );
}
void idCommonLocal::EndRedirect( void ) {
common->EndRedirect();
}
void idCommonLocal::SetRefreshOnPrint( bool set ) {
common->SetRefreshOnPrint( set );
}
void idCommonLocal::Printf( const char *fmt, ... ) {
va_list argptr;
va_start( argptr, fmt );
common->VPrintf( fmt, argptr );
va_end( argptr );
}
void idCommonLocal::VPrintf( const char *fmt, va_list arg ) {
common->VPrintf( fmt, arg );
}
void idCommonLocal::DPrintf( const char *fmt, ... ) {
char buf[4096];
va_list argptr;
va_start( argptr, fmt );
idStr::vsnPrintf( buf, sizeof( buf ), fmt, argptr );
va_end( argptr );
common->DPrintf( buf );
}
void idCommonLocal::Warning( const char *fmt, ... ) {
char buf[4096];
va_list argptr;
va_start( argptr, fmt );
idStr::vsnPrintf( buf, sizeof( buf ), fmt, argptr );
va_end( argptr );
common->Warning( buf );
}
void idCommonLocal::DWarning( const char *fmt, ...) {
char buf[4096];
va_list argptr;
va_start( argptr, fmt );
idStr::vsnPrintf( buf, sizeof( buf ), fmt, argptr );
va_end( argptr );
common->DWarning( buf );
}
void idCommonLocal::PrintWarnings( void ) {
common->PrintWarnings();
}
void idCommonLocal::ClearWarnings( const char *reason ) {
common->ClearWarnings( reason );
}
void idCommonLocal::Error( const char *fmt, ... ) {
char buf[4096];
va_list argptr;
va_start( argptr, fmt );
idStr::vsnPrintf( buf, sizeof( buf ), fmt, argptr );
va_end( argptr );
common->Error( buf );
}
void idCommonLocal::FatalError( const char *fmt, ... ) {
char buf[4096];
va_list argptr;
va_start( argptr, fmt );
idStr::vsnPrintf( buf, sizeof( buf ), fmt, argptr );
va_end( argptr );
common->FatalError( buf );
}
const idLangDict * idCommonLocal::GetLanguageDict( void ) {
return common->GetLanguageDict();
}
const char * idCommonLocal::KeysFromBinding( const char *bind ) {
return common->KeysFromBinding( bind );
}
const char * idCommonLocal::BindingFromKey( const char *key ) {
return common->BindingFromKey( key );
}
int idCommonLocal::ButtonState( int key ) {
return common->ButtonState( key );
}
int idCommonLocal::KeyState( int key ) {
return common->KeyState( key );
}
void idCmdSystemLocal::Init( void ) {
return cmdSystem->Init();
}
void idCmdSystemLocal::Shutdown( void ) {
return cmdSystem->Shutdown();
}
void idCmdSystemLocal::AddCommand( const char *cmdName, cmdFunction_t function, int flags, const char *description, argCompletion_t argCompletion ) {
cmdSystem->AddCommand( cmdName, function, flags, description, argCompletion );
}
void idCmdSystemLocal::RemoveCommand( const char *cmdName ) {
cmdSystem->RemoveCommand( cmdName );
}
void idCmdSystemLocal::RemoveFlaggedCommands( int flags ) {
cmdSystem->RemoveFlaggedCommands( flags );
}
void idCmdSystemLocal::CommandCompletion( void(*callback)( const char *s ) ) {
cmdSystem->CommandCompletion( callback );
}
void idCmdSystemLocal::ArgCompletion( const char *cmdString, void(*callback)( const char *s ) ) {
cmdSystem->ArgCompletion( cmdString, callback );
}
void idCmdSystemLocal::BufferCommandText( cmdExecution_t exec, const char *text ) {
cmdSystem->BufferCommandText( exec, text );
}
void idCmdSystemLocal::ExecuteCommandBuffer( void ) {
cmdSystem->ExecuteCommandBuffer();
}
void idCmdSystemLocal::ArgCompletion_FolderExtension( const idCmdArgs &args, void(*callback)( const char *s ), const char *folder, bool stripFolder, ... ) {
const char *param[16];
const char *p;
va_list argPtr;
int i;
memset( param, 0, sizeof( param ) );
i = 0;
va_start( argPtr, stripFolder );
// This is an ugly hack, but it should work
for ( p = va_arg( argPtr, const char * ); p && i < 16; p = va_arg( argPtr, const char * ), ++i ) {
param[i] = p;
}
cmdSystem->ArgCompletion_FolderExtension( args, callback, folder, stripFolder,
param[0], param[1], param[2], param[3], param[4], param[5], param[6],
param[7], param[8], param[9], param[10], param[11], param[12], param[13],
param[14], param[15], NULL );
}
void idCmdSystemLocal::ArgCompletion_DeclName( const idCmdArgs &args, void(*callback)( const char *s ), int type ) {
cmdSystem->ArgCompletion_DeclName( args, callback, type );
}
void idCmdSystemLocal::BufferCommandArgs( cmdExecution_t exec, const idCmdArgs &args ) {
cmdSystem->BufferCommandArgs( exec, args );
}
void idCmdSystemLocal::SetupReloadEngine( const idCmdArgs &args ) {
cmdSystem->SetupReloadEngine( args );
}
bool idCmdSystemLocal::PostReloadEngine( void ) {
return cmdSystem->PostReloadEngine();
}
void idCVarSystemLocal::Init( void ) {
cvarSystem->Init();
}
void idCVarSystemLocal::Shutdown( void ) {
cvarSystem->Shutdown();
}
bool idCVarSystemLocal::IsInitialized( void ) const {
return cvarSystem->IsInitialized();
}
void idCVarSystemLocal::Register( idCVar *cvar ) {
cvarSystem->Register( cvar );
}
idCVar * idCVarSystemLocal::Find( const char *name ) {
return cvarSystem->Find( name );
}
void idCVarSystemLocal::SetCVarString( const char *name, const char *value, int flags ) {
cvarSystem->SetCVarString( name, value, flags );
}
void idCVarSystemLocal::SetCVarBool( const char *name, const bool value, int flags ) {
cvarSystem->SetCVarBool( name, value, flags );
}
void idCVarSystemLocal::SetCVarInteger( const char *name, const int value, int flags ) {
cvarSystem->SetCVarInteger( name, value, flags );
}
void idCVarSystemLocal::SetCVarFloat( const char *name, const float value, int flags ) {
cvarSystem->SetCVarFloat( name, value, flags );
}
const char * idCVarSystemLocal::GetCVarString( const char *name ) const {
return cvarSystem->GetCVarString( name );
}
bool idCVarSystemLocal::GetCVarBool( const char *name ) const {
return cvarSystem->GetCVarBool( name );
}
int idCVarSystemLocal::GetCVarInteger( const char *name ) const {
return cvarSystem->GetCVarInteger( name );
}
float idCVarSystemLocal::GetCVarFloat( const char *name ) const {
return cvarSystem->GetCVarFloat( name );
}
bool idCVarSystemLocal::Command( const idCmdArgs &args ) {
return cvarSystem->Command( args );
}
void idCVarSystemLocal::CommandCompletion( void(*callback)( const char *s ) ) {
cvarSystem->CommandCompletion( callback );
}
void idCVarSystemLocal::ArgCompletion( const char *cmdString, void(*callback)( const char *s ) ) {
cvarSystem->ArgCompletion( cmdString, callback );
}
void idCVarSystemLocal::SetModifiedFlags( int flags ) {
cvarSystem->SetModifiedFlags( flags );
}
int idCVarSystemLocal::GetModifiedFlags( void ) const {
return cvarSystem->GetModifiedFlags();
}
void idCVarSystemLocal::ClearModifiedFlags( int flags ) {
cvarSystem->ClearModifiedFlags( flags );
}
void idCVarSystemLocal::ResetFlaggedVariables( int flags ) {
cvarSystem->ResetFlaggedVariables( flags );
}
void idCVarSystemLocal::RemoveFlaggedAutoCompletion( int flags ) {
cvarSystem->RemoveFlaggedAutoCompletion( flags );
}
void idCVarSystemLocal::WriteFlaggedVariables( int flags, const char *setCmd, idFile *f ) const {
cvarSystem->WriteFlaggedVariables( flags, setCmd, f );
}
const idDict * idCVarSystemLocal::MoveCVarsToDict( int flags ) const {
return cvarSystem->MoveCVarsToDict( flags );
}
void idCVarSystemLocal::SetCVarsFromDict( const idDict &dict ) {
cvarSystem->SetCVarsFromDict( dict );
}
void idFileSystemLocal::Init( void ) {
fileSystem->Init();
}
void idFileSystemLocal::Restart( void ) {
fileSystem->Restart();
}
void idFileSystemLocal::Shutdown( bool reloading ) {
fileSystem->Shutdown( reloading );
}
bool idFileSystemLocal::IsInitialized( void ) const {
return fileSystem->IsInitialized();
}
bool idFileSystemLocal::PerformingCopyFiles( void ) const {
return fileSystem->PerformingCopyFiles();
}
idModList * idFileSystemLocal::ListMods( void ) {
return fileSystem->ListMods();
}
void idFileSystemLocal::FreeModList( idModList *modList ) {
fileSystem->FreeModList( modList );
}
idFileList * idFileSystemLocal::ListFiles( const char *relativePath, const char *extension, bool sort, bool fullRelativePath, const char* gamedir ) {
return fileSystem->ListFiles( relativePath, extension, sort, fullRelativePath, gamedir );
}
idFileList * idFileSystemLocal::ListFilesTree( const char *relativePath, const char *extension, bool sort, const char* gamedir ) {
return fileSystem->ListFilesTree( relativePath, extension, sort, gamedir );
}
void idFileSystemLocal::FreeFileList( idFileList *fileList ) {
fileSystem->FreeFileList( fileList );
}
const char * idFileSystemLocal::OSPathToRelativePath( const char *OSPath ) {
return fileSystem->OSPathToRelativePath( OSPath );
}
const char * idFileSystemLocal::RelativePathToOSPath( const char *relativePath, const char *basePath ) {
return fileSystem->RelativePathToOSPath( relativePath, basePath );
}
const char * idFileSystemLocal::BuildOSPath( const char *base, const char *game, const char *relativePath ) {
return fileSystem->BuildOSPath( base, game, relativePath );
}
void idFileSystemLocal::CreateOSPath( const char *OSPath ) {
fileSystem->CreateOSPath( OSPath );
}
bool idFileSystemLocal::FileIsInPAK( const char *relativePath ) {
return fileSystem->FileIsInPAK( relativePath );
}
void idFileSystemLocal::UpdatePureServerChecksums( void ) {
fileSystem->UpdatePureServerChecksums();
}
bool idFileSystemLocal::UpdateGamePakChecksums( void ) {
return fileSystem->UpdateGamePakChecksums();
}
fsPureReply_t idFileSystemLocal::SetPureServerChecksums( const int pureChecksums[ MAX_PURE_PAKS ], int gamePakChecksum, int missingChecksums[ MAX_PURE_PAKS ], int *missingGamePakChecksum ) {
return fileSystem->SetPureServerChecksums( pureChecksums, gamePakChecksum, missingChecksums, missingGamePakChecksum );
}
void idFileSystemLocal::GetPureServerChecksums( int checksums[ MAX_PURE_PAKS ], int OS, int *gamePakChecksum ) {
fileSystem->GetPureServerChecksums( checksums, OS, gamePakChecksum );
}
void idFileSystemLocal::SetRestartChecksums( const int pureChecksums[ MAX_PURE_PAKS ], int gamePakChecksum ) {
fileSystem->SetRestartChecksums( pureChecksums, gamePakChecksum );
}
void idFileSystemLocal::ClearPureChecksums( void ) {
fileSystem->ClearPureChecksums();
}
int idFileSystemLocal::GetOSMask( void ) {
return fileSystem->GetOSMask();
}
int idFileSystemLocal::ReadFile( const char *relativePath, void **buffer, ID_TIME_T *timestamp ) {
return fileSystem->ReadFile( relativePath, buffer, timestamp );
}
void idFileSystemLocal::FreeFile( void *buffer ) {
fileSystem->FreeFile( buffer );
}
int idFileSystemLocal::WriteFile( const char *relativePath, const void *buffer, int size, const char *basePath ) {
return fileSystem->WriteFile( relativePath, buffer, size, basePath );
}
void idFileSystemLocal::RemoveFile( const char *relativePath ) {
fileSystem->RemoveFile( relativePath );
}
idFile * idFileSystemLocal::OpenFileRead( const char *relativePath, bool allowCopyFiles, const char* gamedir ) {
return fileSystem->OpenFileRead( relativePath, allowCopyFiles, gamedir );
}
idFile * idFileSystemLocal::OpenFileWrite( const char *relativePath, const char *basePath ) {
return fileSystem->OpenFileWrite( relativePath, basePath );
}
idFile * idFileSystemLocal::OpenFileAppend( const char *filename, bool sync, const char *basePath ) {
return fileSystem->OpenFileAppend( filename, sync, basePath );
}
idFile * idFileSystemLocal::OpenFileByMode( const char *relativePath, fsMode_t mode ) {
return fileSystem->OpenFileByMode( relativePath, mode );
}
idFile * idFileSystemLocal::OpenExplicitFileRead( const char *OSPath ) {
return fileSystem->OpenExplicitFileRead( OSPath );
}
idFile * idFileSystemLocal::OpenExplicitFileWrite( const char *OSPath ) {
return fileSystem->OpenExplicitFileWrite( OSPath );
}
void idFileSystemLocal::CloseFile( idFile *f ) {
fileSystem->CloseFile( f );
}
void idFileSystemLocal::BackgroundDownload( backgroundDownload_t *bgl ) {
fileSystem->BackgroundDownload( bgl );
}
void idFileSystemLocal::ResetReadCount( void ) {
fileSystem->ResetReadCount();
}
int idFileSystemLocal::GetReadCount( void ) {
return fileSystem->GetReadCount();
}
void idFileSystemLocal::AddToReadCount( int c ) {
fileSystem->AddToReadCount( c );
}
void idFileSystemLocal::FindDLL( const char *basename, char dllPath[ MAX_OSPATH ], bool updateChecksum ) {
fileSystem->FindDLL( basename, dllPath, updateChecksum );
}
void idFileSystemLocal::ClearDirCache( void ) {
fileSystem->ClearDirCache();
}
bool idFileSystemLocal::HasD3XP( void ) {
return fileSystem->HasD3XP();
}
bool idFileSystemLocal::RunningD3XP( void ) {
return fileSystem->RunningD3XP();
}
void idFileSystemLocal::CopyFile( const char *fromOSPath, const char *toOSPath ) {
fileSystem->CopyFile( fromOSPath, toOSPath );
}
int idFileSystemLocal::ValidateDownloadPakForChecksum( int checksum, char path[ MAX_STRING_CHARS ], bool isGamePak ) {
return fileSystem->ValidateDownloadPakForChecksum( checksum, path, isGamePak );
}
idFile * idFileSystemLocal::MakeTemporaryFile( void ) {
return fileSystem->MakeTemporaryFile();
}
int idFileSystemLocal::AddZipFile( const char *path ) {
return fileSystem->AddZipFile( path );
}
findFile_t idFileSystemLocal::FindFile( const char *path, bool scheduleAddons ) {
return fileSystem->FindFile( path, scheduleAddons );
}
int idFileSystemLocal::GetNumMaps() {
return fileSystem->GetNumMaps();
}
const idDict * idFileSystemLocal::GetMapDecl( int i ) {
return fileSystem->GetMapDecl( i );
}
void idFileSystemLocal::FindMapScreenshot( const char *path, char *buf, int len ) {
fileSystem->FindMapScreenshot( path, buf, len );
}
bool idFileSystemLocal::FilenameCompare( const char *s1, const char *s2 ) const {
return fileSystem->FilenameCompare( s1, s2 );
}
void idNetworkSystemLocal::ServerSendReliableMessage( int clientNum, const idBitMsg &msg ) {
if ( idBotFacade::IsBot( clientNum ) ) {
// TODO: bots should handle this message
// return;
}
networkSystem->ServerSendReliableMessage( clientNum, msg );
}
void idNetworkSystemLocal::ServerSendReliableMessageExcluding( int clientNum, const idBitMsg &msg ) {
if ( idBotFacade::IsBot( clientNum ) ) {
// TODO: bots should handle this message
// return;
}
networkSystem->ServerSendReliableMessageExcluding( clientNum, msg );
}
int idNetworkSystemLocal::ServerGetClientPing( int clientNum ) {
if ( idBotFacade::IsBot( clientNum ) ) {
return 5; // ping = 5 for bots (same as Half-Life) ;)
}
return networkSystem->ServerGetClientPing( clientNum );
}
int idNetworkSystemLocal::ServerGetClientPrediction( int clientNum ) {
return networkSystem->ServerGetClientPrediction( clientNum );
}
int idNetworkSystemLocal::ServerGetClientTimeSinceLastPacket( int clientNum ) {
if ( idBotFacade::IsBot( clientNum ) ) {
return 0; // bots do not lag
}
return networkSystem->ServerGetClientTimeSinceLastPacket( clientNum );
}
int idNetworkSystemLocal::ServerGetClientTimeSinceLastInput( int clientNum ) {
if ( idBotFacade::IsBot( clientNum ) ) {
return 0; // bots do not lag
}
return networkSystem->ServerGetClientTimeSinceLastInput( clientNum );
}
int idNetworkSystemLocal::ServerGetClientOutgoingRate( int clientNum ) {
return networkSystem->ServerGetClientOutgoingRate( clientNum );
}
int idNetworkSystemLocal::ServerGetClientIncomingRate( int clientNum ) {
return networkSystem->ServerGetClientIncomingRate( clientNum );
}
float idNetworkSystemLocal::ServerGetClientIncomingPacketLoss( int clientNum ) {
return networkSystem->ServerGetClientIncomingPacketLoss( clientNum );
}
void idNetworkSystemLocal::ClientSendReliableMessage( const idBitMsg &msg ) {
networkSystem->ClientSendReliableMessage( msg );
}
int idNetworkSystemLocal::ClientGetPrediction( void ) {
return networkSystem->ClientGetPrediction();
}
int idNetworkSystemLocal::ClientGetTimeSinceLastPacket( void ) {
return networkSystem->ClientGetTimeSinceLastPacket();
}
int idNetworkSystemLocal::ClientGetOutgoingRate( void ) {
return networkSystem->ClientGetOutgoingRate();
}
int idNetworkSystemLocal::ClientGetIncomingRate( void ) {
return networkSystem->ClientGetIncomingRate();
}
float idNetworkSystemLocal::ClientGetIncomingPacketLoss( void ) {
return networkSystem->ClientGetIncomingPacketLoss();
}
void idRenderSystemLocal::Init( void ) {
renderSystem->Init();
}
void idRenderSystemLocal::Shutdown( void ) {
renderSystem->Shutdown();
}
void idRenderSystemLocal::InitOpenGL( void ) {
renderSystem->InitOpenGL();
}
void idRenderSystemLocal::ShutdownOpenGL( void ) {
renderSystem->ShutdownOpenGL();
}
bool idRenderSystemLocal::IsOpenGLRunning( void ) const {
return renderSystem->IsOpenGLRunning();
}
bool idRenderSystemLocal::IsFullScreen( void ) const {
return renderSystem->IsFullScreen();
}
int idRenderSystemLocal::GetScreenWidth( void ) const {
return renderSystem->GetScreenWidth();
}
int idRenderSystemLocal::GetScreenHeight( void ) const {
return renderSystem->GetScreenHeight();
}
idRenderWorld * idRenderSystemLocal::AllocRenderWorld( void ) {
return renderSystem->AllocRenderWorld();
}
void idRenderSystemLocal::FreeRenderWorld( idRenderWorld * rw ) {
renderSystem->FreeRenderWorld( rw );
}
void idRenderSystemLocal::BeginLevelLoad( void ) {
renderSystem->BeginLevelLoad();
}
void idRenderSystemLocal::EndLevelLoad( void ) {
renderSystem->EndLevelLoad();
}
bool idRenderSystemLocal::RegisterFont( const char *fontName, fontInfoEx_t &font ) {
return renderSystem->RegisterFont( fontName, font );
}
void idRenderSystemLocal::SetColor( const idVec4 &rgba ) {
renderSystem->SetColor( rgba );
}
void idRenderSystemLocal::SetColor4( float r, float g, float b, float a ) {
renderSystem->SetColor4( r, g, b, a );
}
void idRenderSystemLocal::DrawStretchPic( const idDrawVert *verts, const glIndex_t *indexes, int vertCount, int indexCount, const idMaterial *material,
bool clip, float min_x, float min_y, float max_x, float max_y ) {
renderSystem->DrawStretchPic( verts, indexes, vertCount, indexCount, material, clip, min_x, min_y, max_x, max_y );
}
void idRenderSystemLocal::DrawStretchPic( float x, float y, float w, float h, float s1, float t1, float s2, float t2, const idMaterial *material ) {
renderSystem->DrawStretchPic( x, y, w, h, s1, t1, s2, t2, material );
}
void idRenderSystemLocal::DrawStretchTri ( idVec2 p1, idVec2 p2, idVec2 p3, idVec2 t1, idVec2 t2, idVec2 t3, const idMaterial *material ) {
renderSystem->DrawStretchTri( p1, p2, p3, t1, t2, t3, material );
}
void idRenderSystemLocal::GlobalToNormalizedDeviceCoordinates( const idVec3 &global, idVec3 &ndc ) {
renderSystem->GlobalToNormalizedDeviceCoordinates( global, ndc );
}
void idRenderSystemLocal::GetGLSettings( int& width, int& height ) {
renderSystem->GetGLSettings( width, height );
}
void idRenderSystemLocal::PrintMemInfo( MemInfo_t *mi ) {
renderSystem->PrintMemInfo( mi );
}
void idRenderSystemLocal::DrawSmallChar( int x, int y, int ch, const idMaterial *material ) {
renderSystem->DrawSmallChar( x, y, ch, material );
}
void idRenderSystemLocal::DrawSmallStringExt( int x, int y, const char *string, const idVec4 &setColor, bool forceColor, const idMaterial *material ) {
renderSystem->DrawSmallStringExt( x, y, string, setColor, forceColor, material );
}
void idRenderSystemLocal::DrawBigChar( int x, int y, int ch, const idMaterial *material ) {
renderSystem->DrawBigChar( x, y, ch, material );
}
void idRenderSystemLocal::DrawBigStringExt( int x, int y, const char *string, const idVec4 &setColor, bool forceColor, const idMaterial *material ) {
renderSystem->DrawBigStringExt( x, y, string, setColor, forceColor, material );
}
void idRenderSystemLocal::WriteDemoPics() {
renderSystem->WriteDemoPics();
}
void idRenderSystemLocal::DrawDemoPics() {
renderSystem->DrawDemoPics();
}
void idRenderSystemLocal::BeginFrame( int windowWidth, int windowHeight ) {
renderSystem->BeginFrame( windowWidth, windowHeight );
}
void idRenderSystemLocal::EndFrame( int *frontEndMsec, int *backEndMsec ) {
renderSystem->EndFrame( frontEndMsec, backEndMsec );
}
void idRenderSystemLocal::TakeScreenshot( int width, int height, const char *fileName, int samples, struct renderView_s *ref ) {
renderSystem->TakeScreenshot( width, height, fileName, samples, ref );
}
void idRenderSystemLocal::CropRenderSize( int width, int height, bool makePowerOfTwo, bool forceDimensions ) {
renderSystem->CropRenderSize( width, height, makePowerOfTwo, forceDimensions );
}
void idRenderSystemLocal::CaptureRenderToImage( const char *imageName ) {
renderSystem->CaptureRenderToImage( imageName );
}
void idRenderSystemLocal::CaptureRenderToFile( const char *fileName, bool fixAlpha ) {
renderSystem->CaptureRenderToFile( fileName, fixAlpha );
}
void idRenderSystemLocal::UnCrop() {
renderSystem->UnCrop();
}
void idRenderSystemLocal::GetCardCaps( bool &oldCard, bool &nv10or20 ) {
renderSystem->GetCardCaps( oldCard, nv10or20 );
}
bool idRenderSystemLocal::UploadImage( const char *imageName, const byte *data, int width, int height ) {
return renderSystem->UploadImage( imageName, data, width, height );
}
void idSoundSystemLocal::Init( void ) {
soundSystem->Init();
}
void idSoundSystemLocal::Shutdown( void ) {
soundSystem->Shutdown();
}
void idSoundSystemLocal::ClearBuffer( void ) {
soundSystem->ClearBuffer();
}
bool idSoundSystemLocal::InitHW( void ) {
return soundSystem->InitHW();
}
bool idSoundSystemLocal::ShutdownHW( void ) {
return soundSystem->ShutdownHW();
}
int idSoundSystemLocal::AsyncUpdate( int time ) {
return soundSystem->AsyncUpdate( time );
}
int idSoundSystemLocal::AsyncUpdateWrite( int time ) {
return soundSystem->AsyncUpdateWrite( time );
}
void idSoundSystemLocal::SetMute( bool mute ) {
soundSystem->SetMute( mute );
}
cinData_t idSoundSystemLocal::ImageForTime( const int milliseconds, const bool waveform ) {
return soundSystem->ImageForTime( milliseconds, waveform );
}
int idSoundSystemLocal::GetSoundDecoderInfo( int index, soundDecoderInfo_t &decoderInfo ) {
return soundSystem->GetSoundDecoderInfo( index, decoderInfo );
}
idSoundWorld * idSoundSystemLocal::AllocSoundWorld( idRenderWorld *rw ) {
return soundSystem->AllocSoundWorld( rw );
}
void idSoundSystemLocal::SetPlayingSoundWorld( idSoundWorld *soundWorld ) {
soundSystem->SetPlayingSoundWorld( soundWorld );
}
idSoundWorld * idSoundSystemLocal::GetPlayingSoundWorld( void ) {
return soundSystem->GetPlayingSoundWorld();
}
void idSoundSystemLocal::BeginLevelLoad( void ) {
soundSystem->BeginLevelLoad();
}
void idSoundSystemLocal::EndLevelLoad( const char *mapString ) {
soundSystem->EndLevelLoad( mapString );
}
int idSoundSystemLocal::AsyncMix( int soundTime, float *mixBuffer ) {
return soundSystem->AsyncMix( soundTime, mixBuffer );
}
void idSoundSystemLocal::PrintMemInfo( MemInfo_t *mi ) {
soundSystem->PrintMemInfo( mi );
}
int idSoundSystemLocal::IsEAXAvailable( void ) {
return soundSystem->IsEAXAvailable();
}
void idRenderModelManagerLocal::Init() {
renderModelManager->Init();
}
void idRenderModelManagerLocal::Shutdown() {
renderModelManager->Shutdown();
}
void idRenderModelManagerLocal::BeginLevelLoad() {
renderModelManager->BeginLevelLoad();
}
void idRenderModelManagerLocal::EndLevelLoad() {
renderModelManager->EndLevelLoad();
}
idRenderModel * idRenderModelManagerLocal::AllocModel() {
return renderModelManager->AllocModel();
}
void idRenderModelManagerLocal::FreeModel( idRenderModel *model ) {
renderModelManager->FreeModel( model );
}
idRenderModel * idRenderModelManagerLocal::FindModel( const char *modelName ) {
return renderModelManager->FindModel( modelName );