Fix several more warnings

- As a side-effect, weapons with key skills other than the conventional three (edged, bashing, pole) are now fully supported (though the scenario editor UI doesn't yet support them)
This commit is contained in:
2015-01-11 16:43:23 -05:00
parent 148fa56a14
commit 43e4bcc048
17 changed files with 20 additions and 74 deletions

View File

@@ -1423,7 +1423,6 @@ void handle_monster_actions(bool& need_redraw, bool& need_reprint) {
need_redraw = false;
}
//pause(2);
short store_cur_pc = current_pc;
if(combat_next_step())
need_redraw = true;
}

View File

@@ -650,6 +650,9 @@ void pc_attack(short who_att,short target) {
case eSkill::POLE_WEAPONS:
damage_monst(target, who_att, r2, spec_dam, DAMAGE_WEAPON,3);
break;
default: // TODO: Not sure what sound to play for unconventional weapons, but let's just go with the generic "ouch" for now
damage_monst(target, who_att, r2, spec_dam, DAMAGE_WEAPON, 0);
break;
}
// poison
if(univ.party[who_att].status[eStatus::POISONED_WEAPON] > 0 && univ.party[who_att].weap_poisoned == weap1) {
@@ -716,6 +719,9 @@ void pc_attack(short who_att,short target) {
case eSkill::POLE_WEAPONS:
damage_monst(target, who_att, r2, spec_dam, DAMAGE_WEAPON,3);
break;
default: // TODO: Not sure what sound to play for unconventional weapons, but let's just go with the generic "ouch" for now
damage_monst(target, who_att, r2, spec_dam, DAMAGE_WEAPON, 0);
break;
}
if((univ.party[who_att].items[weap2].ability == eItemAbil::POISONED_WEAPON) && (get_ran(1,0,1) == 1)) {

View File

@@ -1013,7 +1013,7 @@ bool pc_gworld_loaded = false;
// Returns true is a theft committed
//pc_num; // < 6 - this pc only 6 - any pc
//short mode; // 0 - adjacent 1 - all in sight
bool display_item(location from_loc,short pc_num,short mode, bool check_container) {
bool display_item(location from_loc,short /*pc_num*/,short mode, bool check_container) {
// short item_array[130];
std::vector<cItemRec*> item_array;
short i;

View File

@@ -284,6 +284,7 @@ void menu_activate() {
@implementation MenuHandler
-(void) monstMenu:(id) sender {
cMonster* monst = [[sender representedObject] monst];
(void) monst; // Mark variable as unused
handle_monster_info_menu([monster_info_menu indexOfItem: sender] - 1);
}

View File

@@ -113,7 +113,7 @@ short store_pc_graphic;
// Until that time, the party scen vals are uninited
// Then, it inits the party properly for starting the scenario based
// on the loaded scenario
void init_party_scen_data() {
static void init_party_scen_data() {
short i,j,k,l;
bool stored_item = false;
short store_help;
@@ -1470,7 +1470,6 @@ void cast_town_spell(location where) {
}
adjust = can_see_light(univ.town.p_loc,where,sight_obscurity);
eSkill spell_type = (*town_spell).type;
if(!spell_freebie)
univ.party[who_cast].cur_sp -= (*town_spell).cost;
ter = univ.town->terrain(where.x,where.y);

View File

@@ -586,7 +586,7 @@ short total_encumberance(short pc_num) {
return store;
}
rectangle get_stat_effect_rect(eStatus which_effect) {
static rectangle get_stat_effect_rect(eStatus which_effect) {
int code = (int) which_effect;
rectangle base = {0,0,12,12};
base.offset(12 * (code % 3), 12 * (code / 3));

View File

@@ -427,6 +427,8 @@ static std::string get_node_string(std::string base, eSpecType type, int which)
return get_str(base + "-rect", strnum);
case eSpecCat::OUTDOOR:
return get_str(base + "-outdoor", strnum);
case eSpecCat::INVALID:
return "error";
}
return "";
}

View File

@@ -175,7 +175,7 @@ template<> pair<string,cPict*> cDialog::parse(Element& who /*pict*/){
return p;
}
string dlogStringFilter(string toFilter) {
static string dlogStringFilter(string toFilter) {
string filtered;
bool found_nl = false;
for(char c : toFilter) {

View File

@@ -357,6 +357,7 @@ void cTextField::handleInput(cKey key) {
contents.insert(contents.begin() + insertionPoint, char(key.c));
selectionPoint = ++insertionPoint;
} else switch(key.k) {
case key_enter: break; // Shouldn't be receiving this anyway
// TODO: Implement all the other special keys
case key_left: case key_word_left:
if(haveSelection && !select) {

View File

@@ -13,7 +13,7 @@ void cStack::attachClickHandler(click_callback_t f) throw(xHandlerNotSupported)
onClick = f;
}
void cStack::attachFocusHandler(focus_callback_t f) throw(xHandlerNotSupported) {
void cStack::attachFocusHandler(focus_callback_t) throw(xHandlerNotSupported) {
throw xHandlerNotSupported(true);
}

View File

@@ -147,15 +147,6 @@ short select_pc(short active_only,short free_inv_only) {
else return char_select_pc(active_only,free_inv_only,"Select a character:");
}
static short party_total_level() {
short i,j = 0;
for(i = 0; i < 6; i++)
if(univ.party[i].main_status == eMainStatus::ALIVE)
j += univ.party[i].level;
return j;
}
static void put_pc_spells(cDialog& me, const short store_trait_mode) {
short i;
@@ -243,7 +234,7 @@ static void display_traits_graphics(cDialog& me) {
me["xp"].setTextToNum(store);
}
static bool pick_race_select_led(cDialog& me, std::string item_hit, bool losing, const short store_trait_mode) {
static bool pick_race_select_led(cDialog& me, std::string item_hit, bool, const short store_trait_mode) {
int abil_str = 0;
cPlayer *pc;

View File

@@ -432,7 +432,6 @@ bool handle_action(location the_point,sf::Event /*event*/) {
i = (the_point.x - TER_RECT_UL_X - 8) / scale;
j = (the_point.y - TER_RECT_UL_Y - 8) / scale;
if(scale > 4) {
short dim = editing_town ? town->max_dim() : 48;
if(cen_x + 5 > 256 / scale)
spot_hit.x = cen_x + 5 - 256/scale + i;
else spot_hit.x = i;

View File

@@ -132,7 +132,7 @@ bool check_range(cDialog& me,std::string id,bool losing,long min_val,long max_va
}
// TODO: I have two functions that do this. (The other one is choose_graphic.)
bool pick_picture(ePicType type, cDialog& parent, std::string result_fld, std::string pic_fld, pic_num_t modifier){
static bool pick_picture(ePicType type, cDialog& parent, std::string result_fld, std::string pic_fld, pic_num_t modifier){
pic_num_t cur_sel = 0;
if(result_fld != ""){
cControl& fld_ctrl = parent[result_fld];

View File

@@ -30,4 +30,5 @@ void edit_scen_intro();
bool edit_area_rect_str(short which_str,short mode);
void make_cursor_sword() ;
void edit_dialog_text(short mode,short *str1,cDialog* parent);
size_t num_strs(short str_mode);

View File

@@ -330,7 +330,6 @@ void win_draw_string(sf::RenderTarget& dest_window,rectangle dest_rect,std::stri
if(mode == eTextMode::WRAP) {
moveTo = location(dest_rect.left + 1 + adjust_x, dest_rect.top + 1 + adjust_y + 9);
for(i = 0; text_len(i) != text_len(i + 1) && i < str_len;i++) {
int iLen = text_len(i), lineLen = text_len(last_line_break);
if(((text_len(i) - text_len(last_line_break) > (dest_rect.width() - 6))
&& (last_word_break >= last_line_break)) || (str[i] == '|')) {
if(str[i] == '|') {

View File

@@ -41,58 +41,6 @@ void port_town(legacy::town_record_type* dummy_town_ptr){
}
static void port_dummy_t_d(short size,char *buffer) {
short i;
legacy::big_tr_type *d1;
legacy::ave_tr_type *d2;
legacy::tiny_tr_type *d3;
if(cur_scen_is_mac != mac_is_intel)
return;
switch(size) {
case 0:
d1 = (legacy::big_tr_type *) buffer;
for(i =0 ; i < 16; i++)
flip_rect(&d1->room_rect[i]);
for(i =0 ; i < 60; i++) {
flip_short(&d1->creatures[i].spec1);
flip_short(&d1->creatures[i].spec2);
flip_short(&d1->creatures[i].monster_time);
flip_short(&d1->creatures[i].personality);
flip_short(&d1->creatures[i].special_on_kill);
flip_short(&d1->creatures[i].facial_pic);
}
break;
case 1:
d2 = (legacy::ave_tr_type *) buffer;
for(i =0 ; i < 16; i++)
flip_rect(&d2->room_rect[i]);
for(i =0 ; i < 40; i++) {
flip_short(&d2->creatures[i].spec1);
flip_short(&d2->creatures[i].spec2);
flip_short(&d2->creatures[i].monster_time);
flip_short(&d2->creatures[i].personality);
flip_short(&d2->creatures[i].special_on_kill);
flip_short(&d2->creatures[i].facial_pic);
}
break;
case 2:
d3 = (legacy::tiny_tr_type *) buffer;
for(i =0 ; i < 16; i++)
flip_rect(&d3->room_rect[i]);
for(i =0 ; i < 30; i++) {
flip_short(&d3->creatures[i].spec1);
flip_short(&d3->creatures[i].spec2);
flip_short(&d3->creatures[i].monster_time);
flip_short(&d3->creatures[i].personality);
flip_short(&d3->creatures[i].special_on_kill);
flip_short(&d3->creatures[i].facial_pic);
}
break;
}
}
void port_talk_nodes(legacy::talking_record_type* dummy_talk_ptr) {
short i;

View File

@@ -82,11 +82,11 @@ SpecialParser::SpecialParser() {
#undef _
auto SpecialParser::on_error(const Rule::scanner_t& scan, spirit::parser_error<eParseError, Iter> error) -> ErrStatus {
auto SpecialParser::on_error(const Rule::scanner_t&, spirit::parser_error<eParseError, Iter>) -> ErrStatus {
return ErrStatus(ErrStatus::fail);
}
void init_specials_parse() {
static void init_specials_parse() {
opcode.add((*eSpecType::NONE).opcode().c_str(), eSpecType::NONE);
// Fill in all the opcodes and check for missing types.
// There's really no need to check all the way to the max of the underlying type.