Config: Add "maxTextureSize" entry to artificially limit texture sizes
This commit is contained in:
		
							parent
							
								
									06feafe9ef
								
							
						
					
					
						commit
						1478e1e0f9
					
				
					 6 changed files with 22 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -166,6 +166,7 @@ void Config::read(int argc, char *argv[])
 | 
			
		|||
	PO_DESC(syncToRefreshrate, bool, false) \
 | 
			
		||||
	PO_DESC(solidFonts, bool, false) \
 | 
			
		||||
	PO_DESC(subImageFix, bool, false) \
 | 
			
		||||
	PO_DESC(maxTextureSize, int, 0) \
 | 
			
		||||
	PO_DESC(gameFolder, std::string, ".") \
 | 
			
		||||
	PO_DESC(anyAltToggleFS, bool, false) \
 | 
			
		||||
	PO_DESC(enableReset, bool, true) \
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -49,6 +49,7 @@ struct Config
 | 
			
		|||
	bool solidFonts;
 | 
			
		||||
 | 
			
		||||
	bool subImageFix;
 | 
			
		||||
	int maxTextureSize;
 | 
			
		||||
 | 
			
		||||
	std::string gameFolder;
 | 
			
		||||
	bool anyAltToggleFS;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -23,6 +23,7 @@
 | 
			
		|||
#include "shader.h"
 | 
			
		||||
#include "etc.h"
 | 
			
		||||
#include "gl-fun.h"
 | 
			
		||||
#include "config.h"
 | 
			
		||||
 | 
			
		||||
#include <SDL_rect.h>
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -111,7 +112,7 @@ GLState::Caps::Caps()
 | 
			
		|||
	gl.GetIntegerv(GL_MAX_TEXTURE_SIZE, &maxTexSize);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
GLState::GLState()
 | 
			
		||||
GLState::GLState(const Config &conf)
 | 
			
		||||
{
 | 
			
		||||
	gl.Disable(GL_DEPTH_TEST);
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -121,4 +122,7 @@ GLState::GLState()
 | 
			
		|||
	scissorTest.init(false);
 | 
			
		||||
	scissorBox.init(IntRect(0, 0, 640, 480));
 | 
			
		||||
	program.init(0);
 | 
			
		||||
 | 
			
		||||
	if (conf.maxTextureSize > 0)
 | 
			
		||||
		caps.maxTexSize = conf.maxTextureSize;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -27,6 +27,8 @@
 | 
			
		|||
#include <stack>
 | 
			
		||||
#include <assert.h>
 | 
			
		||||
 | 
			
		||||
struct Config;
 | 
			
		||||
 | 
			
		||||
template<typename T>
 | 
			
		||||
struct GLProperty
 | 
			
		||||
{
 | 
			
		||||
| 
						 | 
				
			
			@ -130,7 +132,7 @@ public:
 | 
			
		|||
 | 
			
		||||
	} caps;
 | 
			
		||||
 | 
			
		||||
	GLState();
 | 
			
		||||
	GLState(const Config &conf);
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
#endif // GLSTATE_H
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -109,6 +109,7 @@ struct SharedStatePrivate
 | 
			
		|||
	      graphics(threadData),
 | 
			
		||||
	      input(*threadData),
 | 
			
		||||
	      audio(*threadData),
 | 
			
		||||
	      _glState(threadData->config),
 | 
			
		||||
	      fontState(threadData->config),
 | 
			
		||||
	      stampCounter(0)
 | 
			
		||||
	{
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue