From: Laszlo T. <ave...@us...> - 2010-11-17 18:09:30
|
gemrb: Infinity Engine emulator The branch master has been updated via d1c2cb0a7cc4233fde6be36504141ff9fea7c82b (commit) Summary of changes: gemrb/core/GUI/Button.cpp | 6 +++++ gemrb/core/GUI/Button.h | 2 + gemrb/plugins/CHUImporter/CHUImporter.cpp | 32 +++++++++++++++++++--------- 3 files changed, 30 insertions(+), 10 deletions(-) from 0a94ef74d7fb1df3a766aa39799a5325891c3242 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://gemrb.git.sourceforge.net/git/gitweb.cgi?p=gemrb/gemrb;a=commitdiff;h=d1c2cb0a7cc4233fde6be36504141ff9fea7c82b commit d1c2cb0a7cc4233fde6be36504141ff9fea7c82b Author: Avenger <ave...@so...> Date: Wed Nov 17 19:08:26 2010 +0100 Button:read the custom anchor point (also read the button frame indices correctly) diff --git a/gemrb/core/GUI/Button.cpp b/gemrb/core/GUI/Button.cpp index 2410de2..83930d2 100644 --- a/gemrb/core/GUI/Button.cpp +++ b/gemrb/core/GUI/Button.cpp @@ -63,6 +63,7 @@ Button::Button() memset(&DestRGB,0,sizeof(DestRGB)); memset( borders, 0, sizeof( borders )); starttime = 0; + Anchor.null(); } Button::~Button() { @@ -718,3 +719,8 @@ void Button::SetHorizontalOverlay(double clip, const Color &src, const Color &de Clipping = clip; Changed = true; } + +void Button::SetAnchor(ieWord x, ieWord y) +{ + Anchor = Point(x,y); +} diff --git a/gemrb/core/GUI/Button.h b/gemrb/core/GUI/Button.h index 376c2f8..1ae3d91 100644 --- a/gemrb/core/GUI/Button.h +++ b/gemrb/core/GUI/Button.h @@ -182,6 +182,7 @@ public: // Public Events void SetTextColor(const Color &fore, const Color &back); /** Sets percent (0-1.0) of width for clipping picture */ void SetPictureClipping(double clip) { Clipping = clip; } + void SetAnchor(ieWord x, ieWord y); private: // Private attributes char* Text; bool hasText; @@ -208,6 +209,7 @@ private: // Private attributes /** HP Bar over portraits */ unsigned long starttime; Color SourceRGB, DestRGB; + Point Anchor; /** frame settings */ ButtonBorder borders[MAX_NUM_BORDERS]; bool IsPixelTransparent (unsigned short x, unsigned short y); diff --git a/gemrb/plugins/CHUImporter/CHUImporter.cpp b/gemrb/plugins/CHUImporter/CHUImporter.cpp index de26ba1..a8c6332 100644 --- a/gemrb/plugins/CHUImporter/CHUImporter.cpp +++ b/gemrb/plugins/CHUImporter/CHUImporter.cpp @@ -140,14 +140,22 @@ Window* CHUImporter::GetWindow(unsigned int wid) btn->Height = Height; btn->ControlType = ControlType; ieResRef BAMFile; - ieWord Cycle, UnpressedIndex, PressedIndex, - SelectedIndex, DisabledIndex; + ieByte Cycle, Flags; + ieByte UnpressedIndex, x1; + ieByte PressedIndex, x2; + ieByte SelectedIndex, y1; + ieByte DisabledIndex, y2; str->ReadResRef( BAMFile ); - str->ReadWord( &Cycle ); - str->ReadWord( &UnpressedIndex ); - str->ReadWord( &PressedIndex ); - str->ReadWord( &SelectedIndex ); - str->ReadWord( &DisabledIndex ); + str->Read( &Cycle, 1 ); + str->Read( &Flags, 1 ); + str->Read( &UnpressedIndex, 1 ); + str->Read( &x1, 1 ); + str->Read( &PressedIndex, 1 ); + str->Read( &x2, 1 ); + str->Read( &SelectedIndex, 1 ); + str->Read( &y1, 1 ); + str->Read( &DisabledIndex, 1 ); + str->Read( &y2, 1 ); btn->Owner = win; /** Justification comes from the .chu, other bits are set by script */ if (!Width) { @@ -157,7 +165,11 @@ Window* CHUImporter::GetWindow(unsigned int wid) btn->SetFlags(IE_GUI_BUTTON_CAPS, BM_OR); } - btn->SetFlags( Cycle&0xff00, BM_OR ); + btn->SetFlags( Flags, BM_OR ); + if (Flags & IE_GUI_BUTTON_ANCHOR) { + btn->SetAnchor(x1 | (x2<<8), y1 | (y2<<8)); + } + if (strnicmp( BAMFile, "guictrl\0", 8 ) == 0) { if (UnpressedIndex == 0) { //printMessage("CHUImporter", "Special Button Control, Skipping Image Loading\n",GREEN ); @@ -178,11 +190,11 @@ Window* CHUImporter::GetWindow(unsigned int wid) /** Cycle is only a byte for buttons */ Sprite2D* tspr = bam->GetFrame( UnpressedIndex, (unsigned char) Cycle ); btn->SetImage( IE_GUI_BUTTON_UNPRESSED, tspr ); - tspr = bam->GetFrame( PressedIndex, (unsigned char) Cycle ); + tspr = bam->GetFrame( PressedIndex, Cycle ); btn->SetImage( IE_GUI_BUTTON_PRESSED, tspr ); //ignorebuttonframes is a terrible hack if (core->HasFeature( GF_IGNORE_BUTTON_FRAMES) ) { - if (bam->GetCycleSize( (unsigned char) Cycle) == 4 ) + if (bam->GetCycleSize(Cycle) == 4 ) SelectedIndex=2; } tspr = bam->GetFrame( SelectedIndex, (unsigned char) Cycle ); ----------------------------------------------------------------------- This is an automated email from the git hooks/post-receive script. -- gemrb: Infinity Engine emulator |