static BOOL DupChannel( SoundManager *sm, Channel* channel, Channel** dupChannelPtr ) { Channel* dupChannel; HRESULT Error; *dupChannelPtr = NULL; // dupChannel = malloc( sizeof(Channel ) ); dupChannel = geRam_Allocate( sizeof(Channel ) ); if( dupChannel == NULL ) { geErrorLog_Add(GE_ERR_OUT_OF_MEMORY, NULL ); return FALSE; } Error = IDirectSound_DuplicateSoundBuffer( lpDirectSound, channel->buffer, &dupChannel->buffer ); if( Error != DS_OK ) { geRam_Free(dupChannel); // free( dupChannel ); dupChannel = ReloadData( channel->Data ); if( dupChannel == NULL ) { geErrorLog_Add(GE_ERR_DS_ERROR, NULL); return FALSE; } } dupChannel->ID = sm->smNextChannelID++; dupChannel->next = NULL; dupChannel->nextDup = channel->nextDup; dupChannel->cfg = channel->cfg; // dupChannel->name = NULL; dupChannel->Data = channel->Data; channel->nextDup = dupChannel; *dupChannelPtr = dupChannel; return( TRUE ); }
void CDlgLinkList::OnCbnSelchangeComboEndtime() { if(m_StartHour.GetCurSel() >= m_EndHour.GetCurSel()) m_EndHour.SetCurSel(min(24,m_StartHour.GetCurSel()+1)); ReloadData(); }
//-------------------------------------------------------------------------------------------------- // Name: InstanceReplaced // Desc: Replaces instance for soft coding //-------------------------------------------------------------------------------------------------- void GameSDKCGameEffectsSystem::InstanceReplaced(void* pOldInstance, void* pNewInstance) { #ifdef SOFTCODE_ENABLED if(pNewInstance && pOldInstance) { GameSDKIGameEffect* pNewGameEffectInstance = static_cast<GameSDKIGameEffect*>(pNewInstance); GameSDKIGameEffect* pOldGameEffectInstance = static_cast<GameSDKIGameEffect*>(pOldInstance); // Copy over flags and remove registered flag so new effect instance can be registered // We haven't used the SOFT macro on the m_flags member because the oldInstance's flags // would then be Nulled out, and they are needed for the effect to be deregistered uint32 oldGameEffectFlags = pOldGameEffectInstance->GetFlags(); SET_FLAG(oldGameEffectFlags,GAME_EFFECT_REGISTERED,false); pNewGameEffectInstance->SetFlags(oldGameEffectFlags); // Register new effect instance, old instance will get unregistered by destructor GAME_FX_SYSTEM.RegisterEffect(pNewGameEffectInstance); // Reload all data used by effects, then data can be added/removed for soft coding ReloadData(); // Data used by effect will be copied to new effect, so mustn't release it but // must set flag so destructor doesn't assert pOldGameEffectInstance->SetFlag(GAME_EFFECT_RELEASED,true); } #endif }//-------------------------------------------------------------------------------------------------
void CDlgLinkList::OnCbnSelchangeComboLinkSelection() { m_LinkSelectionMode = (eLinkSelectionMode) m_ComboBox.GetCurSel(); ReloadData(); }
BOOL CDlgLinkList::OnInitDialog() { CDialog::OnInitDialog(); m_ComboBox.AddString ("All Links"); m_ComboBox.AddString ("Selected Links"); m_ComboBox.AddString ("Within Subarea"); m_ComboBox.AddString ("Freeway"); m_ComboBox.AddString ("Highway"); m_ComboBox.AddString ("Arterial"); m_ComboBox.AddString ("Ramp"); m_ComboBox.AddString ("Connectors"); m_ComboBox.AddString ("All Links Except Connectors"); for (int i = 0; i<= 24; i++) { CString str; str.Format("%d",i); m_StartHour.AddString (str); m_EndHour.AddString (str); } m_StartHour.SetCurSel(0); m_EndHour.SetCurSel(24); m_ComboBox.SetCurSel (0); // Give better margin to editors m_ListCtrl.SetCellMargin(1.2); CGridRowTraitXP* pRowTrait = new CGridRowTraitXP; // Hao: this ponter should be delete. m_ListCtrl.SetDefaultRowTrait(pRowTrait); ReloadData(); return true; }
void CDlgLinkList::OnLinkselectionShowselectedlinksonly() { m_LinkSelectionMode = eLinkSelection_SelectedLinksOnly; ReloadData(); }
void CDlgLinkList::OnLinkselectionShowalllinksexceptconnectors() { m_LinkSelectionMode = eLinkSelection_NoConnectors; ReloadData(); }
void CDlgLinkList::OnLinkselectionShowarteriallinksonly() { m_LinkSelectionMode = eLinkSelection_ArterialOnly; ReloadData(); }
void CDlgLinkList::OnLinkselectionShowramplinksonly() { m_LinkSelectionMode = eLinkSelection_RampOnly; ReloadData(); }
void CDlgLinkList::OnLinkselectionShowhighwaylinksonly() { m_LinkSelectionMode = eLinkSelection_FreewayOnly; ReloadData(); }
void CDlgLinkList::OnLinkselectionShowalllinks() { m_LinkSelectionMode = eLinkSelection_AllLinks; ReloadData(); }
//-------------------------------------------------------------------------------------------------- // Name: OnInputEvent // Desc: Handles any debug input for the game effects system to test effects //-------------------------------------------------------------------------------------------------- bool GameSDKCGameEffectsSystem::OnInputEvent(const SInputEvent& inputEvent) { #if DEBUG_GAME_FX_SYSTEM int debugEffectCount = s_effectDebugList.Size(); if((g_pGameCVars->g_gameFXSystemDebug) && (debugEffectCount > 0)) { if(inputEvent.deviceType == eIDT_Keyboard && inputEvent.state == eIS_Pressed) { switch(inputEvent.keyId) { case GAME_FX_INPUT_IncrementDebugEffectId: { if(s_currentDebugEffectId < (debugEffectCount-1)) { s_currentDebugEffectId++; } break; } case GAME_FX_INPUT_DecrementDebugEffectId: { if(s_currentDebugEffectId > 0) { s_currentDebugEffectId--; } break; } case GAME_FX_INPUT_DecrementDebugView: { if(m_debugView > 0) { OnDeActivateDebugView(m_debugView); m_debugView--; OnActivateDebugView(m_debugView); } break; } case GAME_FX_INPUT_IncrementDebugView: { if(m_debugView < (eMAX_GAME_FX_DEBUG_VIEWS-1)) { OnDeActivateDebugView(m_debugView); m_debugView++; OnActivateDebugView(m_debugView); } break; } case GAME_FX_INPUT_ReloadEffectData: { ReloadData(); break; } case GAME_FX_INPUT_ResetParticleManager: { gEnv->pParticleManager->Reset(false); break; } case GAME_FX_INPUT_PauseParticleManager: { #if DEBUG_GAME_FX_SYSTEM ICVar* pParticleDebugCVar = gEnv->pConsole->GetCVar("e_ParticlesDebug"); if(pParticleDebugCVar) { int flagValue = pParticleDebugCVar->GetIVal(); if(flagValue & AlphaBit('z')) { flagValue &= ~AlphaBit('z'); } else { flagValue |= AlphaBit('z'); } pParticleDebugCVar->Set(flagValue); } #endif break; } } // Send input to current debug effect if(s_effectDebugList[s_currentDebugEffectId].inputCallback) { s_effectDebugList[s_currentDebugEffectId].inputCallback(inputEvent.keyId); } } } #endif return false; // Return false so that other listeners will get this event }//-------------------------------------------------------------------------------------------------