Remove static global std::string

pull/153/head
Hleb Valoshka 2018-12-04 23:04:49 +03:00
parent e5e229d472
commit 91b783102d
4 changed files with 36 additions and 36 deletions

View File

@ -51,7 +51,7 @@ static const char* errorFragmentShaderSource =
"}\n";
static const string CommonHeader("#version 120\n");
static const char* CommonHeader = "#version 120\n";
ShaderManager&
GetShaderManager()
@ -1539,7 +1539,7 @@ PointSizeCalculation()
GLVertexShader*
ShaderManager::buildVertexShader(const ShaderProperties& props)
{
string source = CommonHeader;
string source(CommonHeader);
source += DeclareLights(props);
if (props.lightModel == ShaderProperties::SpecularModel)
@ -1859,7 +1859,7 @@ ShaderManager::buildVertexShader(const ShaderProperties& props)
GLFragmentShader*
ShaderManager::buildFragmentShader(const ShaderProperties& props)
{
string source = CommonHeader;
string source(CommonHeader);
// Without GL_ARB_shader_texture_lod enabled one can use texture2DLod
// in vertext shaders only
@ -2283,7 +2283,7 @@ ShaderManager::buildFragmentShader(const ShaderProperties& props)
GLVertexShader*
ShaderManager::buildRingsVertexShader(const ShaderProperties& props)
{
string source = CommonHeader;
string source(CommonHeader);
source += DeclareLights(props);
source += "uniform vec3 eyePosition;\n";
@ -2337,7 +2337,7 @@ ShaderManager::buildRingsVertexShader(const ShaderProperties& props)
GLFragmentShader*
ShaderManager::buildRingsFragmentShader(const ShaderProperties& props)
{
string source = CommonHeader;
string source(CommonHeader);
source += "uniform vec3 ambientColor;\n";
source += "vec4 diff = vec4(ambientColor, 1.0);\n";
@ -2423,7 +2423,7 @@ ShaderManager::buildRingsFragmentShader(const ShaderProperties& props)
GLVertexShader*
ShaderManager::buildRingsVertexShader(const ShaderProperties& props)
{
string source = CommonHeader;
string source(CommonHeader);
source += DeclareLights(props);
@ -2465,7 +2465,7 @@ ShaderManager::buildRingsVertexShader(const ShaderProperties& props)
GLFragmentShader*
ShaderManager::buildRingsFragmentShader(const ShaderProperties& props)
{
string source = CommonHeader;
string source(CommonHeader);
source += "uniform vec3 ambientColor;\n";
for (unsigned int i = 0; i < props.nLights; i++)
@ -2575,7 +2575,7 @@ ShaderManager::buildRingsFragmentShader(const ShaderProperties& props)
GLVertexShader*
ShaderManager::buildAtmosphereVertexShader(const ShaderProperties& props)
{
string source = CommonHeader;
string source(CommonHeader);
source += DeclareLights(props);
source += "uniform vec3 eyePosition;\n";
@ -2612,7 +2612,7 @@ ShaderManager::buildAtmosphereVertexShader(const ShaderProperties& props)
GLFragmentShader*
ShaderManager::buildAtmosphereFragmentShader(const ShaderProperties& props)
{
string source = CommonHeader;
string source(CommonHeader);
source += "varying vec3 scatterEx;\n";
source += "varying vec3 eyeDir_obj;\n";
@ -2665,7 +2665,7 @@ ShaderManager::buildAtmosphereFragmentShader(const ShaderProperties& props)
GLVertexShader*
ShaderManager::buildEmissiveVertexShader(const ShaderProperties& props)
{
string source = CommonHeader;
string source(CommonHeader);
source += "uniform float opacity;\n";
@ -2727,7 +2727,7 @@ ShaderManager::buildEmissiveVertexShader(const ShaderProperties& props)
GLFragmentShader*
ShaderManager::buildEmissiveFragmentShader(const ShaderProperties& props)
{
string source = CommonHeader;
string source(CommonHeader);
if (props.texUsage & ShaderProperties::DiffuseTexture)
{

View File

@ -17,7 +17,7 @@
using namespace std;
static const string TitleTag("Title:");
static const char TitleTag[] = "Title:";
class ScriptScanner : public EnumFilesHandler
{
@ -60,7 +60,7 @@ public:
// Skip spaces after the Title: tag
if (titlePos != string::npos)
titlePos = firstLine.find_first_not_of(" ", titlePos + TitleTag.length());
titlePos = firstLine.find_first_not_of(" ", titlePos + (sizeof(TitleTag) - 1));
if (titlePos != string::npos)
{

View File

@ -149,7 +149,7 @@ static const WPARAM ID_GOTO_URL = 62000;
HWND hBookmarkTree;
char bookmarkName[33];
static const string ScriptsDirectory = "scripts";
static const char ScriptsDirectory[] = "scripts";
static vector<ScriptMenuItem>* ScriptMenuItems = NULL;

View File

@ -15,28 +15,28 @@
using namespace std;
static const string JPEGExt(".jpeg");
static const string JPGExt(".jpg");
static const string JFIFExt(".jif");
static const string BMPExt(".bmp");
static const string TargaExt(".tga");
static const string PNGExt(".png");
static const string ThreeDSExt(".3ds");
static const string CelestiaTextureExt(".ctx");
static const string CelestiaMeshExt(".cms");
static const string CelestiaCatalogExt(".ssc");
static const string CelestiaStarCatalogExt(".stc");
static const string CelestiaDeepSkyCatalogExt(".dsc");
static const string AVIExt(".avi");
static const string DDSExt(".dds");
static const string DXT5NormalMapExt(".dxt5nm");
static const string CelestiaLegacyScriptExt(".cel");
static const string CelestiaScriptExt(".clx");
static const string CelestiaScriptExt2(".celx");
static const string CelestiaModelExt(".cmod");
static const string CelestiaParticleSystemExt(".cpart");
static const string CelestiaXYZTrajectoryExt(".xyz");
static const string CelestiaXYZVTrajectoryExt(".xyzv");
static const char JPEGExt[] = ".jpeg";
static const char JPGExt[] = ".jpg";
static const char JFIFExt[] = ".jif";
static const char BMPExt[] = ".bmp";
static const char TargaExt[] = ".tga";
static const char PNGExt[] = ".png";
static const char ThreeDSExt[] = ".3ds";
static const char CelestiaTextureExt[] = ".ctx";
static const char CelestiaMeshExt[] = ".cms";
static const char CelestiaCatalogExt[] = ".ssc";
static const char CelestiaStarCatalogExt[] = ".stc";
static const char CelestiaDeepSkyCatalogExt[] = ".dsc";
static const char AVIExt[] = ".avi";
static const char DDSExt[] = ".dds";
static const char DXT5NormalMapExt[] = ".dxt5nm";
static const char CelestiaLegacyScriptExt[] = ".cel";
static const char CelestiaScriptExt[] = ".clx";
static const char CelestiaScriptExt2[] = ".celx";
static const char CelestiaModelExt[] = ".cmod";
static const char CelestiaParticleSystemExt[] = ".cpart";
static const char CelestiaXYZTrajectoryExt[] = ".xyz";
static const char CelestiaXYZVTrajectoryExt[] = ".xyzv";
ContentType DetermineFileType(const string& filename)
{