Remove rotation argument from sub_9819_c

This commit is contained in:
Michał Janiszewski 2018-02-12 22:54:38 +01:00 committed by Michał Janiszewski
parent c420fb56f5
commit 77fb74d5b6
1 changed files with 8 additions and 7 deletions

View File

@ -90,7 +90,8 @@ static void paint_session_add_ps_to_quadrant(paint_session * session, paint_stru
/**
* Extracted from 0x0098196c, 0x0098197c, 0x0098198c, 0x0098199c
*/
static paint_struct * sub_9819_c(paint_session * session, uint32 image_id, LocationXYZ16 offset, LocationXYZ16 boundBoxSize, LocationXYZ16 boundBoxOffset, uint8 rotation)
static paint_struct * sub_9819_c(
paint_session * session, uint32 image_id, LocationXYZ16 offset, LocationXYZ16 boundBoxSize, LocationXYZ16 boundBoxOffset)
{
if (session->NextFreePaintStruct >= session->EndOfPaintStructArray) return nullptr;
auto g1 = gfx_get_g1_element(image_id & 0x7FFFF);
@ -102,7 +103,7 @@ static paint_struct * sub_9819_c(paint_session * session, uint32 image_id, Locat
paint_struct * ps = &session->NextFreePaintStruct->basic;
ps->image_id = image_id;
switch (rotation)
switch (session->CurrentRotation)
{
case 0:
rotate_map_coordinates(&offset.x, &offset.y, 0);
@ -120,7 +121,7 @@ static paint_struct * sub_9819_c(paint_session * session, uint32 image_id, Locat
offset.x += session->SpritePosition.x;
offset.y += session->SpritePosition.y;
LocationXY16 map = coordinate_3d_to_2d(&offset, rotation);
LocationXY16 map = coordinate_3d_to_2d(&offset, session->CurrentRotation);
ps->x = map.x;
ps->y = map.y;
@ -140,7 +141,7 @@ static paint_struct * sub_9819_c(paint_session * session, uint32 image_id, Locat
// This probably rotates the variables so they're relative to rotation 0.
switch (rotation)
switch (session->CurrentRotation)
{
case 0:
boundBoxSize.x--;
@ -920,7 +921,7 @@ paint_struct * sub_98197C(
LocationXYZ16 offset = { x_offset, y_offset, z_offset };
LocationXYZ16 boundBoxSize = { bound_box_length_x, bound_box_length_y, bound_box_length_z };
LocationXYZ16 boundBoxOffset = { bound_box_offset_x, bound_box_offset_y, bound_box_offset_z };
paint_struct * ps = sub_9819_c(session, image_id, offset, boundBoxSize, boundBoxOffset, rotation);
paint_struct * ps = sub_9819_c(session, image_id, offset, boundBoxSize, boundBoxOffset);
if (ps == nullptr) {
return nullptr;
@ -990,7 +991,7 @@ paint_struct * sub_98198C(
LocationXYZ16 offset = { x_offset, y_offset, z_offset };
LocationXYZ16 boundBoxSize = { bound_box_length_x, bound_box_length_y, bound_box_length_z };
LocationXYZ16 boundBoxOffset = { bound_box_offset_x, bound_box_offset_y, bound_box_offset_z };
paint_struct * ps = sub_9819_c(session, image_id, offset, boundBoxSize, boundBoxOffset, rotation);
paint_struct * ps = sub_9819_c(session, image_id, offset, boundBoxSize, boundBoxOffset);
if (ps == nullptr) {
return nullptr;
@ -1045,7 +1046,7 @@ paint_struct * sub_98199C(
LocationXYZ16 offset = { x_offset, y_offset, z_offset };
LocationXYZ16 boundBox = { bound_box_length_x, bound_box_length_y, bound_box_length_z };
LocationXYZ16 boundBoxOffset = { bound_box_offset_x, bound_box_offset_y, bound_box_offset_z };
paint_struct * ps = sub_9819_c(session, image_id, offset, boundBox, boundBoxOffset, rotation);
paint_struct * ps = sub_9819_c(session, image_id, offset, boundBox, boundBoxOffset);
if (ps == nullptr)
{