MCPcopy Create free account
hub / github.com/OpenFodder/openfodder / Mouse_Cursor_Update

Method Mouse_Cursor_Update

Source/Fodder.cpp:4669–4768  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4667}
4668
4669void cFodder::Mouse_Cursor_Update() {
4670 int16 Data0, Data4, Data8;
4671
4672 // Sidebar
4673 if (mMouseX < 32) {
4674 mMouseSpriteNew = eSprite_pStuff_Mouse_Cursor;
4675 mMouseX_Offset = 0;
4676 mMouseY_Offset = 0;
4677 return;
4678 }
4679
4680 if (!mButtonPressRight) {
4681
4682 Data0 = mMouseX + (mCameraX >> 16);
4683 Data4 = mMouseY + (mCameraY >> 16);
4684
4685 Data0 -= 0x0F;
4686 Data4 -= 3;
4687
4688 //loc_30B36
4689 for (auto& Vehicle : mSprites_HumanVehicles) {
4690
4691 if (Vehicle->field_0 < 0)
4692 continue;
4693
4694 if (!Vehicle->field_65)
4695 continue;
4696
4697 // If not human
4698 if (Vehicle->field_22 != eSprite_PersonType_Human)
4699 continue;
4700
4701 Data8 = Vehicle->field_0;
4702 if (Vehicle->field_6F == eVehicle_Turret_Cannon)
4703 goto loc_30BB9;
4704 if (Vehicle->field_6F == eVehicle_Turret_Missile)
4705 goto loc_30BBE;
4706
4707 loc_30BB9:;
4708 Data8 -= 8;
4709 loc_30BBE:;
4710
4711 if (Data0 < Data8)
4712 continue;
4713
4714 Data8 += mSprite_Width[Vehicle->field_18];
4715 if (Data0 > Data8)
4716 continue;
4717
4718 Data8 = Vehicle->field_4;
4719 Data8 -= Vehicle->field_20;
4720 Data8 -= mSprite_Height_Top[Vehicle->field_18];
4721 Data8 -= 0x14;
4722
4723 if (Data4 < Data8)
4724 continue;
4725
4726 Data8 = Vehicle->field_4;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected