mirror of
https://github.com/DrBeef/Raze.git
synced 2024-11-15 17:01:51 +00:00
git-svn-id: https://svn.eduke32.com/eduke32@904 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
f5b049379c
commit
d1df28e457
3 changed files with 42 additions and 16 deletions
|
@ -2890,28 +2890,28 @@ static void ReleaseDirectDrawSurfaces(void)
|
|||
{
|
||||
if (lpDDPalette)
|
||||
{
|
||||
initprintf(" - Releasing palette\n");
|
||||
// initprintf(" - Releasing palette\n");
|
||||
IDirectDrawPalette_Release(lpDDPalette);
|
||||
lpDDPalette = NULL;
|
||||
}
|
||||
|
||||
if (lpDDSBack)
|
||||
{
|
||||
initprintf(" - Releasing back-buffer surface\n");
|
||||
// initprintf(" - Releasing back-buffer surface\n");
|
||||
IDirectDrawSurface_Release(lpDDSBack);
|
||||
lpDDSBack = NULL;
|
||||
}
|
||||
|
||||
if (lpDDSPrimary)
|
||||
{
|
||||
initprintf(" - Releasing primary surface\n");
|
||||
// initprintf(" - Releasing primary surface\n");
|
||||
IDirectDrawSurface_Release(lpDDSPrimary);
|
||||
lpDDSPrimary = NULL;
|
||||
}
|
||||
|
||||
if (lpOffscreen)
|
||||
{
|
||||
initprintf(" - Freeing offscreen buffer\n");
|
||||
// initprintf(" - Freeing offscreen buffer\n");
|
||||
free(lpOffscreen);
|
||||
lpOffscreen = NULL;
|
||||
}
|
||||
|
@ -2934,7 +2934,7 @@ static int SetupDirectDraw(int width, int height)
|
|||
ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE | DDSCAPS_FLIP | DDSCAPS_COMPLEX;
|
||||
ddsd.dwBackBufferCount = 2; // triple-buffer
|
||||
|
||||
initprintf(" - Creating primary surface\n");
|
||||
// initprintf(" - Creating primary surface\n");
|
||||
result = IDirectDraw_CreateSurface(lpDD, &ddsd, &lpDDSPrimary, NULL);
|
||||
if (result != DD_OK)
|
||||
{
|
||||
|
@ -2947,7 +2947,7 @@ static int SetupDirectDraw(int width, int height)
|
|||
ddsd.ddsCaps.dwCaps = DDSCAPS_BACKBUFFER;
|
||||
numpages = 1; // KJS 20031225
|
||||
|
||||
initprintf(" - Getting back buffer\n");
|
||||
// initprintf(" - Getting back buffer\n");
|
||||
result = IDirectDrawSurface_GetAttachedSurface(lpDDSPrimary, &ddsd.ddsCaps, &lpDDSBack);
|
||||
if (result != DD_OK)
|
||||
{
|
||||
|
@ -2956,7 +2956,7 @@ static int SetupDirectDraw(int width, int height)
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
initprintf(" - Allocating offscreen buffer\n");
|
||||
// initprintf(" - Allocating offscreen buffer\n");
|
||||
lpOffscreen = (char *)malloc((width|1)*height);
|
||||
if (!lpOffscreen)
|
||||
{
|
||||
|
@ -2966,7 +2966,7 @@ static int SetupDirectDraw(int width, int height)
|
|||
}
|
||||
|
||||
// attach a palette to the primary surface
|
||||
initprintf(" - Creating palette\n");
|
||||
// initprintf(" - Creating palette\n");
|
||||
for (i=0; i<256; i++)
|
||||
curpalettefaded[i].f = PC_NOCOLLAPSE;
|
||||
result = IDirectDraw_CreatePalette(lpDD, DDPCAPS_8BIT | DDPCAPS_ALLOW256, (LPPALETTEENTRY)curpalettefaded, &lpDDPalette, NULL);
|
||||
|
@ -4084,19 +4084,18 @@ static LRESULT CALLBACK WndProcCallback(HWND hWnd, UINT uMsg, WPARAM wParam, LPA
|
|||
|
||||
case WM_PALETTECHANGED:
|
||||
// someone stole the palette so try and steal it back
|
||||
if (appactive && (HWND)wParam != hWindow) setpalette(0,0);
|
||||
if (bDDrawInited && bpp == 8 && fullscreen)
|
||||
{
|
||||
int result = IDirectDrawSurface_SetPalette(lpDDSPrimary, lpDDPalette);
|
||||
OSD_Printf("DirectDraw palette stolen! Resetting...\n");
|
||||
if (result != DD_OK)
|
||||
{
|
||||
ShowDDrawErrorBox("Failure setting palette", result);
|
||||
UninitDirectDraw();
|
||||
initprintf("Palette set failed: %s\n", GetDDrawError(result));
|
||||
break;
|
||||
}
|
||||
setpalette(0,0);
|
||||
setpalette(0,256);
|
||||
break;
|
||||
}
|
||||
if (appactive && (HWND)wParam != hWindow) setpalette(0,256);
|
||||
break;
|
||||
|
||||
case WM_DISPLAYCHANGE:
|
||||
|
|
|
@ -8245,7 +8245,7 @@ FAKE_F3:
|
|||
restorepalette = 1;
|
||||
vscrn();
|
||||
}
|
||||
|
||||
/*
|
||||
if (KB_UnBoundKeyPressed(sc_F11))
|
||||
{
|
||||
KB_ClearKeyDown(sc_F11);
|
||||
|
@ -8261,6 +8261,20 @@ FAKE_F3:
|
|||
if (ud.brightness < 40) FTA(29 + (ud.brightness>>3) ,g_player[myconnectindex].ps);
|
||||
else if (ud.brightness < 80) FTA(96 + (ud.brightness>>3) - 5,g_player[myconnectindex].ps);
|
||||
}
|
||||
*/
|
||||
if (KB_UnBoundKeyPressed(sc_F11))
|
||||
{
|
||||
KB_ClearKeyDown(sc_F11);
|
||||
cmenu(232);
|
||||
FX_StopAllSounds();
|
||||
clearsoundlocks();
|
||||
g_player[myconnectindex].ps->gm |= MODE_MENU;
|
||||
if (ud.multimode < 2 && ud.recstat != 2)
|
||||
{
|
||||
ready2send = 0;
|
||||
totalclock = ototalclock;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void comlinehelp(void)
|
||||
|
|
|
@ -2572,6 +2572,7 @@ cheat_for_port_credits:
|
|||
#endif
|
||||
break;
|
||||
case 231:
|
||||
case 232:
|
||||
rotatesprite(320<<15,19<<16,65536L,0,MENUBAR,16,0,10,0,0,xdim-1,ydim-1);
|
||||
menutext(320>>1,24,0,0,"COLOR CORRECTION");
|
||||
|
||||
|
@ -2583,9 +2584,21 @@ cheat_for_port_credits:
|
|||
x = probe(c,probey==3?106:98,16,x);
|
||||
|
||||
if (x == -1)
|
||||
{
|
||||
if (g_player[myconnectindex].ps->gm&MODE_GAME && current_menu == 232)
|
||||
{
|
||||
g_player[myconnectindex].ps->gm &= ~MODE_MENU;
|
||||
if (ud.multimode < 2 && ud.recstat != 2)
|
||||
{
|
||||
ready2send = 1;
|
||||
totalclock = ototalclock;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
cmenu(203);
|
||||
probey = 4;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue