• R/O
  • SSH
  • HTTPS

wheretrainbuild: Commit


Commit MetaInfo

Revision54 (tree)
Zeit2020-07-10 11:32:46
Autordangerouswoo

Log Message

(empty log message)

Ändern Zusammenfassung

Diff

--- WhereTrainBuild/AI/LineWalker.cs (revision 53)
+++ WhereTrainBuild/AI/LineWalker.cs (revision 54)
@@ -61,7 +61,7 @@
6161 /// </summary>
6262 public LineWalker(MapTitleManager maptilemanager)
6363 {
64- MaxWalking = 10000;
64+ MaxWalking = 90000;
6565 m_maptilemanager = maptilemanager;
6666 }
6767
@@ -481,17 +481,20 @@
481481 else
482482 maptile = m_cache[MapTile.MakeKey(iTileX, iTileY, m_zoom)];
483483
484- var image = maptile.GetImage() as Bitmap;
485- if (image == null)
484+ lock (maptile)
486485 {
487- image = maptile.GetImage(m_maptilemanager.BaseFolder, m_maptilemanager.Timeout) as Bitmap;
486+ var image = maptile.GetImage() as Bitmap;
487+ if (image == null)
488+ {
489+ image = maptile.GetImage(m_maptilemanager.BaseFolder, m_maptilemanager.Timeout) as Bitmap;
490+ }
491+ if (image == null)
492+ {
493+ return (Result: false, next: pnt);
494+ }
495+ //画像取得
496+ color = image.GetPixel((int)x, (int)y);
488497 }
489- if (image == null)
490- {
491- return (Result: false, next: pnt);
492- }
493- //画像取得
494- color = image.GetPixel((int)x, (int)y);
495498 }
496499
497500 //判定
--- WhereTrainBuild/MapUtil/MapTitleManager.cs (revision 53)
+++ WhereTrainBuild/MapUtil/MapTitleManager.cs (revision 54)
@@ -316,23 +316,26 @@
316316
317317 needslist.Add(maptile);
318318
319- if (maptile.IsCashed(BaseFolder) == true)
319+ lock (maptile)
320320 {
321- //ロード済みの場合、描画
322- Image img = maptile.GetImage(BaseFolder, Timeout);
323- if (img == null)
321+ if (maptile.IsCashed(BaseFolder) == true)
324322 {
325- lock (m_cache)
323+ //ロード済みの場合、描画
324+ Image img = maptile.GetImage(BaseFolder, Timeout);
325+ if (img == null)
326326 {
327- //キャッシュからぬく
328- m_cache.Remove(key);
329- continue;
327+ lock (m_cache)
328+ {
329+ //キャッシュからぬく
330+ m_cache.Remove(key);
331+ continue;
332+ }
330333 }
334+
335+ var lefttop = maptile.GetCorner(MapTile.CornerType.LeftTop);
336+ mapgraphics.DrawImage(img, (lefttop.X - iFindX), (lefttop.Y - iFindY), (float)MercatorTrans.ViewSize + 1, (float)MercatorTrans.ViewSize + 1);
337+ continue;
331338 }
332-
333- var lefttop = maptile.GetCorner(MapTile.CornerType.LeftTop);
334- mapgraphics.DrawImage(img, (lefttop.X - iFindX), (lefttop.Y - iFindY), (float)MercatorTrans.ViewSize+1, (float)MercatorTrans.ViewSize+1);
335- continue;
336339 }
337340
338341 //仮想タイル描画
Show on old repository browser