Small fixes.

This commit is contained in:
spartanj@gmail.com
2011-07-31 17:11:32 -03:00
parent c079fc296a
commit 4e482d925e
2 changed files with 14 additions and 3 deletions

View File

@@ -229,11 +229,16 @@ cLightManager::LightsList& cLightManager::GetLights() {
cLight * cLightManager::GetLightOver( const eeVector2f& OverPos, cLight * LightCurrent ) {
cLight * PivotLight = NULL;
cLight * LastLight = NULL;
cLight * FirstLight = NULL;
for ( LightsList::reverse_iterator it = mLights.rbegin(); it != mLights.rend(); it++ ) {
cLight * Light = (*it);
if ( Contains( Light->GetAABB(), OverPos ) ) {
if ( NULL == FirstLight ) {
FirstLight = Light;
}
if ( NULL != LightCurrent ) {
if ( Light != LightCurrent ) {
PivotLight = Light;
@@ -250,6 +255,10 @@ cLight * cLightManager::GetLightOver( const eeVector2f& OverPos, cLight * LightC
}
}
if ( LastLight == LightCurrent && NULL != FirstLight ) {
return FirstLight;
}
if ( NULL == PivotLight && NULL != LightCurrent && Contains( LightCurrent->GetAABB(), OverPos ) ) {
return LightCurrent;
}

View File

@@ -1098,11 +1098,13 @@ void cMap::SaveToStream( cIOStream& IOS ) {
}
void cMap::Save( const std::string& path ) {
cIOStreamFile IOS( path, std::ios::out | std::ios::binary );
if ( !IsDirectory( path ) ) {
cIOStreamFile IOS( path, std::ios::out | std::ios::binary );
SaveToStream( IOS );
SaveToStream( IOS );
mPath = path;
mPath = path;
}
}
std::vector<std::string> cMap::GetShapeGroups() {