Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 213966
Collapse All | Expand All

(-)NPRQuake.old/Makefile (-2 / +3 lines)
Lines 1-10 Link Here
1
RELEASE_CFLAGS=-Dstricmp=strcasecmp -O3 -ffast-math -funroll-loops -fomit-frame-pointer -fexpensive-optimizations
1
RELEASE_CFLAGS=-Dstricmp=strcasecmp $(OPTFLAGS)
2
#-DGENTOO_LIBDIR='\"$(GENTOO_LIBDIR)\"' -DGENTOO_DATADIR='\"$(GENTOO_DATADIR)\"'
2
3
3
DEBUG_CFLAGS=-Dstricmp=strcasecmp -g
4
DEBUG_CFLAGS=-Dstricmp=strcasecmp -g
4
5
5
CFLAGS=$(RELEASE_CFLAGS)
6
CFLAGS=$(RELEASE_CFLAGS)
6
7
7
DR_FLAGS=-DGLQUAKE -D_DLL_BUILD -shared
8
DR_FLAGS=-DGLQUAKE -D_DLL_BUILD -shared -fPIC
8
9
9
renderers=build/dr_default.so build/brush.so build/bprint.so build/sketch.so
10
renderers=build/dr_default.so build/brush.so build/bprint.so build/sketch.so
10
11
(-)NPRQuake.old/NPRQuakeSrc/common.c (-16 / +39 lines)
Lines 1239-1244 Link Here
1239
1239
1240
char    com_cachedir[MAX_OSPATH];
1240
char    com_cachedir[MAX_OSPATH];
1241
char    com_gamedir[MAX_OSPATH];
1241
char    com_gamedir[MAX_OSPATH];
1242
char	com_basedir[MAX_OSPATH];
1242
1243
1243
typedef struct searchpath_s
1244
typedef struct searchpath_s
1244
{
1245
{
Lines 1686-1705 Link Here
1686
then loads and adds pak1.pak pak2.pak ... 
1687
then loads and adds pak1.pak pak2.pak ... 
1687
================
1688
================
1688
*/
1689
*/
1689
void COM_AddGameDirectory (char *dir)
1690
static void
1691
COM_AddGameDirectory (char *base, char *dir)
1690
{
1692
{
1691
	int                             i;
1693
	int                             i;
1692
	searchpath_t    *search;
1694
	searchpath_t    *search;
1693
	pack_t                  *pak;
1695
	pack_t                  *pak;
1694
	char                    pakfile[MAX_OSPATH];
1696
	char                    pakfile[MAX_OSPATH];
1695
1697
1696
	strcpy (com_gamedir, dir);
1698
	if (!base)
1699
		return;
1700
	
1701
	strcpy(com_gamedir, va("%s/%s", base, dir));
1702
1703
//	strcpy (com_gamedir, dir);
1697
1704
1698
//
1705
//
1699
// add the directory to the search path
1706
// add the directory to the search path
1700
//
1707
//
1701
	search = Hunk_Alloc (sizeof(searchpath_t));
1708
	search = Hunk_Alloc (sizeof(searchpath_t));
1702
	strcpy (search->filename, dir);
1709
	strcpy (search->filename, com_gamedir);
1703
	search->next = com_searchpaths;
1710
	search->next = com_searchpaths;
1704
	com_searchpaths = search;
1711
	com_searchpaths = search;
1705
1712
Lines 1708-1714 Link Here
1708
//
1715
//
1709
	for (i=0 ; ; i++)
1716
	for (i=0 ; ; i++)
1710
	{
1717
	{
1711
		sprintf (pakfile, "%s/pak%i.pak", dir, i);
1718
		sprintf (pakfile, "%s/pak%i.pak", com_gamedir, i);
1712
		pak = COM_LoadPackFile (pakfile);
1719
		pak = COM_LoadPackFile (pakfile);
1713
		if (!pak)
1720
		if (!pak)
1714
			break;
1721
			break;
Lines 1731-1756 Link Here
1731
*/
1738
*/
1732
void COM_InitFilesystem (void)
1739
void COM_InitFilesystem (void)
1733
{
1740
{
1741
	char	*home;
1734
	int             i, j;
1742
	int             i, j;
1735
	char    basedir[MAX_OSPATH];
1743
//	char    basedir[MAX_OSPATH];
1736
	searchpath_t    *search;
1744
	searchpath_t    *search;
1737
1745
1746
	home = getenv("HOME");
1747
1738
//
1748
//
1739
// -basedir <path>
1749
// -basedir <path>
1740
// Overrides the system supplied base directory (under GAMENAME)
1750
// Overrides the system supplied base directory (under GAMENAME)
1741
//
1751
//
1742
	i = COM_CheckParm ("-basedir");
1752
	i = COM_CheckParm ("-basedir");
1743
	if (i && i < com_argc-1)
1753
	if (i && i < com_argc-1)
1744
		strcpy (basedir, com_argv[i+1]);
1754
		strcpy (com_basedir, com_argv[i+1]);
1745
	else
1755
	else
1746
		strcpy (basedir, host_parms.basedir);
1756
		strcpy (com_basedir, GENTOO_DATADIR);
1757
//		strcpy (com_basedir, host_parms.basedir);
1747
1758
1748
	j = strlen (basedir);
1759
	j = strlen (com_basedir);
1749
1760
1750
	if (j > 0)
1761
	if (j > 0)
1751
	{
1762
	{
1752
		if ((basedir[j-1] == '\\') || (basedir[j-1] == '/'))
1763
		if ((com_basedir[j-1] == '\\') || (com_basedir[j-1] == '/'))
1753
			basedir[j-1] = 0;
1764
			com_basedir[j-1] = 0;
1754
	}
1765
	}
1755
1766
1756
//
1767
//
Lines 1774-1785 Link Here
1774
//
1785
//
1775
// start up with GAMENAME by default (id1)
1786
// start up with GAMENAME by default (id1)
1776
//
1787
//
1777
	COM_AddGameDirectory (va("%s/"GAMENAME, basedir) );
1788
	COM_AddGameDirectory(com_basedir, GAMENAME);
1789
	COM_AddGameDirectory(home, ".nprquake-sdl/" GAMENAME);
1778
1790
1779
	if (COM_CheckParm ("-rogue"))
1791
	if (COM_CheckParm ("-rogue")) {
1780
		COM_AddGameDirectory (va("%s/rogue", basedir) );
1792
		COM_AddGameDirectory(com_basedir, "rogue");
1781
	if (COM_CheckParm ("-hipnotic"))
1793
		COM_AddGameDirectory(home, ".nprquake-sdl/rogue");
1782
		COM_AddGameDirectory (va("%s/hipnotic", basedir) );
1794
	}
1795
	if (COM_CheckParm ("-hipnotic")) {
1796
		COM_AddGameDirectory(com_basedir, "hipnotic");
1797
		COM_AddGameDirectory(home, ".nprquake-sdl/hipnotic");
1798
	}
1783
1799
1784
//
1800
//
1785
// -game <gamedir>
1801
// -game <gamedir>
Lines 1789-1797 Link Here
1789
	if (i && i < com_argc-1)
1805
	if (i && i < com_argc-1)
1790
	{
1806
	{
1791
		com_modified = true;
1807
		com_modified = true;
1792
		COM_AddGameDirectory (va("%s/%s", basedir, com_argv[i+1]));
1808
		COM_AddGameDirectory(com_basedir, com_argv[i + 1]);
1809
		COM_AddGameDirectory(home, va(".nprquake-sdl/%s", com_argv[i + 1]));
1793
	}
1810
	}
1794
1811
1812
    /* If home is available, create the game directory */
1813
    if (home) {
1814
        COM_CreatePath(com_gamedir);
1815
        Sys_mkdir(com_gamedir);
1816
    }
1817
1795
//
1818
//
1796
// -path <dir or packfile> [<dir or packfile>] ...
1819
// -path <dir or packfile> [<dir or packfile>] ...
1797
// Fully specifies the exact serach path, overriding the generated one
1820
// Fully specifies the exact serach path, overriding the generated one
(-)NPRQuake.old/NPRQuakeSrc/common.h (+1 lines)
Lines 165-170 Link Here
165
extern int com_filesize;
165
extern int com_filesize;
166
struct cache_user_s;
166
struct cache_user_s;
167
167
168
extern	char	com_basedir[MAX_OSPATH];
168
extern	char	com_gamedir[MAX_OSPATH];
169
extern	char	com_gamedir[MAX_OSPATH];
169
170
170
void COM_WriteFile (char *filename, void *data, int len);
171
void COM_WriteFile (char *filename, void *data, int len);
(-)NPRQuake.old/NPRQuakeSrc/gl_rmisc.c (-2 / +3 lines)
Lines 572-579 Link Here
572
#ifdef _WIN32 //JG
572
#ifdef _WIN32 //JG
573
    hnewlib = LoadLibrary( lib );
573
    hnewlib = LoadLibrary( lib );
574
#else
574
#else
575
    libfile = malloc(strlen(lib) + 4);
575
    libfile = malloc(strlen(lib) + 512);
576
    strcpy(libfile, lib);
576
    strcpy(libfile, GENTOO_LIBDIR"/");
577
    strcat(libfile, lib);
577
    strcat(libfile, ".so");
578
    strcat(libfile, ".so");
578
    hnewlib = dlopen( libfile, RTLD_LAZY | RTLD_GLOBAL );
579
    hnewlib = dlopen( libfile, RTLD_LAZY | RTLD_GLOBAL );
579
    free(libfile);
580
    free(libfile);
(-)NPRQuake.old/NPRQuakeSrc/host.c (+4 lines)
Lines 261-266 Link Here
261
		Key_WriteBindings (f);
261
		Key_WriteBindings (f);
262
		Cvar_WriteVariables (f);
262
		Cvar_WriteVariables (f);
263
263
264
		/* Save the mlook state (rarely used as an actual key binding) */
265
		if (in_mlook.state & 1)
266
			fprintf(f, "+mlook\n");
267
264
		fclose (f);
268
		fclose (f);
265
	}
269
	}
266
}
270
}
(-)NPRQuake.old/NPRQuakeSrc/Makefile (-2 / +3 lines)
Lines 29-35 Link Here
29
29
30
CC=gcc
30
CC=gcc
31
31
32
RELEASE_CFLAGS=$(BASE_CFLAGS) -O3 -ffast-math -funroll-loops -fomit-frame-pointer -fexpensive-optimizations
32
RELEASE_CFLAGS=$(BASE_CFLAGS) $(OPTFLAGS)
33
#-DGENTOO_LIBDIR='\"$(GENTOO_LIBDIR)\"' -DGENTOO_DATADIR='\"$(GENTOO_DATADIR)\"'
33
DEBUG_CFLAGS=$(BASE_CFLAGS) -g
34
DEBUG_CFLAGS=$(BASE_CFLAGS) -g
34
LDFLAGS=-lm
35
LDFLAGS=-lm
35
CFLAGS=$(RELEASE_CFLAGS)
36
CFLAGS=$(RELEASE_CFLAGS)
Lines 176-182 Link Here
176
	$(DO_GL_CC)
177
	$(DO_GL_CC)
177
178
178
$(BUILDDIR)/glquake/common.o :       common.c
179
$(BUILDDIR)/glquake/common.o :       common.c
179
	$(DO_GL_DEBUG_CC)
180
	$(DO_GL_CC)
180
181
181
$(BUILDDIR)/glquake/console.o :      console.c
182
$(BUILDDIR)/glquake/console.o :      console.c
182
	$(DO_GL_CC)
183
	$(DO_GL_CC)
(-)NPRQuake.old/NPRQuakeSrc/math.s (+3 lines)
Lines 416-418 Link Here
416
	call	C(BOPS_Error)
416
	call	C(BOPS_Error)
417
417
418
#endif	// id386
418
#endif	// id386
419
#if defined(__linux__) && defined(__ELF__)
420
.section .note.GNU-stack,"",%progbits
421
#endif
(-)NPRQuake.old/NPRQuakeSrc/snd_mixa.s (+3 lines)
Lines 216-218 Link Here
216
216
217
#endif	// id386
217
#endif	// id386
218
218
219
#if defined(__linux__) && defined(__ELF__)
220
.section .note.GNU-stack,"",%progbits
221
#endif
(-)NPRQuake.old/NPRQuakeSrc/sys_dosa.s (+3 lines)
Lines 93-95 Link Here
93
93
94
	ret
94
	ret
95
95
96
#if defined(__linux__) && defined(__ELF__)
97
.section .note.GNU-stack,"",%progbits
98
#endif
(-)NPRQuake.old/NPRQuakeSrc/sys_linux.c (-2 / +1 lines)
Lines 86-92 Link Here
86
void Sys_Printf (char *fmt, ...)
86
void Sys_Printf (char *fmt, ...)
87
{
87
{
88
	va_list		argptr;
88
	va_list		argptr;
89
	char		text[2048];
89
	char		text[4096];
90
	unsigned char		*p;
90
	unsigned char		*p;
91
91
92
	va_start (argptr,fmt);
92
	va_start (argptr,fmt);
Lines 381-387 Link Here
381
	if (j)
381
	if (j)
382
		parms.memsize = (int) (Q_atof(com_argv[j+1]) * 1024 * 1024);
382
		parms.memsize = (int) (Q_atof(com_argv[j+1]) * 1024 * 1024);
383
	parms.membase = malloc (parms.memsize);
383
	parms.membase = malloc (parms.memsize);
384
385
	parms.basedir = basedir;
384
	parms.basedir = basedir;
386
// caching is disabled by default, use -cachedir to enable
385
// caching is disabled by default, use -cachedir to enable
387
//	parms.cachedir = cachedir;
386
//	parms.cachedir = cachedir;
(-)NPRQuake.old/NPRQuakeSrc/worlda.s (+3 lines)
Lines 142-144 Link Here
142
142
143
#endif	// id386
143
#endif	// id386
144
144
145
#if defined(__linux__) && defined(__ELF__)
146
.section .note.GNU-stack,"",%progbits
147
#endif

Return to bug 213966