Esempio n. 1
0
        public static ResourceCluster <PicInfo> CreatePicRes(Func <byte[], PicInfo> handleLoader, Action <PicInfo> handleUnloader)
        {
            var res = new ResourceCluster <PicInfo>("Picture.dat", @"..\..\..\..\Picture.txt", handleLoader, handleUnloader);

            PicResList.Add(res);
            return(res);
        }
Esempio n. 2
0
        public static int Der(int derId, ResourceCluster <GamePicture.PicInfo> resclu)
        {
            if (derId < 0 || DerList.Count <= derId)
            {
                throw new GameError();
            }

            while (resclu.DerHandleList.Count <= derId)
            {
                resclu.DerHandleList.Add(-1);
            }

            int handle = resclu.DerHandleList[derId];

            if (handle == -1)
            {
                DerInfo i = DerList[derId];

                handle = LoadDer(
                    resclu.GetHandle(i.ParentPicId),
                    i.X,
                    i.Y,
                    i.W,
                    i.H
                    );

                resclu.DerHandleList[derId] = handle;
            }
            return(handle);
        }
Esempio n. 3
0
 public static void ResetPicRes()
 {
     CurrPicRes = null;
 }
Esempio n. 4
0
 public static void SetPicRes(ResourceCluster <PicInfo> resclu)        // resclu: null == reset
 {
     CurrPicRes = resclu;
 }