Skip to content

Commit

Permalink
Remove redundant kernel floor function
Browse files Browse the repository at this point in the history
  • Loading branch information
j4cobgarby committed Oct 25, 2023
1 parent 7cb2351 commit bc3e694
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 7 deletions.
1 change: 0 additions & 1 deletion Kernel/include/Math.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@
#define MIN(x, y) ((x > y) ? y : x)

unsigned int rand();
int floor(int num);
int abs(int num);
5 changes: 0 additions & 5 deletions Kernel/src/Math.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,4 @@ unsigned int rand() {
return ((unsigned int)(rand_next / 65536) % 32768);
}

int floor(int num) {
int x = (int)num;
return num < x ? x - 1 : x;
}

int abs(int num) { return num < 0 ? -num : num; }
2 changes: 1 addition & 1 deletion Kernel/src/Video/Video.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ void DrawBitmapImage(unsigned int x, unsigned int y, unsigned int w, unsigned in
data += bmpHeader.offset;

uint8_t bmpBpp = 24;
uint32_t rowSize = floor((bmpBpp * w + 31) / 32) * 4;
uint32_t rowSize = ((bmpBpp * w + 31) / 32) * 4;
uint32_t bmpOffset = rowSize * (h - 1);

uint32_t pixelSize = 4;
Expand Down

0 comments on commit bc3e694

Please sign in to comment.