Commit Graph

581 Commits

Author SHA1 Message Date
Steve Checkoway a5b9861532 Encapsulate extra stage logic. The condition of HasEarnedExtraStage() remains true (if it was earned) after the call to FinishStage() until the next BeginStage().
I still don't completely like this because after FinishStage(), if an extra stage has been earned, it is immediately in that stage which is sort of strange for SEval. Even worse, if an extra stage was earned in the past but not for the current stage, then the stage doesn't change. (E.g., earn extra stage but not second extra stage, or earn second extra stage.) So once an extra stage has been earned, SEval will be called twice for the same stage. A per-player  m_iExtraStagesPlayed could be added to fix this, but it doesn't seem worth it.
2007-08-11 20:43:01 +00:00
Glenn Maynard 7f08da77f1 set all lights modes in metrics (except for a couple programmatic ones
for now)
2007-06-14 13:38:26 +00:00
Glenn Maynard 6c9c99091f m_vpPlayedSteps is identical to the beginning of m_vpPossibleSteps.
Change to m_iStepsPlayed to avoid the duplicate information.
2007-05-31 04:48:42 +00:00
Glenn Maynard d631d33a65 remove old scroll effect 2007-05-03 21:35:30 +00:00
Glenn Maynard 37153327bb scope 2007-04-29 03:44:17 +00:00
Glenn Maynard 6494893afb fix ScreenTestMode 2007-04-25 23:12:44 +00:00
Glenn Maynard 713c95b2b0 Stage refactoring:
- m_iPlayerCurrentStageIndexForCurrentCredit is changed to m_iPlayerStageTokens,
   counting the number of stages left.  This can be incremented and decremented
   (as a bonus or penalty) with no weird side-effects; it is not used to determine
   whether the player is on an extra stage.  This is less brittle; it eliminates
   special cases to avoid incrementing the counter and skipping into an extra stage.
 - Stage tokens are subtracted for each song played, and a player is unjoined
   when he runs out.
 - Stage tokens are subtracted at the start of gameplay.  If the player cancels,
   they're "refunded".  This differs from before, where the stage was incremented
   at the end of gameplay.  This makes the stage token counter meaningful during
   gameplay; if this is done at the end, then it would be too high during gameplay.
 - IsFinalStage is gone.  If needed, use GetSmallestNumStagesLeftForAnyHumanPlayer.
 - Extra stages are awarded by adding a stage token and incrementing
   m_iAwardedExtraStages.  If m_iAwardedExtraStages is 1, the player is
   on his first extra stage; if 2, his second.
2007-04-25 03:50:17 +00:00
Glenn Maynard ccc19fa60b Don't track the individual stage with Stage; use the stage index for that.
(Reducing the usage of the "stage" concept.  It conflicts with overlapped
play.)
2007-04-25 01:11:50 +00:00
Glenn Maynard d88d9388f8 simplify 2007-04-25 00:30:30 +00:00
Glenn Maynard 5318d0670d Previously, BeginStage was called in SGameplay and FinishStage was called
in each place gameplay exits.  This incremented the stage number in SSM,
and was brittle: FinishStage was sprinkled in many odd places.  Do both
in SGameplay.

This increments the stage number as soon as gameplay ends.  This only
affects evaluation.  Use the stage number from StageStats there, instead
of the current stage, and adjust branches.  During evaluation, the
game is on the upcoming stage and displaying old data for the last
stage, instead of the stage continuing through evaluation.

This also moves a bunch of scoring-related stuff out of SEvaluation,
to the end of gameplay, where it belongs.  Eval is almost const, and things
won't break like they would before if Eval is not used.
2007-04-24 01:35:32 +00:00
Glenn Maynard 9a26797ebb use m_Stage 2007-04-24 00:40:14 +00:00
Glenn Maynard a4b2c91a9d no m_pStageStats for test stuff 2007-04-19 15:25:58 +00:00
Glenn Maynard ee06cb3aa1 m_pStageStats 2007-04-19 15:21:57 +00:00
Chris Danford 43ef38383d separate CurrentStageIndex into separate number per game and per player. This allowed for staggered join periods. 2007-03-25 09:37:14 +00:00
Chris Danford 276b4acf44 fix double Off command. Let SWME handle SM_MenuTimer 2007-03-11 20:49:47 +00:00
Glenn Maynard a584f1b5be rename EndScreen; that's a virtual from Screen. Why is there no way
to get a warning when virtual methods are overloaded without specifying
"virtual"?
2007-03-07 22:04:28 +00:00
Glenn Maynard 43ee764fde remove unused DifficultyIcon. Do this in Lua if wanted. 2007-03-03 01:54:46 +00:00
Glenn Maynard 84e9905ae1 remove unused DifficultyMeter. Do this in Lua if wnated. 2007-03-03 01:43:19 +00:00
Glenn Maynard 5367feb73f ShowDifficultyMeters
(note: this approach is not recommended for new code.  It's better to
control this stuff with Lua.  This is just an interim before this stuff is
moved over to Lua, since I don't want to spend time converting it
right now.)
2007-02-27 01:25:38 +00:00
Glenn Maynard 77eedba13e fix crash 2007-02-21 11:23:30 +00:00
Chris Danford b3c3bd52d2 LOAD_ALL_COMMANDS_AND_SET_XY -> LoadAllCommands; SET_XY 2007-02-19 10:23:29 +00:00
Chris Danford d61272fe08 consistent command loading style 2007-02-19 10:06:50 +00:00
Chris Danford 599db61b62 Always call LoadAllCommands explicitly.
The hack to LoadAllCommands when playing a command was leading to weird interactions: If a theme element contained an OnCommand, it would cause the rest of the commands defined in metrics to not be loaded.
2007-02-19 09:30:07 +00:00
Glenn Maynard abe62b0920 GetMD5ForString: don't hex 2007-01-26 04:35:15 +00:00
Steve Checkoway 4517499f0f lroundf -> lrintf. 2007-01-03 05:05:28 +00:00
Steve Checkoway eb0b26cd82 Float to int is slow on ppc. It requires a store, a big stall, and then a load. It's even worse on a G5 if the compiler is dumb (and let's face it, I'm using gcc here...). Just use lroundf when we want an int. It will certainly be no slower. 2007-01-02 23:36:44 +00:00
Glenn Maynard 0db4a096e5 ScreenWithMenuElements::BeginScreen calls SortByDrawOrder 2006-11-21 04:32:59 +00:00
Chris Danford 2f7ac6aa3c Add m_ to StageStats and PlayerStageStats members. There are several methods of these classes with local variable names that are similar to the member names. m_ helps distinguish between those two types. 2006-11-14 11:13:21 +00:00
Glenn Maynard e1eb59bc02 use bFailed 2006-11-09 08:23:55 +00:00
Steve Checkoway e87789da7c Rename XToString2 to XToString. 2006-10-15 00:09:18 +00:00
Steve Checkoway 04bff6bc1d Use XToString2. 2006-10-15 00:00:22 +00:00
Glenn Maynard 617e8b5335 FOREACH_ENUM2 -> FOREACH_ENUM 2006-10-07 08:56:58 +00:00
Glenn Maynard 4bb479a445 standard enums for some preference types 2006-10-07 07:43:18 +00:00
Glenn Maynard 0b45f5dd0a use SetCurrentStyle 2006-09-30 22:22:26 +00:00
Glenn Maynard 2eca7b670c use FOREACH_ENUM2 2006-09-27 05:18:47 +00:00
Glenn Maynard a20ff0e3b6 GenericTweenOn, GenericTweenOff 2006-09-23 03:37:45 +00:00
Glenn Maynard e7fdfa2132 prefer GAMESTATE->JoinPlayer to setting GAMESTATE->m_bSideIsJoined manually 2006-09-15 05:56:43 +00:00
Steve Checkoway 944a913790 PlayerNumber -> IEP. 2006-09-15 01:47:24 +00:00
Glenn Maynard aeb9c89191 use input.pn 2006-09-13 10:02:58 +00:00
Glenn Maynard e206261b80 ARRAYSIZE -> ARRAYLEN 2006-09-13 03:11:38 +00:00
Glenn Maynard 7b995b8487 remove unused 2006-08-20 20:01:53 +00:00
Steve Checkoway 0cb22fb806 Apparently VC doesn't like using (group).GroupType as a type (and frankly, I couldn't get g++ to accept it outside of StepMania, either) so use the macros with PO and SO prefixes for PlayerOptions and SongOptions, respectively. Also, pointers to data members can't point to elements of an array (no idea why gcc was allowing it before) so use Assign_n and pass the index separately. (Very annoying, typeof() should really be in the standard.) 2006-08-05 08:02:49 +00:00
Steve Checkoway 1802e603b3 Update to use the new ModsGroup api. 2006-08-05 04:47:01 +00:00
Chris Danford 7ac45c24e4 save Preferred, Stage, Song, and Current modifiers separately. This eliminates the fragile mods store/restore. 2006-08-05 02:38:05 +00:00
Steve Checkoway a07e194cf1 Revert. Fixes Linux build. 2006-07-18 05:51:37 +00:00
Jason Felds 366c3440d4 Fix VC8 macro redef warning. (more to come) 2006-07-18 03:56:37 +00:00
Steve Checkoway 161aa4a035 cleanup 2006-07-07 19:34:51 +00:00
Glenn Maynard 7f463daafe remove experimental TotalError 2006-07-07 18:45:15 +00:00
Steve Checkoway af860e6ccc Fix parameter. This worked before because it was being called with an argument of l. 2006-07-05 21:53:12 +00:00
Chris Danford 66d25f70ec AccumStageStats -> AccumPlayedStageStats 2006-07-03 00:04:30 +00:00