Major code reorganization

This commit only updates the XCode project for the changes.
A later commit each will update it for scons and MSVC.

A few actual changes are mixed in:
- Add a prefix header for a handful of common definitions
- Moved current_cursor into the Cursor class as a static member
- Removed the make_cursor_sword and make_cursor_watch functions
- Include tests in the All target
- Remove redundant -l flags for Common and Common-Party (since they're included in the Link phases anyway)
This commit is contained in:
2017-04-14 00:24:29 -04:00
parent b624841bea
commit 82abdab695
211 changed files with 1855 additions and 1881 deletions

View File

@@ -7,10 +7,11 @@
#include "pc.fileio.hpp"
#include "pc.action.hpp"
#include "graphtool.hpp"
#include "soundtool.hpp"
#include "sounds.hpp"
#include "mathutil.hpp"
#include "dialog.hpp"
#include "control.hpp"
#include "cursors.hpp"
#include <boost/lexical_cast.hpp>
extern cUniverse univ;
@@ -105,7 +106,7 @@ void edit_gold_or_food(short which_to_edit) {
store_which_to_edit = which_to_edit;
make_cursor_sword();
set_cursor(sword_curs);
cDialog dlog("get-num");
dlog["okay"].attachClickHandler(get_num_event_filter);
if(which_to_edit == 0)
@@ -126,7 +127,7 @@ void edit_day() {
location view_loc;
make_cursor_sword();
set_cursor(sword_curs);
cDialog dlog("edit-day");
dlog["okay"].attachClickHandler(get_num_event_filter);
@@ -154,7 +155,7 @@ bool take_gold(short amount,bool /*print_result*/) {
void edit_xp(cPlayer *pc) {
location view_loc;
make_cursor_sword();
set_cursor(sword_curs);
cDialog dlog("edit-xp");
dlog["okay"].attachClickHandler(get_num_event_filter);

View File

@@ -10,6 +10,7 @@
#include "strdlog.hpp"
#include "choicedlog.hpp"
#include "winutil.hpp"
#include "cursors.hpp"
#include <boost/lexical_cast.hpp>
/*
@@ -98,7 +99,7 @@ void display_pc(short pc_num,short mode, cDialog* parent) {
}
which_pc_displayed = pc_num;
make_cursor_sword();
set_cursor(sword_curs);
cDialog pcInfo("pc-spell-info", parent);
pcInfo.attachClickHandlers(std::bind(display_pc_event_filter, _1, _2, mode),{"done","left","right"});
@@ -194,7 +195,7 @@ void pick_race_abil(cPlayer *pc,short mode,cDialog* parent) {
static const char*const start_str2 = "Click on advantage button to add/remove.";
store_pc = pc;
make_cursor_sword();
set_cursor(sword_curs);
cDialog pickAbil("pick-race-abil",parent);
pickAbil["done"].attachClickHandler(std::bind(&cDialog::toast, &pickAbil, true));
@@ -231,7 +232,7 @@ extern const eItemAbil alch_ingred2[20] = {
};
void display_alchemy(bool allowEdit,cDialog* parent) {
make_cursor_sword();
set_cursor(sword_curs);
cChoiceDlog showAlch("pc-alchemy-info", {"done"}, parent);
@@ -539,7 +540,7 @@ static bool spend_xp_event_filter(cDialog& me, std::string item_hit, eKeyMod mod
bool spend_xp(short pc_num, short mode, cDialog* parent) {
using namespace std::placeholders;
make_cursor_sword();
set_cursor(sword_curs);
xp_dlog_state save;
save.who = pc_num;

View File

@@ -6,10 +6,9 @@
#include "pc.fileio.hpp"
#include "pc.graphics.hpp"
#include "graphtool.hpp"
#include "soundtool.hpp"
#include "sounds.hpp"
#include "pc.editors.hpp"
#include "mathutil.hpp"
#include "restypes.hpp"
#include "fileio.hpp"
extern cUniverse univ;

View File

@@ -4,9 +4,9 @@
#include "pc.graphics.hpp"
#include "pc.editors.hpp"
#include "pc.action.hpp"
#include "soundtool.hpp"
#include "sounds.hpp"
#include "graphtool.hpp"
#include "restypes.hpp"
#include "res_image.hpp"
#include "message.hpp"
#include "mathutil.hpp"
#include "gitrev.hpp"
@@ -788,8 +788,3 @@ void display_party() {
win_draw_string(mainPtr,dest_rect,to_draw.str(),eTextMode::WRAP,style);
}
}
void make_cursor_sword() {
set_cursor(sword_curs);
}

View File

@@ -3,4 +3,3 @@ void init_main_buttons();
void Set_up_win ();
void redraw_screen();
void do_button_action(short which_pc,short which_button);
void make_cursor_sword();

View File

@@ -7,7 +7,7 @@
#include "pc.editors.hpp"
#include "pc.action.hpp"
#include "pc.fileio.hpp"
#include "soundtool.hpp"
#include "sounds.hpp"
#include "graphtool.hpp"
#include "boe.consts.hpp"
#include "dialog.hpp"
@@ -18,7 +18,7 @@
#include "pc.menus.hpp"
#include "winutil.hpp"
#include "cursors.hpp"
#include "restypes.hpp"
#include "res_image.hpp"
cUniverse univ;