summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
author AJR <ajrhacker@users.noreply.github.com>2021-12-30 15:44:57 -0500
committer AJR <ajrhacker@users.noreply.github.com>2021-12-30 15:47:16 -0500
commit4aca8e189096236b4d5586cf993882a5f2a30e66 (patch)
tree39f1849fc15d4b988a868119c07cfdcd3aac960e
parenta93426ab33a6b64289595ecdd250e42bcc6a59c5 (diff)
Render-related cleanup
- Undo inclusion of screen.h within render.h and update many source files that were stealth-including the former - Move texture_format enum to rendertypes.h - rendlay.h: Make a few methods static - ui/info.cpp: Use C++11-style iteration for render targets
-rw-r--r--src/devices/video/vector.cpp1
-rw-r--r--src/emu/debug/debugcmd.cpp1
-rw-r--r--src/emu/drivers/empty.cpp2
-rw-r--r--src/emu/render.h9
-rw-r--r--src/emu/rendertypes.h10
-rw-r--r--src/emu/rendlay.h30
-rw-r--r--src/emu/screen.h12
-rw-r--r--src/emu/video.cpp1
-rw-r--r--src/frontend/mame/luaengine.cpp1
-rw-r--r--src/frontend/mame/ui/devopt.cpp1
-rw-r--r--src/frontend/mame/ui/info.cpp7
-rw-r--r--src/frontend/mame/ui/ui.cpp1
-rw-r--r--src/frontend/mame/ui/viewgfx.cpp1
-rw-r--r--src/mame/video/deco16ic.cpp2
-rw-r--r--src/osd/mac/window.cpp1
-rw-r--r--src/osd/modules/render/drawd3d.cpp5
-rw-r--r--src/osd/sdl/window.cpp1
17 files changed, 51 insertions, 35 deletions
diff --git a/src/devices/video/vector.cpp b/src/devices/video/vector.cpp
index 9f4a35f4bf5..aa0210eda28 100644
--- a/src/devices/video/vector.cpp
+++ b/src/devices/video/vector.cpp
@@ -46,6 +46,7 @@
#include "emuopts.h"
#include "render.h"
+#include "screen.h"
#define VECTOR_WIDTH_DENOM 512
diff --git a/src/emu/debug/debugcmd.cpp b/src/emu/debug/debugcmd.cpp
index ba85a22f90b..b8de0298432 100644
--- a/src/emu/debug/debugcmd.cpp
+++ b/src/emu/debug/debugcmd.cpp
@@ -23,6 +23,7 @@
#include "emuopts.h"
#include "natkeyboard.h"
#include "render.h"
+#include "screen.h"
#include "softlist.h"
#include "corestr.h"
diff --git a/src/emu/drivers/empty.cpp b/src/emu/drivers/empty.cpp
index 23cf5443013..6b60367403b 100644
--- a/src/emu/drivers/empty.cpp
+++ b/src/emu/drivers/empty.cpp
@@ -10,7 +10,7 @@
#include "emu.h"
#include "emuopts.h"
-#include "render.h"
+#include "screen.h"
//**************************************************************************
// DRIVER STATE
diff --git a/src/emu/render.h b/src/emu/render.h
index d7158340c8f..27205206d1f 100644
--- a/src/emu/render.h
+++ b/src/emu/render.h
@@ -47,18 +47,11 @@
#define MAME_EMU_RENDER_H
#include "rendertypes.h"
-#include "screen.h"
-#include <array>
#include <cmath>
-#include <functional>
-#include <map>
+#include <list>
#include <memory>
#include <mutex>
-#include <string>
-#include <string_view>
-#include <tuple>
-#include <unordered_map>
#include <utility>
#include <vector>
diff --git a/src/emu/rendertypes.h b/src/emu/rendertypes.h
index 43f2ebb85e7..b3eed6ad9bd 100644
--- a/src/emu/rendertypes.h
+++ b/src/emu/rendertypes.h
@@ -20,6 +20,16 @@
//**************************************************************************
+// texture formats
+enum texture_format
+{
+ TEXFORMAT_UNDEFINED = 0, // require a format to be specified
+ TEXFORMAT_PALETTE16, // 16bpp palettized, no alpha
+ TEXFORMAT_RGB32, // 32bpp 8-8-8 RGB
+ TEXFORMAT_ARGB32, // 32bpp 8-8-8-8 ARGB
+ TEXFORMAT_YUY16 // 16bpp 8-8 Y/Cb, Y/Cr in sequence
+};
+
// blending modes
enum
{
diff --git a/src/emu/rendlay.h b/src/emu/rendlay.h
index da9edfcf752..363aea2c649 100644
--- a/src/emu/rendlay.h
+++ b/src/emu/rendlay.h
@@ -16,6 +16,16 @@
#include "rendertypes.h"
#include "screen.h"
+#include <array>
+#include <functional>
+#include <map>
+#include <memory>
+#include <string>
+#include <string_view>
+#include <tuple>
+#include <unordered_map>
+#include <vector>
+
//**************************************************************************
// TYPE DEFINITIONS
@@ -113,16 +123,16 @@ private:
virtual void draw_aligned(running_machine &machine, bitmap_argb32 &dest, const rectangle &bounds, int state);
// drawing helpers
- void draw_text(render_font &font, bitmap_argb32 &dest, const rectangle &bounds, std::string_view str, int align, const render_color &color);
- void draw_segment_horizontal_caps(bitmap_argb32 &dest, int minx, int maxx, int midy, int width, int caps, rgb_t color);
- void draw_segment_horizontal(bitmap_argb32 &dest, int minx, int maxx, int midy, int width, rgb_t color);
- void draw_segment_vertical_caps(bitmap_argb32 &dest, int miny, int maxy, int midx, int width, int caps, rgb_t color);
- void draw_segment_vertical(bitmap_argb32 &dest, int miny, int maxy, int midx, int width, rgb_t color);
- void draw_segment_diagonal_1(bitmap_argb32 &dest, int minx, int maxx, int miny, int maxy, int width, rgb_t color);
- void draw_segment_diagonal_2(bitmap_argb32 &dest, int minx, int maxx, int miny, int maxy, int width, rgb_t color);
- void draw_segment_decimal(bitmap_argb32 &dest, int midx, int midy, int width, rgb_t color);
- void draw_segment_comma(bitmap_argb32 &dest, int minx, int maxx, int miny, int maxy, int width, rgb_t color);
- void apply_skew(bitmap_argb32 &dest, int skewwidth);
+ static void draw_text(render_font &font, bitmap_argb32 &dest, const rectangle &bounds, std::string_view str, int align, const render_color &color);
+ static void draw_segment_horizontal_caps(bitmap_argb32 &dest, int minx, int maxx, int midy, int width, int caps, rgb_t color);
+ static void draw_segment_horizontal(bitmap_argb32 &dest, int minx, int maxx, int midy, int width, rgb_t color);
+ static void draw_segment_vertical_caps(bitmap_argb32 &dest, int miny, int maxy, int midx, int width, int caps, rgb_t color);
+ static void draw_segment_vertical(bitmap_argb32 &dest, int miny, int maxy, int midx, int width, rgb_t color);
+ static void draw_segment_diagonal_1(bitmap_argb32 &dest, int minx, int maxx, int miny, int maxy, int width, rgb_t color);
+ static void draw_segment_diagonal_2(bitmap_argb32 &dest, int minx, int maxx, int miny, int maxy, int width, rgb_t color);
+ static void draw_segment_decimal(bitmap_argb32 &dest, int midx, int midy, int width, rgb_t color);
+ static void draw_segment_comma(bitmap_argb32 &dest, int minx, int maxx, int miny, int maxy, int width, rgb_t color);
+ static void apply_skew(bitmap_argb32 &dest, int skewwidth);
private:
using bounds_vector = emu::render::detail::bounds_vector;
diff --git a/src/emu/screen.h b/src/emu/screen.h
index b909c25cecc..8f54ae9fb3a 100644
--- a/src/emu/screen.h
+++ b/src/emu/screen.h
@@ -13,6 +13,8 @@
#pragma once
+#include "rendertypes.h"
+
#include <type_traits>
#include <utility>
@@ -31,16 +33,6 @@ enum screen_type_enum
SCREEN_TYPE_SVG
};
-// texture formats
-enum texture_format
-{
- TEXFORMAT_UNDEFINED = 0, // require a format to be specified
- TEXFORMAT_PALETTE16, // 16bpp palettized, no alpha
- TEXFORMAT_RGB32, // 32bpp 8-8-8 RGB
- TEXFORMAT_ARGB32, // 32bpp 8-8-8-8 ARGB
- TEXFORMAT_YUY16 // 16bpp 8-8 Y/Cb, Y/Cr in sequence
-};
-
// screen_update callback flags
constexpr u32 UPDATE_HAS_NOT_CHANGED = 0x0001; // the video has not changed
diff --git a/src/emu/video.cpp b/src/emu/video.cpp
index 5cb21b3f849..b13cf663413 100644
--- a/src/emu/video.cpp
+++ b/src/emu/video.cpp
@@ -15,6 +15,7 @@
#include "crsshair.h"
#include "rendersw.hxx"
#include "output.h"
+#include "screen.h"
#include "corestr.h"
#include "png.h"
diff --git a/src/frontend/mame/luaengine.cpp b/src/frontend/mame/luaengine.cpp
index 2cc98b971fe..84048cf7e57 100644
--- a/src/frontend/mame/luaengine.cpp
+++ b/src/frontend/mame/luaengine.cpp
@@ -23,6 +23,7 @@
#include "emuopts.h"
#include "inputdev.h"
#include "natkeyboard.h"
+#include "screen.h"
#include "softlist.h"
#include "uiinput.h"
diff --git a/src/frontend/mame/ui/devopt.cpp b/src/frontend/mame/ui/devopt.cpp
index c9e0fee1833..0f20c35486f 100644
--- a/src/frontend/mame/ui/devopt.cpp
+++ b/src/frontend/mame/ui/devopt.cpp
@@ -13,6 +13,7 @@
#include "ui/ui.h"
#include "romload.h"
+#include "screen.h"
namespace ui {
diff --git a/src/frontend/mame/ui/info.cpp b/src/frontend/mame/ui/info.cpp
index d7ed21065fa..5d4b8c61cb2 100644
--- a/src/frontend/mame/ui/info.cpp
+++ b/src/frontend/mame/ui/info.cpp
@@ -15,9 +15,10 @@
#include "ui/ui.h"
#include "drivenum.h"
+#include "emuopts.h"
#include "romload.h"
+#include "screen.h"
#include "softlist.h"
-#include "emuopts.h"
#include <set>
#include <sstream>
@@ -234,8 +235,8 @@ machine_static_info::machine_static_info(const ui_options &options, machine_conf
// suppress "requires external artwork" warning when external artwork was loaded
if (config.root_device().has_running_machine())
{
- for (render_target *target = config.root_device().machine().render().first_target(); target != nullptr; target = target->next())
- if (!target->hidden() && target->external_artwork())
+ for (render_target const &target : config.root_device().machine().render().targets())
+ if (!target.hidden() && target.external_artwork())
{
m_flags &= ~::machine_flags::REQUIRES_ARTWORK;
break;
diff --git a/src/frontend/mame/ui/ui.cpp b/src/frontend/mame/ui/ui.cpp
index f5978f9c1ea..c9dae332ea6 100644
--- a/src/frontend/mame/ui/ui.cpp
+++ b/src/frontend/mame/ui/ui.cpp
@@ -38,6 +38,7 @@
#include "cheat.h"
#include "rendfont.h"
#include "romload.h"
+#include "screen.h"
#include "uiinput.h"
#include "../osd/modules/lib/osdobj_common.h"
diff --git a/src/frontend/mame/ui/viewgfx.cpp b/src/frontend/mame/ui/viewgfx.cpp
index b10a62aee13..8c51413607a 100644
--- a/src/frontend/mame/ui/viewgfx.cpp
+++ b/src/frontend/mame/ui/viewgfx.cpp
@@ -16,6 +16,7 @@
#include "render.h"
#include "rendfont.h"
#include "rendutil.h"
+#include "screen.h"
#include "tilemap.h"
#include "uiinput.h"
diff --git a/src/mame/video/deco16ic.cpp b/src/mame/video/deco16ic.cpp
index 39564a86c9d..f0d521a05ae 100644
--- a/src/mame/video/deco16ic.cpp
+++ b/src/mame/video/deco16ic.cpp
@@ -174,7 +174,7 @@ Rowscroll style:
#include "emu.h"
#include "video/deco16ic.h"
-#include "render.h"
+#include "screen.h"
DEFINE_DEVICE_TYPE(DECO16IC, deco16ic_device, "deco16ic", "DECO 55 / 56 / 74 / 141 Tilemap Generator")
diff --git a/src/osd/mac/window.cpp b/src/osd/mac/window.cpp
index 4056958b0d9..4a150e54a35 100644
--- a/src/osd/mac/window.cpp
+++ b/src/osd/mac/window.cpp
@@ -20,6 +20,7 @@
#include "emu.h"
#include "emuopts.h"
#include "render.h"
+#include "screen.h"
#include "ui/uimain.h"
// OSD headers
diff --git a/src/osd/modules/render/drawd3d.cpp b/src/osd/modules/render/drawd3d.cpp
index a279034ef7d..7fc1bcf53d6 100644
--- a/src/osd/modules/render/drawd3d.cpp
+++ b/src/osd/modules/render/drawd3d.cpp
@@ -8,10 +8,11 @@
// MAME headers
#include "emu.h"
+#include "emuopts.h"
#include "render.h"
-
#include "rendutil.h"
-#include "emuopts.h"
+#include "screen.h"
+
#include "aviio.h"
// MAMEOS headers
diff --git a/src/osd/sdl/window.cpp b/src/osd/sdl/window.cpp
index 29ed4b920eb..8c60d1131e8 100644
--- a/src/osd/sdl/window.cpp
+++ b/src/osd/sdl/window.cpp
@@ -29,6 +29,7 @@
#include "emu.h"
#include "emuopts.h"
#include "render.h"
+#include "screen.h"
#include "ui/uimain.h"
// OSD headers