CGE: Rename Han structures to Handler
Thanks to Fingolfin for pointing this out (as previous commit)
This commit is contained in:
parent
45de8747d5
commit
4b9d2c2516
4 changed files with 14 additions and 14 deletions
|
@ -96,7 +96,7 @@ void Sound::sndDigiStop(SmpInfo *PSmpInfo) {
|
|||
}
|
||||
|
||||
Fx::Fx(int size) : _current(NULL) {
|
||||
_cache = new Han[size];
|
||||
_cache = new Handler[size];
|
||||
for (_size = 0; _size < size; _size++) {
|
||||
_cache[_size]._ref = 0;
|
||||
_cache[_size]._wav = NULL;
|
||||
|
@ -109,7 +109,7 @@ Fx::~Fx() {
|
|||
}
|
||||
|
||||
void Fx::clear() {
|
||||
for (Han *p = _cache, *q = p + _size; p < q; p++) {
|
||||
for (Handler *p = _cache, *q = p + _size; p < q; p++) {
|
||||
if (p->_ref) {
|
||||
p->_ref = 0;
|
||||
delete p->_wav;
|
||||
|
@ -121,7 +121,7 @@ void Fx::clear() {
|
|||
|
||||
int Fx::find(int ref) {
|
||||
int i = 0;
|
||||
for (Han *p = _cache, *q = p + _size; p < q; p++) {
|
||||
for (Handler *p = _cache, *q = p + _size; p < q; p++) {
|
||||
if (p->_ref == ref)
|
||||
break;
|
||||
else
|
||||
|
@ -131,7 +131,7 @@ int Fx::find(int ref) {
|
|||
}
|
||||
|
||||
void Fx::preload(int ref0) {
|
||||
Han *cacheLim = _cache + _size;
|
||||
Handler *cacheLim = _cache + _size;
|
||||
char filename[12];
|
||||
|
||||
for (int ref = ref0; ref < ref0 + 10; ref++) {
|
||||
|
@ -139,7 +139,7 @@ void Fx::preload(int ref0) {
|
|||
VFile file = VFile(filename);
|
||||
DataCk *wav = loadWave(&file);
|
||||
if (wav) {
|
||||
Han *p = &_cache[find(0)];
|
||||
Handler *p = &_cache[find(0)];
|
||||
if (p >= cacheLim)
|
||||
break;
|
||||
p->_wav = wav;
|
||||
|
@ -157,7 +157,7 @@ DataCk *Fx::load(int idx, int ref) {
|
|||
VFile file = VFile(filename);
|
||||
DataCk *wav = loadWave(&file);
|
||||
if (wav) {
|
||||
Han *p = &_cache[idx];
|
||||
Handler *p = &_cache[idx];
|
||||
p->_wav = wav;
|
||||
p->_ref = ref;
|
||||
} else {
|
||||
|
|
|
@ -82,7 +82,7 @@ private:
|
|||
|
||||
|
||||
class Fx {
|
||||
struct Han {
|
||||
struct Handler {
|
||||
int _ref;
|
||||
DataCk *_wav;
|
||||
} *_cache;
|
||||
|
|
|
@ -38,7 +38,7 @@ Text *_text;
|
|||
Talk *_talk = NULL;
|
||||
|
||||
Text::Text(CGEEngine *vm, const char *fname, int size) : _vm(vm) {
|
||||
_cache = new Han[size];
|
||||
_cache = new Handler[size];
|
||||
mergeExt(_fileName, fname, kSayExt);
|
||||
if (!VFile::exist(_fileName))
|
||||
error("No talk (%s)\n", _fileName);
|
||||
|
@ -55,7 +55,7 @@ Text::~Text() {
|
|||
}
|
||||
|
||||
void Text::clear(int from, int upto) {
|
||||
for (Han *p = _cache, *q = p + _size; p < q; p++) {
|
||||
for (Handler *p = _cache, *q = p + _size; p < q; p++) {
|
||||
if (p->_ref && p->_ref >= from && p->_ref < upto) {
|
||||
p->_ref = 0;
|
||||
delete[] p->_text;
|
||||
|
@ -66,7 +66,7 @@ void Text::clear(int from, int upto) {
|
|||
|
||||
int Text::find(int ref) {
|
||||
int i = 0;
|
||||
for (Han *p = _cache, *q = p + _size; p < q; p++) {
|
||||
for (Handler *p = _cache, *q = p + _size; p < q; p++) {
|
||||
if (p->_ref == ref)
|
||||
break;
|
||||
else
|
||||
|
@ -81,7 +81,7 @@ void Text::preload(int from, int upto) {
|
|||
if (tf._error)
|
||||
return;
|
||||
|
||||
Han *CacheLim = _cache + _size;
|
||||
Handler *CacheLim = _cache + _size;
|
||||
char line[kLineMax + 1];
|
||||
int n;
|
||||
|
||||
|
@ -97,7 +97,7 @@ void Text::preload(int from, int upto) {
|
|||
|
||||
int ref = atoi(s);
|
||||
if (ref && ref >= from && ref < upto) {
|
||||
Han *p = &_cache[find(ref)];
|
||||
Handler *p = &_cache[find(ref)];
|
||||
|
||||
if (p < CacheLim) {
|
||||
delete[] p->_text;
|
||||
|
@ -150,7 +150,7 @@ char *Text::load(int idx, int ref) {
|
|||
if (s < line + n)
|
||||
++s;
|
||||
|
||||
Han *p = &_cache[idx];
|
||||
Handler *p = &_cache[idx];
|
||||
p->_ref = ref;
|
||||
|
||||
if ((p->_text = new char[strlen(s) + 1]) == NULL)
|
||||
|
|
|
@ -42,7 +42,7 @@ namespace CGE {
|
|||
|
||||
|
||||
class Text {
|
||||
struct Han {
|
||||
struct Handler {
|
||||
int _ref;
|
||||
char *_text;
|
||||
} *_cache;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue