Clean up tons of commented fileio code
This commit is contained in:
@@ -1022,204 +1022,6 @@ void make_new_scenario(std::string /*file_name*/,short /*out_width*/,short /*out
|
||||
giveError("Scenario not created; creation is currently disabled.");
|
||||
}
|
||||
|
||||
//bool check_p (short pword) {
|
||||
// if (scenario.flag_b != town_s(pword))
|
||||
// return false;
|
||||
// if (scenario.flag_c != out_s(pword))
|
||||
// return false;
|
||||
// if (scenario.flag_e != str_size_1(pword))
|
||||
// return false;
|
||||
// if (scenario.flag_f != str_size_2(pword))
|
||||
// return false;
|
||||
// if (scenario.flag_h != str_size_3(pword))
|
||||
// return false;
|
||||
// if (scenario.flag_d != init_data(pword))
|
||||
// return false;
|
||||
//
|
||||
// return true;
|
||||
//}
|
||||
//
|
||||
//bool check_p2 (short pword) {
|
||||
// if (scenario.flag_b != town_s(pword))
|
||||
// return false;
|
||||
// if (scenario.flag_c != out_s(pword))
|
||||
// return false;
|
||||
// if (scenario.flag_e != str_size_1(pword))
|
||||
// return false;
|
||||
// if (scenario.flag_f != str_size_2(pword))
|
||||
// return false;
|
||||
// if (scenario.flag_h != str_size_3(pword))
|
||||
// return false;
|
||||
// if (scenario.flag_d != init_data(pword))
|
||||
// return false;
|
||||
//
|
||||
// return true;
|
||||
//}
|
||||
//
|
||||
//bool check_p3 (short pword) {
|
||||
// if (scenario.flag_b != town_s(pword))
|
||||
// return false;
|
||||
// if (scenario.flag_c != out_s(pword))
|
||||
// return false;
|
||||
// if (scenario.flag_e != str_size_1(pword))
|
||||
// return false;
|
||||
// if (scenario.flag_f != str_size_2(pword))
|
||||
// return false;
|
||||
// if (scenario.flag_h != str_size_3(pword))
|
||||
// return false;
|
||||
// if (scenario.flag_d != init_data(pword))
|
||||
// return false;
|
||||
//
|
||||
// return true;
|
||||
//}
|
||||
//
|
||||
//bool import_check_p (short flag_d,short pword) {
|
||||
//
|
||||
// if (flag_d != init_data(pword))
|
||||
// return false;
|
||||
//
|
||||
// return true;
|
||||
//}
|
||||
//short init_data(short flag) {
|
||||
// long k = 0;
|
||||
//
|
||||
// k = (long) flag;
|
||||
// k = k * k;
|
||||
// jl = jl * jl + 84 + k;
|
||||
// k = k + 51;
|
||||
// jl = jl * 2 + 1234 + k;
|
||||
// k = k % 3000;
|
||||
// jl = jl * 54;
|
||||
// jl = jl * 2 + 1234 + k;
|
||||
// k = k * 82;
|
||||
// k = k % 10000;
|
||||
// k = k + 10000;
|
||||
//
|
||||
// return (short) k;
|
||||
//}
|
||||
//
|
||||
//short town_s(short flag) {
|
||||
// long k = 0;
|
||||
//
|
||||
// k = (long) flag;
|
||||
// k = k * k * k;
|
||||
// jl = jl * 54;
|
||||
// jl = jl * 2 + 1234 + k;
|
||||
// k = k + 51;
|
||||
// k = k % 3000;
|
||||
// jl = jl * 2 + 1234 + k;
|
||||
// k = k * scenario.num_towns;
|
||||
// k = k % 10000;
|
||||
// jl = jl * jl + 84 + k;
|
||||
// k = k + 10000;
|
||||
//
|
||||
// return (short) k;
|
||||
//}
|
||||
//
|
||||
//short out_s(short flag) {
|
||||
// long k = 0;
|
||||
//
|
||||
// k = (long) flag;
|
||||
// k = k * k * k;
|
||||
// jl = jl * jl + 84 + k;
|
||||
// k = k + scenario.out_data_size[0][1];
|
||||
// k = k % 3000;
|
||||
// k = k * 4;
|
||||
// jl = jl * 2 + 1234 + k;
|
||||
// jl = jl * 54;
|
||||
// jl = jl * 2 + 1234 + k;
|
||||
// k = k % 10000;
|
||||
// k = k + 4;
|
||||
//
|
||||
// return (short) k;
|
||||
//}
|
||||
//
|
||||
//short str_size_1(short flag) {
|
||||
// long k = 0;
|
||||
//
|
||||
// k = (long) flag;
|
||||
// k = k * k;
|
||||
// jl = jl * 2 + 1234 + k;
|
||||
// jl = jl * jl + 84 + k;
|
||||
// k = k + scenario.scen_str_len[0] + scenario.scen_str_len[1] + scenario.scen_str_len[2];
|
||||
// jl = jl * 2 + 1234 + k;
|
||||
// k = k % 3000;
|
||||
// jl = jl * 54;
|
||||
// jl = jl * jl + 84 + k;
|
||||
// k = k * 4;
|
||||
// k = k % 5000;
|
||||
// k = k - 9099;
|
||||
//
|
||||
// return (short) k;
|
||||
//}
|
||||
//
|
||||
//short str_size_2(short flag) {
|
||||
// long k = 0;
|
||||
//
|
||||
// k = (long) flag;
|
||||
// jl = jl * jl + 84 + k;
|
||||
// k = k * k * k * k;
|
||||
// jl = jl * 54;
|
||||
// k = k + 80;
|
||||
// k = k % 3000;
|
||||
// jl = jl * 2 + 1234 + k;
|
||||
// k = k * scenario.out_width * scenario.out_height;
|
||||
// jl = jl * jl + 84 + k;
|
||||
// k = k % 3124;
|
||||
// k = k - 5426;
|
||||
//
|
||||
// return (short) k;
|
||||
//}
|
||||
//
|
||||
//short str_size_3(short flag) {
|
||||
// long k = 0;
|
||||
//
|
||||
// k = (long) flag;
|
||||
// k = k * (scenario.town_data_size[0][0] + scenario.town_data_size[0][1] + scenario.town_data_size[0][2] + scenario.town_data_size[0][3]);
|
||||
// k = k + 80;
|
||||
// jl = jl * jl + 84 + k;
|
||||
// k = k % 3000;
|
||||
// jl = jl * 2 + 1234 + k;
|
||||
// k = k * 45;
|
||||
// jl = jl * 54;
|
||||
// jl = jl * jl + 84 + k;
|
||||
// k = k % 887;
|
||||
// k = k + 9452;
|
||||
//
|
||||
// return (short) k;
|
||||
//}
|
||||
//
|
||||
//short get_buf_ptr(short flag) {
|
||||
// long k = 0;
|
||||
//
|
||||
// k = (long) flag;
|
||||
// jl = jl * jl + 84 + k;
|
||||
// k = k * (scenario.out_width + scenario.out_width + scenario.out_height + scenario.town_data_size[0][3]);
|
||||
// k = k + 80;
|
||||
// jl = jl * jl + 84 + k;
|
||||
// k = k % 2443;
|
||||
// jl = jl * 54;
|
||||
// k = k * 322;
|
||||
// jl = jl * 2 + 1234 + k;
|
||||
// k = k % 2542;
|
||||
// jl = jl * jl + 84 + k;
|
||||
// k = k + 234;
|
||||
//
|
||||
// return (short) k;
|
||||
//}
|
||||
//
|
||||
//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);
|
||||
// scenario.flag_c = out_s(user_given_password);
|
||||
// scenario.flag_e = str_size_1(user_given_password);
|
||||
// scenario.flag_f = str_size_2(user_given_password);
|
||||
// scenario.flag_h = str_size_3(user_given_password);
|
||||
// scenario.flag_g = 10000 + get_ran(1,0,5000);
|
||||
// scenario.flag_d = init_data(user_given_password);
|
||||
//}
|
||||
|
||||
void start_data_dump() {
|
||||
short i;
|
||||
char* scen_name = scenario.scen_strs(0);
|
||||
@@ -1262,11 +1064,12 @@ void scen_text_dump(){
|
||||
fout << "Town Text:" << endl << endl;
|
||||
for (short j = 0; j < scenario.num_towns; j++) {
|
||||
fout << " Town " << j << ':' << endl;
|
||||
fout << " Town Messages:" << endl;
|
||||
load_town(j,town);
|
||||
for (i = 0; i < 135; i++)
|
||||
if (town->town_strs(i)[0] != '*')
|
||||
fout << " Message " << i << ": " << town->town_strs(i) << endl;
|
||||
fout << endl;
|
||||
fout << endl << " Town Dialogue:" << endl;
|
||||
for (i = 0; i < 10; i++) {
|
||||
fout << " Personality " << i << " (" << town->talking.talk_strs[i] << "): " << endl;
|
||||
fout << " look: " << town->talking.talk_strs[i + 10] << endl;
|
||||
@@ -1283,233 +1086,3 @@ void scen_text_dump(){
|
||||
load_town(cur_town,town);
|
||||
}
|
||||
|
||||
//void start_data_dump()
|
||||
//{
|
||||
// short i;
|
||||
// short j,k;
|
||||
// long val_store,to_return = 0;
|
||||
// short the_type,data_dump_file_id;
|
||||
// Handle the_handle = NULL;
|
||||
// RECT the_rect;
|
||||
// char the_string[256],store_name[256];
|
||||
// char get_text[280];
|
||||
// FSSpec dump_file;
|
||||
// OSErr error;
|
||||
// long len,empty_len;
|
||||
//
|
||||
// FSMakeFSSpec(start_volume,start_dir,"Scenario data",&dump_file);
|
||||
// FSpDelete(&dump_file);
|
||||
// error = FSpCreate(&dump_file,'ttxt','TEXT',smSystemScript);
|
||||
// if ((error = FSpOpenDF(&dump_file,3,&data_dump_file_id)) != 0) {
|
||||
// SysBeep(50);
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
//
|
||||
//// sprintf((char *)empty_line,"\r");
|
||||
//// empty_len = (long) (strlen((char *)empty_line));
|
||||
//
|
||||
// SetFPos (data_dump_file_id, 2, 0);
|
||||
//
|
||||
// sprintf((char *)get_text,"Scenario data for %s:\r",data_store->scen_strs[0]);
|
||||
// len = (long) (strlen((char *)get_text));
|
||||
// FSWrite(data_dump_file_id, &len, (char *) get_text);
|
||||
// sprintf((char *)get_text,"\r");
|
||||
// len = (long) (strlen((char *)get_text));
|
||||
// FSWrite(data_dump_file_id, &len, (char *) get_text);
|
||||
//
|
||||
// sprintf((char *)get_text,"Terrain types for %s:\r",data_store->scen_strs[0]);
|
||||
// len = (long) (strlen((char *)get_text));
|
||||
// FSWrite(data_dump_file_id, &len, (char *) get_text);
|
||||
//
|
||||
//
|
||||
// for (i = 0; i < 256; i++) {
|
||||
// sprintf((char *)get_text," Terrain type %d: %s\r",i,data_store->scen_item_list.ter_names[i]);
|
||||
// len = (long) (strlen((char *)get_text));
|
||||
// FSWrite(data_dump_file_id, &len, (char *) get_text);
|
||||
//
|
||||
// }
|
||||
//
|
||||
// sprintf((char *)get_text,"\r");
|
||||
// len = (long) (strlen((char *)get_text));
|
||||
// FSWrite(data_dump_file_id, &len, (char *) get_text);
|
||||
//
|
||||
// sprintf((char *)get_text,"Monster types for %s:\r",data_store->scen_strs[0]);
|
||||
// len = (long) (strlen((char *)get_text));
|
||||
// FSWrite(data_dump_file_id, &len, (char *) get_text);
|
||||
//
|
||||
// for (i = 0; i < 256; i++) {
|
||||
// sprintf((char *)get_text," Monster type %d: %s\r",i,data_store->scen_item_list.monst_names[i]);
|
||||
// len = (long) (strlen((char *)get_text));
|
||||
// FSWrite(data_dump_file_id, &len, (char *) get_text);
|
||||
//
|
||||
// }
|
||||
//
|
||||
// sprintf((char *)get_text,"\r");
|
||||
// len = (long) (strlen((char *)get_text));
|
||||
// FSWrite(data_dump_file_id, &len, (char *) get_text);
|
||||
//
|
||||
// sprintf((char *)get_text,"Item types for %s:\r",data_store->scen_strs[0]);
|
||||
// len = (long) (strlen((char *)get_text));
|
||||
// FSWrite(data_dump_file_id, &len, (char *) get_text);
|
||||
//
|
||||
// for (i = 0; i < 400; i++) {
|
||||
// sprintf((char *)get_text," Item type %d: %s\r",i,data_store->scen_item_list.scen_items[i].full_name);
|
||||
// len = (long) (strlen((char *)get_text));
|
||||
// FSWrite(data_dump_file_id, &len, (char *) get_text);
|
||||
//
|
||||
// }
|
||||
// FSClose(data_dump_file_id);
|
||||
//
|
||||
//}
|
||||
//
|
||||
//void scen_text_dump()
|
||||
//{
|
||||
// short i;
|
||||
// short j,k;
|
||||
// long val_store,to_return = 0;
|
||||
// short the_type,data_dump_file_id;
|
||||
// Handle the_handle = NULL;
|
||||
// RECT the_rect;
|
||||
// char the_string[256],store_name[256];
|
||||
// char get_text[300];
|
||||
// FSSpec dump_file;
|
||||
// OSErr error;
|
||||
// long len,empty_len;
|
||||
// location out_sec;
|
||||
//
|
||||
// FSMakeFSSpec(start_volume,start_dir,"Scenario text",&dump_file);
|
||||
// FSpDelete(&dump_file);
|
||||
// error = FSpCreate(&dump_file,'ttxt','TEXT',smSystemScript);
|
||||
// if ((error = FSpOpenDF(&dump_file,3,&data_dump_file_id)) != 0) {
|
||||
// SysBeep(50);
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
//
|
||||
//// sprintf((char *)empty_line,"\r");
|
||||
//// empty_len = (long) (strlen((char *)empty_line));
|
||||
//
|
||||
// SetFPos (data_dump_file_id, 2, 0);
|
||||
//
|
||||
// sprintf((char *)get_text,"Scenario text for %s:\r",data_store->scen_strs[0]);
|
||||
// len = (long) (strlen((char *)get_text));
|
||||
// FSWrite(data_dump_file_id, &len, (char *) get_text);
|
||||
// sprintf((char *)get_text,"\r");
|
||||
// len = (long) (strlen((char *)get_text));
|
||||
// FSWrite(data_dump_file_id, &len, (char *) get_text);
|
||||
//
|
||||
// sprintf((char *)get_text,"Scenario Text:\r",data_store->scen_strs[0]);
|
||||
// len = (long) (strlen((char *)get_text));
|
||||
// FSWrite(data_dump_file_id, &len, (char *) get_text);
|
||||
// sprintf((char *)get_text,"\r");
|
||||
// len = (long) (strlen((char *)get_text));
|
||||
// FSWrite(data_dump_file_id, &len, (char *) get_text);
|
||||
// for (i = 0; i < 260; i++)
|
||||
// if (data_store->scen_strs[i][0] != '*') {
|
||||
// sprintf((char *)get_text," Message %d: %s\r",i,data_store->scen_strs[i]);
|
||||
// len = (long) (strlen((char *)get_text));
|
||||
// FSWrite(data_dump_file_id, &len, (char *) get_text);
|
||||
// }
|
||||
//
|
||||
// sprintf((char *)get_text,"\r");
|
||||
// len = (long) (strlen((char *)get_text));
|
||||
// FSWrite(data_dump_file_id, &len, (char *) get_text);
|
||||
// sprintf((char *)get_text,"Outdoor Sections Text:\r",data_store->scen_strs[0]);
|
||||
// len = (long) (strlen((char *)get_text));
|
||||
// FSWrite(data_dump_file_id, &len, (char *) get_text);
|
||||
// sprintf((char *)get_text,"\r");
|
||||
// len = (long) (strlen((char *)get_text));
|
||||
// FSWrite(data_dump_file_id, &len, (char *) get_text);
|
||||
// for (out_sec.x = 0; out_sec.x < scenario.out_width ; out_sec.x++)
|
||||
// for (out_sec.y = 0; out_sec.y < scenario.out_height ; out_sec.y++) {
|
||||
// sprintf((char *)get_text," Section X = %d, Y = %d:\r",(short) out_sec.x,(short) out_sec.y);
|
||||
// len = (long) (strlen((char *)get_text));
|
||||
// FSWrite(data_dump_file_id, &len, (char *) get_text);
|
||||
// sprintf((char *)get_text,"\r");
|
||||
// len = (long) (strlen((char *)get_text));
|
||||
// FSWrite(data_dump_file_id, &len, (char *) get_text);
|
||||
//
|
||||
// load_outdoors(out_sec,0);
|
||||
// for (i = 0; i < 108; i++)
|
||||
// if (data_store->out_strs[i][0] != '*') {
|
||||
// sprintf((char *)get_text," Message %d: %s\r",i,data_store->out_strs[i]);
|
||||
// len = (long) (strlen((char *)get_text));
|
||||
// FSWrite(data_dump_file_id, &len, (char *) get_text);
|
||||
// }
|
||||
// sprintf((char *)get_text,"\r");
|
||||
// len = (long) (strlen((char *)get_text));
|
||||
// FSWrite(data_dump_file_id, &len, (char *) get_text);
|
||||
// }
|
||||
// augment_terrain(out_sec);
|
||||
//
|
||||
// sprintf((char *)get_text,"Town Text:\r",data_store->scen_strs[0]);
|
||||
// len = (long) (strlen((char *)get_text));
|
||||
// FSWrite(data_dump_file_id, &len, (char *) get_text);
|
||||
// sprintf((char *)get_text,"\r");
|
||||
// len = (long) (strlen((char *)get_text));
|
||||
// FSWrite(data_dump_file_id, &len, (char *) get_text);
|
||||
// for (j = 0; j < scenario.num_towns; j++) {
|
||||
// load_town(j);
|
||||
//
|
||||
// sprintf((char *)get_text," Town: %s\r",data_store->town_strs[0]);
|
||||
// len = (long) (strlen((char *)get_text));
|
||||
// FSWrite(data_dump_file_id, &len, (char *) get_text);
|
||||
// sprintf((char *)get_text,"\r");
|
||||
// len = (long) (strlen((char *)get_text));
|
||||
// FSWrite(data_dump_file_id, &len, (char *) get_text);
|
||||
// sprintf((char *)get_text," Town Messages:",data_store->town_strs[j]);
|
||||
// len = (long) (strlen((char *)get_text));
|
||||
// FSWrite(data_dump_file_id, &len, (char *) get_text);
|
||||
// sprintf((char *)get_text,"\r");
|
||||
// len = (long) (strlen((char *)get_text));
|
||||
// FSWrite(data_dump_file_id, &len, (char *) get_text);
|
||||
//
|
||||
// for (i = 0; i < 135; i++)
|
||||
// if (data_store->town_strs[i][0] != '*') {
|
||||
// sprintf((char *)get_text," Message %d: %s\r",i,data_store->town_strs[i]);
|
||||
// len = (long) (strlen((char *)get_text));
|
||||
// FSWrite(data_dump_file_id, &len, (char *) get_text);
|
||||
// }
|
||||
//
|
||||
// sprintf((char *)get_text," Town Dialogue:",data_store->town_strs[j]);
|
||||
// len = (long) (strlen((char *)get_text));
|
||||
// FSWrite(data_dump_file_id, &len, (char *) get_text);
|
||||
// sprintf((char *)get_text,"\r");
|
||||
// len = (long) (strlen((char *)get_text));
|
||||
// FSWrite(data_dump_file_id, &len, (char *) get_text);
|
||||
//
|
||||
// for (i = 0; i < 10; i++) {
|
||||
// sprintf((char *)get_text," Personality %d name: %s\r",j * 10 + i,data_store->talk_strs[i]);
|
||||
// len = (long) (strlen((char *)get_text));
|
||||
// FSWrite(data_dump_file_id, &len, (char *) get_text);
|
||||
// sprintf((char *)get_text," Personality %d look: %s\r",j * 10 + i,data_store->talk_strs[i + 10]);
|
||||
// len = (long) (strlen((char *)get_text));
|
||||
// FSWrite(data_dump_file_id, &len, (char *) get_text);
|
||||
// sprintf((char *)get_text," Personality %d ask name: %s\r",j * 10 + i,data_store->talk_strs[i + 20]);
|
||||
// len = (long) (strlen((char *)get_text));
|
||||
// FSWrite(data_dump_file_id, &len, (char *) get_text);
|
||||
// sprintf((char *)get_text," Personality %d ask job: %s\r",j * 10 + i,data_store->talk_strs[i + 30]);
|
||||
// len = (long) (strlen((char *)get_text));
|
||||
// FSWrite(data_dump_file_id, &len, (char *) get_text);
|
||||
// sprintf((char *)get_text," Personality %d confused: %s\r",j * 10 + i,data_store->talk_strs[i + 160]);
|
||||
// len = (long) (strlen((char *)get_text));
|
||||
// FSWrite(data_dump_file_id, &len, (char *) get_text);
|
||||
// }
|
||||
//
|
||||
// for (i = 40; i < 160; i++)
|
||||
// if (strlen((char *) (data_store->talk_strs[i])) > 0) {
|
||||
// sprintf((char *)get_text," Node %d: %s\r",(i - 40) / 2,data_store->talk_strs[i]);
|
||||
// len = (long) (strlen((char *)get_text));
|
||||
// FSWrite(data_dump_file_id, &len, (char *) get_text);
|
||||
// }
|
||||
//
|
||||
// sprintf((char *)get_text,"\r");
|
||||
// len = (long) (strlen((char *)get_text));
|
||||
// FSWrite(data_dump_file_id, &len, (char *) get_text);
|
||||
//
|
||||
// }
|
||||
//
|
||||
// FSClose(data_dump_file_id);
|
||||
//
|
||||
//}r->right = a;
|
||||
|
Reference in New Issue
Block a user