auto merge mirror branch -> work branch

git-svn-id: svn://svn.icculus.org/gtkradiant/GtkRadiant/branches/ZeroRadiant@309 8a3a26a2-13c4-0310-b231-cf6edde360e5
This commit is contained in:
TTimo 2008-08-24 03:21:41 +00:00
commit 5fc27697b3
35 changed files with 806 additions and 660 deletions

View file

@ -124,6 +124,7 @@ SCommandInfo g_Commands[] =
{"CSGMerge", 'U', 0x04, ID_SELECTION_CSGMERGE, "menu_selection_csgmerge"},
{"CSGSubtract", 'U', 0x01, ID_SELECTION_CSGSUBTRACT, "menu_selection_csgsubstract"},
// {"ViewGroups", 'G', 0x00, ID_VIEW_GROUPS, "menu_view_groups"}, (temporary disabled)
{"SelectFuncGroup", 'G', 0x00, ID_SELECT_FUNC_GROUP, "menu_select_func_group"},
{"HideSelected", 'H', 0x00, ID_VIEW_HIDESHOW_HIDESELECTED, "menu_view_hideshow_hideselected"},
{"ShowHidden", 'H', 0x01, ID_VIEW_HIDESHOW_SHOWHIDDEN, "menu_view_hideshow_showhidden"},
{"BendMode", 'B', 0x00, ID_PATCH_BEND, "menu_patch_bend"},
@ -426,6 +427,7 @@ gint HandleCommand (GtkWidget *widget, gpointer data)
case ID_TOGGLECONSOLE: g_pParentWnd->OnToggleconsole (); break;
case ID_VIEW_ENTITY: g_pParentWnd->OnViewEntity (); break;
case ID_VIEW_GROUPS: g_pParentWnd->OnViewGroups (); break;
case ID_SELECT_FUNC_GROUP: g_pParentWnd->OnSelectFuncGroup(); break;
case ID_TOGGLEVIEW: g_pParentWnd->OnToggleview (); break;
case ID_TOGGLEVIEW_YZ: g_pParentWnd->OnToggleviewYz (); break;
case ID_TOGGLEVIEW_XZ: g_pParentWnd->OnToggleviewXz (); break;
@ -1204,6 +1206,7 @@ void MainFrame::create_main_menu (GtkWidget *window, GtkWidget *vbox)
GTK_SIGNAL_FUNC (HandleCommand), ID_SELECTION_SELECTPARTIALTALL);
create_menu_item_with_mnemonic (menu_in_menu, "Select _Inside",
GTK_SIGNAL_FUNC (HandleCommand), ID_SELECTION_SELECTINSIDE);
create_menu_item_with_mnemonic (menu_in_menu, "Select Func _Group", GTK_SIGNAL_FUNC (HandleCommand), ID_SELECT_FUNC_GROUP);
#ifndef QUAKE3
create_menu_item_with_mnemonic (menu_in_menu, "Nudge Left",
GTK_SIGNAL_FUNC (HandleCommand), ID_SELECTION_SELECT_NUDGELEFT);
@ -7061,6 +7064,23 @@ void MainFrame::OnPatchTab()
}
}
void MainFrame::OnSelectFuncGroup()
{
// check to see if the selected brush is part of a func group
// if it is, deselect everything and reselect the next brush
// in the group
brush_t *b2, *b = selected_brushes.next;
entity_t * e;
if (b != &selected_brushes)
{
if (strcmpi(b->owner->eclass->name, "worldspawn") != 0)
{
e = b->owner;
Select_SelectGroup(e);
}
}
}
void MainFrame::OnCameraForward(bool keydown)
{
if (g_PrefsDlg.m_bCamDiscrete && (m_pCamWnd && !m_pCamWnd->m_bFreeMove) )

View file

@ -407,6 +407,8 @@ struct SKeyInfo
#define ID_COLORS_MINOR_ALT 40230
#define ID_COLORS_MAJOR_ALT 40231
#define ID_SELECT_FUNC_GROUP 40233
// those must have their own ID chunk ID_GRID_025 <= ID_GRID <= ID_GRID_256
#define ID_GRID_025 40300
#define ID_GRID_05 40301
@ -891,6 +893,7 @@ public:
void OnFilterPaths();
void OnFilterClusterportals();
void OnFilterLightgrid();
void OnSelectFuncGroup();
private:
EViewStyle m_nCurrentStyle;

View file

@ -1372,6 +1372,30 @@ void Select_Inside (void)
Sys_UpdateWindows (W_ALL);
}
void Select_SelectGroup(entity_t* group)
{
brush_t* b;
//brush_t* next;
Undo_Start ("select func group");
Undo_AddBrushList (&selected_brushes);
Undo_End();
Select_Deselect();
b = &group->brushes;
do
{
b = b->onext;
Brush_RemoveFromList(b);
Brush_AddToList(b, &selected_brushes);
} while( b->onext != &group->brushes );
Sys_UpdateWindows (W_ALL);
}
void Select_Ungroup(void)
{
int numselectedgroups;

View file

@ -65,6 +65,8 @@ void Select_AllOfType();
void Select_Reselect();
void Select_FitTexture(int nHeight = 1, int nWidth = 1);
void Select_SelectGroup(entity_t* group);
// absolute texture coordinates
// TTimo NOTE: this is stuff for old brushes format and rotation texture lock .. sort of in-between with bush primitives
void ComputeAbsolute(face_t* f, vec3_t& p1, vec3_t& p2, vec3_t& p3);

View file

@ -44,6 +44,76 @@ functions
------------------------------------------------------------------------------- */
/*
ProcessAdvertisements()
copies advertisement info into the BSP structures
*/
static void ProcessAdvertisements( void ) {
int i;
const char* className;
const char* modelKey;
int modelNum;
bspModel_t* adModel;
bspDrawSurface_t* adSurface;
Sys_FPrintf( SYS_VRB, "--- ProcessAdvertisements ---\n" );
for( i = 0; i < numEntities; i++ ) {
/* is an advertisement? */
className = ValueForKey( &entities[ i ], "classname" );
if( !Q_stricmp( "advertisement", className ) ) {
modelKey = ValueForKey( &entities[ i ], "model" );
if( strlen( modelKey ) > MAX_QPATH - 1 ) {
Error( "Model Key for entity exceeds ad struct string length." );
} else {
if( numBSPAds < MAX_MAP_ADVERTISEMENTS ) {
bspAds[numBSPAds].cellId = IntForKey( &entities[ i ], "cellId" );
strncpy( bspAds[numBSPAds].model, modelKey, sizeof( bspAds[numBSPAds].model ) );
modelKey++;
modelNum = atoi( modelKey );
adModel = &bspModels[modelNum];
if( adModel->numBSPSurfaces != 1 ) {
Error( "Ad cell id %d has more than one surface.", bspAds[numBSPAds].cellId );
}
adSurface = &bspDrawSurfaces[adModel->firstBSPSurface];
// store the normal for use at run time.. all ad verts are assumed to
// have identical normals (because they should be a simple rectangle)
// so just use the first vert's normal
VectorCopy( bspDrawVerts[adSurface->firstVert].normal, bspAds[numBSPAds].normal );
// store the ad quad for quick use at run time
if( adSurface->surfaceType == MST_PATCH ) {
int v0 = adSurface->firstVert + adSurface->patchHeight - 1;
int v1 = adSurface->firstVert + adSurface->numVerts - 1;
int v2 = adSurface->firstVert + adSurface->numVerts - adSurface->patchWidth;
int v3 = adSurface->firstVert;
VectorCopy( bspDrawVerts[v0].xyz, bspAds[numBSPAds].rect[0] );
VectorCopy( bspDrawVerts[v1].xyz, bspAds[numBSPAds].rect[1] );
VectorCopy( bspDrawVerts[v2].xyz, bspAds[numBSPAds].rect[2] );
VectorCopy( bspDrawVerts[v3].xyz, bspAds[numBSPAds].rect[3] );
} else {
Error( "Ad cell %d has an unsupported Ad Surface type.", bspAds[numBSPAds].cellId );
}
numBSPAds++;
} else {
Error( "Maximum number of map advertisements exceeded." );
}
}
}
}
Sys_FPrintf( SYS_VRB, "%9d in-game advertisements\n", numBSPAds );
}
/*
SetCloneModelNumbers() - ydnar
@ -840,6 +910,9 @@ int BSPMain( int argc, char **argv )
/* set light styles from targetted light entities */
SetLightStyles();
/* process in game advertisements */
ProcessAdvertisements();
/* finish and write bsp */
EndBSPFile();

View file

@ -239,6 +239,24 @@ void SwapBSPFile( void )
bspFogs[ i ].brushNum = LittleLong( bspFogs[ i ].brushNum );
bspFogs[ i ].visibleSide = LittleLong( bspFogs[ i ].visibleSide );
}
/* advertisements */
for( i = 0; i < numBSPAds; i++ )
{
bspAds[ i ].cellId = LittleLong( bspAds[ i ].cellId );
bspAds[ i ].normal[ 0 ] = LittleFloat( bspAds[ i ].normal[ 0 ] );
bspAds[ i ].normal[ 1 ] = LittleFloat( bspAds[ i ].normal[ 1 ] );
bspAds[ i ].normal[ 2 ] = LittleFloat( bspAds[ i ].normal[ 2 ] );
for( j = 0; j < 4; j++ )
{
bspAds[ i ].rect[j][ 0 ] = LittleFloat( bspAds[ i ].rect[j][ 0 ] );
bspAds[ i ].rect[j][ 1 ] = LittleFloat( bspAds[ i ].rect[j][ 1 ] );
bspAds[ i ].rect[j][ 2 ] = LittleFloat( bspAds[ i ].rect[j][ 2 ] );
}
//bspAds[ i ].model[ MAX_QPATH ];
}
}

View file

@ -63,7 +63,8 @@ into the abstracted bsp file used by q3map2.
#define LUMP_LIGHTMAPS 14
#define LUMP_LIGHTGRID 15
#define LUMP_VISIBILITY 16
#define HEADER_LUMPS 17
#define LUMP_ADVERTISEMENTS 17
#define HEADER_LUMPS 18
/* types */
@ -452,8 +453,6 @@ static void AddLightGridLumps( FILE *file, ibspHeader_t *header )
free( buffer );
}
/*
LoadIBSPFile()
loads a quake 3 bsp file into memory
@ -513,6 +512,9 @@ void LoadIBSPFile( const char *filename )
CopyLightGridLumps( header );
/* advertisements */
numBSPAds = CopyLump( (bspHeader_t*) header, LUMP_ADVERTISEMENTS, bspAds, sizeof( bspAdvertisement_t ) );
/* free the file buffer */
free( header );
}
@ -571,6 +573,9 @@ void WriteIBSPFile( const char *filename )
AddLump( file, (bspHeader_t*) header, LUMP_FOGS, bspFogs, numBSPFogs * sizeof( bspFog_t ) );
AddLump( file, (bspHeader_t*) header, LUMP_DRAWINDEXES, bspDrawIndexes, numBSPDrawIndexes * sizeof( bspDrawIndexes[ 0 ] ) );
/* advertisements */
AddLump( file, (bspHeader_t*) header, LUMP_ADVERTISEMENTS, bspAds, numBSPAds * sizeof( bspAdvertisement_t ) );
/* emit bsp size */
size = ftell( file );
Sys_Printf( "Wrote %.1f MB (%d bytes)\n", (float) size / (1024 * 1024), size );

View file

@ -107,7 +107,7 @@ game_t struct
qfalse, /* flares */
"flareshader", /* default flare shader */
"IBSP", /* bsp file prefix */
46, /* bsp file version */
47, /* bsp file version */
LoadIBSPFile, /* bsp load function */
WriteIBSPFile, /* bsp write function */
@ -171,7 +171,6 @@ game_t struct
{ "nodlight", 0, 0, Q_SURF_NODLIGHT, 0, 0, 0 },
{ "dust", 0, 0, Q_SURF_DUST, 0, 0, 0 },
/* null */
{ NULL, 0, 0, 0, 0, 0, 0 }
}

View file

@ -322,6 +322,10 @@ void CreateEntityLights( void )
if( light->style < LS_NORMAL || light->style >= LS_NONE )
Error( "Invalid lightstyle (%d) on entity %d", light->style, i );
if( light->style != LS_NORMAL ) {
Sys_FPrintf (SYS_WRN, "WARNING: Styled light found targeting %s\n **", target );
}
/* set light intensity */
intensity = FloatForKey( e, "_light" );
if( intensity == 0.0f )

View file

@ -381,7 +381,8 @@ mesh_t *SubdivideMesh( mesh_t in, float maxError, float minLength )
float len;
mesh_t out;
static bspDrawVert_t expand[MAX_EXPANDED_AXIS][MAX_EXPANDED_AXIS];
/* ydnar: static for os x */
MAC_STATIC bspDrawVert_t expand[MAX_EXPANDED_AXIS][MAX_EXPANDED_AXIS];
out.width = in.width;
@ -547,7 +548,8 @@ mesh_t *SubdivideMesh2( mesh_t in, int iterations )
bspDrawVert_t prev, next, mid;
mesh_t out;
static bspDrawVert_t expand[ MAX_EXPANDED_AXIS ][ MAX_EXPANDED_AXIS ];
/* ydnar: static for os x */
MAC_STATIC bspDrawVert_t expand[ MAX_EXPANDED_AXIS ][ MAX_EXPANDED_AXIS ];
/* initial setup */
@ -652,7 +654,8 @@ mesh_t *RemoveLinearMeshColumnsRows( mesh_t *in ) {
vec3_t proj, dir;
mesh_t out;
static bspDrawVert_t expand[MAX_EXPANDED_AXIS][MAX_EXPANDED_AXIS];
/* ydnar: static for os x */
MAC_STATIC bspDrawVert_t expand[MAX_EXPANDED_AXIS][MAX_EXPANDED_AXIS];
out.width = in->width;
@ -728,8 +731,7 @@ mesh_t *SubdivideMeshQuads( mesh_t *in, float minLength, int maxsize, int *width
vec3_t dir;
float length, maxLength, amount;
mesh_t out;
static bspDrawVert_t expand[MAX_EXPANDED_AXIS][MAX_EXPANDED_AXIS];
bspDrawVert_t expand[MAX_EXPANDED_AXIS][MAX_EXPANDED_AXIS];
out.width = in->width;
out.height = in->height;

View file

@ -167,7 +167,6 @@ constants
#define C_ANTIPORTAL 0x00004000 /* like hint, but doesn't generate portals */
#define C_SKIP 0x00008000 /* like hint, but skips this face (doesn't split bsp) */
#define C_NOMARKS 0x00010000 /* no decals */
#define C_DETAIL 0x08000000 /* THIS MUST BE THE SAME AS IN RADIANT! */
@ -320,6 +319,7 @@ abstracted bsp file
#define MAX_MAP_DRAW_VERTS 0x80000
#define MAX_MAP_DRAW_INDEXES 0x80000
#define MAX_MAP_ADVERTISEMENTS 30
/* key / value pair sizes in the entities lump */
#define MAX_KEY 32
@ -499,6 +499,14 @@ typedef struct
bspDrawSurface_t;
/* advertisements */
typedef struct {
int cellId;
vec3_t normal;
vec3_t rect[4];
char model[ MAX_QPATH ];
} bspAdvertisement_t;
/* -------------------------------------------------------------------------------
@ -2269,6 +2277,8 @@ Q_EXTERN bspDrawSurface_t *bspDrawSurfaces Q_ASSIGN( NULL );
Q_EXTERN int numBSPFogs Q_ASSIGN( 0 );
Q_EXTERN bspFog_t bspFogs[ MAX_MAP_FOGS ];
Q_EXTERN int numBSPAds Q_ASSIGN( 0 );
Q_EXTERN bspAdvertisement_t bspAds[ MAX_MAP_ADVERTISEMENTS ];
/* end marker */

View file

@ -16,10 +16,9 @@
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(SolutionDir)\install"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
UseOfMFC="0"
CharacterSet="2"
>
<Tool
@ -61,11 +60,11 @@
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="md5lib.lib ddslib.lib l_net.lib mathlib.lib picomodel.lib libxml2.lib libpng.lib glib-2.0.lib gobject-2.0.lib Wsock32.lib libjpeg.lib"
AdditionalLibraryDirectories="&quot;$(SolutionDir)\..\libxml2\lib&quot;;&quot;$(SolutionDir)\..\gtk2\lib&quot;;&quot;$(SolutionDir)\build\$(ConfigurationName)\libs&quot;;&quot;$(SolutionDir)\..\jpeg-6b&quot;"
IgnoreAllDefaultLibraries="false"
IgnoreDefaultLibraryNames=""
AdditionalDependencies="md5lib.lib ddslib.lib l_net.lib mathlib.lib picomodel.lib jpeg6.lib libxml2.lib libpng.lib glib-2.0.lib gobject-2.0.lib Wsock32.lib"
AdditionalLibraryDirectories="&quot;$(SolutionDir)\..\libxml2\lib&quot;;&quot;$(SolutionDir)\..\gtk2\lib&quot;;&quot;$(SolutionDir)\build\$(ConfigurationName)\libs&quot;"
GenerateDebugInformation="true"
StackReserveSize="2097152"
StackCommitSize="2097152"
TargetMachine="1"
/>
<Tool
@ -91,11 +90,12 @@
/>
<Tool
Name="VCPostBuildEventTool"
CommandLine="copy &quot;$(TargetPath)&quot; C:\alienbrainWork\QuakeZero\radiant\$(TargetFileName)"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)\install"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="2"
@ -137,9 +137,11 @@
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="md5lib.lib ddslib.lib l_net.lib mathlib.lib picomodel.lib libxml2.lib libpng.lib glib-2.0.lib gobject-2.0.lib Wsock32.lib libjpeg.lib"
AdditionalLibraryDirectories="&quot;$(SolutionDir)\..\libxml2\lib&quot;;&quot;$(SolutionDir)\..\gtk2\lib&quot;;&quot;$(SolutionDir)\build\$(ConfigurationName)\libs&quot;;&quot;$(SolutionDir)\..\jpeg-6b&quot;"
AdditionalDependencies="md5lib.lib ddslib.lib l_net.lib mathlib.lib picomodel.lib jpeg6.lib libxml2.lib libpng.lib glib-2.0.lib gobject-2.0.lib Wsock32.lib"
AdditionalLibraryDirectories="&quot;$(SolutionDir)\..\libxml2\lib&quot;;&quot;$(SolutionDir)\..\gtk2\lib&quot;;&quot;$(SolutionDir)\build\$(ConfigurationName)\libs&quot;"
GenerateDebugInformation="true"
StackReserveSize="2097152"
StackCommitSize="2097152"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"
@ -167,6 +169,7 @@
/>
<Tool
Name="VCPostBuildEventTool"
CommandLine="copy &quot;$(TargetPath)&quot; C:\alienbrainWork\QuakeZero\radiant\$(TargetFileName)"
/>
</Configuration>
</Configurations>
@ -233,26 +236,6 @@
RelativePath="..\common\inout.c"
>
</File>
<File
RelativePath="..\common\jpeg.c"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="&quot;$(SolutionDir)\..\jpeg-6b&quot;"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="&quot;$(SolutionDir)\..\jpeg-6b&quot;"
/>
</FileConfiguration>
</File>
<File
RelativePath="..\common\mutex.c"
>

View file

@ -338,12 +338,13 @@ void WriteMapShaderFile( void )
/* print it to the file */
fprintf( file, "%s%s\n", si->shader, si->shaderText );
//% Sys_Printf( "%s%s\n", si->shader, si->shaderText ); /* FIXME: remove debugging code */
//Sys_Printf( "%s%s\n", si->shader, si->shaderText ); /* FIXME: remove debugging code */
Sys_FPrintf( SYS_VRB, "." );
}
/* close the shader */
fflush( file );
fclose( file );
Sys_FPrintf( SYS_VRB, "\n" );

View file

@ -400,6 +400,8 @@ void EndBSPFile( void )
char path[ 1024 ];
Sys_FPrintf( SYS_VRB, "--- EndBSPFile ---\n" );
EmitPlanes();
numBSPEntities = numEntities;