Show
Ignore:
Timestamp:
08/23/08 22:20:51 (3 months ago)
Author:
timo
Message:

ABToSVK commit

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • GtkRadiant/branches/ZeroRadiant.ab/radiant/mainframe.cpp

    r186 r308  
    125125  {"CSGSubtract", 'U', 0x01, ID_SELECTION_CSGSUBTRACT, "menu_selection_csgsubstract"}, 
    126126  //  {"ViewGroups", 'G', 0x00, ID_VIEW_GROUPS, "menu_view_groups"}, (temporary disabled) 
     127  {"SelectFuncGroup", 'G', 0x00, ID_SELECT_FUNC_GROUP, "menu_select_func_group"}, 
    127128  {"HideSelected", 'H', 0x00, ID_VIEW_HIDESHOW_HIDESELECTED, "menu_view_hideshow_hideselected"}, 
    128129  {"ShowHidden", 'H', 0x01, ID_VIEW_HIDESHOW_SHOWHIDDEN, "menu_view_hideshow_showhidden"}, 
     
    427428    case ID_VIEW_ENTITY: g_pParentWnd->OnViewEntity (); break; 
    428429    case ID_VIEW_GROUPS: g_pParentWnd->OnViewGroups (); break; 
     430        case ID_SELECT_FUNC_GROUP: g_pParentWnd->OnSelectFuncGroup(); break; 
    429431    case ID_TOGGLEVIEW: g_pParentWnd->OnToggleview (); break; 
    430432    case ID_TOGGLEVIEW_YZ: g_pParentWnd->OnToggleviewYz (); break; 
     
    12031205  create_menu_item_with_mnemonic (menu_in_menu, "Select _Inside", 
    12041206                    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); 
    12051208#ifndef QUAKE3 
    12061209  create_menu_item_with_mnemonic (menu_in_menu, "Nudge Left", 
     
    70607063} 
    70617064 
     7065void 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 
    70627082void MainFrame::OnCameraForward(bool keydown)  
    70637083{ 
  • GtkRadiant/branches/ZeroRadiant.ab/radiant/mainframe.h

    r184 r308  
    408408#define ID_COLORS_MAJOR_ALT             40231 
    409409 
     410#define ID_SELECT_FUNC_GROUP                    40233 
     411 
    410412// those must have their own ID chunk ID_GRID_025 <= ID_GRID <= ID_GRID_256 
    411413#define ID_GRID_025                     40300 
     
    892894  void OnFilterClusterportals(); 
    893895  void OnFilterLightgrid(); 
     896  void OnSelectFuncGroup(); 
    894897 
    895898private: 
  • GtkRadiant/branches/ZeroRadiant.ab/radiant/select.cpp

    r186 r308  
    13731373} 
    13741374 
     1375void 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 
    13751399void Select_Ungroup(void) 
    13761400{ 
  • GtkRadiant/branches/ZeroRadiant.ab/radiant/select.h

    r184 r308  
    6666void Select_FitTexture(int nHeight = 1, int nWidth = 1); 
    6767 
     68void Select_SelectGroup(entity_t* group); 
     69 
    6870// absolute texture coordinates 
    6971// 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  
    4545 
    4646 
     47/* 
     48ProcessAdvertisements() 
     49copies advertisement info into the BSP structures 
     50*/ 
     51 
     52static 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} 
    47117 
    48118/* 
     
    841911        SetLightStyles(); 
    842912         
     913        /* process in game advertisements */ 
     914        ProcessAdvertisements(); 
     915 
    843916        /* finish and write bsp */ 
    844917        EndBSPFile(); 
  • GtkRadiant/branches/ZeroRadiant.ab/tools/quake3/q3map2/bspfile_abstract.c

    r184 r308  
    239239                bspFogs[ i ].brushNum = LittleLong( bspFogs[ i ].brushNum ); 
    240240                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 ]; 
    241259        } 
    242260} 
  • GtkRadiant/branches/ZeroRadiant.ab/tools/quake3/q3map2/bspfile_ibsp.c

    r184 r308  
    6464#define LUMP_LIGHTGRID          15 
    6565#define LUMP_VISIBILITY         16 
    66 #define HEADER_LUMPS            17 
     66#define LUMP_ADVERTISEMENTS 17 
     67#define HEADER_LUMPS            18 
    6768 
    6869 
     
    453454} 
    454455 
    455  
    456  
    457456/* 
    458457LoadIBSPFile() 
     
    513512         
    514513        CopyLightGridLumps( header ); 
    515          
     514 
     515        /* advertisements */ 
     516        numBSPAds = CopyLump( (bspHeader_t*) header, LUMP_ADVERTISEMENTS, bspAds, sizeof( bspAdvertisement_t ) ); 
     517 
    516518        /* free the file buffer */ 
    517519        free( header ); 
     
    571573        AddLump( file, (bspHeader_t*) header, LUMP_FOGS, bspFogs, numBSPFogs * sizeof( bspFog_t ) ); 
    572574        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 
    574579        /* emit bsp size */ 
    575580        size = ftell( file ); 
  • GtkRadiant/branches/ZeroRadiant.ab/tools/quake3/q3map2/game_quake3.h

    r184 r308  
    108108        "flareshader",          /* default flare shader */ 
    109109        "IBSP",                         /* bsp file prefix */ 
    110         46,                                   /* bsp file version */ 
     110        47,                                   /* bsp file version */ 
    111111        LoadIBSPFile,           /* bsp load function */ 
    112112        WriteIBSPFile,          /* bsp write function */ 
     
    172172                { "dust",                       0,                                                      0,                                                      Q_SURF_DUST,                            0,                                                      0,                                                      0 }, 
    173173                 
    174                  
    175174                /* null */ 
    176175                { NULL, 0, 0, 0, 0, 0, 0 } 
  • GtkRadiant/branches/ZeroRadiant.ab/tools/quake3/q3map2/light.c

    r184 r308  
    323323                        Error( "Invalid lightstyle (%d) on entity %d", light->style, i ); 
    324324                 
     325                if( light->style != LS_NORMAL ) { 
     326                        Sys_FPrintf (SYS_WRN, "WARNING: Styled light found targeting %s\n **", target ); 
     327                } 
     328 
    325329                /* set light intensity */ 
    326330                intensity = FloatForKey( e, "_light" ); 
  • GtkRadiant/branches/ZeroRadiant.ab/tools/quake3/q3map2/mesh.c

    r188 r308  
    382382        mesh_t                                          out; 
    383383         
    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]; 
    385386         
    386387         
     
    548549        mesh_t                                          out; 
    549550         
    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 ]; 
    551553         
    552554         
     
    653655        mesh_t                                          out; 
    654656         
    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]; 
    656659         
    657660 
     
    729732        float                   length, maxLength, amount; 
    730733        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]; 
    733735 
    734736        out.width = in->width; 
  • GtkRadiant/branches/ZeroRadiant.ab/tools/quake3/q3map2/q3map2.h

    r184 r308  
    169169#define C_SKIP                                  0x00008000      /* like hint, but skips this face (doesn't split bsp) */ 
    170170#define C_NOMARKS                               0x00010000      /* no decals */ 
    171  
    172171#define C_DETAIL                                0x08000000      /* THIS MUST BE THE SAME AS IN RADIANT! */ 
    173172 
     
    322321#define MAX_MAP_DRAW_INDEXES    0x80000 
    323322 
     323#define MAX_MAP_ADVERTISEMENTS  30 
    324324 
    325325/* key / value pair sizes in the entities lump */ 
     
    500500bspDrawSurface_t; 
    501501 
     502 
     503/* advertisements */ 
     504typedef struct { 
     505        int                     cellId; 
     506        vec3_t          normal; 
     507        vec3_t          rect[4]; 
     508        char            model[ MAX_QPATH ]; 
     509} bspAdvertisement_t; 
    502510 
    503511 
     
    22712279Q_EXTERN bspFog_t                       bspFogs[ MAX_MAP_FOGS ]; 
    22722280 
     2281Q_EXTERN int                            numBSPAds Q_ASSIGN( 0 ); 
     2282Q_EXTERN bspAdvertisement_t     bspAds[ MAX_MAP_ADVERTISEMENTS ]; 
    22732283 
    22742284 
  • GtkRadiant/branches/ZeroRadiant.ab/tools/quake3/q3map2/q3map2.vcproj

    r177 r308  
    6464                                AdditionalLibraryDirectories="&quot;$(SolutionDir)\..\libxml2\lib&quot;;&quot;$(SolutionDir)\..\gtk2\lib&quot;;&quot;$(SolutionDir)\build\$(ConfigurationName)\libs&quot;" 
    6565                                GenerateDebugInformation="true" 
     66                                StackReserveSize="2097152" 
     67                                StackCommitSize="2097152" 
    6668                                TargetMachine="1" 
    6769                        /> 
     
    8991                        <Tool 
    9092                                Name="VCPostBuildEventTool" 
     93                                CommandLine="copy &quot;$(TargetPath)&quot; C:\alienbrainWork\QuakeZero\radiant\$(TargetFileName)" 
    9194                        /> 
    9295                </Configuration> 
     
    138141                                AdditionalLibraryDirectories="&quot;$(SolutionDir)\..\libxml2\lib&quot;;&quot;$(SolutionDir)\..\gtk2\lib&quot;;&quot;$(SolutionDir)\build\$(ConfigurationName)\libs&quot;" 
    139142                                GenerateDebugInformation="true" 
     143                                StackReserveSize="2097152" 
     144                                StackCommitSize="2097152" 
    140145                                OptimizeReferences="2" 
    141146                                EnableCOMDATFolding="2" 
     
    165170                        <Tool 
    166171                                Name="VCPostBuildEventTool" 
     172                                CommandLine="copy &quot;$(TargetPath)&quot; C:\alienbrainWork\QuakeZero\radiant\$(TargetFileName)" 
    167173                        /> 
    168174                </Configuration> 
  • GtkRadiant/branches/ZeroRadiant.ab/tools/quake3/q3map2/shaders.c

    r184 r308  
    339339                /* print it to the file */ 
    340340                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 */ 
    342342                 
    343343                Sys_FPrintf( SYS_VRB, "." ); 
     
    345345         
    346346        /* close the shader */ 
     347        fflush( file ); 
    347348        fclose( file ); 
    348349         
  • GtkRadiant/branches/ZeroRadiant.ab/tools/quake3/q3map2/writebsp.c

    r184 r308  
    400400        char    path[ 1024 ]; 
    401401         
     402 
     403        Sys_FPrintf( SYS_VRB, "--- EndBSPFile ---\n" ); 
    402404 
    403405        EmitPlanes();