summaryrefslogtreecommitdiff
path: root/utils/hlmv/pakviewer.h
blob: c5c4acf783ac930bccd46d04ced9436c88fdcccf (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose: 
//
// $NoKeywords: $
//
//=============================================================================//
//
//                 Half-Life Model Viewer (c) 1999 by Mete Ciragan
//
// file:           pakviewer.h
// last modified:  Apr 28 1999, Mete Ciragan
// copyright:      The programs and associated files contained in this
//                 distribution were developed by Mete Ciragan. The programs
//                 are not in the public domain, but they are freely
//                 distributable without licensing fees. These programs are
//                 provided without guarantee or warrantee expressed or
//                 implied.
//
// version:        1.2
//
// email:          [email protected]
// web:            http://www.swissquake.ch/chumbalum-soft/
//
#ifndef INCLUDED_PAKVIEWER
#define INCLUDED_PAKVIEWER



#ifndef INCLUDED_MXWINDOW
#include "mxWindow.h"
#endif



#define IDC_PAKVIEWER		1001



typedef struct
{
	char name[56];
	int filepos;
	int filelen;
} lump_t;



#ifdef __cpluspus
extern "C" {
#endif

int pak_ExtractFile (const char *pakFile, const char *lumpName, char *outFile);

#ifdef __cpluspus
}
#endif



class mxTreeView;
class mxButton;
class mxPopupMenu;
// class GlWindow;



class PAKViewer : public mxWindow
{
	char d_pakFile[256];
	char d_currLumpName[256];
	bool d_loadEntirePAK;
	mxTreeView *tvPAK;
	mxPopupMenu *pmMenu;

public:
	// CREATORS
	PAKViewer (mxWindow *window);
	~PAKViewer ();

	// MANIPULATORS
	virtual int handleEvent (mxEvent *event);
	int OnPAKViewer ();
	int OnLoadModel ();
	int OnLoadTexture (int pos);
	int OnPlaySound ();
	int OnExtract ();

	bool openPAKFile (const char *pakFile);
	void closePAKFile ();
	void setLoadEntirePAK (bool b) { d_loadEntirePAK = b; }

	// ACCESSORS
	bool getLoadEntirePAK () const { return d_loadEntirePAK; }
};



#endif // INCLUDED_PAKVIEWER