- Merged two classes (cPopulation::cCreature and cTown::cCreature)

- Changes some C-strings to STL-strings
- Fixed the problem where the spiderweb logo would not fully appear if ShowStartupSplash is disabled

git-svn-id: http://openexile.googlecode.com/svn/trunk@54 4ebdad44-0ea0-11de-aab3-ff745001d230
This commit is contained in:
2009-05-07 02:50:16 +00:00
parent 68dcf3cdef
commit 4dc75d51c0
46 changed files with 932 additions and 831 deletions

View File

@@ -26,7 +26,7 @@ short current_block_edited = 0;
short current_terrain_type = 0;
short safety = 0;
location spot_hit,last_spot_hit(-1,-1);
cTown::cCreature null_monst = {0,0,loc(),0,0,0,0,0,0};
//cTown::cCreature null_monst = {0,0,loc(),0,0,0,0,0,0};
//creature_start_type store_monst = {0,0,{0,0},0,0,0,0,0,0};
bool sign_error_received = false;
short copied_spec = -1;
@@ -99,7 +99,7 @@ short town_buttons[6][10] = {
{50,51,52,53,54,55,56,57,-1,-1},
};
cTown::cCreature last_placed_monst = {0,0,loc(),0,0,0,0,0,0,0};
cCreature last_placed_monst;
cSpecial null_spec_node;// = {0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1};
cSpeech::cNode null_talk_node = {0,0,{120,120,120,120},{120,120,120,120},{0,0,0,0}};
@@ -116,12 +116,12 @@ bool monst_on_space(location loc,short m_num);
short can_see(location p1,location p2,short mode);
void init_current_terrain() {
short i,j;
location d_loc(0,0);
Rect d_rect = {0,0,0,0};
cTown::cWandering d_wan = {0,0,0,0};
cTown::cCreature dummy_creature = {0,0,loc(),0,0,0,0,0,0,0};
//city_ter_rect_type dummy_ter_rect = {{0,0,0,0},0,0};
// short i,j;
// location d_loc(0,0);
// Rect d_rect = {0,0,0,0};
// cTown::cWandering d_wan = {0,0,0,0};
// cTown::cCreature dummy_creature = {0,0,loc(),0,0,0,0,0,0,0};
// //city_ter_rect_type dummy_ter_rect = {{0,0,0,0},0,0};
}
void init_screen_locs() {
@@ -631,7 +631,7 @@ bool handle_action(Point the_point,EventRecord event) {
town->creatures(i).number = mode_count;
town->creatures(i).start_attitude =
scenario.scen_monsters[mode_count].default_attitude;
town->creatures(i).mobile = 1;
town->creatures(i).mobility = 1;
town->creatures(i).time_flag = 0;
town->creatures(i).extra1 = 0;
town->creatures(i).extra2 = 0;
@@ -3255,7 +3255,7 @@ void start_monster_editing(short just_redo_text) {
SetControlMaximum(right_sbar,255 - NRSONPAGE);
}
for (i = 1; i < 256; i++) {
sprintf((char *) str,"%d - %s",i,(char *) scenario.scen_monsters[i].m_name);
sprintf((char *) str,"%d - %s",i,(char *) scenario.scen_monsters[i].m_name.c_str());
set_rb(i - 1,2000 + i,(char *) str,0);
}
if (draw_full == true)
@@ -3283,7 +3283,7 @@ void start_item_editing(short just_redo_text) {
SetControlMaximum(right_sbar,400 - NRSONPAGE);
}
for (i = 0; i < 400; i++) {
sprintf((char *) str,"%d - %s",i,(char *) scenario.scen_items[i].full_name);
sprintf((char *) str,"%d - %s",i,(char *) scenario.scen_items[i].full_name.c_str());
set_rb(i,3000 + i,(char *) str,0);
}
if (draw_full == true)

View File

@@ -851,10 +851,10 @@ void init_scenario() {
scenario.scen_monsters[i] = return_monster_template(i);
get_str(temp_str,2,i);
if ((i > 187) || (i == 0))
sprintf((char *)scenario.scen_monsters[i].m_name, "Unused");
else sprintf((char *)scenario.scen_monsters[i].m_name, "%s", temp_str);
scenario.scen_monsters[i].m_name = "Unused";
else scenario.scen_monsters[i].m_name = (char*)temp_str;
if (i == 0)
sprintf((char *)scenario.scen_monsters[i].m_name, "Empty");
scenario.scen_monsters[i].m_name = "Empty";
}
for (i = 0; i < 30; i++) {
scenario.boats[i] = null_boat;
@@ -1096,7 +1096,7 @@ void put_monst_info_in_dlog() {
csp(814,34,store_monst.picture_num % 1000,type_g);
}
cdsin(814,33,store_which_monst);
CDST(814,2,(char*)scenario.scen_monsters[store_which_monst].m_name);
CDST(814,2,(char*)scenario.scen_monsters[store_which_monst].m_name.c_str());
CDSN(814,3,store_monst.picture_num);
sprintf((char *) str,"Width = %d",store_monst.x_width);
csit(814,40,(char *) str);
@@ -1134,7 +1134,7 @@ bool save_monst_info() {
CDGT(814,2,(char *) str);
str[19] = 0;
sprintf((char*)scenario.scen_monsters[store_which_monst].m_name,"%s",str);
scenario.scen_monsters[store_which_monst].m_name = (char*)str;
//CDGT(814,2,data_store->scen_item_list.monst_names[store_which_monst]);
store_monst.picture_num = CDGN(814,3);
if (cre(store_monst.picture_num,0,5000,"Monster pic must be from 0 to 5000.","",814) > 0) return false;
@@ -1463,8 +1463,8 @@ void put_item_info_in_dlog() {
Str255 str;
cdsin(818,52,store_which_item);
CDST(818,2,store_item.full_name);
CDST(818,3,store_item.name);
CDST(818,2,store_item.full_name.c_str());
CDST(818,3,store_item.name.c_str());
if (store_item.graphic_num >= 1000) // was 150
csp(818,49,store_item.graphic_num % 1000,PICT_CUSTOM + PICT_ITEM);
else csp(818,49,/*1800 + */store_item.graphic_num,PICT_ITEM);
@@ -1489,10 +1489,10 @@ bool save_item_info() {
CDGT(818,2,(char *) str);
str[24] = 0;
sprintf(store_item.full_name,"%s",str);
store_item.full_name = (char*)str;
CDGT(818,3,(char *) str);
str[14] = 0;
sprintf(store_item.name,"%s",str);
store_item.name = (char*)str;
store_item.graphic_num = CDGN(818,4);
store_item.variety = (eItemType) cd_get_led_range(818,18,45);
@@ -1629,7 +1629,7 @@ void put_item_abils_in_dlog() {
short i;
cdsin(824,16,store_which_item);
csit(824,32,store_item2.full_name);
csit(824,32,store_item2.full_name.c_str());
csit(824,34,item_types[store_item2.variety]);
get_str(str,23,store_item2.ability + 1);
csit(824,19,(char *) str);

View File

@@ -30,7 +30,7 @@ extern unsigned char borders[4][50];
extern location cur_out;
//extern cSpeech talking;
cTown::cCreature store_placed_monst,store_placed_monst2;
cCreature store_placed_monst,store_placed_monst2;
short store_which_placed_monst;
cTown::cItem store_placed_item;
short store_which_placed_item,store_which_sign;
@@ -111,9 +111,9 @@ void put_placed_monst_in_dlog() {
short i;
cdsin(837,24,store_which_placed_monst);
csit(837,7,(char*)scenario.scen_monsters[store_placed_monst.number].m_name);
csit(837,7,(char*)scenario.scen_monsters[store_placed_monst.number].m_name.c_str());
cd_set_led_range(837,14,17,store_placed_monst.start_attitude);
cd_set_led_range(837,18,19,store_placed_monst.mobile);
cd_set_led_range(837,18,19,store_placed_monst.mobility);
CDSN(837,2,store_placed_monst.personality);
CDSN(837,3,store_placed_monst.facial_pic);
if ((store_placed_monst.facial_pic < 1))
@@ -127,7 +127,7 @@ bool get_placed_monst_in_dlog() {
short i;
store_placed_monst.start_attitude = cd_get_led_range(837,14,17);
store_placed_monst.mobile = cd_get_led_range(837,18,19);
store_placed_monst.mobility = cd_get_led_range(837,18,19);
store_placed_monst.personality = CDGN(837,2);
store_placed_monst.facial_pic = CDGN(837,3);
// later
@@ -138,7 +138,7 @@ bool get_placed_monst_in_dlog() {
void edit_placed_monst_event_filter (short item_hit) {
Str255 str;
short i;
cTown::cCreature store_m;
cCreature store_m;
switch (item_hit) {
case 20:
@@ -210,7 +210,7 @@ void put_placed_monst_adv_in_dlog() {
short i;
cdsin(838,20,store_which_placed_monst);
csit(838,9,(char*)scenario.scen_monsters[store_placed_monst2.number].m_name);
csit(838,9,(char*)scenario.scen_monsters[store_placed_monst2.number].m_name.c_str());
for (i = 22; i < 30; i++)
cd_set_led(838,i,0);
if (store_placed_monst2.time_flag < 3)
@@ -273,7 +273,7 @@ void edit_placed_monst_adv_event_filter (short item_hit) {
}
}
cTown::cCreature edit_placed_monst_adv(cTown::cCreature monst_record) {
cCreature edit_placed_monst_adv(cCreature monst_record) {
short item_hit,i,store_dialog_answer;
Str255 temp_str;
@@ -308,7 +308,7 @@ void put_placed_item_in_dlog() {
cdsin(836,17,store_which_placed_item);
sprintf((char *) str,"X = %d, Y = %d",store_placed_item.loc.x,store_placed_item.loc.y);
csit(836,22,(char *) str);
csit(836,15,scenario.scen_items[store_placed_item.code].full_name);
csit(836,15,scenario.scen_items[store_placed_item.code].full_name.c_str());
CDSN(836,2,store_placed_item.ability);
if (store_placed_item.always_there == true)
cd_set_led(836,12,1);
@@ -351,7 +351,7 @@ bool get_placed_item_in_dlog() {
void edit_placed_item_event_filter (short item_hit) {
Str255 str;
short i;
cTown::cCreature store_m;
cCreature store_m;
switch (item_hit) {
case 3:
@@ -730,14 +730,14 @@ void put_out_wand_in_dlog() {
if (store_out_wand.monst[i] == 0)
csit(852, i + 7, "Empty");
else {
strcpy((char*)str,(char*)scenario.scen_monsters[store_out_wand.monst[i]].m_name);
strcpy((char*)str,(char*)scenario.scen_monsters[store_out_wand.monst[i]].m_name.c_str());
csit(852,i + 7,(char *) str);
}
for (i = 0; i < 3; i++)
if (store_out_wand.friendly[i] == 0)
csit(852, i + 7 + 7, "Empty");
else {
strcpy((char*)str,(char*)scenario.scen_monsters[store_out_wand.friendly[i]].m_name);
strcpy((char*)str,(char*)scenario.scen_monsters[store_out_wand.friendly[i]].m_name.c_str());
csit(852,i + 7 + 7,(char *) str);
}
if (store_out_wand.cant_flee % 10 == 1)
@@ -787,7 +787,7 @@ bool get_out_wand_in_dlog() {
void edit_out_wand_event_filter (short item_hit) {
Str255 str;
short i,spec;
cTown::cCreature store_m;
cCreature store_m;
switch (item_hit) {
case 17:

View File

@@ -4,7 +4,7 @@ void edit_placed_monst(short which_m);
void edit_placed_monst_event_filter (short item_hit);
bool get_placed_monst_in_dlog();
void put_placed_monst_in_dlog();
cTown::cCreature edit_placed_monst_adv(cTown::cCreature monst_record);
cCreature edit_placed_monst_adv(cCreature monst_record);
void edit_placed_monst_adv_event_filter (short item_hit);
bool get_placed_monst_adv_in_dlog();
void put_placed_monst_adv_in_dlog();