mirror of
https://github.com/holub/mame
synced 2025-07-08 11:21:56 +03:00
added option to clear with value for arrays (nw)
This commit is contained in:
parent
c0740a42c8
commit
a111c124c7
@ -37,6 +37,16 @@ inline std::unique_ptr<T> make_unique_clear(std::size_t size)
|
||||
return ptr;
|
||||
}
|
||||
|
||||
template<typename T,unsigned char F>
|
||||
inline std::unique_ptr<T> make_unique_clear(std::size_t size)
|
||||
{
|
||||
auto ptr = std::make_unique<T>(size);
|
||||
static_assert(std::is_array<T>::value, "Type must be array");
|
||||
memset(ptr.get(), F, sizeof(std::remove_extent<T>) * size);
|
||||
return ptr;
|
||||
}
|
||||
|
||||
|
||||
template<typename T>
|
||||
inline std::unique_ptr<T> make_unique_clear()
|
||||
{
|
||||
|
@ -245,7 +245,7 @@ void segas32_state::common_start(int multi32)
|
||||
|
||||
/* allocate pre-rendered solid lines of 0's and ffff's */
|
||||
m_solid_0000 = make_unique_clear<UINT16[]>(512);
|
||||
m_solid_ffff = make_unique_clear<UINT16[]>(512);
|
||||
m_solid_ffff = make_unique_clear<UINT16[],0xff>(512);
|
||||
|
||||
memset(m_system32_videoram, 0x00, 0x20000);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user