console_set_cursor() now clips to screen size. This actually works around a
possible compiler bug that exposes with -O2 only. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12203 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
** Copyright 2004, Axel Dörfler, [email protected]. All rights reserved.
|
* Copyright 2004-2005, Axel Dörfler, [email protected]. All rights reserved.
|
||||||
** Distributed under the terms of the Haiku License.
|
* Distributed under the terms of the MIT License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include "console.h"
|
#include "console.h"
|
||||||
@@ -118,6 +118,15 @@ console_height(void)
|
|||||||
void
|
void
|
||||||
console_set_cursor(int32 x, int32 y)
|
console_set_cursor(int32 x, int32 y)
|
||||||
{
|
{
|
||||||
|
if (y >= (int32)sScreenHeight)
|
||||||
|
y = sScreenHeight - 1;
|
||||||
|
else if (y < 0)
|
||||||
|
y = 0;
|
||||||
|
if (x >= (int32)sScreenWidth)
|
||||||
|
x = sScreenWidth - 1;
|
||||||
|
else if (x < 0)
|
||||||
|
x = 0;
|
||||||
|
|
||||||
sScreenOffset = x + y * sScreenWidth;
|
sScreenOffset = x + y * sScreenWidth;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user