- Added a setting to skip delay when showing damage to the whole party. It's a hidden preference at the moment, like skip startup splash.

- Replaced all instances of Boolean with bool, TRUE with true, FALSE with false. (Except for a few cases where this resulted in a compile error.)

git-svn-id: http://openexile.googlecode.com/svn/trunk@38 4ebdad44-0ea0-11de-aab3-ff745001d230
This commit is contained in:
2009-04-27 19:41:06 +00:00
parent f28053ed0e
commit e0115dd668
80 changed files with 3703 additions and 3694 deletions

View File

@@ -37,7 +37,7 @@ void process_new_window (short which_dlg) {
short i = -1,j,free_slot = -1,free_item = -1,type,flag;
char but_str[30];
Str255 item_str;
Boolean str_stored = FALSE;
bool str_stored = false;
Rect dlg_rect,store_rect;
short win_height = 0, win_width = 0;
short the_type;
@@ -61,64 +61,64 @@ void process_new_window (short which_dlg) {
GetDialogItemText(the_handle,item_str);
p2cstr(item_str);
dlgs[free_slot].highest_item++;
str_stored = FALSE;
str_stored = false;
if (strlen((char *)item_str) == 0) {
sprintf((char *) item_str, "+");
type = DLG_TEXT_BOLD;
flag = 1;
str_stored = TRUE;
str_stored = true;
}
else if (item_str[0] == '+') { // default is framed text
type = DLG_TEXT_BOLD;
flag = 1;
str_stored = TRUE;
str_stored = true;
}
else if (item_str[0] == '*') {
type = DLG_TEXT_BOLD;
flag = 0;
str_stored = TRUE;
str_stored = true;
}
else if (item_str[0] == '~') {
type = DLG_TEXT_LARGE;
flag = 0;
str_stored = TRUE;
str_stored = true;
}
else if (item_str[0] == '!') {
type = DLG_TEXT_PLAIN;
flag = 0;
str_stored = TRUE;
str_stored = true;
}
else if (item_str[0] == '=') {
type = DLG_TEXT_DEFAULT;
flag = 1;
str_stored = TRUE;
str_stored = true;
}
else if (item_str[0] == '^') {
type = DLG_CUSTOM_BTN;
flag = 1;
if (string_length((char *) item_str) > 55)
flag = 2;
str_stored = TRUE;
str_stored = true;
}
else if (((item_str[0] >= 65) && (item_str[0] <= 122)) || (item_str[0] == '"')) {
type = DLG_TEXT_DEFAULT;
flag = 0;
str_offset = 0;
str_stored = TRUE;
str_stored = true;
}
else if (item_str[0] == '&') {
type = DLG_CUSTOM_DEF_BTN;
flag = 1;
if (string_length((char *) item_str) > 55)
flag = 2;
str_stored = TRUE;
str_stored = true;
}
// else if (item_str[0] == '@') { // For potential future use
// type = DLG_PUSH_BTN;
// flag = 1;
// if (string_length((char *) item_str) > 55)
// flag = 2;
// str_stored = TRUE;
// str_stored = true;
// }
else {
#ifndef EXILE_BIG_GUNS
@@ -183,7 +183,7 @@ void process_new_window (short which_dlg) {
case DLG_TEXT_CLICKABLE: case DLG_TEXT_DEFAULT:
case DLG_CUSTOM_BTN: case DLG_CUSTOM_DEF_BTN:
sprintf(((free_item < 10) ? text_long_str[free_item] : text_short_str[free_item - 10]),"");
if (str_stored == TRUE) {
if (str_stored == true) {
if (free_item < 10)
sprintf(text_long_str[free_item],"%s",(char *) (item_str + str_offset));
else
@@ -205,7 +205,7 @@ void process_new_window (short which_dlg) {
}
}
ShortenDITL(GetDialogFromWindow(hDlg),dlgs[free_slot].highest_item);
SizeWindow(hDlg,win_width,win_height,FALSE);
SizeWindow(hDlg,win_width,win_height,false);
dlgs[free_slot].highest_item = num_items;
}
@@ -311,7 +311,7 @@ GrafPtr hDialog;
short w__gw;
bool fr;
void draw_dialog_graphic(GrafPtr hDlg, Rect rect, short which_g,
short type_g, Boolean do_frame,short win_or_gworld){
short type_g, bool do_frame,short win_or_gworld){
short picnum;
RGBColor store_color;
@@ -321,7 +321,7 @@ void draw_dialog_graphic(GrafPtr hDlg, Rect rect, short which_g,
return;
if (which_g >= 2000)
do_frame = FALSE;
do_frame = false;
which_g = which_g % 2000;
if (type_g == PICT_OLD)
@@ -423,9 +423,9 @@ void draw_dialog_graphic(GrafPtr hDlg, Rect rect, short which_g,
}
w__gw = 0;
hDialog = NULL;
fr = FALSE;
fr = false;
if (do_frame == TRUE) {
if (do_frame == true) {
rect.bottom--;
rect.right--;
frame_dlog_rect(hDlg,rect,3);
@@ -806,7 +806,7 @@ void draw_custom_space_pic(short which_g,Rect& rect){
//GWorldPtr to_gworld = (GWorldPtr) ((w__gw == 1) ? (GWorldPtr) (hDialog): from_gworld);
GWorldPtr to_gworld = (GWorldPtr) hDialog;
Rect from_rect = get_custom_rect(which_g);
if ((w__gw == 0) && (fr == TRUE))
if ((w__gw == 0) && (fr == true))
PaintRect(&rect);
rect_draw_some_item(from_gworld,from_rect,to_gworld,rect,1,draw_dest);
}
@@ -816,7 +816,7 @@ void draw_custom_monst_wide_pic(short which_g,Rect& rect){
Rect small_monst_rect = {0,0,18,14};
rect.right = rect.left + 28;
rect.bottom = rect.top + 36;
if ((w__gw == 0) && (fr == TRUE))
if ((w__gw == 0) && (fr == true))
PaintRect(&rect);
GWorldPtr from_gworld = *dlg_gworlds["custom"];
//GWorldPtr to_gworld = (GWorldPtr) ((w__gw == 1) ? (GWorldPtr) (hDialog): from_gworld);
@@ -834,7 +834,7 @@ void draw_custom_monst_tall_pic(short which_g,Rect& rect){
Rect small_monst_rect = {0,0,18,14};
rect.right = rect.left + 28;
rect.bottom = rect.top + 36;
if ((w__gw == 0) && (fr == TRUE))
if ((w__gw == 0) && (fr == true))
PaintRect(&rect);
GWorldPtr from_gworld = *dlg_gworlds["custom"];
//GWorldPtr to_gworld = (GWorldPtr) ((w__gw == 1) ? (GWorldPtr) (hDialog): from_gworld);
@@ -852,7 +852,7 @@ void draw_custom_monst_large_pic(short which_g,Rect& rect){
Rect small_monst_rect = {0,0,18,14};
rect.right = rect.left + 28;
rect.bottom = rect.top + 36;
if ((w__gw == 0) && (fr == TRUE))
if ((w__gw == 0) && (fr == true))
PaintRect(&rect);
GWorldPtr from_gworld = *dlg_gworlds["custom"];
//GWorldPtr to_gworld = (GWorldPtr) ((w__gw == 1) ? (GWorldPtr) (hDialog): from_gworld);

View File

@@ -15,7 +15,7 @@ short cd_find_dlog(WindowPtr window, short *dlg_num, short *dlg_key);
short cd_get_item_id(short dlg_num, short item_num);
Rect get_item_rect(WindowPtr hDlg, short item_num);
void frame_dlog_rect(GrafPtr hDlg, Rect rect, short val, short med_or_lt = 0);
void draw_dialog_graphic(GrafPtr hDlg, Rect rect, short which_g, short type_g, Boolean do_frame,short win_or_gworld);
void draw_dialog_graphic(GrafPtr hDlg, Rect rect, short which_g, short type_g, bool do_frame,short win_or_gworld);
void convert_pict(short& which_g, short& type_g,Rect& rect);
void draw_preset_ter_pic(short which_g,Rect& rect);
void draw_preset_anim_ter_pic(short which_g,Rect& rect);

View File

@@ -64,7 +64,7 @@ void cd_init_dialogs(INIT_PARAMS){
items[i].dlg = -1;
}
for (i = 0; i < NL; i++) {
labels[i].taken = FALSE;
labels[i].taken = false;
}
for (i = 0; i < NUM_BUTTONS; i++){
for (j = 0; j < 2; j++)
@@ -172,7 +172,7 @@ short cd_kill_dialog(short dlog_num,short parent_message){
for (i = 0; i < NI; i++)
if (items[i].dlg == dlog_num) {
if (items[i].label > 0)
labels[items[i].label_loc].taken = FALSE;
labels[items[i].label_loc].taken = false;
items[i].dlg = -1;
}
@@ -532,9 +532,9 @@ void cd_add_label(short dlog_num, short item_num, char *label, short label_flag)
if (items[item_index].label_loc < 0) {
items[item_index].label = label_flag;
for (i = 0; i < 100; i++)
if (labels[i].taken == FALSE) {
if (labels[i].taken == false) {
label_loc = i;
labels[i].taken = TRUE;
labels[i].taken = true;
i = 100;
}
if (label_loc < 0) {
@@ -556,7 +556,7 @@ void cd_take_label(short dlog_num, short item_num){
if (cd_get_indices(dlog_num,item_num,&dlg_index,&item_index) < 0)
return;
items[item_index].label = 0;
labels[items[item_index].label_loc].taken = FALSE;
labels[items[item_index].label_loc].taken = false;
}
void cd_key_label(short dlog_num, short item_num,short loc){
@@ -576,7 +576,7 @@ void cd_draw_item(short dlog_num,short item_num){
//printf("In cd_draw_item(%i,%i)\n",dlog_num,item_num);
if (cd_get_indices(dlog_num,item_num,&dlg_index,&item_index) < 0)
return;
if (dlgs[dlg_index].draw_ready == FALSE)
if (dlgs[dlg_index].draw_ready == false)
return;
//printf("Drawing item %i of type %i\n",item_num,items[item_index].type);
GetPort(&old_port);
@@ -684,7 +684,7 @@ void cd_draw_item(short dlog_num,short item_num){
if (items[item_index].flag == -1)
cd_erase_item(dlog_num,item_num);
else draw_dialog_graphic(GetWindowPort(dlgs[dlg_index].win), items[item_index].rect, items[item_index].flag,
PICT_OLD, (items[item_index].flag >= 2000) ? FALSE : TRUE,0);
PICT_OLD, (items[item_index].flag >= 2000) ? false : true,0);
break;
default: // DLG_NEW_PICTURE
printf("Type = %i\t",items[item_index].type);
@@ -693,7 +693,7 @@ void cd_draw_item(short dlog_num,short item_num){
if (items[item_index].flag == -1)
cd_erase_item(dlog_num,item_num);
else draw_dialog_graphic(GetWindowPort(dlgs[dlg_index].win), items[item_index].rect, items[item_index].flag,
items[item_index].type - DLG_NEW_PICTURE, (items[item_index].flag >= 2000) ? FALSE : TRUE,0);
items[item_index].type - DLG_NEW_PICTURE, (items[item_index].flag >= 2000) ? false : true,0);
break;
}
}//printf("Item %i drawn.\n",item_num);
@@ -754,7 +754,7 @@ void cd_initial_draw(short dlog_num){
if (which_dlg < 0) {
return;
}
dlgs[which_dlg].draw_ready = TRUE;
dlgs[which_dlg].draw_ready = true;
cd_erase_item(dlog_num, 0);
cd_draw(dlog_num);
@@ -778,7 +778,7 @@ void cd_redraw(WindowPtr window){
if ((which_dlg = cd_find_dlog(window,&dlg_num,&dlg_key)) < 0)
return;
dlgs[which_dlg].draw_ready = TRUE;
dlgs[which_dlg].draw_ready = true;
cd_initial_draw(dlg_num);
}
@@ -790,7 +790,7 @@ void cd_frame_item(short dlog_num, short item_num, short width){
frame_dlog_rect(GetWindowPort(dlgs[dlg_index].win), items[item_index].rect, width);
}
void cd_erase_item(short dlog_num, short item_num, Boolean just_label){
void cd_erase_item(short dlog_num, short item_num, bool just_label){
// if item_num is 0, nail whole window
// item_num + 100 just erase label
short i,dlg_index,item_index,store_label;
@@ -799,7 +799,7 @@ void cd_erase_item(short dlog_num, short item_num, Boolean just_label){
if (item_num >= 100) {
item_num -= 100;
just_label = TRUE;
just_label = true;
}
if (item_num == 0) {
@@ -814,7 +814,7 @@ void cd_erase_item(short dlog_num, short item_num, Boolean just_label){
if (cd_get_indices(dlog_num,item_num,&dlg_index,&item_index) < 0)
return;
to_fry = items[item_index].rect;
if (just_label == TRUE) {
if (just_label == true) {
if (items[item_index].label != 0) {
store_label = items[item_index].label;
if (store_label >= 1000)
@@ -849,7 +849,7 @@ void cd_erase_item(short dlog_num, short item_num, Boolean just_label){
InsetRect(&to_fry,-1,-1);
}
if (dlgs[dlg_index].draw_ready == FALSE) {
if (dlgs[dlg_index].draw_ready == false) {
return;
}
GetPort(&old_port);
@@ -864,7 +864,7 @@ void cd_erase_rect(short dlog_num,Rect to_fry){
if ((dlg_index = cd_get_dlg_index(dlog_num)) < 0)
return;
if (dlgs[dlg_index].draw_ready == FALSE)
if (dlgs[dlg_index].draw_ready == false)
return;
GetPort(&old_port);
@@ -914,7 +914,7 @@ void cd_press_button(short dlog_num, short item_num){
text_short_str[item_index - 10]),1,8,false);
}
if (play_sounds == TRUE) {
if (play_sounds == true) {
play_sound(37);
Delay(6,&dummy);
}
@@ -982,7 +982,7 @@ void cd_register_default_event_filter(dlg_filter_t filter){
event_filters[0] = filter;
}
pascal Boolean cd_event_filter (DialogPtr hDlg, EventRecord *event, short *dummy_item_hit){
pascal bool cd_event_filter (DialogPtr hDlg, EventRecord *event, short *dummy_item_hit){
char chr,chr2;
short wind_hit,item_hit;
Point the_point;
@@ -996,16 +996,16 @@ pascal Boolean cd_event_filter (DialogPtr hDlg, EventRecord *event, short *dummy
w = GetDialogWindow(hDlg);
rgn = NewRgn();
GetWindowRegion(w,kWindowUpdateRgn,rgn);
if (EmptyRgn(rgn) == TRUE) {
if (EmptyRgn(rgn) == true) {
DisposeRgn(rgn);
return FALSE;
return false;
}
DisposeRgn(rgn);
BeginUpdate(w);
cd_redraw(w);
EndUpdate(w);
DrawDialog(hDlg);
return TRUE;
return true;
break;
case keyDown:
@@ -1123,8 +1123,8 @@ pascal Boolean cd_event_filter (DialogPtr hDlg, EventRecord *event, short *dummy
// }
if (wind_hit < 0)
return FALSE;
else return TRUE;
return false;
else return true;
}
void cd_set_bg_pat_num(short n){

View File

@@ -117,13 +117,13 @@ void cd_initial_draw(short dlog_num);
void cd_draw(short dlog_num);
void cd_redraw(WindowPtr window);
void cd_frame_item(short dlog_num, short item_num, short width);
void cd_erase_item(short dlog_num, short item_num, Boolean just_label = FALSE);
void cd_erase_item(short dlog_num, short item_num, bool just_label = false);
void cd_erase_rect(short dlog_num,Rect to_fry);
void cd_press_button(short dlog_num, short item_num);
bool dialog_not_toast();
void toast_dialog();
void untoast_dialog();
pascal Boolean cd_event_filter (DialogPtr hDlg, EventRecord *event, short *dummy_item_hit);
pascal bool cd_event_filter (DialogPtr hDlg, EventRecord *event, short *dummy_item_hit);
short cd_run_dialog();
void cd_register_event_filter(short id, dlg_filter_t filter);
void cd_register_default_event_filter(dlg_filter_t filter);

View File

@@ -56,7 +56,7 @@ short cd_create_custom_dialog(WindowPtr parent, Str255 strs[6],short pic_num,sho
dlgs[free_slot].key = current_key;
dlgs[free_slot].type = 900;
dlgs[free_slot].highest_item = 1;
dlgs[free_slot].draw_ready = FALSE;
dlgs[free_slot].draw_ready = false;
dlgs[free_slot].win = NULL;
// first, create dummy dlog
@@ -178,8 +178,8 @@ short cd_create_custom_dialog(WindowPtr parent, Str255 strs[6],short pic_num,sho
}
}
//MoveWindow(dlgs[free_slot].win,(windRect.right - win_width) / 2,(windRect.bottom - win_width) / 2 + 20,FALSE);
SizeWindow(dlgs[free_slot].win,win_width,win_height,FALSE);
//MoveWindow(dlgs[free_slot].win,(windRect.right - win_width) / 2,(windRect.bottom - win_width) / 2 + 20,false);
SizeWindow(dlgs[free_slot].win,win_width,win_height,false);
ShowWindow(dlgs[free_slot].win);
SetPort(GetWindowPort(dlgs[free_slot].win));
@@ -321,7 +321,7 @@ void display_strings(char *text1, char *text2,
short item_hit;
Str255 sign_text;
location view_loc;
Boolean sound_done = FALSE;
bool sound_done = false;
//make_cursor_sword();

View File

@@ -108,7 +108,7 @@ FSSpecPtr nav_get_scenario(){
FSSpecPtr file_to_load;
NavGetFile(NULL,&s_reply,NULL,NULL,NULL,NULL,NULL,NULL);
if (s_reply.validRecord == FALSE)
if (s_reply.validRecord == false)
return NULL;
AEGetNthPtr(&s_reply.selection,1,typeFSS,&keyword,&descType,file_to_load,sizeof(FSSpec),&actualSize);
@@ -173,15 +173,15 @@ bool load_scenario(FSSpec file_to_load){
if ((scenario.format.flag1 == 10) && (scenario.format.flag2 == 20) &&
(scenario.format.flag3 == 30) && (scenario.format.flag4 == 40)) {
cur_scen_is_mac = true;
file_ok = TRUE;
file_ok = true;
}
else if ((scenario.format.flag1 == 20) && (scenario.format.flag2 == 40) &&
(scenario.format.flag3 == 60) && (scenario.format.flag4 == 80)) {
SysBeep(20);
cur_scen_is_mac = FALSE;
file_ok = TRUE;
cur_scen_is_mac = false;
file_ok = true;
}
if (file_ok == FALSE) {
if (file_ok == false) {
FSClose(file_id);
give_error("This is not a legitimate Blades of Exile scenario.","",0);
return false;
@@ -217,7 +217,7 @@ bool load_scenario(FSSpec file_to_load){
// code for master
/*
for (i = 0; i < 30000; i++) {
if (check_p(i) == TRUE) {
if (check_p(i) == true) {
user_given_password = i;
i = 30000;
}
@@ -227,13 +227,13 @@ bool load_scenario(FSSpec file_to_load){
/* Now check password
if (check_p(0) == FALSE) {
if (check_p(0) == false) {
user_given_password = enter_password();
if (check_p(user_given_password) == FALSE) {
if (check_p(user_given_password) == false) {
fancy_choice_dialog(868,0);
if (overall_mode != 61) {
user_given_password = enter_password();
if (check_p(user_given_password) == FALSE)
if (check_p(user_given_password) == false)
ExitToShell();
}
else return;
@@ -244,13 +244,13 @@ bool load_scenario(FSSpec file_to_load){
//given_password = user_given_password;
scenario.ter_types[23].fly_over = FALSE;
scenario.ter_types[23].fly_over = false;
delete temp_scenario;
delete item_data;
//store_file_reply = file_to_load;
// overall_mode = 60;
// change_made = FALSE;
// change_made = false;
// if(!load_town(scenario.last_town_edited)) return false;
// //load_town(0);
// if(!load_outdoors(scenario.last_out_edited,0)) return false;
@@ -1100,7 +1100,7 @@ void save_party(FSSpec dest_file)
// NavReplyRecord reply;
// OSErr error;
// short file_id;
// Boolean town_save = FALSE;
// bool town_save = false;
// Str63 store_name;
// FSSpec to_load;
//
@@ -1122,15 +1122,15 @@ void save_party(FSSpec dest_file)
//
// char *party_encryptor;
//
// if ((in_startup_mode == FALSE) && (is_town()))
// town_save = TRUE;
// if ((in_startup_mode == false) && (is_town()))
// town_save = true;
//
// strcpy ((char *) store_name, (char *) last_load_file);
//
//
// if ((mode == 1) || (loaded_yet == FALSE)) {
// if ((mode == 1) || (loaded_yet == false)) {
// NavPutFile(NULL,&reply,NULL,NULL,'beSV','blx!',NULL);
// if (reply.validRecord == FALSE)
// if (reply.validRecord == false)
// return;
//
// AEKeyword keyword;
@@ -1138,7 +1138,7 @@ void save_party(FSSpec dest_file)
// Size actualSize;
//
// AEGetNthPtr(&reply.selection,1,typeFSS,&keyword,&descType,&to_load,sizeof(FSSpec),&actualSize);
// loaded_yet = TRUE;
// loaded_yet = true;
// }
// else to_load = store_file_reply;
//
@@ -1161,20 +1161,20 @@ void save_party(FSSpec dest_file)
//
// len = sizeof(flag_type);
//
// flag.i = (town_save == TRUE) ? 1342 : 5790;
// flag.i = (town_save == true) ? 1342 : 5790;
// if ((error = FSWrite(file_id, &len, (char *) store)) != 0){
// add_string_to_buf("Save: Couldn't write to file. ");
// FSClose(file_id);
// SysBeep(2);
// }
// flag.i = (in_startup_mode == FALSE) ? 100 : 200;
// flag.i = (in_startup_mode == false) ? 100 : 200;
// if ((error = FSWrite(file_id, &len, (char *) store)) != 0) {
// add_string_to_buf("Save: Couldn't write to file. ");
// FSClose(file_id);
// SysBeep(2);
// return;
// }
// flag.i = (save_maps == TRUE) ? 5567 : 3422;
// flag.i = (save_maps == true) ? 5567 : 3422;
// if ((error = FSWrite(file_id, &len, (char *) store)) != 0){
// add_string_to_buf("Save: Couldn't write to file. ");
// FSClose(file_id);
@@ -1232,7 +1232,7 @@ void save_party(FSSpec dest_file)
// party_encryptor[count] ^= 0x6B;
// }
//
// if (in_startup_mode == FALSE) {
// if (in_startup_mode == false) {
//
// // SAVE OUT DATA
// len = sizeof(out_info_type);
@@ -1243,7 +1243,7 @@ void save_party(FSSpec dest_file)
// return;
// }
//
// if (town_save == TRUE) {
// if (town_save == true) {
// town_ptr = &c_town;
// len = sizeof(current_town_type);
// if ((error = FSWrite(file_id, &len, (char *) town_ptr)) != 0) {
@@ -1283,7 +1283,7 @@ void save_party(FSSpec dest_file)
// }
//
// // If saving maps, save maps
// if (save_maps == TRUE) {
// if (save_maps == true) {
// maps_ptr = &(town_maps);
// len = (long) sizeof(stored_town_maps_type);
// if ((error = FSWrite(file_id, &len, (char *) maps_ptr)) != 0){
@@ -1327,6 +1327,6 @@ void save_party(FSSpec dest_file)
// SysBeep(2);
// return;
// }
// if (in_startup_mode == FALSE)
// if (in_startup_mode == false)
// add_string_to_buf("Save: Game saved. ");
}

View File

@@ -111,7 +111,7 @@ GWorldPtr load_pict(int picture_to_get)
offPMHandle = GetGWorldPixMap (myGWorld);
good = LockPixels (offPMHandle);
if (good == FALSE) {
if (good == false) {
SysBeep(50);
}
SetRect (&pic_rect, 0, 0, pic_wd, pic_hgt);
@@ -150,10 +150,10 @@ GWorldPtr load_bmp(unsigned char *data, long length){
cur++;
colourTable[i] = (red << 16) + (green << 8) + blue;
}
indexed = TRUE;
indexed = true;
}
else if (bitCount == 24) {
indexed = FALSE;
indexed = false;
}
else {
return NULL;
@@ -314,7 +314,7 @@ void win_draw_string(GrafPtr dest_window,Rect dest_rect,Str255 str,short mode,sh
short last_line_break = 0,last_word_break = 0,on_what_line = 0;
short text_len[257];
short total_width = 0;
Boolean end_loop,force_skip = FALSE;
bool end_loop,force_skip = false;
KeyMap key_state;
long dummy3;
//RgnHandle current_clip;
@@ -360,7 +360,7 @@ void win_draw_string(GrafPtr dest_window,Rect dest_rect,Str255 str,short mode,sh
&& (last_word_break > last_line_break)) || (c_str[i] == '|')) {
if (c_str[i] == '|') {
c_str[i] = ' ';
force_skip = TRUE;
force_skip = true;
}
sprintf((char *)str_to_draw,"%s",(char *)null_s);
strncpy ((char *) str_to_draw,(char *) c_str + last_line_break,(size_t) (last_word_break - last_line_break - 1));
@@ -372,8 +372,8 @@ void win_draw_string(GrafPtr dest_window,Rect dest_rect,Str255 str,short mode,sh
on_what_line++;
MoveTo(dest_rect.left + 1 + adjust_x, dest_rect.top + 1 + line_height * on_what_line + adjust_y + 9);
last_line_break = last_word_break;
if (force_skip == TRUE) {
force_skip = FALSE;
if (force_skip == true) {
force_skip = false;
i++;
last_line_break++;
last_word_break++;
@@ -439,7 +439,7 @@ short string_length(char *str){ // Why not just use strlen?
return total_width;
}
/*OSStatus flip_pict(OSType domain, OSType type, short id, void *ptr, UInt32 size, Boolean isNative, void *refcon){
/*OSStatus flip_pict(OSType domain, OSType type, short id, void *ptr, UInt32 size, bool isNative, void *refcon){
//PicHandle
PicPtr toFlip = (PicPtr) ptr;
@@ -479,7 +479,7 @@ void draw_terrain(){
for (r = 0; r < 9; r++)
{
where_draw.x = q; where_draw.y = r;
if (editing_town == TRUE) {
if (editing_town == true) {
t_to_draw = t_d.terrain[cen_x + q - 4][cen_y + r - 4];
}
else {
@@ -501,7 +501,7 @@ void draw_terrain(){
OffsetRect(&tiny_to,28 * q, 36 * r);
// draw start icon, if starting point
if ((editing_town == TRUE) &&
if ((editing_town == true) &&
(cur_town == scenario.which_town_start) && (scenario.where_start.x == cen_x + q - 4)
&& (scenario.where_start.y == cen_y + r - 4)) {
from_rect = start_button_from;
@@ -510,7 +510,7 @@ void draw_terrain(){
rect_draw_some_item(editor_mixed,from_rect,ter_draw_gworld,to_rect,0,0);
OffsetRect(&tiny_to,0,-7);
}
if ((editing_town == FALSE)
if ((editing_town == false)
&& (scenario.out_sec_start.x == cur_out.x)
&& (scenario.out_sec_start.y == cur_out.y)
&& (scenario.out_start.x == cen_x + q - 4)
@@ -533,7 +533,7 @@ void draw_terrain(){
OffsetRect(&tiny_to,0,-7);
}
if (is_special(cen_x + q - 4,cen_y + r - 4) == TRUE) {
if (is_special(cen_x + q - 4,cen_y + r - 4) == true) {
tiny_from = base_small_button_from;
OffsetRect(&tiny_from,7 * (7),7 * (0));
rect_draw_some_item(editor_mixed,tiny_from,ter_draw_gworld,tiny_to,0,0);
@@ -545,9 +545,9 @@ void draw_terrain(){
rect_draw_some_item(editor_mixed,tiny_from,ter_draw_gworld,tiny_to,0,0);
OffsetRect(&tiny_to,0,-7);
}
//if (is_s_d(cen_x + q - 4,cen_y + r - 4) == TRUE) {
//if (is_s_d(cen_x + q - 4,cen_y + r - 4) == true) {
// }
if (editing_town == FALSE) {
if (editing_town == false) {
for (i = 0; i < 4; i++)
if ((cen_x + q - 4 == current_terrain.wandering_locs[i].x) &&
(cen_y + r - 4 == current_terrain.wandering_locs[i].y)) {
@@ -560,7 +560,7 @@ void draw_terrain(){
}
if (editing_town == TRUE) {
if (editing_town == true) {
for (i = 0; i < 30; i++) {
if ((scenario.scen_boats[i].which_town == cur_town) &&
(scenario.scen_boats[i].boat_loc.x == cen_x + q - 4) &&
@@ -595,27 +595,27 @@ void draw_terrain(){
OffsetRect(&tiny_to,0,-7);
i = 4;
}
if (is_web(cen_x + q - 4,cen_y + r - 4) == TRUE) {
if (is_web(cen_x + q - 4,cen_y + r - 4) == true) {
from_rect = calc_rect(5,0);
Draw_Some_Item(field_gworld,from_rect,ter_draw_gworld,where_draw,1,0);
}
if (is_crate(cen_x + q - 4,cen_y + r - 4) == TRUE) {
if (is_crate(cen_x + q - 4,cen_y + r - 4) == true) {
from_rect = calc_rect(6,0);
Draw_Some_Item(field_gworld,from_rect,ter_draw_gworld,where_draw,1,0);
}
if (is_barrel(cen_x + q - 4,cen_y + r - 4) == TRUE) {
if (is_barrel(cen_x + q - 4,cen_y + r - 4) == true) {
from_rect = calc_rect(7,0);
Draw_Some_Item(field_gworld,from_rect,ter_draw_gworld,where_draw,1,0);
}
if (is_fire_barrier(cen_x + q - 4,cen_y + r - 4) == TRUE) {
if (is_fire_barrier(cen_x + q - 4,cen_y + r - 4) == true) {
from_rect = calc_rect(0,2);
Draw_Some_Item(field_gworld,from_rect,ter_draw_gworld,where_draw,1,0);
}
if (is_quickfire(cen_x + q - 4,cen_y + r - 4) == TRUE) {
if (is_quickfire(cen_x + q - 4,cen_y + r - 4) == true) {
from_rect = calc_rect(7,1);
Draw_Some_Item(field_gworld,from_rect,ter_draw_gworld,where_draw,1,0);
}
if (is_force_barrier(cen_x + q - 4,cen_y + r - 4) == TRUE) {
if (is_force_barrier(cen_x + q - 4,cen_y + r - 4) == true) {
from_rect = calc_rect(2,2);
Draw_Some_Item(field_gworld,from_rect,ter_draw_gworld,where_draw,1,0);
}
@@ -635,7 +635,7 @@ void draw_terrain(){
}
}
if (editing_town == TRUE) {
if (editing_town == true) {
draw_monsts();
draw_items();
}
@@ -643,7 +643,7 @@ void draw_terrain(){
SetPort( ter_draw_gworld);
ClipRect(&clipping_rect);
if (editing_town == TRUE) {
if (editing_town == true) {
// draw info rects
for (i = 0; i < 16; i++)
if (t_d.room_rect[i].left > 0) {
@@ -664,7 +664,7 @@ void draw_terrain(){
FrameRect(&draw_rect);
ForeColor(blackColor);
}
if (editing_town == FALSE) {
if (editing_town == false) {
// draw info rects
for (i = 0; i < 8; i++)
if (current_terrain.info_rect[i].left > 0) {
@@ -680,28 +680,28 @@ void draw_terrain(){
ClipRect(&terrain_rect);
SetPortWindowPort(mainPtr);
small_any_drawn = FALSE;
small_any_drawn = false;
//if (cur_viewing_mode == 0)
// draw_frames();
}
if (cur_viewing_mode == 1) {
SetPort( ter_draw_gworld);
if (small_any_drawn == FALSE) {
if (small_any_drawn == false) {
FillCRect(&terrain_rect,bg[6]);
FrameRect(&terrain_rect);
}
for (q = 0; q < ((editing_town == TRUE) ? max_dim[town_type] : 48); q++)
for (r = 0; r < ((editing_town == TRUE) ? max_dim[town_type] : 48); r++) {
t_to_draw = (editing_town == TRUE) ? t_d.terrain[q][r] :
for (q = 0; q < ((editing_town == true) ? max_dim[town_type] : 48); q++)
for (r = 0; r < ((editing_town == true) ? max_dim[town_type] : 48); r++) {
t_to_draw = (editing_town == true) ? t_d.terrain[q][r] :
current_terrain.terrain[q][r];
if ((small_what_drawn[q][r] != t_to_draw) || (small_any_drawn == FALSE)) {
if ((small_what_drawn[q][r] != t_to_draw) || (small_any_drawn == false)) {
draw_one_tiny_terrain_spot(q,r,t_to_draw);
small_what_drawn[q][r] = t_to_draw;
}
}
SetPortWindowPort(mainPtr);
small_any_drawn = TRUE;
small_any_drawn = true;
}
//draw_cur_string();

View File

@@ -22,7 +22,7 @@ void char_win_draw_string(WindowPtr dest_window,Rect dest_rect,char *str,short m
void char_port_draw_string(GrafPtr dest_window,Rect dest_rect,char *str,short mode,short line_height,bool main_win);
void win_draw_string(GrafPtr dest_window,Rect dest_rect,Str255 str,short mode,short line_height,bool main_win);
short string_length(char *str);
//OSStatus flip_pict(OSType domain, OSType type, short id, void *ptr, UInt32 size, Boolean isNative, void *refcon);
//OSStatus flip_pict(OSType domain, OSType type, short id, void *ptr, UInt32 size, bool isNative, void *refcon);
//void draw_terrain();
Rect calc_rect(short i, short j);
Rect get_custom_rect (short which_rect);

View File

@@ -69,13 +69,13 @@ char numchannel = 3;
char channel;
short snd_played[4] = {-1,-1,-1,-1};
Boolean sound_going(short which_s) {
bool sound_going(short which_s) {
short i;
for (i = 0; i < 4; i++)
if (snd_played[i] == which_s)
return TRUE;
return FALSE;
return true;
return false;
}
pascal void snd_channel_callback(SndChannelPtr theChannel,SndCommand* theCommand) {
@@ -91,11 +91,11 @@ pascal void snd_channel_callback(SndChannelPtr theChannel,SndCommand* theCommand
channel = i;
which_sound = snd_played[channel];
snd_played[channel] = -1;
//if (in_startup_mode == FALSE)
//if (in_startup_mode == false)
// print_num(0,snd_played[channel],channel);
if ((sound_going(which_sound) == FALSE) && (load_when_play[which_sound] == TRUE)) {
if ((sound_going(which_sound) == false) && (load_when_play[which_sound] == true)) {
HUnlock(sound_handles[which_sound]);
//if (in_startup_mode == FALSE)
//if (in_startup_mode == false)
// print_num(99,snd_played[channel],channel);
}
@@ -175,7 +175,7 @@ void play_sound(short which, short how_many_times){ // if < 0, play asynch
#ifdef EXILE_BIG_GUNS
theCommand.param2 = 0;
#endif
SndDoCommand(chan[channel],&theCommand,TRUE);
SndDoCommand(chan[channel],&theCommand,true);
}
else SysBeep(20);
if (which < 0)
@@ -197,5 +197,5 @@ void clear_sound_memory(){
void flip_sound()
{
play_sounds = (play_sounds == TRUE) ? FALSE : TRUE;
play_sounds = (play_sounds == true) ? false : true;
}

View File

@@ -171,7 +171,7 @@ void Initialize(void)
void display_strings_event_filter (short item_hit)////
{
short i;
Boolean had1 = FALSE, had2 = FALSE;
bool had1 = false, had2 = false;
switch (item_hit) {
case 1: