ULTIMA8: Miscellaneous class field renaming

This commit is contained in:
Paul Gilbert 2020-02-24 21:14:17 -08:00
parent 084ae5101b
commit a85bf76b8a
17 changed files with 83 additions and 83 deletions

View file

@ -44,7 +44,7 @@ DEFINE_RUNTIME_CLASSTYPE_CODE(AudioProcess, Process)
AudioProcess *AudioProcess::_theAudioProcess = 0;
AudioProcess::AudioProcess(void) : paused(0) {
AudioProcess::AudioProcess(void) : _paused(0) {
_theAudioProcess = this;
_type = 1; // persistent
}
@ -402,8 +402,8 @@ bool AudioProcess::isSpeechPlaying(Std::string &barked, int shapeNum) {
}
void AudioProcess::pauseAllSamples() {
paused++;
if (paused != 1) return;
_paused++;
if (_paused != 1) return;
AudioMixer *mixer = AudioMixer::get_instance();
@ -421,8 +421,8 @@ void AudioProcess::pauseAllSamples() {
}
void AudioProcess::unpauseAllSamples() {
paused--;
if (paused != 0) return;
_paused--;
if (_paused != 0) return;
AudioMixer *mixer = AudioMixer::get_instance();

View file

@ -120,7 +120,7 @@ public:
private:
void saveData(ODataSource *ods) override;
uint32 paused;
uint32 _paused;
//! play the next speech sample for the text in this SampleInfo
//! note: si is reused if successful

View file

@ -41,7 +41,7 @@ public:
uint32 _maxOffset;
};
uint32 read4(IDataSource *) { return 0; }
uint32 curOffset;
uint32 _curOffset;
virtual const char* const *intrinsics()=0;
virtual const char* const *event_names()=0;

View file

@ -257,9 +257,9 @@ bool FileSystem::RemoveVirtualPath(const string &vpath) {
IDataSource *FileSystem::checkBuiltinData(const Std::string &vfn, bool is_text) {
// Is it a Memory file?
Std::map<Common::String, MemoryFile *>::iterator mf = memoryfiles.find(vfn);
Std::map<Common::String, MemoryFile *>::iterator mf = _memoryFiles.find(vfn);
if (mf != memoryfiles.end())
if (mf != _memoryFiles.end())
return new IBufferDataSource(mf->_value->_data,
mf->_value->_len, is_text);

View file

@ -120,7 +120,7 @@ private:
const uint8 *_data;
const uint32 _len;
};
Std::map<Common::String, MemoryFile *> memoryfiles; // Files mounted in memory
Std::map<Common::String, MemoryFile *> _memoryFiles; // Files mounted in memory
};
} // End of namespace Ultima8

View file

@ -45,7 +45,7 @@ BarkGump::BarkGump(uint16 owner, const Std::string &msg, uint32 speechShapeNum)
ItemRelativeGump(0, 0, 100, 100, owner, FLAG_KEEP_VISIBLE, LAYER_ABOVE_NORMAL),
_barked(msg), _counter(100), _speechShapeNum(speechShapeNum),
_speechLength(0), _totalTextHeight(0), _textWidget(0) {
SettingManager::get_instance()->get("textdelay", textdelay);
SettingManager::get_instance()->get("textdelay", _textDelay);
}
BarkGump::~BarkGump(void) {
@ -106,7 +106,7 @@ void BarkGump::InitGump(Gump *newparent, bool take_focus) {
if (_speechLength && _totalTextHeight) {
_counter = (d.h * _speechLength) / _totalTextHeight;
} else {
_counter = d.h * textdelay;
_counter = d.h * _textDelay;
}
_dims.h = d.h;
_dims.w = d.w;
@ -125,7 +125,7 @@ bool BarkGump::NextText() {
if (_speechLength && _totalTextHeight) {
_counter = (d.h * _speechLength) / _totalTextHeight;
} else {
_counter = d.h * textdelay;
_counter = d.h * _textDelay;
}
_dims.h = d.h;
_dims.w = d.w;
@ -157,7 +157,7 @@ void BarkGump::run() {
if (!speechplaying)
Close();
else
_counter = textdelay;
_counter = _textDelay;
}
}
}
@ -213,12 +213,12 @@ bool BarkGump::loadData(IDataSource *ids, uint32 version) {
TextWidget *widget = p_dynamic_cast<TextWidget *>(getGump(_textWidget));
SettingManager::get_instance()->get("textdelay", textdelay);
SettingManager::get_instance()->get("textdelay", _textDelay);
// This is just a hack
Rect d;
widget->GetDims(d);
_counter = d.h * textdelay;
_counter = d.h * _textDelay;
_dims.h = d.h;
_dims.w = d.w;

View file

@ -59,7 +59,7 @@ protected:
//! returns false if no more text available
bool NextText();
int textdelay;
int _textDelay;
public:
bool loadData(IDataSource *ids, uint32 version);

View file

@ -38,7 +38,7 @@ namespace Ultima8 {
DEFINE_RUNTIME_CLASSTYPE_CODE(BindGump, ModalGump)
BindGump::BindGump(istring *b, Gump *g): ModalGump(0, 0, 160, 80), binding(b), invoker(g) {
BindGump::BindGump(istring *b, Gump *g): ModalGump(0, 0, 160, 80), _binding(b), _invoker(g) {
}
BindGump::~BindGump() {
@ -64,13 +64,13 @@ void BindGump::PaintThis(RenderSurface *surf, int32 lerp_factor, bool scaled) {
}
bool BindGump::OnKeyDown(int key, int mod) {
if (key != Common::KEYCODE_ESCAPE && binding) {
if (key != Common::KEYCODE_ESCAPE && _binding) {
HIDManager *hidmanager = HIDManager::get_instance();
if (key == Common::KEYCODE_BACKSPACE) {
hidmanager->unbind(*binding);
hidmanager->unbind(*_binding);
}
if (invoker)
invoker->ChildNotify(this, UPDATE);
if (_invoker)
_invoker->ChildNotify(this, UPDATE);
}
Close();
return true;
@ -81,8 +81,8 @@ Gump *BindGump::OnMouseDown(int button, int32 mx, int32 my) {
// HIDManager * hidmanager = HIDManager::get_instance();
// if (binding)
// hidmanager->bind(control, *binding);
if (invoker)
invoker->ChildNotify(this, UPDATE);
if (_invoker)
_invoker->ChildNotify(this, UPDATE);
Close();
return this;
}

View file

@ -55,8 +55,8 @@ public:
};
protected:
void saveData(ODataSource *ods) override;
istring *binding;
Gump *invoker;
istring *_binding;
Gump *_invoker;
};
} // End of namespace Ultima8

View file

@ -48,7 +48,7 @@ BookGump::BookGump()
}
BookGump::BookGump(ObjId owner_, Std::string msg) :
ModalGump(0, 0, 100, 100, owner_), text(msg) {
ModalGump(0, 0, 100, 100, owner_), _text(msg) {
}
BookGump::~BookGump(void) {
@ -58,16 +58,16 @@ void BookGump::InitGump(Gump *newparent, bool take_focus) {
ModalGump::InitGump(newparent, take_focus);
// Create the TextWidgets (NOTE: they _must_ have exactly the same _dims)
TextWidget *widget = new TextWidget(9, 5, text, true, 9, 123, 129); //!! constants
TextWidget *widget = new TextWidget(9, 5, _text, true, 9, 123, 129); //!! constants
widget->InitGump(this);
textwidgetL = widget->getObjId();
_textWidgetL = widget->getObjId();
widget = new TextWidget(150, 5, text, true, 9, 123, 129); //!! constants
widget = new TextWidget(150, 5, _text, true, 9, 123, 129); //!! constants
widget->InitGump(this);
textwidgetR = widget->getObjId();
_textWidgetR = widget->getObjId();
widget->setupNextText();
text.clear(); // no longer need this
_text.clear(); // no longer need this
//!! constant
Shape *shapeP = GameData::get_instance()->getGumps()->getShape(6);
@ -82,8 +82,8 @@ void BookGump::InitGump(Gump *newparent, bool take_focus) {
}
void BookGump::NextText() {
TextWidget *widgetL = p_dynamic_cast<TextWidget *>(getGump(textwidgetL));
TextWidget *widgetR = p_dynamic_cast<TextWidget *>(getGump(textwidgetR));
TextWidget *widgetL = p_dynamic_cast<TextWidget *>(getGump(_textWidgetL));
TextWidget *widgetR = p_dynamic_cast<TextWidget *>(getGump(_textWidgetR));
assert(widgetL);
assert(widgetR);
if (!widgetR->setupNextText()) {

View file

@ -31,9 +31,9 @@ namespace Ultima {
namespace Ultima8 {
class BookGump : public ModalGump {
Std::string text;
ObjId textwidgetL;
ObjId textwidgetR;
Std::string _text;
ObjId _textWidgetL;
ObjId _textWidgetR;
public:
ENABLE_RUNTIME_CLASSTYPE()

View file

@ -145,8 +145,8 @@ void ContainerGump::PaintThis(RenderSurface *surf, int32 lerp_factor, bool scale
if (_displayDragging) {
int32 itemx, itemy;
itemx = dragging_x + _itemArea.x;
itemy = dragging_y + _itemArea.y;
itemx = _draggingX + _itemArea.x;
itemy = _draggingY + _itemArea.y;
Shape *s = GameData::get_instance()->getMainShapes()->
getShape(_draggingShape);
assert(s);
@ -403,18 +403,18 @@ bool ContainerGump::DraggingItem(Item *item, int mx, int my) {
// determine target location and set dragging_x/y
dragging_x = mx - _itemArea.x - dox;
dragging_y = my - _itemArea.y - doy;
_draggingX = mx - _itemArea.x - dox;
_draggingY = my - _itemArea.y - doy;
Shape *sh = item->getShapeObject();
assert(sh);
ShapeFrame *fr = sh->getFrame(_draggingFrame);
assert(fr);
if (dragging_x - fr->_xoff < 0 ||
dragging_x - fr->_xoff + fr->_width > _itemArea.w ||
dragging_y - fr->_yoff < 0 ||
dragging_y - fr->_yoff + fr->_height > _itemArea.h) {
if (_draggingX - fr->_xoff < 0 ||
_draggingX - fr->_xoff + fr->_width > _itemArea.w ||
_draggingY - fr->_yoff < 0 ||
_draggingY - fr->_yoff + fr->_height > _itemArea.h) {
_displayDragging = false;
return false;
}
@ -478,7 +478,7 @@ void ContainerGump::DropItem(Item *item, int mx, int my) {
splittarget->randomGumpLocation();
} else {
splittarget->moveToContainer(getContainer(_owner));
splittarget->setGumpLocation(dragging_x, dragging_y);
splittarget->setGumpLocation(_draggingX, _draggingY);
}
}
@ -532,9 +532,9 @@ void ContainerGump::DropItem(Item *item, int mx, int my) {
int32 dox, doy;
Mouse::get_instance()->getDraggingOffset(dox, doy);
dragging_x = mx - _itemArea.x - dox;
dragging_y = my - _itemArea.y - doy;
item->setGumpLocation(dragging_x, dragging_y);
_draggingX = mx - _itemArea.x - dox;
_draggingY = my - _itemArea.y - doy;
item->setGumpLocation(_draggingX, _draggingY);
}
}

View file

@ -89,7 +89,7 @@ protected:
uint32 _draggingShape;
uint32 _draggingFrame;
uint32 _draggingFlags;
int32 dragging_x, dragging_y;
int32 _draggingX, _draggingY;
};
} // End of namespace Ultima8

View file

@ -49,15 +49,15 @@ public:
void ChildNotify(Gump *child, uint32 message) override;
void init();
protected:
istring bindingName;
Std::string displayedName;
Gump *button;
istring _bindingName;
Std::string _displayedName;
Gump *_button;
};
DEFINE_RUNTIME_CLASSTYPE_CODE(ControlEntryGump, Gump)
ControlEntryGump::ControlEntryGump(int x_, int y_, int width, const char *binding, const char *name)
: Gump(x_, y_, width, 5), bindingName(binding), displayedName(name) {
: Gump(x_, y_, width, 5), _bindingName(binding), _displayedName(name) {
}
ControlEntryGump::~ControlEntryGump() {
@ -81,9 +81,9 @@ void ControlEntryGump::init() {
Std::vector<const char *> controls;
Rect rect;
button = new ButtonWidget(0, 0, displayedName, true, font, 0x80D000D0);
button->InitGump(this);
button->GetDims(rect);
_button = new ButtonWidget(0, 0, _displayedName, true, font, 0x80D000D0);
_button->InitGump(this);
_button->GetDims(rect);
_dims.h = rect.h;
@ -105,8 +105,8 @@ void ControlEntryGump::init() {
void ControlEntryGump::ChildNotify(Gump *child, uint32 message) {
ObjId cid = child->getObjId();
if (message == ButtonWidget::BUTTON_CLICK) {
if (cid == button->getObjId()) {
ModalGump *gump = new BindGump(&bindingName, _parent);
if (cid == _button->getObjId()) {
ModalGump *gump = new BindGump(&_bindingName, _parent);
gump->InitGump(0);
gump->setRelativePosition(CENTER);
}

View file

@ -213,8 +213,8 @@ void PaperdollGump::PaintThis(RenderSurface *surf, int32 lerp_factor, bool scale
if (_displayDragging) {
int32 itemx, itemy;
itemx = dragging_x + _itemArea.x;
itemy = dragging_y + _itemArea.y;
itemx = _draggingX + _itemArea.x;
itemy = _draggingY + _itemArea.y;
Shape *s = GameData::get_instance()->getMainShapes()->
getShape(_draggingShape);
assert(s);
@ -342,8 +342,8 @@ bool PaperdollGump::DraggingItem(Item *item, int mx, int my) {
}
_draggingFrame++;
dragging_x = equipcoords[equiptype].x;
dragging_y = equipcoords[equiptype].y;
_draggingX = equipcoords[equiptype].x;
_draggingY = equipcoords[equiptype].y;
} else {
// drop in backpack
@ -352,8 +352,8 @@ bool PaperdollGump::DraggingItem(Item *item, int mx, int my) {
return false;
}
dragging_x = _backpackRect.x + _backpackRect.w / 2;
dragging_y = _backpackRect.y + _backpackRect.h / 2;
_draggingX = _backpackRect.x + _backpackRect.w / 2;
_draggingY = _backpackRect.y + _backpackRect.h / 2;
}
return true;

View file

@ -24,44 +24,44 @@ namespace Ultima8 {
void Args::process(const int32 argc, const char *const *const argv) {
for (int32 i = 1; i < argc; ++i) {
for (uint32 j = 0; (j < options.size()) && (i < argc); ++j) {
switch (options[j].valuetype) {
for (uint32 j = 0; (j < _options.size()) && (i < argc); ++j) {
switch (_options[j].valuetype) {
case Option::no_type:
continue;
case Option::type_bool:
if (options[j].option == argv[i])
*(options[j]._bool_val) = options[j]._bool_default;
if (_options[j].option == argv[i])
*(_options[j]._bool_val) = _options[j]._bool_default;
break;
case Option::type_str: {
if (options[j].option == argv[i]) {
if (_options[j].option == argv[i]) {
// We want the _next_ argument
if (++i >= argc) {
warning("Data not specified for argument '%s'. Using default", options[j].option.c_str());
warning("Data not specified for argument '%s'. Using default", _options[j].option.c_str());
break;
}
*(options[j]._str_val) = argv[i];
*(_options[j]._str_val) = argv[i];
}
break;
}
case Option::type_sint: {
if (options[j].option == argv[i]) {
if (_options[j].option == argv[i]) {
// We want the _next_ argument
if (++i >= argc) {
warning("Data not specified for argument '%s'. Using default", options[j].option.c_str());
warning("Data not specified for argument '%s'. Using default", _options[j].option.c_str());
break;
}
*(options[j]._sint_val) = strtol(argv[i], 0, 10);
*(_options[j]._sint_val) = strtol(argv[i], 0, 10);
}
break;
}
case Option::type_uint: {
if (options[j].option == argv[i]) {
if (_options[j].option == argv[i]) {
// We want the _next_ argument
if (++i >= argc) {
warning("Data not specified for argument '%s'. Using default", options[j].option.c_str());
warning("Data not specified for argument '%s'. Using default", _options[j].option.c_str());
break;
}
*(options[j]._uint_val) = strtoul(argv[i], 0, 10);
*(_options[j]._uint_val) = strtoul(argv[i], 0, 10);
}
break;
}

View file

@ -79,23 +79,23 @@ public:
enum { no_type = 0, type_bool, type_str, type_sint, type_uint } valuetype;
};
Std::vector<Option> options;
Std::vector<Option> _options;
// bool
inline void declare(const char *option_cstr, bool *value, const bool defaultvalue = true) {
options.push_back(Option(option_cstr, value, defaultvalue));
_options.push_back(Option(option_cstr, value, defaultvalue));
};
// string
inline void declare(const char *option_cstr, Std::string *value, const char *defaultvalue = 0) {
options.push_back(Option(option_cstr, value, defaultvalue));
_options.push_back(Option(option_cstr, value, defaultvalue));
};
// sint
inline void declare(const char *option_cstr, int32 *value, const int32 defaultvalue = 0) {
options.push_back(Option(option_cstr, value, defaultvalue));
_options.push_back(Option(option_cstr, value, defaultvalue));
};
// uint
inline void declare(const char *option_cstr, uint32 *value, const uint32 defaultvalue = 0) {
options.push_back(Option(option_cstr, value, defaultvalue));
_options.push_back(Option(option_cstr, value, defaultvalue));
};
void process(const int32 argc, const char *const *const argv);