mirror of
https://github.com/holub/mame
synced 2025-04-28 03:02:52 +03:00
Changed device_image_interface::load() to take 'const std::string &'
This commit is contained in:
parent
871656c98c
commit
764371c72c
@ -1018,7 +1018,7 @@ bool device_image_interface::schedule_postload_hard_reset_if_needed()
|
|||||||
// load - load an image into MAME
|
// load - load an image into MAME
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
|
|
||||||
image_init_result device_image_interface::load(const char *path)
|
image_init_result device_image_interface::load(const std::string &path)
|
||||||
{
|
{
|
||||||
return load_internal(path, false, 0, nullptr, false);
|
return load_internal(path, false, 0, nullptr, false);
|
||||||
}
|
}
|
||||||
|
@ -228,7 +228,7 @@ public:
|
|||||||
const formatlist_type &formatlist() const { return m_formatlist; }
|
const formatlist_type &formatlist() const { return m_formatlist; }
|
||||||
|
|
||||||
// loads an image file
|
// loads an image file
|
||||||
image_init_result load(const char *path);
|
image_init_result load(const std::string &path);
|
||||||
|
|
||||||
// loads a softlist item by name
|
// loads a softlist item by name
|
||||||
image_init_result load_software(const std::string &softlist_name);
|
image_init_result load_software(const std::string &softlist_name);
|
||||||
|
@ -58,7 +58,7 @@ image_manager::image_manager(running_machine &machine)
|
|||||||
// try to load this image
|
// try to load this image
|
||||||
image_init_result result = is_softlist_part
|
image_init_result result = is_softlist_part
|
||||||
? image.load_software(image_name)
|
? image.load_software(image_name)
|
||||||
: image.load(image_name.c_str());
|
: image.load(image_name);
|
||||||
|
|
||||||
// did the image load fail?
|
// did the image load fail?
|
||||||
if (result != image_init_result::PASS)
|
if (result != image_init_result::PASS)
|
||||||
|
@ -49,7 +49,7 @@ void menu_control_floppy_image::do_load_create()
|
|||||||
}
|
}
|
||||||
fd->setup_write(output_format);
|
fd->setup_write(output_format);
|
||||||
} else {
|
} else {
|
||||||
image_init_result err = fd->load(input_filename.c_str());
|
image_init_result err = fd->load(input_filename);
|
||||||
if ((err == image_init_result::PASS) && (output_filename.compare("") != 0))
|
if ((err == image_init_result::PASS) && (output_filename.compare("") != 0))
|
||||||
err = fd->reopen_for_write(output_filename.c_str()) ? image_init_result::FAIL : image_init_result::PASS;
|
err = fd->reopen_for_write(output_filename.c_str()) ? image_init_result::FAIL : image_init_result::PASS;
|
||||||
if (err != image_init_result::PASS) {
|
if (err != image_init_result::PASS) {
|
||||||
@ -61,7 +61,7 @@ void menu_control_floppy_image::do_load_create()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void menu_control_floppy_image::hook_load(std::string filename, bool softlist)
|
void menu_control_floppy_image::hook_load(const std::string &filename, bool softlist)
|
||||||
{
|
{
|
||||||
if (softlist)
|
if (softlist)
|
||||||
{
|
{
|
||||||
|
@ -33,7 +33,7 @@ private:
|
|||||||
virtual void handle() override;
|
virtual void handle() override;
|
||||||
|
|
||||||
void do_load_create();
|
void do_load_create();
|
||||||
virtual void hook_load(std::string filename, bool softlist) override;
|
virtual void hook_load(const std::string &filename, bool softlist) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace ui
|
} // namespace ui
|
||||||
|
@ -153,10 +153,10 @@ void menu_control_device_image::load_software_part()
|
|||||||
// hook_load
|
// hook_load
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
|
|
||||||
void menu_control_device_image::hook_load(std::string name, bool softlist)
|
void menu_control_device_image::hook_load(const std::string &name, bool softlist)
|
||||||
{
|
{
|
||||||
if (m_image.is_reset_on_load()) m_image.set_init_phase();
|
if (m_image.is_reset_on_load()) m_image.set_init_phase();
|
||||||
m_image.load(name.c_str());
|
m_image.load(name);
|
||||||
stack_pop();
|
stack_pop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -53,7 +53,7 @@ protected:
|
|||||||
bool m_create_ok;
|
bool m_create_ok;
|
||||||
|
|
||||||
// methods
|
// methods
|
||||||
virtual void hook_load(std::string filename, bool softlist);
|
virtual void hook_load(const std::string &filename, bool softlist);
|
||||||
virtual void handle() override;
|
virtual void handle() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
Loading…
Reference in New Issue
Block a user