fix lots of CRLFs

This commit is contained in:
Rudolf Polzer 2010-04-17 21:02:26 +02:00
parent 0a92ff3ea2
commit 54ccfc9f18
27 changed files with 2368 additions and 2368 deletions

6
.gitattributes vendored
View File

@ -95,8 +95,8 @@ makespr32 crlf=input
*.mapinfo crlf=input
*.m crlf=input
*.md3 -crlf -diff
*.md5anim crlf=input
*.md5mesh crlf=input
*.md5anim -crlf
*.md5mesh -crlf
*.mdl -crlf -diff
*.med crlf=input
*.mf crlf=input
@ -124,7 +124,7 @@ PkgInfo crlf=input
*.pm crlf=input
*.png -crlf -diff
POSITIONS -crlf -diff
*.proj crlf=input
*.proj -crlf
*.properties crlf=input
*.psd -crlf -diff
*.py crlf=input

View File

@ -1,8 +1,8 @@
; bkgrnd2d.def : Declares the module parameters for the DLL.
LIBRARY "BKGRND2D"
DESCRIPTION 'BKGRND2D Windows Dynamic Link Library'
EXPORTS
; Explicit exports can go here
Synapse_EnumerateInterfaces @1
; bkgrnd2d.def : Declares the module parameters for the DLL.
LIBRARY "BKGRND2D"
DESCRIPTION 'BKGRND2D Windows Dynamic Link Library'
EXPORTS
; Explicit exports can go here
Synapse_EnumerateInterfaces @1

View File

@ -1,131 +1,131 @@
November 25 2003
bkgrnd2d v 0.25 beta for radiant 1.3.13
by SCDS_reyalP (email hellsownpuppy@yahoo.com)
WARNING:
This is an beta release. It is provided with absolutely NO WARRANTY.
If it turns your data to mush and melts your CPU, don't blame me.
Overview:
This little plugin allows you to display an image in the the gtkradiant 2d
windows. This is useful for layout sketches, maps made from
existing plans, building geometry based on photgraphs, viewing terrain
alphamaps in relation to your terrain, and so on.
Installation:
extract the .dll and bitmaps into your gtkradiant/plugins directory, and
restart radiant. Be sure to use directory names, to ensure the bitmaps go
in your plugins/bitmaps directory.
Uninstallation:
Close radiant, delete the bkgrnd2d.dll from the plugins directory, and
delete the bkgrnd2*.bmp files from the plugins/bitmaps directory.
User Interface:
- The plugin adds 4 buttons to the radiant plugin toolbar. The first 3
toggle the display of a background image in the specified view. The fourth
brings up a configuration dialog. The configuration dialog can also be
opened from the plugins menu.
- If an image has not been loaded, or it's display size and location have
not been set, pushing one of the toggle buttons will bring up the dialog
with the corresponding page selected.
- The configuration dialog is non-modal, meaning that you can leave it open
while you work in radiant. If it gets lost behind another window, clicking
on the configuration button will bring it to the forground.
Usage:
- bring up the configuration dialog.
- Choose the "Browse..." button. This will prompt you for an image file.
The file *MUST* be inside your basegame directory (baseq3, main, etmain or
whatever your chosen game uses). The image must be in a format supported by
the game in use. For q3 based games this is truecolor .jpg, .tga and
sometimes .png. For q2 this is .wal
- Use one of the following methods to set the size (in game units) that the
file is displayed.
1) select 1 or more brushes or entities and choose "from selection"
This will use the total dimensions off all selected brushes and entities
to size the image.
2) For the X/Y view only, choose 'Size to min/max keys' This will look in
the worldspawn entity for the keys mapcoordsmins and mapcoordsmaxs (also
used for ET tracemap generation and command map sizing) and use those
dimensions to size the image.
- Use the toggle buttons to show or hide the loaded images. The buttons will
press or unpress whenever you click them, but an image will only be
displayed once you have successfully loaded a file and set its size/postion.
- Set the opacity of the image using the slider in the configuration dialog.
- If any of these commands do not produce the expected results, there may be
an information in the radiant console. Please include this when reporting
bugs.
Notes and limitations:
- This plugin is compiled for GtkRadiant 1.3.13. It may or may not work with
later versions. It will *NOT* work with version 1.3.12 and below. If you
build from source (see below) you can build it for other versions.
- As mentioned above, the image *MUST* be inside your basegame directory, or
another directory in which radiant looks for game files.
- To prevent the image from being distorted, you should size it to the
original images aspect ratio. mapcoordsmaxs/mapcoordsmins and command maps
should always be square.
- If you want a specific pixel to world unit relationship, you must arrange
that yourself.
- On load, the image is converted to a texture whose dimensions are powers
of 2. If the original image dimensions are not powers of 2, some detail will
be lost due to resampling. If it is too large to fit on a single texture,
resolution is reduced.
- radiants gamma and mipmap options are applied to the image.
- If the image has an alpha channel, it will be included in the blending
process. 0 is transparent, 255 is opaque. .tga images are recommended if
you want to have an alpha channel.
- since the plugin will only use true color files, you cannot use a terrain
indexmap (aka alphamap) or heightmap directly. You can of course, save a
copy of your indexmap in a 32 bit format.
- There is no unload command.
- You put the plugin in a game specific plugin directory, rather than the
radiant plugin directory.
- You cannot set the image size with sub-unit precision.
- Only win32 binaries are included. The source is available from:
http://www.cyberonic.net/~gdevault/rfm/mapstuff/bkgrnd2d-b0.25-src.zip
If you want to use it on another platform you will need a buildable gtkradiant
source tree to build it. For any non-windows platform you will also have to
figure out the compile options. I suggest ripping those off from some other
plugin.
TODO:
- make file selection paterns match supported filetypes
- large images without downsampling
- bitmap and pcx support for indexmaps
- automatic size from indexmapped entities
- render under the grid instead of blending
- mac/*nix support
- remember/save/restore settings
- texture options independant of radiant prefs
- clean up icky code
Changes from 0.1
- all 2d views supported
- new ui
- file selection patterns, default directory improved
Changes from 0.2
- tooltips in dialog
- various code cleanup
November 25 2003
bkgrnd2d v 0.25 beta for radiant 1.3.13
by SCDS_reyalP (email hellsownpuppy@yahoo.com)
WARNING:
This is an beta release. It is provided with absolutely NO WARRANTY.
If it turns your data to mush and melts your CPU, don't blame me.
Overview:
This little plugin allows you to display an image in the the gtkradiant 2d
windows. This is useful for layout sketches, maps made from
existing plans, building geometry based on photgraphs, viewing terrain
alphamaps in relation to your terrain, and so on.
Installation:
extract the .dll and bitmaps into your gtkradiant/plugins directory, and
restart radiant. Be sure to use directory names, to ensure the bitmaps go
in your plugins/bitmaps directory.
Uninstallation:
Close radiant, delete the bkgrnd2d.dll from the plugins directory, and
delete the bkgrnd2*.bmp files from the plugins/bitmaps directory.
User Interface:
- The plugin adds 4 buttons to the radiant plugin toolbar. The first 3
toggle the display of a background image in the specified view. The fourth
brings up a configuration dialog. The configuration dialog can also be
opened from the plugins menu.
- If an image has not been loaded, or it's display size and location have
not been set, pushing one of the toggle buttons will bring up the dialog
with the corresponding page selected.
- The configuration dialog is non-modal, meaning that you can leave it open
while you work in radiant. If it gets lost behind another window, clicking
on the configuration button will bring it to the forground.
Usage:
- bring up the configuration dialog.
- Choose the "Browse..." button. This will prompt you for an image file.
The file *MUST* be inside your basegame directory (baseq3, main, etmain or
whatever your chosen game uses). The image must be in a format supported by
the game in use. For q3 based games this is truecolor .jpg, .tga and
sometimes .png. For q2 this is .wal
- Use one of the following methods to set the size (in game units) that the
file is displayed.
1) select 1 or more brushes or entities and choose "from selection"
This will use the total dimensions off all selected brushes and entities
to size the image.
2) For the X/Y view only, choose 'Size to min/max keys' This will look in
the worldspawn entity for the keys mapcoordsmins and mapcoordsmaxs (also
used for ET tracemap generation and command map sizing) and use those
dimensions to size the image.
- Use the toggle buttons to show or hide the loaded images. The buttons will
press or unpress whenever you click them, but an image will only be
displayed once you have successfully loaded a file and set its size/postion.
- Set the opacity of the image using the slider in the configuration dialog.
- If any of these commands do not produce the expected results, there may be
an information in the radiant console. Please include this when reporting
bugs.
Notes and limitations:
- This plugin is compiled for GtkRadiant 1.3.13. It may or may not work with
later versions. It will *NOT* work with version 1.3.12 and below. If you
build from source (see below) you can build it for other versions.
- As mentioned above, the image *MUST* be inside your basegame directory, or
another directory in which radiant looks for game files.
- To prevent the image from being distorted, you should size it to the
original images aspect ratio. mapcoordsmaxs/mapcoordsmins and command maps
should always be square.
- If you want a specific pixel to world unit relationship, you must arrange
that yourself.
- On load, the image is converted to a texture whose dimensions are powers
of 2. If the original image dimensions are not powers of 2, some detail will
be lost due to resampling. If it is too large to fit on a single texture,
resolution is reduced.
- radiants gamma and mipmap options are applied to the image.
- If the image has an alpha channel, it will be included in the blending
process. 0 is transparent, 255 is opaque. .tga images are recommended if
you want to have an alpha channel.
- since the plugin will only use true color files, you cannot use a terrain
indexmap (aka alphamap) or heightmap directly. You can of course, save a
copy of your indexmap in a 32 bit format.
- There is no unload command.
- You put the plugin in a game specific plugin directory, rather than the
radiant plugin directory.
- You cannot set the image size with sub-unit precision.
- Only win32 binaries are included. The source is available from:
http://www.cyberonic.net/~gdevault/rfm/mapstuff/bkgrnd2d-b0.25-src.zip
If you want to use it on another platform you will need a buildable gtkradiant
source tree to build it. For any non-windows platform you will also have to
figure out the compile options. I suggest ripping those off from some other
plugin.
TODO:
- make file selection paterns match supported filetypes
- large images without downsampling
- bitmap and pcx support for indexmaps
- automatic size from indexmapped entities
- render under the grid instead of blending
- mac/*nix support
- remember/save/restore settings
- texture options independant of radiant prefs
- clean up icky code
Changes from 0.1
- all 2d views supported
- new ui
- file selection patterns, default directory improved
Changes from 0.2
- tooltips in dialog
- various code cleanup

View File

@ -1,7 +1,7 @@
; brushexport.def : Declares the module parameters for the DLL.
LIBRARY "BRUSHEXPORT"
EXPORTS
; Explicit exports can go here
Radiant_RegisterModules @1
; brushexport.def : Declares the module parameters for the DLL.
LIBRARY "BRUSHEXPORT"
EXPORTS
; Explicit exports can go here
Radiant_RegisterModules @1

View File

@ -1,25 +1,25 @@
/*
Copyright (C) 2006, Thomas Nitschke.
All Rights Reserved.
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_BRUSH_EXPORT_H)
#define INCLUDED_BRUSH_EXPORT_H
#endif
/*
Copyright (C) 2006, Thomas Nitschke.
All Rights Reserved.
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_BRUSH_EXPORT_H)
#define INCLUDED_BRUSH_EXPORT_H
#endif

View File

@ -1,263 +1,263 @@
/*
Copyright (C) 2006, Stefan Greven.
All Rights Reserved.
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
*/
#include "shaderplug.h"
#include "debugging/debugging.h"
#include <string>
#include <vector>
#include "string/string.h"
#include "modulesystem/singletonmodule.h"
#include "stream/stringstream.h"
#include "os/file.h"
#include <gtk/gtk.h>
#include "iplugin.h"
#include "qerplugin.h"
#include "ifilesystem.h"
#include "iarchive.h"
#include "ishaders.h"
#include "iscriplib.h"
#include "generic/callback.h"
namespace {
const char SHADERTAG_FILE[] = "shadertags.xml";
}
class ShaderPlugPluginDependencies : public GlobalRadiantModuleRef,
public GlobalFileSystemModuleRef,
public GlobalShadersModuleRef
{
public:
ShaderPlugPluginDependencies() :
GlobalShadersModuleRef(GlobalRadiant().getRequiredGameDescriptionKeyValue("shaders"))
{
}
};
namespace Shaderplug
{
GtkWindow* g_window;
std::vector<const char*> archives;
std::set<std::string> shaders;
std::set<std::string> textures;
XmlTagBuilder TagBuilder;
void CreateTagFile();
const char* init(void* hApp, void* pMainWidget)
{
g_window = GTK_WINDOW(pMainWidget);
return "";
}
const char* getName()
{
return "ShaderPlug";
}
const char* getCommandList()
{
return "About;Create tag file";
}
const char* getCommandTitleList()
{
return "";
}
void dispatch(const char* command, float* vMin, float* vMax, bool bSingleBrush)
{
if(string_equal(command, "About"))
{
GlobalRadiant().m_pfnMessageBox(GTK_WIDGET(g_window), "Shaderplug (1.0)\n\n"
"by Shaderman (shaderman@gmx.net)",
"About",
eMB_OK,
eMB_ICONDEFAULT);
}
if(string_equal(command, "Create tag file"))
{
CreateTagFile();
}
}
void loadArchiveFile(const char* filename)
{
archives.push_back(filename);
}
typedef FreeCaller1<const char*, loadArchiveFile> LoadArchiveFileCaller;
void LoadTextureFile(const char* filename)
{
std::string s_filename = filename;
char buffer[256];
strcpy(buffer, "textures/");
// append filename without trailing file extension (.tga or .jpg for example)
strncat(buffer, filename, s_filename.length() - 4);
std::set<std::string>::iterator iter;
iter = shaders.find(buffer);
// a shader with this name already exists
if(iter == shaders.end())
{
textures.insert(buffer);
}
}
typedef FreeCaller1<const char*, LoadTextureFile> LoadTextureFileCaller;
void GetTextures(char* extension)
{
GlobalFileSystem().forEachFile("textures/", extension, LoadTextureFileCaller(), 0);
}
void LoadShaderList(const char* filename)
{
if(string_equal_prefix(filename, "textures/"))
{
shaders.insert(filename);
}
}
typedef FreeCaller1<const char*, LoadShaderList> LoadShaderListCaller;
void GetAllShaders()
{
GlobalShaderSystem().foreachShaderName(LoadShaderListCaller());
}
void GetArchiveList()
{
GlobalFileSystem().forEachArchive(LoadArchiveFileCaller());
globalOutputStream() << "Shaderplug: " << (const Unsigned)Shaderplug::archives.size() << " archives found.\n";
}
void CreateTagFile()
{
const char* shader_type = GlobalRadiant().getGameDescriptionKeyValue("shaders");
GetAllShaders();
globalOutputStream() << "Shaderplug: " << (const Unsigned)shaders.size() << " shaders found.\n";
if(string_equal(shader_type, "quake3"))
{
GetTextures("jpg");
GetTextures("tga");
GetTextures("png");
globalOutputStream() << "Shaderplug: " << (const Unsigned)textures.size() << " textures found.\n";
}
if(shaders.size() || textures.size() != 0)
{
globalOutputStream() << "Shaderplug: Creating XML tag file.\n";
TagBuilder.CreateXmlDocument();
std::set<std::string>::reverse_iterator r_iter;
for(r_iter = textures.rbegin(); r_iter != textures.rend(); ++r_iter)
{
TagBuilder.AddShaderNode(const_cast<char*>((*r_iter).c_str()), STOCK, TEXTURE);
}
for(r_iter = shaders.rbegin(); r_iter != shaders.rend(); ++r_iter)
{
TagBuilder.AddShaderNode(const_cast<char*>((*r_iter).c_str()), STOCK, SHADER);
}
// Get the tag file
StringOutputStream tagFileStream(256);
tagFileStream << GlobalRadiant().getLocalRcPath() << SHADERTAG_FILE;
char* tagFile = tagFileStream.c_str();
char message[256];
strcpy(message, "Tag file saved to\n");
strcat(message, tagFile);
strcat(message, "\nPlease restart Radiant now.\n");
if(file_exists(tagFile))
{
EMessageBoxReturn result = GlobalRadiant().m_pfnMessageBox(GTK_WIDGET(g_window),
"WARNING! A tag file already exists! Overwrite it?", "Overwrite tag file?",
eMB_NOYES,
eMB_ICONWARNING);
if(result == eIDYES)
{
TagBuilder.SaveXmlDoc(tagFile);
GlobalRadiant().m_pfnMessageBox(GTK_WIDGET(g_window), message, "INFO", eMB_OK, eMB_ICONASTERISK);
}
} else {
TagBuilder.SaveXmlDoc(tagFile);
GlobalRadiant().m_pfnMessageBox(GTK_WIDGET(g_window), message, "INFO", eMB_OK, eMB_ICONASTERISK);
}
} else {
GlobalRadiant().m_pfnMessageBox(GTK_WIDGET(g_window),
"No shaders or textures found. No XML tag file created!\n"
"",
"ERROR",
eMB_OK,
eMB_ICONERROR);
}
}
} // namespace
class ShaderPluginModule
{
_QERPluginTable m_plugin;
public:
typedef _QERPluginTable Type;
STRING_CONSTANT(Name, "ShaderPlug");
ShaderPluginModule()
{
m_plugin.m_pfnQERPlug_Init = &Shaderplug::init;
m_plugin.m_pfnQERPlug_GetName = &Shaderplug::getName;
m_plugin.m_pfnQERPlug_GetCommandList = &Shaderplug::getCommandList;
m_plugin.m_pfnQERPlug_GetCommandTitleList = &Shaderplug::getCommandTitleList;
m_plugin.m_pfnQERPlug_Dispatch = &Shaderplug::dispatch;
}
_QERPluginTable* getTable()
{
return &m_plugin;
}
};
typedef SingletonModule<ShaderPluginModule, ShaderPlugPluginDependencies> SingletonShaderPluginModule;
SingletonShaderPluginModule g_ShaderPluginModule;
extern "C" void RADIANT_DLLEXPORT Radiant_RegisterModules(ModuleServer& server)
{
initialiseModule(server);
g_ShaderPluginModule.selfRegister();
}
/*
Copyright (C) 2006, Stefan Greven.
All Rights Reserved.
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
*/
#include "shaderplug.h"
#include "debugging/debugging.h"
#include <string>
#include <vector>
#include "string/string.h"
#include "modulesystem/singletonmodule.h"
#include "stream/stringstream.h"
#include "os/file.h"
#include <gtk/gtk.h>
#include "iplugin.h"
#include "qerplugin.h"
#include "ifilesystem.h"
#include "iarchive.h"
#include "ishaders.h"
#include "iscriplib.h"
#include "generic/callback.h"
namespace {
const char SHADERTAG_FILE[] = "shadertags.xml";
}
class ShaderPlugPluginDependencies : public GlobalRadiantModuleRef,
public GlobalFileSystemModuleRef,
public GlobalShadersModuleRef
{
public:
ShaderPlugPluginDependencies() :
GlobalShadersModuleRef(GlobalRadiant().getRequiredGameDescriptionKeyValue("shaders"))
{
}
};
namespace Shaderplug
{
GtkWindow* g_window;
std::vector<const char*> archives;
std::set<std::string> shaders;
std::set<std::string> textures;
XmlTagBuilder TagBuilder;
void CreateTagFile();
const char* init(void* hApp, void* pMainWidget)
{
g_window = GTK_WINDOW(pMainWidget);
return "";
}
const char* getName()
{
return "ShaderPlug";
}
const char* getCommandList()
{
return "About;Create tag file";
}
const char* getCommandTitleList()
{
return "";
}
void dispatch(const char* command, float* vMin, float* vMax, bool bSingleBrush)
{
if(string_equal(command, "About"))
{
GlobalRadiant().m_pfnMessageBox(GTK_WIDGET(g_window), "Shaderplug (1.0)\n\n"
"by Shaderman (shaderman@gmx.net)",
"About",
eMB_OK,
eMB_ICONDEFAULT);
}
if(string_equal(command, "Create tag file"))
{
CreateTagFile();
}
}
void loadArchiveFile(const char* filename)
{
archives.push_back(filename);
}
typedef FreeCaller1<const char*, loadArchiveFile> LoadArchiveFileCaller;
void LoadTextureFile(const char* filename)
{
std::string s_filename = filename;
char buffer[256];
strcpy(buffer, "textures/");
// append filename without trailing file extension (.tga or .jpg for example)
strncat(buffer, filename, s_filename.length() - 4);
std::set<std::string>::iterator iter;
iter = shaders.find(buffer);
// a shader with this name already exists
if(iter == shaders.end())
{
textures.insert(buffer);
}
}
typedef FreeCaller1<const char*, LoadTextureFile> LoadTextureFileCaller;
void GetTextures(char* extension)
{
GlobalFileSystem().forEachFile("textures/", extension, LoadTextureFileCaller(), 0);
}
void LoadShaderList(const char* filename)
{
if(string_equal_prefix(filename, "textures/"))
{
shaders.insert(filename);
}
}
typedef FreeCaller1<const char*, LoadShaderList> LoadShaderListCaller;
void GetAllShaders()
{
GlobalShaderSystem().foreachShaderName(LoadShaderListCaller());
}
void GetArchiveList()
{
GlobalFileSystem().forEachArchive(LoadArchiveFileCaller());
globalOutputStream() << "Shaderplug: " << (const Unsigned)Shaderplug::archives.size() << " archives found.\n";
}
void CreateTagFile()
{
const char* shader_type = GlobalRadiant().getGameDescriptionKeyValue("shaders");
GetAllShaders();
globalOutputStream() << "Shaderplug: " << (const Unsigned)shaders.size() << " shaders found.\n";
if(string_equal(shader_type, "quake3"))
{
GetTextures("jpg");
GetTextures("tga");
GetTextures("png");
globalOutputStream() << "Shaderplug: " << (const Unsigned)textures.size() << " textures found.\n";
}
if(shaders.size() || textures.size() != 0)
{
globalOutputStream() << "Shaderplug: Creating XML tag file.\n";
TagBuilder.CreateXmlDocument();
std::set<std::string>::reverse_iterator r_iter;
for(r_iter = textures.rbegin(); r_iter != textures.rend(); ++r_iter)
{
TagBuilder.AddShaderNode(const_cast<char*>((*r_iter).c_str()), STOCK, TEXTURE);
}
for(r_iter = shaders.rbegin(); r_iter != shaders.rend(); ++r_iter)
{
TagBuilder.AddShaderNode(const_cast<char*>((*r_iter).c_str()), STOCK, SHADER);
}
// Get the tag file
StringOutputStream tagFileStream(256);
tagFileStream << GlobalRadiant().getLocalRcPath() << SHADERTAG_FILE;
char* tagFile = tagFileStream.c_str();
char message[256];
strcpy(message, "Tag file saved to\n");
strcat(message, tagFile);
strcat(message, "\nPlease restart Radiant now.\n");
if(file_exists(tagFile))
{
EMessageBoxReturn result = GlobalRadiant().m_pfnMessageBox(GTK_WIDGET(g_window),
"WARNING! A tag file already exists! Overwrite it?", "Overwrite tag file?",
eMB_NOYES,
eMB_ICONWARNING);
if(result == eIDYES)
{
TagBuilder.SaveXmlDoc(tagFile);
GlobalRadiant().m_pfnMessageBox(GTK_WIDGET(g_window), message, "INFO", eMB_OK, eMB_ICONASTERISK);
}
} else {
TagBuilder.SaveXmlDoc(tagFile);
GlobalRadiant().m_pfnMessageBox(GTK_WIDGET(g_window), message, "INFO", eMB_OK, eMB_ICONASTERISK);
}
} else {
GlobalRadiant().m_pfnMessageBox(GTK_WIDGET(g_window),
"No shaders or textures found. No XML tag file created!\n"
"",
"ERROR",
eMB_OK,
eMB_ICONERROR);
}
}
} // namespace
class ShaderPluginModule
{
_QERPluginTable m_plugin;
public:
typedef _QERPluginTable Type;
STRING_CONSTANT(Name, "ShaderPlug");
ShaderPluginModule()
{
m_plugin.m_pfnQERPlug_Init = &Shaderplug::init;
m_plugin.m_pfnQERPlug_GetName = &Shaderplug::getName;
m_plugin.m_pfnQERPlug_GetCommandList = &Shaderplug::getCommandList;
m_plugin.m_pfnQERPlug_GetCommandTitleList = &Shaderplug::getCommandTitleList;
m_plugin.m_pfnQERPlug_Dispatch = &Shaderplug::dispatch;
}
_QERPluginTable* getTable()
{
return &m_plugin;
}
};
typedef SingletonModule<ShaderPluginModule, ShaderPlugPluginDependencies> SingletonShaderPluginModule;
SingletonShaderPluginModule g_ShaderPluginModule;
extern "C" void RADIANT_DLLEXPORT Radiant_RegisterModules(ModuleServer& server)
{
initialiseModule(server);
g_ShaderPluginModule.selfRegister();
}

View File

@ -1,7 +1,7 @@
; shaderplug.def : Declares the module parameters for the DLL.
LIBRARY "SHADERPLUG"
EXPORTS
; Explicit exports can go here
Radiant_RegisterModules @1
; shaderplug.def : Declares the module parameters for the DLL.
LIBRARY "SHADERPLUG"
EXPORTS
; Explicit exports can go here
Radiant_RegisterModules @1

View File

@ -1,27 +1,27 @@
/*
Copyright (C) 2006, Stefan Greven.
All Rights Reserved.
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_SHADERPLUG_H)
#define INCLUDED_SHADERPLUG_H
#include "xml/xmltextags.h"
#endif
/*
Copyright (C) 2006, Stefan Greven.
All Rights Reserved.
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_SHADERPLUG_H)
#define INCLUDED_SHADERPLUG_H
#include "xml/xmltextags.h"
#endif

View File

@ -1,462 +1,462 @@
/*
Sunplug plugin for GtkRadiant
Copyright (C) 2004 Topsun
Thanks to SPoG for help!
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "sunplug.h"
#include "debugging/debugging.h"
#include "iplugin.h"
#include "string/string.h"
#include "modulesystem/singletonmodule.h"
#include "iundo.h" // declaration of undo system
#include "ientity.h" // declaration of entity system
#include "iscenegraph.h" // declaration of datastructure of the map
#include "scenelib.h" // declaration of datastructure of the map
#include "qerplugin.h" // declaration to use other interfaces as a plugin
#include <gtk/gtk.h> // to display something with gtk (windows, buttons etc.), the whole package might not be necessary
void about_plugin_window();
void MapCoordinator();
#ifndef _WIN32
// linux itoa implementation
char* itoa( int value, char* result, int base )
{
// check that the base if valid
if (base < 2 || base > 16)
{
*result = 0;
return result;
}
char* out = result;
int quotient = value;
do
{
*out = "0123456789abcdef"[abs(quotient % base)];
++out;
quotient /= base;
} while (quotient);
// Only apply negative sign for base 10
if( value < 0 && base == 10)
*out++ = '-';
std::reverse(result, out);
*out = 0;
return result;
}
#endif
typedef struct _mapcoord_setting_packet {
GtkSpinButton *spinner1, *spinner2, *spinner3, *spinner4;
Entity* worldspawn;
} mapcoord_setting_packet;
static int map_minX, map_maxX, map_minY, map_maxY;
static int minX, maxX, minY, maxY;
mapcoord_setting_packet msp;
// **************************
// ** find entities by class ** from radiant/map.cpp
// **************************
class EntityFindByClassname : public scene::Graph::Walker
{
const char* m_name;
Entity*& m_entity;
public:
EntityFindByClassname(const char* name, Entity*& entity) : m_name(name), m_entity(entity)
{
m_entity = 0;
}
bool pre(const scene::Path& path, scene::Instance& instance) const
{
if(m_entity == 0)
{
Entity* entity = Node_getEntity(path.top());
if(entity != 0
&& string_equal(m_name, entity->getKeyValue("classname")))
{
m_entity = entity;
}
}
return true;
}
};
Entity* Scene_FindEntityByClass(const char* name)
{
Entity* entity;
GlobalSceneGraph().traverse(EntityFindByClassname(name, entity));
return entity;
}
// **************************
// ** GTK callback functions **
// **************************
static gboolean delete_event(GtkWidget *widget, GdkEvent *event, gpointer data)
{
/* If you return FALSE in the "delete_event" signal handler,
* GTK will emit the "destroy" signal. Returning TRUE means
* you don't want the window to be destroyed.
* This is useful for popping up 'are you sure you want to quit?'
* type dialogs. */
return FALSE;
}
// destroy widget if destroy signal is passed to widget
static void destroy(GtkWidget *widget, gpointer data)
{
gtk_widget_destroy(widget);
}
// function for close button to destroy the toplevel widget
static void close_window(GtkWidget *widget, gpointer data)
{
gtk_widget_destroy(gtk_widget_get_toplevel(widget));
}
// callback function to assign the optimal mapcoords to the spinboxes
static void input_optimal(GtkWidget *widget, gpointer data)
{
gtk_spin_button_set_value(msp.spinner1, minX);
gtk_spin_button_set_value(msp.spinner2, maxY);
gtk_spin_button_set_value(msp.spinner3, maxX);
gtk_spin_button_set_value(msp.spinner4, minY);
}
// Spinner return value function
gint grab_int_value(GtkSpinButton *a_spinner, gpointer user_data) {
return gtk_spin_button_get_value_as_int(a_spinner);
}
// write the values of the Spinner-Boxes to the worldspawn
static void set_coordinates(GtkWidget *widget, gpointer data)
{
//Str str_min, str_max;
char buffer[10], str_min[20], str_max[20];
itoa(gtk_spin_button_get_value_as_int(msp.spinner1), str_min, 10);
itoa(gtk_spin_button_get_value_as_int(msp.spinner2), buffer, 10);
strcat(str_min, " ");
strcat(str_min, buffer);
msp.worldspawn->setKeyValue("mapcoordsmins", str_min);
itoa(gtk_spin_button_get_value_as_int(msp.spinner3), str_max, 10);
itoa(gtk_spin_button_get_value_as_int(msp.spinner4), buffer, 10);
strcat(str_max, " ");
strcat(str_max, buffer);
UndoableCommand undo("SunPlug.entitySetMapcoords");
msp.worldspawn->setKeyValue("mapcoordsmaxs", str_max);
close_window(widget, NULL);
}
class SunPlugPluginDependencies :
public GlobalRadiantModuleRef, // basic class for all other module refs
public GlobalUndoModuleRef, // used to say radiant that something has changed and to undo that
public GlobalSceneGraphModuleRef, // necessary to handle data in the mapfile (change, retrieve data)
public GlobalEntityModuleRef // to access and modify the entities
{
public:
SunPlugPluginDependencies() :
GlobalEntityModuleRef(GlobalRadiant().getRequiredGameDescriptionKeyValue("entities"))//,
{
}
};
// *************************
// ** standard plugin stuff **
// *************************
namespace SunPlug
{
GtkWindow* main_window;
char MenuList[100] = "";
const char* init(void* hApp, void* pMainWidget)
{
main_window = GTK_WINDOW(pMainWidget);
return "Initializing SunPlug for GTKRadiant";
}
const char* getName()
{
return "SunPlug"; // name that is shown in the menue
}
const char* getCommandList()
{
const char about[] = "About...";
const char etMapCoordinator[] = ";ET-MapCoordinator";
strcat(MenuList, about);
if (strncmp(GlobalRadiant().getGameName(), "etmain", 6) == 0) strcat(MenuList, etMapCoordinator);
return (const char*)MenuList;
}
const char* getCommandTitleList()
{
return "";
}
void dispatch(const char* command, float* vMin, float* vMax, bool bSingleBrush) // message processing
{
if(string_equal(command, "About..."))
{
about_plugin_window();
}
if(string_equal(command, "ET-MapCoordinator"))
{
MapCoordinator();
}
}
} // namespace
class SunPlugModule : public TypeSystemRef
{
_QERPluginTable m_plugin;
public:
typedef _QERPluginTable Type;
STRING_CONSTANT(Name, "SunPlug");
SunPlugModule()
{
m_plugin.m_pfnQERPlug_Init = &SunPlug::init;
m_plugin.m_pfnQERPlug_GetName = &SunPlug::getName;
m_plugin.m_pfnQERPlug_GetCommandList = &SunPlug::getCommandList;
m_plugin.m_pfnQERPlug_GetCommandTitleList = &SunPlug::getCommandTitleList;
m_plugin.m_pfnQERPlug_Dispatch = &SunPlug::dispatch;
}
_QERPluginTable* getTable()
{
return &m_plugin;
}
};
typedef SingletonModule<SunPlugModule, SunPlugPluginDependencies> SingletonSunPlugModule;
SingletonSunPlugModule g_SunPlugModule;
extern "C" void RADIANT_DLLEXPORT Radiant_RegisterModules(ModuleServer& server)
{
initialiseModule(server);
g_SunPlugModule.selfRegister();
}
// ************
// ** my stuff **
// ************
// About dialog
void about_plugin_window()
{
GtkWidget *window, *vbox, *label, *button;
window = gtk_window_new(GTK_WINDOW_TOPLEVEL); // create a window
gtk_window_set_transient_for(GTK_WINDOW(window), SunPlug::main_window); // make the window to stay in front of the main window
g_signal_connect(G_OBJECT(window), "delete_event", G_CALLBACK(delete_event), NULL); // connect the delete event
g_signal_connect(G_OBJECT(window), "destroy", G_CALLBACK(destroy), NULL); // connect the destroy event for the window
gtk_window_set_title(GTK_WINDOW(window), "About SunPlug"); // set the title of the window for the window
gtk_window_set_resizable(GTK_WINDOW(window), FALSE); // don't let the user resize the window
gtk_window_set_modal(GTK_WINDOW(window), TRUE); // force the user not to do something with the other windows
gtk_container_set_border_width(GTK_CONTAINER(window), 10); // set the border of the window
vbox = gtk_vbox_new(FALSE, 10); // create a box to arrange new objects vertically
gtk_container_add(GTK_CONTAINER(window), vbox); // add the box to the window
label = gtk_label_new("SunPlug v1.0 for NetRadiant 1.5\nby Topsun"); // create a label
gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_LEFT); // text align left
gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 2); // insert the label in the box
button = gtk_button_new_with_label("OK"); // create a button with text
g_signal_connect_swapped(G_OBJECT(button), "clicked", G_CALLBACK (gtk_widget_destroy), window); // connect the click event to close the window
gtk_box_pack_start(GTK_BOX(vbox), button, FALSE, FALSE, 2); // insert the button in the box
gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER); // center the window on screen
gtk_widget_show_all(window); // show the window and all subelements
}
// get the current bounding box and return the optimal coordinates
void GetOptimalCoordinates(AABB *levelBoundingBox)
{
int half_width, half_heigth, center_x, center_y;
half_width = levelBoundingBox->extents.x();
half_heigth = levelBoundingBox->extents.y();
center_x = levelBoundingBox->origin.x();
center_y = levelBoundingBox->origin.y();
if (half_width > 175 || half_heigth > 175) // the square must be at least 350x350 units
{
// the wider side is the indicator for the square
if (half_width >= half_heigth)
{
minX = center_x - half_width;
maxX = center_x + half_width;
minY = center_y - half_width;
maxY = center_y + half_width;
} else {
minX = center_x - half_heigth;
maxX = center_x + half_heigth;
minY = center_y - half_heigth;
maxY = center_y + half_heigth;
}
} else {
minX = center_x - 175;
maxX = center_x + 175;
minY = center_y - 175;
maxY = center_y + 175;
}
}
// MapCoordinator dialog window
void MapCoordinator()
{
GtkWidget *window, *vbox, *table, *label, *spinnerMinX, *spinnerMinY, *spinnerMaxX, *spinnerMaxY, *button;
GtkAdjustment *spinner_adj_MinX, *spinner_adj_MinY, *spinner_adj_MaxX, *spinner_adj_MaxY;
Entity *theWorldspawn = NULL;
const char *buffer;
char line[20];
// in any case we need a window to show the user what to do
window = gtk_window_new(GTK_WINDOW_TOPLEVEL); // create the window
gtk_window_set_transient_for(GTK_WINDOW(window), SunPlug::main_window); // make the window to stay in front of the main window
g_signal_connect(G_OBJECT(window), "delete_event", G_CALLBACK(delete_event), NULL); // connect the delete event for the window
g_signal_connect(G_OBJECT(window), "destroy", G_CALLBACK(destroy), NULL); // connect the destroy event for the window
gtk_window_set_title(GTK_WINDOW(window), "ET-MapCoordinator"); // set the title of the window for the window
gtk_window_set_resizable(GTK_WINDOW(window), FALSE); // don't let the user resize the window
gtk_window_set_modal(GTK_WINDOW(window), TRUE); // force the user not to do something with the other windows
gtk_container_set_border_width(GTK_CONTAINER(window), 10); // set the border of the window
vbox = gtk_vbox_new(FALSE, 10); // create a box to arrange new objects vertically
gtk_container_add(GTK_CONTAINER(window), vbox); // add the box to the window
scene::Path path = makeReference(GlobalSceneGraph().root()); // get the path to the root element of the graph
scene::Instance* instance = GlobalSceneGraph().find(path); // find the instance to the given path
AABB levelBoundingBox = instance->worldAABB(); // get the bounding box of the level
theWorldspawn = Scene_FindEntityByClass("worldspawn"); // find the entity worldspawn
if (theWorldspawn != 0) { // need to have a worldspawn otherwise setting a value crashes the radiant
// next two if's: get the current values of the mapcoords
buffer = theWorldspawn->getKeyValue("mapcoordsmins"); // upper left corner
if (strlen(buffer) > 0) {
strncpy(line, buffer, 19);
map_minX = atoi(strtok(line, " ")); // minimum of x value
map_minY = atoi(strtok(NULL, " ")); // maximum of y value
} else {
map_minX = 0;
map_minY = 0;
}
buffer = theWorldspawn->getKeyValue("mapcoordsmaxs"); // lower right corner
if (strlen(buffer) > 0) {
strncpy(line, buffer, 19);
map_maxX = atoi(strtok(line, " ")); // maximum of x value
map_maxY = atoi(strtok(NULL, " ")); // minimum of y value
} else {
map_maxX = 0;
map_maxY = 0;
}
globalOutputStream() << "SunPlug: calculating optimal coordinates\n"; // write to console that we are calculating the coordinates
GetOptimalCoordinates(&levelBoundingBox); // calculate optimal mapcoords with the dimensions of the level bounding box
globalOutputStream() << "SunPlug: adviced mapcoordsmins=" << minX << " " << maxY << "\n"; // console info about mapcoordsmins
globalOutputStream() << "SunPlug: adviced mapcoordsmaxs=" << maxX << " " << minY << "\n"; // console info about mapcoordsmaxs
spinner_adj_MinX = (GtkAdjustment *)gtk_adjustment_new(map_minX, -65536.0, 65536.0, 1.0, 5.0, 0); // create adjustment for value and range of minimum x value
spinner_adj_MinY = (GtkAdjustment *)gtk_adjustment_new(map_minY, -65536.0, 65536.0, 1.0, 5.0, 0); // create adjustment for value and range of minimum y value
spinner_adj_MaxX = (GtkAdjustment *)gtk_adjustment_new(map_maxX, -65536.0, 65536.0, 1.0, 5.0, 0); // create adjustment for value and range of maximum x value
spinner_adj_MaxY = (GtkAdjustment *)gtk_adjustment_new(map_maxY, -65536.0, 65536.0, 1.0, 5.0, 0); // create adjustment for value and range of maximum y value
button = gtk_button_new_with_label("Get optimal mapcoords"); // create button with text
g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(input_optimal), NULL); // connect button with callback function
gtk_box_pack_start(GTK_BOX(vbox), button, FALSE, FALSE, 2); // insert button into vbox
gtk_box_pack_start(GTK_BOX(vbox), gtk_hseparator_new(), FALSE, FALSE, 2); // insert separator into vbox
table = gtk_table_new(4, 3, TRUE); // create table
gtk_table_set_row_spacings(GTK_TABLE(table), 8); // set row spacings
gtk_table_set_col_spacings(GTK_TABLE(table), 8); // set column spacings
gtk_box_pack_start(GTK_BOX(vbox), table, FALSE, FALSE, 2); // insert table into vbox
label = gtk_label_new("x"); // create label
gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_LEFT); // align text to the left side
gtk_table_attach_defaults(GTK_TABLE(table), label, 1, 2, 0, 1); // insert label into table
label = gtk_label_new("y"); // create label
gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_LEFT); // align text to the left side
gtk_table_attach_defaults(GTK_TABLE(table), label, 2, 3, 0, 1); // insert label into table
label = gtk_label_new("mapcoordsmins"); // create label
gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_LEFT); // align text to the left side
gtk_table_attach_defaults(GTK_TABLE(table), label, 0, 1, 1, 2); // insert label into table
spinnerMinX = gtk_spin_button_new(spinner_adj_MinX, 1.0, 0); // create textbox wiht value spin, value and value range
gtk_table_attach_defaults(GTK_TABLE(table), spinnerMinX, 1, 2, 1, 2); // insert spinbox into table
spinnerMinY = gtk_spin_button_new(spinner_adj_MinY, 1.0, 0); // create textbox wiht value spin, value and value range
gtk_table_attach_defaults(GTK_TABLE(table), spinnerMinY, 2, 3, 1, 2); // insert spinbox into table
label = gtk_label_new("mapcoordsmaxs"); // create label
gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_LEFT); // align text to the left side
gtk_table_attach_defaults(GTK_TABLE(table), label, 0, 1, 2, 3); // insert label into table
spinnerMaxX = gtk_spin_button_new(spinner_adj_MaxX, 1.0, 0); // create textbox wiht value spin, value and value range
gtk_table_attach_defaults(GTK_TABLE(table), spinnerMaxX, 1, 2, 2, 3); // insert spinbox into table
spinnerMaxY = gtk_spin_button_new(spinner_adj_MaxY, 1.0, 0); // create textbox wiht value spin, value and value range
gtk_table_attach_defaults(GTK_TABLE(table), spinnerMaxY, 2, 3, 2, 3); // insert spinbox into table
// put the references to the spinboxes and the worldspawn into the global exchange
msp.spinner1 = GTK_SPIN_BUTTON(spinnerMinX);
msp.spinner2 = GTK_SPIN_BUTTON(spinnerMinY);
msp.spinner3 = GTK_SPIN_BUTTON(spinnerMaxX);
msp.spinner4 = GTK_SPIN_BUTTON(spinnerMaxY);
msp.worldspawn = theWorldspawn;
button = gtk_button_new_with_label("Set"); // create button with text
g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(set_coordinates), NULL); // connect button with callback function
gtk_table_attach_defaults(GTK_TABLE(table), button, 1, 2, 3, 4); // insert button into table
button = gtk_button_new_with_label("Cancel"); // create button with text
g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(close_window), NULL); // connect button with callback function
gtk_table_attach_defaults(GTK_TABLE(table), button, 2, 3, 3, 4); // insert button into table
} else {
globalOutputStream() << "SunPlug: no worldspawn found!\n"; // output error to console
label = gtk_label_new("ERROR: No worldspawn was found in the map!\nIn order to use this tool the map must have at least one brush in the worldspawn. "); // create a label
gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_LEFT); // text align left
gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 2); // insert the label in the box
button = gtk_button_new_with_label("OK"); // create a button with text
g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(close_window), NULL); // connect the click event to close the window
gtk_box_pack_start(GTK_BOX(vbox), button, FALSE, FALSE, 2); // insert the button in the box
}
gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER); // center the window
gtk_widget_show_all(window); // show the window and all subelements
}
/*
Sunplug plugin for GtkRadiant
Copyright (C) 2004 Topsun
Thanks to SPoG for help!
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "sunplug.h"
#include "debugging/debugging.h"
#include "iplugin.h"
#include "string/string.h"
#include "modulesystem/singletonmodule.h"
#include "iundo.h" // declaration of undo system
#include "ientity.h" // declaration of entity system
#include "iscenegraph.h" // declaration of datastructure of the map
#include "scenelib.h" // declaration of datastructure of the map
#include "qerplugin.h" // declaration to use other interfaces as a plugin
#include <gtk/gtk.h> // to display something with gtk (windows, buttons etc.), the whole package might not be necessary
void about_plugin_window();
void MapCoordinator();
#ifndef _WIN32
// linux itoa implementation
char* itoa( int value, char* result, int base )
{
// check that the base if valid
if (base < 2 || base > 16)
{
*result = 0;
return result;
}
char* out = result;
int quotient = value;
do
{
*out = "0123456789abcdef"[abs(quotient % base)];
++out;
quotient /= base;
} while (quotient);
// Only apply negative sign for base 10
if( value < 0 && base == 10)
*out++ = '-';
std::reverse(result, out);
*out = 0;
return result;
}
#endif
typedef struct _mapcoord_setting_packet {
GtkSpinButton *spinner1, *spinner2, *spinner3, *spinner4;
Entity* worldspawn;
} mapcoord_setting_packet;
static int map_minX, map_maxX, map_minY, map_maxY;
static int minX, maxX, minY, maxY;
mapcoord_setting_packet msp;
// **************************
// ** find entities by class ** from radiant/map.cpp
// **************************
class EntityFindByClassname : public scene::Graph::Walker
{
const char* m_name;
Entity*& m_entity;
public:
EntityFindByClassname(const char* name, Entity*& entity) : m_name(name), m_entity(entity)
{
m_entity = 0;
}
bool pre(const scene::Path& path, scene::Instance& instance) const
{
if(m_entity == 0)
{
Entity* entity = Node_getEntity(path.top());
if(entity != 0
&& string_equal(m_name, entity->getKeyValue("classname")))
{
m_entity = entity;
}
}
return true;
}
};
Entity* Scene_FindEntityByClass(const char* name)
{
Entity* entity;
GlobalSceneGraph().traverse(EntityFindByClassname(name, entity));
return entity;
}
// **************************
// ** GTK callback functions **
// **************************
static gboolean delete_event(GtkWidget *widget, GdkEvent *event, gpointer data)
{
/* If you return FALSE in the "delete_event" signal handler,
* GTK will emit the "destroy" signal. Returning TRUE means
* you don't want the window to be destroyed.
* This is useful for popping up 'are you sure you want to quit?'
* type dialogs. */
return FALSE;
}
// destroy widget if destroy signal is passed to widget
static void destroy(GtkWidget *widget, gpointer data)
{
gtk_widget_destroy(widget);
}
// function for close button to destroy the toplevel widget
static void close_window(GtkWidget *widget, gpointer data)
{
gtk_widget_destroy(gtk_widget_get_toplevel(widget));
}
// callback function to assign the optimal mapcoords to the spinboxes
static void input_optimal(GtkWidget *widget, gpointer data)
{
gtk_spin_button_set_value(msp.spinner1, minX);
gtk_spin_button_set_value(msp.spinner2, maxY);
gtk_spin_button_set_value(msp.spinner3, maxX);
gtk_spin_button_set_value(msp.spinner4, minY);
}
// Spinner return value function
gint grab_int_value(GtkSpinButton *a_spinner, gpointer user_data) {
return gtk_spin_button_get_value_as_int(a_spinner);
}
// write the values of the Spinner-Boxes to the worldspawn
static void set_coordinates(GtkWidget *widget, gpointer data)
{
//Str str_min, str_max;
char buffer[10], str_min[20], str_max[20];
itoa(gtk_spin_button_get_value_as_int(msp.spinner1), str_min, 10);
itoa(gtk_spin_button_get_value_as_int(msp.spinner2), buffer, 10);
strcat(str_min, " ");
strcat(str_min, buffer);
msp.worldspawn->setKeyValue("mapcoordsmins", str_min);
itoa(gtk_spin_button_get_value_as_int(msp.spinner3), str_max, 10);
itoa(gtk_spin_button_get_value_as_int(msp.spinner4), buffer, 10);
strcat(str_max, " ");
strcat(str_max, buffer);
UndoableCommand undo("SunPlug.entitySetMapcoords");
msp.worldspawn->setKeyValue("mapcoordsmaxs", str_max);
close_window(widget, NULL);
}
class SunPlugPluginDependencies :
public GlobalRadiantModuleRef, // basic class for all other module refs
public GlobalUndoModuleRef, // used to say radiant that something has changed and to undo that
public GlobalSceneGraphModuleRef, // necessary to handle data in the mapfile (change, retrieve data)
public GlobalEntityModuleRef // to access and modify the entities
{
public:
SunPlugPluginDependencies() :
GlobalEntityModuleRef(GlobalRadiant().getRequiredGameDescriptionKeyValue("entities"))//,
{
}
};
// *************************
// ** standard plugin stuff **
// *************************
namespace SunPlug
{
GtkWindow* main_window;
char MenuList[100] = "";
const char* init(void* hApp, void* pMainWidget)
{
main_window = GTK_WINDOW(pMainWidget);
return "Initializing SunPlug for GTKRadiant";
}
const char* getName()
{
return "SunPlug"; // name that is shown in the menue
}
const char* getCommandList()
{
const char about[] = "About...";
const char etMapCoordinator[] = ";ET-MapCoordinator";
strcat(MenuList, about);
if (strncmp(GlobalRadiant().getGameName(), "etmain", 6) == 0) strcat(MenuList, etMapCoordinator);
return (const char*)MenuList;
}
const char* getCommandTitleList()
{
return "";
}
void dispatch(const char* command, float* vMin, float* vMax, bool bSingleBrush) // message processing
{
if(string_equal(command, "About..."))
{
about_plugin_window();
}
if(string_equal(command, "ET-MapCoordinator"))
{
MapCoordinator();
}
}
} // namespace
class SunPlugModule : public TypeSystemRef
{
_QERPluginTable m_plugin;
public:
typedef _QERPluginTable Type;
STRING_CONSTANT(Name, "SunPlug");
SunPlugModule()
{
m_plugin.m_pfnQERPlug_Init = &SunPlug::init;
m_plugin.m_pfnQERPlug_GetName = &SunPlug::getName;
m_plugin.m_pfnQERPlug_GetCommandList = &SunPlug::getCommandList;
m_plugin.m_pfnQERPlug_GetCommandTitleList = &SunPlug::getCommandTitleList;
m_plugin.m_pfnQERPlug_Dispatch = &SunPlug::dispatch;
}
_QERPluginTable* getTable()
{
return &m_plugin;
}
};
typedef SingletonModule<SunPlugModule, SunPlugPluginDependencies> SingletonSunPlugModule;
SingletonSunPlugModule g_SunPlugModule;
extern "C" void RADIANT_DLLEXPORT Radiant_RegisterModules(ModuleServer& server)
{
initialiseModule(server);
g_SunPlugModule.selfRegister();
}
// ************
// ** my stuff **
// ************
// About dialog
void about_plugin_window()
{
GtkWidget *window, *vbox, *label, *button;
window = gtk_window_new(GTK_WINDOW_TOPLEVEL); // create a window
gtk_window_set_transient_for(GTK_WINDOW(window), SunPlug::main_window); // make the window to stay in front of the main window
g_signal_connect(G_OBJECT(window), "delete_event", G_CALLBACK(delete_event), NULL); // connect the delete event
g_signal_connect(G_OBJECT(window), "destroy", G_CALLBACK(destroy), NULL); // connect the destroy event for the window
gtk_window_set_title(GTK_WINDOW(window), "About SunPlug"); // set the title of the window for the window
gtk_window_set_resizable(GTK_WINDOW(window), FALSE); // don't let the user resize the window
gtk_window_set_modal(GTK_WINDOW(window), TRUE); // force the user not to do something with the other windows
gtk_container_set_border_width(GTK_CONTAINER(window), 10); // set the border of the window
vbox = gtk_vbox_new(FALSE, 10); // create a box to arrange new objects vertically
gtk_container_add(GTK_CONTAINER(window), vbox); // add the box to the window
label = gtk_label_new("SunPlug v1.0 for NetRadiant 1.5\nby Topsun"); // create a label
gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_LEFT); // text align left
gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 2); // insert the label in the box
button = gtk_button_new_with_label("OK"); // create a button with text
g_signal_connect_swapped(G_OBJECT(button), "clicked", G_CALLBACK (gtk_widget_destroy), window); // connect the click event to close the window
gtk_box_pack_start(GTK_BOX(vbox), button, FALSE, FALSE, 2); // insert the button in the box
gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER); // center the window on screen
gtk_widget_show_all(window); // show the window and all subelements
}
// get the current bounding box and return the optimal coordinates
void GetOptimalCoordinates(AABB *levelBoundingBox)
{
int half_width, half_heigth, center_x, center_y;
half_width = levelBoundingBox->extents.x();
half_heigth = levelBoundingBox->extents.y();
center_x = levelBoundingBox->origin.x();
center_y = levelBoundingBox->origin.y();
if (half_width > 175 || half_heigth > 175) // the square must be at least 350x350 units
{
// the wider side is the indicator for the square
if (half_width >= half_heigth)
{
minX = center_x - half_width;
maxX = center_x + half_width;
minY = center_y - half_width;
maxY = center_y + half_width;
} else {
minX = center_x - half_heigth;
maxX = center_x + half_heigth;
minY = center_y - half_heigth;
maxY = center_y + half_heigth;
}
} else {
minX = center_x - 175;
maxX = center_x + 175;
minY = center_y - 175;
maxY = center_y + 175;
}
}
// MapCoordinator dialog window
void MapCoordinator()
{
GtkWidget *window, *vbox, *table, *label, *spinnerMinX, *spinnerMinY, *spinnerMaxX, *spinnerMaxY, *button;
GtkAdjustment *spinner_adj_MinX, *spinner_adj_MinY, *spinner_adj_MaxX, *spinner_adj_MaxY;
Entity *theWorldspawn = NULL;
const char *buffer;
char line[20];
// in any case we need a window to show the user what to do
window = gtk_window_new(GTK_WINDOW_TOPLEVEL); // create the window
gtk_window_set_transient_for(GTK_WINDOW(window), SunPlug::main_window); // make the window to stay in front of the main window
g_signal_connect(G_OBJECT(window), "delete_event", G_CALLBACK(delete_event), NULL); // connect the delete event for the window
g_signal_connect(G_OBJECT(window), "destroy", G_CALLBACK(destroy), NULL); // connect the destroy event for the window
gtk_window_set_title(GTK_WINDOW(window), "ET-MapCoordinator"); // set the title of the window for the window
gtk_window_set_resizable(GTK_WINDOW(window), FALSE); // don't let the user resize the window
gtk_window_set_modal(GTK_WINDOW(window), TRUE); // force the user not to do something with the other windows
gtk_container_set_border_width(GTK_CONTAINER(window), 10); // set the border of the window
vbox = gtk_vbox_new(FALSE, 10); // create a box to arrange new objects vertically
gtk_container_add(GTK_CONTAINER(window), vbox); // add the box to the window
scene::Path path = makeReference(GlobalSceneGraph().root()); // get the path to the root element of the graph
scene::Instance* instance = GlobalSceneGraph().find(path); // find the instance to the given path
AABB levelBoundingBox = instance->worldAABB(); // get the bounding box of the level
theWorldspawn = Scene_FindEntityByClass("worldspawn"); // find the entity worldspawn
if (theWorldspawn != 0) { // need to have a worldspawn otherwise setting a value crashes the radiant
// next two if's: get the current values of the mapcoords
buffer = theWorldspawn->getKeyValue("mapcoordsmins"); // upper left corner
if (strlen(buffer) > 0) {
strncpy(line, buffer, 19);
map_minX = atoi(strtok(line, " ")); // minimum of x value
map_minY = atoi(strtok(NULL, " ")); // maximum of y value
} else {
map_minX = 0;
map_minY = 0;
}
buffer = theWorldspawn->getKeyValue("mapcoordsmaxs"); // lower right corner
if (strlen(buffer) > 0) {
strncpy(line, buffer, 19);
map_maxX = atoi(strtok(line, " ")); // maximum of x value
map_maxY = atoi(strtok(NULL, " ")); // minimum of y value
} else {
map_maxX = 0;
map_maxY = 0;
}
globalOutputStream() << "SunPlug: calculating optimal coordinates\n"; // write to console that we are calculating the coordinates
GetOptimalCoordinates(&levelBoundingBox); // calculate optimal mapcoords with the dimensions of the level bounding box
globalOutputStream() << "SunPlug: adviced mapcoordsmins=" << minX << " " << maxY << "\n"; // console info about mapcoordsmins
globalOutputStream() << "SunPlug: adviced mapcoordsmaxs=" << maxX << " " << minY << "\n"; // console info about mapcoordsmaxs
spinner_adj_MinX = (GtkAdjustment *)gtk_adjustment_new(map_minX, -65536.0, 65536.0, 1.0, 5.0, 0); // create adjustment for value and range of minimum x value
spinner_adj_MinY = (GtkAdjustment *)gtk_adjustment_new(map_minY, -65536.0, 65536.0, 1.0, 5.0, 0); // create adjustment for value and range of minimum y value
spinner_adj_MaxX = (GtkAdjustment *)gtk_adjustment_new(map_maxX, -65536.0, 65536.0, 1.0, 5.0, 0); // create adjustment for value and range of maximum x value
spinner_adj_MaxY = (GtkAdjustment *)gtk_adjustment_new(map_maxY, -65536.0, 65536.0, 1.0, 5.0, 0); // create adjustment for value and range of maximum y value
button = gtk_button_new_with_label("Get optimal mapcoords"); // create button with text
g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(input_optimal), NULL); // connect button with callback function
gtk_box_pack_start(GTK_BOX(vbox), button, FALSE, FALSE, 2); // insert button into vbox
gtk_box_pack_start(GTK_BOX(vbox), gtk_hseparator_new(), FALSE, FALSE, 2); // insert separator into vbox
table = gtk_table_new(4, 3, TRUE); // create table
gtk_table_set_row_spacings(GTK_TABLE(table), 8); // set row spacings
gtk_table_set_col_spacings(GTK_TABLE(table), 8); // set column spacings
gtk_box_pack_start(GTK_BOX(vbox), table, FALSE, FALSE, 2); // insert table into vbox
label = gtk_label_new("x"); // create label
gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_LEFT); // align text to the left side
gtk_table_attach_defaults(GTK_TABLE(table), label, 1, 2, 0, 1); // insert label into table
label = gtk_label_new("y"); // create label
gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_LEFT); // align text to the left side
gtk_table_attach_defaults(GTK_TABLE(table), label, 2, 3, 0, 1); // insert label into table
label = gtk_label_new("mapcoordsmins"); // create label
gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_LEFT); // align text to the left side
gtk_table_attach_defaults(GTK_TABLE(table), label, 0, 1, 1, 2); // insert label into table
spinnerMinX = gtk_spin_button_new(spinner_adj_MinX, 1.0, 0); // create textbox wiht value spin, value and value range
gtk_table_attach_defaults(GTK_TABLE(table), spinnerMinX, 1, 2, 1, 2); // insert spinbox into table
spinnerMinY = gtk_spin_button_new(spinner_adj_MinY, 1.0, 0); // create textbox wiht value spin, value and value range
gtk_table_attach_defaults(GTK_TABLE(table), spinnerMinY, 2, 3, 1, 2); // insert spinbox into table
label = gtk_label_new("mapcoordsmaxs"); // create label
gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_LEFT); // align text to the left side
gtk_table_attach_defaults(GTK_TABLE(table), label, 0, 1, 2, 3); // insert label into table
spinnerMaxX = gtk_spin_button_new(spinner_adj_MaxX, 1.0, 0); // create textbox wiht value spin, value and value range
gtk_table_attach_defaults(GTK_TABLE(table), spinnerMaxX, 1, 2, 2, 3); // insert spinbox into table
spinnerMaxY = gtk_spin_button_new(spinner_adj_MaxY, 1.0, 0); // create textbox wiht value spin, value and value range
gtk_table_attach_defaults(GTK_TABLE(table), spinnerMaxY, 2, 3, 2, 3); // insert spinbox into table
// put the references to the spinboxes and the worldspawn into the global exchange
msp.spinner1 = GTK_SPIN_BUTTON(spinnerMinX);
msp.spinner2 = GTK_SPIN_BUTTON(spinnerMinY);
msp.spinner3 = GTK_SPIN_BUTTON(spinnerMaxX);
msp.spinner4 = GTK_SPIN_BUTTON(spinnerMaxY);
msp.worldspawn = theWorldspawn;
button = gtk_button_new_with_label("Set"); // create button with text
g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(set_coordinates), NULL); // connect button with callback function
gtk_table_attach_defaults(GTK_TABLE(table), button, 1, 2, 3, 4); // insert button into table
button = gtk_button_new_with_label("Cancel"); // create button with text
g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(close_window), NULL); // connect button with callback function
gtk_table_attach_defaults(GTK_TABLE(table), button, 2, 3, 3, 4); // insert button into table
} else {
globalOutputStream() << "SunPlug: no worldspawn found!\n"; // output error to console
label = gtk_label_new("ERROR: No worldspawn was found in the map!\nIn order to use this tool the map must have at least one brush in the worldspawn. "); // create a label
gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_LEFT); // text align left
gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 2); // insert the label in the box
button = gtk_button_new_with_label("OK"); // create a button with text
g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(close_window), NULL); // connect the click event to close the window
gtk_box_pack_start(GTK_BOX(vbox), button, FALSE, FALSE, 2); // insert the button in the box
}
gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER); // center the window
gtk_widget_show_all(window); // show the window and all subelements
}

View File

@ -1,7 +1,7 @@
; sunplug.def : Declares the module parameters for the DLL.
LIBRARY "SUNPLUG"
EXPORTS
; Explicit exports can go here
Radiant_RegisterModules @1
; sunplug.def : Declares the module parameters for the DLL.
LIBRARY "SUNPLUG"
EXPORTS
; Explicit exports can go here
Radiant_RegisterModules @1

View File

@ -1,25 +1,25 @@
/*
Sunplug plugin for GtkRadiant
Copyright (C) 2004 Topsun
Thanks to SPoG for help!
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef _PLUGIN_SUNPLUG_
#define _PLUGIN_SUNPLUG_
#endif // _PLUGIN_SUNPLUG_
/*
Sunplug plugin for GtkRadiant
Copyright (C) 2004 Topsun
Thanks to SPoG for help!
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef _PLUGIN_SUNPLUG_
#define _PLUGIN_SUNPLUG_
#endif // _PLUGIN_SUNPLUG_

View File

@ -1,40 +1,40 @@
# Copyright (C) 2001-2006 William Joseph.
# 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
import os
import sys
def svnAddText(filename):
os.system("svn add " + filename);
os.system("svn ps svn:eol-style native " + filename);
def createCPPTemplate(filename, name):
file = open(filename, "wt")
file.write("\n")
file.write("#include \"" + name + ".h\"\n")
file.write("\n")
file.close()
if __name__ == "__main__":
name = sys.argv[1]
location = sys.argv[2]
filename = os.path.join(location, name + ".cpp")
createCPPTemplate(filename, name)
svnAddText(filename)
# Copyright (C) 2001-2006 William Joseph.
# 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
import os
import sys
def svnAddText(filename):
os.system("svn add " + filename);
os.system("svn ps svn:eol-style native " + filename);
def createCPPTemplate(filename, name):
file = open(filename, "wt")
file.write("\n")
file.write("#include \"" + name + ".h\"\n")
file.write("\n")
file.close()
if __name__ == "__main__":
name = sys.argv[1]
location = sys.argv[2]
filename = os.path.join(location, name + ".cpp")
createCPPTemplate(filename, name)
svnAddText(filename)

View File

@ -1,41 +1,41 @@
# Copyright (C) 2001-2006 William Joseph.
# 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
import os
import sys
def svnAddText(filename):
os.system("svn add " + filename);
os.system("svn ps svn:eol-style native " + filename);
def createHeaderTemplate(filename, name):
file = open(filename, "wt")
file.write("\n")
file.write("#if !defined(_INCLUDED_" + name.upper() + "_H_)\n")
file.write("#define _INCLUDED_" + name.upper() + "_H_\n")
file.write("\n")
file.write("#endif\n")
if __name__ == "__main__":
name = sys.argv[1]
location = sys.argv[2]
filename = os.path.join(location, name + ".h")
createHeaderTemplate(filename, name)
svnAddText(filename)
# Copyright (C) 2001-2006 William Joseph.
# 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
import os
import sys
def svnAddText(filename):
os.system("svn add " + filename);
os.system("svn ps svn:eol-style native " + filename);
def createHeaderTemplate(filename, name):
file = open(filename, "wt")
file.write("\n")
file.write("#if !defined(_INCLUDED_" + name.upper() + "_H_)\n")
file.write("#define _INCLUDED_" + name.upper() + "_H_\n")
file.write("\n")
file.write("#endif\n")
if __name__ == "__main__":
name = sys.argv[1]
location = sys.argv[2]
filename = os.path.join(location, name + ".h")
createHeaderTemplate(filename, name)
svnAddText(filename)

View File

@ -1,3 +1,3 @@
*.dsp -m 'COPY' -k 'b'
*.dsw -m 'COPY' -k 'b'
*.scc -m 'COPY' -k 'b'
*.dsp -m 'COPY' -k 'b'
*.dsw -m 'COPY' -k 'b'
*.scc -m 'COPY' -k 'b'

View File

@ -1,3 +1,3 @@
*.dsp -m 'COPY' -k 'b'
*.dsw -m 'COPY' -k 'b'
*.scc -m 'COPY' -k 'b'
*.dsp -m 'COPY' -k 'b'
*.dsw -m 'COPY' -k 'b'
*.scc -m 'COPY' -k 'b'

File diff suppressed because it is too large Load Diff

View File

@ -1,106 +1,106 @@
/*
Copyright (C) 2006, Stefan Greven.
All Rights Reserved.
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_XMLTEXTAGS_H)
#define INCLUDED_XMLTEXTAGS_H
#include <set>
#include <string/string.h>
#include <vector>
#include "iscriplib.h"
#include <libxml/xpath.h>
#include <libxml/xmlwriter.h>
enum NodeTagType
{
TAG,
EMPTY
};
enum NodeShaderType
{
SHADER,
TEXTURE
};
enum TextureType
{
STOCK,
CUSTOM
};
class XmlTagBuilder
{
private:
CopiedString m_savefilename;
xmlDocPtr doc;
xmlXPathContextPtr context;
xmlNodeSetPtr nodePtr;
xmlXPathObjectPtr XpathEval(const char* queryString)
{
xmlChar* expression = (xmlChar*)queryString;
xmlXPathObjectPtr result = xmlXPathEvalExpression(expression, context);
return result;
};
char* GetTagsXpathExpression(char* buffer, const char* shader, NodeTagType nodeTagType)
{
strcpy(buffer, "/root/*/*[@path='");
strcat(buffer, shader);
switch(nodeTagType)
{
case TAG:
strcat(buffer, "']/tag");
break;
case EMPTY:
strcat(buffer, "']");
};
return buffer;
}
public:
XmlTagBuilder();
~XmlTagBuilder();
bool CreateXmlDocument();
bool OpenXmlDoc(const char* file, const char* savefile = 0);
bool SaveXmlDoc(const char* file);
bool SaveXmlDoc(void);
bool AddShaderNode(const char* shader, TextureType textureType, NodeShaderType nodeShaderType);
bool DeleteShaderNode(const char* shader);
bool CheckShaderTag(const char* shader);
bool CheckShaderTag(const char* shader, const char* content);
bool AddShaderTag(const char* shader, const char* content, NodeTagType nodeTagType);
bool DeleteTag(const char* tag);
int RenameShaderTag(const char* oldtag, CopiedString newtag);
bool DeleteShaderTag(const char* shader, const char* tag);
void GetShaderTags(const char* shader, std::vector<CopiedString>& tags);
void GetUntagged(std::set<CopiedString>& shaders);
void GetAllTags(std::set<CopiedString>& tags);
void TagSearch(const char* expression, std::set<CopiedString>& paths);
};
#endif
/*
Copyright (C) 2006, Stefan Greven.
All Rights Reserved.
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_XMLTEXTAGS_H)
#define INCLUDED_XMLTEXTAGS_H
#include <set>
#include <string/string.h>
#include <vector>
#include "iscriplib.h"
#include <libxml/xpath.h>
#include <libxml/xmlwriter.h>
enum NodeTagType
{
TAG,
EMPTY
};
enum NodeShaderType
{
SHADER,
TEXTURE
};
enum TextureType
{
STOCK,
CUSTOM
};
class XmlTagBuilder
{
private:
CopiedString m_savefilename;
xmlDocPtr doc;
xmlXPathContextPtr context;
xmlNodeSetPtr nodePtr;
xmlXPathObjectPtr XpathEval(const char* queryString)
{
xmlChar* expression = (xmlChar*)queryString;
xmlXPathObjectPtr result = xmlXPathEvalExpression(expression, context);
return result;
};
char* GetTagsXpathExpression(char* buffer, const char* shader, NodeTagType nodeTagType)
{
strcpy(buffer, "/root/*/*[@path='");
strcat(buffer, shader);
switch(nodeTagType)
{
case TAG:
strcat(buffer, "']/tag");
break;
case EMPTY:
strcat(buffer, "']");
};
return buffer;
}
public:
XmlTagBuilder();
~XmlTagBuilder();
bool CreateXmlDocument();
bool OpenXmlDoc(const char* file, const char* savefile = 0);
bool SaveXmlDoc(const char* file);
bool SaveXmlDoc(void);
bool AddShaderNode(const char* shader, TextureType textureType, NodeShaderType nodeShaderType);
bool DeleteShaderNode(const char* shader);
bool CheckShaderTag(const char* shader);
bool CheckShaderTag(const char* shader, const char* content);
bool AddShaderTag(const char* shader, const char* content, NodeTagType nodeTagType);
bool DeleteTag(const char* tag);
int RenameShaderTag(const char* oldtag, CopiedString newtag);
bool DeleteShaderTag(const char* shader, const char* tag);
void GetShaderTags(const char* shader, std::vector<CopiedString>& tags);
void GetUntagged(std::set<CopiedString>& shaders);
void GetAllTags(std::set<CopiedString>& tags);
void TagSearch(const char* expression, std::set<CopiedString>& paths);
};
#endif

View File

@ -1,17 +1,17 @@
common/areaportal
common/clip
common/clusterportal
common/cushion
common/donotenter
common/full_clip
common/hint
common/missileclip
common/nodraw
common/nodrawnonsolid
common/nodrop
common/noimpact
common/origin
common/trigger
common/weapclip
liquid
common/areaportal
common/clip
common/clusterportal
common/cushion
common/donotenter
common/full_clip
common/hint
common/missileclip
common/nodraw
common/nodrawnonsolid
common/nodrop
common/noimpact
common/origin
common/trigger
common/weapclip
liquid
fog

View File

@ -1,5 +1,5 @@
base_support/support1rust
base_support/support1shiny
base_support/support2rust
base_support/wplat1_1
base_support/support1rust
base_support/support1shiny
base_support/support2rust
base_support/wplat1_1
base_support/plate2_5

View File

@ -1,10 +1,10 @@
base_door/shinymetaldoor
base_door/shinymetaldoor_outside
gothic_door/door02_bred
gothic_door/door02_bred2_shiny
gothic_door/door02_eblue2_shiny
gothic_door/door02_i_ornate5_fin
gothic_door/door02_j
gothic_door/door02_j3
gothic_door/door02_j4
base_door/shinymetaldoor
base_door/shinymetaldoor_outside
gothic_door/door02_bred
gothic_door/door02_bred2_shiny
gothic_door/door02_eblue2_shiny
gothic_door/door02_i_ornate5_fin
gothic_door/door02_j
gothic_door/door02_j3
gothic_door/door02_j4
gothic_door/door02_k2b

View File

@ -1,14 +1,14 @@
{
"entity" "misc_model"
"offset" "-16"
"model" "models/mapobjects/trees_sd/tree_a.md3"
"model" "models/mapobjects/trees_sd/tree_b.md3"
"model" "models/mapobjects/trees_sd/tree_c.md3"
"model" "models/mapobjects/trees_sd/tree_d.md3"
"pitch" "-5" "5"
"yaw" "0" "360"
"scale" "1" "1.3"
{
"entity" "misc_model"
"offset" "-16"
"model" "models/mapobjects/trees_sd/tree_a.md3"
"model" "models/mapobjects/trees_sd/tree_b.md3"
"model" "models/mapobjects/trees_sd/tree_c.md3"
"model" "models/mapobjects/trees_sd/tree_d.md3"
"pitch" "-5" "5"
"yaw" "0" "360"
"scale" "1" "1.3"
}

View File

@ -1,115 +1,115 @@
//Microsoft Developer Studio generated resource script.
//
#include "resource.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "afxres.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// English (U.S.) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#endif //_WIN32
/////////////////////////////////////////////////////////////////////////////
//
// Icon
//
// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
IDI_ICON1 ICON DISCARDABLE "icon1.ico"
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE DISCARDABLE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE DISCARDABLE
BEGIN
"#include ""afxres.h""\r\n"
"\0"
END
3 TEXTINCLUDE DISCARDABLE
BEGIN
"\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
#ifndef _MAC
/////////////////////////////////////////////////////////////////////////////
//
// Version
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,0,0,1
PRODUCTVERSION 1,0,0,1
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x40004L
FILETYPE 0x1L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0"
BEGIN
VALUE "Comments", "Heavily modified from original ID tool\0"
VALUE "CompanyName", "Raven Software\0"
VALUE "FileDescription", "qdata\0"
VALUE "FileVersion", "2.0\0"
VALUE "InternalName", "qdata\0"
VALUE "LegalCopyright", "Copyright © 1998\0"
VALUE "OriginalFilename", "qdata.exe\0"
VALUE "ProductName", "Raven Software qdata\0"
VALUE "ProductVersion", "2.0\0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
END
END
#endif // !_MAC
#endif // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED
//Microsoft Developer Studio generated resource script.
//
#include "resource.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "afxres.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// English (U.S.) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#endif //_WIN32
/////////////////////////////////////////////////////////////////////////////
//
// Icon
//
// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
IDI_ICON1 ICON DISCARDABLE "icon1.ico"
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE DISCARDABLE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE DISCARDABLE
BEGIN
"#include ""afxres.h""\r\n"
"\0"
END
3 TEXTINCLUDE DISCARDABLE
BEGIN
"\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
#ifndef _MAC
/////////////////////////////////////////////////////////////////////////////
//
// Version
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,0,0,1
PRODUCTVERSION 1,0,0,1
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x40004L
FILETYPE 0x1L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0"
BEGIN
VALUE "Comments", "Heavily modified from original ID tool\0"
VALUE "CompanyName", "Raven Software\0"
VALUE "FileDescription", "qdata\0"
VALUE "FileVersion", "2.0\0"
VALUE "InternalName", "qdata\0"
VALUE "LegalCopyright", "Copyright © 1998\0"
VALUE "OriginalFilename", "qdata.exe\0"
VALUE "ProductName", "Raven Software qdata\0"
VALUE "ProductVersion", "2.0\0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
END
END
#endif // !_MAC
#endif // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED

View File

@ -1,150 +1,150 @@
/* -------------------------------------------------------------------------------
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
----------------------------------------------------------------------------------
This code has been altered significantly from its original form, to support
several games based on the Quake III Arena engine, in the form of "Q3Map2."
------------------------------------------------------------------------------- */
/* marker */
#ifndef GAME_DARKPLACES_H
#define GAME_DARKPLACES_H
/* content and surface flags get form quake3 */
/* -------------------------------------------------------------------------------
game_t struct
------------------------------------------------------------------------------- */
{
"darkplaces", /* -game x */
"id1", /* default base game data dir */
".darkplaces ", /* unix home sub-dir */
"darkplaces", /* magic path word */
"scripts", /* shader directory */
999, /* max lightmapped surface verts */
999, /* max surface verts */
6000, /* max surface indexes */
qfalse, /* flares */
"flareshader", /* default flare shader */
qfalse, /* wolf lighting model? */
128, /* lightmap width/height */
1.0f, /* lightmap gamma */
200.0f, /* lightmap exposure */
1.0f, /* lightmap compensate */
0.3f, /* lightgrid scale */
0.6f, /* lightgrid ambient scale */
qfalse, /* light angle attenuation uses half-lambert curve */
qtrue, /* disable shader lightstyles hack */
qtrue, /* keep light entities on bsp */
4, /* default patchMeta subdivisions tolerance */
qfalse, /* patch casting enabled */
qfalse, /* compile deluxemaps */
0, /* deluxemaps default mode */
512, /* minimap size */
1.0f, /* minimap sharpener */
0.0f, /* minimap border */
qtrue, /* minimap keep aspect */
MINIMAP_MODE_GRAY, /* minimap mode */
"%s.tga", /* minimap name format */
"IBSP", /* bsp file prefix */
46, /* bsp file version */
qfalse, /* cod-style lump len/ofs order */
LoadIBSPFile, /* bsp load function */
WriteIBSPFile, /* bsp write function */
{
/* name contentFlags contentFlagsClear surfaceFlags surfaceFlagsClear compileFlags compileFlagsClear */
/* default */
{ "default", Q_CONT_SOLID, -1, 0, -1, C_SOLID, -1 },
/* ydnar */
{ "lightgrid", 0, 0, 0, 0, C_LIGHTGRID, 0 },
{ "antiportal", 0, 0, 0, 0, C_ANTIPORTAL, 0 },
{ "skip", 0, 0, 0, 0, C_SKIP, 0 },
/* compiler */
{ "origin", Q_CONT_ORIGIN, Q_CONT_SOLID, 0, 0, C_ORIGIN | C_TRANSLUCENT, C_SOLID },
{ "areaportal", Q_CONT_AREAPORTAL, Q_CONT_SOLID, 0, 0, C_AREAPORTAL | C_TRANSLUCENT, C_SOLID },
{ "trans", Q_CONT_TRANSLUCENT, 0, 0, 0, C_TRANSLUCENT, 0 },
{ "detail", Q_CONT_DETAIL, 0, 0, 0, C_DETAIL, 0 },
{ "structural", Q_CONT_STRUCTURAL, 0, 0, 0, C_STRUCTURAL, 0 },
{ "hint", 0, 0, Q_SURF_HINT, 0, C_HINT, 0 },
{ "nodraw", 0, 0, Q_SURF_NODRAW, 0, C_NODRAW, 0 },
{ "alphashadow", 0, 0, Q_SURF_ALPHASHADOW, 0, C_ALPHASHADOW | C_TRANSLUCENT, 0 },
{ "lightfilter", 0, 0, Q_SURF_LIGHTFILTER, 0, C_LIGHTFILTER | C_TRANSLUCENT, 0 },
{ "nolightmap", 0, 0, Q_SURF_VERTEXLIT, 0, C_VERTEXLIT, 0 },
{ "pointlight", 0, 0, Q_SURF_VERTEXLIT, 0, C_VERTEXLIT, 0 },
/* game */
{ "nonsolid", 0, Q_CONT_SOLID, Q_SURF_NONSOLID, 0, 0, C_SOLID },
{ "trigger", Q_CONT_TRIGGER, Q_CONT_SOLID, 0, 0, C_TRANSLUCENT, C_SOLID },
{ "water", Q_CONT_WATER, Q_CONT_SOLID, 0, 0, C_LIQUID | C_TRANSLUCENT, C_SOLID },
{ "slime", Q_CONT_SLIME, Q_CONT_SOLID, 0, 0, C_LIQUID | C_TRANSLUCENT, C_SOLID },
{ "lava", Q_CONT_LAVA, Q_CONT_SOLID, 0, 0, C_LIQUID | C_TRANSLUCENT, C_SOLID },
{ "playerclip", Q_CONT_PLAYERCLIP, Q_CONT_SOLID, 0, 0, C_DETAIL | C_TRANSLUCENT, C_SOLID },
{ "monsterclip", Q_CONT_MONSTERCLIP, Q_CONT_SOLID, 0, 0, C_DETAIL | C_TRANSLUCENT, C_SOLID },
{ "nodrop", Q_CONT_NODROP, Q_CONT_SOLID, 0, 0, C_TRANSLUCENT, C_SOLID },
{ "clusterportal", Q_CONT_CLUSTERPORTAL, Q_CONT_SOLID, 0, 0, C_TRANSLUCENT, C_SOLID },
{ "donotenter", Q_CONT_DONOTENTER, Q_CONT_SOLID, 0, 0, C_TRANSLUCENT, C_SOLID },
{ "botclip", Q_CONT_BOTCLIP, Q_CONT_SOLID, 0, 0, C_TRANSLUCENT, C_SOLID },
{ "fog", Q_CONT_FOG, Q_CONT_SOLID, 0, 0, C_FOG, C_SOLID },
{ "sky", 0, 0, Q_SURF_SKY, 0, C_SKY, 0 },
{ "slick", 0, 0, Q_SURF_SLICK, 0, 0, 0 },
{ "noimpact", 0, 0, Q_SURF_NOIMPACT, 0, 0, 0 },
{ "nomarks", 0, 0, Q_SURF_NOMARKS, 0, C_NOMARKS, 0 },
{ "ladder", 0, 0, Q_SURF_LADDER, 0, 0, 0 },
{ "nodamage", 0, 0, Q_SURF_NODAMAGE, 0, 0, 0 },
{ "metalsteps", 0, 0, Q_SURF_METALSTEPS, 0, 0, 0 },
{ "flesh", 0, 0, Q_SURF_FLESH, 0, 0, 0 },
{ "nosteps", 0, 0, Q_SURF_NOSTEPS, 0, 0, 0 },
{ "nodlight", 0, 0, Q_SURF_NODLIGHT, 0, 0, 0 },
{ "dust", 0, 0, Q_SURF_DUST, 0, 0, 0 },
/* null */
{ NULL, 0, 0, 0, 0, 0, 0 }
}
}
/* end marker */
#endif
/* -------------------------------------------------------------------------------
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
----------------------------------------------------------------------------------
This code has been altered significantly from its original form, to support
several games based on the Quake III Arena engine, in the form of "Q3Map2."
------------------------------------------------------------------------------- */
/* marker */
#ifndef GAME_DARKPLACES_H
#define GAME_DARKPLACES_H
/* content and surface flags get form quake3 */
/* -------------------------------------------------------------------------------
game_t struct
------------------------------------------------------------------------------- */
{
"darkplaces", /* -game x */
"id1", /* default base game data dir */
".darkplaces ", /* unix home sub-dir */
"darkplaces", /* magic path word */
"scripts", /* shader directory */
999, /* max lightmapped surface verts */
999, /* max surface verts */
6000, /* max surface indexes */
qfalse, /* flares */
"flareshader", /* default flare shader */
qfalse, /* wolf lighting model? */
128, /* lightmap width/height */
1.0f, /* lightmap gamma */
200.0f, /* lightmap exposure */
1.0f, /* lightmap compensate */
0.3f, /* lightgrid scale */
0.6f, /* lightgrid ambient scale */
qfalse, /* light angle attenuation uses half-lambert curve */
qtrue, /* disable shader lightstyles hack */
qtrue, /* keep light entities on bsp */
4, /* default patchMeta subdivisions tolerance */
qfalse, /* patch casting enabled */
qfalse, /* compile deluxemaps */
0, /* deluxemaps default mode */
512, /* minimap size */
1.0f, /* minimap sharpener */
0.0f, /* minimap border */
qtrue, /* minimap keep aspect */
MINIMAP_MODE_GRAY, /* minimap mode */
"%s.tga", /* minimap name format */
"IBSP", /* bsp file prefix */
46, /* bsp file version */
qfalse, /* cod-style lump len/ofs order */
LoadIBSPFile, /* bsp load function */
WriteIBSPFile, /* bsp write function */
{
/* name contentFlags contentFlagsClear surfaceFlags surfaceFlagsClear compileFlags compileFlagsClear */
/* default */
{ "default", Q_CONT_SOLID, -1, 0, -1, C_SOLID, -1 },
/* ydnar */
{ "lightgrid", 0, 0, 0, 0, C_LIGHTGRID, 0 },
{ "antiportal", 0, 0, 0, 0, C_ANTIPORTAL, 0 },
{ "skip", 0, 0, 0, 0, C_SKIP, 0 },
/* compiler */
{ "origin", Q_CONT_ORIGIN, Q_CONT_SOLID, 0, 0, C_ORIGIN | C_TRANSLUCENT, C_SOLID },
{ "areaportal", Q_CONT_AREAPORTAL, Q_CONT_SOLID, 0, 0, C_AREAPORTAL | C_TRANSLUCENT, C_SOLID },
{ "trans", Q_CONT_TRANSLUCENT, 0, 0, 0, C_TRANSLUCENT, 0 },
{ "detail", Q_CONT_DETAIL, 0, 0, 0, C_DETAIL, 0 },
{ "structural", Q_CONT_STRUCTURAL, 0, 0, 0, C_STRUCTURAL, 0 },
{ "hint", 0, 0, Q_SURF_HINT, 0, C_HINT, 0 },
{ "nodraw", 0, 0, Q_SURF_NODRAW, 0, C_NODRAW, 0 },
{ "alphashadow", 0, 0, Q_SURF_ALPHASHADOW, 0, C_ALPHASHADOW | C_TRANSLUCENT, 0 },
{ "lightfilter", 0, 0, Q_SURF_LIGHTFILTER, 0, C_LIGHTFILTER | C_TRANSLUCENT, 0 },
{ "nolightmap", 0, 0, Q_SURF_VERTEXLIT, 0, C_VERTEXLIT, 0 },
{ "pointlight", 0, 0, Q_SURF_VERTEXLIT, 0, C_VERTEXLIT, 0 },
/* game */
{ "nonsolid", 0, Q_CONT_SOLID, Q_SURF_NONSOLID, 0, 0, C_SOLID },
{ "trigger", Q_CONT_TRIGGER, Q_CONT_SOLID, 0, 0, C_TRANSLUCENT, C_SOLID },
{ "water", Q_CONT_WATER, Q_CONT_SOLID, 0, 0, C_LIQUID | C_TRANSLUCENT, C_SOLID },
{ "slime", Q_CONT_SLIME, Q_CONT_SOLID, 0, 0, C_LIQUID | C_TRANSLUCENT, C_SOLID },
{ "lava", Q_CONT_LAVA, Q_CONT_SOLID, 0, 0, C_LIQUID | C_TRANSLUCENT, C_SOLID },
{ "playerclip", Q_CONT_PLAYERCLIP, Q_CONT_SOLID, 0, 0, C_DETAIL | C_TRANSLUCENT, C_SOLID },
{ "monsterclip", Q_CONT_MONSTERCLIP, Q_CONT_SOLID, 0, 0, C_DETAIL | C_TRANSLUCENT, C_SOLID },
{ "nodrop", Q_CONT_NODROP, Q_CONT_SOLID, 0, 0, C_TRANSLUCENT, C_SOLID },
{ "clusterportal", Q_CONT_CLUSTERPORTAL, Q_CONT_SOLID, 0, 0, C_TRANSLUCENT, C_SOLID },
{ "donotenter", Q_CONT_DONOTENTER, Q_CONT_SOLID, 0, 0, C_TRANSLUCENT, C_SOLID },
{ "botclip", Q_CONT_BOTCLIP, Q_CONT_SOLID, 0, 0, C_TRANSLUCENT, C_SOLID },
{ "fog", Q_CONT_FOG, Q_CONT_SOLID, 0, 0, C_FOG, C_SOLID },
{ "sky", 0, 0, Q_SURF_SKY, 0, C_SKY, 0 },
{ "slick", 0, 0, Q_SURF_SLICK, 0, 0, 0 },
{ "noimpact", 0, 0, Q_SURF_NOIMPACT, 0, 0, 0 },
{ "nomarks", 0, 0, Q_SURF_NOMARKS, 0, C_NOMARKS, 0 },
{ "ladder", 0, 0, Q_SURF_LADDER, 0, 0, 0 },
{ "nodamage", 0, 0, Q_SURF_NODAMAGE, 0, 0, 0 },
{ "metalsteps", 0, 0, Q_SURF_METALSTEPS, 0, 0, 0 },
{ "flesh", 0, 0, Q_SURF_FLESH, 0, 0, 0 },
{ "nosteps", 0, 0, Q_SURF_NOSTEPS, 0, 0, 0 },
{ "nodlight", 0, 0, Q_SURF_NODLIGHT, 0, 0, 0 },
{ "dust", 0, 0, Q_SURF_DUST, 0, 0, 0 },
/* null */
{ NULL, 0, 0, 0, 0, 0, 0 }
}
}
/* end marker */
#endif

View File

@ -1,150 +1,150 @@
/* -------------------------------------------------------------------------------
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
----------------------------------------------------------------------------------
This code has been altered significantly from its original form, to support
several games based on the Quake III Arena engine, in the form of "Q3Map2."
------------------------------------------------------------------------------- */
/* marker */
#ifndef GAME_DQ_H
#define GAME_DQ_H
/* content and surface flags get form quake3 */
/* -------------------------------------------------------------------------------
game_t struct
------------------------------------------------------------------------------- */
{
"dq", /* -game x */
"basedq", /* default base game data dir */
".dq", /* unix home sub-dir */
"dq", /* magic path word */
"scripts", /* shader directory */
64, /* max lightmapped surface verts */
999, /* max surface verts */
6000, /* max surface indexes */
qfalse, /* flares */
"flareshader", /* default flare shader */
qfalse, /* wolf lighting model? */
128, /* lightmap width/height */
1.2f, /* lightmap gamma */
200.0f, /* lightmap exposure */
1.0f, /* lightmap compensate */
0.3f, /* lightgrid scale */
0.6f, /* lightgrid ambient scale */
qfalse, /* light angle attenuation uses half-lambert curve */
qtrue, /* disable shader lightstyles hack */
qtrue, /* keep light entities on bsp */
4, /* default patchMeta subdivisions tolerance */
qtrue, /* patch casting enabled */
qtrue, /* compile deluxemaps */
1, /* deluxemaps default mode */
512, /* minimap size */
1.0f, /* minimap sharpener */
0.0f, /* minimap border */
qtrue, /* minimap keep aspect */
MINIMAP_MODE_GRAY, /* minimap mode */
"%s.tga", /* minimap name format */
"IBSP", /* bsp file prefix */
46, /* bsp file version */
qfalse, /* cod-style lump len/ofs order */
LoadIBSPFile, /* bsp load function */
WriteIBSPFile, /* bsp write function */
{
/* name contentFlags contentFlagsClear surfaceFlags surfaceFlagsClear compileFlags compileFlagsClear */
/* default */
{ "default", Q_CONT_SOLID, -1, 0, -1, C_SOLID, -1 },
/* ydnar */
{ "lightgrid", 0, 0, 0, 0, C_LIGHTGRID, 0 },
{ "antiportal", 0, 0, 0, 0, C_ANTIPORTAL, 0 },
{ "skip", 0, 0, 0, 0, C_SKIP, 0 },
/* compiler */
{ "origin", Q_CONT_ORIGIN, Q_CONT_SOLID, 0, 0, C_ORIGIN | C_TRANSLUCENT, C_SOLID },
{ "areaportal", Q_CONT_AREAPORTAL, Q_CONT_SOLID, 0, 0, C_AREAPORTAL | C_TRANSLUCENT, C_SOLID },
{ "trans", Q_CONT_TRANSLUCENT, 0, 0, 0, C_TRANSLUCENT, 0 },
{ "detail", Q_CONT_DETAIL, 0, 0, 0, C_DETAIL, 0 },
{ "structural", Q_CONT_STRUCTURAL, 0, 0, 0, C_STRUCTURAL, 0 },
{ "hint", 0, 0, Q_SURF_HINT, 0, C_HINT, 0 },
{ "nodraw", 0, 0, Q_SURF_NODRAW, 0, C_NODRAW, 0 },
{ "alphashadow", 0, 0, Q_SURF_ALPHASHADOW, 0, C_ALPHASHADOW | C_TRANSLUCENT, 0 },
{ "lightfilter", 0, 0, Q_SURF_LIGHTFILTER, 0, C_LIGHTFILTER | C_TRANSLUCENT, 0 },
{ "nolightmap", 0, 0, Q_SURF_VERTEXLIT, 0, C_VERTEXLIT, 0 },
{ "pointlight", 0, 0, Q_SURF_VERTEXLIT, 0, C_VERTEXLIT, 0 },
/* game */
{ "nonsolid", 0, Q_CONT_SOLID, Q_SURF_NONSOLID, 0, 0, C_SOLID },
{ "trigger", Q_CONT_TRIGGER, Q_CONT_SOLID, 0, 0, C_TRANSLUCENT, C_SOLID },
{ "water", Q_CONT_WATER, Q_CONT_SOLID, 0, 0, C_LIQUID | C_TRANSLUCENT, C_SOLID },
{ "slime", Q_CONT_SLIME, Q_CONT_SOLID, 0, 0, C_LIQUID | C_TRANSLUCENT, C_SOLID },
{ "lava", Q_CONT_LAVA, Q_CONT_SOLID, 0, 0, C_LIQUID | C_TRANSLUCENT, C_SOLID },
{ "playerclip", Q_CONT_PLAYERCLIP, Q_CONT_SOLID, 0, 0, C_DETAIL | C_TRANSLUCENT, C_SOLID },
{ "monsterclip", Q_CONT_MONSTERCLIP, Q_CONT_SOLID, 0, 0, C_DETAIL | C_TRANSLUCENT, C_SOLID },
{ "nodrop", Q_CONT_NODROP, Q_CONT_SOLID, 0, 0, C_TRANSLUCENT, C_SOLID },
{ "clusterportal", Q_CONT_CLUSTERPORTAL, Q_CONT_SOLID, 0, 0, C_TRANSLUCENT, C_SOLID },
{ "donotenter", Q_CONT_DONOTENTER, Q_CONT_SOLID, 0, 0, C_TRANSLUCENT, C_SOLID },
{ "botclip", Q_CONT_BOTCLIP, Q_CONT_SOLID, 0, 0, C_TRANSLUCENT, C_SOLID },
{ "fog", Q_CONT_FOG, Q_CONT_SOLID, 0, 0, C_FOG, C_SOLID },
{ "sky", 0, 0, Q_SURF_SKY, 0, C_SKY, 0 },
{ "slick", 0, 0, Q_SURF_SLICK, 0, 0, 0 },
{ "noimpact", 0, 0, Q_SURF_NOIMPACT, 0, 0, 0 },
{ "nomarks", 0, 0, Q_SURF_NOMARKS, 0, C_NOMARKS, 0 },
{ "ladder", 0, 0, Q_SURF_LADDER, 0, 0, 0 },
{ "nodamage", 0, 0, Q_SURF_NODAMAGE, 0, 0, 0 },
{ "metalsteps", 0, 0, Q_SURF_METALSTEPS, 0, 0, 0 },
{ "flesh", 0, 0, Q_SURF_FLESH, 0, 0, 0 },
{ "nosteps", 0, 0, Q_SURF_NOSTEPS, 0, 0, 0 },
{ "nodlight", 0, 0, Q_SURF_NODLIGHT, 0, 0, 0 },
{ "dust", 0, 0, Q_SURF_DUST, 0, 0, 0 },
/* null */
{ NULL, 0, 0, 0, 0, 0, 0 }
}
}
/* end marker */
#endif
/* -------------------------------------------------------------------------------
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
----------------------------------------------------------------------------------
This code has been altered significantly from its original form, to support
several games based on the Quake III Arena engine, in the form of "Q3Map2."
------------------------------------------------------------------------------- */
/* marker */
#ifndef GAME_DQ_H
#define GAME_DQ_H
/* content and surface flags get form quake3 */
/* -------------------------------------------------------------------------------
game_t struct
------------------------------------------------------------------------------- */
{
"dq", /* -game x */
"basedq", /* default base game data dir */
".dq", /* unix home sub-dir */
"dq", /* magic path word */
"scripts", /* shader directory */
64, /* max lightmapped surface verts */
999, /* max surface verts */
6000, /* max surface indexes */
qfalse, /* flares */
"flareshader", /* default flare shader */
qfalse, /* wolf lighting model? */
128, /* lightmap width/height */
1.2f, /* lightmap gamma */
200.0f, /* lightmap exposure */
1.0f, /* lightmap compensate */
0.3f, /* lightgrid scale */
0.6f, /* lightgrid ambient scale */
qfalse, /* light angle attenuation uses half-lambert curve */
qtrue, /* disable shader lightstyles hack */
qtrue, /* keep light entities on bsp */
4, /* default patchMeta subdivisions tolerance */
qtrue, /* patch casting enabled */
qtrue, /* compile deluxemaps */
1, /* deluxemaps default mode */
512, /* minimap size */
1.0f, /* minimap sharpener */
0.0f, /* minimap border */
qtrue, /* minimap keep aspect */
MINIMAP_MODE_GRAY, /* minimap mode */
"%s.tga", /* minimap name format */
"IBSP", /* bsp file prefix */
46, /* bsp file version */
qfalse, /* cod-style lump len/ofs order */
LoadIBSPFile, /* bsp load function */
WriteIBSPFile, /* bsp write function */
{
/* name contentFlags contentFlagsClear surfaceFlags surfaceFlagsClear compileFlags compileFlagsClear */
/* default */
{ "default", Q_CONT_SOLID, -1, 0, -1, C_SOLID, -1 },
/* ydnar */
{ "lightgrid", 0, 0, 0, 0, C_LIGHTGRID, 0 },
{ "antiportal", 0, 0, 0, 0, C_ANTIPORTAL, 0 },
{ "skip", 0, 0, 0, 0, C_SKIP, 0 },
/* compiler */
{ "origin", Q_CONT_ORIGIN, Q_CONT_SOLID, 0, 0, C_ORIGIN | C_TRANSLUCENT, C_SOLID },
{ "areaportal", Q_CONT_AREAPORTAL, Q_CONT_SOLID, 0, 0, C_AREAPORTAL | C_TRANSLUCENT, C_SOLID },
{ "trans", Q_CONT_TRANSLUCENT, 0, 0, 0, C_TRANSLUCENT, 0 },
{ "detail", Q_CONT_DETAIL, 0, 0, 0, C_DETAIL, 0 },
{ "structural", Q_CONT_STRUCTURAL, 0, 0, 0, C_STRUCTURAL, 0 },
{ "hint", 0, 0, Q_SURF_HINT, 0, C_HINT, 0 },
{ "nodraw", 0, 0, Q_SURF_NODRAW, 0, C_NODRAW, 0 },
{ "alphashadow", 0, 0, Q_SURF_ALPHASHADOW, 0, C_ALPHASHADOW | C_TRANSLUCENT, 0 },
{ "lightfilter", 0, 0, Q_SURF_LIGHTFILTER, 0, C_LIGHTFILTER | C_TRANSLUCENT, 0 },
{ "nolightmap", 0, 0, Q_SURF_VERTEXLIT, 0, C_VERTEXLIT, 0 },
{ "pointlight", 0, 0, Q_SURF_VERTEXLIT, 0, C_VERTEXLIT, 0 },
/* game */
{ "nonsolid", 0, Q_CONT_SOLID, Q_SURF_NONSOLID, 0, 0, C_SOLID },
{ "trigger", Q_CONT_TRIGGER, Q_CONT_SOLID, 0, 0, C_TRANSLUCENT, C_SOLID },
{ "water", Q_CONT_WATER, Q_CONT_SOLID, 0, 0, C_LIQUID | C_TRANSLUCENT, C_SOLID },
{ "slime", Q_CONT_SLIME, Q_CONT_SOLID, 0, 0, C_LIQUID | C_TRANSLUCENT, C_SOLID },
{ "lava", Q_CONT_LAVA, Q_CONT_SOLID, 0, 0, C_LIQUID | C_TRANSLUCENT, C_SOLID },
{ "playerclip", Q_CONT_PLAYERCLIP, Q_CONT_SOLID, 0, 0, C_DETAIL | C_TRANSLUCENT, C_SOLID },
{ "monsterclip", Q_CONT_MONSTERCLIP, Q_CONT_SOLID, 0, 0, C_DETAIL | C_TRANSLUCENT, C_SOLID },
{ "nodrop", Q_CONT_NODROP, Q_CONT_SOLID, 0, 0, C_TRANSLUCENT, C_SOLID },
{ "clusterportal", Q_CONT_CLUSTERPORTAL, Q_CONT_SOLID, 0, 0, C_TRANSLUCENT, C_SOLID },
{ "donotenter", Q_CONT_DONOTENTER, Q_CONT_SOLID, 0, 0, C_TRANSLUCENT, C_SOLID },
{ "botclip", Q_CONT_BOTCLIP, Q_CONT_SOLID, 0, 0, C_TRANSLUCENT, C_SOLID },
{ "fog", Q_CONT_FOG, Q_CONT_SOLID, 0, 0, C_FOG, C_SOLID },
{ "sky", 0, 0, Q_SURF_SKY, 0, C_SKY, 0 },
{ "slick", 0, 0, Q_SURF_SLICK, 0, 0, 0 },
{ "noimpact", 0, 0, Q_SURF_NOIMPACT, 0, 0, 0 },
{ "nomarks", 0, 0, Q_SURF_NOMARKS, 0, C_NOMARKS, 0 },
{ "ladder", 0, 0, Q_SURF_LADDER, 0, 0, 0 },
{ "nodamage", 0, 0, Q_SURF_NODAMAGE, 0, 0, 0 },
{ "metalsteps", 0, 0, Q_SURF_METALSTEPS, 0, 0, 0 },
{ "flesh", 0, 0, Q_SURF_FLESH, 0, 0, 0 },
{ "nosteps", 0, 0, Q_SURF_NOSTEPS, 0, 0, 0 },
{ "nodlight", 0, 0, Q_SURF_NODLIGHT, 0, 0, 0 },
{ "dust", 0, 0, Q_SURF_DUST, 0, 0, 0 },
/* null */
{ NULL, 0, 0, 0, 0, 0, 0 }
}
}
/* end marker */
#endif

View File

@ -1,150 +1,150 @@
/* -------------------------------------------------------------------------------
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
----------------------------------------------------------------------------------
This code has been altered significantly from its original form, to support
several games based on the Quake III Arena engine, in the form of "Q3Map2."
------------------------------------------------------------------------------- */
/* marker */
#ifndef GAME_PROPHECY_H
#define GAME_PROPHECY_H
/* content and surface flags get form quake3 */
/* -------------------------------------------------------------------------------
game_t struct
------------------------------------------------------------------------------- */
{
"prophecy", /* -game x */
"base", /* default base game data dir */
".prophecy", /* unix home sub-dir */
"prophecy", /* magic path word */
"scripts", /* shader directory */
64, /* max lightmapped surface verts */
999, /* max surface verts */
6000, /* max surface indexes */
qfalse, /* flares */
"flareshader", /* default flare shader */
qfalse, /* wolf lighting model? */
128, /* lightmap width/height */
1.0f, /* lightmap gamma */
200.0f, /* lightmap exposure */
1.0f, /* lightmap compensate */
0.4f, /* lightgrid scale */
0.6f, /* lightgrid ambient scale */
qfalse, /* light angle attenuation uses half-lambert curve */
qtrue, /* disable shader lightstyles hack */
qtrue, /* keep light entities on bsp */
4, /* default patchMeta subdivisions tolerance */
qtrue, /* patch casting enabled */
qtrue, /* compile deluxemaps */
0, /* deluxemaps default mode */
512, /* minimap size */
1.0f, /* minimap sharpener */
0.0f, /* minimap border */
qtrue, /* minimap keep aspect */
MINIMAP_MODE_GRAY, /* minimap mode */
"%s.tga", /* minimap name format */
"IBSP", /* bsp file prefix */
46, /* bsp file version */
qfalse, /* cod-style lump len/ofs order */
LoadIBSPFile, /* bsp load function */
WriteIBSPFile, /* bsp write function */
{
/* name contentFlags contentFlagsClear surfaceFlags surfaceFlagsClear compileFlags compileFlagsClear */
/* default */
{ "default", Q_CONT_SOLID, -1, 0, -1, C_SOLID, -1 },
/* ydnar */
{ "lightgrid", 0, 0, 0, 0, C_LIGHTGRID, 0 },
{ "antiportal", 0, 0, 0, 0, C_ANTIPORTAL, 0 },
{ "skip", 0, 0, 0, 0, C_SKIP, 0 },
/* compiler */
{ "origin", Q_CONT_ORIGIN, Q_CONT_SOLID, 0, 0, C_ORIGIN | C_TRANSLUCENT, C_SOLID },
{ "areaportal", Q_CONT_AREAPORTAL, Q_CONT_SOLID, 0, 0, C_AREAPORTAL | C_TRANSLUCENT, C_SOLID },
{ "trans", Q_CONT_TRANSLUCENT, 0, 0, 0, C_TRANSLUCENT, 0 },
{ "detail", Q_CONT_DETAIL, 0, 0, 0, C_DETAIL, 0 },
{ "structural", Q_CONT_STRUCTURAL, 0, 0, 0, C_STRUCTURAL, 0 },
{ "hint", 0, 0, Q_SURF_HINT, 0, C_HINT, 0 },
{ "nodraw", 0, 0, Q_SURF_NODRAW, 0, C_NODRAW, 0 },
{ "alphashadow", 0, 0, Q_SURF_ALPHASHADOW, 0, C_ALPHASHADOW | C_TRANSLUCENT, 0 },
{ "lightfilter", 0, 0, Q_SURF_LIGHTFILTER, 0, C_LIGHTFILTER | C_TRANSLUCENT, 0 },
{ "nolightmap", 0, 0, Q_SURF_VERTEXLIT, 0, C_VERTEXLIT, 0 },
{ "pointlight", 0, 0, Q_SURF_VERTEXLIT, 0, C_VERTEXLIT, 0 },
/* game */
{ "nonsolid", 0, Q_CONT_SOLID, Q_SURF_NONSOLID, 0, 0, C_SOLID },
{ "trigger", Q_CONT_TRIGGER, Q_CONT_SOLID, 0, 0, C_TRANSLUCENT, C_SOLID },
{ "water", Q_CONT_WATER, Q_CONT_SOLID, 0, 0, C_LIQUID | C_TRANSLUCENT, C_SOLID },
{ "slime", Q_CONT_SLIME, Q_CONT_SOLID, 0, 0, C_LIQUID | C_TRANSLUCENT, C_SOLID },
{ "lava", Q_CONT_LAVA, Q_CONT_SOLID, 0, 0, C_LIQUID | C_TRANSLUCENT, C_SOLID },
{ "playerclip", Q_CONT_PLAYERCLIP, Q_CONT_SOLID, 0, 0, C_DETAIL | C_TRANSLUCENT, C_SOLID },
{ "monsterclip", Q_CONT_MONSTERCLIP, Q_CONT_SOLID, 0, 0, C_DETAIL | C_TRANSLUCENT, C_SOLID },
{ "nodrop", Q_CONT_NODROP, Q_CONT_SOLID, 0, 0, C_TRANSLUCENT, C_SOLID },
{ "clusterportal", Q_CONT_CLUSTERPORTAL, Q_CONT_SOLID, 0, 0, C_TRANSLUCENT, C_SOLID },
{ "donotenter", Q_CONT_DONOTENTER, Q_CONT_SOLID, 0, 0, C_TRANSLUCENT, C_SOLID },
{ "botclip", Q_CONT_BOTCLIP, Q_CONT_SOLID, 0, 0, C_TRANSLUCENT, C_SOLID },
{ "fog", Q_CONT_FOG, Q_CONT_SOLID, 0, 0, C_FOG, C_SOLID },
{ "sky", 0, 0, Q_SURF_SKY, 0, C_SKY, 0 },
{ "slick", 0, 0, Q_SURF_SLICK, 0, 0, 0 },
{ "noimpact", 0, 0, Q_SURF_NOIMPACT, 0, 0, 0 },
{ "nomarks", 0, 0, Q_SURF_NOMARKS, 0, C_NOMARKS, 0 },
{ "ladder", 0, 0, Q_SURF_LADDER, 0, 0, 0 },
{ "nodamage", 0, 0, Q_SURF_NODAMAGE, 0, 0, 0 },
{ "metalsteps", 0, 0, Q_SURF_METALSTEPS, 0, 0, 0 },
{ "flesh", 0, 0, Q_SURF_FLESH, 0, 0, 0 },
{ "nosteps", 0, 0, Q_SURF_NOSTEPS, 0, 0, 0 },
{ "nodlight", 0, 0, Q_SURF_NODLIGHT, 0, 0, 0 },
{ "dust", 0, 0, Q_SURF_DUST, 0, 0, 0 },
/* null */
{ NULL, 0, 0, 0, 0, 0, 0 }
}
}
/* end marker */
#endif
/* -------------------------------------------------------------------------------
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
----------------------------------------------------------------------------------
This code has been altered significantly from its original form, to support
several games based on the Quake III Arena engine, in the form of "Q3Map2."
------------------------------------------------------------------------------- */
/* marker */
#ifndef GAME_PROPHECY_H
#define GAME_PROPHECY_H
/* content and surface flags get form quake3 */
/* -------------------------------------------------------------------------------
game_t struct
------------------------------------------------------------------------------- */
{
"prophecy", /* -game x */
"base", /* default base game data dir */
".prophecy", /* unix home sub-dir */
"prophecy", /* magic path word */
"scripts", /* shader directory */
64, /* max lightmapped surface verts */
999, /* max surface verts */
6000, /* max surface indexes */
qfalse, /* flares */
"flareshader", /* default flare shader */
qfalse, /* wolf lighting model? */
128, /* lightmap width/height */
1.0f, /* lightmap gamma */
200.0f, /* lightmap exposure */
1.0f, /* lightmap compensate */
0.4f, /* lightgrid scale */
0.6f, /* lightgrid ambient scale */
qfalse, /* light angle attenuation uses half-lambert curve */
qtrue, /* disable shader lightstyles hack */
qtrue, /* keep light entities on bsp */
4, /* default patchMeta subdivisions tolerance */
qtrue, /* patch casting enabled */
qtrue, /* compile deluxemaps */
0, /* deluxemaps default mode */
512, /* minimap size */
1.0f, /* minimap sharpener */
0.0f, /* minimap border */
qtrue, /* minimap keep aspect */
MINIMAP_MODE_GRAY, /* minimap mode */
"%s.tga", /* minimap name format */
"IBSP", /* bsp file prefix */
46, /* bsp file version */
qfalse, /* cod-style lump len/ofs order */
LoadIBSPFile, /* bsp load function */
WriteIBSPFile, /* bsp write function */
{
/* name contentFlags contentFlagsClear surfaceFlags surfaceFlagsClear compileFlags compileFlagsClear */
/* default */
{ "default", Q_CONT_SOLID, -1, 0, -1, C_SOLID, -1 },
/* ydnar */
{ "lightgrid", 0, 0, 0, 0, C_LIGHTGRID, 0 },
{ "antiportal", 0, 0, 0, 0, C_ANTIPORTAL, 0 },
{ "skip", 0, 0, 0, 0, C_SKIP, 0 },
/* compiler */
{ "origin", Q_CONT_ORIGIN, Q_CONT_SOLID, 0, 0, C_ORIGIN | C_TRANSLUCENT, C_SOLID },
{ "areaportal", Q_CONT_AREAPORTAL, Q_CONT_SOLID, 0, 0, C_AREAPORTAL | C_TRANSLUCENT, C_SOLID },
{ "trans", Q_CONT_TRANSLUCENT, 0, 0, 0, C_TRANSLUCENT, 0 },
{ "detail", Q_CONT_DETAIL, 0, 0, 0, C_DETAIL, 0 },
{ "structural", Q_CONT_STRUCTURAL, 0, 0, 0, C_STRUCTURAL, 0 },
{ "hint", 0, 0, Q_SURF_HINT, 0, C_HINT, 0 },
{ "nodraw", 0, 0, Q_SURF_NODRAW, 0, C_NODRAW, 0 },
{ "alphashadow", 0, 0, Q_SURF_ALPHASHADOW, 0, C_ALPHASHADOW | C_TRANSLUCENT, 0 },
{ "lightfilter", 0, 0, Q_SURF_LIGHTFILTER, 0, C_LIGHTFILTER | C_TRANSLUCENT, 0 },
{ "nolightmap", 0, 0, Q_SURF_VERTEXLIT, 0, C_VERTEXLIT, 0 },
{ "pointlight", 0, 0, Q_SURF_VERTEXLIT, 0, C_VERTEXLIT, 0 },
/* game */
{ "nonsolid", 0, Q_CONT_SOLID, Q_SURF_NONSOLID, 0, 0, C_SOLID },
{ "trigger", Q_CONT_TRIGGER, Q_CONT_SOLID, 0, 0, C_TRANSLUCENT, C_SOLID },
{ "water", Q_CONT_WATER, Q_CONT_SOLID, 0, 0, C_LIQUID | C_TRANSLUCENT, C_SOLID },
{ "slime", Q_CONT_SLIME, Q_CONT_SOLID, 0, 0, C_LIQUID | C_TRANSLUCENT, C_SOLID },
{ "lava", Q_CONT_LAVA, Q_CONT_SOLID, 0, 0, C_LIQUID | C_TRANSLUCENT, C_SOLID },
{ "playerclip", Q_CONT_PLAYERCLIP, Q_CONT_SOLID, 0, 0, C_DETAIL | C_TRANSLUCENT, C_SOLID },
{ "monsterclip", Q_CONT_MONSTERCLIP, Q_CONT_SOLID, 0, 0, C_DETAIL | C_TRANSLUCENT, C_SOLID },
{ "nodrop", Q_CONT_NODROP, Q_CONT_SOLID, 0, 0, C_TRANSLUCENT, C_SOLID },
{ "clusterportal", Q_CONT_CLUSTERPORTAL, Q_CONT_SOLID, 0, 0, C_TRANSLUCENT, C_SOLID },
{ "donotenter", Q_CONT_DONOTENTER, Q_CONT_SOLID, 0, 0, C_TRANSLUCENT, C_SOLID },
{ "botclip", Q_CONT_BOTCLIP, Q_CONT_SOLID, 0, 0, C_TRANSLUCENT, C_SOLID },
{ "fog", Q_CONT_FOG, Q_CONT_SOLID, 0, 0, C_FOG, C_SOLID },
{ "sky", 0, 0, Q_SURF_SKY, 0, C_SKY, 0 },
{ "slick", 0, 0, Q_SURF_SLICK, 0, 0, 0 },
{ "noimpact", 0, 0, Q_SURF_NOIMPACT, 0, 0, 0 },
{ "nomarks", 0, 0, Q_SURF_NOMARKS, 0, C_NOMARKS, 0 },
{ "ladder", 0, 0, Q_SURF_LADDER, 0, 0, 0 },
{ "nodamage", 0, 0, Q_SURF_NODAMAGE, 0, 0, 0 },
{ "metalsteps", 0, 0, Q_SURF_METALSTEPS, 0, 0, 0 },
{ "flesh", 0, 0, Q_SURF_FLESH, 0, 0, 0 },
{ "nosteps", 0, 0, Q_SURF_NOSTEPS, 0, 0, 0 },
{ "nodlight", 0, 0, Q_SURF_NODLIGHT, 0, 0, 0 },
{ "dust", 0, 0, Q_SURF_DUST, 0, 0, 0 },
/* null */
{ NULL, 0, 0, 0, 0, 0, 0 }
}
}
/* end marker */
#endif

View File

@ -1 +1 @@
101 ICON DISCARDABLE "q3map2.ico"
101 ICON DISCARDABLE "q3map2.ico"

View File

@ -1,8 +1,8 @@
Index: light.c
===================================================================
--- light.c (revision 158)
+++ light.c (working copy)
@@ -357,12 +365,13 @@
Index: light.c
===================================================================
--- light.c (revision 158)
+++ light.c (working copy)
@@ -357,12 +365,13 @@
intensity *= scale;
/* ydnar: get deviance and samples */