Skip to content

Commit afb09a1

Browse files
committed
fixed network conversion
1 parent a6977ca commit afb09a1

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

include/DMDUtil/DMD.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ class DMDUTILAPI DMD
7777
DMD();
7878
~DMD();
7979

80-
enum class Mode
80+
enum class Mode : int
8181
{
8282
Unknown = 0,
8383
Data = 1,

src/DMD.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@ DMD::Update DMD::Update::toNetworkByteOrder() const
100100
{
101101
// uint8_t and bool are not converted, as they are already in network byte order.
102102
Update copy = *this;
103-
copy.mode = static_cast<Mode>(htonl(static_cast<uint32_t>(mode)));
104-
copy.layout = static_cast<AlphaNumericLayout>(htonl(static_cast<uint32_t>(layout)));
103+
copy.mode = static_cast<Mode>(htonl(static_cast<int>(mode)));
104+
copy.layout = static_cast<AlphaNumericLayout>(htonl(static_cast<int>(layout)));
105105
copy.depth = htonl(depth);
106106
for (size_t i = 0; i < 256 * 64; i++)
107107
{
@@ -119,7 +119,7 @@ DMD::Update DMD::Update::toNetworkByteOrder() const
119119
void DMD::StreamHeader::convertToHostByteOrder()
120120
{
121121
// uint8_t and char are not converted, as they are already in host byte order.
122-
mode = static_cast<Mode>(ntohl(static_cast<uint32_t>(mode)));
122+
mode = static_cast<Mode>(ntohl(static_cast<int>(mode)));
123123
width = ntohs(width);
124124
height = ntohs(height);
125125
length = ntohl(length);
@@ -128,7 +128,7 @@ void DMD::StreamHeader::convertToHostByteOrder()
128128
void DMD::StreamHeader::convertToNetworkByteOrder()
129129
{
130130
// uint8_t and char are not converted, as they are already in network byte order.
131-
mode = static_cast<Mode>(htonl(static_cast<uint32_t>(mode)));
131+
mode = static_cast<Mode>(htonl(static_cast<int>(mode)));
132132
width = htons(width);
133133
height = htons(height);
134134
length = htonl(length);
@@ -1039,7 +1039,7 @@ void DMD::SerumThread()
10391039
if (m_pZeDMD->GetWidth() == 256)
10401040
flags |= FLAG_REQUEST_64P_FRAMES;
10411041
else
1042-
flags = FLAG_REQUEST_32P_FRAMES;
1042+
flags |= FLAG_REQUEST_32P_FRAMES;
10431043
}
10441044

10451045
if (m_rgb24DMDs.size() > 0)
@@ -1055,6 +1055,8 @@ void DMD::SerumThread()
10551055

10561056
if (m_pPixelcadeDMD) flags |= FLAG_REQUEST_32P_FRAMES;
10571057

1058+
// flags |= FLAG_REQUEST_32P_FRAMES;
1059+
10581060
m_pSerum = (name[0] != '\0') ? Serum_Load(m_altColorPath, m_romName, flags) : nullptr;
10591061
if (m_pSerum)
10601062
{

0 commit comments

Comments
 (0)