Commit 592eaf86 authored by mercury233's avatar mercury233

fix texture loadedList

parent ab7b6822
...@@ -381,6 +381,10 @@ public class GameTextureManager ...@@ -381,6 +381,10 @@ public class GameTextureManager
private static void ProcessingCardFeature(PictureResource pic) private static void ProcessingCardFeature(PictureResource pic)
{ {
if (loadedList.ContainsKey(hashPic(pic.code, pic.type)))
{
return;
}
bool EightEdition = false; bool EightEdition = false;
BitmapHelper bitmap = getCloseup(pic); BitmapHelper bitmap = getCloseup(pic);
if (bitmap != null) if (bitmap != null)
...@@ -414,11 +418,8 @@ public class GameTextureManager ...@@ -414,11 +418,8 @@ public class GameTextureManager
} }
caculateK(pic); caculateK(pic);
if (!loadedList.ContainsKey(hashPic(pic.code, pic.type)))
{
loadedList.Add(hashPic(pic.code, pic.type), pic); loadedList.Add(hashPic(pic.code, pic.type), pic);
} }
}
else else
{ {
var data = getPicture(pic, out EightEdition); var data = getPicture(pic, out EightEdition);
...@@ -435,11 +436,8 @@ public class GameTextureManager ...@@ -435,11 +436,8 @@ public class GameTextureManager
pic.hashed_data[w, h, 3] = 0; pic.hashed_data[w, h, 3] = 0;
} }
} }
if (!loadedList.ContainsKey(hashPic(pic.code, pic.type)))
{
loadedList.Add(hashPic(pic.code, pic.type), pic); loadedList.Add(hashPic(pic.code, pic.type), pic);
} }
}
else else
{ {
MemoryStream stream = new MemoryStream(data); MemoryStream stream = new MemoryStream(data);
...@@ -472,13 +470,10 @@ public class GameTextureManager ...@@ -472,13 +470,10 @@ public class GameTextureManager
pic.hashed_data[w, h, 3] = a * 0.7f; pic.hashed_data[w, h, 3] = a * 0.7f;
} }
} }
if (!loadedList.ContainsKey(hashPic(pic.code, pic.type)))
{
loadedList.Add(hashPic(pic.code, pic.type), pic); loadedList.Add(hashPic(pic.code, pic.type), pic);
} }
} }
} }
}
private static void caculateK(PictureResource pic) private static void caculateK(PictureResource pic)
{ {
...@@ -670,6 +665,10 @@ public class GameTextureManager ...@@ -670,6 +665,10 @@ public class GameTextureManager
private static void ProcessingVerticleDrawing(PictureResource pic) private static void ProcessingVerticleDrawing(PictureResource pic)
{ {
if (loadedList.ContainsKey(hashPic(pic.code, pic.type)))
{
return;
}
var bitmap = getCloseup(pic); var bitmap = getCloseup(pic);
if (bitmap == null) if (bitmap == null)
{ {
...@@ -740,11 +739,8 @@ public class GameTextureManager ...@@ -740,11 +739,8 @@ public class GameTextureManager
caculateK(pic); caculateK(pic);
} }
if (!loadedList.ContainsKey(hashPic(pic.code, pic.type)))
{
loadedList.Add(hashPic(pic.code, pic.type), pic); loadedList.Add(hashPic(pic.code, pic.type), pic);
} }
}
private static void softVtype(PictureResource pic, float si) private static void softVtype(PictureResource pic, float si)
{ {
...@@ -798,16 +794,18 @@ public class GameTextureManager ...@@ -798,16 +794,18 @@ public class GameTextureManager
private static void ProcessingCardPicture(PictureResource pic) private static void ProcessingCardPicture(PictureResource pic)
{ {
if (loadedList.ContainsKey(hashPic(pic.code, pic.type)))
{
return;
}
bool EightEdition; bool EightEdition;
var data = getPicture(pic, out EightEdition); var data = getPicture(pic, out EightEdition);
if (data.Length > 0) if (data.Length > 0)
{ {
pic.data = data; pic.data = data;
if (!loadedList.ContainsKey(hashPic(pic.code, pic.type)))
{
loadedList.Add(hashPic(pic.code, pic.type), pic); loadedList.Add(hashPic(pic.code, pic.type), pic);
} }
}
else else
{ {
if (pic.code > 0) if (pic.code > 0)
...@@ -818,12 +816,9 @@ public class GameTextureManager ...@@ -818,12 +816,9 @@ public class GameTextureManager
{ {
pic.u_data = myBack; pic.u_data = myBack;
} }
if (!loadedList.ContainsKey(hashPic(pic.code, pic.type)))
{
loadedList.Add(hashPic(pic.code, pic.type), pic); loadedList.Add(hashPic(pic.code, pic.type), pic);
} }
} }
}
private static UInt64 hashPic(long code, GameTextureType type) private static UInt64 hashPic(long code, GameTextureType type)
{ {
......
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