diff options
author | Strangerke | 2011-06-29 16:15:41 +0200 |
---|---|---|
committer | Strangerke | 2011-06-29 16:15:41 +0200 |
commit | b0c9c9122fc678074aba30068e5b36d347208e65 (patch) | |
tree | 79a99db08ec985f2e5f1e216823b1104d5b753fb /engines/kyra/debugger.cpp | |
parent | f2f3124246a77036f843dee2d83ad28084234ebc (diff) | |
parent | c32a3ea0d30336771bab460ecccb58c4614e6294 (diff) | |
download | scummvm-rg350-b0c9c9122fc678074aba30068e5b36d347208e65.tar.gz scummvm-rg350-b0c9c9122fc678074aba30068e5b36d347208e65.tar.bz2 scummvm-rg350-b0c9c9122fc678074aba30068e5b36d347208e65.zip |
Merge branch 'master' of github.com:scummvm/scummvm into soltys_wip2
Diffstat (limited to 'engines/kyra/debugger.cpp')
-rw-r--r-- | engines/kyra/debugger.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/engines/kyra/debugger.cpp b/engines/kyra/debugger.cpp index d0baf8a133..e8dd9e9a15 100644 --- a/engines/kyra/debugger.cpp +++ b/engines/kyra/debugger.cpp @@ -71,11 +71,18 @@ bool Debugger::cmd_loadPalette(int argc, const char **argv) { } if (_vm->game() != GI_KYRA1 && _vm->resource()->getFileSize(argv[1]) != 768) { - uint8 buffer[320*200]; + uint8 *buffer = (uint8 *)malloc(320 * 200 * sizeof(uint8)); + if (!buffer) { + DebugPrintf("ERROR: Cannot allocate buffer for screen region!\n"); + return true; + } + _vm->screen()->copyRegionToBuffer(5, 0, 0, 320, 200, buffer); _vm->screen()->loadBitmap(argv[1], 5, 5, 0); palette.copy(_vm->screen()->getCPagePtr(5), 0, 256); _vm->screen()->copyBlockToPage(5, 0, 0, 320, 200, buffer); + + free(buffer); } else if (!_vm->screen()->loadPalette(argv[1], palette)) { DebugPrintf("ERROR: Palette '%s' not found!\n", argv[1]); return true; |