Changeset 189
- Timestamp:
- 06/14/07 19:11:37 (1 year ago)
- Files:
-
- trunk/src/config.h (modified) (4 diffs)
- trunk/src/defines.h (modified) (1 diff)
- trunk/src/dungeon.c (modified) (1 diff)
- trunk/src/externs.h (modified) (1 diff)
- trunk/src/files.c (modified) (6 diffs)
- trunk/src/init1.c (modified) (1 diff)
- trunk/src/load.c (modified) (2 diffs)
- trunk/src/main-win.c (modified) (16 diffs)
- trunk/src/main-x11.c (modified) (1 diff)
- trunk/src/main.c (modified) (1 diff)
- trunk/src/melee2.c (modified) (4 diffs)
- trunk/src/randart.c (modified) (2 diffs)
- trunk/src/squelch.c (modified) (1 diff)
- trunk/src/wizard1.c (modified) (1 diff)
- trunk/src/wizard2.c (modified) (1 diff)
- trunk/src/xtra2.c (modified) (2 diffs)
- trunk/src/z-file.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/config.h
r182 r189 97 97 98 98 /* 99 * OPTION: Allow monsters to "flee" when hit hard100 */101 #define ALLOW_FEAR102 103 /*104 * OPTION: Allow monsters to "flee" from strong players105 */106 #define ALLOW_TERROR107 108 109 /*110 99 * OPTION: Allow parsing of the ascii template files in "init.c". 111 100 * This must be defined if you do not have valid binary image files. … … 148 137 149 138 /* 150 * OPTION: Allow "Wizards" to yield "high scores"151 */152 /* #define SCORE_WIZARDS */153 154 /*155 139 * OPTION: Allow "Borgs" to yield "high scores" 156 140 */ 157 141 /* #define SCORE_BORGS */ 158 159 /*160 * OPTION: Allow "Cheaters" to yield "high scores"161 */162 /* #define SCORE_CHEATERS */163 142 164 143 … … 216 195 */ 217 196 #define DRS_SMART_OPTIONS 218 219 220 /*221 * OPTION: Allow the use of random artifacts (see "randart.c").222 */223 #define GJW_RANDART224 197 225 198 … … 362 335 # undef ALLOW_MACROS 363 336 # undef MONSTER_FLOW 364 # undef ALLOW_TERROR365 337 # undef DRS_SMART_OPTIONS 366 338 # undef GJW_RANDART trunk/src/defines.h
r171 r189 204 204 /* 205 205 * OPTION: Maximum number of macros (see "util.c") 206 * Default: assume at most 256 macros are used 207 */ 208 #define MACRO_MAX 256 206 */ 207 #define MACRO_MAX 512 209 208 210 209 /* trunk/src/dungeon.c
r163 r189 1947 1947 seed_town = rand_int(0x10000000); 1948 1948 1949 #ifdef GJW_RANDART1950 1951 1949 /* Hack -- seed for random artifacts */ 1952 1950 seed_randart = rand_int(0x10000000); 1953 1951 1954 #endif /* GJW_RANDART */1955 1956 1952 /* Roll up a new character */ 1957 1953 player_birth(); 1958 1954 1959 #ifdef GJW_RANDART1960 1961 1955 /* Randomize the artifacts */ 1962 1956 if (adult_randarts) 1963 {1964 1957 do_randart(seed_randart, TRUE); 1965 }1966 1967 #else /* GJW_RANDART */1968 1969 /* Make sure random artifacts are turned off if not available */1970 adult_randarts = FALSE;1971 1972 #endif /* GJW_RANDART */1973 1958 1974 1959 /* Hack -- enter the world */ trunk/src/externs.h
r182 r189 585 585 /* squelch.c */ 586 586 int get_autoinscription_index(s16b k_idx); 587 const char *get_autoinscription(s16b kind_idx); 587 588 int apply_autoinscription(object_type *o_ptr); 588 589 int remove_autoinscription(s16b kind); trunk/src/files.c
r182 r189 2481 2481 } 2482 2482 2483 #if defined(WINDOWS) || defined(MSDOS)2483 #if defined(WINDOWS) 2484 2484 2485 2485 /* Max length */ … … 3324 3324 static errr enter_score(void) 3325 3325 { 3326 #ifndef SCORE_CHEATERS3327 3326 int j; 3328 #endif /* SCORE_CHEATERS */3329 3327 3330 3328 high_score the_score; … … 3336 3334 return (0); 3337 3335 } 3338 3339 #ifndef SCORE_WIZARDS3340 3336 3341 3337 /* Wizard-mode pre-empts scoring */ … … 3348 3344 } 3349 3345 3350 #endif3351 3352 3346 #ifndef SCORE_BORGS 3353 3347 … … 3362 3356 #endif /* SCORE_BORGS */ 3363 3357 3364 #ifndef SCORE_CHEATERS3365 3366 3358 /* Cheaters are not scored */ 3367 3359 for (j = OPT_SCORE; j < OPT_MAX; ++j) … … 3374 3366 return (0); 3375 3367 } 3376 3377 #endif /* SCORE_CHEATERS */3378 3368 3379 3369 /* Hack -- Interupted */ trunk/src/init1.c
r163 r189 4557 4557 #endif /* ALLOW_TEMPLATES_OUTPUT */ 4558 4558 4559 4560 4561 #else /* ALLOW_TEMPLATES */4562 4563 #ifdef MACINTOSH4564 static int i = 0;4565 #endif4566 4567 4559 #endif /* ALLOW_TEMPLATES */ trunk/src/load.c
r156 r189 1290 1290 static errr rd_randarts(void) 1291 1291 { 1292 1293 #ifdef GJW_RANDART1294 1295 1292 int i; 1296 1293 byte tmp8u; … … 1420 1417 1421 1418 return (0); 1422 1423 #else /* GJW_RANDART */1424 1425 note("Random artifacts are disabled in this binary.");1426 return (-1);1427 1428 #endif /* GJW_RANDART */1429 1430 1419 } 1431 1420 trunk/src/main-win.c
r179 r189 91 91 #endif /* HTML_HELP */ 92 92 93 94 /*95 * Extract the "WIN32" flag from the compiler96 */97 #if defined(__WIN32__) || defined(__WINNT__) || defined(__NT__)98 # ifndef WIN3299 # define WIN32100 # endif101 #endif102 93 103 94 … … 280 271 * Hack -- Fake declarations from "dos.h" XXX XXX XXX 281 272 */ 282 #ifdef WIN32283 273 #define INVALID_FILE_NAME (DWORD)0xFFFFFFFF 284 #else /* WIN32 */285 #define FA_LABEL 0x08 /* Volume label */286 #define FA_DIREC 0x10 /* Directory */287 unsigned _cdecl _dos_getfileattr(const char *, unsigned *);288 #endif /* WIN32 */289 274 290 275 /* 291 276 * Silliness in WIN32 drawing routine 292 277 */ 293 #ifdef WIN32 294 # define MoveTo(H,X,Y) MoveToEx(H, X, Y, NULL) 295 #endif /* WIN32 */ 278 #define MoveTo(H,X,Y) MoveToEx(H, X, Y, NULL) 296 279 297 280 /* … … 764 747 char path[1024]; 765 748 766 #ifdef WIN32767 768 749 DWORD attrib; 769 770 #else /* WIN32 */771 772 unsigned int attrib;773 774 #endif /* WIN32 */775 750 776 751 /* Copy it */ 777 752 my_strcpy(path, s, sizeof(path)); 778 753 779 #ifdef WIN32780 781 754 /* Examine */ 782 755 attrib = GetFileAttributes(path); … … 788 761 if (attrib & FILE_ATTRIBUTE_DIRECTORY) return (FALSE); 789 762 790 #else /* WIN32 */791 792 /* Examine and verify */793 if (_dos_getfileattr(path, &attrib)) return (FALSE);794 795 /* Prohibit something */796 if (attrib & FA_LABEL) return (FALSE);797 798 /* Prohibit directory */799 if (attrib & FA_DIREC) return (FALSE);800 801 #endif /* WIN32 */802 803 763 /* Success */ 804 764 return (TRUE); … … 815 775 char path[1024]; 816 776 817 #ifdef WIN32818 819 777 DWORD attrib; 820 821 #else /* WIN32 */822 823 unsigned int attrib;824 825 #endif /* WIN32 */826 778 827 779 /* Copy it */ … … 834 786 if (i && (path[i-1] == '\\')) path[--i] = '\0'; 835 787 836 #ifdef WIN32837 838 788 /* Examine */ 839 789 attrib = GetFileAttributes(path); … … 844 794 /* Require directory */ 845 795 if (!(attrib & FILE_ATTRIBUTE_DIRECTORY)) return (FALSE); 846 847 #else /* WIN32 */848 849 /* Examine and verify */850 if (_dos_getfileattr(path, &attrib)) return (FALSE);851 852 /* Prohibit something */853 if (attrib & FA_LABEL) return (FALSE);854 855 /* Require directory */856 if (!(attrib & FA_DIREC)) return (FALSE);857 858 #endif /* WIN32 */859 796 860 797 /* Success */ … … 1877 1814 1878 1815 /* Reset visuals */ 1879 #ifdef ANGBAND_2_8_11880 reset_visuals();1881 #else /* ANGBAND_2_8_1 */1882 1816 reset_visuals(TRUE); 1883 #endif /* ANGBAND_2_8_1 */1884 1817 } 1885 1818 … … 2038 1971 path_build(buf, sizeof(buf), ANGBAND_DIR_XTRA_SOUND, sound_file[v][Rand_simple(i)]); 2039 1972 2040 #ifdef WIN322041 2042 1973 /* Play the sound, catch errors */ 2043 1974 return (PlaySound(buf, 0, SND_FILENAME | SND_ASYNC)); 2044 1975 2045 #else /* WIN32 */2046 2047 /* Play the sound, catch errors */2048 return (sndPlaySound(buf, SND_ASYNC));2049 2050 #endif /* WIN32 */2051 2052 1976 #else /* USE_SOUND */ 2053 1977 … … 2064 1988 static int Term_xtra_win_delay(int v) 2065 1989 { 2066 #ifdef WIN322067 2068 1990 /* Sleep */ 2069 1991 if (v > 0) Sleep(v); 2070 2071 #else /* WIN32 */2072 2073 DWORD t;2074 MSG msg;2075 2076 /* Final count */2077 t = GetTickCount() + v;2078 2079 /* Wait for it */2080 while (GetTickCount() < t)2081 {2082 /* Handle messages */2083 if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))2084 {2085 TranslateMessage(&msg);2086 DispatchMessage(&msg);2087 }2088 }2089 2090 #endif /* WIN32 */2091 1992 2092 1993 /* Success */ … … 2544 2445 char tc; 2545 2446 2546 #ifdef ZANGBAND2547 2548 td->map_tile_wid = (td->tile_wid * td->cols) / MAX_WID;2549 td->map_tile_hgt = (td->tile_hgt * td->rows) / MAX_HGT;2550 2551 #ifdef ZANGBAND_WILDERNESS2552 2553 min_x = min_wid;2554 min_y = min_hgt;2555 max_x = max_wid;2556 max_y = max_hgt;2557 2558 #else /* ZANGBAND_WILDERNESS */2559 2560 min_x = 0;2561 min_y = 0;2562 max_x = cur_wid;2563 max_y = cur_hgt;2564 2565 #endif /* ZANGBAND_WILDERNESS */2566 2567 #else /* ZANGBAND */2568 2569 2447 td->map_tile_wid = (td->tile_wid * td->cols) / DUNGEON_WID; 2570 2448 td->map_tile_hgt = (td->tile_hgt * td->rows) / DUNGEON_HGT; … … 2574 2452 max_x = DUNGEON_WID; 2575 2453 max_y = DUNGEON_HGT; 2576 2577 #endif /* ZANGBAND */2578 2454 2579 2455 /* Draw the map */ … … 2835 2711 term_data_link(td); 2836 2712 term_screen = &td->t; 2837 2838 #ifdef ZANGBAND_BIGSCREEN2839 2840 /*2841 * Reset map size if required2842 */2843 2844 /* Mega-Hack -- no panel yet */2845 panel_row_min = 0;2846 panel_row_max = 0;2847 panel_col_min = 0;2848 panel_col_max = 0;2849 2850 /* Reset the panels */2851 map_panel_size();2852 2853 #endif /* ZANGBAND_BIGSCREEN */2854 2713 2855 2714 /* Activate the main window */ … … 3400 3259 3401 3260 /* Save the game */ 3402 #ifdef ZANGBAND3403 do_cmd_save_game(FALSE);3404 #else /* ZANGBAND */3405 3261 do_cmd_save_game(); 3406 #endif /* ZANGBAND */3407 3262 } 3408 3263 else … … 3430 3285 3431 3286 /* Save the game */ 3432 #ifdef ZANGBAND3433 do_cmd_save_game(FALSE);3434 #else /* ZANGBAND */3435 3287 do_cmd_save_game(); 3436 #endif /* ZANGBAND */3437 3288 } 3438 3289 quit(NULL); … … 4116 3967 4117 3968 /* Save the game */ 4118 #ifdef ZANGBAND4119 do_cmd_save_game(FALSE);4120 #else /* ZANGBAND */4121 3969 do_cmd_save_game(); 4122 #endif /* ZANGBAND */4123 3970 } 4124 3971 quit(NULL); trunk/src/main-x11.c
r166 r189 1268 1268 ifnt->hgt = info->ascent + info->descent; 1269 1269 ifnt->wid = cs->width; 1270 1271 #ifdef OBSOLETE_SIZING_METHOD1272 /* Extract default sizing info */1273 ifnt->asc = cs->ascent;1274 ifnt->hgt = (cs->ascent + cs->descent);1275 ifnt->wid = cs->width;1276 #endif1277 1278 1270 ifnt->twid = cs->width; 1279 1271 trunk/src/main.c
r141 r189 19 19 20 20 #if defined(WIN32_CONSOLE_MODE) \ 21 || (!defined( MACINTOSH) && !defined(WINDOWS) && !defined(RISCOS)) \21 || (!defined(WINDOWS) && !defined(RISCOS)) \ 22 22 || defined(USE_SDL) 23 23 trunk/src/melee2.c
r158 r189 2331 2331 monster_type *m_ptr = &mon_list[m_idx]; 2332 2332 2333 #ifdef ALLOW_TERROR2334 2335 2333 monster_race *r_ptr = &r_info[m_ptr->r_idx]; 2336 2334 … … 2340 2338 u32b p_val, m_val; 2341 2339 2342 #endif /* ALLOW_TERROR */2343 2344 2340 /* Keep monsters from running too far away */ 2345 2341 if (m_ptr->cdis > MAX_SIGHT + 5) return (FALSE); … … 2347 2343 /* All "afraid" monsters will run away */ 2348 2344 if (m_ptr->monfear) return (TRUE); 2349 2350 #ifdef ALLOW_TERROR2351 2345 2352 2346 /* Nearby monsters will not become terrified */ … … 2377 2371 /* Strong players scare strong monsters */ 2378 2372 if (p_val * m_mhp > m_val * p_mhp) return (TRUE); 2379 2380 #endif /* ALLOW_TERROR */2381 2373 2382 2374 /* Assume no terror */ trunk/src/randart.c
r175 r189 18 18 * Random artifact generator (randart) by Greg Wooledge. 19 19 */ 20 21 #ifdef GJW_RANDART22 20 23 21 #define MAX_TRIES 200 … … 1433 1431 } 1434 1432 1435 #else /* GJW_RANDART */1436 1437 #ifdef MACINTOSH1438 static int i = 0;1439 #endif /* MACINTOSH */1440 1441 #endif /* GJW_RANDART */trunk/src/squelch.c
r171 r189 179 179 * DOCUMENT ME! 180 180 */ 181 static cptrget_autoinscription(s16b kind_idx)181 const char *get_autoinscription(s16b kind_idx) 182 182 { 183 183 int i; trunk/src/wizard1.c
r136 r189 913 913 914 914 915 #else916 917 #ifdef MACINTOSH918 static int i = 0;919 915 #endif 920 921 #endiftrunk/src/wizard2.c
r136 r189 1736 1736 1737 1737 1738 #else1739 1740 #ifdef MACINTOSH1741 static int i = 0;1742 1738 #endif 1743 1739 1744 #endif 1745 1746 1740 trunk/src/xtra2.c
r163 r189 1499 1499 1500 1500 1501 #ifdef ALLOW_FEAR1502 1503 1501 /* Mega-Hack -- Pain cancels fear */ 1504 1502 if (m_ptr->monfear && (dam > 0)) … … 1548 1546 } 1549 1547 } 1550 1551 #endif /* ALLOW_FEAR */1552 1548 1553 1549 trunk/src/z-file.c
r187 r189 243 243 } 244 244 245 #if defined(MACINTOSH) || defined(MACH_O_CARBON)245 #ifdef MACH_O_CARBON 246 246 247 247 /* … … 252 252 if (c == '\r') c = '\n'; 253 253 254 #endif /* MAC INTOSH || MACH_O_CARBON */254 #endif /* MACH_O_CARBON */ 255 255 256 256 /* End of line */ … … 547 547 fff = fopen(buf, mode); 548 548 549 #if defined(MAC _MPW) || defined(MACH_O_CARBON)549 #if defined(MACH_O_CARBON) 550 550 551 551 /* Set file creator and type */ … … 624 624 if (path_parse(buf, sizeof(buf), file)) return (-1); 625 625 626 #if defined(MACINTOSH)627 628 /* Create the file, fail if exists, write-only, binary */629 fd = open(buf, O_CREAT | O_EXCL | O_WRONLY | O_BINARY);630 631 #else632 633 626 /* Create the file, fail if exists, write-only, binary */ 634 627 fd = open(buf, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, mode); 635 628 636 #endif 637 638 #if defined(MAC_MPW) || defined(MACH_O_CARBON) 629 #ifdef MACH_O_CARBON 639 630 640 631 /* Set file creator and type */ … … 660 651 if (path_parse(buf, sizeof(buf), file)) return (-1); 661 652 662 #if defined(MACINTOSH) || defined(WINDOWS)663 664 /* Attempt to open the file */665 return (open(buf, flags | O_BINARY));666 667 #else668 669 653 /* Attempt to open the file */ 670 654 return (open(buf, flags | O_BINARY, 0)); 671 672 #endif673 674 655 } 675 656
