Revert "Kill off UFO plugins."

This reverts commit 75cc7d3a45.
This commit is contained in:
jdolan 2013-07-04 20:12:37 -04:00
parent 75cc7d3a45
commit 45b95af999
19 changed files with 3880 additions and 0 deletions

View File

@ -113,6 +113,7 @@ class Config:
'plugins/mapxml/mapxml.vcproj',
'plugins/shaders/shaders.vcproj',
'plugins/surface/surface.vcproj',
'plugins/surface_ufoai/surface_ufoai.vcproj',
'plugins/surface_quake2/surface_quake2.vcproj',
'plugins/surface_heretic2/surface_heretic2.vcproj',
'contrib/camera/camera.vcproj',
@ -120,6 +121,7 @@ class Config:
'contrib/hydratoolz/hydratoolz.vcproj',
'contrib/bobtoolz/bobtoolz.vcproj',
'contrib/gtkgensurf/gtkgensurf.vcproj',
'contrib/ufoai/ufoai.vcproj',
'contrib/bkgrnd2d/bkgrnd2d.vcproj'
]:
( libpath, libname ) = os.path.split( project )

271
contrib/ufoai/plugin.cpp Normal file
View File

@ -0,0 +1,271 @@
/*
Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
GtkRadiant is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
GtkRadiant is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GtkRadiant; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "plugin.h"
#include "ufoai_filters.h"
#define CMD_SEP "-"
#define CMD_ABOUT "About..."
// =============================================================================
// Globals
// function tables
_QERFuncTable_1 g_FuncTable;
_QERQglTable g_QglTable;
_QERFileSystemTable g_FileSystemTable;
_QEREntityTable g_EntityTable;
_QERAppDataTable g_DataTable;
// the gtk widget
void *g_pMainWidget;
// =============================================================================
// plugin implementation
#define PLUGIN_NAME "UFO:AI plugin"
#define PLUGIN_VERSION "0.1"
//backwards for some reason
static const char *PLUGIN_COMMANDS = CMD_ABOUT ";" CMD_SEP;
static const char *PLUGIN_ABOUT = _( "UFO: Alien Invasion plugin " PLUGIN_VERSION "\nby Martin Gerhardy" );
#define NUM_TOOLBAR_BUTTONS FILTER_MAX
typedef struct toolbar_button_info_s
{
const char *image;
const char *text;
const char *tip;
void ( *func )();
IToolbarButton::EType type;
} toolbar_button_info_t;
static const toolbar_button_info_t toolbar_buttons[NUM_TOOLBAR_BUTTONS] =
{
{
"ufoai_actorclip.bmp",
_( "Filter actorclip" ),
_( "Actorclip" ),
DoActorClipFiltering,
IToolbarButton::eToggleButton
},
{
"ufoai_weaponclip.bmp",
_( "Filter weaponclip" ),
_( "Weaponclip" ),
DoWeaponClipFiltering,
IToolbarButton::eToggleButton
},
{
"ufoai_nodraw.bmp",
_( "Filter nodraw" ),
_( "NoDraw" ),
DoNoDrawFiltering,
IToolbarButton::eToggleButton
},
{
"ufoai_stepon.bmp",
_( "Filter stepon" ),
_( "Stepon" ),
DoSteponFiltering,
IToolbarButton::eToggleButton
},
{
"ufoai_level1.bmp",
_( "Filter level1" ),
_( "Level 1" ),
DoLevel1Filtering,
IToolbarButton::eToggleButton
},
{
"ufoai_level2.bmp",
_( "Filter level2" ),
_( "Level 2" ),
DoLevel2Filtering,
IToolbarButton::eToggleButton
},
{
"ufoai_level3.bmp",
_( "Filter level3" ),
_( "Level 3" ),
DoLevel3Filtering,
IToolbarButton::eToggleButton
},
{
"ufoai_level4.bmp",
_( "Filter level4" ),
_( "Level 4" ),
DoLevel4Filtering,
IToolbarButton::eToggleButton
},
{
"ufoai_level5.bmp",
_( "Filter level5" ),
_( "Level 5" ),
DoLevel5Filtering,
IToolbarButton::eToggleButton
},
{
"ufoai_level6.bmp",
_( "Filter level6" ),
_( "Level 6" ),
DoLevel6Filtering,
IToolbarButton::eToggleButton
},
{
"ufoai_level7.bmp",
_( "Filter level7" ),
_( "Level 7" ),
DoLevel7Filtering,
IToolbarButton::eToggleButton
},
{
"ufoai_level8.bmp",
_( "Filter level8" ),
_( "Level 8" ),
DoLevel8Filtering,
IToolbarButton::eToggleButton
},
};
class UFOAIButton : public IToolbarButton
{
public:
const toolbar_button_info_s *bi;
virtual const char* getImage() const {
return bi->image;
}
virtual const char* getText() const {
return bi->text;
}
virtual const char* getTooltip() const {
return bi->tip;
}
virtual void activate() const {
bi->func();
return ;
}
virtual EType getType() const {
return bi->type;
}
};
UFOAIButton g_ufoaibuttons[NUM_TOOLBAR_BUTTONS];
unsigned int ToolbarButtonCount( void ){
return NUM_TOOLBAR_BUTTONS;
}
const IToolbarButton* GetToolbarButton( unsigned int index ){
g_ufoaibuttons[index].bi = &toolbar_buttons[index];
return &g_ufoaibuttons[index];
}
extern "C" const char* QERPlug_Init( void *hApp, void* pMainWidget ){
g_pMainWidget = pMainWidget;
UFOAIFilterInit();
return PLUGIN_NAME;
}
extern "C" const char* QERPlug_GetName( void ){
return (char *) PLUGIN_NAME;
}
extern "C" const char* QERPlug_GetCommandList( void ){
return (char *) PLUGIN_COMMANDS;
}
extern "C" void QERPlug_Dispatch( const char *p, vec3_t vMin, vec3_t vMax, bool bSingleBrush ){
if ( !strcmp( p, CMD_ABOUT ) ) {
g_FuncTable.m_pfnMessageBox( NULL, PLUGIN_ABOUT, _( "About" ), MB_OK, NULL );
}
else {
Sys_Printf( "Message: %s\n", p );
}
}
// =============================================================================
// SYNAPSE
CSynapseServer* g_pSynapseServer = NULL;
CSynapseClientUFOAI g_SynapseClient;
#if __GNUC__ >= 4
#pragma GCC visibility push(default)
#endif
extern "C" CSynapseClient * SYNAPSE_DLL_EXPORT Synapse_EnumerateInterfaces( const char *version, CSynapseServer *pServer ){
#if __GNUC__ >= 4
#pragma GCC visibility pop
#endif
if ( strcmp( version, SYNAPSE_VERSION ) ) {
Syn_Printf( "ERROR: synapse API version mismatch: should be '" SYNAPSE_VERSION "', got '%s'\n", version );
return NULL;
}
g_pSynapseServer = pServer;
g_pSynapseServer->IncRef();
Set_Syn_Printf( g_pSynapseServer->Get_Syn_Printf() );
g_SynapseClient.AddAPI( TOOLBAR_MAJOR, UFOAI_MINOR, sizeof( _QERPlugToolbarTable ) );
g_SynapseClient.AddAPI( PLUGIN_MAJOR, UFOAI_MINOR, sizeof( _QERPluginTable ) );
g_SynapseClient.AddAPI( RADIANT_MAJOR, NULL, sizeof( g_FuncTable ), SYN_REQUIRE, &g_FuncTable );
g_SynapseClient.AddAPI( QGL_MAJOR, NULL, sizeof( g_QglTable ), SYN_REQUIRE, &g_QglTable );
g_SynapseClient.AddAPI( VFS_MAJOR, "*", sizeof( g_FileSystemTable ), SYN_REQUIRE, &g_FileSystemTable );
// get worldspawn
g_SynapseClient.AddAPI( ENTITY_MAJOR, NULL, sizeof( g_EntityTable ), SYN_REQUIRE, &g_EntityTable );
// selected brushes
g_SynapseClient.AddAPI( DATA_MAJOR, NULL, sizeof( g_DataTable ), SYN_REQUIRE, &g_DataTable );
return &g_SynapseClient;
}
bool CSynapseClientUFOAI::RequestAPI( APIDescriptor_t *pAPI ){
if ( !strcmp( pAPI->major_name, PLUGIN_MAJOR ) ) {
_QERPluginTable* pTable = static_cast<_QERPluginTable*>( pAPI->mpTable );
pTable->m_pfnQERPlug_Init = QERPlug_Init;
pTable->m_pfnQERPlug_GetName = QERPlug_GetName;
pTable->m_pfnQERPlug_GetCommandList = QERPlug_GetCommandList;
pTable->m_pfnQERPlug_Dispatch = QERPlug_Dispatch;
return true;
}
else if ( !strcmp( pAPI->major_name, TOOLBAR_MAJOR ) ) {
_QERPlugToolbarTable* pTable = static_cast<_QERPlugToolbarTable*>( pAPI->mpTable );
pTable->m_pfnToolbarButtonCount = &ToolbarButtonCount;
pTable->m_pfnGetToolbarButton = &GetToolbarButton;
return true;
}
Syn_Printf( "ERROR: RequestAPI( '%s' ) not found in '%s'\n", pAPI->major_name, GetInfo() );
return false;
}
#include "version.h"
const char* CSynapseClientUFOAI::GetInfo(){
return PLUGIN_NAME " plugin built " __DATE__ " " RADIANT_VERSION;
}
const char* CSynapseClientUFOAI::GetName(){
return PLUGIN_NAME;
}

68
contrib/ufoai/plugin.h Normal file
View File

@ -0,0 +1,68 @@
/*
Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
GtkRadiant is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
GtkRadiant is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GtkRadiant; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef _PLUGIN_H_
#define _PLUGIN_H_
/*!
\todo need general notice about lib purpose etc.
and the external dependencies (such as GLib, STL, mathlib etc.)
*/
#include <stdio.h>
// for CPtrArray for idata.h
#include "missing.h"
#include "synapse.h"
#include "iplugin.h"
#include "itoolbar.h"
#define USE_QERTABLE_DEFINE
#include "qerplugin.h"
#include "igl.h"
#include "ifilesystem.h"
#include "ientity.h"
#include "idata.h"
#include <glib/gi18n.h>
extern _QERFuncTable_1 g_FuncTable;
extern _QERQglTable g_QglTable;
extern _QERFileSystemTable g_FileSystemTable;
extern _QEREntityTable g_EntityTable;
extern _QERAppDataTable g_DataTable;
extern void *g_pMainWidget;
extern CSynapseServer* g_pSynapseServer;
class CSynapseClientUFOAI : public CSynapseClient
{
public:
// CSynapseClient API
bool RequestAPI( APIDescriptor_t *pAPI );
const char* GetInfo();
const char* GetName();
CSynapseClientUFOAI() { }
virtual ~CSynapseClientUFOAI() { }
};
#define UFOAI_MINOR "ufo:ai"
#endif // _PLUGIN_H_

7
contrib/ufoai/ufoai.def Normal file
View File

@ -0,0 +1,7 @@
; ufoai.def : Declares the module parameters for the DLL.
LIBRARY "UFOAI"
EXPORTS
; Explicit exports can go here
Synapse_EnumerateInterfaces @1

191
contrib/ufoai/ufoai.vcproj Normal file
View File

@ -0,0 +1,191 @@
<?xml version="1.0" encoding="UTF-8"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9.00"
Name="ufoai"
ProjectGUID="{850DD97C-B457-497D-B5F5-DA1904FAC5F9}"
Keyword="Win32Proj"
TargetFrameworkVersion="0"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(SolutionDir)\install\modules"
IntermediateDirectory="$(SolutionDir)\build\intermediate\$(ConfigurationName)\$(ProjectName)"
ConfigurationType="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="&quot;$(SolutionDir)\libs&quot;;&quot;$(SolutionDir)\include&quot;;&quot;$(SolutionDir)\..\STLport-5.2.1\stlport&quot;;&quot;$(SolutionDir)\..\gtk-2.16.6\include\glib-2.0&quot;;&quot;$(SolutionDir)\..\gtk-2.16.6\lib\glib-2.0\include&quot;;&quot;$(SolutionDir)\..\gtk-2.16.6\include&quot;;&quot;$(SolutionDir)\..\gtk-2.16.6\include\gtk-2.0&quot;;&quot;$(SolutionDir)\..\gtk-2.16.6\lib\gtk-2.0\include&quot;;&quot;$(SolutionDir)\..\gtk-2.16.6\include\cairo&quot;;&quot;$(SolutionDir)\..\gtk-2.16.6\include\pango-1.0&quot;;&quot;$(SolutionDir)\..\gtk-2.16.6\include\atk-1.0&quot;;&quot;$(SolutionDir)\..\libxml2-2.7.3\include\libxml2&quot;"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;UFOAI_EXPORTS;"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
UsePrecompiledHeader="0"
WarningLevel="3"
DebugInformationFormat="4"
DisableSpecificWarnings="4996;4244;4101;4800"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalOptions="/STACK:8388608"
AdditionalDependencies="glib-2.0.lib gobject-2.0.lib intl.lib gtk-win32-2.0.lib libxml2.lib synapse.lib"
AdditionalLibraryDirectories="&quot;$(SolutionDir)\..\gtk-2.16.6\lib&quot;;&quot;$(SolutionDir)\..\libxml2-2.7.3\lib&quot;;&quot;$(SolutionDir)\build\$(ConfigurationName)\libs&quot;"
ModuleDefinitionFile="ufoai.def"
GenerateDebugInformation="true"
SubSystem="2"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)\install\modules"
IntermediateDirectory="$(SolutionDir)\build\intermediate\$(ConfigurationName)\$(ProjectName)"
ConfigurationType="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="&quot;$(SolutionDir)\libs&quot;;&quot;$(SolutionDir)\include&quot;;&quot;$(SolutionDir)\..\STLport-5.2.1\stlport&quot;;&quot;$(SolutionDir)\..\gtk-2.16.6\include\glib-2.0&quot;;&quot;$(SolutionDir)\..\gtk-2.16.6\lib\glib-2.0\include&quot;;&quot;$(SolutionDir)\..\gtk-2.16.6\include&quot;;&quot;$(SolutionDir)\..\gtk-2.16.6\include\gtk-2.0&quot;;&quot;$(SolutionDir)\..\gtk-2.16.6\lib\gtk-2.0\include&quot;;&quot;$(SolutionDir)\..\gtk-2.16.6\include\cairo&quot;;&quot;$(SolutionDir)\..\gtk-2.16.6\include\pango-1.0&quot;;&quot;$(SolutionDir)\..\gtk-2.16.6\include\atk-1.0&quot;;&quot;$(SolutionDir)\..\libxml2-2.7.3\include\libxml2&quot;"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;UFOAI_EXPORTS;"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
WarningLevel="3"
DebugInformationFormat="3"
DisableSpecificWarnings="4996;4244;4101;4800"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalOptions="/STACK:8388608"
AdditionalDependencies="glib-2.0.lib gobject-2.0.lib intl.lib gtk-win32-2.0.lib libxml2.lib synapse.lib"
AdditionalLibraryDirectories="&quot;$(SolutionDir)\..\gtk-2.16.6\lib&quot;;&quot;$(SolutionDir)\..\libxml2-2.7.3\lib&quot;;&quot;$(SolutionDir)\build\$(ConfigurationName)\libs&quot;"
ModuleDefinitionFile="ufoai.def"
GenerateDebugInformation="true"
SubSystem="2"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="src"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
>
<File
RelativePath=".\plugin.cpp"
>
</File>
<File
RelativePath=".\ufoai.def"
>
</File>
<File
RelativePath=".\ufoai_filters.cpp"
>
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

176
contrib/ufoai/ufoai.vcxproj Normal file
View File

@ -0,0 +1,176 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{850DD97C-B457-497D-B5F5-DA1904FAC5F9}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>v110</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>v110</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>v110</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>v110</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>11.0.60315.1</_ProjectFileVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<OutDir>$(SolutionDir)\install\modules\</OutDir>
<IntDir>$(SolutionDir)\build\intermediate\$(Configuration)\$(ProjectName)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<OutDir>$(SolutionDir)\install\modules\</OutDir>
<IntDir>$(SolutionDir)\build\intermediate\$(Configuration)\$(ProjectName)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(SolutionDir)\libs;$(SolutionDir)\include;$(SolutionDir)\..\STLport-5.2.1\stlport;$(SolutionDir)\..\gtk-2.24.10\include\glib-2.0;$(SolutionDir)\..\gtk-2.24.10\include\gdk-pixbuf-2.0;$(SolutionDir)\..\gtk-2.24.10\lib\glib-2.0\include;$(SolutionDir)\..\gtk-2.24.10\include;$(SolutionDir)\..\gtk-2.24.10\include\gtk-2.0;$(SolutionDir)\..\gtk-2.24.10\lib\gtk-2.0\include;$(SolutionDir)\..\gtk-2.24.10\include\cairo;$(SolutionDir)\..\gtk-2.24.10\include\pango-1.0;$(SolutionDir)\..\gtk-2.24.10\include\atk-1.0;$(SolutionDir)\..\libxml2-2.9.1\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;UFOAI_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>true</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<PrecompiledHeader />
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
<DisableSpecificWarnings>4996;4244;4101;4800;%(DisableSpecificWarnings)</DisableSpecificWarnings>
</ClCompile>
<Link>
<AdditionalOptions>/STACK:8388608 %(AdditionalOptions)</AdditionalOptions>
<AdditionalDependencies>ws2_32.lib;glib-2.0.lib;gobject-2.0.lib;intl.lib;gtk-win32-2.0.lib;libxml2.lib;synapse.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(SolutionDir)\..\gtk-2.24.10\lib;$(SolutionDir)\..\libxml2-2.9.1\lib\$(Configuration)\$(Platform);$(SolutionDir)\build\$(Configuration)\libs;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<ModuleDefinitionFile>ufoai.def</ModuleDefinitionFile>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<TargetMachine>MachineX86</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(SolutionDir)\libs;$(SolutionDir)\include;$(SolutionDir)\..\STLport-5.2.1\stlport;$(SolutionDir)\..\gtk-2.24.10\include\glib-2.0;$(SolutionDir)\..\gtk-2.24.10\include\gdk-pixbuf-2.0;$(SolutionDir)\..\gtk-2.24.10\lib\glib-2.0\include;$(SolutionDir)\..\gtk-2.24.10\include;$(SolutionDir)\..\gtk-2.24.10\include\gtk-2.0;$(SolutionDir)\..\gtk-2.24.10\lib\gtk-2.0\include;$(SolutionDir)\..\gtk-2.24.10\include\cairo;$(SolutionDir)\..\gtk-2.24.10\include\pango-1.0;$(SolutionDir)\..\gtk-2.24.10\include\atk-1.0;$(SolutionDir)\..\libxml2-2.9.1\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;UFOAI_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<DisableSpecificWarnings>4996;4244;4101;4800;%(DisableSpecificWarnings)</DisableSpecificWarnings>
</ClCompile>
<Link>
<AdditionalOptions>/STACK:8388608 %(AdditionalOptions)</AdditionalOptions>
<AdditionalDependencies>ws2_32.lib;glib-2.0.lib;gobject-2.0.lib;intl.lib;gtk-win32-2.0.lib;libxml2.lib;synapse.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(SolutionDir)\..\gtk-2.24.10\lib;$(SolutionDir)\..\libxml2-2.9.1\lib\$(Configuration)\$(Platform);$(SolutionDir)\build\$(Configuration)\libs;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<ModuleDefinitionFile>ufoai.def</ModuleDefinitionFile>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<AdditionalIncludeDirectories>$(SolutionDir)\libs;$(SolutionDir)\include;$(SolutionDir)\..\STLport-5.2.1\stlport;$(SolutionDir)\..\gtk-2.24.10\include\glib-2.0;$(SolutionDir)\..\gtk-2.24.10\include\gdk-pixbuf-2.0;$(SolutionDir)\..\gtk-2.24.10\lib\glib-2.0\include;$(SolutionDir)\..\gtk-2.24.10\include;$(SolutionDir)\..\gtk-2.24.10\include\gtk-2.0;$(SolutionDir)\..\gtk-2.24.10\lib\gtk-2.0\include;$(SolutionDir)\..\gtk-2.24.10\include\cairo;$(SolutionDir)\..\gtk-2.24.10\include\pango-1.0;$(SolutionDir)\..\gtk-2.24.10\include\atk-1.0;$(SolutionDir)\..\libxml2-2.9.1\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;UFOAI_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<PrecompiledHeader />
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<DisableSpecificWarnings>4996;4244;4101;4800;%(DisableSpecificWarnings)</DisableSpecificWarnings>
</ClCompile>
<Link>
<AdditionalOptions>/STACK:8388608 %(AdditionalOptions)</AdditionalOptions>
<AdditionalDependencies>ws2_32.lib;glib-2.0.lib;gobject-2.0.lib;intl.lib;gtk-win32-2.0.lib;libxml2.lib;synapse.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(SolutionDir)\..\gtk-2.24.10\lib;$(SolutionDir)\..\libxml2-2.9.1\lib\$(Configuration)\$(Platform);$(SolutionDir)\build\$(Configuration)\libs;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<ModuleDefinitionFile>ufoai.def</ModuleDefinitionFile>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<TargetMachine>MachineX86</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<AdditionalIncludeDirectories>$(SolutionDir)\libs;$(SolutionDir)\include;$(SolutionDir)\..\STLport-5.2.1\stlport;$(SolutionDir)\..\gtk-2.24.10\include\glib-2.0;$(SolutionDir)\..\gtk-2.24.10\include\gdk-pixbuf-2.0;$(SolutionDir)\..\gtk-2.24.10\lib\glib-2.0\include;$(SolutionDir)\..\gtk-2.24.10\include;$(SolutionDir)\..\gtk-2.24.10\include\gtk-2.0;$(SolutionDir)\..\gtk-2.24.10\lib\gtk-2.0\include;$(SolutionDir)\..\gtk-2.24.10\include\cairo;$(SolutionDir)\..\gtk-2.24.10\include\pango-1.0;$(SolutionDir)\..\gtk-2.24.10\include\atk-1.0;$(SolutionDir)\..\libxml2-2.9.1\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;UFOAI_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<DisableSpecificWarnings>4996;4244;4101;4800;%(DisableSpecificWarnings)</DisableSpecificWarnings>
</ClCompile>
<Link>
<AdditionalOptions>/STACK:8388608 %(AdditionalOptions)</AdditionalOptions>
<AdditionalDependencies>ws2_32.lib;glib-2.0.lib;gobject-2.0.lib;intl.lib;gtk-win32-2.0.lib;libxml2.lib;synapse.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(SolutionDir)\..\gtk-2.24.10\lib;$(SolutionDir)\..\libxml2-2.9.1\lib\$(Configuration)\$(Platform);$(SolutionDir)\build\$(Configuration)\libs;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<ModuleDefinitionFile>ufoai.def</ModuleDefinitionFile>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="plugin.cpp" />
<ClCompile Include="ufoai_filters.cpp" />
</ItemGroup>
<ItemGroup>
<None Include="ufoai.def" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\libs\synapse\synapse.vcxproj">
<Project>{e13ccfb0-a366-4ef3-a66f-c374b563e4df}</Project>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="src">
<UniqueIdentifier>{f3cd758b-8b56-44e2-9155-0613b20b6fad}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="plugin.cpp">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="ufoai_filters.cpp">
<Filter>src</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<None Include="ufoai.def">
<Filter>src</Filter>
</None>
</ItemGroup>
</Project>

View File

@ -0,0 +1,95 @@
#include "plugin.h"
#include "ufoai_filters.h"
#include "ifilters.h"
#define FilterAdd g_FuncTable.m_pfnFilterAdd
#define FiltersActivate g_FuncTable.m_pfnFiltersActivate
static bfilter_t* filters[FILTER_MAX];
void UFOAIFilterInit( void ){
// texture name filters
filters[FILTER_ACTORCLIP] = FilterAdd( 1, 0, "actorclip", 0 );
filters[FILTER_WEAPONCLIP] = FilterAdd( 1, 0, "weaponclip", 0 );
filters[FILTER_NODRAW] = FilterAdd( 1, 0, "nodraw", 0 );
filters[FILTER_STEPON] = FilterAdd( 1, 0, "stepon", 0 );
// content flag filters
filters[FILTER_LEVEL1] = FilterAdd( 7, UFOAI_CONTENTS_LEVEL_1, "level1", 0 );
filters[FILTER_LEVEL2] = FilterAdd( 7, UFOAI_CONTENTS_LEVEL_2, "level2", 0 );
filters[FILTER_LEVEL3] = FilterAdd( 7, UFOAI_CONTENTS_LEVEL_3, "level3", 0 );
filters[FILTER_LEVEL4] = FilterAdd( 7, UFOAI_CONTENTS_LEVEL_4, "level4", 0 );
filters[FILTER_LEVEL5] = FilterAdd( 7, UFOAI_CONTENTS_LEVEL_5, "level5", 0 );
filters[FILTER_LEVEL6] = FilterAdd( 7, UFOAI_CONTENTS_LEVEL_6, "level6", 0 );
filters[FILTER_LEVEL7] = FilterAdd( 7, UFOAI_CONTENTS_LEVEL_7, "level7", 0 );
filters[FILTER_LEVEL8] = FilterAdd( 7, UFOAI_CONTENTS_LEVEL_8, "level8", 0 );
Sys_Printf( "UFO:AI Filters initialized\n" );
}
void PerformFiltering( int type ){
if ( !filters[type] ) {
Sys_Printf( "filters are not yet initialized\n" );
return;
}
if ( filters[type]->active ) {
filters[type]->active = false;
//Sys_Printf("filter %i deactivated (mask %i 0x%x)\n", type, filters[type]->mask, filters[type]->mask);
}
else {
filters[type]->active = true;
//Sys_Printf("filter %i activated (mask %i 0x%x)\n", type, filters[type]->mask, filters[type]->mask);
}
FiltersActivate();
}
void DoSteponFiltering( void ){
PerformFiltering( FILTER_STEPON );
}
void DoWeaponClipFiltering( void ){
PerformFiltering( FILTER_WEAPONCLIP );
}
void DoActorClipFiltering( void ){
PerformFiltering( FILTER_ACTORCLIP );
}
void DoNoDrawFiltering( void ){
PerformFiltering( FILTER_NODRAW );
}
void DoLevel1Filtering( void ){
PerformFiltering( FILTER_LEVEL1 );
}
void DoLevel2Filtering( void ){
PerformFiltering( FILTER_LEVEL2 );
}
void DoLevel3Filtering( void ){
PerformFiltering( FILTER_LEVEL3 );
}
void DoLevel4Filtering( void ){
PerformFiltering( FILTER_LEVEL4 );
}
void DoLevel5Filtering( void ){
PerformFiltering( FILTER_LEVEL5 );
}
void DoLevel6Filtering( void ){
PerformFiltering( FILTER_LEVEL6 );
}
void DoLevel7Filtering( void ){
PerformFiltering( FILTER_LEVEL7 );
}
void DoLevel8Filtering( void ){
PerformFiltering( FILTER_LEVEL8 );
}

View File

@ -0,0 +1,49 @@
enum FILTERS {
FILTER_ACTORCLIP,
FILTER_WEAPONCLIP,
FILTER_NODRAW,
FILTER_STEPON,
FILTER_LEVEL1,
FILTER_LEVEL2,
FILTER_LEVEL3,
FILTER_LEVEL4,
FILTER_LEVEL5,
FILTER_LEVEL6,
FILTER_LEVEL7,
FILTER_LEVEL8,
FILTER_MAX
};
#define UFOAI_CONTENTS_LEVEL_1 0x0100
#define UFOAI_CONTENTS_LEVEL_2 0x0200
#define UFOAI_CONTENTS_LEVEL_3 0x0400
#define UFOAI_CONTENTS_LEVEL_4 0x0800
#define UFOAI_CONTENTS_LEVEL_5 0x1000
#define UFOAI_CONTENTS_LEVEL_6 0x2000
#define UFOAI_CONTENTS_LEVEL_7 0x4000
#define UFOAI_CONTENTS_LEVEL_8 0x8000
#define UFOAI_CONTENTS_ACTORCLIP 0x00010000
#define UFOAI_CONTENTS_WEAPONCLIP 0x02000000
#define UFOAI_CONTENTS_STEPON 0x40000000
#define UFOAI_SURF_NODRAW 0x00000080
void DoSteponFiltering( void );
void DoWeaponClipFiltering( void );
void DoActorClipFiltering( void );
void DoNoDrawFiltering( void );
void DoLevel1Filtering( void );
void DoLevel2Filtering( void );
void DoLevel3Filtering( void );
void DoLevel4Filtering( void );
void DoLevel5Filtering( void );
void DoLevel6Filtering( void );
void DoLevel7Filtering( void );
void DoLevel8Filtering( void );
// add the ufoai filters
void UFOAIFilterInit( void );

View File

@ -0,0 +1,7 @@
; surface_ufoai.def : Declares the module parameters for the DLL.
LIBRARY "SURFACE_UFOAI"
EXPORTS
; Explicit exports can go here
Synapse_EnumerateInterfaces @1

View File

@ -0,0 +1,195 @@
<?xml version="1.0" encoding="UTF-8"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9.00"
Name="surface_ufoai"
ProjectGUID="{F400371F-455F-4B6C-9F13-A2E57110E725}"
Keyword="Win32Proj"
TargetFrameworkVersion="0"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(SolutionDir)\install\modules"
IntermediateDirectory="$(SolutionDir)\build\intermediate\$(ConfigurationName)\$(ProjectName)"
ConfigurationType="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="&quot;$(SolutionDir)\libs&quot;;&quot;$(SolutionDir)\include&quot;;&quot;$(SolutionDir)\..\STLport-5.2.1\stlport&quot;;&quot;$(SolutionDir)\..\gtk-2.16.6\include\glib-2.0&quot;;&quot;$(SolutionDir)\..\gtk-2.16.6\lib\glib-2.0\include&quot;;&quot;$(SolutionDir)\..\gtk-2.16.6\include&quot;;&quot;$(SolutionDir)\..\gtk-2.16.6\include\gtk-2.0&quot;;&quot;$(SolutionDir)\..\gtk-2.16.6\lib\gtk-2.0\include&quot;;&quot;$(SolutionDir)\..\gtk-2.16.6\include\cairo&quot;;&quot;$(SolutionDir)\..\gtk-2.16.6\include\pango-1.0&quot;;&quot;$(SolutionDir)\..\gtk-2.16.6\include\atk-1.0&quot;;&quot;$(SolutionDir)\..\libxml2-2.7.3\include\libxml2&quot;"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;SURFACE_UFOAI_EXPORTS;"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
UsePrecompiledHeader="0"
WarningLevel="3"
DebugInformationFormat="4"
DisableSpecificWarnings="4996;4244;4101;4800"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalOptions="/STACK:8388608"
AdditionalDependencies="glib-2.0.lib gobject-2.0.lib intl.lib gtk-win32-2.0.lib libxml2.lib synapse.lib"
AdditionalLibraryDirectories="&quot;$(SolutionDir)\..\gtk-2.16.6\lib&quot;;&quot;$(SolutionDir)\..\libxml2-2.7.3\lib&quot;;&quot;$(SolutionDir)\build\$(ConfigurationName)\libs&quot;"
ModuleDefinitionFile="surface_ufoai.def"
GenerateDebugInformation="true"
SubSystem="2"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)\install\modules"
IntermediateDirectory="$(SolutionDir)\build\intermediate\$(ConfigurationName)\$(ProjectName)"
ConfigurationType="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="&quot;$(SolutionDir)\libs&quot;;&quot;$(SolutionDir)\include&quot;;&quot;$(SolutionDir)\..\STLport-5.2.1\stlport&quot;;&quot;$(SolutionDir)\..\gtk-2.16.6\include\glib-2.0&quot;;&quot;$(SolutionDir)\..\gtk-2.16.6\lib\glib-2.0\include&quot;;&quot;$(SolutionDir)\..\gtk-2.16.6\include&quot;;&quot;$(SolutionDir)\..\gtk-2.16.6\include\gtk-2.0&quot;;&quot;$(SolutionDir)\..\gtk-2.16.6\lib\gtk-2.0\include&quot;;&quot;$(SolutionDir)\..\gtk-2.16.6\include\cairo&quot;;&quot;$(SolutionDir)\..\gtk-2.16.6\include\pango-1.0&quot;;&quot;$(SolutionDir)\..\gtk-2.16.6\include\atk-1.0&quot;;&quot;$(SolutionDir)\..\libxml2-2.7.3\include\libxml2&quot;"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;SURFACE_UFOAI_EXPORTS;"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
WarningLevel="3"
DebugInformationFormat="3"
DisableSpecificWarnings="4996;4244;4101;4800"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalOptions="/STACK:8388608"
AdditionalDependencies="glib-2.0.lib gobject-2.0.lib intl.lib gtk-win32-2.0.lib libxml2.lib synapse.lib"
AdditionalLibraryDirectories="&quot;$(SolutionDir)\..\gtk-2.16.6\lib&quot;;&quot;$(SolutionDir)\..\libxml2-2.7.3\lib&quot;;&quot;$(SolutionDir)\build\$(ConfigurationName)\libs&quot;"
ModuleDefinitionFile="surface_ufoai.def"
GenerateDebugInformation="true"
SubSystem="2"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="src"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
>
<File
RelativePath=".\surface_ufoai.def"
>
</File>
<File
RelativePath=".\surfacedialog.cpp"
>
</File>
<File
RelativePath=".\surfaceflagsdialog_ufoai.cpp"
>
</File>
<File
RelativePath=".\surfdlg_plugin.cpp"
>
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@ -0,0 +1,177 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{F400371F-455F-4B6C-9F13-A2E57110E725}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>v110</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>v110</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>v110</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>v110</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>11.0.60315.1</_ProjectFileVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<OutDir>$(SolutionDir)\install\modules\</OutDir>
<IntDir>$(SolutionDir)\build\intermediate\$(Configuration)\$(ProjectName)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<OutDir>$(SolutionDir)\install\modules\</OutDir>
<IntDir>$(SolutionDir)\build\intermediate\$(Configuration)\$(ProjectName)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(SolutionDir)\libs;$(SolutionDir)\include;$(SolutionDir)\..\STLport-5.2.1\stlport;$(SolutionDir)\..\gtk-2.24.10\include\glib-2.0;$(SolutionDir)\..\gtk-2.24.10\include\gdk-pixbuf-2.0;$(SolutionDir)\..\gtk-2.24.10\lib\glib-2.0\include;$(SolutionDir)\..\gtk-2.24.10\include;$(SolutionDir)\..\gtk-2.24.10\include\gtk-2.0;$(SolutionDir)\..\gtk-2.24.10\lib\gtk-2.0\include;$(SolutionDir)\..\gtk-2.24.10\include\cairo;$(SolutionDir)\..\gtk-2.24.10\include\pango-1.0;$(SolutionDir)\..\gtk-2.24.10\include\atk-1.0;$(SolutionDir)\..\libxml2-2.9.1\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;SURFACE_UFOAI_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>true</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<PrecompiledHeader />
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
<DisableSpecificWarnings>4996;4244;4101;4800;%(DisableSpecificWarnings)</DisableSpecificWarnings>
</ClCompile>
<Link>
<AdditionalOptions>/STACK:8388608 %(AdditionalOptions)</AdditionalOptions>
<AdditionalDependencies>ws2_32.lib;glib-2.0.lib;gobject-2.0.lib;intl.lib;gtk-win32-2.0.lib;libxml2.lib;synapse.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(SolutionDir)\..\gtk-2.24.10\lib;$(SolutionDir)\..\libxml2-2.9.1\lib\$(Configuration)\$(Platform);$(SolutionDir)\build\$(Configuration)\libs;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<ModuleDefinitionFile>surface_ufoai.def</ModuleDefinitionFile>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<TargetMachine>MachineX86</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(SolutionDir)\libs;$(SolutionDir)\include;$(SolutionDir)\..\STLport-5.2.1\stlport;$(SolutionDir)\..\gtk-2.24.10\include\glib-2.0;$(SolutionDir)\..\gtk-2.24.10\include\gdk-pixbuf-2.0;$(SolutionDir)\..\gtk-2.24.10\lib\glib-2.0\include;$(SolutionDir)\..\gtk-2.24.10\include;$(SolutionDir)\..\gtk-2.24.10\include\gtk-2.0;$(SolutionDir)\..\gtk-2.24.10\lib\gtk-2.0\include;$(SolutionDir)\..\gtk-2.24.10\include\cairo;$(SolutionDir)\..\gtk-2.24.10\include\pango-1.0;$(SolutionDir)\..\gtk-2.24.10\include\atk-1.0;$(SolutionDir)\..\libxml2-2.9.1\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;SURFACE_UFOAI_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<DisableSpecificWarnings>4996;4244;4101;4800;%(DisableSpecificWarnings)</DisableSpecificWarnings>
</ClCompile>
<Link>
<AdditionalOptions>/STACK:8388608 %(AdditionalOptions)</AdditionalOptions>
<AdditionalDependencies>ws2_32.lib;glib-2.0.lib;gobject-2.0.lib;intl.lib;gtk-win32-2.0.lib;libxml2.lib;synapse.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(SolutionDir)\..\gtk-2.24.10\lib;$(SolutionDir)\..\libxml2-2.9.1\lib\$(Configuration)\$(Platform);$(SolutionDir)\build\$(Configuration)\libs;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<ModuleDefinitionFile>surface_ufoai.def</ModuleDefinitionFile>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<AdditionalIncludeDirectories>$(SolutionDir)\libs;$(SolutionDir)\include;$(SolutionDir)\..\STLport-5.2.1\stlport;$(SolutionDir)\..\gtk-2.24.10\include\glib-2.0;$(SolutionDir)\..\gtk-2.24.10\include\gdk-pixbuf-2.0;$(SolutionDir)\..\gtk-2.24.10\lib\glib-2.0\include;$(SolutionDir)\..\gtk-2.24.10\include;$(SolutionDir)\..\gtk-2.24.10\include\gtk-2.0;$(SolutionDir)\..\gtk-2.24.10\lib\gtk-2.0\include;$(SolutionDir)\..\gtk-2.24.10\include\cairo;$(SolutionDir)\..\gtk-2.24.10\include\pango-1.0;$(SolutionDir)\..\gtk-2.24.10\include\atk-1.0;$(SolutionDir)\..\libxml2-2.9.1\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;SURFACE_UFOAI_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<PrecompiledHeader />
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<DisableSpecificWarnings>4996;4244;4101;4800;%(DisableSpecificWarnings)</DisableSpecificWarnings>
</ClCompile>
<Link>
<AdditionalOptions>/STACK:8388608 %(AdditionalOptions)</AdditionalOptions>
<AdditionalDependencies>ws2_32.lib;glib-2.0.lib;gobject-2.0.lib;intl.lib;gtk-win32-2.0.lib;libxml2.lib;synapse.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(SolutionDir)\..\gtk-2.24.10\lib;$(SolutionDir)\..\libxml2-2.9.1\lib\$(Configuration)\$(Platform);$(SolutionDir)\build\$(Configuration)\libs;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<ModuleDefinitionFile>surface_ufoai.def</ModuleDefinitionFile>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<TargetMachine>MachineX86</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<AdditionalIncludeDirectories>$(SolutionDir)\libs;$(SolutionDir)\include;$(SolutionDir)\..\STLport-5.2.1\stlport;$(SolutionDir)\..\gtk-2.24.10\include\glib-2.0;$(SolutionDir)\..\gtk-2.24.10\include\gdk-pixbuf-2.0;$(SolutionDir)\..\gtk-2.24.10\lib\glib-2.0\include;$(SolutionDir)\..\gtk-2.24.10\include;$(SolutionDir)\..\gtk-2.24.10\include\gtk-2.0;$(SolutionDir)\..\gtk-2.24.10\lib\gtk-2.0\include;$(SolutionDir)\..\gtk-2.24.10\include\cairo;$(SolutionDir)\..\gtk-2.24.10\include\pango-1.0;$(SolutionDir)\..\gtk-2.24.10\include\atk-1.0;$(SolutionDir)\..\libxml2-2.9.1\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;SURFACE_UFOAI_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<DisableSpecificWarnings>4996;4244;4101;4800;%(DisableSpecificWarnings)</DisableSpecificWarnings>
</ClCompile>
<Link>
<AdditionalOptions>/STACK:8388608 %(AdditionalOptions)</AdditionalOptions>
<AdditionalDependencies>ws2_32.lib;glib-2.0.lib;gobject-2.0.lib;intl.lib;gtk-win32-2.0.lib;libxml2.lib;synapse.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(SolutionDir)\..\gtk-2.24.10\lib;$(SolutionDir)\..\libxml2-2.9.1\lib\$(Configuration)\$(Platform);$(SolutionDir)\build\$(Configuration)\libs;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<ModuleDefinitionFile>surface_ufoai.def</ModuleDefinitionFile>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<None Include="surface_ufoai.def" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="surfacedialog.cpp" />
<ClCompile Include="surfaceflagsdialog_ufoai.cpp" />
<ClCompile Include="surfdlg_plugin.cpp" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\libs\synapse\synapse.vcxproj">
<Project>{e13ccfb0-a366-4ef3-a66f-c374b563e4df}</Project>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="src">
<UniqueIdentifier>{8d3e9596-a105-4ce1-8cfb-7b02c906b270}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<None Include="surface_ufoai.def">
<Filter>src</Filter>
</None>
</ItemGroup>
<ItemGroup>
<ClCompile Include="surfacedialog.cpp">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="surfaceflagsdialog_ufoai.cpp">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="surfdlg_plugin.cpp">
<Filter>src</Filter>
</ClCompile>
</ItemGroup>
</Project>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,31 @@
/*
Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
GtkRadiant is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
GtkRadiant is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GtkRadiant; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef _SURFACEDIALOG_H_
#define _SURFACEDIALOG_H_
void UpdateSurfaceDialog();
void DoSurface();
void ToggleSurface();
void SurfaceDlgFitAll();
GtkWidget *Get_SI_Module_Widget();
#endif // _SURFACEDIALOG_H_

View File

@ -0,0 +1,406 @@
/*
Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
GtkRadiant is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
GtkRadiant is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GtkRadiant; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <gtk/gtk.h>
#include <glib/gi18n.h>
#include <gdk/gdkkeysyms.h>
#include <glib/gi18n.h>
#include "surfdlg_plugin.h"
#include "surfaceflagsdialog_ufoai.h"
GtkWidget *notebook1;
// 32 bit is the max
#define MAX_BUTTONS 32
#ifdef _WIN32
// TTimo: THIS IS UGLY
#define snprintf _snprintf
#endif
GtkWidget *surface_buttons[MAX_BUTTONS];
GtkWidget *content_buttons[MAX_BUTTONS];
GtkWidget *value_entry;
gboolean setup_buttons = TRUE;
int working_surface_flags;
int surface_mask;
int working_content_flags;
int content_mask;
int working_value;
inline void set_inconsistent( GtkWidget *toggle_button ){
gtk_toggle_button_set_inconsistent( GTK_TOGGLE_BUTTON( toggle_button ), TRUE );
}
inline void clear_inconsistent( GtkWidget *toggle_button ){
if ( gtk_toggle_button_get_inconsistent( GTK_TOGGLE_BUTTON( toggle_button ) ) ) {
gtk_toggle_button_set_inconsistent( GTK_TOGGLE_BUTTON( toggle_button ), FALSE );
}
}
void clear_all_inconsistent( void ){
int i;
for ( i = 0; i < MAX_BUTTONS; i++ ) {
clear_inconsistent( surface_buttons[i] );
clear_inconsistent( content_buttons[i] );
}
}
void clear_all_buttons_and_values(){
int i;
for ( i = 0; i < MAX_BUTTONS; i++ ) {
gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( surface_buttons[i] ), FALSE );
gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_buttons[i] ), FALSE );
}
gtk_entry_set_text( (GtkEntry *)value_entry, "" );
}
void SetFlagButtons_UFOAI( texdef_to_face_t *texdef_face_list, bool b_isListEmpty ){
int contents = 0;
int flags = 0;
int value = 0;
int diff_contents = 0;
int diff_flags = 0;
gboolean diff_value = FALSE;
char tex_buff[11];
texdef_t* tmp_texdef;
texdef_to_face_t* temp_texdef_face_list;
int i;
setup_buttons = TRUE;
working_surface_flags = 0;
surface_mask = 0;
working_content_flags = 0;
content_mask = 0;
working_value = 0;
if ( !b_isListEmpty ) {
tmp_texdef = &texdef_face_list->texdef;
contents = tmp_texdef->contents;
flags = tmp_texdef->flags;
value = tmp_texdef->value;
Sys_Printf( "Surface: %d\tContents: %d\tValue: %d\ttmp_texdef\n",tmp_texdef->flags,tmp_texdef->contents,tmp_texdef->value );
Sys_Printf( "Surface: %d\tContents: %d\tValue: %d\n",flags,contents,value );
for ( temp_texdef_face_list = texdef_face_list->next; temp_texdef_face_list; temp_texdef_face_list = temp_texdef_face_list->next )
{
tmp_texdef = &temp_texdef_face_list->texdef;
diff_contents |= contents ^ tmp_texdef->contents; // Figure out which buttons are inconsistent
diff_flags |= flags ^ tmp_texdef->flags;
if ( tmp_texdef->value != value ) {
diff_value = TRUE;
}
Sys_Printf( "Surface: %d\tContents: %d\tValue: %d\ttmp_texdef\n",tmp_texdef->flags,tmp_texdef->contents,tmp_texdef->value );
Sys_Printf( "Surface: %d\tContents: %d\tValue: %d\n",flags,contents,value );
}
}
clear_all_inconsistent();
// If no faces/brushes are selected, clear everything and bail
if ( b_isListEmpty ) {
clear_all_buttons_and_values();
setup_buttons = FALSE;
return;
}
for ( i = 0; i < MAX_BUTTONS; i++ ) {
// Set surface buttons to reflect brush/face flags, contents, and values
if ( diff_flags & ( 1 << i ) ) {
set_inconsistent( surface_buttons[i] );
}
else if ( flags & ( 1 << i ) ) {
gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( surface_buttons[i] ), TRUE );
}
else{
gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( surface_buttons[i] ), FALSE );
}
if ( diff_contents & ( 1 << i ) ) {
set_inconsistent( content_buttons[i] );
}
else if ( contents & ( 1 << i ) ) {
gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_buttons[i] ), TRUE );
}
else{
gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( content_buttons[i] ), FALSE );
}
}
// Set Value
if ( diff_value ) {
gtk_entry_set_text( (GtkEntry *)value_entry, "" );
}
else {
working_value = value;
sprintf( tex_buff, "%d", value );
gtk_entry_set_text( (GtkEntry *)value_entry, tex_buff );
}
setup_buttons = FALSE;
}
void SetChangeInFlags_Face_UFOAI( texdef_to_face_t *texdef_face_list ){
texdef_to_face_t *temp_texdef_face_list;
texdef_t *tmp_texdef;
for ( temp_texdef_face_list = texdef_face_list; temp_texdef_face_list; temp_texdef_face_list = temp_texdef_face_list->next )
{
tmp_texdef = &temp_texdef_face_list->texdef;
tmp_texdef->flags = ( tmp_texdef->flags & ~surface_mask ) | working_surface_flags;
tmp_texdef->contents = ( tmp_texdef->contents & ~content_mask ) | working_content_flags;
tmp_texdef->value = working_value;
Sys_Printf( "content_flag: %d content_mask: %d\n",working_content_flags,content_mask );
Sys_Printf( "content: %d\n",tmp_texdef->contents );
}
}
inline void change_surfaceflag( GtkWidget *togglebutton, int sur_flag, gboolean change_flag_to ){
if ( !setup_buttons ) { // If we're setting up the buttons, we really don't need to
// set flags that are already set
if ( gtk_toggle_button_get_inconsistent( GTK_TOGGLE_BUTTON( togglebutton ) ) ) { // Clear out inconsistent, if set
clear_inconsistent( GTK_WIDGET( togglebutton ) );
}
surface_mask |= sur_flag;
if ( change_flag_to ) {
working_surface_flags |= sur_flag;
}
else{
working_surface_flags &= ~sur_flag;
}
}
}
inline void change_contentflag( GtkWidget *togglebutton, int content_flag, gboolean change_flag_to ){
if ( ( !setup_buttons ) ) { // If we're setting up the buttons, we really don't need to
// set flags that are already set
if ( gtk_toggle_button_get_inconsistent( GTK_TOGGLE_BUTTON( togglebutton ) ) ) {
clear_inconsistent( togglebutton );
}
//if (g_ptrSelectedFaces.GetSize() == 0) // Only changing content flags on whole brushes, not faces.
//{
content_mask |= content_flag;
if ( change_flag_to ) {
working_content_flags |= content_flag;
}
else{
working_content_flags &= ~content_flag;
}
//}
Sys_Printf( "content_flag: %d content_mask: %d\n",content_flag,content_mask );
}
}
// Surface Flags Callbacks
void on_surface_button_toggled( GtkToggleButton *togglebutton, gpointer user_data ){
int flag = GPOINTER_TO_INT( user_data );
change_surfaceflag( GTK_WIDGET( togglebutton ), flag, ( GTK_TOGGLE_BUTTON( togglebutton )->active ) );
}
// Content Flags Callbacks
void on_content_button_toggled( GtkToggleButton *togglebutton, gpointer user_data ){
int flag = GPOINTER_TO_INT( user_data );
change_contentflag( GTK_WIDGET( togglebutton ), flag, ( GTK_TOGGLE_BUTTON( togglebutton )->active ) );
}
// Value Entry Callback
void on_value_entry_changed( GtkEditable *editable, gpointer user_data ){
if ( ( !setup_buttons ) ) { // If we're setting up the buttons, don't change value
working_value = atoi( gtk_entry_get_text( (GtkEntry*)editable ) );
}
}
void on_value_entry_insert_text( GtkEditable *editable, gchar *new_text, gint new_text_length, gint *position, gpointer user_data ){
int i, count = 0;
gchar *result;
// Limit input to digits, throwing out anything else
// Modified from Gtk FAQ for text filtering of GtkEntry
result = g_new( gchar, new_text_length );
for ( i = 0; i < new_text_length; i++ ) {
if ( !isdigit( new_text[i] ) ) {
continue;
}
result[count++] = new_text[i];
}
if ( count > 0 ) {
gtk_signal_handler_block_by_func( GTK_OBJECT( editable ),
GTK_SIGNAL_FUNC( on_value_entry_insert_text ),
user_data );
gtk_editable_insert_text( editable, result, count, position );
gtk_signal_handler_unblock_by_func( GTK_OBJECT( editable ),
GTK_SIGNAL_FUNC( on_value_entry_insert_text ),
user_data );
}
gtk_signal_emit_stop_by_name( GTK_OBJECT( editable ), "insert_text" );
g_free( result );
}
void on_surfacebutton_clicked( GtkButton *button, gpointer user_data ){
gtk_notebook_set_page( GTK_NOTEBOOK( notebook1 ), 0 );
}
void on_contentbutton_clicked( GtkButton *button, gpointer user_data ){
gtk_notebook_set_page( GTK_NOTEBOOK( notebook1 ), 1 );
}
#define UFOAI_FLAG_BUTTON_BORDER 3
GtkWidget* Create_UFOAIFlagsDialog( GtkWidget* surfacedialog_widget ){
GtkWidget *frame1;
GtkWidget *vbox1;
GtkWidget *vbox2;
GtkWidget *vbox3;
GtkWidget *vbox4;
GtkWidget *table4;
GtkWidget *hbox2;
GtkWidget *hbox3;
GtkWidget *hseparator1;
GtkWidget *value_label;
GtkWidget *label5;
GtkWidget *table3;
GtkWidget *label6;
int i, x, y;
const char *buttonLabel;
char buffer[8];
frame1 = gtk_frame_new( _( "Flags" ) );
gtk_widget_show( frame1 );
gtk_container_add( GTK_CONTAINER( surfacedialog_widget ), frame1 );
vbox1 = gtk_vbox_new( FALSE, 0 );
gtk_widget_show( vbox1 );
gtk_container_add( GTK_CONTAINER( frame1 ), vbox1 );
notebook1 = gtk_notebook_new();
gtk_widget_show( notebook1 );
gtk_box_pack_start( GTK_BOX( vbox1 ), notebook1, TRUE, TRUE, 0 );
gtk_notebook_set_show_tabs( GTK_NOTEBOOK( notebook1 ), TRUE );
gtk_container_set_border_width( GTK_CONTAINER( notebook1 ), 5 );
vbox2 = gtk_vbox_new( FALSE, 0 );
gtk_widget_show( vbox2 );
gtk_container_add( GTK_CONTAINER( notebook1 ), vbox2 );
table4 = gtk_table_new( 8, 4, FALSE );
gtk_widget_show( table4 );
gtk_box_pack_start( GTK_BOX( vbox2 ), table4, TRUE, TRUE, 0 );
y = -1;
for ( i = 0; i < MAX_BUTTONS; i++ ) {
if ( !( i % 4 ) ) {
y++;
}
x = i % 4;
snprintf( buffer, sizeof( buffer ) - 1, "surf%i", i + 1 );
buttonLabel = g_FuncTable.m_pfnReadProjectKey( buffer );
Sys_Printf( "%s: %s\n", buffer, buttonLabel );
surface_buttons[i] = gtk_toggle_button_new_with_label( buttonLabel );
gtk_signal_connect( GTK_OBJECT( surface_buttons[i] ), "toggled", GTK_SIGNAL_FUNC( on_surface_button_toggled ), GINT_TO_POINTER( 1 << i ) );
gtk_widget_show( surface_buttons[i] );
gtk_table_attach( GTK_TABLE( table4 ), surface_buttons[i], 0 + x, 1 + x, ( 0 + y ), ( 1 + y ),
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
gtk_container_set_border_width( GTK_CONTAINER( surface_buttons[i] ), UFOAI_FLAG_BUTTON_BORDER );
}
hseparator1 = gtk_hseparator_new();
gtk_widget_show( hseparator1 );
gtk_box_pack_start( GTK_BOX( vbox2 ), hseparator1, FALSE, FALSE, 0 );
gtk_widget_set_usize( hseparator1, -2, 5 );
hbox2 = gtk_hbox_new( FALSE, 0 );
gtk_widget_show( hbox2 );
gtk_box_pack_start( GTK_BOX( vbox2 ), hbox2, FALSE, FALSE, 0 );
hbox3 = gtk_hbox_new( FALSE, 0 );
gtk_widget_show( hbox3 );
gtk_box_pack_start( GTK_BOX( hbox2 ), hbox3, TRUE, TRUE, 0 );
vbox4 = gtk_vbox_new( FALSE, 0 );
gtk_widget_show( vbox4 );
gtk_box_pack_start( GTK_BOX( hbox3 ), vbox4, TRUE, TRUE, 0 );
value_label = gtk_label_new( " Value: " );
gtk_widget_show( value_label );
gtk_box_pack_start( GTK_BOX( hbox3 ), value_label, FALSE, FALSE, 0 );
value_entry = gtk_entry_new();
gtk_signal_connect( GTK_OBJECT( value_entry ), "changed",
GTK_SIGNAL_FUNC( on_value_entry_changed ),
NULL );
gtk_signal_connect( GTK_OBJECT( value_entry ), "insert_text",
GTK_SIGNAL_FUNC( on_value_entry_insert_text ),
NULL );
gtk_entry_set_max_length( (GtkEntry *)value_entry, 11 );
gtk_widget_show( value_entry );
gtk_box_pack_start( GTK_BOX( hbox3 ), value_entry, TRUE, TRUE, 0 );
vbox3 = gtk_vbox_new( FALSE, 0 );
gtk_widget_show( vbox3 );
gtk_box_pack_start( GTK_BOX( hbox3 ), vbox3, TRUE, TRUE, 0 );
label5 = gtk_label_new( "Surface Flags" );
gtk_widget_show( label5 );
gtk_notebook_set_tab_label( GTK_NOTEBOOK( notebook1 ), gtk_notebook_get_nth_page( GTK_NOTEBOOK( notebook1 ), 0 ), label5 );
table3 = gtk_table_new( 8, 4, FALSE );
gtk_widget_show( table3 );
gtk_container_add( GTK_CONTAINER( notebook1 ), table3 );
y = -1;
for ( i = 0; i < MAX_BUTTONS; i++ ) {
if ( !( i % 4 ) ) {
y++;
}
x = i % 4;
snprintf( buffer, sizeof( buffer ) - 1, "cont%i", i + 1 );
buttonLabel = g_FuncTable.m_pfnReadProjectKey( buffer );
content_buttons[i] = gtk_toggle_button_new_with_label( buttonLabel );
gtk_signal_connect( GTK_OBJECT( content_buttons[i] ), "toggled", GTK_SIGNAL_FUNC( on_content_button_toggled ), GINT_TO_POINTER( 1 << i ) );
gtk_widget_show( content_buttons[i] );
gtk_table_attach( GTK_TABLE( table3 ), content_buttons[i], 0 + x, 1 + x, ( 0 + y ), ( 1 + y ),
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
gtk_container_set_border_width( GTK_CONTAINER( content_buttons[i] ), UFOAI_FLAG_BUTTON_BORDER );
}
label6 = gtk_label_new( "Content Flags" );
gtk_widget_show( label6 );
gtk_notebook_set_tab_label( GTK_NOTEBOOK( notebook1 ), gtk_notebook_get_nth_page( GTK_NOTEBOOK( notebook1 ), 1 ), label6 );
return frame1;
}

View File

@ -0,0 +1,25 @@
/*
Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
GtkRadiant is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
GtkRadiant is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GtkRadiant; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef _SURFACEFLAGSDIALOG_UFOAI_H
#define _SURFACEFLAGSDIALOG_UFOAI_H
#endif // _SURFACEFLAGSDIALOG_UFOAI_H

View File

@ -0,0 +1,120 @@
/*
Copyright (c) 2001, Loki software, inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list
of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
Neither the name of Loki software nor the names of its contributors may be used
to endorse or promote products derived from this software without specific prior
written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
DIRECT,INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <stdio.h>
#include "surfdlg_plugin.h"
#include "surfacedialog.h"
#include "synapse.h"
class CSynapseClient_SurfDLG : public CSynapseClient
{
public:
// CSynapseClient API
bool RequestAPI( APIDescriptor_t *pAPI );
const char* GetInfo();
const char* GetName();
bool OnActivate();
CSynapseClient_SurfDLG() { }
virtual ~CSynapseClient_SurfDLG() { }
};
// =============================================================================
// SYNAPSE
_QERFuncTable_1 g_FuncTable;
_QERUndoTable g_UndoTable;
_QERAppSurfaceTable g_AppSurfaceTable;
_QERSelectedFaceTable g_SelectedFaceTable;
_QERShadersTable g_ShadersTable;
_QERAppShadersTable g_AppShadersTable;
_QERAppDataTable g_AppDataTable;
CSynapseServer* g_pSynapseServer = NULL;
CSynapseClient_SurfDLG g_SynapseClient;
#if __GNUC__ >= 4
#pragma GCC visibility push(default)
#endif
extern "C" CSynapseClient * SYNAPSE_DLL_EXPORT Synapse_EnumerateInterfaces( const char *version, CSynapseServer *pServer ) {
#if __GNUC__ >= 4
#pragma GCC visibility pop
#endif
if ( strcmp( version, SYNAPSE_VERSION ) ) {
Syn_Printf( "ERROR: synapse API version mismatch: should be '" SYNAPSE_VERSION "', got '%s'\n", version );
return NULL;
}
g_pSynapseServer = pServer;
g_pSynapseServer->IncRef();
Set_Syn_Printf( g_pSynapseServer->Get_Syn_Printf() );
g_SynapseClient.AddAPI( SURFACEDIALOG_MAJOR, "ufoai", sizeof( _QERPlugSurfaceTable ) );
g_SynapseClient.AddAPI( RADIANT_MAJOR, NULL, sizeof( _QERFuncTable_1 ), SYN_REQUIRE, &g_FuncTable );
g_SynapseClient.AddAPI( UNDO_MAJOR, NULL, sizeof( _QERUndoTable ), SYN_REQUIRE, &g_UndoTable );
g_SynapseClient.AddAPI( APPSURFACEDIALOG_MAJOR, NULL, sizeof( _QERAppSurfaceTable ), SYN_REQUIRE, &g_AppSurfaceTable );
g_SynapseClient.AddAPI( SELECTEDFACE_MAJOR, NULL, sizeof( _QERSelectedFaceTable ), SYN_REQUIRE, &g_SelectedFaceTable );
g_SynapseClient.AddAPI( SHADERS_MAJOR, "ufoai", sizeof( _QERShadersTable ), SYN_REQUIRE, &g_ShadersTable );
g_SynapseClient.AddAPI( APPSHADERS_MAJOR, NULL, sizeof( _QERAppShadersTable ), SYN_REQUIRE, &g_AppShadersTable );
g_SynapseClient.AddAPI( DATA_MAJOR, NULL, sizeof( _QERAppDataTable ), SYN_REQUIRE, &g_AppDataTable );
return &g_SynapseClient;
}
bool CSynapseClient_SurfDLG::RequestAPI( APIDescriptor_t *pAPI ){
if ( !strcmp( pAPI->major_name, SURFACEDIALOG_MAJOR ) ) {
_QERPlugSurfaceTable* pSurfDialogTable = static_cast<_QERPlugSurfaceTable*>( pAPI->mpTable );
if ( !strcmp( pAPI->minor_name, "ufoai" ) ) {
pSurfDialogTable->m_pfnToggleSurface = &ToggleSurface;
pSurfDialogTable->m_pfnDoSurface = &DoSurface;
pSurfDialogTable->m_pfnUpdateSurfaceDialog = &UpdateSurfaceDialog;
pSurfDialogTable->m_pfnSurfaceDlgFitAll = &SurfaceDlgFitAll;
pSurfDialogTable->m_pfnGet_SI_Module_Widget = &Get_SI_Module_Widget;
return true;
}
}
Syn_Printf( "ERROR: RequestAPI( '%s' ) not found in '%s'\n", pAPI->major_name, GetInfo() );
return false;
}
#include "version.h"
const char* CSynapseClient_SurfDLG::GetInfo(){
return "Surface Dialog (UFO: Alien Invasion) module built " __DATE__ " " RADIANT_VERSION;
}
const char* CSynapseClient_SurfDLG::GetName(){
return "surface";
}
bool CSynapseClient_SurfDLG::OnActivate(){
return true;
}

View File

@ -0,0 +1,97 @@
/*
Copyright (c) 2001, Loki software, inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list
of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
Neither the name of Loki software nor the names of its contributors may be used
to endorse or promote products derived from this software without specific prior
written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
DIRECT,INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef _SURFDLG_PLUGIN_H_
#define _SURFDLG_PLUGIN_H_
#ifdef __linux__
typedef void* HMODULE;
typedef void* LPVOID;
typedef char* LPCSTR;
#endif // __linux__
#include "qerplugin.h"
#include "synapse.h"
#include "iselectedface.h"
#include "iundo.h"
#include "ishaders.h"
#include "mathlib.h"
#include "missing.h"
#include "idata.h"
#include "isurfaceplugin.h"
class SurfaceDialog : public IPluginTexdef
{
int refCount;
public:
// Increment the number of references to this object
void IncRef() { refCount++; }
// Decrement the reference count
void DecRef() {
if ( --refCount <= 0 ) {
delete this;
}
}
};
extern _QERFuncTable_1 g_FuncTable;
extern _QERUndoTable g_UndoTable;
extern _QERAppSurfaceTable g_AppSurfaceTable;
extern _QERSelectedFaceTable g_SelectedFaceTable;
extern _QERShadersTable g_ShadersTable;
extern _QERAppShadersTable g_AppShadersTable;
extern _QERAppDataTable g_AppDataTable;
#define GetSelectedFaceCount g_SelectedFaceTable.m_pfnGetSelectedFaceCount
#define Undo_Undo g_UndoTable.m_pfnUndo_Undo
#define Undo_GetUndoId g_UndoTable.m_pfnUndo_GetUndoId
#define Sys_Printf g_FuncTable.m_pfnSysPrintf
#define Sys_FPrintf g_FuncTable.m_pfnSysFPrintf
#define Sys_UpdateWindows g_FuncTable.m_pfnSysUpdateWindows
#define Select_FitTexture g_AppSurfaceTable.m_pfnSelect_FitTexture
#define Get_SI_Inc g_AppSurfaceTable.m_pfnQERApp_QeglobalsSavedinfo_SIInc
#define GridSize g_AppSurfaceTable.m_pfnQeglobalsGetGridSize
#define FaceList_FitTexture g_AppSurfaceTable.m_pfnFaceList_FitTexture
#define GetMainWindow g_AppSurfaceTable.m_pfnGetMainWindow
#define GetSelectedFaceCountfromBrushes g_AppSurfaceTable.m_pfnGetSelectedFaceCountfromBrushes
#define GetSelFacesTexdef g_AppSurfaceTable.m_pfnGetSelFacesTexdef
#define SetTexdef_FaceList g_AppSurfaceTable.m_pfnSetTexdef_FaceList
#define SetWinPos_from_Prefs g_AppSurfaceTable.m_pfnSetWinPos_From_Prefs
#define Texturewin g_AppShadersTable.m_pfnQeglobalsTexturewin
#endif // _SURFDLG_PLUGIN_H_