Changeset 308
- Timestamp:
- 08/23/08 22:20:51 (3 months ago)
- Files:
-
- GtkRadiant/branches/ZeroRadiant.ab/radiant/mainframe.cpp (modified) (4 diffs)
- GtkRadiant/branches/ZeroRadiant.ab/radiant/mainframe.h (modified) (2 diffs)
- GtkRadiant/branches/ZeroRadiant.ab/radiant/select.cpp (modified) (1 diff)
- GtkRadiant/branches/ZeroRadiant.ab/radiant/select.h (modified) (1 diff)
- GtkRadiant/branches/ZeroRadiant.ab/tools/quake3/q3map2/bsp.c (modified) (2 diffs)
- GtkRadiant/branches/ZeroRadiant.ab/tools/quake3/q3map2/bspfile_abstract.c (modified) (1 diff)
- GtkRadiant/branches/ZeroRadiant.ab/tools/quake3/q3map2/bspfile_ibsp.c (modified) (4 diffs)
- GtkRadiant/branches/ZeroRadiant.ab/tools/quake3/q3map2/game_quake3.h (modified) (2 diffs)
- GtkRadiant/branches/ZeroRadiant.ab/tools/quake3/q3map2/light.c (modified) (1 diff)
- GtkRadiant/branches/ZeroRadiant.ab/tools/quake3/q3map2/mesh.c (modified) (4 diffs)
- GtkRadiant/branches/ZeroRadiant.ab/tools/quake3/q3map2/q3map2.h (modified) (4 diffs)
- GtkRadiant/branches/ZeroRadiant.ab/tools/quake3/q3map2/q3map2.vcproj (modified) (4 diffs)
- GtkRadiant/branches/ZeroRadiant.ab/tools/quake3/q3map2/shaders.c (modified) (2 diffs)
- GtkRadiant/branches/ZeroRadiant.ab/tools/quake3/q3map2/writebsp.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
GtkRadiant/branches/ZeroRadiant.ab/radiant/mainframe.cpp
r186 r308 125 125 {"CSGSubtract", 'U', 0x01, ID_SELECTION_CSGSUBTRACT, "menu_selection_csgsubstract"}, 126 126 // {"ViewGroups", 'G', 0x00, ID_VIEW_GROUPS, "menu_view_groups"}, (temporary disabled) 127 {"SelectFuncGroup", 'G', 0x00, ID_SELECT_FUNC_GROUP, "menu_select_func_group"}, 127 128 {"HideSelected", 'H', 0x00, ID_VIEW_HIDESHOW_HIDESELECTED, "menu_view_hideshow_hideselected"}, 128 129 {"ShowHidden", 'H', 0x01, ID_VIEW_HIDESHOW_SHOWHIDDEN, "menu_view_hideshow_showhidden"}, … … 427 428 case ID_VIEW_ENTITY: g_pParentWnd->OnViewEntity (); break; 428 429 case ID_VIEW_GROUPS: g_pParentWnd->OnViewGroups (); break; 430 case ID_SELECT_FUNC_GROUP: g_pParentWnd->OnSelectFuncGroup(); break; 429 431 case ID_TOGGLEVIEW: g_pParentWnd->OnToggleview (); break; 430 432 case ID_TOGGLEVIEW_YZ: g_pParentWnd->OnToggleviewYz (); break; … … 1203 1205 create_menu_item_with_mnemonic (menu_in_menu, "Select _Inside", 1204 1206 GTK_SIGNAL_FUNC (HandleCommand), ID_SELECTION_SELECTINSIDE); 1207 create_menu_item_with_mnemonic (menu_in_menu, "Select Func _Group", GTK_SIGNAL_FUNC (HandleCommand), ID_SELECT_FUNC_GROUP); 1205 1208 #ifndef QUAKE3 1206 1209 create_menu_item_with_mnemonic (menu_in_menu, "Nudge Left", … … 7060 7063 } 7061 7064 7065 void MainFrame::OnSelectFuncGroup() 7066 { 7067 // check to see if the selected brush is part of a func group 7068 // if it is, deselect everything and reselect the next brush 7069 // in the group 7070 brush_t *b2, *b = selected_brushes.next; 7071 entity_t * e; 7072 if (b != &selected_brushes) 7073 { 7074 if (strcmpi(b->owner->eclass->name, "worldspawn") != 0) 7075 { 7076 e = b->owner; 7077 Select_SelectGroup(e); 7078 } 7079 } 7080 } 7081 7062 7082 void MainFrame::OnCameraForward(bool keydown) 7063 7083 { GtkRadiant/branches/ZeroRadiant.ab/radiant/mainframe.h
r184 r308 408 408 #define ID_COLORS_MAJOR_ALT 40231 409 409 410 #define ID_SELECT_FUNC_GROUP 40233 411 410 412 // those must have their own ID chunk ID_GRID_025 <= ID_GRID <= ID_GRID_256 411 413 #define ID_GRID_025 40300 … … 892 894 void OnFilterClusterportals(); 893 895 void OnFilterLightgrid(); 896 void OnSelectFuncGroup(); 894 897 895 898 private: GtkRadiant/branches/ZeroRadiant.ab/radiant/select.cpp
r186 r308 1373 1373 } 1374 1374 1375 void Select_SelectGroup(entity_t* group) 1376 { 1377 brush_t* b; 1378 //brush_t* next; 1379 1380 Undo_Start ("select func group"); 1381 Undo_AddBrushList (&selected_brushes); 1382 Undo_End(); 1383 1384 Select_Deselect(); 1385 1386 b = &group->brushes; 1387 1388 do 1389 { 1390 b = b->onext; 1391 Brush_RemoveFromList(b); 1392 Brush_AddToList(b, &selected_brushes); 1393 } while( b->onext != &group->brushes ); 1394 1395 Sys_UpdateWindows (W_ALL); 1396 } 1397 1398 1375 1399 void Select_Ungroup(void) 1376 1400 { GtkRadiant/branches/ZeroRadiant.ab/radiant/select.h
r184 r308 66 66 void Select_FitTexture(int nHeight = 1, int nWidth = 1); 67 67 68 void Select_SelectGroup(entity_t* group); 69 68 70 // absolute texture coordinates 69 71 // TTimo NOTE: this is stuff for old brushes format and rotation texture lock .. sort of in-between with bush primitives GtkRadiant/branches/ZeroRadiant.ab/tools/quake3/q3map2/bsp.c
r184 r308 45 45 46 46 47 /* 48 ProcessAdvertisements() 49 copies advertisement info into the BSP structures 50 */ 51 52 static void ProcessAdvertisements( void ) { 53 int i; 54 const char* className; 55 const char* modelKey; 56 int modelNum; 57 bspModel_t* adModel; 58 bspDrawSurface_t* adSurface; 59 60 Sys_FPrintf( SYS_VRB, "--- ProcessAdvertisements ---\n" ); 61 62 for( i = 0; i < numEntities; i++ ) { 63 64 /* is an advertisement? */ 65 className = ValueForKey( &entities[ i ], "classname" ); 66 67 if( !Q_stricmp( "advertisement", className ) ) { 68 69 modelKey = ValueForKey( &entities[ i ], "model" ); 70 71 if( strlen( modelKey ) > MAX_QPATH - 1 ) { 72 Error( "Model Key for entity exceeds ad struct string length." ); 73 } else { 74 if( numBSPAds < MAX_MAP_ADVERTISEMENTS ) { 75 bspAds[numBSPAds].cellId = IntForKey( &entities[ i ], "cellId" ); 76 strncpy( bspAds[numBSPAds].model, modelKey, sizeof( bspAds[numBSPAds].model ) ); 77 78 modelKey++; 79 modelNum = atoi( modelKey ); 80 adModel = &bspModels[modelNum]; 81 82 if( adModel->numBSPSurfaces != 1 ) { 83 Error( "Ad cell id %d has more than one surface.", bspAds[numBSPAds].cellId ); 84 } 85 86 adSurface = &bspDrawSurfaces[adModel->firstBSPSurface]; 87 88 // store the normal for use at run time.. all ad verts are assumed to 89 // have identical normals (because they should be a simple rectangle) 90 // so just use the first vert's normal 91 VectorCopy( bspDrawVerts[adSurface->firstVert].normal, bspAds[numBSPAds].normal ); 92 93 // store the ad quad for quick use at run time 94 if( adSurface->surfaceType == MST_PATCH ) { 95 int v0 = adSurface->firstVert + adSurface->patchHeight - 1; 96 int v1 = adSurface->firstVert + adSurface->numVerts - 1; 97 int v2 = adSurface->firstVert + adSurface->numVerts - adSurface->patchWidth; 98 int v3 = adSurface->firstVert; 99 VectorCopy( bspDrawVerts[v0].xyz, bspAds[numBSPAds].rect[0] ); 100 VectorCopy( bspDrawVerts[v1].xyz, bspAds[numBSPAds].rect[1] ); 101 VectorCopy( bspDrawVerts[v2].xyz, bspAds[numBSPAds].rect[2] ); 102 VectorCopy( bspDrawVerts[v3].xyz, bspAds[numBSPAds].rect[3] ); 103 } else { 104 Error( "Ad cell %d has an unsupported Ad Surface type.", bspAds[numBSPAds].cellId ); 105 } 106 107 numBSPAds++; 108 } else { 109 Error( "Maximum number of map advertisements exceeded." ); 110 } 111 } 112 } 113 } 114 115 Sys_FPrintf( SYS_VRB, "%9d in-game advertisements\n", numBSPAds ); 116 } 47 117 48 118 /* … … 841 911 SetLightStyles(); 842 912 913 /* process in game advertisements */ 914 ProcessAdvertisements(); 915 843 916 /* finish and write bsp */ 844 917 EndBSPFile(); GtkRadiant/branches/ZeroRadiant.ab/tools/quake3/q3map2/bspfile_abstract.c
r184 r308 239 239 bspFogs[ i ].brushNum = LittleLong( bspFogs[ i ].brushNum ); 240 240 bspFogs[ i ].visibleSide = LittleLong( bspFogs[ i ].visibleSide ); 241 } 242 243 /* advertisements */ 244 for( i = 0; i < numBSPAds; i++ ) 245 { 246 bspAds[ i ].cellId = LittleLong( bspAds[ i ].cellId ); 247 bspAds[ i ].normal[ 0 ] = LittleFloat( bspAds[ i ].normal[ 0 ] ); 248 bspAds[ i ].normal[ 1 ] = LittleFloat( bspAds[ i ].normal[ 1 ] ); 249 bspAds[ i ].normal[ 2 ] = LittleFloat( bspAds[ i ].normal[ 2 ] ); 250 251 for( j = 0; j < 4; j++ ) 252 { 253 bspAds[ i ].rect[j][ 0 ] = LittleFloat( bspAds[ i ].rect[j][ 0 ] ); 254 bspAds[ i ].rect[j][ 1 ] = LittleFloat( bspAds[ i ].rect[j][ 1 ] ); 255 bspAds[ i ].rect[j][ 2 ] = LittleFloat( bspAds[ i ].rect[j][ 2 ] ); 256 } 257 258 //bspAds[ i ].model[ MAX_QPATH ]; 241 259 } 242 260 } GtkRadiant/branches/ZeroRadiant.ab/tools/quake3/q3map2/bspfile_ibsp.c
r184 r308 64 64 #define LUMP_LIGHTGRID 15 65 65 #define LUMP_VISIBILITY 16 66 #define HEADER_LUMPS 17 66 #define LUMP_ADVERTISEMENTS 17 67 #define HEADER_LUMPS 18 67 68 68 69 … … 453 454 } 454 455 455 456 457 456 /* 458 457 LoadIBSPFile() … … 513 512 514 513 CopyLightGridLumps( header ); 515 514 515 /* advertisements */ 516 numBSPAds = CopyLump( (bspHeader_t*) header, LUMP_ADVERTISEMENTS, bspAds, sizeof( bspAdvertisement_t ) ); 517 516 518 /* free the file buffer */ 517 519 free( header ); … … 571 573 AddLump( file, (bspHeader_t*) header, LUMP_FOGS, bspFogs, numBSPFogs * sizeof( bspFog_t ) ); 572 574 AddLump( file, (bspHeader_t*) header, LUMP_DRAWINDEXES, bspDrawIndexes, numBSPDrawIndexes * sizeof( bspDrawIndexes[ 0 ] ) ); 573 575 576 /* advertisements */ 577 AddLump( file, (bspHeader_t*) header, LUMP_ADVERTISEMENTS, bspAds, numBSPAds * sizeof( bspAdvertisement_t ) ); 578 574 579 /* emit bsp size */ 575 580 size = ftell( file ); GtkRadiant/branches/ZeroRadiant.ab/tools/quake3/q3map2/game_quake3.h
r184 r308 108 108 "flareshader", /* default flare shader */ 109 109 "IBSP", /* bsp file prefix */ 110 4 6, /* bsp file version */110 47, /* bsp file version */ 111 111 LoadIBSPFile, /* bsp load function */ 112 112 WriteIBSPFile, /* bsp write function */ … … 172 172 { "dust", 0, 0, Q_SURF_DUST, 0, 0, 0 }, 173 173 174 175 174 /* null */ 176 175 { NULL, 0, 0, 0, 0, 0, 0 } GtkRadiant/branches/ZeroRadiant.ab/tools/quake3/q3map2/light.c
r184 r308 323 323 Error( "Invalid lightstyle (%d) on entity %d", light->style, i ); 324 324 325 if( light->style != LS_NORMAL ) { 326 Sys_FPrintf (SYS_WRN, "WARNING: Styled light found targeting %s\n **", target ); 327 } 328 325 329 /* set light intensity */ 326 330 intensity = FloatForKey( e, "_light" ); GtkRadiant/branches/ZeroRadiant.ab/tools/quake3/q3map2/mesh.c
r188 r308 382 382 mesh_t out; 383 383 384 static bspDrawVert_t expand[MAX_EXPANDED_AXIS][MAX_EXPANDED_AXIS]; 384 /* ydnar: static for os x */ 385 MAC_STATIC bspDrawVert_t expand[MAX_EXPANDED_AXIS][MAX_EXPANDED_AXIS]; 385 386 386 387 … … 548 549 mesh_t out; 549 550 550 static bspDrawVert_t expand[ MAX_EXPANDED_AXIS ][ MAX_EXPANDED_AXIS ]; 551 /* ydnar: static for os x */ 552 MAC_STATIC bspDrawVert_t expand[ MAX_EXPANDED_AXIS ][ MAX_EXPANDED_AXIS ]; 551 553 552 554 … … 653 655 mesh_t out; 654 656 655 static bspDrawVert_t expand[MAX_EXPANDED_AXIS][MAX_EXPANDED_AXIS]; 657 /* ydnar: static for os x */ 658 MAC_STATIC bspDrawVert_t expand[MAX_EXPANDED_AXIS][MAX_EXPANDED_AXIS]; 656 659 657 660 … … 729 732 float length, maxLength, amount; 730 733 mesh_t out; 731 732 static bspDrawVert_t expand[MAX_EXPANDED_AXIS][MAX_EXPANDED_AXIS]; 734 bspDrawVert_t expand[MAX_EXPANDED_AXIS][MAX_EXPANDED_AXIS]; 733 735 734 736 out.width = in->width; GtkRadiant/branches/ZeroRadiant.ab/tools/quake3/q3map2/q3map2.h
r184 r308 169 169 #define C_SKIP 0x00008000 /* like hint, but skips this face (doesn't split bsp) */ 170 170 #define C_NOMARKS 0x00010000 /* no decals */ 171 172 171 #define C_DETAIL 0x08000000 /* THIS MUST BE THE SAME AS IN RADIANT! */ 173 172 … … 322 321 #define MAX_MAP_DRAW_INDEXES 0x80000 323 322 323 #define MAX_MAP_ADVERTISEMENTS 30 324 324 325 325 /* key / value pair sizes in the entities lump */ … … 500 500 bspDrawSurface_t; 501 501 502 503 /* advertisements */ 504 typedef struct { 505 int cellId; 506 vec3_t normal; 507 vec3_t rect[4]; 508 char model[ MAX_QPATH ]; 509 } bspAdvertisement_t; 502 510 503 511 … … 2271 2279 Q_EXTERN bspFog_t bspFogs[ MAX_MAP_FOGS ]; 2272 2280 2281 Q_EXTERN int numBSPAds Q_ASSIGN( 0 ); 2282 Q_EXTERN bspAdvertisement_t bspAds[ MAX_MAP_ADVERTISEMENTS ]; 2273 2283 2274 2284 GtkRadiant/branches/ZeroRadiant.ab/tools/quake3/q3map2/q3map2.vcproj
r177 r308 64 64 AdditionalLibraryDirectories=""$(SolutionDir)\..\libxml2\lib";"$(SolutionDir)\..\gtk2\lib";"$(SolutionDir)\build\$(ConfigurationName)\libs"" 65 65 GenerateDebugInformation="true" 66 StackReserveSize="2097152" 67 StackCommitSize="2097152" 66 68 TargetMachine="1" 67 69 /> … … 89 91 <Tool 90 92 Name="VCPostBuildEventTool" 93 CommandLine="copy "$(TargetPath)" C:\alienbrainWork\QuakeZero\radiant\$(TargetFileName)" 91 94 /> 92 95 </Configuration> … … 138 141 AdditionalLibraryDirectories=""$(SolutionDir)\..\libxml2\lib";"$(SolutionDir)\..\gtk2\lib";"$(SolutionDir)\build\$(ConfigurationName)\libs"" 139 142 GenerateDebugInformation="true" 143 StackReserveSize="2097152" 144 StackCommitSize="2097152" 140 145 OptimizeReferences="2" 141 146 EnableCOMDATFolding="2" … … 165 170 <Tool 166 171 Name="VCPostBuildEventTool" 172 CommandLine="copy "$(TargetPath)" C:\alienbrainWork\QuakeZero\radiant\$(TargetFileName)" 167 173 /> 168 174 </Configuration> GtkRadiant/branches/ZeroRadiant.ab/tools/quake3/q3map2/shaders.c
r184 r308 339 339 /* print it to the file */ 340 340 fprintf( file, "%s%s\n", si->shader, si->shaderText ); 341 // %Sys_Printf( "%s%s\n", si->shader, si->shaderText ); /* FIXME: remove debugging code */341 //Sys_Printf( "%s%s\n", si->shader, si->shaderText ); /* FIXME: remove debugging code */ 342 342 343 343 Sys_FPrintf( SYS_VRB, "." ); … … 345 345 346 346 /* close the shader */ 347 fflush( file ); 347 348 fclose( file ); 348 349 GtkRadiant/branches/ZeroRadiant.ab/tools/quake3/q3map2/writebsp.c
r184 r308 400 400 char path[ 1024 ]; 401 401 402 403 Sys_FPrintf( SYS_VRB, "--- EndBSPFile ---\n" ); 402 404 403 405 EmitPlanes();
