mirror of
https://github.com/ptitSeb/Serious-Engine
synced 2025-02-16 23:20:09 +01:00
Fixed the bsr Portable C function, the game start correctly now
This commit is contained in:
parent
8c49b5f7a0
commit
8c03fccd64
@ -521,15 +521,15 @@ static void RSBinToGroups( ScenePolygon *pspoFirst)
|
|||||||
|
|
||||||
#else
|
#else
|
||||||
// emulate x86's bsr opcode...not fast. :/
|
// emulate x86's bsr opcode...not fast. :/
|
||||||
register INDEX val = _ctGroupsCount;
|
register DWORD val = _ctGroupsCount;
|
||||||
register INDEX bsr = 0;
|
register INDEX bsr = 31;
|
||||||
if (val != 0)
|
if (val != 0)
|
||||||
{
|
{
|
||||||
while (bsr < 32)
|
while (bsr > 0)
|
||||||
{
|
{
|
||||||
if (val & (1 << bsr))
|
if (val & (1l << bsr))
|
||||||
break;
|
break;
|
||||||
bsr++;
|
bsr--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user