Descent3/lib/bumpmap.h

45 lines
976 B
C
Raw Normal View History

2024-04-16 03:43:29 +00:00
#ifndef BUMPMAP_H
#define BUMPMAP_H
#include "pstypes.h"
#ifdef MACINTOSH
#define MAX_BUMPMAPS 1
#else
#define MAX_BUMPMAPS 500
#endif
2024-04-16 18:56:40 +00:00
#define BAD_BUMP_INDEX 65535
2024-04-16 03:43:29 +00:00
2024-04-16 18:56:40 +00:00
#define BUMPF_USED 1
#define BUMPF_CHANGED 2
2024-04-16 03:43:29 +00:00
2024-04-16 18:56:40 +00:00
typedef struct {
ushort *data; // 8bit data
short cache_slot; // for the renderers use
ubyte width, height;
ubyte flags, pad;
2024-04-16 03:43:29 +00:00
} bms_bumpmap;
extern bms_bumpmap GameBumpmaps[MAX_BUMPMAPS];
// Sets all the bumpmaps to unused
void bump_InitBumpmaps();
2024-04-16 18:56:40 +00:00
void bump_ShutdownBumpmaps(void);
2024-04-16 03:43:29 +00:00
// Allocs a bumpmap of BUMP_WIDTH * BUMP_HEIGHT size
// Returns bumpmap handle if successful, -1 if otherwise
2024-04-16 18:56:40 +00:00
int bump_AllocBumpmap(int w, int h);
2024-04-16 03:43:29 +00:00
// Given a handle, frees the bumpmap memory and flags this bumpmap as unused
2024-04-16 18:56:40 +00:00
void bump_FreeBumpmap(int handle);
2024-04-16 03:43:29 +00:00
// returns a bumpmaps data else NULL if something is wrong
2024-04-16 18:56:40 +00:00
ushort *bump_data(int handle);
2024-04-16 03:43:29 +00:00
// returns width or height of the passed in bumpmap
ubyte bump_w(int handle);
ubyte bump_h(int handle);
#endif