📄 settings.h
字号:
//////////////////////////////////////////////////////////////////////////
// This file deals with all the settings of the game, like screen res, //
// alphablending, vsync etc. It can save thos settings to ini file so //
// that they stay the same betwen sessions. //
// //
// Written by: Patrik S鰀erberg //
// Modified: Leon Ljunggren, Carl Johannson //
//////////////////////////////////////////////////////////////////////////
#ifndef _SETTINGS_H_
#define _SETTINGS_H_
#define SCREEN_WIDTH 1024
#define SCREEN_HEIGHT 768
#define SCREEN_DEPTH 32
#define FULL_SCREEN true
#include <windows.h>
#include "singleton.h"
class GcSettings : public Singleton<GcSettings>
{
public:
// Constructor / Destrucotr
GcSettings();
~GcSettings();
// Read settings form file
static bool ReadSettings();
// Write Settings to file
static bool WriteSettings();
/* Accessors */
static int ScreenWidth() { return screenWidth; }
static int ScreenHeight() { return screenHeight; }
static int ScreenDepth() { return screenDepth; }
static int FullScreen() { return fullScreen; }
static void FullScreen(bool screen) { fullScreen = (int)screen; }
static int RenderMethod() { return renderMethod; }
static void RenderMethod(int method) { renderMethod = method; }
static int ColorArray() { return useColor; }
static void ColorArray(bool array) { useColor = (int)array; }
static int Light() { return useLight; }
static int Fog() { return useFog; }
static void Fog(bool use) { useFog = (int)use; }
static int FogDepth() { return fogDepth; }
static void FogDepth(int depth) { fogDepth = depth; }
static int DrawSkybox() { return drawSkybox; }
static void DrawSkybox(bool draw) { drawSkybox = (int)draw; }
static int ShowDebug() { return showDebug; }
static void ShowDebug(bool debug) { showDebug = (int)debug; }
static void ToggleDebug() { if(showDebug == 0) showDebug = 1; else showDebug = 0; }
static int ShowHUD() { return showHUD; }
static void ShowHUD(bool hud) { showHUD = (int)hud; }
static void ToggleShowHUD() { if(showHUD == 0) showHUD = 1; else showHUD = 0; }
static int TexDetail() { return detailTex; }
static void TexDetail(int level) { detailTex = level; }
static int Scale() { return scale; }
static int HeightScael() { return heightScale; }
static char *HeightmapPath() { return heighMapPath; }
static char *LandTexPath() { return landTexPath; }
static bool MultiTexture() { return multiTexture; }
static void MultiTexture(bool use) { multiTexture = use; }
static bool VideoMemory() { return videoMemory; }
static void VideoMemory(bool use) { videoMemory = use; }
static bool Gravity() { return gravity; }
static void Gravity(bool use) { gravity = use; }
private:
static int screenWidth;
static int screenHeight;
static int screenDepth;
static int fullScreen;
static int renderMethod;
static int useColor;
static int useLight;
static int useFog;
static int fogDepth;
static int drawSkybox;
static int showDebug;
static int showHUD;
static int detailTex;
static int scale;
static int heightScale;
static char heighMapPath[80];
static char landTexPath[80];
static bool multiTexture;
static bool videoMemory;
static bool gravity;
};
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -