|
From: SakirSoft <sak...@us...> - 2005-09-16 11:35:14
|
Update of /cvsroot/openmugen/OpenMugen/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20093 Modified Files: AirManager.cpp AirManager.h CmdManager.cpp ControllerExecuter.cpp StateParser.cpp StateParser.h player.cpp Log Message: Changed ClsnRect from ints to floats for Fixed HitPause Handling Fixed Clsn scaling and Image scaling depending on players def values Index: AirManager.cpp =================================================================== RCS file: /cvsroot/openmugen/OpenMugen/src/AirManager.cpp,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -p -r1.1.1.1 -r1.2 --- AirManager.cpp 30 Aug 2005 15:09:03 -0000 1.1.1.1 +++ AirManager.cpp 16 Sep 2005 11:35:04 -0000 1.2 @@ -282,14 +282,14 @@ void CAirManager::OpenAir(char *strFileN } else if( tok.CheckTokenIsNumber() ) { - int values[5]; + float values[5]; for( int v = 0; v < 5; v++ ) { if( !tok.CheckTokenIsNumber() ) { } - values[ v ] = tok.GetInt(); + values[ v ] = tok.GetFloat(); if( v < 4 ) { Index: AirManager.h =================================================================== RCS file: /cvsroot/openmugen/OpenMugen/src/AirManager.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -p -r1.1.1.1 -r1.2 --- AirManager.h 30 Aug 2005 15:09:03 -0000 1.1.1.1 +++ AirManager.h 16 Sep 2005 11:35:04 -0000 1.2 @@ -34,8 +34,8 @@ enum struct ClsnRECT { - s16 x,y; - s16 h,w; + float x,y; + float h,w; }; //Clsn Struct to hold one Clns Rectangle with type Index: CmdManager.cpp =================================================================== RCS file: /cvsroot/openmugen/OpenMugen/src/CmdManager.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -p -r1.2 -r1.3 --- CmdManager.cpp 12 Sep 2005 20:04:17 -0000 1.2 +++ CmdManager.cpp 16 Sep 2005 11:35:04 -0000 1.3 @@ -484,7 +484,7 @@ void CCmdManager::Update( bool* gameInpu //copy the detected command it to the command buffer strcpy( strCommandBuffer[nBufferIndex], m_CurrCommandName); - // PrintMessage("%s",m_CurrCommandName); + // PrintMessage("%s",m_CurrCommandName); if( ++nBufferIndex >= MaxCommandBuffer) nBufferIndex=0; Index: ControllerExecuter.cpp =================================================================== RCS file: /cvsroot/openmugen/OpenMugen/src/ControllerExecuter.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -p -r1.4 -r1.5 --- ControllerExecuter.cpp 12 Sep 2005 20:04:17 -0000 1.4 +++ ControllerExecuter.cpp 16 Sep 2005 11:35:04 -0000 1.5 @@ -690,7 +690,7 @@ void CControllerExecuter::TargetState() void CControllerExecuter::PlaySnd() { PLAYSND *temp = (PLAYSND*)lpController; - int SndGrp = temp->group_no; + int SndGrp = m_pVM->Execute(temp->group_no); int SndItem = (int)m_pVM->Execute(temp->item_no); if(temp->bFightSnd) Index: StateParser.cpp =================================================================== RCS file: /cvsroot/openmugen/OpenMugen/src/StateParser.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -p -r1.4 -r1.5 --- StateParser.cpp 12 Sep 2005 20:04:17 -0000 1.4 +++ StateParser.cpp 16 Sep 2005 11:35:04 -0000 1.5 @@ -2836,20 +2836,9 @@ void CStateParser::ParsePlaySnd() if( !tok.CheckToken("=") ) Error("expected ="); - - char strPlaySound[20]; - strcpy(strPlaySound,tok.GetToken()); - - if( ( strPlaySound[0] == 'F' ) || ( strPlaySound[0] == 'f' ) ) - { - temp->bFightSnd = true; - strPlaySound[0]= '0'; - temp->group_no= atoi(strPlaySound); - - } - else - temp->group_no= atoi(strPlaySound); - + temp->bFightSnd = tok.CheckToken("F"); + temp->group_no= GenerateInstruction(); + if(tok.CheckToken(",") ) temp->item_no = GenerateInstruction(); Index: StateParser.h =================================================================== RCS file: /cvsroot/openmugen/OpenMugen/src/StateParser.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -p -r1.3 -r1.4 --- StateParser.h 12 Sep 2005 20:04:17 -0000 1.3 +++ StateParser.h 16 Sep 2005 11:35:04 -0000 1.4 @@ -961,7 +961,7 @@ struct PALFX struct PLAYSND { bool bFightSnd; - s32 group_no; + INSTRUCTION* group_no; INSTRUCTION* item_no; INSTRUCTION* volume; INSTRUCTION* channel; Index: player.cpp =================================================================== RCS file: /cvsroot/openmugen/OpenMugen/src/player.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -p -r1.4 -r1.5 --- player.cpp 12 Sep 2005 20:04:17 -0000 1.4 +++ player.cpp 16 Sep 2005 11:35:04 -0000 1.5 @@ -163,10 +163,10 @@ bool CPlayer::LoadPlayer(PlayerDef playe defInfo=playerdef; memset(&ConstData,0,sizeof(ConstData)); - if( defInfo.info.mugenVersion.day != 31 || +/* if( defInfo.info.mugenVersion.day != 31 || defInfo.info.mugenVersion.month != 12 || defInfo.info.mugenVersion.year != 2005 ) - throw(CError("This Charackter (%s) is not supported by OpenMugen yet\nIt will be a intern or extern converter avaibale\n ",defInfo.info.strDisplayName) ); + throw(CError("This Charackter (%s) is not supported by OpenMugen yet\nIt will be a intern or extern converter avaibale\n ",defInfo.info.strDisplayName) );*/ CStateParser StateParser; //rest memory allocater @@ -505,17 +505,20 @@ ClsnRECT CPlayer::ConvertClsnRectToGloba if(!bRightFaced) { - temp.w = abs(clsn.ClsnRect.x-clsn.ClsnRect.w); - temp.h = abs(clsn.ClsnRect.h-clsn.ClsnRect.y); - temp.x = clsn.ClsnRect.x > clsn.ClsnRect.w ? (-clsn.ClsnRect.x)+x : (-clsn.ClsnRect.w)+x; - temp.y = clsn.ClsnRect.y < clsn.ClsnRect.h ? clsn.ClsnRect.y+y : clsn.ClsnRect.h+y; + temp.w = fabs(clsn.ClsnRect.x*x_scale-clsn.ClsnRect.w*x_scale); + temp.h = fabs(clsn.ClsnRect.h*y_scale-clsn.ClsnRect.y*y_scale); + temp.x = clsn.ClsnRect.x > clsn.ClsnRect.w ? (-clsn.ClsnRect.x*x_scale)+x : (-clsn.ClsnRect.w*x_scale)+x; + temp.y = clsn.ClsnRect.y < clsn.ClsnRect.h ? clsn.ClsnRect.y*y_scale+y : clsn.ClsnRect.h*y_scale+y; + + + } else { - temp.w = abs(clsn.ClsnRect.x-clsn.ClsnRect.w); - temp.h = abs(clsn.ClsnRect.h-clsn.ClsnRect.y); - temp.x = clsn.ClsnRect.x < clsn.ClsnRect.w ? clsn.ClsnRect.x+x : clsn.ClsnRect.w+x; - temp.y = clsn.ClsnRect.y < clsn.ClsnRect.h ? clsn.ClsnRect.y+y : clsn.ClsnRect.h+y; + temp.w = fabs(clsn.ClsnRect.x*x_scale-clsn.ClsnRect.w*x_scale); + temp.h = fabs(clsn.ClsnRect.h*y_scale-clsn.ClsnRect.y*y_scale); + temp.x = clsn.ClsnRect.x < clsn.ClsnRect.w ? clsn.ClsnRect.x*x_scale+x : clsn.ClsnRect.w*x_scale+x; + temp.y = clsn.ClsnRect.y < clsn.ClsnRect.h ? clsn.ClsnRect.y*y_scale+y : clsn.ClsnRect.h*y_scale+y; } @@ -936,11 +939,12 @@ funcion is in its name ;-) bool CPlayer::CheckClsn1Collision(ClsnRECT Clsn1,ClsnRECT Clsn2) { //taken from SDL_CollideBoundingBox from the SDL Collid lib - if(Clsn2.x + Clsn2.w < Clsn1.x) return 0; //just checking if their - if(Clsn2.x > Clsn1.x + Clsn1.w) return 0; //bounding boxes even touch + if( (Clsn2.x + Clsn2.w) < Clsn1.x) return 0; //just checking if their + if( Clsn2.x > (Clsn1.x + Clsn1.w)) return 0; //bounding boxes even touch - if(Clsn2.y + Clsn2.h < Clsn1.y) return 0; - if(Clsn2.y > Clsn1.y + Clsn1.h) return 0; + if( (Clsn2.y + Clsn2.h ) < Clsn1.y) return 0; + if( Clsn2.y > (Clsn1.y + Clsn1.h) ) return 0; + return 1; @@ -1106,8 +1110,8 @@ void CPlayer::CheckGlobalStatus() m_pVMachine->SetPlayers(this,opponent); m_pControllerExec->SetPlayer(this,opponent); HandleFSM(); - HandlePushBehavior(opponent); HandleHitDef(opponent); + HandlePushBehavior(opponent); HandleGetHitState(); } @@ -1149,17 +1153,21 @@ void CPlayer::Think() m_pCmdManager->Update( inputs, bRightFaced ); m_pInputProcessor->Update( inputs, m_pEngine->GetJoyCount(), m_pEngine->GetJoyInfo() ); + CheckGlobalStatus(); m_pSffManager->SetSprPrior(nSprPrio); - + UpDateHitPause(); + //only update the state time if we ar not maked a changestate if(!bChangeState && !bPause && !bHitPause) nStateTime++; ResetFlags(); UpDateFacing(); - UpDateHitPause(); + + + } DrawPlayer(); @@ -1311,7 +1319,7 @@ void CPlayer::Debug() m_pVideoSystem->DrawText(0,120,"HitBy1 = %i | NotHitBy1 = %i",HitBySlot1.nTime,NotHitBySlot1.nTime); m_pVideoSystem->DrawText(0,130,"HitBy2 = %i | NotHitBy2 = %i",HitBySlot2.nTime,NotHitBySlot2.nTime); m_pVideoSystem->DrawText(0,140,"HitTime = %i| HitPause =%i | HitShakeOver %i",nHitPauseTime,bHitPause,HitShakeOver()); - m_pVideoSystem->DrawText(0,150,"Defence = %f | AttackPower = %f | ExplodNum %i",fDefence,fAttackPower,m_ExplodList.size()); + m_pVideoSystem->DrawText(0,150,"Defence = %f | AttackPower = %f | ExplodNum %i",fDefence,fAttackPower,bHitPause); @@ -1373,7 +1381,7 @@ void CPlayer::ResetPlayer() //he is alive again bAlive=true; bCtrl=true; - nLife=1;//ConstData.Data.nLife; + nLife=ConstData.Data.nLife; nFront=ConstData.Size.nGroundFront; nBack=ConstData.Size.nGroundBack; bChangeState=false; |