--- /dev/null
+/*
+ Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ For a list of contributors, see the accompanying CONTRIBUTORS file.
+
+ This file is part of GtkRadiant.
+
+ GtkRadiant is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ GtkRadiant is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with GtkRadiant; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#if !defined( INCLUDED_DEFAULTS_H )
+#define INCLUDED_DEFAULTS_H
+
+#define DEFAULT_EDITORVFS_DIRNAME "base/"
+#define DEFAULT_TEXTURE_DIRNAME "textures/"
+#define DEFAULT_NOTEX_DIRNAME DEFAULT_TEXTURE_DIRNAME "radiant/"
+#define DEFAULT_NOTEX_BASENAME "notex"
+#define DEFAULT_SHADERNOTEX_BASENAME "shadernotex"
+#define DEFAULT_NOTEX_NAME DEFAULT_NOTEX_DIRNAME DEFAULT_NOTEX_BASENAME
+#define DEFAULT_SHADERNOTEX_NAME DEFAULT_NOTEX_DIRNAME DEFAULT_SHADERNOTEX_BASENAME
+
+#endif // INCLUDED_DEFAULTS_H
typedef Callback<void(const ShaderLayer&)> ShaderLayerCallback;
-
class IShader
{
public:
return GlobalShadersModule::getTable();
}
-
#define QERApp_Shader_ForName GlobalShaderSystem().getShaderForName
#define QERApp_ActiveShaders_IteratorBegin GlobalShaderSystem().beginActiveShadersIterator
#define QERApp_ActiveShaders_IteratorAtEnd GlobalShaderSystem().endActiveShadersIterator
#if !defined ( INCLUDED_SHADERLIB_H )
#define INCLUDED_SHADERLIB_H
+#include "defaults.h"
#include "string/string.h"
#include "character.h"
#include "ishaders.h"
return GlobalTexturePrefix_get();
}
-
#endif
// Leonardo Zide (leo@lokigames.com)
//
+#include "defaults.h"
#include "shaders.h"
#include "globaldefs.h"
ShaderLanguage g_shaderLanguage = SHADERLANGUAGE_QUAKE3;
bool g_useShaderList = true;
_QERPlugImageTable *g_bitmapModule = 0;
-const char *g_texturePrefix = "textures/";
+const char *g_texturePrefix = DEFAULT_TEXTURE_DIRNAME;
void ActiveShaders_IteratorBegin();
m_notfound = m_pTexture;
{
- StringOutputStream name(256);
- name << GlobalRadiant().getAppPath() << "bitmaps/" << (IsDefault() ? "notex.png" : "shadernotex.png");
- m_pTexture = GlobalTexturesCache().capture(LoadImageCallback(0, loadBitmap), name.c_str());
+ m_pTexture = GlobalTexturesCache().capture(IsDefault() ? DEFAULT_NOTEX_NAME : DEFAULT_SHADERNOTEX_NAME);
}
}
// Leonardo Zide (leo@lokigames.com)
//
+#include "defaults.h"
#include "qe3.h"
#include "globaldefs.h"
const char *userRoot = g_qeglobals.m_userEnginePath.c_str();
const char *globalRoot = EnginePath_get();
+ // editor builtin VFS
+ StringOutputStream editorGamePath(256);
+ editorGamePath << GlobalRadiant().getAppPath() << DEFAULT_EDITORVFS_DIRNAME;
+ GlobalFileSystem().initDirectory(editorGamePath.c_str());
+
// if we have a mod dir
if (!string_equal(gamename, basegame)) {
// ~/.<gameprefix>/<fs_game>
#include "debugging/debugging.h"
#include "warnings.h"
-
+
+#include "defaults.h"
#include "ifilesystem.h"
#include "iundo.h"
#include "igl.h"
#include "shaders.h"
#include "commands.h"
-#define NOTEX_BASENAME "notex"
-#define SHADERNOTEX_BASENAME "shadernotex"
-
bool TextureBrowser_showWads()
{
return !string_empty(g_pGameDescription->getKeyValue("show_wads"));
bool isNotex(const char *name)
{
- if (string_equal_suffix(name, "/" NOTEX_BASENAME)) {
+ if (string_equal_suffix(name, "/" DEFAULT_NOTEX_BASENAME)) {
return true;
}
- if (string_equal_suffix(name, "/" SHADERNOTEX_BASENAME)) {
+ if (string_equal_suffix(name, "/" DEFAULT_SHADERNOTEX_BASENAME)) {
return true;
}
return false;
void TextureBrowser_SetNotex()
{
- StringOutputStream name(256);
- name << GlobalRadiant().getAppPath() << "bitmaps/" NOTEX_BASENAME ".png";
- g_notex = name.c_str();
+ IShader *notex = QERApp_Shader_ForName(DEFAULT_NOTEX_NAME);
+ IShader *shadernotex = QERApp_Shader_ForName(DEFAULT_SHADERNOTEX_NAME);
+
+ g_notex = notex->getTexture()->name;
+ g_shadernotex = shadernotex->getTexture()->name;
- name = StringOutputStream(256);
- name << GlobalRadiant().getAppPath() << "bitmaps/" SHADERNOTEX_BASENAME " .png";
- g_shadernotex = name.c_str();
+ notex->DecRef();
+ shadernotex->DecRef();
}
ui::Widget TextureBrowser_constructWindow(ui::Window toplevel)