mirror of
https://github.com/holub/mame
synced 2025-04-23 08:49:55 +03:00
emu/rendersw.hxx: Appease complilers that don't believe in constexpr trigonometry.
This commit is contained in:
parent
18951453d8
commit
5c14cc707b
@ -31,7 +31,7 @@ private:
|
||||
|
||||
// internal helpers
|
||||
template <int... Values>
|
||||
static constexpr auto make_cosine_table(std::integer_sequence<int, Values...>) { return std::array{ u32((1.0 / cos(atan(double(Values) / double(sizeof...(Values) - 1)))) * 0x10000000 + 0.5)... }; }
|
||||
static auto make_cosine_table(std::integer_sequence<int, Values...>) { return std::array{ u32((1.0 / cos(atan(double(Values) / double(sizeof...(Values) - 1)))) * 0x10000000 + 0.5)... }; }
|
||||
static constexpr bool is_opaque(float alpha) { return (alpha >= (NoDestRead ? 0.5f : 1.0f)); }
|
||||
static constexpr bool is_transparent(float alpha) { return (alpha < (NoDestRead ? 0.5f : 0.0001f)); }
|
||||
static rgb_t apply_intensity(int intensity, rgb_t color) { return color.scale8(intensity); }
|
||||
@ -430,7 +430,7 @@ private:
|
||||
static void draw_line(render_primitive const &prim, PixelType *dstdata, s32 width, s32 height, u32 pitch)
|
||||
{
|
||||
// internal cosine table generated at compile time
|
||||
static constexpr auto s_cosine_table = make_cosine_table(std::make_integer_sequence<int, 2049>());
|
||||
static auto const s_cosine_table = make_cosine_table(std::make_integer_sequence<int, 2049>());
|
||||
|
||||
// compute the start/end coordinates
|
||||
int x1 = int(prim.bounds.x0 * 65536.0f);
|
||||
|
Loading…
Reference in New Issue
Block a user