2001-02-09 01:52:44 +00:00
|
|
|
|
2001-06-03 04:52:36 +00:00
|
|
|
typedef union pixel32_u {
|
2001-02-09 01:52:44 +00:00
|
|
|
byte chan[4];
|
|
|
|
unsigned p;
|
|
|
|
} pixel32_t;
|
|
|
|
|
|
|
|
|
2001-06-03 04:52:36 +00:00
|
|
|
typedef struct texturedef_s {
|
2001-02-09 01:52:44 +00:00
|
|
|
char texture[16];
|
|
|
|
float rotate;
|
|
|
|
float shift[2];
|
|
|
|
float scale[2];
|
|
|
|
} texturedef_t;
|
|
|
|
|
2001-06-03 04:52:36 +00:00
|
|
|
typedef struct qtexture_s {
|
2001-02-09 01:52:44 +00:00
|
|
|
char name[16];
|
2001-06-03 04:52:36 +00:00
|
|
|
|
2001-02-09 01:52:44 +00:00
|
|
|
int width;
|
|
|
|
int height;
|
|
|
|
NSBitmapImageRep *rep;
|
|
|
|
void *data;
|
|
|
|
pixel32_t flatcolor;
|
|
|
|
} qtexture_t;
|
|
|
|
|
|
|
|
#define MAX_TEXTURES 1024
|
|
|
|
|
|
|
|
extern int tex_count;
|
|
|
|
extern qtexture_t qtextures[MAX_TEXTURES];
|
|
|
|
|
|
|
|
void TEX_InitFromWad (char *path);
|
|
|
|
qtexture_t *TEX_ForName (char *name);
|
|
|
|
|
2001-06-03 04:52:36 +00:00
|
|
|
typedef struct {
|
2001-02-09 01:52:44 +00:00
|
|
|
id image; // NXImage
|
|
|
|
NSRect r;
|
|
|
|
char *name;
|
|
|
|
int index;
|
|
|
|
int display; // flag (on/off)
|
|
|
|
} texpal_t;
|
|
|
|
|
|
|
|
#define TEX_INDENT 10
|
|
|
|
#define TEX_SPACING 16
|
|
|
|
|
|
|
|
extern id texturepalette_i;
|
|
|
|
|
|
|
|
@interface TexturePalette:Object
|
|
|
|
{
|
|
|
|
char currentwad[1024];
|
|
|
|
id textureList_i;
|
|
|
|
id textureView_i;
|
|
|
|
id searchField_i;
|
|
|
|
id sizeField_i;
|
|
|
|
|
|
|
|
id field_Xshift_i;
|
|
|
|
id field_Yshift_i;
|
|
|
|
id field_Xscale_i;
|
|
|
|
id field_Yscale_i;
|
|
|
|
id field_Rotate_i;
|
|
|
|
|
|
|
|
int viewWidth;
|
|
|
|
int viewHeight;
|
|
|
|
int selectedTexture;
|
|
|
|
}
|
|
|
|
|
2001-06-03 04:52:36 +00:00
|
|
|
- (NSString *) currentWad;
|
|
|
|
- initPaletteFromWadfile:(NSString *) wadFile;
|
2001-02-09 01:52:44 +00:00
|
|
|
- computeTextureViewSize;
|
|
|
|
- alphabetize;
|
|
|
|
- getList;
|
2001-06-03 04:52:36 +00:00
|
|
|
- (int) getSelectedTexture;
|
|
|
|
- setSelectedTexture: (int) which;
|
|
|
|
- (int) getSelectedTexIndex;
|
2001-02-09 01:52:44 +00:00
|
|
|
|
|
|
|
// Called externally
|
2001-06-03 04:52:36 +00:00
|
|
|
- (NSString *) selectedTextureName;
|
|
|
|
- selectTextureByName: (NSString *) name;
|
2001-02-09 01:52:44 +00:00
|
|
|
|
|
|
|
// New methods to replace the 2 above ones
|
2001-06-03 04:52:36 +00:00
|
|
|
- (texturedef_t *) textureDef;
|
|
|
|
- setTextureDef: (texturedef_t *) td;
|
2001-02-09 01:52:44 +00:00
|
|
|
|
|
|
|
// Action methods
|
2001-06-03 04:52:36 +00:00
|
|
|
- searchForTexture: (id) sender;
|
2001-02-09 01:52:44 +00:00
|
|
|
|
2001-06-03 04:52:36 +00:00
|
|
|
- clearTexinfo: (id) sender;
|
2001-02-09 01:52:44 +00:00
|
|
|
|
2001-06-03 04:52:36 +00:00
|
|
|
- incXShift: (id) sender;
|
|
|
|
- decXShift: (id) sender;
|
2001-02-09 01:52:44 +00:00
|
|
|
|
2001-06-03 04:52:36 +00:00
|
|
|
- incYShift: (id) sender;
|
|
|
|
- decYShift: (id) sender;
|
2001-02-09 01:52:44 +00:00
|
|
|
|
2001-06-03 04:52:36 +00:00
|
|
|
- incRotate: (id) sender;
|
|
|
|
- decRotate: (id) sender;
|
2001-02-09 01:52:44 +00:00
|
|
|
|
2001-06-03 04:52:36 +00:00
|
|
|
- incXScale: (id) sender;
|
|
|
|
- decXScale: (id) sender;
|
2001-02-09 01:52:44 +00:00
|
|
|
|
2001-06-03 04:52:36 +00:00
|
|
|
- incYScale: (id) sender;
|
|
|
|
- decYScale: (id) sender;
|
2001-02-09 01:52:44 +00:00
|
|
|
|
2001-06-03 04:52:36 +00:00
|
|
|
- texturedefChanged: (id) sender;
|
|
|
|
- onlyShowMapTextures: (id) sender;
|
|
|
|
- (int) searchForTextureInPalette: (NSString *) texture;
|
|
|
|
- setDisplayFlag: (int) index to: (int) value;
|
2001-02-09 01:52:44 +00:00
|
|
|
|
|
|
|
@end
|