Common object-, inventory-, container- and firemode-related functions. More...
#include "q_shared.h"
Go to the source code of this file.
Functions | |
void | INVSH_InitCSI (csi_t *import) |
Initializes client server shared data pointer. This works because the client and the server are both using exactly the same pointer. | |
qboolean | INV_IsFloorDef (const invDef_t *invDef) |
Checks whether a given inventory definition is of special type. | |
qboolean | INV_IsRightDef (const invDef_t *invDef) |
Checks whether a given inventory definition is of special type. | |
qboolean | INV_IsLeftDef (const invDef_t *invDef) |
Checks whether a given inventory definition is of special type. | |
qboolean | INV_IsEquipDef (const invDef_t *invDef) |
Checks whether a given inventory definition is of special type. | |
qboolean | INV_IsArmourDef (const invDef_t *invDef) |
Checks whether a given inventory definition is of special type. | |
invList_t * | INVSH_HasArmour (const inventory_t *inv) |
static qboolean | INVSH_CheckShapeCollision (const uint32_t *shape, const uint32_t itemShape, const int x, const int y) |
Will check if the item-shape is colliding with something else in the container-shape at position x/y. | |
static qboolean | INVSH_CheckToInventory_shape (const inventory_t *const i, const invDef_t *container, const uint32_t itemShape, const int x, const int y, const invList_t *ignoredItem) |
Checks if an item-shape can be put into a container at a certain position... ignores any 'special' types of containers. | |
int | INVSH_CheckToInventory (const inventory_t *const i, const objDef_t *od, const invDef_t *container, const int x, const int y, const invList_t *ignoredItem) |
qboolean | INVSH_CompareItem (item_t *item1, item_t *item2) |
Check if the (physical) information of 2 items is exactly the same. | |
static qboolean | INVSH_ShapeCheckPosition (const invList_t *ic, const int x, const int y) |
Check if a position in a container is used by an item (i.e. collides with the shape). | |
void | INVSH_GetFirstShapePosition (const invList_t *ic, int *const x, int *const y) |
Calculates the first "true" bit in the shape and returns its position in the container. | |
qboolean | INVSH_ExistsInInventory (const inventory_t *const inv, const invDef_t *container, item_t item) |
Searches if there is a specific item already in the inventory&container. | |
qboolean | INV_IsCraftItem (const objDef_t *obj) |
Checks whether a given item is an aircraftitem item. | |
qboolean | INV_IsBaseDefenceItem (const objDef_t *obj) |
Checks whether a given item is a basedefence item. | |
invList_t * | INVSH_SearchInInventory (const inventory_t *const i, const invDef_t *container, const int x, const int y) |
Searches if there is an item at location (x,y) in a container. | |
void | INVSH_FindSpace (const inventory_t *const inv, const item_t *item, const invDef_t *container, int *const px, int *const py, const invList_t *ignoredItem) |
Finds space for item in inv at container. | |
objDef_t * | INVSH_GetItemByIDSilent (const char *id) |
Returns the index of this item in the inventory. | |
objDef_t * | INVSH_GetItemByIDX (int index) |
Returns the index of this item in the inventory. | |
objDef_t * | INVSH_GetItemByID (const char *id) |
Returns the item that belongs to the given id or NULL if it wasn't found. | |
invDef_t * | INVSH_GetInventoryDefinitionByID (const char *id) |
qboolean | INVSH_LoadableInWeapon (const objDef_t *od, const objDef_t *weapon) |
Checks if an item can be used to reload a weapon. | |
const fireDef_t * | FIRESH_GetFiredef (const objDef_t *obj, const weaponFireDefIndex_t weapFdsIdx, const fireDefIndex_t fdIdx) |
Get the fire definitions for a given object. | |
const fireDef_t * | FIRESH_FiredefForWeapon (const item_t *item) |
Returns the firedefinitions for a given weapon/ammo. | |
const objDef_t * | INVSH_HasReactionFireEnabledWeapon (const invList_t *invList) |
Checks whether the given list contains a reaction fire enabled weapon. | |
void | INVSH_MergeShapes (uint32_t *shape, const uint32_t itemShape, const int x, const int y) |
Will merge the second shape (=itemShape) into the first one (=big container shape) on the position x/y. | |
qboolean | INVSH_CheckShape (const uint32_t *shape, const int x, const int y) |
Checks the shape if there is a 1-bit on the position x/y. | |
static qboolean | INVSH_CheckShapeSmall (const uint32_t shape, const int x, const int y) |
Checks the shape if there is a 1-bit on the position x/y. | |
int | INVSH_ShapeSize (const uint32_t shape) |
Counts the used bits in a shape (item shape). | |
static uint32_t | INVSH_ShapeSetBit (uint32_t shape, const int x, const int y) |
Sets one bit in a shape to true/1. | |
uint32_t | INVSH_ShapeRotate (const uint32_t shape) |
Rotates a shape definition 90 degree to the left (CCW). | |
Variables | |
static csi_t * | CSI |
static int | cacheCheckToInventory = INV_DOES_NOT_FIT |
Common object-, inventory-, container- and firemode-related functions.
Definition in file inv_shared.c.
Returns the firedefinitions for a given weapon/ammo.
NULL
if the ammo doesn't support the given weapon Definition at line 607 of file inv_shared.c.
References objDef_s::fd, i, item_s::m, objDef_s::numWeapons, item_s::t, and objDef_s::weapons.
Referenced by actorL_shoot(), AI_FighterCalcBestAction(), AI_HideNeeded(), CL_SwapSkills(), G_ActorGetTUForReactionFire(), G_ActorHasWorkingFireModeSet(), G_PrepareShot(), G_ReactionFireGetTUsForItem(), HUD_GetFireDefinitionForHand(), HUD_GetMinimumTUsForUsage(), HUD_UpdateActorFireMode(), and INVSH_HasReactionFireEnabledWeapon().
const fireDef_t* FIRESH_GetFiredef | ( | const objDef_t * | obj, | |
const weaponFireDefIndex_t | weapFdsIdx, | |||
const fireDefIndex_t | fdIdx | |||
) |
Get the fire definitions for a given object.
[in] | obj | The object to get the firedef for |
[in] | weapFdsIdx | the weapon index in the fire definition array |
[in] | fdIdx | the fire definition index for the weapon (given by weapFdsIdx ) |
Definition at line 592 of file inv_shared.c.
References objDef_s::fd, objDef_s::id, MAX_FIREDEFS_PER_WEAPON, MAX_WEAPONS_PER_OBJDEF, and Sys_Error().
Referenced by CL_ActorDoShoot(), CL_ActorDoShootTime(), CL_ActorDoThrow(), CL_ActorShootHidden(), CL_ActorShootHiddenTime(), CL_GetEventTime(), and HUD_UpdateActorFireMode().
Checks whether a given inventory definition is of special type.
invDef | The inventory definition to check |
true
if the given inventory definition is of type armour Definition at line 89 of file inv_shared.c.
References invDef_s::id, and csi_s::idArmour.
Referenced by I_MoveInInventory().
Checks whether a given item is a basedefence item.
[in] | obj | pointer to item definition to check whether it's a basedefence item |
Definition at line 383 of file inv_shared.c.
References objDef_s::craftitem, objDef_s::isDummy, MAX_ACITEMS, and craftitem_s::type.
Checks whether a given item is an aircraftitem item.
[in] | obj | pointer to item definition to check whether it's an aircraftiem item |
Definition at line 369 of file inv_shared.c.
References objDef_s::craftitem, objDef_s::isDummy, MAX_ACITEMS, and craftitem_s::type.
Referenced by INV_ItemMatchesFilter().
Checks whether a given inventory definition is of special type.
invDef | The inventory definition to check |
true
if the given inventory definition is of type equip Definition at line 79 of file inv_shared.c.
References invDef_s::id, and csi_s::idEquip.
Referenced by I_MoveInInventory(), INVSH_CheckToInventory(), and UI_ContainerNodeDNDMove().
Checks whether a given inventory definition is of special type.
invDef | The inventory definition to check |
true
if the given inventory definition is of type floor Definition at line 49 of file inv_shared.c.
References invDef_s::id, and csi_s::idFloor.
Referenced by G_ActorInvMove(), I_MoveInInventory(), INVSH_CheckToInventory(), and UI_ContainerNodeDNDMove().
Checks whether a given inventory definition is of special type.
invDef | The inventory definition to check |
true
if the given inventory definition is of type left Definition at line 69 of file inv_shared.c.
References invDef_s::id, and csi_s::idLeft.
Referenced by G_ActorInvMove(), G_ActorReload(), I_MoveInInventory(), INVSH_CheckToInventory(), and UI_ContainerNodeDrawSingle().
Checks whether a given inventory definition is of special type.
invDef | The inventory definition to check |
true
if the given inventory definition is of type right Definition at line 59 of file inv_shared.c.
References invDef_s::id, and csi_s::idRight.
Referenced by G_ActorInvMove(), I_MoveInInventory(), INVSH_CheckToInventory(), and UI_ContainerNodeDrawSingle().
Checks the shape if there is a 1-bit on the position x/y.
[in] | shape | Pointer to 'uint32_t shape[SHAPE_BIG_MAX_HEIGHT]' |
[in] | x | |
[in] | y |
Definition at line 673 of file inv_shared.c.
References Com_Printf(), qfalse, qtrue, SHAPE_BIG_MAX_HEIGHT, and SHAPE_BIG_MAX_WIDTH.
Referenced by UI_ContainerNodeDrawFreeSpace().
static qboolean INVSH_CheckShapeCollision | ( | const uint32_t * | shape, | |
const uint32_t | itemShape, | |||
const int | x, | |||
const int | y | |||
) | [static] |
Will check if the item-shape is colliding with something else in the container-shape at position x/y.
[in] | shape | Pointer to 'uint32_t shape[SHAPE_BIG_MAX_HEIGHT]' |
[in] | itemShape | |
[in] | x | |
[in] | y |
Definition at line 109 of file inv_shared.c.
References Com_DPrintf(), DEBUG_SHARED, i, qfalse, qtrue, SHAPE_BIG_MAX_HEIGHT, SHAPE_SMALL_MAX_HEIGHT, and SHAPE_SMALL_MAX_WIDTH.
Referenced by INVSH_CheckToInventory_shape().
Checks the shape if there is a 1-bit on the position x/y.
[in] | shape | The shape to check in. (8x4) |
[in] | x | |
[in] | y |
Definition at line 695 of file inv_shared.c.
References Com_Printf(), qfalse, SHAPE_BIG_MAX_HEIGHT, SHAPE_BIG_MAX_WIDTH, and SHAPE_SMALL_MAX_WIDTH.
Referenced by INVSH_ShapeRotate().
int INVSH_CheckToInventory | ( | const inventory_t *const | i, | |
const objDef_t * | od, | |||
const invDef_t * | container, | |||
const int | x, | |||
const int | y, | |||
const invList_t * | ignoredItem | |||
) |
[in] | i | The inventory to check the item in. |
[in] | od | The item to check in the inventory. |
[in] | container | The index of the container in the inventory to check the item in. |
[in] | x | The x value in the container (1 << x in the shape bitmask) |
[in] | y | The y value in the container (SHAPE_BIG_MAX_HEIGHT is the max) |
[in] | ignoredItem | You can ignore one item in the container (most often the currently dragged one). Use NULL if you want to check against all items in the container. |
< Return INV_FITS_BOTH if both if statements where true above.
< We are returning with status qtrue (1) if the item does not fit at all - unlikely but not impossible.
< Return INV_FITS_BOTH if both if statements where true above.
Definition at line 206 of file inv_shared.c.
References invDef_s::all, invDef_s::armour, inventory_s::c, Com_DPrintf(), DEBUG_SHARED, invDef_s::extension, objDef_s::extension, objDef_s::fireTwoHanded, invDef_s::headgear, objDef_s::headgear, objDef_s::holdTwoHanded, invDef_s::id, csi_s::idLeft, csi_s::idRight, INV_DOES_NOT_FIT, INV_FITS, INV_FITS_ONLY_ROTATED, INV_IsArmour, INV_IsEquipDef(), INV_IsFloorDef(), INV_IsLeftDef(), INV_IsRightDef(), INVSH_CheckToInventory_shape(), INVSH_ShapeRotate(), invList_s::item, invDef_s::scroll, objDef_s::shape, invDef_s::single, and item_s::t.
Referenced by I_MoveInInventory(), I_TryAddToInventory(), INVSH_FindSpace(), UI_ContainerNodeDNDMove(), UI_ContainerNodeDrawDropPreview(), and UI_ContainerNodeDrawFreeSpace().
static qboolean INVSH_CheckToInventory_shape | ( | const inventory_t *const | i, | |
const invDef_t * | container, | |||
const uint32_t | itemShape, | |||
const int | x, | |||
const int | y, | |||
const invList_t * | ignoredItem | |||
) | [static] |
Checks if an item-shape can be put into a container at a certain position... ignores any 'special' types of containers.
[in] | i | |
[in] | container | The container (index) to look into. |
[in] | itemShape | The shape info of an item to fit into the container. |
[in] | x | The x value in the container (1 << x in the shape bitmask) |
[in] | y | The x value in the container (SHAPE_BIG_MAX_HEIGHT is the max) |
[in] | ignoredItem | You can ignore one item in the container (most often the currently dragged one). Use NULL if you want to check against all items in the container. |
Definition at line 154 of file inv_shared.c.
References inventory_s::c, cacheCheckToInventory, invDef_s::id, INVSH_CheckShapeCollision(), INVSH_MergeShapes(), INVSH_ShapeRotate(), invList_s::item, invList_s::next, qfalse, qtrue, item_s::rotated, invDef_s::scroll, objDef_s::shape, invDef_s::shape, SHAPE_BIG_MAX_HEIGHT, SHAPE_BIG_MAX_WIDTH, Sys_Error(), item_s::t, invList_s::x, and invList_s::y.
Referenced by INVSH_CheckToInventory().
Check if the (physical) information of 2 items is exactly the same.
[in] | item1 | First item to compare. |
[in] | item2 | Second item to compare. |
Definition at line 285 of file inv_shared.c.
References item_s::a, item_s::m, qfalse, qtrue, and item_s::t.
Referenced by I_AddToInventory(), and INVSH_ExistsInInventory().
qboolean INVSH_ExistsInInventory | ( | const inventory_t *const | inv, | |
const invDef_t * | container, | |||
item_t | item | |||
) |
Searches if there is a specific item already in the inventory&container.
[in] | inv | Pointer to the inventory where we will search. |
[in] | container | Container in the inventory. |
[in] | item | The item to search for. |
Definition at line 348 of file inv_shared.c.
References inventory_s::c, invDef_s::id, INVSH_CompareItem(), invList_s::item, invList_s::next, qfalse, and qtrue.
Referenced by testItemAdd(), testItemDel(), testItemMove(), and UI_ContainerNodeDNDMove().
void INVSH_FindSpace | ( | const inventory_t *const | inv, | |
const item_t * | item, | |||
const invDef_t * | container, | |||
int *const | px, | |||
int *const | py, | |||
const invList_t * | ignoredItem | |||
) |
Finds space for item in inv at container.
[in] | inv | The inventory to search space in |
[in] | item | The item to check the space for |
[in] | container | The container to search in |
[out] | px | The x position in the container |
[out] | py | The y position in the container |
[in] | ignoredItem | You can ignore one item in the container (most often the currently dragged one). Use NULL if you want to check against all items in the container. |
Definition at line 430 of file inv_shared.c.
References cacheCheckToInventory, Com_DPrintf(), DEBUG_SHARED, objDef_s::id, INV_DOES_NOT_FIT, INV_FITS, INVSH_CheckToInventory(), invDef_s::name, NONE, invDef_s::scroll, SHAPE_BIG_MAX_HEIGHT, SHAPE_BIG_MAX_WIDTH, item_s::t, and objDef_s::type.
Referenced by G_ActorInvMove(), I_AddToInventory(), I_MoveInInventory(), I_TryAddToInventory(), UI_ContainerNodeAutoPlace(), and UI_ContainerNodeDNDMove().
void INVSH_GetFirstShapePosition | ( | const invList_t * | ic, | |
int *const | x, | |||
int *const | y | |||
) |
Calculates the first "true" bit in the shape and returns its position in the container.
[in] | ic | A pointer to an invList_t struct. |
[out] | x | The x location inside the item. |
[out] | y | The x location inside the item. |
Definition at line 324 of file inv_shared.c.
References INVSH_ShapeCheckPosition(), NONE, SHAPE_SMALL_MAX_HEIGHT, invList_s::x, and invList_s::y.
Referenced by CL_ActorReload(), and G_ActorInvMove().
invDef_t* INVSH_GetInventoryDefinitionByID | ( | const char * | id | ) |
Searched an inventory container by a given container id
[in] | id | ID or name of the inventory container to search for |
NULL
if not found Definition at line 523 of file inv_shared.c.
References i, csi_s::ids, and invDef_s::name.
Referenced by testItemAdd(), testItemDel(), testItemMassActions(), testItemMove(), UI_BaseInventoryNodeLoaded(), and UI_ContainerNodeLoaded().
objDef_t* INVSH_GetItemByID | ( | const char * | id | ) |
Returns the item that belongs to the given id or NULL
if it wasn't found.
[in] | id | the item id in our object definition array (csi.ods) |
Definition at line 509 of file inv_shared.c.
References Com_Printf(), and INVSH_GetItemByIDSilent().
Referenced by AII_AddAmmoToSlot(), AII_AddItemToSlot(), AIM_AircraftEquipAddItem_f(), AIM_AutoEquipAircraft(), AIM_CheckTechnologyIntoSlot(), AIM_CrafttypeFilter(), AIM_SelectableCraftItem(), AIM_UpdateAircraftItemList(), AIR_LoadAircraftXML(), AIR_ParseAircraft(), AIR_Refuel(), AIRFIGHT_LoadXML(), AL_AddAliens(), B_AntimatterInBase(), B_LoadStorageXML(), B_UpdateAntimatterCap(), BDEF_AddItem_f(), BS_BuyItem_f(), BS_LoadXML(), BS_SellItem_f(), CL_CleanupAircraftCrew(), CL_LoadItemXML(), CL_ParseComponents(), Com_AddObjectLinks(), Com_ParseEquipment(), Com_ParseTeam(), MP_LoadTeamMultiplayer(), PR_LoadXML(), RS_AssignTechLinks(), TR_EmptyTransferCargo(), TR_LoadXML(), TR_TransferAlienAfterMissionStart(), TR_TransferList_Scroll_f(), TR_TransferListSelect_f(), TR_TransferSelect(), UP_Article(), UP_DrawAssociatedAmmo(), and UP_ResearchedLinkClick_f().
objDef_t* INVSH_GetItemByIDSilent | ( | const char * | id | ) |
Returns the index of this item in the inventory.
[in] | id | the item id in our object definition array (csi.ods) |
Definition at line 475 of file inv_shared.c.
References i, objDef_s::id, csi_s::numODs, and csi_s::ods.
Referenced by AIM_UpdateItemDescription(), B_ManageAntimatter(), BDEF_SelectItem_f(), CL_ParseComponents(), Com_ParseItem(), G_AddItemToFloor(), INVSH_GetItemByID(), testItemAdd(), testItemDel(), testItemMassActions(), testItemMove(), UI_ItemNodeDraw(), and UP_TechGetsDisplayed().
objDef_t* INVSH_GetItemByIDX | ( | int | index | ) |
Returns the index of this item in the inventory.
Definition at line 493 of file inv_shared.c.
References NONE, csi_s::numODs, csi_s::ods, and Sys_Error().
Referenced by AII_GetCraftitemTechsByType(), B_InitialEquipment(), B_RemoveItemsExceedingCapacity(), B_SaveStorageXML(), B_UpdateStorageCap(), BS_InitMarket(), BS_SaveXML(), CL_ActorDoShoot(), CL_ActorDoShootTime(), CL_ActorDoThrow(), CL_ActorReactionFireChange(), CL_ActorShootHidden(), CL_ActorShootHiddenTime(), CL_AddActorWeapon(), CL_CampaignRunMarket(), CL_GetEventTime(), CL_InvAmmo(), CL_InvReload(), CL_NetReceiveItem(), CL_ViewPrecacheModels(), Com_AddObjectLinks(), CP_AddItemAsCollected_f(), CP_AddWeaponAmmo(), CP_ItemsSanityCheck(), G_ClientAction(), HUD_ShotReserve_f(), I_EquipActor(), I_PackAmmoAndWeapon(), INV_EquipmentDefSanityCheck(), INV_UpdateObject_f(), LE_GetAnim(), MP_SaveTeamMultiplayer(), RS_InitTree(), S_LoadSamples(), testItemMassActions(), TR_CargoList(), TR_CargoListSelect_f(), TR_CheckItem(), TR_EmptyTransferCargo(), TR_SaveXML(), TR_TransferList_Scroll_f(), TR_TransferListClear_f(), TR_TransferListSelect_f(), TR_TransferSelect(), UI_BaseInventoryNodeDrawItems(), UI_BaseInventoryNodeGetItem(), UI_ContainerItemIteratorNext(), UI_ContainerNodeUpdateEquipment(), UI_ItemNodeDraw(), and UP_Article().
invList_t* INVSH_HasArmour | ( | const inventory_t * | inv | ) |
Definition at line 94 of file inv_shared.c.
References inventory_s::c, and csi_s::idArmour.
Referenced by CHRSH_CharGetBody(), and CHRSH_CharGetHead().
Checks whether the given list contains a reaction fire enabled weapon.
NULL
if no reaction fire enabled weapon was found in the given list, the reaction fire enabled object otherwise. Definition at line 634 of file inv_shared.c.
References FIRESH_FiredefForWeapon(), invList_s::item, invList_s::next, fireDef_s::reaction, and item_s::t.
Referenced by G_ActorHasReactionFireEnabledWeapon(), G_ReactionFireSetDefault(), and HUD_WeaponWithReaction().
void INVSH_InitCSI | ( | csi_t * | import | ) |
Initializes client server shared data pointer. This works because the client and the server are both using exactly the same pointer.
[in] | import | The client server interface pointer |
Definition at line 39 of file inv_shared.c.
Referenced by Com_ParseScripts(), and G_Init().
Checks if an item can be used to reload a weapon.
[in] | od | The object definition of the ammo. |
[in] | weapon | The weapon (in the inventory) to check the item with. |
Definition at line 541 of file inv_shared.c.
References Com_DPrintf(), DEBUG_SHARED, i, objDef_s::id, objDef_s::numWeapons, qfalse, qtrue, and objDef_s::weapons.
Referenced by CL_ActorGetContainerForReload(), CP_AddWeaponAmmo(), G_ActorReload(), G_ClientCanReload(), I_EquipActor(), I_MoveInInventory(), I_PackAmmoAndWeapon(), UI_BaseInventoryNodeDrawItems(), UI_ContainerNodeDNDMove(), UI_ContainerNodeDrawGrid(), and UI_ContainerNodeDrawSingle().
Will merge the second shape (=itemShape) into the first one (=big container shape) on the position x/y.
[in] | shape | Pointer to 'uint32_t shape[SHAPE_BIG_MAX_HEIGHT]' |
[in] | itemShape | |
[in] | x | |
[in] | y |
Definition at line 659 of file inv_shared.c.
References i, SHAPE_BIG_MAX_HEIGHT, SHAPE_SMALL_MAX_HEIGHT, and SHAPE_SMALL_MAX_WIDTH.
Referenced by INVSH_CheckToInventory_shape(), and UI_ContainerNodeDrawFreeSpace().
invList_t* INVSH_SearchInInventory | ( | const inventory_t *const | i, | |
const invDef_t * | container, | |||
const int | x, | |||
const int | y | |||
) |
Searches if there is an item at location (x,y) in a container.
[in] | i | Pointer to the inventory where we will search. |
[in] | container | Container in the inventory. |
[in] | x/y | Position in the container that you want to check. |
Definition at line 396 of file inv_shared.c.
References inventory_s::c, invDef_s::id, INVSH_ShapeCheckPosition(), invDef_s::name, invList_s::next, invDef_s::scroll, invDef_s::single, and Sys_Error().
Referenced by CL_InvAmmo(), CL_InvDel(), CL_InvReload(), G_ActorInvMove(), G_ClientAction(), I_MoveInInventory(), UI_ContainerNodeAutoPlace(), UI_ContainerNodeDNDFinished(), UI_ContainerNodeDNDMove(), and UI_ContainerNodeGetItemAtPosition().
static qboolean INVSH_ShapeCheckPosition | ( | const invList_t * | ic, | |
const int | x, | |||
const int | y | |||
) | [static] |
Check if a position in a container is used by an item (i.e. collides with the shape).
[in] | ic | A pointer to an invList_t struct. The position is checked against its contained item. |
[in] | x | The x location in the container. |
[in] | y | The y location in the container. |
Definition at line 299 of file inv_shared.c.
References INVSH_ShapeRotate(), invList_s::item, qfalse, qtrue, item_s::rotated, objDef_s::shape, SHAPE_SMALL_MAX_WIDTH, item_s::t, invList_s::x, and invList_s::y.
Referenced by INVSH_GetFirstShapePosition(), and INVSH_SearchInInventory().
Rotates a shape definition 90 degree to the left (CCW).
[in] | shape | The shape to rotate. |
Definition at line 750 of file inv_shared.c.
References INVSH_CheckShapeSmall(), INVSH_ShapeSetBit(), SHAPE_SMALL_MAX_HEIGHT, and SHAPE_SMALL_MAX_WIDTH.
Referenced by INVSH_CheckToInventory(), INVSH_CheckToInventory_shape(), INVSH_ShapeCheckPosition(), and UI_ContainerNodeDrawFreeSpace().
Sets one bit in a shape to true/1.
[in] | shape | The shape to modify. (8x4) |
[in] | x | The x (width) position of the bit to set. |
[in] | y | The y (height) position of the bit to set. |
Definition at line 732 of file inv_shared.c.
References Com_Printf(), SHAPE_SMALL_MAX_HEIGHT, and SHAPE_SMALL_MAX_WIDTH.
Referenced by INVSH_ShapeRotate().
int INVSH_ShapeSize | ( | const uint32_t | shape | ) |
Counts the used bits in a shape (item shape).
[in] | shape | The shape to count the bits in. |
Definition at line 711 of file inv_shared.c.
References i, SHAPE_SMALL_MAX_HEIGHT, and SHAPE_SMALL_MAX_WIDTH.
Referenced by LE_BiggestItem().
int cacheCheckToInventory = INV_DOES_NOT_FIT [static] |
Definition at line 99 of file inv_shared.c.
Referenced by INVSH_CheckToInventory_shape(), and INVSH_FindSpace().
Definition at line 30 of file inv_shared.c.