Changeset 297
- Timestamp:
- 07/05/08 05:21:36 (5 months ago)
- Files:
-
- GtkRadiant/trunk/radiant/groupdialog.cpp (modified) (1 diff)
- GtkRadiant/trunk/radiant/preferences.cpp (modified) (5 diffs)
- GtkRadiant/trunk/radiant/preferences.h (modified) (1 diff)
- GtkRadiant/trunk/radiant/surfaceplugin.cpp (modified) (7 diffs)
- GtkRadiant/trunk/radiant/watchbsp.cpp (modified) (12 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
GtkRadiant/trunk/radiant/groupdialog.cpp
r296 r297 1341 1341 } 1342 1342 1343 if (g_pGameDescription->quake2 || ( g_pGameDescription->mGameFile == "q2.game" ) || ( g_pGameDescription->mGameFile == "heretic2.game" )) {1343 if (g_pGameDescription->quake2) { 1344 1344 GtkWidget *check = gtk_check_button_new_with_label (_("!Easy")); 1345 1345 gtk_widget_show (check); GtkRadiant/trunk/radiant/preferences.cpp
r296 r297 695 695 */ 696 696 697 #if defined(WIN32) 698 #define ENGINE_ATTRIBUTE "engine_win32" 699 #define MP_ENGINE_ATTRIBUTE "mp_engine_win32" 700 #elif defined(__linux__) || defined (__FreeBSD__) 701 #define ENGINE_ATTRIBUTE "engine_linux" 702 #define MP_ENGINE_ATTRIBUTE "mp_engine_linux" 703 #elif defined(__APPLE__) 704 #define ENGINE_ATTRIBUTE "engine_macos" 705 #define MP_ENGINE_ATTRIBUTE "mp_engine_macos" 706 #else 707 #error "unsupported platform" 708 #endif 709 710 711 #if defined(WIN32) 712 #define ENGINEPATH_ATTRIBUTE "enginepath_win32" 713 #elif defined(__linux__) || defined (__FreeBSD__) 714 #define ENGINEPATH_ATTRIBUTE "enginepath_linux" 715 #elif defined(__APPLE__) 716 #define ENGINEPATH_ATTRIBUTE "enginepath_macos" 717 #else 718 #error "unknown platform" 719 #endif 720 721 697 722 CGameDescription::CGameDescription(xmlDocPtr pDoc, const Str &GameFile) 698 723 { … … 711 736 prop = (char*)xmlGetProp( pNode, (xmlChar*)"gametools" ); 712 737 if ( prop == NULL ) { 713 Error( "Didn't find 'gametools' node in the game description file '%s'\n", pDoc->URL );738 Error( "Didn't find 'gametools' node in the game description file '%s'\n", pDoc->URL ); 714 739 } 715 740 { … … 785 810 } 786 811 787 // on win32, engine path can now be specified relative to the exe's cwd 788 prop = (char*)xmlGetProp(pNode, (const xmlChar *)"enginepath");789 if ( prop != NULL ) { 790 char full[PATH_MAX]; 812 813 prop = (char*)xmlGetProp(pNode, (const xmlChar*)ENGINE_ATTRIBUTE); 814 if (prop == NULL) 815 { 791 816 #ifdef _WIN32 792 _fullpath( full, prop, PATH_MAX ); 793 #else 794 strncpy( full, prop, PATH_MAX ); 817 mEngine = "quake3.exe"; 818 #elif __linux__ 819 mEngine = "quake3"; 820 #elif __APPLE__ 821 mEngine = "Quake3.app"; 795 822 #endif 796 xmlFree( prop );797 prop = NULL;798 // process seperators799 for ( p = full; *p != '\0'; p++ ) {800 if ( *p == '\\' ) {801 *p = '/';802 }803 823 } 804 mEnginePath = full; 805 if ( p != full && *(p-1) != '/' ) { 806 mEnginePath += "/"; 824 else 825 { 826 mEngine = prop; 827 xmlFree(prop); 807 828 } 808 } 809 else 810 { 811 // if engine path was not specified in the .game, it implies we can guess it from the gametools path 812 // on win32, and for most game package, the gametools are installed with the game 813 char aux_path[PATH_MAX]; // aux 814 strcpy( aux_path, mGameToolsPath.GetBuffer() ); 815 if ( ( aux_path[ strlen(aux_path)-1 ] == '/' ) || ( aux_path[ strlen(aux_path)-1 ] == '\\' ) ) { 816 aux_path[strlen(aux_path)-1] = '\0'; // strip ending '/' if any 829 830 prop = (char*)xmlGetProp(pNode, (const xmlChar*)MP_ENGINE_ATTRIBUTE); 831 if (prop == NULL) 832 { 833 #ifdef _WIN32 834 mMultiplayerEngine = "quake3.exe"; 835 #elif __linux__ 836 mMultiplayerEngine = "quake3"; 837 #elif __APPLE__ 838 mMultiplayerEngine = "Quake3.app"; 839 #endif 817 840 } 818 char up_path[PATH_MAX]; // up one level 819 ExtractFilePath( aux_path, up_path ); 820 mEnginePath = up_path; 821 } 822 823 prop = (char*)xmlGetProp(pNode, (xmlChar*)"engine"); 824 if (prop == NULL) 825 { 826 #ifdef _WIN32 827 mEngine = "quake3.exe"; 828 #elif __linux__ 829 mEngine = "quake3"; 830 #elif __APPLE__ 831 mEngine = "Quake3.app"; 832 #endif 833 } 834 else 835 { 836 mEngine = prop; 837 xmlFree(prop); 838 } 841 else 842 { 843 mMultiplayerEngine = prop; 844 xmlFree(prop); 845 } 846 847 { 848 // on win32, engine path can now be specified relative to the exe's cwd 849 prop = (char*)xmlGetProp(pNode, (const xmlChar *)ENGINEPATH_ATTRIBUTE); 850 if ( prop != NULL ) { 851 char full[PATH_MAX]; 852 #ifdef _WIN32 853 _fullpath( full, prop, PATH_MAX ); 854 #else 855 strncpy( full, prop, PATH_MAX ); 856 #endif 857 xmlFree( prop ); 858 prop = NULL; 859 // process seperators 860 for ( p = full; *p != '\0'; p++ ) { 861 if ( *p == '\\' ) { 862 *p = '/'; 863 } 864 } 865 mEnginePath = full; 866 if ( p != full && *(p-1) != '/' ) { 867 mEnginePath += "/"; 868 } 869 } 870 else 871 { 872 // if engine path was not specified in the .game, it implies we can guess it from the gametools path 873 // on win32, and for most game package, the gametools are installed with the game 874 char aux_path[PATH_MAX]; // aux 875 strcpy( aux_path, mGameToolsPath.GetBuffer() ); 876 if ( ( aux_path[ strlen(aux_path)-1 ] == '/' ) || ( aux_path[ strlen(aux_path)-1 ] == '\\' ) ) { 877 aux_path[strlen(aux_path)-1] = '\0'; // strip ending '/' if any 878 } 879 char up_path[PATH_MAX]; // up one level 880 ExtractFilePath( aux_path, up_path ); 881 mEnginePath = up_path; 882 } 883 } 839 884 840 885 #if defined (__linux__) || defined (__APPLE__) … … 2885 2930 mLocalPrefs.GetPref(TEXTURE_KEY, &m_bTextureWindow, TRUE); 2886 2931 } 2887 else if (g_pGameDescription->quake2 || ( g_pGameDescription->mGameFile == "q2.game" ) || ( g_pGameDescription->mGameFile == "heretic2.game" ))2932 else if (g_pGameDescription->quake2) 2888 2933 { 2889 2934 // BSP monitoring is implemented in Quake2 and Heretic2 tools … … 3328 3373 fprintf( fg, "<?xml version=\"1.0\" encoding=\"iso-8859-1\" standalone=\"yes\"?>\n<game\n" ); 3329 3374 fprintf( fg, " name=\"%s\"\n", m_strName.GetBuffer() ); 3330 fprintf( fg, " enginepath=\"%s\"\n", m_strEngine.GetBuffer() );3375 fprintf( fg, " "ENGINEPATH_ATTRIBUTE"=\"%s\"\n", m_strEngine.GetBuffer() ); 3331 3376 switch ( m_availGames[ m_nComboSelect ] ) { 3332 3377 case GAME_Q2: { GtkRadiant/trunk/radiant/preferences.h
r288 r297 172 172 Str mEnginePath; ///< path to the engine 173 173 Str mEngine; ///< engine name 174 Str mMultiplayerEngine; ///< engine name 174 175 #if defined (__linux__) || defined (__APPLE__) 175 176 Str mUserPathPrefix; ///< prefix for ~/.q3a ~/.wolf init, only on *nix GtkRadiant/trunk/radiant/surfaceplugin.cpp
r203 r297 169 169 bool b_isQuake2; 170 170 171 if ( ( g_pGameDescription->quake2 ) || ( g_pGameDescription->mGameFile == "q2.game" ) || ( g_pGameDescription->mGameFile == "heretic2.game" ))171 if (g_pGameDescription->quake2) 172 172 b_isQuake2 = true; 173 173 else … … 176 176 if (!texdef_face_list) 177 177 return; 178 178 179 179 if (b_SetUndoPoint) 180 180 { … … 191 191 192 192 Undo_Start("set facelist texdefs"); 193 193 194 194 if( selected_brushes.next != &selected_brushes ) 195 Undo_AddBrushList(&selected_brushes); 195 Undo_AddBrushList(&selected_brushes); 196 196 else 197 197 Undo_AddBrush(texdef_face_list->brush); 198 199 } 200 } 201 198 199 } 200 } 201 202 202 for(texdef_to_face = texdef_face_list; texdef_to_face; texdef_to_face = texdef_to_face->next) 203 203 { … … 206 206 else 207 207 SetFaceTexdef(texdef_to_face->face, &texdef_to_face->texdef, NULL , bFit_to_Scale); 208 Brush_Build(texdef_to_face->brush); 208 Brush_Build(texdef_to_face->brush); 209 209 if(bFit_to_Scale) 210 210 texdef_to_face->texdef = texdef_to_face->face->texdef; 211 211 } 212 212 213 213 if ( b_SetUndoPoint ) 214 214 { … … 216 216 { 217 217 if(selected_brushes.next != &selected_brushes) 218 Undo_EndBrushList(&selected_brushes); 218 Undo_EndBrushList(&selected_brushes); 219 219 else 220 220 Undo_EndBrush(texdef_face_list->brush); 221 221 222 222 Undo_End(); 223 223 // Over-write the orig_texdef list, cementing the change. … … 226 226 } 227 227 } 228 228 229 229 Sys_UpdateWindows (W_ALL); 230 230 } … … 240 240 { 241 241 Face_FitTexture(temp_texdef_face_list->face, nHeight, nWidth); 242 Brush_Build(temp_texdef_face_list->brush,true,true,false,false); 242 Brush_Build(temp_texdef_face_list->brush,true,true,false,false); 243 243 // Write changes to our working Texdef list 244 244 temp_texdef_face_list->texdef = temp_texdef_face_list->face->texdef; GtkRadiant/trunk/radiant/watchbsp.cpp
r250 r297 3 3 All rights reserved. 4 4 5 Redistribution and use in source and binary forms, with or without modification, 5 Redistribution and use in source and binary forms, with or without modification, 6 6 are permitted provided that the following conditions are met: 7 7 8 Redistributions of source code must retain the above copyright notice, this list 8 Redistributions of source code must retain the above copyright notice, this list 9 9 of conditions and the following disclaimer. 10 10 … … 13 13 other materials provided with the distribution. 14 14 15 Neither the name of Loki software nor the names of its contributors may be used 16 to endorse or promote products derived from this software without specific prior 17 written permission. 18 19 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' 20 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 22 DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY 23 DIRECT,INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 24 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 25 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 26 ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 28 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 15 Neither the name of Loki software nor the names of its contributors may be used 16 to endorse or promote products derived from this software without specific prior 17 written permission. 18 19 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' 20 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 22 DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY 23 DIRECT,INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 24 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 25 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 26 ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 28 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 29 */ 30 30 … … 69 69 #include "stream_version.h" 70 70 71 static void saxStartElement(message_info_t *data, const xmlChar *name, const xmlChar **attrs) 71 static void saxStartElement(message_info_t *data, const xmlChar *name, const xmlChar **attrs) 72 72 { 73 73 if (data->ignore_depth == 0) … … 94 94 else if (strcmp((char*)attrs[1],Q3MAP_STREAM_VERSION) != 0) 95 95 { 96 Sys_FPrintf(SYS_ERR, 96 Sys_FPrintf(SYS_ERR, 97 97 "This version of Radiant reads version %s debug streams, I got an incoming connection with version %s\n" 98 98 "Please make sure your versions of Radiant and q3map are matching.\n", Q3MAP_STREAM_VERSION, (char*)attrs[1]); … … 106 106 data->msg_level = atoi ((char *)attrs[1]); 107 107 } 108 else if (strcmp ((char *)name, "polyline") == 0) 108 else if (strcmp ((char *)name, "polyline") == 0) 109 109 // polyline has a particular status .. right now we only use it for leakfile .. 110 110 { … … 206 206 char saxMsgBuffer[4096]; 207 207 va_list args; 208 208 209 209 va_start(args, msg); 210 210 vsprintf (saxMsgBuffer, msg, args); … … 217 217 char saxMsgBuffer[4096]; 218 218 va_list args; 219 219 220 220 va_start(args, msg); 221 221 vsprintf (saxMsgBuffer, msg, args); … … 227 227 { 228 228 char buffer[4096]; 229 229 230 230 va_list args; 231 231 232 232 va_start(args, msg); 233 233 vsprintf (buffer, msg, args); … … 391 391 Sys_Printf("Connected.\n"); 392 392 // prepare the message info struct for diving in 393 memset (&m_message_info, 0, sizeof(message_info_s)); 393 memset (&m_message_info, 0, sizeof(message_info_s)); 394 394 // a dumb flag to make sure we init the push parser context when first getting a msg 395 395 m_bNeedCtxtInit = true; … … 504 504 cmd = g_pGameDescription->mEnginePath.GetBuffer(); 505 505 // this is game dependant 506 //!\todo Read the engine binary name from a config file. 507 if (g_pGameDescription->mGameFile == "wolf.game") 506 if (!strcmp(ValueForKey(g_qeglobals.d_project_entity, "gamemode"),"mp")) 508 507 { 509 if (!strcmp(ValueForKey(g_qeglobals.d_project_entity, "gamemode"),"mp")) 510 { 511 // MP 512 #if defined(WIN32) 513 cmd += "WolfMP.exe"; 514 #elif defined(__linux__) 515 cmd += "wolfmp"; 516 #elif defined(__APPLE__) 517 cmd += "wolfmp.app"; 518 #else 519 #error "WTF are you compiling on" 520 #endif 521 } 522 else 523 { 524 // SP 525 #if defined(WIN32) 526 cmd += "WolfSP.exe"; 527 #elif defined(__linux__) 528 cmd += "wolfsp"; 529 #elif defined(__APPLE__) 530 cmd += "wolfsp.app"; 531 #else 532 #error "WTF are you compiling on" 533 #endif 534 } 535 } else if (g_pGameDescription->mGameFile == "et.game") 536 { 537 #if defined(WIN32) 538 cmd += "et.exe"; 539 #elif defined(__linux__) 540 cmd += "et"; 541 #elif defined(__APPLE__) 542 cmd += "et.app"; 543 #else 544 #error "WTF are you compiling on" 545 #endif 546 } 547 // RIANT 548 // JK2 HACK 549 else if (g_pGameDescription->mGameFile == "jk2.game") 550 { 551 if (!strcmp(ValueForKey(g_qeglobals.d_project_entity, "gamemode"),"mp")) 552 { 553 // MP 554 #if defined(WIN32) 555 cmd += "jk2MP.exe"; 556 #elif defined(__linux__) 557 cmd += "jk2mp"; 558 #elif defined(__APPLE__) 559 cmd += "jk2mp.app"; 560 #else 561 #error "WTF are you compiling on" 562 #endif 563 } 564 else 565 { 566 // SP 567 #if defined(WIN32) 568 cmd += "jk2SP.exe"; 569 #elif defined(__linux__) 570 cmd += "jk2sp"; 571 #elif defined(__APPLE__) 572 cmd += "jk2sp.app"; 573 #else 574 #error "WTF are you compiling on" 575 #endif 576 } 577 } 578 // TTimo 579 // JA HACK 580 else if (g_pGameDescription->mGameFile == "ja.game") 581 { 582 if (!strcmp(ValueForKey(g_qeglobals.d_project_entity, "gamemode"),"mp")) 583 { 584 // MP 585 #if defined(WIN32) 586 cmd += "jamp.exe"; 587 #elif !defined(__linux__) && !defined(__APPLE__) 588 #error "WTF are you compiling on" 589 #endif 590 } 591 else 592 { 593 // SP 594 #if defined(WIN32) 595 cmd += "jasp.exe"; 596 #elif !defined(__linux__) && !defined(__APPLE__) 597 #error "WTF are you compiling on" 598 #endif 599 } 600 } 601 // RIANT 602 // STVEF HACK 603 else if (g_pGameDescription->mGameFile == "stvef.game") 604 { 605 if (!strcmp(ValueForKey(g_qeglobals.d_project_entity, "gamemode"),"mp")) 606 { 607 // MP 608 #if defined(WIN32) 609 cmd += "stvoyHM.exe"; 610 #elif defined(__linux__) 611 cmd += "stvoyHM"; 612 #elif defined(__APPLE__) 613 cmd += "stvoyHM.app"; 614 #else 615 #error "WTF are you compiling on" 616 #endif 617 } 618 else 619 { 620 // SP 621 #if defined(WIN32) 622 cmd += "stvoy.exe"; 623 #elif defined(__linux__) 624 cmd += "stvoy"; 625 #elif defined(__APPLE__) 626 cmd += "stvoy.app"; 627 #else 628 #error "WTF are you compiling on" 629 #endif 630 } 631 } 632 // RIANT 633 // SOF2 HACK 634 else if (g_pGameDescription->mGameFile == "sof2.game") 635 { 636 if (!strcmp(ValueForKey(g_qeglobals.d_project_entity, "gamemode"),"mp")) 637 { 638 // MP 639 #if defined(WIN32) 640 cmd += "sof2MP.exe"; 641 #elif defined(__linux__) 642 cmd += "b00gus"; 643 #elif defined(__APPLE__) 644 cmd += "sof2MP.app"; 645 #else 646 #error "WTF are you compiling on" 647 #endif 648 } 649 else 650 { 651 // SP 652 #if defined(WIN32) 653 cmd += "sof2.exe"; 654 #elif defined(__linux__) 655 cmd += "b00gus"; 656 #elif defined(__APPLE__) 657 cmd += "sof2.app"; 658 #else 659 #error "WTF are you compiling on" 660 #endif 661 } 508 // MP 509 cmd += g_pGameDescription->mMultiplayerEngine.GetBuffer(); 662 510 } 663 511 else 664 512 { 513 // SP 665 514 cmd += g_pGameDescription->mEngine.GetBuffer(); 666 515 } 667 516 #ifdef _WIN32 668 517 // NOTE: we are using unix pathnames and CreateProcess doesn't like / in the program path 518 // FIXME: This isn't true anymore, doesn't it? 669 519 FindReplace( cmd, "/", "\\" ); 670 520 #endif 671 521 Str cmdline; 672 if ( (g_pGameDescription->mGameFile == "q2.game") || (g_pGameDescription->mGameFile == "heretic2.game"))522 if ( g_pGameDescription->quake2 ) 673 523 { 674 524 cmdline = ". +exec radiant.cfg +map "; … … 697 547 else 698 548 { 699 // SP 549 // SP 700 550 cmdline += "+set nextmap \"spdevmap "; 701 551 cmdline += m_sBSPName; … … 743 593 Sys_Printf("WatchBSP got a monitoring request while not idling...\n"); 744 594 // prompt the user, should we cancel the current process and go ahead? 745 if (gtk_MessageBox(g_pParentWnd->m_pWidget, "I am already monitoring a BSP process.\nDo you want me to override and start a new compilation?", 595 if (gtk_MessageBox(g_pParentWnd->m_pWidget, "I am already monitoring a BSP process.\nDo you want me to override and start a new compilation?", 746 596 "BSP process monitoring", MB_YESNO ) == IDYES) 747 597 {
