(PC Editor and Scenario Editor are unaffected by this commit.) Things removed: - All references to Carbon and QuickDraw are gone. - No more Resource Manager; the game no longer relies on old resource files at all - The old dialog framework (from dlogtool.c, functions usually prefixed with cd_) is no longer used. - Files that weren't being compiled - Boost libraries that are now in the C++ library (function, shared_ptr) - Obsolete build settings Replacement dependencies: - Boost Filesystem replaces references to things like FSSpec - SFML replaces all the QuickDraw code and most window management - Cocoa replaces AppleEvent management, menu management, and some window management - I wrote a resource manager interface to mimick the important aspects of the behaviour of the Mac Resource Manager - I had to rewrite some functions that QuickDraw provided natively, such as clipping regions; not all of these are tested Things added: - Every referenced dialog has been converted from a DITL resource into the new XML-based dialog format. - All referenced STR# resources have been extracted into simple text files - Now compiles against Mac OSX 10.7 SDK and libc++ - The first item in the Help menu opens the docs on Sylae's website - It seems all the constants for soundtool vanished somewhere, so I added them back from the original Mac source Other changes: - Updated to XCode 4(?) project format - Added the xcschemes created by XCode 4; I'm not sure how important these are, but they seem like they might be important - Added document on converting dialogs to the XML format. - Make string formatting mismatches into errors instead of warnings - Disable error limit - Graphics sheets that previously used masking now have alpha transparency - Converted all graphics sheets to 8-bit PNG - Trimmed white border from intro image - Converted dialogs in the resource file have their resource name set to the name of the XML file of the converted version - Referenced string resources in the resource file have their resource name set to the name of the text file of the extracted version - Add the black-and-white patterns from the PAT resources to the pixpats.png; at least one of them is used somewhere in the game - Recreated the menu.xib as a Cocoa xib file instead of a Carbon xib file - Disable GNU C++ extensions; maybe this'll make it easier to compile with cl.exe later - Add marks to the enormous handle_action function to make it easier to navigate\ - A build step to validate the XML dialogs using xmllint (doesn't quite work properly yet but does at least catch dialogs that are not well-formed)- Fix a lot of warnings about assigning string constants to non-const char pointers - Fixed the file and application icons (which had somehow become corrupted at some point) - Lots of additional functions in the custom location and rectangle classes, including implicit conversion to and from SFML rects and vectors; also they now store coordinates as int instead of char - A new enum for encounter note types - Much tweaking of the encounter note recording mechanisms - To ease porting, I added a simple function that converts from classic Mac ticks (about 1/60 of a second) to the SFML time type - Python script to convert STR# resources to txt files, replacing newlines with vertical bars - Extracted the Mac font (Dungeon Bold) from the resource file and also added the Windows font (MaidenWord) XML Dialog Framework changes: - Remove the static initialization object in favour of manually calling cDialog::init() - {set,get}Format() no longer used for colour; there's a dedicated {set,get}Colour() instead - draw() methods unprotected in the control classes so that controls can be drawn in the main window - There's no longer a friend relationship between the dialogs and the controls - Fixed buttons duplicating the "depressed" boolean - Buttons now properly offset the label for tiny and push buttons, and for LEDs - Buttons no longer assume that either none or both of "width" and "height" are given in the XML - Add {get,set}BtnType() to cButton - cLedGroup now overrides handleClick(), which has also been made virtual; this was necessary for LEDs within a group to properly hilite while being clicked - Add addChoice() to cLedGroup to insert additional LED choices - Moved the key enums and cKey to a separate file - Add a method to get a control's attached key - Add methods to get and set a control's rect and position - Controls can now directly take a window as a parent rather than a dialog - Add addLabelFor() method to cDialog which adds a static text control as a label for another control - Remove hack for storing a dialog result of arbitrary type in favour of boost::any - Add method to get default text colour for a dialog - Add method to get a dialog's rect - Add method to add the same event handler to multiple controls in a dialog - Add concept of default button to dialogs - Add enum for text field type (currently either number or text) - Implement the text field without use of native controls, including somewhat decent text input and a flashing insertion point - cPict no longer stores references to every sheet; it fetches them as needed from the resource manager - The many draw functions in cPict are no longer static, since they need to access the window containing the pict (before they could only be static due to QuickDraw's global state) - Add setPict() without a type argument to change the graphic without changing the type, which is a common operation - Add a scrollbar control; the specifics aren't implemented yet - Change signature of the record callback for cStrDlog; it will no longer be passed the strings - Publicize the no-button constructor of cChoiceDlog; it'll assume "okay" is the only button - Add operator-> to cPictChoice for accessing the underlying dialog - Add constructor to cPictChoice that takes a starting and ending pic num - Remove err parameter from giveError - Many more keys handled, plus support for catching copy, paste, cut, and select all keyboard shortcuts - Text input fields take priority, overriding any other keyboard shortcuts in the dialog, but they never catch help (F1), escape, or enter - Some changes to the format itself: -> keys go in the "def-key" attribute, but modifiers go in "key-mod" -> "clickable" is no longer a recognized attribute -> "title" is now a recognized text size (18pt, even larger than "large" at 12pt) -> "defbtn" attribute on the root element
166 lines
4.8 KiB
C++
166 lines
4.8 KiB
C++
/*
|
|
* universe.h
|
|
* BoE
|
|
*
|
|
* Created by Celtic Minstrel on 24/04/09.
|
|
*
|
|
*/
|
|
|
|
#ifndef UNIVERSE_H
|
|
#define UNIVERSE_H
|
|
|
|
#include <iosfwd>
|
|
#include <boost/filesystem/path.hpp>
|
|
#include "party.h"
|
|
#include "creatlist.h"
|
|
#include "item.h"
|
|
#include "town.h"
|
|
#include "talking.h"
|
|
#include "simpletypes.h"
|
|
|
|
namespace fs = boost::filesystem; // TODO: Centralize this namespace alias?
|
|
|
|
namespace legacy {
|
|
struct out_info_type;
|
|
struct current_town_type;
|
|
struct town_item_list;
|
|
struct stored_town_maps_type;
|
|
struct stored_outdoor_maps_type;
|
|
struct big_tr_type;
|
|
};
|
|
|
|
class cCurTown {
|
|
public:
|
|
cTown* record;
|
|
// formerly current_town_type
|
|
short num; // 200 if outdoors (my addition)
|
|
short difficulty;
|
|
//char explored[64][64];
|
|
bool hostile;
|
|
cPopulation monst;
|
|
bool in_boat; // is this really needed?
|
|
location p_loc;
|
|
cSpeech* cur_talk; // my addition
|
|
short cur_talk_loaded; // my addition
|
|
|
|
cItemRec items[115]; // formerly town_item_list type
|
|
|
|
//ter_num_t template_terrain[64][64];
|
|
unsigned long fields[64][64];
|
|
bool special_spot[64][64];
|
|
// unsigned char trim[64][64]; // transient
|
|
|
|
void append(legacy::current_town_type& old,short which_size);
|
|
void append(legacy::town_item_list& old);
|
|
void append(unsigned char(& old_sfx)[64][64], unsigned char(& old_misc_i)[64][64]);
|
|
void append(legacy::big_tr_type& old);
|
|
|
|
unsigned char explored(char x,char y) const __attribute__((deprecated));
|
|
unsigned char misc_i(char x, char y) const __attribute__((deprecated));
|
|
unsigned char sfx(char x, char y) const __attribute__((deprecated));
|
|
|
|
cTown* operator -> ();
|
|
cCurTown();
|
|
bool loaded() const;
|
|
void unload();
|
|
short countMonsters();
|
|
|
|
bool is_explored(char x, char y) const;
|
|
bool is_force_wall(char x, char y) const;
|
|
bool is_fire_wall(char x, char y) const;
|
|
bool is_antimagic(char x, char y) const;
|
|
bool is_scloud(char x, char y) const; // stinking cloud
|
|
bool is_ice_wall(char x, char y) const;
|
|
bool is_blade_wall(char x, char y) const;
|
|
bool is_sleep_cloud(char x, char y) const;
|
|
bool is_block(char x, char y) const; // currently unused
|
|
bool is_spot(char x, char y) const;
|
|
bool is_special(char x, char y) const;
|
|
bool is_web(char x, char y) const;
|
|
bool is_crate(char x, char y) const;
|
|
bool is_barrel(char x, char y) const;
|
|
bool is_fire_barr(char x, char y) const;
|
|
bool is_force_barr(char x, char y) const;
|
|
bool is_quickfire(char x, char y) const;
|
|
bool is_sm_blood(char x, char y) const;
|
|
bool is_med_blood(char x, char y) const;
|
|
bool is_lg_blood(char x, char y) const;
|
|
bool is_sm_slime(char x, char y) const;
|
|
bool is_lg_slime(char x, char y) const;
|
|
bool is_ash(char x, char y) const;
|
|
bool is_bones(char x, char y) const;
|
|
bool is_rubble(char x, char y) const;
|
|
bool is_force_cage(char x, char y) const;
|
|
// bool is_trim(char x, char y, char t) const;
|
|
bool set_explored(char x, char y, bool b);
|
|
bool set_force_wall(char x, char y, bool b);
|
|
bool set_fire_wall(char x, char y, bool b);
|
|
bool set_antimagic(char x, char y, bool b);
|
|
bool set_scloud(char x, char y, bool b); // stinking cloud
|
|
bool set_ice_wall(char x, char y, bool b);
|
|
bool set_blade_wall(char x, char y, bool b);
|
|
bool set_sleep_cloud(char x, char y, bool b);
|
|
bool set_block(char x, char y, bool b); // currently unused
|
|
bool set_spot(char x, char y, bool b);
|
|
bool set_special(char x, char y, bool b);
|
|
bool set_web(char x, char y, bool b);
|
|
bool set_crate(char x, char y, bool b);
|
|
bool set_barrel(char x, char y, bool b);
|
|
bool set_fire_barr(char x, char y, bool b);
|
|
bool set_force_barr(char x, char y, bool b);
|
|
bool set_quickfire(char x, char y, bool b);
|
|
bool set_sm_blood(char x, char y, bool b);
|
|
bool set_med_blood(char x, char y, bool b);
|
|
bool set_lg_blood(char x, char y, bool b);
|
|
bool set_sm_slime(char x, char y, bool b);
|
|
bool set_lg_slime(char x, char y, bool b);
|
|
bool set_ash(char x, char y, bool b);
|
|
bool set_bones(char x, char y, bool b);
|
|
bool set_rubble(char x, char y, bool b);
|
|
bool set_force_cage(char x, char y, bool b);
|
|
// bool set_trim(char x, char y, char t, bool b);
|
|
void writeTo(std::ostream& file);
|
|
void readFrom(std::istream& file);
|
|
};
|
|
|
|
class cCurOut {
|
|
public:
|
|
char expl[96][96]; // formerly out_info_type
|
|
ter_num_t out[96][96];
|
|
unsigned char out_e[96][96];
|
|
cOutdoors outdoors[2][2];
|
|
|
|
//unsigned char sfx[64][64];
|
|
//unsigned char misc_i[64][64];
|
|
|
|
void append(legacy::out_info_type& old);
|
|
|
|
ter_num_t(& operator [] (size_t i))[96];
|
|
ter_num_t& operator [] (location loc);
|
|
void writeTo(std::ostream& file);
|
|
void readFrom(std::istream& file);
|
|
};
|
|
|
|
enum eAmbientSound {
|
|
AMBIENT_NONE,
|
|
AMBIENT_DRIP,
|
|
AMBIENT_BIRD,
|
|
AMBIENT_CUSTOM,
|
|
};
|
|
|
|
class cUniverse{
|
|
public:
|
|
cParty party;
|
|
cCurTown town;
|
|
char town_maps[200][8][64]; // formerly stored_town_maps_type
|
|
cCurOut out;
|
|
char out_maps[100][6][48]; // formerly stored_outdoor_maps_type
|
|
snd_num_t out_sound;
|
|
fs::path file;
|
|
|
|
void append(legacy::stored_town_maps_type& old);
|
|
void append(legacy::stored_outdoor_maps_type& old);
|
|
short difficulty_adjust();
|
|
};
|
|
|
|
#endif |