aboutsummaryrefslogtreecommitdiff
path: root/engines/parallaction/disk_br.cpp
diff options
context:
space:
mode:
authorNicola Mettifogo2007-08-12 17:13:21 +0000
committerNicola Mettifogo2007-08-12 17:13:21 +0000
commit10ee427772c03db711dfd3d363075000e45697b6 (patch)
tree405b34c2e258eef46821fd12be2bb8b7029f61a8 /engines/parallaction/disk_br.cpp
parent0ec634ea06d3e4f8506ab7dd1ddfdeedc3d28f23 (diff)
downloadscummvm-rg350-10ee427772c03db711dfd3d363075000e45697b6.tar.gz
scummvm-rg350-10ee427772c03db711dfd3d363075000e45697b6.tar.bz2
scummvm-rg350-10ee427772c03db711dfd3d363075000e45697b6.zip
Changed signature of disk routines for backgrounds to something resembling revisions prior to 28524, yet keeping the new useful BackgroundInfo struct. Those routines can now be used to fill specific fields of the struct, instead of having them create a new one at each call.
This feature is needed by BRA, since background, mask and path are specified by different instructions in the script. svn-id: r28566
Diffstat (limited to 'engines/parallaction/disk_br.cpp')
-rw-r--r--engines/parallaction/disk_br.cpp20
1 files changed, 9 insertions, 11 deletions
diff --git a/engines/parallaction/disk_br.cpp b/engines/parallaction/disk_br.cpp
index cb33bdb485..65332a2a4a 100644
--- a/engines/parallaction/disk_br.cpp
+++ b/engines/parallaction/disk_br.cpp
@@ -175,7 +175,7 @@ Cnv* DosDisk_br::loadFrames(const char* name) {
// doesn't need slides in that sense, but it still has some special
// graphics resources with palette data, so those will be named slides.
//
-BackgroundInfo* DosDisk_br::loadSlide(const char *name) {
+void DosDisk_br::loadSlide(BackgroundInfo& info, const char *name) {
debugC(5, kDebugDisk, "DosDisk_br::loadSlide");
char path[PATH_LEN];
@@ -185,29 +185,27 @@ BackgroundInfo* DosDisk_br::loadSlide(const char *name) {
if (!stream.open(path))
errorFileNotFound(path);
- BackgroundInfo* info = new BackgroundInfo;
-
stream.skip(4);
- info->width = stream.readUint32BE();
- info->height = stream.readUint32BE();
+ info.width = stream.readUint32BE();
+ info.height = stream.readUint32BE();
stream.skip(20);
byte rgb[768];
stream.read(rgb, 768);
for (uint i = 0; i < 256; i++) {
- info->palette.setEntry(i, rgb[i] >> 2, rgb[i+256] >> 2, rgb[i+512] >> 2);
+ info.palette.setEntry(i, rgb[i] >> 2, rgb[i+256] >> 2, rgb[i+512] >> 2);
}
- info->bg.create(info->width, info->height, 1);
- stream.read(info->bg.pixels, info->width * info->height);
+ info.bg.create(info.width, info.height, 1);
+ stream.read(info.bg.pixels, info.width * info.height);
- return info;
+ return;
}
-BackgroundInfo* DosDisk_br::loadScenery(const char *name, const char *mask, const char* path) {
+void DosDisk_br::loadScenery(BackgroundInfo& info, const char *name, const char *mask, const char* path) {
debugC(5, kDebugDisk, "DosDisk_br::loadScenery");
- return 0;
+ return;
}
Table* DosDisk_br::loadTable(const char* name) {