aboutsummaryrefslogtreecommitdiff
path: root/engines/glk
diff options
context:
space:
mode:
authorPaul Gilbert2019-03-02 16:07:10 -0800
committerPaul Gilbert2019-03-02 18:11:51 -0800
commit6be0dbe016d83f64168166d520bcc4a942d59087 (patch)
tree5c5b8a2b2e483aadfe65c10b03343b0d5aafea4c /engines/glk
parent668820e018218b8544e35fbb569008f8a4bf1beb (diff)
downloadscummvm-rg350-6be0dbe016d83f64168166d520bcc4a942d59087.tar.gz
scummvm-rg350-6be0dbe016d83f64168166d520bcc4a942d59087.tar.bz2
scummvm-rg350-6be0dbe016d83f64168166d520bcc4a942d59087.zip
GLK: Move input caret drawing into base FontInfo class
Diffstat (limited to 'engines/glk')
-rw-r--r--engines/glk/conf.cpp3
-rw-r--r--engines/glk/fonts.cpp18
-rw-r--r--engines/glk/fonts.h19
3 files changed, 21 insertions, 19 deletions
diff --git a/engines/glk/conf.cpp b/engines/glk/conf.cpp
index 5c6bc761bc..4e7ed24b02 100644
--- a/engines/glk/conf.cpp
+++ b/engines/glk/conf.cpp
@@ -124,6 +124,9 @@ Conf::Conf(InterpreterType interpType) {
get("caretcolor", _propInfo._caretColor, nullptr);
get("caretcolor", _propInfo._caretSave, nullptr);
get("caretshape", _propInfo._caretShape, 2);
+ _monoInfo._caretColor = _propInfo._caretColor;
+ _monoInfo._caretSave = _propInfo._caretSave;
+ _monoInfo._caretShape = _propInfo._caretShape;
_propInfo._linkStyle = _monoInfo._linkStyle = ConfMan.hasKey("linkstyle")
&& !strToInt(ConfMan.get("linkstyle").c_str()) ? 0 : 1;
diff --git a/engines/glk/fonts.cpp b/engines/glk/fonts.cpp
index cdac7c0b2b..12ae7c6489 100644
--- a/engines/glk/fonts.cpp
+++ b/engines/glk/fonts.cpp
@@ -29,18 +29,10 @@ namespace Glk {
FontInfo::FontInfo() : _size(0), _aspect(0), _cellW(0), _cellH(0), _leading(0), _baseLine(0),
_linkStyle(0), _moreFont(PROPB), _moreAlign(0), _caps(0), _linkColor(0), _linkSave(0),
- _moreColor(0), _moreSave(0) {
+ _moreColor(0), _moreSave(0), _caretShape(0), _caretColor(0), _caretSave(0) {
}
-/*--------------------------------------------------------------------------*/
-
-PropFontInfo::PropFontInfo() : _justify(0), _quotes(0), _dashes(0), _spaces(0), _caretShape(0),
- _lineSeparation(2), _caretColor(0), _caretSave(0) {
-}
-
-/*--------------------------------------------------------------------------*/
-
-void PropFontInfo::drawCaret(const Point &pos) {
+void FontInfo::drawCaret(const Point &pos) {
uint color = _caretColor;
Graphics::Screen &s = *g_vm->_screen;
int x = pos.x / GLI_SUBPIX, y = pos.y;
@@ -75,4 +67,10 @@ void PropFontInfo::drawCaret(const Point &pos) {
}
+/*--------------------------------------------------------------------------*/
+
+PropFontInfo::PropFontInfo() : _justify(0), _quotes(0), _dashes(0), _spaces(0),
+ _lineSeparation(2) {
+}
+
} // End of namespace Glk
diff --git a/engines/glk/fonts.h b/engines/glk/fonts.h
index 4a9253023c..156f4d44f8 100644
--- a/engines/glk/fonts.h
+++ b/engines/glk/fonts.h
@@ -48,11 +48,21 @@ struct FontInfo {
int _moreAlign;
Common::String _morePrompt;
int _caps;
+ uint _caretColor, _caretSave;
+ int _caretShape;
/**
* Constructor
*/
FontInfo();
+
+
+ /**
+ * Draws the text input caret at the given position
+ * @remarks The position specifies the caret's bottom-left corner,
+ * and the X position is in multiples of GLI_SUBPIX
+ */
+ void drawCaret(const Point &pos);
};
/**
@@ -65,8 +75,6 @@ struct MonoFontInfo : public FontInfo {
* Font info for proportional (variable size) fonts
*/
struct PropFontInfo : public MonoFontInfo {
- uint _caretColor, _caretSave;
- int _caretShape;
int _justify;
int _quotes;
int _dashes;
@@ -77,13 +85,6 @@ struct PropFontInfo : public MonoFontInfo {
* Constructor
*/
PropFontInfo();
-
- /**
- * Draws the text input caret at the given position
- * @remarks The position specifies the caret's bottom-left corner,
- * and the X position is in multiples of GLI_SUBPIX
- */
- void drawCaret(const Point &pos);
};
} // End of namespace Glk