aboutsummaryrefslogtreecommitdiff
path: root/engines/glk
diff options
context:
space:
mode:
authorPaul Gilbert2019-05-04 11:03:50 +1000
committerPaul Gilbert2019-05-04 11:03:50 +1000
commit3662e80c0fa9e738407f49794e0f5281ff02c675 (patch)
treed1d227c3ba8c35dfbe74eb73d6063ccd6cf39401 /engines/glk
parent5f57440deec5f6d34f2738f0705204557d3e6ab3 (diff)
downloadscummvm-rg350-3662e80c0fa9e738407f49794e0f5281ff02c675.tar.gz
scummvm-rg350-3662e80c0fa9e738407f49794e0f5281ff02c675.tar.bz2
scummvm-rg350-3662e80c0fa9e738407f49794e0f5281ff02c675.zip
GLK: Create objrocks for saved game file sreams
Diffstat (limited to 'engines/glk')
-rw-r--r--engines/glk/glulxe/glkop.cpp1
-rw-r--r--engines/glk/streams.cpp5
-rw-r--r--engines/glk/streams.h2
3 files changed, 7 insertions, 1 deletions
diff --git a/engines/glk/glulxe/glkop.cpp b/engines/glk/glulxe/glkop.cpp
index 635d90bb7b..70fb44b85e 100644
--- a/engines/glk/glulxe/glkop.cpp
+++ b/engines/glk/glulxe/glkop.cpp
@@ -677,6 +677,7 @@ void Glulxe::unparse_glk_args(dispatch_splot_t *splot, const char **proto, int d
opref = garglist[gargnum]._opaqueref;
if (opref) {
gidispatch_rock_t objrock = gidispatch_get_objrock(opref, *cx - 'a');
+ assert(objrock.ptr);
thisval = ((classref_t *)objrock.ptr)->id;
} else {
thisval = 0;
diff --git a/engines/glk/streams.cpp b/engines/glk/streams.cpp
index 907cde4d66..e0271baea8 100644
--- a/engines/glk/streams.cpp
+++ b/engines/glk/streams.cpp
@@ -1588,6 +1588,11 @@ frefid_t Streams::iterate(frefid_t fref, uint *rock) {
/*--------------------------------------------------------------------------*/
+FileReference::FileReference() : _rock(0), _slotNumber(-1), _fileType(fileusage_Data), _textMode(false) {
+ if (g_vm->gli_register_obj)
+ _dispRock = (*g_vm->gli_register_obj)(this, gidisp_Class_Fileref);
+}
+
FileReference::FileReference(int slot, const Common::String &desc, uint usage, uint rock) :
_rock(rock), _slotNumber(slot), _description(desc),
_fileType((FileUsage)(usage & fileusage_TypeMask)), _textMode(usage & fileusage_TextMode) {
diff --git a/engines/glk/streams.h b/engines/glk/streams.h
index f899936ef3..14ca91dfc0 100644
--- a/engines/glk/streams.h
+++ b/engines/glk/streams.h
@@ -98,7 +98,7 @@ struct FileReference {
/**
* Constructor
*/
- FileReference() : _rock(0), _slotNumber(-1), _fileType(fileusage_Data), _textMode(false) {}
+ FileReference();
/**
* Constructor