diff options
author | Oliver Kiehl | 2004-04-12 12:25:51 +0000 |
---|---|---|
committer | Oliver Kiehl | 2004-04-12 12:25:51 +0000 |
commit | c57234870601fa4241b68beefd0a83677e8c935a (patch) | |
tree | 0e1f9610f01dfb13db44ab7046a2734dc1643c91 /simon | |
parent | 2b1542803004f4ca26f30f4b7c4d94d7b7e6d5c5 (diff) | |
download | scummvm-rg350-c57234870601fa4241b68beefd0a83677e8c935a.tar.gz scummvm-rg350-c57234870601fa4241b68beefd0a83677e8c935a.tar.bz2 scummvm-rg350-c57234870601fa4241b68beefd0a83677e8c935a.zip |
Enable hack for old games too. don't pass larger size on to resfile_read
svn-id: r13558
Diffstat (limited to 'simon')
-rw-r--r-- | simon/simon.cpp | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/simon/simon.cpp b/simon/simon.cpp index bfd39a72b9..b2584b496c 100644 --- a/simon/simon.cpp +++ b/simon/simon.cpp @@ -4304,6 +4304,12 @@ void SimonEngine::read_vga_from_datfile_1(uint vga_id) { } byte *SimonEngine::read_vga_from_datfile_2(uint id) { + // !!! HACK !!! + // allocate more space for text to cope with foreign languages that use + // up more space than english. I hope 6400 bytes are enough. This number + // is base on: 2 (lines) * 320 (screen width) * 10 (textheight) -- olki + int extraBuffer = (id == 5 ? 6400 : 0); + if (_game & GF_OLD_BUNDLE) { File in; char buf[15]; @@ -4327,10 +4333,10 @@ byte *SimonEngine::read_vga_from_datfile_2(uint id) { byte *buffer = new byte[size]; if (in.read(buffer, size) != size) error("read_vga_from_datfile_2: read failed"); - dst = setup_vga_destination (READ_BE_UINT32 (buffer + size - 4)); + dst = setup_vga_destination (READ_BE_UINT32(buffer + size - 4) + extraBuffer); decrunch_file_amiga (buffer, dst, size); } else { - dst = setup_vga_destination(size); + dst = setup_vga_destination(size + extraBuffer); if (in.read(dst, size) != size) error("read_vga_from_datfile_2: read failed"); } @@ -4342,14 +4348,7 @@ byte *SimonEngine::read_vga_from_datfile_2(uint id) { uint32 size = _game_offsets_ptr[id + 1] - offs_a; byte *dst; - // !!! HACK !!! - // allocate more space for text to cope with foreign languages that use - // up more space than english. I hope 6400 bytes are enough. This number - // is base on: 2 (lines) * 320 (screen width) * 10 (textheight) -- olki - if (id == 5) - size += 6400; - - dst = setup_vga_destination(size); + dst = setup_vga_destination(size + extraBuffer); resfile_read(dst, offs_a, size); return dst; |