merge with stops fix

This commit is contained in:
Thai Pangsakulyanont
2011-03-31 23:31:29 +07:00
18 changed files with 97 additions and 33 deletions
+3
View File
@@ -21,6 +21,7 @@ ___*
.cvsignore
.DS_Store
Thumbs.db
GameData.smzip
config.log
config.status
*.pbxuser
@@ -73,6 +74,8 @@ Program/StepMania*.lib
crashinfo.txt
Utils/temp*
*.lnk
BuildLog.htm
*.pch
syntax: regexp
.*\#.*\#$
+11
View File
@@ -9,6 +9,17 @@ Not all changes are documented, for various reasons.
supported but exist anyways.)
_____________________________________________________________________________
================================================================================
sm-ssc $NEXTVERSION | 2011????
--------------------------------------------------------------------------------
It depends on who you ask.
It could be v1.2.5, it could be v1.3.0, it could even be StepMania 5.
20110329
--------
* [ScreenEdit] Changed sample playback button to L. [AJ]
* [ScreenGameplay] Announcers say combo messages again. [AJ]
================================================================================
sm-ssc v1.2.4 | 20110327
--------------------------------------------------------------------------------
+1 -1
View File
@@ -25,7 +25,7 @@ ret.Redir = function(sButton, sElement)
-- Test
if sElement == "Hold Head Inactive" or
sElement == "Roll Head Inactive" or
sElement == "Roll Head Inactive"
then
sElement = "StreamHead Inactive";
end
+3 -2
View File
@@ -1996,7 +1996,7 @@ ShowAutogen=true
AutogenX=40
AutogenY=0
AutogenOnCommand=
AutogenSetCommand=%function(self,param) if param.CustomDifficulty then self:diffuse(CustomDifficultyToLightColor(param.CustomDifficulty)); self:strokecolor(CustomDifficultyToDarkColor(param.CustomDifficulty)); end end
AutogenSetCommand=
ShowStepsType=false
StepsTypeX=0
StepsTypeY=0
@@ -3615,13 +3615,14 @@ CancelTransitionsOut=true
PlayMusic=false
TimerSeconds=-1
ShowStyleIcon=false
LineNames="1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16"
LineNames="1,2,3,4,5,6,R,7,8,9,10,11,12,13,14,15,16"
Line1="list,Speed"
Line2="list,Accel"
Line3="list,Effect"
Line4="list,Appearance"
Line5="list,Turn"
Line6="list,Insert"
LineR="list,Remove"
Line7="list,Scroll"
Line8="list,NoteSkins"
Line9="list,Holds"
+8
View File
@@ -150,6 +150,7 @@ my @files = (
"Characters/default",
"Courses/Default",
"Data",
"NoteSkins/beat/default",
"NoteSkins/common/common",
# dance noteskins
"NoteSkins/dance/default",
@@ -166,8 +167,13 @@ my @files = (
"NoteSkins/dance/retrobar-splithand_whiteblue",
# pump noteskins
"NoteSkins/pump/cmd",
"NoteSkins/pump/cmd-routine-p1",
"NoteSkins/pump/cmd-routine-p2",
"NoteSkins/pump/complex",
"NoteSkins/pump/default",
"NoteSkins/pump/frame5p",
"NoteSkins/pump/newextra",
"NoteSkins/pump/rhythm",
"NoteSkins/pump/simple",
# kb7 noteskins
"NoteSkins/kb7/default",
@@ -175,6 +181,8 @@ my @files = (
"NoteSkins/kb7/retrobar",
"NoteSkins/kb7/retrobar-iidx",
"NoteSkins/kb7/retrobar-o2jam",
"NoteSkins/kb7/retrobar-razor",
"NoteSkins/kb7/retrobar-razor_o2",
# themes
"Themes/_fallback",
"Themes/_portKit-sm4",
+4 -2
View File
@@ -142,7 +142,8 @@ static void StartMusic( MusicToPlay &ToPlay )
{
LOG->Trace( "Found '%s'", ToPlay.m_sTimingFile.c_str() );
Song song;
if( SSCLoader::LoadFromSSCFile(ToPlay.m_sTimingFile, song) )
if( GetExtension(ToPlay.m_sTimingFile.c_str()) == ".ssc" &&
SSCLoader::LoadFromSSCFile(ToPlay.m_sTimingFile, song) )
{
ToPlay.HasTiming = true;
ToPlay.m_TimingData = song.m_Timing;
@@ -151,7 +152,8 @@ static void StartMusic( MusicToPlay &ToPlay )
if( pStepsCabinetLights )
pStepsCabinetLights->GetNoteData( ToPlay.m_LightsData );
}
else if( SMLoader::LoadFromSMFile(ToPlay.m_sTimingFile, song) )
else if( GetExtension(ToPlay.m_sTimingFile.c_str()) == ".sm" &&
SMLoader::LoadFromSMFile(ToPlay.m_sTimingFile, song) )
{
ToPlay.HasTiming = true;
ToPlay.m_TimingData = song.m_Timing;
+1 -3
View File
@@ -287,7 +287,7 @@ static RString GetSMNotesTag( const Song &song, const Steps &in )
return JoinLineList( lines );
}
bool NotesWriterSM::Write( RString sPath, const Song &out )
bool NotesWriterSM::Write( RString sPath, const Song &out, const vector<Steps*>& vpStepsToSave )
{
int flags = RageFile::WRITE;
@@ -302,8 +302,6 @@ bool NotesWriterSM::Write( RString sPath, const Song &out )
WriteGlobalTags( f, out );
// Save specified Steps to this file
const vector<Steps*>& vpStepsToSave = out.GetAllSteps();
FOREACH_CONST( Steps*, vpStepsToSave, s )
{
const Steps* pSteps = *s;
+1 -1
View File
@@ -11,7 +11,7 @@ namespace NotesWriterSM
* @param sPath the path to write the file.
* @param out the Song to be written out.
* @return its success or failure. */
bool Write( RString sPath, const Song &out );
bool Write( RString sPath, const Song &out, const vector<Steps*>& vpStepsToSave );
/**
* @brief Get some contents about the edit file first.
* @param pSong the Song in question.
+8 -7
View File
@@ -315,8 +315,9 @@ public:
float level;
// Mouse coordinates
unsigned x;
unsigned y;
//unsigned x;
//unsigned y;
int z; // mousewheel
/* Whether this button is pressed. This is level with a threshold and
* debouncing applied. */
@@ -324,12 +325,12 @@ public:
RageTimer ts;
DeviceInput(): device(InputDevice_Invalid), button(DeviceButton_Invalid), level(0), x(0), y(0), bDown(false), ts(RageZeroTimer) { }
DeviceInput( InputDevice d, DeviceButton b, float l=0 ): device(d), button(b), level(l), x(0), y(0), bDown(l > 0.5f), ts(RageZeroTimer) { }
DeviceInput(): device(InputDevice_Invalid), button(DeviceButton_Invalid), level(0), z(0), bDown(false), ts(RageZeroTimer) { }
DeviceInput( InputDevice d, DeviceButton b, float l=0 ): device(d), button(b), level(l), z(0), bDown(l > 0.5f), ts(RageZeroTimer) { }
DeviceInput( InputDevice d, DeviceButton b, float l, const RageTimer &t ):
device(d), button(b), level(l), x(0), y(0), bDown(level > 0.5f), ts(t) { }
DeviceInput( InputDevice d, DeviceButton b, const RageTimer &t, unsigned xPos=0, unsigned yPos=0 ):
device(d), button(b), level(0), x(xPos), y(yPos), bDown(false), ts(t) { }
device(d), button(b), level(l), z(0), bDown(level > 0.5f), ts(t) { }
DeviceInput( InputDevice d, DeviceButton b, const RageTimer &t, int zVal=0 ):
device(d), button(b), level(0), z(zVal), bDown(false), ts(t) { }
bool operator==( const DeviceInput &other ) const
{
+2 -3
View File
@@ -207,7 +207,7 @@ void ScreenEdit::InitEditMappings()
m_EditMappingsDeviceInput.hold[EDIT_BUTTON_SAMPLE_LENGTH_DOWN][0] = DeviceInput(DEVICE_KEYBOARD, KEY_LSHIFT);
m_EditMappingsDeviceInput.hold[EDIT_BUTTON_SAMPLE_LENGTH_DOWN][1] = DeviceInput(DEVICE_KEYBOARD, KEY_RSHIFT);
m_EditMappingsDeviceInput.button[EDIT_BUTTON_PLAY_SAMPLE_MUSIC][0] = DeviceInput(DEVICE_KEYBOARD, KEY_Cm);
m_EditMappingsDeviceInput.button[EDIT_BUTTON_PLAY_SAMPLE_MUSIC][0] = DeviceInput(DEVICE_KEYBOARD, KEY_Cl);
m_EditMappingsDeviceInput.button[EDIT_BUTTON_OPEN_BGCHANGE_LAYER1_MENU][0] = DeviceInput(DEVICE_KEYBOARD, KEY_Cb);
m_EditMappingsDeviceInput.button[EDIT_BUTTON_OPEN_BGCHANGE_LAYER2_MENU][0] = DeviceInput(DEVICE_KEYBOARD, KEY_Cb);
@@ -2647,8 +2647,7 @@ void ScreenEdit::HandleScreenMessage( const ScreenMessage SM )
else if ( SM == SM_BackFromWarpChange )
{
float fWarp = StringToFloat( ScreenTextEntry::s_sLastAnswer );
if( fWarp > 0 )
m_pSong->m_Timing.SetWarpAtBeat( GAMESTATE->m_fSongBeat, fWarp );
m_pSong->m_Timing.SetWarpAtBeat( GAMESTATE->m_fSongBeat, fWarp );
SetDirty( true );
}
else if( SM == SM_BackFromBGChange )
+4 -2
View File
@@ -2517,9 +2517,11 @@ void ScreenGameplay::HandleScreenMessage( const ScreenMessage SM )
if( !m_Toasty.IsTransitioning() && !m_Toasty.IsFinished() ) // don't play if we've already played it once
m_Toasty.StartTransitioning();
}
else if( SM >= SM_100Combo && SM <= SM_1000Combo )
else if( ScreenMessageHelpers::ScreenMessageToString(SM).find("0Combo") != string::npos )
{
int iCombo = ( SM-(SM_100Combo+1) ) * 100;
int iCombo;
RString sCropped = ScreenMessageHelpers::ScreenMessageToString(SM).substr(3);
sscanf(sCropped.c_str(),"%d%*s",&iCombo);
PlayAnnouncer( ssprintf("gameplay %d combo",iCombo), 2 );
}
else if( SM == SM_ComboStopped )
+16 -1
View File
@@ -925,7 +925,22 @@ bool Song::SaveToSMFile()
// If the file exists, make a backup.
if( IsAFile(sPath) )
FileCopy( sPath, sPath + ".old" );
return NotesWriterSM::Write( sPath, *this );
vector<Steps*> vpStepsToSave;
FOREACH_CONST( Steps*, m_vpSteps, s )
{
Steps *pSteps = *s;
if( pSteps->IsAutogen() )
continue; // don't write autogen notes
// Only save steps that weren't loaded from a profile.
if( pSteps->WasLoadedFromProfile() )
continue;
vpStepsToSave.push_back( pSteps );
}
return NotesWriterSM::Write( sPath, *this, vpStepsToSave );
}
@@ -46,6 +46,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\libpng\include;..\zlib"
PreprocessorDefinitions="WIN32;_WINDOWS;_DEBUG"
MinimalRebuild="true"
BasicRuntimeChecks="3"
@@ -70,8 +71,10 @@
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="libpng.lib;zdll.lib"
OutputFile="..\..\Program\$(ProjectName)-debug.exe"
LinkIncremental="2"
AdditionalLibraryDirectories="..\libpng\lib;..\zlib"
GenerateDebugInformation="true"
SubSystem="2"
RandomizedBaseAddress="1"
@@ -132,6 +135,7 @@
Optimization="2"
InlineFunctionExpansion="1"
OmitFramePointers="true"
AdditionalIncludeDirectories="..\libpng\include;..\zlib"
PreprocessorDefinitions="WIN32;_WINDOWS;NDEBUG"
StringPooling="true"
MinimalRebuild="false"
@@ -157,8 +161,10 @@
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="libpng.lib zdll.lib"
OutputFile="..\..\Program\$(ProjectName).exe"
LinkIncremental="1"
AdditionalLibraryDirectories="..\libpng\lib;..\zlib"
GenerateManifest="true"
GenerateDebugInformation="true"
SubSystem="2"
+1 -1
View File
@@ -170,7 +170,7 @@ bool SavePNG( FILE *f, char szErrorbuf[1024], const Surface *pSurf )
if( setjmp(pPng->jmpbuf) )
{
png_destroy_read_struct( &pPng, &pInfo, png_infopp_NULL );
png_destroy_read_struct( &pPng, &pInfo, NULL );
return false;
}
+1 -1
View File
@@ -546,7 +546,7 @@ void TimingData::GetBeatAndBPSFromElapsedTimeNoOffset( float fElapsedTime, float
fBPS = itBPMS->m_fBPS;
itBPMS ++;
break;
case FOUND_STOP: // TODO: update for Delays.
case FOUND_STOP:
{
fTimeToNextEvent = itSS->m_fStopSeconds;
fNextEventTime = fLastTime + fTimeToNextEvent;
@@ -413,12 +413,21 @@ void InputHandler_DInput::UpdatePolled( DIDevice &device, const RageTimer &tm )
break;
case DIMOFS_Z:
{
neg = MOUSE_WHEELUP; pos = MOUSE_WHEELDOWN;
neg = MOUSE_WHEELDOWN; pos = MOUSE_WHEELUP;
val = state.lZ;
//LOG->Trace("MouseWheel polled: %i",val);
INPUTFILTER->UpdateMouseWheel(val);
float l = SCALE( int(val), -120.0f, 120.0f, 0.0f, 1.0f );
ButtonPressed( DeviceInput(dev, neg, max(-l,0), tm) );
ButtonPressed( DeviceInput(dev, pos, max(+l,0), tm) );
/*
if( (int)val != 0 )
{
// positive values: WheelUp
// negative values: WheelDown
float l = SCALE( int(val), -120.0f, 120.0f, -1.0f, 1.0f );
ButtonPressed( DeviceInput(dev, neg, max(-l,0), tm) );
ButtonPressed( DeviceInput(dev, pos, max(+l,0), tm) );
}
*/
}
break;
default: LOG->MapLog( "unknown input",
@@ -515,10 +524,12 @@ void InputHandler_DInput::UpdateBuffered( DIDevice &device, const RageTimer &tm
INPUTFILTER->UpdateCursorLocation((float)cursorPos.x,(float)cursorPos.y);
break;
case DIMOFS_Z:
// positive values: WheelUp
// negative values: WheelDown
INPUTFILTER->UpdateMouseWheel(l);
{
up = MOUSE_WHEELUP; down = MOUSE_WHEELDOWN;
l = SCALE( int(evtbuf[i].dwData), -120.0f, 120.0f, 1.0f, -1.0f );
l = SCALE( int(evtbuf[i].dwData), -WHEEL_DELTA, WHEEL_DELTA, 1.0f, -1.0f );
DeviceInput diUp = DeviceInput(dev, up, max(-l,0), tm);
DeviceInput diDown = DeviceInput(dev, down, max(+l,0), tm);
ButtonPressed( diUp );
@@ -247,10 +247,10 @@ InputHandler_MacOSX_HID::InputHandler_MacOSX_HID() : m_Sem( "Input thread starte
// Add devices.
LOG->Trace( "Finding keyboards" );
AddDevices( kHIDPage_GenericDesktop, kHIDUsage_GD_Keyboard, id );
/*
LOG->Trace( "Finding mice" );
AddDevices( kHIDPage_GenericDesktop, kHIDUsage_GD_Mouse, id );
*/
LOG->Trace( "Finding joysticks" );
id = DEVICE_JOY1;
AddDevices( kHIDPage_GenericDesktop, kHIDUsage_GD_Joystick, id );
+9 -2
View File
@@ -60,6 +60,7 @@ void MouseDevice::AddElement( int usagePage, int usage, IOHIDElementCookie cooki
m.y_max = iMax;
break;
case kHIDUsage_GD_Z:
case kHIDUsage_GD_Wheel: // also handle wheel
m.z_axis = cookie;
m.z_min = iMin;
m.z_max = iMax;
@@ -102,13 +103,19 @@ void MouseDevice::GetButtonPresses( vector<DeviceInput>& vPresses, IOHIDElementC
{
// todo: add mouse axis stuff -aj
const Mouse& m = m_Mouse;
HRESULT result;
IOHIDEventStruct hidEvent;
// result = (*m_Interface)->getElementValue(hidDeviceInterface,cookie,&hidEvent);
if( m.x_axis == cookie )
{
// INPUTFILTER->UpdateCursorLocation(value,m.y_axis);
//INPUTFILTER->UpdateCursorLocation(value,m.y_axis);
LOG->Trace("Mouse X: Value = %i",value);
}
else if( m.y_axis == cookie )
{
// INPUTFILTER->UpdateCursorLocation(m.x_axis,value);
//INPUTFILTER->UpdateCursorLocation(m.x_axis,value);
LOG->Trace("Mouse Y: Value = %i",value);
}
else if( m.z_axis == cookie )
{