fallout2-ce/src/object.h

176 lines
7.4 KiB
C
Raw Normal View History

2022-05-19 01:51:26 -07:00
#ifndef OBJECT_H
#define OBJECT_H
#include "db.h"
#include "geometry.h"
#include "inventory.h"
#include "map_defs.h"
#include "obj_types.h"
typedef struct ObjectWithFlags {
int flags;
Object* object;
} ObjectWithFlags;
extern bool gObjectsInitialized;
extern int _updateHexWidth;
extern int _updateHexHeight;
extern int _updateHexArea;
extern int* _orderTable[2];
extern int* _offsetTable[2];
extern int* _offsetModTable;
extern int* _offsetDivTable;
extern ObjectListNode** _renderTable;
extern int _outlineCount;
extern ObjectListNode* gObjectListHead;
extern int _centerToUpperLeft;
extern int gObjectFindElevation;
extern int gObjectFindTile;
extern ObjectListNode* gObjectFindLastObjectListNode;
extern int* gObjectFids;
extern int gObjectFidsLength;
extern Rect _light_rect[9];
extern int _light_distance[36];
extern int gViolenceLevel;
extern int _obj_last_roof_x;
extern int _obj_last_roof_y;
extern int _obj_last_elev;
extern int _obj_last_is_empty;
extern unsigned char* _wallBlendTable;
extern unsigned char* _glassBlendTable;
extern unsigned char* _steamBlendTable;
extern unsigned char* _energyBlendTable;
extern unsigned char* _redBlendTable;
extern Object* _moveBlockObj;
extern int _objItemOutlineState;
extern int _cd_order[9];
extern int _light_blocked[6][36];
extern int _light_offsets[2][6][36];
extern Rect gObjectsWindowRect;
extern Object* _outlinedObjects[100];
extern int _updateAreaPixelBounds;
extern int dword_639D94;
extern int dword_639D98;
extern int dword_639D9C;
extern ObjectListNode* gObjectListHeadByTile[HEX_GRID_SIZE];
extern unsigned char _glassGrayTable[256];
extern unsigned char _commonGrayTable[256];
extern int gObjectsWindowBufferSize;
extern unsigned char* gObjectsWindowBuffer;
extern int gObjectsWindowHeight;
extern Object* gEgg;
extern int gObjectsWindowPitch;
extern int gObjectsWindowWidth;
extern Object* gDude;
extern char _obj_seen_check[5001];
extern char _obj_seen[5001];
int objectsInit(unsigned char* buf, int width, int height, int pitch);
void objectsReset();
void objectsExit();
int objectRead(Object* obj, File* stream);
int objectLoadAll(File* stream);
int objectLoadAllInternal(File* stream);
void _obj_fix_combat_cid_for_dude();
void _object_fix_weapon_ammo(Object* obj);
int objectWrite(Object* obj, File* stream);
int objectSaveAll(File* stream);
void _obj_render_pre_roof(Rect* rect, int elevation);
void _obj_render_post_roof(Rect* rect, int elevation);
int objectCreateWithFidPid(Object** objectPtr, int fid, int pid);
int objectCreateWithPid(Object** objectPtr, int pid);
int _obj_copy(Object** a1, Object* a2);
int _obj_connect(Object* obj, int tile_index, int elev, Rect* rect);
int _obj_disconnect(Object* obj, Rect* rect);
int _obj_offset(Object* obj, int x, int y, Rect* rect);
int _obj_move(Object* a1, int a2, int a3, int elevation, Rect* a5);
int objectSetLocation(Object* obj, int tile, int elevation, Rect* rect);
int _obj_reset_roof();
int objectSetFid(Object* obj, int fid, Rect* rect);
int objectSetFrame(Object* obj, int frame, Rect* rect);
int objectSetNextFrame(Object* obj, Rect* rect);
int objectSetPrevFrame(Object* obj, Rect* rect);
int objectSetRotation(Object* obj, int direction, Rect* rect);
int objectRotateClockwise(Object* obj, Rect* rect);
int objectRotateCounterClockwise(Object* obj, Rect* rect);
void _obj_rebuild_all_light();
int objectSetLight(Object* obj, int lightDistance, int lightIntensity, Rect* rect);
int objectGetLightIntensity(Object* obj);
int _obj_turn_on_light(Object* obj, Rect* rect);
int _obj_turn_off_light(Object* obj, Rect* rect);
int objectShow(Object* obj, Rect* rect);
int objectHide(Object* obj, Rect* rect);
int objectEnableOutline(Object* obj, Rect* rect);
int objectDisableOutline(Object* obj, Rect* rect);
int _obj_toggle_flat(Object* obj, Rect* rect);
int objectDestroy(Object* a1, Rect* a2);
int _obj_inven_free(Inventory* inventory);
bool _obj_action_can_use(Object* obj);
bool _obj_action_can_talk_to(Object* obj);
bool _obj_portal_is_walk_thru(Object* obj);
Object* objectFindById(int a1);
Object* objectGetOwner(Object* obj);
void _obj_remove_all();
Object* objectFindFirst();
Object* objectFindNext();
Object* objectFindFirstAtElevation(int elevation);
Object* objectFindNextAtElevation();
Object* objectFindFirstAtLocation(int elevation, int tile);
Object* objectFindNextAtLocation();
void objectGetRect(Object* obj, Rect* rect);
bool _obj_occupied(int tile_num, int elev);
Object* _obj_blocking_at(Object* a1, int tile_num, int elev);
Object* _obj_shoot_blocking_at(Object* obj, int tile, int elev);
Object* _obj_ai_blocking_at(Object* a1, int tile, int elevation);
int _obj_scroll_blocking_at(int tile_num, int elev);
Object* _obj_sight_blocking_at(Object* a1, int tile_num, int elev);
int objectGetDistanceBetween(Object* object1, Object* object2);
int objectGetDistanceBetweenTiles(Object* object1, int tile1, Object* object2, int tile2);
int objectListCreate(int tile, int elevation, int objectType, Object*** objectsPtr);
void objectListFree(Object** objects);
void _translucent_trans_buf_to_buf(unsigned char* src, int srcWidth, int srcHeight, int srcPitch, unsigned char* dest, int destX, int destY, int destPitch, unsigned char* a9, unsigned char* a10);
void _dark_trans_buf_to_buf(unsigned char* src, int srcWidth, int srcHeight, int srcPitch, unsigned char* dest, int destX, int destY, int destPitch, int light);
void _dark_translucent_trans_buf_to_buf(unsigned char* src, int srcWidth, int srcHeight, int srcPitch, unsigned char* dest, int destX, int destY, int destPitch, int light, unsigned char* a10, unsigned char* a11);
void _intensity_mask_buf_to_buf(unsigned char* src, int srcWidth, int srcHeight, int srcPitch, unsigned char* dest, int destPitch, unsigned char* mask, int maskPitch, int light);
int objectSetOutline(Object* obj, int a2, Rect* rect);
int objectClearOutline(Object* obj, Rect* rect);
int _obj_intersects_with(Object* object, int x, int y);
int _obj_create_intersect_list(int x, int y, int elevation, int objectType, ObjectWithFlags** entriesPtr);
void _obj_delete_intersect_list(ObjectWithFlags** a1);
void _obj_clear_seen();
void _obj_process_seen();
char* objectGetName(Object* obj);
char* objectGetDescription(Object* obj);
void _obj_preload_art_cache(int flags);
int _obj_offset_table_init();
void _obj_offset_table_exit();
int _obj_order_table_init();
int _obj_order_comp_func_even(const void* a1, const void* a2);
int _obj_order_comp_func_odd(const void* a1, const void* a2);
void _obj_order_table_exit();
int _obj_render_table_init();
void _obj_render_table_exit();
void _obj_light_table_init();
void _obj_blend_table_init();
void _obj_blend_table_exit();
int _obj_save_obj(File* stream, Object* object);
int _obj_load_obj(File* stream, Object** objectPtr, int elevation, Object* owner);
int _obj_save_dude(File* stream);
int _obj_load_dude(File* stream);
int objectAllocate(Object** objectPtr);
void objectDeallocate(Object** objectPtr);
int objectListNodeCreate(ObjectListNode** nodePtr);
void objectListNodeDestroy(ObjectListNode** nodePtr);
int objectGetListNode(Object* obj, ObjectListNode** out_node, ObjectListNode** out_prev_node);
void _obj_insert(ObjectListNode* ptr);
int _obj_remove(ObjectListNode* a1, ObjectListNode* a2);
int _obj_connect_to_tile(ObjectListNode* node, int tile_index, int elev, Rect* rect);
int _obj_adjust_light(Object* obj, int a2, Rect* rect);
void objectDrawOutline(Object* object, Rect* rect);
void _obj_render_object(Object* object, Rect* rect, int light);
void _obj_fix_violence_settings(int* fid);
int _obj_preload_sort(const void* a1, const void* a2);
#endif /* OBJECT_H */