Commit 5b7ea06f authored by Dark Zane's avatar Dark Zane Committed by GitHub

Merge branch 'fallenstardust:master' into master

parents 10c02aff 5aae994d
...@@ -1396,7 +1396,7 @@ void Game::MainLoop() { ...@@ -1396,7 +1396,7 @@ void Game::MainLoop() {
} }
#endif #endif
while(device->run()) { while(device->run()) {
ALOGV("game draw frame"); //ALOGV("game draw frame");
linePatternD3D = (linePatternD3D + 1) % 30; linePatternD3D = (linePatternD3D + 1) % 30;
linePatternGL = (linePatternGL << 1) | (linePatternGL >> 15); linePatternGL = (linePatternGL << 1) | (linePatternGL >> 15);
atkframe += 0.1f; atkframe += 0.1f;
......
...@@ -3726,6 +3726,7 @@ int32 field::destroy(uint16 step, group * targets, effect * reason_effect, uint3 ...@@ -3726,6 +3726,7 @@ int32 field::destroy(uint16 step, group * targets, effect * reason_effect, uint3
pcard->current.reason_player = pcard->temp.reason_player; pcard->current.reason_player = pcard->temp.reason_player;
core.destroy_canceled.insert(pcard); core.destroy_canceled.insert(pcard);
cit = targets->container.erase(cit); cit = targets->container.erase(cit);
continue;
} }
} }
++cit; ++cit;
......
...@@ -7,21 +7,19 @@ ...@@ -7,21 +7,19 @@
class BufferIO { class BufferIO {
public: public:
inline static int ReadInt32(unsigned char*& p) { inline static int ReadInt32(unsigned char*& p) {
int ret; int ret = *(int*)p;
memcpy(&ret, (void *)p, sizeof(int));
p += 4; p += 4;
return ret; return ret;
} }
inline static short ReadInt16(unsigned char*& p) { inline static short ReadInt16(unsigned char*& p) {
short ret; short ret = *(short*)p;
memcpy(&ret, (void *)p, sizeof(short));
p += 2; p += 2;
return ret; return ret;
} }
inline static char ReadInt8(unsigned char*& p) { inline static char ReadInt8(unsigned char*& p) {
char* pRet = (char*)p; char ret = *(char*)p;
p++; p++;
return *pRet; return ret;
} }
inline static unsigned char ReadUInt8(unsigned char*& p) { inline static unsigned char ReadUInt8(unsigned char*& p) {
unsigned char ret = *(unsigned char*)p; unsigned char ret = *(unsigned char*)p;
...@@ -29,15 +27,15 @@ public: ...@@ -29,15 +27,15 @@ public:
return ret; return ret;
} }
inline static void WriteInt32(unsigned char*& p, int val) { inline static void WriteInt32(unsigned char*& p, int val) {
memcpy((void *)p, &val, sizeof(int)); (*(int*)p) = val;
p += 4; p += 4;
} }
inline static void WriteInt16(unsigned char*& p, short val) { inline static void WriteInt16(unsigned char*& p, short val) {
memcpy((void *)p, &val, sizeof(short)); (*(short*)p) = val;
p += 2; p += 2;
} }
inline static void WriteInt8(unsigned char*& p, char val) { inline static void WriteInt8(unsigned char*& p, char val) {
memcpy((void *)p, &val, sizeof(char)); *p = val;
p++; p++;
} }
template<typename T1, typename T2> template<typename T1, typename T2>
...@@ -61,6 +59,7 @@ public: ...@@ -61,6 +59,7 @@ public:
*pstr = 0; *pstr = 0;
return l; return l;
} }
// UTF-16/UTF-32 to UTF-8
static int EncodeUTF8(const wchar_t * wsrc, char * str) { static int EncodeUTF8(const wchar_t * wsrc, char * str) {
char* pstr = str; char* pstr = str;
while(*wsrc != 0) { while(*wsrc != 0) {
...@@ -71,17 +70,24 @@ public: ...@@ -71,17 +70,24 @@ public:
str[0] = ((*wsrc >> 6) & 0x1f) | 0xc0; str[0] = ((*wsrc >> 6) & 0x1f) | 0xc0;
str[1] = ((*wsrc) & 0x3f) | 0x80; str[1] = ((*wsrc) & 0x3f) | 0x80;
str += 2; str += 2;
} else { } else if(*wsrc < 0x10000 && (*wsrc < 0xd800 || *wsrc > 0xdfff)) {
str[0] = ((*wsrc >> 12) & 0xf) | 0xe0; str[0] = ((*wsrc >> 12) & 0xf) | 0xe0;
str[1] = ((*wsrc >> 6) & 0x3f) | 0x80; str[1] = ((*wsrc >> 6) & 0x3f) | 0x80;
str[2] = ((*wsrc) & 0x3f) | 0x80; str[2] = ((*wsrc) & 0x3f) | 0x80;
str += 3; str += 3;
} else {
str[0] = ((*wsrc >> 18) & 0x7) | 0xf0;
str[1] = ((*wsrc >> 12) & 0x3f) | 0x80;
str[2] = ((*wsrc >> 6) & 0x3f) | 0x80;
str[3] = ((*wsrc) & 0x3f) | 0x80;
str += 4;
} }
wsrc++; wsrc++;
} }
*str = 0; *str = 0;
return str - pstr; return str - pstr;
} }
// UTF-8 to UTF-16/UTF-32
static int DecodeUTF8(const char * src, wchar_t * wstr) { static int DecodeUTF8(const char * src, wchar_t * wstr) {
const char* p = src; const char* p = src;
wchar_t* wp = wstr; wchar_t* wp = wstr;
...@@ -90,13 +96,13 @@ public: ...@@ -90,13 +96,13 @@ public:
*wp = *p; *wp = *p;
p++; p++;
} else if((*p & 0xe0) == 0xc0) { } else if((*p & 0xe0) == 0xc0) {
*wp = (((int)p[0] & 0x1f) << 6) | ((int)p[1] & 0x3f); *wp = (((unsigned)p[0] & 0x1f) << 6) | ((unsigned)p[1] & 0x3f);
p += 2; p += 2;
} else if((*p & 0xf0) == 0xe0) { } else if((*p & 0xf0) == 0xe0) {
*wp = (((int)p[0] & 0xf) << 12) | (((int)p[1] & 0x3f) << 6) | ((int)p[2] & 0x3f); *wp = (((unsigned)p[0] & 0xf) << 12) | (((unsigned)p[1] & 0x3f) << 6) | ((unsigned)p[2] & 0x3f);
p += 3; p += 3;
} else if((*p & 0xf8) == 0xf0) { } else if((*p & 0xf8) == 0xf0) {
*wp = (((int)p[0] & 0x7) << 18) | (((int)p[1] & 0x3f) << 12) | (((int)p[2] & 0x3f) << 6) | ((int)p[3] & 0x3f); *wp = (((unsigned)p[0] & 0x7) << 18) | (((unsigned)p[1] & 0x3f) << 12) | (((unsigned)p[2] & 0x3f) << 6) | ((unsigned)p[3] & 0x3f);
p += 4; p += 4;
} else } else
p++; p++;
......
#[2024.1][2024.1 TCG][2023.10][2023.7][2023.4][2023.1][2022.10][2022.7][2022.4][2022.1][2021.10][2021.7][2021.4][2021.1][2020.10][2020.7][2020.4][2020.1][2019.10][2019.7][2019.4][2019.1][2018.10][2018.7][2018.4][2018.1][2017.10][2017.7][2017.4][2017.1][2016.10][2016.7][2016.4][2016.1][2015.10][2015.4][2015.1][2014.10][2014.7][2014.4][2014.2][2013.9][2023.9 TCG][2023.6 TCG][2023.2 TCG][2022.12 TCG][2022.10 TCG][2022.5 TCG][2022.2 TCG][2021.10 TCG][2021.7 TCG][2021.3 TCG][2020.12 TCG][2020.9 TCG][2020.6 TCG][2020.4 TCG][2020.1 TCG][2019.10 TCG][2019.7 TCG][2019.4 TCG][2019.1 TCG][2018.12 TCG][2018.9 TCG][2018.5 TCG][2018.2 TCG][2017.11 TCG][2017.9 TCG][2017.6 TCG][2017.3 TCG][2016.8 TCG][2016.4 TCG][2015.11 TCG][2015.7 TCG][2015.4 TCG][2015.1 TCG][2014.10 TCG][2014.7 TCG][2014.4 TCG][2014.1.1 TCG][2013.10.11 TCG][2013.3.1][2012.9.1][2012.3.1][2011.9.1] #[2024.1][2024.1 TCG][2023.10][2023.7][2023.4][2023.1][2022.10][2022.7][2022.4][2022.1][2021.10][2021.7][2021.4][2021.1][2020.10][2020.7][2020.4][2020.1][2019.10][2019.7][2019.4][2019.1][2018.10][2018.7][2018.4][2018.1][2017.10][2017.7][2017.4][2017.1][2016.10][2016.7][2016.4][2016.1][2015.10][2015.4][2015.1][2014.10][2014.7][2014.4][2014.2][2013.9][2023.9 TCG][2023.6 TCG][2023.2 TCG][2022.12 TCG][2022.10 TCG][2022.5 TCG][2022.2 TCG][2021.10 TCG][2021.7 TCG][2021.3 TCG][2020.12 TCG][2020.9 TCG][2020.6 TCG][2020.4 TCG][2020.1 TCG][2019.10 TCG][2019.7 TCG][2019.4 TCG][2019.1 TCG][2018.12 TCG][2018.9 TCG][2018.5 TCG][2018.2 TCG][2017.11 TCG][2017.9 TCG][2017.6 TCG][2017.3 TCG][2016.8 TCG][2016.4 TCG][2015.11 TCG][2015.7 TCG][2015.4 TCG][2015.1 TCG][2014.10 TCG][2014.7 TCG][2014.4 TCG][2014.1.1 TCG][2013.10.11 TCG][2013.3.1][2012.9.1][2012.3.1][2011.9.1]
!2024.1 !2024.1
#forbidden #forbidden
91869203 0 --アマゾネスの射手 91869203 0 --アマゾネスの射手
...@@ -344,7 +343,7 @@ ...@@ -344,7 +343,7 @@
65536818 1 --Denglong, First of the Yang Zing 65536818 1 --Denglong, First of the Yang Zing
94677445 1 --Ib the World Chalice Justiciar 94677445 1 --Ib the World Chalice Justiciar
74586817 1 --PSY-Framelord Omega 74586817 1 --PSY-Framelord Omega
39880350 1 --Sunavalon Dryas 93896655 1 --Sunavalon Dryas
65563871 1 --Sunvine Healer 65563871 1 --Sunvine Healer
90953320 1 --T.G. Hyper Librarian 90953320 1 --T.G. Hyper Librarian
27552504 1 --Beatrice, Lady of the Eternal 27552504 1 --Beatrice, Lady of the Eternal
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment