[Scummvm-git-logs] scummvm master -> cad35501ff20755c98661fa538d0a8c98cc27200
dreammaster
paulfgilbert at gmail.com
Tue Feb 25 06:18:10 UTC 2020
This automated email contains information about 3 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
a85bf76b8a ULTIMA8: Miscellaneous class field renaming
931f1b9a86 ULTIMA8: More class field renamings
cad35501ff ULTIMA8: More class field renamings
Commit: a85bf76b8aef477eaa2d5ceb146cf79a9159e936
https://github.com/scummvm/scummvm/commit/a85bf76b8aef477eaa2d5ceb146cf79a9159e936
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2020-02-24T22:16:45-08:00
Commit Message:
ULTIMA8: Miscellaneous class field renaming
Changed paths:
engines/ultima/ultima8/audio/audio_process.cpp
engines/ultima/ultima8/audio/audio_process.h
engines/ultima/ultima8/convert/u8/convert_usecode_u8.h
engines/ultima/ultima8/filesys/file_system.cpp
engines/ultima/ultima8/filesys/file_system.h
engines/ultima/ultima8/gumps/bark_gump.cpp
engines/ultima/ultima8/gumps/bark_gump.h
engines/ultima/ultima8/gumps/bind_gump.cpp
engines/ultima/ultima8/gumps/bind_gump.h
engines/ultima/ultima8/gumps/book_gump.cpp
engines/ultima/ultima8/gumps/book_gump.h
engines/ultima/ultima8/gumps/container_gump.cpp
engines/ultima/ultima8/gumps/container_gump.h
engines/ultima/ultima8/gumps/controls_gump.cpp
engines/ultima/ultima8/gumps/paperdoll_gump.cpp
engines/ultima/ultima8/misc/args.cpp
engines/ultima/ultima8/misc/args.h
diff --git a/engines/ultima/ultima8/audio/audio_process.cpp b/engines/ultima/ultima8/audio/audio_process.cpp
index d13f57b443..c84d94e118 100644
--- a/engines/ultima/ultima8/audio/audio_process.cpp
+++ b/engines/ultima/ultima8/audio/audio_process.cpp
@@ -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();
diff --git a/engines/ultima/ultima8/audio/audio_process.h b/engines/ultima/ultima8/audio/audio_process.h
index 7923d07b5e..78b08ec9f7 100644
--- a/engines/ultima/ultima8/audio/audio_process.h
+++ b/engines/ultima/ultima8/audio/audio_process.h
@@ -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
diff --git a/engines/ultima/ultima8/convert/u8/convert_usecode_u8.h b/engines/ultima/ultima8/convert/u8/convert_usecode_u8.h
index 9d5a4bdf1f..4080da16cf 100644
--- a/engines/ultima/ultima8/convert/u8/convert_usecode_u8.h
+++ b/engines/ultima/ultima8/convert/u8/convert_usecode_u8.h
@@ -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;
diff --git a/engines/ultima/ultima8/filesys/file_system.cpp b/engines/ultima/ultima8/filesys/file_system.cpp
index 9b4ef9684a..29674a9110 100644
--- a/engines/ultima/ultima8/filesys/file_system.cpp
+++ b/engines/ultima/ultima8/filesys/file_system.cpp
@@ -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);
diff --git a/engines/ultima/ultima8/filesys/file_system.h b/engines/ultima/ultima8/filesys/file_system.h
index 2b020322f4..39a8d1b1c9 100644
--- a/engines/ultima/ultima8/filesys/file_system.h
+++ b/engines/ultima/ultima8/filesys/file_system.h
@@ -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
diff --git a/engines/ultima/ultima8/gumps/bark_gump.cpp b/engines/ultima/ultima8/gumps/bark_gump.cpp
index d673101b3f..b80c40d372 100644
--- a/engines/ultima/ultima8/gumps/bark_gump.cpp
+++ b/engines/ultima/ultima8/gumps/bark_gump.cpp
@@ -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;
diff --git a/engines/ultima/ultima8/gumps/bark_gump.h b/engines/ultima/ultima8/gumps/bark_gump.h
index ff418d44f9..630fc291f4 100644
--- a/engines/ultima/ultima8/gumps/bark_gump.h
+++ b/engines/ultima/ultima8/gumps/bark_gump.h
@@ -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);
diff --git a/engines/ultima/ultima8/gumps/bind_gump.cpp b/engines/ultima/ultima8/gumps/bind_gump.cpp
index 32d9f03d54..af4af69fa0 100644
--- a/engines/ultima/ultima8/gumps/bind_gump.cpp
+++ b/engines/ultima/ultima8/gumps/bind_gump.cpp
@@ -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;
}
diff --git a/engines/ultima/ultima8/gumps/bind_gump.h b/engines/ultima/ultima8/gumps/bind_gump.h
index f9aa63cad0..03c041528a 100644
--- a/engines/ultima/ultima8/gumps/bind_gump.h
+++ b/engines/ultima/ultima8/gumps/bind_gump.h
@@ -55,8 +55,8 @@ public:
};
protected:
void saveData(ODataSource *ods) override;
- istring *binding;
- Gump *invoker;
+ istring *_binding;
+ Gump *_invoker;
};
} // End of namespace Ultima8
diff --git a/engines/ultima/ultima8/gumps/book_gump.cpp b/engines/ultima/ultima8/gumps/book_gump.cpp
index 6b5569b358..39e22945ab 100644
--- a/engines/ultima/ultima8/gumps/book_gump.cpp
+++ b/engines/ultima/ultima8/gumps/book_gump.cpp
@@ -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()) {
diff --git a/engines/ultima/ultima8/gumps/book_gump.h b/engines/ultima/ultima8/gumps/book_gump.h
index 35cc384ff7..bf49078722 100644
--- a/engines/ultima/ultima8/gumps/book_gump.h
+++ b/engines/ultima/ultima8/gumps/book_gump.h
@@ -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()
diff --git a/engines/ultima/ultima8/gumps/container_gump.cpp b/engines/ultima/ultima8/gumps/container_gump.cpp
index 92cd64d29a..ad7d200cc4 100644
--- a/engines/ultima/ultima8/gumps/container_gump.cpp
+++ b/engines/ultima/ultima8/gumps/container_gump.cpp
@@ -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);
}
}
diff --git a/engines/ultima/ultima8/gumps/container_gump.h b/engines/ultima/ultima8/gumps/container_gump.h
index 5b5b3aeec3..79aedabe13 100644
--- a/engines/ultima/ultima8/gumps/container_gump.h
+++ b/engines/ultima/ultima8/gumps/container_gump.h
@@ -89,7 +89,7 @@ protected:
uint32 _draggingShape;
uint32 _draggingFrame;
uint32 _draggingFlags;
- int32 dragging_x, dragging_y;
+ int32 _draggingX, _draggingY;
};
} // End of namespace Ultima8
diff --git a/engines/ultima/ultima8/gumps/controls_gump.cpp b/engines/ultima/ultima8/gumps/controls_gump.cpp
index 01e89c1759..63a297b764 100644
--- a/engines/ultima/ultima8/gumps/controls_gump.cpp
+++ b/engines/ultima/ultima8/gumps/controls_gump.cpp
@@ -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);
}
diff --git a/engines/ultima/ultima8/gumps/paperdoll_gump.cpp b/engines/ultima/ultima8/gumps/paperdoll_gump.cpp
index a1f1dbf5ca..6ad557bfa6 100644
--- a/engines/ultima/ultima8/gumps/paperdoll_gump.cpp
+++ b/engines/ultima/ultima8/gumps/paperdoll_gump.cpp
@@ -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;
diff --git a/engines/ultima/ultima8/misc/args.cpp b/engines/ultima/ultima8/misc/args.cpp
index d86d4237be..349d62b71f 100644
--- a/engines/ultima/ultima8/misc/args.cpp
+++ b/engines/ultima/ultima8/misc/args.cpp
@@ -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;
}
diff --git a/engines/ultima/ultima8/misc/args.h b/engines/ultima/ultima8/misc/args.h
index 678de76539..3afebc2dd6 100644
--- a/engines/ultima/ultima8/misc/args.h
+++ b/engines/ultima/ultima8/misc/args.h
@@ -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);
Commit: 931f1b9a866d81196dfb73e0071620f6aa2f5359
https://github.com/scummvm/scummvm/commit/931f1b9a866d81196dfb73e0071620f6aa2f5359
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2020-02-24T22:16:45-08:00
Commit Message:
ULTIMA8: More class field renamings
Changed paths:
engines/ultima/ultima8/filesys/idata_source.h
engines/ultima/ultima8/filesys/named_archive_file.h
engines/ultima/ultima8/gumps/menu_gump.cpp
engines/ultima/ultima8/gumps/menu_gump.h
engines/ultima/ultima8/gumps/minimap_gump.cpp
engines/ultima/ultima8/gumps/minimap_gump.h
engines/ultima/ultima8/gumps/paperdoll_gump.cpp
engines/ultima/ultima8/gumps/paperdoll_gump.h
engines/ultima/ultima8/kernel/kernel.cpp
engines/ultima/ultima8/kernel/kernel.h
engines/ultima/ultima8/kernel/object_manager.cpp
engines/ultima/ultima8/kernel/object_manager.h
engines/ultima/ultima8/kernel/process.cpp
engines/ultima/ultima8/kernel/process.h
engines/ultima/ultima8/misc/debugger.cpp
engines/ultima/ultima8/world/actors/quick_avatar_mover_process.cpp
engines/ultima/ultima8/world/actors/quick_avatar_mover_process.h
engines/ultima/ultima8/world/glob_egg.cpp
engines/ultima/ultima8/world/map_glob.cpp
engines/ultima/ultima8/world/map_glob.h
diff --git a/engines/ultima/ultima8/filesys/idata_source.h b/engines/ultima/ultima8/filesys/idata_source.h
index 0f6ada1efb..06f1b110b4 100644
--- a/engines/ultima/ultima8/filesys/idata_source.h
+++ b/engines/ultima/ultima8/filesys/idata_source.h
@@ -197,43 +197,43 @@ public:
class IBufferDataSource : public IDataSource {
protected:
- const uint8 *buf;
- const uint8 *buf_ptr;
- bool free_buffer;
- uint32 size;
+ const uint8 *_buf;
+ const uint8 *_bufPtr;
+ bool _freeBuffer;
+ uint32 _size;
void ConvertTextBuffer() {
#ifdef WIN32
- uint8 *new_buf = new uint8[size];
+ uint8 *new_buf = new uint8[_size];
uint8 *new_buf_ptr = new_buf;
uint32 new_size = 0;
// What we want to do is convert all 0x0D 0x0A to just 0x0D
// Do for all but last byte
- while (size > 1) {
- if (*(uint16 *)buf_ptr == 0x0A0D) {
- buf_ptr++;
- size--;
+ while (_size > 1) {
+ if (*(uint16 *)_bufPtr == 0x0A0D) {
+ _bufPtr++;
+ _size--;
}
- *new_buf_ptr = *buf_ptr;
+ *new_buf_ptr = *_bufPtr;
new_buf_ptr++;
new_size++;
- buf_ptr++;
- size--;
+ _bufPtr++;
+ _size--;
}
// Do last byte
- if (size) *new_buf_ptr = *buf_ptr;
+ if (_size) *new_buf_ptr = *_bufPtr;
// Delete old buffer if requested
- if (free_buffer) delete[] const_cast<uint8 *>(buf);
+ if (_freeBuffer) delete[] const_cast<uint8 *>(_buf);
- buf_ptr = buf = new_buf;
- size = new_size;
- free_buffer = true;
+ _bufPtr = _buf = new_buf;
+ _size = new_size;
+ _freeBuffer = true;
#endif
}
@@ -241,107 +241,107 @@ public:
IBufferDataSource(const void *data, unsigned int len, bool is_text = false,
bool delete_data = false) {
assert(data != 0 || len == 0);
- buf = buf_ptr = static_cast<const uint8 *>(data);
- size = len;
- free_buffer = delete_data;
+ _buf = _bufPtr = static_cast<const uint8 *>(data);
+ _size = len;
+ _freeBuffer = delete_data;
if (is_text) ConvertTextBuffer();
}
virtual void load(const void *data, unsigned int len, bool is_text = false,
bool delete_data = false) {
- if (free_buffer && buf) delete [] const_cast<uint8 *>(buf);
- free_buffer = false;
- buf = buf_ptr = 0;
+ if (_freeBuffer && _buf) delete [] const_cast<uint8 *>(_buf);
+ _freeBuffer = false;
+ _buf = _bufPtr = 0;
assert(data != 0 || len == 0);
- buf = buf_ptr = static_cast<const uint8 *>(data);
- size = len;
- free_buffer = delete_data;
+ _buf = _bufPtr = static_cast<const uint8 *>(data);
+ _size = len;
+ _freeBuffer = delete_data;
if (is_text) ConvertTextBuffer();
}
~IBufferDataSource() override {
- if (free_buffer && buf) delete [] const_cast<uint8 *>(buf);
- free_buffer = false;
- buf = buf_ptr = 0;
+ if (_freeBuffer && _buf) delete [] const_cast<uint8 *>(_buf);
+ _freeBuffer = false;
+ _buf = _bufPtr = 0;
}
uint8 read1() override {
uint8 b0;
- b0 = *buf_ptr++;
+ b0 = *_bufPtr++;
return (b0);
}
uint16 read2() override {
uint8 b0, b1;
- b0 = *buf_ptr++;
- b1 = *buf_ptr++;
+ b0 = *_bufPtr++;
+ b1 = *_bufPtr++;
return (b0 | (b1 << 8));
}
uint16 read2high() override {
uint8 b0, b1;
- b1 = *buf_ptr++;
- b0 = *buf_ptr++;
+ b1 = *_bufPtr++;
+ b0 = *_bufPtr++;
return (b0 | (b1 << 8));
}
uint32 read3() override {
uint8 b0, b1, b2;
- b0 = *buf_ptr++;
- b1 = *buf_ptr++;
- b2 = *buf_ptr++;
+ b0 = *_bufPtr++;
+ b1 = *_bufPtr++;
+ b2 = *_bufPtr++;
return (b0 | (b1 << 8) | (b2 << 16));
}
uint32 read4() override {
uint8 b0, b1, b2, b3;
- b0 = *buf_ptr++;
- b1 = *buf_ptr++;
- b2 = *buf_ptr++;
- b3 = *buf_ptr++;
+ b0 = *_bufPtr++;
+ b1 = *_bufPtr++;
+ b2 = *_bufPtr++;
+ b3 = *_bufPtr++;
return (b0 | (b1 << 8) | (b2 << 16) | (b3 << 24));
}
uint32 read4high() override {
uint8 b0, b1, b2, b3;
- b3 = *buf_ptr++;
- b2 = *buf_ptr++;
- b1 = *buf_ptr++;
- b0 = *buf_ptr++;
+ b3 = *_bufPtr++;
+ b2 = *_bufPtr++;
+ b1 = *_bufPtr++;
+ b0 = *_bufPtr++;
return (b0 | (b1 << 8) | (b2 << 16) | (b3 << 24));
}
int32 read(void *str, int32 num_bytes) override {
- if (buf_ptr >= buf + size) return 0;
+ if (_bufPtr >= _buf + _size) return 0;
int32 count = num_bytes;
- if (buf_ptr + num_bytes > buf + size)
- count = static_cast<int32>(buf - buf_ptr + size);
- Std::memcpy(str, buf_ptr, count);
- buf_ptr += count;
+ if (_bufPtr + num_bytes > _buf + _size)
+ count = static_cast<int32>(_buf - _bufPtr + _size);
+ Std::memcpy(str, _bufPtr, count);
+ _bufPtr += count;
return count;
}
void seek(uint32 pos) override {
- buf_ptr = buf + pos;
+ _bufPtr = _buf + pos;
}
void skip(int32 delta) override {
- buf_ptr += delta;
+ _bufPtr += delta;
}
uint32 getSize() const override {
- return size;
+ return _size;
}
uint32 getPos() const override {
- return static_cast<uint32>(buf_ptr - buf);
+ return static_cast<uint32>(_bufPtr - _buf);
}
bool eof() const override {
- return (static_cast<uint32>(buf_ptr - buf)) >= size;
+ return (static_cast<uint32>(_bufPtr - _buf)) >= _size;
}
};
diff --git a/engines/ultima/ultima8/filesys/named_archive_file.h b/engines/ultima/ultima8/filesys/named_archive_file.h
index 49605832a8..8ce9b6a565 100644
--- a/engines/ultima/ultima8/filesys/named_archive_file.h
+++ b/engines/ultima/ultima8/filesys/named_archive_file.h
@@ -33,7 +33,7 @@ class NamedArchiveFile : public ArchiveFile {
public:
ENABLE_RUNTIME_CLASSTYPE()
- NamedArchiveFile() : indexCount(0) { }
+ NamedArchiveFile() : _indexCount(0) { }
~NamedArchiveFile() override { }
bool exists(uint32 index) override {
@@ -59,7 +59,7 @@ public:
uint32 getCount() override = 0;
uint32 getIndexCount() override {
- return indexCount;
+ return _indexCount;
}
bool isIndexed() const override {
@@ -72,8 +72,8 @@ public:
protected:
bool indexToName(uint32 index, Std::string &name) {
Std::map<uint32, Std::string>::iterator iter;
- iter = indexedNames.find(index);
- if (iter == indexedNames.end()) return false;
+ iter = _indexedNames.find(index);
+ if (iter == _indexedNames.end()) return false;
name = iter->_value;
return true;
}
@@ -82,13 +82,13 @@ protected:
uint32 index;
bool hasIndex = extractIndexFromName(name, index);
if (hasIndex) {
- indexedNames[index] = name;
- if (index >= indexCount) indexCount = index + 1;
+ _indexedNames[index] = name;
+ if (index >= _indexCount) _indexCount = index + 1;
}
}
- Std::map<uint32, Std::string> indexedNames;
- uint32 indexCount;
+ Std::map<uint32, Std::string> _indexedNames;
+ uint32 _indexCount;
};
} // End of namespace Ultima8
diff --git a/engines/ultima/ultima8/gumps/menu_gump.cpp b/engines/ultima/ultima8/gumps/menu_gump.cpp
index d6eeb5dbbe..4197102ff6 100644
--- a/engines/ultima/ultima8/gumps/menu_gump.cpp
+++ b/engines/ultima/ultima8/gumps/menu_gump.cpp
@@ -56,19 +56,19 @@ DEFINE_RUNTIME_CLASSTYPE_CODE(MenuGump, ModalGump)
MenuGump::MenuGump(bool nameEntryMode_)
: ModalGump(0, 0, 5, 5, 0, FLAG_DONT_SAVE) {
- nameEntryMode = nameEntryMode_;
+ _nameEntryMode = nameEntryMode_;
Mouse *mouse = Mouse::get_instance();
mouse->pushMouseCursor();
- if (!nameEntryMode)
+ if (!_nameEntryMode)
mouse->setMouseCursor(Mouse::MOUSE_HAND);
else
mouse->setMouseCursor(Mouse::MOUSE_NONE);
// Save old music state
MusicProcess *musicprocess = MusicProcess::get_instance();
- if (musicprocess) oldMusicTrack = musicprocess->getTrack();
- else oldMusicTrack = 0;
+ if (musicprocess) _oldMusicTrack = musicprocess->getTrack();
+ else _oldMusicTrack = 0;
}
MenuGump::~MenuGump() {
@@ -77,7 +77,7 @@ MenuGump::~MenuGump() {
void MenuGump::Close(bool no_del) {
// Restore old music state
MusicProcess *musicprocess = MusicProcess::get_instance();
- if (musicprocess) musicprocess->playMusic(oldMusicTrack);
+ if (musicprocess) musicprocess->playMusic(_oldMusicTrack);
Mouse *mouse = Mouse::get_instance();
mouse->popMouseCursor();
@@ -108,7 +108,7 @@ void MenuGump::InitGump(Gump *newparent, bool take_focus) {
logo->SetShape(logoShape, 0);
logo->InitGump(this, false);
- if (!nameEntryMode) {
+ if (!_nameEntryMode) {
SettingManager *settingman = SettingManager::get_instance();
bool endgame, quotes;
settingman->get("endgame", endgame);
@@ -167,7 +167,7 @@ void MenuGump::PaintThis(RenderSurface *surf, int32 lerp_factor, bool scaled) {
bool MenuGump::OnKeyDown(int key, int mod) {
if (Gump::OnKeyDown(key, mod)) return true;
- if (!nameEntryMode) {
+ if (!_nameEntryMode) {
if (key == Common::KEYCODE_ESCAPE) {
// FIXME: this check should probably be in Game or GUIApp
diff --git a/engines/ultima/ultima8/gumps/menu_gump.h b/engines/ultima/ultima8/gumps/menu_gump.h
index 55aae1c1b6..48c932626b 100644
--- a/engines/ultima/ultima8/gumps/menu_gump.h
+++ b/engines/ultima/ultima8/gumps/menu_gump.h
@@ -54,8 +54,8 @@ public:
static void inputName();
protected:
- bool nameEntryMode;
- int oldMusicTrack;
+ bool _nameEntryMode;
+ int _oldMusicTrack;
virtual void selectEntry(int entry);
};
diff --git a/engines/ultima/ultima8/gumps/minimap_gump.cpp b/engines/ultima/ultima8/gumps/minimap_gump.cpp
index b8b64c14a7..8e9d8e81b9 100644
--- a/engines/ultima/ultima8/gumps/minimap_gump.cpp
+++ b/engines/ultima/ultima8/gumps/minimap_gump.cpp
@@ -43,7 +43,7 @@ MiniMapGump::MiniMapGump(int x_, int y_) :
FLAG_DRAGGABLE, LAYER_NORMAL), _minimap(), _lastMapNum(0) {
_minimap._format = TEX_FMT_NATIVE;
_minimap._width = _minimap._height = MAP_NUM_CHUNKS * MINMAPGUMP_SCALE;
- _minimap._buffer = texbuffer[0];
+ _minimap._buffer = _texBuffer[0];
}
MiniMapGump::MiniMapGump() : Gump() {
@@ -58,7 +58,7 @@ void MiniMapGump::PaintThis(RenderSurface *surf, int32 lerp_factor, bool scaled)
int mapChunkSize = currentmap->getChunkSize();
if (currentmap->getNum() != _lastMapNum) {
- Std::memset(texbuffer, 0, sizeof(texbuffer));
+ Std::memset(_texBuffer, 0, sizeof(_texBuffer));
_lastMapNum = currentmap->getNum();
}
@@ -71,8 +71,8 @@ void MiniMapGump::PaintThis(RenderSurface *surf, int32 lerp_factor, bool scaled)
for (int xv = 0; xv < MAP_NUM_CHUNKS; xv++) {
if (currentmap->isChunkFast(xv, yv)) {
for (int j = 0; j < MINMAPGUMP_SCALE; j++) for (int i = 0; i < MINMAPGUMP_SCALE; i++) {
- if (texbuffer[yv * MINMAPGUMP_SCALE + j][xv * MINMAPGUMP_SCALE + i] == 0)
- texbuffer[yv * MINMAPGUMP_SCALE + j][xv * MINMAPGUMP_SCALE + i] = sampleAtPoint(
+ if (_texBuffer[yv * MINMAPGUMP_SCALE + j][xv * MINMAPGUMP_SCALE + i] == 0)
+ _texBuffer[yv * MINMAPGUMP_SCALE + j][xv * MINMAPGUMP_SCALE + i] = sampleAtPoint(
xv * mapChunkSize + mapChunkSize / (MINMAPGUMP_SCALE * 2) + (mapChunkSize * i) / MINMAPGUMP_SCALE,
yv * mapChunkSize + mapChunkSize / (MINMAPGUMP_SCALE * 2) + (mapChunkSize * j) / MINMAPGUMP_SCALE,
currentmap);
@@ -173,7 +173,7 @@ bool MiniMapGump::loadData(IDataSource *ids, uint32 version) {
_lastMapNum = 0;
_minimap._format = TEX_FMT_NATIVE;
_minimap._width = _minimap._height = MAP_NUM_CHUNKS * MINMAPGUMP_SCALE;
- _minimap._buffer = texbuffer[0];
+ _minimap._buffer = _texBuffer[0];
return true;
}
diff --git a/engines/ultima/ultima8/gumps/minimap_gump.h b/engines/ultima/ultima8/gumps/minimap_gump.h
index b198cafb4d..5f30717e8a 100644
--- a/engines/ultima/ultima8/gumps/minimap_gump.h
+++ b/engines/ultima/ultima8/gumps/minimap_gump.h
@@ -36,7 +36,7 @@ namespace Ultima8 {
class MiniMapGump : public Gump {
Texture _minimap;
unsigned int _lastMapNum;
- uint32 texbuffer[MAP_NUM_CHUNKS * MINMAPGUMP_SCALE][MAP_NUM_CHUNKS * MINMAPGUMP_SCALE];
+ uint32 _texBuffer[MAP_NUM_CHUNKS * MINMAPGUMP_SCALE][MAP_NUM_CHUNKS * MINMAPGUMP_SCALE];
uint32 sampleAtPoint(int x, int y, CurrentMap *map);
diff --git a/engines/ultima/ultima8/gumps/paperdoll_gump.cpp b/engines/ultima/ultima8/gumps/paperdoll_gump.cpp
index 6ad557bfa6..9cb78172be 100644
--- a/engines/ultima/ultima8/gumps/paperdoll_gump.cpp
+++ b/engines/ultima/ultima8/gumps/paperdoll_gump.cpp
@@ -85,8 +85,8 @@ static const int statbuttony = 84;
PaperdollGump::PaperdollGump() : ContainerGump(), _statButtonId(0),
_backpackRect(49, 25, 10, 25) {
- Common::fill(cached_text, cached_text + 14, (RenderedText *)nullptr);
- Common::fill(cached_val, cached_val + 7, 0);
+ Common::fill(_cachedText, _cachedText + 14, (RenderedText *)nullptr);
+ Common::fill(_cachedVal, _cachedVal + 7, 0);
}
PaperdollGump::PaperdollGump(Shape *shape_, uint32 frameNum, uint16 owner,
@@ -95,14 +95,14 @@ PaperdollGump::PaperdollGump(Shape *shape_, uint32 frameNum, uint16 owner,
_statButtonId(0), _backpackRect(49, 25, 10, 25) {
_statButtonId = 0;
- Common::fill(cached_text, cached_text + 14, (RenderedText *)nullptr);
- Common::fill(cached_val, cached_val + 7, 0);
+ Common::fill(_cachedText, _cachedText + 14, (RenderedText *)nullptr);
+ Common::fill(_cachedVal, _cachedVal + 7, 0);
}
PaperdollGump::~PaperdollGump() {
for (int i = 0; i < 14; ++i) { // ! constant
- delete cached_text[i];
- cached_text[i] = 0;
+ delete _cachedText[i];
+ _cachedText[i] = 0;
}
}
@@ -152,21 +152,21 @@ void PaperdollGump::PaintStat(RenderSurface *surf, unsigned int n,
char buf[16]; // enough for uint32
unsigned int remaining;
- if (!cached_text[2 * n])
- cached_text[2 * n] = descfont->renderText(text, remaining,
+ if (!_cachedText[2 * n])
+ _cachedText[2 * n] = descfont->renderText(text, remaining,
statdescwidth, statheight,
Font::TEXT_RIGHT);
- cached_text[2 * n]->draw(surf, statcoords[n].xd, statcoords[n].y);
+ _cachedText[2 * n]->draw(surf, statcoords[n].xd, statcoords[n].y);
- if (!cached_text[2 * n + 1] || cached_val[n] != val) {
- delete cached_text[2 * n + 1];
+ if (!_cachedText[2 * n + 1] || _cachedVal[n] != val) {
+ delete _cachedText[2 * n + 1];
sprintf(buf, "%d", val);
- cached_text[2 * n + 1] = font->renderText(buf, remaining,
+ _cachedText[2 * n + 1] = font->renderText(buf, remaining,
statwidth, statheight,
Font::TEXT_RIGHT);
- cached_val[n] = val;
+ _cachedVal[n] = val;
}
- cached_text[2 * n + 1]->draw(surf, statcoords[n].x, statcoords[n].y);
+ _cachedText[2 * n + 1]->draw(surf, statcoords[n].x, statcoords[n].y);
}
void PaperdollGump::PaintStats(RenderSurface *surf, int32 lerp_factor) {
diff --git a/engines/ultima/ultima8/gumps/paperdoll_gump.h b/engines/ultima/ultima8/gumps/paperdoll_gump.h
index 65271c1a89..4a9cb52a13 100644
--- a/engines/ultima/ultima8/gumps/paperdoll_gump.h
+++ b/engines/ultima/ultima8/gumps/paperdoll_gump.h
@@ -74,8 +74,8 @@ protected:
void PaintStat(RenderSurface *surf, unsigned int n,
Std::string text, int val);
- RenderedText *cached_text[14]; // constant!!
- int cached_val[7]; // constant!!
+ RenderedText *_cachedText[14]; // constant!!
+ int _cachedVal[7]; // constant!!
uint16 _statButtonId;
private:
diff --git a/engines/ultima/ultima8/kernel/kernel.cpp b/engines/ultima/ultima8/kernel/kernel.cpp
index 4d3fe78fb8..f9c31efddb 100644
--- a/engines/ultima/ultima8/kernel/kernel.cpp
+++ b/engines/ultima/ultima8/kernel/kernel.cpp
@@ -32,14 +32,14 @@
namespace Ultima {
namespace Ultima8 {
-Kernel *Kernel::kernel = 0;
+Kernel *Kernel::_kernel = 0;
-Kernel::Kernel() : loading(false) {
+Kernel::Kernel() : _loading(false) {
debugN(MM_INFO, "Creating Kernel...\n");
- kernel = this;
- pIDs = new idMan(1, 32766, 128);
- current_process = processes.end();
+ _kernel = this;
+ _pIDs = new idMan(1, 32766, 128);
+ current_process = _processes.end();
_frameNum = 0;
_paused = 0;
_runningProcess = 0;
@@ -50,21 +50,21 @@ Kernel::~Kernel() {
reset();
debugN(MM_INFO, "Destroying Kernel...\n");
- kernel = 0;
+ _kernel = 0;
- delete pIDs;
+ delete _pIDs;
}
void Kernel::reset() {
debugN(MM_INFO, "Resetting Kernel...\n");
- for (ProcessIterator it = processes.begin(); it != processes.end(); ++it) {
+ for (ProcessIterator it = _processes.begin(); it != _processes.end(); ++it) {
delete(*it);
}
- processes.clear();
- current_process = processes.begin();
+ _processes.clear();
+ current_process = _processes.begin();
- pIDs->clearAll();
+ _pIDs->clearAll();
_paused = 0;
_runningProcess = 0;
@@ -75,10 +75,10 @@ void Kernel::reset() {
ProcId Kernel::assignPID(Process *proc) {
// to prevent new processes from getting a PID while loading
- if (loading) return 0xFFFF;
+ if (_loading) return 0xFFFF;
// Get a pID
- proc->_pid = pIDs->getNewID();
+ proc->_pid = _pIDs->getNewID();
return proc->_pid;
}
@@ -119,7 +119,7 @@ ProcId Kernel::addProcessExec(Process *proc) {
<< ", pid = " << proc->_pid << Std::endl;
#endif
- processes.push_back(proc);
+ _processes.push_back(proc);
proc->_flags |= Process::PROC_ACTIVE;
Process *oldrunning = _runningProcess;
@@ -138,16 +138,16 @@ void Kernel::removeProcess(Process *proc) {
//! over the list. (Hence the special 'erase' in runProcs below, which
//! is very Std::list-specific, incidentally)
- for (ProcessIterator it = processes.begin(); it != processes.end(); ++it) {
+ for (ProcessIterator it = _processes.begin(); it != _processes.end(); ++it) {
if (*it == proc) {
proc->_flags &= ~Process::PROC_ACTIVE;
perr << "[Kernel] Removing process " << proc << Std::endl;
- processes.erase(it);
+ _processes.erase(it);
// Clear pid
- pIDs->clearID(proc->_pid);
+ _pIDs->clearID(proc->_pid);
return;
}
@@ -159,7 +159,7 @@ void Kernel::runProcesses() {
if (!_paused)
_frameNum++;
- if (processes.size() == 0) {
+ if (_processes.size() == 0) {
return;
/*
perr << "Process queue is empty?! Aborting.\n";
@@ -168,8 +168,8 @@ void Kernel::runProcesses() {
exit(0);
*/
}
- current_process = processes.begin();
- while (current_process != processes.end()) {
+ current_process = _processes.begin();
+ while (current_process != _processes.end()) {
Process *p = *current_process;
if (!_paused && ((p->_flags & (Process::PROC_TERMINATED |
@@ -189,10 +189,10 @@ void Kernel::runProcesses() {
}
if (!_paused && (p->_flags & Process::PROC_TERMINATED)) {
// process is killed, so remove it from the list
- current_process = processes.erase(current_process);
+ current_process = _processes.erase(current_process);
// Clear pid
- pIDs->clearID(p->_pid);
+ _pIDs->clearID(p->_pid);
//! is this the right place to delete processes?
delete p;
@@ -204,13 +204,13 @@ void Kernel::runProcesses() {
}
void Kernel::setNextProcess(Process *proc) {
- if (current_process != processes.end() && *current_process == proc) return;
+ if (current_process != _processes.end() && *current_process == proc) return;
if (proc->_flags & Process::PROC_ACTIVE) {
- for (ProcessIterator it = processes.begin();
- it != processes.end(); ++it) {
+ for (ProcessIterator it = _processes.begin();
+ it != _processes.end(); ++it) {
if (*it == proc) {
- processes.erase(it);
+ _processes.erase(it);
break;
}
}
@@ -218,18 +218,18 @@ void Kernel::setNextProcess(Process *proc) {
proc->_flags |= Process::PROC_ACTIVE;
}
- if (current_process == processes.end()) {
- processes.push_front(proc);
+ if (current_process == _processes.end()) {
+ _processes.push_front(proc);
} else {
ProcessIterator t = current_process;
++t;
- processes.insert(t, proc);
+ _processes.insert(t, proc);
}
}
Process *Kernel::getProcess(ProcId pid) {
- for (ProcessIterator it = processes.begin(); it != processes.end(); ++it) {
+ for (ProcessIterator it = _processes.begin(); it != _processes.end(); ++it) {
Process *p = *it;
if (p->_pid == pid)
return p;
@@ -239,13 +239,13 @@ Process *Kernel::getProcess(ProcId pid) {
void Kernel::kernelStats() {
g_debugger->debugPrintf("Kernel memory stats:\n");
- g_debugger->debugPrintf("Processes : %u/32765\n", processes.size());
+ g_debugger->debugPrintf("Processes : %u/32765\n", _processes.size());
}
void Kernel::processTypes() {
g_debugger->debugPrintf("Current process types:\n");
Std::map<Common::String, unsigned int> processtypes;
- for (ProcessIterator it = processes.begin(); it != processes.end(); ++it) {
+ for (ProcessIterator it = _processes.begin(); it != _processes.end(); ++it) {
Process *p = *it;
processtypes[p->GetClassType()._className]++;
}
@@ -258,7 +258,7 @@ void Kernel::processTypes() {
uint32 Kernel::getNumProcesses(ObjId objid, uint16 processtype) {
uint32 count = 0;
- for (ProcessIterator it = processes.begin(); it != processes.end(); ++it) {
+ for (ProcessIterator it = _processes.begin(); it != _processes.end(); ++it) {
Process *p = *it;
// Don't count us, we are not really here
@@ -273,7 +273,7 @@ uint32 Kernel::getNumProcesses(ObjId objid, uint16 processtype) {
}
Process *Kernel::findProcess(ObjId objid, uint16 processtype) {
- for (ProcessIterator it = processes.begin(); it != processes.end(); ++it) {
+ for (ProcessIterator it = _processes.begin(); it != _processes.end(); ++it) {
Process *p = *it;
// Don't count us, we are not really here
@@ -290,7 +290,7 @@ Process *Kernel::findProcess(ObjId objid, uint16 processtype) {
void Kernel::killProcesses(ObjId objid, uint16 processtype, bool fail) {
- for (ProcessIterator it = processes.begin(); it != processes.end(); ++it) {
+ for (ProcessIterator it = _processes.begin(); it != _processes.end(); ++it) {
Process *p = *it;
if (p->_itemNum != 0 && (objid == 0 || objid == p->_itemNum) &&
@@ -306,7 +306,7 @@ void Kernel::killProcesses(ObjId objid, uint16 processtype, bool fail) {
}
void Kernel::killProcessesNotOfType(ObjId objid, uint16 processtype, bool fail) {
- for (ProcessIterator it = processes.begin(); it != processes.end(); ++it) {
+ for (ProcessIterator it = _processes.begin(); it != _processes.end(); ++it) {
Process *p = *it;
if (p->_itemNum != 0 && (objid == 0 || objid == p->_itemNum) &&
@@ -323,9 +323,9 @@ void Kernel::killProcessesNotOfType(ObjId objid, uint16 processtype, bool fail)
void Kernel::save(ODataSource *ods) {
ods->write4(_frameNum);
- pIDs->save(ods);
- ods->write4(processes.size());
- for (ProcessIterator it = processes.begin(); it != processes.end(); ++it) {
+ _pIDs->save(ods);
+ ods->write4(_processes.size());
+ for (ProcessIterator it = _processes.begin(); it != _processes.end(); ++it) {
(*it)->save(ods);
}
}
@@ -333,14 +333,14 @@ void Kernel::save(ODataSource *ods) {
bool Kernel::load(IDataSource *ids, uint32 version) {
_frameNum = ids->read4();
- if (!pIDs->load(ids, version)) return false;
+ if (!_pIDs->load(ids, version)) return false;
uint32 pcount = ids->read4();
for (unsigned int i = 0; i < pcount; ++i) {
Process *p = loadProcess(ids, version);
if (!p) return false;
- processes.push_back(p);
+ _processes.push_back(p);
}
return true;
@@ -356,19 +356,19 @@ Process *Kernel::loadProcess(IDataSource *ids, uint32 version) {
delete[] buf;
Std::map<Common::String, ProcessLoadFunc>::iterator iter;
- iter = processloaders.find(classname);
+ iter = _processLoaders.find(classname);
- if (iter == processloaders.end()) {
+ if (iter == _processLoaders.end()) {
perr << "Unknown Process class: " << classname << Std::endl;
return 0;
}
- loading = true;
+ _loading = true;
Process *p = (*(iter->_value))(ids, version);
- loading = false;
+ _loading = false;
return p;
}
diff --git a/engines/ultima/ultima8/kernel/kernel.h b/engines/ultima/ultima8/kernel/kernel.h
index 18b6433cff..3af9f35946 100644
--- a/engines/ultima/ultima8/kernel/kernel.h
+++ b/engines/ultima/ultima8/kernel/kernel.h
@@ -47,7 +47,7 @@ public:
~Kernel();
static Kernel *get_instance() {
- return kernel;
+ return _kernel;
}
void reset();
@@ -89,10 +89,10 @@ public:
//! get an iterator of the process list.
ProcessIter getProcessBeginIterator() {
- return processes.begin();
+ return _processes.begin();
}
ProcessIter getProcessEndIterator() {
- return processes.end();
+ return _processes.end();
}
void kernelStats();
@@ -120,7 +120,7 @@ public:
}
void addProcessLoader(Std::string classname, ProcessLoadFunc func) {
- processloaders[classname] = func;
+ _processLoaders[classname] = func;
}
uint32 getFrameNum() const {
@@ -132,14 +132,14 @@ public:
private:
Process *loadProcess(IDataSource *ids, uint32 version);
- Std::list<Process *> processes;
- idMan *pIDs;
+ Std::list<Process *> _processes;
+ idMan *_pIDs;
Std::list<Process *>::iterator current_process;
- Std::map<Common::String, ProcessLoadFunc> processloaders;
+ Std::map<Common::String, ProcessLoadFunc> _processLoaders;
- bool loading;
+ bool _loading;
uint32 _frameNum;
unsigned int _paused;
@@ -147,7 +147,7 @@ private:
Process *_runningProcess;
- static Kernel *kernel;
+ static Kernel *_kernel;
};
// a bit of a hack to prevent having to write a load function for
diff --git a/engines/ultima/ultima8/kernel/object_manager.cpp b/engines/ultima/ultima8/kernel/object_manager.cpp
index c9cdf0dc6f..19b655dd83 100644
--- a/engines/ultima/ultima8/kernel/object_manager.cpp
+++ b/engines/ultima/ultima8/kernel/object_manager.cpp
@@ -52,7 +52,7 @@
namespace Ultima {
namespace Ultima8 {
-ObjectManager *ObjectManager::objectmanager = 0;
+ObjectManager *ObjectManager::_objectManager = 0;
// a template class to prevent having to write a load function for
@@ -73,7 +73,7 @@ struct ObjectLoader {
ObjectManager::ObjectManager() {
debugN(MM_INFO, "Creating ObjectManager...\n");
- objectmanager = this;
+ _objectManager = this;
setupLoaders();
@@ -88,7 +88,7 @@ ObjectManager::~ObjectManager() {
reset();
debugN(MM_INFO, "Destroying ObjectManager...\n");
- objectmanager = 0;
+ _objectManager = 0;
delete _objIDs;
delete _actorIDs;
diff --git a/engines/ultima/ultima8/kernel/object_manager.h b/engines/ultima/ultima8/kernel/object_manager.h
index 6da343e935..68d171ed00 100644
--- a/engines/ultima/ultima8/kernel/object_manager.h
+++ b/engines/ultima/ultima8/kernel/object_manager.h
@@ -42,7 +42,7 @@ public:
~ObjectManager();
static ObjectManager *get_instance() {
- return objectmanager;
+ return _objectManager;
}
void reset();
@@ -82,7 +82,7 @@ private:
}
Std::map<Common::String, ObjectLoadFunc> _objectLoaders;
- static ObjectManager *objectmanager;
+ static ObjectManager *_objectManager;
};
} // End of namespace Ultima8
diff --git a/engines/ultima/ultima8/kernel/process.cpp b/engines/ultima/ultima8/kernel/process.cpp
index a1a754171d..b9322d5bf3 100644
--- a/engines/ultima/ultima8/kernel/process.cpp
+++ b/engines/ultima/ultima8/kernel/process.cpp
@@ -52,13 +52,13 @@ void Process::terminate() {
Kernel *kernel = Kernel::get_instance();
// wake up waiting processes
- for (Std::vector<ProcId>::iterator i = waiting.begin();
- i != waiting.end(); ++i) {
+ for (Std::vector<ProcId>::iterator i = _waiting.begin();
+ i != _waiting.end(); ++i) {
Process *p = kernel->getProcess(*i);
if (p)
p->wakeUp(_result);
}
- waiting.clear();
+ _waiting.clear();
_flags |= PROC_TERMINATED;
}
@@ -78,7 +78,7 @@ void Process::waitFor(ProcId pid_) {
// add this process to waiting list of process pid_
Process *p = kernel->getProcess(pid_);
assert(p);
- p->waiting.push_back(_pid);
+ p->_waiting.push_back(_pid);
}
_flags |= PROC_SUSPENDED;
@@ -106,10 +106,10 @@ void Process::dumpInfo() {
if (_flags & PROC_TERM_DEFERRED) info += "t";
if (_flags & PROC_FAILED) info += "F";
if (_flags & PROC_RUNPAUSED) info += "R";
- if (!waiting.empty()) {
+ if (!_waiting.empty()) {
info += ", notify: ";
- for (Std::vector<ProcId>::iterator i = waiting.begin(); i != waiting.end(); ++i) {
- if (i != waiting.begin()) info += ", ";
+ for (Std::vector<ProcId>::iterator i = _waiting.begin(); i != _waiting.end(); ++i) {
+ if (i != _waiting.begin()) info += ", ";
info += *i;
}
}
@@ -136,9 +136,9 @@ void Process::saveData(ODataSource *ods) {
ods->write2(_itemNum);
ods->write2(_type);
ods->write4(_result);
- ods->write4(static_cast<uint32>(waiting.size()));
- for (unsigned int i = 0; i < waiting.size(); ++i)
- ods->write2(waiting[i]);
+ ods->write4(static_cast<uint32>(_waiting.size()));
+ for (unsigned int i = 0; i < _waiting.size(); ++i)
+ ods->write2(_waiting[i]);
}
bool Process::loadData(IDataSource *ids, uint32 version) {
@@ -148,9 +148,9 @@ bool Process::loadData(IDataSource *ids, uint32 version) {
_type = ids->read2();
_result = ids->read4();
uint32 waitcount = ids->read4();
- waiting.resize(waitcount);
+ _waiting.resize(waitcount);
for (unsigned int i = 0; i < waitcount; ++i)
- waiting[i] = ids->read2();
+ _waiting[i] = ids->read2();
return true;
}
diff --git a/engines/ultima/ultima8/kernel/process.h b/engines/ultima/ultima8/kernel/process.h
index e75a648808..63acc7b7c8 100644
--- a/engines/ultima/ultima8/kernel/process.h
+++ b/engines/ultima/ultima8/kernel/process.h
@@ -131,7 +131,7 @@ protected:
//! Processes waiting for this one to finish.
//! When this process terminates, awaken them and pass them the result val.
- Std::vector<ProcId> waiting;
+ Std::vector<ProcId> _waiting;
public:
diff --git a/engines/ultima/ultima8/misc/debugger.cpp b/engines/ultima/ultima8/misc/debugger.cpp
index 84dbff237e..a27f0b32d9 100644
--- a/engines/ultima/ultima8/misc/debugger.cpp
+++ b/engines/ultima/ultima8/misc/debugger.cpp
@@ -949,8 +949,8 @@ bool Debugger::cmdListProcesses(int argc, const char **argv) {
} else {
debugPrintf("Processes:\n");
}
- for (ProcessIterator it = kern->processes.begin();
- it != kern->processes.end(); ++it) {
+ for (ProcessIterator it = kern->_processes.begin();
+ it != kern->_processes.end(); ++it) {
Process *p = *it;
if (argc == 1 || p->_itemNum == item)
p->dumpInfo();
diff --git a/engines/ultima/ultima8/world/actors/quick_avatar_mover_process.cpp b/engines/ultima/ultima8/world/actors/quick_avatar_mover_process.cpp
index eae590e344..915605a094 100644
--- a/engines/ultima/ultima8/world/actors/quick_avatar_mover_process.cpp
+++ b/engines/ultima/ultima8/world/actors/quick_avatar_mover_process.cpp
@@ -39,7 +39,7 @@ namespace Ultima8 {
// p_dynamic_cast stuff
DEFINE_RUNTIME_CLASSTYPE_CODE(QuickAvatarMoverProcess, Process)
-ProcId QuickAvatarMoverProcess::amp[6] = { 0, 0, 0, 0, 0, 0 };
+ProcId QuickAvatarMoverProcess::_amp[6] = { 0, 0, 0, 0, 0, 0 };
bool QuickAvatarMoverProcess::_clipping = false;
bool QuickAvatarMoverProcess::_quarter = false;
@@ -50,7 +50,7 @@ QuickAvatarMoverProcess::QuickAvatarMoverProcess(int x, int y, int z, int dir) :
_dx(x), _dy(y), _dz(z), _dir(dir) {
QuickAvatarMoverProcess::terminateMover(dir);
assert(_dir < 6);
- amp[_dir] = getPid();
+ _amp[_dir] = getPid();
}
QuickAvatarMoverProcess::~QuickAvatarMoverProcess() {
@@ -133,7 +133,7 @@ void QuickAvatarMoverProcess::run() {
void QuickAvatarMoverProcess::terminate() {
Process::terminate();
- amp[_dir] = 0;
+ _amp[_dir] = 0;
}
void QuickAvatarMoverProcess::terminateMover(int dir) {
@@ -142,7 +142,7 @@ void QuickAvatarMoverProcess::terminateMover(int dir) {
Kernel *kernel = Kernel::get_instance();
QuickAvatarMoverProcess *p =
- p_dynamic_cast<QuickAvatarMoverProcess *>(kernel->getProcess(amp[dir]));
+ p_dynamic_cast<QuickAvatarMoverProcess *>(kernel->getProcess(_amp[dir]));
if (p && !p->is_terminated())
p->terminate();
@@ -171,7 +171,7 @@ bool QuickAvatarMoverProcess::loadData(IDataSource *ids, uint32 version) {
// small safety precaution
_dir = ids->read4();
if (_dir < 6)
- amp[_dir] = 0;
+ _amp[_dir] = 0;
else
return false;
diff --git a/engines/ultima/ultima8/world/actors/quick_avatar_mover_process.h b/engines/ultima/ultima8/world/actors/quick_avatar_mover_process.h
index d9af3c5e56..89fb9acfbd 100644
--- a/engines/ultima/ultima8/world/actors/quick_avatar_mover_process.h
+++ b/engines/ultima/ultima8/world/actors/quick_avatar_mover_process.h
@@ -62,7 +62,7 @@ protected:
void saveData(ODataSource *ods) override;
int _dx, _dy, _dz, _dir;
- static ProcId amp[6];
+ static ProcId _amp[6];
static bool _clipping;
static bool _quarter;
};
diff --git a/engines/ultima/ultima8/world/glob_egg.cpp b/engines/ultima/ultima8/world/glob_egg.cpp
index e632fdcc94..e3d8c6554c 100644
--- a/engines/ultima/ultima8/world/glob_egg.cpp
+++ b/engines/ultima/ultima8/world/glob_egg.cpp
@@ -59,7 +59,7 @@ void GlobEgg::enterFastArea() {
if (!glob) return;
Std::vector<GlobItem>::iterator iter;
- for (iter = glob->contents.begin(); iter != glob->contents.end(); ++iter) {
+ for (iter = glob->_contents.begin(); iter != glob->_contents.end(); ++iter) {
GlobItem &globitem = *iter;
Item *item = ItemFactory::createItem(globitem.shape, globitem.frame,
0,
diff --git a/engines/ultima/ultima8/world/map_glob.cpp b/engines/ultima/ultima8/world/map_glob.cpp
index 5d48cb006a..8cdc5570ba 100644
--- a/engines/ultima/ultima8/world/map_glob.cpp
+++ b/engines/ultima/ultima8/world/map_glob.cpp
@@ -33,14 +33,14 @@ MapGlob::MapGlob() {
MapGlob::~MapGlob() {
- contents.clear();
+ _contents.clear();
}
void MapGlob::read(IDataSource *ds) {
unsigned int itemcount = ds->read2();
assert(ds->getSize() >= 2 + itemcount * 6);
- contents.clear();
- contents.resize(itemcount);
+ _contents.clear();
+ _contents.resize(itemcount);
for (unsigned int i = 0; i < itemcount; ++i) {
GlobItem item;
@@ -51,7 +51,7 @@ void MapGlob::read(IDataSource *ds) {
item.shape = ds->read2();
item.frame = ds->read1();
- contents[i] = item;
+ _contents[i] = item;
}
}
diff --git a/engines/ultima/ultima8/world/map_glob.h b/engines/ultima/ultima8/world/map_glob.h
index c46ceec137..f9e57c1dca 100644
--- a/engines/ultima/ultima8/world/map_glob.h
+++ b/engines/ultima/ultima8/world/map_glob.h
@@ -48,7 +48,7 @@ public:
void read(IDataSource *ds);
private:
- Std::vector<GlobItem> contents;
+ Std::vector<GlobItem> _contents;
};
} // End of namespace Ultima8
Commit: cad35501ff20755c98661fa538d0a8c98cc27200
https://github.com/scummvm/scummvm/commit/cad35501ff20755c98661fa538d0a8c98cc27200
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2020-02-24T22:16:45-08:00
Commit Message:
ULTIMA8: More class field renamings
Changed paths:
engines/ultima/ultima8/audio/speech_flex.cpp
engines/ultima/ultima8/audio/speech_flex.h
engines/ultima/ultima8/games/treasure_loader.cpp
engines/ultima/ultima8/games/treasure_loader.h
engines/ultima/ultima8/graphics/base_soft_render_surface.cpp
engines/ultima/ultima8/graphics/manips.h
engines/ultima/ultima8/graphics/render_surface.cpp
engines/ultima/ultima8/graphics/render_surface.h
engines/ultima/ultima8/graphics/scaler.h
engines/ultima/ultima8/graphics/soft_render_surface.cpp
engines/ultima/ultima8/graphics/soft_render_surface.inl
engines/ultima/ultima8/graphics/type_flags.cpp
engines/ultima/ultima8/graphics/type_flags.h
engines/ultima/ultima8/gumps/minimap_gump.cpp
engines/ultima/ultima8/kernel/segmented_pool.cpp
engines/ultima/ultima8/kernel/segmented_pool.h
engines/ultima/ultima8/misc/debugger.cpp
engines/ultima/ultima8/ultima8.cpp
engines/ultima/ultima8/usecode/uc_stack.cpp
engines/ultima/ultima8/usecode/uc_stack.h
diff --git a/engines/ultima/ultima8/audio/speech_flex.cpp b/engines/ultima/ultima8/audio/speech_flex.cpp
index 77bd0255f1..cfaa0beaa5 100644
--- a/engines/ultima/ultima8/audio/speech_flex.cpp
+++ b/engines/ultima/ultima8/audio/speech_flex.cpp
@@ -45,7 +45,7 @@ SpeechFlex::SpeechFlex(IDataSource *ds) : SoundFlex(ds) {
// pout << "Found string: \"" << s[i] << "\"" << Std::endl;
- phrases.push_back(s[i]);
+ _phrases.push_back(s[i]);
}
delete [] buf;
@@ -71,7 +71,7 @@ int SpeechFlex::getIndexForPhrase(const Std::string &phrase,
// pout << "Looking for string: \"" << text << "\"" << Std::endl;
- for (it = phrases.begin(); it != phrases.end(); ++it) {
+ for (it = _phrases.begin(); it != _phrases.end(); ++it) {
if (text.find(it->c_str()) == 0) {
// pout << "Found: " << i << Std::endl;
end = (*it).size() + start + pos1;
diff --git a/engines/ultima/ultima8/audio/speech_flex.h b/engines/ultima/ultima8/audio/speech_flex.h
index e96ec225b8..c9ae9c9cf3 100644
--- a/engines/ultima/ultima8/audio/speech_flex.h
+++ b/engines/ultima/ultima8/audio/speech_flex.h
@@ -31,7 +31,7 @@ namespace Ultima {
namespace Ultima8 {
class SpeechFlex : public SoundFlex {
- Std::vector<istring> phrases;
+ Std::vector<istring> _phrases;
public:
// p_dynamic_class stuff
diff --git a/engines/ultima/ultima8/games/treasure_loader.cpp b/engines/ultima/ultima8/games/treasure_loader.cpp
index 31e7fce537..d9861a238a 100644
--- a/engines/ultima/ultima8/games/treasure_loader.cpp
+++ b/engines/ultima/ultima8/games/treasure_loader.cpp
@@ -43,7 +43,7 @@ void TreasureLoader::loadDefaults() {
TreasureInfo ti;
bool ok = internalParse(defaultiter->_value, ti, true);
if (ok) {
- defaultTreasure[defaultiter->_key] = ti;
+ _defaultTreasure[defaultiter->_key] = ti;
} else {
perr << "Failed to parse treasure type '" << defaultiter->_key
<< "': " << defaultiter->_value << Std::endl;
@@ -118,8 +118,8 @@ bool TreasureLoader::internalParse(Std::string desc, TreasureInfo &ti,
if (loadedDefault)
return false;
TreasureMap::iterator iter;
- iter = defaultTreasure.find(val);
- if (iter != defaultTreasure.end())
+ iter = _defaultTreasure.find(val);
+ if (iter != _defaultTreasure.end())
ti = iter->_value;
else
return false;
diff --git a/engines/ultima/ultima8/games/treasure_loader.h b/engines/ultima/ultima8/games/treasure_loader.h
index d1ae5ceae8..43ed25d0db 100644
--- a/engines/ultima/ultima8/games/treasure_loader.h
+++ b/engines/ultima/ultima8/games/treasure_loader.h
@@ -40,7 +40,7 @@ public:
bool parse(Std::string, Std::vector<TreasureInfo> &treasure);
private:
- TreasureMap defaultTreasure;
+ TreasureMap _defaultTreasure;
bool internalParse(Std::string desc, TreasureInfo &ti, bool loadingDefault);
diff --git a/engines/ultima/ultima8/graphics/base_soft_render_surface.cpp b/engines/ultima/ultima8/graphics/base_soft_render_surface.cpp
index cbb1cb1b04..11da0e63b4 100644
--- a/engines/ultima/ultima8/graphics/base_soft_render_surface.cpp
+++ b/engines/ultima/ultima8/graphics/base_soft_render_surface.cpp
@@ -51,30 +51,30 @@ BaseSoftRenderSurface::BaseSoftRenderSurface(Graphics::ManagedSurface *s) :
_bitsPerPixel = _surface->format.bpp();
_bytesPerPixel = _surface->format.bytesPerPixel;
- RenderSurface::format.s_bpp = _bitsPerPixel;
- RenderSurface::format.s_bytes_per_pixel = _bytesPerPixel;
- RenderSurface::format.r_loss = _surface->format.rLoss;
- RenderSurface::format.g_loss = _surface->format.gLoss;
- RenderSurface::format.b_loss = _surface->format.bLoss;
- RenderSurface::format.a_loss = _surface->format.aLoss;
- RenderSurface::format.r_loss16 = format.r_loss + 8;
- RenderSurface::format.g_loss16 = format.g_loss + 8;
- RenderSurface::format.b_loss16 = format.b_loss + 8;
- RenderSurface::format.a_loss16 = format.a_loss + 8;
- RenderSurface::format.r_shift = _surface->format.rShift;
- RenderSurface::format.g_shift = _surface->format.gShift;
- RenderSurface::format.b_shift = _surface->format.bShift;
- RenderSurface::format.a_shift = _surface->format.aShift;
- RenderSurface::format.r_mask = _surface->format.rMax() << _surface->format.rShift;
- RenderSurface::format.g_mask = _surface->format.gMax() << _surface->format.gShift;
- RenderSurface::format.b_mask = _surface->format.bMax() << _surface->format.bShift;
- RenderSurface::format.a_mask = _surface->format.aMax() << _surface->format.aShift;
+ RenderSurface::_format.s_bpp = _bitsPerPixel;
+ RenderSurface::_format.s_bytes_per_pixel = _bytesPerPixel;
+ RenderSurface::_format.r_loss = _surface->format.rLoss;
+ RenderSurface::_format.g_loss = _surface->format.gLoss;
+ RenderSurface::_format.b_loss = _surface->format.bLoss;
+ RenderSurface::_format.a_loss = _surface->format.aLoss;
+ RenderSurface::_format.r_loss16 = _format.r_loss + 8;
+ RenderSurface::_format.g_loss16 = _format.g_loss + 8;
+ RenderSurface::_format.b_loss16 = _format.b_loss + 8;
+ RenderSurface::_format.a_loss16 = _format.a_loss + 8;
+ RenderSurface::_format.r_shift = _surface->format.rShift;
+ RenderSurface::_format.g_shift = _surface->format.gShift;
+ RenderSurface::_format.b_shift = _surface->format.bShift;
+ RenderSurface::_format.a_shift = _surface->format.aShift;
+ RenderSurface::_format.r_mask = _surface->format.rMax() << _surface->format.rShift;
+ RenderSurface::_format.g_mask = _surface->format.gMax() << _surface->format.gShift;
+ RenderSurface::_format.b_mask = _surface->format.bMax() << _surface->format.bShift;
+ RenderSurface::_format.a_mask = _surface->format.aMax() << _surface->format.aShift;
SetPixelsPointer();
// Trickery to get the alpha channel
- if (format.a_mask == 0 && _bytesPerPixel == 4) {
- uint32 mask = ~(format.r_mask | format.g_mask | format.b_mask);
+ if (_format.a_mask == 0 && _bytesPerPixel == 4) {
+ uint32 mask = ~(_format.r_mask | _format.g_mask | _format.b_mask);
// Using all bits????
if (!mask) return;
@@ -103,10 +103,10 @@ BaseSoftRenderSurface::BaseSoftRenderSurface(Graphics::ManagedSurface *s) :
if (zero < last) return;
// Set it
- format.a_shift = first;
- format.a_loss = 8 - (last + 1 - first);
- format.a_loss16 = format.a_loss + 8;
- format.a_mask = mask;
+ _format.a_shift = first;
+ _format.a_loss = 8 - (last + 1 - first);
+ _format.a_loss16 = _format.a_loss + 8;
+ _format.a_mask = mask;
}
}
@@ -126,25 +126,25 @@ BaseSoftRenderSurface::BaseSoftRenderSurface(int w, int h, int bpp,
switch (bpp) {
case 15:
- format.r_loss = 3;
- format.g_loss = 3;
- format.b_loss = 3;
- format.a_loss = 7;
+ _format.r_loss = 3;
+ _format.g_loss = 3;
+ _format.b_loss = 3;
+ _format.a_loss = 7;
bpp = 16;
break;
case 16:
- format.r_loss = 3;
- format.g_loss = 2;
- format.b_loss = 3;
- format.a_loss = 0;
+ _format.r_loss = 3;
+ _format.g_loss = 2;
+ _format.b_loss = 3;
+ _format.a_loss = 0;
break;
case 32:
- format.r_loss = 0;
- format.g_loss = 0;
- format.b_loss = 0;
- format.a_loss = 0;
+ _format.r_loss = 0;
+ _format.g_loss = 0;
+ _format.b_loss = 0;
+ _format.a_loss = 0;
break;
default:
@@ -155,20 +155,20 @@ BaseSoftRenderSurface::BaseSoftRenderSurface(int w, int h, int bpp,
_bitsPerPixel = bpp;
_bytesPerPixel = bpp / 8;
- RenderSurface::format.s_bpp = bpp;
- RenderSurface::format.s_bytes_per_pixel = _bytesPerPixel;
- RenderSurface::format.r_loss16 = format.r_loss + 8;
- RenderSurface::format.g_loss16 = format.g_loss + 8;
- RenderSurface::format.b_loss16 = format.b_loss + 8;
- RenderSurface::format.a_loss16 = format.a_loss + 8;
- RenderSurface::format.r_shift = rsft;
- RenderSurface::format.g_shift = gsft;
- RenderSurface::format.b_shift = bsft;
- RenderSurface::format.a_shift = asft;
- RenderSurface::format.r_mask = (0xFF >> format.r_loss) << rsft;
- RenderSurface::format.g_mask = (0xFF >> format.g_loss) << gsft;
- RenderSurface::format.b_mask = (0xFF >> format.b_loss) << bsft;
- RenderSurface::format.a_mask = (0xFF >> format.a_loss) << asft;
+ RenderSurface::_format.s_bpp = bpp;
+ RenderSurface::_format.s_bytes_per_pixel = _bytesPerPixel;
+ RenderSurface::_format.r_loss16 = _format.r_loss + 8;
+ RenderSurface::_format.g_loss16 = _format.g_loss + 8;
+ RenderSurface::_format.b_loss16 = _format.b_loss + 8;
+ RenderSurface::_format.a_loss16 = _format.a_loss + 8;
+ RenderSurface::_format.r_shift = rsft;
+ RenderSurface::_format.g_shift = gsft;
+ RenderSurface::_format.b_shift = bsft;
+ RenderSurface::_format.a_shift = asft;
+ RenderSurface::_format.r_mask = (0xFF >> _format.r_loss) << rsft;
+ RenderSurface::_format.g_mask = (0xFF >> _format.g_loss) << gsft;
+ RenderSurface::_format.b_mask = (0xFF >> _format.b_loss) << bsft;
+ RenderSurface::_format.a_mask = (0xFF >> _format.a_loss) << asft;
SetPixelsPointer();
}
@@ -186,7 +186,7 @@ BaseSoftRenderSurface::BaseSoftRenderSurface(int w, int h, uint8 *buf) :
_flipped(false), _clipWindow(0, 0, 0, 0), _lockCount(0), _surface(0), _rttTex(0) {
_clipWindow.ResizeAbs(_width = w, _height = h);
- int bpp = RenderSurface::format.s_bpp;
+ int bpp = RenderSurface::_format.s_bpp;
_pitch = w * bpp / 8;
_bitsPerPixel = bpp;
@@ -208,7 +208,7 @@ BaseSoftRenderSurface::BaseSoftRenderSurface(int w, int h) :
_flipped(false), _clipWindow(0, 0, 0, 0), _lockCount(0), _surface(0), _rttTex(0) {
_clipWindow.ResizeAbs(_width = w, _height = h);
- int bpp = RenderSurface::format.s_bpp;
+ int bpp = RenderSurface::_format.s_bpp;
_pitch = w * bpp / 8;
_bitsPerPixel = bpp;
diff --git a/engines/ultima/ultima8/graphics/manips.h b/engines/ultima/ultima8/graphics/manips.h
index b625b532c6..aae25d0a9e 100644
--- a/engines/ultima/ultima8/graphics/manips.h
+++ b/engines/ultima/ultima8/graphics/manips.h
@@ -217,12 +217,12 @@ public:
}
static void split(uint16 src, uint8 &r, uint8 &g, uint8 &b, uint8 &a) {
UNPACK_RGBA8(src, r, g, b, a);
- r = RenderSurface::Gamma22toGamma10[r];
- g = RenderSurface::Gamma22toGamma10[g];
- b = RenderSurface::Gamma22toGamma10[b];
+ r = RenderSurface::_gamma22toGamma10[r];
+ g = RenderSurface::_gamma22toGamma10[g];
+ b = RenderSurface::_gamma22toGamma10[b];
}
static uint16 merge(uint8 r, uint8 g, uint8 b, uint8 a) {
- return PACK_RGBA8(RenderSurface::Gamma10toGamma22[r], RenderSurface::Gamma10toGamma22[g], RenderSurface::Gamma10toGamma22[b], a);
+ return PACK_RGBA8(RenderSurface::_gamma10toGamma22[r], RenderSurface::_gamma10toGamma22[g], RenderSurface::_gamma10toGamma22[b], a);
}
static uint16 to16bit(uint16 src) {
return src;
@@ -239,12 +239,12 @@ public:
}
static void split(uint32 src, uint8 &r, uint8 &g, uint8 &b, uint8 &a) {
UNPACK_RGBA8(src, r, g, b, a);
- r = RenderSurface::Gamma22toGamma10[r];
- g = RenderSurface::Gamma22toGamma10[g];
- b = RenderSurface::Gamma22toGamma10[b];
+ r = RenderSurface::_gamma22toGamma10[r];
+ g = RenderSurface::_gamma22toGamma10[g];
+ b = RenderSurface::_gamma22toGamma10[b];
}
static uint32 merge(uint8 r, uint8 g, uint8 b, uint8 a) {
- return PACK_RGBA8(RenderSurface::Gamma10toGamma22[r], RenderSurface::Gamma10toGamma22[g], RenderSurface::Gamma10toGamma22[b], a);
+ return PACK_RGBA8(RenderSurface::_gamma10toGamma22[r], RenderSurface::_gamma10toGamma22[g], RenderSurface::_gamma10toGamma22[b], a);
}
static uint16 to16bit(uint32 src) {
uint8 r, g, b;
@@ -262,13 +262,13 @@ public:
return PACK_RGBA8(TEX32_R(src), TEX32_G(src), TEX32_B(src), TEX32_A(src));
}
static void split(uint32 src, uint8 &r, uint8 &g, uint8 &b, uint8 &a) {
- r = RenderSurface::Gamma22toGamma10[TEX32_R(src)];
- g = RenderSurface::Gamma22toGamma10[TEX32_G(src)];
- b = RenderSurface::Gamma22toGamma10[TEX32_B(src)];
+ r = RenderSurface::_gamma22toGamma10[TEX32_R(src)];
+ g = RenderSurface::_gamma22toGamma10[TEX32_G(src)];
+ b = RenderSurface::_gamma22toGamma10[TEX32_B(src)];
a = TEX32_A(src);
}
static uint16 merge(uint8 r, uint8 g, uint8 b, uint8 a) {
- return PACK_RGBA8(RenderSurface::Gamma10toGamma22[r], RenderSurface::Gamma10toGamma22[g], RenderSurface::Gamma10toGamma22[b], a);
+ return PACK_RGBA8(RenderSurface::_gamma10toGamma22[r], RenderSurface::_gamma10toGamma22[g], RenderSurface::_gamma10toGamma22[b], a);
}
static uint16 to16bit(uint32 src) {
return (src >> 3) | ((src >> 5) & 0x7E0) | ((src >> 8) & 0xF800);
@@ -284,13 +284,13 @@ public:
return PACK_RGBA8(TEX32_R(src), TEX32_G(src), TEX32_B(src), TEX32_A(src));
}
static void split(uint32 src, uint8 &r, uint8 &g, uint8 &b, uint8 &a) {
- r = RenderSurface::Gamma22toGamma10[TEX32_R(src)];
- g = RenderSurface::Gamma22toGamma10[TEX32_G(src)];
- b = RenderSurface::Gamma22toGamma10[TEX32_B(src)];
+ r = RenderSurface::_gamma22toGamma10[TEX32_R(src)];
+ g = RenderSurface::_gamma22toGamma10[TEX32_G(src)];
+ b = RenderSurface::_gamma22toGamma10[TEX32_B(src)];
a = TEX32_A(src);
}
static uint32 merge(uint8 r, uint8 g, uint8 b, uint8 a) {
- return PACK_RGBA8(RenderSurface::Gamma10toGamma22[r], RenderSurface::Gamma10toGamma22[g], RenderSurface::Gamma10toGamma22[b], a);
+ return PACK_RGBA8(RenderSurface::_gamma10toGamma22[r], RenderSurface::_gamma10toGamma22[g], RenderSurface::_gamma10toGamma22[b], a);
}
static uint16 to16bit(uint32 src) {
return (src >> 3) | ((src >> 5) & 0x7E0) | ((src >> 8) & 0xF800);
@@ -307,13 +307,13 @@ public:
return src;
}
static void split(uint32 src, uint8 &c0, uint8 &c1, uint8 &c2, uint8 &a) {
- c0 = RenderSurface::Gamma22toGamma10[(src) & 0xFF];
- c1 = RenderSurface::Gamma22toGamma10[(src >> 8) & 0xFF];
- c2 = RenderSurface::Gamma22toGamma10[(src >> 16) & 0xFF];
+ c0 = RenderSurface::_gamma22toGamma10[(src) & 0xFF];
+ c1 = RenderSurface::_gamma22toGamma10[(src >> 8) & 0xFF];
+ c2 = RenderSurface::_gamma22toGamma10[(src >> 16) & 0xFF];
a = src >> 24;
}
static uint32 merge(uint8 c0, uint8 c1, uint8 c2, uint8 a) {
- return RenderSurface::Gamma10toGamma22[c0] | (RenderSurface::Gamma10toGamma22[c1] << 8) | (RenderSurface::Gamma10toGamma22[c2] << 16) | (a << 24);
+ return RenderSurface::_gamma10toGamma22[c0] | (RenderSurface::_gamma10toGamma22[c1] << 8) | (RenderSurface::_gamma10toGamma22[c2] << 16) | (a << 24);
}
static uint16 to16bit(uint32 src) {
return (src >> 3) | ((src >> 5) & 0x7E0) | ((src >> 8) & 0xF800);
@@ -331,12 +331,12 @@ public:
}
static void split(uint32 src, uint8 &c0, uint8 &c1, uint8 &c2, uint8 &a) {
a = src;
- c2 = RenderSurface::Gamma22toGamma10[(src >> 8) & 0xFF];
- c1 = RenderSurface::Gamma22toGamma10[(src >> 16) & 0xFF];
- c0 = RenderSurface::Gamma22toGamma10[(src >> 24) & 0xFF];
+ c2 = RenderSurface::_gamma22toGamma10[(src >> 8) & 0xFF];
+ c1 = RenderSurface::_gamma22toGamma10[(src >> 16) & 0xFF];
+ c0 = RenderSurface::_gamma22toGamma10[(src >> 24) & 0xFF];
}
static uint32 merge(uint8 c0, uint8 c1, uint8 c2, uint8 a) {
- return a | (RenderSurface::Gamma10toGamma22[c2] << 8) | (RenderSurface::Gamma10toGamma22[c1] << 16) | (RenderSurface::Gamma10toGamma22[c0] << 24);
+ return a | (RenderSurface::_gamma10toGamma22[c2] << 8) | (RenderSurface::_gamma10toGamma22[c1] << 16) | (RenderSurface::_gamma10toGamma22[c0] << 24);
}
static uint16 to16bit(uint32 src) {
return (src >> 27) | ((src >> 13) & 0x7E0) | ((src << 8) & 0xF800);
diff --git a/engines/ultima/ultima8/graphics/render_surface.cpp b/engines/ultima/ultima8/graphics/render_surface.cpp
index 751cdc9e18..a45159df09 100644
--- a/engines/ultima/ultima8/graphics/render_surface.cpp
+++ b/engines/ultima/ultima8/graphics/render_surface.cpp
@@ -29,7 +29,7 @@
namespace Ultima {
namespace Ultima8 {
-RenderSurface::Format RenderSurface::format = {
+RenderSurface::Format RenderSurface::_format = {
0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
@@ -37,8 +37,8 @@ RenderSurface::Format RenderSurface::format = {
0, 0, 0, 0
};
-uint8 RenderSurface::Gamma10toGamma22[256];
-uint8 RenderSurface::Gamma22toGamma10[256];
+uint8 RenderSurface::_gamma10toGamma22[256];
+uint8 RenderSurface::_gamma22toGamma10[256];
//
// RenderSurface::SetVideoMode()
@@ -73,8 +73,8 @@ RenderSurface *RenderSurface::SetVideoMode(uint32 width, uint32 height, int bpp)
// Initialize gamma correction tables
for (int i = 0; i < 256; i++) {
- Gamma22toGamma10[i] = static_cast<uint8>(0.5 + (Std::pow(i / 255.0, 2.2 / 1.0) * 255.0));
- Gamma10toGamma22[i] = static_cast<uint8>(0.5 + (Std::pow(i / 255.0, 1.0 / 2.2) * 255.0));
+ _gamma22toGamma10[i] = static_cast<uint8>(0.5 + (Std::pow(i / 255.0, 2.2 / 1.0) * 255.0));
+ _gamma10toGamma22[i] = static_cast<uint8>(0.5 + (Std::pow(i / 255.0, 1.0 / 2.2) * 255.0));
}
return surf;
@@ -86,7 +86,7 @@ RenderSurface *RenderSurface::CreateSecondaryRenderSurface(uint32 width, uint32
RenderSurface *surf;
// TODO: Change this
- if (format.s_bpp == 32) surf = new SoftRenderSurface<uint32>(width, height);
+ if (_format.s_bpp == 32) surf = new SoftRenderSurface<uint32>(width, height);
else surf = new SoftRenderSurface<uint16>(width, height);
return surf;
}
diff --git a/engines/ultima/ultima8/graphics/render_surface.h b/engines/ultima/ultima8/graphics/render_surface.h
index b449ce6477..8c41234da0 100644
--- a/engines/ultima/ultima8/graphics/render_surface.h
+++ b/engines/ultima/ultima8/graphics/render_surface.h
@@ -39,13 +39,13 @@ struct Palette;
struct Rect;
class Scaler;
-#define UNPACK_RGB8(pix,r,g,b) { r = (((pix)&RenderSurface::format.r_mask)>>RenderSurface::format.r_shift)<<RenderSurface::format.r_loss; g = (((pix)&RenderSurface::format.g_mask)>>RenderSurface::format.g_shift)<<RenderSurface::format.g_loss; b = (((pix)&RenderSurface::format.b_mask)>>RenderSurface::format.b_shift)<<RenderSurface::format.b_loss; }
-#define PACK_RGB8(r,g,b) ((((r)>>RenderSurface::format.r_loss)<<RenderSurface::format.r_shift) | (((g)>>RenderSurface::format.g_loss)<<RenderSurface::format.g_shift) | (((b)>>RenderSurface::format.b_loss)<<RenderSurface::format.b_shift))
-#define PACK_RGB16(r,g,b) ((((r)>>RenderSurface::format.r_loss16)<<RenderSurface::format.r_shift) | (((g)>>RenderSurface::format.g_loss16)<<RenderSurface::format.g_shift) | (((b)>>RenderSurface::format.b_loss16)<<RenderSurface::format.b_shift))
+#define UNPACK_RGB8(pix,r,g,b) { r = (((pix)&RenderSurface::_format.r_mask)>>RenderSurface::_format.r_shift)<<RenderSurface::_format.r_loss; g = (((pix)&RenderSurface::_format.g_mask)>>RenderSurface::_format.g_shift)<<RenderSurface::_format.g_loss; b = (((pix)&RenderSurface::_format.b_mask)>>RenderSurface::_format.b_shift)<<RenderSurface::_format.b_loss; }
+#define PACK_RGB8(r,g,b) ((((r)>>RenderSurface::_format.r_loss)<<RenderSurface::_format.r_shift) | (((g)>>RenderSurface::_format.g_loss)<<RenderSurface::_format.g_shift) | (((b)>>RenderSurface::_format.b_loss)<<RenderSurface::_format.b_shift))
+#define PACK_RGB16(r,g,b) ((((r)>>RenderSurface::_format.r_loss16)<<RenderSurface::_format.r_shift) | (((g)>>RenderSurface::_format.g_loss16)<<RenderSurface::_format.g_shift) | (((b)>>RenderSurface::_format.b_loss16)<<RenderSurface::_format.b_shift))
-#define UNPACK_RGBA8(pix,r,g,b,a) { r = (((pix)&RenderSurface::format.r_mask)>>RenderSurface::format.r_shift)<<RenderSurface::format.r_loss; g = (((pix)&RenderSurface::format.g_mask)>>RenderSurface::format.g_shift)<<RenderSurface::format.g_loss; b = (((pix)&RenderSurface::format.b_mask)>>RenderSurface::format.b_shift)<<RenderSurface::format.b_loss; ; a = (((pix)&RenderSurface::format.a_mask)>>RenderSurface::format.a_shift)<<RenderSurface::format.a_loss; }
-#define PACK_RGBA8(r,g,b,a) ((((r)>>RenderSurface::format.r_loss)<<RenderSurface::format.r_shift) | (((g)>>RenderSurface::format.g_loss)<<RenderSurface::format.g_shift) | (((b)>>RenderSurface::format.b_loss)<<RenderSurface::format.b_shift) | (((a)>>RenderSurface::format.a_loss)<<RenderSurface::format.a_shift))
-#define PACK_RGBA16(r,g,b,a) ((((r)>>RenderSurface::format.r_loss16)<<RenderSurface::format.r_shift) | (((g)>>RenderSurface::format.g_loss16)<<RenderSurface::format.g_shift) | (((b)>>RenderSurface::format.b_loss16)<<RenderSurface::format.b_shift) | (((a)>>RenderSurface::format.a_loss16)<<RenderSurface::format.a_shift))
+#define UNPACK_RGBA8(pix,r,g,b,a) { r = (((pix)&RenderSurface::_format.r_mask)>>RenderSurface::_format.r_shift)<<RenderSurface::_format.r_loss; g = (((pix)&RenderSurface::_format.g_mask)>>RenderSurface::_format.g_shift)<<RenderSurface::_format.g_loss; b = (((pix)&RenderSurface::_format.b_mask)>>RenderSurface::_format.b_shift)<<RenderSurface::_format.b_loss; ; a = (((pix)&RenderSurface::_format.a_mask)>>RenderSurface::_format.a_shift)<<RenderSurface::_format.a_loss; }
+#define PACK_RGBA8(r,g,b,a) ((((r)>>RenderSurface::_format.r_loss)<<RenderSurface::_format.r_shift) | (((g)>>RenderSurface::_format.g_loss)<<RenderSurface::_format.g_shift) | (((b)>>RenderSurface::_format.b_loss)<<RenderSurface::_format.b_shift) | (((a)>>RenderSurface::_format.a_loss)<<RenderSurface::_format.a_shift))
+#define PACK_RGBA16(r,g,b,a) ((((r)>>RenderSurface::_format.r_loss16)<<RenderSurface::_format.r_shift) | (((g)>>RenderSurface::_format.g_loss16)<<RenderSurface::_format.g_shift) | (((b)>>RenderSurface::_format.b_loss16)<<RenderSurface::_format.b_shift) | (((a)>>RenderSurface::_format.a_loss16)<<RenderSurface::_format.a_shift))
//
// RenderSurface
@@ -64,10 +64,10 @@ public:
uint32 r_mask, g_mask, b_mask, a_mask;
};
- static Format format;
+ static Format _format;
- static uint8 Gamma10toGamma22[256];
- static uint8 Gamma22toGamma10[256];
+ static uint8 _gamma10toGamma22[256];
+ static uint8 _gamma22toGamma10[256];
//! Create a standard RenderSurface
static RenderSurface *SetVideoMode(uint32 width, uint32 height, int bpp);
diff --git a/engines/ultima/ultima8/graphics/scaler.h b/engines/ultima/ultima8/graphics/scaler.h
index 325ecf8a45..86356ab7a4 100644
--- a/engines/ultima/ultima8/graphics/scaler.h
+++ b/engines/ultima/ultima8/graphics/scaler.h
@@ -81,14 +81,14 @@ public:
if (!(scale_bits & (1 << y_factor))) return false;
}
- if (RenderSurface::format.s_bytes_per_pixel == 4) {
+ if (RenderSurface::_format.s_bytes_per_pixel == 4) {
if (texture->_format == TEX_FMT_NATIVE || (texture->_format == TEX_FMT_STANDARD &&
- RenderSurface::format.a_mask == TEX32_A_MASK && RenderSurface::format.r_mask == TEX32_R_MASK &&
- RenderSurface::format.g_mask == TEX32_G_MASK && RenderSurface::format.b_mask == TEX32_B_MASK)) {
- if (RenderSurface::format.a_mask == 0xFF000000) {
+ RenderSurface::_format.a_mask == TEX32_A_MASK && RenderSurface::_format.r_mask == TEX32_R_MASK &&
+ RenderSurface::_format.g_mask == TEX32_G_MASK && RenderSurface::_format.b_mask == TEX32_B_MASK)) {
+ if (RenderSurface::_format.a_mask == 0xFF000000) {
if (!Scale32_A888) return 0;
return Scale32_A888(texture, sx, sy, sw, sh, pixel, dw, dh, pitch, clamp_src);
- } else if (RenderSurface::format.a_mask == 0x000000FF) {
+ } else if (RenderSurface::_format.a_mask == 0x000000FF) {
if (!Scale32_888A) return 0;
return Scale32_888A(texture, sx, sy, sw, sh, pixel, dw, dh, pitch, clamp_src);
} else {
@@ -100,7 +100,7 @@ public:
return Scale32Sta(texture, sx, sy, sw, sh, pixel, dw, dh, pitch, clamp_src);
}
}
- if (RenderSurface::format.s_bytes_per_pixel == 2) {
+ if (RenderSurface::_format.s_bytes_per_pixel == 2) {
if (texture->_format == TEX_FMT_NATIVE) {
if (!Scale16Nat) return 0;
return Scale16Nat(texture, sx, sy, sw, sh, pixel, dw, dh, pitch, clamp_src);
diff --git a/engines/ultima/ultima8/graphics/soft_render_surface.cpp b/engines/ultima/ultima8/graphics/soft_render_surface.cpp
index ee2997bc96..8d52f14e62 100644
--- a/engines/ultima/ultima8/graphics/soft_render_surface.cpp
+++ b/engines/ultima/ultima8/graphics/soft_render_surface.cpp
@@ -181,7 +181,7 @@ template<> void SoftRenderSurface<uint32>::Fill32(uint32 rgb, int32 sx, int32 sy
template<class uintX> void SoftRenderSurface<uintX>::FillAlpha(uint8 alpha, int32 sx, int32 sy, int32 w, int32 h) {
_clipWindow.IntersectOther(sx, sy, w, h);
- if (!w || !h || !RenderSurface::format.a_mask) return;
+ if (!w || !h || !RenderSurface::_format.a_mask) return;
// An optimization.
if ((int)(w * sizeof(uintX)) == _pitch) {
@@ -195,24 +195,24 @@ template<class uintX> void SoftRenderSurface<uintX>::FillAlpha(uint8 alpha, int3
uint8 *line_end = pixel + w * sizeof(uintX);
int diff = _pitch - w * sizeof(uintX);
- uintX a = (((uintX)alpha) << RenderSurface::format.a_shift)&RenderSurface::format.a_mask;
+ uintX a = (((uintX)alpha) << RenderSurface::_format.a_shift)&RenderSurface::_format.a_mask;
#ifdef CHECK_ALPHA_FILLS
uintX c;
uintX m;
if (a == 0) {
- c = (RenderSurface::format.b_mask >> 1)&RenderSurface::format.b_mask;
- m = RenderSurface::format.b_mask;
+ c = (RenderSurface::_format.b_mask >> 1)&RenderSurface::_format.b_mask;
+ m = RenderSurface::_format.b_mask;
} else {
- c = (RenderSurface::format.r_mask >> 1)&RenderSurface::format.r_mask;
- m = RenderSurface::format.r_mask;
+ c = (RenderSurface::_format.r_mask >> 1)&RenderSurface::_format.r_mask;
+ m = RenderSurface::_format.r_mask;
}
#endif
while (pixel != end) {
while (pixel != line_end) {
uintX *dest = reinterpret_cast<uintX *>(pixel);
- *dest = (*dest & ~RenderSurface::format.a_mask) | a;
+ *dest = (*dest & ~RenderSurface::_format.a_mask) | a;
#ifdef CHECK_ALPHA_FILLS
*dest = (*dest & ~m) | (c + (((*dest & m) >> 1)&m));
#endif
@@ -254,7 +254,7 @@ template<class uintX> void SoftRenderSurface<uintX>::FillBlended(uint32 rgba, in
while (pixel != line_end) {
uintX *dest = reinterpret_cast<uintX *>(pixel);
uintX d = *dest;
- *dest = (d & RenderSurface::format.a_mask) | BlendPreModFast(rgba, d);
+ *dest = (d & RenderSurface::_format.a_mask) | BlendPreModFast(rgba, d);
pixel += sizeof(uintX);
}
@@ -634,7 +634,7 @@ template<class uintX> void SoftRenderSurface<uintX>::MaskedBlit(Texture *_tex, i
if (!alpha_blend) while (pixel != line_end) {
uintX *dest = reinterpret_cast<uintX *>(pixel);
- if ((*texel & TEX32_A_MASK) && (*dest & RenderSurface::format.a_mask)) {
+ if ((*texel & TEX32_A_MASK) && (*dest & RenderSurface::_format.a_mask)) {
*dest = static_cast<uintX>(
PACK_RGB8(
(TEX32_R(*texel) * ia + r) >> 8,
@@ -649,7 +649,7 @@ template<class uintX> void SoftRenderSurface<uintX>::MaskedBlit(Texture *_tex, i
else while (pixel != line_end) {
uintX *dest = reinterpret_cast<uintX *>(pixel);
- if (*dest & RenderSurface::format.a_mask) {
+ if (*dest & RenderSurface::_format.a_mask) {
uint32 alpha = *texel & TEX32_A_MASK;
if (alpha == 0xFF) {
*dest = static_cast<uintX>(
@@ -691,8 +691,8 @@ template<class uintX> void SoftRenderSurface<uintX>::MaskedBlit(Texture *_tex, i
uintX *dest = reinterpret_cast<uintX *>(pixel);
// Uh, not completely supported right now
- //if ((*texel & RenderSurface::format.a_mask) && (*dest & RenderSurface::format.a_mask))
- if (*dest & RenderSurface::format.a_mask) {
+ //if ((*texel & RenderSurface::_format.a_mask) && (*dest & RenderSurface::_format.a_mask))
+ if (*dest & RenderSurface::_format.a_mask) {
*dest = BlendHighlight(*texel, r, g, b, 1, ia);
}
pixel += sizeof(uintX);
diff --git a/engines/ultima/ultima8/graphics/soft_render_surface.inl b/engines/ultima/ultima8/graphics/soft_render_surface.inl
index 7d95286a2d..64fc258c88 100644
--- a/engines/ultima/ultima8/graphics/soft_render_surface.inl
+++ b/engines/ultima/ultima8/graphics/soft_render_surface.inl
@@ -151,7 +151,7 @@ const int32 neg = (FLIP_CONDITIONAL)?-1:0;
//
#ifdef DESTALPHA_MASK
-#define NOT_DESTINATION_MASKED (*pixptr & RenderSurface::format.a_mask)
+#define NOT_DESTINATION_MASKED (*pixptr & RenderSurface::_format.a_mask)
#else
diff --git a/engines/ultima/ultima8/graphics/type_flags.cpp b/engines/ultima/ultima8/graphics/type_flags.cpp
index 43abd9b561..c7ea7f0597 100644
--- a/engines/ultima/ultima8/graphics/type_flags.cpp
+++ b/engines/ultima/ultima8/graphics/type_flags.cpp
@@ -43,8 +43,8 @@ TypeFlags::~TypeFlags() {
}
ShapeInfo *TypeFlags::getShapeInfo(uint32 shapenum) {
- if (shapenum < shapeInfo.size())
- return &(shapeInfo[shapenum]);
+ if (shapenum < _shapeInfo.size())
+ return &(_shapeInfo[shapenum]);
else
return 0;
}
@@ -63,8 +63,8 @@ void TypeFlags::load(IDataSource *ds) {
uint32 size = ds->getSize();
uint32 count = size / blocksize;
- shapeInfo.clear();
- shapeInfo.resize(count);
+ _shapeInfo.clear();
+ _shapeInfo.resize(count);
for (uint32 i = 0; i < count; ++i) {
uint8 data[9];
@@ -152,14 +152,14 @@ void TypeFlags::load(IDataSource *ds) {
si._weaponInfo = 0;
si._armourInfo = 0;
- shapeInfo[i] = si;
+ _shapeInfo[i] = si;
}
if (GAME_IS_U8) {
// Workaround for incorrectly set solid flags on some "moss
// curtains" in the catacombs. See also docs/u8bugs.txt
for (uint32 i = 459; i <= 464; ++i) {
- shapeInfo[i]._flags &= ~ShapeInfo::SI_SOLID;
+ _shapeInfo[i]._flags &= ~ShapeInfo::SI_SOLID;
}
}
@@ -215,8 +215,8 @@ void TypeFlags::loadWeaponInfo() {
else
wi->_treasureChance = 0;
- assert(wi->_shape < shapeInfo.size());
- shapeInfo[wi->_shape]._weaponInfo = wi;
+ assert(wi->_shape < _shapeInfo.size());
+ _shapeInfo[wi->_shape]._weaponInfo = wi;
}
}
@@ -238,13 +238,13 @@ void TypeFlags::loadArmourInfo() {
config->get(k + "/shape", val);
ai._shape = static_cast<uint32>(val);
- assert(ai._shape < shapeInfo.size());
+ assert(ai._shape < _shapeInfo.size());
assert(msf->getShape(ai._shape));
unsigned int framecount = msf->getShape(ai._shape)->frameCount();
- ArmourInfo *aia = shapeInfo[ai._shape]._armourInfo;
+ ArmourInfo *aia = _shapeInfo[ai._shape]._armourInfo;
if (!aia) {
aia = new ArmourInfo[framecount];
- shapeInfo[ai._shape]._armourInfo = aia;
+ _shapeInfo[ai._shape]._armourInfo = aia;
for (unsigned int i = 0; i < framecount; ++i) {
aia[i]._shape = 0;
aia[i]._frame = 0;
@@ -360,8 +360,8 @@ void TypeFlags::loadMonsterInfo() {
mi->_treasure.clear();
}
- assert(mi->_shape < shapeInfo.size());
- shapeInfo[mi->_shape]._monsterInfo = mi;
+ assert(mi->_shape < _shapeInfo.size());
+ _shapeInfo[mi->_shape]._monsterInfo = mi;
}
}
diff --git a/engines/ultima/ultima8/graphics/type_flags.h b/engines/ultima/ultima8/graphics/type_flags.h
index 0a156380cf..c91c1c4c92 100644
--- a/engines/ultima/ultima8/graphics/type_flags.h
+++ b/engines/ultima/ultima8/graphics/type_flags.h
@@ -44,7 +44,7 @@ private:
void loadArmourInfo();
void loadMonsterInfo();
- Std::vector<ShapeInfo> shapeInfo;
+ Std::vector<ShapeInfo> _shapeInfo;
};
} // End of namespace Ultima8
diff --git a/engines/ultima/ultima8/gumps/minimap_gump.cpp b/engines/ultima/ultima8/gumps/minimap_gump.cpp
index 8e9d8e81b9..3a78f222f9 100644
--- a/engines/ultima/ultima8/gumps/minimap_gump.cpp
+++ b/engines/ultima/ultima8/gumps/minimap_gump.cpp
@@ -152,14 +152,14 @@ uint32 MiniMapGump::sampleAtPoint(int x_, int y_, CurrentMap *currentmap) {
uint16 r2, g2, b2;
UNPACK_RGB8(pal->_native_untransformed[frame->getPixelAtPoint(i - sx, j - sy)], r2, g2, b2);
- r += RenderSurface::Gamma22toGamma10[r2];
- g += RenderSurface::Gamma22toGamma10[g2];
- b += RenderSurface::Gamma22toGamma10[b2];
+ r += RenderSurface::_gamma22toGamma10[r2];
+ g += RenderSurface::_gamma22toGamma10[g2];
+ b += RenderSurface::_gamma22toGamma10[b2];
c++;
}
if (!c) return 0;
- return PACK_RGB8(RenderSurface::Gamma10toGamma22[r / c], RenderSurface::Gamma10toGamma22[g / c], RenderSurface::Gamma10toGamma22[b / c]);
+ return PACK_RGB8(RenderSurface::_gamma10toGamma22[r / c], RenderSurface::_gamma10toGamma22[g / c], RenderSurface::_gamma10toGamma22[b / c]);
} else return 0;
}
diff --git a/engines/ultima/ultima8/kernel/segmented_pool.cpp b/engines/ultima/ultima8/kernel/segmented_pool.cpp
index cc5e1b8d1e..db0bcf6d94 100644
--- a/engines/ultima/ultima8/kernel/segmented_pool.cpp
+++ b/engines/ultima/ultima8/kernel/segmented_pool.cpp
@@ -73,21 +73,21 @@ SegmentedPool::SegmentedPool(size_t nodeCapacity_, uint32 nodes)
VALGRIND_CREATE_MEMPOOL(_startOfPool, redzoneSize, 0);
- firstFree = reinterpret_cast<SegmentedPoolNode *>(_startOfPool);
- firstFree->pool = this;
- firstFree->size = 0;
+ _firstFree = reinterpret_cast<SegmentedPoolNode *>(_startOfPool);
+ _firstFree->pool = this;
+ _firstFree->size = 0;
- lastFree = firstFree;
+ _lastFree = _firstFree;
for (i = 1; i < nodes; ++i) {
- lastFree->nextFree = reinterpret_cast<SegmentedPoolNode *>(_startOfPool + i * _nodeOffset);
- lastFree = lastFree->nextFree;
+ _lastFree->nextFree = reinterpret_cast<SegmentedPoolNode *>(_startOfPool + i * _nodeOffset);
+ _lastFree = _lastFree->nextFree;
- lastFree->pool = this;
- lastFree->size = 0;
+ _lastFree->pool = this;
+ _lastFree->size = 0;
}
- lastFree->nextFree = 0;
+ _lastFree->nextFree = 0;
}
SegmentedPool::~SegmentedPool() {
@@ -105,14 +105,14 @@ void *SegmentedPool::allocate(size_t size) {
return 0;
--_freeNodeCount;
- node = firstFree;
+ node = _firstFree;
node->size = size;
if (isFull()) {
- firstFree = 0;
- lastFree = 0;
+ _firstFree = 0;
+ _lastFree = 0;
} else {
- firstFree = firstFree->nextFree;
+ _firstFree = _firstFree->nextFree;
}
node->nextFree = 0;
@@ -143,11 +143,11 @@ void SegmentedPool::deallocate(void *ptr) {
// debugN"Free Node 0x%08X\n", node);
if (isFull()) {
- firstFree = node;
- lastFree = node;
+ _firstFree = node;
+ _lastFree = node;
} else {
- lastFree->nextFree = node;
- lastFree = lastFree->nextFree;
+ _lastFree->nextFree = node;
+ _lastFree = _lastFree->nextFree;
}
++_freeNodeCount;
}
diff --git a/engines/ultima/ultima8/kernel/segmented_pool.h b/engines/ultima/ultima8/kernel/segmented_pool.h
index 663cc1a90b..63d1e3f202 100644
--- a/engines/ultima/ultima8/kernel/segmented_pool.h
+++ b/engines/ultima/ultima8/kernel/segmented_pool.h
@@ -78,8 +78,8 @@ private:
uint32 _nodes;
uint32 _freeNodeCount;
- SegmentedPoolNode *firstFree;
- SegmentedPoolNode *lastFree;
+ SegmentedPoolNode *_firstFree;
+ SegmentedPoolNode *_lastFree;
};
} // End of namespace Ultima8
diff --git a/engines/ultima/ultima8/misc/debugger.cpp b/engines/ultima/ultima8/misc/debugger.cpp
index a27f0b32d9..990cd3b347 100644
--- a/engines/ultima/ultima8/misc/debugger.cpp
+++ b/engines/ultima/ultima8/misc/debugger.cpp
@@ -711,7 +711,7 @@ bool Debugger::cmdToggleHighlightItems(int argc, const char **argv) {
bool Debugger::cmdDumpMap(int argc, const char **argv) {
#ifdef TODO
// We only support 32 bits per pixel for now
- if (RenderSurface::format.s_bpp != 32) return;
+ if (RenderSurface::_format.s_bpp != 32) return;
// Save because we're going to potentially break the game by enlarging
// the fast area and available object IDs.
diff --git a/engines/ultima/ultima8/ultima8.cpp b/engines/ultima/ultima8/ultima8.cpp
index c477e3d01a..c9227f8664 100644
--- a/engines/ultima/ultima8/ultima8.cpp
+++ b/engines/ultima/ultima8/ultima8.cpp
@@ -622,7 +622,7 @@ void Ultima8Engine::GraphicSysInit() {
_screen->GetSurfaceDims(old_dims);
if (width == old_dims.w && height == old_dims.h)
return;
- bpp = RenderSurface::format.s_bpp;
+ bpp = RenderSurface::_format.s_bpp;
delete _screen;
}
diff --git a/engines/ultima/ultima8/usecode/uc_stack.cpp b/engines/ultima/ultima8/usecode/uc_stack.cpp
index 34cb17cfba..88824ad143 100644
--- a/engines/ultima/ultima8/usecode/uc_stack.cpp
+++ b/engines/ultima/ultima8/usecode/uc_stack.cpp
@@ -41,11 +41,11 @@ bool UCStack::load(IDataSource *ids, uint32 version) {
if (_buf) delete[] _buf;
_buf = new uint8[_size];
#else
- if (_size > sizeof(buf_array)) {
+ if (_size > sizeof(_bufArray)) {
perr << "Error: UCStack _size mismatch (buf_array too small)" << Std::endl;
return false;
}
- _buf = buf_array;
+ _buf = _bufArray;
#endif
uint32 sp = ids->read4();
_bufPtr = _buf + sp;
diff --git a/engines/ultima/ultima8/usecode/uc_stack.h b/engines/ultima/ultima8/usecode/uc_stack.h
index 50f0ee4f18..102c8dfa74 100644
--- a/engines/ultima/ultima8/usecode/uc_stack.h
+++ b/engines/ultima/ultima8/usecode/uc_stack.h
@@ -179,9 +179,9 @@ public:
#ifndef USE_DYNAMIC_UCSTACK
class UCStack : public BaseUCStack {
- uint8 buf_array[0x1000];
+ uint8 _bufArray[0x1000];
public:
- UCStack() : BaseUCStack(0x1000, buf_array) { }
+ UCStack() : BaseUCStack(0x1000, _bufArray) { }
~UCStack() override { }
void save(ODataSource *ods);
More information about the Scummvm-git-logs
mailing list