55#include " xMathInlines.h"
66#include " zSurface.h"
77#include " zRenderState.h"
8+ #include " zEntPlayerBungeeState.h"
89
910#include < types.h>
1011#include < rwplcore.h>
@@ -637,10 +638,6 @@ namespace oob_state
637638 this ->updatess [9 ] = &supdate_fade_out;
638639 }
639640
640- grab_state_type::tutorial_callback::tutorial_callback (grab_state_type& owner) : owner(owner)
641- {
642- }
643-
644641 grab_state_type::substate_enum grab_state_type::supdate_fade_out (grab_state_type& gst,
645642 xScene& scene, F32& dt)
646643 {
@@ -858,10 +855,35 @@ namespace oob_state
858855 {
859856 return SS_BEGIN_WAIT;
860857 };
858+
859+ grab_state_type::tutorial_callback::tutorial_callback (grab_state_type& owner) : owner(owner)
860+ {
861+ }
862+
863+ out_state_type::out_state_type () : state_type(STATE_OUT)
864+ {
865+ }
866+
867+ in_state_type::in_state_type () : state_type(STATE_IN)
868+ {
869+ }
870+
871+ void state_type::start ()
872+ {
873+ };
874+
875+ void state_type::stop ()
876+ {
877+ };
861878 } // namespace
862879} // namespace oob_state
863880
864- float oob_state::oob_timer ()
881+ bool oob_state::IsPlayerInControl ()
882+ {
883+ return oob_state::shared.control == 0 ;
884+ }
885+
886+ F32 oob_state::oob_timer ()
865887{
866888 if (shared.reset_time == fixed.reset_time )
867889 {
@@ -871,6 +893,82 @@ float oob_state::oob_timer()
871893 return -1 .0f ;
872894}
873895
896+ bool oob_state::render ()
897+ {
898+ if ((shared.flags & 0x3 ) != 3 )
899+ {
900+ return false ;
901+ }
902+
903+ if (!shared.control )
904+ {
905+ return false ;
906+ }
907+
908+ xLightKit_Enable (globals.player .ent .lightKit , globals.currWorld );
909+ xEntRender (&globals.player .ent );
910+ xLightKit_Enable (NULL , globals.currWorld );
911+
912+ return true ;
913+ }
914+
915+ void oob_state::fx_render ()
916+ {
917+ if ((shared.flags & 0x3 ) != 3 )
918+ {
919+ return ;
920+ }
921+
922+ if (shared.control && shared.fade_alpha < 1 .0f )
923+ {
924+ render_fade ();
925+ render_ghost ();
926+ }
927+
928+ if (shared.render_hand && shared.model != NULL )
929+ {
930+ render_hand ();
931+ }
932+ }
933+
934+ void oob_state::force_start ()
935+ {
936+ if ((shared.flags & 0x7 ) == 0x3 && !bungee_state::active ())
937+ {
938+ if (globals.player .ControlOff & 0x8000 )
939+ {
940+ shared.flags |= 0x8 ;
941+ oob_player_teleported = false ;
942+ }
943+ else
944+ {
945+ shared.flags &= ~0x8 ;
946+ shared.state ->stop ();
947+ shared.state = shared.states [2 ];
948+ shared.state ->start ();
949+ }
950+ }
951+ }
952+
953+ void oob_state::read_persistent (xSerial& s)
954+ {
955+ for (U32 i = 0 ; i < 6 ; i++)
956+ {
957+ S32 val;
958+ s.Read_b1 (&val);
959+
960+ idiot_levels[i].triggered = (bool )val;
961+ }
962+ }
963+
964+ void oob_state::write_persistent (xSerial& s)
965+ {
966+ for (U32 i = 0 ; i < 6 ; i++)
967+ {
968+ s.Write_b1 ((bool )idiot_levels[i].triggered );
969+ }
970+ }
971+
874972void oob_state::in_state_type::start ()
875973{
876974 shared.reset_time = FLOAT_MAX;
@@ -892,19 +990,6 @@ void oob_state::out_state_type::stop() {
892990
893991};
894992
895- void oob_state::state_type::start () {
896-
897- };
898-
899- void oob_state::state_type::stop () {
900-
901- };
902-
903- bool oob_state::IsPlayerInControl ()
904- {
905- return oob_state::shared.control == 0 ;
906- }
907-
908993namespace oob_state
909994{
910995 namespace
0 commit comments