CachePck() public static method

public static CachePck ( string basePath, string basename, int bpp, Palette p ) : PckFile
basePath string
basename string
bpp int
p Palette
return PckFile
Example #1
0
        public override IUnit GetNewUnit(Palette p)
        {
            if (myFile == null)
            {
                PckFile myPck;
                try
                {
                    myPck = GameInfo.CachePck(basePath, basename, 4, p);
                }
                catch
                {
                    myPck = GameInfo.CachePck(basePath, basename, 2, p);
                }
                myFile           = new Type4File(this);
                myFile.ImageFile = myPck;
            }

            return(new HumanSoldier1((Type4File)myFile, p));
        }
Example #2
0
		public override IUnit GetNewUnit(Palette p)
		{
			//if(myFile==null)
			//	myFile = new Type1File(this);

			if(myFile==null)
			{
				PckFile myPck;
				try
				{
					myPck = GameInfo.CachePck(basePath,basename,4,p);
				}
				catch
				{
					myPck = GameInfo.CachePck(basePath,basename,2,p);
				}
				myFile = new Type1File(this);
				myFile.ImageFile=myPck;
			}
			
			return new Type1Unit((Type1File)myFile,p);
		}
Example #3
0
        public override IUnit GetNewUnit(Palette p)
        {
            if (myFile == null)
            {
                PckFile myPck;
                try
                {
                    myPck = GameInfo.CachePck(basePath, basename, 4, p);
                }
                catch
                {
                    myPck = GameInfo.CachePck(basePath, basename, 2, p);
                }
                myFile           = new Type0File(this, myPck.Count);
                myFile.ImageFile = myPck;
            }

            AlienSoldier a = new AlienSoldier((Type0File)myFile, p);

            a.Name = basename;
            return(a);
        }
Example #4
0
        public PckFile GetPckFile(Palette p)
        {
            return(GameInfo.CachePck(BasePath, BaseName, 2, p));
//			new PckFile(File.OpenRead(basePath + basename + ".PCK"), File.OpenRead(basePath + basename + ".TAB"), 2, p, screen);
//			GameInfo.GetPckFile(basename, basePath, p, 2, screen);
        }