mirror of
https://github.com/isledecomp/isle.git
synced 2025-10-23 00:14:22 +00:00
implement/match UpdateLightPosition() (#744)
This commit is contained in:
@@ -339,11 +339,37 @@ MxBool FUN_1003ef60()
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x1003f050
|
||||
MxS32 FUN_1003f050(MxS32)
|
||||
// FUNCTION: LEGO1 0x1003f050
|
||||
MxS32 UpdateLightPosition(MxS32 p_value)
|
||||
{
|
||||
// TODO
|
||||
return 0;
|
||||
// This function updates the light position
|
||||
// relatively by the amount passed in p_value.
|
||||
// Because it operates relatively, it does not set
|
||||
// the light position to an arbitrary value.
|
||||
|
||||
MxS32 lightPosition = atoi(VariableTable()->GetVariable("lightposition"));
|
||||
|
||||
if (p_value > 0) {
|
||||
lightPosition += 1;
|
||||
if (lightPosition > 5) {
|
||||
lightPosition = 5;
|
||||
}
|
||||
}
|
||||
else {
|
||||
lightPosition -= 1;
|
||||
if (lightPosition < 0) {
|
||||
lightPosition = 0;
|
||||
}
|
||||
}
|
||||
|
||||
SetLightPosition(lightPosition);
|
||||
|
||||
char lightPositionBuffer[32];
|
||||
sprintf(lightPositionBuffer, "%d", lightPosition);
|
||||
|
||||
VariableTable()->SetVariable("lightposition", lightPositionBuffer);
|
||||
|
||||
return lightPosition;
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x1003f0d0
|
||||
|
Reference in New Issue
Block a user