mirror of
https://git.code.sf.net/p/quake/quake2forge
synced 2025-01-19 15:40:59 +00:00
- Replace a fixme in vid_menu.c with a warning.
- Remove some dead dead code from main.c
This commit is contained in:
parent
1d554ce1f3
commit
97d7b9731e
2 changed files with 1 additions and 143 deletions
142
src/main.c
142
src/main.c
|
@ -44,15 +44,6 @@
|
||||||
#include <sys/mman.h>
|
#include <sys/mman.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
/* merged from sys_*.c -- jaq */
|
|
||||||
#if defined(__linux__) || defined(__sgi)
|
|
||||||
#include <mntent.h>
|
|
||||||
#elif defined(__FreeBSD__) || defined(__bsd__) || defined (__NetBSD__)
|
|
||||||
#include <fstab.h>
|
|
||||||
#elif defined(__sun__)
|
|
||||||
#include <sys/file.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAVE_DLOPEN
|
#ifdef HAVE_DLOPEN
|
||||||
# include <dlfcn.h>
|
# include <dlfcn.h>
|
||||||
#endif
|
#endif
|
||||||
|
@ -387,139 +378,6 @@ int main (int argc, char **argv) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
|
||||||
void Sys_CopyProtect(void)
|
|
||||||
{
|
|
||||||
/* merged in from sys_bsd.c -- jaq */
|
|
||||||
#ifdef __linux__
|
|
||||||
FILE *mnt;
|
|
||||||
struct mntent *ent;
|
|
||||||
#else /* __bsd__ */
|
|
||||||
struct fstab * ent;
|
|
||||||
#endif
|
|
||||||
char path[MAX_OSPATH];
|
|
||||||
struct stat st;
|
|
||||||
qboolean found_cd = false;
|
|
||||||
|
|
||||||
static qboolean checked = false;
|
|
||||||
|
|
||||||
if (checked)
|
|
||||||
return;
|
|
||||||
|
|
||||||
/* sys_irix.c -- jaq
|
|
||||||
Com_Printf("XXX - Sys_CopyProtect disabled\n");
|
|
||||||
checked = true;
|
|
||||||
return;
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* merged in from sys_bsd.c */
|
|
||||||
#ifdef __linux__
|
|
||||||
if ((mnt = setmntent("/etc/mtab", "r")) == NULL)
|
|
||||||
Com_Error(ERR_FATAL, "Can't read mount table to determine mounted cd location.");
|
|
||||||
|
|
||||||
while ((ent = getmntent(mnt)) != NULL) {
|
|
||||||
if (strcmp(ent->mnt_type, "iso9660") == 0) {
|
|
||||||
#else /* __bsd__ */
|
|
||||||
while ((ent = getfsent()) != NULL) {
|
|
||||||
if (strcmp(ent->fs_vfstype, "cd9660") == 0) {
|
|
||||||
#endif
|
|
||||||
// found a cd file system
|
|
||||||
found_cd = true;
|
|
||||||
/* merged in from sys_bsd.c */
|
|
||||||
#ifdef __linux__
|
|
||||||
sprintf(path, "%s/%s", ent->mnt_dir, "install/data/quake2.exe");
|
|
||||||
#else /* __bsd__ */
|
|
||||||
sprintf(path, "%s/%s", ent->fs_file, "install/data/quake2.exe");
|
|
||||||
#endif
|
|
||||||
if (stat(path, &st) == 0) {
|
|
||||||
// found it
|
|
||||||
checked = true;
|
|
||||||
/* merged in from sys_bsd.c */
|
|
||||||
#ifdef __linux__
|
|
||||||
endmntent(mnt);
|
|
||||||
#else /* __bsd__ */
|
|
||||||
endfsent();
|
|
||||||
#endif
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
/* merged in from sys_bsd.c */
|
|
||||||
#ifdef __linux__
|
|
||||||
sprintf(path, "%s/%s", ent->mnt_dir, "Install/Data/quake2.exe");
|
|
||||||
#else /* __bsd__ */
|
|
||||||
sprintf(path, "%s/%s", ent->fs_file, "Install/Data/quake2.exe");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (stat(path, &st) == 0) {
|
|
||||||
// found it
|
|
||||||
checked = true;
|
|
||||||
/* merged in from sys_bsd.c */
|
|
||||||
#ifdef __linux__
|
|
||||||
endmntent(mnt);
|
|
||||||
#else /* __bsd__ */
|
|
||||||
endfsent();
|
|
||||||
#endif
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
/* merged in from sys_bsd.c */
|
|
||||||
#ifdef __linux__
|
|
||||||
sprintf(path, "%s/%s", ent->mnt_dir, "quake2.exe");
|
|
||||||
#else /* __bsd__ */
|
|
||||||
sprintf(path, "%s/%s", ent->fs_file, "quake2.exe");
|
|
||||||
#endif
|
|
||||||
if (stat(path, &st) == 0) {
|
|
||||||
// found it
|
|
||||||
checked = true;
|
|
||||||
/* merged in from sys_bsd.c */
|
|
||||||
#ifdef __linux__
|
|
||||||
endmntent(mnt);
|
|
||||||
#else /* __bsd__ */
|
|
||||||
endfsent();
|
|
||||||
#endif
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/* merged in from sys_bsd.c */
|
|
||||||
#ifdef __linux__
|
|
||||||
endmntent(mnt);
|
|
||||||
#else /* __bsd__ */
|
|
||||||
endfsent();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (found_cd)
|
|
||||||
Com_Error (ERR_FATAL, "Could not find a Quake2 CD in your CD drive.");
|
|
||||||
Com_Error (ERR_FATAL, "Unable to find a mounted iso9660 file system.\n"
|
|
||||||
"You must mount the Quake2 CD in a cdrom drive in order to play.");
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if 0
|
|
||||||
/*
|
|
||||||
================
|
|
||||||
Sys_MakeCodeWriteable
|
|
||||||
================
|
|
||||||
*/
|
|
||||||
void Sys_MakeCodeWriteable (unsigned long startaddr, unsigned long length)
|
|
||||||
{
|
|
||||||
|
|
||||||
int r;
|
|
||||||
unsigned long addr;
|
|
||||||
int psize = getpagesize();
|
|
||||||
|
|
||||||
addr = (startaddr & ~(psize-1)) - psize;
|
|
||||||
|
|
||||||
// fprintf(stderr, "writable code %lx(%lx)-%lx, length=%lx\n", startaddr,
|
|
||||||
// addr, startaddr+length, length);
|
|
||||||
|
|
||||||
r = mprotect((char*)addr, length + startaddr - addr + psize, 7);
|
|
||||||
|
|
||||||
if (r < 0)
|
|
||||||
Sys_Error("Protection change failed\n");
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
size_t verify_fread(void * ptr, size_t size, size_t nitems, FILE * fp) {
|
size_t verify_fread(void * ptr, size_t size, size_t nitems, FILE * fp) {
|
||||||
size_t ret;
|
size_t ret;
|
||||||
int err;
|
int err;
|
||||||
|
|
|
@ -183,7 +183,7 @@ static void ApplyChanges( void *unused )
|
||||||
vid_ref->modified = true;
|
vid_ref->modified = true;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
/* FIXME: probably put some error message here */
|
Com_Printf("No video refresher\n");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue