rm plugins that we won't use
[pcsx_rearmed.git] / plugins / peopsxgl / cfg.c
diff --git a/plugins/peopsxgl/cfg.c b/plugins/peopsxgl/cfg.c
deleted file mode 100644 (file)
index 3dcd0ab..0000000
+++ /dev/null
@@ -1,249 +0,0 @@
-/***************************************************************************\r
-                           cfg.c  -  description\r
-                             -------------------\r
-    begin                : Sun Mar 08 2009\r
-    copyright            : (C) 1999-2009 by Pete Bernert\r
-    web                  : www.pbernert.com   \r
- ***************************************************************************/\r
-\r
-/***************************************************************************\r
- *                                                                         *\r
- *   This program is free software; you can redistribute it and/or modify  *\r
- *   it under the terms of the GNU General Public License as published by  *\r
- *   the Free Software Foundation; either version 2 of the License, or     *\r
- *   (at your option) any later version. See also the license.txt file for *\r
- *   additional informations.                                              *\r
- *                                                                         *\r
- ***************************************************************************/\r
-\r
-//*************************************************************************// \r
-// History of changes:\r
-//\r
-// 2009/03/08 - Pete  \r
-// - generic cleanup for the Peops release\r
-//\r
-//*************************************************************************// \r
-\r
-#define _IN_CFG\r
-\r
-#include "stdafx.h"\r
-#include "externals.h"\r
-#include "cfg.h"\r
-\r
-char *pConfigFile = NULL;\r
-\r
-void ReadConfigFile()\r
-{\r
- FILE *in = NULL;\r
- int len;\r
- char *pB, *p, t[256];\r
-\r
- if (pConfigFile != NULL)\r
-  in = fopen(pConfigFile, "rb");\r
- else\r
-  in = fopen("gpuPeopsMesaGL.cfg", "rb"); \r
-\r
- if (in == NULL) return;\r
-\r
- pB=(char *)malloc(32767);                             // buffer for reading config (32k)\r
- memset(pB, 0, 32767);\r
-\r
- len = fread(pB, 1, 32767, in);                        // read config in buffer\r
- fclose(in);                                           // close config file\r
-\r
- strcpy(t,"\nResX");p=strstr(pB,t);if(p) {p=strstr(p,"=");len=1;}\r
- if(p) iResX=atoi(p+len);\r
- if(iResX<10) iResX=10;\r
-\r
- strcpy(t,"\nResY");p=strstr(pB,t);if(p) {p=strstr(p,"=");len=1;}\r
- if(p) iResY=atoi(p+len);\r
- if(iResY<10) iResY=10;\r
-\r
- strcpy(t,"\nKeepRatio");p=strstr(pB,t);if(p) {p=strstr(p,"=");len=1;}\r
- if(p) bKeepRatio=atoi(p+len);\r
- if(bKeepRatio<0) bKeepRatio=0;\r
- if(bKeepRatio>1) bKeepRatio=1;\r
-\r
- strcpy(t,"\nScreenSmoothing");p=strstr(pB,t);if(p) {p=strstr(p,"=");len=1;}\r
- if(p) iBlurBuffer=atoi(p+len);\r
- if(iBlurBuffer<0) iBlurBuffer=0;\r
- if(iBlurBuffer>1) iBlurBuffer=1;\r
-\r
- strcpy(t,"\nHiResTextures");p=strstr(pB,t);if(p) {p=strstr(p,"=");len=1;}\r
- if(p) iHiResTextures=atoi(p+len);\r
- if(iHiResTextures<0) iHiResTextures=0;\r
- if(iHiResTextures>2) iHiResTextures=2;\r
-\r
- iSortTexCnt =0;\r
- strcpy(t,"\nVRamSize");p=strstr(pB,t);if(p) {p=strstr(p,"=");len=1;}\r
- if(p) iVRamSize=atoi(p+len);\r
- if(iVRamSize<0)    iVRamSize=0;\r
- if(iVRamSize>1024) iVRamSize=1024;\r
-\r
- strcpy(t,"\nFullScreen");p=strstr(pB,t);if(p) {p=strstr(p,"=");len=1;}\r
- if(p) bFullScreen=atoi(p+len);\r
- if(bFullScreen>1) bFullScreen=1;\r
-\r
- strcpy(t,"\nScanLines");p=strstr(pB,t);if(p) {p=strstr(p,"=");len=1;}\r
- if(p) iUseScanLines=atoi(p+len);\r
- if(iUseScanLines<0) iUseScanLines=0;\r
- if(iUseScanLines>1) iUseScanLines=1;\r
-\r
- strcpy(t,"\nScanLinesBlend");p=strstr(pB,t);if(p) {p=strstr(p,"=");len=1;}\r
- if(p) iScanBlend=atoi(p+len);\r
- if(iScanBlend<-1)  iScanBlend=-1;\r
- if(iScanBlend>255) iScanBlend=255;\r
-\r
- strcpy(t,"\nFrameTextures");p=strstr(pB,t);if(p) {p=strstr(p,"=");len=1;}\r
- if(p) iFrameTexType=atoi(p+len);\r
- if(iFrameTexType<0) iFrameTexType=0;\r
- if(iFrameTexType>3) iFrameTexType=3;\r
-\r
- strcpy(t,"\nFrameAccess");p=strstr(pB,t);if(p) {p=strstr(p,"=");len=1;}\r
- if(p) iFrameReadType=atoi(p+len);\r
- if(iFrameReadType<0) iFrameReadType=0;\r
- if(iFrameReadType>4) iFrameReadType=4;\r
- if(iFrameReadType==4) bFullVRam=TRUE;\r
- else                  bFullVRam=FALSE;\r
-\r
- strcpy(t,"\nTexFilter");p=strstr(pB,t);if(p) {p=strstr(p,"=");len=1;}\r
- if(p) iFilterType=atoi(p+len);\r
- if(iFilterType<0) iFilterType=0;\r
- if(iFilterType>6) iFilterType=6;\r
-\r
- strcpy(t,"\nAdvancedBlend");p=strstr(pB,t);if(p) {p=strstr(p,"=");len=1;}\r
- if(p) bAdvancedBlend=atoi(p+len);\r
- if(bAdvancedBlend<0) bAdvancedBlend=0;\r
- if(bAdvancedBlend>1) bAdvancedBlend=1;\r
-\r
- strcpy(t,"\nDithering");p=strstr(pB,t);if(p) {p=strstr(p,"=");len=1;}\r
- if(p) bDrawDither=atoi(p+len);\r
- if(bDrawDither<0) bDrawDither=0;\r
- if(bDrawDither>1) bDrawDither=1;\r
-\r
- strcpy(t,"\nLineMode");p=strstr(pB,t);if(p) {p=strstr(p,"=");len=1;}\r
- if(p) bUseLines=atoi(p+len);\r
- if(bUseLines<0) bUseLines=0;\r
- if(bUseLines>1) bUseLines=1;\r
-\r
- strcpy(t,"\nShowFPS");p=strstr(pB,t);if(p) {p=strstr(p,"=");len=1;}\r
- if(p) iShowFPS=atoi(p+len);\r
- if(iShowFPS<0) iShowFPS=0;\r
- if(iShowFPS>1) iShowFPS=1;\r
-\r
- strcpy(t,"\nUseFrameLimit");p=strstr(pB,t);if(p) {p=strstr(p,"=");len=1;}\r
- if(p) bUseFrameLimit=atoi(p+len);\r
- if(bUseFrameLimit<0) bUseFrameLimit=0;\r
- if(bUseFrameLimit>1) bUseFrameLimit=1;\r
-\r
- strcpy(t,"\nUseFrameSkip");p=strstr(pB,t);if(p) {p=strstr(p,"=");len=1;}\r
- if(p) bUseFrameSkip=atoi(p+len);\r
- if(bUseFrameSkip<0) bUseFrameSkip=0;\r
- if(bUseFrameSkip>1) bUseFrameSkip=1;\r
-\r
- strcpy(t,"\nFPSDetection");p=strstr(pB,t);if(p) {p=strstr(p,"=");len=1;}\r
- if(p) iFrameLimit=atoi(p+len)+1;\r
- if(iFrameLimit<1) iFrameLimit=1;\r
- if(iFrameLimit>2) iFrameLimit=2;\r
-\r
- strcpy(t,"\nFrameRate");p=strstr(pB,t);if(p) {p=strstr(p,"=");len=1;}\r
- if(p) fFrameRate=(float)atof(p+len);\r
- if(fFrameRate<0.0f)    fFrameRate=0.0f;\r
- if(fFrameRate>1000.0f) fFrameRate=1000.0f;\r
-\r
- strcpy(t,"\nOffscreenDrawing");p=strstr(pB,t);if(p) {p=strstr(p,"=");len=1;}\r
- if(p) iOffscreenDrawing=atoi(p+len);\r
- if(iOffscreenDrawing<0) iOffscreenDrawing=0;\r
- if(iOffscreenDrawing>4) iOffscreenDrawing=4;\r
-\r
- strcpy(t,"\nOpaquePass");p=strstr(pB,t);if(p) {p=strstr(p,"=");len=1;}\r
- if(p) bOpaquePass=atoi(p+len);\r
- if(bOpaquePass<0) bOpaquePass=0;\r
- if(bOpaquePass>1) bOpaquePass=1;\r
-\r
- strcpy(t,"\nAntiAlias");p=strstr(pB,t);if(p) {p=strstr(p,"=");len=1;}\r
- if(p) bUseAntiAlias=atoi(p+len);\r
- if(bUseAntiAlias<0) bUseAntiAlias=0;\r
- if(bUseAntiAlias>1) bUseAntiAlias=1;\r
-\r
- strcpy(t,"\nTexQuality");p=strstr(pB,t);if(p) {p=strstr(p,"=");len=1;}\r
- if(p) iTexQuality=atoi(p+len);\r
- if(iTexQuality<0) iTexQuality=0;\r
- if(iTexQuality>4) iTexQuality=4;\r
-\r
- strcpy(t,"\n15bitMdec");p=strstr(pB,t);if(p) {p=strstr(p,"=");len=1;}\r
- if(p) bUse15bitMdec=atoi(p+len);\r
- if(bUse15bitMdec<0) bUse15bitMdec=0;\r
- if(bUse15bitMdec>1) bUse15bitMdec=1;\r
-\r
- strcpy(t,"\nMaskDetect");p=strstr(pB,t);if(p) {p=strstr(p,"=");len=1;}\r
- if(p) iUseMask=atoi(p+len);\r
- if(iUseMask<0) iUseMask=0;\r
- if(iUseMask>1) iUseMask=1;\r
-\r
- strcpy(t,"\nFastMdec");p=strstr(pB,t);if(p) {p=strstr(p,"=");len=1;}\r
- if(p) bUseFastMdec=atoi(p+len);\r
- if(bUseFastMdec<0) bUseFastMdec=0;\r
- if(bUseFastMdec>1) bUseFastMdec=1;\r
-\r
- strcpy(t,"\nCfgFixes");p=strstr(pB,t);if(p) {p=strstr(p,"=");len=1;}\r
- if(p) dwCfgFixes=atoi(p+len);\r
-\r
- strcpy(t,"\nUseFixes");p=strstr(pB,t);if(p) {p=strstr(p,"=");len=1;}\r
- if(p) bUseFixes=atoi(p+len);\r
- if(bUseFixes<0) bUseFixes=0;\r
- if(bUseFixes>1) bUseFixes=1;\r
-\r
- strcpy(t,"\nOGLExtensions");p=strstr(pB,t);if(p) {p=strstr(p,"=");len=1;}\r
- if(p) iUseExts=atoi(p+len);\r
- if(iUseExts>1) iUseExts=1;\r
-\r
- free(pB);\r
-}\r
-\r
-void ReadConfig(void)                                  // read config (linux file)\r
-{\r
- iResX=640;\r
- iResY=480;\r
- iColDepth=16;\r
- bChangeRes=FALSE;\r
- bWindowMode=TRUE;\r
- iUseScanLines=0;\r
- bFullScreen=FALSE;\r
- bFullVRam=FALSE;\r
- iFilterType=0;\r
- bAdvancedBlend=FALSE;\r
- bDrawDither=FALSE;\r
- bUseLines=FALSE;\r
- bUseFrameLimit=TRUE;\r
- bUseFrameSkip=FALSE;\r
- iFrameLimit=2;\r
- fFrameRate=200.0f;\r
- iOffscreenDrawing=2;\r
- bOpaquePass=TRUE;\r
- bUseAntiAlias=FALSE;\r
- iTexQuality=0;\r
- iUseMask=0;\r
- iZBufferDepth=0;\r
- bUseFastMdec=TRUE;\r
- dwCfgFixes=0;\r
- bUseFixes=FALSE;\r
- iFrameTexType=1;\r
- iFrameReadType=0;\r
- bUse15bitMdec=FALSE;\r
- iShowFPS=0;\r
- bKeepRatio=FALSE;\r
- iScanBlend=0;\r
- iVRamSize=0;\r
- iTexGarbageCollection=1;\r
- iBlurBuffer=0;\r
- iHiResTextures=0;\r
- iForceVSync=-1;\r
-\r
- ReadConfigFile();                                     // read file\r
-\r
- if(!iColDepth)  iColDepth=32;                         // adjust color info\r
- if(iUseMask)    iZBufferDepth=16;                     // set zbuffer depth \r
- else            iZBufferDepth=0;\r
- if(bUseFixes)   dwActFixes=dwCfgFixes;                // init game fix global\r
-}\r