- Tidied scenario editor code – proper indentation applied, no more multiple statements on one line, etc

- Changed various terrain arrays from unsigned char to unsigned short to support more than 256 terrain types.

git-svn-id: http://openexile.googlecode.com/svn/trunk@42 4ebdad44-0ea0-11de-aab3-ff745001d230
This commit is contained in:
2009-04-28 16:45:32 +00:00
parent 049754ea27
commit 3efed5dcc7
17 changed files with 5219 additions and 5280 deletions

View File

@@ -1093,39 +1093,13 @@
GCC_INPUT_FILETYPE = sourcecode.cpp.cpp;
GCC_MODEL_TUNING = G4;
GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = NO;
GCC_WARN_ABOUT_INVALID_OFFSETOF_MACRO = NO;
GCC_WARN_ABOUT_MISSING_NEWLINE = YES;
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_CHECK_SWITCH_STATEMENTS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_LABEL = YES;
GCC_WARN_UNUSED_PARAMETER = YES;
GCC_WARN_UNUSED_VALUE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
HEADER_SEARCH_PATHS = "/usr/include/c++/4.0.0/";
LIBRARY_SEARCH_PATHS = "";
LINK_WITH_STANDARD_LIBRARIES = YES;
MACOSX_DEPLOYMENT_TARGET_i386 = 10.4;
MACOSX_DEPLOYMENT_TARGET_ppc = 10.3;
OTHER_LDFLAGS_QUOTED_FOR_PROJECT_1 = "\"$(PROJECT_DIR)/misc/\"";
SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.4u.sdk";
SDKROOT_i386 = /Developer/SDKs/MacOSX10.4u.sdk;
SDKROOT_ppc = /Developer/SDKs/MacOSX10.4u.sdk;
STANDARD_C_PLUS_PLUS_LIBRARY_TYPE = static;
STRIP_INSTALLED_PRODUCT = NO;
};
name = Debug;
};
2BF04AA40BF51845006C0831 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = (
i386,
ppc,
);
COPY_PHASE_STRIP = YES;
GCC_CHAR_IS_UNSIGNED_CHAR = YES;
GCC_INPUT_FILETYPE = sourcecode.cpp.cpp;
GCC_ONE_BYTE_BOOL = YES;
GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = NO;
GCC_WARN_CHECK_SWITCH_STATEMENTS = YES;
GCC_WARN_MISSING_PARENTHESES = YES;
GCC_WARN_PROTOTYPE_CONVERSION = YES;
GCC_WARN_SIGN_COMPARE = YES;
GCC_WARN_TYPECHECK_CALLS_TO_PRINTF = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
@@ -1143,7 +1117,56 @@
SDKROOT_i386 = /Developer/SDKs/MacOSX10.4u.sdk;
SDKROOT_ppc = /Developer/SDKs/MacOSX10.4u.sdk;
STANDARD_C_PLUS_PLUS_LIBRARY_TYPE = static;
WARNING_CFLAGS = "float-equal";
STRIP_INSTALLED_PRODUCT = NO;
WARNING_CFLAGS = (
"-Wfloat-equal",
"-Wpadded",
"-Wno-long-long",
);
};
name = Debug;
};
2BF04AA40BF51845006C0831 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = (
i386,
ppc,
);
COPY_PHASE_STRIP = YES;
GCC_CHAR_IS_UNSIGNED_CHAR = YES;
GCC_INPUT_FILETYPE = sourcecode.cpp.cpp;
GCC_ONE_BYTE_BOOL = YES;
GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = NO;
GCC_WARN_ABOUT_INVALID_OFFSETOF_MACRO = NO;
GCC_WARN_ABOUT_MISSING_NEWLINE = YES;
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_CHECK_SWITCH_STATEMENTS = YES;
GCC_WARN_MISSING_PARENTHESES = YES;
GCC_WARN_PROTOTYPE_CONVERSION = YES;
GCC_WARN_SIGN_COMPARE = YES;
GCC_WARN_TYPECHECK_CALLS_TO_PRINTF = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_LABEL = YES;
GCC_WARN_UNUSED_PARAMETER = YES;
GCC_WARN_UNUSED_VALUE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
HEADER_SEARCH_PATHS = "/usr/include/c++/4.0.0/";
LIBRARY_SEARCH_PATHS = "";
LINK_WITH_STANDARD_LIBRARIES = YES;
MACOSX_DEPLOYMENT_TARGET_i386 = 10.4;
MACOSX_DEPLOYMENT_TARGET_ppc = 10.3;
OTHER_LDFLAGS_QUOTED_FOR_PROJECT_1 = "\"$(PROJECT_DIR)/misc/\"";
SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.4u.sdk";
SDKROOT_i386 = /Developer/SDKs/MacOSX10.4u.sdk;
SDKROOT_ppc = /Developer/SDKs/MacOSX10.4u.sdk;
STANDARD_C_PLUS_PLUS_LIBRARY_TYPE = static;
WARNING_CFLAGS = (
"-Wfloat-equal",
"-Wpadded",
"-Wno-long-long",
);
};
name = Release;
};

File diff suppressed because it is too large Load Diff

View File

@@ -62,8 +62,7 @@ void reset_lb() {
// is slot >= 0, force that slot
// if -1, use 1st free slot
void set_lb(short slot, short mode, char *label, short do_draw)
{
void set_lb(short slot, short mode, char *label, short do_draw) {
short i;
if (slot < 0) {
@@ -86,8 +85,7 @@ void set_lb(short slot, short mode, char *label, short do_draw)
void init_rb()
{
void init_rb() {
short i;
SetControlMinimum(right_sbar,0);
@@ -98,8 +96,7 @@ void init_rb()
}
}
void reset_rb()
{
void reset_rb() {
short i;
for (i = 0; i < NRS; i++) {
@@ -112,8 +109,7 @@ void reset_rb()
// is slot >= 0, force that slot
// if -1, use 1st free slot
void set_rb(short slot, short mode, char *label, short do_draw)
{
void set_rb(short slot, short mode, char *label, short do_draw) {
short i,highest_used = 0;
if (slot < 0) {

View File

@@ -66,7 +66,8 @@ unsigned char m_level[200] = {
18,18,22,22,10,30,20,27,30,7, // 160
30,15,12,18,3,5,7,39,20,24, // 170
24,8,7,25,2,10,18,0,0,0, // 180
0,0,0,0,0,0,0,0,0,0}; // 190
0,0,0,0,0,0,0,0,0,0
}; // 190
short m_health[200] = {
0,6,6,6,6,6,6,6,6,6, // 0
@@ -88,7 +89,8 @@ short m_health[200] = {
70,70,90,120,100,200,100,150,200,40, // 160
500,100,80,110,17,30,30,2500,100,125, // 170
140,40,10,80,6,30,50,150,0,0, // 180
0,0,0,0,0,0,0,0,0,0}; // 190
0,0,0,0,0,0,0,0,0,0
}; // 190
unsigned char m_armor[200] = {
1,1,1,1,1,1,1,1,1,1, // 0
@@ -110,7 +112,8 @@ unsigned char m_armor[200] = {
14,14,18,25,25,25,20,30,9,0, // 160
15,6,10,14,3,1,10,40,14,14, // 170
10,6,30,20,1,2,4,12,0,0, // 180
0,0,0,0,0,0,0,0,0,0}; // 190
0,0,0,0,0,0,0,0,0,0
}; // 190
unsigned char m_skill[200] = {
2,2,2,2,2,2,2,2,2,1, // 0
@@ -132,7 +135,8 @@ unsigned char m_skill[200] = {
15,15,13,26,0,0,30,36,30,4, // 160
26,18,15,17,6,5,10,35,20,20, // 170
17,7,2,16,2,8,14,18,0,0, // 180
0,0,0,0,0,0,0,0,0,0}; // 190
0,0,0,0,0,0,0,0,0,0
}; // 190
short m_a1[200] = {
6,6,6,6,6,6,6,6,6,1, // 0
@@ -154,7 +158,8 @@ short m_a1[200] = {
310,310,10,410,0,0,810,913,913,8, // 160
710,512,210,212,12,0,208,840,308,308, // 170
308,209,8,912,8,108,210,312,0,0, // 180
0,0,0,0,0,0,0,0,0,0}; // 190
0,0,0,0,0,0,0,0,0,0
}; // 190
short m_a2[200] = {
0,0,0,0,0,0,0,0,0,0, // 0
@@ -176,7 +181,8 @@ short m_a2[200] = {
0,0,0,0,0,0,0,0,0,0, // 160
310,0,108,12,0,105,0,730,308,308, // 170
308,209,0,0,0,0,0,212,0,0, // 180
0,0,0,0,0,0,0,0,0,0}; // 190
0,0,0,0,0,0,0,0,0,0
}; // 190
short m_a3[200] = {
0,0,0,0,0,0,0,0,0,0, // 0
@@ -198,7 +204,8 @@ short m_a3[200] = {
0,0,0,0,0,0,0,0,0,0, // 160
310,0,108,12,0,105,0,730,308,308, // 170
308,0,0,0,0,0,0,212,0,0, // 180
0,0,0,0,0,0,0,0,0,0}; // 190
0,0,0,0,0,0,0,0,0,0
}; // 190
unsigned char m_a1t[200] = {
0,0,0,0,0,0,0,0,0,0, // 0
@@ -220,7 +227,8 @@ unsigned char m_a1t[200] = {
0,0,0,0,0,0,2,2,2,4, // 160
2,2,2,2,0,0,3,2,2,2,// 170
2,2,7,9,0,0,0,2,0,0, // 180
0,0,0,0,0,0,0,0,0,0}; // 190
0,0,0,0,0,0,0,0,0,0
}; // 190
unsigned char m_a23t[200] = {
0,0,0,0,0,0,0,0,0,0, // 0
@@ -242,7 +250,8 @@ unsigned char m_a23t[200] = {
0,0,0,0,0,0,0,0,0,0,
1,1,1,1,0,1,0,1,2,2,
2,2,0,0,0,0,0,1,0,0,
0,0,0,0,0,0,0,0,0,0}; // 190
0,0,0,0,0,0,0,0,0,0
}; // 190
unsigned char m_type[200] = {
@@ -265,7 +274,8 @@ unsigned char m_type[200] = {
11,11,11,11,11,11,2,2,2,6, // 160
1,2,2,2,1,8,10,13,1,1, // 170
1,1,14,14,6,6,6,7,0,0, // 180
0,0,0,0,0,0,0,0,0,0}; // 190
0,0,0,0,0,0,0,0,0,0
}; // 190
unsigned char m_speed[200] = {
0,4,4,4,4,4,4,4,4,4, // 0
@@ -287,7 +297,8 @@ unsigned char m_speed[200] = {
4,4,4,7,4,4,4,5,3,4, // 160
4,4,3,4,4,3,4,4,4,4, // 170
4,4,9,8,3,5,5,6,4,4, // 180
4,4,4,4,4,4,4,4,4,4}; // 190
4,4,4,4,4,4,4,4,4,4
}; // 190
unsigned char m_mu[200] = {
0,0,0,0,0,0,0,0,0,0, // 0
@@ -309,7 +320,8 @@ unsigned char m_mu[200] = {
0,0,0,0,0,7,0,0,0,0,
5,0,0,0,0,0,0,7,0,0,
0,0,3,2,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0}; // 190
0,0,0,0,0,0,0,0,0,0
}; // 190
unsigned char m_cl[200] = {
0,0,0,0,0,0,0,0,0,0, // 0
@@ -331,7 +343,8 @@ unsigned char m_cl[200] = {
0,0,0,5,0,7,0,0,0,0,
7,0,0,0,0,0,0,7,0,0,
0,0,0,2,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0}; // 190
0,0,0,0,0,0,0,0,0,0
}; // 190
unsigned char m_breath[200] = {
0,0,0,0,0,0,0,0,0,0, // 0
@@ -353,7 +366,8 @@ unsigned char m_breath[200] = {
7,107,208,9,209,0,0,0,0,0,
9,0,0,0,0,0,0,35,0,15,
115,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0}; // 190
0,0,0,0,0,0,0,0,0,0
}; // 190
unsigned char m_poison[200] = {
0,0,0,0,0,0,0,0,0,0, // 0
@@ -375,7 +389,8 @@ unsigned char m_poison[200] = {
0,0,0,0,0,0,0,6,7,0,
0,0,0,4,1,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0}; // 190
0,0,0,0,0,0,0,0,0,0
}; // 190
unsigned char m_treas[200] = {
0,0,0,0,0,0,0,0,0,0, // 0
@@ -397,7 +412,8 @@ unsigned char m_treas[200] = {
0,0,0,0,0,0,0,0,3,2, // 160
3,2,1,2,0,0,0,4,2,3, // 170
3,0,0,0,1,2,3,0,0,0, // 180
0,0,0,0,0,0,0,0,0,0}; // 190
0,0,0,0,0,0,0,0,0,0
}; // 190
unsigned char m_abil[200] = {
0,0,0,0,0,0,0,0,0,0, // 0
@@ -419,7 +435,8 @@ unsigned char m_abil[200] = {
0,0,33,28,24,9,0,0,29,0, // 160
0,34,0,32,0,0,31,13,0,0, // 170
0,0,28,29,0,0,0,33,0,0, // 180
0,0,0,0,0,0,0,0,0,0}; // 190
0,0,0,0,0,0,0,0,0,0
}; // 190
unsigned char m_pict[200] = {
0,1,2,3,4,5,6,7,8,9, // 0
@@ -441,7 +458,8 @@ unsigned char m_pict[200] = {
147,148,149,150,151,152,153,154,155,159, // 160
160,164,166,168,170,61,74,95,160,160, // 170
171,172,173,174,160,3,5,173,143,0, // 180
0,0,0,0,0,0,0,0,0,0}; // 190
0,0,0,0,0,0,0,0,0,0
}; // 190
unsigned char m_magic_r[200] = {
@@ -464,7 +482,8 @@ unsigned char m_magic_r[200] = {
1,1,1,1,2,2,0,0,1,2,
1,0,0,1,0,0,1,2,0,0,
0,0,2,1,0,0,0,2,0,0,
0,0,0,0,0,0,0,0,0,0}; // 190
0,0,0,0,0,0,0,0,0,0
}; // 190
unsigned char m_fire_r[200] = {
0,0,0,0,0,0,0,0,0,0, // 0
@@ -486,7 +505,8 @@ unsigned char m_fire_r[200] = {
2,0,0,1,2,2,0,0,0,0,
2,0,0,0,0,0,1,2,0,2,
0,0,2,1,0,0,0,1,0,0,
0,0,0,0,0,0,0,0,0,0}; // 190
0,0,0,0,0,0,0,0,0,0
}; // 190
unsigned char m_cold_r[200] = {
0,0,0,0,0,0,0,0,0,0, // 0
@@ -508,7 +528,8 @@ unsigned char m_cold_r[200] = {
0,2,0,1,2,2,0,0,0,0,
0,0,0,0,0,2,0,1,0,0,
2,0,2,1,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0}; // 190
0,0,0,0,0,0,0,0,0,0
}; // 190
unsigned char m_poison_r[200] = {
0,0,0,0,0,0,0,0,0,0, // 0
@@ -530,9 +551,11 @@ unsigned char m_poison_r[200] = {
2,2,2,1,2,2,0,0,0,0,
1,1,0,0,0,2,2,1,0,0,
0,0,2,2,0,0,0,2,0,0,
0,0,0,0,0,0,0,0,0,0}; // 190
0,0,0,0,0,0,0,0,0,0
}; // 190
short ter_pics[256] = {0,1,2,3,4,5,6,6,7,8,
short ter_pics[256] = {
0,1,2,3,4,5,6,6,7,8,
8,9,10,10,11,12,12,13,14,15,
16,17,18,19,20,21,22,23,24,25,
26,27,28,29,30,31,32,33,34,35,
@@ -557,7 +580,8 @@ short ter_pics[256] = {0,1,2,3,4,5,6,6,7,8,
166,167,168,169,170,171,172,173,174,175,
176,177,187,188,189,190,2,192,193,195,
194,196,197,191,200,201,207,208,209,210,
211,212,407,408,409,410};
211,212,407,408,409,410
};
short ter_block[256] = {
0,0,0,0,0,5,5,1,5,5,
@@ -589,7 +613,8 @@ short ter_block[256] = {
0,0,4,4,0,0,4,4,4,4,
4,4,5,5,5,5,5,5,5,5,
5,5,5,5,5,5,2,2,2,2,
2,2,0,0,0,0};
2,2,0,0,0,0
};
short ter_traits[256] = {
0,0,0,0,0,0,0,0,0,0,
@@ -621,10 +646,10 @@ short ter_traits[256] = {
0,14,0,14,20,0,0,0,0,0,
0,0,21,21,21,21,21,21,21,21,
21,21,21,21,21,21,0,0,0,0,
0,0,16,17,18,19};
0,0,16,17,18,19
};
cMonster return_monster_template(unsigned char store)
{
cMonster return_monster_template(unsigned char store) {
cMonster monst;
short m_num,i;
@@ -765,8 +790,7 @@ cMonster return_monster_template(unsigned char store)
// return i;
//}
void init_scenario()
{
void init_scenario() {
short i;
rectangle dummy_rect;
Str255 temp_str;
@@ -868,8 +892,7 @@ void init_scenario()
scenario.scen_str_len[i] = strlen((char *) scenario.scen_strs(i));
}
}
void put_ter_info_in_dlog()
{
void put_ter_info_in_dlog() {
Str255 str;
cdsin(813,12,store_which_ter);
@@ -899,8 +922,7 @@ void put_ter_info_in_dlog()
else csp(813,14,store_ter.picture,PICT_TER);
}
bool save_ter_info()
{
bool save_ter_info() {
Str255 str;
short i;
@@ -959,17 +981,18 @@ bool save_ter_info()
return true;
}
void edit_ter_type_event_filter (short item_hit)
{
void edit_ter_type_event_filter (short item_hit) {
Str255 str;
short i;
switch (item_hit) {
case 9:
toast_dialog(); break;
toast_dialog();
break;
case 62:
if (save_ter_info() == true)
toast_dialog(); break;
toast_dialog();
break;
case 10:
if (save_ter_info() == false) break;
store_which_ter--;
@@ -1019,9 +1042,8 @@ void edit_ter_type_event_filter (short item_hit)
}
}
short edit_ter_type(short which_ter)
short edit_ter_type(short which_ter) {
// ignore parent in Mac version
{
short item_hit,i,store_dialog_answer;
Str255 temp_str;
char *blocked_strs[6] = {"Clear","Walk through, Opaque","Clear, Special","Clear, Blocked","Blocked, Obstructed",
@@ -1051,8 +1073,7 @@ short edit_ter_type(short which_ter)
return 0;
}
void put_monst_info_in_dlog()
{
void put_monst_info_in_dlog() {
Str255 str;
if (store_monst.picture_num < 1000)
@@ -1106,8 +1127,7 @@ void put_monst_info_in_dlog()
csit(814,44,(char *) str);
}
bool save_monst_info()
{
bool save_monst_info() {
Str255 str;
short i;
@@ -1120,13 +1140,21 @@ bool save_monst_info()
// later check pic num for error, and assign widths if custom
if (store_monst.picture_num >= 1000) {
if ((store_monst.picture_num >= 1000) && (store_monst.picture_num < 2000)) {
store_monst.x_width = 1; store_monst.y_width = 1; }
store_monst.x_width = 1;
store_monst.y_width = 1;
}
if ((store_monst.picture_num >= 2000) && (store_monst.picture_num < 3000)) {
store_monst.x_width = 2; store_monst.y_width = 1; }
store_monst.x_width = 2;
store_monst.y_width = 1;
}
if ((store_monst.picture_num >= 3000) && (store_monst.picture_num < 4000)) {
store_monst.x_width = 1; store_monst.y_width = 2; }
store_monst.x_width = 1;
store_monst.y_width = 2;
}
if ((store_monst.picture_num >= 4000) && (store_monst.picture_num < 5000)) {
store_monst.x_width = 2; store_monst.y_width = 2; }
store_monst.x_width = 2;
store_monst.y_width = 2;
}
}
else {
if (cre(store_monst.picture_num,0,174,"Non-customized monster pic must be from 0 to 173.","",814) > 0) return false;
@@ -1175,15 +1203,15 @@ bool save_monst_info()
return true;
}
void edit_monst_type_event_filter (short item_hit)
{
void edit_monst_type_event_filter (short item_hit) {
Str255 str;
short i;
cMonster temp_monst;
switch (item_hit) {
case 20:
toast_dialog(); break;
toast_dialog();
break;
case 19:
if (save_monst_info() == true) {
scenario.scen_monsters[store_which_monst] = store_monst;
@@ -1265,9 +1293,8 @@ void edit_monst_type_event_filter (short item_hit)
}
}
short edit_monst_type(short which_monst)
short edit_monst_type(short which_monst) {
// ignore parent in Mac version
{
short item_hit,i,store_dialog_answer;
Str255 temp_str;
char *attitude[4] = {"Friendly, Docile","Hostile, Type A","Friendly, Will Fight","Hostile, Type B"};
@@ -1291,8 +1318,7 @@ short edit_monst_type(short which_monst)
return 0;
}
void put_monst_abils_in_dlog()
{
void put_monst_abils_in_dlog() {
Str255 str;
short i;
@@ -1325,8 +1351,7 @@ void put_monst_abils_in_dlog()
if (store_monst2.immunities & 128 ) cd_set_led(815,20,1);
}
bool save_monst_abils()
{
bool save_monst_abils() {
Str255 str;
short i;
@@ -1358,14 +1383,15 @@ bool save_monst_abils()
return true;
}
void edit_monst_abil_event_filter (short item_hit)
{
void edit_monst_abil_event_filter (short item_hit) {
Str255 str;
short i;
switch (item_hit) {
case 8: store_monst2.level = -1;
toast_dialog(); break;
case 8:
store_monst2.level = -1;
toast_dialog();
break;
case 7:
if (save_monst_abils() == true)
toast_dialog();
@@ -1396,9 +1422,8 @@ void edit_monst_abil_event_filter (short item_hit)
}
}
cMonster edit_monst_abil(cMonster starting_record,short parent_num)
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;
@@ -1433,8 +1458,7 @@ cMonster edit_monst_abil(cMonster starting_record,short parent_num)
return store_monst2;
}
void put_item_info_in_dlog()
{
void put_item_info_in_dlog() {
Str255 str;
cdsin(818,52,store_which_item);
@@ -1458,8 +1482,7 @@ void put_item_info_in_dlog()
}
bool save_item_info()
{
bool save_item_info() {
Str255 str;
short i;
@@ -1513,18 +1536,18 @@ bool save_item_info()
return true;
}
void edit_item_type_event_filter (short item_hit)
{
void edit_item_type_event_filter (short item_hit) {
Str255 str;
short i;
cItemRec temp_item;
switch (item_hit) {
case 15:
toast_dialog(); break;
toast_dialog();
break;
case 14:
if (save_item_info() == true)
toast_dialog(); break;
toast_dialog();
break;
case 16:
@@ -1574,9 +1597,8 @@ void edit_item_type_event_filter (short item_hit)
}
}
short edit_item_type(short which_item)
short edit_item_type(short which_item) {
// ignore parent in Mac version
{
short item_hit,i,store_dialog_answer;
Str255 temp_str;
@@ -1602,8 +1624,7 @@ short edit_item_type(short which_item)
return 0;
}
void put_item_abils_in_dlog()
{
void put_item_abils_in_dlog() {
Str255 str;
short i;
@@ -1630,8 +1651,7 @@ void put_item_abils_in_dlog()
else cd_set_led(824,12,0);
}
bool save_item_abils()
{
bool save_item_abils() {
Str255 str;
short i;
@@ -1650,14 +1670,15 @@ bool save_item_abils()
return true;
}
void edit_item_abil_event_filter (short item_hit)
{
void edit_item_abil_event_filter (short item_hit) {
Str255 str;
short i;
switch (item_hit) {
case 4: store_item2.ability = 0;
toast_dialog(); break;
case 4:
store_item2.ability = 0;
toast_dialog();
break;
case 3:
if (save_item_abils() == true)
toast_dialog();
@@ -1740,9 +1761,8 @@ void edit_item_abil_event_filter (short item_hit)
}
}
cItemRec edit_item_abil(cItemRec starting_record,short parent_num)
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;
@@ -1775,8 +1795,7 @@ cItemRec edit_item_abil(cItemRec starting_record,short parent_num)
return store_item2;
}
void put_spec_item_in_dlog()
{
void put_spec_item_in_dlog() {
Str255 str;
short i;
@@ -1785,13 +1804,14 @@ void put_spec_item_in_dlog()
CDST(806,3,scenario.scen_strs(60 + store_which_spec_item * 2 + 1));
CDSN(806,4,scenario.special_item_special[store_which_spec_item]);
if (scenario.special_items[store_which_spec_item] >= 10)
cd_set_led(806,15,1); else cd_set_led(806,15,0);
cd_set_led(806,15,1);
else cd_set_led(806,15,0);
if (scenario.special_items[store_which_spec_item] % 10 > 0)
cd_set_led(806,17,1); else cd_set_led(806,17,0);
cd_set_led(806,17,1);
else cd_set_led(806,17,0);
}
bool save_spec_item()
{
bool save_spec_item() {
Str255 str;
short i;
@@ -1811,14 +1831,14 @@ bool save_spec_item()
return true;
}
void edit_spec_item_event_filter (short spec_item_hit)
{
void edit_spec_item_event_filter (short spec_item_hit) {
Str255 str;
short i,spec;
switch (spec_item_hit) {
case 11:
toast_dialog(); break;
toast_dialog();
break;
case 5:
if (save_spec_item() == true)
toast_dialog();
@@ -1865,9 +1885,8 @@ void edit_spec_item_event_filter (short spec_item_hit)
}
}
void edit_spec_item(short which_item)
void edit_spec_item(short which_item) {
// ignore parent in Mac version
{
short spec_item_hit,i,store_dialog_answer;
Str255 temp_str;
@@ -1887,8 +1906,7 @@ void edit_spec_item(short which_item)
cd_kill_dialog(806,0);
}
void put_save_rects_in_dlog()
{
void put_save_rects_in_dlog() {
Str255 str;
short i;
@@ -1903,8 +1921,7 @@ void put_save_rects_in_dlog()
}
bool save_save_rects()
{
bool save_save_rects() {
Str255 str;
short i;
@@ -1934,14 +1951,14 @@ bool save_save_rects()
return true;
}
void edit_save_rects_event_filter (short save_rects_hit)
{
void edit_save_rects_event_filter (short save_rects_hit) {
Str255 str;
short i;
switch (save_rects_hit) {
case 18:
toast_dialog(); break;
toast_dialog();
break;
case 17:
if (save_save_rects() == true)
toast_dialog();
@@ -1950,9 +1967,8 @@ void edit_save_rects_event_filter (short save_rects_hit)
}
}
void edit_save_rects()
void edit_save_rects() {
// ignore parent in Mac version
{
short save_rects_hit,i,store_dialog_answer;
Str255 temp_str;
@@ -1964,8 +1980,7 @@ void edit_save_rects()
cd_kill_dialog(807,0);
}
bool save_horses()
{
bool save_horses() {
Str255 str;
short i;
@@ -1984,8 +1999,7 @@ bool save_horses()
return true;
}
void put_horses_in_dlog()
{
void put_horses_in_dlog() {
Str255 str;
short i;
@@ -1999,8 +2013,7 @@ void put_horses_in_dlog()
}
void edit_horses_event_filter (short item_hit)
{
void edit_horses_event_filter (short item_hit) {
Str255 str;
short i;
@@ -2028,9 +2041,8 @@ void edit_horses_event_filter (short item_hit)
}
}
void edit_horses()
void edit_horses() {
// ignore parent in Mac version
{
short horses_hit,i,store_dialog_answer;
Str255 temp_str;
@@ -2044,8 +2056,7 @@ void edit_horses()
cd_kill_dialog(808,0);
}
bool save_boats()
{
bool save_boats() {
Str255 str;
short i;
@@ -2064,8 +2075,7 @@ bool save_boats()
return true;
}
void put_boats_in_dlog()
{
void put_boats_in_dlog() {
Str255 str;
short i;
@@ -2079,8 +2089,7 @@ void put_boats_in_dlog()
}
void edit_boats_event_filter (short item_hit)
{
void edit_boats_event_filter (short item_hit) {
Str255 str;
short i;
@@ -2108,9 +2117,8 @@ void edit_boats_event_filter (short item_hit)
}
}
void edit_boats()
void edit_boats() {
// ignore parent in Mac version
{
short boats_hit,i,store_dialog_answer;
Str255 temp_str;
@@ -2124,8 +2132,7 @@ void edit_boats()
cd_kill_dialog(809,0);
}
bool save_add_town()
{
bool save_add_town() {
Str255 str;
short i;
@@ -2143,8 +2150,7 @@ bool save_add_town()
return true;
}
void put_add_town_in_dlog()
{
void put_add_town_in_dlog() {
Str255 str;
short i;
@@ -2156,8 +2162,7 @@ void put_add_town_in_dlog()
}
void edit_add_town_event_filter (short item_hit)
{
void edit_add_town_event_filter (short item_hit) {
Str255 str;
short i;
@@ -2170,9 +2175,8 @@ void edit_add_town_event_filter (short item_hit)
}
}
void edit_add_town()
void edit_add_town() {
// ignore parent in Mac version
{
short add_town_hit,i,store_dialog_answer;
Str255 temp_str;
@@ -2184,8 +2188,7 @@ void edit_add_town()
cd_kill_dialog(810,0);
}
bool save_item_placement()
{
bool save_item_placement() {
Str255 str;
short i;
@@ -2206,8 +2209,7 @@ bool save_item_placement()
return true;
}
void put_item_placement_in_dlog()
{
void put_item_placement_in_dlog() {
Str255 str;
short i;
@@ -2221,8 +2223,7 @@ void put_item_placement_in_dlog()
}
void edit_item_placement_event_filter (short item_hit)
{
void edit_item_placement_event_filter (short item_hit) {
Str255 str;
short i;
@@ -2267,9 +2268,8 @@ void edit_item_placement_event_filter (short item_hit)
}
}
void edit_item_placement()
void edit_item_placement() {
// ignore parent in Mac version
{
short item_placement_hit,i,store_dialog_answer;
Str255 temp_str;
@@ -2284,8 +2284,7 @@ void edit_item_placement()
cd_kill_dialog(812,0);
}
bool save_scen_details()
{
bool save_scen_details() {
Str255 str;
short i;
@@ -2308,8 +2307,7 @@ bool save_scen_details()
return true;
}
void put_scen_details_in_dlog()
{
void put_scen_details_in_dlog() {
Str255 str;
short i;
@@ -2323,8 +2321,7 @@ void put_scen_details_in_dlog()
CDST(803,7,scenario.scen_strs(3));
}
void edit_scen_details_event_filter (short item_hit)
{
void edit_scen_details_event_filter (short item_hit) {
Str255 str;
short i;
@@ -2340,9 +2337,8 @@ void edit_scen_details_event_filter (short item_hit)
}
}
void edit_scen_details()
void edit_scen_details() {
// ignore parent in Mac version
{
short scen_details_hit,i,store_dialog_answer;
Str255 temp_str;
@@ -2356,8 +2352,7 @@ void edit_scen_details()
void put_make_scen_1_in_dlog()
{
void put_make_scen_1_in_dlog() {
Str255 str;
short i;
@@ -2365,8 +2360,7 @@ void put_make_scen_1_in_dlog()
CDST(800,3,"filename");
}
void edit_make_scen_1_event_filter (short item_hit)
{
void edit_make_scen_1_event_filter (short item_hit) {
Str255 str;
short i,j;
@@ -2400,9 +2394,8 @@ void edit_make_scen_1_event_filter (short item_hit)
}
}
short edit_make_scen_1(char *filename,char *title,short *grass)
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;
@@ -2419,8 +2412,7 @@ short edit_make_scen_1(char *filename,char *title,short *grass)
return dialog_answer;
}
void put_make_scen_2_in_dlog()
{
void put_make_scen_2_in_dlog() {
Str255 str;
short i;
@@ -2431,8 +2423,7 @@ void put_make_scen_2_in_dlog()
CDSN(801,6,0);
}
void edit_make_scen_2_event_filter (short item_hit)
{
void edit_make_scen_2_event_filter (short item_hit) {
Str255 str;
short i,j,k;
@@ -2470,9 +2461,8 @@ void edit_make_scen_2_event_filter (short item_hit)
}
}
short edit_make_scen_2(short *val_array)
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;
@@ -2490,8 +2480,7 @@ short edit_make_scen_2(short *val_array)
return dialog_answer;
}
bool build_scenario()
{
bool build_scenario() {
printf("Building a scenario currently disabled.\n");
// short two_flags[6]; // width, height, large, med, small, default_town
// Str255 f_name,f_name2,title;
@@ -2533,7 +2522,8 @@ bool build_scenario()
// // now make sure correct outdoors is in memory, because we're going to be saving scenarios
// // for a while
// overall_mode = 60;
// cur_out.x = 0; cur_out.y = 0;
// cur_out.x = 0;
// cur_out.y = 0;
// load_outdoors(cur_out,0);
//
// for (i = 0; i < two_flags[2]; i++) {
@@ -2579,8 +2569,7 @@ bool build_scenario()
// update_item_menu();
}
void user_password_filter (short item_hit)
{
void user_password_filter (short item_hit) {
Str255 str;
short i;
@@ -2597,9 +2586,8 @@ void user_password_filter (short item_hit)
}
}
short get_password()
short get_password() {
// ignore parent in Mac version
{
short town_strs_hit,i,store_dialog_answer;
Str255 temp_str,str2;
@@ -2617,8 +2605,7 @@ short get_password()
return i;
}
void set_starting_loc_filter (short item_hit)
{
void set_starting_loc_filter (short item_hit) {
Str255 str;
short i,j,k;
@@ -2648,9 +2635,8 @@ void set_starting_loc_filter (short item_hit)
}
}
void set_starting_loc()
void set_starting_loc() {
// ignore parent in Mac version
{
short town_strs_hit,i,store_dialog_answer;
Str255 temp_str,str2;
@@ -2667,8 +2653,7 @@ void set_starting_loc()
}
bool save_scenario_events()
{
bool save_scenario_events() {
Str255 str;
short i;
@@ -2686,8 +2671,7 @@ bool save_scenario_events()
return true;
}
void put_scenario_events_in_dlog()
{
void put_scenario_events_in_dlog() {
Str255 str;
short i;
@@ -2698,8 +2682,7 @@ void put_scenario_events_in_dlog()
}
void edit_scenario_events_event_filter (short item_hit)
{
void edit_scenario_events_event_filter (short item_hit) {
Str255 str;
short i,spec;
@@ -2730,9 +2713,8 @@ void edit_scenario_events_event_filter (short item_hit)
}
}
void edit_scenario_events()
void edit_scenario_events() {
// ignore parent in Mac version
{
short advanced_town_hit,i,store_dialog_answer;
Str255 temp_str;
@@ -2746,8 +2728,7 @@ void edit_scenario_events()
cd_kill_dialog(811,0);
}
void give_password_filter (short item_hit)
{
void give_password_filter (short item_hit) {
Str255 str;
short i;
@@ -2760,9 +2741,8 @@ void give_password_filter (short item_hit)
}
}
short enter_password()
short enter_password() {
// ignore parent in Mac version
{
short town_strs_hit,i,store_dialog_answer;
Str255 temp_str,str2;
@@ -2781,8 +2761,7 @@ short enter_password()
return i;
}
short wd_to_pwd(Str255 str)
{
short wd_to_pwd(Str255 str) {
char pwd[8] = "aaaaaa";
short i;
long val = 0,pow[6] = {1,10,100,1000,9999,99999};

View File

@@ -3,8 +3,7 @@
#include "classes.h"
#include "scen.dlgutil.h"
DialogPtr make_dialog(int resource_num)
{
DialogPtr make_dialog(int resource_num) {
DialogPtr the_dialog;
the_dialog = GetNewDialog (resource_num, 0, IN_FRONT);
@@ -15,8 +14,7 @@ DialogPtr make_dialog(int resource_num)
return the_dialog;
}
void put_num_in_text(short num_to_put,DialogPtr the_dialog, short item_num)
{
void put_num_in_text(short num_to_put,DialogPtr the_dialog, short item_num) {
Str255 text_entry;
short the_type;
Handle the_handle = NULL;
@@ -27,8 +25,7 @@ void put_num_in_text(short num_to_put,DialogPtr the_dialog, short item_num)
SetDialogItemText ( the_handle, text_entry);
}
long get_text_item_num(short item_num,DialogPtr the_dialog)
{
long get_text_item_num(short item_num,DialogPtr the_dialog) {
long storage;
long number_given = 0;

View File

@@ -47,8 +47,7 @@ ResFileRefNum mainRef, graphicsRef, soundRef;
void print_write_position ();
void load_spec_graphics();
void init_directories()
{
void init_directories() {
short error;
char thing[60];
// Str255 data_name = "\pExile III data";
@@ -127,8 +126,7 @@ void init_directories()
// Strategy ... assemble a big Dummy file containing the whole scenario
//chunk by chunk, copy the dummy over the original, and delete the dummy
// the whole scenario is too big be be shifted around at once
void save_scenario()
{
void save_scenario() {
// short i,j,k,num_outdoors;
// FSSpec to_load,dummy_file;
// NavReplyRecord reply;
@@ -174,7 +172,9 @@ void save_scenario()
// //buffer = (char *) NewPtr(buf_len);
// buffer = new char[100000];
// if (buffer == NULL) {
// FSClose(scen_f); FSClose(dummy_f); oops_error(14);
// FSClose(scen_f);
// FSClose(dummy_f);
// oops_error(14);
// return;
// }
//
@@ -425,8 +425,7 @@ void save_scenario()
//
}
GWorldPtr load_bmp_from_file(Str255 filename)
{
GWorldPtr load_bmp_from_file(Str255 filename) {
short file_id;
long length;
if (HOpen(start_volume,start_dir,filename,1,&file_id) != 0) return NULL;
@@ -443,8 +442,7 @@ GWorldPtr load_bmp_from_file(Str255 filename)
return ret;
}
void augment_terrain(location to_create)
{
void augment_terrain(location to_create) {
location to_load;
short i,j;
@@ -477,8 +475,7 @@ void augment_terrain(location to_create)
void create_basic_scenario()
{
void create_basic_scenario() {
// short i,j,k,num_outdoors;
// FSSpec to_load,new_file,dummy_file;
// NavReplyRecord reply;
@@ -681,8 +678,7 @@ void create_basic_scenario()
}
// if which_town is -1, load town from base
void import_town(short which_town,FSSpec temp_file_to_load)
{
void import_town(short which_town,FSSpec temp_file_to_load) {
printf("Town import currently disabled.\n");
// short i,j,k,l,file_id;
// bool file_ok = false;
@@ -841,8 +837,7 @@ void import_town(short which_town,FSSpec temp_file_to_load)
// When this is called, the current town is the town to make town 0.
void make_new_scenario(Str255 file_name,short out_width,short out_height,short making_warriors_grove,
short use_grass)
{
short use_grass) {
// short i,j,k,num_outdoors;
// FSSpec dummy_file;
// NavReplyRecord reply;
@@ -1120,8 +1115,7 @@ void make_new_scenario(Str255 file_name,short out_width,short out_height,short m
printf("Scenario not created; creation is currently disabled.\n");
}
bool check_p (short pword)
{
bool check_p (short pword) {
if (scenario.flag_b != town_s(pword))
return false;
if (scenario.flag_c != out_s(pword))
@@ -1138,8 +1132,7 @@ bool check_p (short pword)
return true;
}
bool check_p2 (short pword)
{
bool check_p2 (short pword) {
if (scenario.flag_b != town_s(pword))
return false;
if (scenario.flag_c != out_s(pword))
@@ -1156,8 +1149,7 @@ bool check_p2 (short pword)
return true;
}
bool check_p3 (short pword)
{
bool check_p3 (short pword) {
if (scenario.flag_b != town_s(pword))
return false;
if (scenario.flag_c != out_s(pword))
@@ -1174,16 +1166,14 @@ bool check_p3 (short pword)
return true;
}
bool import_check_p (short flag_d,short pword)
{
bool import_check_p (short flag_d,short pword) {
if (flag_d != init_data(pword))
return false;
return true;
}
short init_data(short flag)
{
short init_data(short flag) {
long k = 0;
k = (long) flag;
@@ -1201,8 +1191,7 @@ k = k % 3000;
return (short) k;
}
short town_s(short flag)
{
short town_s(short flag) {
long k = 0;
k = (long) flag;
@@ -1220,8 +1209,7 @@ short town_s(short flag)
return (short) k;
}
short out_s(short flag)
{
short out_s(short flag) {
long k = 0;
k = (long) flag;
@@ -1239,8 +1227,7 @@ short out_s(short flag)
return (short) k;
}
short str_size_1(short flag)
{
short str_size_1(short flag) {
long k = 0;
k = (long) flag;
@@ -1259,8 +1246,7 @@ short str_size_1(short flag)
return (short) k;
}
short str_size_2(short flag)
{
short str_size_2(short flag) {
long k = 0;
k = (long) flag;
@@ -1278,8 +1264,7 @@ short str_size_2(short flag)
return (short) k;
}
short str_size_3(short flag)
{
short str_size_3(short flag) {
long k = 0;
k = (long) flag;
@@ -1297,8 +1282,7 @@ short str_size_3(short flag)
return (short) k;
}
short get_buf_ptr(short flag)
{
short get_buf_ptr(short flag) {
long k = 0;
k = (long) flag;
@@ -1317,8 +1301,7 @@ short get_buf_ptr(short flag)
return (short) k;
}
void reset_pwd()
{
void reset_pwd() {
// now flags
scenario.flag_a = sizeof(scenario_header_flags) + sizeof(legacy::scenario_data_type) + get_ran(1,-1000,1000);
scenario.flag_b = town_s(user_given_password);

View File

@@ -217,8 +217,7 @@ void init_dialogs(){
//return tmp;
}
void Set_up_win ()
{
void Set_up_win () {
short i,j;
for (i = 0; i < 70; i++){
palette_buttons_from[i] = palette_button_base;
@@ -262,8 +261,7 @@ void Set_up_win ()
load_main_screen();
}
void run_startup_g()
{
void run_startup_g() {
Rect pict_rect = {0,0,480,640};
PicHandle pict_to_draw;
@@ -303,8 +301,7 @@ void load_graphics(){
mixed_gworld = load_pict(903);
}
void load_main_screen()
{
void load_main_screen() {
Str255 fn1 = "\pGeneva";
Str255 fn2 = "\pDungeon Bold";
Str255 fn3 = "\pPalatino";
@@ -331,8 +328,7 @@ void load_main_screen()
//draw_main_screen();
}
void redraw_screen()
{
void redraw_screen() {
GrafPtr old_port;
@@ -345,8 +341,7 @@ void redraw_screen()
SetPort (old_port);
}
void draw_main_screen()
{
void draw_main_screen() {
short i;
Rect draw_rect;
@@ -384,8 +379,7 @@ void draw_main_screen()
}
void draw_lb()
{
void draw_lb() {
Rect temp_rect;
short i;
@@ -397,8 +391,7 @@ void draw_lb()
}
// mode 0 normal 1 click
void draw_lb_slot (short which,short mode)
{
void draw_lb_slot (short which,short mode) {
Rect text_rect,from_rect;
FillCRect(&left_buttons[which][0],bg[20]);
@@ -429,8 +422,7 @@ void draw_lb_slot (short which,short mode)
TextFace(bold);
}
void draw_rb()
{
void draw_rb() {
short i,pos;
pos = GetControlValue(right_sbar);
@@ -439,8 +431,7 @@ void draw_rb()
}
// mode 0 normal 1 pressed
void draw_rb_slot (short which,short mode)
{
void draw_rb_slot (short which,short mode) {
Rect text_rect;
short pos;
@@ -461,8 +452,7 @@ void draw_rb_slot (short which,short mode)
TextFace(bold);
}
void set_up_terrain_buttons()
{
void set_up_terrain_buttons() {
short i,j,pic,small_i;
Rect ter_from,ter_to,ter_from_base = {0,0,36,28};
Rect tiny_from,tiny_to;
@@ -582,7 +572,8 @@ void draw_terrain(){
for (q = 0; q < 9; q++)
for (r = 0; r < 9; r++)
{
where_draw.x = q; where_draw.y = r;
where_draw.x = q;
where_draw.y = r;
if (editing_town == true) {
t_to_draw = town->terrain(cen_x + q - 4,cen_y + r - 4);
}
@@ -815,8 +806,7 @@ void draw_terrain(){
rect_draw_some_item(ter_draw_gworld,terrain_rect,ter_draw_gworld,world_screen,0,1);
}
void draw_monsts()
{
void draw_monsts() {
short i,k,width,height,m_start_pic;
GWorldPtr from_gworld;
Rect source_rect,draw_rect;
@@ -855,8 +845,7 @@ void draw_monsts()
// Returns rect for drawing an item, if num < 25, rect is in big item template,
// otherwise in small item template
Rect get_item_template_rect (short type_wanted)
{
Rect get_item_template_rect (short type_wanted) {
Rect store_rect;
if (type_wanted < 45) {
@@ -875,8 +864,7 @@ Rect get_item_template_rect (short type_wanted)
return store_rect;
}
void draw_items()
{
void draw_items() {
short i;
Rect source_rect,dest_rect;
location where_draw;
@@ -916,8 +904,7 @@ void draw_items()
}
void force_tiny_redraw()
{
void force_tiny_redraw() {
// short q,r;
// for (q = 0; q < 8; q++)
// for (r = 0; r < 64; r++)
@@ -925,13 +912,11 @@ void force_tiny_redraw()
}
void redraw_selected_ter()
{
void redraw_selected_ter() {
// draw_one_terrain_spot(18,8,(unsigned char) current_terrain_type);
}
void draw_one_terrain_spot (short i,short j,unsigned char terrain_to_draw)
{
void draw_one_terrain_spot (short i,short j,unsigned char terrain_to_draw) {
location where_draw;
Rect source_rect;
short picture_wanted;
@@ -966,8 +951,7 @@ void draw_one_terrain_spot (short i,short j,unsigned char terrain_to_draw)
Draw_Some_Item(source_gworld, source_rect, ter_draw_gworld, where_draw, 0, 0);
}
void draw_one_tiny_terrain_spot (short i,short j,unsigned char terrain_to_draw)
{
void draw_one_tiny_terrain_spot (short i,short j,unsigned char terrain_to_draw) {
location where_draw;
Rect source_rect,dest_rect = {0,0,4,4},from_rect = {0,0,4,4};
@@ -1028,8 +1012,7 @@ void draw_one_tiny_terrain_spot (short i,short j,unsigned char terrain_to_draw)
/* Draw a bitmap in the world window. hor in 0 .. 8, vert in 0 .. 8,
object is ptr. to bitmap to be drawn, and masking is for Copybits. */
void Draw_Some_Item ( GWorldPtr src_gworld,Rect src_rect,GWorldPtr targ_gworld,location target,
char masked,short main_win)
{
char masked,short main_win) {
Rect destrec;
PixMapHandle test1, test2;
RGBColor test_color, store_color;
@@ -1051,8 +1034,7 @@ BitMap store_dest;
/* Input terrain currently trying to draw. Get back Rect in terrain template containing
desired pixmap, or Rect to darkness if desired map not present */
Rect get_template_rect (unsigned char type_wanted)
{
Rect get_template_rect (unsigned char type_wanted) {
Rect store_rect;
short i,j;
short picture_wanted;
@@ -1069,8 +1051,7 @@ Rect get_template_rect (unsigned char type_wanted)
return store_rect;
}
void draw_frames()
{
void draw_frames() {
char q,r,i,k;
location which_pt;
Rect draw_rect;
@@ -1107,8 +1088,7 @@ void draw_frames()
}
void place_location()
{
void place_location() {
Rect text_rect = {367,290,384,510};
Str255 draw_str;
Rect from_rect,draw_rect,source_rect,erase_rect;
@@ -1193,8 +1173,7 @@ void place_location()
}
// klugde for speed ...exactly like place location above, but just writes location
void place_just_location()
{
void place_just_location() {
Rect text_rect = {367,290,384,510};
Str255 draw_str;
Rect from_rect,draw_rect,source_rect,erase_rect;
@@ -1232,8 +1211,7 @@ void place_just_location()
terrain_buttons_gworld,draw_rect,0,1);
}
void set_string(char *string,char *string2)
{
void set_string(char *string,char *string2) {
strcpy((char *)current_string,string);
c2pstr((char*) current_string);
// if (strlen(string2) == 0)
@@ -1247,8 +1225,7 @@ void set_string(char *string,char *string2)
}
/*
void draw_cur_string()
{
void draw_cur_string() {
Rect from_rect,draw_rect;
from_rect = terrain_buttons_rect;
@@ -1263,16 +1240,14 @@ void draw_cur_string()
DrawString(current_string2);
} */
void undo_clip()
{
void undo_clip() {
Rect c = {0,0,480,640};
ClipRect(&c);
}
bool is_special(short i,short j)
{
bool is_special(short i,short j) {
short k;
if (editing_town == true)
@@ -1287,18 +1262,16 @@ bool is_special(short i,short j)
return false;
}
void take_special(short i,short j)
{}
void take_special(short i,short j) {
}
void make_special(short i,short j)
{}
void make_special(short i,short j) {
}
void sort_specials() {
}
void sort_specials()
{}
bool is_field_type(short i,short j,short field_type)
{
bool is_field_type(short i,short j,short field_type) {
short k;
for (k = 0; k < 50; k++)
@@ -1309,8 +1282,7 @@ bool is_field_type(short i,short j,short field_type)
return false;
}
void make_field_type(short i,short j,short field_type)
{
void make_field_type(short i,short j,short field_type) {
short k;
if (is_field_type(i,j,field_type) == true)
@@ -1326,8 +1298,7 @@ void make_field_type(short i,short j,short field_type)
}
void take_field_type(short i,short j,short field_type)
{
void take_field_type(short i,short j,short field_type) {
short k;
for (k = 0; k < 50; k++)
@@ -1339,103 +1310,81 @@ void take_field_type(short i,short j,short field_type)
}
}
bool is_web(short i,short j)
{
bool is_web(short i,short j) {
return is_field_type(i,j,3);
}
void make_web(short i,short j)
{
void make_web(short i,short j) {
make_field_type(i,j,3);
}
void take_web(short i,short j)
{
void take_web(short i,short j) {
take_field_type(i,j,3);
}
bool is_crate(short i,short j)
{
bool is_crate(short i,short j) {
return is_field_type(i,j,4);
}
void make_crate(short i,short j)
{
void make_crate(short i,short j) {
make_field_type(i,j,4);
}
void take_crate(short i,short j)
{
void take_crate(short i,short j) {
take_field_type(i,j,4);
}
bool is_barrel(short i,short j)
{
bool is_barrel(short i,short j) {
return is_field_type(i,j,5);
}
void make_barrel(short i,short j)
{
void make_barrel(short i,short j) {
make_field_type(i,j,5);
}
void take_barrel(short i,short j)
{
void take_barrel(short i,short j) {
take_field_type(i,j,5);
}
bool is_fire_barrier(short i,short j)
{
bool is_fire_barrier(short i,short j) {
return is_field_type(i,j,6);
}
void make_fire_barrier(short i,short j)
{
void make_fire_barrier(short i,short j) {
make_field_type(i,j,6);
}
void take_fire_barrier(short i,short j)
{
void take_fire_barrier(short i,short j) {
take_field_type(i,j,6);
}
bool is_force_barrier(short i,short j)
{
bool is_force_barrier(short i,short j) {
return is_field_type(i,j,7);
}
void make_force_barrier(short i,short j)
{
void make_force_barrier(short i,short j) {
make_field_type(i,j,7);
}
void take_force_barrier(short i,short j)
{
void take_force_barrier(short i,short j) {
take_field_type(i,j,7);
}
bool is_sfx(short i,short j,short type)
{
bool is_sfx(short i,short j,short type) {
return is_field_type(i,j,type + 14);
}
void make_sfx(short i,short j,short type)
{
void make_sfx(short i,short j,short type) {
make_field_type(i,j,type + 14);
}
void take_sfx(short i,short j,short type)
{
void take_sfx(short i,short j,short type) {
take_field_type(i,j,type + 14);
}
bool is_quickfire(short i,short j)
{
bool is_quickfire(short i,short j) {
return is_field_type(i,j,8);
}
void make_quickfire(short i,short j)
{
void make_quickfire(short i,short j) {
make_field_type(i,j,8);
}
void take_quickfire(short i,short j)
{
void take_quickfire(short i,short j) {
take_field_type(i,j,8);
}
bool container_there(location l)
{
bool container_there(location l) {
unsigned char ter;

View File

@@ -43,10 +43,16 @@ short num_specs[3] = {256,60,100};
short ex1a_choose[12] = {19,50,55,56,57,58,59,60,182,229,-1,-1};
short ex2a_choose[18] = {55,56,57,-1,-1, -1,135,136,171,172, 181,192,226,-1,-1, -1,-1,-1};
short ex1b_choose[40] = {13,20,55,56,57,24,-1,-1,80,130, 131,132,133,137,138,140,141,142,143,145,
146,147,148,149,150,151,152,153,154,184, 188,195,186,-1,-1,-1,-1,-1,-1,155};
short ex2b_choose[20] = {19,50,55,56,57,58,59,60,130,134,
135,136,139,144,154,-1,-1,-1,-1,-1};
short ex1b_choose[40] = {
13, 20, 55, 56, 57, 24, -1, -1, 80, 130,
131,132,133,137,138,140,141,142,143,145,
146,147,148,149,150,151,152,153,154,184,
188,195,186,-1, -1, -1, -1, -1, -1, 155
};
short ex2b_choose[20] = {
19, 50, 55, 56, 57, 58, 59, 60, 130,134,
135,136,139,144,154,-1, -1, -1, -1, -1
};
char edit_spec_stuff_done_mess[256] = {
0,1,1,0,0,0,1,0,0,0,
@@ -74,7 +80,8 @@ char edit_spec_stuff_done_mess[256] = {
0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0};
0,0,0,0,0,0
};
char edit_spec_mess_mess[256] = {
0,1,1,1,0,1,1,0,0,0,
0,1,1,0,0,0,0,1,1,1,
@@ -101,7 +108,8 @@ char edit_spec_mess_mess[256] = {
0,0,0,0,0,0,1,1,1,3,
0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0};
0,0,0,0,0,0
};
char edit_pict_mess[256] = {
0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,
@@ -128,7 +136,8 @@ char edit_pict_mess[256] = {
0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0};
0,0,0,0,0,0
};
char edit_jumpto_mess[256] = {
0,0,0,0,0,0,0,1,1,1,
1,0,0,0,0,0,0,0,0,0,
@@ -155,11 +164,11 @@ char edit_jumpto_mess[256] = {
0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0};
0,0,0,0,0,0
};
//cre = check range error
bool cre(short val,short min,short max,char *text1, char *text2,short parent_num)
{
bool cre(short val,short min,short max,char *text1, char *text2,short parent_num) {
if ((val < min) || (val > max)) {
give_error(text1,text2,parent_num);
return true;
@@ -167,8 +176,7 @@ bool cre(short val,short min,short max,char *text1, char *text2,short parent_num
return false;
}
void choose_graphic_event_filter (short item_hit)
{
void choose_graphic_event_filter (short item_hit) {
short i;
bool had1 = false, had2 = false;
@@ -203,8 +211,7 @@ void choose_graphic_event_filter (short item_hit)
}
}
void put_choice_pics(short g_type)
{
void put_choice_pics(short g_type) {
short item_hit,i;
for (i = 0; i < 36; i++) {
@@ -223,8 +230,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 choose_graphic(short first_g,short last_g,short cur_choice,short g_type,short parent_num) {
short item_hit;
Str255 sign_text;
@@ -256,8 +262,7 @@ short choose_graphic(short first_g,short last_g,short cur_choice,short g_type,sh
return dialog_answer;
}
void choose_text_res_event_filter (short item_hit)
{
void choose_text_res_event_filter (short item_hit) {
short i;
bool had1 = false, had2 = false;
@@ -292,8 +297,7 @@ void choose_text_res_event_filter (short item_hit)
}
}
void put_text_res()
{
void put_text_res() {
short item_hit,i;
Str255 str;
@@ -314,8 +318,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 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;
@@ -347,8 +350,7 @@ short choose_text_res(short res_list,short first_t,short last_t,short cur_choice
return dialog_answer;
}
void edit_text_event_filter (short item_hit)
{
void edit_text_event_filter (short item_hit) {
Str255 str;
short i;
short num_strs[3] = {260,108,140};
@@ -383,9 +385,8 @@ void edit_text_event_filter (short item_hit)
}
// mode 0 - scen 1 - out 2 - town
void edit_text_str(short which_str,short mode)
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;
@@ -409,8 +410,7 @@ void edit_text_str(short which_str,short mode)
cd_kill_dialog(816,0);
}
void edit_area_rect_event_filter (short item_hit)
{
void edit_area_rect_event_filter (short item_hit) {
Str255 str;
short i;
@@ -432,9 +432,8 @@ void edit_area_rect_event_filter (short item_hit)
}
// mode 0 - out 1 - town
bool edit_area_rect_str(short which_str,short mode)
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;
@@ -454,8 +453,7 @@ bool edit_area_rect_str(short which_str,short mode)
return dialog_answer;
}
bool save_spec_enc()
{
bool save_spec_enc() {
Str255 str;
short i;
@@ -488,8 +486,7 @@ bool save_spec_enc()
return true;
}
void put_spec_enc_in_dlog()
{
void put_spec_enc_in_dlog() {
Str255 str;
short i;
@@ -504,44 +501,109 @@ void put_spec_enc_in_dlog()
CDSN(822,2,store_spec_node.sd1);
CDSN(822,3,store_spec_node.sd2);
switch (edit_spec_stuff_done_mess[store_spec_node.type]) {
case 0: csit(822,20,"Unused."); csit(822,21,"Unused."); break;
case 1: csit(822,20,"Stuff Done Flag Part A"); csit(822,21,"Stuff Done Flag Part B"); break;
case 2: csit(822,20,"Chance of placing (0 - 100)"); csit(822,21,"Unused"); break;
case 3: csit(822,20,"Stuff Done Flag Part A"); csit(822,21,"Unused"); break;
case 4: csit(822,20,"X of space to move to"); csit(822,21,"Y of space to move to"); break;
case 5: csit(822,20,"Terrain to change to"); csit(822,21,"Chance of changing (0 - 100)"); break;
case 6: csit(822,20,"Switch this ter. type"); csit(822,21,"with this ter. type"); break;
case 7: csit(822,20,"Chance of placing (0 - 100)"); csit(822,21,"What to place (see docs.)"); break;
case 8: csit(822,20,"Chance of placing (0 - 100)"); csit(822,21,"0 - web, 1 - barrel, 2 - crate"); break;
case 0:
csit(822,20,"Unused.");
csit(822,21,"Unused.");
break;
case 1:
csit(822,20,"Stuff Done Flag Part A");
csit(822,21,"Stuff Done Flag Part B");
break;
case 2:
csit(822,20,"Chance of placing (0 - 100)");
csit(822,21,"Unused");
break;
case 3:
csit(822,20,"Stuff Done Flag Part A");
csit(822,21,"Unused");
break;
case 4:
csit(822,20,"X of space to move to");
csit(822,21,"Y of space to move to");
break;
case 5:
csit(822,20,"Terrain to change to");
csit(822,21,"Chance of changing (0 - 100)");
break;
case 6:
csit(822,20,"Switch this ter. type");
csit(822,21,"with this ter. type");
break;
case 7:
csit(822,20,"Chance of placing (0 - 100)");
csit(822,21,"What to place (see docs.)");
break;
case 8:
csit(822,20,"Chance of placing (0 - 100)");
csit(822,21,"0 - web, 1 - barrel, 2 - crate");
break;
}
CDSN(822,4,store_spec_node.m1);
CDSN(822,5,store_spec_node.m2);
switch (edit_spec_mess_mess[store_spec_node.type]) {
case 0: csit(822,22,"Unused."); csit(822,23,"Unused."); cd_activate_item(822,49,0); break;
case 1: csit(822,22,"First part of message"); csit(822,23,"Second part of message");
cd_activate_item(822,49,1); break;
case 2: csit(822,22,"Number of first message in dialog"); csit(822,23,"Unused");
cd_activate_item(822,49,1); break;
case 3: csit(822,22,"Name of Store"); csit(822,23,"Unused");
cd_activate_item(822,49,1); break;
case 4: csit(822,22,"Number of first message in dialog");
case 0:
csit(822,22,"Unused.");
csit(822,23,"Unused.");
cd_activate_item(822,49,0);
break;
case 1:
csit(822,22,"First part of message");
csit(822,23,"Second part of message");
cd_activate_item(822,49,1);
break;
case 2:
csit(822,22,"Number of first message in dialog");
csit(822,23,"Unused");
cd_activate_item(822,49,1);
break;
case 3:
csit(822,22,"Name of Store");
csit(822,23,"Unused");
cd_activate_item(822,49,1);
break;
case 4:
csit(822,22,"Number of first message in dialog");
csit(822,23,"1 - add 'Leave'/'OK' button, else no");
cd_activate_item(822,49,1); break;
case 5: csit(822,22,"Number of first message in dialog");
cd_activate_item(822,49,1);
break;
case 5:
csit(822,22,"Number of first message in dialog");
csit(822,23,"Num. of spec. item to give (-1 none)");
cd_activate_item(822,49,1); break;
cd_activate_item(822,49,1);
break;
}
CDSN(822,6,store_spec_node.pic);
switch (edit_pict_mess[store_spec_node.type]) {
case 0: csit(822,24,"Unused."); cd_activate_item(822,46,0); break;
case 1: csit(822,24,"Dialog Picture number"); cd_activate_item(822,46,1); break;
case 2: csit(822,24,"Terrain Picture number"); cd_activate_item(822,46,1); break;
case 3: csit(822,24,"Monster Picture number"); cd_activate_item(822,46,1); break;
case 4: csit(822,24,"Chance of changing (0 - 100)"); cd_activate_item(822,46,0); break;
case 5: csit(822,24,"Number of letters to match"); cd_activate_item(822,46,0); break;
case 6: csit(822,24,"Radius of explosion"); cd_activate_item(822,46,0); break;
case 0:
csit(822,24,"Unused.");
cd_activate_item(822,46,0);
break;
case 1:
csit(822,24,"Dialog Picture number");
cd_activate_item(822,46,1);
break;
case 2:
csit(822,24,"Terrain Picture number");
cd_activate_item(822,46,1);
break;
case 3:
csit(822,24,"Monster Picture number");
cd_activate_item(822,46,1);
break;
case 4:
csit(822,24,"Chance of changing (0 - 100)");
cd_activate_item(822,46,0);
break;
case 5:
csit(822,24,"Number of letters to match");
cd_activate_item(822,46,0);
break;
case 6:
csit(822,24,"Radius of explosion");
cd_activate_item(822,46,0);
break;
}
CDSN(822,7,store_spec_node.ex1a);
@@ -578,16 +640,25 @@ void put_spec_enc_in_dlog()
CDSN(822,11,store_spec_node.jumpto);
switch (edit_jumpto_mess[store_spec_node.type]) {
case 0: csit(822,30,"Special to Jump To"); break;
case 1: csit(822,30,"Special node if not blocked"); break;
case 2: csit(822,30,"Special after trap finished"); break;
case 3: csit(822,30,"Otherwise call this special"); break;
case 4: csit(822,30,"Special if OK/Leave picked"); break;
case 0:
csit(822,30,"Special to Jump To");
break;
case 1:
csit(822,30,"Special node if not blocked");
break;
case 2:
csit(822,30,"Special after trap finished");
break;
case 3:
csit(822,30,"Otherwise call this special");
break;
case 4:
csit(822,30,"Special if OK/Leave picked");
break;
}
}
void edit_spec_enc_event_filter (short item_hit)
{
void edit_spec_enc_event_filter (short item_hit) {
Str255 str;
short i,node_to_change_to = -1,spec;
@@ -613,7 +684,8 @@ void edit_spec_enc_event_filter (short item_hit)
"Press the Go Back button until it disappears.",822);
break;
}
toast_dialog(); break;
toast_dialog();
break;
case 43: case 44: case 45: // 1b, 2b, jump to spec
if (save_spec_enc() == false)
break;
@@ -667,13 +739,17 @@ void edit_spec_enc_event_filter (short item_hit)
case 47: // 1a choose
switch (store_spec_node.type) {
case 19: case 50: case 58: case 59: case 60:
i = choose_text_res(-2,0,399,store_spec_node.ex1a,822,"Give which item?"); break;
i = choose_text_res(-2,0,399,store_spec_node.ex1a,822,"Give which item?");
break;
case 229:
i = choose_text_res(-2,0,399,store_spec_node.ex1a,822,"First item in store?"); break;
i = choose_text_res(-2,0,399,store_spec_node.ex1a,822,"First item in store?");
break;
case 55: case 56: case 57:
i = choose_text_res(-3,0,NUM_DLOG_B - 1,store_spec_node.ex1a,822,"Which button label?"); break;
i = choose_text_res(-3,0,NUM_DLOG_B - 1,store_spec_node.ex1a,822,"Which button label?");
break;
case 182:
i = choose_text_res(-1,1,255,store_spec_node.ex1a,822,"Choose Which Monster:"); break;
i = choose_text_res(-1,1,255,store_spec_node.ex1a,822,"Choose Which Monster:");
break;
}
store_spec_node.ex1a = i;
CDSN(822,7,store_spec_node.ex1a);
@@ -681,13 +757,17 @@ void edit_spec_enc_event_filter (short item_hit)
case 48: // 2a choose
switch (store_spec_node.type) {
case 19: case 50: case 192: case 229:
i = choose_text_res(-2,0,399,store_spec_node.ex2a,822,"Give which item?"); break;
i = choose_text_res(-2,0,399,store_spec_node.ex2a,822,"Give which item?");
break;
case 55: case 56: case 57: case 58: case 59: case 60:
i = choose_text_res(-3,0,NUM_DLOG_B - 1,store_spec_node.ex2a,822,"Which button label?"); break;
i = choose_text_res(-3,0,NUM_DLOG_B - 1,store_spec_node.ex2a,822,"Which button label?");
break;
case 181:
i = choose_text_res(-1,1,255,store_spec_node.ex2a,822,"Choose Which Monster:"); break;
i = choose_text_res(-1,1,255,store_spec_node.ex2a,822,"Choose Which Monster:");
break;
case 135: case 136: case 171: case 172: case 226:
i = choose_text_res(-4,0,255,store_spec_node.ex2a,822,"Which Terrain?"); break;
i = choose_text_res(-4,0,255,store_spec_node.ex2a,822,"Which Terrain?");
break;
}
store_spec_node.ex2a = i;
CDSN(822,9,store_spec_node.ex2a);
@@ -713,9 +793,15 @@ void edit_spec_enc_event_filter (short item_hit)
toast_dialog();
i = -1;
switch (edit_pict_mess[store_spec_node.type]) {
case 1: i = choose_graphic(/*700,731*/0,PICT_N_DLG,store_spec_node.pic,PICT_DLG,822); break;
case 2: i = choose_graphic(0,PICT_N_TER,store_spec_node.pic,PICT_TER,822); break;
case 3: i = choose_graphic(/*400,572*/0,PICT_N_MONST,store_spec_node.pic,PICT_MONST,822); break;
case 1:
i = choose_graphic(/*700,731*/0,PICT_N_DLG,store_spec_node.pic,PICT_DLG,822);
break;
case 2:
i = choose_graphic(0,PICT_N_TER,store_spec_node.pic,PICT_TER,822);
break;
case 3:
i = choose_graphic(/*400,572*/0,PICT_N_MONST,store_spec_node.pic,PICT_MONST,822);
break;
}
if (i >= 0) {
store_spec_node.pic = i;
@@ -738,7 +824,8 @@ void edit_spec_enc_event_filter (short item_hit)
i = choose_text_res(22,51,64,store_spec_node.type + 1,822,"Choose One-Shot Special:");
if (i >= 0) {
store_spec_node.type = i - 1;
store_spec_node.sd1 = -1; store_spec_node.sd2 = -1;
store_spec_node.sd1 = -1;
store_spec_node.sd2 = -1;
if ((store_spec_node.type >= 55) && (store_spec_node.type <= 57))
store_spec_node.m2 = 1;
}
@@ -797,9 +884,8 @@ 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)
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;
@@ -827,8 +913,7 @@ void edit_spec_enc(short which_node,short mode,short parent_num)
cd_kill_dialog(822,0);
}
short get_fresh_spec(short which_mode)
{
short get_fresh_spec(short which_mode) {
short i;
cSpecial store_node;
@@ -846,17 +931,14 @@ short get_fresh_spec(short which_mode)
return -1;
}
void edit_spec_text_event_filter (short item_hit)
{
void edit_spec_text_event_filter (short item_hit) {
Str255 str;
short i;
switch (item_hit) {
case 7:
if (item_hit == 7) {
toast_dialog();
break;
case 6:
return;
} else if(item_hit == 6){
CDGT(826,2,(char *) str);
if (strlen((char *) str) > 0) {
if (*store_str1 < 0) {
@@ -887,7 +969,7 @@ void edit_spec_text_event_filter (short item_hit)
if (i < 500) {
give_error("There are no more free message slots.",
"To free up some slots, go into Edit Town/Out/Scenario Text to clear some messages.", 826);
break;
return;
}
}
if (*store_str1 >= 0) {
@@ -934,7 +1016,7 @@ void edit_spec_text_event_filter (short item_hit)
if (i < 500) {
give_error("There are no more free message slots.",
"To free up some slots, go into Edit Town/Out/Scenario Text to clear some messages.", 826);
break;
return;
}
}
if (*store_str2 >= 0) {
@@ -952,13 +1034,12 @@ void edit_spec_text_event_filter (short item_hit)
}
}
toast_dialog();
break;
return;
}
}
// mode 0 - scen 1 - out 2 - town
void edit_spec_text(short mode,short *str1,short *str2,short parent)
{
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 num_s_strs[3] = {100,90,100};
@@ -1024,8 +1105,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)
{
void edit_dialog_text(short mode,short *str1,short parent) {
short text_hit,i,j,store_dialog_answer,item_hit;
Str255 temp_str;
short num_s_strs[3] = {100,90,100};
@@ -1114,8 +1194,7 @@ void edit_dialog_text(short mode,short *str1,short parent)
cd_kill_dialog(842,0);
}
void edit_special_num_event_filter (short item_hit)
{
void edit_special_num_event_filter (short item_hit) {
Str255 str;
short i;
@@ -1137,8 +1216,7 @@ void edit_special_num_event_filter (short item_hit)
}
}
short edit_special_num(short mode,short what_start)
{
short edit_special_num(short mode,short what_start) {
short text_hit,i,j,store_dialog_answer,item_hit;
Str255 temp_str;
@@ -1155,8 +1233,7 @@ short edit_special_num(short mode,short what_start)
return dialog_answer;
}
void edit_scen_intro_event_filter (short item_hit)
{
void edit_scen_intro_event_filter (short item_hit) {
Str255 str;
short i;
@@ -1186,8 +1263,7 @@ void edit_scen_intro_event_filter (short item_hit)
}
}
void edit_scen_intro()
{
void edit_scen_intro() {
short text_hit,i,j,store_dialog_answer,item_hit;
Str255 temp_str;
short num_s_strs[3] = {100,90,100};
@@ -1205,14 +1281,12 @@ void edit_scen_intro()
cd_kill_dialog(804,0);
}
void make_cursor_sword()
{
void make_cursor_sword() {
set_cursor(0);
}
// only used at beginning of program
short choice_dialog(short pic,short num)
{
short choice_dialog(short pic,short num) {
DialogPtr select_dialog = NULL;
short the_type;
Handle the_handle = NULL;

View File

@@ -85,8 +85,7 @@ bool mac_is_intel;
//
//Changed to ISO C specified argument and return type.
int main(void)
{
int main(void) {
short j,k;
long i;
@@ -108,7 +107,8 @@ int main(void)
Point p = {0,0};
init_graph_tool(redraw_screen,NULL);
cen_x = 18; cen_y = 18;
cen_x = 18;
cen_y = 18;
run_startup_g();
init_lb();
@@ -128,7 +128,9 @@ int main(void)
menu_bar_handle = GetNewMBar(128);
if (menu_bar_handle == NULL) {
SysBeep(50); SysBeep(50); SysBeep(50);
SysBeep(50);
SysBeep(50);
SysBeep(50);
ExitToShell();
}
SetMenuBar(menu_bar_handle);
@@ -169,8 +171,7 @@ int main(void)
//
//MW specified argument and return type.
void Initialize(void)
{
void Initialize(void) {
Str255 tit = " ";
OSErr error;
@@ -229,8 +230,7 @@ void check_for_intel(){
else mac_is_intel = false;
}
void Set_Window_Drag_Bdry()
{
void Set_Window_Drag_Bdry() {
BitMap bmap;
GetQDGlobalsScreenBits(&bmap);
Drag_Rect = bmap.bounds;
@@ -240,8 +240,7 @@ void Set_Window_Drag_Bdry()
Drag_Rect.bottom -= DRAG_EDGE;
}
void Handle_One_Event()
{
void Handle_One_Event() {
short chr,chr2;
long menu_choice;
@@ -291,13 +290,11 @@ void Handle_One_Event()
}
void Handle_Activate()
{
void Handle_Activate() {
restore_cursor();
}
void Handle_Update()
{
void Handle_Update() {
WindowPtr the_window;
GrafPtr old_port;
@@ -315,8 +312,7 @@ void Handle_Update()
restore_cursor();
}
void handle_menu_choice(long choice)
{
void handle_menu_choice(long choice) {
int menu,menu_item;
if (choice != 0) {
@@ -355,8 +351,7 @@ void handle_menu_choice(long choice)
HiliteMenu(0);
}
void handle_apple_menu(int item_hit)
{
void handle_apple_menu(int item_hit) {
Str255 desk_acc_name;
short desk_acc_num;
@@ -372,8 +367,7 @@ void handle_apple_menu(int item_hit)
}
void handle_file_menu(int item_hit)
{
void handle_file_menu(int item_hit) {
short create;
switch (item_hit) {
@@ -410,8 +404,7 @@ void handle_file_menu(int item_hit)
}
}
void handle_scenario_menu(int item_hit)
{
void handle_scenario_menu(int item_hit) {
short i;
switch (item_hit) {
@@ -446,10 +439,12 @@ void handle_scenario_menu(int item_hit)
//give_error("Passwords have been disabled; they are no longer necessary.","",0);
break;
case 9: // Edit Special Nodes
SetControlValue(right_sbar,0); start_special_editing(0,0);
SetControlValue(right_sbar,0);
start_special_editing(0,0);
break;
case 10: // Edit Scenario Text
SetControlValue(right_sbar,0); start_string_editing(0,0);
SetControlValue(right_sbar,0);
start_string_editing(0,0);
break;
case 11: // Import Town
if (change_made == true) {
@@ -521,76 +516,124 @@ void handle_scenario_menu(int item_hit)
change_made = true;
}
void handle_town_menu(int item_hit)
{
void handle_town_menu(int item_hit) {
short i;
change_made = true;
switch (item_hit) {
case 1: edit_town_details(); break;
case 2: edit_town_wand(); break;
case 3: overall_mode = MODE_SET_TOWN_RECT;
case 1:
edit_town_details();
break;
case 2:
edit_town_wand();
break;
case 3:
overall_mode = MODE_SET_TOWN_RECT;
mode_count = 2;
set_cursor(5);
set_string("Set town boundary","Select upper left corner");
break;
case 4: frill_up_terrain(); break;
case 5: unfrill_terrain(); break;
case 6: edit_town_strs(); break;
case 8: if (fancy_choice_dialog(863,0) == 2)
case 4:
frill_up_terrain();
break;
case 5:
unfrill_terrain();
break;
case 6:
edit_town_strs();
break;
case 8:
if (fancy_choice_dialog(863,0) == 2)
break;
place_items_in_town();
break; // add random
case 9: for (i = 0; i < 64; i++)
case 9:
for (i = 0; i < 64; i++)
town->preset_items[i].property = 0;
fancy_choice_dialog(861,0);
draw_terrain();
break; // set not prop
case 10: if (fancy_choice_dialog(862,0) == 2)
case 10:
if (fancy_choice_dialog(862,0) == 2)
break;
for (i = 0; i < 64; i++)
town->preset_items[i].code = -1;
draw_terrain();
break; // clear all items
case 13: SetControlValue(right_sbar,0); start_special_editing(2,0); break;
case 14: SetControlValue(right_sbar,0); start_string_editing(2,0); break;
case 15: edit_advanced_town(); break;
case 16: edit_town_events(); break;
case 13:
SetControlValue(right_sbar,0);
start_special_editing(2,0);
break;
case 14:
SetControlValue(right_sbar,0);
start_string_editing(2,0);
break;
case 15:
edit_advanced_town();
break;
case 16:
edit_town_events();
break;
}
}
void handle_outdoor_menu(int item_hit)
{
void handle_outdoor_menu(int item_hit) {
short i;
change_made = true;
switch (item_hit) {
case 1: outdoor_details(); break;
case 2: edit_out_wand(0); break;
case 3: edit_out_wand(1); break;
case 4: frill_up_terrain(); break;
case 5: unfrill_terrain(); break;
case 6: edit_out_strs(); break;
case 8: overall_mode = MODE_SET_OUT_START;
set_string("Select party starting location.",""); break;
case 11: SetControlValue(right_sbar,0); start_special_editing(1,0); break;
case 12: SetControlValue(right_sbar,0); start_string_editing(1,0); break;
case 1:
outdoor_details();
break;
case 2:
edit_out_wand(0);
break;
case 3:
edit_out_wand(1);
break;
case 4:
frill_up_terrain();
break;
case 5:
unfrill_terrain();
break;
case 6:
edit_out_strs();
break;
case 8:
overall_mode = MODE_SET_OUT_START;
set_string("Select party starting location.","");
break;
case 11:
SetControlValue(right_sbar,0);
start_special_editing(1,0);
break;
case 12:
SetControlValue(right_sbar,0);
start_string_editing(1,0);
break;
}
}
void handle_help_menu(int item_hit)
{
void handle_help_menu(int item_hit) {
short i;
switch (item_hit) {
case 1: fancy_choice_dialog(986,0); break; // started
case 2: fancy_choice_dialog(1000,0); break; // testing
case 3: fancy_choice_dialog(1001,0); break; // distributing
case 5: fancy_choice_dialog(1002,0); break; // contest
case 1:
fancy_choice_dialog(986,0);
break; // started
case 2:
fancy_choice_dialog(1000,0);
break; // testing
case 3:
fancy_choice_dialog(1001,0);
break; // distributing
case 5:
fancy_choice_dialog(1002,0);
break; // contest
}
}
void handle_item_menu(int item_hit)
{
void handle_item_menu(int item_hit) {
if (scenario.scen_items[item_hit].variety == 0) {
give_error("This item has its Variety set to No Item. You can only place items with a Variety set to an actual item type.","",0);
return;
@@ -600,8 +643,7 @@ void handle_item_menu(int item_hit)
mode_count = item_hit;
}
void handle_monst_menu(int item_hit)
{
void handle_monst_menu(int item_hit) {
overall_mode = MODE_PLACE_CREATURE;
set_string("Place the monster.","Select monster location");
mode_count = item_hit;
@@ -609,8 +651,7 @@ void handle_monst_menu(int item_hit)
pascal void right_sbar_action(ControlHandle bar, short part)
{
pascal void right_sbar_action(ControlHandle bar, short part) {
short old_setting,new_setting,max,i;
if (part == 0)
@@ -621,10 +662,18 @@ pascal void right_sbar_action(ControlHandle bar, short part)
max = GetControlMaximum(bar);
switch (part) {
case kControlUpButtonPart: new_setting--; break;
case kControlDownButtonPart: new_setting++; break;
case kControlPageUpPart: new_setting -= NRSONPAGE - 1; break;
case kControlPageDownPart: new_setting += NRSONPAGE - 1; break;
case kControlUpButtonPart:
new_setting--;
break;
case kControlDownButtonPart:
new_setting++;
break;
case kControlPageUpPart:
new_setting -= NRSONPAGE - 1;
break;
case kControlPageDownPart:
new_setting += NRSONPAGE - 1;
break;
}
new_setting = minmax(0,max,new_setting);
SetControlValue(bar,new_setting);
@@ -632,8 +681,7 @@ pascal void right_sbar_action(ControlHandle bar, short part)
draw_rb();
}
void Mouse_Pressed()
{
void Mouse_Pressed() {
WindowPtr the_window;
short the_part,content_part,i;
long menu_choice;
@@ -675,7 +723,8 @@ void Mouse_Pressed()
}
break;
case kControlUpButtonPart: case kControlPageUpPart: case kControlDownButtonPart: case kControlPageDownPart:
case kControlUpButtonPart: case kControlPageUpPart:
case kControlDownButtonPart: case kControlPageDownPart:
if (control_hit == right_sbar)
content_part = TrackControl(control_hit,event.where,(ControlActionUPP)right_sbar_action);
break;
@@ -689,14 +738,12 @@ void Mouse_Pressed()
}
}
void close_program()
{
void close_program() {
restore_depth();
if(town != NULL) delete town;
}
void ding()
{
void ding() {
SysBeep(1);
}
@@ -840,8 +887,7 @@ void set_pixel_depth() {
old_depth = pixel_depth;
}
void restore_depth()
{
void restore_depth() {
GDHandle cur_device;
PixMapHandle screen_pixmap_handle;
OSErr err;

View File

@@ -51,8 +51,7 @@ cSpeech::cNode store_talk_node;
location store_cur_loc;
__attribute__((deprecated))
void init_town(short size)
{
void init_town(short size) {
short i,j,s;
Str255 temp_str;
if(size == 0) town = new cBigTown;
@@ -92,8 +91,7 @@ void init_town(short size)
}
__attribute__((deprecated))
void init_out()
{
void init_out() {
short i,j;
Str255 temp_str;
@@ -108,8 +106,7 @@ void init_out()
}
}
void put_placed_monst_in_dlog()
{
void put_placed_monst_in_dlog() {
Str255 str;
short i;
@@ -125,8 +122,7 @@ void put_placed_monst_in_dlog()
csp(837,11,store_placed_monst.facial_pic,PICT_CUSTOM + PICT_TALK);
else csp(837,11,store_placed_monst.facial_pic/* + 1000*/,PICT_TALK);
}
bool get_placed_monst_in_dlog()
{
bool get_placed_monst_in_dlog() {
Str255 str;
short i;
@@ -139,8 +135,7 @@ bool get_placed_monst_in_dlog()
return true;
}
void edit_placed_monst_event_filter (short item_hit)
{
void edit_placed_monst_event_filter (short item_hit) {
Str255 str;
short i;
cTown::cCreature store_m;
@@ -185,8 +180,7 @@ void edit_placed_monst_event_filter (short item_hit)
}
}
void edit_placed_monst(short which_m)
{
void edit_placed_monst(short which_m) {
short item_hit,i,store_dialog_answer;
Str255 temp_str;
@@ -211,8 +205,7 @@ void edit_placed_monst(short which_m)
}
void put_placed_monst_adv_in_dlog()
{
void put_placed_monst_adv_in_dlog() {
Str255 str;
short i;
@@ -232,8 +225,7 @@ void put_placed_monst_adv_in_dlog()
CDSN(838,5,store_placed_monst2.spec1);
CDSN(838,6,store_placed_monst2.spec2);
}
bool get_placed_monst_adv_in_dlog()
{
bool get_placed_monst_adv_in_dlog() {
Str255 str;
short i;
@@ -255,8 +247,7 @@ bool get_placed_monst_adv_in_dlog()
return true;
}
void edit_placed_monst_adv_event_filter (short item_hit)
{
void edit_placed_monst_adv_event_filter (short item_hit) {
Str255 str;
short i;
@@ -282,8 +273,7 @@ void edit_placed_monst_adv_event_filter (short item_hit)
}
}
cTown::cCreature edit_placed_monst_adv(cTown::cCreature monst_record)
{
cTown::cCreature edit_placed_monst_adv(cTown::cCreature monst_record) {
short item_hit,i,store_dialog_answer;
Str255 temp_str;
@@ -311,8 +301,7 @@ cTown::cCreature edit_placed_monst_adv(cTown::cCreature monst_record)
return store_placed_monst2;
}
void put_placed_item_in_dlog()
{
void put_placed_item_in_dlog() {
Str255 str;
short i;
@@ -336,8 +325,7 @@ void put_placed_item_in_dlog()
csp(836,4,i % 150,PICT_CUSTOM + PICT_ITEM);
else csp(836,4,/*1800 + */i,PICT_ITEM);
}
bool get_placed_item_in_dlog()
{
bool get_placed_item_in_dlog() {
Str255 str;
short i;
@@ -360,8 +348,7 @@ bool get_placed_item_in_dlog()
return true;
}
void edit_placed_item_event_filter (short item_hit)
{
void edit_placed_item_event_filter (short item_hit) {
Str255 str;
short i;
cTown::cCreature store_m;
@@ -382,7 +369,6 @@ void edit_placed_item_event_filter (short item_hit)
put_placed_item_in_dlog();
}
break;
default:
for (i = 12; i <= 14; i++)
cd_flip_led(836,i,item_hit);
@@ -390,8 +376,7 @@ void edit_placed_item_event_filter (short item_hit)
}
}
void edit_placed_item(short which_i)
{
void edit_placed_item(short which_i) {
short item_hit,i,store_dialog_answer;
Str255 temp_str;
@@ -410,8 +395,7 @@ void edit_placed_item(short which_i)
}
void edit_sign_event_filter (short item_hit)
{
void edit_sign_event_filter (short item_hit) {
short i;
bool had1 = false, had2 = false;
@@ -442,8 +426,7 @@ void edit_sign_event_filter (short item_hit)
else CDST(831,2,town->town_strs(120 + store_which_sign));
}
void edit_sign(short which_sign,short picture)
{
void edit_sign(short which_sign,short picture) {
short item_hit;
Str255 sign_text;
@@ -472,8 +455,7 @@ void edit_sign(short which_sign,short picture)
cd_kill_dialog(831,0);
}
bool save_out_strs()
{
bool save_out_strs() {
Str255 str;
short i;
@@ -486,8 +468,7 @@ bool save_out_strs()
return true;
}
void put_out_strs_in_dlog()
{
void put_out_strs_in_dlog() {
Str255 str;
short i;
@@ -504,8 +485,7 @@ void put_out_strs_in_dlog()
}
void edit_out_strs_event_filter (short item_hit)
{
void edit_out_strs_event_filter (short item_hit) {
Str255 str;
short i;
@@ -528,9 +508,8 @@ void edit_out_strs_event_filter (short item_hit)
}
}
void edit_out_strs()
void edit_out_strs() {
// ignore parent in Mac version
{
short out_strs_hit,i,store_dialog_answer;
Str255 temp_str;
@@ -547,8 +526,7 @@ void edit_out_strs()
}
bool save_town_strs()
{
bool save_town_strs() {
Str255 str;
short i;
@@ -561,8 +539,7 @@ bool save_town_strs()
return true;
}
void put_town_strs_in_dlog()
{
void put_town_strs_in_dlog() {
Str255 str;
short i;
@@ -579,8 +556,7 @@ void put_town_strs_in_dlog()
}
void edit_town_strs_event_filter (short item_hit)
{
void edit_town_strs_event_filter (short item_hit) {
Str255 str;
short i;
@@ -603,9 +579,8 @@ void edit_town_strs_event_filter (short item_hit)
}
}
void edit_town_strs()
void edit_town_strs() {
// ignore parent in Mac version
{
short town_strs_hit,i,store_dialog_answer;
Str255 temp_str;
@@ -623,8 +598,7 @@ void edit_town_strs()
short store_which_town_dlg;
void pick_town_num_event_filter (short item_hit)
{
void pick_town_num_event_filter (short item_hit) {
Str255 str;
short i;
@@ -645,9 +619,8 @@ void pick_town_num_event_filter (short item_hit)
}
}
short pick_town_num(short which_dlog,short def)
short pick_town_num(short which_dlog,short def) {
// ignore parent in Mac version
{
short town_strs_hit,i,store_dialog_answer;
Str255 temp_str,str2;
@@ -666,8 +639,7 @@ short pick_town_num(short which_dlog,short def)
return dialog_answer;
}
void change_ter_event_filter (short item_hit)
{
void change_ter_event_filter (short item_hit) {
Str255 str;
short i;
@@ -683,7 +655,9 @@ void change_ter_event_filter (short item_hit)
toast_dialog();
break;
case 6:
a = -1; b = -1; c = -1;
a = -1;
b = -1;
c = -1;
toast_dialog();
break;
case 10: case 11:
@@ -695,9 +669,8 @@ void change_ter_event_filter (short item_hit)
}
}
void change_ter(short *change_from,short *change_to,short *chance)
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;
@@ -716,8 +689,7 @@ void change_ter(short *change_from,short *change_to,short *chance)
cd_kill_dialog(857,0);
}
void outdoor_details_event_filter (short item_hit)
{
void outdoor_details_event_filter (short item_hit) {
Str255 str;
short i;
@@ -732,9 +704,8 @@ void outdoor_details_event_filter (short item_hit)
}
}
void outdoor_details()
void outdoor_details() {
// ignore parent in Mac version
{
short town_strs_hit,i,store_dialog_answer;
Str255 temp_str;
@@ -750,8 +721,7 @@ void outdoor_details()
cd_kill_dialog(851,0);
}
void put_out_wand_in_dlog()
{
void put_out_wand_in_dlog() {
Str255 str;
short i;
@@ -782,8 +752,7 @@ void put_out_wand_in_dlog()
CDSN(852,5,store_out_wand.end_spec1);
CDSN(852,6,store_out_wand.end_spec2);
}
bool get_out_wand_in_dlog()
{
bool get_out_wand_in_dlog() {
Str255 str;
short i;
@@ -815,8 +784,7 @@ bool get_out_wand_in_dlog()
return true;
}
void edit_out_wand_event_filter (short item_hit)
{
void edit_out_wand_event_filter (short item_hit) {
Str255 str;
short i,spec;
cTown::cCreature store_m;
@@ -846,7 +814,6 @@ void edit_out_wand_event_filter (short item_hit)
current_terrain.wandering[store_which_out_wand] : current_terrain.special_enc[store_which_out_wand];
put_out_wand_in_dlog();
break;
case 31: case 32: case 33:
if (get_out_wand_in_dlog() == false)
break;
@@ -886,8 +853,7 @@ void edit_out_wand_event_filter (short item_hit)
}
// mode 0 - wandering 1 - special
void edit_out_wand(short mode)
{
void edit_out_wand(short mode) {
short item_hit,i,store_dialog_answer;
Str255 temp_str;
@@ -909,8 +875,7 @@ void edit_out_wand(short mode)
}
bool save_town_details()
{
bool save_town_details() {
Str255 str;
short i;
@@ -931,8 +896,7 @@ bool save_town_details()
return true;
}
void put_town_details_in_dlog()
{
void put_town_details_in_dlog() {
Str255 str;
short i;
@@ -945,8 +909,7 @@ void put_town_details_in_dlog()
}
void edit_town_details_event_filter (short item_hit)
{
void edit_town_details_event_filter (short item_hit) {
Str255 str;
short i;
@@ -961,9 +924,8 @@ void edit_town_details_event_filter (short item_hit)
}
}
void edit_town_details()
void edit_town_details() {
// ignore parent in Mac version
{
short town_details_hit,i,store_dialog_answer;
Str255 temp_str;
@@ -975,8 +937,7 @@ void edit_town_details()
cd_kill_dialog(832,0);
}
bool save_town_events()
{
bool save_town_events() {
Str255 str;
short i;
@@ -989,8 +950,7 @@ bool save_town_events()
return true;
}
void put_town_events_in_dlog()
{
void put_town_events_in_dlog() {
Str255 str;
short i;
@@ -1001,8 +961,7 @@ void put_town_events_in_dlog()
}
void edit_town_events_event_filter (short item_hit)
{
void edit_town_events_event_filter (short item_hit) {
Str255 str;
short i,spec;
@@ -1033,9 +992,8 @@ void edit_town_events_event_filter (short item_hit)
}
}
void edit_town_events()
void edit_town_events() {
// ignore parent in Mac version
{
short advanced_town_hit,i,store_dialog_answer;
Str255 temp_str;
@@ -1049,8 +1007,7 @@ void edit_town_events()
cd_kill_dialog(833,0);
}
bool save_advanced_town()
{
bool save_advanced_town() {
Str255 str;
short i;
@@ -1075,8 +1032,7 @@ bool save_advanced_town()
return true;
}
void put_advanced_town_in_dlog()
{
void put_advanced_town_in_dlog() {
Str255 str;
short i;
@@ -1091,8 +1047,7 @@ void put_advanced_town_in_dlog()
}
void edit_advanced_town_event_filter (short item_hit)
{
void edit_advanced_town_event_filter (short item_hit) {
Str255 str;
short i,spec;
@@ -1110,9 +1065,8 @@ void edit_advanced_town_event_filter (short item_hit)
}
}
void edit_advanced_town()
void edit_advanced_town() {
// ignore parent in Mac version
{
short advanced_town_hit,i,store_dialog_answer;
Str255 temp_str;
@@ -1126,8 +1080,7 @@ void edit_advanced_town()
cd_kill_dialog(834,0);
}
bool save_town_wand()
{
bool save_town_wand() {
Str255 str;
short i,j;
@@ -1142,8 +1095,7 @@ bool save_town_wand()
return true;
}
void put_town_wand_in_dlog()
{
void put_town_wand_in_dlog() {
Str255 str;
short i,j;
@@ -1155,8 +1107,7 @@ void put_town_wand_in_dlog()
}
void edit_town_wand_event_filter (short item_hit)
{
void edit_town_wand_event_filter (short item_hit) {
Str255 str;
short i,j,spec;
@@ -1178,9 +1129,8 @@ void edit_town_wand_event_filter (short item_hit)
}
}
void edit_town_wand()
void edit_town_wand() {
// ignore parent in Mac version
{
short town_wand_hit,i,store_dialog_answer;
Str255 temp_str;
@@ -1194,8 +1144,7 @@ void edit_town_wand()
cd_kill_dialog(835,0);
}
bool save_basic_dlog()
{
bool save_basic_dlog() {
Str255 str;
short i,j;
@@ -1209,8 +1158,7 @@ bool save_basic_dlog()
return true;
}
void put_basic_dlog_in_dlog()
{
void put_basic_dlog_in_dlog() {
Str255 str;
short i,j;
@@ -1223,8 +1171,7 @@ void put_basic_dlog_in_dlog()
}
void edit_basic_dlog_event_filter (short item_hit)
{
void edit_basic_dlog_event_filter (short item_hit) {
Str255 str;
short i,j,spec;
@@ -1251,9 +1198,8 @@ void edit_basic_dlog_event_filter (short item_hit)
}
}
void edit_basic_dlog(short which_node)
void edit_basic_dlog(short which_node) {
// ignore parent in Mac version
{
short basic_dlog_hit,i,store_dialog_answer;
Str255 temp_str;
@@ -1270,8 +1216,7 @@ void edit_basic_dlog(short which_node)
cd_kill_dialog(821,0);
}
bool save_talk_node()
{
bool save_talk_node() {
Str255 str;
short i;
@@ -1353,8 +1298,7 @@ bool save_talk_node()
return true;
}
void put_talk_node_in_dlog()
{
void put_talk_node_in_dlog() {
Str255 str;
short i;
@@ -1398,8 +1342,7 @@ void put_talk_node_in_dlog()
}
void edit_talk_node_event_filter (short item_hit)
{
void edit_talk_node_event_filter (short item_hit) {
Str255 str;
short i,j,node_to_change_to = -1,spec;
@@ -1420,8 +1363,8 @@ void edit_talk_node_event_filter (short item_hit)
}
break;
case 12:
toast_dialog(); break;
toast_dialog();
break;
case 14:
if (save_talk_node() == false)
break;
@@ -1521,9 +1464,8 @@ void edit_talk_node_event_filter (short item_hit)
}
}
void edit_talk_node(short which_node,short parent_num)
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;
@@ -1550,8 +1492,7 @@ void edit_talk_node(short which_node,short parent_num)
cd_kill_dialog(817,0);
}
void pick_out_event_filter (short item_hit)
{
void pick_out_event_filter (short item_hit) {
Str255 temp_str;
short i,j,spec;
@@ -1587,9 +1528,8 @@ void pick_out_event_filter (short item_hit)
csit(854,11,(char *) temp_str);
}
short pick_out(location default_loc)
short pick_out(location default_loc) {
// ignore parent in Mac version
{
short basic_dlog_hit,i,store_dialog_answer;
Str255 temp_str;
@@ -1610,8 +1550,7 @@ short pick_out(location default_loc)
return dialog_answer;
}
void new_town_event_filter (short item_hit)
{
void new_town_event_filter (short item_hit) {
Str255 temp_str;
short i,j,spec;
@@ -1632,9 +1571,8 @@ void new_town_event_filter (short item_hit)
}
bool new_town(short which_town)
bool new_town(short which_town) {
// ignore parent in Mac version
{
printf("Town creation currently disabled.\n");
// short basic_dlog_hit,i,j,store_dialog_answer;
// Str255 temp_str;
@@ -1691,8 +1629,7 @@ bool new_town(short which_town)
}
// before calling this, be sure to do all checks to make sure it's safe.
void delete_last_town()
{
void delete_last_town() {
scenario.num_towns--;
scenario.town_size[scenario.num_towns] = 0;
scenario.town_hidden[scenario.num_towns] = 0;
@@ -1712,8 +1649,7 @@ void delete_last_town()
save_scenario();
}
void pick_import_town_event_filter (short item_hit)
{
void pick_import_town_event_filter (short item_hit) {
Str255 str;
short i;
@@ -1734,9 +1670,8 @@ void pick_import_town_event_filter (short item_hit)
}
}
short pick_import_town(short def, FSSpec* temp_file_to_load)
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;
NavReplyRecord s_reply;

View File

@@ -34,7 +34,7 @@ public:
cCreature& operator = (legacy::outdoor_creature_type old);
};
unsigned char terrain[48][48];
unsigned short terrain[48][48];
location special_locs[18];
unsigned char special_id[18];
location exit_locs[8];

View File

@@ -114,7 +114,7 @@ void cBigTown::append(legacy::big_tr_type& old){
}
}
unsigned char& cTinyTown::terrain(size_t x, size_t y){
unsigned short& cTinyTown::terrain(size_t x, size_t y){
return _terrain[x][y];
}
@@ -130,7 +130,7 @@ unsigned char& cTinyTown::lighting(size_t i, size_t r){
return _lighting[i][r];
}
unsigned char& cMedTown::terrain(size_t x, size_t y){
unsigned short& cMedTown::terrain(size_t x, size_t y){
return _terrain[x][y];
}
@@ -146,7 +146,7 @@ unsigned char& cMedTown::lighting(size_t i, size_t r){
return _lighting[i][r];
}
unsigned char& cBigTown::terrain(size_t x, size_t y){
unsigned short& cBigTown::terrain(size_t x, size_t y){
return _terrain[x][y];
}

View File

@@ -13,13 +13,13 @@ namespace legacy {
};
class cBigTown : public cTown { // formerly big_tr_type
unsigned char _terrain[64][64];
unsigned short _terrain[64][64];
rectangle _room_rect[16];
cCreature _creatures[60];
unsigned char _lighting[8][64];
public:
void append(legacy::big_tr_type& old);
unsigned char& terrain(size_t x, size_t y);
unsigned short& terrain(size_t x, size_t y);
rectangle& room_rect(size_t i);
cCreature& creatures(size_t i);
unsigned char& lighting(size_t i, size_t r);
@@ -30,13 +30,13 @@ public:
};
class cMedTown : public cTown { // formerly ave_tr_type
unsigned char _terrain[48][48];
unsigned short _terrain[48][48];
rectangle _room_rect[16];
cCreature _creatures[40];
unsigned char _lighting[6][48];
public:
void append(legacy::ave_tr_type& old);
unsigned char& terrain(size_t x, size_t y);
unsigned short& terrain(size_t x, size_t y);
rectangle& room_rect(size_t i);
cCreature& creatures(size_t i);
unsigned char& lighting(size_t i, size_t r);
@@ -47,13 +47,13 @@ public:
};
class cTinyTown : public cTown { // formerly tiny_tr_type
unsigned char _terrain[32][32];
unsigned short _terrain[32][32];
rectangle _room_rect[16];
cCreature _creatures[30];
unsigned char _lighting[4][32];
public:
void append(legacy::tiny_tr_type& old);
unsigned char& terrain(size_t x, size_t y);
unsigned short& terrain(size_t x, size_t y);
rectangle& room_rect(size_t i);
cCreature& creatures(size_t i);
unsigned char& lighting(size_t i, size_t r);

View File

@@ -8,8 +8,8 @@
#include "classes.h"
unsigned char& cTemplTown::terrain(size_t x, size_t y){
return _lighting[0][0]; // will need to calculate the terrain somehow
unsigned short& cTemplTown::terrain(size_t x, size_t y){
return _terrain[0][0]; // will need to calculate the terrain somehow
}
rectangle& cTemplTown::room_rect(size_t i){

View File

@@ -24,13 +24,13 @@ public:
};
private:
cCreature _creatures[30];
// unsigned char _terrain[?][?];
unsigned short _terrain[64][64];
rectangle _room_rect[16];
unsigned char _lighting[4][32];
cCityBlock blocks[15];
cTerRect ter_rects[10];
public:
unsigned char& terrain(size_t x, size_t y);
unsigned short& terrain(size_t x, size_t y);
rectangle& room_rect(size_t i);
cCreature& creatures(size_t i);
unsigned char& lighting(size_t i, size_t r);

View File

@@ -89,7 +89,7 @@ public:
virtual void append(legacy::big_tr_type& old);
virtual void append(legacy::ave_tr_type& old);
virtual void append(legacy::tiny_tr_type& old);
virtual unsigned char& terrain(size_t x, size_t y) = 0;
virtual unsigned short& terrain(size_t x, size_t y) = 0;
virtual rectangle& room_rect(size_t i) = 0;
virtual cCreature& creatures(size_t i) = 0;
virtual unsigned char& lighting(size_t i, size_t r) = 0;

View File

@@ -30,11 +30,11 @@ public:
cSpeech* cur_talk; // my addition
short cur_talk_loaded; // my addition
unsigned char setup[4][64][64]; // formerly setup_save_type
unsigned short setup[4][64][64]; // formerly setup_save_type
cItemRec items[115]; // formerly town_item_list type
char maps[200][8][64]; // formerly stored_town_maps_type
unsigned char template_terrain[64][64];
unsigned short template_terrain[64][64];
void append(legacy::current_town_type& old,short which_size);
void append(legacy::town_item_list& old);
@@ -48,7 +48,8 @@ class cCurOut {
public:
char expl[96][96]; // formerly out_info_type
char maps[100][6][48]; // formerly stored_outdoor_maps_type
unsigned char out[96][96],out_e[96][96];
unsigned short out[96][96];
unsigned char out_e[96][96];
cOutdoors outdoors[2][2];
unsigned char sfx[64][64];