- Got the new dialog engine into a semi-functional, mostly crash-free state!
- Created constants for the number of monster and terrain sheets, so that we can easily add more. - Added init_sheets() function to initialize cPict's static variables. - Moved the code for checking for an interrupt key out into a separate function so that it can be used elsewhere as well. - Added error checking to make sure a sheet exists before drawing from it. (Note: Will need to catch the exception and draw a blank rather than simply terminating.) - Fixed bug where status icons were drawn instead of terrain map icons. git-svn-id: http://openexile.googlecode.com/svn/trunk@99 4ebdad44-0ea0-11de-aab3-ff745001d230
This commit is contained in:
@@ -55,10 +55,9 @@ void cButton::draw(){
|
||||
else if(type == BTN_PUSH) TextSize(10);
|
||||
else TextSize(12);
|
||||
from_gw = buttons[btnGW[type]];
|
||||
to_gw = (GWorldPtr) parent->win;
|
||||
from_rect = btnRects[btnGW[type]][depressed];
|
||||
to_rect = frame;
|
||||
rect_draw_some_item(from_gw,from_rect,to_gw,to_rect); // TODO: This originally drew to dest 2 (dialog window); does it still?
|
||||
rect_draw_some_item(from_gw,from_rect,to_rect,(Point){0,0}); // TODO: This originally drew to dest 2 (dialog window); does it still?
|
||||
RGBForeColor(&parent->defTextClr);
|
||||
char_win_draw_string(parent->win,to_rect,lbl.c_str(),1,8);
|
||||
// TODO: Adjust string location as appropriate
|
||||
@@ -86,7 +85,7 @@ short cButton::getFormat(eFormat prop) throw(xUnsupportedProp){
|
||||
}
|
||||
|
||||
// Indices within the buttons array.
|
||||
size_t cButton::btnGW[13] = {
|
||||
size_t cButton::btnGW[14] = {
|
||||
0, // BTN_SM
|
||||
1, // BTN_REG
|
||||
2, // BTN_LG
|
||||
@@ -100,6 +99,7 @@ size_t cButton::btnGW[13] = {
|
||||
3, // BTN_TALL
|
||||
3, // BTN_TRAIT
|
||||
6, // BTN_PUSH
|
||||
5, // BTN_LED
|
||||
};
|
||||
|
||||
GWorldPtr cButton::buttons[7] = {NULL,NULL,NULL,NULL,NULL,NULL,NULL};
|
||||
@@ -221,11 +221,10 @@ void cLed::draw(){
|
||||
if(foundSilom())TextFace(normal);
|
||||
else TextFace(bold);
|
||||
TextSize(9);
|
||||
from_gw = buttons[BTN_LED];
|
||||
to_gw = (GWorldPtr) parent->win;
|
||||
from_gw = buttons[btnGW[BTN_LED]];
|
||||
from_rect = ledRects[state][depressed];
|
||||
to_rect = frame;
|
||||
rect_draw_some_item(from_gw,from_rect,to_gw,to_rect);
|
||||
rect_draw_some_item(from_gw,from_rect,to_rect,(Point){0,0});
|
||||
RGBForeColor(&parent->defTextClr);
|
||||
char_win_draw_string(parent->win,to_rect,lbl.c_str(),1,8);
|
||||
// TODO: Adjust string location as appropriate
|
||||
|
||||
@@ -60,8 +60,8 @@ private:
|
||||
bool pressed;
|
||||
std::string fromList;
|
||||
static Rect btnRects[13][2];
|
||||
static size_t btnGW[13];
|
||||
protected:
|
||||
static size_t btnGW[14];
|
||||
static GWorldPtr buttons[7];
|
||||
};
|
||||
|
||||
|
||||
@@ -25,9 +25,9 @@ static std::string generateRandomString(){
|
||||
// Not bothering to seed, because it doesn't actually matter if it's truly random.
|
||||
// Though, this will be called after srand() is called in main() anyway.
|
||||
int n_chars = rand() % 100;
|
||||
std::string s;
|
||||
std::string s = "$";
|
||||
while(n_chars > 0){
|
||||
s += char(rand() % 223) + ' ';
|
||||
s += char(rand() % 96) + ' '; // was 223 ...
|
||||
n_chars--;
|
||||
}
|
||||
return s;
|
||||
@@ -36,17 +36,17 @@ static std::string generateRandomString(){
|
||||
template<> pair<string,cPict*> cDialog::parse(Element& who /*pict*/){
|
||||
std::pair<std::string,cPict*> p;
|
||||
Iterator<Attribute> attr;
|
||||
std::string name, val;
|
||||
std::istringstream sin(val);
|
||||
std::string name;
|
||||
bool wide = false, tall = false, custom = false;
|
||||
int width = 0, height = 0;
|
||||
p.second = new cPict(this);
|
||||
for(attr = attr.begin(&who); attr != attr.end(); attr++){
|
||||
attr->GetName(&name);
|
||||
attr->GetValue(&val);
|
||||
if(name == "name")
|
||||
p.first = val;
|
||||
attr->GetValue(&p.first);
|
||||
else if(name == "type"){
|
||||
std::string val;
|
||||
attr->GetValue(&val);
|
||||
if(val == "blank"){
|
||||
p.second->picType = PIC_TER;
|
||||
p.second->picNum = -1;
|
||||
@@ -80,29 +80,30 @@ template<> pair<string,cPict*> cDialog::parse(Element& who /*pict*/){
|
||||
p.second->picType = PIC_STATUS;
|
||||
else throw xBadVal("pict",name,val);
|
||||
}else if(name == "custom"){
|
||||
std::string val;
|
||||
attr->GetValue(&val);
|
||||
if(val == "true") custom = true;
|
||||
}else if(name == "clickable"){
|
||||
std::string val;
|
||||
attr->GetValue(&val);
|
||||
if(val == "true") p.second->clickable = true;
|
||||
}else if(name == "size"){
|
||||
std::string val;
|
||||
attr->GetValue(&val);
|
||||
if(val == "wide") wide = true;
|
||||
else if(val == "tall") tall = true;
|
||||
else if(val == "large") wide = tall = true;
|
||||
else throw xBadVal("pict",name,val);
|
||||
}else if(name == "num"){
|
||||
sin.str(val);
|
||||
sin >> p.second->picNum;
|
||||
attr->GetValue(&p.second->picNum);
|
||||
}else if(name == "top"){
|
||||
sin.str(val);
|
||||
sin >> p.second->frame.top;
|
||||
attr->GetValue(&p.second->frame.top);
|
||||
}else if(name == "left"){
|
||||
sin.str(val);
|
||||
sin >> p.second->frame.left;
|
||||
attr->GetValue(&p.second->frame.left);
|
||||
}else if(name == "width"){
|
||||
sin.str(val);
|
||||
sin >> width;
|
||||
attr->GetValue(&width);
|
||||
}else if(name == "height"){
|
||||
sin.str(val);
|
||||
sin >> height;
|
||||
attr->GetValue(&height);
|
||||
}else throw xBadAttr("pict",name);
|
||||
}
|
||||
if(wide && !tall && p.second->picType == PIC_MONST) p.second->picType = PIC_MONST_WIDE;
|
||||
@@ -165,19 +166,24 @@ template<> pair<string,cTextMsg*> cDialog::parse(Element& who /*text*/){
|
||||
pair<string,cTextMsg*> p;
|
||||
Iterator<Attribute> attr;
|
||||
Iterator<Node> node;
|
||||
string name, val;
|
||||
string name;
|
||||
int width = 0, height = 0;
|
||||
p.second = new cTextMsg(this);
|
||||
for(attr = attr.begin(&who); attr != attr.end(); attr++){
|
||||
attr->GetName(&name);
|
||||
attr->GetValue(&val);
|
||||
if(name == "name")
|
||||
p.first = val;
|
||||
attr->GetValue(&p.first);
|
||||
else if(name == "framed"){
|
||||
std::string val;
|
||||
attr->GetValue(&val);
|
||||
if(val == "true") p.second->drawFramed = true;
|
||||
}else if(name == "clickable"){
|
||||
std::string val;
|
||||
attr->GetValue(&val);
|
||||
if(val == "true") p.second->clickable = true;
|
||||
}else if(name == "font"){
|
||||
std::string val;
|
||||
attr->GetValue(&val);
|
||||
if(val == "dungeon")
|
||||
p.second->textFont = DUNGEON;
|
||||
else if(val == "geneva")
|
||||
@@ -188,12 +194,16 @@ template<> pair<string,cTextMsg*> cDialog::parse(Element& who /*text*/){
|
||||
p.second->textFont = MAIDENWORD;
|
||||
else throw xBadVal("text",name,val);
|
||||
}else if(name == "size"){
|
||||
std::string val;
|
||||
attr->GetValue(&val);
|
||||
if(val == "large")
|
||||
p.second->textSize = 12;
|
||||
else if(val == "small")
|
||||
p.second->textSize = 10;
|
||||
else throw xBadVal("text",name,val);
|
||||
}else if(name == "color" || name == "colour"){
|
||||
std::string val;
|
||||
attr->GetValue(&val);
|
||||
RGBColor clr;
|
||||
try{
|
||||
clr = parseColor(val);
|
||||
@@ -202,19 +212,15 @@ template<> pair<string,cTextMsg*> cDialog::parse(Element& who /*text*/){
|
||||
}
|
||||
p.second->color = clr;
|
||||
}else if(name == "top"){
|
||||
istringstream sin(val);
|
||||
sin >> p.second->frame.top;
|
||||
attr->GetValue(&p.second->frame.top);
|
||||
}else if(name == "left"){
|
||||
istringstream sin(val);
|
||||
sin >> p.second->frame.left;
|
||||
attr->GetValue(&p.second->frame.left);
|
||||
}else if(name == "width"){
|
||||
istringstream sin(val);
|
||||
sin >> width;
|
||||
attr->GetValue(&width);
|
||||
}else if(name == "height"){
|
||||
istringstream sin(val);
|
||||
sin >> height;
|
||||
attr->GetValue(&height);
|
||||
}else if(name == "fromlist"){
|
||||
p.second->fromList = val;
|
||||
attr->GetValue(&p.second->fromList);
|
||||
}else throw xBadAttr("pict",name);
|
||||
}
|
||||
p.second->frame.right = p.second->frame.left + width;
|
||||
@@ -294,17 +300,20 @@ template<> pair<string,cButton*> cDialog::parse(Element& who /*button*/){
|
||||
pair<string,cButton*> p;
|
||||
Iterator<Attribute> attr;
|
||||
Iterator<Node> node;
|
||||
string name, val;
|
||||
string name;
|
||||
int width = 0, height = 0;
|
||||
p.second = new cButton(this);
|
||||
for(attr = attr.begin(&who); attr != attr.end(); attr++){
|
||||
attr->GetName(&name);
|
||||
attr->GetValue(&val);
|
||||
if(name == "name")
|
||||
p.first = val;
|
||||
attr->GetValue(&p.first);
|
||||
else if(name == "wrap"){
|
||||
std::string val;
|
||||
attr->GetValue(&val);
|
||||
if(val == "true") p.second->wrapLabel = true;
|
||||
}else if(name == "type"){
|
||||
std::string val;
|
||||
attr->GetValue(&val);
|
||||
if(val == "small")
|
||||
p.second->type = BTN_SM;
|
||||
else if(val == "regular")
|
||||
@@ -332,25 +341,23 @@ template<> pair<string,cButton*> cDialog::parse(Element& who /*button*/){
|
||||
else if(val == "push")
|
||||
p.second->type = BTN_PUSH;
|
||||
}else if(name == "def-key"){
|
||||
std::string val;
|
||||
attr->GetValue(&val);
|
||||
try{
|
||||
p.second->key = parseKey(val);
|
||||
}catch(int){
|
||||
throw xBadVal("button",name,val);
|
||||
}
|
||||
}else if(name == "fromlist")
|
||||
p.second->fromList = val;
|
||||
attr->GetValue(&p.second->fromList);
|
||||
else if(name == "top"){
|
||||
istringstream sin(val);
|
||||
sin >> p.second->frame.top;
|
||||
attr->GetValue(&p.second->frame.top);
|
||||
}else if(name == "left"){
|
||||
istringstream sin(val);
|
||||
sin >> p.second->frame.left;
|
||||
attr->GetValue(&p.second->frame.left);
|
||||
}else if(name == "width"){
|
||||
istringstream sin;
|
||||
sin >> width;
|
||||
attr->GetValue(&width);
|
||||
}else if(name == "height"){
|
||||
istringstream sin;
|
||||
sin >> height;
|
||||
attr->GetValue(&height);
|
||||
}else throw xBadAttr("button",name);
|
||||
}
|
||||
if(width > 0 || height > 0) {
|
||||
@@ -469,23 +476,26 @@ template<> pair<string,cLed*> cDialog::parse(Element& who /*LED*/){
|
||||
pair<string,cLed*> p;
|
||||
Iterator<Attribute> attr;
|
||||
Iterator<Node> node;
|
||||
string name, val;
|
||||
string name;
|
||||
int width = 0, height = 0;
|
||||
p.second = new cLed(this);
|
||||
p.second->type = BTN_LED;
|
||||
for(attr = attr.begin(&who); attr != attr.end(); attr++){
|
||||
attr->GetName(&name);
|
||||
attr->GetValue(&val);
|
||||
if(name == "name")
|
||||
p.first = val;
|
||||
attr->GetValue(&p.first);
|
||||
else if(name == "state"){
|
||||
std::string val;
|
||||
attr->GetValue(&val);
|
||||
if(val == "red") p.second->state = led_red;
|
||||
else if(val == "green") p.second->state = led_green;
|
||||
else if(val == "off") p.second->state = led_off;
|
||||
else throw xBadVal("led",name,val);
|
||||
}else if(name == "fromlist")
|
||||
p.second->fromList = val;
|
||||
attr->GetValue(&p.second->fromList);
|
||||
else if(name == "font"){
|
||||
std::string val;
|
||||
attr->GetValue(&val);
|
||||
if(val == "dungeon")
|
||||
p.second->textFont = DUNGEON;
|
||||
else if(val == "geneva")
|
||||
@@ -496,12 +506,16 @@ template<> pair<string,cLed*> cDialog::parse(Element& who /*LED*/){
|
||||
p.second->textFont = MAIDENWORD;
|
||||
else throw xBadVal("text",name,val);
|
||||
}else if(name == "size"){
|
||||
std::string val;
|
||||
attr->GetValue(&val);
|
||||
if(val == "large")
|
||||
p.second->textSize = 12;
|
||||
else if(val == "small")
|
||||
p.second->textSize = 10;
|
||||
else throw xBadVal("text",name,val);
|
||||
}else if(name == "color" || name == "colour"){
|
||||
std::string val;
|
||||
attr->GetValue(&val);
|
||||
RGBColor clr;
|
||||
try{
|
||||
clr = parseColor(val);
|
||||
@@ -510,17 +524,13 @@ template<> pair<string,cLed*> cDialog::parse(Element& who /*LED*/){
|
||||
}
|
||||
p.second->color = clr;
|
||||
}else if(name == "top"){
|
||||
istringstream sin(val);
|
||||
sin >> p.second->frame.top;
|
||||
attr->GetValue(&p.second->frame.top);
|
||||
}else if(name == "left"){
|
||||
istringstream sin(val);
|
||||
sin >> p.second->frame.left;
|
||||
attr->GetValue(&p.second->frame.left);
|
||||
}else if(name == "width"){
|
||||
istringstream sin;
|
||||
sin >> width;
|
||||
attr->GetValue(&width);
|
||||
}else if(name == "height"){
|
||||
istringstream sin;
|
||||
sin >> height;
|
||||
attr->GetValue(&height);
|
||||
}else throw xBadAttr("button",name);
|
||||
}
|
||||
if(width > 0 || height > 0) {
|
||||
@@ -554,15 +564,14 @@ template<> pair<string,cLedGroup*> cDialog::parse(Element& who /*group*/){
|
||||
pair<string,cLedGroup*> p;
|
||||
Iterator<Attribute> attr;
|
||||
Iterator<Element> node;
|
||||
string name, val;
|
||||
string name;
|
||||
p.second = new cLedGroup(this);
|
||||
for(attr = attr.begin(&who); attr != attr.end(); attr++){
|
||||
attr->GetName(&name);
|
||||
attr->GetValue(&val);
|
||||
if(name == "name")
|
||||
p.first = val;
|
||||
attr->GetValue(&p.first);
|
||||
else if(name == "fromlist")
|
||||
p.second->fromList = val;
|
||||
attr->GetValue(&p.second->fromList);
|
||||
else throw xBadAttr("button",name);
|
||||
}
|
||||
string content;
|
||||
@@ -591,32 +600,29 @@ template<> pair<string,cTextField*> cDialog::parse(Element& who /*field*/){
|
||||
pair<string,cTextField*> p;
|
||||
Iterator<Attribute> attr;
|
||||
Iterator<Node> node;
|
||||
string name, val;
|
||||
string name;
|
||||
int width = 0, height = 0;
|
||||
p.second = new cTextField(this);
|
||||
for(attr = attr.begin(&who); attr != attr.end(); attr++){
|
||||
attr->GetName(&name);
|
||||
attr->GetValue(&val);
|
||||
if(name == "name")
|
||||
p.first = val;
|
||||
attr->GetValue(&p.first);
|
||||
else if(name == "type"){
|
||||
std::string val;
|
||||
attr->GetValue(&val);
|
||||
if(val == "num")
|
||||
p.second->isNumericField = true;
|
||||
else if(val == "text")
|
||||
p.second->isNumericField = false;
|
||||
else throw xBadVal("field",name,val);
|
||||
}else if(name == "top"){
|
||||
istringstream sin(val);
|
||||
sin >> p.second->frame.top;
|
||||
attr->GetValue(&p.second->frame.top);
|
||||
}else if(name == "left"){
|
||||
istringstream sin(val);
|
||||
sin >> p.second->frame.left;
|
||||
attr->GetValue(&p.second->frame.left);
|
||||
}else if(name == "width"){
|
||||
istringstream sin;
|
||||
sin >> width;
|
||||
attr->GetValue(&width);
|
||||
}else if(name == "height"){
|
||||
istringstream sin;
|
||||
sin >> height;
|
||||
attr->GetValue(&height);
|
||||
}else throw xBadAttr("button",name);
|
||||
}
|
||||
p.second->frame.right = p.second->frame.left + width;
|
||||
@@ -786,9 +792,12 @@ void cDialog::run(){
|
||||
char c, k;
|
||||
cKey key;
|
||||
EventRecord currentEvent;
|
||||
GrafPtr old_port;
|
||||
std::string itemHit = "";
|
||||
dialogNotToast = true;
|
||||
GetPort(&old_port);
|
||||
ShowWindow(win);
|
||||
SetPortWindowPort(win);
|
||||
BeginAppModalStateForWindow(win);
|
||||
while(dialogNotToast){
|
||||
if(!WaitNextEvent(everyEvent, ¤tEvent, 0, NULL))continue;
|
||||
@@ -896,6 +905,7 @@ void cDialog::run(){
|
||||
if(ctrl != controls.end()) ctrl->second->triggerClickHandler(*this,itemHit,key.mod,currentEvent.where);
|
||||
}
|
||||
EndAppModalStateForWindow(win);
|
||||
SetPort(old_port);
|
||||
HideWindow(win);
|
||||
}
|
||||
|
||||
|
||||
@@ -71,5 +71,9 @@ void cTextField::hide(){
|
||||
}
|
||||
|
||||
void cTextField::draw(){
|
||||
GrafPtr cur_port;
|
||||
GetPort(&cur_port);
|
||||
SetPortWindowPort(parent->win);
|
||||
Draw1Control(theField);
|
||||
SetPort(cur_port);
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ void cPict::init(){
|
||||
drawPict()[PIC_DLOG_LG] = drawPresetDlogLg;
|
||||
drawPict()[PIC_SCEN_LG] = drawPresetScenLg;
|
||||
drawPict()[PIC_TER_MAP] = drawPresetTerMap;
|
||||
drawPict()[PIC_TER_MAP] = drawStatusIcon;
|
||||
drawPict()[PIC_STATUS] = drawStatusIcon;
|
||||
drawPict()[PIC_MONST_WIDE] = drawPresetMonstWide;
|
||||
drawPict()[PIC_MONST_TALL] = drawPresetMonstTall;
|
||||
drawPict()[PIC_MONST_LG] = drawPresetMonstLg;
|
||||
@@ -61,8 +61,8 @@ void cPict::init(){
|
||||
drawPict()[PIC_PARTY_MONST_LG] = drawPartyMonstLg;
|
||||
}
|
||||
|
||||
std::map<ePicType,void(*)(short,GWorldPtr,Rect)>& cPict::drawPict(){
|
||||
static std::map<ePicType,void(*)(short,GWorldPtr,Rect)> f;
|
||||
std::map<ePicType,void(*)(short,Rect)>& cPict::drawPict(){
|
||||
static std::map<ePicType,void(*)(short,Rect)> f;
|
||||
return f;
|
||||
}
|
||||
|
||||
@@ -96,7 +96,7 @@ short cPict::getFormat(eFormat prop) throw(xUnsupportedProp){
|
||||
else throw xUnsupportedProp(prop);
|
||||
}
|
||||
|
||||
void cPict::setSheet(eSheetType type, short n, GWorldPtr sheet){
|
||||
void cPict::setSheet(eSheetType type, GWorldPtr sheet, short n){
|
||||
// Step one: verify
|
||||
if(n < -1) throw std::out_of_range("Negative values for n, other than -1, are invalid.");
|
||||
if(n == -1 && type == SHEET_FULL)
|
||||
@@ -512,6 +512,9 @@ short cPict::animFrame = 0;
|
||||
void cPict::draw(){
|
||||
RGBColor store_color;
|
||||
Rect rect = frame;
|
||||
GrafPtr cur_port;
|
||||
GetPort(&cur_port);
|
||||
SetPortWindowPort(parent->win);
|
||||
|
||||
if(!visible){ // Erase it
|
||||
InsetRect(&rect, -3, -3);
|
||||
@@ -528,29 +531,32 @@ void cPict::draw(){
|
||||
GetBackColor(&store_color);
|
||||
BackColor(whiteColor);
|
||||
|
||||
drawPict()[picType](picNum,(GWorldPtr) parent->win,rect);
|
||||
drawPict()[picType](picNum,rect);
|
||||
if(drawFramed) drawFrame(2,0);
|
||||
SetPort(cur_port);
|
||||
}
|
||||
|
||||
void cPict::drawPresetTer(short num, GWorldPtr to_gw, Rect to_rect){
|
||||
void cPict::drawPresetTer(short num, Rect to_rect){
|
||||
printf("Getting terrain icon from sheet %i.\n",num / 50);
|
||||
if(!isSheetSet(SHEET_TER,num / 50)) throw xMissingSheet(SHEET_TER,num / 50);
|
||||
GWorldPtr from_gw = ter[num / 50];
|
||||
num = num % 50;
|
||||
Rect from_rect = calc_rect(num % 10, num / 10);
|
||||
if (to_rect.right - to_rect.left > 28)
|
||||
InsetRect(&to_rect,4,0);
|
||||
rect_draw_some_item(from_gw, from_rect, to_gw, to_rect);
|
||||
rect_draw_some_item(from_gw, from_rect, to_rect, (Point){0,0});
|
||||
}
|
||||
|
||||
void cPict::drawPresetTerAnim(short num, GWorldPtr to_gw, Rect to_rect){
|
||||
void cPict::drawPresetTerAnim(short num, Rect to_rect){
|
||||
Rect from_rect = calc_rect(4 * (num / 5) + animFrame, num % 5);
|
||||
if(!isSheetSet(SHEET_TER_ANIM)) throw xMissingSheet(SHEET_TER_ANIM);
|
||||
GWorldPtr from_gw = teranim;
|
||||
printf("Getting animated terrain graphic %i from sheet 20", num);
|
||||
if (to_rect.right - to_rect.left > 28) {
|
||||
InsetRect(&to_rect,4,0);
|
||||
to_rect.right = to_rect.left + 28;
|
||||
}
|
||||
rect_draw_some_item(from_gw, from_rect, to_gw, to_rect);
|
||||
rect_draw_some_item(from_gw, from_rect, to_rect, (Point){0,0});
|
||||
}
|
||||
|
||||
static Rect calcDefMonstRect(short i, short animFrame){
|
||||
@@ -569,241 +575,268 @@ static Rect calcDefMonstRect(short i, short animFrame){
|
||||
return r;
|
||||
}
|
||||
|
||||
void cPict::drawPresetMonstSm(short num, GWorldPtr to_gw, Rect to_rect){
|
||||
void cPict::drawPresetMonstSm(short num, Rect to_rect){
|
||||
short m_start_pic = m_pic_index[num].i;
|
||||
if(!isSheetSet(SHEET_MONST,m_start_pic / 20)) throw xMissingSheet(SHEET_MONST,m_start_pic / 20);
|
||||
GWorldPtr from_gw = monst[m_start_pic / 20];
|
||||
m_start_pic = m_start_pic % 20;
|
||||
Rect from_rect = calcDefMonstRect(num, animFrame);
|
||||
to_rect.right = to_rect.left + 28;
|
||||
to_rect.bottom = to_rect.top + 36;
|
||||
PaintRect(&to_rect);
|
||||
rect_draw_some_item(from_gw, from_rect, to_gw, to_rect, transparent);
|
||||
rect_draw_some_item(from_gw, from_rect, to_rect, (Point){0,0}, transparent);
|
||||
}
|
||||
|
||||
void cPict::drawPresetMonstWide(short num, GWorldPtr to_gw, Rect to_rect){
|
||||
void cPict::drawPresetMonstWide(short num, Rect to_rect){
|
||||
Rect small_monst_rect = {0,0,18,14};
|
||||
to_rect.right = to_rect.left + 28; to_rect.bottom = to_rect.top + 36;
|
||||
PaintRect(&to_rect);
|
||||
|
||||
short m_start_pic = m_pic_index[num].i;
|
||||
if(!isSheetSet(SHEET_MONST,m_start_pic / 20)) throw xMissingSheet(SHEET_MONST,m_start_pic / 20);
|
||||
GWorldPtr from_gw = monst[m_start_pic / 20];
|
||||
m_start_pic = m_start_pic % 20;
|
||||
Rect from_rect = calcDefMonstRect(num, animFrame);
|
||||
OffsetRect(&small_monst_rect,to_rect.left,to_rect.top + 7);
|
||||
rect_draw_some_item(from_gw, from_rect, to_gw, small_monst_rect, transparent);
|
||||
rect_draw_some_item(from_gw, from_rect, small_monst_rect, (Point){0,0}, transparent);
|
||||
|
||||
m_start_pic = m_pic_index[num].i + 1;
|
||||
if(!isSheetSet(SHEET_MONST,m_start_pic / 20)) throw xMissingSheet(SHEET_MONST,m_start_pic / 20);
|
||||
from_gw = monst[m_start_pic / 20];
|
||||
m_start_pic = m_start_pic % 20;
|
||||
from_rect = calcDefMonstRect(num, animFrame);
|
||||
OffsetRect(&small_monst_rect,14,0);
|
||||
rect_draw_some_item(from_gw, from_rect, to_gw, small_monst_rect, transparent);
|
||||
rect_draw_some_item(from_gw, from_rect, small_monst_rect, (Point){0,0}, transparent);
|
||||
}
|
||||
|
||||
void cPict::drawPresetMonstTall(short num, GWorldPtr to_gw, Rect to_rect){
|
||||
void cPict::drawPresetMonstTall(short num, Rect to_rect){
|
||||
Rect small_monst_rect = {0,0,18,14};
|
||||
to_rect.right = to_rect.left + 28;
|
||||
to_rect.bottom = to_rect.top + 36;
|
||||
PaintRect(&to_rect);
|
||||
|
||||
short m_start_pic = m_pic_index[num].i;
|
||||
if(!isSheetSet(SHEET_MONST,m_start_pic / 20)) throw xMissingSheet(SHEET_MONST,m_start_pic / 20);
|
||||
GWorldPtr from_gw = monst[m_start_pic / 20];
|
||||
m_start_pic = m_start_pic % 20;
|
||||
Rect from_rect = calcDefMonstRect(num, animFrame);
|
||||
OffsetRect(&small_monst_rect,to_rect.left + 7,to_rect.top);
|
||||
rect_draw_some_item(from_gw, from_rect, to_gw, small_monst_rect, transparent);
|
||||
rect_draw_some_item(from_gw, from_rect, small_monst_rect, (Point){0,0}, transparent);
|
||||
|
||||
m_start_pic = m_pic_index[num].i + 1;
|
||||
if(!isSheetSet(SHEET_MONST,m_start_pic / 20)) throw xMissingSheet(SHEET_MONST,m_start_pic / 20);
|
||||
from_gw = monst[m_start_pic / 20];
|
||||
m_start_pic = m_start_pic % 20;
|
||||
from_rect = calcDefMonstRect(num, animFrame);
|
||||
OffsetRect(&small_monst_rect,0,18);
|
||||
rect_draw_some_item(from_gw, from_rect, to_gw, small_monst_rect, transparent);
|
||||
rect_draw_some_item(from_gw, from_rect, small_monst_rect, (Point){0,0}, transparent);
|
||||
}
|
||||
|
||||
void cPict::drawPresetMonstLg(short num, GWorldPtr to_gw, Rect to_rect){
|
||||
void cPict::drawPresetMonstLg(short num, Rect to_rect){
|
||||
Rect small_monst_rect = {0,0,18,14};
|
||||
to_rect.right = to_rect.left + 28;
|
||||
to_rect.bottom = to_rect.top + 36;
|
||||
PaintRect(&to_rect);
|
||||
|
||||
short m_start_pic = m_pic_index[num].i;
|
||||
if(!isSheetSet(SHEET_MONST,m_start_pic / 20)) throw xMissingSheet(SHEET_MONST,m_start_pic / 20);
|
||||
GWorldPtr from_gw = monst[m_start_pic / 20];
|
||||
m_start_pic = m_start_pic % 20;
|
||||
Rect from_rect = calcDefMonstRect(num, animFrame);
|
||||
OffsetRect(&small_monst_rect,to_rect.left,to_rect.top);
|
||||
rect_draw_some_item(from_gw, from_rect, to_gw, small_monst_rect, transparent);
|
||||
rect_draw_some_item(from_gw, from_rect, small_monst_rect, (Point){0,0}, transparent);
|
||||
|
||||
m_start_pic = m_pic_index[num].i + 1;
|
||||
if(!isSheetSet(SHEET_MONST,m_start_pic / 20)) throw xMissingSheet(SHEET_MONST,m_start_pic / 20);
|
||||
from_gw = monst[m_start_pic / 20];
|
||||
m_start_pic = m_start_pic % 20;
|
||||
from_rect = calcDefMonstRect(num, animFrame);
|
||||
OffsetRect(&small_monst_rect,14,0);
|
||||
rect_draw_some_item(from_gw, from_rect, to_gw, small_monst_rect, transparent);
|
||||
rect_draw_some_item(from_gw, from_rect, small_monst_rect, (Point){0,0}, transparent);
|
||||
|
||||
m_start_pic = m_pic_index[num].i + 2;
|
||||
if(!isSheetSet(SHEET_MONST,m_start_pic / 20)) throw xMissingSheet(SHEET_MONST,m_start_pic / 20);
|
||||
from_gw = monst[m_start_pic / 20];
|
||||
m_start_pic = m_start_pic % 20;
|
||||
from_rect = calcDefMonstRect(num, animFrame);
|
||||
OffsetRect(&small_monst_rect,-14,18);
|
||||
rect_draw_some_item(from_gw, from_rect, to_gw, small_monst_rect, transparent);
|
||||
rect_draw_some_item(from_gw, from_rect, small_monst_rect, (Point){0,0}, transparent);
|
||||
|
||||
m_start_pic = m_pic_index[num].i + 3;
|
||||
if(!isSheetSet(SHEET_MONST,m_start_pic / 20)) throw xMissingSheet(SHEET_MONST,m_start_pic / 20);
|
||||
from_gw = monst[m_start_pic / 20];
|
||||
m_start_pic = m_start_pic % 20;
|
||||
from_rect = calcDefMonstRect(num, animFrame);
|
||||
OffsetRect(&small_monst_rect,14,0);
|
||||
rect_draw_some_item(from_gw, from_rect, to_gw, small_monst_rect, transparent);
|
||||
rect_draw_some_item(from_gw, from_rect, small_monst_rect, (Point){0,0}, transparent);
|
||||
}
|
||||
|
||||
void cPict::drawPresetDlog(short num, GWorldPtr to_gw, Rect to_rect){
|
||||
void cPict::drawPresetDlog(short num, Rect to_rect){
|
||||
to_rect.right = to_rect.left + 36;
|
||||
to_rect.bottom = to_rect.top + 36;
|
||||
if(!isSheetSet(SHEET_DLOG)) throw xMissingSheet(SHEET_DLOG);
|
||||
GWorldPtr from_gw = dlog;
|
||||
Rect from_rect = {0,0,36,36};
|
||||
OffsetRect(&from_rect,36 * (num % 4),36 * (num / 4));
|
||||
rect_draw_some_item(from_gw, from_rect, to_gw, to_rect);
|
||||
rect_draw_some_item(from_gw, from_rect, to_rect, (Point){0,0});
|
||||
}
|
||||
|
||||
void cPict::drawPresetDlogLg(short num, GWorldPtr to_gw, Rect to_rect){
|
||||
void cPict::drawPresetDlogLg(short num, Rect to_rect){
|
||||
to_rect.right = to_rect.left + 72;
|
||||
to_rect.bottom = to_rect.top + 72;
|
||||
if(!isSheetSet(SHEET_DLOG)) throw xMissingSheet(SHEET_DLOG);
|
||||
GWorldPtr from_gw = dlog;
|
||||
Rect from_rect = {0,0,72,72};
|
||||
OffsetRect(&from_rect,36 * (num % 4),36 * (num / 4));
|
||||
rect_draw_some_item(from_gw, from_rect, to_gw, to_rect);
|
||||
rect_draw_some_item(from_gw, from_rect, to_rect, (Point){0,0});
|
||||
}
|
||||
|
||||
void cPict::drawPresetTalk(short num, GWorldPtr to_gw, Rect to_rect){
|
||||
void cPict::drawPresetTalk(short num, Rect to_rect){
|
||||
num--;
|
||||
to_rect.right = to_rect.left + 32;
|
||||
to_rect.bottom = to_rect.top + 32;
|
||||
if(!isSheetSet(SHEET_TALK)) throw xMissingSheet(SHEET_TALK);
|
||||
GWorldPtr from_gw = talk;
|
||||
Rect from_rect = {0,0,32,32};
|
||||
OffsetRect(&from_rect,32 * (num % 10),32 * (num / 10));
|
||||
rect_draw_some_item(from_gw, from_rect, to_gw, to_rect);
|
||||
rect_draw_some_item(from_gw, from_rect, to_rect, (Point){0,0});
|
||||
}
|
||||
|
||||
void cPict::drawPresetScen(short num, GWorldPtr to_gw, Rect to_rect){
|
||||
void cPict::drawPresetScen(short num, Rect to_rect){
|
||||
if(!isSheetSet(SHEET_SCEN)) throw xMissingSheet(SHEET_SCEN);
|
||||
GWorldPtr from_gw = scen;
|
||||
Rect from_rect = {0,0,32,32};
|
||||
OffsetRect(&from_rect,32 * (num % 5),32 * (num / 5));
|
||||
to_rect.right = to_rect.left + 32;
|
||||
to_rect.bottom = to_rect.top + 32;
|
||||
rect_draw_some_item(from_gw, from_rect, to_gw, to_rect);
|
||||
rect_draw_some_item(from_gw, from_rect, to_rect, (Point){0,0});
|
||||
}
|
||||
|
||||
void cPict::drawPresetScenLg(short num, GWorldPtr to_gw, Rect to_rect){
|
||||
void cPict::drawPresetScenLg(short num, Rect to_rect){
|
||||
if(!isSheetSet(SHEET_SCEN_LG)) throw xMissingSheet(SHEET_SCEN_LG);
|
||||
GWorldPtr from_gw = largeScen;
|
||||
to_rect.right = to_rect.left + 64;
|
||||
to_rect.bottom = to_rect.top + 64;
|
||||
Rect from_rect = {0,0,64,64};
|
||||
OffsetRect(&from_rect, num * 64, 0);
|
||||
rect_draw_some_item(from_gw, from_rect, to_gw, to_rect);
|
||||
rect_draw_some_item(from_gw, from_rect, to_rect, (Point){0,0});
|
||||
}
|
||||
|
||||
void cPict::drawPresetItem(short num, GWorldPtr to_gw, Rect to_rect){
|
||||
void cPict::drawPresetItem(short num, Rect to_rect){
|
||||
to_rect.right = to_rect.left + 28;
|
||||
to_rect.bottom = to_rect.top + 36;
|
||||
PaintRect(&to_rect);
|
||||
GWorldPtr from_gw;
|
||||
Rect from_rect = {0,0,18,18};
|
||||
if (num < 45) {
|
||||
if(!isSheetSet(SHEET_ITEM)) throw xMissingSheet(SHEET_ITEM);
|
||||
from_gw = item;
|
||||
from_rect = calc_rect(num % 5, num / 5);
|
||||
}else{
|
||||
if(!isSheetSet(SHEET_TINY_ITEM)) throw xMissingSheet(SHEET_TINY_ITEM);
|
||||
from_gw = tinyItem;
|
||||
InsetRect(&to_rect,5,9);
|
||||
OffsetRect(&from_rect,18 * (num % 10), 18 * (num / 10));
|
||||
}
|
||||
rect_draw_some_item(from_gw, from_rect, to_gw, to_rect, transparent);
|
||||
rect_draw_some_item(from_gw, from_rect, to_rect, (Point){0,0}, transparent);
|
||||
}
|
||||
|
||||
void cPict::drawPresetPc(short num, GWorldPtr to_gw, Rect to_rect){
|
||||
void cPict::drawPresetPc(short num, Rect to_rect){
|
||||
if(!isSheetSet(SHEET_PC)) throw xMissingSheet(SHEET_PC);
|
||||
GWorldPtr from_gw = pc;
|
||||
Rect from_rect = calc_rect(2 * (num / 8), num % 8);
|
||||
to_rect.right = to_rect.left + 28;
|
||||
to_rect.bottom = to_rect.top + 36;
|
||||
PaintRect(&to_rect);
|
||||
rect_draw_some_item(from_gw, from_rect, to_gw, to_rect, transparent);
|
||||
rect_draw_some_item(from_gw, from_rect, to_rect, (Point){0,0}, transparent);
|
||||
}
|
||||
|
||||
void cPict::drawPresetField(short num, GWorldPtr to_gw, Rect to_rect){
|
||||
void cPict::drawPresetField(short num, Rect to_rect){
|
||||
if(!isSheetSet(SHEET_FIELD)) throw xMissingSheet(SHEET_FIELD);
|
||||
GWorldPtr from_gw = field;
|
||||
Rect from_rect = calc_rect(num % 8, num / 8);
|
||||
to_rect.right = to_rect.left + 28;
|
||||
to_rect.bottom = to_rect.top + 36;
|
||||
PaintRect(&to_rect);
|
||||
rect_draw_some_item(from_gw, from_rect, to_gw, to_rect, transparent);
|
||||
rect_draw_some_item(from_gw, from_rect, to_rect, (Point){0,0}, transparent);
|
||||
}
|
||||
|
||||
void cPict::drawPresetBoom(short num, GWorldPtr to_gw, Rect to_rect){
|
||||
void cPict::drawPresetBoom(short num, Rect to_rect){
|
||||
if(!isSheetSet(SHEET_BOOM)) throw xMissingSheet(SHEET_BOOM);
|
||||
GWorldPtr from_gw = boom;
|
||||
Rect from_rect = calc_rect(num % 8, num / 8);
|
||||
to_rect.right = to_rect.left + 28;
|
||||
to_rect.bottom = to_rect.top + 36;
|
||||
PaintRect(&to_rect);
|
||||
rect_draw_some_item(from_gw, from_rect, to_gw, to_rect, transparent);
|
||||
rect_draw_some_item(from_gw, from_rect, to_rect, (Point){0,0}, transparent);
|
||||
}
|
||||
|
||||
void cPict::drawFullSheet(short num, GWorldPtr to_gw, Rect to_rect){
|
||||
void cPict::drawFullSheet(short num, Rect to_rect){
|
||||
Rect from_rect;
|
||||
if(!isSheetSet(SHEET_FULL,num)) throw xMissingSheet(SHEET_FULL,num);
|
||||
GWorldPtr from_gw = largeSheets[num];
|
||||
GetPortBounds(from_gw, &from_rect);
|
||||
to_rect.right = to_rect.left + (from_rect.right - from_rect.left);
|
||||
to_rect.bottom = to_rect.top + (from_rect.bottom - from_rect.top);
|
||||
rect_draw_some_item(from_gw, from_rect, to_gw, to_rect);
|
||||
rect_draw_some_item(from_gw, from_rect, to_rect, (Point){0,0});
|
||||
}
|
||||
|
||||
void cPict::drawPresetMissile(short num, GWorldPtr to_gw, Rect to_rect){
|
||||
void cPict::drawPresetMissile(short num, Rect to_rect){
|
||||
Rect from_rect = {0,0,18,18};
|
||||
if(!isSheetSet(SHEET_MISSILE)) throw xMissingSheet(SHEET_MISSILE);
|
||||
GWorldPtr from_gw = missile;
|
||||
to_rect.right = to_rect.left + 18;
|
||||
to_rect.bottom = to_rect.top + 18;
|
||||
PaintRect(&to_rect);
|
||||
short i = animFrame == 7 ? 0 : animFrame + 1;
|
||||
OffsetRect(&from_rect,18 * i, 18 * num);
|
||||
rect_draw_some_item(from_gw, from_rect, to_gw, to_rect, transparent);
|
||||
rect_draw_some_item(from_gw, from_rect, to_rect, (Point){0,0}, transparent);
|
||||
}
|
||||
|
||||
void cPict::drawPresetTerMap(short num, GWorldPtr to_gw, Rect to_rect){
|
||||
void cPict::drawPresetTerMap(short num, Rect to_rect){
|
||||
Rect from_rect = {0,0,12,12};
|
||||
if(!isSheetSet(SHEET_TER_MAP)) throw xMissingSheet(SHEET_TER_MAP);
|
||||
GWorldPtr from_gw = map;
|
||||
to_rect.right = to_rect.left + 24;
|
||||
to_rect.bottom = to_rect.top + 24;
|
||||
OffsetRect(&from_rect,12 * (num % 10), 12 * (num / 10));
|
||||
rect_draw_some_item(from_gw, from_rect, to_gw, to_rect);
|
||||
rect_draw_some_item(from_gw, from_rect, to_rect, (Point){0,0});
|
||||
}
|
||||
|
||||
void cPict::drawStatusIcon(short num, GWorldPtr to_gw, Rect to_rect){
|
||||
void cPict::drawStatusIcon(short num, Rect to_rect){
|
||||
Rect from_rect = {0,0,12,12};
|
||||
if(!isSheetSet(SHEET_STATUS)) throw xMissingSheet(SHEET_STATUS);
|
||||
GWorldPtr from_gw = status;
|
||||
to_rect.right = to_rect.left + 12;
|
||||
to_rect.bottom = to_rect.top + 12;
|
||||
OffsetRect(&from_rect,12 * (num % 3), 12 * (num / 3));
|
||||
rect_draw_some_item(from_gw, from_rect, to_gw, to_rect, transparent);
|
||||
rect_draw_some_item(from_gw, from_rect, to_rect, (Point){0,0}, transparent);
|
||||
}
|
||||
|
||||
void cPict::drawCustomTer(short num, GWorldPtr to_gw, Rect to_rect){
|
||||
void cPict::drawCustomTer(short num, Rect to_rect){
|
||||
printf("Drawing graphic %i as a custom terrain pic.\n",num);
|
||||
to_rect.right = to_rect.left + 28;
|
||||
to_rect.bottom = to_rect.top + 32;
|
||||
Rect from_rect;
|
||||
GWorldPtr from_gw = customSheets[get_custom_rect(num,from_rect)];
|
||||
rect_draw_some_item(from_gw, from_rect, to_gw, to_rect);
|
||||
short n = get_custom_rect(num,from_rect);
|
||||
if(!isSheetSet(SHEET_CUSTOM,n)) throw xMissingSheet(SHEET_CUSTOM,n);
|
||||
GWorldPtr from_gw = customSheets[n];
|
||||
rect_draw_some_item(from_gw, from_rect, to_rect, (Point){0,0});
|
||||
}
|
||||
|
||||
void cPict::drawCustomTerAnim(short num, GWorldPtr to_gw, Rect to_rect){
|
||||
void cPict::drawCustomTerAnim(short num, Rect to_rect){
|
||||
printf("Drawing graphic %i as a custom animated terrain pic.\n",num);
|
||||
to_rect.right = to_rect.left + 28;
|
||||
to_rect.bottom = to_rect.top + 32;
|
||||
num += animFrame;
|
||||
Rect from_rect;
|
||||
GWorldPtr from_gw = customSheets[get_custom_rect(num,from_rect)];
|
||||
rect_draw_some_item(from_gw, from_rect, to_gw, to_rect);
|
||||
short n = get_custom_rect(num,from_rect);
|
||||
if(!isSheetSet(SHEET_CUSTOM,n)) throw xMissingSheet(SHEET_CUSTOM,n);
|
||||
GWorldPtr from_gw = customSheets[n];
|
||||
rect_draw_some_item(from_gw, from_rect, to_rect, (Point){0,0});
|
||||
}
|
||||
|
||||
void cPict::drawCustomMonstSm(short num, GWorldPtr to_gw, Rect to_rect){
|
||||
void cPict::drawCustomMonstSm(short num, Rect to_rect){
|
||||
static const short adj[4] = {0, 2, 1, 3};
|
||||
num += adj[animFrame];
|
||||
printf("Drawing graphic %i as a custom space pic.\n",num);
|
||||
@@ -812,11 +845,13 @@ void cPict::drawCustomMonstSm(short num, GWorldPtr to_gw, Rect to_rect){
|
||||
PaintRect(&to_rect);
|
||||
|
||||
Rect from_rect;
|
||||
GWorldPtr from_gw = customSheets[get_custom_rect(num,from_rect)];
|
||||
rect_draw_some_item(from_gw, from_rect, to_gw, to_rect, transparent);
|
||||
short n = get_custom_rect(num,from_rect);
|
||||
if(!isSheetSet(SHEET_CUSTOM,n)) throw xMissingSheet(SHEET_CUSTOM,n);
|
||||
GWorldPtr from_gw = customSheets[n];
|
||||
rect_draw_some_item(from_gw, from_rect, to_rect, (Point){0,0}, transparent);
|
||||
}
|
||||
|
||||
void cPict::drawCustomMonstWide(short num, GWorldPtr to_gw, Rect to_rect){
|
||||
void cPict::drawCustomMonstWide(short num, Rect to_rect){
|
||||
static const short adj[4] = {0, 4, 2, 6};
|
||||
num += adj[animFrame];
|
||||
Rect small_monst_rect = {0,0,18,14};
|
||||
@@ -825,16 +860,20 @@ void cPict::drawCustomMonstWide(short num, GWorldPtr to_gw, Rect to_rect){
|
||||
PaintRect(&to_rect);
|
||||
|
||||
Rect from_rect;
|
||||
GWorldPtr from_gw = customSheets[get_custom_rect(num,from_rect)];
|
||||
short n = get_custom_rect(num,from_rect);
|
||||
if(!isSheetSet(SHEET_CUSTOM,n)) throw xMissingSheet(SHEET_CUSTOM,n);
|
||||
GWorldPtr from_gw = customSheets[n];
|
||||
OffsetRect(&small_monst_rect,to_rect.left,to_rect.top + 7);
|
||||
rect_draw_some_item(from_gw, from_rect, to_gw, small_monst_rect, transparent);
|
||||
rect_draw_some_item(from_gw, from_rect, small_monst_rect, (Point){0,0}, transparent);
|
||||
|
||||
from_gw = customSheets[get_custom_rect(num + 1,from_rect)];
|
||||
n = get_custom_rect(num,from_rect);
|
||||
if(!isSheetSet(SHEET_CUSTOM,n)) throw xMissingSheet(SHEET_CUSTOM,n);
|
||||
from_gw = customSheets[n];
|
||||
OffsetRect(&small_monst_rect,14,0);
|
||||
rect_draw_some_item(from_gw, from_rect, to_gw, small_monst_rect, transparent);
|
||||
rect_draw_some_item(from_gw, from_rect, small_monst_rect, (Point){0,0}, transparent);
|
||||
}
|
||||
|
||||
void cPict::drawCustomMonstTall(short num, GWorldPtr to_gw, Rect to_rect){
|
||||
void cPict::drawCustomMonstTall(short num, Rect to_rect){
|
||||
static const short adj[4] = {0, 4, 2, 6};
|
||||
num += adj[animFrame];
|
||||
Rect small_monst_rect = {0,0,18,14};
|
||||
@@ -843,16 +882,20 @@ void cPict::drawCustomMonstTall(short num, GWorldPtr to_gw, Rect to_rect){
|
||||
PaintRect(&to_rect);
|
||||
|
||||
Rect from_rect;
|
||||
GWorldPtr from_gw = customSheets[get_custom_rect(num,from_rect)];
|
||||
short n = get_custom_rect(num,from_rect);
|
||||
if(!isSheetSet(SHEET_CUSTOM,n)) throw xMissingSheet(SHEET_CUSTOM,n);
|
||||
GWorldPtr from_gw = customSheets[n];
|
||||
OffsetRect(&small_monst_rect,to_rect.left + 7,to_rect.top);
|
||||
rect_draw_some_item(from_gw, from_rect, to_gw, small_monst_rect, transparent);
|
||||
rect_draw_some_item(from_gw, from_rect, small_monst_rect, (Point){0,0}, transparent);
|
||||
|
||||
from_gw = customSheets[get_custom_rect(num + 1,from_rect)];
|
||||
n = get_custom_rect(num,from_rect);
|
||||
if(!isSheetSet(SHEET_CUSTOM,n)) throw xMissingSheet(SHEET_CUSTOM,n);
|
||||
from_gw = customSheets[n];
|
||||
OffsetRect(&small_monst_rect,0,18);
|
||||
rect_draw_some_item(from_gw, from_rect, to_gw, small_monst_rect, transparent);
|
||||
rect_draw_some_item(from_gw, from_rect, small_monst_rect, (Point){0,0}, transparent);
|
||||
}
|
||||
|
||||
void cPict::drawCustomMonstLg(short num, GWorldPtr to_gw, Rect to_rect){
|
||||
void cPict::drawCustomMonstLg(short num, Rect to_rect){
|
||||
static const short adj[4] = {0, 8, 4, 12};
|
||||
num += adj[animFrame];
|
||||
Rect small_monst_rect = {0,0,18,14};
|
||||
@@ -861,192 +904,256 @@ void cPict::drawCustomMonstLg(short num, GWorldPtr to_gw, Rect to_rect){
|
||||
PaintRect(&to_rect);
|
||||
|
||||
Rect from_rect;
|
||||
GWorldPtr from_gw = customSheets[get_custom_rect(num,from_rect)];
|
||||
short n = get_custom_rect(num,from_rect);
|
||||
if(!isSheetSet(SHEET_CUSTOM,n)) throw xMissingSheet(SHEET_CUSTOM,n);
|
||||
GWorldPtr from_gw = customSheets[n];
|
||||
OffsetRect(&small_monst_rect,to_rect.left,to_rect.top);
|
||||
rect_draw_some_item(from_gw, from_rect, to_gw, small_monst_rect, transparent);
|
||||
rect_draw_some_item(from_gw, from_rect, small_monst_rect, (Point){0,0}, transparent);
|
||||
|
||||
from_gw = customSheets[get_custom_rect(num+1,from_rect)];
|
||||
n = get_custom_rect(num,from_rect);
|
||||
if(!isSheetSet(SHEET_CUSTOM,n)) throw xMissingSheet(SHEET_CUSTOM,n);
|
||||
from_gw = customSheets[n];
|
||||
OffsetRect(&small_monst_rect,14,0);
|
||||
rect_draw_some_item(from_gw, from_rect, to_gw, small_monst_rect, transparent);
|
||||
rect_draw_some_item(from_gw, from_rect, small_monst_rect, (Point){0,0}, transparent);
|
||||
|
||||
from_gw = customSheets[get_custom_rect(num+2,from_rect)];
|
||||
n = get_custom_rect(num,from_rect);
|
||||
if(!isSheetSet(SHEET_CUSTOM,n)) throw xMissingSheet(SHEET_CUSTOM,n);
|
||||
from_gw = customSheets[n];
|
||||
OffsetRect(&small_monst_rect,-14,18);
|
||||
rect_draw_some_item(from_gw, from_rect, to_gw, small_monst_rect, transparent);
|
||||
rect_draw_some_item(from_gw, from_rect, small_monst_rect, (Point){0,0}, transparent);
|
||||
|
||||
from_gw = customSheets[get_custom_rect(num+3,from_rect)];
|
||||
n = get_custom_rect(num,from_rect);
|
||||
if(!isSheetSet(SHEET_CUSTOM,n)) throw xMissingSheet(SHEET_CUSTOM,n);
|
||||
from_gw = customSheets[n];
|
||||
OffsetRect(&small_monst_rect,14,0);
|
||||
rect_draw_some_item(from_gw, from_rect, to_gw, small_monst_rect, transparent);
|
||||
rect_draw_some_item(from_gw, from_rect, small_monst_rect, (Point){0,0}, transparent);
|
||||
}
|
||||
|
||||
void cPict::drawCustomDlog(short num, GWorldPtr to_gw, Rect to_rect){
|
||||
void cPict::drawCustomDlog(short num, Rect to_rect){
|
||||
Rect from_rect;
|
||||
GWorldPtr from_gw = customSheets[get_custom_rect(num,from_rect)];
|
||||
short n = get_custom_rect(num,from_rect);
|
||||
if(!isSheetSet(SHEET_CUSTOM,n)) throw xMissingSheet(SHEET_CUSTOM,n);
|
||||
GWorldPtr from_gw = customSheets[n];
|
||||
to_rect.right = to_rect.left + 18;
|
||||
to_rect.bottom = to_rect.top + 36;
|
||||
from_rect.right = from_rect.left + 18;
|
||||
from_rect.bottom = from_rect.top + 36;
|
||||
rect_draw_some_item(from_gw, from_rect, to_gw, to_rect);
|
||||
rect_draw_some_item(from_gw, from_rect, to_rect, (Point){0,0});
|
||||
|
||||
from_gw = customSheets[get_custom_rect(num,from_rect)];
|
||||
n = get_custom_rect(num,from_rect);
|
||||
if(!isSheetSet(SHEET_CUSTOM,n)) throw xMissingSheet(SHEET_CUSTOM,n);
|
||||
from_gw = customSheets[n];
|
||||
OffsetRect(&to_rect,18,0);
|
||||
from_rect.right = from_rect.left + 18;
|
||||
from_rect.bottom = from_rect.top + 36;
|
||||
rect_draw_some_item(from_gw, from_rect, to_gw, to_rect);
|
||||
rect_draw_some_item(from_gw, from_rect, to_rect, (Point){0,0});
|
||||
}
|
||||
|
||||
void cPict::drawCustomDlogLg(short num, GWorldPtr to_gw, Rect to_rect){
|
||||
drawCustomDlog(num,to_gw,to_rect);
|
||||
OffsetRect(&to_rect,28,0);
|
||||
drawCustomDlog(num+2,to_gw,to_rect);
|
||||
OffsetRect(&to_rect,-28,36);
|
||||
drawCustomDlog(num+4,to_gw,to_rect);
|
||||
OffsetRect(&to_rect,28,0);
|
||||
drawCustomDlog(num+6,to_gw,to_rect);
|
||||
void cPict::drawCustomDlogLg(short num, Rect to_rect){
|
||||
drawCustomDlog(num,to_rect);
|
||||
OffsetRect(&to_rect,36,0);
|
||||
drawCustomDlog(num + 2,to_rect);
|
||||
OffsetRect(&to_rect,-36,36);
|
||||
drawCustomDlog(num + 4,to_rect);
|
||||
OffsetRect(&to_rect,36,0);
|
||||
drawCustomDlog(num + 6,to_rect);
|
||||
}
|
||||
|
||||
void cPict::drawCustomTalk(short num, GWorldPtr to_gw, Rect to_rect){
|
||||
void cPict::drawCustomTalk(short num, Rect to_rect){
|
||||
Rect from_rect;
|
||||
GWorldPtr from_gw = customSheets[get_custom_rect(num,from_rect)];
|
||||
short n = get_custom_rect(num,from_rect);
|
||||
if(!isSheetSet(SHEET_CUSTOM,n)) throw xMissingSheet(SHEET_CUSTOM,n);
|
||||
GWorldPtr from_gw = customSheets[n];
|
||||
to_rect.right = to_rect.left + 16;
|
||||
to_rect.bottom = to_rect.top + 32;
|
||||
from_rect.right = from_rect.left + 16;
|
||||
from_rect.bottom = from_rect.top + 32;
|
||||
rect_draw_some_item(from_gw, from_rect, to_gw, to_rect);
|
||||
rect_draw_some_item(from_gw, from_rect, to_rect, (Point){0,0});
|
||||
|
||||
from_gw = customSheets[get_custom_rect(num+1,from_rect)];
|
||||
n = get_custom_rect(num,from_rect);
|
||||
if(!isSheetSet(SHEET_CUSTOM,n)) throw xMissingSheet(SHEET_CUSTOM,n);
|
||||
from_gw = customSheets[n];
|
||||
OffsetRect(&to_rect,16,0);
|
||||
from_rect.right = from_rect.left + 16;
|
||||
from_rect.bottom = from_rect.top + 32;
|
||||
rect_draw_some_item(from_gw, from_rect, to_gw, to_rect);
|
||||
rect_draw_some_item(from_gw, from_rect, to_rect, (Point){0,0});
|
||||
}
|
||||
|
||||
void cPict::drawCustomItem(short num, GWorldPtr to_gw, Rect to_rect){
|
||||
void cPict::drawCustomItem(short num, Rect to_rect){
|
||||
printf("Drawing graphic %i as a custom space pic.\n",num);
|
||||
to_rect.right = to_rect.left + 28;
|
||||
to_rect.bottom = to_rect.top + 32;
|
||||
Rect from_rect;
|
||||
GWorldPtr from_gw = customSheets[get_custom_rect(num,from_rect)];
|
||||
short n = get_custom_rect(num,from_rect);
|
||||
if(!isSheetSet(SHEET_CUSTOM,n)) throw xMissingSheet(SHEET_CUSTOM,n);
|
||||
GWorldPtr from_gw = customSheets[n];
|
||||
PaintRect(&to_rect);
|
||||
rect_draw_some_item(from_gw, from_rect, to_gw, to_rect, transparent);
|
||||
rect_draw_some_item(from_gw, from_rect, to_rect, (Point){0,0}, transparent);
|
||||
}
|
||||
|
||||
void cPict::drawCustomMissile(short num, GWorldPtr to_gw, Rect to_rect){
|
||||
void cPict::drawCustomMissile(short num, Rect to_rect){
|
||||
num += animFrame % 4;
|
||||
Rect from_rect;
|
||||
GWorldPtr from_gw = customSheets[get_custom_rect(num,from_rect)];
|
||||
short n = get_custom_rect(num,from_rect);
|
||||
if(!isSheetSet(SHEET_CUSTOM,n)) throw xMissingSheet(SHEET_CUSTOM,n);
|
||||
GWorldPtr from_gw = customSheets[n];
|
||||
from_rect.right = from_rect.left + 18;
|
||||
from_rect.bottom = from_rect.top + 18;
|
||||
if(animFrame >= 4) OffsetRect(&from_rect, 0, 18);
|
||||
PaintRect(&to_rect);
|
||||
InsetRect(&to_rect,5,9);
|
||||
rect_draw_some_item(from_gw, from_rect, to_gw, to_rect, transparent);
|
||||
rect_draw_some_item(from_gw, from_rect, to_rect, (Point){0,0}, transparent);
|
||||
}
|
||||
|
||||
void cPict::drawCustomTerMap(short num, GWorldPtr to_gw, Rect to_rect){
|
||||
void cPict::drawCustomTerMap(short num, Rect to_rect){
|
||||
Rect from_rect;
|
||||
GWorldPtr from_gw = customSheets[get_custom_rect(num % 1000,from_rect)];
|
||||
short n = get_custom_rect(num,from_rect);
|
||||
if(!isSheetSet(SHEET_CUSTOM,n)) throw xMissingSheet(SHEET_CUSTOM,n);
|
||||
GWorldPtr from_gw = customSheets[n];
|
||||
from_rect.right = from_rect.left + 12;
|
||||
from_rect.bottom = from_rect.top + 12;
|
||||
num /= 1000; num--;
|
||||
OffsetRect(&from_rect, (num / 3) * 12, (num % 3) * 12);
|
||||
to_rect.right = to_rect.left + 24;
|
||||
to_rect.bottom = to_rect.top + 24;
|
||||
rect_draw_some_item(from_gw, from_rect, to_gw, to_rect);
|
||||
rect_draw_some_item(from_gw, from_rect, to_rect, (Point){0,0});
|
||||
}
|
||||
|
||||
void cPict::drawPartyMonstSm(short num, GWorldPtr to_gw, Rect to_rect){
|
||||
void cPict::drawPartyMonstSm(short num, Rect to_rect){
|
||||
printf("Drawing graphic %i as a custom space pic.\n",num);
|
||||
to_rect.right = to_rect.left + 28;
|
||||
to_rect.bottom = to_rect.top + 32;
|
||||
if(!isSheetSet(SHEET_PARTY)) throw xMissingSheet(SHEET_PARTY);
|
||||
GWorldPtr from_gw = save;
|
||||
Rect from_rect = get_custom_rect(num);
|
||||
PaintRect(&to_rect);
|
||||
rect_draw_some_item(from_gw, from_rect, to_gw, to_rect, transparent);
|
||||
rect_draw_some_item(from_gw, from_rect, to_rect, (Point){0,0}, transparent);
|
||||
}
|
||||
|
||||
void cPict::drawPartyMonstWide(short num, GWorldPtr to_gw, Rect to_rect){
|
||||
void cPict::drawPartyMonstWide(short num, Rect to_rect){
|
||||
Rect small_monst_rect = {0,0,18,14};
|
||||
to_rect.right = to_rect.left + 28;
|
||||
to_rect.bottom = to_rect.top + 36;
|
||||
PaintRect(&to_rect);
|
||||
if(!isSheetSet(SHEET_PARTY)) throw xMissingSheet(SHEET_PARTY);
|
||||
GWorldPtr from_gw = save;
|
||||
|
||||
Rect from_rect = get_custom_rect(num);
|
||||
OffsetRect(&small_monst_rect,to_rect.left,to_rect.top + 7);
|
||||
rect_draw_some_item(from_gw, from_rect, to_gw, small_monst_rect, transparent);
|
||||
rect_draw_some_item(from_gw, from_rect, small_monst_rect, (Point){0,0}, transparent);
|
||||
|
||||
from_rect = get_custom_rect(num+1);
|
||||
OffsetRect(&small_monst_rect,14,0);
|
||||
rect_draw_some_item(from_gw, from_rect, to_gw, small_monst_rect, transparent);
|
||||
rect_draw_some_item(from_gw, from_rect, small_monst_rect, (Point){0,0}, transparent);
|
||||
}
|
||||
|
||||
void cPict::drawPartyMonstTall(short num, GWorldPtr to_gw, Rect to_rect){
|
||||
void cPict::drawPartyMonstTall(short num, Rect to_rect){
|
||||
Rect small_monst_rect = {0,0,18,14};
|
||||
to_rect.right = to_rect.left + 28;
|
||||
to_rect.bottom = to_rect.top + 36;
|
||||
PaintRect(&to_rect);
|
||||
if(!isSheetSet(SHEET_PARTY)) throw xMissingSheet(SHEET_PARTY);
|
||||
GWorldPtr from_gw = save;
|
||||
|
||||
Rect from_rect = get_custom_rect(num);
|
||||
OffsetRect(&small_monst_rect,to_rect.left + 7,to_rect.top);
|
||||
rect_draw_some_item(from_gw, from_rect, to_gw, small_monst_rect, transparent);
|
||||
rect_draw_some_item(from_gw, from_rect, small_monst_rect, (Point){0,0}, transparent);
|
||||
|
||||
OffsetRect(&small_monst_rect,0,18);
|
||||
from_rect = get_custom_rect(num+1);
|
||||
rect_draw_some_item(from_gw, from_rect, to_gw, small_monst_rect, transparent);
|
||||
rect_draw_some_item(from_gw, from_rect, small_monst_rect, (Point){0,0}, transparent);
|
||||
}
|
||||
|
||||
void cPict::drawPartyMonstLg(short num, GWorldPtr to_gw, Rect to_rect){
|
||||
void cPict::drawPartyMonstLg(short num, Rect to_rect){
|
||||
Rect small_monst_rect = {0,0,18,14};
|
||||
to_rect.right = to_rect.left + 28;
|
||||
to_rect.bottom = to_rect.top + 36;
|
||||
PaintRect(&to_rect);
|
||||
if(!isSheetSet(SHEET_PARTY)) throw xMissingSheet(SHEET_PARTY);
|
||||
GWorldPtr from_gw = save;
|
||||
|
||||
Rect from_rect = get_custom_rect(num);
|
||||
OffsetRect(&small_monst_rect,to_rect.left,to_rect.top);
|
||||
rect_draw_some_item(from_gw, from_rect, to_gw, small_monst_rect, transparent);
|
||||
rect_draw_some_item(from_gw, from_rect, small_monst_rect, (Point){0,0}, transparent);
|
||||
|
||||
OffsetRect(&small_monst_rect,14,0);
|
||||
from_rect = get_custom_rect(num+1);
|
||||
rect_draw_some_item(from_gw, from_rect, to_gw, small_monst_rect, transparent);
|
||||
rect_draw_some_item(from_gw, from_rect, small_monst_rect, (Point){0,0}, transparent);
|
||||
|
||||
OffsetRect(&small_monst_rect,-14,18);
|
||||
from_rect = get_custom_rect(num+2);
|
||||
rect_draw_some_item(from_gw, from_rect, to_gw, small_monst_rect, transparent);
|
||||
rect_draw_some_item(from_gw, from_rect, small_monst_rect, (Point){0,0}, transparent);
|
||||
|
||||
OffsetRect(&small_monst_rect,14,0);
|
||||
from_rect = get_custom_rect(num+3);
|
||||
rect_draw_some_item(from_gw, from_rect, to_gw, small_monst_rect, transparent);
|
||||
rect_draw_some_item(from_gw, from_rect, small_monst_rect, (Point){0,0}, transparent);
|
||||
}
|
||||
|
||||
void cPict::drawPartyScen(short num, GWorldPtr to_gw, Rect to_rect){
|
||||
void cPict::drawPartyScen(short num, Rect to_rect){
|
||||
if(!isSheetSet(SHEET_HEADER)) throw xMissingSheet(SHEET_HEADER);
|
||||
GWorldPtr from_gw = header;
|
||||
Rect from_rect = {0,0,32,32};
|
||||
OffsetRect(&from_rect,32 * (num % 5),32 * (num / 5));
|
||||
to_rect.right = to_rect.left + 32;
|
||||
to_rect.bottom = to_rect.top + 32;
|
||||
rect_draw_some_item(from_gw, from_rect, to_gw, to_rect);
|
||||
rect_draw_some_item(from_gw, from_rect, to_rect, (Point){0,0});
|
||||
}
|
||||
|
||||
void cPict::drawPartyItem(short num, GWorldPtr to_gw, Rect to_rect){
|
||||
void cPict::drawPartyItem(short num, Rect to_rect){
|
||||
printf("Drawing graphic %i as a custom space pic.\n",num);
|
||||
to_rect.right = to_rect.left + 28;
|
||||
to_rect.bottom = to_rect.top + 32;
|
||||
if(!isSheetSet(SHEET_PARTY)) throw xMissingSheet(SHEET_PARTY);
|
||||
GWorldPtr from_gw = save;
|
||||
Rect from_rect = get_custom_rect(num);
|
||||
PaintRect(&to_rect);
|
||||
rect_draw_some_item(from_gw, from_rect, to_gw, to_rect, transparent);
|
||||
rect_draw_some_item(from_gw, from_rect, to_rect, (Point){0,0}, transparent);
|
||||
}
|
||||
|
||||
void cPict::drawPartyPc(short num, GWorldPtr to_gw, Rect to_rect){
|
||||
void cPict::drawPartyPc(short num, Rect to_rect){
|
||||
printf("Drawing graphic %i as a custom space pic.\n",num);
|
||||
to_rect.right = to_rect.left + 28;
|
||||
to_rect.bottom = to_rect.top + 32;
|
||||
if(!isSheetSet(SHEET_PARTY)) throw xMissingSheet(SHEET_PARTY);
|
||||
GWorldPtr from_gw = save;
|
||||
Rect from_rect = get_custom_rect(num);
|
||||
PaintRect(&to_rect);
|
||||
rect_draw_some_item(from_gw, from_rect, to_gw, to_rect, transparent);
|
||||
rect_draw_some_item(from_gw, from_rect, to_rect, (Point){0,0}, transparent);
|
||||
}
|
||||
|
||||
cPict::~cPict() {}
|
||||
|
||||
xMissingSheet::xMissingSheet(eSheetType t, size_t n) throw() : type(t), num(n) {}
|
||||
|
||||
xMissingSheet::~xMissingSheet() throw() {}
|
||||
|
||||
const char* xMissingSheet::what() throw(){
|
||||
const size_t len = strlen(messages[type]) + strlen(messages[NUM_SHEET_TYPES]) + 1;
|
||||
char*const msg = new char[len];
|
||||
sprintf(msg,messages[type],num);
|
||||
strcat(msg,messages[NUM_SHEET_TYPES]);
|
||||
return msg;
|
||||
}
|
||||
|
||||
const char*const xMissingSheet::messages[] = {
|
||||
"Terrain sheet #%d has not been set!",
|
||||
"The animated terrain sheet has not been set!",
|
||||
"Monster sheet #%d has not been set!",
|
||||
"The dialog sheet has not been set!",
|
||||
"The talk portraits sheet has not been set!",
|
||||
"The scenario icon sheet has not been set!",
|
||||
"The large scenario icon sheet has not been set!",
|
||||
"The large items sheet has not been set!",
|
||||
"The tiny items sheet has not been set!",
|
||||
"The PC sheet has not been set!",
|
||||
"The fields sheet has not been set!",
|
||||
"The booms sheet has not been set!",
|
||||
"The missile sheet has not been set!",
|
||||
"The party sheet has not been set!",
|
||||
"The scenario header sheet has not been set!",
|
||||
"The terrain map sheet has not been set!",
|
||||
"Full sheet #%d has not been set!",
|
||||
"The status sheet has not been set!",
|
||||
"Custom sheet #%d has not been set!",
|
||||
"%s It was accessed before it was set."
|
||||
};
|
||||
|
||||
@@ -86,6 +86,7 @@ enum eSheetType {
|
||||
SHEET_FULL,
|
||||
SHEET_STATUS,
|
||||
SHEET_CUSTOM,
|
||||
NUM_SHEET_TYPES
|
||||
};
|
||||
|
||||
class cPict : public cControl {
|
||||
@@ -96,8 +97,8 @@ public:
|
||||
bool triggerClickHandler(cDialog& me, std::string id, eKeyMod mods, Point where);
|
||||
void setFormat(eFormat prop, short val) throw(xUnsupportedProp);
|
||||
short getFormat(eFormat prop) throw(xUnsupportedProp);
|
||||
static void setSheet(eSheetType type, short n, GWorldPtr sheet);
|
||||
static bool isSheetSet(eSheetType type, size_t n);
|
||||
static void setSheet(eSheetType type, GWorldPtr sheet, short n = 0);
|
||||
static bool isSheetSet(eSheetType type, size_t n = 0);
|
||||
void setPict(pic_num_t num, ePicType type);
|
||||
pic_num_t getPicNum();
|
||||
ePicType getPicType();
|
||||
@@ -116,45 +117,45 @@ private:
|
||||
static GWorldPtr teranim, dlog, talk, scen, largeScen, item, tinyItem, pc, field, boom, missile, save, header, map, status;
|
||||
static std::vector<GWorldPtr> ter, monst, customSheets;
|
||||
static std::map<size_t,GWorldPtr> largeSheets; // map instead of vector because it'll be a sparse array
|
||||
static void drawPresetTer(short num, GWorldPtr to_gw, Rect to_rect);
|
||||
static void drawPresetTerAnim(short num, GWorldPtr to_gw, Rect to_rect);
|
||||
static void drawPresetMonstSm(short num, GWorldPtr to_gw, Rect to_rect);
|
||||
static void drawPresetMonstWide(short num, GWorldPtr to_gw, Rect to_rect);
|
||||
static void drawPresetMonstTall(short num, GWorldPtr to_gw, Rect to_rect);
|
||||
static void drawPresetMonstLg(short num, GWorldPtr to_gw, Rect to_rect);
|
||||
static void drawPresetDlog(short num, GWorldPtr to_gw, Rect to_rect);
|
||||
static void drawPresetDlogLg(short num, GWorldPtr to_gw, Rect to_rect);
|
||||
static void drawPresetTalk(short num, GWorldPtr to_gw, Rect to_rect);
|
||||
static void drawPresetScen(short num, GWorldPtr to_gw, Rect to_rect);
|
||||
static void drawPresetScenLg(short num, GWorldPtr to_gw, Rect to_rect);
|
||||
static void drawPresetItem(short num, GWorldPtr to_gw, Rect to_rect);
|
||||
static void drawPresetPc(short num, GWorldPtr to_gw, Rect to_rect);
|
||||
static void drawPresetField(short num, GWorldPtr to_gw, Rect to_rect);
|
||||
static void drawPresetBoom(short num, GWorldPtr to_gw, Rect to_rect);
|
||||
static void drawPresetMissile(short num, GWorldPtr to_gw, Rect to_rect);
|
||||
static void drawPresetTerMap(short num, GWorldPtr to_gw, Rect to_rect);
|
||||
static void drawStatusIcon(short num, GWorldPtr to_gw, Rect to_rect);
|
||||
static void drawFullSheet(short num, GWorldPtr to_gw, Rect to_rect);
|
||||
static void drawCustomTer(short num, GWorldPtr to_gw, Rect to_rect);
|
||||
static void drawCustomTerAnim(short num, GWorldPtr to_gw, Rect to_rect);
|
||||
static void drawCustomMonstSm(short num, GWorldPtr to_gw, Rect to_rect);
|
||||
static void drawCustomMonstWide(short num, GWorldPtr to_gw, Rect to_rect);
|
||||
static void drawCustomMonstTall(short num, GWorldPtr to_gw, Rect to_rect);
|
||||
static void drawCustomMonstLg(short num, GWorldPtr to_gw, Rect to_rect);
|
||||
static void drawCustomDlog(short num, GWorldPtr to_gw, Rect to_rect);
|
||||
static void drawCustomDlogLg(short num, GWorldPtr to_gw, Rect to_rect);
|
||||
static void drawCustomTalk(short num, GWorldPtr to_gw, Rect to_rect);
|
||||
static void drawCustomItem(short num, GWorldPtr to_gw, Rect to_rect);
|
||||
static void drawCustomMissile(short num, GWorldPtr to_gw, Rect to_rect);
|
||||
static void drawCustomTerMap(short num, GWorldPtr to_gw, Rect to_rect);
|
||||
static void drawPartyMonstSm(short num, GWorldPtr to_gw, Rect to_rect);
|
||||
static void drawPartyMonstWide(short num, GWorldPtr to_gw, Rect to_rect);
|
||||
static void drawPartyMonstTall(short num, GWorldPtr to_gw, Rect to_rect);
|
||||
static void drawPartyMonstLg(short num, GWorldPtr to_gw, Rect to_rect);
|
||||
static void drawPartyScen(short num, GWorldPtr to_gw, Rect to_rect);
|
||||
static void drawPartyItem(short num, GWorldPtr to_gw, Rect to_rect);
|
||||
static void drawPartyPc(short num, GWorldPtr to_gw, Rect to_rect);
|
||||
static std::map<ePicType,void(*)(short,GWorldPtr,Rect)>& drawPict();
|
||||
static void drawPresetTer(short num, Rect to_rect);
|
||||
static void drawPresetTerAnim(short num, Rect to_rect);
|
||||
static void drawPresetMonstSm(short num, Rect to_rect);
|
||||
static void drawPresetMonstWide(short num, Rect to_rect);
|
||||
static void drawPresetMonstTall(short num, Rect to_rect);
|
||||
static void drawPresetMonstLg(short num, Rect to_rect);
|
||||
static void drawPresetDlog(short num, Rect to_rect);
|
||||
static void drawPresetDlogLg(short num, Rect to_rect);
|
||||
static void drawPresetTalk(short num, Rect to_rect);
|
||||
static void drawPresetScen(short num, Rect to_rect);
|
||||
static void drawPresetScenLg(short num, Rect to_rect);
|
||||
static void drawPresetItem(short num, Rect to_rect);
|
||||
static void drawPresetPc(short num, Rect to_rect);
|
||||
static void drawPresetField(short num, Rect to_rect);
|
||||
static void drawPresetBoom(short num, Rect to_rect);
|
||||
static void drawPresetMissile(short num, Rect to_rect);
|
||||
static void drawPresetTerMap(short num, Rect to_rect);
|
||||
static void drawStatusIcon(short num, Rect to_rect);
|
||||
static void drawFullSheet(short num, Rect to_rect);
|
||||
static void drawCustomTer(short num, Rect to_rect);
|
||||
static void drawCustomTerAnim(short num, Rect to_rect);
|
||||
static void drawCustomMonstSm(short num, Rect to_rect);
|
||||
static void drawCustomMonstWide(short num, Rect to_rect);
|
||||
static void drawCustomMonstTall(short num, Rect to_rect);
|
||||
static void drawCustomMonstLg(short num, Rect to_rect);
|
||||
static void drawCustomDlog(short num, Rect to_rect);
|
||||
static void drawCustomDlogLg(short num, Rect to_rect);
|
||||
static void drawCustomTalk(short num, Rect to_rect);
|
||||
static void drawCustomItem(short num, Rect to_rect);
|
||||
static void drawCustomMissile(short num, Rect to_rect);
|
||||
static void drawCustomTerMap(short num, Rect to_rect);
|
||||
static void drawPartyMonstSm(short num, Rect to_rect);
|
||||
static void drawPartyMonstWide(short num, Rect to_rect);
|
||||
static void drawPartyMonstTall(short num, Rect to_rect);
|
||||
static void drawPartyMonstLg(short num, Rect to_rect);
|
||||
static void drawPartyScen(short num, Rect to_rect);
|
||||
static void drawPartyItem(short num, Rect to_rect);
|
||||
static void drawPartyPc(short num, Rect to_rect);
|
||||
static std::map<ePicType,void(*)(short,Rect)>& drawPict();
|
||||
//static void(* drawPict[NUM_PIC_TYPES])(short,GWorldPtr,Rect);
|
||||
click_callback_t onClick;
|
||||
};
|
||||
@@ -165,4 +166,15 @@ ePicType operator + (ePicTypeMod lhs, ePicType rhs);
|
||||
ePicType operator - (ePicTypeMod lhs, ePicType rhs);
|
||||
ePicType&operator +=(ePicType&lhs, ePicTypeMod rhs);
|
||||
ePicType&operator -=(ePicType&lhs, ePicTypeMod rhs);
|
||||
|
||||
class xMissingSheet : std::exception {
|
||||
static const char*const messages[NUM_SHEET_TYPES+1];
|
||||
eSheetType type;
|
||||
size_t num;
|
||||
public:
|
||||
explicit xMissingSheet(eSheetType t, size_t n = 0) throw();
|
||||
~xMissingSheet() throw();
|
||||
const char* what() throw();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user