BAN: Add math to its own namespace

This commit is contained in:
Bananymous
2023-01-10 19:11:27 +02:00
parent 181478119e
commit 6f9552d673
9 changed files with 32 additions and 16 deletions

View File

@@ -113,7 +113,6 @@ _start:
orl $0x80000000, %ecx
movl %ecx, %cr0
xchgw %bx, %bx
# call global constuctors
call _init
@@ -121,6 +120,7 @@ _start:
call kernel_main
system_halt:
xchgw %bx, %bx
cli
1: hlt
jmp 1b

View File

@@ -282,8 +282,8 @@ namespace Kernel
{
m_mouse_pos.exists = true;
m_tty->RenderFromBuffer(m_mouse_pos.x, m_mouse_pos.y);
m_mouse_pos.x = clamp<int32_t>(m_mouse_pos.x + event.dx, 0, m_tty->Width() - 1);
m_mouse_pos.y = clamp<int32_t>(m_mouse_pos.y - event.dy, 0, m_tty->Height() - 1);
m_mouse_pos.x = Math::clamp<int32_t>(m_mouse_pos.x + event.dx, 0, m_tty->Width() - 1);
m_mouse_pos.y = Math::clamp<int32_t>(m_mouse_pos.y - event.dy, 0, m_tty->Height() - 1);
VESA::PutBitmapAt(s_pointer, m_mouse_pos.x, m_mouse_pos.y, VESA::Color::BRIGHT_WHITE);
}