Compare commits
2 Commits
ffacff67cf
...
d4903caafa
Author | SHA1 | Date |
---|---|---|
Bananymous | d4903caafa | |
Bananymous | caa0111c79 |
|
@ -31,6 +31,9 @@ namespace BAN
|
||||||
const T& front() const;
|
const T& front() const;
|
||||||
T& front();
|
T& front();
|
||||||
|
|
||||||
|
const T& back() const;
|
||||||
|
T& back();
|
||||||
|
|
||||||
size_type size() const { return m_size; }
|
size_type size() const { return m_size; }
|
||||||
bool empty() const { return size() == 0; }
|
bool empty() const { return size() == 0; }
|
||||||
bool full() const { return size() == capacity(); }
|
bool full() const { return size() == capacity(); }
|
||||||
|
@ -98,6 +101,20 @@ namespace BAN
|
||||||
return *element_at(m_first);
|
return *element_at(m_first);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template<typename T, size_t S>
|
||||||
|
const T& CircularQueue<T, S>::back() const
|
||||||
|
{
|
||||||
|
ASSERT(!empty());
|
||||||
|
return *element_at((m_first + m_size - 1) % capacity());
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T, size_t S>
|
||||||
|
T& CircularQueue<T, S>::back()
|
||||||
|
{
|
||||||
|
ASSERT(!empty());
|
||||||
|
return *element_at((m_first + m_size - 1) % capacity());
|
||||||
|
}
|
||||||
|
|
||||||
template<typename T, size_t S>
|
template<typename T, size_t S>
|
||||||
const T* CircularQueue<T, S>::element_at(size_type index) const
|
const T* CircularQueue<T, S>::element_at(size_type index) const
|
||||||
{
|
{
|
||||||
|
|
|
@ -165,6 +165,22 @@ namespace Kernel::Input
|
||||||
|
|
||||||
for (int i = 0; i < event_count; i++)
|
for (int i = 0; i < event_count; i++)
|
||||||
{
|
{
|
||||||
|
if (!m_event_queue.empty() && m_event_queue.back().type == events[i].type)
|
||||||
|
{
|
||||||
|
if (events[i].type == MouseEventType::MouseMoveEvent)
|
||||||
|
{
|
||||||
|
m_event_queue.back().move_event.rel_x += events[i].move_event.rel_x;
|
||||||
|
m_event_queue.back().move_event.rel_y += events[i].move_event.rel_y;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (events[i].type == MouseEventType::MouseScrollEvent)
|
||||||
|
{
|
||||||
|
m_event_queue.back().scroll_event.scroll += events[i].scroll_event.scroll;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (m_event_queue.full())
|
if (m_event_queue.full())
|
||||||
{
|
{
|
||||||
dwarnln("PS/2 event queue full");
|
dwarnln("PS/2 event queue full");
|
||||||
|
|
Loading…
Reference in New Issue