Go on, you might as well do it. All the icky glue code is already written for you in LWJGL too - all you’ve got to port is the game itself.
BTW, the CD check in Q2 is this:
/*
================
Sys_ScanForCD
================
*/
char *Sys_ScanForCD (void)
{
static char cddir[MAX_OSPATH];
static qboolean done;
#ifndef DEMO
char drive[4];
FILE *f;
char test[MAX_QPATH];
if (done) // don't re-check
return cddir;
// no abort/retry/fail errors
SetErrorMode (SEM_FAILCRITICALERRORS);
drive[0] = 'c';
drive[1] = ':';
drive[2] = '\\';
drive[3] = 0;
done = true;
// scan the drives
for (drive[0] = 'c' ; drive[0] <= 'z' ; drive[0]++)
{
// where activision put the stuff...
sprintf (cddir, "%sinstall\\data", drive);
sprintf (test, "%sinstall\\data\\quake2.exe", drive);
f = fopen(test, "r");
if (f)
{
fclose (f);
if (GetDriveType (drive) == DRIVE_CDROM)
return cddir;
}
}
#endif
cddir[0] = 0;
return NULL;
}
/*
================
Sys_CopyProtect
================
*/
void Sys_CopyProtect (void)
{
#ifndef DEMO
char *cddir;
cddir = Sys_ScanForCD();
if (!cddir[0])
Com_Error (ERR_FATAL, "You must have the Quake2 CD in the drive to play.");
#endif
}
GPL code
i.e. it’s not a very clever check at all is it Besides I think we might add a CD API to LWJGL at some point.
Cas