[Scummvm-cvs-logs] SF.net SVN: scummvm: [21411] scummvm/trunk/engines/cine
sev at users.sourceforge.net
sev at users.sourceforge.net
Wed Mar 22 19:16:01 CET 2006
Revision: 21411
Author: sev
Date: 2006-03-22 19:15:39 -0800 (Wed, 22 Mar 2006)
ViewCVS: http://svn.sourceforge.net/scummvm/?rev=21411&view=rev
Log Message:
-----------
Make copy protection in OS and FW turnable. Still buggy
Modified Paths:
--------------
scummvm/trunk/engines/cine/cine.cpp
scummvm/trunk/engines/cine/part.cpp
scummvm/trunk/engines/cine/part.h
scummvm/trunk/engines/cine/prc.cpp
Modified: scummvm/trunk/engines/cine/cine.cpp
===================================================================
--- scummvm/trunk/engines/cine/cine.cpp 2006-03-23 03:08:05 UTC (rev 21410)
+++ scummvm/trunk/engines/cine/cine.cpp 2006-03-23 03:15:39 UTC (rev 21411)
@@ -215,7 +215,7 @@
}
// bypass protection
- if (gameType == GID_OS) {
+ if (gameType == GID_OS && !ConfMan.getBool("copy_protection")) {
globalVars[255] = 1;
}
Modified: scummvm/trunk/engines/cine/part.cpp
===================================================================
--- scummvm/trunk/engines/cine/part.cpp 2006-03-23 03:08:05 UTC (rev 21410)
+++ scummvm/trunk/engines/cine/part.cpp 2006-03-23 03:15:39 UTC (rev 21411)
@@ -134,6 +134,7 @@
"RSC16",
"RSC17",
// english version
+#if 1
"SONS1",
"SONS2",
"SONS3",
@@ -143,12 +144,12 @@
"SONS7",
"SONS8",
"SONS9",
-/*
-"SONS31", // french version
-"SONS32",
-"SONS33",
-"SONS34"
-*/
+#else
+ "SONS31", // french version
+ "SONS32",
+ "SONS33",
+ "SONS34"
+#endif
};
int16 findFileInBundle(const char *fileName) {
@@ -209,4 +210,21 @@
return dataPtr;
}
+uint8 *readFile(const char *filename) {
+ Common::File in;
+
+ in.open(filename);
+
+ if (!in.isOpen())
+ error("readFile(): Cannot open file %s", filename);
+
+ uint8 *dataPtr;
+ uint32 size = in.size();
+
+ dataPtr = (uint8 *)malloc(size);
+ in.read(dataPtr, size);
+
+ return dataPtr;
+}
+
} // End of namespace Cine
Modified: scummvm/trunk/engines/cine/part.h
===================================================================
--- scummvm/trunk/engines/cine/part.h 2006-03-23 03:08:05 UTC (rev 21410)
+++ scummvm/trunk/engines/cine/part.h 2006-03-23 03:15:39 UTC (rev 21411)
@@ -69,6 +69,7 @@
void readFromPart(int16 idx, uint8 *dataPtr);
uint8 *readBundleFile(int16 foundFileIdx);
+uint8 *readFile(const char *filename);
} // End of namespace Cine
Modified: scummvm/trunk/engines/cine/prc.cpp
===================================================================
--- scummvm/trunk/engines/cine/prc.cpp 2006-03-23 03:08:05 UTC (rev 21410)
+++ scummvm/trunk/engines/cine/prc.cpp 2006-03-23 03:15:39 UTC (rev 21411)
@@ -26,6 +26,8 @@
#include "cine/auto00.h"
#include "cine/various.h"
+#include "common/config-manager.h"
+
namespace Cine {
prcLinkedListStruct globalScriptsHead;
@@ -74,11 +76,13 @@
checkDataDisk(-1);
if ((gameType == Cine::GID_FW) && (!strcmp(pPrcName, "AUTO00.PRC"))) {
- // bypass protection
- scriptPtr = AUT000;
+ if (!ConfMan.getBool("copy_protection"))
+ scriptPtr = AUT000;
+ else
+ scriptPtr = readFile(pPrcName);
} else {
scriptPtr = readBundleFile(findFileInBundle(pPrcName));
- ASSERT_PTR(scriptPtr);
+ ASSERT_PTR(scriptPtr);
}
setMouseCursor(MOUSE_CURSOR_DISK);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list