diff options
Diffstat (limited to 'plugins/dfxvideo/menu.c')
| -rw-r--r-- | plugins/dfxvideo/menu.c | 163 |
1 files changed, 80 insertions, 83 deletions
diff --git a/plugins/dfxvideo/menu.c b/plugins/dfxvideo/menu.c index 57ff2201..4867ca0b 100644 --- a/plugins/dfxvideo/menu.c +++ b/plugins/dfxvideo/menu.c @@ -20,79 +20,76 @@ #include "externals.h" #include "draw.h" #include "menu.h" -#include "gpu.h"
+#include "gpu.h" -#ifdef _WINDOWS
-
-#include "record.h"
-
-HFONT hGFont=NULL;
-BOOL bTransparent=FALSE;
-
-#endif
+#ifdef _WINDOWS + +#include "record.h" + +HFONT hGFont=NULL; +BOOL bTransparent=FALSE; + +#endif unsigned long dwCoreFlags = 0; // create lists/stuff for fonts (actually there are no more lists, but I am too lazy to change the func names ;) void InitMenu(void) -{
-#ifdef _WINDOWS
- hGFont=CreateFont(//-8,
- 13,0,0,0,FW_NORMAL,FALSE,FALSE,FALSE,
- ANSI_CHARSET,OUT_DEFAULT_PRECIS,
- CLIP_DEFAULT_PRECIS,DEFAULT_QUALITY,
- DEFAULT_PITCH,
- //"Courier New");
- //"MS Sans Serif");
- "Arial");
+{ +#ifdef _WINDOWS + hGFont=CreateFont(//-8, + 13,0,0,0,FW_NORMAL,FALSE,FALSE,FALSE, + ANSI_CHARSET,OUT_DEFAULT_PRECIS, + CLIP_DEFAULT_PRECIS,DEFAULT_QUALITY, + DEFAULT_PITCH, + //"Courier New"); + //"MS Sans Serif"); + "Arial"); #endif } // kill existing lists/fonts void CloseMenu(void) { -#ifdef _WINDOWS
- if(hGFont) DeleteObject(hGFont);
- hGFont=NULL;
-#else
- DestroyPic();
+#ifdef _WINDOWS + if(hGFont) DeleteObject(hGFont); + hGFont=NULL; +#else + DestroyPic(); #endif } // DISPLAY FPS/MENU TEXT -#include <time.h> -extern time_t tStart; - int iMPos=0; // menu arrow pos void DisplayText(void) // DISPLAY TEXT -{
-#ifdef _WINDOWS
- HDC hdc;HFONT hFO;
-
- IDirectDrawSurface_GetDC(DX.DDSRender,&hdc);
- hFO=(HFONT)SelectObject(hdc,hGFont);
-
- SetTextColor(hdc,RGB(0,255,0));
- if(bTransparent)
- SetBkMode(hdc,TRANSPARENT);
- else SetBkColor(hdc,RGB(0,0,0));
-
- if(szDebugText[0] && ((time(NULL) - tStart) < 2)) // special debug text? show it
- {
- RECT r={0,0,1024,1024};
- DrawText(hdc,szDebugText,lstrlen(szDebugText),&r,DT_LEFT|DT_NOCLIP);
- }
- else // else standard gpu menu
- {
- szDebugText[0]=0;
- lstrcat(szDispBuf,szMenuBuf);
- ExtTextOut(hdc,0,0,0,NULL,szDispBuf,lstrlen(szDispBuf),NULL);
- }
-
- SelectObject(hdc,hFO);
- IDirectDrawSurface_ReleaseDC(DX.DDSRender,hdc);
+{ +#ifdef _WINDOWS + HDC hdc;HFONT hFO; + + IDirectDrawSurface_GetDC(DX.DDSRender,&hdc); + hFO=(HFONT)SelectObject(hdc,hGFont); + + SetTextColor(hdc,RGB(0,255,0)); + if(bTransparent) + SetBkMode(hdc,TRANSPARENT); + else SetBkColor(hdc,RGB(0,0,0)); + + if(szDebugText[0] && ((time(NULL) - tStart) < 2)) // special debug text? show it + { + RECT r={0,0,1024,1024}; + DrawText(hdc,szDebugText,lstrlen(szDebugText),&r,DT_LEFT|DT_NOCLIP); + } + else // else standard gpu menu + { + szDebugText[0]=0; + lstrcat(szDispBuf,szMenuBuf); + ExtTextOut(hdc,0,0,0,NULL,szDispBuf,lstrlen(szDispBuf),NULL); + } + + SelectObject(hdc,hFO); + IDirectDrawSurface_ReleaseDC(DX.DDSRender,hdc); #endif } @@ -144,27 +141,27 @@ void BuildDispMenu(int iInc) szMenuBuf[24]='0'+(char)((dwCoreFlags&0xf000)>>12); // number } -#ifdef _WINDOWS
- if(bVsync_Key) szMenuBuf[25] = 'V';
-#endif
+#ifdef _WINDOWS + if(bVsync_Key) szMenuBuf[25] = 'V'; +#endif if(lSelectedSlot) szMenuBuf[26] = '0'+(char)lSelectedSlot; - szMenuBuf[(iMPos+1)*5]='<'; // set arrow
- -#ifdef _WINDOWS
- if(RECORD_RECORDING)
- {
- szMenuBuf[27] = ' ';
- szMenuBuf[28] = ' ';
- szMenuBuf[29] = ' ';
- szMenuBuf[30] = 'R';
- szMenuBuf[31] = 'e';
- szMenuBuf[32] = 'c';
- szMenuBuf[33] = 0;
- }
-
- if(DX.DDSScreenPic) ShowTextGpuPic();
+ szMenuBuf[(iMPos+1)*5]='<'; // set arrow + +#ifdef _WINDOWS + if(RECORD_RECORDING) + { + szMenuBuf[27] = ' '; + szMenuBuf[28] = ' '; + szMenuBuf[29] = ' '; + szMenuBuf[30] = 'R'; + szMenuBuf[31] = 'e'; + szMenuBuf[32] = 'c'; + szMenuBuf[33] = 0; + } + + if(DX.DDSScreenPic) ShowTextGpuPic(); #endif } @@ -178,18 +175,18 @@ void SwitchDispMenu(int iStep) // SWITCH DISP MENU case 0: // frame limit { int iType=0; - bInitCap = TRUE;
- -#ifdef _WINDOWS
- if(iFrameLimit==1 && UseFrameLimit &&
- GetAsyncKeyState(VK_SHIFT)&32768)
- {
- fFrameRate+=iStep;
- if(fFrameRate<3.0f) fFrameRate=3.0f;
- SetAutoFrameCap();
- break;
- }
-#endif
+ bInitCap = TRUE; + +#ifdef _WINDOWS + if(iFrameLimit==1 && UseFrameLimit && + GetAsyncKeyState(VK_SHIFT)&32768) + { + fFrameRate+=iStep; + if(fFrameRate<3.0f) fFrameRate=3.0f; + SetAutoFrameCap(); + break; + } +#endif if(UseFrameLimit) iType=iFrameLimit; iType+=iStep; |
