ported over the 1.5 branch version of q3map2 which is newer

made Visual Studio files work in VS2005 Express
fixed a ton of warnings in VS2005 Express
fixed some compile problems on OpenSUSE 11.0


git-svn-id: svn://svn.icculus.org/gtkradiant/GtkRadiant/trunk@302 8a3a26a2-13c4-0310-b231-cf6edde360e5
This commit is contained in:
Forest Hale 2008-07-25 07:31:37 +00:00
parent 995f6a1011
commit 88cea027e6
126 changed files with 6908 additions and 3792 deletions

View file

@ -10,7 +10,7 @@ Import( [ 'utils', 'config', 'settings', 'lib_objects' ] )
env = Environment()
settings.SetupEnvironment( env, config['name'] )
env.Prepend( CPPPATH = [ '#tools/quake3/common' ] )
env.Append( LIBS = [ 'pthread', 'png', 'jpeg' ] )
env.Append( LIBS = [ 'pthread', 'png', 'jpeg', 'mhash' ] )
proj = utils.vcproj( os.path.join( GetLaunchDir(), 'tools/quake3/q3map2/q3map2.vcproj' ) )
objects = lib_objects
objects += [ os.path.join( 'tools/quake3/q3map2', i ) for i in proj.getSourceFiles() ]

View file

@ -147,7 +147,7 @@ void CBackgroundDialogPage::Browse()
//TODO bug/patch for comments
//TODO patern gets fucked up sometimes if empty
newfile = g_FuncTable.m_pfnFileDialog(pDialogWnd,TRUE,
_("Load Background Image"),browsedir,FILETYPE_KEY);
_("Load Background Image"),browsedir,FILETYPE_KEY, NULL);
if(!newfile) {
Syn_Printf(MSG_PREFIX "newfile = NULL\n");
return;

View file

@ -1,87 +1,246 @@
<?xml version="1.0" ?><VisualStudioProject Name="camera" ProjectGUID="{A43B5811-4BCC-483A-BDAC-F5721DCF9B4A}" ProjectType="Visual C++" RootNamespace="camera" Version="8.00">
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8.00"
Name="camera"
ProjectGUID="{A43B5811-4BCC-483A-BDAC-F5721DCF9B4A}"
RootNamespace="camera"
>
<Platforms>
<Platform Name="Win32"/>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration CharacterSet="2" ConfigurationType="2" IntermediateDirectory="$(SolutionDir)\build\intermediate\$(ConfigurationName)\$(ProjectName)" Name="Debug|Win32" OutputDirectory="$(SolutionDir)\install\modules">
<Tool Name="VCPreBuildEventTool"/>
<Tool Name="VCCustomBuildTool"/>
<Tool Name="VCXMLDataGeneratorTool"/>
<Tool Name="VCWebServiceProxyGeneratorTool"/>
<Tool Name="VCMIDLTool"/>
<Tool AdditionalIncludeDirectories="&quot;$(SolutionDir)\include&quot;;&quot;$(SolutionDir)\libs&quot;;&quot;$(SolutionDir)\..\STLPort\stlport&quot;;&quot;$(SolutionDir)\..\gtk2\include&quot;;&quot;$(SolutionDir)\..\gtk2\include\glib-2.0&quot;;&quot;$(SolutionDir)\..\gtk2\lib\glib-2.0\include&quot;;&quot;$(SolutionDir)\..\gtk2\lib\gtk-2.0\include&quot;;&quot;$(SolutionDir)\..\gtk2\lib\gtkglext-1.0\include&quot;;&quot;$(SolutionDir)\..\gtk2\include\gtk-2.0&quot;;&quot;$(SolutionDir)\..\gtk2\include\cairo&quot;;&quot;$(SolutionDir)\..\gtk2\include\pango-1.0&quot;;&quot;$(SolutionDir)\..\gtk2\include\atk-1.0&quot;;&quot;$(SolutionDir)\..\gtk2\include\gtkglext-1.0&quot;;&quot;$(SolutionDir)\..\libxml2\include&quot;" BasicRuntimeChecks="3" DebugInformationFormat="4" Detect64BitPortabilityProblems="true" DisableSpecificWarnings="4996;4244;4267" MinimalRebuild="true" Name="VCCLCompilerTool" Optimization="0" PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS" RuntimeLibrary="3" WarningLevel="3"/>
<Tool Name="VCManagedResourceCompilerTool"/>
<Tool Name="VCResourceCompilerTool"/>
<Tool Name="VCPreLinkEventTool"/>
<Tool AdditionalDependencies="synapse.lib splines.lib libxml2.lib glib-2.0.lib gobject-2.0.lib gtk-win32-2.0.lib" AdditionalLibraryDirectories="&quot;$(SolutionDir)\..\libxml2\lib&quot;;&quot;$(SolutionDir)\..\gtk2\lib&quot;;&quot;$(SolutionDir)\build\$(ConfigurationName)\libs&quot;" GenerateDebugInformation="true" ModuleDefinitionFile="camera.def" Name="VCLinkerTool" TargetMachine="1"/>
<Tool Name="VCALinkTool"/>
<Tool Name="VCManifestTool"/>
<Tool Name="VCXDCMakeTool"/>
<Tool Name="VCBscMakeTool"/>
<Tool Name="VCFxCopTool"/>
<Tool Name="VCAppVerifierTool"/>
<Tool Name="VCWebDeploymentTool"/>
<Tool Name="VCPostBuildEventTool"/>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(SolutionDir)\install\modules"
IntermediateDirectory="$(SolutionDir)\build\intermediate\$(ConfigurationName)\$(ProjectName)"
ConfigurationType="2"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="&quot;$(SolutionDir)\include&quot;;&quot;$(SolutionDir)\libs&quot;;&quot;$(SolutionDir)\..\STLPort\stlport&quot;;&quot;$(SolutionDir)\..\gtk2\include&quot;;&quot;$(SolutionDir)\..\gtk2\include\glib-2.0&quot;;&quot;$(SolutionDir)\..\gtk2\lib\glib-2.0\include&quot;;&quot;$(SolutionDir)\..\gtk2\lib\gtk-2.0\include&quot;;&quot;$(SolutionDir)\..\gtk2\lib\gtkglext-1.0\include&quot;;&quot;$(SolutionDir)\..\gtk2\include\gtk-2.0&quot;;&quot;$(SolutionDir)\..\gtk2\include\cairo&quot;;&quot;$(SolutionDir)\..\gtk2\include\pango-1.0&quot;;&quot;$(SolutionDir)\..\gtk2\include\atk-1.0&quot;;&quot;$(SolutionDir)\..\gtk2\include\gtkglext-1.0&quot;;&quot;$(SolutionDir)\..\libxml2\include&quot;"
PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="4"
DisableSpecificWarnings="4996;4244;4267"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="synapse.lib splines.lib libxml2.lib glib-2.0.lib gobject-2.0.lib gtk-win32-2.0.lib intl.lib"
AdditionalLibraryDirectories="&quot;$(SolutionDir)\..\libxml2\lib&quot;;&quot;$(SolutionDir)\..\gtk2\lib&quot;;&quot;$(SolutionDir)\build\$(ConfigurationName)\libs&quot;"
ModuleDefinitionFile="camera.def"
GenerateDebugInformation="true"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration CharacterSet="2" ConfigurationType="2" IntermediateDirectory="$(SolutionDir)\build\intermediate\$(ConfigurationName)\$(ProjectName)" Name="Release|Win32" OutputDirectory="$(SolutionDir)\install\modules">
<Tool Name="VCPreBuildEventTool"/>
<Tool Name="VCCustomBuildTool"/>
<Tool Name="VCXMLDataGeneratorTool"/>
<Tool Name="VCWebServiceProxyGeneratorTool"/>
<Tool Name="VCMIDLTool"/>
<Tool AdditionalIncludeDirectories="&quot;$(SolutionDir)\include&quot;;&quot;$(SolutionDir)\libs&quot;;&quot;$(SolutionDir)\..\STLPort\stlport&quot;;&quot;$(SolutionDir)\..\gtk2\include&quot;;&quot;$(SolutionDir)\..\gtk2\include\glib-2.0&quot;;&quot;$(SolutionDir)\..\gtk2\lib\glib-2.0\include&quot;;&quot;$(SolutionDir)\..\gtk2\lib\gtk-2.0\include&quot;;&quot;$(SolutionDir)\..\gtk2\lib\gtkglext-1.0\include&quot;;&quot;$(SolutionDir)\..\gtk2\include\gtk-2.0&quot;;&quot;$(SolutionDir)\..\gtk2\include\cairo&quot;;&quot;$(SolutionDir)\..\gtk2\include\pango-1.0&quot;;&quot;$(SolutionDir)\..\gtk2\include\atk-1.0&quot;;&quot;$(SolutionDir)\..\gtk2\include\gtkglext-1.0&quot;;&quot;$(SolutionDir)\..\libxml2\include&quot;" DebugInformationFormat="3" Detect64BitPortabilityProblems="true" DisableSpecificWarnings="4996;4244;4267" Name="VCCLCompilerTool" PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS" RuntimeLibrary="2" WarningLevel="3"/>
<Tool Name="VCManagedResourceCompilerTool"/>
<Tool Name="VCResourceCompilerTool"/>
<Tool Name="VCPreLinkEventTool"/>
<Tool AdditionalDependencies="synapse.lib splines.lib libxml2.lib glib-2.0.lib gobject-2.0.lib gtk-win32-2.0.lib" AdditionalLibraryDirectories="&quot;$(SolutionDir)\..\libxml2\lib&quot;;&quot;$(SolutionDir)\..\gtk2\lib&quot;;&quot;$(SolutionDir)\build\$(ConfigurationName)\libs&quot;" EnableCOMDATFolding="2" GenerateDebugInformation="true" ModuleDefinitionFile="camera.def" Name="VCLinkerTool" OptimizeReferences="2" TargetMachine="1"/>
<Tool Name="VCALinkTool"/>
<Tool Name="VCManifestTool"/>
<Tool Name="VCXDCMakeTool"/>
<Tool Name="VCBscMakeTool"/>
<Tool Name="VCFxCopTool"/>
<Tool Name="VCAppVerifierTool"/>
<Tool Name="VCWebDeploymentTool"/>
<Tool Name="VCPostBuildEventTool"/>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)\install\modules"
IntermediateDirectory="$(SolutionDir)\build\intermediate\$(ConfigurationName)\$(ProjectName)"
ConfigurationType="2"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="&quot;$(SolutionDir)\include&quot;;&quot;$(SolutionDir)\libs&quot;;&quot;$(SolutionDir)\..\STLPort\stlport&quot;;&quot;$(SolutionDir)\..\gtk2\include&quot;;&quot;$(SolutionDir)\..\gtk2\include\glib-2.0&quot;;&quot;$(SolutionDir)\..\gtk2\lib\glib-2.0\include&quot;;&quot;$(SolutionDir)\..\gtk2\lib\gtk-2.0\include&quot;;&quot;$(SolutionDir)\..\gtk2\lib\gtkglext-1.0\include&quot;;&quot;$(SolutionDir)\..\gtk2\include\gtk-2.0&quot;;&quot;$(SolutionDir)\..\gtk2\include\cairo&quot;;&quot;$(SolutionDir)\..\gtk2\include\pango-1.0&quot;;&quot;$(SolutionDir)\..\gtk2\include\atk-1.0&quot;;&quot;$(SolutionDir)\..\gtk2\include\gtkglext-1.0&quot;;&quot;$(SolutionDir)\..\libxml2\include&quot;"
PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS"
RuntimeLibrary="2"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
DisableSpecificWarnings="4996;4244;4267"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="synapse.lib splines.lib libxml2.lib glib-2.0.lib gobject-2.0.lib gtk-win32-2.0.lib intl.lib"
AdditionalLibraryDirectories="&quot;$(SolutionDir)\..\libxml2\lib&quot;;&quot;$(SolutionDir)\..\gtk2\lib&quot;;&quot;$(SolutionDir)\build\$(ConfigurationName)\libs&quot;"
ModuleDefinitionFile="camera.def"
GenerateDebugInformation="true"
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="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" Name="Source Files">
<File RelativePath=".\camera.cpp">
<Filter
Name="Source Files"
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
>
<File
RelativePath=".\camera.cpp"
>
</File>
<File RelativePath=".\camera.def">
<File
RelativePath=".\camera.def"
>
</File>
<File RelativePath=".\dialogs.cpp">
<File
RelativePath=".\dialogs.cpp"
>
</File>
<File RelativePath=".\dialogs_common.cpp">
<File
RelativePath=".\dialogs_common.cpp"
>
</File>
<File RelativePath=".\funchandlers.cpp">
<File
RelativePath=".\funchandlers.cpp"
>
</File>
<File RelativePath=".\listener.cpp">
<File
RelativePath=".\listener.cpp"
>
</File>
<File RelativePath=".\misc.cpp">
<File
RelativePath=".\misc.cpp"
>
</File>
<File RelativePath=".\renderer.cpp">
<File
RelativePath=".\renderer.cpp"
>
</File>
</Filter>
<Filter Filter="h;hpp;hxx;hm;inl" Name="Header Files">
<File RelativePath=".\camera.h">
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl"
>
<File
RelativePath=".\camera.h"
>
</File>
<File RelativePath=".\dialogs.h">
<File
RelativePath=".\dialogs.h"
>
</File>
<File RelativePath=".\funchandlers.h">
<File
RelativePath=".\funchandlers.h"
>
</File>
<File RelativePath=".\listener.h">
<File
RelativePath=".\listener.h"
>
</File>
<File RelativePath=".\misc.h">
<File
RelativePath=".\misc.h"
>
</File>
<File RelativePath=".\renderer.h">
<File
RelativePath=".\renderer.h"
>
</File>
</Filter>
<Filter Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" Name="Resource Files">
<Filter
Name="Resource Files"
Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
>
</Filter>
</Files>
<Globals>

View file

@ -26,6 +26,9 @@ Copyright (C) 2002 Splash Damage Ltd.
#include "camera.h"
#include <glib.h>
#include <glib/gi18n.h>
static GSList *g_pEditTypeRadio = NULL;
static GtkWidget *g_pEditModeEditRadioButton = NULL;
GtkWidget *g_pEditModeAddRadioButton = NULL;

View file

@ -36,7 +36,7 @@ void dialog_button_callback (GtkWidget *widget, gpointer data)
ret = (int*)g_object_get_data (G_OBJECT (parent), "ret");
*loop = 0;
*ret = (int)data;
*ret = GPOINTER_TO_INT (data);
}
gint dialog_delete_callback (GtkWidget *widget, GdkEvent* event, gpointer data)

View file

@ -106,7 +106,7 @@ void DoLoadCamera()
else
strcpy( basepath, g_FuncTable.m_pfnGetGamePath() );
const gchar *filename = g_FuncTable.m_pfnFileDialog( (GtkWidget *)g_pRadiantWnd, TRUE, "Open Camera File", basepath, "camera");
const gchar *filename = g_FuncTable.m_pfnFileDialog( (GtkWidget *)g_pRadiantWnd, TRUE, "Open Camera File", basepath, "camera", NULL);
if( filename )
{
@ -161,7 +161,7 @@ void DoSaveCamera() {
else
strcpy( basepath, g_FuncTable.m_pfnGetGamePath() );
const gchar *filename = g_FuncTable.m_pfnFileDialog( (void *)g_pRadiantWnd, FALSE, "Save Camera File", basepath, "camera");
const gchar *filename = g_FuncTable.m_pfnFileDialog( (void *)g_pRadiantWnd, FALSE, "Save Camera File", basepath, "camera", NULL);
if( filename ) {
char fullpathtofile[PATH_MAX + 8];

View file

@ -912,7 +912,7 @@ static void bitmap_browse (GtkWidget *widget, gpointer data)
const char *filename;
char *ptr;
filename = g_FuncTable.m_pfnFileDialog (g_pWnd, TRUE, "Bitmap File", gbmp.defpath, "gtkgensurf");
filename = g_FuncTable.m_pfnFileDialog (g_pWnd, TRUE, "Bitmap File", gbmp.defpath, "gtkgensurf", NULL);
if (filename != NULL)
{

View file

@ -397,7 +397,7 @@ void UpdatePreview (bool DataChange)
void SaveSetup (GtkWidget *parent)
{
const char *name = g_FuncTable.m_pfnFileDialog (parent, false, "Save GenSurf Settings",
g_FuncTable.m_pfnProfileGetDirectory (), "gtkgensurf");
g_FuncTable.m_pfnProfileGetDirectory (), "gtkgensurf", NULL);
if (name != NULL)
{
@ -436,7 +436,7 @@ void OpenSetup (GtkWidget *parent, int UseDefaults)
name = g_strdup ("plugins/defaults.srf"); // dummy string
else
name = g_FuncTable.m_pfnFileDialog (parent, true, "Open GenSurf Settings",
g_FuncTable.m_pfnProfileGetDirectory (), "gtkgensurf");
g_FuncTable.m_pfnProfileGetDirectory (), "gtkgensurf", NULL);
if(name != NULL)
{

View file

@ -230,7 +230,7 @@ typedef gint (WINAPI* PFN_QERAPP_MESSAGEBOX) (void *parent, const char* text,
// - 'pattern': the first pattern is for the win32 mode, then comes the Gtk pattern list, see Radiant source for samples
// TTimo 04/01/2001 toolkit-independant, cast parent to a GtkWidget*
typedef const gchar* (* PFN_QERAPP_FILEDIALOG) (void *parent, gboolean open, const char* title,
const char* path, const char* pattern);
const char* path, const char* pattern, const char *baseSubDir);
typedef gchar* (WINAPI* PFN_QERAPP_DIRDIALOG) (void *parent, const char* title,
const char* path);

View file

@ -523,7 +523,7 @@ static int DDSDecompressDXT1( ddsBuffer_t *dds, int width, int height, unsigned
for( y = 0; y < yBlocks; y++ )
{
/* 8 bytes per block */
block = (ddsColorBlock_t*) ((unsigned int) dds->data + y * xBlocks * 8);
block = (ddsColorBlock_t*) ((size_t) dds->data + y * xBlocks * 8);
/* walk x */
for( x = 0; x < xBlocks; x++, block++ )
@ -569,7 +569,7 @@ static int DDSDecompressDXT3( ddsBuffer_t *dds, int width, int height, unsigned
for( y = 0; y < yBlocks; y++ )
{
/* 8 bytes per block, 1 block for alpha, 1 block for color */
block = (ddsColorBlock_t*) ((unsigned int) dds->data + y * xBlocks * 16);
block = (ddsColorBlock_t*) ((size_t) dds->data + y * xBlocks * 16);
/* walk x */
for( x = 0; x < xBlocks; x++, block++ )
@ -625,7 +625,7 @@ static int DDSDecompressDXT5( ddsBuffer_t *dds, int width, int height, unsigned
for( y = 0; y < yBlocks; y++ )
{
/* 8 bytes per block, 1 block for alpha, 1 block for color */
block = (ddsColorBlock_t*) ((unsigned int) dds->data + y * xBlocks * 16);
block = (ddsColorBlock_t*) ((size_t) dds->data + y * xBlocks * 16);
/* walk x */
for( x = 0; x < xBlocks; x++, block++ )

View file

@ -546,7 +546,7 @@ int lwGetPolygons5( picoMemStream_t *fp, int cksize, lwPolygonList *plist, int p
bp += 2;
}
j -= 1;
pp->surf = ( lwSurface * ) j;
pp->surf = ( lwSurface * ) ((size_t)j);
pp++;
pv += nv;

View file

@ -353,7 +353,7 @@ int lwResolvePolySurfaces( lwPolygonList *polygon, lwTagList *tlist,
}
for ( i = 0; i < polygon->count; i++ ) {
index = ( int ) polygon->pol[ i ].surf;
index = ( int ) ((size_t)polygon->pol[ i ].surf);
if ( index < 0 || index > tlist->count ) return 0;
if ( !s[ index ] ) {
s[ index ] = lwDefaultSurface();
@ -527,7 +527,7 @@ int lwGetPolygonTags( picoMemStream_t *fp, int cksize, lwTagList *tlist,
if ( rlen < 0 || rlen > cksize ) return 0;
switch ( type ) {
case ID_SURF: plist->pol[ i ].surf = ( lwSurface * ) j; break;
case ID_SURF: plist->pol[ i ].surf = ( lwSurface * ) ((size_t)j); break;
case ID_PART: plist->pol[ i ].part = j; break;
case ID_SMGP: plist->pol[ i ].smoothgrp = j; break;
}

View file

@ -182,7 +182,7 @@ float CalculateLightRadius(entity_t * e, bool outer)
if (!outer) {
if (iSpawnFlags & 2)
fIntensity *= .9;
fIntensity *= .9f;
else
fIntensity *= .25f;
}

View file

@ -1610,7 +1610,7 @@ static void on_lock_valuechange_togglebutton_toggled (GtkToggleButton *togglebut
{
bool is_Locked;
is_Locked = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(lock_valuechange_togglebutton));
is_Locked = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(lock_valuechange_togglebutton)) != false;
gtk_widget_set_sensitive( GTK_WIDGET( hscale_value_spinbutton ), is_Locked );
gtk_widget_set_sensitive( GTK_WIDGET( vscale_value_spinbutton ), is_Locked );

View file

@ -38,7 +38,7 @@ void BP_dialog_button_callback (GtkWidget *widget, gpointer data)
ret = (int*)g_object_get_data (G_OBJECT (parent), "ret");
*loop = 0;
*ret = (int)data;
*ret = GPOINTER_TO_INT (data);
}
gint BP_dialog_delete_callback (GtkWidget *widget, GdkEvent* event, gpointer data)

View file

@ -3141,10 +3141,10 @@ void Brush_Draw(brush_t *b)
if (!bTrans) {
if (face->texdef.flags & Q2_SURF_TRANS33) {
bTrans = true;
transVal = 0.33;
transVal = 0.33f;
} else if (face->texdef.flags & Q2_SURF_TRANS66) {
bTrans = true;
transVal = 0.66;
transVal = 0.66f;
}
}

View file

@ -3158,7 +3158,7 @@ int DoCapDlg (int *type, bool *b_GroupResult)
*type = IENDCAP; // *type = CapDialog::IENDCAP;
// Gef: Added toggle for optional cap func_grouping
*b_GroupResult = (bool *)gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(group_toggle));
*b_GroupResult = (bool)gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(group_toggle));
}
gtk_grab_remove (dlg);

View file

@ -859,7 +859,7 @@ void dialog_button_callback( GtkWidget *widget, gpointer data ) {
ret = (int*)g_object_get_data( G_OBJECT( parent ), "ret" );
*loop = 0;
*ret = (int)data;
*ret = GPOINTER_TO_INT (data);
}
gint dialog_delete_callback (GtkWidget *widget, GdkEvent* event, gpointer data)
@ -1037,7 +1037,7 @@ static void file_sel_callback (GtkWidget *widget, gpointer data)
loop = (int*)g_object_get_data (G_OBJECT (parent), "loop");
success = (bool*)g_object_get_data (G_OBJECT (parent), "success");
if ((int)data == IDOK)
if (GPOINTER_TO_INT (data) == IDOK)
*success = true;
#ifdef FILEDLG_DBG

View file

@ -81,7 +81,7 @@ URL adds an optional 'go to URL' button
int WINAPI gtk_MessageBox (void *parent, const char* lpText, const char* lpCaption = "Radiant", guint32 uType = MB_OK, const char* URL = NULL);
// NOTE: the returned filename is allocated with g_malloc and MUST be freed with g_free (both for win32 and Gtk dialogs)
// GtkWidget *parent
const char* file_dialog (void *parent, gboolean open, const char* title, const char* path = (char*)NULL, const char* pattern = NULL, const char *baseSubDir = NULL);
const gchar* file_dialog (void *parent, gboolean open, const char* title, const char* path = (char*)NULL, const char* pattern = NULL, const char *baseSubDir = NULL);
/*!
\fn dir_dialog, prompts for a directory

View file

@ -208,11 +208,11 @@ EPathCheck CheckFile( const char *path ) {
}
bool radCreateDirectory( const char *directory ) {
return CreateDirectory( directory, NULL );
return CreateDirectory( directory, NULL ) != false;
}
bool radCopyFile( const char *lpExistingFileName, const char *lpNewFileName ) {
return CopyFile( lpExistingFileName, lpNewFileName, FALSE );
return CopyFile( lpExistingFileName, lpNewFileName, FALSE ) != false;
}
#endif

View file

@ -7,7 +7,8 @@
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "afxres.h"
//#include "afxres.h"
#include "windows.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS

View file

@ -60,7 +60,7 @@
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="l_net.lib cmdlib.lib mathlib.lib Wsock32.lib libxml2.lib glib-2.0.lib gobject-2.0.lib gdk-win32-2.0.lib gtk-win32-2.0.lib gtkglext-win32-1.0.lib gdkglext-win32-1.0.lib pango-1.0.lib"
AdditionalDependencies="user32.lib shell32.lib gdi32.lib comdlg32.lib l_net.lib cmdlib.lib mathlib.lib Wsock32.lib libxml2.lib glib-2.0.lib gobject-2.0.lib gdk-win32-2.0.lib gtk-win32-2.0.lib gtkglext-win32-1.0.lib gdkglext-win32-1.0.lib pango-1.0.lib intl.lib"
AdditionalLibraryDirectories="&quot;$(SolutionDir)\..\libxml2\lib&quot;;&quot;$(SolutionDir)\..\gtk2\lib&quot;;&quot;$(SolutionDir)\build\$(ConfigurationName)\libs&quot;"
GenerateDebugInformation="true"
TargetMachine="1"
@ -134,7 +134,7 @@
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="l_net.lib cmdlib.lib mathlib.lib Wsock32.lib libxml2.lib glib-2.0.lib gobject-2.0.lib gdk-win32-2.0.lib gtk-win32-2.0.lib gtkglext-win32-1.0.lib gdkglext-win32-1.0.lib pango-1.0.lib"
AdditionalDependencies="user32.lib shell32.lib gdi32.lib comdlg32.lib l_net.lib cmdlib.lib mathlib.lib Wsock32.lib libxml2.lib glib-2.0.lib gobject-2.0.lib gdk-win32-2.0.lib gtk-win32-2.0.lib gtkglext-win32-1.0.lib gdkglext-win32-1.0.lib pango-1.0.lib intl.lib"
AdditionalLibraryDirectories="&quot;$(SolutionDir)\..\libxml2\lib&quot;;&quot;$(SolutionDir)\..\gtk2\lib&quot;;&quot;$(SolutionDir)\build\$(ConfigurationName)\libs&quot;"
GenerateDebugInformation="true"
OptimizeReferences="2"
@ -997,11 +997,11 @@
>
</File>
<File
RelativePath="..\..\src\gtk+\gtk\gtkmisc.h"
RelativePath=".\gtkmisc.h"
>
</File>
<File
RelativePath=".\gtkmisc.h"
RelativePath="..\..\src\gtk+\gtk\gtkmisc.h"
>
</File>
<File
@ -2413,6 +2413,10 @@
<Filter
Name="Misc"
>
<File
RelativePath="..\..\src\gtk+\gdk\win32\makefile.msc"
>
</File>
<File
RelativePath="..\..\src\gtk+\gtk\makefile.msc"
>
@ -2425,10 +2429,6 @@
RelativePath="..\..\src\gtk+\gdk\makefile.msc"
>
</File>
<File
RelativePath="..\..\src\gtk+\gdk\win32\makefile.msc"
>
</File>
</Filter>
<File
RelativePath="..\setup\changelog.txt"

View file

@ -55,7 +55,7 @@ brush_t* WINAPI QERApp_GetSelectedFaceBrush(int iface)
// NOTE: we expect pWinding to have MAX_POINTS_ON_WINDING points ready for writing
int WINAPI QERApp_GetFaceInfo(int iface, _QERFaceData *pFaceData, winding_t *pWinding)
{
int size;
size_t size;
if (iface>=g_ptrSelectedFaces.GetSize())
{
@ -74,7 +74,7 @@ int WINAPI QERApp_GetFaceInfo(int iface, _QERFaceData *pFaceData, winding_t *pWi
VectorCopy( selFace->planepts[2], pFaceData->m_v3 );
pFaceData->m_bBPrimit = true;
memcpy( &pFaceData->brushprimit_texdef, &selFace->brushprimit_texdef, sizeof(brushprimit_texdef_t) );
size = (int)((winding_t *)0)->points[selFace->face_winding->numpoints];
size = (size_t)((winding_t *)0)->points[selFace->face_winding->numpoints];
memcpy( pWinding, selFace->face_winding, size );
return 1;
}

View file

@ -250,7 +250,7 @@ void Winding_RemovePoint(winding_t *w, int point)
if (point < w->numpoints-1)
{
memmove(&w->points[point], &w->points[point+1], (int)((winding_t *)0)->points[w->numpoints - point - 1]);
memmove(&w->points[point], &w->points[point+1], (size_t)((winding_t *)0)->points[w->numpoints - point - 1]);
}
w->numpoints--;
}

View file

@ -27,7 +27,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#include <sys/types.h>
#include <sys/stat.h>
#ifdef _WIN32
#ifdef WIN32
#include <direct.h>
#include <windows.h>
#endif
@ -93,7 +93,7 @@ Mimic unix command line expansion
#define MAX_EX_ARGC 1024
int ex_argc;
char *ex_argv[MAX_EX_ARGC];
#ifdef _WIN32
#ifdef WIN32
#include "io.h"
void ExpandWildcards( int *argc, char ***argv )
{
@ -337,7 +337,7 @@ void Q_getwd (char *out)
{
int i = 0;
#ifdef _WIN32
#ifdef WIN32
_getcwd (out, 256);
strcat (out, "\\");
#else
@ -356,7 +356,7 @@ void Q_getwd (char *out)
void Q_mkdir (const char *path)
{
#ifdef _WIN32
#ifdef WIN32
if (_mkdir (path) != -1)
return;
#else
@ -1159,7 +1159,7 @@ void CreatePath (const char *path)
char c;
char dir[1024];
#ifdef _WIN32
#ifdef WIN32
int olddrive = -1;
if ( path[1] == ':' )
@ -1183,7 +1183,7 @@ void CreatePath (const char *path)
}
}
#ifdef _WIN32
#ifdef WIN32
if ( olddrive != -1 )
{
_chdrive( olddrive );
@ -1212,7 +1212,7 @@ void QCopyFile (const char *from, const char *to)
void Sys_Sleep(int n)
{
#ifdef _WIN32
#ifdef WIN32
Sleep (n);
#endif
#if defined (__linux__) || defined (__APPLE__)

View file

@ -32,7 +32,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#include <time.h>
#include <stdarg.h>
#ifdef _WIN32
#ifdef WIN32
#ifdef NDEBUG // Don't show in a Release build
#pragma warning(disable : 4305) // truncate from double to float
#pragma warning(disable : 4244) // conversion from double to float
@ -40,7 +40,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#endif
#endif
#ifdef _WIN32
#ifdef WIN32
#pragma intrinsic( memset, memcpy )
#endif

View file

@ -33,7 +33,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#include <sys/types.h>
#include <sys/stat.h>
#ifdef _WIN32
#ifdef WIN32
#include <direct.h>
#include <windows.h>
#endif
@ -42,7 +42,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#include "l_net/l_net.h"
#include "libxml/tree.h"
#ifdef _WIN32
#ifdef WIN32
HWND hwndOut = NULL;
qboolean lookedForServer = false;
UINT wm_BroadcastCommand = -1;

View file

@ -1,4 +1,5 @@
/*
/* -------------------------------------------------------------------------------
Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
@ -17,6 +18,9 @@ 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
Nurail: Swiped from Q3Map2
*/

View file

@ -32,7 +32,7 @@ The .pak files are just a linear collapse of a directory tree
========================================================================
*/
#ifdef _WIN32
#ifdef WIN32
#ifdef NDEBUG // Don't show in a Release build
#pragma warning(disable : 4305) // truncate from double to float
#pragma warning(disable : 4244) // conversion from double to float

View file

@ -110,7 +110,7 @@ WIN32
===================================================================
*/
#ifdef _WIN32
#ifdef WIN32
#define USED

View file

@ -31,7 +31,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#include <limits.h>
#endif
#ifdef _WIN32
#ifdef WIN32
#include <windows.h>
#endif

View file

@ -46,7 +46,7 @@ writebsp.c
#include "bspfile.h"
#include "inout.h"
#ifdef _WIN32
#ifdef WIN32
#ifdef NDEBUG // Don't show in a Release build
#pragma warning(disable : 4305) // truncate from double to float
#pragma warning(disable : 4244) // conversion from double to float

View file

@ -36,11 +36,11 @@ trace.c
#include "lbmlib.h"
#include "inout.h"
#ifdef _WIN32
#ifdef WIN32
#include <windows.h>
#endif
#ifdef _WIN32
#ifdef WIN32
#ifdef NDEBUG // Don't show in a Release build
#pragma warning(disable : 4305) // truncate from double to float
#pragma warning(disable : 4244) // conversion from double to float

View file

@ -30,7 +30,7 @@ qvis3.c
#include "bspfile.h"
#include "inout.h"
#ifdef _WIN32
#ifdef WIN32
#ifdef NDEBUG // Don't show in a Release build
#pragma warning(disable : 4305) // truncate from double to float
#pragma warning(disable : 4244) // conversion from double to float

View file

@ -495,17 +495,31 @@ void BeginBSPFile (void)
EndBSPFile
============
*/
void EndBSPFile( void ) {
void EndBSPFile (void)
{
char path[1024];
EmitBrushes();
EmitPlanes();
UnparseEntities();
#if 0
int len;
byte *buf;
#endif
EmitBrushes ();
EmitPlanes ();
UnparseEntities ();
// load the pop
#if 0
sprintf (path, "%s/pics/pop.lmp", gamedir);
len = LoadFile (path, &buf);
memcpy (dpop, buf, sizeof(dpop));
free (buf);
#endif
// write the map
sprintf( path, "%s.bsp", source );
Sys_Printf( "Writing %s\n", path );
WriteBSPFile( path );
sprintf (path, "%s.bsp", source);
Sys_Printf ("Writing %s\n", path);
WriteBSPFile (path);
}

View file

@ -1,3 +1,24 @@
/*
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 "qdata.h"
#include "inout.h"

View file

@ -1,3 +1,23 @@
/*
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 "qdata.h"
#include "inout.h"

View file

@ -1,3 +1,24 @@
/*
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 "qdata.h"
#include "inout.h"
@ -26,6 +47,8 @@ void InitPaths( int *argc, char **argv );
=======================================================
*/
unsigned Com_BlockChecksum (void *buffer, int length);
typedef struct
{
char name[56];
@ -143,6 +166,7 @@ void FinishPak (void)
int dirlen;
int d;
int i;
unsigned checksum;
if (!g_pak)
return;
@ -155,6 +179,8 @@ void FinishPak (void)
pakheader.dirofs = LittleLong(ftell(pakfile));
pakheader.dirlen = LittleLong(dirlen);
checksum = Com_BlockChecksum ( (void *)pfiles, dirlen );
SafeWrite (pakfile, pfiles, dirlen);
i = ftell (pakfile);
@ -165,6 +191,7 @@ void FinishPak (void)
d = pf - pfiles;
printf ("%i files packed in %i bytes\n",d, i);
printf ("checksum: 0x%x\n", checksum);
}

View file

@ -1,5 +1,23 @@
// qdata.h
/*
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 <stdlib.h>
#include <stdio.h>
@ -16,7 +34,7 @@
#include "l3dslib.h"
#include "bspfile.h"
#ifdef _WIN32
#ifdef WIN32
#ifdef NDEBUG // Don't show in a Release build
#pragma warning(disable : 4305) // truncate from double to float
#pragma warning(disable : 4244) // conversion from double to float

View file

@ -1,3 +1,23 @@
/*
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 "qdata.h"
#include "inout.h"

View file

@ -1,3 +1,24 @@
/*
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 "qdata.h"
/*

View file

@ -1,3 +1,24 @@
/*
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 "qdata.h"
#include "inout.h"

View file

@ -181,3 +181,4 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
{-0.425325f, -0.688191f, -0.587785f},
{-0.587785f, -0.425325f, -0.688191f},
{-0.688191f, -0.587785f, -0.425325f},

View file

@ -27,7 +27,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#include <sys/types.h>
#include <sys/stat.h>
#ifdef _WIN32
#ifdef WIN32
#include <direct.h>
#include <windows.h>
#endif
@ -356,7 +356,7 @@ void Q_getwd (char *out)
{
int i = 0;
#ifdef _WIN32
#ifdef WIN32
_getcwd (out, 256);
strcat (out, "\\");
#else
@ -375,7 +375,7 @@ void Q_getwd (char *out)
void Q_mkdir (const char *path)
{
#ifdef _WIN32
#ifdef WIN32
if (_mkdir (path) != -1)
return;
#else
@ -1229,7 +1229,7 @@ void QCopyFile (const char *from, const char *to)
void Sys_Sleep(int n)
{
#ifdef _WIN32
#ifdef WIN32
Sleep (n);
#endif
#if defined (__linux__) || defined (__APPLE__)

View file

@ -33,7 +33,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#include <sys/types.h>
#include <sys/stat.h>
#ifdef _WIN32
#ifdef WIN32
#include <direct.h>
#include <windows.h>
#endif
@ -42,7 +42,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#include "l_net/l_net.h"
#include "libxml/tree.h"
#ifdef _WIN32
#ifdef WIN32
HWND hwndOut = NULL;
qboolean lookedForServer = false;
UINT wm_BroadcastCommand = -1;

View file

@ -0,0 +1,298 @@
/*
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
*/
/* GLOBAL.H - RSAREF types and constants */
#include <string.h>
/* POINTER defines a generic pointer type */
typedef unsigned char *POINTER;
/* UINT2 defines a two byte word */
typedef unsigned short int UINT2;
/* UINT4 defines a four byte word */
typedef unsigned long int UINT4;
/* MD4.H - header file for MD4C.C */
/* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991.
All rights reserved.
License to copy and use this software is granted provided that it is identified as the RSA Data Security, Inc. MD4 Message-Digest Algorithm in all material mentioning or referencing this software or this function.
License is also granted to make and use derivative works provided that such works are identified as derived from the RSA Data Security, Inc. MD4 Message-Digest Algorithm in all material mentioning or referencing the derived work.
RSA Data Security, Inc. makes no representations concerning either the merchantability of this software or the suitability of this software for any particular purpose. It is provided as is without express or implied warranty of any kind.
These notices must be retained in any copies of any part of this documentation and/or software. */
/* MD4 context. */
typedef struct {
UINT4 state[4]; /* state (ABCD) */
UINT4 count[2]; /* number of bits, modulo 2^64 (lsb first) */
unsigned char buffer[64]; /* input buffer */
} MD4_CTX;
void MD4Init (MD4_CTX *);
void MD4Update (MD4_CTX *, unsigned char *, unsigned int);
void MD4Final (unsigned char [16], MD4_CTX *);
/* MD4C.C - RSA Data Security, Inc., MD4 message-digest algorithm */
/* Copyright (C) 1990-2, RSA Data Security, Inc. All rights reserved.
License to copy and use this software is granted provided that it is identified as the
RSA Data Security, Inc. MD4 Message-Digest Algorithm
in all material mentioning or referencing this software or this function.
License is also granted to make and use derivative works provided that such works are identified as
derived from the RSA Data Security, Inc. MD4 Message-Digest Algorithm
in all material mentioning or referencing the derived work.
RSA Data Security, Inc. makes no representations concerning either the merchantability of this software or the suitability of this software for any particular purpose. It is provided
as is without express or implied warranty of any kind.
These notices must be retained in any copies of any part of this documentation and/or software. */
/* Constants for MD4Transform routine. */
#define S11 3
#define S12 7
#define S13 11
#define S14 19
#define S21 3
#define S22 5
#define S23 9
#define S24 13
#define S31 3
#define S32 9
#define S33 11
#define S34 15
static void MD4Transform (UINT4 [4], unsigned char [64]);
static void Encode (unsigned char *, UINT4 *, unsigned int);
static void Decode (UINT4 *, unsigned char *, unsigned int);
static void MD4_memcpy (POINTER, POINTER, unsigned int);
static void MD4_memset (POINTER, int, unsigned int);
static unsigned char PADDING[64] = {
0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
};
/* F, G and H are basic MD4 functions. */
#define F(x, y, z) (((x) & (y)) | ((~x) & (z)))
#define G(x, y, z) (((x) & (y)) | ((x) & (z)) | ((y) & (z)))
#define H(x, y, z) ((x) ^ (y) ^ (z))
/* ROTATE_LEFT rotates x left n bits. */
#define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32-(n))))
/* FF, GG and HH are transformations for rounds 1, 2 and 3 */
/* Rotation is separate from addition to prevent recomputation */
#define FF(a, b, c, d, x, s) {(a) += F ((b), (c), (d)) + (x); (a) = ROTATE_LEFT ((a), (s));}
#define GG(a, b, c, d, x, s) {(a) += G ((b), (c), (d)) + (x) + (UINT4)0x5a827999; (a) = ROTATE_LEFT ((a), (s));}
#define HH(a, b, c, d, x, s) {(a) += H ((b), (c), (d)) + (x) + (UINT4)0x6ed9eba1; (a) = \
ROTATE_LEFT ((a), (s)); }
/* MD4 initialization. Begins an MD4 operation, writing a new context. */
void MD4Init (MD4_CTX *context)
{
context->count[0] = context->count[1] = 0;
/* Load magic initialization constants.*/
context->state[0] = 0x67452301;
context->state[1] = 0xefcdab89;
context->state[2] = 0x98badcfe;
context->state[3] = 0x10325476;
}
/* MD4 block update operation. Continues an MD4 message-digest operation, processing another message block, and updating the context. */
void MD4Update (MD4_CTX *context, unsigned char *input, unsigned int inputLen)
{
unsigned int i, index, partLen;
/* Compute number of bytes mod 64 */
index = (unsigned int)((context->count[0] >> 3) & 0x3F);
/* Update number of bits */
if ((context->count[0] += ((UINT4)inputLen << 3))< ((UINT4)inputLen << 3))
context->count[1]++;
context->count[1] += ((UINT4)inputLen >> 29);
partLen = 64 - index;
/* Transform as many times as possible.*/
if (inputLen >= partLen)
{
memcpy((POINTER)&context->buffer[index], (POINTER)input, partLen);
MD4Transform (context->state, context->buffer);
for (i = partLen; i + 63 < inputLen; i += 64)
MD4Transform (context->state, &input[i]);
index = 0;
}
else
i = 0;
/* Buffer remaining input */
memcpy ((POINTER)&context->buffer[index], (POINTER)&input[i], inputLen-i);
}
/* MD4 finalization. Ends an MD4 message-digest operation, writing the the message digest and zeroizing the context. */
void MD4Final (unsigned char digest[16], MD4_CTX *context)
{
unsigned char bits[8];
unsigned int index, padLen;
/* Save number of bits */
Encode (bits, context->count, 8);
/* Pad out to 56 mod 64.*/
index = (unsigned int)((context->count[0] >> 3) & 0x3f);
padLen = (index < 56) ? (56 - index) : (120 - index);
MD4Update (context, PADDING, padLen);
/* Append length (before padding) */
MD4Update (context, bits, 8);
/* Store state in digest */
Encode (digest, context->state, 16);
/* Zeroize sensitive information.*/
memset ((POINTER)context, 0, sizeof (*context));
}
/* MD4 basic transformation. Transforms state based on block. */
static void MD4Transform (UINT4 state[4], unsigned char block[64])
{
UINT4 a = state[0], b = state[1], c = state[2], d = state[3], x[16];
Decode (x, block, 64);
/* Round 1 */
FF (a, b, c, d, x[ 0], S11); /* 1 */
FF (d, a, b, c, x[ 1], S12); /* 2 */
FF (c, d, a, b, x[ 2], S13); /* 3 */
FF (b, c, d, a, x[ 3], S14); /* 4 */
FF (a, b, c, d, x[ 4], S11); /* 5 */
FF (d, a, b, c, x[ 5], S12); /* 6 */
FF (c, d, a, b, x[ 6], S13); /* 7 */
FF (b, c, d, a, x[ 7], S14); /* 8 */
FF (a, b, c, d, x[ 8], S11); /* 9 */
FF (d, a, b, c, x[ 9], S12); /* 10 */
FF (c, d, a, b, x[10], S13); /* 11 */
FF (b, c, d, a, x[11], S14); /* 12 */
FF (a, b, c, d, x[12], S11); /* 13 */
FF (d, a, b, c, x[13], S12); /* 14 */
FF (c, d, a, b, x[14], S13); /* 15 */
FF (b, c, d, a, x[15], S14); /* 16 */
/* Round 2 */
GG (a, b, c, d, x[ 0], S21); /* 17 */
GG (d, a, b, c, x[ 4], S22); /* 18 */
GG (c, d, a, b, x[ 8], S23); /* 19 */
GG (b, c, d, a, x[12], S24); /* 20 */
GG (a, b, c, d, x[ 1], S21); /* 21 */
GG (d, a, b, c, x[ 5], S22); /* 22 */
GG (c, d, a, b, x[ 9], S23); /* 23 */
GG (b, c, d, a, x[13], S24); /* 24 */
GG (a, b, c, d, x[ 2], S21); /* 25 */
GG (d, a, b, c, x[ 6], S22); /* 26 */
GG (c, d, a, b, x[10], S23); /* 27 */
GG (b, c, d, a, x[14], S24); /* 28 */
GG (a, b, c, d, x[ 3], S21); /* 29 */
GG (d, a, b, c, x[ 7], S22); /* 30 */
GG (c, d, a, b, x[11], S23); /* 31 */
GG (b, c, d, a, x[15], S24); /* 32 */
/* Round 3 */
HH (a, b, c, d, x[ 0], S31); /* 33 */
HH (d, a, b, c, x[ 8], S32); /* 34 */
HH (c, d, a, b, x[ 4], S33); /* 35 */
HH (b, c, d, a, x[12], S34); /* 36 */
HH (a, b, c, d, x[ 2], S31); /* 37 */
HH (d, a, b, c, x[10], S32); /* 38 */
HH (c, d, a, b, x[ 6], S33); /* 39 */
HH (b, c, d, a, x[14], S34); /* 40 */
HH (a, b, c, d, x[ 1], S31); /* 41 */
HH (d, a, b, c, x[ 9], S32); /* 42 */
HH (c, d, a, b, x[ 5], S33); /* 43 */
HH (b, c, d, a, x[13], S34); /* 44 */
HH (a, b, c, d, x[ 3], S31); /* 45 */
HH (d, a, b, c, x[11], S32); /* 46 */
HH (c, d, a, b, x[ 7], S33); /* 47 */
HH (b, c, d, a, x[15], S34); /* 48 */
state[0] += a;
state[1] += b;
state[2] += c;
state[3] += d;
/* Zeroize sensitive information.*/
memset ((POINTER)x, 0, sizeof (x));
}
/* Encodes input (UINT4) into output (unsigned char). Assumes len is a multiple of 4. */
static void Encode (unsigned char *output, UINT4 *input, unsigned int len)
{
unsigned int i, j;
for (i = 0, j = 0; j < len; i++, j += 4) {
output[j] = (unsigned char)(input[i] & 0xff);
output[j+1] = (unsigned char)((input[i] >> 8) & 0xff);
output[j+2] = (unsigned char)((input[i] >> 16) & 0xff);
output[j+3] = (unsigned char)((input[i] >> 24) & 0xff);
}
}
/* Decodes input (unsigned char) into output (UINT4). Assumes len is a multiple of 4. */
static void Decode (UINT4 *output, unsigned char *input, unsigned int len)
{
unsigned int i, j;
for (i = 0, j = 0; j < len; i++, j += 4)
output[i] = ((UINT4)input[j]) | (((UINT4)input[j+1]) << 8) | (((UINT4)input[j+2]) << 16) | (((UINT4)input[j+3]) << 24);
}
//===================================================================
unsigned Com_BlockChecksum (void *buffer, int length)
{
int digest[4];
unsigned val;
MD4_CTX ctx;
MD4Init (&ctx);
MD4Update (&ctx, (unsigned char *)buffer, length);
MD4Final ( (unsigned char *)digest, &ctx);
val = digest[0] ^ digest[1] ^ digest[2] ^ digest[3];
return val;
}

View file

@ -1,4 +1,5 @@
/*
/* -------------------------------------------------------------------------------
Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.

View file

@ -110,7 +110,7 @@ WIN32
===================================================================
*/
#ifdef _WIN32
#ifdef WIN32
#define USED

View file

@ -55,6 +55,8 @@ extern qboolean g_nomkdir;
=======================================================
*/
unsigned Com_BlockChecksum (void *buffer, int length);
typedef struct
{
char name[56];
@ -153,6 +155,7 @@ void FinishPak (void)
int dirlen;
int d;
int i;
unsigned checksum;
if (!g_pak)
return;
@ -165,6 +168,8 @@ void FinishPak (void)
pakheader.dirofs = LittleLong(ftell(pakfile));
pakheader.dirlen = LittleLong(dirlen);
checksum = Com_BlockChecksum ( (void *)pfiles, dirlen );
SafeWrite (pakfile, pfiles, dirlen);
i = ftell (pakfile);
@ -175,6 +180,7 @@ void FinishPak (void)
d = pf - pfiles;
printf ("%i files packed in %i bytes\n",d, i);
printf ("checksum: 0x%x\n", checksum);
}

View file

@ -333,7 +333,7 @@ void Q_getwd (char *out)
{
int i = 0;
#ifdef _WIN32
#ifdef WIN32
_getcwd (out, 256);
strcat (out, "\\");
#else
@ -352,7 +352,7 @@ void Q_getwd (char *out)
void Q_mkdir (const char *path)
{
#ifdef _WIN32
#ifdef WIN32
if (_mkdir (path) != -1)
return;
#else
@ -1144,7 +1144,7 @@ void QCopyFile (const char *from, const char *to)
void Sys_Sleep(int n)
{
#ifdef _WIN32
#ifdef WIN32
Sleep (n);
#endif
#if defined (__linux__) || defined (__APPLE__)

View file

@ -21,6 +21,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
// imagelib.c
#include "inout.h"
#include "cmdlib.h"
#include "imagelib.h"
#include "vfs.h"
@ -884,233 +885,242 @@ typedef struct _TargaHeader {
unsigned char pixel_size, attributes;
} TargaHeader;
void TargaError(TargaHeader *t, const char *message)
{
Sys_Printf("%s\n:TargaHeader:\nuint8 id_length = %i;\nuint8 colormap_type = %i;\nuint8 image_type = %i;\nuint16 colormap_index = %i;\nuint16 colormap_length = %i;\nuint8 colormap_size = %i;\nuint16 x_origin = %i;\nuint16 y_origin = %i;\nuint16 width = %i;\nuint16 height = %i;\nuint8 pixel_size = %i;\nuint8 attributes = %i;\n", message, t->id_length, t->colormap_type, t->image_type, t->colormap_index, t->colormap_length, t->colormap_size, t->x_origin, t->y_origin, t->width, t->height, t->pixel_size, t->attributes);
}
/*
=============
LoadTGABuffer
=============
*/
void LoadTGABuffer ( byte *buffer, byte **pic, int *width, int *height)
void LoadTGABuffer (const byte *f, const byte *enddata, byte **pic, int *width, int *height)
{
int columns, rows, numPixels;
byte *pixbuf;
int row, column;
byte *buf_p;
int x, y, row_inc, compressed, readpixelcount, red, green, blue, alpha, runlen, pindex, alphabits, image_width, image_height;
byte *pixbuf, *image_rgba;
const byte *fin;
unsigned char *p;
TargaHeader targa_header;
byte *targa_rgba;
unsigned char palette[256*4];
*pic = NULL;
buf_p = buffer;
// abort if it is too small to parse
if (enddata - f < 19)
return;
targa_header.id_length = *buf_p++;
targa_header.colormap_type = *buf_p++;
targa_header.image_type = *buf_p++;
targa_header.id_length = f[0];
targa_header.colormap_type = f[1];
targa_header.image_type = f[2];
targa_header.colormap_index = LittleShort ( *(short *)buf_p );
buf_p += 2;
targa_header.colormap_length = LittleShort ( *(short *)buf_p );
buf_p += 2;
targa_header.colormap_size = *buf_p++;
targa_header.x_origin = LittleShort ( *(short *)buf_p );
buf_p += 2;
targa_header.y_origin = LittleShort ( *(short *)buf_p );
buf_p += 2;
targa_header.width = LittleShort ( *(short *)buf_p );
buf_p += 2;
targa_header.height = LittleShort ( *(short *)buf_p );
buf_p += 2;
targa_header.pixel_size = *buf_p++;
targa_header.attributes = *buf_p++;
targa_header.colormap_index = f[3] + f[4] * 256;
targa_header.colormap_length = f[5] + f[6] * 256;
targa_header.colormap_size = f[7];
targa_header.x_origin = f[8] + f[9] * 256;
targa_header.y_origin = f[10] + f[11] * 256;
targa_header.width = image_width = f[12] + f[13] * 256;
targa_header.height = image_height = f[14] + f[15] * 256;
if (targa_header.image_type!=2
&& targa_header.image_type!=10
&& targa_header.image_type != 3 )
targa_header.pixel_size = f[16];
targa_header.attributes = f[17];
// advance to end of header
fin = f + 18;
// skip TARGA image comment (usually 0 bytes)
fin += targa_header.id_length;
// read/skip the colormap if present (note: according to the TARGA spec it
// can be present even on truecolor or greyscale images, just not used by
// the image data)
if (targa_header.colormap_type)
{
Error("LoadTGA: Only type 2 (RGB), 3 (gray), and 10 (RGB) TGA images supported\n");
if (targa_header.colormap_length > 256)
{
TargaError(&targa_header, "LoadTGA: only up to 256 colormap_length supported\n");
return;
}
if (targa_header.colormap_index)
{
TargaError(&targa_header, "LoadTGA: colormap_index not supported\n");
return;
}
if (targa_header.colormap_size == 24)
{
for (x = 0;x < targa_header.colormap_length;x++)
{
palette[x*4+2] = *fin++;
palette[x*4+1] = *fin++;
palette[x*4+0] = *fin++;
palette[x*4+3] = 255;
}
}
else if (targa_header.colormap_size == 32)
{
for (x = 0;x < targa_header.colormap_length;x++)
{
palette[x*4+2] = *fin++;
palette[x*4+1] = *fin++;
palette[x*4+0] = *fin++;
palette[x*4+3] = *fin++;
}
}
else
{
TargaError(&targa_header, "LoadTGA: Only 32 and 24 bit colormap_size supported\n");
return;
}
}
if ( targa_header.colormap_type != 0 )
// check our pixel_size restrictions according to image_type
if (targa_header.image_type == 2 || targa_header.image_type == 10)
{
Error("LoadTGA: colormaps not supported\n" );
if (targa_header.pixel_size != 24 && targa_header.pixel_size != 32)
{
TargaError(&targa_header, "LoadTGA: only 24bit and 32bit pixel sizes supported for type 2 and type 10 images\n");
return;
}
}
else if (targa_header.image_type == 1 || targa_header.image_type == 9)
{
if (targa_header.pixel_size != 8)
{
TargaError(&targa_header, "LoadTGA: only 8bit pixel size for type 1, 3, 9, and 11 images supported\n");
return;
}
}
else if (targa_header.image_type == 3 || targa_header.image_type == 11)
{
if (targa_header.pixel_size != 8)
{
TargaError(&targa_header, "LoadTGA: only 8bit pixel size for type 1, 3, 9, and 11 images supported\n");
return;
}
}
else
{
TargaError(&targa_header, "LoadTGA: Only type 1, 2, 3, 9, 10, and 11 targa RGB images supported");
return;
}
if ( ( targa_header.pixel_size != 32 && targa_header.pixel_size != 24 ) && targa_header.image_type != 3 )
if (targa_header.attributes & 0x10)
{
Error("LoadTGA: Only 32 or 24 bit images supported (no colormaps)\n");
TargaError(&targa_header, "LoadTGA: origin must be in top left or bottom left, top right and bottom right are not supported\n");
return;
}
columns = targa_header.width;
rows = targa_header.height;
numPixels = columns * rows;
// number of attribute bits per pixel, we only support 0 or 8
alphabits = targa_header.attributes & 0x0F;
if (alphabits != 8 && alphabits != 0)
{
TargaError(&targa_header, "LoadTGA: only 0 or 8 attribute (alpha) bits supported\n");
return;
}
image_rgba = safe_malloc(image_width * image_height * 4);
if (!image_rgba)
{
Sys_Printf("LoadTGA: not enough memory for %i by %i image\n", image_width, image_height);
return;
}
// If bit 5 of attributes isn't set, the image has been stored from bottom to top
if ((targa_header.attributes & 0x20) == 0)
{
pixbuf = image_rgba + (image_height - 1)*image_width*4;
row_inc = -image_width*4*2;
}
else
{
pixbuf = image_rgba;
row_inc = 0;
}
compressed = targa_header.image_type == 9 || targa_header.image_type == 10 || targa_header.image_type == 11;
x = 0;
y = 0;
red = green = blue = alpha = 255;
while (y < image_height)
{
// decoder is mostly the same whether it's compressed or not
readpixelcount = 1000000;
runlen = 1000000;
if (compressed && fin < enddata)
{
runlen = *fin++;
// high bit indicates this is an RLE compressed run
if (runlen & 0x80)
readpixelcount = 1;
runlen = 1 + (runlen & 0x7f);
}
while((runlen--) && y < image_height)
{
if (readpixelcount > 0)
{
readpixelcount--;
red = green = blue = alpha = 255;
if (fin < enddata)
{
switch(targa_header.image_type)
{
case 1:
case 9:
// colormapped
pindex = *fin++;
if (pindex >= targa_header.colormap_length)
pindex = 0; // error
p = palette + pindex * 4;
red = p[0];
green = p[1];
blue = p[2];
alpha = p[3];
break;
case 2:
case 10:
// BGR or BGRA
blue = *fin++;
if (fin < enddata)
green = *fin++;
if (fin < enddata)
red = *fin++;
if (targa_header.pixel_size == 32 && fin < enddata)
alpha = *fin++;
break;
case 3:
case 11:
// greyscale
red = green = blue = *fin++;
break;
}
if (!alphabits)
alpha = 255;
}
}
*pixbuf++ = red;
*pixbuf++ = green;
*pixbuf++ = blue;
*pixbuf++ = alpha;
x++;
if (x == image_width)
{
// end of line, advance to next
x = 0;
y++;
pixbuf += row_inc;
}
}
}
*pic = image_rgba;
if (width)
*width = columns;
*width = image_width;
if (height)
*height = rows;
targa_rgba = safe_malloc (numPixels*4);
*pic = targa_rgba;
if (targa_header.id_length != 0)
buf_p += targa_header.id_length; // skip TARGA image comment
if ( targa_header.image_type==2 || targa_header.image_type == 3 )
{
// Uncompressed RGB or gray scale image
for(row=rows-1; row>=0; row--)
{
pixbuf = targa_rgba + row*columns*4;
for(column=0; column<columns; column++)
{
unsigned char red,green,blue,alphabyte;
switch (targa_header.pixel_size)
{
case 8:
blue = *buf_p++;
green = blue;
red = blue;
*pixbuf++ = red;
*pixbuf++ = green;
*pixbuf++ = blue;
*pixbuf++ = 255;
break;
case 24:
blue = *buf_p++;
green = *buf_p++;
red = *buf_p++;
*pixbuf++ = red;
*pixbuf++ = green;
*pixbuf++ = blue;
*pixbuf++ = 255;
break;
case 32:
blue = *buf_p++;
green = *buf_p++;
red = *buf_p++;
alphabyte = *buf_p++;
*pixbuf++ = red;
*pixbuf++ = green;
*pixbuf++ = blue;
*pixbuf++ = alphabyte;
break;
default:
//Error("LoadTGA: illegal pixel_size '%d' in file '%s'\n", targa_header.pixel_size, name );
break;
}
}
}
}
else if (targa_header.image_type==10) { // Runlength encoded RGB images
unsigned char red,green,blue,alphabyte,packetHeader,packetSize,j;
red = 0;
green = 0;
blue = 0;
alphabyte = 0xff;
for(row=rows-1; row>=0; row--) {
pixbuf = targa_rgba + row*columns*4;
for(column=0; column<columns; ) {
packetHeader= *buf_p++;
packetSize = 1 + (packetHeader & 0x7f);
if (packetHeader & 0x80) { // run-length packet
switch (targa_header.pixel_size) {
case 24:
blue = *buf_p++;
green = *buf_p++;
red = *buf_p++;
alphabyte = 255;
break;
case 32:
blue = *buf_p++;
green = *buf_p++;
red = *buf_p++;
alphabyte = *buf_p++;
break;
default:
//Error("LoadTGA: illegal pixel_size '%d' in file '%s'\n", targa_header.pixel_size, name );
break;
}
for(j=0;j<packetSize;j++) {
*pixbuf++=red;
*pixbuf++=green;
*pixbuf++=blue;
*pixbuf++=alphabyte;
column++;
if (column==columns) { // run spans across rows
column=0;
if (row>0)
row--;
else
goto breakOut;
pixbuf = targa_rgba + row*columns*4;
}
}
}
else { // non run-length packet
for(j=0;j<packetSize;j++) {
switch (targa_header.pixel_size) {
case 24:
blue = *buf_p++;
green = *buf_p++;
red = *buf_p++;
*pixbuf++ = red;
*pixbuf++ = green;
*pixbuf++ = blue;
*pixbuf++ = 255;
break;
case 32:
blue = *buf_p++;
green = *buf_p++;
red = *buf_p++;
alphabyte = *buf_p++;
*pixbuf++ = red;
*pixbuf++ = green;
*pixbuf++ = blue;
*pixbuf++ = alphabyte;
break;
default:
//Sysprintf("LoadTGA: illegal pixel_size '%d' in file '%s'\n", targa_header.pixel_size, name );
break;
}
column++;
if (column==columns) { // pixel packet run spans across rows
column=0;
if (row>0)
row--;
else
goto breakOut;
pixbuf = targa_rgba + row*columns*4;
}
}
}
}
breakOut:;
}
}
// vertically flipped
if ( (targa_header.attributes & (1<<5)) ) {
int flip;
for (row = 0; row < .5f * rows; row++)
{
for (column = 0; column < columns; column++)
{
flip = *( (int*)targa_rgba + row * columns + column);
*( (int*)targa_rgba + row * columns + column) = *( (int*)targa_rgba + ( ( rows - 1 ) - row ) * columns + column );
*( (int*)targa_rgba + ( ( rows - 1 ) - row ) * columns + column ) = flip;
}
}
}
//free(buffer);
*height = image_height;
}
/*
=============
LoadTGA
@ -1129,7 +1139,7 @@ void LoadTGA (const char *name, byte **pixels, int *width, int *height)
Error ("Couldn't read %s", name);
}
LoadTGABuffer(buffer, pixels, width, height);
LoadTGABuffer(buffer, buffer + nLen, pixels, width, height);
}

View file

@ -36,9 +36,10 @@ void Save256Image (const char *name, byte *pixels, byte *palette,
int width, int height);
void LoadTGA( const char *filename, byte **pixels, int *width, int *height );
void LoadTGABuffer( byte *buffer, byte **pic, int *width, int *height );
void WriteTGA( const char *filename, byte *data, int width, int height );
void LoadTGA (const char *filename, byte **pixels, int *width, int *height);
void LoadTGABuffer ( const byte *buffer, const byte* enddata, byte **pic, int *width, int *height);
void WriteTGA (const char *filename, byte *data, int width, int height);
int LoadJPGBuff( void *src_buffer, int src_size, unsigned char **pic, int *width, int *height );
void Load32BitImage( const char *name, unsigned **pixels, int *width, int *height );
void Load32BitImage (const char *name, unsigned **pixels, int *width, int *height);

View file

@ -33,7 +33,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#include <sys/types.h>
#include <sys/stat.h>
#ifdef _WIN32
#ifdef WIN32
#include <direct.h>
#include <windows.h>
#endif
@ -42,7 +42,11 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#include "l_net/l_net.h"
#include "libxml/tree.h"
#ifdef _WIN32
// utf8 conversion
#include <glib/gconvert.h>
#include <glib/gmem.h>
#ifdef WIN32
HWND hwndOut = NULL;
qboolean lookedForServer = qfalse;
UINT wm_BroadcastCommand = -1;
@ -289,7 +293,11 @@ void FPrintf (int flag, char *buf)
bGotXML = qtrue;
}
node = xmlNewNode (NULL, "message");
xmlNodeSetContent (node, buf);
{
gchar* utf8 = g_locale_to_utf8(buf, -1, NULL, NULL, NULL);
xmlNodeSetContent(node, utf8);
g_free(utf8);
}
level[0] = (int)'0' + flag;
level[1] = 0;
xmlSetProp (node, "level", (char *)&level );

View file

@ -24,6 +24,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
// inout is the only stuff relying on xml, include the headers there
#include "libxml/tree.h"
#include "mathlib.h"
// some useful xml routines
xmlNodePtr xml_NodeForVec( vec3_t v );

View file

@ -31,7 +31,7 @@ WIN32
===================================================================
*/
#ifdef _WIN32
#ifdef WIN32
#define USED

View file

@ -249,8 +249,11 @@ winding_t *BaseWindingForPlane (vec3_t normal, vec_t dist)
CrossProduct (vup, normal, vright);
VectorScale (vup, MAX_WORLD_COORD, vup);
VectorScale (vright, MAX_WORLD_COORD, vright);
// LordHavoc: this has to use *2 because otherwise some created points may
// be inside the world (think of a diagonal case), and any brush with such
// points should be removed, failure to detect such cases is disasterous
VectorScale (vup, MAX_WORLD_COORD*2, vup);
VectorScale (vright, MAX_WORLD_COORD*2, vright);
// project a really big axis aligned box onto the plane
w = AllocWinding (4);
@ -283,7 +286,7 @@ winding_t *CopyWinding (winding_t *w)
winding_t *c;
c = AllocWinding (w->numpoints);
size = (int)((winding_t *)0)->p[w->numpoints];
size = (int)((size_t)((winding_t *)0)->p[w->numpoints]);
memcpy (c, w, size);
return c;
}

View file

@ -19,6 +19,8 @@ along with GtkRadiant; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
// Copyright (C) 1999-2000 Id Software, Inc.
//
// This file must be identical in the quake and utils directories
// contents flags are seperate bits

View file

@ -110,7 +110,7 @@ WIN32
===================================================================
*/
#ifdef _WIN32
#ifdef WIN32
#define USED
@ -602,7 +602,6 @@ RunThreadsOn
*/
void RunThreadsOn (int workcnt, qboolean showpacifier, void(*func)(int))
{
int i;
int start, end;
dispatch = 0;

View file

@ -60,7 +60,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "cmdlib.h"
#include "mathlib.h"
#include "glib.h"
#include <glib.h>
#include "inout.h"
#include "vfs.h"
#include "unzip.h"

View file

@ -1,3 +1,24 @@
/*
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 <assert.h>
#include "q3data.h"

View file

@ -1,3 +1,24 @@
/*
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
*/
typedef struct
{
float x, y, z;

View file

@ -1,3 +1,24 @@
/*
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 "q3data.h"
#if 0

View file

@ -1,3 +1,24 @@
/*
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 "q3data.h"
byte *byteimage, *lbmpalette;

View file

@ -1,5 +1,26 @@
/*
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 <assert.h>
#ifdef _WIN32
#ifdef WIN32
#include <io.h>
#endif
#include "md3lib.h"

View file

@ -1,3 +1,24 @@
/*
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 <stdio.h>
#include "../common/cmdlib.h"
#include "mathlib.h"

View file

@ -1,3 +1,24 @@
/*
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 <assert.h>
#include "q3data.h"

View file

@ -1,3 +1,24 @@
/*
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
*/
#if 0
/*

View file

@ -1,6 +1,27 @@
/*
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 "p3dlib.h"
#ifdef _WIN32
#ifdef WIN32
#include <io.h>
#endif
#include <stdlib.h>

View file

@ -1,3 +1,24 @@
/*
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
*/
#define P3D_GET_CROSSLINE 1
#define P3D_GET_RESTOFLINE 2

View file

@ -1,3 +1,24 @@
/*
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 <assert.h>
#include "q3data.h"

View file

@ -1,4 +1,25 @@
#ifdef _WIN32
/*
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
*/
#ifdef WIN32
#include <io.h>
#endif
#include "q3data.h"
@ -31,6 +52,8 @@ char writedir[1024];
=======================================================
*/
unsigned Com_BlockChecksum (void *buffer, int length);
typedef struct
{
char name[56];

View file

@ -1,3 +1,24 @@
/*
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
*/
// q3data.h

View file

@ -1,3 +1,24 @@
/*
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 <stdio.h>
#include <string.h>
#include <stdlib.h>

View file

@ -1,3 +1,24 @@
/*
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 <assert.h>
#include "q3data.h"

View file

@ -1,4 +1,5 @@
/*
/* -------------------------------------------------------------------------------
Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
@ -77,7 +78,7 @@ int CountBrushList( brush_t *brushes )
/* count brushes */
for( brushes; brushes != NULL; brushes = brushes->next )
for( ; brushes != NULL; brushes = brushes->next )
c++;
return c;
}
@ -92,13 +93,13 @@ allocates a new brush
brush_t *AllocBrush( int numSides )
{
brush_t *bb;
int c;
size_t c;
/* allocate and clear */
if( numSides <= 0 )
Error( "AllocBrush called with numsides = %d", numSides );
c = (int) &(((brush_t*) 0)->sides[ numSides ]);
c = (size_t)&(((brush_t*) 0)->sides[ numSides ]);
bb = safe_malloc( c );
memset( bb, 0, c );
if( numthreads == 1 )
@ -121,7 +122,7 @@ void FreeBrush( brush_t *b )
/* error check */
if( *((int*) b) == 0xFEFEFEFE )
if( *((unsigned int*) b) == 0xFEFEFEFE )
{
Sys_FPrintf( SYS_VRB, "WARNING: Attempt to free an already freed brush!\n" );
return;
@ -133,8 +134,8 @@ void FreeBrush( brush_t *b )
FreeWinding( b->sides[ i ].winding );
/* ydnar: overwrite it */
memset( b, 0xFE, (int) &(((brush_t*) 0)->sides[ b->numsides ]) );
*((int*) b) = 0xFEFEFEFE;
memset( b, 0xFE, (size_t)&(((brush_t*) 0)->sides[ b->numsides ]) );
*((unsigned int*) b) = 0xFEFEFEFE;
/* free it */
free( b );
@ -155,7 +156,7 @@ void FreeBrushList( brush_t *brushes )
/* walk brush list */
for( brushes; brushes != NULL; brushes = next )
for( ; brushes != NULL; brushes = next )
{
next = brushes->next;
FreeBrush( brushes );
@ -172,12 +173,12 @@ duplicates the brush, sides, and windings
brush_t *CopyBrush( brush_t *brush )
{
brush_t *newBrush;
int size;
size_t size;
int i;
/* copy brush */
size = (int) &(((brush_t*) 0)->sides[ brush->numsides ]);
size = (size_t)&(((brush_t*) 0)->sides[ brush->numsides ]);
newBrush = AllocBrush( brush->numsides );
memcpy( newBrush, brush, size );
@ -376,8 +377,6 @@ qboolean CreateBrushWindings( brush_t *brush )
continue; /* back side clipaway */
if( brush->sides[ j ].bevel )
continue;
if( brush->sides[ j ].backSide )
continue;
plane = &mapplanes[ brush->sides[ j ].planenum ^ 1 ];
ChopWindingInPlace( &w, plane->normal, plane->dist, 0 ); // CLIP_EPSILON );
@ -850,9 +849,6 @@ void SplitBrush( brush_t *brush, int planenum, brush_t **front, brush_t **back )
w = BaseWindingForPlane (plane->normal, plane->dist);
for (i=0 ; i<brush->numsides && w ; i++)
{
if ( brush->sides[i].backSide ) {
continue; // fake back-sided polygons never split
}
plane2 = &mapplanes[brush->sides[i].planenum ^ 1];
ChopWindingInPlace (&w, plane2->normal, plane2->dist, 0); // PLANESIDE_EPSILON);
}
@ -910,18 +906,10 @@ void SplitBrush( brush_t *brush, int planenum, brush_t **front, brush_t **back )
// see if we have valid polygons on both sides
for (i=0 ; i<2 ; i++)
{
BoundBrush (b[i]);
for (j=0 ; j<3 ; j++)
{
if (b[i]->mins[j] < MIN_WORLD_COORD || b[i]->maxs[j] > MAX_WORLD_COORD)
if (b[i]->numsides < 3 || !BoundBrush (b[i]))
{
if (b[i]->numsides >= 3)
Sys_FPrintf (SYS_VRB,"bogus brush after clip\n");
break;
}
}
if (b[i]->numsides < 3 || j < 3)
{
FreeBrush (b[i]);
b[i] = NULL;
}

View file

@ -1,4 +1,5 @@
/*
/* -------------------------------------------------------------------------------
Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.

View file

@ -1,4 +1,5 @@
/*
/* -------------------------------------------------------------------------------
Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
@ -586,7 +587,9 @@ int BSPMain( int argc, char **argv )
tempSource[ 0 ] = '\0';
/* set flares flag */
/* set standard game flags */
maxSurfaceVerts = game->maxSurfaceVerts;
maxSurfaceIndexes = game->maxSurfaceIndexes;
emitFlares = game->emitFlares;
/* process arguments */
@ -687,11 +690,13 @@ int BSPMain( int argc, char **argv )
}
else if( !strcmp( argv[ i ], "-mv" ) )
{
maxSurfaceVerts = atoi( argv[ i + 1 ] );
if( maxSurfaceVerts < 3 )
maxSurfaceVerts = 3;
maxLMSurfaceVerts = atoi( argv[ i + 1 ] );
if( maxLMSurfaceVerts < 3 )
maxLMSurfaceVerts = 3;
if( maxLMSurfaceVerts > maxSurfaceVerts )
maxSurfaceVerts = maxLMSurfaceVerts;
i++;
Sys_Printf( "Maximum per-surface vertex count set to %d\n", maxSurfaceVerts );
Sys_Printf( "Maximum lightmapped surface vertex count set to %d\n", maxLMSurfaceVerts );
}
else if( !strcmp( argv[ i ], "-mi" ) )
{

View file

@ -1,4 +1,5 @@
/*
/* -------------------------------------------------------------------------------
Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
@ -435,7 +436,7 @@ void PrintBSPFileSizes( void )
Sys_Printf( "\n");
Sys_Printf( "%9d lightmaps %9d\n",
numBSPLightBytes / (LIGHTMAP_WIDTH * LIGHTMAP_HEIGHT * 3), numBSPLightBytes );
numBSPLightBytes / (game->lightmapSize * game->lightmapSize * 3), numBSPLightBytes );
Sys_Printf( "%9d lightgrid %9d *\n",
numBSPGridPoints, (int) (numBSPGridPoints * sizeof( *bspGridPoints )) );
Sys_Printf( " visibility %9d\n",

View file

@ -1,4 +1,5 @@
/*
/* -------------------------------------------------------------------------------
Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.

View file

@ -1,4 +1,5 @@
/*
/* -------------------------------------------------------------------------------
Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.

View file

@ -1,5 +1,107 @@
Q3Map2 Version History + Changelog (Reverse Chronological Order)
2.5.16 (2004-10-18)
- New: -fixaas mode to reassociate an AAS file with a changed BSP
- New: -nostyles switch on light phase disabling lightstyles
- Using libmhash cryptographic hashing library instead of md5lib
2.5.15 (2004-07-08)
- New: q3map_rgbGen, q3map_rgbMod or q3map_colorGen, q3map_colorMod
- New: q3map_alphaGen const (like q3map_alphaMod set)
- New: q3map_noVertexLight to suppress overwriting of vertex rgb
- q3map_backShader now works again, can be used instead of
q3map_cloneShader + q3map_invert on the target shader
- q3map_alphaMod volume brushes in func_group entities will now only
affect that entity's surfaces
- q3map_clipModel now works on trans/nonsolid shaders, allowing
simplified clipping surfaces in models
- Fixed bug in alphaMod code where only the first vertex was being
modded (thanks Ratty)
- Vis exits instead of crashing with divide-by-zero when there are
no portals on simple box maps
- All of a surface's lightmaps must be solid or not solid, fixing
ST coord problem with non-Raven games using lightstyles
- Reverted a change in the meta code which was causing lightmap coord
overflows and ugly self-shadowing errors on surface boundaries
- Any use of lightstyles automatically sets -nocollapse to reduce
total shader counts
- Tenebrae lightmap size changed to 512x512
2.5.14 (2004-04-09)
- New: -dirty mode courtesy of RaP7oR (dirtmapping/ambient occlusion)
- New: q3map_skyLight code using more uniform angular distribution about
the sky hemisphere
- New: q3map_alphaMod set N.N
- New: q3map_alphaMod scale N.N
- New: q3map_alphaMod volume - applies all other q3map_alphaMod directives
to each vertex inside a brush textured with this shader, allowing large
faded scrolling fire shaders, waterfalls, marquees, explicit dotProduct
terrain blending control, etc.
- Fixed a bug in alphaMod code where the type of the first alphaMod was
being used for all subsequent alphaMods
- Lowered vertex-lit surface limits to 999 verts, 1000 was breaking Quake 3
- Tightened up solid lightmap tolerances
- Fixed bug in solid lightmap code where lightmap SD coords were being
incorrectly set
2.5.13 (2004-03-03)
- New: -convert -format <game> to convert between different BSP formats.
Example, to convert a Jedi Academy map to Enemy Territory:
-game ja -convert -format et
- New: -game etut support for Urban Terror on Enemy Territory
- New: -analyze mode for reverse engineering a BSP format
- New: -compensate N.N (default 1.0) for descaling lightmap/vertex/grid
data to compensate for ingame overbrighting. 4.0 is a good value for
Quake 3 if used in combination with -gamma 2.2
- New: compensate/gamma per-game setting
- New: -light -cpma argument for "classic" (sic) vertex lighting
- Replaced malloc() with stack allocation in IlluminateRawLightmap for
most small/medium lightmap calculations
- Misc cleanups in q3map2.h
- Support for non-128x128 lightmaps
- The -meta process will now generate surfaces with more than 64
verts that have non-lightmapped shaders
- Extended lightmap size tolerance to 2x for merging meta triangles in
maps with aggressive lightmapscale. Sorry kids!
- Moved surface finish pass (celshading, cloning) to final surface pass.
This should fix a bug involving fog/tesselation/celshading/cloning
- Solid-color lightmaps (within 1/255 in RGB) are detected and replaced
with a single pixel lightmap, saving space
2.5.12 (2004-01-18)
- New: -dark option for dark lightmap/brush seams in -light (Unreal 1-ish)
- New: spawnflags 4 on misc_model entities makes them forcemeta/lightmapped
unless explicitly set as vertex lit in their shader(s). This can be
combined with spawnflags 2 (solid) as spawnflags 6
- New: -gamma N.N switch sets lightmap/vertex gamma value for more
realistic lighting, instead of using high ambient/minlight. Default
is 1.0 (linear ramp), good values are between 1.5 and 2.2
- Changed q3map_lightmapGamma N.N to q3map_lightmapBrightness N.N, to
better match its intended function
- Ported to VS.NET 2003 and GtkRadiant 1.5 (spog_branch)
- Fixed bug in _skybox maps where sunlight was leaking through brushes.
Thanks pjw!
- Fixed bug in ASE loader where models without submodels/submaterials
would not load properly.
- Fixed bug where q3map_tcGen was not being applied to models
- Optimized MergeMetaTriangles a bit
- Added KOR's fix to raytracer
- -bouncegrid no longer affects the lightgrid dir
- Added feature to PicoModel where spaces in material names in 3DS, ASE
and LWO models will mark the end of the shader name, so you can have
"textures/foo/bar 1" and "textures/foo/bar 2" in Lightwave, and both
surfaces will map to "textures/foo/bar"
2.5.11 (2003-12-01)
- New: added support for _skybox entities to generate "portal sky"

View file

@ -1,4 +1,5 @@
/*
/* -------------------------------------------------------------------------------
Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.

View file

@ -1,4 +1,5 @@
/*
/* -------------------------------------------------------------------------------
Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.

View file

@ -1,4 +1,5 @@
/*
/* -------------------------------------------------------------------------------
Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
@ -659,9 +660,6 @@ static void ProjectDecalOntoWinding( decalProjector_t *dp, mapDrawSurface_t *ds,
dv->color[ j ][ 3 ] = alpha;
}
}
/* ydnar: finish the surface */
FinishSurface( ds2 );
}
@ -788,8 +786,7 @@ static void ProjectDecalOntoTriangles( decalProjector_t *dp, mapDrawSurface_t *d
/* triangle surfaces without shaders don't get marks by default */
if( (ds->type == SURFACE_TRIANGLES || ds->type == SURFACE_FORCED_META) &&
ds->shaderInfo->shaderText == NULL )
if( ds->type == SURFACE_TRIANGLES && ds->shaderInfo->shaderText == NULL )
return;
/* backface check */

View file

@ -1,4 +1,5 @@
/*
/* -------------------------------------------------------------------------------
Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
@ -179,7 +180,7 @@ int CountFaceList( face_t *list )
c = 0;
for( list; list != NULL; list = list->next )
for( ; list != NULL; list = list->next )
c++;
return c;
}

View file

@ -1,4 +1,5 @@
/*
/* -------------------------------------------------------------------------------
Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
@ -396,8 +397,6 @@ qboolean ChopFaceSurfaceByBrush( entity_t *e, mapDrawSurface_t *ds, brush_t *b )
{
/* get brush side and plane */
s = &b->sides[ i ];
if( s->backSide )
continue;
plane = &mapplanes[ s->planenum ];
/* handle coplanar outfacing (don't fog) */

View file

@ -1,4 +1,5 @@
/*
/* -------------------------------------------------------------------------------
Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
@ -104,11 +105,18 @@ game_t struct
".ef", /* unix home sub-dir */
"elite", /* magic path word */
"scripts", /* shader directory */
qfalse, /* wolf lighting model? */
64, /* max lightmapped surface verts */
999, /* max surface verts */
6000, /* max surface indexes */
qfalse, /* flares */
"flareshader", /* default flare shader */
qfalse, /* wolf lighting model? */
128, /* lightmap width/height */
1.0f, /* lightmap gamma */
1.0f, /* lightmap compensate */
"IBSP", /* bsp file prefix */
46, /* bsp file version */
qfalse, /* cod-style lump len/ofs order */
LoadIBSPFile, /* bsp load function */
WriteIBSPFile, /* bsp write function */

View file

@ -0,0 +1,264 @@
/* -------------------------------------------------------------------------------
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
----------------------------------------------------------------------------------
This code has been altered significantly from its original form, to support
several games based on the Quake III Arena engine, in the form of "Q3Map2."
------------------------------------------------------------------------------- */
/* marker */
#ifndef GAME_ETUT_H
#define GAME_ETUT_H
/* -------------------------------------------------------------------------------
content and surface flags
------------------------------------------------------------------------------- */
/* game flags */
#define U_CONT_SOLID 1 /* an eye is never valid in a solid */
#define U_CONT_LAVA 8
#define U_CONT_SLIME 16
#define U_CONT_WATER 32
#define U_CONT_FOG 64
#define U_CONT_AREAPORTAL 0x8000
#define U_CONT_PLAYERCLIP 0x10000
#define U_CONT_MONSTERCLIP 0x20000
#define U_CONT_TELEPORTER 0x40000
#define U_CONT_JUMPPAD 0x80000
#define U_CONT_CLUSTERPORTAL 0x100000
#define U_CONT_DONOTENTER 0x200000
#define U_CONT_BOTCLIP 0x400000
#define U_CONT_ORIGIN 0x1000000 /* removed before bsping an entity */
#define U_CONT_BODY 0x2000000 /* should never be on a brush, only in game */
#define U_CONT_CORPSE 0x4000000
#define U_CONT_DETAIL 0x8000000 /* brushes not used for the bsp */
#define U_CONT_STRUCTURAL 0x10000000 /* brushes used for the bsp */
#define U_CONT_TRANSLUCENT 0x20000000 /* don't consume surface fragments inside */
#define U_CONT_TRIGGER 0x40000000
#define U_CONT_NODROP 0x80000000 /* don't leave bodies or items (death fog, lava) */
#define U_SURF_NODAMAGE 0x1 /* never give falling damage */
#define U_SURF_SLICK 0x2 /* effects game physics */
#define U_SURF_SKY 0x4 /* lighting from environment map */
#define U_SURF_LADDER 0x8
#define U_SURF_NOIMPACT 0x10 /* don't make missile explosions */
#define U_SURF_NOMARKS 0x20 /* don't leave missile marks */
#define U_SURF_FLESH 0x40 /* make flesh sounds and effects */
#define U_SURF_NODRAW 0x80 /* don't generate a drawsurface at all */
#define U_SURF_HINT 0x100 /* make a primary bsp splitter */
#define U_SURF_SKIP 0x200 /* completely ignore, allowing non-closed brushes */
#define U_SURF_NOLIGHTMAP 0x400 /* surface doesn't need a lightmap */
#define U_SURF_POINTLIGHT 0x800 /* generate lighting info at vertexes */
#define U_SURF_METALSTEPS 0x1000 /* clanking footsteps */
#define U_SURF_NOSTEPS 0x2000 /* no footstep sounds */
#define U_SURF_NONSOLID 0x4000 /* don't collide against curves with this set */
#define U_SURF_LIGHTFILTER 0x8000 /* act as a light filter during q3map -light */
#define U_SURF_ALPHASHADOW 0x10000 /* do per-pixel light shadow casting in q3map */
#define U_SURF_NODLIGHT 0x20000 /* don't dlight even if solid (solid lava, skies) */
#define U_SURF_DUST 0x40000 /* leave a dust trail when walking on this surface */
/* ydnar flags */
#define U_SURF_VERTEXLIT (U_SURF_POINTLIGHT | U_SURF_NOLIGHTMAP)
/* materials */
#define U_MAT_MASK 0xFFF00000 /* mask to get the material type */
#define U_MAT_NONE 0x00000000
#define U_MAT_TIN 0x00100000
#define U_MAT_ALUMINUM 0x00200000
#define U_MAT_IRON 0x00300000
#define U_MAT_TITANIUM 0x00400000
#define U_MAT_STEEL 0x00500000
#define U_MAT_BRASS 0x00600000
#define U_MAT_COPPER 0x00700000
#define U_MAT_CEMENT 0x00800000
#define U_MAT_ROCK 0x00900000
#define U_MAT_GRAVEL 0x00A00000
#define U_MAT_PAVEMENT 0x00B00000
#define U_MAT_BRICK 0x00C00000
#define U_MAT_CLAY 0x00D00000
#define U_MAT_GRASS 0x00E00000
#define U_MAT_DIRT 0x00F00000
#define U_MAT_MUD 0x01000000
#define U_MAT_SNOW 0x01100000
#define U_MAT_ICE 0x01200000
#define U_MAT_SAND 0x01300000
#define U_MAT_CERAMICTILE 0x01400000
#define U_MAT_LINOLEUM 0x01500000
#define U_MAT_RUG 0x01600000
#define U_MAT_PLASTER 0x01700000
#define U_MAT_PLASTIC 0x01800000
#define U_MAT_CARDBOARD 0x01900000
#define U_MAT_HARDWOOD 0x01A00000
#define U_MAT_SOFTWOOD 0x01B00000
#define U_MAT_PLANK 0x01C00000
#define U_MAT_GLASS 0x01D00000
#define U_MAT_WATER 0x01E00000
#define U_MAT_STUCCO 0x01F00000
/* -------------------------------------------------------------------------------
game_t struct
------------------------------------------------------------------------------- */
{
"etut", /* -game x */
"etut", /* default base game data dir */
".etwolf", /* unix home sub-dir */
"et", /* magic path word */
"scripts", /* shader directory */
1024, /* max lightmapped surface verts */
1024, /* max surface verts */
6144, /* max surface indexes */
qfalse, /* flares */
"flareshader", /* default flare shader */
qfalse, /* wolf lighting model? */
128, /* lightmap width/height */
2.2f, /* lightmap gamma */
1.0f, /* lightmap compensate */
"IBSP", /* bsp file prefix */
47, /* bsp file version */
qfalse, /* cod-style lump len/ofs order */
LoadIBSPFile, /* bsp load function */
WriteIBSPFile, /* bsp write function */
{
/* name contentFlags contentFlagsClear surfaceFlags surfaceFlagsClear compileFlags compileFlagsClear */
/* default */
{ "default", U_CONT_SOLID, -1, 0, -1, C_SOLID, -1 },
/* ydnar */
{ "lightgrid", 0, 0, 0, 0, C_LIGHTGRID, 0 },
{ "antiportal", 0, 0, 0, 0, C_ANTIPORTAL, 0 },
{ "skip", 0, 0, 0, 0, C_SKIP, 0 },
/* compiler */
{ "origin", U_CONT_ORIGIN, U_CONT_SOLID, 0, 0, C_ORIGIN | C_TRANSLUCENT, C_SOLID },
{ "areaportal", U_CONT_AREAPORTAL, U_CONT_SOLID, 0, 0, C_AREAPORTAL | C_TRANSLUCENT, C_SOLID },
{ "trans", U_CONT_TRANSLUCENT, 0, 0, 0, C_TRANSLUCENT, 0 },
{ "detail", U_CONT_DETAIL, 0, 0, 0, C_DETAIL, 0 },
{ "structural", U_CONT_STRUCTURAL, 0, 0, 0, C_STRUCTURAL, 0 },
{ "hint", 0, 0, U_SURF_HINT, 0, C_HINT, 0 },
{ "nodraw", 0, 0, U_SURF_NODRAW, 0, C_NODRAW, 0 },
{ "alphashadow", 0, 0, U_SURF_ALPHASHADOW, 0, C_ALPHASHADOW | C_TRANSLUCENT, 0 },
{ "lightfilter", 0, 0, U_SURF_LIGHTFILTER, 0, C_LIGHTFILTER | C_TRANSLUCENT, 0 },
{ "nolightmap", 0, 0, U_SURF_VERTEXLIT, 0, C_VERTEXLIT, 0 },
{ "pointlight", 0, 0, U_SURF_VERTEXLIT, 0, C_VERTEXLIT, 0 },
/* game */
{ "nonsolid", 0, U_CONT_SOLID, U_SURF_NONSOLID, 0, 0, C_SOLID },
{ "trigger", U_CONT_TRIGGER, U_CONT_SOLID, 0, 0, C_TRANSLUCENT, C_SOLID },
{ "water", U_CONT_WATER, U_CONT_SOLID, 0, 0, C_LIQUID | C_TRANSLUCENT, C_SOLID },
{ "slime", U_CONT_SLIME, U_CONT_SOLID, 0, 0, C_LIQUID | C_TRANSLUCENT, C_SOLID },
{ "lava", U_CONT_LAVA, U_CONT_SOLID, 0, 0, C_LIQUID | C_TRANSLUCENT, C_SOLID },
{ "playerclip", U_CONT_PLAYERCLIP, U_CONT_SOLID, 0, 0, C_DETAIL | C_TRANSLUCENT, C_SOLID },
{ "monsterclip", U_CONT_MONSTERCLIP, U_CONT_SOLID, 0, 0, C_DETAIL | C_TRANSLUCENT, C_SOLID },
{ "nodrop", U_CONT_NODROP, U_CONT_SOLID, 0, 0, C_TRANSLUCENT, C_SOLID },
{ "clusterportal", U_CONT_CLUSTERPORTAL, U_CONT_SOLID, 0, 0, C_TRANSLUCENT, C_SOLID },
{ "donotenter", U_CONT_DONOTENTER, U_CONT_SOLID, 0, 0, C_TRANSLUCENT, C_SOLID },
{ "botclip", U_CONT_BOTCLIP, U_CONT_SOLID, 0, 0, C_TRANSLUCENT, C_SOLID },
{ "fog", U_CONT_FOG, U_CONT_SOLID, 0, 0, C_FOG, C_SOLID },
{ "sky", 0, 0, U_SURF_SKY, 0, C_SKY, 0 },
{ "slick", 0, 0, U_SURF_SLICK, 0, 0, 0 },
{ "noimpact", 0, 0, U_SURF_NOIMPACT, 0, 0, 0 },
{ "nomarks", 0, 0, U_SURF_NOMARKS, 0, C_NOMARKS, 0 },
{ "ladder", 0, 0, U_SURF_LADDER, 0, 0, 0 },
{ "nodamage", 0, 0, U_SURF_NODAMAGE, 0, 0, 0 },
{ "metalsteps", 0, 0, U_SURF_METALSTEPS, 0, 0, 0 },
{ "flesh", 0, 0, U_SURF_FLESH, 0, 0, 0 },
{ "nosteps", 0, 0, U_SURF_NOSTEPS, 0, 0, 0 },
{ "nodlight", 0, 0, U_SURF_NODLIGHT, 0, 0, 0 },
{ "dust", 0, 0, U_SURF_DUST, 0, 0, 0 },
/* materials */
{ "*mat_none", 0, 0, U_MAT_NONE, U_MAT_MASK, 0, 0 },
{ "*mat_tin", 0, 0, U_MAT_TIN, U_MAT_MASK, 0, 0 },
{ "*mat_aluminum", 0, 0, U_MAT_ALUMINUM, U_MAT_MASK, 0, 0 },
{ "*mat_iron", 0, 0, U_MAT_IRON, U_MAT_MASK, 0, 0 },
{ "*mat_titanium", 0, 0, U_MAT_TITANIUM, U_MAT_MASK, 0, 0 },
{ "*mat_steel", 0, 0, U_MAT_STEEL, U_MAT_MASK, 0, 0 },
{ "*mat_brass", 0, 0, U_MAT_BRASS, U_MAT_MASK, 0, 0 },
{ "*mat_copper", 0, 0, U_MAT_COPPER, U_MAT_MASK, 0, 0 },
{ "*mat_cement", 0, 0, U_MAT_CEMENT, U_MAT_MASK, 0, 0 },
{ "*mat_rock", 0, 0, U_MAT_ROCK, U_MAT_MASK, 0, 0 },
{ "*mat_gravel", 0, 0, U_MAT_GRAVEL, U_MAT_MASK, 0, 0 },
{ "*mat_pavement", 0, 0, U_MAT_PAVEMENT, U_MAT_MASK, 0, 0 },
{ "*mat_brick", 0, 0, U_MAT_BRICK, U_MAT_MASK, 0, 0 },
{ "*mat_clay", 0, 0, U_MAT_CLAY, U_MAT_MASK, 0, 0 },
{ "*mat_grass", 0, 0, U_MAT_GRASS, U_MAT_MASK, 0, 0 },
{ "*mat_dirt", 0, 0, U_MAT_DIRT, U_MAT_MASK, 0, 0 },
{ "*mat_mud", 0, 0, U_MAT_MUD, U_MAT_MASK, 0, 0 },
{ "*mat_snow", 0, 0, U_MAT_SNOW, U_MAT_MASK, 0, 0 },
{ "*mat_ice", 0, 0, U_MAT_ICE, U_MAT_MASK, 0, 0 },
{ "*mat_sand", 0, 0, U_MAT_SAND, U_MAT_MASK, 0, 0 },
{ "*mat_ceramic", 0, 0, U_MAT_CERAMICTILE, U_MAT_MASK, 0, 0 },
{ "*mat_ceramictile", 0, 0, U_MAT_CERAMICTILE, U_MAT_MASK, 0, 0 },
{ "*mat_linoleum", 0, 0, U_MAT_LINOLEUM, U_MAT_MASK, 0, 0 },
{ "*mat_rug", 0, 0, U_MAT_RUG, U_MAT_MASK, 0, 0 },
{ "*mat_plaster", 0, 0, U_MAT_PLASTER, U_MAT_MASK, 0, 0 },
{ "*mat_plastic", 0, 0, U_MAT_PLASTIC, U_MAT_MASK, 0, 0 },
{ "*mat_cardboard", 0, 0, U_MAT_CARDBOARD, U_MAT_MASK, 0, 0 },
{ "*mat_hardwood", 0, 0, U_MAT_HARDWOOD, U_MAT_MASK, 0, 0 },
{ "*mat_softwood", 0, 0, U_MAT_SOFTWOOD, U_MAT_MASK, 0, 0 },
{ "*mat_plank", 0, 0, U_MAT_PLANK, U_MAT_MASK, 0, 0 },
{ "*mat_glass", 0, 0, U_MAT_GLASS, U_MAT_MASK, 0, 0 },
{ "*mat_water", 0, 0, U_MAT_WATER, U_MAT_MASK, 0, 0 },
{ "*mat_stucco", 0, 0, U_MAT_STUCCO, U_MAT_MASK, 0, 0 },
/* null */
{ NULL, 0, 0, 0, 0, 0, 0 }
}
}
/* end marker */
#endif

View file

@ -1,4 +1,5 @@
/*
/* -------------------------------------------------------------------------------
Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
@ -58,11 +59,18 @@ game_t struct
".ja", /* unix home sub-dir */
"GameData", /* magic path word */
"shaders", /* shader directory */
qfalse, /* wolf lighting model? */
64, /* max lightmapped surface verts */
999, /* max surface verts */
6000, /* max surface indexes */
qtrue, /* flares */
"gfx/misc/flare", /* default flare shader */
qfalse, /* wolf lighting model? */
128, /* lightmap width/height */
1.0f, /* lightmap gamma */
1.0f, /* lightmap compensate */
"RBSP", /* bsp file prefix */
1, /* bsp file version */
qfalse, /* cod-style lump len/ofs order */
LoadRBSPFile, /* bsp load function */
WriteRBSPFile, /* bsp write function */

View file

@ -1,4 +1,5 @@
/*
/* -------------------------------------------------------------------------------
Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
@ -55,11 +56,18 @@ game_t struct
".jk2", /* unix home sub-dir */
"GameData", /* magic path word */
"shaders", /* shader directory */
qfalse, /* wolf lighting model? */
64, /* max lightmapped surface verts */
999, /* max surface verts */
6000, /* max surface indexes */
qtrue, /* flares */
"gfx/misc/flare", /* default flare shader */
qfalse, /* wolf lighting model? */
128, /* lightmap width/height */
1.0f, /* lightmap gamma */
1.0f, /* lightmap compensate */
"RBSP", /* bsp file prefix */
1, /* bsp file version */
qfalse, /* cod-style lump len/ofs order */
LoadRBSPFile, /* bsp load function */
WriteRBSPFile, /* bsp write function */

View file

@ -0,0 +1,195 @@
/* -------------------------------------------------------------------------------
This code is based on source provided under the terms of the Id Software
LIMITED USE SOFTWARE LICENSE AGREEMENT, a copy of which is included with the
GtkRadiant sources (see LICENSE_ID). If you did not receive a copy of
LICENSE_ID, please contact Id Software immediately at info@idsoftware.com.
All changes and additions to the original source which have been developed by
other contributors (see CONTRIBUTORS) are provided under the terms of the
license the contributors choose (see LICENSE), to the extent permitted by the
LICENSE_ID. If you did not receive a copy of the contributor license,
please contact the GtkRadiant maintainers at info@gtkradiant.com immediately.
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.
----------------------------------------------------------------------------------
This code has been altered significantly from its original form, to support
several games based on the Quake III Arena engine, in the form of "Q3Map2."
------------------------------------------------------------------------------- */
/* marker */
#ifndef GAME_QFUSION_H
#define GAME_QFUSION_H
/* -------------------------------------------------------------------------------
content and surface flags
------------------------------------------------------------------------------- */
/* game flags */
#define F_CONT_SOLID 1 /* an eye is never valid in a solid */
#define F_CONT_LAVA 8
#define F_CONT_SLIME 16
#define F_CONT_WATER 32
#define F_CONT_FOG 64
#define F_CONT_AREAPORTAL 0x8000
#define F_CONT_PLAYERCLIP 0x10000
#define F_CONT_MONSTERCLIP 0x20000
#define F_CONT_TELEPORTER 0x40000
#define F_CONT_JUMPPAD 0x80000
#define F_CONT_CLUSTERPORTAL 0x100000
#define F_CONT_DONOTENTER 0x200000
#define F_CONT_BOTCLIP 0x400000
#define F_CONT_ORIGIN 0x1000000 /* removed before bsping an entity */
#define F_CONT_BODY 0x2000000 /* should never be on a brush, only in game */
#define F_CONT_CORPSE 0x4000000
#define F_CONT_DETAIL 0x8000000 /* brushes not used for the bsp */
#define F_CONT_STRUCTURAL 0x10000000 /* brushes used for the bsp */
#define F_CONT_TRANSLUCENT 0x20000000 /* don't consume surface fragments inside */
#define F_CONT_TRIGGER 0x40000000
#define F_CONT_NODROP 0x80000000 /* don't leave bodies or items (death fog, lava) */
#define F_SURF_NODAMAGE 0x1 /* never give falling damage */
#define F_SURF_SLICK 0x2 /* effects game physics */
#define F_SURF_SKY 0x4 /* lighting from environment map */
#define F_SURF_LADDER 0x8
#define F_SURF_NOIMPACT 0x10 /* don't make missile explosions */
#define F_SURF_NOMARKS 0x20 /* don't leave missile marks */
#define F_SURF_FLESH 0x40 /* make flesh sounds and effects */
#define F_SURF_NODRAW 0x80 /* don't generate a drawsurface at all */
#define F_SURF_HINT 0x100 /* make a primary bsp splitter */
#define F_SURF_SKIP 0x200 /* completely ignore, allowing non-closed brushes */
#define F_SURF_NOLIGHTMAP 0x400 /* surface doesn't need a lightmap */
#define F_SURF_POINTLIGHT 0x800 /* generate lighting info at vertexes */
#define F_SURF_METALSTEPS 0x1000 /* clanking footsteps */
#define F_SURF_NOSTEPS 0x2000 /* no footstep sounds */
#define F_SURF_NONSOLID 0x4000 /* don't collide against curves with this set */
#define F_SURF_LIGHTFILTER 0x8000 /* act as a light filter during q3map -light */
#define F_SURF_ALPHASHADOW 0x10000 /* do per-pixel light shadow casting in q3map */
#define F_SURF_NODLIGHT 0x20000 /* don't dlight even if solid (solid lava, skies) */
#define F_SURF_DUST 0x40000 /* leave a dust trail when walking on this surface */
/* ydnar flags */
#define F_SURF_VERTEXLIT (F_SURF_POINTLIGHT | F_SURF_NOLIGHTMAP)
/* -------------------------------------------------------------------------------
game_t struct
------------------------------------------------------------------------------- */
{
"qfusion", /* -game x */
"baseq3", /* default base game data dir */
".q3a", /* unix home sub-dir */
"quake", /* magic path word */
"scripts", /* shader directory */
2048, /* max lightmapped surface verts */
2048, /* max surface verts */
12288, /* max surface indexes */
qtrue, /* flares */
"flareshader", /* default flare shader */
qfalse, /* wolf lighting model? */
512, /* lightmap width/height */
1.0f, /* lightmap gamma */
1.0f, /* lightmap compensate */
"FBSP", /* bsp file prefix */
1, /* bsp file version */
qfalse, /* cod-style lump len/ofs order */
LoadRBSPFile, /* bsp load function */
WriteRBSPFile, /* bsp write function */
{
/* name contentFlags contentFlagsClear surfaceFlags surfaceFlagsClear compileFlags compileFlagsClear */
/* default */
{ "default", F_CONT_SOLID, -1, 0, -1, C_SOLID, -1 },
/* ydnar */
{ "lightgrid", 0, 0, 0, 0, C_LIGHTGRID, 0 },
{ "antiportal", 0, 0, 0, 0, C_ANTIPORTAL, 0 },
{ "skip", 0, 0, 0, 0, C_SKIP, 0 },
/* compiler */
{ "origin", F_CONT_ORIGIN, F_CONT_SOLID, 0, 0, C_ORIGIN | C_TRANSLUCENT, C_SOLID },
{ "areaportal", F_CONT_AREAPORTAL, F_CONT_SOLID, 0, 0, C_AREAPORTAL | C_TRANSLUCENT, C_SOLID },
{ "trans", F_CONT_TRANSLUCENT, 0, 0, 0, C_TRANSLUCENT, 0 },
{ "detail", F_CONT_DETAIL, 0, 0, 0, C_DETAIL, 0 },
{ "structural", F_CONT_STRUCTURAL, 0, 0, 0, C_STRUCTURAL, 0 },
{ "hint", 0, 0, F_SURF_HINT, 0, C_HINT, 0 },
{ "nodraw", 0, 0, F_SURF_NODRAW, 0, C_NODRAW, 0 },
{ "alphashadow", 0, 0, F_SURF_ALPHASHADOW, 0, C_ALPHASHADOW | C_TRANSLUCENT, 0 },
{ "lightfilter", 0, 0, F_SURF_LIGHTFILTER, 0, C_LIGHTFILTER | C_TRANSLUCENT, 0 },
{ "nolightmap", 0, 0, F_SURF_VERTEXLIT, 0, C_VERTEXLIT, 0 },
{ "pointlight", 0, 0, F_SURF_VERTEXLIT, 0, C_VERTEXLIT, 0 },
/* game */
{ "nonsolid", 0, F_CONT_SOLID, F_SURF_NONSOLID, 0, 0, C_SOLID },
{ "trigger", F_CONT_TRIGGER, F_CONT_SOLID, 0, 0, C_TRANSLUCENT, C_SOLID },
{ "water", F_CONT_WATER, F_CONT_SOLID, 0, 0, C_LIQUID | C_TRANSLUCENT, C_SOLID },
{ "slime", F_CONT_SLIME, F_CONT_SOLID, 0, 0, C_LIQUID | C_TRANSLUCENT, C_SOLID },
{ "lava", F_CONT_LAVA, F_CONT_SOLID, 0, 0, C_LIQUID | C_TRANSLUCENT, C_SOLID },
{ "playerclip", F_CONT_PLAYERCLIP, F_CONT_SOLID, 0, 0, C_DETAIL | C_TRANSLUCENT, C_SOLID },
{ "monsterclip", F_CONT_MONSTERCLIP, F_CONT_SOLID, 0, 0, C_DETAIL | C_TRANSLUCENT, C_SOLID },
{ "nodrop", F_CONT_NODROP, F_CONT_SOLID, 0, 0, C_TRANSLUCENT, C_SOLID },
{ "clusterportal", F_CONT_CLUSTERPORTAL, F_CONT_SOLID, 0, 0, C_TRANSLUCENT, C_SOLID },
{ "donotenter", F_CONT_DONOTENTER, F_CONT_SOLID, 0, 0, C_TRANSLUCENT, C_SOLID },
{ "botclip", F_CONT_BOTCLIP, F_CONT_SOLID, 0, 0, C_TRANSLUCENT, C_SOLID },
{ "fog", F_CONT_FOG, F_CONT_SOLID, 0, 0, C_FOG, C_SOLID },
{ "sky", 0, 0, F_SURF_SKY, 0, C_SKY, 0 },
{ "slick", 0, 0, F_SURF_SLICK, 0, 0, 0 },
{ "noimpact", 0, 0, F_SURF_NOIMPACT, 0, 0, 0 },
{ "nomarks", 0, 0, F_SURF_NOMARKS, 0, C_NOMARKS, 0 },
{ "ladder", 0, 0, F_SURF_LADDER, 0, 0, 0 },
{ "nodamage", 0, 0, F_SURF_NODAMAGE, 0, 0, 0 },
{ "metalsteps", 0, 0, F_SURF_METALSTEPS, 0, 0, 0 },
{ "flesh", 0, 0, F_SURF_FLESH, 0, 0, 0 },
{ "nosteps", 0, 0, F_SURF_NOSTEPS, 0, 0, 0 },
{ "nodlight", 0, 0, F_SURF_NODLIGHT, 0, 0, 0 },
{ "dust", 0, 0, F_SURF_DUST, 0, 0, 0 },
/* null */
{ NULL, 0, 0, 0, 0, 0, 0 }
}
}
/* end marker */
#endif

View file

@ -1,4 +1,5 @@
/*
/* -------------------------------------------------------------------------------
Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
@ -103,11 +104,18 @@ game_t struct
".q3a", /* unix home sub-dir */
"quake", /* magic path word */
"scripts", /* shader directory */
qfalse, /* wolf lighting model? */
64, /* max lightmapped surface verts */
999, /* max surface verts */
6000, /* max surface indexes */
qfalse, /* flares */
"flareshader", /* default flare shader */
qfalse, /* wolf lighting model? */
128, /* lightmap width/height */
1.0f, /* lightmap gamma */
1.0f, /* lightmap compensate */
"IBSP", /* bsp file prefix */
46, /* bsp file version */
qfalse, /* cod-style lump len/ofs order */
LoadIBSPFile, /* bsp load function */
WriteIBSPFile, /* bsp write function */

View file

@ -1,4 +1,5 @@
/*
/* -------------------------------------------------------------------------------
Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
@ -130,11 +131,18 @@ game_t struct
".sof2", /* unix home sub-dir */
"soldier", /* magic path word */
"shaders", /* shader directory */
qfalse, /* wolf lighting model? */
64, /* max lightmapped surface verts */
999, /* max surface verts */
6000, /* max surface indexes */
qtrue, /* flares */
"gfx/misc/lens_flare", /* default flare shader */
qfalse, /* wolf lighting model? */
128, /* lightmap width/height */
1.0f, /* lightmap gamma */
1.0f, /* lightmap compensate */
"RBSP", /* bsp file prefix */
1, /* bsp file version */
qfalse, /* cod-style lump len/ofs order */
LoadRBSPFile, /* bsp load function */
WriteRBSPFile, /* bsp write function */

View file

@ -1,4 +1,5 @@
/*
/* -------------------------------------------------------------------------------
Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
@ -103,11 +104,18 @@ game_t struct
".tenebrae", /* unix home sub-dir */
"tenebrae", /* magic path word */
"scripts", /* shader directory */
qfalse, /* wolf lighting model? */
1024, /* max lightmapped surface verts */
1024, /* max surface verts */
6144, /* max surface indexes */
qfalse, /* flares */
"flareshader", /* default flare shader */
qfalse, /* wolf lighting model? */
512, /* lightmap width/height */
2.0f, /* lightmap gamma */
1.0f, /* lightmap compensate */
"IBSP", /* bsp file prefix */
46, /* bsp file version */
qfalse, /* cod-style lump len/ofs order */
LoadIBSPFile, /* bsp load function */
WriteIBSPFile, /* bsp write function */

View file

@ -0,0 +1,160 @@
/* -------------------------------------------------------------------------------
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
----------------------------------------------------------------------------------
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."
------------------------------------------------------------------------------- */
/* Tremulous support, by LinuxManMikeC */
/* marker */
#ifndef GAME_TREMULOUS_H
#define GAME_TREMULOUS_H
/* -------------------------------------------------------------------------------
content and surface flags - also uses defines from game_quake3.h
------------------------------------------------------------------------------- */
#define TREM_CONT_NOALIENBUILD 0x1000
#define TREM_CONT_NOHUMANBUILD 0x2000
#define TREM_CONT_NOBUILD 0x4000
#define TREM_SURF_NOALIENBUILDSURFACE 0x80000
#define TREM_SURF_NOHUMANBUILDSURFACE 0x100000
#define TREM_SURF_NOBUILDSURFACE 0x200000
/* -------------------------------------------------------------------------------
game_t struct
------------------------------------------------------------------------------- */
{
"tremulous", /* -game x */
"base", /* default base game data dir */
".tremulous", /* unix home sub-dir */
"tremulous", /* magic path word - think this is right for trem*/
"scripts", /* shader directory */
64, /* max lightmapped surface verts */
999, /* max surface verts */
6000, /* max surface indexes */
qfalse, /* flares */
"flareshader", /* default flare shader */
qfalse, /* wolf lighting model? */
128, /* lightmap width/height */
1.0f, /* lightmap gamma */
1.0f, /* lightmap compensate */
"IBSP", /* bsp file prefix */
46, /* bsp file version */
qfalse, /* cod-style lump len/ofs order */
LoadIBSPFile, /* bsp load function */
WriteIBSPFile, /* bsp write function */
{
/* name contentFlags contentFlagsClear surfaceFlags surfaceFlagsClear compileFlags compileFlagsClear */
/* default */
{ "default", Q_CONT_SOLID, -1, 0, -1, C_SOLID, -1 },
/* ydnar */
{ "lightgrid", 0, 0, 0, 0, C_LIGHTGRID, 0 },
{ "antiportal", 0, 0, 0, 0, C_ANTIPORTAL, 0 },
{ "skip", 0, 0, 0, 0, C_SKIP, 0 },
/* compiler */
{ "origin", Q_CONT_ORIGIN, Q_CONT_SOLID, 0, 0, C_ORIGIN | C_TRANSLUCENT, C_SOLID },
{ "areaportal", Q_CONT_AREAPORTAL, Q_CONT_SOLID, 0, 0, C_AREAPORTAL | C_TRANSLUCENT, C_SOLID },
{ "trans", Q_CONT_TRANSLUCENT, 0, 0, 0, C_TRANSLUCENT, 0 },
{ "detail", Q_CONT_DETAIL, 0, 0, 0, C_DETAIL, 0 },
{ "structural", Q_CONT_STRUCTURAL, 0, 0, 0, C_STRUCTURAL, 0 },
{ "hint", 0, 0, Q_SURF_HINT, 0, C_HINT, 0 },
{ "nodraw", 0, 0, Q_SURF_NODRAW, 0, C_NODRAW, 0 },
{ "alphashadow", 0, 0, Q_SURF_ALPHASHADOW, 0, C_ALPHASHADOW | C_TRANSLUCENT, 0 },
{ "lightfilter", 0, 0, Q_SURF_LIGHTFILTER, 0, C_LIGHTFILTER | C_TRANSLUCENT, 0 },
{ "nolightmap", 0, 0, Q_SURF_VERTEXLIT, 0, C_VERTEXLIT, 0 },
{ "pointlight", 0, 0, Q_SURF_VERTEXLIT, 0, C_VERTEXLIT, 0 },
/* game */
{ "nonsolid", 0, Q_CONT_SOLID, Q_SURF_NONSOLID, 0, 0, C_SOLID },
{ "trigger", Q_CONT_TRIGGER, Q_CONT_SOLID, 0, 0, C_TRANSLUCENT, C_SOLID },
{ "water", Q_CONT_WATER, Q_CONT_SOLID, 0, 0, C_LIQUID | C_TRANSLUCENT, C_SOLID },
{ "slime", Q_CONT_SLIME, Q_CONT_SOLID, 0, 0, C_LIQUID | C_TRANSLUCENT, C_SOLID },
{ "lava", Q_CONT_LAVA, Q_CONT_SOLID, 0, 0, C_LIQUID | C_TRANSLUCENT, C_SOLID },
{ "playerclip", Q_CONT_PLAYERCLIP, Q_CONT_SOLID, 0, 0, C_DETAIL | C_TRANSLUCENT, C_SOLID },
{ "monsterclip", Q_CONT_MONSTERCLIP, Q_CONT_SOLID, 0, 0, C_DETAIL | C_TRANSLUCENT, C_SOLID },
{ "nodrop", Q_CONT_NODROP, Q_CONT_SOLID, 0, 0, C_TRANSLUCENT, C_SOLID },
{ "clusterportal", Q_CONT_CLUSTERPORTAL, Q_CONT_SOLID, 0, 0, C_TRANSLUCENT, C_SOLID },
{ "donotenter", Q_CONT_DONOTENTER, Q_CONT_SOLID, 0, 0, C_TRANSLUCENT, C_SOLID },
{ "botclip", Q_CONT_BOTCLIP, Q_CONT_SOLID, 0, 0, C_TRANSLUCENT, C_SOLID },
{ "fog", Q_CONT_FOG, Q_CONT_SOLID, 0, 0, C_FOG, C_SOLID },
{ "sky", 0, 0, Q_SURF_SKY, 0, C_SKY, 0 },
{ "slick", 0, 0, Q_SURF_SLICK, 0, 0, 0 },
{ "noimpact", 0, 0, Q_SURF_NOIMPACT, 0, 0, 0 },
{ "nomarks", 0, 0, Q_SURF_NOMARKS, 0, C_NOMARKS, 0 },
{ "ladder", 0, 0, Q_SURF_LADDER, 0, 0, 0 },
{ "nodamage", 0, 0, Q_SURF_NODAMAGE, 0, 0, 0 },
{ "metalsteps", 0, 0, Q_SURF_METALSTEPS, 0, 0, 0 },
{ "flesh", 0, 0, Q_SURF_FLESH, 0, 0, 0 },
{ "nosteps", 0, 0, Q_SURF_NOSTEPS, 0, 0, 0 },
{ "nodlight", 0, 0, Q_SURF_NODLIGHT, 0, 0, 0 },
{ "dust", 0, 0, Q_SURF_DUST, 0, 0, 0 },
/* tremulous */
{"noalienbuild", TREM_CONT_NOALIENBUILD,0,0,0,0,0},
{"nohumanbuild", TREM_CONT_NOHUMANBUILD,0,0,0,0,0},
{"nobuild", TREM_CONT_NOBUILD,0,0,0,0,0},
{"noalienbuildsurface", 0,0,TREM_SURF_NOALIENBUILDSURFACE,0,0,0},
{"nohumanbuildsurface", 0,0,TREM_SURF_NOHUMANBUILDSURFACE,0,0,0},
{"nobuildsurface", 0,0,TREM_SURF_NOBUILDSURFACE,0,0,0},
/* null */
{ NULL, 0, 0, 0, 0, 0, 0 }
}
}
/* end marker */
#endif

View file

@ -1,4 +1,5 @@
/*
/* -------------------------------------------------------------------------------
Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
@ -120,11 +121,18 @@ game_t struct
".wolf", /* unix home sub-dir */
"wolf", /* magic path word */
"scripts", /* shader directory */
qtrue, /* wolf lighting model? */
64, /* max lightmapped surface verts */
999, /* max surface verts */
6000, /* max surface indexes */
qfalse, /* flares */
"flareshader", /* default flare shader */
qtrue, /* wolf lighting model? */
128, /* lightmap width/height */
1.0f, /* lightmap gamma */
1.0f, /* lightmap compensate */
"IBSP", /* bsp file prefix */
47, /* bsp file version */
qfalse, /* cod-style lump len/ofs order */
LoadIBSPFile, /* bsp load function */
WriteIBSPFile, /* bsp write function */

View file

@ -1,4 +1,5 @@
/*
/* -------------------------------------------------------------------------------
Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
@ -57,11 +58,18 @@ game_t struct
".etwolf", /* unix home sub-dir */
"et", /* magic path word */
"scripts", /* shader directory */
qtrue, /* wolf lighting model? */
1024, /* max lightmapped surface verts */
1024, /* max surface verts */
6144, /* max surface indexes */
qfalse, /* flares */
"flareshader", /* default flare shader */
qtrue, /* wolf lighting model? */
128, /* lightmap width/height */
1.0f, /* lightmap gamma */
1.0f, /* lightmap compensate */
"IBSP", /* bsp file prefix */
47, /* bsp file version */
qfalse, /* cod-style lump len/ofs order */
LoadIBSPFile, /* bsp load function */
WriteIBSPFile, /* bsp write function */

View file

@ -1,4 +1,5 @@
/*
/* -------------------------------------------------------------------------------
Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
@ -390,7 +391,7 @@ image_t *ImageLoad( const char *filename )
strcat( name, ".tga" );
size = vfsLoadFile( (const char*) name, (void**) &buffer, 0 );
if( size > 0 )
LoadTGABuffer( buffer, &image->pixels, &image->width, &image->height );
LoadTGABuffer( buffer, buffer + size, &image->pixels, &image->width, &image->height );
else
{
/* attempt to load png */

View file

@ -1,4 +1,5 @@
/*
/* -------------------------------------------------------------------------------
Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.

View file

@ -1,4 +1,5 @@
/*
/* -------------------------------------------------------------------------------
Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
@ -115,6 +116,7 @@ static void CreateSunLight( sun_t *sun )
light->fade = 1.0f;
light->falloffTolerance = falloffTolerance;
light->filterRadius = sun->filterRadius / sun->numSamples;
light->style = noStyles ? LS_NORMAL : sun->style;
/* set the light's position out to infinity */
VectorMA( vec3_origin, (MAX_WORLD_COORD * 8.0f), direction, light->origin ); /* MAX_WORLD_COORD * 2.0f */
@ -140,11 +142,13 @@ CreateSkyLights() - ydnar
simulates sky light with multiple suns
*/
static void CreateSkyLights( vec3_t color, float value, int iterations, float filterRadius )
static void CreateSkyLights( vec3_t color, float value, int iterations, float filterRadius, int style )
{
int c, i, j, k, numSuns;
int i, j, numSuns;
int angleSteps, elevationSteps;
float angle, elevation;
float angleStep, elevationStep;
float step, start;
vec3_t in;
sun_t sun;
@ -161,36 +165,49 @@ static void CreateSkyLights( vec3_t color, float value, int iterations, float fi
sun.deviance = 0.0f;
sun.filterRadius = filterRadius;
sun.numSamples = 1;
sun.style = noStyles ? LS_NORMAL : style;
sun.next = NULL;
/* iterate */
numSuns = 0;
for( c = 0; c < 2; c++ )
{
for( k = 0, in[ 2 ] = start; k < iterations; k++, in[ 2 ] += step )
{
/* don't create sky light below the horizon */
if( in[ 2 ] <= 0.0f )
continue;
/* setup */
elevationSteps = iterations - 1;
angleSteps = elevationSteps * 4;
angle = 0.0f;
elevationStep = DEG2RAD( 90.0f / iterations ); /* skip elevation 0 */
angleStep = DEG2RAD( 360.0f / angleSteps );
for( j = 0, in[ 1 ] = start; j < iterations; j++, in[ 1 ] += step )
{
for( i = 0, in[ 0 ] = start; i < iterations; i++, in[ 0 ] += step )
{
if( VectorNormalize( in, sun.direction ) )
{
if( c > 0 && numSuns > 0 )
{
/* calc individual sun brightness */
numSuns = angleSteps * elevationSteps + 1;
sun.photons = value / numSuns;
/* iterate elevation */
elevation = elevationStep * 0.5f;
angle = 0.0f;
for( i = 0, elevation = elevationStep * 0.5f; i < elevationSteps; i++ )
{
/* iterate angle */
for( j = 0; j < angleSteps; j++ )
{
/* create sun */
sun.direction[ 0 ] = cos( angle ) * cos( elevation );
sun.direction[ 1 ] = sin( angle ) * cos( elevation );
sun.direction[ 2 ] = sin( elevation );
CreateSunLight( &sun );
/* move */
angle += angleStep;
}
else
numSuns++;
}
}
}
}
/* move */
elevation += elevationStep;
angle += angleStep / elevationSteps;
}
/* create vertical sun */
VectorSet( sun.direction, 0.0f, 0.0f, 1.0f );
CreateSunLight( &sun );
/* short circuit */
return;
}
@ -245,7 +262,7 @@ void CreateEntityLights( void )
spawnflags = IntForKey( e, "spawnflags" );
/* ydnar: quake 3+ light behavior */
if( game->wolfLight == qfalse )
if( wolfLight == qfalse )
{
/* set default flags */
flags = LIGHT_Q3A_DEFAULT;
@ -317,11 +334,15 @@ void CreateEntityLights( void )
/* set origin */
GetVectorForKey( e, "origin", light->origin);
light->style = IntForKey( e, "_style" );
if( light->style == 0 )
if( light->style == LS_NORMAL )
light->style = IntForKey( e, "style" );
if( light->style < LS_NORMAL || light->style >= LS_NONE )
Error( "Invalid lightstyle (%d) on entity %d", light->style, i );
/* override */
if( noStyles )
light->style = LS_NORMAL;
/* set light intensity */
intensity = FloatForKey( e, "_light" );
if( intensity == 0.0f )
@ -433,6 +454,7 @@ void CreateEntityLights( void )
sun.photons = (intensity / pointScale);
sun.deviance = deviance / 180.0f * Q_PI;
sun.numSamples = numSamples;
sun.style = noStyles ? LS_NORMAL : light->style;
sun.next = NULL;
/* make a sun light */
@ -516,7 +538,7 @@ void CreateSurfaceLights( void )
if( si->skyLightValue > 0.0f )
{
Sys_FPrintf( SYS_VRB, "Sky: %s\n", si->shader );
CreateSkyLights( si->color, si->skyLightValue, si->skyLightIterations, si->lightFilterRadius );
CreateSkyLights( si->color, si->skyLightValue, si->skyLightIterations, si->lightFilterRadius, si->lightStyle );
si->skyLightValue = 0.0f; /* FIXME: hack! */
}
@ -546,7 +568,7 @@ void CreateSurfaceLights( void )
VectorCopy( origin, light->origin );
VectorCopy( si->color, light->color );
light->falloffTolerance = falloffTolerance;
light->style = light->style;
light->style = si->lightStyle;
/* add to point light count and continue */
numPointLights++;
@ -737,35 +759,8 @@ int LightContributionToSample( trace_t *trace )
return 0;
}
/* ptpff approximation */
if( light->type == EMIT_AREA && faster )
{
/* get direction and distance */
VectorCopy( light->origin, trace->end );
dist = SetupTrace( trace );
if( dist >= light->envelope )
return 0;
/* clamp the distance to prevent super hot spots */
if( dist < 16.0f )
dist = 16.0f;
/* angle attenuation */
angle = DotProduct( trace->normal, trace->direction );
/* twosided lighting */
if( trace->twoSided )
angle = fabs( angle );
/* attenuate */
angle *= -DotProduct( light->normal, trace->direction );
if( angle <= 0.0f )
return 0;
add = light->photons / (dist * dist) * angle;
}
/* exact point to polygon form factor */
else if( light->type == EMIT_AREA )
if( light->type == EMIT_AREA )
{
float factor;
float d;
@ -774,8 +769,6 @@ int LightContributionToSample( trace_t *trace )
/* project sample point into light plane */
d = DotProduct( trace->origin, light->normal ) - light->dist;
//% if( !(light->flags & LIGHT_TWOSIDED) && d < -1.0f )
//% return 0;
if( d < 3.0f )
{
/* sample point behind plane? */
@ -800,6 +793,27 @@ int LightContributionToSample( trace_t *trace )
if( dist >= light->envelope )
return 0;
/* ptpff approximation */
if( faster )
{
/* angle attenuation */
angle = DotProduct( trace->normal, trace->direction );
/* twosided lighting */
if( trace->twoSided )
angle = fabs( angle );
/* attenuate */
angle *= -DotProduct( light->normal, trace->direction );
if( angle == 0.0f )
return 0;
else if( angle < 0.0f &&
(trace->twoSided || (light->flags & LIGHT_TWOSIDED)) )
angle = -angle;
add = light->photons / (dist * dist) * angle;
}
else
{
/* calculate the contribution */
factor = PointToPolygonFormFactor( pushedOrigin, trace->normal, light->w );
if( factor == 0.0f )
@ -824,6 +838,7 @@ int LightContributionToSample( trace_t *trace )
/* ydnar: moved to here */
add = factor * light->add;
}
}
/* point/spot lights */
else if( light->type == EMIT_POINT || light->type == EMIT_SPOT )
@ -1436,6 +1451,7 @@ void TraceGrid( int num )
#endif
/* store direction */
if( !bouncing )
NormalToLatLong( gp->dir, bgp->latLong );
}
@ -1634,6 +1650,18 @@ void LightWorld( void )
Sys_Printf( "%9d luxels mapped\n", numLuxelsMapped );
Sys_Printf( "%9d luxels occluded\n", numLuxelsOccluded );
/* dirty them up */
if( dirty )
{
Sys_Printf( "--- DirtyRawLightmap ---\n" );
RunThreadsOnIndividual( numRawLightmaps, qtrue, DirtyRawLightmap );
}
/* ydnar: set up light envelopes */
SetupEnvelopes( qfalse, fast );
@ -1747,6 +1775,12 @@ int LightMain( int argc, char **argv )
/* note it */
Sys_Printf( "--- Light ---\n" );
/* set standard game flags */
wolfLight = game->wolfLight;
lmCustomSize = game->lightmapSize;
lightmapGamma = game->lightmapGamma;
lightmapCompensate = game->lightmapCompensate;
/* process commandline arguments */
for( i = 1; i < (argc - 1); i++ )
{
@ -1794,6 +1828,24 @@ int LightMain( int argc, char **argv )
i++;
}
else if( !strcmp( argv[ i ], "-gamma" ) )
{
f = atof( argv[ i + 1 ] );
lightmapGamma = f;
Sys_Printf( "Lighting gamma set to %f\n", lightmapGamma );
i++;
}
else if( !strcmp( argv[ i ], "-compensate" ) )
{
f = atof( argv[ i + 1 ] );
if( f <= 0.0f )
f = 1.0f;
lightmapCompensate = f;
Sys_Printf( "Lighting compensation set to 1/%f\n", lightmapCompensate );
i++;
}
/* ydnar switches */
else if( !strcmp( argv[ i ], "-bounce" ) )
{
@ -1831,6 +1883,18 @@ int LightMain( int argc, char **argv )
Sys_Printf( "Lightmap filtering enabled\n" );
}
else if( !strcmp( argv[ i ], "-dark" ) )
{
dark = qtrue;
Sys_Printf( "Dark lightmap seams enabled\n" );
}
else if( !strcmp( argv[ i ], "-shadeangle" ) )
{
shadeAngleDegrees = atof( argv[ i + 1 ] );
@ -1884,13 +1948,13 @@ int LightMain( int argc, char **argv )
if( ((lmCustomSize - 1) & lmCustomSize) || lmCustomSize < 2 )
{
Sys_Printf( "WARNING: Lightmap size must be a power of 2, greater or equal to 2 pixels.\n" );
lmCustomSize = LIGHTMAP_WIDTH;
lmCustomSize = game->lightmapSize;
}
i++;
Sys_Printf( "Default lightmap size set to %d x %d pixels\n", lmCustomSize, lmCustomSize );
/* enable external lightmaps */
if( lmCustomSize != LIGHTMAP_WIDTH )
if( lmCustomSize != game->lightmapSize )
{
externalLightmaps = qtrue;
Sys_Printf( "Storing all lightmaps externally\n" );
@ -1907,8 +1971,15 @@ int LightMain( int argc, char **argv )
else if( !strcmp( argv[ i ], "-wolf" ) )
{
/* -game should already be set */
game->wolfLight = qtrue;
Sys_Printf( "Enabling Wolf lighting model\n" );
wolfLight = qtrue;
Sys_Printf( "Enabling Wolf lighting model (linear default)\n" );
}
else if( !strcmp( argv[ i ], "-q3" ) )
{
/* -game should already be set */
wolfLight = qfalse;
Sys_Printf( "Enabling Quake 3 lighting model (nonlinear default)\n" );
}
else if( !strcmp( argv[ i ], "-sunonly" ) )
@ -1944,7 +2015,6 @@ int LightMain( int argc, char **argv )
else if( !strcmp( argv[ i ], "-smooth" ) )
{
smooth = qtrue;
lightSamples = EXTRA_SCALE;
Sys_Printf( "The -smooth argument is deprecated, use \"-samples 2\" instead\n" );
}
@ -2064,14 +2134,11 @@ int LightMain( int argc, char **argv )
}
else if( !strcmp( argv[ i ], "-extra" ) )
{
extra = qtrue;
superSample = EXTRA_SCALE; /* ydnar */
Sys_Printf( "The -extra argument is deprecated, use \"-super 2\" instead\n" );
}
else if( !strcmp( argv[ i ], "-extrawide" ) )
{
extra = qtrue;
extraWide = qtrue;
superSample = EXTRAWIDE_SCALE; /* ydnar */
filter = qtrue; /* ydnar */
Sys_Printf( "The -extrawide argument is deprecated, use \"-filter [-super 2]\" instead\n");
@ -2114,9 +2181,64 @@ int LightMain( int argc, char **argv )
loMem = qtrue;
Sys_Printf( "Enabling low-memory (potentially slower) lighting mode\n" );
}
else if( !strcmp( argv[ i ], "-nostyle" ) || !strcmp( argv[ i ], "-nostyles" ) )
{
noStyles = qtrue;
Sys_Printf( "Disabling lightstyles\n" );
}
else if( !strcmp( argv[ i ], "-cpma" ) )
{
cpmaHack = qtrue;
Sys_Printf( "Enabling Challenge Pro Mode Asstacular Vertex Lighting Mode (tm)\n" );
}
/* r7: dirtmapping */
else if( !strcmp( argv[ i ], "-dirty" ) )
{
dirty = qtrue;
Sys_Printf( "Dirtmapping enabled\n" );
}
else if( !strcmp( argv[ i ], "-dirtdebug" ) || !strcmp( argv[ i ], "-debugdirt" ) )
{
dirtDebug = qtrue;
Sys_Printf( "Dirtmap debugging enabled\n" );
}
else if( !strcmp( argv[ i ], "-dirtmode" ) )
{
dirtMode = atoi( argv[ i + 1 ] );
if( dirtMode != 0 && dirtMode != 1 )
dirtMode = 0;
if( dirtMode == 1 )
Sys_Printf( "Enabling randomized dirtmapping\n" );
else
Sys_Printf( "WARNING: Unknown option \"%s\"\n", argv[ i ] );
Sys_Printf( "Enabling ordered dir mapping\n" );
}
else if( !strcmp( argv[ i ], "-dirtdepth" ) )
{
dirtDepth = atof( argv[ i + 1 ] );
if( dirtDepth <= 0.0f )
dirtDepth = 128.0f;
Sys_Printf( "Dirtmapping depth set to %.1f\n", dirtDepth );
}
else if( !strcmp( argv[ i ], "-dirtscale" ) )
{
dirtScale = atof( argv[ i + 1 ] );
if( dirtScale <= 0.0f )
dirtScale = 1.0f;
Sys_Printf( "Dirtmapping scale set to %.1f\n", dirtScale );
}
else if( !strcmp( argv[ i ], "-dirtgain" ) )
{
dirtGain = atof( argv[ i + 1 ] );
if( dirtGain <= 0.0f )
dirtGain = 1.0f;
Sys_Printf( "Dirtmapping gain set to %.1f\n", dirtGain );
}
/* unhandled args */
else
Sys_Printf( "WARNING: Unknown argument \"%s\"\n", argv[ i ] );
}
/* clean up map name */
@ -2156,6 +2278,7 @@ int LightMain( int argc, char **argv )
/* ydnar: set up optimization */
SetupBrushes();
SetupDirt();
SetupSurfaceLightmaps();
/* initialize the surface facet tracing */

Some files were not shown because too many files have changed in this diff Show more