Last change
on this file since 481 was
481,
checked in by Sam Hocevar, 11 years ago
|
Fuck the history, I'm renaming all .hpp files to .h for my own sanity.
|
-
Property svn:keywords set to
Id
|
File size:
1.1 KB
|
Line | |
---|
1 | /* |
---|
2 | * Abuse - dark 2D side-scrolling platform game |
---|
3 | * Copyright (c) 1995 Crack dot Com |
---|
4 | * |
---|
5 | * This software was released into the Public Domain. As with most public |
---|
6 | * domain software, no warranty is made or implied by Crack dot Com or |
---|
7 | * Jonathan Clark. |
---|
8 | */ |
---|
9 | |
---|
10 | #ifndef __SPECACHE_HPP_ |
---|
11 | #define __SPECACHE_HPP_ |
---|
12 | |
---|
13 | #include "specs.h" |
---|
14 | |
---|
15 | #include <string.h> |
---|
16 | |
---|
17 | class spec_directory_cache |
---|
18 | { |
---|
19 | class filename_node |
---|
20 | { |
---|
21 | public : |
---|
22 | filename_node *left,*right,*next; |
---|
23 | char *fn; |
---|
24 | spec_directory *sd; |
---|
25 | char *filename() { return fn; } |
---|
26 | filename_node(char const *filename, spec_directory *dir) |
---|
27 | { |
---|
28 | fn = strdup(filename); |
---|
29 | sd = dir; |
---|
30 | next = left = right = 0; |
---|
31 | } |
---|
32 | long size; |
---|
33 | } *fn_root,*fn_list; |
---|
34 | void clear(filename_node *f); // private recursive member |
---|
35 | long size; |
---|
36 | public : |
---|
37 | spec_directory *get_spec_directory(char const *filename, bFILE *fp=NULL); |
---|
38 | spec_directory_cache() { fn_root=0; size=0; } |
---|
39 | void clear(); // frees up all allocated memory |
---|
40 | void load(bFILE *fp); |
---|
41 | void save(bFILE *fp); |
---|
42 | ~spec_directory_cache() { clear(); } |
---|
43 | } ; |
---|
44 | |
---|
45 | extern spec_directory_cache sd_cache; |
---|
46 | |
---|
47 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.