aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/gui/gui_controls.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/sci/gui/gui_controls.cpp')
-rw-r--r--engines/sci/gui/gui_controls.cpp28
1 files changed, 14 insertions, 14 deletions
diff --git a/engines/sci/gui/gui_controls.cpp b/engines/sci/gui/gui_controls.cpp
index f9239f9573..40b61f3ef6 100644
--- a/engines/sci/gui/gui_controls.cpp
+++ b/engines/sci/gui/gui_controls.cpp
@@ -36,8 +36,8 @@
namespace Sci {
-SciGuiControls::SciGuiControls(SciGuiGfx *gfx, SciGuiText *text)
- : _gfx(gfx), _text(text) {
+SciGuiControls::SciGuiControls(SegManager *segMan, SciGuiGfx *gfx, SciGuiText *text)
+ : _segMan(segMan), _gfx(gfx), _text(text) {
init();
}
@@ -137,10 +137,10 @@ void SciGuiControls::TexteditSetBlinkTime() {
_texteditBlinkTime = g_system->getMillis() + (30 * 1000 / 60);
}
-void SciGuiControls::TexteditChange(SegManager *segMan, reg_t controlObject, reg_t eventObject) {
- uint16 cursorPos = GET_SEL32V(segMan, controlObject, cursor);
- uint16 maxChars = GET_SEL32V(segMan, controlObject, max);
- reg_t textReference = GET_SEL32(segMan, controlObject, text);
+void SciGuiControls::TexteditChange(reg_t controlObject, reg_t eventObject) {
+ uint16 cursorPos = GET_SEL32V(_segMan, controlObject, cursor);
+ uint16 maxChars = GET_SEL32V(_segMan, controlObject, max);
+ reg_t textReference = GET_SEL32(_segMan, controlObject, text);
Common::String text;
uint16 textSize, eventType, eventKey;
bool textChanged = false;
@@ -148,18 +148,18 @@ void SciGuiControls::TexteditChange(SegManager *segMan, reg_t controlObject, reg
if (textReference.isNull())
error("kEditControl called on object that doesnt have a text reference");
- text = segMan->getString(textReference);
+ text = _segMan->getString(textReference);
if (!eventObject.isNull()) {
textSize = text.size();
- eventType = GET_SEL32V(segMan, eventObject, type);
+ eventType = GET_SEL32V(_segMan, eventObject, type);
switch (eventType) {
case SCI_EVT_MOUSE_PRESS:
// TODO: Implement mouse support for cursor change
break;
case SCI_EVT_KEYBOARD:
- eventKey = GET_SEL32V(segMan, eventObject, message);
+ eventKey = GET_SEL32V(_segMan, eventObject, message);
switch (eventKey) {
case SCI_K_BACKSPACE:
if (cursorPos > 0) {
@@ -203,9 +203,9 @@ void SciGuiControls::TexteditChange(SegManager *segMan, reg_t controlObject, reg
if (textChanged) {
GuiResourceId oldFontId = _text->GetFontId();
- GuiResourceId fontId = GET_SEL32V(segMan, controlObject, font);
- rect = Common::Rect(GET_SEL32V(segMan, controlObject, nsLeft), GET_SEL32V(segMan, controlObject, nsTop),
- GET_SEL32V(segMan, controlObject, nsRight), GET_SEL32V(segMan, controlObject, nsBottom));
+ GuiResourceId fontId = GET_SEL32V(_segMan, controlObject, font);
+ rect = Common::Rect(GET_SEL32V(_segMan, controlObject, nsLeft), GET_SEL32V(_segMan, controlObject, nsTop),
+ GET_SEL32V(_segMan, controlObject, nsRight), GET_SEL32V(_segMan, controlObject, nsBottom));
TexteditCursorErase();
_gfx->EraseRect(rect);
_text->Box(text.c_str(), 0, rect, SCI_TEXT_ALIGNMENT_LEFT, fontId);
@@ -214,7 +214,7 @@ void SciGuiControls::TexteditChange(SegManager *segMan, reg_t controlObject, reg
TexteditCursorDraw(rect, text.c_str(), cursorPos);
_text->SetFont(oldFontId);
// Write back string
- segMan->strcpy(textReference, text.c_str());
+ _segMan->strcpy(textReference, text.c_str());
} else {
if (g_system->getMillis() >= _texteditBlinkTime) {
_gfx->InvertRect(_texteditCursorRect);
@@ -224,7 +224,7 @@ void SciGuiControls::TexteditChange(SegManager *segMan, reg_t controlObject, reg
}
}
- PUT_SEL32V(segMan, controlObject, cursor, cursorPos);
+ PUT_SEL32V(_segMan, controlObject, cursor, cursorPos);
}
} // End of namespace Sci