fix lots of CRLFs
This commit is contained in:
parent
0a92ff3ea2
commit
54ccfc9f18
6
.gitattributes
vendored
6
.gitattributes
vendored
|
|
@ -95,8 +95,8 @@ makespr32 crlf=input
|
||||||
*.mapinfo crlf=input
|
*.mapinfo crlf=input
|
||||||
*.m crlf=input
|
*.m crlf=input
|
||||||
*.md3 -crlf -diff
|
*.md3 -crlf -diff
|
||||||
*.md5anim crlf=input
|
*.md5anim -crlf
|
||||||
*.md5mesh crlf=input
|
*.md5mesh -crlf
|
||||||
*.mdl -crlf -diff
|
*.mdl -crlf -diff
|
||||||
*.med crlf=input
|
*.med crlf=input
|
||||||
*.mf crlf=input
|
*.mf crlf=input
|
||||||
|
|
@ -124,7 +124,7 @@ PkgInfo crlf=input
|
||||||
*.pm crlf=input
|
*.pm crlf=input
|
||||||
*.png -crlf -diff
|
*.png -crlf -diff
|
||||||
POSITIONS -crlf -diff
|
POSITIONS -crlf -diff
|
||||||
*.proj crlf=input
|
*.proj -crlf
|
||||||
*.properties crlf=input
|
*.properties crlf=input
|
||||||
*.psd -crlf -diff
|
*.psd -crlf -diff
|
||||||
*.py crlf=input
|
*.py crlf=input
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
; bkgrnd2d.def : Declares the module parameters for the DLL.
|
; bkgrnd2d.def : Declares the module parameters for the DLL.
|
||||||
|
|
||||||
LIBRARY "BKGRND2D"
|
LIBRARY "BKGRND2D"
|
||||||
DESCRIPTION 'BKGRND2D Windows Dynamic Link Library'
|
DESCRIPTION 'BKGRND2D Windows Dynamic Link Library'
|
||||||
|
|
||||||
EXPORTS
|
EXPORTS
|
||||||
; Explicit exports can go here
|
; Explicit exports can go here
|
||||||
Synapse_EnumerateInterfaces @1
|
Synapse_EnumerateInterfaces @1
|
||||||
|
|
|
||||||
|
|
@ -1,131 +1,131 @@
|
||||||
November 25 2003
|
November 25 2003
|
||||||
bkgrnd2d v 0.25 beta for radiant 1.3.13
|
bkgrnd2d v 0.25 beta for radiant 1.3.13
|
||||||
by SCDS_reyalP (email hellsownpuppy@yahoo.com)
|
by SCDS_reyalP (email hellsownpuppy@yahoo.com)
|
||||||
|
|
||||||
WARNING:
|
WARNING:
|
||||||
This is an beta release. It is provided with absolutely NO WARRANTY.
|
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.
|
If it turns your data to mush and melts your CPU, don't blame me.
|
||||||
|
|
||||||
Overview:
|
Overview:
|
||||||
This little plugin allows you to display an image in the the gtkradiant 2d
|
This little plugin allows you to display an image in the the gtkradiant 2d
|
||||||
windows. This is useful for layout sketches, maps made from
|
windows. This is useful for layout sketches, maps made from
|
||||||
existing plans, building geometry based on photgraphs, viewing terrain
|
existing plans, building geometry based on photgraphs, viewing terrain
|
||||||
alphamaps in relation to your terrain, and so on.
|
alphamaps in relation to your terrain, and so on.
|
||||||
|
|
||||||
Installation:
|
Installation:
|
||||||
extract the .dll and bitmaps into your gtkradiant/plugins directory, and
|
extract the .dll and bitmaps into your gtkradiant/plugins directory, and
|
||||||
restart radiant. Be sure to use directory names, to ensure the bitmaps go
|
restart radiant. Be sure to use directory names, to ensure the bitmaps go
|
||||||
in your plugins/bitmaps directory.
|
in your plugins/bitmaps directory.
|
||||||
|
|
||||||
Uninstallation:
|
Uninstallation:
|
||||||
Close radiant, delete the bkgrnd2d.dll from the plugins directory, and
|
Close radiant, delete the bkgrnd2d.dll from the plugins directory, and
|
||||||
delete the bkgrnd2*.bmp files from the plugins/bitmaps directory.
|
delete the bkgrnd2*.bmp files from the plugins/bitmaps directory.
|
||||||
|
|
||||||
User Interface:
|
User Interface:
|
||||||
- The plugin adds 4 buttons to the radiant plugin toolbar. The first 3
|
- 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
|
toggle the display of a background image in the specified view. The fourth
|
||||||
brings up a configuration dialog. The configuration dialog can also be
|
brings up a configuration dialog. The configuration dialog can also be
|
||||||
opened from the plugins menu.
|
opened from the plugins menu.
|
||||||
|
|
||||||
- If an image has not been loaded, or it's display size and location have
|
- 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
|
not been set, pushing one of the toggle buttons will bring up the dialog
|
||||||
with the corresponding page selected.
|
with the corresponding page selected.
|
||||||
|
|
||||||
- The configuration dialog is non-modal, meaning that you can leave it open
|
- 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
|
while you work in radiant. If it gets lost behind another window, clicking
|
||||||
on the configuration button will bring it to the forground.
|
on the configuration button will bring it to the forground.
|
||||||
|
|
||||||
Usage:
|
Usage:
|
||||||
- bring up the configuration dialog.
|
- bring up the configuration dialog.
|
||||||
|
|
||||||
- Choose the "Browse..." button. This will prompt you for an image file.
|
- Choose the "Browse..." button. This will prompt you for an image file.
|
||||||
The file *MUST* be inside your basegame directory (baseq3, main, etmain or
|
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
|
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
|
the game in use. For q3 based games this is truecolor .jpg, .tga and
|
||||||
sometimes .png. For q2 this is .wal
|
sometimes .png. For q2 this is .wal
|
||||||
|
|
||||||
- Use one of the following methods to set the size (in game units) that the
|
- Use one of the following methods to set the size (in game units) that the
|
||||||
file is displayed.
|
file is displayed.
|
||||||
1) select 1 or more brushes or entities and choose "from selection"
|
1) select 1 or more brushes or entities and choose "from selection"
|
||||||
This will use the total dimensions off all selected brushes and entities
|
This will use the total dimensions off all selected brushes and entities
|
||||||
to size the image.
|
to size the image.
|
||||||
2) For the X/Y view only, choose 'Size to min/max keys' This will look in
|
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
|
the worldspawn entity for the keys mapcoordsmins and mapcoordsmaxs (also
|
||||||
used for ET tracemap generation and command map sizing) and use those
|
used for ET tracemap generation and command map sizing) and use those
|
||||||
dimensions to size the image.
|
dimensions to size the image.
|
||||||
|
|
||||||
- Use the toggle buttons to show or hide the loaded images. The buttons will
|
- 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
|
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.
|
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.
|
- 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
|
- 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
|
an information in the radiant console. Please include this when reporting
|
||||||
bugs.
|
bugs.
|
||||||
|
|
||||||
|
|
||||||
Notes and limitations:
|
Notes and limitations:
|
||||||
- This plugin is compiled for GtkRadiant 1.3.13. It may or may not work with
|
- 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
|
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.
|
build from source (see below) you can build it for other versions.
|
||||||
|
|
||||||
- As mentioned above, the image *MUST* be inside your basegame directory, or
|
- As mentioned above, the image *MUST* be inside your basegame directory, or
|
||||||
another directory in which radiant looks for game files.
|
another directory in which radiant looks for game files.
|
||||||
|
|
||||||
- To prevent the image from being distorted, you should size it to the
|
- To prevent the image from being distorted, you should size it to the
|
||||||
original images aspect ratio. mapcoordsmaxs/mapcoordsmins and command maps
|
original images aspect ratio. mapcoordsmaxs/mapcoordsmins and command maps
|
||||||
should always be square.
|
should always be square.
|
||||||
|
|
||||||
- If you want a specific pixel to world unit relationship, you must arrange
|
- If you want a specific pixel to world unit relationship, you must arrange
|
||||||
that yourself.
|
that yourself.
|
||||||
|
|
||||||
- On load, the image is converted to a texture whose dimensions are powers
|
- 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
|
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,
|
be lost due to resampling. If it is too large to fit on a single texture,
|
||||||
resolution is reduced.
|
resolution is reduced.
|
||||||
|
|
||||||
- radiants gamma and mipmap options are applied to the image.
|
- radiants gamma and mipmap options are applied to the image.
|
||||||
|
|
||||||
- If the image has an alpha channel, it will be included in the blending
|
- 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
|
process. 0 is transparent, 255 is opaque. .tga images are recommended if
|
||||||
you want to have an alpha channel.
|
you want to have an alpha channel.
|
||||||
|
|
||||||
- since the plugin will only use true color files, you cannot use a terrain
|
- 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
|
indexmap (aka alphamap) or heightmap directly. You can of course, save a
|
||||||
copy of your indexmap in a 32 bit format.
|
copy of your indexmap in a 32 bit format.
|
||||||
|
|
||||||
- There is no unload command.
|
- There is no unload command.
|
||||||
|
|
||||||
- You put the plugin in a game specific plugin directory, rather than the
|
- You put the plugin in a game specific plugin directory, rather than the
|
||||||
radiant plugin directory.
|
radiant plugin directory.
|
||||||
|
|
||||||
- You cannot set the image size with sub-unit precision.
|
- You cannot set the image size with sub-unit precision.
|
||||||
|
|
||||||
- Only win32 binaries are included. The source is available from:
|
- Only win32 binaries are included. The source is available from:
|
||||||
http://www.cyberonic.net/~gdevault/rfm/mapstuff/bkgrnd2d-b0.25-src.zip
|
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
|
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
|
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
|
figure out the compile options. I suggest ripping those off from some other
|
||||||
plugin.
|
plugin.
|
||||||
|
|
||||||
TODO:
|
TODO:
|
||||||
- make file selection paterns match supported filetypes
|
- make file selection paterns match supported filetypes
|
||||||
- large images without downsampling
|
- large images without downsampling
|
||||||
- bitmap and pcx support for indexmaps
|
- bitmap and pcx support for indexmaps
|
||||||
- automatic size from indexmapped entities
|
- automatic size from indexmapped entities
|
||||||
- render under the grid instead of blending
|
- render under the grid instead of blending
|
||||||
- mac/*nix support
|
- mac/*nix support
|
||||||
- remember/save/restore settings
|
- remember/save/restore settings
|
||||||
- texture options independant of radiant prefs
|
- texture options independant of radiant prefs
|
||||||
- clean up icky code
|
- clean up icky code
|
||||||
|
|
||||||
Changes from 0.1
|
Changes from 0.1
|
||||||
- all 2d views supported
|
- all 2d views supported
|
||||||
- new ui
|
- new ui
|
||||||
- file selection patterns, default directory improved
|
- file selection patterns, default directory improved
|
||||||
|
|
||||||
Changes from 0.2
|
Changes from 0.2
|
||||||
- tooltips in dialog
|
- tooltips in dialog
|
||||||
- various code cleanup
|
- various code cleanup
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
; brushexport.def : Declares the module parameters for the DLL.
|
; brushexport.def : Declares the module parameters for the DLL.
|
||||||
|
|
||||||
LIBRARY "BRUSHEXPORT"
|
LIBRARY "BRUSHEXPORT"
|
||||||
|
|
||||||
EXPORTS
|
EXPORTS
|
||||||
; Explicit exports can go here
|
; Explicit exports can go here
|
||||||
Radiant_RegisterModules @1
|
Radiant_RegisterModules @1
|
||||||
|
|
|
||||||
|
|
@ -1,25 +1,25 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2006, Thomas Nitschke.
|
Copyright (C) 2006, Thomas Nitschke.
|
||||||
All Rights Reserved.
|
All Rights Reserved.
|
||||||
|
|
||||||
This file is part of GtkRadiant.
|
This file is part of GtkRadiant.
|
||||||
|
|
||||||
GtkRadiant is free software; you can redistribute it and/or modify
|
GtkRadiant is free software; you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation; either version 2 of the License, or
|
the Free Software Foundation; either version 2 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
GtkRadiant is distributed in the hope that it will be useful,
|
GtkRadiant is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with GtkRadiant; if not, write to the Free Software
|
along with GtkRadiant; if not, write to the Free Software
|
||||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if !defined(INCLUDED_BRUSH_EXPORT_H)
|
#if !defined(INCLUDED_BRUSH_EXPORT_H)
|
||||||
#define INCLUDED_BRUSH_EXPORT_H
|
#define INCLUDED_BRUSH_EXPORT_H
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -1,263 +1,263 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2006, Stefan Greven.
|
Copyright (C) 2006, Stefan Greven.
|
||||||
All Rights Reserved.
|
All Rights Reserved.
|
||||||
|
|
||||||
This file is part of GtkRadiant.
|
This file is part of GtkRadiant.
|
||||||
|
|
||||||
GtkRadiant is free software; you can redistribute it and/or modify
|
GtkRadiant is free software; you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation; either version 2 of the License, or
|
the Free Software Foundation; either version 2 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
GtkRadiant is distributed in the hope that it will be useful,
|
GtkRadiant is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with GtkRadiant; if not, write to the Free Software
|
along with GtkRadiant; if not, write to the Free Software
|
||||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "shaderplug.h"
|
#include "shaderplug.h"
|
||||||
|
|
||||||
#include "debugging/debugging.h"
|
#include "debugging/debugging.h"
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include "string/string.h"
|
#include "string/string.h"
|
||||||
#include "modulesystem/singletonmodule.h"
|
#include "modulesystem/singletonmodule.h"
|
||||||
#include "stream/stringstream.h"
|
#include "stream/stringstream.h"
|
||||||
#include "os/file.h"
|
#include "os/file.h"
|
||||||
|
|
||||||
#include <gtk/gtk.h>
|
#include <gtk/gtk.h>
|
||||||
|
|
||||||
#include "iplugin.h"
|
#include "iplugin.h"
|
||||||
#include "qerplugin.h"
|
#include "qerplugin.h"
|
||||||
#include "ifilesystem.h"
|
#include "ifilesystem.h"
|
||||||
#include "iarchive.h"
|
#include "iarchive.h"
|
||||||
#include "ishaders.h"
|
#include "ishaders.h"
|
||||||
#include "iscriplib.h"
|
#include "iscriplib.h"
|
||||||
|
|
||||||
#include "generic/callback.h"
|
#include "generic/callback.h"
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
const char SHADERTAG_FILE[] = "shadertags.xml";
|
const char SHADERTAG_FILE[] = "shadertags.xml";
|
||||||
}
|
}
|
||||||
|
|
||||||
class ShaderPlugPluginDependencies : public GlobalRadiantModuleRef,
|
class ShaderPlugPluginDependencies : public GlobalRadiantModuleRef,
|
||||||
public GlobalFileSystemModuleRef,
|
public GlobalFileSystemModuleRef,
|
||||||
public GlobalShadersModuleRef
|
public GlobalShadersModuleRef
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ShaderPlugPluginDependencies() :
|
ShaderPlugPluginDependencies() :
|
||||||
GlobalShadersModuleRef(GlobalRadiant().getRequiredGameDescriptionKeyValue("shaders"))
|
GlobalShadersModuleRef(GlobalRadiant().getRequiredGameDescriptionKeyValue("shaders"))
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
namespace Shaderplug
|
namespace Shaderplug
|
||||||
{
|
{
|
||||||
GtkWindow* g_window;
|
GtkWindow* g_window;
|
||||||
|
|
||||||
std::vector<const char*> archives;
|
std::vector<const char*> archives;
|
||||||
std::set<std::string> shaders;
|
std::set<std::string> shaders;
|
||||||
std::set<std::string> textures;
|
std::set<std::string> textures;
|
||||||
|
|
||||||
XmlTagBuilder TagBuilder;
|
XmlTagBuilder TagBuilder;
|
||||||
void CreateTagFile();
|
void CreateTagFile();
|
||||||
|
|
||||||
const char* init(void* hApp, void* pMainWidget)
|
const char* init(void* hApp, void* pMainWidget)
|
||||||
{
|
{
|
||||||
g_window = GTK_WINDOW(pMainWidget);
|
g_window = GTK_WINDOW(pMainWidget);
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
const char* getName()
|
const char* getName()
|
||||||
{
|
{
|
||||||
return "ShaderPlug";
|
return "ShaderPlug";
|
||||||
}
|
}
|
||||||
const char* getCommandList()
|
const char* getCommandList()
|
||||||
{
|
{
|
||||||
return "About;Create tag file";
|
return "About;Create tag file";
|
||||||
}
|
}
|
||||||
const char* getCommandTitleList()
|
const char* getCommandTitleList()
|
||||||
{
|
{
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
void dispatch(const char* command, float* vMin, float* vMax, bool bSingleBrush)
|
void dispatch(const char* command, float* vMin, float* vMax, bool bSingleBrush)
|
||||||
{
|
{
|
||||||
if(string_equal(command, "About"))
|
if(string_equal(command, "About"))
|
||||||
{
|
{
|
||||||
GlobalRadiant().m_pfnMessageBox(GTK_WIDGET(g_window), "Shaderplug (1.0)\n\n"
|
GlobalRadiant().m_pfnMessageBox(GTK_WIDGET(g_window), "Shaderplug (1.0)\n\n"
|
||||||
"by Shaderman (shaderman@gmx.net)",
|
"by Shaderman (shaderman@gmx.net)",
|
||||||
"About",
|
"About",
|
||||||
eMB_OK,
|
eMB_OK,
|
||||||
eMB_ICONDEFAULT);
|
eMB_ICONDEFAULT);
|
||||||
}
|
}
|
||||||
if(string_equal(command, "Create tag file"))
|
if(string_equal(command, "Create tag file"))
|
||||||
{
|
{
|
||||||
CreateTagFile();
|
CreateTagFile();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void loadArchiveFile(const char* filename)
|
void loadArchiveFile(const char* filename)
|
||||||
{
|
{
|
||||||
archives.push_back(filename);
|
archives.push_back(filename);
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef FreeCaller1<const char*, loadArchiveFile> LoadArchiveFileCaller;
|
typedef FreeCaller1<const char*, loadArchiveFile> LoadArchiveFileCaller;
|
||||||
|
|
||||||
void LoadTextureFile(const char* filename)
|
void LoadTextureFile(const char* filename)
|
||||||
{
|
{
|
||||||
std::string s_filename = filename;
|
std::string s_filename = filename;
|
||||||
|
|
||||||
char buffer[256];
|
char buffer[256];
|
||||||
strcpy(buffer, "textures/");
|
strcpy(buffer, "textures/");
|
||||||
|
|
||||||
// append filename without trailing file extension (.tga or .jpg for example)
|
// append filename without trailing file extension (.tga or .jpg for example)
|
||||||
strncat(buffer, filename, s_filename.length() - 4);
|
strncat(buffer, filename, s_filename.length() - 4);
|
||||||
|
|
||||||
std::set<std::string>::iterator iter;
|
std::set<std::string>::iterator iter;
|
||||||
iter = shaders.find(buffer);
|
iter = shaders.find(buffer);
|
||||||
|
|
||||||
// a shader with this name already exists
|
// a shader with this name already exists
|
||||||
if(iter == shaders.end())
|
if(iter == shaders.end())
|
||||||
{
|
{
|
||||||
textures.insert(buffer);
|
textures.insert(buffer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef FreeCaller1<const char*, LoadTextureFile> LoadTextureFileCaller;
|
typedef FreeCaller1<const char*, LoadTextureFile> LoadTextureFileCaller;
|
||||||
|
|
||||||
void GetTextures(char* extension)
|
void GetTextures(char* extension)
|
||||||
{
|
{
|
||||||
GlobalFileSystem().forEachFile("textures/", extension, LoadTextureFileCaller(), 0);
|
GlobalFileSystem().forEachFile("textures/", extension, LoadTextureFileCaller(), 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LoadShaderList(const char* filename)
|
void LoadShaderList(const char* filename)
|
||||||
{
|
{
|
||||||
if(string_equal_prefix(filename, "textures/"))
|
if(string_equal_prefix(filename, "textures/"))
|
||||||
{
|
{
|
||||||
shaders.insert(filename);
|
shaders.insert(filename);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef FreeCaller1<const char*, LoadShaderList> LoadShaderListCaller;
|
typedef FreeCaller1<const char*, LoadShaderList> LoadShaderListCaller;
|
||||||
|
|
||||||
void GetAllShaders()
|
void GetAllShaders()
|
||||||
{
|
{
|
||||||
GlobalShaderSystem().foreachShaderName(LoadShaderListCaller());
|
GlobalShaderSystem().foreachShaderName(LoadShaderListCaller());
|
||||||
}
|
}
|
||||||
|
|
||||||
void GetArchiveList()
|
void GetArchiveList()
|
||||||
{
|
{
|
||||||
GlobalFileSystem().forEachArchive(LoadArchiveFileCaller());
|
GlobalFileSystem().forEachArchive(LoadArchiveFileCaller());
|
||||||
globalOutputStream() << "Shaderplug: " << (const Unsigned)Shaderplug::archives.size() << " archives found.\n";
|
globalOutputStream() << "Shaderplug: " << (const Unsigned)Shaderplug::archives.size() << " archives found.\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
void CreateTagFile()
|
void CreateTagFile()
|
||||||
{
|
{
|
||||||
const char* shader_type = GlobalRadiant().getGameDescriptionKeyValue("shaders");
|
const char* shader_type = GlobalRadiant().getGameDescriptionKeyValue("shaders");
|
||||||
|
|
||||||
GetAllShaders();
|
GetAllShaders();
|
||||||
globalOutputStream() << "Shaderplug: " << (const Unsigned)shaders.size() << " shaders found.\n";
|
globalOutputStream() << "Shaderplug: " << (const Unsigned)shaders.size() << " shaders found.\n";
|
||||||
|
|
||||||
if(string_equal(shader_type, "quake3"))
|
if(string_equal(shader_type, "quake3"))
|
||||||
{
|
{
|
||||||
GetTextures("jpg");
|
GetTextures("jpg");
|
||||||
GetTextures("tga");
|
GetTextures("tga");
|
||||||
GetTextures("png");
|
GetTextures("png");
|
||||||
|
|
||||||
globalOutputStream() << "Shaderplug: " << (const Unsigned)textures.size() << " textures found.\n";
|
globalOutputStream() << "Shaderplug: " << (const Unsigned)textures.size() << " textures found.\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
if(shaders.size() || textures.size() != 0)
|
if(shaders.size() || textures.size() != 0)
|
||||||
{
|
{
|
||||||
globalOutputStream() << "Shaderplug: Creating XML tag file.\n";
|
globalOutputStream() << "Shaderplug: Creating XML tag file.\n";
|
||||||
|
|
||||||
TagBuilder.CreateXmlDocument();
|
TagBuilder.CreateXmlDocument();
|
||||||
|
|
||||||
std::set<std::string>::reverse_iterator r_iter;
|
std::set<std::string>::reverse_iterator r_iter;
|
||||||
|
|
||||||
for(r_iter = textures.rbegin(); r_iter != textures.rend(); ++r_iter)
|
for(r_iter = textures.rbegin(); r_iter != textures.rend(); ++r_iter)
|
||||||
{
|
{
|
||||||
TagBuilder.AddShaderNode(const_cast<char*>((*r_iter).c_str()), STOCK, TEXTURE);
|
TagBuilder.AddShaderNode(const_cast<char*>((*r_iter).c_str()), STOCK, TEXTURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
for(r_iter = shaders.rbegin(); r_iter != shaders.rend(); ++r_iter)
|
for(r_iter = shaders.rbegin(); r_iter != shaders.rend(); ++r_iter)
|
||||||
{
|
{
|
||||||
TagBuilder.AddShaderNode(const_cast<char*>((*r_iter).c_str()), STOCK, SHADER);
|
TagBuilder.AddShaderNode(const_cast<char*>((*r_iter).c_str()), STOCK, SHADER);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get the tag file
|
// Get the tag file
|
||||||
StringOutputStream tagFileStream(256);
|
StringOutputStream tagFileStream(256);
|
||||||
tagFileStream << GlobalRadiant().getLocalRcPath() << SHADERTAG_FILE;
|
tagFileStream << GlobalRadiant().getLocalRcPath() << SHADERTAG_FILE;
|
||||||
char* tagFile = tagFileStream.c_str();
|
char* tagFile = tagFileStream.c_str();
|
||||||
|
|
||||||
char message[256];
|
char message[256];
|
||||||
strcpy(message, "Tag file saved to\n");
|
strcpy(message, "Tag file saved to\n");
|
||||||
strcat(message, tagFile);
|
strcat(message, tagFile);
|
||||||
strcat(message, "\nPlease restart Radiant now.\n");
|
strcat(message, "\nPlease restart Radiant now.\n");
|
||||||
|
|
||||||
if(file_exists(tagFile))
|
if(file_exists(tagFile))
|
||||||
{
|
{
|
||||||
EMessageBoxReturn result = GlobalRadiant().m_pfnMessageBox(GTK_WIDGET(g_window),
|
EMessageBoxReturn result = GlobalRadiant().m_pfnMessageBox(GTK_WIDGET(g_window),
|
||||||
"WARNING! A tag file already exists! Overwrite it?", "Overwrite tag file?",
|
"WARNING! A tag file already exists! Overwrite it?", "Overwrite tag file?",
|
||||||
eMB_NOYES,
|
eMB_NOYES,
|
||||||
eMB_ICONWARNING);
|
eMB_ICONWARNING);
|
||||||
|
|
||||||
if(result == eIDYES)
|
if(result == eIDYES)
|
||||||
{
|
{
|
||||||
TagBuilder.SaveXmlDoc(tagFile);
|
TagBuilder.SaveXmlDoc(tagFile);
|
||||||
GlobalRadiant().m_pfnMessageBox(GTK_WIDGET(g_window), message, "INFO", eMB_OK, eMB_ICONASTERISK);
|
GlobalRadiant().m_pfnMessageBox(GTK_WIDGET(g_window), message, "INFO", eMB_OK, eMB_ICONASTERISK);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
TagBuilder.SaveXmlDoc(tagFile);
|
TagBuilder.SaveXmlDoc(tagFile);
|
||||||
GlobalRadiant().m_pfnMessageBox(GTK_WIDGET(g_window), message, "INFO", eMB_OK, eMB_ICONASTERISK);
|
GlobalRadiant().m_pfnMessageBox(GTK_WIDGET(g_window), message, "INFO", eMB_OK, eMB_ICONASTERISK);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
GlobalRadiant().m_pfnMessageBox(GTK_WIDGET(g_window),
|
GlobalRadiant().m_pfnMessageBox(GTK_WIDGET(g_window),
|
||||||
"No shaders or textures found. No XML tag file created!\n"
|
"No shaders or textures found. No XML tag file created!\n"
|
||||||
"",
|
"",
|
||||||
"ERROR",
|
"ERROR",
|
||||||
eMB_OK,
|
eMB_OK,
|
||||||
eMB_ICONERROR);
|
eMB_ICONERROR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
class ShaderPluginModule
|
class ShaderPluginModule
|
||||||
{
|
{
|
||||||
_QERPluginTable m_plugin;
|
_QERPluginTable m_plugin;
|
||||||
public:
|
public:
|
||||||
typedef _QERPluginTable Type;
|
typedef _QERPluginTable Type;
|
||||||
STRING_CONSTANT(Name, "ShaderPlug");
|
STRING_CONSTANT(Name, "ShaderPlug");
|
||||||
|
|
||||||
ShaderPluginModule()
|
ShaderPluginModule()
|
||||||
{
|
{
|
||||||
m_plugin.m_pfnQERPlug_Init = &Shaderplug::init;
|
m_plugin.m_pfnQERPlug_Init = &Shaderplug::init;
|
||||||
m_plugin.m_pfnQERPlug_GetName = &Shaderplug::getName;
|
m_plugin.m_pfnQERPlug_GetName = &Shaderplug::getName;
|
||||||
m_plugin.m_pfnQERPlug_GetCommandList = &Shaderplug::getCommandList;
|
m_plugin.m_pfnQERPlug_GetCommandList = &Shaderplug::getCommandList;
|
||||||
m_plugin.m_pfnQERPlug_GetCommandTitleList = &Shaderplug::getCommandTitleList;
|
m_plugin.m_pfnQERPlug_GetCommandTitleList = &Shaderplug::getCommandTitleList;
|
||||||
m_plugin.m_pfnQERPlug_Dispatch = &Shaderplug::dispatch;
|
m_plugin.m_pfnQERPlug_Dispatch = &Shaderplug::dispatch;
|
||||||
}
|
}
|
||||||
_QERPluginTable* getTable()
|
_QERPluginTable* getTable()
|
||||||
{
|
{
|
||||||
return &m_plugin;
|
return &m_plugin;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef SingletonModule<ShaderPluginModule, ShaderPlugPluginDependencies> SingletonShaderPluginModule;
|
typedef SingletonModule<ShaderPluginModule, ShaderPlugPluginDependencies> SingletonShaderPluginModule;
|
||||||
|
|
||||||
SingletonShaderPluginModule g_ShaderPluginModule;
|
SingletonShaderPluginModule g_ShaderPluginModule;
|
||||||
|
|
||||||
extern "C" void RADIANT_DLLEXPORT Radiant_RegisterModules(ModuleServer& server)
|
extern "C" void RADIANT_DLLEXPORT Radiant_RegisterModules(ModuleServer& server)
|
||||||
{
|
{
|
||||||
initialiseModule(server);
|
initialiseModule(server);
|
||||||
|
|
||||||
g_ShaderPluginModule.selfRegister();
|
g_ShaderPluginModule.selfRegister();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
; shaderplug.def : Declares the module parameters for the DLL.
|
; shaderplug.def : Declares the module parameters for the DLL.
|
||||||
|
|
||||||
LIBRARY "SHADERPLUG"
|
LIBRARY "SHADERPLUG"
|
||||||
|
|
||||||
EXPORTS
|
EXPORTS
|
||||||
; Explicit exports can go here
|
; Explicit exports can go here
|
||||||
Radiant_RegisterModules @1
|
Radiant_RegisterModules @1
|
||||||
|
|
|
||||||
|
|
@ -1,27 +1,27 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2006, Stefan Greven.
|
Copyright (C) 2006, Stefan Greven.
|
||||||
All Rights Reserved.
|
All Rights Reserved.
|
||||||
|
|
||||||
This file is part of GtkRadiant.
|
This file is part of GtkRadiant.
|
||||||
|
|
||||||
GtkRadiant is free software; you can redistribute it and/or modify
|
GtkRadiant is free software; you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation; either version 2 of the License, or
|
the Free Software Foundation; either version 2 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
GtkRadiant is distributed in the hope that it will be useful,
|
GtkRadiant is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with GtkRadiant; if not, write to the Free Software
|
along with GtkRadiant; if not, write to the Free Software
|
||||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if !defined(INCLUDED_SHADERPLUG_H)
|
#if !defined(INCLUDED_SHADERPLUG_H)
|
||||||
#define INCLUDED_SHADERPLUG_H
|
#define INCLUDED_SHADERPLUG_H
|
||||||
|
|
||||||
#include "xml/xmltextags.h"
|
#include "xml/xmltextags.h"
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -1,462 +1,462 @@
|
||||||
/*
|
/*
|
||||||
Sunplug plugin for GtkRadiant
|
Sunplug plugin for GtkRadiant
|
||||||
Copyright (C) 2004 Topsun
|
Copyright (C) 2004 Topsun
|
||||||
Thanks to SPoG for help!
|
Thanks to SPoG for help!
|
||||||
|
|
||||||
This library is free software; you can redistribute it and/or
|
This library is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU Lesser General Public
|
modify it under the terms of the GNU Lesser General Public
|
||||||
License as published by the Free Software Foundation; either
|
License as published by the Free Software Foundation; either
|
||||||
version 2.1 of the License, or (at your option) any later version.
|
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,
|
This library is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
Lesser General Public License for more details.
|
Lesser General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public
|
You should have received a copy of the GNU Lesser General Public
|
||||||
License along with this library; if not, write to the Free Software
|
License along with this library; if not, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "sunplug.h"
|
#include "sunplug.h"
|
||||||
|
|
||||||
#include "debugging/debugging.h"
|
#include "debugging/debugging.h"
|
||||||
|
|
||||||
#include "iplugin.h"
|
#include "iplugin.h"
|
||||||
|
|
||||||
#include "string/string.h"
|
#include "string/string.h"
|
||||||
#include "modulesystem/singletonmodule.h"
|
#include "modulesystem/singletonmodule.h"
|
||||||
|
|
||||||
#include "iundo.h" // declaration of undo system
|
#include "iundo.h" // declaration of undo system
|
||||||
#include "ientity.h" // declaration of entity system
|
#include "ientity.h" // declaration of entity system
|
||||||
#include "iscenegraph.h" // declaration of datastructure of the map
|
#include "iscenegraph.h" // declaration of datastructure of the map
|
||||||
|
|
||||||
#include "scenelib.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 "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
|
#include <gtk/gtk.h> // to display something with gtk (windows, buttons etc.), the whole package might not be necessary
|
||||||
|
|
||||||
void about_plugin_window();
|
void about_plugin_window();
|
||||||
void MapCoordinator();
|
void MapCoordinator();
|
||||||
|
|
||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
// linux itoa implementation
|
// linux itoa implementation
|
||||||
char* itoa( int value, char* result, int base )
|
char* itoa( int value, char* result, int base )
|
||||||
{
|
{
|
||||||
// check that the base if valid
|
// check that the base if valid
|
||||||
if (base < 2 || base > 16)
|
if (base < 2 || base > 16)
|
||||||
{
|
{
|
||||||
*result = 0;
|
*result = 0;
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
char* out = result;
|
char* out = result;
|
||||||
int quotient = value;
|
int quotient = value;
|
||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
*out = "0123456789abcdef"[abs(quotient % base)];
|
*out = "0123456789abcdef"[abs(quotient % base)];
|
||||||
++out;
|
++out;
|
||||||
|
|
||||||
quotient /= base;
|
quotient /= base;
|
||||||
} while (quotient);
|
} while (quotient);
|
||||||
|
|
||||||
// Only apply negative sign for base 10
|
// Only apply negative sign for base 10
|
||||||
if( value < 0 && base == 10)
|
if( value < 0 && base == 10)
|
||||||
*out++ = '-';
|
*out++ = '-';
|
||||||
|
|
||||||
std::reverse(result, out);
|
std::reverse(result, out);
|
||||||
|
|
||||||
*out = 0;
|
*out = 0;
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef struct _mapcoord_setting_packet {
|
typedef struct _mapcoord_setting_packet {
|
||||||
GtkSpinButton *spinner1, *spinner2, *spinner3, *spinner4;
|
GtkSpinButton *spinner1, *spinner2, *spinner3, *spinner4;
|
||||||
Entity* worldspawn;
|
Entity* worldspawn;
|
||||||
} mapcoord_setting_packet;
|
} mapcoord_setting_packet;
|
||||||
|
|
||||||
static int map_minX, map_maxX, map_minY, map_maxY;
|
static int map_minX, map_maxX, map_minY, map_maxY;
|
||||||
static int minX, maxX, minY, maxY;
|
static int minX, maxX, minY, maxY;
|
||||||
mapcoord_setting_packet msp;
|
mapcoord_setting_packet msp;
|
||||||
|
|
||||||
// **************************
|
// **************************
|
||||||
// ** find entities by class ** from radiant/map.cpp
|
// ** find entities by class ** from radiant/map.cpp
|
||||||
// **************************
|
// **************************
|
||||||
class EntityFindByClassname : public scene::Graph::Walker
|
class EntityFindByClassname : public scene::Graph::Walker
|
||||||
{
|
{
|
||||||
const char* m_name;
|
const char* m_name;
|
||||||
Entity*& m_entity;
|
Entity*& m_entity;
|
||||||
public:
|
public:
|
||||||
EntityFindByClassname(const char* name, Entity*& entity) : m_name(name), m_entity(entity)
|
EntityFindByClassname(const char* name, Entity*& entity) : m_name(name), m_entity(entity)
|
||||||
{
|
{
|
||||||
m_entity = 0;
|
m_entity = 0;
|
||||||
}
|
}
|
||||||
bool pre(const scene::Path& path, scene::Instance& instance) const
|
bool pre(const scene::Path& path, scene::Instance& instance) const
|
||||||
{
|
{
|
||||||
if(m_entity == 0)
|
if(m_entity == 0)
|
||||||
{
|
{
|
||||||
Entity* entity = Node_getEntity(path.top());
|
Entity* entity = Node_getEntity(path.top());
|
||||||
if(entity != 0
|
if(entity != 0
|
||||||
&& string_equal(m_name, entity->getKeyValue("classname")))
|
&& string_equal(m_name, entity->getKeyValue("classname")))
|
||||||
{
|
{
|
||||||
m_entity = entity;
|
m_entity = entity;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
Entity* Scene_FindEntityByClass(const char* name)
|
Entity* Scene_FindEntityByClass(const char* name)
|
||||||
{
|
{
|
||||||
Entity* entity;
|
Entity* entity;
|
||||||
GlobalSceneGraph().traverse(EntityFindByClassname(name, entity));
|
GlobalSceneGraph().traverse(EntityFindByClassname(name, entity));
|
||||||
return entity;
|
return entity;
|
||||||
}
|
}
|
||||||
|
|
||||||
// **************************
|
// **************************
|
||||||
// ** GTK callback functions **
|
// ** GTK callback functions **
|
||||||
// **************************
|
// **************************
|
||||||
|
|
||||||
static gboolean delete_event(GtkWidget *widget, GdkEvent *event, gpointer data)
|
static gboolean delete_event(GtkWidget *widget, GdkEvent *event, gpointer data)
|
||||||
{
|
{
|
||||||
/* If you return FALSE in the "delete_event" signal handler,
|
/* If you return FALSE in the "delete_event" signal handler,
|
||||||
* GTK will emit the "destroy" signal. Returning TRUE means
|
* GTK will emit the "destroy" signal. Returning TRUE means
|
||||||
* you don't want the window to be destroyed.
|
* you don't want the window to be destroyed.
|
||||||
* This is useful for popping up 'are you sure you want to quit?'
|
* This is useful for popping up 'are you sure you want to quit?'
|
||||||
* type dialogs. */
|
* type dialogs. */
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// destroy widget if destroy signal is passed to widget
|
// destroy widget if destroy signal is passed to widget
|
||||||
static void destroy(GtkWidget *widget, gpointer data)
|
static void destroy(GtkWidget *widget, gpointer data)
|
||||||
{
|
{
|
||||||
gtk_widget_destroy(widget);
|
gtk_widget_destroy(widget);
|
||||||
}
|
}
|
||||||
|
|
||||||
// function for close button to destroy the toplevel widget
|
// function for close button to destroy the toplevel widget
|
||||||
static void close_window(GtkWidget *widget, gpointer data)
|
static void close_window(GtkWidget *widget, gpointer data)
|
||||||
{
|
{
|
||||||
gtk_widget_destroy(gtk_widget_get_toplevel(widget));
|
gtk_widget_destroy(gtk_widget_get_toplevel(widget));
|
||||||
}
|
}
|
||||||
|
|
||||||
// callback function to assign the optimal mapcoords to the spinboxes
|
// callback function to assign the optimal mapcoords to the spinboxes
|
||||||
static void input_optimal(GtkWidget *widget, gpointer data)
|
static void input_optimal(GtkWidget *widget, gpointer data)
|
||||||
{
|
{
|
||||||
gtk_spin_button_set_value(msp.spinner1, minX);
|
gtk_spin_button_set_value(msp.spinner1, minX);
|
||||||
gtk_spin_button_set_value(msp.spinner2, maxY);
|
gtk_spin_button_set_value(msp.spinner2, maxY);
|
||||||
gtk_spin_button_set_value(msp.spinner3, maxX);
|
gtk_spin_button_set_value(msp.spinner3, maxX);
|
||||||
gtk_spin_button_set_value(msp.spinner4, minY);
|
gtk_spin_button_set_value(msp.spinner4, minY);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Spinner return value function
|
// Spinner return value function
|
||||||
gint grab_int_value(GtkSpinButton *a_spinner, gpointer user_data) {
|
gint grab_int_value(GtkSpinButton *a_spinner, gpointer user_data) {
|
||||||
return gtk_spin_button_get_value_as_int(a_spinner);
|
return gtk_spin_button_get_value_as_int(a_spinner);
|
||||||
}
|
}
|
||||||
|
|
||||||
// write the values of the Spinner-Boxes to the worldspawn
|
// write the values of the Spinner-Boxes to the worldspawn
|
||||||
static void set_coordinates(GtkWidget *widget, gpointer data)
|
static void set_coordinates(GtkWidget *widget, gpointer data)
|
||||||
{
|
{
|
||||||
//Str str_min, str_max;
|
//Str str_min, str_max;
|
||||||
char buffer[10], str_min[20], str_max[20];
|
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.spinner1), str_min, 10);
|
||||||
itoa(gtk_spin_button_get_value_as_int(msp.spinner2), buffer, 10);
|
itoa(gtk_spin_button_get_value_as_int(msp.spinner2), buffer, 10);
|
||||||
strcat(str_min, " ");
|
strcat(str_min, " ");
|
||||||
strcat(str_min, buffer);
|
strcat(str_min, buffer);
|
||||||
msp.worldspawn->setKeyValue("mapcoordsmins", str_min);
|
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.spinner3), str_max, 10);
|
||||||
itoa(gtk_spin_button_get_value_as_int(msp.spinner4), buffer, 10);
|
itoa(gtk_spin_button_get_value_as_int(msp.spinner4), buffer, 10);
|
||||||
strcat(str_max, " ");
|
strcat(str_max, " ");
|
||||||
strcat(str_max, buffer);
|
strcat(str_max, buffer);
|
||||||
UndoableCommand undo("SunPlug.entitySetMapcoords");
|
UndoableCommand undo("SunPlug.entitySetMapcoords");
|
||||||
msp.worldspawn->setKeyValue("mapcoordsmaxs", str_max);
|
msp.worldspawn->setKeyValue("mapcoordsmaxs", str_max);
|
||||||
|
|
||||||
close_window(widget, NULL);
|
close_window(widget, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
class SunPlugPluginDependencies :
|
class SunPlugPluginDependencies :
|
||||||
public GlobalRadiantModuleRef, // basic class for all other module refs
|
public GlobalRadiantModuleRef, // basic class for all other module refs
|
||||||
public GlobalUndoModuleRef, // used to say radiant that something has changed and to undo that
|
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 GlobalSceneGraphModuleRef, // necessary to handle data in the mapfile (change, retrieve data)
|
||||||
public GlobalEntityModuleRef // to access and modify the entities
|
public GlobalEntityModuleRef // to access and modify the entities
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
SunPlugPluginDependencies() :
|
SunPlugPluginDependencies() :
|
||||||
GlobalEntityModuleRef(GlobalRadiant().getRequiredGameDescriptionKeyValue("entities"))//,
|
GlobalEntityModuleRef(GlobalRadiant().getRequiredGameDescriptionKeyValue("entities"))//,
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// *************************
|
// *************************
|
||||||
// ** standard plugin stuff **
|
// ** standard plugin stuff **
|
||||||
// *************************
|
// *************************
|
||||||
namespace SunPlug
|
namespace SunPlug
|
||||||
{
|
{
|
||||||
GtkWindow* main_window;
|
GtkWindow* main_window;
|
||||||
char MenuList[100] = "";
|
char MenuList[100] = "";
|
||||||
|
|
||||||
const char* init(void* hApp, void* pMainWidget)
|
const char* init(void* hApp, void* pMainWidget)
|
||||||
{
|
{
|
||||||
main_window = GTK_WINDOW(pMainWidget);
|
main_window = GTK_WINDOW(pMainWidget);
|
||||||
return "Initializing SunPlug for GTKRadiant";
|
return "Initializing SunPlug for GTKRadiant";
|
||||||
}
|
}
|
||||||
const char* getName()
|
const char* getName()
|
||||||
{
|
{
|
||||||
return "SunPlug"; // name that is shown in the menue
|
return "SunPlug"; // name that is shown in the menue
|
||||||
}
|
}
|
||||||
const char* getCommandList()
|
const char* getCommandList()
|
||||||
{
|
{
|
||||||
const char about[] = "About...";
|
const char about[] = "About...";
|
||||||
const char etMapCoordinator[] = ";ET-MapCoordinator";
|
const char etMapCoordinator[] = ";ET-MapCoordinator";
|
||||||
|
|
||||||
strcat(MenuList, about);
|
strcat(MenuList, about);
|
||||||
if (strncmp(GlobalRadiant().getGameName(), "etmain", 6) == 0) strcat(MenuList, etMapCoordinator);
|
if (strncmp(GlobalRadiant().getGameName(), "etmain", 6) == 0) strcat(MenuList, etMapCoordinator);
|
||||||
return (const char*)MenuList;
|
return (const char*)MenuList;
|
||||||
}
|
}
|
||||||
const char* getCommandTitleList()
|
const char* getCommandTitleList()
|
||||||
{
|
{
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
void dispatch(const char* command, float* vMin, float* vMax, bool bSingleBrush) // message processing
|
void dispatch(const char* command, float* vMin, float* vMax, bool bSingleBrush) // message processing
|
||||||
{
|
{
|
||||||
if(string_equal(command, "About..."))
|
if(string_equal(command, "About..."))
|
||||||
{
|
{
|
||||||
about_plugin_window();
|
about_plugin_window();
|
||||||
}
|
}
|
||||||
if(string_equal(command, "ET-MapCoordinator"))
|
if(string_equal(command, "ET-MapCoordinator"))
|
||||||
{
|
{
|
||||||
MapCoordinator();
|
MapCoordinator();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
class SunPlugModule : public TypeSystemRef
|
class SunPlugModule : public TypeSystemRef
|
||||||
{
|
{
|
||||||
_QERPluginTable m_plugin;
|
_QERPluginTable m_plugin;
|
||||||
public:
|
public:
|
||||||
typedef _QERPluginTable Type;
|
typedef _QERPluginTable Type;
|
||||||
STRING_CONSTANT(Name, "SunPlug");
|
STRING_CONSTANT(Name, "SunPlug");
|
||||||
|
|
||||||
SunPlugModule()
|
SunPlugModule()
|
||||||
{
|
{
|
||||||
m_plugin.m_pfnQERPlug_Init = &SunPlug::init;
|
m_plugin.m_pfnQERPlug_Init = &SunPlug::init;
|
||||||
m_plugin.m_pfnQERPlug_GetName = &SunPlug::getName;
|
m_plugin.m_pfnQERPlug_GetName = &SunPlug::getName;
|
||||||
m_plugin.m_pfnQERPlug_GetCommandList = &SunPlug::getCommandList;
|
m_plugin.m_pfnQERPlug_GetCommandList = &SunPlug::getCommandList;
|
||||||
m_plugin.m_pfnQERPlug_GetCommandTitleList = &SunPlug::getCommandTitleList;
|
m_plugin.m_pfnQERPlug_GetCommandTitleList = &SunPlug::getCommandTitleList;
|
||||||
m_plugin.m_pfnQERPlug_Dispatch = &SunPlug::dispatch;
|
m_plugin.m_pfnQERPlug_Dispatch = &SunPlug::dispatch;
|
||||||
}
|
}
|
||||||
_QERPluginTable* getTable()
|
_QERPluginTable* getTable()
|
||||||
{
|
{
|
||||||
return &m_plugin;
|
return &m_plugin;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef SingletonModule<SunPlugModule, SunPlugPluginDependencies> SingletonSunPlugModule;
|
typedef SingletonModule<SunPlugModule, SunPlugPluginDependencies> SingletonSunPlugModule;
|
||||||
|
|
||||||
SingletonSunPlugModule g_SunPlugModule;
|
SingletonSunPlugModule g_SunPlugModule;
|
||||||
|
|
||||||
|
|
||||||
extern "C" void RADIANT_DLLEXPORT Radiant_RegisterModules(ModuleServer& server)
|
extern "C" void RADIANT_DLLEXPORT Radiant_RegisterModules(ModuleServer& server)
|
||||||
{
|
{
|
||||||
initialiseModule(server);
|
initialiseModule(server);
|
||||||
|
|
||||||
g_SunPlugModule.selfRegister();
|
g_SunPlugModule.selfRegister();
|
||||||
}
|
}
|
||||||
|
|
||||||
// ************
|
// ************
|
||||||
// ** my stuff **
|
// ** my stuff **
|
||||||
// ************
|
// ************
|
||||||
|
|
||||||
// About dialog
|
// About dialog
|
||||||
void about_plugin_window()
|
void about_plugin_window()
|
||||||
{
|
{
|
||||||
GtkWidget *window, *vbox, *label, *button;
|
GtkWidget *window, *vbox, *label, *button;
|
||||||
|
|
||||||
window = gtk_window_new(GTK_WINDOW_TOPLEVEL); // create a window
|
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
|
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), "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
|
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_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_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_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
|
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
|
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
|
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
|
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_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
|
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
|
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
|
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_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_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
|
gtk_widget_show_all(window); // show the window and all subelements
|
||||||
}
|
}
|
||||||
|
|
||||||
// get the current bounding box and return the optimal coordinates
|
// get the current bounding box and return the optimal coordinates
|
||||||
void GetOptimalCoordinates(AABB *levelBoundingBox)
|
void GetOptimalCoordinates(AABB *levelBoundingBox)
|
||||||
{
|
{
|
||||||
int half_width, half_heigth, center_x, center_y;
|
int half_width, half_heigth, center_x, center_y;
|
||||||
|
|
||||||
half_width = levelBoundingBox->extents.x();
|
half_width = levelBoundingBox->extents.x();
|
||||||
half_heigth = levelBoundingBox->extents.y();
|
half_heigth = levelBoundingBox->extents.y();
|
||||||
center_x = levelBoundingBox->origin.x();
|
center_x = levelBoundingBox->origin.x();
|
||||||
center_y = levelBoundingBox->origin.y();
|
center_y = levelBoundingBox->origin.y();
|
||||||
|
|
||||||
if (half_width > 175 || half_heigth > 175) // the square must be at least 350x350 units
|
if (half_width > 175 || half_heigth > 175) // the square must be at least 350x350 units
|
||||||
{
|
{
|
||||||
// the wider side is the indicator for the square
|
// the wider side is the indicator for the square
|
||||||
if (half_width >= half_heigth)
|
if (half_width >= half_heigth)
|
||||||
{
|
{
|
||||||
minX = center_x - half_width;
|
minX = center_x - half_width;
|
||||||
maxX = center_x + half_width;
|
maxX = center_x + half_width;
|
||||||
minY = center_y - half_width;
|
minY = center_y - half_width;
|
||||||
maxY = center_y + half_width;
|
maxY = center_y + half_width;
|
||||||
} else {
|
} else {
|
||||||
minX = center_x - half_heigth;
|
minX = center_x - half_heigth;
|
||||||
maxX = center_x + half_heigth;
|
maxX = center_x + half_heigth;
|
||||||
minY = center_y - half_heigth;
|
minY = center_y - half_heigth;
|
||||||
maxY = center_y + half_heigth;
|
maxY = center_y + half_heigth;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
minX = center_x - 175;
|
minX = center_x - 175;
|
||||||
maxX = center_x + 175;
|
maxX = center_x + 175;
|
||||||
minY = center_y - 175;
|
minY = center_y - 175;
|
||||||
maxY = center_y + 175;
|
maxY = center_y + 175;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// MapCoordinator dialog window
|
// MapCoordinator dialog window
|
||||||
void MapCoordinator()
|
void MapCoordinator()
|
||||||
{
|
{
|
||||||
GtkWidget *window, *vbox, *table, *label, *spinnerMinX, *spinnerMinY, *spinnerMaxX, *spinnerMaxY, *button;
|
GtkWidget *window, *vbox, *table, *label, *spinnerMinX, *spinnerMinY, *spinnerMaxX, *spinnerMaxY, *button;
|
||||||
GtkAdjustment *spinner_adj_MinX, *spinner_adj_MinY, *spinner_adj_MaxX, *spinner_adj_MaxY;
|
GtkAdjustment *spinner_adj_MinX, *spinner_adj_MinY, *spinner_adj_MaxX, *spinner_adj_MaxY;
|
||||||
Entity *theWorldspawn = NULL;
|
Entity *theWorldspawn = NULL;
|
||||||
const char *buffer;
|
const char *buffer;
|
||||||
char line[20];
|
char line[20];
|
||||||
|
|
||||||
// in any case we need a window to show the user what to do
|
// in any case we need a window to show the user what to do
|
||||||
window = gtk_window_new(GTK_WINDOW_TOPLEVEL); // create the window
|
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
|
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), "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
|
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_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_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_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
|
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
|
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
|
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::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
|
scene::Instance* instance = GlobalSceneGraph().find(path); // find the instance to the given path
|
||||||
AABB levelBoundingBox = instance->worldAABB(); // get the bounding box of the level
|
AABB levelBoundingBox = instance->worldAABB(); // get the bounding box of the level
|
||||||
|
|
||||||
theWorldspawn = Scene_FindEntityByClass("worldspawn"); // find the entity worldspawn
|
theWorldspawn = Scene_FindEntityByClass("worldspawn"); // find the entity worldspawn
|
||||||
if (theWorldspawn != 0) { // need to have a worldspawn otherwise setting a value crashes the radiant
|
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
|
// next two if's: get the current values of the mapcoords
|
||||||
buffer = theWorldspawn->getKeyValue("mapcoordsmins"); // upper left corner
|
buffer = theWorldspawn->getKeyValue("mapcoordsmins"); // upper left corner
|
||||||
if (strlen(buffer) > 0) {
|
if (strlen(buffer) > 0) {
|
||||||
strncpy(line, buffer, 19);
|
strncpy(line, buffer, 19);
|
||||||
map_minX = atoi(strtok(line, " ")); // minimum of x value
|
map_minX = atoi(strtok(line, " ")); // minimum of x value
|
||||||
map_minY = atoi(strtok(NULL, " ")); // maximum of y value
|
map_minY = atoi(strtok(NULL, " ")); // maximum of y value
|
||||||
} else {
|
} else {
|
||||||
map_minX = 0;
|
map_minX = 0;
|
||||||
map_minY = 0;
|
map_minY = 0;
|
||||||
}
|
}
|
||||||
buffer = theWorldspawn->getKeyValue("mapcoordsmaxs"); // lower right corner
|
buffer = theWorldspawn->getKeyValue("mapcoordsmaxs"); // lower right corner
|
||||||
if (strlen(buffer) > 0) {
|
if (strlen(buffer) > 0) {
|
||||||
strncpy(line, buffer, 19);
|
strncpy(line, buffer, 19);
|
||||||
map_maxX = atoi(strtok(line, " ")); // maximum of x value
|
map_maxX = atoi(strtok(line, " ")); // maximum of x value
|
||||||
map_maxY = atoi(strtok(NULL, " ")); // minimum of y value
|
map_maxY = atoi(strtok(NULL, " ")); // minimum of y value
|
||||||
} else {
|
} else {
|
||||||
map_maxX = 0;
|
map_maxX = 0;
|
||||||
map_maxY = 0;
|
map_maxY = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
globalOutputStream() << "SunPlug: calculating optimal coordinates\n"; // write to console that we are calculating the coordinates
|
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
|
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 mapcoordsmins=" << minX << " " << maxY << "\n"; // console info about mapcoordsmins
|
||||||
globalOutputStream() << "SunPlug: adviced mapcoordsmaxs=" << maxX << " " << minY << "\n"; // console info about mapcoordsmaxs
|
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_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_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_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
|
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
|
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
|
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), 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
|
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
|
table = gtk_table_new(4, 3, TRUE); // create table
|
||||||
gtk_table_set_row_spacings(GTK_TABLE(table), 8); // set row spacings
|
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_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
|
gtk_box_pack_start(GTK_BOX(vbox), table, FALSE, FALSE, 2); // insert table into vbox
|
||||||
|
|
||||||
label = gtk_label_new("x"); // create label
|
label = gtk_label_new("x"); // create label
|
||||||
gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_LEFT); // align text to the left side
|
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
|
gtk_table_attach_defaults(GTK_TABLE(table), label, 1, 2, 0, 1); // insert label into table
|
||||||
|
|
||||||
label = gtk_label_new("y"); // create label
|
label = gtk_label_new("y"); // create label
|
||||||
gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_LEFT); // align text to the left side
|
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
|
gtk_table_attach_defaults(GTK_TABLE(table), label, 2, 3, 0, 1); // insert label into table
|
||||||
|
|
||||||
label = gtk_label_new("mapcoordsmins"); // create label
|
label = gtk_label_new("mapcoordsmins"); // create label
|
||||||
gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_LEFT); // align text to the left side
|
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
|
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
|
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
|
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
|
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
|
gtk_table_attach_defaults(GTK_TABLE(table), spinnerMinY, 2, 3, 1, 2); // insert spinbox into table
|
||||||
|
|
||||||
label = gtk_label_new("mapcoordsmaxs"); // create label
|
label = gtk_label_new("mapcoordsmaxs"); // create label
|
||||||
gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_LEFT); // align text to the left side
|
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
|
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
|
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
|
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
|
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
|
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
|
// put the references to the spinboxes and the worldspawn into the global exchange
|
||||||
msp.spinner1 = GTK_SPIN_BUTTON(spinnerMinX);
|
msp.spinner1 = GTK_SPIN_BUTTON(spinnerMinX);
|
||||||
msp.spinner2 = GTK_SPIN_BUTTON(spinnerMinY);
|
msp.spinner2 = GTK_SPIN_BUTTON(spinnerMinY);
|
||||||
msp.spinner3 = GTK_SPIN_BUTTON(spinnerMaxX);
|
msp.spinner3 = GTK_SPIN_BUTTON(spinnerMaxX);
|
||||||
msp.spinner4 = GTK_SPIN_BUTTON(spinnerMaxY);
|
msp.spinner4 = GTK_SPIN_BUTTON(spinnerMaxY);
|
||||||
msp.worldspawn = theWorldspawn;
|
msp.worldspawn = theWorldspawn;
|
||||||
|
|
||||||
button = gtk_button_new_with_label("Set"); // create button with text
|
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
|
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
|
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
|
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
|
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
|
gtk_table_attach_defaults(GTK_TABLE(table), button, 2, 3, 3, 4); // insert button into table
|
||||||
} else {
|
} else {
|
||||||
globalOutputStream() << "SunPlug: no worldspawn found!\n"; // output error to console
|
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
|
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_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
|
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
|
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
|
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_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_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER); // center the window
|
||||||
gtk_widget_show_all(window); // show the window and all subelements
|
gtk_widget_show_all(window); // show the window and all subelements
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
; sunplug.def : Declares the module parameters for the DLL.
|
; sunplug.def : Declares the module parameters for the DLL.
|
||||||
|
|
||||||
LIBRARY "SUNPLUG"
|
LIBRARY "SUNPLUG"
|
||||||
|
|
||||||
EXPORTS
|
EXPORTS
|
||||||
; Explicit exports can go here
|
; Explicit exports can go here
|
||||||
Radiant_RegisterModules @1
|
Radiant_RegisterModules @1
|
||||||
|
|
|
||||||
|
|
@ -1,25 +1,25 @@
|
||||||
/*
|
/*
|
||||||
Sunplug plugin for GtkRadiant
|
Sunplug plugin for GtkRadiant
|
||||||
Copyright (C) 2004 Topsun
|
Copyright (C) 2004 Topsun
|
||||||
Thanks to SPoG for help!
|
Thanks to SPoG for help!
|
||||||
|
|
||||||
This library is free software; you can redistribute it and/or
|
This library is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU Lesser General Public
|
modify it under the terms of the GNU Lesser General Public
|
||||||
License as published by the Free Software Foundation; either
|
License as published by the Free Software Foundation; either
|
||||||
version 2.1 of the License, or (at your option) any later version.
|
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,
|
This library is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
Lesser General Public License for more details.
|
Lesser General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public
|
You should have received a copy of the GNU Lesser General Public
|
||||||
License along with this library; if not, write to the Free Software
|
License along with this library; if not, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _PLUGIN_SUNPLUG_
|
#ifndef _PLUGIN_SUNPLUG_
|
||||||
#define _PLUGIN_SUNPLUG_
|
#define _PLUGIN_SUNPLUG_
|
||||||
|
|
||||||
|
|
||||||
#endif // _PLUGIN_SUNPLUG_
|
#endif // _PLUGIN_SUNPLUG_
|
||||||
|
|
|
||||||
|
|
@ -1,40 +1,40 @@
|
||||||
# Copyright (C) 2001-2006 William Joseph.
|
# Copyright (C) 2001-2006 William Joseph.
|
||||||
# For a list of contributors, see the accompanying CONTRIBUTORS file.
|
# For a list of contributors, see the accompanying CONTRIBUTORS file.
|
||||||
#
|
#
|
||||||
# This file is part of GtkRadiant.
|
# This file is part of GtkRadiant.
|
||||||
#
|
#
|
||||||
# GtkRadiant is free software; you can redistribute it and/or modify
|
# GtkRadiant is free software; you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
# the Free Software Foundation; either version 2 of the License, or
|
# the Free Software Foundation; either version 2 of the License, or
|
||||||
# (at your option) any later version.
|
# (at your option) any later version.
|
||||||
#
|
#
|
||||||
# GtkRadiant is distributed in the hope that it will be useful,
|
# GtkRadiant is distributed in the hope that it will be useful,
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with GtkRadiant; if not, write to the Free Software
|
# along with GtkRadiant; if not, write to the Free Software
|
||||||
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
def svnAddText(filename):
|
def svnAddText(filename):
|
||||||
os.system("svn add " + filename);
|
os.system("svn add " + filename);
|
||||||
os.system("svn ps svn:eol-style native " + filename);
|
os.system("svn ps svn:eol-style native " + filename);
|
||||||
|
|
||||||
def createCPPTemplate(filename, name):
|
def createCPPTemplate(filename, name):
|
||||||
file = open(filename, "wt")
|
file = open(filename, "wt")
|
||||||
file.write("\n")
|
file.write("\n")
|
||||||
file.write("#include \"" + name + ".h\"\n")
|
file.write("#include \"" + name + ".h\"\n")
|
||||||
file.write("\n")
|
file.write("\n")
|
||||||
file.close()
|
file.close()
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
name = sys.argv[1]
|
name = sys.argv[1]
|
||||||
location = sys.argv[2]
|
location = sys.argv[2]
|
||||||
filename = os.path.join(location, name + ".cpp")
|
filename = os.path.join(location, name + ".cpp")
|
||||||
createCPPTemplate(filename, name)
|
createCPPTemplate(filename, name)
|
||||||
svnAddText(filename)
|
svnAddText(filename)
|
||||||
|
|
|
||||||
82
generic_h.py
82
generic_h.py
|
|
@ -1,41 +1,41 @@
|
||||||
# Copyright (C) 2001-2006 William Joseph.
|
# Copyright (C) 2001-2006 William Joseph.
|
||||||
# For a list of contributors, see the accompanying CONTRIBUTORS file.
|
# For a list of contributors, see the accompanying CONTRIBUTORS file.
|
||||||
#
|
#
|
||||||
# This file is part of GtkRadiant.
|
# This file is part of GtkRadiant.
|
||||||
#
|
#
|
||||||
# GtkRadiant is free software; you can redistribute it and/or modify
|
# GtkRadiant is free software; you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
# the Free Software Foundation; either version 2 of the License, or
|
# the Free Software Foundation; either version 2 of the License, or
|
||||||
# (at your option) any later version.
|
# (at your option) any later version.
|
||||||
#
|
#
|
||||||
# GtkRadiant is distributed in the hope that it will be useful,
|
# GtkRadiant is distributed in the hope that it will be useful,
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with GtkRadiant; if not, write to the Free Software
|
# along with GtkRadiant; if not, write to the Free Software
|
||||||
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
def svnAddText(filename):
|
def svnAddText(filename):
|
||||||
os.system("svn add " + filename);
|
os.system("svn add " + filename);
|
||||||
os.system("svn ps svn:eol-style native " + filename);
|
os.system("svn ps svn:eol-style native " + filename);
|
||||||
|
|
||||||
def createHeaderTemplate(filename, name):
|
def createHeaderTemplate(filename, name):
|
||||||
file = open(filename, "wt")
|
file = open(filename, "wt")
|
||||||
file.write("\n")
|
file.write("\n")
|
||||||
file.write("#if !defined(_INCLUDED_" + name.upper() + "_H_)\n")
|
file.write("#if !defined(_INCLUDED_" + name.upper() + "_H_)\n")
|
||||||
file.write("#define _INCLUDED_" + name.upper() + "_H_\n")
|
file.write("#define _INCLUDED_" + name.upper() + "_H_\n")
|
||||||
file.write("\n")
|
file.write("\n")
|
||||||
file.write("#endif\n")
|
file.write("#endif\n")
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
name = sys.argv[1]
|
name = sys.argv[1]
|
||||||
location = sys.argv[2]
|
location = sys.argv[2]
|
||||||
filename = os.path.join(location, name + ".h")
|
filename = os.path.join(location, name + ".h")
|
||||||
createHeaderTemplate(filename, name)
|
createHeaderTemplate(filename, name)
|
||||||
svnAddText(filename)
|
svnAddText(filename)
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,3 @@
|
||||||
*.dsp -m 'COPY' -k 'b'
|
*.dsp -m 'COPY' -k 'b'
|
||||||
*.dsw -m 'COPY' -k 'b'
|
*.dsw -m 'COPY' -k 'b'
|
||||||
*.scc -m 'COPY' -k 'b'
|
*.scc -m 'COPY' -k 'b'
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,3 @@
|
||||||
*.dsp -m 'COPY' -k 'b'
|
*.dsp -m 'COPY' -k 'b'
|
||||||
*.dsw -m 'COPY' -k 'b'
|
*.dsw -m 'COPY' -k 'b'
|
||||||
*.scc -m 'COPY' -k 'b'
|
*.scc -m 'COPY' -k 'b'
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,106 +1,106 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2006, Stefan Greven.
|
Copyright (C) 2006, Stefan Greven.
|
||||||
All Rights Reserved.
|
All Rights Reserved.
|
||||||
|
|
||||||
This file is part of GtkRadiant.
|
This file is part of GtkRadiant.
|
||||||
|
|
||||||
GtkRadiant is free software; you can redistribute it and/or modify
|
GtkRadiant is free software; you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation; either version 2 of the License, or
|
the Free Software Foundation; either version 2 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
GtkRadiant is distributed in the hope that it will be useful,
|
GtkRadiant is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with GtkRadiant; if not, write to the Free Software
|
along with GtkRadiant; if not, write to the Free Software
|
||||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if !defined(INCLUDED_XMLTEXTAGS_H)
|
#if !defined(INCLUDED_XMLTEXTAGS_H)
|
||||||
#define INCLUDED_XMLTEXTAGS_H
|
#define INCLUDED_XMLTEXTAGS_H
|
||||||
|
|
||||||
#include <set>
|
#include <set>
|
||||||
#include <string/string.h>
|
#include <string/string.h>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "iscriplib.h"
|
#include "iscriplib.h"
|
||||||
|
|
||||||
#include <libxml/xpath.h>
|
#include <libxml/xpath.h>
|
||||||
#include <libxml/xmlwriter.h>
|
#include <libxml/xmlwriter.h>
|
||||||
|
|
||||||
enum NodeTagType
|
enum NodeTagType
|
||||||
{
|
{
|
||||||
TAG,
|
TAG,
|
||||||
EMPTY
|
EMPTY
|
||||||
};
|
};
|
||||||
|
|
||||||
enum NodeShaderType
|
enum NodeShaderType
|
||||||
{
|
{
|
||||||
SHADER,
|
SHADER,
|
||||||
TEXTURE
|
TEXTURE
|
||||||
};
|
};
|
||||||
|
|
||||||
enum TextureType
|
enum TextureType
|
||||||
{
|
{
|
||||||
STOCK,
|
STOCK,
|
||||||
CUSTOM
|
CUSTOM
|
||||||
};
|
};
|
||||||
|
|
||||||
class XmlTagBuilder
|
class XmlTagBuilder
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
CopiedString m_savefilename;
|
CopiedString m_savefilename;
|
||||||
xmlDocPtr doc;
|
xmlDocPtr doc;
|
||||||
xmlXPathContextPtr context;
|
xmlXPathContextPtr context;
|
||||||
xmlNodeSetPtr nodePtr;
|
xmlNodeSetPtr nodePtr;
|
||||||
|
|
||||||
xmlXPathObjectPtr XpathEval(const char* queryString)
|
xmlXPathObjectPtr XpathEval(const char* queryString)
|
||||||
{
|
{
|
||||||
xmlChar* expression = (xmlChar*)queryString;
|
xmlChar* expression = (xmlChar*)queryString;
|
||||||
xmlXPathObjectPtr result = xmlXPathEvalExpression(expression, context);
|
xmlXPathObjectPtr result = xmlXPathEvalExpression(expression, context);
|
||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
|
|
||||||
char* GetTagsXpathExpression(char* buffer, const char* shader, NodeTagType nodeTagType)
|
char* GetTagsXpathExpression(char* buffer, const char* shader, NodeTagType nodeTagType)
|
||||||
{
|
{
|
||||||
strcpy(buffer, "/root/*/*[@path='");
|
strcpy(buffer, "/root/*/*[@path='");
|
||||||
strcat(buffer, shader);
|
strcat(buffer, shader);
|
||||||
|
|
||||||
switch(nodeTagType)
|
switch(nodeTagType)
|
||||||
{
|
{
|
||||||
case TAG:
|
case TAG:
|
||||||
strcat(buffer, "']/tag");
|
strcat(buffer, "']/tag");
|
||||||
break;
|
break;
|
||||||
case EMPTY:
|
case EMPTY:
|
||||||
strcat(buffer, "']");
|
strcat(buffer, "']");
|
||||||
};
|
};
|
||||||
|
|
||||||
return buffer;
|
return buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
XmlTagBuilder();
|
XmlTagBuilder();
|
||||||
~XmlTagBuilder();
|
~XmlTagBuilder();
|
||||||
|
|
||||||
bool CreateXmlDocument();
|
bool CreateXmlDocument();
|
||||||
bool OpenXmlDoc(const char* file, const char* savefile = 0);
|
bool OpenXmlDoc(const char* file, const char* savefile = 0);
|
||||||
bool SaveXmlDoc(const char* file);
|
bool SaveXmlDoc(const char* file);
|
||||||
bool SaveXmlDoc(void);
|
bool SaveXmlDoc(void);
|
||||||
bool AddShaderNode(const char* shader, TextureType textureType, NodeShaderType nodeShaderType);
|
bool AddShaderNode(const char* shader, TextureType textureType, NodeShaderType nodeShaderType);
|
||||||
bool DeleteShaderNode(const char* shader);
|
bool DeleteShaderNode(const char* shader);
|
||||||
bool CheckShaderTag(const char* shader);
|
bool CheckShaderTag(const char* shader);
|
||||||
bool CheckShaderTag(const char* shader, const char* content);
|
bool CheckShaderTag(const char* shader, const char* content);
|
||||||
bool AddShaderTag(const char* shader, const char* content, NodeTagType nodeTagType);
|
bool AddShaderTag(const char* shader, const char* content, NodeTagType nodeTagType);
|
||||||
bool DeleteTag(const char* tag);
|
bool DeleteTag(const char* tag);
|
||||||
int RenameShaderTag(const char* oldtag, CopiedString newtag);
|
int RenameShaderTag(const char* oldtag, CopiedString newtag);
|
||||||
bool DeleteShaderTag(const char* shader, const char* tag);
|
bool DeleteShaderTag(const char* shader, const char* tag);
|
||||||
void GetShaderTags(const char* shader, std::vector<CopiedString>& tags);
|
void GetShaderTags(const char* shader, std::vector<CopiedString>& tags);
|
||||||
void GetUntagged(std::set<CopiedString>& shaders);
|
void GetUntagged(std::set<CopiedString>& shaders);
|
||||||
void GetAllTags(std::set<CopiedString>& tags);
|
void GetAllTags(std::set<CopiedString>& tags);
|
||||||
void TagSearch(const char* expression, std::set<CopiedString>& paths);
|
void TagSearch(const char* expression, std::set<CopiedString>& paths);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -1,17 +1,17 @@
|
||||||
common/areaportal
|
common/areaportal
|
||||||
common/clip
|
common/clip
|
||||||
common/clusterportal
|
common/clusterportal
|
||||||
common/cushion
|
common/cushion
|
||||||
common/donotenter
|
common/donotenter
|
||||||
common/full_clip
|
common/full_clip
|
||||||
common/hint
|
common/hint
|
||||||
common/missileclip
|
common/missileclip
|
||||||
common/nodraw
|
common/nodraw
|
||||||
common/nodrawnonsolid
|
common/nodrawnonsolid
|
||||||
common/nodrop
|
common/nodrop
|
||||||
common/noimpact
|
common/noimpact
|
||||||
common/origin
|
common/origin
|
||||||
common/trigger
|
common/trigger
|
||||||
common/weapclip
|
common/weapclip
|
||||||
liquid
|
liquid
|
||||||
fog
|
fog
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
base_support/support1rust
|
base_support/support1rust
|
||||||
base_support/support1shiny
|
base_support/support1shiny
|
||||||
base_support/support2rust
|
base_support/support2rust
|
||||||
base_support/wplat1_1
|
base_support/wplat1_1
|
||||||
base_support/plate2_5
|
base_support/plate2_5
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
base_door/shinymetaldoor
|
base_door/shinymetaldoor
|
||||||
base_door/shinymetaldoor_outside
|
base_door/shinymetaldoor_outside
|
||||||
gothic_door/door02_bred
|
gothic_door/door02_bred
|
||||||
gothic_door/door02_bred2_shiny
|
gothic_door/door02_bred2_shiny
|
||||||
gothic_door/door02_eblue2_shiny
|
gothic_door/door02_eblue2_shiny
|
||||||
gothic_door/door02_i_ornate5_fin
|
gothic_door/door02_i_ornate5_fin
|
||||||
gothic_door/door02_j
|
gothic_door/door02_j
|
||||||
gothic_door/door02_j3
|
gothic_door/door02_j3
|
||||||
gothic_door/door02_j4
|
gothic_door/door02_j4
|
||||||
gothic_door/door02_k2b
|
gothic_door/door02_k2b
|
||||||
|
|
@ -1,14 +1,14 @@
|
||||||
{
|
{
|
||||||
"entity" "misc_model"
|
"entity" "misc_model"
|
||||||
|
|
||||||
"offset" "-16"
|
"offset" "-16"
|
||||||
|
|
||||||
"model" "models/mapobjects/trees_sd/tree_a.md3"
|
"model" "models/mapobjects/trees_sd/tree_a.md3"
|
||||||
"model" "models/mapobjects/trees_sd/tree_b.md3"
|
"model" "models/mapobjects/trees_sd/tree_b.md3"
|
||||||
"model" "models/mapobjects/trees_sd/tree_c.md3"
|
"model" "models/mapobjects/trees_sd/tree_c.md3"
|
||||||
"model" "models/mapobjects/trees_sd/tree_d.md3"
|
"model" "models/mapobjects/trees_sd/tree_d.md3"
|
||||||
|
|
||||||
"pitch" "-5" "5"
|
"pitch" "-5" "5"
|
||||||
"yaw" "0" "360"
|
"yaw" "0" "360"
|
||||||
"scale" "1" "1.3"
|
"scale" "1" "1.3"
|
||||||
}
|
}
|
||||||
|
|
@ -1,115 +1,115 @@
|
||||||
//Microsoft Developer Studio generated resource script.
|
//Microsoft Developer Studio generated resource script.
|
||||||
//
|
//
|
||||||
#include "resource.h"
|
#include "resource.h"
|
||||||
|
|
||||||
#define APSTUDIO_READONLY_SYMBOLS
|
#define APSTUDIO_READONLY_SYMBOLS
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// Generated from the TEXTINCLUDE 2 resource.
|
// Generated from the TEXTINCLUDE 2 resource.
|
||||||
//
|
//
|
||||||
#include "afxres.h"
|
#include "afxres.h"
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
#undef APSTUDIO_READONLY_SYMBOLS
|
#undef APSTUDIO_READONLY_SYMBOLS
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// English (U.S.) resources
|
// English (U.S.) resources
|
||||||
|
|
||||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
|
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
||||||
#pragma code_page(1252)
|
#pragma code_page(1252)
|
||||||
#endif //_WIN32
|
#endif //_WIN32
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// Icon
|
// Icon
|
||||||
//
|
//
|
||||||
|
|
||||||
// Icon with lowest ID value placed first to ensure application icon
|
// Icon with lowest ID value placed first to ensure application icon
|
||||||
// remains consistent on all systems.
|
// remains consistent on all systems.
|
||||||
IDI_ICON1 ICON DISCARDABLE "icon1.ico"
|
IDI_ICON1 ICON DISCARDABLE "icon1.ico"
|
||||||
|
|
||||||
#ifdef APSTUDIO_INVOKED
|
#ifdef APSTUDIO_INVOKED
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// TEXTINCLUDE
|
// TEXTINCLUDE
|
||||||
//
|
//
|
||||||
|
|
||||||
1 TEXTINCLUDE DISCARDABLE
|
1 TEXTINCLUDE DISCARDABLE
|
||||||
BEGIN
|
BEGIN
|
||||||
"resource.h\0"
|
"resource.h\0"
|
||||||
END
|
END
|
||||||
|
|
||||||
2 TEXTINCLUDE DISCARDABLE
|
2 TEXTINCLUDE DISCARDABLE
|
||||||
BEGIN
|
BEGIN
|
||||||
"#include ""afxres.h""\r\n"
|
"#include ""afxres.h""\r\n"
|
||||||
"\0"
|
"\0"
|
||||||
END
|
END
|
||||||
|
|
||||||
3 TEXTINCLUDE DISCARDABLE
|
3 TEXTINCLUDE DISCARDABLE
|
||||||
BEGIN
|
BEGIN
|
||||||
"\r\n"
|
"\r\n"
|
||||||
"\0"
|
"\0"
|
||||||
END
|
END
|
||||||
|
|
||||||
#endif // APSTUDIO_INVOKED
|
#endif // APSTUDIO_INVOKED
|
||||||
|
|
||||||
|
|
||||||
#ifndef _MAC
|
#ifndef _MAC
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// Version
|
// Version
|
||||||
//
|
//
|
||||||
|
|
||||||
VS_VERSION_INFO VERSIONINFO
|
VS_VERSION_INFO VERSIONINFO
|
||||||
FILEVERSION 1,0,0,1
|
FILEVERSION 1,0,0,1
|
||||||
PRODUCTVERSION 1,0,0,1
|
PRODUCTVERSION 1,0,0,1
|
||||||
FILEFLAGSMASK 0x3fL
|
FILEFLAGSMASK 0x3fL
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
FILEFLAGS 0x1L
|
FILEFLAGS 0x1L
|
||||||
#else
|
#else
|
||||||
FILEFLAGS 0x0L
|
FILEFLAGS 0x0L
|
||||||
#endif
|
#endif
|
||||||
FILEOS 0x40004L
|
FILEOS 0x40004L
|
||||||
FILETYPE 0x1L
|
FILETYPE 0x1L
|
||||||
FILESUBTYPE 0x0L
|
FILESUBTYPE 0x0L
|
||||||
BEGIN
|
BEGIN
|
||||||
BLOCK "StringFileInfo"
|
BLOCK "StringFileInfo"
|
||||||
BEGIN
|
BEGIN
|
||||||
BLOCK "040904b0"
|
BLOCK "040904b0"
|
||||||
BEGIN
|
BEGIN
|
||||||
VALUE "Comments", "Heavily modified from original ID tool\0"
|
VALUE "Comments", "Heavily modified from original ID tool\0"
|
||||||
VALUE "CompanyName", "Raven Software\0"
|
VALUE "CompanyName", "Raven Software\0"
|
||||||
VALUE "FileDescription", "qdata\0"
|
VALUE "FileDescription", "qdata\0"
|
||||||
VALUE "FileVersion", "2.0\0"
|
VALUE "FileVersion", "2.0\0"
|
||||||
VALUE "InternalName", "qdata\0"
|
VALUE "InternalName", "qdata\0"
|
||||||
VALUE "LegalCopyright", "Copyright © 1998\0"
|
VALUE "LegalCopyright", "Copyright © 1998\0"
|
||||||
VALUE "OriginalFilename", "qdata.exe\0"
|
VALUE "OriginalFilename", "qdata.exe\0"
|
||||||
VALUE "ProductName", "Raven Software qdata\0"
|
VALUE "ProductName", "Raven Software qdata\0"
|
||||||
VALUE "ProductVersion", "2.0\0"
|
VALUE "ProductVersion", "2.0\0"
|
||||||
END
|
END
|
||||||
END
|
END
|
||||||
BLOCK "VarFileInfo"
|
BLOCK "VarFileInfo"
|
||||||
BEGIN
|
BEGIN
|
||||||
VALUE "Translation", 0x409, 1200
|
VALUE "Translation", 0x409, 1200
|
||||||
END
|
END
|
||||||
END
|
END
|
||||||
|
|
||||||
#endif // !_MAC
|
#endif // !_MAC
|
||||||
|
|
||||||
#endif // English (U.S.) resources
|
#endif // English (U.S.) resources
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef APSTUDIO_INVOKED
|
#ifndef APSTUDIO_INVOKED
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// Generated from the TEXTINCLUDE 3 resource.
|
// Generated from the TEXTINCLUDE 3 resource.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
#endif // not APSTUDIO_INVOKED
|
#endif // not APSTUDIO_INVOKED
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,150 +1,150 @@
|
||||||
/* -------------------------------------------------------------------------------
|
/* -------------------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (C) 1999-2006 Id Software, Inc. and contributors.
|
Copyright (C) 1999-2006 Id Software, Inc. and contributors.
|
||||||
For a list of contributors, see the accompanying CONTRIBUTORS file.
|
For a list of contributors, see the accompanying CONTRIBUTORS file.
|
||||||
|
|
||||||
This file is part of GtkRadiant.
|
This file is part of GtkRadiant.
|
||||||
|
|
||||||
GtkRadiant is free software; you can redistribute it and/or modify
|
GtkRadiant is free software; you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation; either version 2 of the License, or
|
the Free Software Foundation; either version 2 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
GtkRadiant is distributed in the hope that it will be useful,
|
GtkRadiant is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with GtkRadiant; if not, write to the Free Software
|
along with GtkRadiant; if not, write to the Free Software
|
||||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
----------------------------------------------------------------------------------
|
----------------------------------------------------------------------------------
|
||||||
|
|
||||||
This code has been altered significantly from its original form, to support
|
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."
|
several games based on the Quake III Arena engine, in the form of "Q3Map2."
|
||||||
|
|
||||||
------------------------------------------------------------------------------- */
|
------------------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* marker */
|
/* marker */
|
||||||
#ifndef GAME_DARKPLACES_H
|
#ifndef GAME_DARKPLACES_H
|
||||||
#define GAME_DARKPLACES_H
|
#define GAME_DARKPLACES_H
|
||||||
|
|
||||||
/* content and surface flags get form quake3 */
|
/* content and surface flags get form quake3 */
|
||||||
|
|
||||||
/* -------------------------------------------------------------------------------
|
/* -------------------------------------------------------------------------------
|
||||||
|
|
||||||
game_t struct
|
game_t struct
|
||||||
|
|
||||||
------------------------------------------------------------------------------- */
|
------------------------------------------------------------------------------- */
|
||||||
|
|
||||||
{
|
{
|
||||||
"darkplaces", /* -game x */
|
"darkplaces", /* -game x */
|
||||||
"id1", /* default base game data dir */
|
"id1", /* default base game data dir */
|
||||||
".darkplaces ", /* unix home sub-dir */
|
".darkplaces ", /* unix home sub-dir */
|
||||||
"darkplaces", /* magic path word */
|
"darkplaces", /* magic path word */
|
||||||
"scripts", /* shader directory */
|
"scripts", /* shader directory */
|
||||||
999, /* max lightmapped surface verts */
|
999, /* max lightmapped surface verts */
|
||||||
999, /* max surface verts */
|
999, /* max surface verts */
|
||||||
6000, /* max surface indexes */
|
6000, /* max surface indexes */
|
||||||
qfalse, /* flares */
|
qfalse, /* flares */
|
||||||
"flareshader", /* default flare shader */
|
"flareshader", /* default flare shader */
|
||||||
qfalse, /* wolf lighting model? */
|
qfalse, /* wolf lighting model? */
|
||||||
128, /* lightmap width/height */
|
128, /* lightmap width/height */
|
||||||
1.0f, /* lightmap gamma */
|
1.0f, /* lightmap gamma */
|
||||||
200.0f, /* lightmap exposure */
|
200.0f, /* lightmap exposure */
|
||||||
1.0f, /* lightmap compensate */
|
1.0f, /* lightmap compensate */
|
||||||
0.3f, /* lightgrid scale */
|
0.3f, /* lightgrid scale */
|
||||||
0.6f, /* lightgrid ambient scale */
|
0.6f, /* lightgrid ambient scale */
|
||||||
qfalse, /* light angle attenuation uses half-lambert curve */
|
qfalse, /* light angle attenuation uses half-lambert curve */
|
||||||
qtrue, /* disable shader lightstyles hack */
|
qtrue, /* disable shader lightstyles hack */
|
||||||
qtrue, /* keep light entities on bsp */
|
qtrue, /* keep light entities on bsp */
|
||||||
4, /* default patchMeta subdivisions tolerance */
|
4, /* default patchMeta subdivisions tolerance */
|
||||||
qfalse, /* patch casting enabled */
|
qfalse, /* patch casting enabled */
|
||||||
qfalse, /* compile deluxemaps */
|
qfalse, /* compile deluxemaps */
|
||||||
0, /* deluxemaps default mode */
|
0, /* deluxemaps default mode */
|
||||||
512, /* minimap size */
|
512, /* minimap size */
|
||||||
1.0f, /* minimap sharpener */
|
1.0f, /* minimap sharpener */
|
||||||
0.0f, /* minimap border */
|
0.0f, /* minimap border */
|
||||||
qtrue, /* minimap keep aspect */
|
qtrue, /* minimap keep aspect */
|
||||||
MINIMAP_MODE_GRAY, /* minimap mode */
|
MINIMAP_MODE_GRAY, /* minimap mode */
|
||||||
"%s.tga", /* minimap name format */
|
"%s.tga", /* minimap name format */
|
||||||
"IBSP", /* bsp file prefix */
|
"IBSP", /* bsp file prefix */
|
||||||
46, /* bsp file version */
|
46, /* bsp file version */
|
||||||
qfalse, /* cod-style lump len/ofs order */
|
qfalse, /* cod-style lump len/ofs order */
|
||||||
LoadIBSPFile, /* bsp load function */
|
LoadIBSPFile, /* bsp load function */
|
||||||
WriteIBSPFile, /* bsp write function */
|
WriteIBSPFile, /* bsp write function */
|
||||||
|
|
||||||
{
|
{
|
||||||
/* name contentFlags contentFlagsClear surfaceFlags surfaceFlagsClear compileFlags compileFlagsClear */
|
/* name contentFlags contentFlagsClear surfaceFlags surfaceFlagsClear compileFlags compileFlagsClear */
|
||||||
|
|
||||||
/* default */
|
/* default */
|
||||||
{ "default", Q_CONT_SOLID, -1, 0, -1, C_SOLID, -1 },
|
{ "default", Q_CONT_SOLID, -1, 0, -1, C_SOLID, -1 },
|
||||||
|
|
||||||
|
|
||||||
/* ydnar */
|
/* ydnar */
|
||||||
{ "lightgrid", 0, 0, 0, 0, C_LIGHTGRID, 0 },
|
{ "lightgrid", 0, 0, 0, 0, C_LIGHTGRID, 0 },
|
||||||
{ "antiportal", 0, 0, 0, 0, C_ANTIPORTAL, 0 },
|
{ "antiportal", 0, 0, 0, 0, C_ANTIPORTAL, 0 },
|
||||||
{ "skip", 0, 0, 0, 0, C_SKIP, 0 },
|
{ "skip", 0, 0, 0, 0, C_SKIP, 0 },
|
||||||
|
|
||||||
|
|
||||||
/* compiler */
|
/* compiler */
|
||||||
{ "origin", Q_CONT_ORIGIN, Q_CONT_SOLID, 0, 0, C_ORIGIN | C_TRANSLUCENT, C_SOLID },
|
{ "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 },
|
{ "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 },
|
{ "trans", Q_CONT_TRANSLUCENT, 0, 0, 0, C_TRANSLUCENT, 0 },
|
||||||
{ "detail", Q_CONT_DETAIL, 0, 0, 0, C_DETAIL, 0 },
|
{ "detail", Q_CONT_DETAIL, 0, 0, 0, C_DETAIL, 0 },
|
||||||
{ "structural", Q_CONT_STRUCTURAL, 0, 0, 0, C_STRUCTURAL, 0 },
|
{ "structural", Q_CONT_STRUCTURAL, 0, 0, 0, C_STRUCTURAL, 0 },
|
||||||
{ "hint", 0, 0, Q_SURF_HINT, 0, C_HINT, 0 },
|
{ "hint", 0, 0, Q_SURF_HINT, 0, C_HINT, 0 },
|
||||||
{ "nodraw", 0, 0, Q_SURF_NODRAW, 0, C_NODRAW, 0 },
|
{ "nodraw", 0, 0, Q_SURF_NODRAW, 0, C_NODRAW, 0 },
|
||||||
|
|
||||||
{ "alphashadow", 0, 0, Q_SURF_ALPHASHADOW, 0, C_ALPHASHADOW | C_TRANSLUCENT, 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 },
|
{ "lightfilter", 0, 0, Q_SURF_LIGHTFILTER, 0, C_LIGHTFILTER | C_TRANSLUCENT, 0 },
|
||||||
{ "nolightmap", 0, 0, Q_SURF_VERTEXLIT, 0, C_VERTEXLIT, 0 },
|
{ "nolightmap", 0, 0, Q_SURF_VERTEXLIT, 0, C_VERTEXLIT, 0 },
|
||||||
{ "pointlight", 0, 0, Q_SURF_VERTEXLIT, 0, C_VERTEXLIT, 0 },
|
{ "pointlight", 0, 0, Q_SURF_VERTEXLIT, 0, C_VERTEXLIT, 0 },
|
||||||
|
|
||||||
|
|
||||||
/* game */
|
/* game */
|
||||||
{ "nonsolid", 0, Q_CONT_SOLID, Q_SURF_NONSOLID, 0, 0, C_SOLID },
|
{ "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 },
|
{ "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 },
|
{ "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 },
|
{ "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 },
|
{ "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 },
|
{ "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 },
|
{ "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 },
|
{ "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 },
|
{ "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 },
|
{ "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 },
|
{ "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 },
|
{ "fog", Q_CONT_FOG, Q_CONT_SOLID, 0, 0, C_FOG, C_SOLID },
|
||||||
{ "sky", 0, 0, Q_SURF_SKY, 0, C_SKY, 0 },
|
{ "sky", 0, 0, Q_SURF_SKY, 0, C_SKY, 0 },
|
||||||
|
|
||||||
{ "slick", 0, 0, Q_SURF_SLICK, 0, 0, 0 },
|
{ "slick", 0, 0, Q_SURF_SLICK, 0, 0, 0 },
|
||||||
|
|
||||||
{ "noimpact", 0, 0, Q_SURF_NOIMPACT, 0, 0, 0 },
|
{ "noimpact", 0, 0, Q_SURF_NOIMPACT, 0, 0, 0 },
|
||||||
{ "nomarks", 0, 0, Q_SURF_NOMARKS, 0, C_NOMARKS, 0 },
|
{ "nomarks", 0, 0, Q_SURF_NOMARKS, 0, C_NOMARKS, 0 },
|
||||||
{ "ladder", 0, 0, Q_SURF_LADDER, 0, 0, 0 },
|
{ "ladder", 0, 0, Q_SURF_LADDER, 0, 0, 0 },
|
||||||
{ "nodamage", 0, 0, Q_SURF_NODAMAGE, 0, 0, 0 },
|
{ "nodamage", 0, 0, Q_SURF_NODAMAGE, 0, 0, 0 },
|
||||||
{ "metalsteps", 0, 0, Q_SURF_METALSTEPS, 0, 0, 0 },
|
{ "metalsteps", 0, 0, Q_SURF_METALSTEPS, 0, 0, 0 },
|
||||||
{ "flesh", 0, 0, Q_SURF_FLESH, 0, 0, 0 },
|
{ "flesh", 0, 0, Q_SURF_FLESH, 0, 0, 0 },
|
||||||
{ "nosteps", 0, 0, Q_SURF_NOSTEPS, 0, 0, 0 },
|
{ "nosteps", 0, 0, Q_SURF_NOSTEPS, 0, 0, 0 },
|
||||||
{ "nodlight", 0, 0, Q_SURF_NODLIGHT, 0, 0, 0 },
|
{ "nodlight", 0, 0, Q_SURF_NODLIGHT, 0, 0, 0 },
|
||||||
{ "dust", 0, 0, Q_SURF_DUST, 0, 0, 0 },
|
{ "dust", 0, 0, Q_SURF_DUST, 0, 0, 0 },
|
||||||
|
|
||||||
|
|
||||||
/* null */
|
/* null */
|
||||||
{ NULL, 0, 0, 0, 0, 0, 0 }
|
{ NULL, 0, 0, 0, 0, 0, 0 }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* end marker */
|
/* end marker */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,150 +1,150 @@
|
||||||
/* -------------------------------------------------------------------------------
|
/* -------------------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (C) 1999-2006 Id Software, Inc. and contributors.
|
Copyright (C) 1999-2006 Id Software, Inc. and contributors.
|
||||||
For a list of contributors, see the accompanying CONTRIBUTORS file.
|
For a list of contributors, see the accompanying CONTRIBUTORS file.
|
||||||
|
|
||||||
This file is part of GtkRadiant.
|
This file is part of GtkRadiant.
|
||||||
|
|
||||||
GtkRadiant is free software; you can redistribute it and/or modify
|
GtkRadiant is free software; you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation; either version 2 of the License, or
|
the Free Software Foundation; either version 2 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
GtkRadiant is distributed in the hope that it will be useful,
|
GtkRadiant is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with GtkRadiant; if not, write to the Free Software
|
along with GtkRadiant; if not, write to the Free Software
|
||||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
----------------------------------------------------------------------------------
|
----------------------------------------------------------------------------------
|
||||||
|
|
||||||
This code has been altered significantly from its original form, to support
|
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."
|
several games based on the Quake III Arena engine, in the form of "Q3Map2."
|
||||||
|
|
||||||
------------------------------------------------------------------------------- */
|
------------------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* marker */
|
/* marker */
|
||||||
#ifndef GAME_DQ_H
|
#ifndef GAME_DQ_H
|
||||||
#define GAME_DQ_H
|
#define GAME_DQ_H
|
||||||
|
|
||||||
/* content and surface flags get form quake3 */
|
/* content and surface flags get form quake3 */
|
||||||
|
|
||||||
/* -------------------------------------------------------------------------------
|
/* -------------------------------------------------------------------------------
|
||||||
|
|
||||||
game_t struct
|
game_t struct
|
||||||
|
|
||||||
------------------------------------------------------------------------------- */
|
------------------------------------------------------------------------------- */
|
||||||
|
|
||||||
{
|
{
|
||||||
"dq", /* -game x */
|
"dq", /* -game x */
|
||||||
"basedq", /* default base game data dir */
|
"basedq", /* default base game data dir */
|
||||||
".dq", /* unix home sub-dir */
|
".dq", /* unix home sub-dir */
|
||||||
"dq", /* magic path word */
|
"dq", /* magic path word */
|
||||||
"scripts", /* shader directory */
|
"scripts", /* shader directory */
|
||||||
64, /* max lightmapped surface verts */
|
64, /* max lightmapped surface verts */
|
||||||
999, /* max surface verts */
|
999, /* max surface verts */
|
||||||
6000, /* max surface indexes */
|
6000, /* max surface indexes */
|
||||||
qfalse, /* flares */
|
qfalse, /* flares */
|
||||||
"flareshader", /* default flare shader */
|
"flareshader", /* default flare shader */
|
||||||
qfalse, /* wolf lighting model? */
|
qfalse, /* wolf lighting model? */
|
||||||
128, /* lightmap width/height */
|
128, /* lightmap width/height */
|
||||||
1.2f, /* lightmap gamma */
|
1.2f, /* lightmap gamma */
|
||||||
200.0f, /* lightmap exposure */
|
200.0f, /* lightmap exposure */
|
||||||
1.0f, /* lightmap compensate */
|
1.0f, /* lightmap compensate */
|
||||||
0.3f, /* lightgrid scale */
|
0.3f, /* lightgrid scale */
|
||||||
0.6f, /* lightgrid ambient scale */
|
0.6f, /* lightgrid ambient scale */
|
||||||
qfalse, /* light angle attenuation uses half-lambert curve */
|
qfalse, /* light angle attenuation uses half-lambert curve */
|
||||||
qtrue, /* disable shader lightstyles hack */
|
qtrue, /* disable shader lightstyles hack */
|
||||||
qtrue, /* keep light entities on bsp */
|
qtrue, /* keep light entities on bsp */
|
||||||
4, /* default patchMeta subdivisions tolerance */
|
4, /* default patchMeta subdivisions tolerance */
|
||||||
qtrue, /* patch casting enabled */
|
qtrue, /* patch casting enabled */
|
||||||
qtrue, /* compile deluxemaps */
|
qtrue, /* compile deluxemaps */
|
||||||
1, /* deluxemaps default mode */
|
1, /* deluxemaps default mode */
|
||||||
512, /* minimap size */
|
512, /* minimap size */
|
||||||
1.0f, /* minimap sharpener */
|
1.0f, /* minimap sharpener */
|
||||||
0.0f, /* minimap border */
|
0.0f, /* minimap border */
|
||||||
qtrue, /* minimap keep aspect */
|
qtrue, /* minimap keep aspect */
|
||||||
MINIMAP_MODE_GRAY, /* minimap mode */
|
MINIMAP_MODE_GRAY, /* minimap mode */
|
||||||
"%s.tga", /* minimap name format */
|
"%s.tga", /* minimap name format */
|
||||||
"IBSP", /* bsp file prefix */
|
"IBSP", /* bsp file prefix */
|
||||||
46, /* bsp file version */
|
46, /* bsp file version */
|
||||||
qfalse, /* cod-style lump len/ofs order */
|
qfalse, /* cod-style lump len/ofs order */
|
||||||
LoadIBSPFile, /* bsp load function */
|
LoadIBSPFile, /* bsp load function */
|
||||||
WriteIBSPFile, /* bsp write function */
|
WriteIBSPFile, /* bsp write function */
|
||||||
|
|
||||||
{
|
{
|
||||||
/* name contentFlags contentFlagsClear surfaceFlags surfaceFlagsClear compileFlags compileFlagsClear */
|
/* name contentFlags contentFlagsClear surfaceFlags surfaceFlagsClear compileFlags compileFlagsClear */
|
||||||
|
|
||||||
/* default */
|
/* default */
|
||||||
{ "default", Q_CONT_SOLID, -1, 0, -1, C_SOLID, -1 },
|
{ "default", Q_CONT_SOLID, -1, 0, -1, C_SOLID, -1 },
|
||||||
|
|
||||||
|
|
||||||
/* ydnar */
|
/* ydnar */
|
||||||
{ "lightgrid", 0, 0, 0, 0, C_LIGHTGRID, 0 },
|
{ "lightgrid", 0, 0, 0, 0, C_LIGHTGRID, 0 },
|
||||||
{ "antiportal", 0, 0, 0, 0, C_ANTIPORTAL, 0 },
|
{ "antiportal", 0, 0, 0, 0, C_ANTIPORTAL, 0 },
|
||||||
{ "skip", 0, 0, 0, 0, C_SKIP, 0 },
|
{ "skip", 0, 0, 0, 0, C_SKIP, 0 },
|
||||||
|
|
||||||
|
|
||||||
/* compiler */
|
/* compiler */
|
||||||
{ "origin", Q_CONT_ORIGIN, Q_CONT_SOLID, 0, 0, C_ORIGIN | C_TRANSLUCENT, C_SOLID },
|
{ "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 },
|
{ "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 },
|
{ "trans", Q_CONT_TRANSLUCENT, 0, 0, 0, C_TRANSLUCENT, 0 },
|
||||||
{ "detail", Q_CONT_DETAIL, 0, 0, 0, C_DETAIL, 0 },
|
{ "detail", Q_CONT_DETAIL, 0, 0, 0, C_DETAIL, 0 },
|
||||||
{ "structural", Q_CONT_STRUCTURAL, 0, 0, 0, C_STRUCTURAL, 0 },
|
{ "structural", Q_CONT_STRUCTURAL, 0, 0, 0, C_STRUCTURAL, 0 },
|
||||||
{ "hint", 0, 0, Q_SURF_HINT, 0, C_HINT, 0 },
|
{ "hint", 0, 0, Q_SURF_HINT, 0, C_HINT, 0 },
|
||||||
{ "nodraw", 0, 0, Q_SURF_NODRAW, 0, C_NODRAW, 0 },
|
{ "nodraw", 0, 0, Q_SURF_NODRAW, 0, C_NODRAW, 0 },
|
||||||
|
|
||||||
{ "alphashadow", 0, 0, Q_SURF_ALPHASHADOW, 0, C_ALPHASHADOW | C_TRANSLUCENT, 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 },
|
{ "lightfilter", 0, 0, Q_SURF_LIGHTFILTER, 0, C_LIGHTFILTER | C_TRANSLUCENT, 0 },
|
||||||
{ "nolightmap", 0, 0, Q_SURF_VERTEXLIT, 0, C_VERTEXLIT, 0 },
|
{ "nolightmap", 0, 0, Q_SURF_VERTEXLIT, 0, C_VERTEXLIT, 0 },
|
||||||
{ "pointlight", 0, 0, Q_SURF_VERTEXLIT, 0, C_VERTEXLIT, 0 },
|
{ "pointlight", 0, 0, Q_SURF_VERTEXLIT, 0, C_VERTEXLIT, 0 },
|
||||||
|
|
||||||
|
|
||||||
/* game */
|
/* game */
|
||||||
{ "nonsolid", 0, Q_CONT_SOLID, Q_SURF_NONSOLID, 0, 0, C_SOLID },
|
{ "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 },
|
{ "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 },
|
{ "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 },
|
{ "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 },
|
{ "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 },
|
{ "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 },
|
{ "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 },
|
{ "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 },
|
{ "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 },
|
{ "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 },
|
{ "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 },
|
{ "fog", Q_CONT_FOG, Q_CONT_SOLID, 0, 0, C_FOG, C_SOLID },
|
||||||
{ "sky", 0, 0, Q_SURF_SKY, 0, C_SKY, 0 },
|
{ "sky", 0, 0, Q_SURF_SKY, 0, C_SKY, 0 },
|
||||||
|
|
||||||
{ "slick", 0, 0, Q_SURF_SLICK, 0, 0, 0 },
|
{ "slick", 0, 0, Q_SURF_SLICK, 0, 0, 0 },
|
||||||
|
|
||||||
{ "noimpact", 0, 0, Q_SURF_NOIMPACT, 0, 0, 0 },
|
{ "noimpact", 0, 0, Q_SURF_NOIMPACT, 0, 0, 0 },
|
||||||
{ "nomarks", 0, 0, Q_SURF_NOMARKS, 0, C_NOMARKS, 0 },
|
{ "nomarks", 0, 0, Q_SURF_NOMARKS, 0, C_NOMARKS, 0 },
|
||||||
{ "ladder", 0, 0, Q_SURF_LADDER, 0, 0, 0 },
|
{ "ladder", 0, 0, Q_SURF_LADDER, 0, 0, 0 },
|
||||||
{ "nodamage", 0, 0, Q_SURF_NODAMAGE, 0, 0, 0 },
|
{ "nodamage", 0, 0, Q_SURF_NODAMAGE, 0, 0, 0 },
|
||||||
{ "metalsteps", 0, 0, Q_SURF_METALSTEPS, 0, 0, 0 },
|
{ "metalsteps", 0, 0, Q_SURF_METALSTEPS, 0, 0, 0 },
|
||||||
{ "flesh", 0, 0, Q_SURF_FLESH, 0, 0, 0 },
|
{ "flesh", 0, 0, Q_SURF_FLESH, 0, 0, 0 },
|
||||||
{ "nosteps", 0, 0, Q_SURF_NOSTEPS, 0, 0, 0 },
|
{ "nosteps", 0, 0, Q_SURF_NOSTEPS, 0, 0, 0 },
|
||||||
{ "nodlight", 0, 0, Q_SURF_NODLIGHT, 0, 0, 0 },
|
{ "nodlight", 0, 0, Q_SURF_NODLIGHT, 0, 0, 0 },
|
||||||
{ "dust", 0, 0, Q_SURF_DUST, 0, 0, 0 },
|
{ "dust", 0, 0, Q_SURF_DUST, 0, 0, 0 },
|
||||||
|
|
||||||
|
|
||||||
/* null */
|
/* null */
|
||||||
{ NULL, 0, 0, 0, 0, 0, 0 }
|
{ NULL, 0, 0, 0, 0, 0, 0 }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* end marker */
|
/* end marker */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,150 +1,150 @@
|
||||||
/* -------------------------------------------------------------------------------
|
/* -------------------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (C) 1999-2006 Id Software, Inc. and contributors.
|
Copyright (C) 1999-2006 Id Software, Inc. and contributors.
|
||||||
For a list of contributors, see the accompanying CONTRIBUTORS file.
|
For a list of contributors, see the accompanying CONTRIBUTORS file.
|
||||||
|
|
||||||
This file is part of GtkRadiant.
|
This file is part of GtkRadiant.
|
||||||
|
|
||||||
GtkRadiant is free software; you can redistribute it and/or modify
|
GtkRadiant is free software; you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation; either version 2 of the License, or
|
the Free Software Foundation; either version 2 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
GtkRadiant is distributed in the hope that it will be useful,
|
GtkRadiant is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with GtkRadiant; if not, write to the Free Software
|
along with GtkRadiant; if not, write to the Free Software
|
||||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
----------------------------------------------------------------------------------
|
----------------------------------------------------------------------------------
|
||||||
|
|
||||||
This code has been altered significantly from its original form, to support
|
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."
|
several games based on the Quake III Arena engine, in the form of "Q3Map2."
|
||||||
|
|
||||||
------------------------------------------------------------------------------- */
|
------------------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* marker */
|
/* marker */
|
||||||
#ifndef GAME_PROPHECY_H
|
#ifndef GAME_PROPHECY_H
|
||||||
#define GAME_PROPHECY_H
|
#define GAME_PROPHECY_H
|
||||||
|
|
||||||
/* content and surface flags get form quake3 */
|
/* content and surface flags get form quake3 */
|
||||||
|
|
||||||
/* -------------------------------------------------------------------------------
|
/* -------------------------------------------------------------------------------
|
||||||
|
|
||||||
game_t struct
|
game_t struct
|
||||||
|
|
||||||
------------------------------------------------------------------------------- */
|
------------------------------------------------------------------------------- */
|
||||||
|
|
||||||
{
|
{
|
||||||
"prophecy", /* -game x */
|
"prophecy", /* -game x */
|
||||||
"base", /* default base game data dir */
|
"base", /* default base game data dir */
|
||||||
".prophecy", /* unix home sub-dir */
|
".prophecy", /* unix home sub-dir */
|
||||||
"prophecy", /* magic path word */
|
"prophecy", /* magic path word */
|
||||||
"scripts", /* shader directory */
|
"scripts", /* shader directory */
|
||||||
64, /* max lightmapped surface verts */
|
64, /* max lightmapped surface verts */
|
||||||
999, /* max surface verts */
|
999, /* max surface verts */
|
||||||
6000, /* max surface indexes */
|
6000, /* max surface indexes */
|
||||||
qfalse, /* flares */
|
qfalse, /* flares */
|
||||||
"flareshader", /* default flare shader */
|
"flareshader", /* default flare shader */
|
||||||
qfalse, /* wolf lighting model? */
|
qfalse, /* wolf lighting model? */
|
||||||
128, /* lightmap width/height */
|
128, /* lightmap width/height */
|
||||||
1.0f, /* lightmap gamma */
|
1.0f, /* lightmap gamma */
|
||||||
200.0f, /* lightmap exposure */
|
200.0f, /* lightmap exposure */
|
||||||
1.0f, /* lightmap compensate */
|
1.0f, /* lightmap compensate */
|
||||||
0.4f, /* lightgrid scale */
|
0.4f, /* lightgrid scale */
|
||||||
0.6f, /* lightgrid ambient scale */
|
0.6f, /* lightgrid ambient scale */
|
||||||
qfalse, /* light angle attenuation uses half-lambert curve */
|
qfalse, /* light angle attenuation uses half-lambert curve */
|
||||||
qtrue, /* disable shader lightstyles hack */
|
qtrue, /* disable shader lightstyles hack */
|
||||||
qtrue, /* keep light entities on bsp */
|
qtrue, /* keep light entities on bsp */
|
||||||
4, /* default patchMeta subdivisions tolerance */
|
4, /* default patchMeta subdivisions tolerance */
|
||||||
qtrue, /* patch casting enabled */
|
qtrue, /* patch casting enabled */
|
||||||
qtrue, /* compile deluxemaps */
|
qtrue, /* compile deluxemaps */
|
||||||
0, /* deluxemaps default mode */
|
0, /* deluxemaps default mode */
|
||||||
512, /* minimap size */
|
512, /* minimap size */
|
||||||
1.0f, /* minimap sharpener */
|
1.0f, /* minimap sharpener */
|
||||||
0.0f, /* minimap border */
|
0.0f, /* minimap border */
|
||||||
qtrue, /* minimap keep aspect */
|
qtrue, /* minimap keep aspect */
|
||||||
MINIMAP_MODE_GRAY, /* minimap mode */
|
MINIMAP_MODE_GRAY, /* minimap mode */
|
||||||
"%s.tga", /* minimap name format */
|
"%s.tga", /* minimap name format */
|
||||||
"IBSP", /* bsp file prefix */
|
"IBSP", /* bsp file prefix */
|
||||||
46, /* bsp file version */
|
46, /* bsp file version */
|
||||||
qfalse, /* cod-style lump len/ofs order */
|
qfalse, /* cod-style lump len/ofs order */
|
||||||
LoadIBSPFile, /* bsp load function */
|
LoadIBSPFile, /* bsp load function */
|
||||||
WriteIBSPFile, /* bsp write function */
|
WriteIBSPFile, /* bsp write function */
|
||||||
|
|
||||||
{
|
{
|
||||||
/* name contentFlags contentFlagsClear surfaceFlags surfaceFlagsClear compileFlags compileFlagsClear */
|
/* name contentFlags contentFlagsClear surfaceFlags surfaceFlagsClear compileFlags compileFlagsClear */
|
||||||
|
|
||||||
/* default */
|
/* default */
|
||||||
{ "default", Q_CONT_SOLID, -1, 0, -1, C_SOLID, -1 },
|
{ "default", Q_CONT_SOLID, -1, 0, -1, C_SOLID, -1 },
|
||||||
|
|
||||||
|
|
||||||
/* ydnar */
|
/* ydnar */
|
||||||
{ "lightgrid", 0, 0, 0, 0, C_LIGHTGRID, 0 },
|
{ "lightgrid", 0, 0, 0, 0, C_LIGHTGRID, 0 },
|
||||||
{ "antiportal", 0, 0, 0, 0, C_ANTIPORTAL, 0 },
|
{ "antiportal", 0, 0, 0, 0, C_ANTIPORTAL, 0 },
|
||||||
{ "skip", 0, 0, 0, 0, C_SKIP, 0 },
|
{ "skip", 0, 0, 0, 0, C_SKIP, 0 },
|
||||||
|
|
||||||
|
|
||||||
/* compiler */
|
/* compiler */
|
||||||
{ "origin", Q_CONT_ORIGIN, Q_CONT_SOLID, 0, 0, C_ORIGIN | C_TRANSLUCENT, C_SOLID },
|
{ "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 },
|
{ "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 },
|
{ "trans", Q_CONT_TRANSLUCENT, 0, 0, 0, C_TRANSLUCENT, 0 },
|
||||||
{ "detail", Q_CONT_DETAIL, 0, 0, 0, C_DETAIL, 0 },
|
{ "detail", Q_CONT_DETAIL, 0, 0, 0, C_DETAIL, 0 },
|
||||||
{ "structural", Q_CONT_STRUCTURAL, 0, 0, 0, C_STRUCTURAL, 0 },
|
{ "structural", Q_CONT_STRUCTURAL, 0, 0, 0, C_STRUCTURAL, 0 },
|
||||||
{ "hint", 0, 0, Q_SURF_HINT, 0, C_HINT, 0 },
|
{ "hint", 0, 0, Q_SURF_HINT, 0, C_HINT, 0 },
|
||||||
{ "nodraw", 0, 0, Q_SURF_NODRAW, 0, C_NODRAW, 0 },
|
{ "nodraw", 0, 0, Q_SURF_NODRAW, 0, C_NODRAW, 0 },
|
||||||
|
|
||||||
{ "alphashadow", 0, 0, Q_SURF_ALPHASHADOW, 0, C_ALPHASHADOW | C_TRANSLUCENT, 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 },
|
{ "lightfilter", 0, 0, Q_SURF_LIGHTFILTER, 0, C_LIGHTFILTER | C_TRANSLUCENT, 0 },
|
||||||
{ "nolightmap", 0, 0, Q_SURF_VERTEXLIT, 0, C_VERTEXLIT, 0 },
|
{ "nolightmap", 0, 0, Q_SURF_VERTEXLIT, 0, C_VERTEXLIT, 0 },
|
||||||
{ "pointlight", 0, 0, Q_SURF_VERTEXLIT, 0, C_VERTEXLIT, 0 },
|
{ "pointlight", 0, 0, Q_SURF_VERTEXLIT, 0, C_VERTEXLIT, 0 },
|
||||||
|
|
||||||
|
|
||||||
/* game */
|
/* game */
|
||||||
{ "nonsolid", 0, Q_CONT_SOLID, Q_SURF_NONSOLID, 0, 0, C_SOLID },
|
{ "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 },
|
{ "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 },
|
{ "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 },
|
{ "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 },
|
{ "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 },
|
{ "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 },
|
{ "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 },
|
{ "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 },
|
{ "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 },
|
{ "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 },
|
{ "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 },
|
{ "fog", Q_CONT_FOG, Q_CONT_SOLID, 0, 0, C_FOG, C_SOLID },
|
||||||
{ "sky", 0, 0, Q_SURF_SKY, 0, C_SKY, 0 },
|
{ "sky", 0, 0, Q_SURF_SKY, 0, C_SKY, 0 },
|
||||||
|
|
||||||
{ "slick", 0, 0, Q_SURF_SLICK, 0, 0, 0 },
|
{ "slick", 0, 0, Q_SURF_SLICK, 0, 0, 0 },
|
||||||
|
|
||||||
{ "noimpact", 0, 0, Q_SURF_NOIMPACT, 0, 0, 0 },
|
{ "noimpact", 0, 0, Q_SURF_NOIMPACT, 0, 0, 0 },
|
||||||
{ "nomarks", 0, 0, Q_SURF_NOMARKS, 0, C_NOMARKS, 0 },
|
{ "nomarks", 0, 0, Q_SURF_NOMARKS, 0, C_NOMARKS, 0 },
|
||||||
{ "ladder", 0, 0, Q_SURF_LADDER, 0, 0, 0 },
|
{ "ladder", 0, 0, Q_SURF_LADDER, 0, 0, 0 },
|
||||||
{ "nodamage", 0, 0, Q_SURF_NODAMAGE, 0, 0, 0 },
|
{ "nodamage", 0, 0, Q_SURF_NODAMAGE, 0, 0, 0 },
|
||||||
{ "metalsteps", 0, 0, Q_SURF_METALSTEPS, 0, 0, 0 },
|
{ "metalsteps", 0, 0, Q_SURF_METALSTEPS, 0, 0, 0 },
|
||||||
{ "flesh", 0, 0, Q_SURF_FLESH, 0, 0, 0 },
|
{ "flesh", 0, 0, Q_SURF_FLESH, 0, 0, 0 },
|
||||||
{ "nosteps", 0, 0, Q_SURF_NOSTEPS, 0, 0, 0 },
|
{ "nosteps", 0, 0, Q_SURF_NOSTEPS, 0, 0, 0 },
|
||||||
{ "nodlight", 0, 0, Q_SURF_NODLIGHT, 0, 0, 0 },
|
{ "nodlight", 0, 0, Q_SURF_NODLIGHT, 0, 0, 0 },
|
||||||
{ "dust", 0, 0, Q_SURF_DUST, 0, 0, 0 },
|
{ "dust", 0, 0, Q_SURF_DUST, 0, 0, 0 },
|
||||||
|
|
||||||
|
|
||||||
/* null */
|
/* null */
|
||||||
{ NULL, 0, 0, 0, 0, 0, 0 }
|
{ NULL, 0, 0, 0, 0, 0, 0 }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* end marker */
|
/* end marker */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
101 ICON DISCARDABLE "q3map2.ico"
|
101 ICON DISCARDABLE "q3map2.ico"
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
Index: light.c
|
Index: light.c
|
||||||
===================================================================
|
===================================================================
|
||||||
--- light.c (revision 158)
|
--- light.c (revision 158)
|
||||||
+++ light.c (working copy)
|
+++ light.c (working copy)
|
||||||
@@ -357,12 +365,13 @@
|
@@ -357,12 +365,13 @@
|
||||||
intensity *= scale;
|
intensity *= scale;
|
||||||
|
|
||||||
/* ydnar: get deviance and samples */
|
/* ydnar: get deviance and samples */
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user