Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Red Comrades Engine #1823

Merged
merged 153 commits into from May 16, 2020
Merged

Red Comrades Engine #1823

merged 153 commits into from May 16, 2020

Conversation

@whiterandrek
Copy link
Member

whiterandrek commented Aug 25, 2019

This PR adds support for the Red Comrades 1, Red Comrades 2 and Red Comrades Demo by S.K.I.F
The demo is fully supported.
The other games can run, but are unplayable due to a lot of bugs.

The engine misses walking system implementation. This is the main reason why the engine is bugged.

I'm not sure if it should be merged in current state.
Looking forward to your suggestions.

@whiterandrek whiterandrek force-pushed the whiterandrek:petka branch 4 times, most recently from 072c254 to d0551ad Aug 25, 2019
op = (*_ip >> 24);
} while (op != 2);
unk = 1;
goto label;

This comment has been minimized.

Copy link
@bluegr

bluegr Aug 31, 2019

Member

This resets unk to 1, like in the beginning of the function. So here you can just call sub40B670(arg) instead of using goto

_bgs[i].attachedObjIds.resize(stream->readUint32LE());
for (uint j = 0; j < _bgs[i].attachedObjIds.size(); ++j) {
_bgs[i].attachedObjIds[j] = stream->readUint16LE();
QMessageObject *obj = g_vm->getQSystem()->findObject(_bgs[i].attachedObjIds[j]);

This comment has been minimized.

Copy link
@bluegr

bluegr Aug 31, 2019

Member

You are using g_vm->getQSystem() a lot in this class. You could store a pointer to it in a class variable instead


void SoundMgr::removeSoundsWithType(Audio::Mixer::SoundType type) {
SoundsMap::iterator it;
for (it = _sounds.begin(); it != _sounds.end(); ++it) {

This comment has been minimized.

Copy link
@winterheart

winterheart Dec 11, 2019

this should be rewrote into

for (it = _sounds.begin(); it != _sounds.end();) {
  Sound *s = it->_value.get();
  if (s->type() == type && !s->isPlaying()) {
    it = _sounds.erase(it);
  } else {
    it++;
  }
}

or else whole cycle run into SIGSERV on deleted iterator value

@Thunderforge
Copy link
Contributor

Thunderforge commented Apr 6, 2020

I think something went wrong with this PR (a failed rebase?). There are currently 5,807 commits, and many of them don't have anything to do with this engine. Can that get resolved?

@sev-
Copy link
Member

sev- commented May 9, 2020

The last push is all wrong. You have to rebase it. You got a bunch of irrelevant commits in there.

@sev- sev- force-pushed the whiterandrek:petka branch 2 times, most recently from 4044831 to 82398e5 May 9, 2020
@whiterandrek whiterandrek force-pushed the whiterandrek:petka branch from 3a34f25 to ae02b20 May 14, 2020
@sev- sev- changed the title Red Comrades Engine - DO NOT MERGE Red Comrades Engine May 16, 2020
@sev- sev- merged commit 158a18b into scummvm:master May 16, 2020
2 checks passed
2 checks passed
Codacy/PR Quality Review Up to standards. A positive pull request.
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

6 participants
You can’t perform that action at this time.