至少不报错了

This commit is contained in:
Qiuzhizhe 2022-09-30 11:09:55 +08:00
parent 7ee5dfd7b5
commit 1ca4a6f3a5
No known key found for this signature in database
GPG Key ID: 4EF4BF5521540263
5 changed files with 19 additions and 18 deletions

View File

@ -4,7 +4,7 @@
#include "../Global.h"
#define BEFORE_EXTRA
using namespace mce;
using mce::Color;
#undef BEFORE_EXTRA
namespace ColorFormat {

View File

@ -25,7 +25,8 @@ namespace RakNet {
struct SystemAddress {
char filler[17 * 8]; // uncertain?
MCAPI void ToString_New(bool, char, char*);
private:
MCAPI void ToString_New(bool, char, char*) const;
};
struct RakNetGUID {
uint64_t unk;

View File

@ -26,14 +26,14 @@ public:
return id != a1.id;
}
bool isValid(){
return *this != ScoreboardId::INVALID;
return *this != 0xFFFFFFFF;
}
#undef AFTER_EXTRA
#ifndef DISABLE_CONSTRUCTOR_PREVENTION_SCOREBOARDID
public:
struct ScoreboardId& operator=(struct ScoreboardId const &);
// ScoreboardId(struct ScoreboardId const &)= delete;
// ScoreboardId()= delete;
struct ScoreboardId& operator=(struct ScoreboardId const &) = delete;
ScoreboardId(struct ScoreboardId const &)= delete;
//ScoreboardId()= delete;
#endif
public:
#ifdef ENABLE_VIRTUAL_FAKESYMBOL_SCOREBOARDID

View File

@ -139,9 +139,9 @@ public:
LIAPI double deltaE94(mce::Color const& dst) const; // 1.0 for JND
LIAPI double deltaE00(mce::Color const& dst) const; // 1.0 for JND
MCAPI static mce::Color const NIL;
MCAPI static class mce::Color fromHexString(std::string const&);
MCAPI bool operator==(class mce::Color const&) const;
MCAPI static Color const NIL;
MCAPI static class Color fromHexString(std::string const&);
MCAPI bool operator==(class Color const&) const;
MCAPI int toABGR(void) const;
MCAPI int toARGB(void) const;
MCAPI std::string toHexString(void) const;

View File

@ -102,7 +102,7 @@ std::string consoleCodeFromColorCode(std::string const& mcCode) {
return iter->second;
}
mce::Color ColorFromConsoleCode(std::string const& console) {
Color ColorFromConsoleCode(std::string const& console) {
unsigned char decoration = 0;
unsigned char r = 0;
unsigned char g = 0;
@ -110,10 +110,10 @@ mce::Color ColorFromConsoleCode(std::string const& console) {
std::istringstream iss(console);
int c = 0;
if (iss.get() != '\x1b' || iss.get() != '[')
return mce::Color::NIL;
return Color::NIL;
c = __readUnsignedChar(decoration, iss);
if (c == EOF)
return mce::Color::NIL;
return Color::NIL;
if (c == 'm') {
auto codeIter = decorationToColorCodeMap.find(decoration);
if (codeIter != decorationToColorCodeMap.end())
@ -124,19 +124,19 @@ mce::Color ColorFromConsoleCode(std::string const& console) {
unsigned char unk;
c = __readUnsignedChar(unk, iss);
if (c != ';')
return mce::Color::NIL;
return Color::NIL;
c = __readUnsignedChar(r, iss);
if (c != ';')
return mce::Color::NIL;
return Color::NIL;
c = __readUnsignedChar(g, iss);
if (c != ';')
return mce::Color::NIL;
return Color::NIL;
c = __readUnsignedChar(b, iss);
if (c != 'm')
return mce::Color::NIL;
return mce::Color(r, g, b);
return Color::NIL;
return Color(r, g, b);
}
return mce::Color::NIL;
return Color::NIL;
}
std::string nearestColorCodeFromConsoleCode(std::string const& code) {