Commit Graph
71 Commits
Author SHA1 Message Date
Paul Gilbert 66150ee064 TITANIC: Remove redundant flag clearing in star control 2017-09-10 16:52:13 -04:00
Paul Gilbert c9a92c3c16 TITANIC: Fix locking/unlocking starfield markers multiple times 2017-09-09 19:26:54 -04:00
Paul Gilbert 00b4e509a0 TITANIC: Various whitespace fixes in star control classes 2017-09-09 18:46:10 -04:00
David Fioramonti 93d9ac926c TITANIC: star camera better handler function naming
The functions that dealt with the mover handling only
had handler in the name so I added mover and type to the
name to reflect that it involves the mover handler.
2017-09-07 06:34:03 -07:00
David Fioramonti d3a0a487be TITANIC: star control, removed todos and improved some comments 2017-09-07 06:33:05 -07:00
David Fioramonti 40684e83d3 TITANIC: Better naming for Viewport function
I differentiated getRelativePosCentering() and
getRelativePosCentering2() since one was using
the raw Pose and one was using the regular Pose.
2017-09-07 06:23:01 -07:00
Paul Gilbert ba84efe497 TITANIC: Minor cleanup and warning fixes to star control 2017-09-02 11:20:17 -04:00
David Fioramonti 4e586ba43d TITANIC: Fix star3 locking overshoot, #9961
I fixed this previously for star2, I thought the
overshoot for star3 locking might have also been fixed
since I hadn't observed it in a while.

I applied the same workaround by setting the old position
to be the new position.
2017-09-02 07:41:26 -07:00
David Fioramonti d6ca9eda93 TITANIC: Move Matrix4Inv out of starcamera and into FPose function 2017-09-02 06:41:07 -07:00
David Fioramonti d55406b642 TITANIC: Remove DVector and DAffine files from build and folder 2017-09-02 06:41:07 -07:00
David Fioramonti 1160b88d06 TITANIC: Swap DAffine for FPose in Orientation and Transforms
More swapping of functions in the Orientation and Transform classes.
2017-09-02 06:40:41 -07:00
David Fioramonti b842a43c40 TITANIC: Swap DAffine usage for FPose in setViewportAngle 2017-09-02 06:40:41 -07:00
David Fioramonti 910e221861 TITANIC: Replace DAffine with FPose in Transform and Orientation classes 2017-09-02 06:40:41 -07:00
David Fioramonti fa11ae477f TITANIC: Duplicate DAffine usage in lockMarker2 with FPose usage 2017-09-02 06:40:41 -07:00
David Fioramonti f01115f450 TITANIC: Added DAffine functions that combines several vector operations 2017-09-01 15:42:51 -07:00
David Fioramonti 24c2e3ce4f TITANIC: Replace all external uses of DVector with FVector
Wherever DVector was used outside of DAffine and CMatrixTransform
I replaced with FVectors. So Internally those functions are still
using DVectors.

This required adding some new functions to FVector that duplicated
functionality in DVector.
2017-09-01 04:30:55 -07:00
David Fioramonti 0df15f0b0d TITANIC: Don't allow unlocking stars while locking onto a star
Fixes #10170.

I've added a boolean variable that tracks whether the game is
in the process of locking onto a star or not.

When the user hits the unlock button _isInLockingProcess gets checked and
the request to unlock is denied if the locking on is currently happening.

Once the locking on is finished then the release is lifted and the user
can unlock at this time (or after locking onto the next star).
2017-08-31 19:25:40 -07:00
Paul Gilbert 88782928ff TITANIC: Minor syntactic fixes for Star Control classes 2017-08-31 20:04:28 -04:00
David Fioramonti 4dbfc3595e TITANIC: Fix star lock2/lock3 overshoot, fixes #9961
The problem was that the camera when locking onto the 2nd star
was starting at a bad spot and then overshooting when it moved
to do the locking movements.

A solution I picked is just to start at the final spot.

I also removed the check that the distance the mover had to move
was too large since the bug is now avoided.
2017-08-31 04:10:07 -07:00
David Fioramonti 4c2ac405a5 TITANIC: Star Camera lockMarker2 refactor
Named many variables in the lockMarker2 functions.
2017-08-31 04:10:06 -07:00
David Fioramonti f411da4902 TITANIC: Renamed a dvector func
More correct function naming then before.
2017-08-30 19:53:13 -07:00
David Fioramonti f1e673c133 TITANIC: StarCamera separate function for calculating angle
This makes lockMarker2 more manageable.
2017-08-30 19:53:13 -07:00
David Fioramonti 6a43e8d958 TITANIC: StarCamera work 2017-08-30 19:53:13 -07:00
David Fioramonti 8f479522c4 TITANIC: CCameraMover and related classes Refactor
1. Removed updatePosition function defintions since
UnmarkedCameraMover and MarkedCameraMover, derived classes,
are overriddening it. I.e., CCameraMover::updatePosition doesn't
get used.

This also allowed some header files to removed.

2. Renaming of some functions.
2017-08-30 19:53:13 -07:00
David Fioramonti 5cf2f16ca0 TITANIC: Refactoring of Viewport class
1. Improved naming of functions.
	E.x., fn17 is now called getRelativePosNoCentering
2. Improved variable names
	E.x., _valArray[3] is now _pixel1OffSetX, naming makes sense for it
	use in CBaseStars::draw.
3. Lots of comments and TODO added for suspicious behavior
	Mentioned unused functions and values that don't get used.
4. Changes in other classes that viewport renaming affected
	Some of the star_camera functions were 1-1 mapping of
	functions in viewport so I just made the names be the same.
2017-08-27 05:39:13 -07:00
David Fioramonti c96b01b82e TITANIC: Reduce header includes for titanic.h
I reduced the header includes a lot in Titanic.h and forward
declared when I could. Titanic.h was including a lot and
a lot of functions that were including it were not using its
API. This will help make it more clear which implementation
files are using which class since they will just need to include
which ones they need.

I also moved the debug related items in Titanic.h into the debugger
header.

I also reordered several of the the header includes to be local to
global.
2017-08-24 04:06:54 -07:00
David Fioramonti 04598dd5ad TITANIC: Named some functions in fvector 2017-08-21 15:42:50 -07:00
David Fioramonti 2a96a6fc72 TITANIC: Prevent 2 star locking for large distances
I have added a conditional to the code so that if the player
tries to lock onto the 2nd star and they are very far away, >1e8,
then the game will not allow the star to be locked.

This is a temporary workaround since if a distance of farther
then this is attempted then the view will be throw way off
and the stars will not be shown locking onto correctly.

I've also made the locking functions return booleans so I can
determine the success of the lockings.

This is a partial fix for #9961.
2017-08-20 20:25:31 -07:00
David Fioramonti ffbfdac87e TITANIC: Change ship view and position even if not moved
The code was preventing the position and view from changing
when the distance between the current and new position for
a marked auto mover was zero. This happens if you lock the
2nd or 3rd star and then unlock and relock again.

It was prevented this with asserts and if statement checks
and I removed them all.

This section of code isn't doing any inverses based on the
reciprocal of the distance so theres no issue with allowing
transition speeds/distances of zero.

Fixes #10148.
2017-08-20 13:24:37 -07:00
Paul Gilbert cd9fe5c219 TITANIC: Further camera and crosshair classes cleanup 2017-08-20 14:43:00 -04:00
David Fioramonti 312d63c3c9 TITANIC: Prevent moving for locking stars when onto of star
Originally, if you unlocked a star when you had 2 or 3 stars
locked and then relocked without changing views then the game
crashed.

This was because it was trying to transition a distance of zero
and this failed an assert (to normalize the length to be the distance).
The transition is no longer done so the crash does not happen.

Fixes #10147.
2017-08-19 08:36:02 -07:00
David Fioramonti 24bec379d5 TITANIC: Pull assert out of dvector/fvector normalization
Before the normalization function was asserting if it couldn't
normalize now the caller can determine what to do with a failed
normalization.
2017-08-19 08:36:02 -07:00
David Fioramonti b200317306 TITANIC: Renamed functions that adds/removes stars/markers
Before it was add/remove row so the new name is more informative.
2017-08-18 18:56:12 -07:00
David Fioramonti 1370b49b6a TITANIC: Simplified dependencies for classes related to star_camera
This involved removing header files and forward declaring when possible.
I also reorded the header include files to be local to gloabal.
E.x., in the class implementation the class header file
would be the first included.

This is a first pass of header reduction for star_control/ files
2017-08-18 17:26:05 -07:00
David Fioramonti 524855d173 TITANIC: Change variable for tracking stars marked into enum 2017-08-18 04:54:27 -07:00
David Fioramonti 5ebc972c25 TITANIC: Change fpose Yaxis rotation to be same as wikipedia
Add negatives to star camera turning rotations so view turns correctly
when no stars are marked and 1 star is marked.
2017-08-16 05:13:08 -07:00
Paul Gilbert 9cc1f09f2c TITANIC: Further cleanup of DVector class 2017-08-13 15:22:26 -04:00
David Fioramonti d1f9aa8fe3 TITANIC: dvector work, fn5 renamed to RotXY
It does a rotation around the X axis then Y.
2017-08-12 21:32:07 -07:00
David Fioramonti 18e52ef1ea TITANIC: star control dvector rename fn2 to RotVectAxisY 2017-08-12 18:38:58 -07:00
David Fioramonti a319941436 TITANIC: Star control dvector work, renamed fn1 to DAffMatrixProdVec
It does a matrix product with a vector and a z translation
2017-08-12 18:32:52 -07:00
David Fioramonti c4751fc611 TITANIC: Change Starview slowdown to reverse
This changes the starview manual camera movement using semicolon.
Before it slowed down the ship. To make it more like the original
game it now adds negative velocity so that it slows down then
speeds up in the backward direction.

The functions were renamed accordingly.
2017-08-06 18:05:18 -07:00
Paul Gilbert 906c6de3d1 TITANIC: Fix daffine.h includes 2017-07-12 19:52:25 -04:00
Paul Gilbert 256b27581c TITANIC: Rename DMatrix to DAffine, thanks to wjp 2017-07-12 19:41:05 -04:00
Paul Gilbert dc5645cb11 TITANIC: Change rows to cols in DMatrix, thanks to wjp 2017-07-12 19:20:11 -04:00
Paul Gilbert 46f4047a1d TITANIC: Renamings for camera mover classes 2017-06-07 22:00:22 -04:00
Paul Gilbert 0331fab01b TITANIC: Fix rotating starview when 2 markers are locked in 2017-06-07 21:28:15 -04:00
Paul Gilbert cc5629014e TITANIC: Further fixes for locking marker 2 2017-06-06 20:20:53 -04:00
Paul Gilbert cb3f8f35db TITANIC: Rewrite of lockMarker2 2017-06-05 20:34:11 -04:00
Paul Gilbert 39ffcf7a1b TITANIC: Simplifications in lockMarker2 2017-06-04 20:17:51 -04:00
Paul Gilbert 032cd3f4eb TITANIC: Simplify DVector fn1 2017-06-04 20:17:11 -04:00