Squash a lot of missing prototype warnings

This commit is contained in:
2014-04-15 03:39:21 -04:00
parent 2d69851746
commit ac3ac31f04
18 changed files with 83 additions and 91 deletions

View File

@@ -2637,7 +2637,7 @@ location get_cur_direction(location the_point)
return store_dir;
}
eDirection find_waterfall(short x, short y, short mode){
static eDirection find_waterfall(short x, short y, short mode){
// If more than one waterfall adjacent, randomly selects
bool to_dir[8];
for(eDirection i = DIR_N; i < DIR_HERE; i++){
@@ -2664,7 +2664,7 @@ eDirection find_waterfall(short x, short y, short mode){
return DIR_HERE; // just in case something wonky happens
}
void run_waterfalls(short mode){ // mode 0 - town, 1 - outdoors
static void run_waterfalls(short mode){ // mode 0 - town, 1 - outdoors
short x,y;
if(mode == 0){
x = univ.town.p_loc.x;

View File

@@ -1128,7 +1128,7 @@ void save_prefs(bool resetHelp){
}
}
bool prefs_event_filter (cDialog& me, std::string id, eKeyMod mods)
static bool prefs_event_filter (cDialog& me, std::string id, eKeyMod mods)
{
// TODO: I should no longer need done_yet as this now only handles the okay and cancel buttons; the LEDs are now handled automatically by the cLed class (and the cLedGroup class, for LED groups).
bool done_yet = false,did_cancel = false,reset_help = false;
@@ -1254,7 +1254,7 @@ void pick_preferences()
adjust_window_mode();
}
void put_party_stats(cDialog& me)
static void put_party_stats(cDialog& me)
{
short i;
@@ -1283,7 +1283,7 @@ void put_party_stats(cDialog& me)
draw_startup(0);
}
bool edit_party_event_filter(cDialog& me, std::string item_hit, eKeyMod mods)
static bool edit_party_event_filter(cDialog& me, std::string item_hit, eKeyMod mods)
{
if(item_hit == "done") {
me.toast();
@@ -1372,7 +1372,7 @@ void edit_party(short can_create,short can_cancel)
}
bool tip_of_day_event_filter(cDialog& me, std::string item_hit, eKeyMod mods)
static bool tip_of_day_event_filter(cDialog& me, std::string item_hit, eKeyMod mods)
{
std::string place_str;
@@ -1411,7 +1411,7 @@ void tip_of_day()
}
void put_scen_info(cDialog& me)
static void put_scen_info(cDialog& me)
{
unsigned int i;
std::ostringstream sout;
@@ -1444,7 +1444,7 @@ void put_scen_info(cDialog& me)
}
}
bool pick_a_scen_event_filter(cDialog& me, std::string item_hit, eKeyMod mods)
static static bool pick_a_scen_event_filter(cDialog& me, std::string item_hit, eKeyMod mods)
{
if(item_hit == "cancel") {
me.setResult<short>(-1);

View File

@@ -530,7 +530,7 @@ void end_startup()
load_main_screen();
}
void loadImageToRenderTexture(sf::RenderTexture& tex, std::string imgName) {
static void loadImageToRenderTexture(sf::RenderTexture& tex, std::string imgName) {
sf::Texture temp_gworld;
temp_gworld.loadFromImage(*ResMgr::get<ImageRsrc>(imgName));
RECT texrect(temp_gworld);
@@ -1073,7 +1073,7 @@ void draw_terrain(short mode)
}
ter_num_t get_ground_for_shore(ter_num_t ter){
static ter_num_t get_ground_for_shore(ter_num_t ter){
if(scenario.ter_types[ter].block_horse) return current_ground;
else if(scenario.ter_types[ter].blockage > 2) return current_ground;
else return ter;
@@ -1327,7 +1327,7 @@ bool extend_road_terrain(ter_num_t ter)
return false;
}
bool connect_roads(ter_num_t ter){
static bool connect_roads(ter_num_t ter){
eTrimType trim = scenario.ter_types[ter].trim_type;
eTerSpec spec = scenario.ter_types[ter].special;
if(trim == TRIM_ROAD || trim == TRIM_CITY)

View File

@@ -5,8 +5,8 @@ void draw_pcs(location center,short mode);
void draw_outd_boats(location center);
void draw_town_boat(location center) ;
void draw_party_symbol(short mode,location center);
RECT get_monster_rect (unsigned char type_wanted,short mode) ;
RECT get_monster_template_rect (unsigned short type_wanted,short mode,short which_part) ;
RECT get_monster_rect (pic_num_t type_wanted,short mode) ;
RECT get_monster_template_rect (pic_num_t type_wanted,short mode,short which_part) ;
RECT get_item_template_rect (short type_wanted);
bool is_fluid(ter_num_t ter_type);
bool is_shore(ter_num_t ter_type);

View File

@@ -76,7 +76,7 @@ short store_displayed_item,position,num_entries;
unsigned short cur_entry;
cCreature hold_m;
void put_spell_info(cDialog& me, short display_mode)
static void put_spell_info(cDialog& me, short display_mode)
{
std::ostringstream store_text;
short pos,ran;
@@ -103,7 +103,7 @@ void put_spell_info(cDialog& me, short display_mode)
}
bool display_spells_event_filter(cDialog& me, std::string item_hit, eKeyMod mods, short display_mode)
static bool display_spells_event_filter(cDialog& me, std::string item_hit, eKeyMod mods, short display_mode)
{
short store;
if(item_hit == "done") {
@@ -148,7 +148,7 @@ void display_spells(short mode,short force_spell,cDialog* parent)
spellInfo.run();
}
void put_skill_info(cDialog& me)
static void put_skill_info(cDialog& me)
{
std::string store_text;
short pos;
@@ -168,7 +168,7 @@ void put_skill_info(cDialog& me)
}
bool display_skills_event_filter(cDialog& me, std::string item_hit, eKeyMod mods)
static bool display_skills_event_filter(cDialog& me, std::string item_hit, eKeyMod mods)
{
if(item_hit == "done") {
me.toast();
@@ -201,7 +201,7 @@ void display_skills(short force_skill,cDialog* parent)
skillDlog.run();
}
void put_pc_spells(cDialog& me)
static void put_pc_spells(cDialog& me)
{
short i;
@@ -217,7 +217,7 @@ void put_pc_spells(cDialog& me)
me["who"].setText(univ.party[which_pc_displayed].name.c_str());
}
bool display_pc_event_filter(cDialog& me, std::string item_hit, eKeyMod mods)
static bool display_pc_event_filter(cDialog& me, std::string item_hit, eKeyMod mods)
{
short pc_num;
@@ -270,7 +270,7 @@ void display_pc(short pc_num,short mode,cDialog* parent)
pcInfo.run();
}
void put_item_info(cDialog& me,short pc,short item)////
static void put_item_info(cDialog& me,short pc,short item)////
{
char store_text[256];
std::string desc_str;
@@ -392,7 +392,7 @@ void put_item_info(cDialog& me,short pc,short item)////
}
bool display_pc_item_event_filter(cDialog& me, std::string item_hit, eKeyMod mods)
static bool display_pc_item_event_filter(cDialog& me, std::string item_hit, eKeyMod mods)
{
short item,pc_num;
@@ -419,7 +419,7 @@ bool display_pc_item_event_filter(cDialog& me, std::string item_hit, eKeyMod mod
return true;
}
void display_pc_item(short pc_num,short item,cItemRec si,short parent)
void display_pc_item(short pc_num,short item,cItemRec si,cDialog* parent)
{
store_item_pc = pc_num;
if (pc_num == 6)
@@ -428,7 +428,7 @@ void display_pc_item(short pc_num,short item,cItemRec si,short parent)
store_displayed_item = item;
make_cursor_sword();
cDialog itemInfo("item-info.xml");
cDialog itemInfo("item-info.xml",parent);
// By attaching the click handler to "id" and "magic", we suppress normal LED behaviour
itemInfo.attachClickHandlers(display_pc_item_event_filter, {"done","left","right","id","magic"});
@@ -458,7 +458,7 @@ void display_pc_item(short pc_num,short item,cItemRec si,short parent)
}
void put_monst_info(cDialog& me)
static void put_monst_info(cDialog& me)
{
std::string store_text;
std::string str;
@@ -531,7 +531,7 @@ void put_monst_info(cDialog& me)
}
bool display_monst_event_filter(cDialog& me, std::string item_hit, eKeyMod mods)
static bool display_monst_event_filter(cDialog& me, std::string item_hit, eKeyMod mods)
{
short i,dummy = 0;
@@ -623,7 +623,7 @@ void display_monst(short array_pos,cCreature *which_m,short mode)
}
// TODO: Create a dedicated dialog for alchemy info
bool display_alchemy_event_filter(cDialog& me, std::string item_hit, eKeyMod mods)
static bool display_alchemy_event_filter(cDialog& me, std::string item_hit, eKeyMod mods)
{
std::string get_text;
@@ -661,7 +661,7 @@ void display_alchemy(cDialog* parent)
alchemy.run();
}
void display_alchemy()
static void display_alchemy()
{
short i;
@@ -683,7 +683,7 @@ void display_alchemy()
}
void display_traits_graphics(cDialog& me)
static void display_traits_graphics(cDialog& me)
{
short i,store;
@@ -702,12 +702,12 @@ void display_traits_graphics(cDialog& me)
me["xp"].setTextToNum(store);
}
bool pick_race_abil_event_filter(cDialog& me, std::string item_hit, eKeyMod mods) {
static bool pick_race_abil_event_filter(cDialog& me, std::string item_hit, eKeyMod mods) {
me.toast();
return true;
}
bool pick_race_select_led(cDialog& me, std::string item_hit, bool losing)
static bool pick_race_select_led(cDialog& me, std::string item_hit, bool losing)
{
std::string abil_str;
cPlayer *pc;
@@ -768,7 +768,7 @@ void pick_race_abil(cPlayer *pc,short mode,cDialog* parent)
pickAbil.run();
}
void display_pc_info(cDialog& me)
static void display_pc_info(cDialog& me)
{
short i,store;
char str[256];
@@ -863,7 +863,7 @@ void display_pc_info(cDialog& me)
}
}
bool give_pc_info_event_filter(cDialog& me, std::string item_hit, eKeyMod mods)
static bool give_pc_info_event_filter(cDialog& me, std::string item_hit, eKeyMod mods)
{
short pc;
@@ -884,7 +884,7 @@ bool give_pc_info_event_filter(cDialog& me, std::string item_hit, eKeyMod mods)
return true;
}
bool give_pc_extra_info(cDialog& me, std::string item_hit, eKeyMod mods) {
static bool give_pc_extra_info(cDialog& me, std::string item_hit, eKeyMod mods) {
short pc = store_pc_num;
if(item_hit == "seemage") display_pc(pc,0,&me);
else if(item_hit == "seepriest") display_pc(pc,1,&me);
@@ -915,7 +915,7 @@ void give_pc_info(short pc_num)
pcInfo.run();
}
bool adventure_notes_event_filter(cDialog& me, std::string item_hit, eKeyMod mods)
static bool adventure_notes_event_filter(cDialog& me, std::string item_hit, eKeyMod mods)
{
unsigned short i;
std::string place_str;
@@ -1038,7 +1038,7 @@ void adventure_notes()
encNotes.run();
}
void put_talk(cDialog& me)
static void put_talk(cDialog& me)
{
short personality;
char place_str[256];
@@ -1080,7 +1080,7 @@ void put_talk(cDialog& me)
}
}
bool talk_notes_event_filter(cDialog& me, std::string item_hit, eKeyMod mods)
static bool talk_notes_event_filter(cDialog& me, std::string item_hit, eKeyMod mods)
{
if(item_hit == "done") me.toast();
else if(item_hit == "left") {
@@ -1129,7 +1129,7 @@ void talk_notes()
talkNotes.run();
}
bool journal_event_filter(cDialog& me, std::string item_hit, eKeyMod mods)
static bool journal_event_filter(cDialog& me, std::string item_hit, eKeyMod mods)
{
short i;
char place_str[256];
@@ -1199,7 +1199,7 @@ void add_to_journal(short event)
}
// Call call this anywhere, but don't forget parent!!!
void give_help(short help1,short help2,cDialog* parent)
static void give_help(short help1,short help2,cDialog* parent)
{
bool help_forced = false;
std::string str1,str2;

View File

@@ -5,7 +5,7 @@ class cDialog;
void display_spells(short mode,short force_spell,cDialog* parent);
void display_skills(short force_skill,cDialog* parent);
void display_pc(short pc_num,short mode,cDialog* parent_num);
void display_pc_item(short pc_num,short item,cItemRec si,short parent);
void display_pc_item(short pc_num,short item,cItemRec si,cDialog* parent);
void display_monst(short array_pos,cCreature *which_m,short mode);
void display_alchemy(cDialog* parent);
void pick_race_abil(cPlayer *pc,short mode,cDialog* parent);

View File

@@ -857,7 +857,7 @@ void make_town_hostile()
}
void put_item_graphics(cDialog& me)
static void put_item_graphics(cDialog& me)
{
short i,storage;
cItemRec item;
@@ -948,7 +948,7 @@ void put_item_graphics(cDialog& me)
}
bool display_item_event_filter(cDialog& me, std::string id, eKeyMod mods)
static bool display_item_event_filter(cDialog& me, std::string id, eKeyMod mods)
{
cItemRec item;
@@ -1150,7 +1150,7 @@ short custom_choice_dialog(std::array<std::string, 6>& strs,short pic_num,ePicTy
// return i;
//}
bool select_pc_event_filter (cDialog& me, std::string item_hit, eKeyMod mods)
static bool select_pc_event_filter (cDialog& me, std::string item_hit, eKeyMod mods)
{
me.toast();
if(item_hit != "cancel") {
@@ -1200,7 +1200,7 @@ short select_pc(short active_only,short free_inv_only)
else return char_select_pc(active_only,free_inv_only,"Select a character:");
}
bool get_num_of_items_event_filter(cDialog& me, std::string item_hit, eKeyMod mods)
static bool get_num_of_items_event_filter(cDialog& me, std::string item_hit, eKeyMod mods)
{
me.setResult<int>(me["number"].getTextAsNum());
return true;
@@ -1469,7 +1469,7 @@ void refresh_store_items()
}
bool get_text_response_event_filter(cDialog& me, std::string item_hit, eKeyMod mods)
static bool get_text_response_event_filter(cDialog& me, std::string item_hit, eKeyMod mods)
{
me.toast();
me.setResult(me["response"].getText());

View File

@@ -897,7 +897,7 @@ void handle_monster_info_menu(int item_hit)
// HUnlock((Handle) which_curs);
//}
cursor_type get_mode_cursor(){
static cursor_type get_mode_cursor(){
switch(overall_mode){
case MODE_TOWN_TARGET:
case MODE_SPELL_TARGET:

View File

@@ -100,7 +100,7 @@ void adjust_monst_menu() {
}
}
void setMenuCallback(NSMenuItem* item, id targ, SEL selector, int num) {
static void setMenuCallback(NSMenuItem* item, id targ, SEL selector, int num) {
[item setTarget: targ];
[item setAction: selector];
[item setRepresentedObject: [[NSNumber numberWithInt: num] retain]];

View File

@@ -726,7 +726,7 @@ void click_shop_rect(RECT area_rect)
}
graf_pos calc_item_rect(int num,RECT& to_rect) {
static graf_pos calc_item_rect(int num,RECT& to_rect) {
RECT from_rect = {0,0,18,18};
sf::Texture *from_gw = &tiny_obj_gworld;
if (num < 45) {

View File

@@ -965,7 +965,7 @@ void drain_pc(short which_pc,short how_much)
// TODO: This dialog needs some kind of context system really badly to avoid the rampant globals
// MARK: Start spend XP dialog
void do_xp_keep(short pc_num,short mode)
static void do_xp_keep(short pc_num,short mode)
{
for (i = 0; i < 20; i++)
univ.party[pc_num].skills[i] = store_skills[i];
@@ -979,7 +979,7 @@ void do_xp_keep(short pc_num,short mode)
}
void draw_xp_skills(cDialog& me)
static void draw_xp_skills(cDialog& me)
{
short i;
// TODO: Wouldn't it make more sense for it to be red when you can't buy the skill rather than red when you can?
@@ -1003,13 +1003,13 @@ void draw_xp_skills(cDialog& me)
sp.setTextToNum(store_sp);
}
void update_gold_skills(cDialog& me) {
static void update_gold_skills(cDialog& me) {
me["gold"].setTextToNum(((store_train_mode == 0) ? 0 : store_g));
me["skp"].setTextToNum(store_skp);
}
void do_xp_draw(cDialog& me)
static void do_xp_draw(cDialog& me)
{
@@ -1040,7 +1040,7 @@ void do_xp_draw(cDialog& me)
update_gold_skills(me);
}
bool spend_xp_navigate_filter(cDialog& me, std::string item_hit, eKeyMod mods)
static bool spend_xp_navigate_filter(cDialog& me, std::string item_hit, eKeyMod mods)
{
short mode,pc_num;
bool talk_done = false;
@@ -1088,7 +1088,7 @@ bool spend_xp_navigate_filter(cDialog& me, std::string item_hit, eKeyMod mods)
return true;
}
bool spend_xp_event_filter(cDialog& me, std::string item_hit, eKeyMod mods) {
static bool spend_xp_event_filter(cDialog& me, std::string item_hit, eKeyMod mods) {
short mode = store_train_mode, pc_num = store_train_pc;
if(item_hit.substr(0,2) == "hp") {
if(mod_contains(mods, mod_alt)) {
@@ -2272,7 +2272,7 @@ bool pc_can_cast_spell(short pc_num,short type,short spell_num)
// MARK: Begin spellcasting dialog
void draw_caster_buttons(cDialog& me)
static void draw_caster_buttons(cDialog& me)
{
short i;
@@ -2297,7 +2297,7 @@ void draw_caster_buttons(cDialog& me)
}
}
void draw_spell_info(cDialog& me)
static void draw_spell_info(cDialog& me)
{
@@ -2341,7 +2341,7 @@ void draw_spell_info(cDialog& me)
}
}
void draw_spell_pc_info(cDialog& me)
static void draw_spell_pc_info(cDialog& me)
{
short i;
@@ -2362,7 +2362,7 @@ void draw_spell_pc_info(cDialog& me)
}
void put_pc_caster_buttons(cDialog& me)
static void put_pc_caster_buttons(cDialog& me)
{
short i;
@@ -2376,7 +2376,7 @@ void put_pc_caster_buttons(cDialog& me)
}
}
}
void put_pc_target_buttons(cDialog& me)
static void put_pc_target_buttons(cDialog& me)
{
if (store_spell_target < 6) {
@@ -2393,7 +2393,7 @@ void put_pc_target_buttons(cDialog& me)
}
// TODO: This stuff may be better handled by using an LED group with a custom focus handler
void put_spell_led_buttons(cDialog& me)
static void put_spell_led_buttons(cDialog& me)
{
short i,spell_for_this_button;
@@ -2417,7 +2417,7 @@ void put_spell_led_buttons(cDialog& me)
}
}
void put_spell_list(cDialog& me)
static void put_spell_list(cDialog& me)
{
short i;
@@ -2468,7 +2468,7 @@ void put_spell_list(cDialog& me)
}
void put_pick_spell_graphics(cDialog& me)
static void put_pick_spell_graphics(cDialog& me)
{
short i;
@@ -2482,7 +2482,7 @@ void put_pick_spell_graphics(cDialog& me)
draw_pc_effects(10 + i); // TODO: This line might mean that the "kludge" from the old code is already handled here; verify?
}
bool pick_spell_caster(cDialog& me, std::string id, eKeyMod mods) {
static bool pick_spell_caster(cDialog& me, std::string id, eKeyMod mods) {
short item_hit = id[id.length() - 1] - '1';
// TODO: This visibility check is probably not needed; wouldn't the dialog framework only trigger on visible elements?
if(me[id].isVisible()) {
@@ -2503,7 +2503,7 @@ bool pick_spell_caster(cDialog& me, std::string id, eKeyMod mods) {
return true;
}
bool pick_spell_target(cDialog& me, std::string id, eKeyMod mods) {
static bool pick_spell_target(cDialog& me, std::string id, eKeyMod mods) {
static const char*const no_target = " No target needed.";
static const char*const bad_target = " Can't cast on him/her.";
static const char*const got_target = " Target selected.";
@@ -2525,7 +2525,7 @@ bool pick_spell_target(cDialog& me, std::string id, eKeyMod mods) {
void finish_pick_spell(cDialog& me, bool spell_toast);
bool pick_spell_event_filter(cDialog& me, std::string item_hit, eKeyMod mods) {
static bool pick_spell_event_filter(cDialog& me, std::string item_hit, eKeyMod mods) {
bool spell_toast = false,dialog_done = false;
if(item_hit == "cancel") {
spell_toast = true;
@@ -2544,7 +2544,7 @@ bool pick_spell_event_filter(cDialog& me, std::string item_hit, eKeyMod mods) {
return true;
}
bool pick_spell_select_led(cDialog& me, std::string id, eKeyMod mods) {
static bool pick_spell_select_led(cDialog& me, std::string id, eKeyMod mods) {
static const char*const choose_target = " Now pick a target.";
static const char*const bad_spell = " Spell not available.";
short item_hit = id[id.length() - 1] - '1';
@@ -2903,7 +2903,7 @@ void do_alchemy() ////
}
bool alch_choice_event_filter(cDialog& me, std::string item_hit, eKeyMod mods)
static bool alch_choice_event_filter(cDialog& me, std::string item_hit, eKeyMod mods)
{
if(item_hit == "help") {
univ.party.help_received[20] = 0;
@@ -2981,7 +2981,7 @@ bool pick_pc_graphic(short pc_num,short mode,cDialog* parent)
return choice != 36;
}
bool pc_name_event_filter(cDialog& me, std::string item_hit, eKeyMod mods)
static bool pc_name_event_filter(cDialog& me, std::string item_hit, eKeyMod mods)
{
std::string pcName = me["name"].getText();

View File

@@ -10,7 +10,7 @@
#import "cursors.h"
NSAutoreleasePool *pool;
NSImage* ImageFromURL(CFURLRef url){
static NSImage* ImageFromURL(CFURLRef url){
CGImageSourceRef imageSource = CGImageSourceCreateWithURL(url, NULL);
CGImageRef theImage = nil;
@@ -75,14 +75,6 @@ void SetNSCursor(CursorRef cursor){
void SetNSCursorWatch() {
}
void HideNSCursor(){
[NSCursor hide];
}
void ShowNSCursor(){
[NSCursor unhide];
}
void CleanUp(){
// [pool release];
}

View File

@@ -61,7 +61,7 @@ struct header_posix_ustar {
#include <stdexcept>
header_posix_ustar generateTarHeader(const std::string& fileName, unsigned long long fileSize,bool directory=false){
static header_posix_ustar generateTarHeader(const std::string& fileName, unsigned long long fileSize,bool directory=false){
if(fileSize>077777777777LL)
throw std::length_error("Specified file size >= 8 GB");
if(fileName.length()>=100)
@@ -210,7 +210,7 @@ bool load_scenario(fs::path file_to_load){
return true;
}
long get_town_offset(short which_town){
static long get_town_offset(short which_town){
int i,j;
long len_to_jump,store;
@@ -547,7 +547,7 @@ bool load_town_str(short which_town, cTown*& t){
return true;
}
long get_outdoors_offset(location& which_out){
static long get_outdoors_offset(location& which_out){
int i,j,out_sec_num;
long len_to_jump,store;
out_sec_num = scenario.out_width * which_out.y + which_out.x;

View File

@@ -885,14 +885,14 @@ public:
// TODO: Additional functions?
};
void fill_shape(sf::RenderTarget& target, sf::Shape& shape, int x, int y, sf::Color colour) {
static void fill_shape(sf::RenderTarget& target, sf::Shape& shape, int x, int y, sf::Color colour) {
shape.setPosition(x, y);
shape.setFillColor(colour);
target.draw(shape);
}
void frame_shape(sf::RenderTarget& target, sf::Shape& shape, int x, int y, sf::Color colour) {
static void frame_shape(sf::RenderTarget& target, sf::Shape& shape, int x, int y, sf::Color colour) {
shape.setPosition(x, y);
shape.setOutlineColor(colour);
shape.setFillColor(sf::Color::Transparent);

View File

@@ -41,7 +41,7 @@ void port_town(legacy::town_record_type* dummy_town_ptr){
}
void port_dummy_t_d(short size,char *buffer)
static void port_dummy_t_d(short size,char *buffer)
{
short i;
legacy::big_tr_type *d1;
@@ -473,7 +473,7 @@ void flip_long(int32_t *s)
}
// TODO: This was because Windows stored its rect members in a different order, but since we now have our own rect class, it shouldn't be needed.
void alter_rect(legacy::Rect *r)
static void alter_rect(legacy::Rect *r)
{
short a;

View File

@@ -12,7 +12,7 @@
//static const CFStringRef prefsID = CFSTR("com.spidweb.bladesofexile");
NSString* convertKey(std::string keypath) {
static NSString* convertKey(std::string keypath) {
NSString* key = [NSString stringWithCString: keypath.c_str() encoding: NSASCIIStringEncoding];
return key;
}

View File

@@ -64,7 +64,7 @@ public:
T* operator->() {return the_ptr;}
};
void loadColourTable(ptr_guard<char>& picData, sf::Color(& clut)[256], int numColours) {
static void loadColourTable(ptr_guard<char>& picData, sf::Color(& clut)[256], int numColours) {
while(numColours >= 0) {
int i = extract_word(picData);
if(i > 256) oopsError(5);
@@ -80,7 +80,7 @@ void loadColourTable(ptr_guard<char>& picData, sf::Color(& clut)[256], int numCo
}
}
void loadUnpackedPixels(ptr_guard<char>& picData,ptr_guard<unsigned char>& pixels,sf::Color(& clut)[256],legacy::Rect& bounds,int rowBytes) {
static void loadUnpackedPixels(ptr_guard<char>& picData,ptr_guard<unsigned char>& pixels,sf::Color(& clut)[256],legacy::Rect& bounds,int rowBytes) {
for(int i = 0; i < bounds.bottom - bounds.top; i++) {
for(int j = 0; j < bounds.right - bounds.left; j++) {
size_t pixel = i * rowBytes + j;
@@ -93,7 +93,7 @@ void loadUnpackedPixels(ptr_guard<char>& picData,ptr_guard<unsigned char>& pixel
}
}
void loadPackedPixels(ptr_guard<char>& picData,ptr_guard<unsigned char>& pixels,sf::Color(& clut)[256],legacy::Rect& bounds,int rowBytes) {
static void loadPackedPixels(ptr_guard<char>& picData,ptr_guard<unsigned char>& pixels,sf::Color(& clut)[256],legacy::Rect& bounds,int rowBytes) {
// Packed data
int countSize = rowBytes > 250 ? 2 : 1;
for(int i = 0; i < bounds.bottom - bounds.top; i++) {
@@ -133,7 +133,7 @@ void loadPackedPixels(ptr_guard<char>& picData,ptr_guard<unsigned char>& pixels,
}
}
legacy::Rect loadPixMapData(ptr_guard<char>& picData, ptr_guard<unsigned char>& pixels, int pixMapType) {
static legacy::Rect loadPixMapData(ptr_guard<char>& picData, ptr_guard<unsigned char>& pixels, int pixMapType) {
int rowBytes = extract_word(picData) & 0x7fff;
picData += 2; // Skip rowBytes; assume we have a v2 (colour) bitmap
legacy::Rect bounds = *(legacy::Rect*)picData;
@@ -166,7 +166,7 @@ legacy::Rect loadPixMapData(ptr_guard<char>& picData, ptr_guard<unsigned char>&
return bounds;
}
rectangle loadFromPictResource(Handle resHandle, unsigned char*& pixelStore) {
static rectangle loadFromPictResource(Handle resHandle, unsigned char*& pixelStore) {
HLock(resHandle);
// TODO: Use picSize to ensure I don't go out of bounds
size_t picSize = GetHandleSize(resHandle);

View File

@@ -72,7 +72,7 @@ short sound_delay[100] = {
};
short store_last_sound_played;
bool sound_going(short which_s) {
static bool sound_going(snd_num_t which_s) {
short i;
for (i = 0; i < 4; i++)
@@ -81,7 +81,7 @@ bool sound_going(short which_s) {
return false;
}
std::string sound_to_fname_map(int snd_num) {
static std::string sound_to_fname_map(snd_num_t snd_num) {
std::ostringstream sout;
sout << "SND" << snd_num;
return sout.str();