Exemple #1
0
        public void LoadFromProject(BinaryReader br)
        {
            string    fontName = string.Empty;
            int       bold, italic, underline, strike, size;
            FontStyle fontStyle = FontStyle.Regular;

            _full_path_name = HPTFileHelper.GetString(br);
            _filename       = Path.GetFileName(_full_path_name);

            fontName  = HPTFileHelper.GetString(br);
            size      = br.ReadInt32();
            bold      = br.ReadInt32();
            italic    = br.ReadInt32();
            underline = br.ReadInt32();
            strike    = br.ReadInt32();

            if (bold != 0 || underline != 0 || italic != 0 || strike != 0)
            {
                fontStyle &= ~FontStyle.Regular;
            }

            if (bold != 0)
            {
                fontStyle |= FontStyle.Bold;
            }
            if (underline != 0)
            {
                fontStyle |= FontStyle.Underline;
            }
            if (italic != 0)
            {
                fontStyle |= FontStyle.Italic;
            }
            if (strike != 0)
            {
                fontStyle |= FontStyle.Strikeout;
            }

            _font     = new Font(fontName, size, fontStyle);
            _fontName = fontName;

            if (_font.Name != fontName)
            {
                //LogManager.OnLogMessage(this, string.Format("Font name did not work: {0}, changed to: {1}", fontName, _font.Name));
            }


            _keyred     = br.ReadInt32();
            _keygreen   = br.ReadInt32();
            _keyblue    = br.ReadInt32();
            _colorred   = br.ReadInt32();
            _colorgreen = br.ReadInt32();
            _colorblue  = br.ReadInt32();
            _fringred   = br.ReadInt32();
            _fringgreen = br.ReadInt32();
            _fringblue  = br.ReadInt32();
        }
Exemple #2
0
 public void LoadFromProject(BinaryReader br)
 {
     _full_path_name       = HPTFileHelper.GetString(br);
     _file_name            = Path.GetFileName(_full_path_name);
     _map_data             = HPTFileHelper.GetString(br);
     _tileimage_layer1     = HPTFileHelper.GetString(br);
     _tiledata_layer1      = HPTFileHelper.GetString(br);
     _tileimage_layer2     = HPTFileHelper.GetString(br);
     _tiledata_layer2      = HPTFileHelper.GetString(br);
     _num_frontlayer_tiles = br.ReadInt32();
     _num_backlayer_tiles  = br.ReadInt32();
 }
Exemple #3
0
        public void LoadFromProject(BinaryReader br)
        {
            int size = 0;

            _full_path_name = HPTFileHelper.GetString(br);
            _filename       = Path.GetFileName(_full_path_name);

            size = br.ReadInt32();
            for (int i = 0; i < size; i++)
            {
                HPTWav hptWav = new HPTWav();
                hptWav.LoadFromProject(br);
                wavs.Add(hptWav);
            }
        }
Exemple #4
0
        public void LoadFromProject(BinaryReader br)
        {
            _full_path_name = HPTFileHelper.GetString(br);
            _file_name      = Path.GetFileName(_full_path_name);
            _desc           = HPTFileHelper.GetString(br);

            _width           = br.ReadInt32();
            _height          = br.ReadInt32();
            _color_key_red   = br.ReadInt32();
            _color_key_blue  = br.ReadInt32();
            _color_key_green = br.ReadInt32();

            _default_frame_rate   = br.ReadSingle();
            _default_auto_animate = br.ReadBoolean();
            _num_frame_sets       = br.ReadInt32();

            _frames_per_set.Clear();
            if (_num_frame_sets > 0)
            {
                int frames = 0;
                for (int i = 0; i < _num_frame_sets; i++)
                {
                    frames = br.ReadInt32();
                    _frames_per_set.Add(frames);
                }
            }

            // load the image
            try
            {
                FileStream fs = new FileStream(_full_path_name, FileMode.Open);
                _image = Bitmap.FromStream(fs);//.FromFile(_full_path_name);
                fs.Close();

                _img_width  = _image.Width;
                _img_height = _image.Height;
            }
            catch
            {
                LogManager.OnLogMessage(this, string.Format("Error opening file, \"{0}\".", _full_path_name));
            }
        }
Exemple #5
0
        public void LoadFromProject(BinaryReader br)
        {
            int      size = 0;
            HPTImage hptImage;

            _full_path_name = HPTFileHelper.GetString(br);
            _file_name      = Path.GetFileName(_full_path_name);

            size = br.ReadInt32();
            _hgfHeader.NumberOfImages = size;

            _hptImages.Clear();
            for (int i = 0; i < size; i++)
            {
                // get pngs
                hptImage = new HPTImage();
                hptImage.LoadFromProject(br);
                _hptImages.Add(hptImage);
            }
        }
Exemple #6
0
 public void LoadFromProject(BinaryReader br)
 {
     _filename = HPTFileHelper.GetString(br);
     _desc     = HPTFileHelper.GetString(br);
 }