From: SakirSoft <sak...@us...> - 2005-07-02 17:13:14
|
Update of /cvsroot/openmugen/OpenMugen/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3782/src Modified Files: ControllerExecuter.cpp GameObjects.cpp GameObjects.h Makefile.win OpenMugen.dev OpenMugen.layout SffManager.h StateManager.cpp StateParser.cpp StateParser.h VideoSystem.cpp global.cpp global.h player.cpp player.h Log Message: Add AdjustPath function to remove spaces after the path Fixed after 10 minutes speed issue bug Add SuperPause controller Index: ControllerExecuter.cpp =================================================================== RCS file: /cvsroot/openmugen/OpenMugen/src/ControllerExecuter.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -p -r1.8 -r1.9 --- ControllerExecuter.cpp 1 Jul 2005 18:04:09 -0000 1.8 +++ ControllerExecuter.cpp 2 Jul 2005 17:13:05 -0000 1.9 @@ -318,7 +318,8 @@ void CControllerExecuter::Explod() CExplod *explod = new CExplod( new CSffManager(p), nAnim,pos_pl); - + + explod->SetPosType(1); explod->SetPosX(x); explod->SetPosY(y); explod->SetSprPrio(SprPrio+5); @@ -506,7 +507,50 @@ void CControllerExecuter::SelfState() void CControllerExecuter::SuperPause() { SUPERPAUSE *temp = (SUPERPAUSE*)lpController; - PrintMessage("TODO: implement SuperPause controller"); + + CSuperPause *pause = new CSuperPause(); + + int time = (int)m_pVM->Execute(temp->time,30); + int move_time=(int)m_pVM->Execute(temp->movetime); + int cmd_buffer = (int)m_pVM->Execute(temp->endcmdbuftime); + bool pauseBg = (int)m_pVM->Execute(temp->pausebg,1) > 0; + s32 nAnim = (s32)m_pVM->Execute(temp->nAnimNo,-1); + s32 snd_grp = (s32)m_pVM->Execute(temp->snd_grp,-1); + s32 snd_item = (s32)m_pVM->Execute(temp->snd_item,-1); + + //play sound + if( snd_grp != -1) + { + if( temp->bPlayerSound ) + m_CurrentPlayer->PlaySnd(snd_grp,snd_item); + else + mugen->GetEngine()->PlaySnd(snd_grp,snd_item); + + } + + //ceate the charge effect with a special id + if( nAnim != -1 ) + { + CSffManager *p = temp->bPlayerAnim ? m_CurrentPlayer->GetSff() : mugen->GetEngine()->GetEngineSff(); + CExplod *explod = new CExplod(new CSffManager(p),nAnim,m_CurrentPlayer); + explod->SetPosType(1); // p1 pps + explod->SetPosX( m_pVM->Execute(temp->pos_x) ); + explod->SetPosY( m_pVM->Execute(temp->pos_y) ); + explod->SetSprPrio(6); + + explod->SetId(-111); //special ID + mugen->GetEngine()->AddObject( explod ); + + } + + pause->SetPauseTime(time); + pause->SetMoveTime(move_time); + pause->SetBufferTime(cmd_buffer); + pause->SetBgPause(pauseBg); + + mugen->GetEngine()->AddObject( pause ); + + PrintMessage("Test SuperPause :TODO Add unhitable, poweradd,p2defmul"); } void CControllerExecuter::StateTypeSet() @@ -920,7 +964,22 @@ void CControllerExecuter::ParentVarSet() void CControllerExecuter::Pause() { PAUSE *temp = (PAUSE*)lpController; - PrintMessage("TODO: implement Pause controller"); + + int time = (int)m_pVM->Execute(temp->time,30); + int move_time=(int)m_pVM->Execute(temp->movetime); + int cmd_buffer = (int)m_pVM->Execute(temp->endcmdbuftime); + bool pauseBg = (int)m_pVM->Execute(temp->pausebg,1) > 0; + + CPause * pause = new CPause(); + pause->SetPauseTime(time); + pause->SetMoveTime(move_time); + pause->SetBufferTime(cmd_buffer); + pause->SetBgPause(pauseBg); + // pause-> + + mugen->GetEngine()->AddObject( pause ); + + PrintMessage("test Pause controller"); } void CControllerExecuter::PlayerPush() Index: GameObjects.cpp =================================================================== RCS file: /cvsroot/openmugen/OpenMugen/src/GameObjects.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -p -r1.3 -r1.4 --- GameObjects.cpp 1 Jul 2005 18:04:10 -0000 1.3 +++ GameObjects.cpp 2 Jul 2005 17:13:05 -0000 1.4 @@ -335,3 +335,123 @@ void CPause::UpDateState() } } + + + + + + + +/* +================================================================================ +Constructor of SuperPause object +================================================================================ +*/ +CSuperPause::CSuperPause() +{ + nTime = 30; + nEndCmdBufTime = 0; + nMoveTime = 0; + bPauseBg = true; + bPause = false; + bValid = true; + bActive = false; + bDarken = true; + +} +/* +================================================================================ +Deconstuctor of SuperPause object +================================================================================ +*/ +CSuperPause::~CSuperPause() +{ + +} + +void CSuperPause::Think() +{ + if( !bPause ) + UpDateState(); +} + +bool CSuperPause::isValid() +{ + return bValid; +} + +void CSuperPause::Pause(bool pause) +{ + bPause = pause; +} + +/* +================================================================================ +This is quite the same as the Pause controller`s UpDateState function +But it takes care to dark the screen and do not pause the Explode object +which is created by the super pause controller +The explode has a special id of -111 +================================================================================ +*/ +void CSuperPause::UpDateState() +{ + + if( nTime == 0 ) + { + bValid = false; + + list<CBaseObject*>* ObjList = mugen->GetEngine()->GetObjectList(); + + for( BI i = ObjList->begin(); i != ObjList->end(); ++i) + { + CBaseObject* object = *i; + //Pause controller should not pause him self + if( object->GetType() != CBaseObject::PauseObject ) + object->Pause(false); + } + return; + + } + + //darken the screen + if( bDarken ) + mugen->GetVideo()->AddRect(0,0,319,239,0,0,0,128,6,CVideoSystem::RECT_FILLED); + + + //the pause begins after nMoveTime is 0 + if( nTime > 0 && nMoveTime == 0) + { + nTime--; + bActive = true; + } + + if( nMoveTime > 0 ) + nMoveTime--; + + + //Activtae the pause + if( bActive ) + { + list<CBaseObject*>* ObjList = mugen->GetEngine()->GetObjectList(); + + for( BI i = ObjList->begin(); i != ObjList->end(); ++i) + { + CBaseObject* object = *i; + + //take care of ouer special explode + if( object->GetType() == CBaseObject::ExplodeObject ) + { + CExplod *explod = reinterpret_cast<CExplod*>(object); + if( explod->GetId() == -111 ) + continue; + + } + + //Pause controller should not pause him self + if( object->GetType() != CBaseObject::PauseObject ) + object->Pause(true); + } + } + +} + Index: GameObjects.h =================================================================== RCS file: /cvsroot/openmugen/OpenMugen/src/GameObjects.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -p -r1.2 -r1.3 --- GameObjects.h 29 Jun 2005 12:21:26 -0000 1.2 +++ GameObjects.h 2 Jul 2005 17:13:05 -0000 1.3 @@ -43,7 +43,7 @@ public: ExplodeObject, PauseObject, HitByObject, - NitHitByObject, + NotHitByObject, ProjectileObject, PlayerObject //helpers are also players but players cant get invalide }; @@ -97,6 +97,7 @@ public: ~CExplod(); //Set functions + void SetId(int nId){id=nId;} void SetPosX( float x ); void SetPosY( float y ); void AddPosX( float x ) {x_pos += x; } @@ -109,6 +110,7 @@ public: void SetRemTime( int time ) {rem_time = time;} void SetSprPrio( u8 nPrio); void SetPosType(int pos) { nPosType = pos;} + int GetId() {return id;} //Base function of the object int GetType() {return CBaseObject::ExplodeObject;} @@ -123,7 +125,6 @@ public: Definition of the Pause object ================================================================================ */ - class CPause:public CBaseObject { int nTime; @@ -153,4 +154,40 @@ public: }; +/* +================================================================================ +Definition of the SuperPause object +================================================================================ +*/ + +class CSuperPause:public CBaseObject +{ + int nTime; + int nEndCmdBufTime; + int nMoveTime; + bool bPause; + bool bActive; + bool bPauseBg; + bool bValid; + bool bDarken; + void UpDateState(); + +public: + CSuperPause(); + ~CSuperPause(); + + //Set functions + void SetPauseTime(int time) {nTime = time;} + void SetMoveTime(int time) {nMoveTime = time;} + void SetBufferTime(int time) {nEndCmdBufTime = time;} + void SetBgPause(bool pause) {bPauseBg = pause;} + + //Base function of the object + int GetType() {return CBaseObject::PauseObject;} + void Think(); + bool isValid(); + void Pause(bool pause); + +}; + #endif Index: Makefile.win =================================================================== RCS file: /cvsroot/openmugen/OpenMugen/src/Makefile.win,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -p -r1.7 -r1.8 --- Makefile.win 1 Jul 2005 18:04:10 -0000 1.7 +++ Makefile.win 2 Jul 2005 17:13:05 -0000 1.8 @@ -1,18 +1,18 @@ # Project: OpenMugen # Makefile created by Dev-C++ 4.9.9.2 -CPP = g++.exe -D__DEBUG__ -CC = gcc.exe -D__DEBUG__ +CPP = g++.exe +CC = gcc.exe WINDRES = windres.exe RES = OBJ = ../OBJ/main.o ../OBJ/game.o ../OBJ/global.o ../OBJ/SDLManager.o ../OBJ/VideoSystem.o ../OBJ/scale2xSDL.o ../OBJ/SDL_framerate.o ../OBJ/scale2x.o ../OBJ/MemManager.o ../OBJ/SffManager.o ../OBJ/player.o ../OBJ/Stack.o ../OBJ/VM.o ../OBJ/StateManager.o ../OBJ/AirManager.o ../OBJ/engine.o ../OBJ/ControllerExecuter.o ../OBJ/tokenizer.o ../OBJ/StateParser.o ../OBJ/CmdManager.o ../OBJ/assert.o ../OBJ/Input.o ../OBJ/SoundSystem.o ../OBJ/GameObjects.o $(RES) LINKOBJ = ../OBJ/main.o ../OBJ/game.o ../OBJ/global.o ../OBJ/SDLManager.o ../OBJ/VideoSystem.o ../OBJ/scale2xSDL.o ../OBJ/SDL_framerate.o ../OBJ/scale2x.o ../OBJ/MemManager.o ../OBJ/SffManager.o ../OBJ/player.o ../OBJ/Stack.o ../OBJ/VM.o ../OBJ/StateManager.o ../OBJ/AirManager.o ../OBJ/engine.o ../OBJ/ControllerExecuter.o ../OBJ/tokenizer.o ../OBJ/StateParser.o ../OBJ/CmdManager.o ../OBJ/assert.o ../OBJ/Input.o ../OBJ/SoundSystem.o ../OBJ/GameObjects.o $(RES) -LIBS = -L"D:/Development/tools/Dev-Cpp/lib" -lmingw32 -lSDLmain -lSDL -lSGE -lSDL_Image -lSDL_mixer -lSDL_image -g3 +LIBS = -L"D:/Development/tools/Dev-Cpp/lib" -lmingw32 -lSDLmain -lSDL -lSGE -lSDL_Image -lSDL_mixer -lSDL_image INCS = -I"D:/Development/tools/Dev-Cpp/include" CXXINCS = -I"D:/Development/tools/Dev-Cpp/lib/gcc/mingw32/3.4.2/include" -I"D:/Development/tools/Dev-Cpp/include/c++/3.4.2/backward" -I"D:/Development/tools/Dev-Cpp/include/c++/3.4.2/mingw32" -I"D:/Development/tools/Dev-Cpp/include/c++/3.4.2" -I"D:/Development/tools/Dev-Cpp/include" BIN = ../BIN/OpenMugen.exe -CXXFLAGS = $(CXXINCS) -I"D:\Development\tools\Dev-Cpp\\include\SDL" -I"D:\Development\tools\Dev-Cpp\\include\SGE" -Dmain=SDL_main -D_WIN32 -D_DEBUG -g3 -CFLAGS = $(INCS) -Dmain=SDL_main -g3 +CXXFLAGS = $(CXXINCS) -I"D:\Development\tools\Dev-Cpp\\include\SDL" -I"D:\Development\tools\Dev-Cpp\\include\SGE" -Dmain=SDL_main -D_WIN32 -D_DEBUG +CFLAGS = $(INCS) -Dmain=SDL_main RM = rm -f .PHONY: all all-before all-after clean clean-custom Index: OpenMugen.dev =================================================================== RCS file: /cvsroot/openmugen/OpenMugen/src/OpenMugen.dev,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -p -r1.7 -r1.8 --- OpenMugen.dev 1 Jul 2005 18:04:10 -0000 1.7 +++ OpenMugen.dev 2 Jul 2005 17:13:05 -0000 1.8 @@ -27,7 +27,7 @@ CustomMakefile= IncludeVersionInfo=0 SupportXPThemes=0 CompilerSet=0 -CompilerSettings=0000000000000001000000 +CompilerSettings=0000000000000000000000 [Unit1] FileName=main.cpp Index: OpenMugen.layout =================================================================== RCS file: /cvsroot/openmugen/OpenMugen/src/OpenMugen.layout,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -p -r1.12 -r1.13 --- OpenMugen.layout 1 Jul 2005 18:04:10 -0000 1.12 +++ OpenMugen.layout 2 Jul 2005 17:13:05 -0000 1.13 @@ -6,28 +6,28 @@ LeftChar=1 Open=0 Top=0 [Editors] -Focused=31 -Order=35,20,7,18,17,29,8,19,31 +Focused=7 +Order=20,4,1,35,0,43,39,38,44,32,33,46,5,17,18,29,31,2,15,28,7 [Editor_0] -Open=0 +Open=1 Top=0 CursorCol=1 -CursorRow=2 -TopLine=1 +CursorRow=14 +TopLine=22 LeftChar=1 [Editor_1] -Open=0 +Open=1 Top=0 -CursorCol=22 -CursorRow=9 -TopLine=1 +CursorCol=32 +CursorRow=79 +TopLine=40 LeftChar=1 [Editor_2] -Open=0 +Open=1 Top=0 CursorCol=1 CursorRow=92 -TopLine=65 +TopLine=17 LeftChar=1 [Editor_3] Open=0 @@ -37,18 +37,18 @@ CursorRow=57 TopLine=31 LeftChar=1 [Editor_4] -Open=0 +Open=1 Top=0 -CursorCol=21 -CursorRow=36 -TopLine=1 +CursorCol=6 +CursorRow=281 +TopLine=259 LeftChar=1 [Editor_5] -Open=0 +Open=1 Top=0 CursorCol=32 CursorRow=48 -TopLine=19 +TopLine=110 LeftChar=1 [Editor_6] Open=0 @@ -59,13 +59,13 @@ TopLine=13 LeftChar=1 [Editor_7] Open=1 -Top=0 -CursorCol=14 -CursorRow=295 -TopLine=264 +Top=1 +CursorCol=29 +CursorRow=52 +TopLine=40 LeftChar=1 [Editor_8] -Open=1 +Open=0 Top=0 CursorCol=29 CursorRow=99 @@ -107,10 +107,10 @@ CursorRow=35 TopLine=8 LeftChar=1 [Editor_15] -Open=0 +Open=1 Top=0 -CursorCol=1 -CursorRow=12 +CursorCol=13 +CursorRow=20 TopLine=1 LeftChar=1 [Editor_16] @@ -123,30 +123,30 @@ LeftChar=1 [Editor_17] Open=1 Top=0 -CursorCol=45 -CursorRow=156 -TopLine=124 +CursorCol=25 +CursorRow=116 +TopLine=100 LeftChar=1 [Editor_18] Open=1 Top=0 -CursorCol=58 -CursorRow=192 -TopLine=161 +CursorCol=9 +CursorRow=175 +TopLine=121 LeftChar=1 [Editor_19] -Open=1 +Open=0 Top=0 -CursorCol=57 -CursorRow=208 -TopLine=390 +CursorCol=32 +CursorRow=458 +TopLine=431 LeftChar=1 [Editor_20] Open=1 Top=0 -CursorCol=7 -CursorRow=816 -TopLine=795 +CursorCol=10 +CursorRow=986 +TopLine=1 LeftChar=1 [Editor_21] Open=0 @@ -186,9 +186,9 @@ LeftChar=1 [Editor_26] Open=0 Top=0 -CursorCol=37 -CursorRow=204 -TopLine=148 +CursorCol=73 +CursorRow=372 +TopLine=344 LeftChar=1 [Editor_27] Open=0 @@ -198,11 +198,11 @@ CursorRow=107 TopLine=82 LeftChar=1 [Editor_28] -Open=0 +Open=1 Top=0 CursorCol=3 CursorRow=78 -TopLine=55 +TopLine=22 LeftChar=1 [Editor_29] Open=1 @@ -220,24 +220,24 @@ TopLine=47 LeftChar=1 [Editor_31] Open=1 -Top=1 -CursorCol=1 -CursorRow=262 -TopLine=248 +Top=0 +CursorCol=5 +CursorRow=248 +TopLine=14 LeftChar=1 [Editor_32] -Open=0 +Open=1 Top=0 -CursorCol=71 -CursorRow=43 +CursorCol=19 +CursorRow=33 TopLine=16 LeftChar=1 [Editor_33] -Open=0 +Open=1 Top=0 -CursorCol=12 -CursorRow=306 -TopLine=298 +CursorCol=30 +CursorRow=539 +TopLine=519 LeftChar=1 [Editor_34] Open=0 @@ -249,37 +249,37 @@ LeftChar=1 [Editor_35] Open=1 Top=0 -CursorCol=34 -CursorRow=96 -TopLine=74 +CursorCol=45 +CursorRow=209 +TopLine=188 LeftChar=1 [Editor_36] Open=0 Top=0 CursorCol=17 -CursorRow=533 -TopLine=496 +CursorRow=200 +TopLine=183 LeftChar=1 [Editor_37] Open=0 Top=0 -CursorCol=7 -CursorRow=2335 -TopLine=2317 +CursorCol=5 +CursorRow=4471 +TopLine=395 LeftChar=1 [Editor_38] -Open=0 +Open=1 Top=0 CursorCol=1 CursorRow=23 TopLine=1 LeftChar=1 [Editor_39] -Open=0 +Open=1 Top=0 CursorCol=7 CursorRow=23 -TopLine=16 +TopLine=50 LeftChar=1 [Editor_40] Open=0 @@ -303,18 +303,18 @@ CursorRow=4 TopLine=1 LeftChar=1 [Editor_43] -Open=0 +Open=1 Top=0 -CursorCol=1 -CursorRow=23 -TopLine=50 +CursorCol=36 +CursorRow=68 +TopLine=31 LeftChar=1 [Editor_44] -Open=0 +Open=1 Top=0 CursorCol=1 CursorRow=101 -TopLine=68 +TopLine=65 LeftChar=1 [Editor_45] Open=0 @@ -324,25 +324,25 @@ CursorRow=87 TopLine=46 LeftChar=1 [Editor_46] -Open=0 +Open=1 Top=0 CursorCol=51 CursorRow=192 -TopLine=186 +TopLine=190 LeftChar=1 [Editor_47] Open=0 Top=0 -CursorCol=33 -CursorRow=110 -TopLine=114 +CursorCol=16 +CursorRow=100 +TopLine=81 LeftChar=1 [Editor_48] Open=0 Top=0 -CursorCol=24 -CursorRow=222 -TopLine=34 +CursorCol=6 +CursorRow=427 +TopLine=409 LeftChar=1 [Editor_49] Open=0 Index: SffManager.h =================================================================== RCS file: /cvsroot/openmugen/OpenMugen/src/SffManager.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -p -r1.6 -r1.7 --- SffManager.h 1 Jul 2005 18:04:10 -0000 1.6 +++ SffManager.h 2 Jul 2005 17:13:05 -0000 1.7 @@ -102,10 +102,10 @@ private: u32 nFlags; //current animation information bool bLooped; - u16 nDuringTime; - u16 nCurrentImage; - u16 nCurrentImageTime; - u16 nCurrTime; + u32 nDuringTime; + u32 nCurrentImage; + u32 nCurrentImageTime; + u32 nCurrTime; ///////////////////////////////// u32 nTimer; //Sprite list @@ -126,11 +126,11 @@ public: //returns the current animation ActionElement *GetCurrAnimation(){return Anim;} bool isLooped(){return bLooped;} - u16 GetDuringTime(){return nDuringTime;} - u16 GetCurrentImageNr(){return nCurrentImage;} - u16 GetCurrentImageTime(){return nCurrentImageTime;} - u16 GetCurrentAnimTime(){return nCurrTime;} - s16 GetCompleteAnimTime(){if(Anim) return Anim->nCompletAnimTime; } + u32 GetDuringTime(){return nDuringTime;} + u32 GetCurrentImageNr(){return nCurrentImage;} + u32 GetCurrentImageTime(){return nCurrentImageTime;} + u32 GetCurrentAnimTime(){return nCurrTime;} + s32 GetCompleteAnimTime(){if(Anim) return Anim->nCompletAnimTime; } gtArray<SFFSPRITE> *GetSffPool(){return &SffPool;} CAirManager* GetAirManager(){return m_pAirManger;} Index: StateManager.cpp =================================================================== RCS file: /cvsroot/openmugen/OpenMugen/src/StateManager.cpp,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -p -r1.1.1.1 -r1.2 --- StateManager.cpp 10 Jun 2005 21:35:08 -0000 1.1.1.1 +++ StateManager.cpp 2 Jul 2005 17:13:05 -0000 1.2 @@ -368,6 +368,8 @@ void CStateManager::AddState(s32 nStateN nCurrTrigger=0; nTriggerListSize=100; + lpStateDefList[nTotalStateDef-1].lpState[nTotalState].nActivated=1; + lpStateDefList[nTotalStateDef-1].lpState[nTotalState].nPresist = 1; lpStateDefList[nTotalStateDef-1].lpState[nTotalState].triggers=(PLTRIGGER*)m_pAlloc->Alloc(sizeof(PLTRIGGER)*nTriggerListSize); nTotalState++; Index: StateParser.cpp =================================================================== RCS file: /cvsroot/openmugen/OpenMugen/src/StateParser.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -p -r1.5 -r1.6 --- StateParser.cpp 1 Jul 2005 18:04:10 -0000 1.5 +++ StateParser.cpp 2 Jul 2005 17:13:05 -0000 1.6 @@ -4479,38 +4479,21 @@ void CStateParser::ParseSuperPause() { if( !tok.CheckToken("=") ) Error("missing \"=\" "); - - char strAnim[20]; - strcpy(strAnim,tok.GetToken()); - if( strAnim[0] == 'S' || strAnim[0] == 's') - { - temp->bPlayerAnim = true; - strAnim[0] = '0'; - temp->nAnimNo = atoi(strAnim); - - }else - temp->nAnimNo = atoi(strAnim); + temp->bPlayerAnim = tok.CheckToken("S"); + temp->nAnimNo = GenerateInstruction(); + }else if( tok.CheckToken("sound") ) { if( !tok.CheckToken("=") ) Error("missing \"=\" "); - - char strAnim[20]; - strcpy(strAnim,tok.GetToken()); + + temp->bPlayerSound= tok.CheckToken("S"); + temp->snd_grp = GenerateInstruction(); - if( strAnim[0] == 'S' || strAnim[0] == 's') - { - temp->bPlayerSound= true; - strAnim[0] = '0'; - temp->snd_grp = atoi(strAnim); - - }else - temp->snd_grp = atoi(strAnim); - if( tok.CheckToken(",") ) - temp->snd_item = tok.GetInt(); + temp->snd_item = GenerateInstruction(); }else if( tok.CheckToken("pos") ) { Index: StateParser.h =================================================================== RCS file: /cvsroot/openmugen/OpenMugen/src/StateParser.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -p -r1.4 -r1.5 --- StateParser.h 1 Jul 2005 18:04:10 -0000 1.4 +++ StateParser.h 2 Jul 2005 17:13:05 -0000 1.5 @@ -197,6 +197,7 @@ struct PLSTATE PLTRIGGER *triggers; u16 nHowManyTriggers; s16 nPresist; + u16 nActivated; bool bIgnorPause; void *controller; @@ -793,9 +794,9 @@ struct SUPERPAUSE { INSTRUCTION* time; bool bPlayerAnim; - s32 nAnimNo; + INSTRUCTION* nAnimNo; bool bPlayerSound; - s32 snd_grp,snd_item; + INSTRUCTION* snd_grp,*snd_item; INSTRUCTION* pos_x; INSTRUCTION* pos_y; INSTRUCTION* darken; Index: VideoSystem.cpp =================================================================== RCS file: /cvsroot/openmugen/OpenMugen/src/VideoSystem.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -p -r1.7 -r1.8 --- VideoSystem.cpp 1 Jul 2005 18:04:10 -0000 1.7 +++ VideoSystem.cpp 2 Jul 2005 17:13:05 -0000 1.8 @@ -57,7 +57,7 @@ bool CVideoSystem::InitSystem() { PrintMessage("CVideoSystem::InitSystem()"); //Set Video mode and get main Surface - screen=SDL_SetVideoMode(640,480,16,SDL_HWSURFACE|SDL_DOUBLEBUF); + screen=SDL_SetVideoMode(640,480,16,SDL_HWSURFACE/*|SDL_DOUBLEBUF*/); //Check the surface for validate if(screen==NULL) { @@ -115,12 +115,12 @@ void CVideoSystem::Draw() } DrawText(265,10,"%2.2f FPS",nFps); - - - // SDL_BlitSurface(work,NULL,screen,NULL); + +// SDL_BlitSurface(work,NULL,screen,NULL); //scale2x(work,screen); - FilterImage(); + FilterImage(); + //SDL_UpdateRect(screen,0,0,640,480); SDL_Flip(screen); //Limit the frame rate to 60 Hz SDL_framerateDelay(&m_FPSmanager); Index: global.cpp =================================================================== RCS file: /cvsroot/openmugen/OpenMugen/src/global.cpp,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -p -r1.1.1.1 -r1.2 --- global.cpp 10 Jun 2005 21:35:00 -0000 1.1.1.1 +++ global.cpp 2 Jul 2005 17:13:05 -0000 1.2 @@ -218,36 +218,50 @@ void LoadPlayerDef(const char* strPlayer strcpy(strTemp,strFolderPath); strcat(strTemp,playerdef.files.strCmd); strcpy(playerdef.files.strCmd,strTemp); + AdjustPath(playerdef.files.strCmd); //correct cns strcpy(strTemp,strFolderPath); strcat(strTemp,playerdef.files.strCns); strcpy(playerdef.files.strCns,strTemp); + AdjustPath(playerdef.files.strCns); //correct st strcpy(strTemp,strFolderPath); strcat(strTemp,playerdef.files.strSt); strcpy(playerdef.files.strSt,strTemp); + AdjustPath(playerdef.files.strSt); + //correct stcommon strcpy(strTemp,strFolderPath); strcat(strTemp,playerdef.files.strStCommon); strcpy(playerdef.files.strStCommon,strTemp); + AdjustPath(playerdef.files.strStCommon); + //correct sprite strcpy(strTemp,strFolderPath); strcat(strTemp,playerdef.files.strSprite); strcpy(playerdef.files.strSprite,strTemp); + AdjustPath(playerdef.files.strSprite); + //correct anim strcpy(strTemp,strFolderPath); strcat(strTemp,playerdef.files.strAirFile); strcpy(playerdef.files.strAirFile,strTemp); + AdjustPath(playerdef.files.strAirFile); + + //correct sound strcpy(strTemp,strFolderPath); strcat(strTemp,playerdef.files.strSoundFile); strcpy(playerdef.files.strSoundFile,strTemp); + AdjustPath(playerdef.files.strSoundFile); + //correct pal1 strcpy(strTemp,strFolderPath); strcat(strTemp,playerdef.files.strPal[0]); strcpy(playerdef.files.strPal[0],strTemp); + AdjustPath(playerdef.files.strPal[0]); delete[] strFolderPath; delete[] strTemp; @@ -256,6 +270,17 @@ void LoadPlayerDef(const char* strPlayer tok.CloseFile(); } +void AdjustPath(char *strPath) +{ + int len = strlen(strPath)-1; + + while( isspace(strPath[len]) ) + len--; + + strPath[len+1]='\0'; + +} + PlayerConst LoadPlayerConst(const char* strPlayerConst) { CTokenizer tok; Index: global.h =================================================================== RCS file: /cvsroot/openmugen/OpenMugen/src/global.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -p -r1.6 -r1.7 --- global.h 1 Jul 2005 18:04:10 -0000 1.6 +++ global.h 2 Jul 2005 17:13:05 -0000 1.7 @@ -76,6 +76,7 @@ extern CGame *mugen; //functions void PrintMessage(char *str,...); void InitLogFile(); +void AdjustPath(char *strPath); #endif Index: player.cpp =================================================================== RCS file: /cvsroot/openmugen/OpenMugen/src/player.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -p -r1.9 -r1.10 --- player.cpp 1 Jul 2005 18:04:10 -0000 1.9 +++ player.cpp 2 Jul 2005 17:13:05 -0000 1.10 @@ -51,6 +51,7 @@ CPlayer::CPlayer() //this should be a unique player id number nPlayerID=0; nTeamID=0; + lpCurrStatedef = 0; bIsHelper=false; @@ -385,21 +386,13 @@ void CPlayer::CheckSpecialState() PLSTATEDEF *specialStateDef=m_pStateManager->GetStateDef(-3); if(specialStateDef) { - for(u16 i=0;i<specialStateDef->nHowManyState;i++) - { - if( CheckState(&specialStateDef->lpState[i]) ) - ExecuteController(&specialStateDef->lpState[i]); - } + CheckAndExecuteState(specialStateDef); } specialStateDef=m_pStateManager->GetStateDef(-2); if(specialStateDef) { - for(u16 i=0;i<specialStateDef->nHowManyState;i++) - { - if( CheckState(&specialStateDef->lpState[i]) ) - ExecuteController(&specialStateDef->lpState[i]); - } + CheckAndExecuteState(specialStateDef); } @@ -409,17 +402,8 @@ void CPlayer::CheckSpecialState() if(specialStateDef ) { - - for(u16 i=0;i<specialStateDef->nHowManyState;i++) - { - - if( CheckState(&specialStateDef->lpState[i]) ) - { - ExecuteController(&specialStateDef->lpState[i]); - } - } - - } + CheckAndExecuteState(specialStateDef); + } } /* @@ -427,14 +411,29 @@ This checks the Current state of the pla */ void CPlayer::CheckNormalState() { - for(u16 i=0;i<lpCurrStatedef->nHowManyState;i++) + CheckAndExecuteState(lpCurrStatedef); +} + + + +void CPlayer::CheckAndExecuteState(PLSTATEDEF *StateDef) +{ + for(u16 i=0;i<StateDef->nHowManyState;i++) { //save the current controller type for checking for an changeState - u16 nType=lpCurrStatedef->lpState[i].nType; + u16 nType=StateDef->lpState[i].nType; - if( CheckState(&lpCurrStatedef->lpState[i]) ) + if( CheckState(&StateDef->lpState[i]) ) { - ExecuteController(&lpCurrStatedef->lpState[i]); + if ( (StateDef->lpState[i].nPresist == 0 ) && (StateDef->lpState[i].nActivated == 1) ) + ExecuteController(&StateDef->lpState[i]); + + if( (StateDef->lpState[i].nPresist > 0 ) && + ( (StateDef->lpState[i].nActivated % StateDef->lpState[i].nPresist ) == 0) ) + ExecuteController(&StateDef->lpState[i]); + + + StateDef->lpState[i].nActivated++; //we have a change state if(nType==17) { @@ -444,7 +443,7 @@ void CPlayer::CheckNormalState() } } - + } /* @@ -839,7 +838,7 @@ Only a helper can get invalid */ bool CPlayer::isValid() { - + return true; } //handles the facing of the player @@ -978,7 +977,15 @@ void CPlayer::ChangeState(s32 nStateNumb nStateTime=0; //we did a change state bChangeState=true; - //get the statedef + //reset the states + if( lpCurrStatedef ) + { + for( int i = 0;i < lpCurrStatedef->nHowManyState;i++) + { + lpCurrStatedef->lpState[i].nActivated = 1; + } + } + lpCurrStatedef=m_pStateManager->GetStateDef(nStateNumber); // PrintMessage("change state %i",nStateNumber); Index: player.h =================================================================== RCS file: /cvsroot/openmugen/OpenMugen/src/player.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -p -r1.6 -r1.7 --- player.h 29 Jun 2005 12:21:28 -0000 1.6 +++ player.h 2 Jul 2005 17:13:05 -0000 1.7 @@ -456,6 +456,7 @@ private: bool CheckClsn1Collision(ClsnRECT Clsn1,ClsnRECT Clsn2); void ExecuteController(PLSTATE* tempState); void CheckGlobalStatus(); + void CheckAndExecuteState(PLSTATEDEF *StateDef); void HandleFSM(); void HandlePushBehavior(CPlayer *opponent); void HandleHitDef(CPlayer *opponent); |