Descent3/lib/megacell.h

49 lines
1.0 KiB
C
Raw Normal View History

2024-04-16 03:43:29 +00:00
#ifndef MEGACELL_H
#define MEGACELL_H
#include "pstypes.h"
#include "manage.h"
#include "gametexture.h"
2024-04-16 18:56:40 +00:00
#define MAX_MEGACELLS 100
2024-04-16 03:43:29 +00:00
2024-04-16 18:56:40 +00:00
#define DEFAULT_MEGACELL_WIDTH 8
#define DEFAULT_MEGACELL_HEIGHT 8
2024-04-16 03:43:29 +00:00
2024-04-16 18:56:40 +00:00
#define MAX_MEGACELL_WIDTH 8
#define MAX_MEGACELL_HEIGHT 8
2024-04-16 03:43:29 +00:00
2024-04-16 18:56:40 +00:00
typedef struct {
char name[PAGENAME_LEN];
sbyte width;
sbyte height;
2024-04-16 03:43:29 +00:00
2024-04-16 18:56:40 +00:00
short texture_handles[MAX_MEGACELL_WIDTH * MAX_MEGACELL_HEIGHT];
int flags;
ubyte used;
2024-04-16 03:43:29 +00:00
} megacell;
extern int Num_megacells;
extern megacell Megacells[MAX_MEGACELLS];
// Sets all MEGACELLs to unused
2024-04-16 18:56:40 +00:00
void InitMegacells();
2024-04-16 03:43:29 +00:00
// Allocs a MEGACELL for use, returns -1 if error, else index on success
2024-04-16 18:56:40 +00:00
int AllocMegacell();
2024-04-16 03:43:29 +00:00
// Frees MEGACELL index n
2024-04-16 18:56:40 +00:00
void FreeMegacell(int n);
2024-04-16 03:43:29 +00:00
// Gets next MEGACELL from n that has actually been alloced
2024-04-16 18:56:40 +00:00
int GetNextMegacell(int n);
2024-04-16 03:43:29 +00:00
// Gets previous MEGACELL from n that has actually been alloced
2024-04-16 18:56:40 +00:00
int GetPrevMegacell(int n);
2024-04-16 03:43:29 +00:00
// Searches thru all MEGACELLs for a specific name, returns -1 if not found
// or index of MEGACELL with name
2024-04-16 18:56:40 +00:00
int FindMegacellName(char *name);
2024-04-16 03:43:29 +00:00
#endif