Ticket #7902: samnmax_demo_extension_patch

File samnmax_demo_extension_patch, 2.9 KB (added by SF/japj, 22 years ago)

resource extension patch

Line 
1Index: resource.cpp
2===================================================================
3RCS file: /cvsroot/scummvm/scummvm/resource.cpp,v
4retrieving revision 1.13
5diff -u -r1.13 resource.cpp
6--- resource.cpp 2001/11/07 18:10:51 1.13
7+++ resource.cpp 2001/11/07 20:30:07
8@@ -59,9 +59,15 @@
9 return;
10 }
11 if (room==0) {
12- sprintf(buf, "%s.000", _exe_name);
13+ if (_resExtension)
14+ sprintf(buf, "%s.%s0", _exe_name, _resExtension);
15+ else
16+ sprintf(buf, "%s.000", _exe_name);
17 } else {
18- sprintf(buf, "%s.%.3d", _exe_name, res.roomno[1][room]);
19+ if (_resExtension)
20+ sprintf(buf, "%s.%s%.1d", _exe_name, _resExtension, res.roomno[1][room]);
21+ else
22+ sprintf(buf, "%s.%.3d", _exe_name, res.roomno[1][room]);
23 }
24 _encbyte = 0x69;
25 if (openResourceFile(buf)) {
26Index: scumm.h
27===================================================================
28RCS file: /cvsroot/scummvm/scummvm/scumm.h,v
29retrieving revision 1.20
30diff -u -r1.20 scumm.h
31--- scumm.h 2001/11/07 18:10:51 1.20
32+++ scumm.h 2001/11/07 20:30:12
33@@ -612,6 +612,7 @@
34
35 char *_resFilePrefix;
36 char *_resFilePath;
37+ char *_resExtension;
38
39 int _keyPressed;
40
41Index: scummvm.cpp
42===================================================================
43RCS file: /cvsroot/scummvm/scummvm/scummvm.cpp,v
44retrieving revision 1.19
45diff -u -r1.19 scummvm.cpp
46--- scummvm.cpp 2001/11/06 21:41:56 1.19
47+++ scummvm.cpp 2001/11/07 20:30:15
48@@ -412,15 +412,17 @@
49 char *filename;
50 char *gamename;
51 byte id,major,middle,minor;
52+ char *resExt; // resource extenstion ie .SMx, .LAx 0-> no extension "normal behaviour"
53 };
54
55 static const VersionSettings version_settings[] = {
56- {"monkey", "Monkey Island 1", GID_MONKEY, 5, 2, 2},
57- {"monkey2", "Monkey Island 2: LeChuck's revenge", GID_MONKEY2, 5, 2, 2},
58- {"atlantis", "Indiana Jones 4 and the Fate of Atlantis", GID_INDY4, 5, 5, 0},
59- {"playfate", "Indiana Jones 4 and the Fate of Atlantis (Demo)", GID_INDY4, 5, 5, 0},
60- {"tentacle", "Day Of The Tenctacle", GID_TENTACLE, 6, 4, 2},
61- {"samnmax", "Sam & Max", GID_SAMNMAX, 6, 4, 2},
62+ {"monkey", "Monkey Island 1", GID_MONKEY, 5, 2, 2, 0},
63+ {"monkey2", "Monkey Island 2: LeChuck's revenge", GID_MONKEY2, 5, 2, 2, 0},
64+ {"atlantis", "Indiana Jones 4 and the Fate of Atlantis", GID_INDY4, 5, 5, 0, 0},
65+ {"playfate", "Indiana Jones 4 and the Fate of Atlantis (Demo)", GID_INDY4, 5, 5, 0, 0},
66+ {"tentacle", "Day Of The Tenctacle", GID_TENTACLE, 6, 4, 2, 0},
67+ {"samnmax", "Sam & Max", GID_SAMNMAX, 6, 4, 2, 0},
68+ {"snmdemo", "Sam & Max (Demo)", GID_SAMNMAX, 6, 3, 0 , "SM"},
69 {NULL,NULL}
70 };
71
72@@ -436,6 +438,7 @@
73 _middleScummVersion = gnl->middle;
74 _minorScummVersion = gnl->minor;
75 _gameText = gnl->gamename;
76+ _resExtension = gnl->resExt;
77 debug(1, "Detected game '%s', version %d.%d.%d",
78 gnl->gamename, gnl->major, gnl->middle, gnl->minor);
79 return true;