fix a real error (m68kdasm) and some harmless performance warnings and use modern headers

This commit is contained in:
toxieainc 2022-07-11 18:10:41 +02:00
parent e0053b3a46
commit 4961951a89
25 changed files with 81 additions and 119 deletions

View file

@ -251,8 +251,8 @@ static const char* g_cpcc[64] =
{/* 000 001 010 011 100 101 110 111 */ {/* 000 001 010 011 100 101 110 111 */
"f", "eq", "ogt", "oge", "olt", "ole", "ogl", "or", /* 000 */ "f", "eq", "ogt", "oge", "olt", "ole", "ogl", "or", /* 000 */
"un", "ueq", "ugt", "uge", "ult", "ule", "ne", "t", /* 001 */ "un", "ueq", "ugt", "uge", "ult", "ule", "ne", "t", /* 001 */
"sf", "seq", "gt", "ge", "lt", "le", "gl" "gle", /* 010 */ "sf", "seq", "gt", "ge", "lt", "le", "gl", "gle", /* 010 */
"ngle", "ngl", "nle", "nlt", "nge", "ngt", "sne", "st", /* 011 */ "ngle", "ngl", "nle", "nlt", "nge", "ngt", "sne","st", /* 011 */
"?", "?", "?", "?", "?", "?", "?", "?", /* 100 */ "?", "?", "?", "?", "?", "?", "?", "?", /* 100 */
"?", "?", "?", "?", "?", "?", "?", "?", /* 101 */ "?", "?", "?", "?", "?", "?", "?", "?", /* 101 */
"?", "?", "?", "?", "?", "?", "?", "?", /* 110 */ "?", "?", "?", "?", "?", "?", "?", "?", /* 110 */

View file

@ -20,7 +20,7 @@ bool GameLoader::LoadZipArchive(ZipArchive *zip, const std::string &zipfilename)
zip->zfs.push_back(zf); zip->zfs.push_back(zf);
// Identify all files in zip archive // Identify all files in zip archive
int err = UNZ_OK; int err;
for (err = unzGoToFirstFile(zf); err == UNZ_OK; err = unzGoToNextFile(zf)) for (err = unzGoToFirstFile(zf); err == UNZ_OK; err = unzGoToNextFile(zf))
{ {
unz_file_info file_info; unz_file_info file_info;
@ -193,11 +193,11 @@ static void PopulateGameInfo(Game *game, const Util::Config::Node &game_node)
game->name = game_node["name"].ValueAs<std::string>(); game->name = game_node["name"].ValueAs<std::string>();
game->parent = game_node["parent"].ValueAsDefault<std::string>(std::string()); game->parent = game_node["parent"].ValueAsDefault<std::string>(std::string());
game->title = game_node["identity/title"].ValueAsDefault<std::string>("Unknown"); game->title = game_node["identity/title"].ValueAsDefault<std::string>("Unknown");
game->version = game_node["identity/version"].ValueAsDefault<std::string>(""); game->version = game_node["identity/version"].ValueAsDefault<std::string>(std::string());
game->manufacturer = game_node["identity/manufacturer"].ValueAsDefault<std::string>("Unknown"); game->manufacturer = game_node["identity/manufacturer"].ValueAsDefault<std::string>("Unknown");
game->year = game_node["identity/year"].ValueAsDefault<unsigned>(0); game->year = game_node["identity/year"].ValueAsDefault<unsigned>(0);
game->stepping = game_node["hardware/stepping"].ValueAsDefault<std::string>(""); game->stepping = game_node["hardware/stepping"].ValueAsDefault<std::string>(std::string());
game->mpeg_board = game_node["hardware/mpeg_board"].ValueAsDefault<std::string>(""); game->mpeg_board = game_node["hardware/mpeg_board"].ValueAsDefault<std::string>(std::string());
std::map<std::string, Game::AudioTypes> audio_types std::map<std::string, Game::AudioTypes> audio_types
{ {
{ "", Game::STEREO_LR }, // default to stereo { "", Game::STEREO_LR }, // default to stereo
@ -212,7 +212,7 @@ static void PopulateGameInfo(Game *game, const Util::Config::Node &game_node)
}; };
std::string audio_type = game_node["hardware/audio"].ValueAsDefault<std::string>(std::string()); std::string audio_type = game_node["hardware/audio"].ValueAsDefault<std::string>(std::string());
game->audio = audio_types[audio_type]; game->audio = audio_types[audio_type];
game->pci_bridge = game_node["hardware/pci_bridge"].ValueAsDefault<std::string>(""); game->pci_bridge = game_node["hardware/pci_bridge"].ValueAsDefault<std::string>(std::string());
game->real3d_pci_id = game_node["hardware/real3d_pci_id"].ValueAsDefault<uint32_t>(0); game->real3d_pci_id = game_node["hardware/real3d_pci_id"].ValueAsDefault<uint32_t>(0);
game->real3d_status_bit_set_percent_of_frame = game_node["hardware/real3d_status_bit_set_percent_of_frame"].ValueAsDefault<float>(0); game->real3d_status_bit_set_percent_of_frame = game_node["hardware/real3d_status_bit_set_percent_of_frame"].ValueAsDefault<float>(0);
game->encryption_key = game_node["hardware/encryption_key"].ValueAsDefault<uint32_t>(0); game->encryption_key = game_node["hardware/encryption_key"].ValueAsDefault<uint32_t>(0);
@ -849,7 +849,7 @@ std::string StripFilename(const std::string &filepath)
// If none found, there is directory component here // If none found, there is directory component here
if (last_slash == std::string::npos) if (last_slash == std::string::npos)
return ""; return std::string();
// Otherwise, strip everything after the slash // Otherwise, strip everything after the slash
return std::string(filepath, 0, last_slash + 1); return std::string(filepath, 0, last_slash + 1);

View file

@ -1,5 +1,5 @@
#include "GLSLShader.h" #include "GLSLShader.h"
#include <stdio.h> #include <cstdio>
GLSLShader::GLSLShader() { GLSLShader::GLSLShader() {
@ -107,6 +107,3 @@ int GLSLShader::GetAttributeLocation(const char *str)
{ {
return glGetAttribLocation(m_program, str); return glGetAttribLocation(m_program, str);
} }

View file

@ -3,9 +3,8 @@
#include <vector> #include <vector>
#include <unordered_map> #include <unordered_map>
#include <map>
#include <memory> #include <memory>
#include <string.h> #include <cstring>
#include "Texture.h" #include "Texture.h"
#include "Mat4.h" #include "Mat4.h"
@ -32,24 +31,19 @@ struct Vertex // half vertex
static bool Equal(const Vertex& p1, const Vertex& p2) static bool Equal(const Vertex& p1, const Vertex& p2)
{ {
if (p1.pos[0] == p2.pos[0] && return (p1.pos[0] == p2.pos[0] &&
p1.pos[1] == p2.pos[1] && p1.pos[1] == p2.pos[1] &&
p1.pos[2] == p2.pos[2]) p1.pos[2] == p2.pos[2]);
{
return true;
}
return false;
} }
static void Average(const Vertex& p1, const Vertex& p2, Vertex& p3) static void Average(const Vertex& p1, const Vertex& p2, Vertex& p3)
{ {
p3.pos[3] = 1.0f; //always 1 p3.pos[3] = 1.0f; //always 1
p3.fixedShade = (p1.fixedShade + p2.fixedShade) / 2.0f; p3.fixedShade = (p1.fixedShade + p2.fixedShade) * 0.5f;
for (int i = 0; i < 3; i++) { p3.pos[i] = (p1.pos[i] + p2.pos[i]) / 2.0f; } for (int i = 0; i < 3; i++) { p3.pos[i] = (p1.pos[i] + p2.pos[i]) * 0.5f; }
for (int i = 0; i < 3; i++) { p3.normal[i] = (p1.normal[i] + p2.normal[i]) / 2.0f; } for (int i = 0; i < 3; i++) { p3.normal[i] = (p1.normal[i] + p2.normal[i]) * 0.5f; }
for (int i = 0; i < 2; i++) { p3.texcoords[i] = (p1.texcoords[i] + p2.texcoords[i]) / 2.0f; } for (int i = 0; i < 2; i++) { p3.texcoords[i] = (p1.texcoords[i] + p2.texcoords[i]) * 0.5f; }
} }
}; };

View file

@ -117,7 +117,7 @@ int PolyHeader::NumVerts()
int PolyHeader::NumSharedVerts() int PolyHeader::NumSharedVerts()
{ {
int sharedVerts[] = { 0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4 }; static const int sharedVerts[] = { 0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4 };
return sharedVerts[header[0] & 0xf]; return sharedVerts[header[0] & 0xf];
} }
@ -135,9 +135,9 @@ bool PolyHeader::SharedVertex(int vertex)
void PolyHeader::FaceNormal(float n[3]) void PolyHeader::FaceNormal(float n[3])
{ {
n[0] = (float)(((INT32)header[1]) >> 8) * (1.0f / 4194304.0f); n[0] = (float)(((INT32)header[1]) >> 8) * (float)(1.0 / 4194304.0);
n[1] = (float)(((INT32)header[2]) >> 8) * (1.0f / 4194304.0f); n[1] = (float)(((INT32)header[2]) >> 8) * (float)(1.0 / 4194304.0);
n[2] = (float)(((INT32)header[3]) >> 8) * (1.0f / 4194304.0f); n[2] = (float)(((INT32)header[3]) >> 8) * (float)(1.0 / 4194304.0);
} }
float PolyHeader::UVScale() float PolyHeader::UVScale()

View file

@ -43,7 +43,7 @@ void main()
position = spotEllipse.xy; position = spotEllipse.xy;
size = spotEllipse.zw; size = spotEllipse.zw;
ellipse = length((gl_FragCoord.xy - position) / size); ellipse = length((gl_FragCoord.xy - position) / size);
ellipse = pow(ellipse, 2.0); // decay rate = square of distance from center ellipse = ellipse * ellipse; // decay rate = square of distance from center
ellipse = 1.0 - ellipse; // invert ellipse = 1.0 - ellipse; // invert
ellipse = max(0.0, ellipse); // clamp ellipse = max(0.0, ellipse); // clamp

View file

@ -134,6 +134,7 @@ GLint R3DShader::GetVertexAttribPos(const std::string& attrib)
if (m_vertexLocCache.count(attrib)==0) { if (m_vertexLocCache.count(attrib)==0) {
auto pos = glGetAttribLocation(m_shaderProgram, attrib.c_str()); auto pos = glGetAttribLocation(m_shaderProgram, attrib.c_str());
m_vertexLocCache[attrib] = pos; m_vertexLocCache[attrib] = pos;
return pos;
} }
return m_vertexLocCache[attrib]; return m_vertexLocCache[attrib];

View file

@ -4,7 +4,7 @@
#include <GL/glew.h> #include <GL/glew.h>
#include "Util/NewConfig.h" #include "Util/NewConfig.h"
#include "Model.h" #include "Model.h"
#include <map> #include <unordered_map>
#include <string> #include <string>
namespace New3D { namespace New3D {
@ -109,7 +109,7 @@ private:
GLint m_locDiscardAlpha; GLint m_locDiscardAlpha;
// vertex attribute position cache // vertex attribute position cache
std::map<std::string, GLint> m_vertexLocCache; std::unordered_map<std::string, GLint> m_vertexLocCache;
}; };

View file

@ -4,7 +4,7 @@ namespace New3D {
TextureSheet::TextureSheet() TextureSheet::TextureSheet()
{ {
m_temp.resize(1024 * 1024 * 4); // temporay buffer for textures m_temp.resize(1024 * 1024 * 4); // temporary buffer for textures
} }
int TextureSheet::ToIndex(int x, int y) int TextureSheet::ToIndex(int x, int y)

View file

@ -1,33 +1,9 @@
#include "Vec.h" #include "Vec.h"
#include <cmath> #include <cmath>
#include <algorithm>
namespace New3D { namespace New3D {
static float fastSqrt(float number) {
long i;
float x, y;
const float f = 1.5F;
x = number * 0.5F;
y = number;
i = * ( long * ) &y;
i = 0x5f375a86 - ( i >> 1 );
y = * ( float * ) &i;
y = y * ( f - ( x * y * y ) );
y = y * ( f - ( x * y * y ) );
return number * y;
}
static float fastInvSqrt(float x)
{
float xhalf = 0.5f*x;
int i = *(int*)&x; // get bits for floating value
i = 0x5f375a86- (i>>1); // gives initial guess y0
x = *(float*)&i; // convert bits back to float
x = x*(1.5f-xhalf*x*x); // Newton step, repeating increases accuracy
return x;
}
void V3::subtract(const Vec3 a, const Vec3 b, Vec3 out) { void V3::subtract(const Vec3 a, const Vec3 b, Vec3 out) {
out[0] = a[0] - b[0]; out[0] = a[0] - b[0];
@ -58,7 +34,7 @@ void V3::add(Vec3 a, const Vec3 b) {
void V3::divide(Vec3 a, float number) { void V3::divide(Vec3 a, float number) {
multiply(a,1/number); multiply(a,1.f/number);
} }
void V3::multiply(Vec3 a, float number) { void V3::multiply(Vec3 a, float number) {
@ -123,13 +99,13 @@ float V3::length(const Vec3 v) {
void V3::normalise(Vec3 v) { void V3::normalise(Vec3 v) {
//======== //========
float len; float inv_len;
//======== //========
len = v[0]*v[0] + v[1]*v[1] + v[2]*v[2]; inv_len = v[0]*v[0] + v[1]*v[1] + v[2]*v[2];
len = fastInvSqrt(len); inv_len = 1.f/std::sqrt(inv_len);
multiply(v,len); multiply(v,inv_len);
} }
void V3::multiplyAdd(const Vec3 a, float scale, const Vec3 b, Vec3 out) { void V3::multiplyAdd(const Vec3 a, float scale, const Vec3 b, Vec3 out) {
@ -141,9 +117,9 @@ void V3::multiplyAdd(const Vec3 a, float scale, const Vec3 b, Vec3 out) {
void V3::reset(Vec3 v) { void V3::reset(Vec3 v) {
v[0] = 0; v[0] = 0.f;
v[1] = 0; v[1] = 0.f;
v[2] = 0; v[2] = 0.f;
} }
void V3::set(Vec3 v, float value) { void V3::set(Vec3 v, float value) {
@ -171,7 +147,7 @@ void V3::reflect(const Vec3 a, const Vec3 b, Vec3 out) {
V3::copy(a,v); V3::copy(a,v);
temp = V3::dotProduct(a,b) * 2; temp = V3::dotProduct(a,b) * 2.f;
V3::multiply(v,temp); V3::multiply(v,temp);
V3::subtract(b,v,out); V3::subtract(b,v,out);
@ -191,16 +167,16 @@ void V3::createNormal(const Vec3 a, const Vec3 b, const Vec3 c, Vec3 outNormal)
void V3::_max(Vec3 a, const Vec3 compare) { void V3::_max(Vec3 a, const Vec3 compare) {
if(a[0] < compare[0]) a[0] = compare[0]; a[0] = std::max(compare[0], a[0]);
if(a[1] < compare[1]) a[1] = compare[1]; a[1] = std::max(compare[1], a[1]);
if(a[2] < compare[2]) a[2] = compare[2]; a[2] = std::max(compare[2], a[2]);
} }
void V3::_min(Vec3 a, const Vec3 compare) { void V3::_min(Vec3 a, const Vec3 compare) {
if(a[0] > compare[0]) a[0] = compare[0]; a[0] = std::min(compare[0], a[0]);
if(a[1] > compare[1]) a[1] = compare[1]; a[1] = std::min(compare[1], a[1]);
if(a[2] > compare[2]) a[2] = compare[2]; a[2] = std::min(compare[2], a[2]);
} }
bool V3::cmp(const Vec3 a, float b) { bool V3::cmp(const Vec3 a, float b) {
@ -223,14 +199,9 @@ bool V3::cmp(const Vec3 a, const Vec3 b) {
void V3::clamp(Vec3 a, float _min, float _max) { void V3::clamp(Vec3 a, float _min, float _max) {
if(a[0] < _min) a[0] = _min; a[0] = std::min(std::max(_min, a[0]), _max);
if(a[0] > _max) a[0] = _max; a[1] = std::min(std::max(_min, a[1]), _max);
a[2] = std::min(std::max(_min, a[2]), _max);
if(a[1] < _min) a[1] = _min;
if(a[1] > _max) a[1] = _max;
if(a[2] < _min) a[2] = _min;
if(a[2] > _max) a[2] = _max;
} }
} // New3D } // New3D

View file

@ -724,7 +724,7 @@ void CInputSystem::CheckKeySources(int kbdNum, bool fullAxisOnly, vector<CInputS
find(badSources.begin(), badSources.end(), source) == badSources.end()) find(badSources.begin(), badSources.end(), source) == badSources.end())
{ {
// Update mapping string and add source to list // Update mapping string and add source to list
if (sources.size() == 0) if (sources.empty())
mapping.assign("KEY"); mapping.assign("KEY");
else else
mapping.append("+KEY"); mapping.append("+KEY");
@ -758,7 +758,7 @@ void CInputSystem::CheckMouseSources(int mseNum, bool fullAxisOnly, bool mseCent
{ {
// Otherwise, update mapping string and add source to list // Otherwise, update mapping string and add source to list
const char *partName = LookupName(msePart); const char *partName = LookupName(msePart);
if (sources.size() == 0) if (sources.empty())
mapping.assign("MOUSE"); mapping.assign("MOUSE");
else else
mapping.append("+MOUSE"); mapping.append("+MOUSE");
@ -787,7 +787,7 @@ void CInputSystem::CheckJoySources(int joyNum, bool fullAxisOnly, vector<CInputS
{ {
// Otherwise, update mapping string and add source to list // Otherwise, update mapping string and add source to list
const char *partName = LookupName(joyPart); const char *partName = LookupName(joyPart);
if (sources.size() == 0) if (sources.empty())
mapping.assign("JOY"); mapping.assign("JOY");
else else
mapping.append("+JOY"); mapping.append("+JOY");
@ -800,7 +800,7 @@ void CInputSystem::CheckJoySources(int joyNum, bool fullAxisOnly, vector<CInputS
} }
} }
bool CInputSystem::ParseInt(string str, int &num) bool CInputSystem::ParseInt(const string& str, int &num)
{ {
stringstream ss(str); stringstream ss(str);
return !(ss >> num).fail(); return !(ss >> num).fail();
@ -813,7 +813,7 @@ string CInputSystem::IntToString(int num)
return ss.str(); return ss.str();
} }
bool CInputSystem::EqualsIgnoreCase(string str1, const char *str2) bool CInputSystem::EqualsIgnoreCase(const string& str1, const char *str2)
{ {
for (string::const_iterator ci = str1.begin(); ci < str1.end(); ++ci) for (string::const_iterator ci = str1.begin(); ci < str1.end(); ++ci)
{ {
@ -824,7 +824,7 @@ bool CInputSystem::EqualsIgnoreCase(string str1, const char *str2)
return *str2 == '\0'; return *str2 == '\0';
} }
bool CInputSystem::StartsWithIgnoreCase(string str1, const char *str2) bool CInputSystem::StartsWithIgnoreCase(const string& str1, const char *str2)
{ {
for (string::const_iterator ci = str1.begin(); ci < str1.end(); ++ci) for (string::const_iterator ci = str1.begin(); ci < str1.end(); ++ci)
{ {
@ -1023,7 +1023,7 @@ CInputSource *CInputSystem::ParseSingleSource(string str)
if (rightSource != NULL) if (rightSource != NULL)
sources.push_back(rightSource); sources.push_back(rightSource);
} }
if (sources.size() > 0) if (!sources.empty())
return new CMultiInputSource(true, sources); return new CMultiInputSource(true, sources);
} }
return m_emptySource; return m_emptySource;
@ -1772,7 +1772,7 @@ bool CInputSystem::ReadMapping(char *buffer, unsigned bufSize, bool fullAxisOnly
CheckAllSources(readFlags, fullAxisOnly, mseCentered, sources, mapping, badSources); CheckAllSources(readFlags, fullAxisOnly, mseCentered, sources, mapping, badSources);
// When some inputs have been activated, keep looping until they have all been released again. // When some inputs have been activated, keep looping until they have all been released again.
if (sources.size() > 0) if (!sources.empty())
{ {
// Check each source is no longer active // Check each source is no longer active
bool active = false; bool active = false;

View file

@ -420,13 +420,13 @@ private:
*/ */
void CheckJoySources(int joyNum, bool fullAxisOnly, std::vector<CInputSource*> &sources, std::string &mapping, std::vector<CInputSource*> &badSources); void CheckJoySources(int joyNum, bool fullAxisOnly, std::vector<CInputSource*> &sources, std::string &mapping, std::vector<CInputSource*> &badSources);
bool ParseInt(std::string str, int &num); bool ParseInt(const std::string& str, int &num);
std::string IntToString(int num); std::string IntToString(int num);
bool EqualsIgnoreCase(std::string str1, const char *str2); bool EqualsIgnoreCase(const std::string& str1, const char *str2);
bool StartsWithIgnoreCase(std::string str1, const char *str2); bool StartsWithIgnoreCase(const std::string& str1, const char *str2);
/* /*
* Returns true if the given string represents a valid key name. * Returns true if the given string represents a valid key name.

View file

@ -36,7 +36,7 @@ using namespace std;
ESourceType CMultiInputSource::GetCombinedType(vector<CInputSource*> &sources) ESourceType CMultiInputSource::GetCombinedType(vector<CInputSource*> &sources)
{ {
// Check if vector is empty // Check if vector is empty
if (sources.size() == 0) if (sources.empty())
return SourceEmpty; return SourceEmpty;
// Otherwise, see whether all sources are switches, or if have a full- or half-axis present // Otherwise, see whether all sources are switches, or if have a full- or half-axis present
bool allSwitches = true; bool allSwitches = true;

View file

@ -29,10 +29,10 @@
* be decoded incorrectly. * be decoded incorrectly.
*/ */
#include <stdio.h> #include <cstdio>
#include <string.h> #include <cstring>
#ifdef STANDALONE #ifdef STANDALONE
#include <stdlib.h> #include <cstdlib>
#endif #endif
#include "Types.h" #include "Types.h"

View file

@ -33,7 +33,7 @@
#include "93C46.h" #include "93C46.h"
#include <string.h> #include <cstring>
#include "Supermodel.h" #include "Supermodel.h"

View file

@ -143,7 +143,7 @@ int CDSBResampler::UpSampleAndMix(INT16 *outL, INT16 *outR, INT16 *inL, INT16 *i
int outIdx = 0; int outIdx = 0;
int inIdx = 0; int inIdx = 0;
INT32 leftSample, rightSample, leftSoundSample, rightSoundSample; INT32 leftSample, rightSample, leftSoundSample, rightSoundSample;
INT32 v[2], musicVol, soundVol; INT32 v[2], musicVol;
// Obtain program volume settings and convert to 24.8 fixed point (0-200 -> 0x00-0x200) // Obtain program volume settings and convert to 24.8 fixed point (0-200 -> 0x00-0x200)
musicVol = m_config["MusicVolume"].ValueAs<int>(); musicVol = m_config["MusicVolume"].ValueAs<int>();

View file

@ -1144,7 +1144,7 @@ UINT16 CModel3::Read16(UINT32 addr)
#ifdef NET_BOARD #ifdef NET_BOARD
case 0xc0: // spikeout call this case 0xc0: // spikeout call this
// interresting : poking @4 master to same value as slave (0x100) or simply !=0 -> connected and go in game, but freeze (prints comm error) as soon as players appear after the gate // interesting : poking @4 master to same value as slave (0x100) or simply !=0 -> connected and go in game, but freeze (prints comm error) as soon as players appear after the gate
// sort of sync ack ? who writes this 16b value ? // sort of sync ack ? who writes this 16b value ?
{ {
UINT16 result; UINT16 result;

View file

@ -809,7 +809,7 @@ uint32_t CReal3D::ReadRegister(unsigned reg)
int index = (reg - 20) / 4; int index = (reg - 20) / 4;
float val = Render3D->GetLosValue(index); float val = Render3D->GetLosValue(index);
if (val) { if (val != 0.f) {
//val = 1.0f / val; // test program indicate z values are 1 over //val = 1.0f / val; // test program indicate z values are 1 over
return 0xffffffff; // infinity return 0xffffffff; // infinity
} }
@ -922,7 +922,6 @@ uint32_t CReal3D::GetASICIDCode(ASIC asic) const
} }
void CReal3D::SetStepping(int stepping, uint32_t pciIDValue) void CReal3D::SetStepping(int stepping, uint32_t pciIDValue)
{ {
step = stepping; step = stepping;
if ((step!=0x10) && (step!=0x15) && (step!=0x20) && (step!=0x21)) if ((step!=0x10) && (step!=0x15) && (step!=0x20) && (step!=0x21))

View file

@ -36,7 +36,7 @@
#include "Util/NewConfig.h" #include "Util/NewConfig.h"
#include <cstdint> #include <cstdint>
#include <map> #include <unordered_map>
/* /*
* QueuedUploadTextures: * QueuedUploadTextures:
@ -505,7 +505,7 @@ private:
bool m_evenFrame = false; bool m_evenFrame = false;
// Internal ASIC state // Internal ASIC state
std::map<ASIC, uint32_t> m_asicID; std::unordered_map<ASIC, uint32_t> m_asicID;
uint64_t m_internalRenderConfig[2]; uint64_t m_internalRenderConfig[2];
}; };

View file

@ -104,7 +104,7 @@ private:
// netsock // netsock
UINT16 port_in = 0; UINT16 port_in = 0;
UINT16 port_out = 0; UINT16 port_out = 0;
std::string addr_out = ""; std::string addr_out;
std::unique_ptr<TCPSend> nets; std::unique_ptr<TCPSend> nets;
std::unique_ptr<TCPReceive> netr; std::unique_ptr<TCPReceive> netr;

View file

@ -85,7 +85,7 @@ private:
// netsock // netsock
uint16_t port_in = 0; uint16_t port_in = 0;
uint16_t port_out = 0; uint16_t port_out = 0;
std::string addr_out = ""; std::string addr_out;
std::thread m_connectThread; std::thread m_connectThread;
std::atomic_bool m_quit = false; std::atomic_bool m_quit = false;
std::atomic_bool m_connected = false; std::atomic_bool m_connected = false;

View file

@ -60,7 +60,7 @@ bool TCPSend::Send(const void * data, int length)
DPRINTF("Sending %i bytes\n", length); DPRINTF("Sending %i bytes\n", length);
int sent = 0; int sent;
sent = SDLNet_TCP_Send(m_socket, &length, sizeof(int)); // pack the length at the start of transmission. sent = SDLNet_TCP_Send(m_socket, &length, sizeof(int)); // pack the length at the start of transmission.

View file

@ -112,7 +112,7 @@ std::shared_ptr<CLogger> CreateLogger(const Util::Config::Node &config)
loggers.push_back(std::make_shared<CConsoleErrorLogger>()); loggers.push_back(std::make_shared<CConsoleErrorLogger>());
// Parse other log outputs // Parse other log outputs
std::string logOutputs = config["LogOutput"].ValueAsDefault<std::string>(""); std::string logOutputs = config["LogOutput"].ValueAsDefault<std::string>(std::string());
std::vector<std::string> outputs = Util::Format(logOutputs).Split(','); std::vector<std::string> outputs = Util::Format(logOutputs).Split(',');
std::set<std::string> supportedDestinations { "stdout", "stderr", "syslog" }; std::set<std::string> supportedDestinations { "stdout", "stderr", "syslog" };

View file

@ -1444,7 +1444,7 @@ HRESULT CDirectInputSystem::CreateJoystickEffect(LPDIRECTINPUTDEVICE8 joystick,
DICONSTANTFORCE dicf; DICONSTANTFORCE dicf;
DICONDITION dic; DICONDITION dic;
DIPERIODIC dip; DIPERIODIC dip;
DIENVELOPE die; //DIENVELOPE die;
GUID guid; GUID guid;
// Set common effects parameters // Set common effects parameters
@ -1883,7 +1883,7 @@ bool CDirectInputSystem::ProcessForceFeedbackCmd(int joyNum, int axisNum, ForceF
DICONSTANTFORCE dicf; DICONSTANTFORCE dicf;
DICONDITION dic; DICONDITION dic;
DIPERIODIC dip; DIPERIODIC dip;
DIENVELOPE die; //DIENVELOPE die;
// Set common parameters // Set common parameters
DIEFFECT eff; DIEFFECT eff;

View file

@ -276,7 +276,7 @@ namespace Util
std::string BitRegister::ToBinaryString() const std::string BitRegister::ToBinaryString() const
{ {
if (Empty()) if (Empty())
return std::string(""); return std::string();
std::string out(Size(), '0'); std::string out(Size(), '0');
for (size_t i = 0; i < Size(); i++) for (size_t i = 0; i < Size(); i++)
{ {
@ -287,9 +287,9 @@ namespace Util
std::string BitRegister::ToHexString() const std::string BitRegister::ToHexString() const
{ {
const char digits[] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' }; static const char digits[] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' };
if (Empty()) if (Empty())
return std::string(""); return std::string();
size_t partial = Size() & 3; size_t partial = Size() & 3;
size_t num_digits = Size() / 4 + (partial != 0 ? 1 : 0); size_t num_digits = Size() / 4 + (partial != 0 ? 1 : 0);
std::string out(num_digits + 2, '0'); std::string out(num_digits + 2, '0');