Skip to content

Commit

Permalink
ALTV-426 add latest apis
Browse files Browse the repository at this point in the history
  • Loading branch information
Doxoh committed Oct 4, 2024
1 parent 8621096 commit d1fe7d1
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 5 deletions.
10 changes: 7 additions & 3 deletions c-api/func_table.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "func_table.h"

inline uint64_t capiHash = 5316421578343678696UL;
inline uint64_t capiHash = 10340967010520350397UL;
inline uint64_t capiHashes[] = {
0,
#ifdef ALT_CLIENT_API
Expand Down Expand Up @@ -482,6 +482,7 @@ inline uint64_t capiHashes[] = {
7285942813518470950UL,
1117662078157381260UL,
9560528769032004812UL,
13206342625351776081UL,
14268893542560810008UL,
3255950788253963043UL,
16182899257589323539UL,
Expand All @@ -491,10 +492,11 @@ inline uint64_t capiHashes[] = {
16837975631170049766UL,
17030953846480430905UL,
7856663484428066825UL,
15158102510225914020UL,
4739364089865431579UL,
4358271132564072471UL,
7499702612373464399UL,
18153641274402744534UL,
12048596999299004349UL,
4102368831198906004UL,
7739810354326755506UL,
12723661681621738686UL,
Expand Down Expand Up @@ -2297,6 +2299,7 @@ inline void* capiPointers[] = {
(void*) InteriorPortal_GetEntityPosition,
(void*) InteriorPortal_GetEntityRotation,
(void*) InteriorPortal_GetFlag,
(void*) InteriorPortal_GetIndex,
(void*) InteriorPortal_GetRoomFrom,
(void*) InteriorPortal_GetRoomTo,
(void*) InteriorPortal_SetCornerPosition,
Expand All @@ -2306,10 +2309,11 @@ inline void* capiPointers[] = {
(void*) InteriorPortal_SetRoomTo,
(void*) InteriorRoom_GetExtents,
(void*) InteriorRoom_GetFlag,
(void*) InteriorRoom_GetIndex,
(void*) InteriorRoom_GetName,
(void*) InteriorRoom_GetNameHash,
(void*) InteriorRoom_GetTimecycle,
(void*) InteriorRoom_SetEntitiesExtents,
(void*) InteriorRoom_SetExtents,
(void*) InteriorRoom_SetFlag,
(void*) InteriorRoom_SetTimecycle,
(void*) LocalObject_ActivatePhysics,
Expand Down
5 changes: 5 additions & 0 deletions c-api/interior_portal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
CAPI_START()

#ifdef ALT_CLIENT_API
uint32_t InteriorPortal_GetIndex(uint32_t interiorId, uint32_t portalIndex)
{
auto portal = GetInteriorPortal(interiorId, portalIndex);
return portal->GetIndex();
}

uint16_t InteriorPortal_GetCornerCount(uint32_t interiorId, uint32_t portalIndex)
{
Expand Down
1 change: 1 addition & 0 deletions c-api/interior_portal.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#pragma clang diagnostic pop
#endif

EXPORT_CLIENT uint32_t InteriorPortal_GetIndex(uint32_t interiorId, uint32_t portalIndex);
EXPORT_CLIENT uint16_t InteriorPortal_GetCornerCount(uint32_t interiorId, uint32_t portalIndex);
EXPORT_CLIENT alt::Position InteriorPortal_GetCornerPosition(uint32_t interiorId, uint32_t portalIndex, uint32_t cornerIndex);
EXPORT_CLIENT uint32_t InteriorPortal_GetRoomFrom(uint32_t interiorId, uint32_t portalIndex);
Expand Down
8 changes: 7 additions & 1 deletion c-api/interior_room.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@
CAPI_START()

#ifdef ALT_CLIENT_API
uint32_t InteriorRoom_GetIndex(uint32_t interiorId, uint32_t roomValue, uint8_t isIndex)
{
auto room = GetInteriorRoom(interiorId, roomValue, isIndex);
return room->GetIndex();
}

const char* InteriorRoom_GetName(uint32_t interiorId, uint32_t roomValue, uint8_t isIndex, int32_t& size)
{
auto room = GetInteriorRoom(interiorId, roomValue, isIndex);
Expand Down Expand Up @@ -52,7 +58,7 @@ void InteriorRoom_SetTimecycle(uint32_t interiorId, uint32_t roomValue, uint8_t
room->SetTimecycle(timecycle);
}

void InteriorRoom_SetEntitiesExtents(uint32_t interiorId, uint32_t roomValue, uint8_t isIndex, position_t min,
void InteriorRoom_SetExtents(uint32_t interiorId, uint32_t roomValue, uint8_t isIndex, position_t min,
position_t max)
{
auto room = GetInteriorRoom(interiorId, roomValue, isIndex);
Expand Down
3 changes: 2 additions & 1 deletion c-api/interior_room.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#pragma clang diagnostic pop
#endif

EXPORT_CLIENT uint32_t InteriorRoom_GetIndex(uint32_t interiorId, uint32_t roomValue, uint8_t isIndex);
EXPORT_CLIENT const char* InteriorRoom_GetName(uint32_t interiorId, uint32_t roomValue, uint8_t isIndex, int32_t& size);
EXPORT_CLIENT uint32_t InteriorRoom_GetNameHash(uint32_t interiorId, uint32_t roomValue, uint8_t isIndex);
EXPORT_CLIENT int32_t InteriorRoom_GetFlag(uint32_t interiorId, uint32_t roomValue, uint8_t isIndex);
Expand All @@ -31,7 +32,7 @@ EXPORT_CLIENT void InteriorRoom_GetExtents(uint32_t interiorId, uint32_t roomVal

EXPORT_CLIENT void InteriorRoom_SetFlag(uint32_t interiorId, uint32_t roomValue, uint8_t isIndex, int32_t flag);
EXPORT_CLIENT void InteriorRoom_SetTimecycle(uint32_t interiorId, uint32_t roomValue, uint8_t isIndex, uint32_t timecycle);
EXPORT_CLIENT void InteriorRoom_SetEntitiesExtents(uint32_t interiorId, uint32_t roomValue, uint8_t isIndex, position_t min, position_t max);
EXPORT_CLIENT void InteriorRoom_SetExtents(uint32_t interiorId, uint32_t roomValue, uint8_t isIndex, position_t min, position_t max);


#ifdef ALT_CLIENT_API
Expand Down

0 comments on commit d1fe7d1

Please sign in to comment.