diff --git a/README.md b/README.md index 2c69ee6..02596d0 100644 --- a/README.md +++ b/README.md @@ -141,18 +141,18 @@ That will generate the rom at `/build/portal64.z64`
## Current New Feature TODO List -- [ ] Change default controls - [ ] investigate failed portal hole in test chamber 04 -- [ ] increaes collider height - [ ] ball velocity in test chamber 11 - [ ] clear sleeping object physics flag so buttons in savefiles remain pressed after loading - [ ] rumble pak support? - [ ] Investigate crash after falling into death water on test chamber 8 -- [ ] Add particle effects (shooting portal gun, energy pellet) - [ ] Add auto save checkpoints - [ ] Correct elevator timing - [ ] Adding loading notice between levels #45 - [ ] pausing while glados is speaking can end her speech early +- [x] Change default controls +- [x] Add particle effects (shooting portal gun, energy pellet) +- [x] increaes collider height - [x] test chamber 11 is broken - [x] test chamber 4 has an inverted indicator light sign - [x] test chamber 4 door doesnt close diff --git a/src/controls/controller_actions.c b/src/controls/controller_actions.c index 2715267..c7a76d5 100644 --- a/src/controls/controller_actions.c +++ b/src/controls/controller_actions.c @@ -6,20 +6,20 @@ #include "../savefile/savefile.h" unsigned char gDefaultControllerSettings[ControllerActionSourceCount] = { - [ControllerActionSourceAButton] = ControllerActionJump, - [ControllerActionSourceBButton] = ControllerActionUseItem, + [ControllerActionSourceAButton] = ControllerActionOpenPortal1, + [ControllerActionSourceBButton] = ControllerActionOpenPortal0, [ControllerActionSourceCUpButton] = ControllerActionMove, [ControllerActionSourceCRightButton] = ControllerActionNone, [ControllerActionSourceCDownButton] = ControllerActionNone, [ControllerActionSourceCLeftButton] = ControllerActionNone, - [ControllerActionSourceDUpButton] = ControllerActionMove, + [ControllerActionSourceDUpButton] = ControllerActionLookForward, [ControllerActionSourceDRightButton] = ControllerActionNone, - [ControllerActionSourceDDownButton] = ControllerActionNone, + [ControllerActionSourceDDownButton] = ControllerActionLookBackward, [ControllerActionSourceDLeftButton] = ControllerActionNone, [ControllerActionSourceStartButton] = ControllerActionPause, - [ControllerActionSourceLTrig] = ControllerActionOpenPortal1, - [ControllerActionSourceRTrig] = ControllerActionOpenPortal1, - [ControllerActionSourceZTrig] = ControllerActionOpenPortal0, + [ControllerActionSourceLTrig] = ControllerActionDuck, + [ControllerActionSourceRTrig] = ControllerActionJump, + [ControllerActionSourceZTrig] = ControllerActionUseItem, [ControllerActionSourceJoystick] = ControllerActionRotate, }; diff --git a/src/scene/portal_surface_generator.c b/src/scene/portal_surface_generator.c index 1bca893..720a936 100644 --- a/src/scene/portal_surface_generator.c +++ b/src/scene/portal_surface_generator.c @@ -235,23 +235,18 @@ int portalSurfaceFindNextLoop(struct PortalSurfaceBuilder* surfaceBuilder, struc #define MAX_INTERSECT_LOOPS 20 int portalSurfaceIsPointOnLine(struct Vector2s16* pointA, struct Vector2s16* edgeA, struct Vector2s16* edgeDir) { - struct Vector2s16 originOffset; - struct Vector2s16 endpointOffset; - if (edgeDir->equalTest == 0) { return 0; } - vector2s16Add(edgeA, edgeDir, &endpointOffset); - vector2s16Sub(&endpointOffset, pointA, &endpointOffset); - + struct Vector2s16 originOffset; vector2s16Sub(edgeA, pointA, &originOffset); - int crossProduct = vector2s16Cross(&originOffset, &endpointOffset); + int dotProduct = vector2s16Dot(&originOffset, edgeDir); + int crossProduct = vector2s16Cross(&originOffset, edgeDir); int edgeDirLength = vector2s16MagSqr(edgeDir); - s64 angleCheck = (s64)crossProduct * 50LL / (s64)edgeDirLength; - return angleCheck == 0; + return dotProduct >= 0 && dotProduct <= edgeDirLength && abs(crossProduct) * 100 < edgeDirLength; } enum IntersectionType { @@ -658,14 +653,6 @@ struct Vector2s16* portalSurfaceIntersectEdgeWithLoop(struct PortalSurfaceBuilde if (intersectType == IntersectionTypePoint) { int newPointIndex; - if (vector2s16DistSqr(&intersectionPoint, pointA) <= COLLAPSE_DISTANCE * COLLAPSE_DISTANCE) { - intersectionPoint = *pointA; - } - - if (vector2s16DistSqr(&intersectionPoint, pointB) <= COLLAPSE_DISTANCE * COLLAPSE_DISTANCE) { - intersectionPoint = *pointB; - } - if (intersectionPoint.equalTest == edgeA->equalTest) { newPointIndex = edge->pointIndex; currentEdge = portalSurfaceFindCurrentFace(surfaceBuilder, pointA, currentEdge);