- Cleaned out some of the compiler warnings in the scenario editor (removing unused variables mostly).
- Finally removed the grow box in the corner of the scenario editor window. - Changed #include <iostream> in several headers to #include <iosfwd>, since they were only present for the use of the ostream and istream classes, and cout/cin were unneeded. - Changed bool to Boolean in the old structs, since that's what it was originally. - Small changes to graphtool, including an overload of get_custom_rect. - Added gcd function to mathutil; was needed for something in the new dialog engine git-svn-id: http://openexile.googlecode.com/svn/trunk@71 4ebdad44-0ea0-11de-aab3-ff745001d230
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 6.4 MiB After Width: | Height: | Size: 6.6 MiB |
@@ -125,7 +125,7 @@ void init_current_terrain() {
|
||||
}
|
||||
|
||||
void init_screen_locs() {
|
||||
int i,j,q,r;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 4; i++)
|
||||
border_rect[i] = world_screen;
|
||||
@@ -142,11 +142,10 @@ void init_screen_locs() {
|
||||
}
|
||||
|
||||
bool handle_action(Point the_point,EventRecord event) {
|
||||
short i,j, x, y;
|
||||
short i,j, x;
|
||||
bool are_done = false;
|
||||
Str255 str,s2;
|
||||
Str255 s2;
|
||||
|
||||
Rect targ_rect;
|
||||
bool need_redraw = false,option_hit = false;
|
||||
location spot_hit;
|
||||
Point cur_point,cur_point2;
|
||||
@@ -472,7 +471,7 @@ bool handle_action(Point the_point,EventRecord event) {
|
||||
for (x = 0; x < 16; x++)
|
||||
if (town->room_rect(x).right == 0) {
|
||||
town->room_rect(x) = working_rect;
|
||||
sprintf(town->town_strs(x + 1),"");
|
||||
strcpy(town->town_strs(x + 1),"");
|
||||
if (edit_area_rect_str(x,1) == false)
|
||||
town->room_rect(x).right = 0;
|
||||
x = 500;
|
||||
@@ -482,7 +481,7 @@ bool handle_action(Point the_point,EventRecord event) {
|
||||
for (x = 0; x < 8; x++)
|
||||
if (current_terrain.info_rect[x].right == 0) {
|
||||
current_terrain.info_rect[x] = working_rect;
|
||||
sprintf(current_terrain.out_strs(x + 1),"");
|
||||
strcpy(current_terrain.out_strs(x + 1),"");
|
||||
if (edit_area_rect_str(x,0) == false)
|
||||
current_terrain.info_rect[x].right = 0;
|
||||
x = 500;
|
||||
@@ -588,11 +587,11 @@ bool handle_action(Point the_point,EventRecord event) {
|
||||
overall_mode = MODE_DRAWING;
|
||||
set_cursor(0);
|
||||
break;
|
||||
case 7: // edit_monst does nothing at all, but I think this would otherwise be the same as mode 39
|
||||
edit_monst(1,spot_hit.x,spot_hit.y);
|
||||
overall_mode = MODE_DRAWING;
|
||||
set_cursor(0);
|
||||
break;
|
||||
// case 7: // edit_monst does nothing at all, but I think this would otherwise be the same as mode 39
|
||||
// edit_monst(1,spot_hit.x,spot_hit.y);
|
||||
// overall_mode = MODE_DRAWING;
|
||||
// set_cursor(0);
|
||||
// break;
|
||||
case MODE_PLACE_SAME_CREATURE:
|
||||
if (last_placed_monst.number == 0) {
|
||||
give_error("Either no monster has been placed, or the last time you tried to place a monster the operation failed.","",0);
|
||||
@@ -1240,8 +1239,6 @@ bool handle_action(Point the_point,EventRecord event) {
|
||||
|
||||
|
||||
void flash_rect(Rect to_flash) {
|
||||
RGBColor test_color, store_color;
|
||||
int i;
|
||||
unsigned long dummy;
|
||||
|
||||
InvertRect (&to_flash);
|
||||
@@ -1446,23 +1443,23 @@ void handle_keystroke(char chr,char chr2,EventRecord event) {
|
||||
|
||||
|
||||
|
||||
void get_wandering_monst() {
|
||||
}
|
||||
|
||||
void get_town_info() {
|
||||
}
|
||||
|
||||
void edit_monst(short mode,short x,short y) {
|
||||
//mode; // 1 - place/edit 2 - place same
|
||||
}
|
||||
|
||||
|
||||
void get_sign_resource() {
|
||||
}
|
||||
|
||||
|
||||
void set_info_strings() {
|
||||
}
|
||||
//void get_wandering_monst() {
|
||||
//}
|
||||
//
|
||||
//void get_town_info() {
|
||||
//}
|
||||
//
|
||||
//void edit_monst(short mode,short x,short y) {
|
||||
// //mode; // 1 - place/edit 2 - place same
|
||||
//}
|
||||
//
|
||||
//
|
||||
//void get_sign_resource() {
|
||||
//}
|
||||
//
|
||||
//
|
||||
//void set_info_strings() {
|
||||
//}
|
||||
|
||||
|
||||
|
||||
@@ -1513,7 +1510,7 @@ void modify_lists() {
|
||||
void set_up_lights() {
|
||||
short i,j,rad;
|
||||
location where,l;
|
||||
location light_locs[40];
|
||||
//location light_locs[40];
|
||||
short num_lights = 0;
|
||||
bool where_lit[64][64];
|
||||
|
||||
@@ -1552,9 +1549,9 @@ void set_up_lights() {
|
||||
|
||||
|
||||
bool is_wall(short i,short j) {
|
||||
unsigned short ter,walls[3] = {77,77,224};
|
||||
unsigned short ter;
|
||||
bool answer = false;
|
||||
short k,pic;
|
||||
short pic;
|
||||
|
||||
ter = (editing_town == true) ? town->terrain(i,j) : current_terrain.terrain[i][j];
|
||||
pic = scenario.ter_types[ter].picture;
|
||||
@@ -1600,7 +1597,7 @@ bool is_correctable_wall(short i,short j) {
|
||||
|
||||
bool is_mountain(short i,short j) {
|
||||
bool answer = false;
|
||||
short k,pic;
|
||||
short pic;
|
||||
unsigned short ter;
|
||||
|
||||
ter = (editing_town == true) ? town->terrain(i,j) : current_terrain.terrain[i][j];
|
||||
@@ -1622,7 +1619,7 @@ bool is_mountain(short i,short j) {
|
||||
}
|
||||
bool is_hill(short i,short j) {
|
||||
bool answer = false;
|
||||
short k,pic;
|
||||
short pic;
|
||||
unsigned short ter;
|
||||
|
||||
ter = (editing_town == true) ? town->terrain(i,j) : current_terrain.terrain[i][j];
|
||||
@@ -1652,7 +1649,7 @@ bool is_hill_or_mountain(short i,short j) {
|
||||
}
|
||||
bool is_erasable_water(short i,short j) {
|
||||
bool answer = false;
|
||||
short k,pic;
|
||||
short pic;
|
||||
unsigned short ter;
|
||||
|
||||
ter = (editing_town == true) ? town->terrain(i,j) : current_terrain.terrain[i][j];
|
||||
@@ -1669,7 +1666,7 @@ bool is_erasable_water(short i,short j) {
|
||||
}
|
||||
bool is_water(short i,short j) {
|
||||
bool answer = false;
|
||||
short k,pic;
|
||||
short pic;
|
||||
unsigned short ter;
|
||||
|
||||
ter = (editing_town == true) ? town->terrain(i,j) : current_terrain.terrain[i][j];
|
||||
@@ -1686,7 +1683,7 @@ bool is_water(short i,short j) {
|
||||
}
|
||||
bool is_correctable_water(short i,short j) {
|
||||
bool answer = false;
|
||||
short k,pic;
|
||||
short pic;
|
||||
unsigned short ter;
|
||||
|
||||
ter = (editing_town == true) ? town->terrain(i,j) : current_terrain.terrain[i][j];
|
||||
@@ -3287,9 +3284,6 @@ void shut_down_menus(short mode) {
|
||||
}
|
||||
|
||||
void start_terrain_editing() {
|
||||
short i;
|
||||
Str255 str;
|
||||
|
||||
HideControl(right_sbar);
|
||||
overall_mode = MODE_EDIT_TYPES;
|
||||
set_up_terrain_buttons();
|
||||
@@ -3538,7 +3532,7 @@ bool save_check(short which_dlog) {
|
||||
|
||||
void update_item_menu() {
|
||||
short i,j;
|
||||
MenuHandle item_menu[5],mon_menu[4],block_menu;
|
||||
MenuHandle item_menu[5],mon_menu[4];
|
||||
Str255 item_name;
|
||||
|
||||
for (i = 0; i < 5; i++)
|
||||
@@ -3691,8 +3685,6 @@ short can_see(location p1,location p2,short mode) {
|
||||
}
|
||||
|
||||
bool monst_on_space(location loc,short m_num) {
|
||||
short i,j;
|
||||
|
||||
if (editing_town == false)
|
||||
return false;
|
||||
if (town->creatures(m_num).number == 0)
|
||||
|
||||
@@ -48,7 +48,7 @@ void init_lb() {
|
||||
short i;
|
||||
for (i = 0; i < NLS; i++) {
|
||||
left_button_status[i] = 0;
|
||||
sprintf((char *) strings_ls[i], "");
|
||||
strcpy((char *) strings_ls[i], "");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -92,7 +92,7 @@ void init_rb() {
|
||||
SetControlValue(right_sbar,0);
|
||||
for (i = 0; i < NRS; i++) {
|
||||
right_button_status[i] = 0;
|
||||
sprintf((char *) strings_rs[i], "");
|
||||
strcpy((char *) strings_rs[i], "");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1045,7 +1045,7 @@ void edit_ter_type_event_filter (short item_hit) {
|
||||
|
||||
short edit_ter_type(short which_ter) {
|
||||
// ignore parent in Mac version
|
||||
short item_hit,i,store_dialog_answer;
|
||||
short item_hit,i;
|
||||
Str255 temp_str;
|
||||
char *blocked_strs[6] = {"Clear","Walk through, Opaque","Clear, Special","Clear, Blocked","Blocked, Obstructed",
|
||||
"Blocked, Opaque"};
|
||||
@@ -1205,7 +1205,6 @@ bool save_monst_info() {
|
||||
}
|
||||
|
||||
void edit_monst_type_event_filter (short item_hit) {
|
||||
Str255 str;
|
||||
short i;
|
||||
cMonster temp_monst;
|
||||
|
||||
@@ -1222,7 +1221,7 @@ void edit_monst_type_event_filter (short item_hit) {
|
||||
case 23: // abils
|
||||
if (save_monst_info() == false) break;
|
||||
temp_monst = edit_monst_abil(store_monst,814);
|
||||
if ((temp_monst.level >= 0) && (temp_monst.level < 255))
|
||||
if (temp_monst.level < 255)
|
||||
store_monst = temp_monst;
|
||||
put_monst_info_in_dlog();
|
||||
break;
|
||||
@@ -1296,8 +1295,7 @@ void edit_monst_type_event_filter (short item_hit) {
|
||||
|
||||
short edit_monst_type(short which_monst) {
|
||||
// ignore parent in Mac version
|
||||
short item_hit,i,store_dialog_answer;
|
||||
Str255 temp_str;
|
||||
short item_hit,i;
|
||||
char *attitude[4] = {"Friendly, Docile","Hostile, Type A","Friendly, Will Fight","Hostile, Type B"};
|
||||
|
||||
store_which_monst = which_monst;
|
||||
@@ -1353,9 +1351,6 @@ void put_monst_abils_in_dlog() {
|
||||
}
|
||||
|
||||
bool save_monst_abils() {
|
||||
Str255 str;
|
||||
short i;
|
||||
|
||||
store_monst2.poison = CDGN(815,2);
|
||||
if (cre(store_monst2.poison,0,8,"Poison must be from 0 to 8.","",815) > 0) return false;
|
||||
store_monst2.breath = CDGN(815,3);
|
||||
@@ -1385,12 +1380,11 @@ bool save_monst_abils() {
|
||||
}
|
||||
|
||||
void edit_monst_abil_event_filter (short item_hit) {
|
||||
Str255 str;
|
||||
short i;
|
||||
|
||||
switch (item_hit) {
|
||||
case 8:
|
||||
store_monst2.level = -1;
|
||||
store_monst2.level = 255;
|
||||
toast_dialog();
|
||||
break;
|
||||
case 7:
|
||||
@@ -1425,8 +1419,7 @@ void edit_monst_abil_event_filter (short item_hit) {
|
||||
|
||||
cMonster edit_monst_abil(cMonster starting_record,short parent_num) {
|
||||
// ignore parent in Mac version
|
||||
short item_hit,i,store_dialog_answer;
|
||||
Str255 temp_str;
|
||||
short item_hit;
|
||||
|
||||
//store_which_monst = which_monst;
|
||||
store_monst2 = starting_record;
|
||||
@@ -1460,8 +1453,6 @@ cMonster edit_monst_abil(cMonster starting_record,short parent_num) {
|
||||
}
|
||||
|
||||
void put_item_info_in_dlog() {
|
||||
Str255 str;
|
||||
|
||||
cdsin(818,52,store_which_item);
|
||||
CDST(818,2,store_item.full_name.c_str());
|
||||
CDST(818,3,store_item.name.c_str());
|
||||
@@ -1485,7 +1476,6 @@ void put_item_info_in_dlog() {
|
||||
|
||||
bool save_item_info() {
|
||||
Str255 str;
|
||||
short i;
|
||||
|
||||
CDGT(818,2,(char *) str);
|
||||
str[24] = 0;
|
||||
@@ -1538,7 +1528,6 @@ bool save_item_info() {
|
||||
}
|
||||
|
||||
void edit_item_type_event_filter (short item_hit) {
|
||||
Str255 str;
|
||||
short i;
|
||||
cItemRec temp_item;
|
||||
|
||||
@@ -1599,8 +1588,7 @@ void edit_item_type_event_filter (short item_hit) {
|
||||
|
||||
short edit_item_type(short which_item) {
|
||||
// ignore parent in Mac version
|
||||
short item_hit,i,store_dialog_answer;
|
||||
Str255 temp_str;
|
||||
short item_hit,i;
|
||||
|
||||
store_which_item = which_item;
|
||||
store_item = scenario.scen_items[store_which_item];
|
||||
@@ -1626,7 +1614,6 @@ short edit_item_type(short which_item) {
|
||||
|
||||
void put_item_abils_in_dlog() {
|
||||
Str255 str;
|
||||
short i;
|
||||
|
||||
cdsin(824,16,store_which_item);
|
||||
csit(824,32,store_item2.full_name.c_str());
|
||||
@@ -1652,9 +1639,6 @@ void put_item_abils_in_dlog() {
|
||||
}
|
||||
|
||||
bool save_item_abils() {
|
||||
Str255 str;
|
||||
short i;
|
||||
|
||||
store_item2.magic_use_type = cd_get_led_range(824,5,8);
|
||||
store_item2.treas_class = cd_get_led_range(824,26,30);
|
||||
store_item2.ability_strength = CDGN(824,2);
|
||||
@@ -1671,7 +1655,6 @@ bool save_item_abils() {
|
||||
}
|
||||
|
||||
void edit_item_abil_event_filter (short item_hit) {
|
||||
Str255 str;
|
||||
short i;
|
||||
|
||||
switch (item_hit) {
|
||||
@@ -1763,8 +1746,7 @@ void edit_item_abil_event_filter (short item_hit) {
|
||||
|
||||
cItemRec edit_item_abil(cItemRec starting_record,short parent_num) {
|
||||
// ignore parent in Mac version
|
||||
short item_hit,i,store_dialog_answer;
|
||||
Str255 temp_str;
|
||||
short item_hit;
|
||||
|
||||
//store_which_item = which_item;
|
||||
store_item2 = starting_record;
|
||||
@@ -1796,9 +1778,6 @@ cItemRec edit_item_abil(cItemRec starting_record,short parent_num) {
|
||||
}
|
||||
|
||||
void put_spec_item_in_dlog() {
|
||||
Str255 str;
|
||||
short i;
|
||||
|
||||
cdsin(806,19,store_which_spec_item);
|
||||
CDST(806,2,scenario.scen_strs(60 + store_which_spec_item * 2));
|
||||
CDST(806,3,scenario.scen_strs(60 + store_which_spec_item * 2 + 1));
|
||||
@@ -1813,7 +1792,6 @@ void put_spec_item_in_dlog() {
|
||||
|
||||
bool save_spec_item() {
|
||||
Str255 str;
|
||||
short i;
|
||||
|
||||
CDGT(806,2,(char *) str);
|
||||
str[25] = 0;
|
||||
@@ -1832,8 +1810,7 @@ bool save_spec_item() {
|
||||
}
|
||||
|
||||
void edit_spec_item_event_filter (short spec_item_hit) {
|
||||
Str255 str;
|
||||
short i,spec;
|
||||
short spec;
|
||||
|
||||
switch (spec_item_hit) {
|
||||
case 11:
|
||||
@@ -1887,8 +1864,7 @@ void edit_spec_item_event_filter (short spec_item_hit) {
|
||||
|
||||
void edit_spec_item(short which_item) {
|
||||
// ignore parent in Mac version
|
||||
short spec_item_hit,i,store_dialog_answer;
|
||||
Str255 temp_str;
|
||||
short spec_item_hit;
|
||||
|
||||
//store_which_spec_item = which_spec_item;
|
||||
store_which_spec_item = which_item;
|
||||
@@ -1907,7 +1883,6 @@ void edit_spec_item(short which_item) {
|
||||
}
|
||||
|
||||
void put_save_rects_in_dlog() {
|
||||
Str255 str;
|
||||
short i;
|
||||
|
||||
for (i = 0; i < 3; i++) {
|
||||
@@ -1922,7 +1897,6 @@ void put_save_rects_in_dlog() {
|
||||
}
|
||||
|
||||
bool save_save_rects() {
|
||||
Str255 str;
|
||||
short i;
|
||||
|
||||
for (i = 0; i < 3; i++) {
|
||||
@@ -1952,9 +1926,6 @@ bool save_save_rects() {
|
||||
}
|
||||
|
||||
void edit_save_rects_event_filter (short save_rects_hit) {
|
||||
Str255 str;
|
||||
short i;
|
||||
|
||||
switch (save_rects_hit) {
|
||||
case 18:
|
||||
toast_dialog();
|
||||
@@ -1969,8 +1940,7 @@ void edit_save_rects_event_filter (short save_rects_hit) {
|
||||
|
||||
void edit_save_rects() {
|
||||
// ignore parent in Mac version
|
||||
short save_rects_hit,i,store_dialog_answer;
|
||||
Str255 temp_str;
|
||||
short save_rects_hit;
|
||||
|
||||
cd_create_dialog_parent_num(807,0);
|
||||
|
||||
@@ -1981,7 +1951,6 @@ void edit_save_rects() {
|
||||
}
|
||||
|
||||
bool save_horses() {
|
||||
Str255 str;
|
||||
short i;
|
||||
|
||||
for (i = 0; i < 6; i++) {
|
||||
@@ -2000,7 +1969,6 @@ bool save_horses() {
|
||||
}
|
||||
|
||||
void put_horses_in_dlog() {
|
||||
Str255 str;
|
||||
short i;
|
||||
|
||||
for (i = 0; i < 6; i++) {
|
||||
@@ -2014,7 +1982,6 @@ void put_horses_in_dlog() {
|
||||
}
|
||||
|
||||
void edit_horses_event_filter (short item_hit) {
|
||||
Str255 str;
|
||||
short i;
|
||||
|
||||
switch (item_hit) {
|
||||
@@ -2043,8 +2010,7 @@ void edit_horses_event_filter (short item_hit) {
|
||||
|
||||
void edit_horses() {
|
||||
// ignore parent in Mac version
|
||||
short horses_hit,i,store_dialog_answer;
|
||||
Str255 temp_str;
|
||||
short horses_hit;
|
||||
|
||||
store_horse_page = 0;
|
||||
|
||||
@@ -2057,7 +2023,6 @@ void edit_horses() {
|
||||
}
|
||||
|
||||
bool save_boats() {
|
||||
Str255 str;
|
||||
short i;
|
||||
|
||||
for (i = 0; i < 6; i++) {
|
||||
@@ -2076,7 +2041,6 @@ bool save_boats() {
|
||||
}
|
||||
|
||||
void put_boats_in_dlog() {
|
||||
Str255 str;
|
||||
short i;
|
||||
|
||||
for (i = 0; i < 6; i++) {
|
||||
@@ -2090,7 +2054,6 @@ void put_boats_in_dlog() {
|
||||
}
|
||||
|
||||
void edit_boats_event_filter (short item_hit) {
|
||||
Str255 str;
|
||||
short i;
|
||||
|
||||
switch (item_hit) {
|
||||
@@ -2119,8 +2082,7 @@ void edit_boats_event_filter (short item_hit) {
|
||||
|
||||
void edit_boats() {
|
||||
// ignore parent in Mac version
|
||||
short boats_hit,i,store_dialog_answer;
|
||||
Str255 temp_str;
|
||||
short boats_hit;
|
||||
|
||||
store_boat_page = 0;
|
||||
|
||||
@@ -2133,7 +2095,6 @@ void edit_boats() {
|
||||
}
|
||||
|
||||
bool save_add_town() {
|
||||
Str255 str;
|
||||
short i;
|
||||
|
||||
for (i = 0; i < 10; i++) {
|
||||
@@ -2151,7 +2112,6 @@ bool save_add_town() {
|
||||
}
|
||||
|
||||
void put_add_town_in_dlog() {
|
||||
Str255 str;
|
||||
short i;
|
||||
|
||||
for (i = 0; i < 10; i++) {
|
||||
@@ -2163,9 +2123,6 @@ void put_add_town_in_dlog() {
|
||||
}
|
||||
|
||||
void edit_add_town_event_filter (short item_hit) {
|
||||
Str255 str;
|
||||
short i;
|
||||
|
||||
switch (item_hit) {
|
||||
case 32:
|
||||
if (save_add_town() == true)
|
||||
@@ -2177,8 +2134,7 @@ void edit_add_town_event_filter (short item_hit) {
|
||||
|
||||
void edit_add_town() {
|
||||
// ignore parent in Mac version
|
||||
short add_town_hit,i,store_dialog_answer;
|
||||
Str255 temp_str;
|
||||
short add_town_hit;
|
||||
|
||||
cd_create_dialog_parent_num(810,0);
|
||||
|
||||
@@ -2189,7 +2145,6 @@ void edit_add_town() {
|
||||
}
|
||||
|
||||
bool save_item_placement() {
|
||||
Str255 str;
|
||||
short i;
|
||||
|
||||
store_storage.property = cd_get_led(812,38);
|
||||
@@ -2210,7 +2165,6 @@ bool save_item_placement() {
|
||||
}
|
||||
|
||||
void put_item_placement_in_dlog() {
|
||||
Str255 str;
|
||||
short i;
|
||||
|
||||
cdsin(812,27,cur_shortcut);
|
||||
@@ -2224,7 +2178,6 @@ void put_item_placement_in_dlog() {
|
||||
}
|
||||
|
||||
void edit_item_placement_event_filter (short item_hit) {
|
||||
Str255 str;
|
||||
short i;
|
||||
|
||||
switch (item_hit) {
|
||||
@@ -2270,8 +2223,7 @@ void edit_item_placement_event_filter (short item_hit) {
|
||||
|
||||
void edit_item_placement() {
|
||||
// ignore parent in Mac version
|
||||
short item_placement_hit,i,store_dialog_answer;
|
||||
Str255 temp_str;
|
||||
short item_placement_hit;
|
||||
|
||||
store_storage = scenario.storage_shortcuts[0];
|
||||
cur_shortcut = 0;
|
||||
@@ -2308,9 +2260,6 @@ bool save_scen_details() {
|
||||
}
|
||||
|
||||
void put_scen_details_in_dlog() {
|
||||
Str255 str;
|
||||
short i;
|
||||
|
||||
cd_set_led_range(803,30,33,scenario.difficulty);
|
||||
cd_set_led_range(803,21,24,scenario.rating);
|
||||
CDSN(803,2,scenario.format.ver[0]);
|
||||
@@ -2322,9 +2271,6 @@ void put_scen_details_in_dlog() {
|
||||
}
|
||||
|
||||
void edit_scen_details_event_filter (short item_hit) {
|
||||
Str255 str;
|
||||
short i;
|
||||
|
||||
switch (item_hit) {
|
||||
case 8:
|
||||
if (save_scen_details() == true)
|
||||
@@ -2339,8 +2285,7 @@ void edit_scen_details_event_filter (short item_hit) {
|
||||
|
||||
void edit_scen_details() {
|
||||
// ignore parent in Mac version
|
||||
short scen_details_hit,i,store_dialog_answer;
|
||||
Str255 temp_str;
|
||||
short scen_details_hit;
|
||||
|
||||
cd_create_dialog_parent_num(803,0);
|
||||
|
||||
@@ -2353,9 +2298,6 @@ void edit_scen_details() {
|
||||
|
||||
|
||||
void put_make_scen_1_in_dlog() {
|
||||
Str255 str;
|
||||
short i;
|
||||
|
||||
CDST(800,2,"Scenario name");
|
||||
CDST(800,3,"filename");
|
||||
}
|
||||
@@ -2396,8 +2338,7 @@ void edit_make_scen_1_event_filter (short item_hit) {
|
||||
|
||||
short edit_make_scen_1(char *filename,char *title,short *grass) {
|
||||
// ignore parent in Mac version
|
||||
short make_scen_1_hit,i,store_dialog_answer;
|
||||
Str255 temp_str;
|
||||
short make_scen_1_hit;
|
||||
|
||||
cd_create_dialog_parent_num(800,0);
|
||||
|
||||
@@ -2413,9 +2354,6 @@ short edit_make_scen_1(char *filename,char *title,short *grass) {
|
||||
}
|
||||
|
||||
void put_make_scen_2_in_dlog() {
|
||||
Str255 str;
|
||||
short i;
|
||||
|
||||
CDSN(801,2,1);
|
||||
CDSN(801,3,1);
|
||||
CDSN(801,4,0);
|
||||
@@ -2424,7 +2362,6 @@ void put_make_scen_2_in_dlog() {
|
||||
}
|
||||
|
||||
void edit_make_scen_2_event_filter (short item_hit) {
|
||||
Str255 str;
|
||||
short i,j,k;
|
||||
|
||||
switch (item_hit) {
|
||||
@@ -2463,8 +2400,7 @@ void edit_make_scen_2_event_filter (short item_hit) {
|
||||
|
||||
short edit_make_scen_2(short *val_array) {
|
||||
// ignore parent in Mac version
|
||||
short make_scen_2_hit,i,store_dialog_answer;//array[6];
|
||||
Str255 temp_str;
|
||||
short make_scen_2_hit,i;//array[6];
|
||||
|
||||
//array = val_array;
|
||||
cd_create_dialog_parent_num(801,0);
|
||||
@@ -2567,6 +2503,7 @@ bool build_scenario() {
|
||||
// cur_town = 0;
|
||||
// augment_terrain(cur_out);
|
||||
// update_item_menu();
|
||||
return false;
|
||||
}
|
||||
|
||||
//void user_password_filter (short item_hit) {
|
||||
@@ -2637,8 +2574,7 @@ void set_starting_loc_filter (short item_hit) {
|
||||
|
||||
void set_starting_loc() {
|
||||
// ignore parent in Mac version
|
||||
short town_strs_hit,i,store_dialog_answer;
|
||||
Str255 temp_str,str2;
|
||||
short town_strs_hit;
|
||||
|
||||
cd_create_dialog_parent_num(805,0);
|
||||
|
||||
@@ -2654,7 +2590,6 @@ void set_starting_loc() {
|
||||
}
|
||||
|
||||
bool save_scenario_events() {
|
||||
Str255 str;
|
||||
short i;
|
||||
|
||||
for (i = 0; i < 10; i++) {
|
||||
@@ -2672,7 +2607,6 @@ bool save_scenario_events() {
|
||||
}
|
||||
|
||||
void put_scenario_events_in_dlog() {
|
||||
Str255 str;
|
||||
short i;
|
||||
|
||||
for (i = 0; i < 10; i++) {
|
||||
@@ -2683,8 +2617,7 @@ void put_scenario_events_in_dlog() {
|
||||
}
|
||||
|
||||
void edit_scenario_events_event_filter (short item_hit) {
|
||||
Str255 str;
|
||||
short i,spec;
|
||||
short spec;
|
||||
|
||||
switch (item_hit) {
|
||||
case 22:
|
||||
@@ -2715,8 +2648,7 @@ void edit_scenario_events_event_filter (short item_hit) {
|
||||
|
||||
void edit_scenario_events() {
|
||||
// ignore parent in Mac version
|
||||
short advanced_town_hit,i,store_dialog_answer;
|
||||
Str255 temp_str;
|
||||
short advanced_town_hit;
|
||||
|
||||
|
||||
cd_create_dialog_parent_num(811,0);
|
||||
|
||||
@@ -49,7 +49,6 @@ void load_spec_graphics();
|
||||
|
||||
void init_directories() {
|
||||
short error;
|
||||
char thing[60];
|
||||
// Str255 data_name = "\pExile III data";
|
||||
//
|
||||
// HGetVol((StringPtr) start_name,&start_volume,&start_dir);
|
||||
|
||||
@@ -38,7 +38,7 @@ extern cTown* town;
|
||||
//extern short town_type; // 0 - big 1 - ave 2 - small
|
||||
extern short cur_viewing_mode;
|
||||
extern eScenMode overall_mode;
|
||||
extern eDrawMode draw_mode = DRAW_TERRAIN;
|
||||
eDrawMode draw_mode = DRAW_TERRAIN;
|
||||
extern short available_dlog_buttons[NUM_DLOG_B];
|
||||
extern bool editing_town;
|
||||
//extern short max_dim[3];
|
||||
@@ -350,6 +350,8 @@ short get_small_icon(unsigned short ter){
|
||||
case TER_SPEC_CALL_SPECIAL_WHEN_USED:
|
||||
icon = scenario.ter_types[ter].flag3;
|
||||
break;
|
||||
default:
|
||||
icon = -1;
|
||||
}
|
||||
if(icon == 255) icon = -1;
|
||||
return icon;
|
||||
@@ -444,7 +446,6 @@ void load_main_screen() {
|
||||
Str255 fn1 = "\pGeneva";
|
||||
Str255 fn2 = "\pDungeon Bold";
|
||||
Str255 fn3 = "\pPalatino";
|
||||
short i,j;
|
||||
|
||||
GetFNum(fn1,&geneva_font_num);
|
||||
if (geneva_font_num == 0)
|
||||
@@ -481,7 +482,6 @@ void redraw_screen() {
|
||||
}
|
||||
|
||||
void draw_main_screen() {
|
||||
short i;
|
||||
Rect draw_rect;
|
||||
|
||||
|
||||
@@ -694,7 +694,7 @@ void set_up_terrain_buttons() {
|
||||
}
|
||||
|
||||
void draw_terrain(){
|
||||
short q,r,x,y,i,small_i;
|
||||
short q,r,x,i,small_i;
|
||||
location which_pt,where_draw;
|
||||
Rect draw_rect,clipping_rect = {8,8,332,260};
|
||||
unsigned char t_to_draw;
|
||||
|
||||
@@ -178,7 +178,6 @@ bool cre(short val,short min,short max,char *text1, char *text2,short parent_num
|
||||
|
||||
void choose_graphic_event_filter (short item_hit) {
|
||||
short i;
|
||||
bool had1 = false, had2 = false;
|
||||
|
||||
switch (item_hit) {
|
||||
case 1:
|
||||
@@ -212,7 +211,7 @@ void choose_graphic_event_filter (short item_hit) {
|
||||
}
|
||||
|
||||
void put_choice_pics(short g_type) {
|
||||
short item_hit,i;
|
||||
short i;
|
||||
|
||||
for (i = 0; i < 36; i++) {
|
||||
if (store_first_g + which_page * 36 + i > store_last_g) {
|
||||
@@ -233,9 +232,7 @@ void put_choice_pics(short g_type) {
|
||||
short choose_graphic(short first_g,short last_g,short cur_choice,short g_type,short parent_num) {
|
||||
|
||||
short item_hit;
|
||||
Str255 sign_text;
|
||||
location view_loc;
|
||||
bool sound_done = false;
|
||||
|
||||
//make_cursor_sword();
|
||||
|
||||
@@ -264,7 +261,6 @@ short choose_graphic(short first_g,short last_g,short cur_choice,short g_type,sh
|
||||
|
||||
void choose_text_res_event_filter (short item_hit) {
|
||||
short i;
|
||||
bool had1 = false, had2 = false;
|
||||
|
||||
switch (item_hit) {
|
||||
case 2:
|
||||
@@ -298,7 +294,7 @@ void choose_text_res_event_filter (short item_hit) {
|
||||
}
|
||||
|
||||
void put_text_res() {
|
||||
short item_hit,i;
|
||||
short i;
|
||||
Str255 str;
|
||||
|
||||
for (i = 0; i < 40; i++) {
|
||||
@@ -321,9 +317,7 @@ void put_text_res() {
|
||||
short choose_text_res(short res_list,short first_t,short last_t,short cur_choice,short parent_num,char *title) {
|
||||
|
||||
short item_hit;
|
||||
Str255 sign_text;
|
||||
location view_loc;
|
||||
bool sound_done = false;
|
||||
|
||||
//make_cursor_sword();
|
||||
store_res_list = res_list;
|
||||
@@ -351,8 +345,6 @@ short choose_text_res(short res_list,short first_t,short last_t,short cur_choice
|
||||
}
|
||||
|
||||
void edit_text_event_filter (short item_hit) {
|
||||
Str255 str;
|
||||
short i;
|
||||
short num_strs[3] = {260,108,140};
|
||||
|
||||
if (store_str_mode == 0)
|
||||
@@ -387,8 +379,7 @@ void edit_text_event_filter (short item_hit) {
|
||||
// mode 0 - scen 1 - out 2 - town
|
||||
void edit_text_str(short which_str,short mode) {
|
||||
// ignore parent in Mac version
|
||||
short text_hit,i,store_dialog_answer,item_hit;
|
||||
Str255 temp_str;
|
||||
short item_hit;
|
||||
|
||||
store_which_str = which_str;
|
||||
store_str_mode = mode;
|
||||
@@ -412,7 +403,6 @@ void edit_text_str(short which_str,short mode) {
|
||||
|
||||
void edit_area_rect_event_filter (short item_hit) {
|
||||
Str255 str;
|
||||
short i;
|
||||
|
||||
switch (item_hit) {
|
||||
case 6:
|
||||
@@ -434,8 +424,7 @@ void edit_area_rect_event_filter (short item_hit) {
|
||||
// mode 0 - out 1 - town
|
||||
bool edit_area_rect_str(short which_str,short mode) {
|
||||
// ignore parent in Mac version
|
||||
short area_rect_hit,i,store_dialog_answer,item_hit;
|
||||
Str255 temp_str;
|
||||
short item_hit;
|
||||
|
||||
store_which_str = which_str;
|
||||
store_str_mode = mode;
|
||||
@@ -454,9 +443,6 @@ bool edit_area_rect_str(short which_str,short mode) {
|
||||
}
|
||||
|
||||
bool save_spec_enc() {
|
||||
Str255 str;
|
||||
short i;
|
||||
|
||||
store_spec_node.sd1 = CDGN(822,2);
|
||||
store_spec_node.sd2 = CDGN(822,3);
|
||||
store_spec_node.m1 = CDGN(822,4);
|
||||
@@ -659,7 +645,6 @@ void put_spec_enc_in_dlog() {
|
||||
}
|
||||
|
||||
void edit_spec_enc_event_filter (short item_hit) {
|
||||
Str255 str;
|
||||
short i,node_to_change_to = -1,spec;
|
||||
|
||||
switch (item_hit) {
|
||||
@@ -886,8 +871,7 @@ void edit_spec_enc_event_filter (short item_hit) {
|
||||
// mode - 0 scen 1 - out 2 - town
|
||||
void edit_spec_enc(short which_node,short mode,short parent_num) {
|
||||
// ignore parent in Mac version
|
||||
short spec_enc_hit,i,store_dialog_answer;
|
||||
Str255 temp_str;
|
||||
short spec_enc_hit,i;
|
||||
|
||||
store_which_mode = mode;
|
||||
store_which_node = which_node;
|
||||
@@ -1040,8 +1024,7 @@ void edit_spec_text_event_filter (short item_hit) {
|
||||
|
||||
// mode 0 - scen 1 - out 2 - town
|
||||
void edit_spec_text(short mode,short *str1,short *str2,short parent) {
|
||||
short text_hit,i,store_dialog_answer,item_hit;
|
||||
Str255 temp_str;
|
||||
short item_hit;
|
||||
short num_s_strs[3] = {100,90,100};
|
||||
|
||||
store_str1 = str1;
|
||||
@@ -1106,8 +1089,7 @@ void edit_dialog_text_event_filter (short item_hit){
|
||||
|
||||
// mode 0 - scen 1 - out 2 - town
|
||||
void edit_dialog_text(short mode,short *str1,short parent) {
|
||||
short text_hit,i,j,store_dialog_answer,item_hit;
|
||||
Str255 temp_str;
|
||||
short i,j,item_hit;
|
||||
short num_s_strs[3] = {100,90,100};
|
||||
|
||||
store_str1 = str1;
|
||||
@@ -1160,13 +1142,13 @@ void edit_dialog_text(short mode,short *str1,short parent) {
|
||||
for (i = *str1; i < *str1 + 6; i++) {
|
||||
switch (store_spec_str_mode) {
|
||||
case 0:
|
||||
sprintf(scenario.scen_strs(160 + i),"");
|
||||
strcpy(scenario.scen_strs(160 + i),"");
|
||||
break;
|
||||
case 1:
|
||||
sprintf(current_terrain.out_strs(10 + i),"");
|
||||
strcpy(current_terrain.out_strs(10 + i),"");
|
||||
break;
|
||||
case 2:
|
||||
sprintf(town->town_strs(20 + i),"");
|
||||
strcpy(town->town_strs(20 + i),"");
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1195,7 +1177,6 @@ void edit_dialog_text(short mode,short *str1,short parent) {
|
||||
}
|
||||
|
||||
void edit_special_num_event_filter (short item_hit) {
|
||||
Str255 str;
|
||||
short i;
|
||||
|
||||
switch (item_hit) {
|
||||
@@ -1217,8 +1198,7 @@ void edit_special_num_event_filter (short item_hit) {
|
||||
}
|
||||
|
||||
short edit_special_num(short mode,short what_start) {
|
||||
short text_hit,i,j,store_dialog_answer,item_hit;
|
||||
Str255 temp_str;
|
||||
short item_hit;
|
||||
|
||||
store_spec_mode = mode;
|
||||
|
||||
@@ -1234,7 +1214,6 @@ short edit_special_num(short mode,short what_start) {
|
||||
}
|
||||
|
||||
void edit_scen_intro_event_filter (short item_hit) {
|
||||
Str255 str;
|
||||
short i;
|
||||
|
||||
switch (item_hit) {
|
||||
@@ -1264,8 +1243,7 @@ void edit_scen_intro_event_filter (short item_hit) {
|
||||
}
|
||||
|
||||
void edit_scen_intro() {
|
||||
short text_hit,i,j,store_dialog_answer,item_hit;
|
||||
Str255 temp_str;
|
||||
short i,item_hit;
|
||||
short num_s_strs[3] = {100,90,100};
|
||||
|
||||
|
||||
@@ -1288,14 +1266,7 @@ void make_cursor_sword() {
|
||||
// only used at beginning of program
|
||||
short choice_dialog(short pic,short num) {
|
||||
DialogPtr select_dialog = NULL;
|
||||
short the_type;
|
||||
Handle the_handle = NULL;
|
||||
Rect the_rect;
|
||||
short item_hit,i;
|
||||
Str255 pc_name;
|
||||
GrafPtr old_port;
|
||||
PicHandle pict_to_draw;
|
||||
|
||||
short item_hit;
|
||||
|
||||
select_dialog = GetNewDialog (num, 0, IN_FRONT);
|
||||
if (select_dialog == NULL) {
|
||||
|
||||
@@ -86,10 +86,6 @@ bool mac_is_intel;
|
||||
|
||||
//Changed to ISO C specified argument and return type.
|
||||
int main(void) {
|
||||
|
||||
short j,k;
|
||||
long i;
|
||||
size_t size;
|
||||
//outdoor_record_type dummy_outdoor, *store2;
|
||||
|
||||
|
||||
@@ -105,7 +101,6 @@ int main(void) {
|
||||
load_graphics();
|
||||
|
||||
init_dialogs();
|
||||
Point p = {0,0};
|
||||
init_graph_tool(redraw_screen,NULL);
|
||||
|
||||
cen_x = 18;
|
||||
@@ -175,7 +170,6 @@ int main(void) {
|
||||
void Initialize(void) {
|
||||
|
||||
Str255 tit = " ";
|
||||
OSErr error;
|
||||
|
||||
|
||||
/* Initialize all the needed managers. */
|
||||
@@ -207,7 +201,7 @@ void Initialize(void) {
|
||||
//InsetRect(&windRect, 5, 34);
|
||||
InsetRect(&windRect,(windRect.right - 584) / 2,(windRect.bottom - 420) / 2);
|
||||
OffsetRect(&windRect,0,18);
|
||||
mainPtr = NewCWindow(nil, &windRect, "\pBlades of Exile Scenario Editor", true, documentProc,
|
||||
mainPtr = NewCWindow(nil, &windRect, "\pBlades of Exile Scenario Editor", true, noGrowDocProc,
|
||||
(WindowPtr) -1, false, 0);
|
||||
GetWindowPortBounds(mainPtr,&windRect);
|
||||
SetPortWindowPort(mainPtr); /* set window to current graf port */
|
||||
@@ -353,9 +347,6 @@ void handle_menu_choice(long choice) {
|
||||
}
|
||||
|
||||
void handle_apple_menu(int item_hit) {
|
||||
Str255 desk_acc_name;
|
||||
short desk_acc_num;
|
||||
|
||||
switch (item_hit) {
|
||||
case 1:
|
||||
fancy_choice_dialog(1062,0);
|
||||
@@ -369,8 +360,6 @@ void handle_apple_menu(int item_hit) {
|
||||
|
||||
|
||||
void handle_file_menu(int item_hit) {
|
||||
short create;
|
||||
|
||||
switch (item_hit) {
|
||||
case 1: // open
|
||||
try{
|
||||
@@ -580,8 +569,6 @@ void handle_town_menu(int item_hit) {
|
||||
}
|
||||
}
|
||||
void handle_outdoor_menu(int item_hit) {
|
||||
short i;
|
||||
|
||||
change_made = true;
|
||||
switch (item_hit) {
|
||||
case 1:
|
||||
@@ -618,8 +605,6 @@ void handle_outdoor_menu(int item_hit) {
|
||||
}
|
||||
|
||||
void handle_help_menu(int item_hit) {
|
||||
short i;
|
||||
|
||||
switch (item_hit) {
|
||||
case 1:
|
||||
fancy_choice_dialog(986,0);
|
||||
@@ -655,7 +640,7 @@ void handle_monst_menu(int item_hit) {
|
||||
|
||||
|
||||
pascal void right_sbar_action(ControlHandle bar, short part) {
|
||||
short old_setting,new_setting,max,i;
|
||||
short old_setting,new_setting,max;
|
||||
|
||||
if (part == 0)
|
||||
return;
|
||||
@@ -686,7 +671,7 @@ pascal void right_sbar_action(ControlHandle bar, short part) {
|
||||
|
||||
void Mouse_Pressed() {
|
||||
WindowPtr the_window;
|
||||
short the_part,content_part,i;
|
||||
short the_part,content_part;
|
||||
long menu_choice;
|
||||
BitMap bmap;
|
||||
ControlHandle control_hit;
|
||||
@@ -873,9 +858,6 @@ void ding() {
|
||||
void set_pixel_depth() {
|
||||
GDHandle cur_device;
|
||||
PixMapHandle screen_pixmap_handle;
|
||||
OSErr err;
|
||||
short choice;
|
||||
|
||||
cur_device = GetGDevice();
|
||||
|
||||
|
||||
@@ -894,8 +876,6 @@ void restore_depth() {
|
||||
GDHandle cur_device;
|
||||
PixMapHandle screen_pixmap_handle;
|
||||
OSErr err;
|
||||
short choice;
|
||||
|
||||
cur_device = GetGDevice();
|
||||
|
||||
screen_pixmap_handle = (**(cur_device)).gdPMap;
|
||||
|
||||
@@ -52,7 +52,7 @@ location store_cur_loc;
|
||||
|
||||
__attribute__((deprecated))
|
||||
void init_town(short size) {
|
||||
short i,j,s;
|
||||
short i,j;
|
||||
Str255 temp_str;
|
||||
if(size == 0) town = new cBigTown;
|
||||
else if(size == 1) town = new cMedTown;
|
||||
@@ -73,8 +73,8 @@ void init_town(short size) {
|
||||
town->talking.strlens[i] = 0;
|
||||
for(i = 0; i < 170; i++)
|
||||
if (i < 10)
|
||||
sprintf(town->talking.talk_strs[i],"Unused");
|
||||
else sprintf(town->talking.talk_strs[i],"");
|
||||
strcpy(town->talking.talk_strs[i],"Unused");
|
||||
else strcpy(town->talking.talk_strs[i],"");
|
||||
|
||||
for(i = 0; i < 60; i++) {
|
||||
town->talking.talk_nodes[i].personality = -1;
|
||||
@@ -107,9 +107,6 @@ void init_out() {
|
||||
}
|
||||
|
||||
void put_placed_monst_in_dlog() {
|
||||
Str255 str;
|
||||
short i;
|
||||
|
||||
cdsin(837,24,store_which_placed_monst);
|
||||
csit(837,7,(char*)scenario.scen_monsters[store_placed_monst.number].m_name.c_str());
|
||||
cd_set_led_range(837,14,17,store_placed_monst.start_attitude);
|
||||
@@ -123,9 +120,6 @@ void put_placed_monst_in_dlog() {
|
||||
else csp(837,11,store_placed_monst.facial_pic/* + 1000*/,PICT_TALK);
|
||||
}
|
||||
bool get_placed_monst_in_dlog() {
|
||||
Str255 str;
|
||||
short i;
|
||||
|
||||
store_placed_monst.start_attitude = cd_get_led_range(837,14,17);
|
||||
store_placed_monst.mobility = cd_get_led_range(837,18,19);
|
||||
store_placed_monst.personality = CDGN(837,2);
|
||||
@@ -136,7 +130,6 @@ bool get_placed_monst_in_dlog() {
|
||||
}
|
||||
|
||||
void edit_placed_monst_event_filter (short item_hit) {
|
||||
Str255 str;
|
||||
short i;
|
||||
cCreature store_m;
|
||||
|
||||
@@ -182,8 +175,7 @@ void edit_placed_monst_event_filter (short item_hit) {
|
||||
|
||||
void edit_placed_monst(short which_m) {
|
||||
|
||||
short item_hit,i,store_dialog_answer;
|
||||
Str255 temp_str;
|
||||
short item_hit,i;
|
||||
char *attitude[4] = {"Friendly, Docile","Hostile, Type A","Friendly, Will Fight","Hostile, Type B"};
|
||||
|
||||
store_placed_monst = town->creatures(which_m);
|
||||
@@ -206,7 +198,6 @@ void edit_placed_monst(short which_m) {
|
||||
}
|
||||
|
||||
void put_placed_monst_adv_in_dlog() {
|
||||
Str255 str;
|
||||
short i;
|
||||
|
||||
cdsin(838,20,store_which_placed_monst);
|
||||
@@ -226,9 +217,6 @@ void put_placed_monst_adv_in_dlog() {
|
||||
CDSN(838,6,store_placed_monst2.spec2);
|
||||
}
|
||||
bool get_placed_monst_adv_in_dlog() {
|
||||
Str255 str;
|
||||
short i;
|
||||
|
||||
store_placed_monst2.time_flag = cd_get_led_range(838,22,29);
|
||||
if (store_placed_monst2.time_flag > 2)
|
||||
store_placed_monst2.time_flag++;
|
||||
@@ -248,9 +236,6 @@ bool get_placed_monst_adv_in_dlog() {
|
||||
}
|
||||
|
||||
void edit_placed_monst_adv_event_filter (short item_hit) {
|
||||
Str255 str;
|
||||
short i;
|
||||
|
||||
switch (item_hit) {
|
||||
case 16:
|
||||
if (get_placed_monst_adv_in_dlog() == false)
|
||||
@@ -275,7 +260,7 @@ void edit_placed_monst_adv_event_filter (short item_hit) {
|
||||
|
||||
cCreature edit_placed_monst_adv(cCreature monst_record) {
|
||||
|
||||
short item_hit,i,store_dialog_answer;
|
||||
short item_hit,i;
|
||||
Str255 temp_str;
|
||||
char *time_labels[] = {"Always here","Appear on given day","Disappear on day",
|
||||
"Sometimes here A","Sometimes here B","Sometimes here C",
|
||||
@@ -326,7 +311,6 @@ void put_placed_item_in_dlog() {
|
||||
else csp(836,4,/*1800 + */i,PICT_ITEM);
|
||||
}
|
||||
bool get_placed_item_in_dlog() {
|
||||
Str255 str;
|
||||
short i;
|
||||
|
||||
store_placed_item.ability = CDGN(836,2);
|
||||
@@ -349,7 +333,6 @@ bool get_placed_item_in_dlog() {
|
||||
}
|
||||
|
||||
void edit_placed_item_event_filter (short item_hit) {
|
||||
Str255 str;
|
||||
short i;
|
||||
cCreature store_m;
|
||||
|
||||
@@ -378,8 +361,7 @@ void edit_placed_item_event_filter (short item_hit) {
|
||||
|
||||
void edit_placed_item(short which_i) {
|
||||
|
||||
short item_hit,i,store_dialog_answer;
|
||||
Str255 temp_str;
|
||||
short item_hit;
|
||||
|
||||
store_placed_item = town->preset_items[which_i];
|
||||
store_which_placed_item = which_i;
|
||||
@@ -396,9 +378,6 @@ void edit_placed_item(short which_i) {
|
||||
}
|
||||
|
||||
void edit_sign_event_filter (short item_hit) {
|
||||
short i;
|
||||
bool had1 = false, had2 = false;
|
||||
|
||||
switch (item_hit) {
|
||||
case 9: case 4:
|
||||
if (editing_town == false)
|
||||
@@ -429,9 +408,7 @@ void edit_sign_event_filter (short item_hit) {
|
||||
void edit_sign(short which_sign,short picture) {
|
||||
|
||||
short item_hit;
|
||||
Str255 sign_text;
|
||||
location view_loc;
|
||||
bool sound_done = false;
|
||||
|
||||
store_which_sign = which_sign;
|
||||
|
||||
@@ -486,9 +463,6 @@ void put_out_strs_in_dlog() {
|
||||
}
|
||||
|
||||
void edit_out_strs_event_filter (short item_hit) {
|
||||
Str255 str;
|
||||
short i;
|
||||
|
||||
switch (item_hit) {
|
||||
case 10:
|
||||
if (save_out_strs() == true)
|
||||
@@ -510,8 +484,7 @@ void edit_out_strs_event_filter (short item_hit) {
|
||||
|
||||
void edit_out_strs() {
|
||||
// ignore parent in Mac version
|
||||
short out_strs_hit,i,store_dialog_answer;
|
||||
Str255 temp_str;
|
||||
short out_strs_hit,i;
|
||||
|
||||
for (i = 0; i < 8; i++)
|
||||
str_do_delete[i] = 0;
|
||||
@@ -557,9 +530,6 @@ void put_town_strs_in_dlog() {
|
||||
}
|
||||
|
||||
void edit_town_strs_event_filter (short item_hit) {
|
||||
Str255 str;
|
||||
short i;
|
||||
|
||||
switch (item_hit) {
|
||||
case 18:
|
||||
if (save_town_strs() == true)
|
||||
@@ -581,8 +551,7 @@ void edit_town_strs_event_filter (short item_hit) {
|
||||
|
||||
void edit_town_strs() {
|
||||
// ignore parent in Mac version
|
||||
short town_strs_hit,i,store_dialog_answer;
|
||||
Str255 temp_str;
|
||||
short town_strs_hit,i;
|
||||
|
||||
for (i = 0; i < 16; i++)
|
||||
str_do_delete[i] = 0;
|
||||
@@ -599,9 +568,6 @@ void edit_town_strs() {
|
||||
|
||||
short store_which_town_dlg;
|
||||
void pick_town_num_event_filter (short item_hit) {
|
||||
Str255 str;
|
||||
short i;
|
||||
|
||||
switch (item_hit) {
|
||||
case 3:
|
||||
dialog_answer = CDGN(store_which_town_dlg,2);
|
||||
@@ -621,7 +587,7 @@ void pick_town_num_event_filter (short item_hit) {
|
||||
|
||||
short pick_town_num(short which_dlog,short def) {
|
||||
// ignore parent in Mac version
|
||||
short town_strs_hit,i,store_dialog_answer;
|
||||
short town_strs_hit;
|
||||
Str255 temp_str,str2;
|
||||
|
||||
store_which_town_dlg = which_dlog;
|
||||
@@ -640,7 +606,6 @@ short pick_town_num(short which_dlog,short def) {
|
||||
}
|
||||
|
||||
void change_ter_event_filter (short item_hit) {
|
||||
Str255 str;
|
||||
short i;
|
||||
|
||||
switch (item_hit) {
|
||||
@@ -671,8 +636,7 @@ void change_ter_event_filter (short item_hit) {
|
||||
|
||||
void change_ter(short *change_from,short *change_to,short *chance) {
|
||||
// ignore parent in Mac version
|
||||
short town_strs_hit,i,store_dialog_answer;
|
||||
Str255 temp_str;
|
||||
short town_strs_hit;
|
||||
|
||||
cd_create_dialog_parent_num(857,0);
|
||||
|
||||
@@ -691,7 +655,6 @@ void change_ter(short *change_from,short *change_to,short *chance) {
|
||||
|
||||
void outdoor_details_event_filter (short item_hit) {
|
||||
Str255 str;
|
||||
short i;
|
||||
|
||||
switch (item_hit) {
|
||||
case 3:
|
||||
@@ -706,7 +669,7 @@ void outdoor_details_event_filter (short item_hit) {
|
||||
|
||||
void outdoor_details() {
|
||||
// ignore parent in Mac version
|
||||
short town_strs_hit,i,store_dialog_answer;
|
||||
short town_strs_hit;
|
||||
Str255 temp_str;
|
||||
|
||||
|
||||
@@ -753,9 +716,6 @@ void put_out_wand_in_dlog() {
|
||||
CDSN(852,6,store_out_wand.end_spec2);
|
||||
}
|
||||
bool get_out_wand_in_dlog() {
|
||||
Str255 str;
|
||||
short i;
|
||||
|
||||
store_out_wand.spec_on_meet = CDGN(852,2);
|
||||
store_out_wand.spec_on_win = CDGN(852,3);
|
||||
store_out_wand.spec_on_flee = CDGN(852,4);
|
||||
@@ -785,7 +745,6 @@ bool get_out_wand_in_dlog() {
|
||||
}
|
||||
|
||||
void edit_out_wand_event_filter (short item_hit) {
|
||||
Str255 str;
|
||||
short i,spec;
|
||||
cCreature store_m;
|
||||
|
||||
@@ -855,8 +814,7 @@ void edit_out_wand_event_filter (short item_hit) {
|
||||
// mode 0 - wandering 1 - special
|
||||
void edit_out_wand(short mode) {
|
||||
|
||||
short item_hit,i,store_dialog_answer;
|
||||
Str255 temp_str;
|
||||
short item_hit;
|
||||
|
||||
store_which_out_wand = 0;
|
||||
store_out_wand_mode = mode;
|
||||
@@ -877,7 +835,6 @@ void edit_out_wand(short mode) {
|
||||
|
||||
bool save_town_details() {
|
||||
Str255 str;
|
||||
short i;
|
||||
|
||||
CDGT(832,2,(char *) str);
|
||||
sprintf(town->town_strs(0),"%-29.29s",str);
|
||||
@@ -897,9 +854,6 @@ bool save_town_details() {
|
||||
}
|
||||
|
||||
void put_town_details_in_dlog() {
|
||||
Str255 str;
|
||||
short i;
|
||||
|
||||
CDST(832,2,town->town_strs(0));
|
||||
CDSN(832,3,town->town_chop_time);
|
||||
CDSN(832,4,town->town_chop_key);
|
||||
@@ -910,9 +864,6 @@ void put_town_details_in_dlog() {
|
||||
}
|
||||
|
||||
void edit_town_details_event_filter (short item_hit) {
|
||||
Str255 str;
|
||||
short i;
|
||||
|
||||
switch (item_hit) {
|
||||
case 7:
|
||||
if (save_town_details() == true)
|
||||
@@ -926,8 +877,7 @@ void edit_town_details_event_filter (short item_hit) {
|
||||
|
||||
void edit_town_details() {
|
||||
// ignore parent in Mac version
|
||||
short town_details_hit,i,store_dialog_answer;
|
||||
Str255 temp_str;
|
||||
short town_details_hit;
|
||||
|
||||
cd_create_dialog_parent_num(832,0);
|
||||
|
||||
@@ -938,7 +888,6 @@ void edit_town_details() {
|
||||
}
|
||||
|
||||
bool save_town_events() {
|
||||
Str255 str;
|
||||
short i;
|
||||
|
||||
for (i = 0; i < 8; i++) {
|
||||
@@ -951,7 +900,6 @@ bool save_town_events() {
|
||||
}
|
||||
|
||||
void put_town_events_in_dlog() {
|
||||
Str255 str;
|
||||
short i;
|
||||
|
||||
for (i = 0; i < 8; i++) {
|
||||
@@ -962,8 +910,7 @@ void put_town_events_in_dlog() {
|
||||
}
|
||||
|
||||
void edit_town_events_event_filter (short item_hit) {
|
||||
Str255 str;
|
||||
short i,spec;
|
||||
short spec;
|
||||
|
||||
switch (item_hit) {
|
||||
case 18:
|
||||
@@ -994,8 +941,7 @@ void edit_town_events_event_filter (short item_hit) {
|
||||
|
||||
void edit_town_events() {
|
||||
// ignore parent in Mac version
|
||||
short advanced_town_hit,i,store_dialog_answer;
|
||||
Str255 temp_str;
|
||||
short advanced_town_hit;
|
||||
|
||||
|
||||
cd_create_dialog_parent_num(833,0);
|
||||
@@ -1008,7 +954,6 @@ void edit_town_events() {
|
||||
}
|
||||
|
||||
bool save_advanced_town() {
|
||||
Str255 str;
|
||||
short i;
|
||||
|
||||
for (i = 0; i < 4; i++) {
|
||||
@@ -1033,7 +978,6 @@ bool save_advanced_town() {
|
||||
}
|
||||
|
||||
void put_advanced_town_in_dlog() {
|
||||
Str255 str;
|
||||
short i;
|
||||
|
||||
for (i = 0; i < 4; i++) {
|
||||
@@ -1048,9 +992,6 @@ void put_advanced_town_in_dlog() {
|
||||
}
|
||||
|
||||
void edit_advanced_town_event_filter (short item_hit) {
|
||||
Str255 str;
|
||||
short i,spec;
|
||||
|
||||
switch (item_hit) {
|
||||
case 16:
|
||||
if (save_advanced_town() == true)
|
||||
@@ -1067,8 +1008,7 @@ void edit_advanced_town_event_filter (short item_hit) {
|
||||
|
||||
void edit_advanced_town() {
|
||||
// ignore parent in Mac version
|
||||
short advanced_town_hit,i,store_dialog_answer;
|
||||
Str255 temp_str;
|
||||
short advanced_town_hit;
|
||||
|
||||
|
||||
cd_create_dialog_parent_num(834,0);
|
||||
@@ -1081,7 +1021,6 @@ void edit_advanced_town() {
|
||||
}
|
||||
|
||||
bool save_town_wand() {
|
||||
Str255 str;
|
||||
short i,j;
|
||||
|
||||
for (i = 0; i < 4; i++)
|
||||
@@ -1096,7 +1035,6 @@ bool save_town_wand() {
|
||||
}
|
||||
|
||||
void put_town_wand_in_dlog() {
|
||||
Str255 str;
|
||||
short i,j;
|
||||
|
||||
for (i = 0; i < 4; i++)
|
||||
@@ -1108,8 +1046,7 @@ void put_town_wand_in_dlog() {
|
||||
}
|
||||
|
||||
void edit_town_wand_event_filter (short item_hit) {
|
||||
Str255 str;
|
||||
short i,j,spec;
|
||||
short i,j;
|
||||
|
||||
switch (item_hit) {
|
||||
case 18:
|
||||
@@ -1131,8 +1068,7 @@ void edit_town_wand_event_filter (short item_hit) {
|
||||
|
||||
void edit_town_wand() {
|
||||
// ignore parent in Mac version
|
||||
short town_wand_hit,i,store_dialog_answer;
|
||||
Str255 temp_str;
|
||||
short town_wand_hit;
|
||||
|
||||
|
||||
cd_create_dialog_parent_num(835,0);
|
||||
@@ -1145,9 +1081,6 @@ void edit_town_wand() {
|
||||
}
|
||||
|
||||
bool save_basic_dlog() {
|
||||
Str255 str;
|
||||
short i,j;
|
||||
|
||||
CDGT(821,2,town->talking.talk_strs[store_which_talk_node]);
|
||||
town->talking.talk_strs[store_which_talk_node][30] = 0;
|
||||
CDGT(821,3,town->talking.talk_strs[160 + store_which_talk_node]);
|
||||
@@ -1159,9 +1092,6 @@ bool save_basic_dlog() {
|
||||
}
|
||||
|
||||
void put_basic_dlog_in_dlog() {
|
||||
Str255 str;
|
||||
short i,j;
|
||||
|
||||
cdsin(821,14,store_which_talk_node + cur_town * 10);
|
||||
CDST(821,2,town->talking.talk_strs[store_which_talk_node]);
|
||||
CDST(821,3,town->talking.talk_strs[160 + store_which_talk_node]);
|
||||
@@ -1172,9 +1102,6 @@ void put_basic_dlog_in_dlog() {
|
||||
}
|
||||
|
||||
void edit_basic_dlog_event_filter (short item_hit) {
|
||||
Str255 str;
|
||||
short i,j,spec;
|
||||
|
||||
switch (item_hit) {
|
||||
case 7:
|
||||
if (save_basic_dlog() == true)
|
||||
@@ -1200,8 +1127,7 @@ void edit_basic_dlog_event_filter (short item_hit) {
|
||||
|
||||
void edit_basic_dlog(short which_node) {
|
||||
// ignore parent in Mac version
|
||||
short basic_dlog_hit,i,store_dialog_answer;
|
||||
Str255 temp_str;
|
||||
short basic_dlog_hit;
|
||||
|
||||
store_which_talk_node = which_node;
|
||||
|
||||
@@ -1343,7 +1269,6 @@ void put_talk_node_in_dlog() {
|
||||
}
|
||||
|
||||
void edit_talk_node_event_filter (short item_hit) {
|
||||
Str255 str;
|
||||
short i,j,node_to_change_to = -1,spec;
|
||||
|
||||
switch (item_hit) {
|
||||
@@ -1466,8 +1391,7 @@ void edit_talk_node_event_filter (short item_hit) {
|
||||
|
||||
void edit_talk_node(short which_node,short parent_num) {
|
||||
// ignore parent in Mac version
|
||||
short talk_node_hit,i,store_dialog_answer;
|
||||
Str255 temp_str;
|
||||
short talk_node_hit,i;
|
||||
|
||||
store_which_talk_node = which_node;
|
||||
for (i = 0; i < 60; i++)
|
||||
@@ -1494,7 +1418,6 @@ void edit_talk_node(short which_node,short parent_num) {
|
||||
|
||||
void pick_out_event_filter (short item_hit) {
|
||||
Str255 temp_str;
|
||||
short i,j,spec;
|
||||
|
||||
switch (item_hit) {
|
||||
case 2:
|
||||
@@ -1530,7 +1453,7 @@ void pick_out_event_filter (short item_hit) {
|
||||
|
||||
short pick_out(location default_loc) {
|
||||
// ignore parent in Mac version
|
||||
short basic_dlog_hit,i,store_dialog_answer;
|
||||
short basic_dlog_hit;
|
||||
Str255 temp_str;
|
||||
|
||||
store_cur_loc = default_loc;
|
||||
@@ -1551,9 +1474,6 @@ short pick_out(location default_loc) {
|
||||
}
|
||||
|
||||
void new_town_event_filter (short item_hit) {
|
||||
Str255 temp_str;
|
||||
short i,j,spec;
|
||||
|
||||
switch (item_hit) {
|
||||
case 3:
|
||||
dialog_answer = 1;
|
||||
@@ -1626,6 +1546,7 @@ bool new_town(short which_town) {
|
||||
//
|
||||
// reset_pwd();
|
||||
// return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
// before calling this, be sure to do all checks to make sure it's safe.
|
||||
@@ -1650,9 +1571,6 @@ void delete_last_town() {
|
||||
}
|
||||
|
||||
void pick_import_town_event_filter (short item_hit) {
|
||||
Str255 str;
|
||||
short i;
|
||||
|
||||
switch (item_hit) {
|
||||
case 3:
|
||||
dialog_answer = CDGN(841,2);
|
||||
@@ -1672,8 +1590,7 @@ void pick_import_town_event_filter (short item_hit) {
|
||||
|
||||
short pick_import_town(short def, FSSpec* temp_file_to_load) {
|
||||
// ignore parent in Mac version
|
||||
short town_strs_hit,i,store_dialog_answer;
|
||||
Str255 temp_str,str2;
|
||||
short town_strs_hit;
|
||||
NavReplyRecord s_reply;
|
||||
|
||||
NavChooseFile(NULL,&s_reply,NULL,NULL,NULL,NULL,NULL,NULL);
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
#define MOUSE_REGION 0L
|
||||
#define DRAG_EDGE 15
|
||||
#define IN_FRONT (WindowPtr)-1L
|
||||
#define NIL 0L
|
||||
|
||||
#define NUM_TOWN_ITEMS 115
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
#include "location.h"
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
#include <iosfwd>
|
||||
|
||||
namespace legacy { struct item_record_type; };
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#define MONSTER_H
|
||||
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
#include <iosfwd>
|
||||
|
||||
namespace legacy {
|
||||
struct monster_record_type;
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
#include "location.h"
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
#include <iosfwd>
|
||||
|
||||
namespace legacy {
|
||||
struct out_wandering_type;
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#define PC_H
|
||||
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
#include <iosfwd>
|
||||
|
||||
namespace legacy { struct pc_record_type; };
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
#ifndef REGTOWN_H
|
||||
#define REGTOWN_H
|
||||
|
||||
#include <iostream>
|
||||
#include <iosfwd>
|
||||
|
||||
namespace legacy {
|
||||
struct big_tr_type;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
#ifndef SCENARIO_H
|
||||
#define SCENARIO_H
|
||||
|
||||
#include <iostream>
|
||||
#include <iosfwd>
|
||||
|
||||
namespace legacy{
|
||||
struct scenario_data_type;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
#ifndef SPECIAL_H
|
||||
#define SPECIAL_H
|
||||
|
||||
#include <iostream>
|
||||
#include <iosfwd>
|
||||
|
||||
namespace legacy { struct special_node_type; };
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
#ifndef TALKING_H
|
||||
#define TALKING_H
|
||||
|
||||
#include <iostream>
|
||||
#include <iosfwd>
|
||||
|
||||
namespace legacy {
|
||||
struct talking_record_type;
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#define TERRAIN_H
|
||||
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
#include <iosfwd>
|
||||
|
||||
namespace legacy { struct terrain_type_type; };
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
#ifndef TMPLTOWN_H
|
||||
#define TMPLTOWN_H
|
||||
|
||||
#include <iostream>
|
||||
#include <iosfwd>
|
||||
|
||||
class cTemplTown {
|
||||
public:
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#define TOWN_H
|
||||
|
||||
#include <vector>
|
||||
#include <iostream>
|
||||
#include <iosfwd>
|
||||
|
||||
namespace legacy {
|
||||
struct town_record_type;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
#ifndef UNIVERSE_H
|
||||
#define UNIVERSE_H
|
||||
|
||||
#include <iostream>
|
||||
#include <iosfwd>
|
||||
|
||||
namespace legacy {
|
||||
struct out_info_type;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
#ifndef VEHICLE_H
|
||||
#define VEHICLE_H
|
||||
|
||||
#include <iostream>
|
||||
#include <iosfwd>
|
||||
#include "location.h"
|
||||
|
||||
namespace legacy {
|
||||
|
||||
@@ -85,7 +85,7 @@ namespace legacy {
|
||||
char awkward, bonus, protection, charges, type;
|
||||
unsigned char graphic_num,ability, type_flag, is_special;
|
||||
short value;
|
||||
bool identified, magic;
|
||||
Boolean identified, magic;
|
||||
unsigned char weight, description_flag;
|
||||
char full_name[25], name[15];
|
||||
unsigned char reserved1,reserved2;
|
||||
@@ -207,13 +207,13 @@ namespace legacy {
|
||||
struct horse_record_type {
|
||||
location horse_loc,horse_loc_in_sec,horse_sector;
|
||||
short which_town;
|
||||
bool exists,property;
|
||||
Boolean exists,property;
|
||||
} __attribute__((packed));
|
||||
|
||||
struct boat_record_type {
|
||||
location boat_loc,boat_loc_in_sec,boat_sector;
|
||||
short which_town;
|
||||
bool exists,property;
|
||||
Boolean exists,property;
|
||||
} __attribute__((packed));
|
||||
|
||||
struct talk_save_type {
|
||||
@@ -239,7 +239,7 @@ namespace legacy {
|
||||
} __attribute__((packed));
|
||||
|
||||
struct outdoor_creature_type {
|
||||
bool exists;
|
||||
Boolean exists;
|
||||
short direction;
|
||||
out_wandering_type what_monst;
|
||||
location which_sector,m_loc;
|
||||
@@ -253,6 +253,7 @@ namespace legacy {
|
||||
location outdoor_corner,i_w_c,p_loc,loc_in_sec;
|
||||
boat_record_type boats[30];
|
||||
horse_record_type horses[30];
|
||||
//char pad1[8];
|
||||
creature_list_type creature_save[4];
|
||||
short in_boat,in_horse;
|
||||
outdoor_creature_type out_c[10];
|
||||
@@ -265,7 +266,7 @@ namespace legacy {
|
||||
talk_save_type talk_save[120];
|
||||
short direction,at_which_save_slot;
|
||||
char alchemy[20];
|
||||
bool can_find_town[200];
|
||||
Boolean can_find_town[200];
|
||||
short key_times[100];
|
||||
short party_event_timers[30];
|
||||
short global_or_town[30];
|
||||
@@ -326,10 +327,10 @@ namespace legacy {
|
||||
short max_health,cur_health,max_sp,cur_sp,experience,skill_pts,level;
|
||||
short status[15];
|
||||
item_record_type items[24];
|
||||
bool equip[24];
|
||||
bool priest_spells[62],mage_spells[62];
|
||||
Boolean equip[24];
|
||||
Boolean priest_spells[62],mage_spells[62];
|
||||
short which_graphic,weap_poisoned;
|
||||
bool advan[15],traits[15];
|
||||
Boolean advan[15],traits[15];
|
||||
short race,exp_adj,direction;
|
||||
} __attribute__((packed));
|
||||
|
||||
@@ -353,9 +354,9 @@ namespace legacy {
|
||||
short town_num, difficulty;
|
||||
town_record_type town;
|
||||
char explored[64][64];
|
||||
bool hostile;
|
||||
Boolean hostile;
|
||||
creature_list_type monst;
|
||||
bool in_boat;
|
||||
Boolean in_boat;
|
||||
location p_loc;
|
||||
} __attribute__((packed));
|
||||
|
||||
|
||||
@@ -284,11 +284,11 @@ void rect_draw_some_item (GWorldPtr src_gworld,Rect src_rect,GWorldPtr targ_gwor
|
||||
SetPort(cur_port);
|
||||
}
|
||||
|
||||
void char_win_draw_string(WindowPtr dest_window,Rect dest_rect,char *str,short mode,short line_height,bool main_win){
|
||||
void char_win_draw_string(WindowPtr dest_window,Rect dest_rect,const char *str,short mode,short line_height,bool main_win){
|
||||
char_port_draw_string(GetWindowPort(dest_window),dest_rect,str,mode,line_height, main_win);
|
||||
}
|
||||
|
||||
void char_port_draw_string(GrafPtr dest_window,Rect dest_rect,char *str,short mode,short line_height,bool main_win){
|
||||
void char_port_draw_string(GrafPtr dest_window,Rect dest_rect,const char *str,short mode,short line_height,bool main_win){
|
||||
Str255 store_s;
|
||||
|
||||
strcpy((char*) store_s,str);
|
||||
@@ -723,6 +723,15 @@ Rect get_custom_rect (short which_rect){
|
||||
return store_rect;
|
||||
}
|
||||
|
||||
short get_custom_rect (short which_rect, Rect& store_rect){ // returns the number of the sheet to use
|
||||
short sheet = which_rect / 100;
|
||||
which_rect %= 100;
|
||||
SetRect(&store_rect,0,0,28,36);
|
||||
|
||||
OffsetRect(&store_rect,28 * (which_rect % 10),36 * (which_rect / 10));
|
||||
return sheet;
|
||||
}
|
||||
|
||||
void get_str(Str255 str,short i, short j){
|
||||
GetIndString(str, i, j);
|
||||
p2cstr(str);
|
||||
|
||||
@@ -18,14 +18,15 @@ void set_cursor(short which_curs);
|
||||
void restore_cursor();
|
||||
void rect_draw_some_item (GWorldPtr src_gworld,Rect src_rect,GWorldPtr targ_gworld,Rect targ_rect,
|
||||
char masked,short main_win);
|
||||
void char_win_draw_string(WindowPtr dest_window,Rect dest_rect,char *str,short mode,short line_height,bool main_win);
|
||||
void char_port_draw_string(GrafPtr dest_window,Rect dest_rect,char *str,short mode,short line_height,bool main_win);
|
||||
void char_win_draw_string(WindowPtr dest_window,Rect dest_rect,const char *str,short mode,short line_height,bool main_win);
|
||||
void char_port_draw_string(GrafPtr dest_window,Rect dest_rect,const 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(const char *str);
|
||||
//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);
|
||||
short get_custom_rect (short which_rect, Rect& store_rect);
|
||||
void get_str(Str255 str,short i, short j);
|
||||
GWorldPtr importPictureFileToGWorld(const FSSpec *fileSpec);
|
||||
void writeGWorldToPNGFile(GWorldPtr gw, const FSSpec *fileSpec);
|
||||
|
||||
@@ -58,3 +58,13 @@ short move_to_zero(short val){
|
||||
return val - 1;
|
||||
return val;
|
||||
}
|
||||
|
||||
short gcd(short a, short b){ // Grabbed from Wikipedia and translated to C code
|
||||
short t;
|
||||
while(b != 0){
|
||||
t = b;
|
||||
b = a % b;
|
||||
a = t;
|
||||
}
|
||||
return a;
|
||||
}
|
||||
@@ -13,3 +13,4 @@ short max(short a,short b);
|
||||
short min(short a,short b);
|
||||
short minmax(short min,short max,short k);
|
||||
short move_to_zero(short val);
|
||||
short gcd(short a, short b);
|
||||
|
||||
Reference in New Issue
Block a user