Skip to content

Commit a675b39

Browse files
authored
Merge pull request #26 from smlu/develop
v0.3.1
2 parents 54366c9 + 01639c1 commit a675b39

22 files changed

+99
-93
lines changed

CHANGELOG.md

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
## v0.3.1
2+
### General:
3+
- Fixed radius of fading plate 3DO models (5d705fb)
4+
- Codebase update and cleanup (bf2c4f7)
5+
- Fixed bug calculating time delta when path move thing is blocked (f361b65)
6+
This fixes the bug where another thing object blocks the path of path moving objects, causing them to continue moving indefinitely as long as the path is blocked.
7+
e.g.: pressed button moves out of socket if player blocks its path when the button moves to initial position.
8+
- Fixed incorrect usage of enum flags (918bcee)
9+
- Added define guard for `STRICT` macro to prevent redefinition warnings (1b0e597)
10+
- Fixed incorrect enumerator names enum `SithCollisionType` (f2cbab2)
11+
112
## v0.3
213
### General:
314
- Fixed various bugs
@@ -13,17 +24,18 @@
1324
- Added developer COG verbs (33f8f9d)
1425
- Added error log when popping invalid string from COG stack (34c9e20)
1526
- Rename debug mode flag `SITHDEBUG_AILOOK_FOR_TARGET_DISABLED` to `SITHDEBUG_AINOTARGET` (53b9091)
16-
- Changed argument order of debug print COG functions (a80ed30)
27+
- Changed argument order of debug print COG functions (a80ed30)
1728
Also changed the log level to debug.
1829
- Added programs `yacc` & `flex` (d6f5be6 + b669ca8)
1930
- Fixed yacc initial line number at the start of code parsing. (232f268)
2031
This fixes line number in log when error is encountered.
21-
- Fixed bug in multiple COG thing functions (`sithCogFunctionThing` module) where a return value was not pushed to the execution stack on error. (e9d4167)
32+
- Fixed bug in multiple COG thing functions (`sithCogFunctionThing` module) where a return value
33+
was not pushed to the execution stack on error. (e9d4167)
2234
This fixes corruption of the COG's execution stack when an error occurs.
2335
- Added new `rdVector` arithmetic functions (c4c8ee5)
2436
- Fix null pointer dereference && infinitive loop in `sithAnimate_BuildScrollFaceRotate`, `sithAnimate_PushItem`, `sithAnimate_PullItem`, `sithAnimate_UpdatePushItemAnim` and `sithAnimate_UpdatePullItemAnim` (70cf7bf)
2537
- Fixed handling division by zero in `sithAnimate_StartSpriteSizeAnim` & `sithAnimate_StartThingMoveAnim` (f5dc718)
26-
- Altered the AnimateSpriteSize COG function to return -1 when deltaTime is 0. (039a227)
38+
- Altered the `AnimateSpriteSize` COG function to return -1 when deltaTime is 0. (039a227)
2739
This change prevents unnecessary animation creation, thereby saving animation slots.
2840
The function now returns -1 to the script when the sprite size is set instantly but no animation is created,
2941
whereas previously, -1 was returned only on animation creation errors.
@@ -117,7 +129,7 @@
117129

118130
### Display & Render:
119131
- Added support for display resolutions higher than 2048-pixel (6f9db7e)
120-
- Fixed bug rendering ceiling sky (6f9db7e)
132+
- Fixed bug rendering ceiling sky (2a200d5)
121133
- Fixed thumbnail rendering in save game dialog (c7bb134)
122134
- Fixed thumbnail rendering in exit dialog (b64fb63)
123135
- Increased size of game save/load dialogs (ce321bb)

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
cmake_minimum_required(VERSION 3.15)
22

3-
project(OpenJones3D VERSION 0.3.0)
3+
project(OpenJones3D VERSION 0.3.1)
44

55
set(CMAKE_C_STANDARD 11)
66
set(CMAKE_C_STANDARD_REQUIRED ON)

Jones3D/Display/jonesConfig.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3814,8 +3814,7 @@ UINT_PTR CALLBACK jonesConfig_SaveGameDialogHookProc(HWND hDlg, UINT uMsg, WPARA
38143814
bValidFile = false;
38153815
}
38163816

3817-
// TODO: Replace const 17 with macro or with some STD_ARRAYLEN(aLevels)
3818-
for ( size_t levelNum = 0; levelNum < 17u; ++levelNum )
3817+
for ( size_t levelNum = 0; levelNum < JONESLEVEL_BONUSLEVELNUM; ++levelNum )
38193818
{
38203819
const char* pSaveName = sithGetLevelSaveFilename(levelNum);
38213820
if ( pSaveName )

Libs/j3dcore/j3d.h.in

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@
3030
# ifndef NDEBUG
3131
# define J3D_DEBUG 1
3232
# endif
33-
# define STRICT
33+
# ifndef STRICT
34+
# define STRICT
35+
# endif
3436
# define WIN32_LEAN_AND_MEAN
3537
# include <Windows.h>
3638
# define strcmpi _strcmpi

Libs/sith/Engine/sithAnimate.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1867,7 +1867,7 @@ SithSurface* J3DAPI sithAnimate_GetThingFloorSurface(const SithThing* pThing)
18671867
break;
18681868
}
18691869

1870-
if ( (pCollision->type & SITHCOLLISION_ADJOINCROSS) != 0 )
1870+
if ( (pCollision->type & SITHCOLLISION_WORLD) != 0 )
18711871
{
18721872
SithSurface* pSurfaceCollided = pCollision->pSurfaceCollided;
18731873
sithCollision_DecreaseStackLevel();
@@ -1907,7 +1907,7 @@ void J3DAPI sithAnimate_FindAndEnterFloorSurface(const SithThing* pThing, const
19071907
break;
19081908
}
19091909

1910-
if ( (pCollision->type & SITHCOLLISION_ADJOINCROSS) != 0 )
1910+
if ( (pCollision->type & SITHCOLLISION_WORLD) != 0 )
19111911
{
19121912
pSurfaceCollided = pCollision->pSurfaceCollided;
19131913
if ( pSurfaceCollided != pPrevSurf )

Libs/sith/Engine/sithCamera.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -896,7 +896,6 @@ void J3DAPI sithCamera_Update(SithCamera* pCamera)
896896
{
897897
if ( pThing1->moveStatus == SITHPLAYERMOVE_SWIMIDLE && (pThing1->moveInfo.physics.flags & SITH_PF_ONWATERSURFACE) != 0 )
898898
{
899-
LABEL_74:
900899
memcpy(&pCamera->offset, &sithCamera_vecCameraOffsetClimbDown, sizeof(pCamera->offset));
901900
goto LABEL_76;
902901
}

Libs/sith/Engine/sithCollision.c

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ SithSector* J3DAPI sithCollision_FindWaterSector(SithSector* pStartSector, rdVec
352352
break;
353353
}
354354

355-
if ( (pCollision->type & (SITHCOLLISION_WORLD | SITHCOLLISION_ADJOINTOUCH)) != 0
355+
if ( (pCollision->type & (SITHCOLLISION_ADJOINCROSS | SITHCOLLISION_ADJOINTOUCH)) != 0
356356
&& (pCollision->pSurfaceCollided->flags & SITH_SURFACE_WATER) != 0
357357
&& (pCollision->pSurfaceCollided->pAdjoin->pAdjoinSector->flags & SITH_SECTOR_UNDERWATER) != 0 )
358358
{
@@ -481,7 +481,7 @@ int J3DAPI sithCollision_HasLOS(const SithThing* pViewer, const SithThing* pTarg
481481
}
482482
}
483483

484-
else if ( (pCollision->type & SITHCOLLISION_ADJOINTOUCH) == 0 || (pCollision->pSurfaceCollided->pAdjoin->flags & SITHCOLLISION_ADJOINCROSS) == 0 )
484+
else if ( (pCollision->type & SITHCOLLISION_ADJOINTOUCH) == 0 || (pCollision->pSurfaceCollided->pAdjoin->flags & SITH_ADJOIN_MOVE) == 0 )
485485
{
486486
bLos = 0;
487487
break;
@@ -1069,7 +1069,7 @@ float J3DAPI sithCollision_SearchForCollisions(SithSector* pStartSector, SithThi
10691069
pCollision = sithCollision_aCollisions[stackLevel];
10701070
while ( collNum < sithCollision_aNumStackCollisions[stackLevel] )
10711071
{
1072-
if ( pCollision->type == SITHCOLLISION_WORLD )
1072+
if ( pCollision->type == SITHCOLLISION_ADJOINCROSS )
10731073
{
10741074
pAdjoin = pCollision->pSurfaceCollided->pAdjoin;
10751075
SITH_ASSERTREL(pAdjoin);
@@ -1229,7 +1229,7 @@ void J3DAPI sithCollision_SearchForSurfaceCollisions(const SithSector* pSector,
12291229
{
12301230
if ( ((colflags & 4) == 0 || (colflags & 1) == 0) && !sithCollision_CheckSectorSearched(pAdjoin->pAdjoinSector) )
12311231
{
1232-
sithCollision_PushSurfaceCollision(pCurSurf, pHitDist, SITHCOLLISION_WORLD, 0);
1232+
sithCollision_PushSurfaceCollision(pCurSurf, pHitDist, SITHCOLLISION_ADJOINCROSS, NULL);
12331233
}
12341234

12351235
if ( (colflags & 2) == 0
@@ -1245,10 +1245,10 @@ void J3DAPI sithCollision_SearchForSurfaceCollisions(const SithSector* pSector,
12451245
{
12461246
if ( (colflags & 4) != 0 && (colflags & 1) != 0 && !sithCollision_CheckSectorSearched(pAdjoin->pAdjoinSector) )
12471247
{
1248-
sithCollision_PushSurfaceCollision(pCurSurf, pHitDist, SITHCOLLISION_WORLD, 0);
1248+
sithCollision_PushSurfaceCollision(pCurSurf, pHitDist, SITHCOLLISION_ADJOINCROSS, NULL);
12491249
}
12501250

1251-
sithCollision_PushSurfaceCollision(pCurSurf, distance, SITHCOLLISION_ADJOINTOUCH, 0);
1251+
sithCollision_PushSurfaceCollision(pCurSurf, distance, SITHCOLLISION_ADJOINTOUCH, NULL);
12521252
}
12531253
}
12541254
}
@@ -1273,7 +1273,7 @@ void J3DAPI sithCollision_SearchForSurfaceCollisions(const SithSector* pSector,
12731273
{
12741274
if ( (colflags & 0x400) != 0 || rdVector_Dot3(moveNorm, &hitNorm) < 0.0f )
12751275
{
1276-
sithCollision_PushSurfaceCollision(pCurSurf, pHitDist, (SithCollisionType)(hitType | SITHCOLLISION_ADJOINCROSS), &hitNorm);
1276+
sithCollision_PushSurfaceCollision(pCurSurf, pHitDist, (SithCollisionType)(hitType | SITHCOLLISION_WORLD), &hitNorm);
12771277
}
12781278
}
12791279
}
@@ -2460,18 +2460,18 @@ void J3DAPI sithCollision_PushSurfaceCollision(SithSurface* pSurf, float distanc
24602460
{
24612461
SithCollision* pCollision;
24622462

2463-
SITH_ASSERTREL(((hitType) & (SITHCOLLISION_WORLD | SITHCOLLISION_ADJOINTOUCH | SITHCOLLISION_ADJOINCROSS)));
2463+
SITH_ASSERTREL(((hitType) & (SITHCOLLISION_ADJOINCROSS | SITHCOLLISION_ADJOINTOUCH | SITHCOLLISION_WORLD)));
24642464
if ( sithCollision_aNumStackCollisions[stackLevel] == STD_ARRAYLEN(sithCollision_aCollisions[stackLevel]) )
24652465
{
24662466
SITHLOG_ERROR("Found too many collisions in collision system.\n");
24672467
return;
24682468
}
24692469

24702470
pCollision = &sithCollision_aCollisions[stackLevel][sithCollision_aNumStackCollisions[stackLevel]++];
2471-
pCollision->pThingCollided = NULL;
2472-
pCollision->bEnumerated = 0;
2473-
pCollision->type = hitType;
2474-
pCollision->distance = distance;
2471+
pCollision->pThingCollided = NULL;
2472+
pCollision->bEnumerated = 0;
2473+
pCollision->type = hitType;
2474+
pCollision->distance = distance;
24752475
pCollision->pSurfaceCollided = pSurf;
24762476
if ( pHitNorm )
24772477
{
@@ -2612,7 +2612,7 @@ float J3DAPI sithCollision_CheckDistance(SithThing* pThing, const rdVector3* mov
26122612
break;
26132613
}
26142614

2615-
if ( (pCollision->type & SITHCOLLISION_ADJOINCROSS) != 0 )
2615+
if ( (pCollision->type & SITHCOLLISION_WORLD) != 0 )
26162616
{
26172617
SITH_ASSERTREL(pCollision->pThingCollided == NULL);
26182618
SITH_ASSERTREL(pCollision->pSurfaceCollided != NULL);

Libs/sith/Engine/sithPathMove.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -561,11 +561,14 @@ void J3DAPI sithPathMove_UpdateMove(SithThing* pThing, float simTime)
561561
float movedDist = sithCollision_MoveThing(pThing, &pPath->vecDeltaPos, moveDist, 0x44);
562562
if ( movedDist < moveDist )
563563
{
564-
timeDelta = 0.0f;
565564
if ( stdMath_ClipNearZero(movedDist) > 0.0f )
566565
{
567566
timeDelta = movedDist / moveDist * timeDelta;
568567
}
568+
else
569+
{
570+
timeDelta = 0.0f;
571+
}
569572

570573
++pPath->numBlockedMoves;
571574
}

Libs/sith/Engine/sithPuppet.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1830,7 +1830,7 @@ void J3DAPI sithPuppet_StopForceMove(SithThing* pThing, int bStopTracks)
18301830
{
18311831
break;
18321832
}
1833-
if ( (pCollision->type & SITHCOLLISION_ADJOINCROSS) != 0 )
1833+
if ( (pCollision->type & SITHCOLLISION_WORLD) != 0 )
18341834
{
18351835
if ( (pCollision->pSurfaceCollided->flags & SITH_SURFACE_LAVA) == 0 )
18361836
{
@@ -2178,7 +2178,7 @@ void J3DAPI sithPuppet_DefaultCallback(SithThing* pThing, int track, rdKeyMarker
21782178
{
21792179
if ( pThing->renderData.pPuppet->aTracks[track].playSpeed >= 0.5f && pThing->pSoundClass )
21802180
{
2181-
if ( pThing->pInSector && (pThing->pInSector->flags & SITH_TF_REMOTE) != 0 )
2181+
if ( pThing->pInSector && (pThing->pInSector->flags & SITH_SECTOR_AETHERIUM) != 0 )
21822182
{
21832183
sithSoundClass_PlayModeRandom(pThing, SITHSOUNDCLASS_LSWIMAET);
21842184
}

Libs/sith/Engine/sithRender.c

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1139,13 +1139,7 @@ int J3DAPI sithRender_RenderThing(SithThing* pThing)
11391139
sithRender_pExtraThingRenderFunc(pThing);
11401140
}
11411141

1142-
if ( pThing->type != SITH_THING_EXPLOSION )
1143-
{
1144-
1145-
return drawResult;
1146-
}
1147-
1148-
if ( (pThing->thingInfo.actorInfo.flags & SITH_AF_DROID) == 0 )
1142+
if ( pThing->type != SITH_THING_EXPLOSION || (pThing->thingInfo.explosionInfo.flags & SITH_EF_BLINDPLAYER) == 0 )
11491143
{
11501144
return drawResult;
11511145
}
@@ -1154,7 +1148,7 @@ int J3DAPI sithRender_RenderThing(SithThing* pThing)
11541148
// In JKDF2 (OpenJKDF2), here is section of code that adds light flashing effect to player view
11551149
stdMath_Dist3D1(pThing->transformedPos.x, pThing->transformedPos.y, pThing->transformedPos.z);
11561150

1157-
pThing->thingInfo.actorInfo.flags &= ~SITH_EF_BLINDPLAYER;// 0x100 - SITH_EF_BLINDPLAYER
1151+
pThing->thingInfo.explosionInfo.flags &= ~SITH_EF_BLINDPLAYER;// 0x100 - SITH_EF_BLINDPLAYER
11581152
return drawResult;
11591153
}
11601154

0 commit comments

Comments
 (0)