MCPcopy Create free account
hub / github.com/demoth/jake2 / Init

Method Init

client/src/main/java/jake2/client/CDAudio.java:345–379  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

343 }
344
345 public static int Init() {
346 cd_nocd = Cvar.getInstance().Get ("cd_nocd", "0", Defines.CVAR_ARCHIVE );
347
348 if ( (int)cd_nocd.value != 0 )
349 return -1;
350
351 cddir = Cvar.getInstance().Get ("cddir", "C:\\Quake2\\baseq2", Defines.CVAR_ARCHIVE );
352 cd_volume = Cvar.getInstance().Get ("cd_volume", "1", Defines.CVAR_ARCHIVE);
353 cdvolume = cd_volume.value;
354
355
356 //for (i = 0; i < 100; i++)
357 // remap[i] = i;
358
359
360 if (GetAudioDiskInfo() == -1)
361 {
362 Com.Printf("CD Audio No CD (MP3s) in player\n");
363 //cdValid = false;
364 cdfile = -1;
365 initialized = false;
366 enabled = false;
367 return -1;
368 }
369
370 Cmd.AddCommand ("cd", CDAudio::CD_f);
371
372 //cdValid = true;
373 cdfile = 0;
374 initialized = true;
375 enabled = true;
376
377 Com.Printf("CD Audio (MP3s) Initialized\n");
378 return 0;
379 }
380
381 public static void Shutdown() {
382 if (initialized == false)

Callers 1

InitMethod · 0.95

Calls 5

getInstanceMethod · 0.95
GetAudioDiskInfoMethod · 0.95
PrintfMethod · 0.95
AddCommandMethod · 0.95
GetMethod · 0.80

Tested by

no test coverage detected