summaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
author Vas Crabb <vas@vastheman.com>2016-07-12 13:09:42 +1000
committer Vas Crabb <vas@vastheman.com>2016-07-12 13:09:42 +1000
commit31c4a813698b8aba24036efb80c09101d0a8694e (patch)
treecf9abfabd3eadbf9cf79d51939872b0be40af138 /src
parent203c8ffbdbaa9046cde09af1d6355d202cbe0341 (diff)
misc fixes (nw)
* remove a temporary * fix deps * remove a vestigial member * play nicer with dotfiles * play nicer with pch
Diffstat (limited to 'src')
-rw-r--r--src/frontend/mame/ui/menu.h2
-rw-r--r--src/frontend/mame/ui/widgets.cpp6
-rw-r--r--src/frontend/mame/ui/widgets.h20
-rw-r--r--src/lib/util/corefile.cpp9
4 files changed, 18 insertions, 19 deletions
diff --git a/src/frontend/mame/ui/menu.h b/src/frontend/mame/ui/menu.h
index ab9799371f0..3c74031852d 100644
--- a/src/frontend/mame/ui/menu.h
+++ b/src/frontend/mame/ui/menu.h
@@ -267,7 +267,7 @@ private:
void add_cleanup_callback(cleanup_callback &&callback);
bitmap_argb32 *bgrnd_bitmap() { return m_bgrnd_bitmap.get(); }
- render_texture * bgrnd_texture() { return m_bgrnd_texture.get(); }
+ render_texture *bgrnd_texture() { return m_bgrnd_texture.get(); }
void reset_topmost(reset_options options) { if (m_stack) m_stack->reset(options); }
diff --git a/src/frontend/mame/ui/widgets.cpp b/src/frontend/mame/ui/widgets.cpp
index 3d92bd7c03a..7a82310879e 100644
--- a/src/frontend/mame/ui/widgets.cpp
+++ b/src/frontend/mame/ui/widgets.cpp
@@ -8,9 +8,10 @@
*********************************************************************/
+#include "emu.h"
+
#include "widgets.h"
-#include "rendutil.h"
-#include "drivenum.h"
+
namespace ui {
/***************************************************************************
@@ -26,7 +27,6 @@ widgets_manager::widgets_manager(running_machine &machine)
, m_hilight_texture()
, m_hilight_main_bitmap(std::make_unique<bitmap_argb32>(1, 128))
, m_hilight_main_texture()
- , m_bgrnd_texture()
{
render_manager &render(machine.render());
auto const texture_free([&render](render_texture *texture) { render.texture_free(texture); });
diff --git a/src/frontend/mame/ui/widgets.h b/src/frontend/mame/ui/widgets.h
index 5e9c79f78ba..a18c3a80cc9 100644
--- a/src/frontend/mame/ui/widgets.h
+++ b/src/frontend/mame/ui/widgets.h
@@ -13,12 +13,12 @@
#pragma once
+#include "bitmap.h"
+#include "render.h"
+
#include <memory>
#include <functional>
-#include "ui/ui.h"
-#include "bitmap.h"
-#include "render.h"
namespace ui {
/***************************************************************************
@@ -33,20 +33,18 @@ public:
render_texture *hilight_texture() { return m_hilight_texture.get(); }
render_texture *hilight_main_texture() { return m_hilight_main_texture.get(); }
render_texture *arrow_texture() { return m_arrow_texture.get(); }
- render_texture * bgrnd_texture() { return m_bgrnd_texture.get(); }
using bitmap_ptr = std::unique_ptr<bitmap_argb32>;
using texture_ptr = std::unique_ptr<render_texture, std::function<void(render_texture *)> >;
private:
- bitmap_ptr m_hilight_bitmap;
- texture_ptr m_hilight_texture;
- bitmap_ptr m_hilight_main_bitmap;
- texture_ptr m_hilight_main_texture;
- texture_ptr m_arrow_texture;
- texture_ptr m_bgrnd_texture;
-
static void render_triangle(bitmap_argb32 &dest, bitmap_argb32 &source, const rectangle &sbounds, void *param);
+
+ bitmap_ptr m_hilight_bitmap;
+ texture_ptr m_hilight_texture;
+ bitmap_ptr m_hilight_main_bitmap;
+ texture_ptr m_hilight_main_texture;
+ texture_ptr m_arrow_texture;
};
} // namespace ui
diff --git a/src/lib/util/corefile.cpp b/src/lib/util/corefile.cpp
index c06426015f7..7a34406cf02 100644
--- a/src/lib/util/corefile.cpp
+++ b/src/lib/util/corefile.cpp
@@ -18,6 +18,8 @@
#include <algorithm>
#include <cassert>
#include <cstring>
+#include <iterator>
+
#include <ctype.h>
@@ -1279,13 +1281,12 @@ std::string core_filename_extract_base(const std::string &name, bool strip_exten
auto const chop_position = strip_extension
? std::find(name.rbegin(), start, '.')
: start;
- auto const end = (chop_position != start)
- ? chop_position + 1
+ auto const end = ((chop_position != start) && (std::next(chop_position) != start))
+ ? std::next(chop_position)
: name.rbegin();
// copy the result into an string
- std::string result(start.base(), end.base());
- return result;
+ return std::string(start.base(), end.base());
}