[Scummvm-git-logs] scummvm master -> 1adc1ed576386737f8f2d7ff6c8a98a853f6b9dd
mgerhardy
noreply at scummvm.org
Thu Oct 17 13:42:07 UTC 2024
This automated email contains information about 6 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
76c9777994 TWINE: fixed typo
6839956b58 TWINE: added original function names as comments
e5c54ccfc2 TWINE: renamed members to match original sources (grid related)
219ba171e2 TWINE: check against zoneGrm in CheckZoneSce - found in original sources
ac12c15050 TWINE: renamed method to match original sources (createCellingGridColumn)
1adc1ed576 TWINE: improved center actor debug command to place the actor correctly on higher levels
Commit: 76c9777994ff3b6a2ff6cb1bca9c8a99e368d239
https://github.com/scummvm/scummvm/commit/76c9777994ff3b6a2ff6cb1bca9c8a99e368d239
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2024-10-17T15:41:44+02:00
Commit Message:
TWINE: fixed typo
Changed paths:
engines/twine/scene/actor.h
diff --git a/engines/twine/scene/actor.h b/engines/twine/scene/actor.h
index 199708f6fd3..016b4aedcfb 100644
--- a/engines/twine/scene/actor.h
+++ b/engines/twine/scene/actor.h
@@ -138,7 +138,7 @@ struct BonusParameter {
/**
* Actors structure
*
- * Such as characters, doors, moving plataforms, invisible actors, ...
+ * Such as characters, doors, moving platforms, invisible actors, ...
*/
class ActorStruct { // T_OBJET
private:
@@ -368,7 +368,7 @@ public:
void hitObj(int32 actorIdx, int32 actorIdxAttacked, int32 strengthOfHit, int32 angle);
/** Process actor carrier */
- void checkCarrier(int32 actorIdx); // CheckCarrier
+ void checkCarrier(int32 actorIdx);
/** Process actor extra bonus */
void giveExtraBonus(int32 actorIdx);
Commit: 6839956b5850d2048d8d657b27749d6effbc5a03
https://github.com/scummvm/scummvm/commit/6839956b5850d2048d8d657b27749d6effbc5a03
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2024-10-17T15:41:44+02:00
Commit Message:
TWINE: added original function names as comments
Changed paths:
engines/twine/scene/scene.h
diff --git a/engines/twine/scene/scene.h b/engines/twine/scene/scene.h
index 24b8db04096..13bddf574a0 100644
--- a/engines/twine/scene/scene.h
+++ b/engines/twine/scene/scene.h
@@ -142,8 +142,8 @@ private:
int16 _sampleRound[4]{0};
int16 _sampleFrequency[4]{0}; // lba2
int16 _sampleVolume[4]{0}; // lba2
- int16 _sampleMinDelay = 0;
- int16 _sampleMinDelayRnd = 0;
+ int16 _sampleMinDelay = 0; // SecondMin
+ int16 _sampleMinDelayRnd = 0; // SecondEcart
int16 _samplePlayed = 0;
@@ -229,7 +229,7 @@ public:
bool loadSceneCubeXY(int sceneNum, int32 *cubeX, int32 *cubeY);
/** Process scene environment sound */
- void processEnvironmentSound();
+ void processEnvironmentSound(); // GereAmbiance
void initSceneVars();
bool isGameRunning() const;
Commit: e5c54ccfc2bf0fc8417ab6f03e7f5250a5a8c371
https://github.com/scummvm/scummvm/commit/e5c54ccfc2bf0fc8417ab6f03e7f5250a5a8c371
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2024-10-17T15:41:44+02:00
Commit Message:
TWINE: renamed members to match original sources (grid related)
Changed paths:
engines/twine/renderer/redraw.cpp
engines/twine/scene/grid.h
engines/twine/scene/scene.cpp
engines/twine/script/script_life.cpp
diff --git a/engines/twine/renderer/redraw.cpp b/engines/twine/renderer/redraw.cpp
index 0bcb6d55ba5..8c617f4b4e1 100644
--- a/engines/twine/renderer/redraw.cpp
+++ b/engines/twine/renderer/redraw.cpp
@@ -248,7 +248,7 @@ int32 Redraw::fillActorDrawingList(DrawListStruct *drawList, bool flagflip) {
actor->_workFlags.bWasDrawn = 0; // reset visible state
actor->_workFlags.bIsTargetable = 0;
- if (_engine->_grid->_useCellingGrid != -1 && actor->_posObj.y > _engine->_scene->_sceneZones[_engine->_grid->_cellingGridIdx].maxs.y) {
+ if (_engine->_grid->_zoneGrm != -1 && actor->_posObj.y > _engine->_scene->_sceneZones[_engine->_grid->_indexGrm].maxs.y) {
continue;
}
// no redraw required
diff --git a/engines/twine/scene/grid.h b/engines/twine/scene/grid.h
index 7e60f8e4fc8..39276f9f610 100644
--- a/engines/twine/scene/grid.h
+++ b/engines/twine/scene/grid.h
@@ -200,9 +200,9 @@ public:
IVec3 _worldCube; // WorldXCube WorldYCube
/** Flag to know if the engine is using celling grids */
- int16 _useCellingGrid = 0;
+ int16 _zoneGrm = 0;
/** Current celling grid index */
- int16 _cellingGridIdx = 0;
+ int16 _indexGrm = 0;
/**
* Draw 3D actor over bricks
diff --git a/engines/twine/scene/scene.cpp b/engines/twine/scene/scene.cpp
index 9e23e55745f..a713d43c055 100644
--- a/engines/twine/scene/scene.cpp
+++ b/engines/twine/scene/scene.cpp
@@ -651,8 +651,8 @@ void Scene::changeCube() {
_engine->_gameState->_nbLittleKeys = 0;
_engine->_gameState->_magicBall = -1;
_engine->_movements->_lastJoyFlag = true;
- _engine->_grid->_useCellingGrid = -1;
- _engine->_grid->_cellingGridIdx = -1;
+ _engine->_grid->_zoneGrm = -1;
+ _engine->_grid->_indexGrm = -1;
_engine->_redraw->_firstTime = true;
_engine->_cameraZone = false;
_newCube = SCENE_CEILING_GRID_FADE_1;
@@ -781,7 +781,7 @@ void Scene::checkZoneSce(int32 actorIdx) {
int32 currentZ = actor->_posObj.z;
actor->_zoneSce = -1;
- bool tmpCellingGrid = false;
+ bool flaggrm = false;
if (IS_HERO(actorIdx)) {
_flagClimbing = false;
@@ -822,16 +822,16 @@ void Scene::checkZoneSce(int32 actorIdx) {
break;
case ZoneType::kGrid:
if (_numObjFollow == actorIdx) {
- tmpCellingGrid = true;
- if (_engine->_grid->_useCellingGrid != zone->num) {
+ flaggrm = true;
+ if (_engine->_grid->_zoneGrm != zone->num) {
if (zone->num != -1) {
_engine->_grid->copyMapToCube();
}
- _engine->_grid->_useCellingGrid = zone->num;
- _engine->_grid->_cellingGridIdx = z;
+ _engine->_grid->_zoneGrm = zone->num;
+ _engine->_grid->_indexGrm = z;
_engine->saveTimer(false);
- _engine->_grid->initCellingGrid(_engine->_grid->_useCellingGrid);
+ _engine->_grid->initCellingGrid(_engine->_grid->_zoneGrm);
_engine->restoreTimer();
}
}
@@ -875,9 +875,9 @@ void Scene::checkZoneSce(int32 actorIdx) {
}
}
- if (!tmpCellingGrid && actorIdx == _numObjFollow && _engine->_grid->_useCellingGrid != -1) {
- _engine->_grid->_useCellingGrid = -1;
- _engine->_grid->_cellingGridIdx = -1;
+ if (!flaggrm && actorIdx == _numObjFollow && _engine->_grid->_zoneGrm != -1) {
+ _engine->_grid->_zoneGrm = -1;
+ _engine->_grid->_indexGrm = -1;
_engine->_grid->copyMapToCube();
_engine->_redraw->_firstTime = true;
}
diff --git a/engines/twine/script/script_life.cpp b/engines/twine/script/script_life.cpp
index 8fb85742147..69d073095cb 100644
--- a/engines/twine/script/script_life.cpp
+++ b/engines/twine/script/script_life.cpp
@@ -1691,9 +1691,9 @@ int32 ScriptLife::lSUB_FUEL(TwinEEngine *engine, LifeScriptContext &ctx) {
* @note Opcode @c 0x4C
*/
int32 ScriptLife::lSET_GRM(TwinEEngine *engine, LifeScriptContext &ctx) {
- engine->_grid->_cellingGridIdx = ctx.stream.readByte();
- debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::SET_GRM(%i)", (int)engine->_grid->_cellingGridIdx);
- engine->_grid->initCellingGrid(engine->_grid->_cellingGridIdx);
+ engine->_grid->_indexGrm = ctx.stream.readByte();
+ debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::SET_GRM(%i)", (int)engine->_grid->_indexGrm);
+ engine->_grid->initCellingGrid(engine->_grid->_indexGrm);
return 0;
}
@@ -1760,9 +1760,9 @@ int32 ScriptLife::lBETA(TwinEEngine *engine, LifeScriptContext &ctx) {
*/
int32 ScriptLife::lGRM_OFF(TwinEEngine *engine, LifeScriptContext &ctx) {
debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::GRM_OFF()");
- if (engine->_grid->_cellingGridIdx != -1) {
- engine->_grid->_useCellingGrid = -1;
- engine->_grid->_cellingGridIdx = -1;
+ if (engine->_grid->_indexGrm != -1) {
+ engine->_grid->_zoneGrm = -1;
+ engine->_grid->_indexGrm = -1;
engine->_grid->copyMapToCube();
engine->_redraw->drawScene(true);
}
Commit: 219ba171e2988d165ed499d0b0ef2026c32a1c16
https://github.com/scummvm/scummvm/commit/219ba171e2988d165ed499d0b0ef2026c32a1c16
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2024-10-17T15:41:44+02:00
Commit Message:
TWINE: check against zoneGrm in CheckZoneSce - found in original sources
Changed paths:
engines/twine/scene/scene.cpp
diff --git a/engines/twine/scene/scene.cpp b/engines/twine/scene/scene.cpp
index a713d43c055..731c8d6b939 100644
--- a/engines/twine/scene/scene.cpp
+++ b/engines/twine/scene/scene.cpp
@@ -824,7 +824,7 @@ void Scene::checkZoneSce(int32 actorIdx) {
if (_numObjFollow == actorIdx) {
flaggrm = true;
if (_engine->_grid->_zoneGrm != zone->num) {
- if (zone->num != -1) {
+ if (_engine->_grid->_zoneGrm != -1) {
_engine->_grid->copyMapToCube();
}
Commit: ac12c15050113566bb8f421e128999d10e2b0645
https://github.com/scummvm/scummvm/commit/ac12c15050113566bb8f421e128999d10e2b0645
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2024-10-17T15:41:44+02:00
Commit Message:
TWINE: renamed method to match original sources (createCellingGridColumn)
Changed paths:
engines/twine/scene/grid.cpp
engines/twine/scene/grid.h
diff --git a/engines/twine/scene/grid.cpp b/engines/twine/scene/grid.cpp
index d04c1cea3c0..d97ed856778 100644
--- a/engines/twine/scene/grid.cpp
+++ b/engines/twine/scene/grid.cpp
@@ -364,7 +364,7 @@ void Grid::decompColumn(const uint8 *gridEntry, uint32 gridEntrySize, uint8 *des
} while (--brickCount);
}
-void Grid::createCellingGridColumn(const uint8 *gridEntry, uint32 gridEntrySize, uint8 *dest, uint32 destSize) {
+void Grid::calcGraphMsk(const uint8 *gridEntry, uint32 gridEntrySize, uint8 *dest, uint32 destSize) {
Common::MemoryReadStream stream(gridEntry, gridEntrySize);
Common::SeekableMemoryWriteStream outstream(dest, destSize);
int32 brickCount = stream.readByte();
@@ -417,7 +417,7 @@ void Grid::createCellingGridMap(const uint8 *gridPtr, int32 gridPtrSize) { // Mi
for (int32 x = 0; x < SIZE_CUBE_X; x++) {
const int gridOffset = READ_LE_UINT16(tempGridPtr);
tempGridPtr += 2;
- createCellingGridColumn(gridPtr + gridOffset, gridPtrSize - gridOffset, _bufCube + blockOffset, _blockBufferSize - blockOffset);
+ calcGraphMsk(gridPtr + gridOffset, gridPtrSize - gridOffset, _bufCube + blockOffset, _blockBufferSize - blockOffset);
blockOffset += 2 * SIZE_CUBE_Y;
}
currGridOffset += SIZE_CUBE_X + SIZE_CUBE_Z;
diff --git a/engines/twine/scene/grid.h b/engines/twine/scene/grid.h
index 39276f9f610..c7ba10669d0 100644
--- a/engines/twine/scene/grid.h
+++ b/engines/twine/scene/grid.h
@@ -122,7 +122,7 @@ private:
* @param gridEntry current grid index
* @param dest destination block buffer
*/
- void createCellingGridColumn(const uint8 *gridEntry, uint32 gridEntrySize, uint8 *dest, uint32 destSize);
+ void calcGraphMsk(const uint8 *gridEntry, uint32 gridEntrySize, uint8 *dest, uint32 destSize);
/**
* Create grid Y column in block buffer
* @param gridEntry current grid index
Commit: 1adc1ed576386737f8f2d7ff6c8a98a853f6b9dd
https://github.com/scummvm/scummvm/commit/1adc1ed576386737f8f2d7ff6c8a98a853f6b9dd
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2024-10-17T15:41:44+02:00
Commit Message:
TWINE: improved center actor debug command to place the actor correctly on higher levels
Changed paths:
engines/twine/debugger/debugtools.cpp
diff --git a/engines/twine/debugger/debugtools.cpp b/engines/twine/debugger/debugtools.cpp
index 230495c392f..7f4be59ac7b 100644
--- a/engines/twine/debugger/debugtools.cpp
+++ b/engines/twine/debugger/debugtools.cpp
@@ -824,7 +824,12 @@ static void debuggerMenu(TwinEEngine *engine) {
if (ImGui::MenuItem("Center actor")) {
ActorStruct *actor = engine->_scene->getActor(OWN_ACTOR_SCENE_INDEX);
actor->_posObj = engine->_grid->_worldCube;
- actor->_posObj.y += 1000;
+ actor->_posObj.y += 16 * SIZE_BRICK_Y;
+ int32 y = actor->_posObj.y - 1 - SIZE_BRICK_Y;
+ while (y > 0 && ShapeType::kNone == engine->_grid->worldColBrick(actor->_posObj.x, y, actor->_posObj.z)) {
+ y -= SIZE_BRICK_Y;
+ }
+ actor->_posObj.y = (y + SIZE_BRICK_Y) & ~(SIZE_BRICK_Y - 1);
}
if (ImGui::BeginMenu("Animations")) {
More information about the Scummvm-git-logs
mailing list