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
This commit is contained in:
AJR 2021-12-30 15:44:57 -05:00
parent a93426ab33
commit 4aca8e1890
17 changed files with 53 additions and 37 deletions

View File

@ -46,6 +46,7 @@
#include "emuopts.h"
#include "render.h"
#include "screen.h"
#define VECTOR_WIDTH_DENOM 512

View File

@ -23,6 +23,7 @@
#include "emuopts.h"
#include "natkeyboard.h"
#include "render.h"
#include "screen.h"
#include "softlist.h"
#include "corestr.h"

View File

@ -10,7 +10,7 @@
#include "emu.h"
#include "emuopts.h"
#include "render.h"
#include "screen.h"
//**************************************************************************
// DRIVER STATE

View File

@ -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>

View File

@ -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
{

View File

@ -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;

View File

@ -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

View File

@ -15,6 +15,7 @@
#include "crsshair.h"
#include "rendersw.hxx"
#include "output.h"
#include "screen.h"
#include "corestr.h"
#include "png.h"

View File

@ -23,6 +23,7 @@
#include "emuopts.h"
#include "inputdev.h"
#include "natkeyboard.h"
#include "screen.h"
#include "softlist.h"
#include "uiinput.h"

View File

@ -13,6 +13,7 @@
#include "ui/ui.h"
#include "romload.h"
#include "screen.h"
namespace ui {

View File

@ -15,9 +15,10 @@
#include "ui/ui.h"
#include "drivenum.h"
#include "romload.h"
#include "softlist.h"
#include "emuopts.h"
#include "romload.h"
#include "screen.h"
#include "softlist.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;

View File

@ -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"

View File

@ -16,6 +16,7 @@
#include "render.h"
#include "rendfont.h"
#include "rendutil.h"
#include "screen.h"
#include "tilemap.h"
#include "uiinput.h"

View File

@ -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")

View File

@ -20,6 +20,7 @@
#include "emu.h"
#include "emuopts.h"
#include "render.h"
#include "screen.h"
#include "ui/uimain.h"
// OSD headers

View File

@ -8,10 +8,11 @@
// MAME headers
#include "emu.h"
#include "render.h"
#include "rendutil.h"
#include "emuopts.h"
#include "render.h"
#include "rendutil.h"
#include "screen.h"
#include "aviio.h"
// MAMEOS headers

View File

@ -29,6 +29,7 @@
#include "emu.h"
#include "emuopts.h"
#include "render.h"
#include "screen.h"
#include "ui/uimain.h"
// OSD headers