mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-25 03:00:46 +00:00
git-svn-id: https://svn.eduke32.com/eduke32@627 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
d6beeac46e
commit
25ac5770c0
15 changed files with 54 additions and 40 deletions
|
@ -31,6 +31,9 @@ extern char offscreenrendering;
|
||||||
extern void (*baselayer_onvideomodechange)(int);
|
extern void (*baselayer_onvideomodechange)(int);
|
||||||
|
|
||||||
#ifdef USE_OPENGL
|
#ifdef USE_OPENGL
|
||||||
|
#include "osd.h"
|
||||||
|
extern int osdcmd_glinfo(const osdfuncparm_t *parm);
|
||||||
|
|
||||||
struct glinfo {
|
struct glinfo {
|
||||||
const char *vendor;
|
const char *vendor;
|
||||||
const char *renderer;
|
const char *renderer;
|
||||||
|
@ -52,6 +55,7 @@ struct glinfo {
|
||||||
char multitex;
|
char multitex;
|
||||||
char envcombine;
|
char envcombine;
|
||||||
char vbos;
|
char vbos;
|
||||||
|
char dumped;
|
||||||
};
|
};
|
||||||
extern struct glinfo glinfo;
|
extern struct glinfo glinfo;
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -30,6 +30,7 @@ struct glinfo glinfo =
|
||||||
0, // multitexturing
|
0, // multitexturing
|
||||||
0, // env_combine
|
0, // env_combine
|
||||||
0, // Vertex Buffer Objects
|
0, // Vertex Buffer Objects
|
||||||
|
0, // GL info dumped
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -79,17 +80,17 @@ static int osdcmd_hicsetpalettetint(const osdfuncparm_t *parm)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static int osdcmd_glinfo(const osdfuncparm_t *parm)
|
int osdcmd_glinfo(const osdfuncparm_t *parm)
|
||||||
{
|
{
|
||||||
char *s,*t,*u,i;
|
char *s,*t,*u,i;
|
||||||
|
|
||||||
if (bpp == 8)
|
if (bpp == 8)
|
||||||
{
|
{
|
||||||
OSD_Printf("glinfo: Not in OpenGL mode.\n");
|
initprintf("glinfo: Not in OpenGL mode.\n");
|
||||||
return OSDCMD_OK;
|
return OSDCMD_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
OSD_Printf("OpenGL Information:\n"
|
initprintf("OpenGL Information:\n"
|
||||||
" Version: %s\n"
|
" Version: %s\n"
|
||||||
" Vendor: %s\n"
|
" Vendor: %s\n"
|
||||||
" Renderer: %s\n"
|
" Renderer: %s\n"
|
||||||
|
@ -130,7 +131,7 @@ static int osdcmd_glinfo(const osdfuncparm_t *parm)
|
||||||
);
|
);
|
||||||
|
|
||||||
s = Bstrdup(glinfo.extensions);
|
s = Bstrdup(glinfo.extensions);
|
||||||
if (!s) OSD_Printf(glinfo.extensions);
|
if (!s) initprintf(glinfo.extensions);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
i = 0; t = u = s;
|
i = 0; t = u = s;
|
||||||
|
@ -141,14 +142,14 @@ static int osdcmd_glinfo(const osdfuncparm_t *parm)
|
||||||
if (i&1)
|
if (i&1)
|
||||||
{
|
{
|
||||||
*t = 0;
|
*t = 0;
|
||||||
OSD_Printf(" %s\n",u);
|
initprintf(" %s\n",u);
|
||||||
u = t+1;
|
u = t+1;
|
||||||
}
|
}
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
t++;
|
t++;
|
||||||
}
|
}
|
||||||
if (i&1) OSD_Printf(" %s\n",u);
|
if (i&1) initprintf(" %s\n",u);
|
||||||
Bfree(s);
|
Bfree(s);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -276,7 +276,7 @@ int app_main(int argc, const char **argv)
|
||||||
pathsearchmode = 1; // unrestrict findfrompath so that full access to the filesystem can be had
|
pathsearchmode = 1; // unrestrict findfrompath so that full access to the filesystem can be had
|
||||||
|
|
||||||
#ifdef USE_OPENGL
|
#ifdef USE_OPENGL
|
||||||
OSD_RegisterFunction("restartvid","restartvid: reinitialise the video mode",osdcmd_restartvid);
|
OSD_RegisterFunction("restartvid","restartvid: reinitialize the video mode",osdcmd_restartvid);
|
||||||
OSD_RegisterFunction("vidmode","vidmode [xdim ydim] [bpp] [fullscreen]: immediately change the video mode",osdcmd_vidmode);
|
OSD_RegisterFunction("vidmode","vidmode [xdim ydim] [bpp] [fullscreen]: immediately change the video mode",osdcmd_vidmode);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -104,7 +104,7 @@ void initcache(intptr_t dacachestart, int dacachesize)
|
||||||
cac[0].lock = &zerochar;
|
cac[0].lock = &zerochar;
|
||||||
cacnum = 1;
|
cacnum = 1;
|
||||||
|
|
||||||
initprintf("initcache(): Initialised with %d bytes\n", dacachesize);
|
initprintf("initcache(): Initialized with %d bytes\n", dacachesize);
|
||||||
}
|
}
|
||||||
|
|
||||||
void allocache(intptr_t *newhandle, int newbytes, char *newlockptr)
|
void allocache(intptr_t *newhandle, int newbytes, char *newlockptr)
|
||||||
|
|
|
@ -63,7 +63,7 @@ static hicreplctyp * hicfindsubst(int picnum, int palnum, int skybox)
|
||||||
|
|
||||||
//
|
//
|
||||||
// hicinit()
|
// hicinit()
|
||||||
// Initialise the high-colour stuff to default.
|
// Initialize the high-colour stuff to default.
|
||||||
//
|
//
|
||||||
void hicinit(void)
|
void hicinit(void)
|
||||||
{
|
{
|
||||||
|
|
|
@ -59,7 +59,7 @@ static char osdvisible=0; // onscreen display visible?
|
||||||
static char osdinput=0; // capture input?
|
static char osdinput=0; // capture input?
|
||||||
static int osdhead=0; // topmost visible line number
|
static int osdhead=0; // topmost visible line number
|
||||||
static BFILE *osdlog=NULL; // log filehandle
|
static BFILE *osdlog=NULL; // log filehandle
|
||||||
static char osdinited=0; // text buffer initialised?
|
static char osdinited=0; // text buffer initialized?
|
||||||
static int osdkey=0x29; // tilde shows the osd
|
static int osdkey=0x29; // tilde shows the osd
|
||||||
static int keytime=0;
|
static int keytime=0;
|
||||||
static int osdscrtime = 0;
|
static int osdscrtime = 0;
|
||||||
|
@ -288,7 +288,7 @@ void OSD_Cleanup(void)
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// OSD_Init() -- Initialises the on-screen display
|
// OSD_Init() -- Initializes the on-screen display
|
||||||
//
|
//
|
||||||
void OSD_Init(void)
|
void OSD_Init(void)
|
||||||
{
|
{
|
||||||
|
|
|
@ -688,7 +688,7 @@ void polymost_glreset()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// one-time initialisation of OpenGL for polymost
|
// one-time initialization of OpenGL for polymost
|
||||||
void polymost_glinit()
|
void polymost_glinit()
|
||||||
{
|
{
|
||||||
GLfloat col[4];
|
GLfloat col[4];
|
||||||
|
|
|
@ -216,7 +216,7 @@ int initsystem(void)
|
||||||
|
|
||||||
SDL_VERSION(&compiled);
|
SDL_VERSION(&compiled);
|
||||||
|
|
||||||
initprintf("Initialising SDL system interface "
|
initprintf("Initializing SDL system interface "
|
||||||
"(compiled with SDL version %d.%d.%d, DLL version %d.%d.%d)\n",
|
"(compiled with SDL version %d.%d.%d, DLL version %d.%d.%d)\n",
|
||||||
linked->major, linked->minor, linked->patch,
|
linked->major, linked->minor, linked->patch,
|
||||||
compiled.major, compiled.minor, compiled.patch);
|
compiled.major, compiled.minor, compiled.patch);
|
||||||
|
@ -227,7 +227,7 @@ int initsystem(void)
|
||||||
#endif
|
#endif
|
||||||
))
|
))
|
||||||
{
|
{
|
||||||
initprintf("Initialisation failed! (%s)\n", SDL_GetError());
|
initprintf("Initialization failed! (%s)\n", SDL_GetError());
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -585,13 +585,13 @@ Uint32 timerticspersec=0;
|
||||||
static void(*usertimercallback)(void) = NULL;
|
static void(*usertimercallback)(void) = NULL;
|
||||||
|
|
||||||
//
|
//
|
||||||
// inittimer() -- initialise timer
|
// inittimer() -- initialize timer
|
||||||
//
|
//
|
||||||
int inittimer(int tickspersecond)
|
int inittimer(int tickspersecond)
|
||||||
{
|
{
|
||||||
if (timerfreq) return 0; // already installed
|
if (timerfreq) return 0; // already installed
|
||||||
|
|
||||||
// initprintf("Initialising timer\n");
|
// initprintf("Initializing timer\n");
|
||||||
|
|
||||||
timerfreq = 1000;
|
timerfreq = 1000;
|
||||||
timerticspersec = tickspersecond;
|
timerticspersec = tickspersecond;
|
||||||
|
@ -1110,6 +1110,12 @@ int setvideomode(int x, int y, int c, int fs)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Bfree(p);
|
Bfree(p);
|
||||||
|
|
||||||
|
if (!glinfo.dumped)
|
||||||
|
{
|
||||||
|
osdcmd_glinfo(NULL);
|
||||||
|
glinfo.dumped = 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -74,7 +74,7 @@ void initsb(char dadigistat, char damusistat, int dasamplerate, char danumspeake
|
||||||
|
|
||||||
musicstat = damusistat;
|
musicstat = damusistat;
|
||||||
|
|
||||||
printOSD("Initialising FMOD...\n");
|
printOSD("Initializing FMOD...\n");
|
||||||
printOSD(" Linked version: %.02f\n", FMOD_VERSION);
|
printOSD(" Linked version: %.02f\n", FMOD_VERSION);
|
||||||
printOSD(" DLL version: %.02f\n", FSOUND_GetVersion());
|
printOSD(" DLL version: %.02f\n", FSOUND_GetVersion());
|
||||||
|
|
||||||
|
|
|
@ -514,7 +514,7 @@ int initsystem(void)
|
||||||
{
|
{
|
||||||
DEVMODE desktopmode;
|
DEVMODE desktopmode;
|
||||||
|
|
||||||
initprintf("Initialising Windows DirectX/GDI system interface\n");
|
initprintf("Initializing Windows DirectX/GDI system interface\n");
|
||||||
|
|
||||||
// get the desktop dimensions before anything changes them
|
// get the desktop dimensions before anything changes them
|
||||||
ZeroMemory(&desktopmode, sizeof(DEVMODE));
|
ZeroMemory(&desktopmode, sizeof(DEVMODE));
|
||||||
|
@ -548,7 +548,7 @@ int initsystem(void)
|
||||||
|
|
||||||
// try and start DirectDraw
|
// try and start DirectDraw
|
||||||
if (InitDirectDraw())
|
if (InitDirectDraw())
|
||||||
initprintf("DirectDraw initialisation failed. Fullscreen modes will be unavailable.\n");
|
initprintf("DirectDraw initialization failed. Fullscreen modes will be unavailable.\n");
|
||||||
|
|
||||||
OSD_RegisterFunction("maxrefreshfreq", "maxrefreshfreq: maximum display frequency to set for OpenGL Polymost modes (0=no maximum)", set_maxrefreshfreq);
|
OSD_RegisterFunction("maxrefreshfreq", "maxrefreshfreq: maximum display frequency to set for OpenGL Polymost modes (0=no maximum)", set_maxrefreshfreq);
|
||||||
OSD_RegisterFunction("r_windowpositioning", "r_windowpositioning: enable/disable window position memory", set_windowpos);
|
OSD_RegisterFunction("r_windowpositioning", "r_windowpositioning: enable/disable window position memory", set_windowpos);
|
||||||
|
@ -807,7 +807,7 @@ int initmouse(void)
|
||||||
{
|
{
|
||||||
if (moustat) return 0;
|
if (moustat) return 0;
|
||||||
|
|
||||||
initprintf("Initialising mouse\n");
|
initprintf("Initializing mouse\n");
|
||||||
|
|
||||||
// grab input
|
// grab input
|
||||||
moustat=1;
|
moustat=1;
|
||||||
|
@ -1135,7 +1135,7 @@ static BOOL InitDirectInput(void)
|
||||||
|
|
||||||
if (bDInputInited) return FALSE;
|
if (bDInputInited) return FALSE;
|
||||||
|
|
||||||
initprintf("Initialising DirectInput...\n");
|
initprintf("Initializing DirectInput...\n");
|
||||||
|
|
||||||
// load up the DirectInput DLL
|
// load up the DirectInput DLL
|
||||||
if (!hDInputDLL)
|
if (!hDInputDLL)
|
||||||
|
@ -1267,7 +1267,7 @@ static void UninitDirectInput(void)
|
||||||
int devn;
|
int devn;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (bDInputInited) initprintf("Uninitialising DirectInput...\n");
|
if (bDInputInited) initprintf("Uninitializing DirectInput...\n");
|
||||||
|
|
||||||
AcquireInputDevices(0,-1);
|
AcquireInputDevices(0,-1);
|
||||||
|
|
||||||
|
@ -1798,7 +1798,7 @@ void (*installusertimercallback(void (*callback)(void)))(void)
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// inittimer() -- initialise timer
|
// inittimer() -- initialize timer
|
||||||
//
|
//
|
||||||
int inittimer(int tickspersecond)
|
int inittimer(int tickspersecond)
|
||||||
{
|
{
|
||||||
|
@ -1806,7 +1806,7 @@ int inittimer(int tickspersecond)
|
||||||
|
|
||||||
if (timerfreq) return 0; // already installed
|
if (timerfreq) return 0; // already installed
|
||||||
|
|
||||||
// initprintf("Initialising timer\n");
|
// initprintf("Initializing timer\n");
|
||||||
|
|
||||||
// OpenWatcom seems to want us to query the value into a local variable
|
// OpenWatcom seems to want us to query the value into a local variable
|
||||||
// instead of the global 'timerfreq' or else it gets pissed with an
|
// instead of the global 'timerfreq' or else it gets pissed with an
|
||||||
|
@ -2164,7 +2164,7 @@ void getvalidmodes(void)
|
||||||
|
|
||||||
if (bDDrawInited)
|
if (bDDrawInited)
|
||||||
{
|
{
|
||||||
// if DirectDraw initialisation didn't fail enumerate fullscreen modes
|
// if DirectDraw initialization didn't fail enumerate fullscreen modes
|
||||||
|
|
||||||
result = IDirectDraw_EnumDisplayModes(lpDD, 0, NULL, 0, getvalidmodes_enum);
|
result = IDirectDraw_EnumDisplayModes(lpDD, 0, NULL, 0, getvalidmodes_enum);
|
||||||
if (result != DD_OK)
|
if (result != DD_OK)
|
||||||
|
@ -2663,7 +2663,7 @@ static BOOL InitDirectDraw(void)
|
||||||
|
|
||||||
if (bDDrawInited) return FALSE;
|
if (bDDrawInited) return FALSE;
|
||||||
|
|
||||||
initprintf("Initialising DirectDraw...\n");
|
initprintf("Initializing DirectDraw...\n");
|
||||||
|
|
||||||
// load up the DirectDraw DLL
|
// load up the DirectDraw DLL
|
||||||
if (!hDDrawDLL)
|
if (!hDDrawDLL)
|
||||||
|
@ -2734,7 +2734,7 @@ static BOOL InitDirectDraw(void)
|
||||||
//
|
//
|
||||||
static void UninitDirectDraw(void)
|
static void UninitDirectDraw(void)
|
||||||
{
|
{
|
||||||
if (bDDrawInited) initprintf("Uninitialising DirectDraw...\n");
|
if (bDDrawInited) initprintf("Uninitializing DirectDraw...\n");
|
||||||
|
|
||||||
ReleaseDirectDrawSurfaces();
|
ReleaseDirectDrawSurfaces();
|
||||||
|
|
||||||
|
@ -3052,7 +3052,7 @@ static void ReleaseOpenGL(void)
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// UninitOpenGL() -- unitialises any openGL libraries
|
// UninitOpenGL() -- unitializes any openGL libraries
|
||||||
//
|
//
|
||||||
static void UninitOpenGL(void)
|
static void UninitOpenGL(void)
|
||||||
{
|
{
|
||||||
|
@ -3248,6 +3248,12 @@ static int SetupOpenGL(int width, int height, int bitspp)
|
||||||
}
|
}
|
||||||
numpages = 2; // KJS 20031225: tell rotatesprite that it's double buffered!
|
numpages = 2; // KJS 20031225: tell rotatesprite that it's double buffered!
|
||||||
|
|
||||||
|
if (!glinfo.dumped)
|
||||||
|
{
|
||||||
|
osdcmd_glinfo(NULL);
|
||||||
|
glinfo.dumped = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -5972,7 +5972,7 @@ int ExtInit(void)
|
||||||
|
|
||||||
if (initengine())
|
if (initengine())
|
||||||
{
|
{
|
||||||
initprintf("There was a problem initialising the engine.\n");
|
initprintf("There was a problem initializing the engine.\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -9611,8 +9611,8 @@ static void Startup(int argc, const char **argv)
|
||||||
|
|
||||||
if (initengine())
|
if (initengine())
|
||||||
{
|
{
|
||||||
wm_msgbox("Build Engine Initialisation Error",
|
wm_msgbox("Build Engine Initialization Error",
|
||||||
"There was a problem initialising the Build engine: %s", engineerrstr);
|
"There was a problem initializing the Build engine: %s", engineerrstr);
|
||||||
freeconmem();
|
freeconmem();
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
@ -10122,8 +10122,8 @@ void app_main(int argc,const char **argv)
|
||||||
|
|
||||||
if (preinitengine())
|
if (preinitengine())
|
||||||
{
|
{
|
||||||
wm_msgbox("Build Engine Initialisation Error",
|
wm_msgbox("Build Engine Initialization Error",
|
||||||
"There was a problem initialising the Build engine: %s", engineerrstr);
|
"There was a problem initializing the Build engine: %s", engineerrstr);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -566,7 +566,7 @@ int GetGameVar(const char *szGameLabel, int lDefault, int iActor, int iPlayer)
|
||||||
return lDefault;
|
return lDefault;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int *GetGameValuePtr(const char *szGameLabel)
|
static intptr_t *GetGameValuePtr(const char *szGameLabel)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
for (i=0;i<iGameVarCount;i++)
|
for (i=0;i<iGameVarCount;i++)
|
||||||
|
@ -653,9 +653,6 @@ void ResetSystemDefaults(void)
|
||||||
g_iTextureID=GetGameID("TEXTURE");
|
g_iTextureID=GetGameID("TEXTURE");
|
||||||
g_iThisActorID=GetGameID("THISACTOR");
|
g_iThisActorID=GetGameID("THISACTOR");
|
||||||
|
|
||||||
// for(i=0;i<MAXTILES;i++)
|
|
||||||
// projectile[i] = defaultprojectile[i];
|
|
||||||
|
|
||||||
Bmemcpy(&projectile,&defaultprojectile,sizeof(projectile));
|
Bmemcpy(&projectile,&defaultprojectile,sizeof(projectile));
|
||||||
|
|
||||||
//AddLog("EOF:ResetWeaponDefaults");
|
//AddLog("EOF:ResetWeaponDefaults");
|
||||||
|
|
|
@ -1010,8 +1010,8 @@ int registerosdcommands(void)
|
||||||
OSD_RegisterFunction("quit","quit: exits the game immediately", osdcmd_quit);
|
OSD_RegisterFunction("quit","quit: exits the game immediately", osdcmd_quit);
|
||||||
|
|
||||||
OSD_RegisterFunction("rate","rate: sets the multiplayer packet send rate, in packets/sec",osdcmd_rate);
|
OSD_RegisterFunction("rate","rate: sets the multiplayer packet send rate, in packets/sec",osdcmd_rate);
|
||||||
OSD_RegisterFunction("restartsound","restartsound: reinitialises the sound system",osdcmd_restartsound);
|
OSD_RegisterFunction("restartsound","restartsound: reinitializes the sound system",osdcmd_restartsound);
|
||||||
OSD_RegisterFunction("restartvid","restartvid: reinitialises the video mode",osdcmd_restartvid);
|
OSD_RegisterFunction("restartvid","restartvid: reinitializes the video mode",osdcmd_restartvid);
|
||||||
|
|
||||||
OSD_RegisterFunction("sensitivity","sensitivity <value>: changes the mouse sensitivity", osdcmd_sensitivity);
|
OSD_RegisterFunction("sensitivity","sensitivity <value>: changes the mouse sensitivity", osdcmd_sensitivity);
|
||||||
OSD_RegisterFunction("setvar","setvar <gamevar> <value>: sets the value of a gamevar", osdcmd_setvar);
|
OSD_RegisterFunction("setvar","setvar <gamevar> <value>: sets the value of a gamevar", osdcmd_setvar);
|
||||||
|
|
Loading…
Reference in a new issue