PRIVATE: New engine for Private Eye #2771
Conversation
DeepCode's analysis on #6a3f96 found:
Top issues
|
Great work. At this moment, there are a number of issues with logic, memory management and mostly with the code formatting and naming. |
typedef Common::List<Common::String> NameList; | ||
typedef Common::List<Symbol*> ConstantList; | ||
|
||
extern SymbolMap settings, variables, cursors, locations, rects; |
sev-
Feb 13, 2021
Member
extern
is C'ism here. Please remove.
extern
is C'ism here. Please remove.
neuromancer
Feb 14, 2021
Author
Contributor
Removing this extern will cause the compiler to fail for the multiple definition of these variables:
engines/private/symbol.cpp:29:11: error: redefinition of 'Private::SymbolMap Private::settings'
29 | SymbolMap settings, variables, cursors, locations, rects;
| ^~~~~~~~
In file included from ./engines/private/grammar.h:30,
from engines/private/symbol.cpp:24:
./engines/private/symbol.h:55:11: note: 'Private::SymbolMap Private::settings' previously declared here
55 | SymbolMap settings, variables, cursors, locations, rects;
Removing this extern will cause the compiler to fail for the multiple definition of these variables:
engines/private/symbol.cpp:29:11: error: redefinition of 'Private::SymbolMap Private::settings'
29 | SymbolMap settings, variables, cursors, locations, rects;
| ^~~~~~~~
In file included from ./engines/private/grammar.h:30,
from engines/private/symbol.cpp:24:
./engines/private/symbol.h:55:11: note: 'Private::SymbolMap Private::settings' previously declared here
55 | SymbolMap settings, variables, cursors, locations, rects;
sev-
Feb 15, 2021
Member
Just wrap it into a class. Polluting your engine namespace like this is not the best idea.
Just wrap it into a class. Polluting your engine namespace like this is not the best idea.
neuromancer
Feb 17, 2021
Author
Contributor
I think this is done. Please take a look
I think this is done. Please take a look
The commits must conform to our commit guidelines. Put 'PRIVATE:` prefix everywhere except the common code. |
Very good progress. Only a handful of relatively small notes left. |
// structs | ||
|
||
typedef struct ExitInfo { | ||
Common::String *nextSetting; |
sev-
Feb 19, 2021
Member
then you could check if (nextSetting.empty())
then you could check if (nextSetting.empty())
Only three tiny notes and then it is ready for merge. |
* | ||
*/ | ||
|
||
#ifndef COMMON_INSTALLER_ARCHIVE_H |
sev-
Feb 26, 2021
Member
This has to be updated after the file rename.
This has to be updated after the file rename.
_setting = (Setting *)malloc(sizeof(Setting)); | ||
memset((void *)_setting, 0, sizeof(Setting)); | ||
|
||
Gen::g_vm->_prog = (Inst *)&_setting->prog; |
sev-
Feb 26, 2021
Member
You declared using namespace Gen;
. Thus, you could write directly g_vm->_prog = (Inst *)&_setting->prog;
If you cannot, then move the using
inside of namespace Settings, so these namespace specifiers could be dropped.
You declared using namespace Gen;
. Thus, you could write directly g_vm->_prog = (Inst *)&_setting->prog;
If you cannot, then move the using
inside of namespace Settings, so these namespace specifiers could be dropped.
The game is completable but there are a few missing minor features:
Also, I'm still cleaning up the source code, but I believe it can be reviewed
already. I know the commits messages are not following the guidelines, so
please considering squashing them to keep this a single commit.
As expected, the game needs extensive testing and bug fixing,
since the gameplay has a lot different variations and I was not able to
test them all.
This engine only allows to play the US version of the Windows game and
its demo. I wasn't able to test any MacOS version. European versions
should be correctly detected but they are not supported. They require
to add bytecode support to run the same assets files (it shouldn't be
too difficult to implement).