Skip to content

Commit

Permalink
Win32: Fixing novideo mode
Browse files Browse the repository at this point in the history
Tried to cherry-pick 704f059 from ringzero, but it went awry.
Instead, this commit contains the equivalent changes applied manually.
  • Loading branch information
skyjake committed Jul 17, 2011
1 parent 3cec0bc commit 14e3050
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 10 deletions.
11 changes: 4 additions & 7 deletions doomsday/engine/portable/src/dd_main.c
Expand Up @@ -378,13 +378,10 @@ int DD_Main(void)
winFlags, 0))
return -1;

if(!isDedicated)
if(!GL_EarlyInit())
{
if(!GL_EarlyInit())
{
Sys_CriticalMessage("GL_EarlyInit() failed.");
return -1;
}
Sys_CriticalMessage("GL_EarlyInit() failed.");
return -1;
}

/**
Expand All @@ -401,7 +398,7 @@ int DD_Main(void)
DD_StartupWorker, NULL);

// Engine initialization is complete. Now finish up with the GL.
if(!isDedicated)
if(!novideo)
{
GL_Init();
GL_InitRefresh();
Expand Down
3 changes: 3 additions & 0 deletions doomsday/engine/portable/src/gl_main.c
Expand Up @@ -623,6 +623,8 @@ boolean GL_EarlyInit(void)
*/
void GL_Init(void)
{
if(novideo) return;

if(!initGLOk)
{
Con_Error("GL_Init: GL_EarlyInit has not been done yet.\n");
Expand All @@ -647,6 +649,7 @@ void GL_Init(void)
*/
void GL_InitRefresh(void)
{
if(novideo) return;
GL_InitTextureManager();
}

Expand Down
8 changes: 6 additions & 2 deletions doomsday/engine/portable/src/gl_texmanager.c
Expand Up @@ -1062,7 +1062,7 @@ DGLuint GL_PrepareLSTexture(lightingtexid_t which)
{ "radioOE", GL_CLAMP_TO_EDGE, GL_CLAMP_TO_EDGE }
};

if(which < 0 || which >= NUM_LIGHTING_TEXTURES)
if(novideo || which < 0 || which >= NUM_LIGHTING_TEXTURES)
return 0;

if(!lightingTextures[which].tex)
Expand All @@ -1080,7 +1080,7 @@ DGLuint GL_PrepareLSTexture(lightingtexid_t which)

DGLuint GL_PrepareSysFlareTexture(flaretexid_t flare)
{
if(flare >= NUM_SYSFLARE_TEXTURES)
if(novideo || flare >= NUM_SYSFLARE_TEXTURES)
return 0;

if(!sysFlareTextures[flare].tex)
Expand Down Expand Up @@ -2389,6 +2389,8 @@ DGLuint GL_PreparePatch2(patchtex_t* p)
*/
DGLuint GL_PreparePatch(patchtex_t* patchTex)
{
if(novideo) return 0;

if(patchTex)
{
if(!patchTex->tex)
Expand All @@ -2404,6 +2406,8 @@ DGLuint GL_PreparePatch(patchtex_t* patchTex)

DGLuint GL_PreparePatchOtherPart(patchtex_t* patchTex)
{
if(novideo) return 0;

if(patchTex)
{
if(!patchTex->tex)
Expand Down
3 changes: 2 additions & 1 deletion doomsday/engine/win32/src/dd_winit.c
Expand Up @@ -276,7 +276,8 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
// First order of business: are we running in dedicated mode?
if(ArgCheck("-dedicated"))
isDedicated = true;

novideo = ArgCheck("-novideo") || isDedicated;

DD_ComposeMainWindowTitle(buf);

// First we need to locate the game lib name among the command line
Expand Down

0 comments on commit 14e3050

Please sign in to comment.