Changeset 189

Show
Ignore:
Timestamp:
06/14/07 19:11:37 (1 year ago)
Author:
takkaria
Message:

Bits of cleanup:

  • Turn on ALLOW_FEAR, ALLOW_TERROR, GJW_RANDART permanently, and SCORE_WIZARDS and SCORE_CHEATERS off.
  • Remove some old MACINTOSH, MAC_MPW, MSDOS and 16-bit Windows support bits
  • Up the macro limit
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/config.h

    r182 r189  
    9797 
    9898/* 
    99  * OPTION: Allow monsters to "flee" when hit hard 
    100  */ 
    101 #define ALLOW_FEAR 
    102  
    103 /* 
    104  * OPTION: Allow monsters to "flee" from strong players 
    105  */ 
    106 #define ALLOW_TERROR 
    107  
    108  
    109 /* 
    11099 * OPTION: Allow parsing of the ascii template files in "init.c". 
    111100 * This must be defined if you do not have valid binary image files. 
     
    148137 
    149138/* 
    150  * OPTION: Allow "Wizards" to yield "high scores" 
    151  */ 
    152 /* #define SCORE_WIZARDS */ 
    153  
    154 /* 
    155139 * OPTION: Allow "Borgs" to yield "high scores" 
    156140 */ 
    157141/* #define SCORE_BORGS */ 
    158  
    159 /* 
    160  * OPTION: Allow "Cheaters" to yield "high scores" 
    161  */ 
    162 /* #define SCORE_CHEATERS */ 
    163142 
    164143 
     
    216195 */ 
    217196#define DRS_SMART_OPTIONS 
    218  
    219  
    220 /* 
    221  * OPTION: Allow the use of random artifacts (see "randart.c"). 
    222  */ 
    223 #define GJW_RANDART 
    224197 
    225198 
     
    362335# undef ALLOW_MACROS 
    363336# undef MONSTER_FLOW 
    364 # undef ALLOW_TERROR 
    365337# undef DRS_SMART_OPTIONS 
    366338# undef GJW_RANDART 
  • trunk/src/defines.h

    r171 r189  
    204204/* 
    205205 * 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 
    209208 
    210209/* 
  • trunk/src/dungeon.c

    r163 r189  
    19471947                seed_town = rand_int(0x10000000); 
    19481948 
    1949 #ifdef GJW_RANDART 
    1950  
    19511949                /* Hack -- seed for random artifacts */ 
    19521950                seed_randart = rand_int(0x10000000); 
    19531951 
    1954 #endif /* GJW_RANDART */ 
    1955  
    19561952                /* Roll up a new character */ 
    19571953                player_birth(); 
    19581954 
    1959 #ifdef GJW_RANDART 
    1960  
    19611955                /* Randomize the artifacts */ 
    19621956                if (adult_randarts) 
    1963                 { 
    19641957                        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 */ 
    19731958 
    19741959                /* Hack -- enter the world */ 
  • trunk/src/externs.h

    r182 r189  
    585585/* squelch.c */ 
    586586int get_autoinscription_index(s16b k_idx); 
     587const char *get_autoinscription(s16b kind_idx); 
    587588int apply_autoinscription(object_type *o_ptr); 
    588589int remove_autoinscription(s16b kind); 
  • trunk/src/files.c

    r182 r189  
    24812481        } 
    24822482 
    2483 #if defined(WINDOWS) || defined(MSDOS) 
     2483#if defined(WINDOWS) 
    24842484 
    24852485        /* Max length */ 
     
    33243324static errr enter_score(void) 
    33253325{ 
    3326 #ifndef SCORE_CHEATERS 
    33273326        int j; 
    3328 #endif /* SCORE_CHEATERS */ 
    33293327 
    33303328        high_score the_score; 
     
    33363334                return (0); 
    33373335        } 
    3338  
    3339 #ifndef SCORE_WIZARDS 
    33403336 
    33413337        /* Wizard-mode pre-empts scoring */ 
     
    33483344        } 
    33493345 
    3350 #endif 
    3351  
    33523346#ifndef SCORE_BORGS 
    33533347 
     
    33623356#endif /* SCORE_BORGS */ 
    33633357 
    3364 #ifndef SCORE_CHEATERS 
    3365  
    33663358        /* Cheaters are not scored */ 
    33673359        for (j = OPT_SCORE; j < OPT_MAX; ++j) 
     
    33743366                return (0); 
    33753367        } 
    3376  
    3377 #endif /* SCORE_CHEATERS */ 
    33783368 
    33793369        /* Hack -- Interupted */ 
  • trunk/src/init1.c

    r163 r189  
    45574557#endif /* ALLOW_TEMPLATES_OUTPUT */ 
    45584558 
    4559  
    4560  
    4561 #else   /* ALLOW_TEMPLATES */ 
    4562  
    4563 #ifdef MACINTOSH 
    4564 static int i = 0; 
    4565 #endif 
    4566  
    45674559#endif  /* ALLOW_TEMPLATES */ 
  • trunk/src/load.c

    r156 r189  
    12901290static errr rd_randarts(void) 
    12911291{ 
    1292  
    1293 #ifdef GJW_RANDART 
    1294  
    12951292        int i; 
    12961293        byte tmp8u; 
     
    14201417 
    14211418        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  
    14301419} 
    14311420 
  • trunk/src/main-win.c

    r179 r189  
    9191#endif /* HTML_HELP */ 
    9292 
    93  
    94 /* 
    95  * Extract the "WIN32" flag from the compiler 
    96  */ 
    97 #if defined(__WIN32__) || defined(__WINNT__) || defined(__NT__) 
    98 # ifndef WIN32 
    99 #  define WIN32 
    100 # endif 
    101 #endif 
    10293 
    10394 
     
    280271 * Hack -- Fake declarations from "dos.h" XXX XXX XXX 
    281272 */ 
    282 #ifdef WIN32 
    283273#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 */ 
    289274 
    290275/* 
    291276 * Silliness in WIN32 drawing routine 
    292277 */ 
    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) 
    296279 
    297280/* 
     
    764747        char path[1024]; 
    765748 
    766 #ifdef WIN32 
    767  
    768749        DWORD attrib; 
    769  
    770 #else /* WIN32 */ 
    771  
    772         unsigned int attrib; 
    773  
    774 #endif /* WIN32 */ 
    775750 
    776751        /* Copy it */ 
    777752        my_strcpy(path, s, sizeof(path)); 
    778753 
    779 #ifdef WIN32 
    780  
    781754        /* Examine */ 
    782755        attrib = GetFileAttributes(path); 
     
    788761        if (attrib & FILE_ATTRIBUTE_DIRECTORY) return (FALSE); 
    789762 
    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  
    803763        /* Success */ 
    804764        return (TRUE); 
     
    815775        char path[1024]; 
    816776 
    817 #ifdef WIN32 
    818  
    819777        DWORD attrib; 
    820  
    821 #else /* WIN32 */ 
    822  
    823         unsigned int attrib; 
    824  
    825 #endif /* WIN32 */ 
    826778 
    827779        /* Copy it */ 
     
    834786        if (i && (path[i-1] == '\\')) path[--i] = '\0'; 
    835787 
    836 #ifdef WIN32 
    837  
    838788        /* Examine */ 
    839789        attrib = GetFileAttributes(path); 
     
    844794        /* Require directory */ 
    845795        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 */ 
    859796 
    860797        /* Success */ 
     
    18771814 
    18781815                /* Reset visuals */ 
    1879 #ifdef ANGBAND_2_8_1 
    1880                 reset_visuals(); 
    1881 #else /* ANGBAND_2_8_1 */ 
    18821816                reset_visuals(TRUE); 
    1883 #endif /* ANGBAND_2_8_1 */ 
    18841817        } 
    18851818 
     
    20381971        path_build(buf, sizeof(buf), ANGBAND_DIR_XTRA_SOUND, sound_file[v][Rand_simple(i)]); 
    20391972 
    2040 #ifdef WIN32 
    2041  
    20421973        /* Play the sound, catch errors */ 
    20431974        return (PlaySound(buf, 0, SND_FILENAME | SND_ASYNC)); 
    20441975 
    2045 #else /* WIN32 */ 
    2046  
    2047         /* Play the sound, catch errors */ 
    2048         return (sndPlaySound(buf, SND_ASYNC)); 
    2049  
    2050 #endif /* WIN32 */ 
    2051  
    20521976#else /* USE_SOUND */ 
    20531977 
     
    20641988static int Term_xtra_win_delay(int v) 
    20651989{ 
    2066 #ifdef WIN32 
    2067  
    20681990        /* Sleep */ 
    20691991        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 */ 
    20911992 
    20921993        /* Success */ 
     
    25442445        char tc; 
    25452446 
    2546 #ifdef ZANGBAND 
    2547  
    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_WILDERNESS 
    2552  
    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  
    25692447        td->map_tile_wid = (td->tile_wid * td->cols) / DUNGEON_WID; 
    25702448        td->map_tile_hgt = (td->tile_hgt * td->rows) / DUNGEON_HGT; 
     
    25742452        max_x = DUNGEON_WID; 
    25752453        max_y = DUNGEON_HGT; 
    2576  
    2577 #endif /* ZANGBAND */ 
    25782454 
    25792455        /* Draw the map */ 
     
    28352711        term_data_link(td); 
    28362712        term_screen = &td->t; 
    2837  
    2838 #ifdef ZANGBAND_BIGSCREEN 
    2839  
    2840         /* 
    2841          * Reset map size if required 
    2842          */ 
    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 */ 
    28542713 
    28552714        /* Activate the main window */ 
     
    34003259 
    34013260                                /* Save the game */ 
    3402 #ifdef ZANGBAND 
    3403                                 do_cmd_save_game(FALSE); 
    3404 #else /* ZANGBAND */ 
    34053261                                do_cmd_save_game(); 
    3406 #endif /* ZANGBAND */ 
    34073262                        } 
    34083263                        else 
     
    34303285 
    34313286                                /* Save the game */ 
    3432 #ifdef ZANGBAND 
    3433                                 do_cmd_save_game(FALSE); 
    3434 #else /* ZANGBAND */ 
    34353287                                do_cmd_save_game(); 
    3436 #endif /* ZANGBAND */ 
    34373288                        } 
    34383289                        quit(NULL); 
     
    41163967 
    41173968                                /* Save the game */ 
    4118 #ifdef ZANGBAND 
    4119                                 do_cmd_save_game(FALSE); 
    4120 #else /* ZANGBAND */ 
    41213969                                do_cmd_save_game(); 
    4122 #endif /* ZANGBAND */ 
    41233970                        } 
    41243971                        quit(NULL); 
  • trunk/src/main-x11.c

    r166 r189  
    12681268        ifnt->hgt = info->ascent + info->descent; 
    12691269        ifnt->wid = cs->width; 
    1270  
    1271 #ifdef OBSOLETE_SIZING_METHOD 
    1272         /* Extract default sizing info */ 
    1273         ifnt->asc = cs->ascent; 
    1274         ifnt->hgt = (cs->ascent + cs->descent); 
    1275         ifnt->wid = cs->width; 
    1276 #endif 
    1277  
    12781270        ifnt->twid = cs->width; 
    12791271 
  • trunk/src/main.c

    r141 r189  
    1919 
    2020#if defined(WIN32_CONSOLE_MODE) \ 
    21     || (!defined(MACINTOSH) && !defined(WINDOWS) && !defined(RISCOS)) \ 
     21    || (!defined(WINDOWS) && !defined(RISCOS)) \ 
    2222    || defined(USE_SDL) 
    2323 
  • trunk/src/melee2.c

    r158 r189  
    23312331        monster_type *m_ptr = &mon_list[m_idx]; 
    23322332 
    2333 #ifdef ALLOW_TERROR 
    2334  
    23352333        monster_race *r_ptr = &r_info[m_ptr->r_idx]; 
    23362334 
     
    23402338        u32b p_val, m_val; 
    23412339 
    2342 #endif /* ALLOW_TERROR */ 
    2343  
    23442340        /* Keep monsters from running too far away */ 
    23452341        if (m_ptr->cdis > MAX_SIGHT + 5) return (FALSE); 
     
    23472343        /* All "afraid" monsters will run away */ 
    23482344        if (m_ptr->monfear) return (TRUE); 
    2349  
    2350 #ifdef ALLOW_TERROR 
    23512345 
    23522346        /* Nearby monsters will not become terrified */ 
     
    23772371        /* Strong players scare strong monsters */ 
    23782372        if (p_val * m_mhp > m_val * p_mhp) return (TRUE); 
    2379  
    2380 #endif /* ALLOW_TERROR */ 
    23812373 
    23822374        /* Assume no terror */ 
  • trunk/src/randart.c

    r175 r189  
    1818 * Random artifact generator (randart) by Greg Wooledge. 
    1919 */ 
    20  
    21 #ifdef GJW_RANDART 
    2220 
    2321#define MAX_TRIES 200 
     
    14331431} 
    14341432 
    1435 #else /* GJW_RANDART */ 
    1436  
    1437 #ifdef MACINTOSH 
    1438 static int i = 0; 
    1439 #endif /* MACINTOSH */ 
    1440  
    1441 #endif /* GJW_RANDART */ 
  • trunk/src/squelch.c

    r171 r189  
    179179 * DOCUMENT ME! 
    180180 */ 
    181 static cptr get_autoinscription(s16b kind_idx) 
     181const char *get_autoinscription(s16b kind_idx) 
    182182{ 
    183183        int i; 
  • trunk/src/wizard1.c

    r136 r189  
    913913 
    914914 
    915 #else 
    916  
    917 #ifdef MACINTOSH 
    918 static int i = 0; 
    919915#endif 
    920  
    921 #endif 
  • trunk/src/wizard2.c

    r136 r189  
    17361736 
    17371737 
    1738 #else 
    1739  
    1740 #ifdef MACINTOSH 
    1741 static int i = 0; 
    17421738#endif 
    17431739 
    1744 #endif 
    1745  
    1746  
     1740 
  • trunk/src/xtra2.c

    r163 r189  
    14991499 
    15001500 
    1501 #ifdef ALLOW_FEAR 
    1502  
    15031501        /* Mega-Hack -- Pain cancels fear */ 
    15041502        if (m_ptr->monfear && (dam > 0)) 
     
    15481546                } 
    15491547        } 
    1550  
    1551 #endif /* ALLOW_FEAR */ 
    15521548 
    15531549 
  • trunk/src/z-file.c

    r187 r189  
    243243                } 
    244244 
    245 #if defined(MACINTOSH) || defined(MACH_O_CARBON) 
     245#ifdef MACH_O_CARBON 
    246246 
    247247                /* 
     
    252252                if (c == '\r') c = '\n'; 
    253253 
    254 #endif /* MACINTOSH || MACH_O_CARBON */ 
     254#endif /* MACH_O_CARBON */ 
    255255 
    256256                /* End of line */ 
     
    547547        fff = fopen(buf, mode); 
    548548 
    549 #if defined(MAC_MPW) || defined(MACH_O_CARBON) 
     549#if defined(MACH_O_CARBON) 
    550550 
    551551        /* Set file creator and type */ 
     
    624624        if (path_parse(buf, sizeof(buf), file)) return (-1); 
    625625 
    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 #else 
    632  
    633626        /* Create the file, fail if exists, write-only, binary */ 
    634627        fd = open(buf, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, mode); 
    635628 
    636 #endif 
    637  
    638 #if defined(MAC_MPW) || defined(MACH_O_CARBON) 
     629#ifdef MACH_O_CARBON 
    639630 
    640631        /* Set file creator and type */ 
     
    660651        if (path_parse(buf, sizeof(buf), file)) return (-1); 
    661652 
    662 #if defined(MACINTOSH) || defined(WINDOWS) 
    663  
    664         /* Attempt to open the file */ 
    665         return (open(buf, flags | O_BINARY)); 
    666  
    667 #else 
    668  
    669653        /* Attempt to open the file */ 
    670654        return (open(buf, flags | O_BINARY, 0)); 
    671  
    672 #endif 
    673  
    674655} 
    675656