void GLWindow::ProcessEvents() { FUNCLOG #ifdef USE_GSOPEN2 GetWindowSize(); #else ResizeCheck(); #endif if (THR_KeyEvent) // This value was passed from GSKeyEvents which could be in another thread { int my_KeyEvent = THR_KeyEvent; bool my_bShift = THR_bShift; bool my_bCtrl = THR_bCtrl; THR_KeyEvent = 0; switch (my_KeyEvent) { case XK_F5: case XK_F6: case XK_F7: case XK_F9: // Note: to avoid some clash with PCSX2 shortcut in GSOpen2. // GS shortcut will only be activated when ctrl is press if (my_bCtrl) OnFKey(my_KeyEvent - XK_F1 + 1, my_bShift); break; } } }
void SjRingbuffer::RemoveFromBeg(long bytesToRemove) { // Remove some bytes from the beginning of the buffer. // If you use this function in different threads, don't forget // to call Lock()/Unlock(). // // It is okay to remove 0 bytes in which case the function does nothing. if( bytesToRemove > m_validBytes ) { bytesToRemove = m_validBytes; } // correct buffer m_validPos = (m_validPos + bytesToRemove) % m_totalBytes; m_validBytes -= bytesToRemove; // are the valid bytes small enough to perform a possibly waiting buffer shrinking? ResizeCheck(); }
void SjRingbuffer::Empty() { m_validPos = 0; m_validBytes = 0; ResizeCheck(); }