Exemplo n.º 1
0
        protected virtual void RenderNoBindRectangle(Rect2d rect, OGLTexture texture, double distance, double transparency)
        {
            Rect2d coords = texture.GetCoordinates();

            if (transparency < 1.0)
            {
                GL.Color4(1.0, 1.0, 1.0, transparency);
            }

            //##########
            GL.Begin(BeginMode.Quads);
            //##########

            GL.TexCoord2(coords.bl);
            GL.Vertex3(rect.tl.X, rect.tl.Y, distance);

            GL.TexCoord2(coords.tl);
            GL.Vertex3(rect.bl.X, rect.bl.Y, distance);

            GL.TexCoord2(coords.tr);
            GL.Vertex3(rect.br.X, rect.br.Y, distance);

            GL.TexCoord2(coords.br);
            GL.Vertex3(rect.tr.X, rect.tr.Y, distance);

            //##########
            GL.End();
            //##########

            if (transparency < 1.0)
            {
                GL.Color4(1.0, 1.0, 1.0, 1.0);
            }
        }
Exemplo n.º 2
0
 public HUDImage(OGLTexture tex, int w, int h)
     : base()
 {
     texture = tex;
     width   = w;
     height  = h;
 }
Exemplo n.º 3
0
 public ExtraTileInfo(LayMapTile tile, OGLTextureManager manager)
 {
     Parent         = tile;
     TextureManager = manager;
     Texture        = TextureManager.LoadTexture(EvilTools.GetExecutingPath(@"MapEditor\Tiles\" + tile.Id + ".png"));
     if (Texture == null)
     {
         Texture = TextureManager.LoadTexture(EvilTools.GetExecutingPath(@"MapEditor\Tiles\unknown.png"));
     }
 }
Exemplo n.º 4
0
        private void RenderObject(LayEntity obj)
        {
            OGLTexture text = Textures.LoadTexture(EvilTools.GetExecutingPath(@"MapEditor\Objects\" + obj.EntityDescriptionID + ".png"));

            if (text == null)
            {
                OGLTools.DrawFilledRectangle(Color.Green, new Position2D(obj.Pattern.Location.X * BoxSize + BoxSize - m_PositionX, obj.Pattern.Location.Y * BoxSize + BoxSize - m_PositionY), new Dimension2D(BoxSize, BoxSize));
                return;
            }

            OGLTools.DrawTexture(text, new Position2D(0, 0), text.Size, new Position2D(obj.Pattern.Location.X * BoxSize + BoxSize - m_PositionX, obj.Pattern.Location.Y * BoxSize + BoxSize - m_PositionY), new Dimension2D(BoxSize, BoxSize), 1f);
        }
Exemplo n.º 5
0
        public FragmentParticle(OGLTexture baseTex, int entw, int enth, int texX, int texY, int fullW, int fullH)
            : base()
        {
            Rect2d coords = baseTex.GetCoordinates();
            double w      = coords.Width / (fullW * 1.0);
            double h      = coords.Height / (fullH * 1.0);
            double x      = coords.bl.X + w * texX;
            double y      = coords.tl.Y - h * texY - h;

            width   = entw / (fullW * 1.0);
            height  = enth / (fullH * 1.0);
            texture = new OGLTextureFragment(baseTex.GetID(), x, y, w, h).GetTextureWrapper();
        }
Exemplo n.º 6
0
        private void RenderDebugPattern()
        {
            LayEntity ent = Plugin.LayFile.FindEntity("13029");

            if (ent == null)
            {
                return;
            }

            // draw the console!
            OGLTexture text = Textures.LoadTexture(EvilTools.GetExecutingPath(@"MapEditor\Objects\13029.png"));

            //OGLTools.DrawTexture(text, new Position2D(0, 0), text.Size, new Position2D(ent.Pattern.Location.X * BoxSize - m_PositionX, ent.Pattern.Location.Y * BoxSize - m_PositionY), text.Size, 1.0f);
            OGLTools.DrawTexture(text, new Position2D(0, 0), text.Size, new Position2D(GetPosition(ent.Pattern.Location.X * BoxSize) - m_PositionX + BoxSize, GetPosition(ent.Pattern.Location.Y * BoxSize) - m_PositionY + BoxSize), new Position2D(ent.Pattern.Location.X * BoxSize - m_PositionX + BoxSize * 5, ent.Pattern.Location.Y * BoxSize - m_PositionY + BoxSize + BoxSize), 1.0f);

            OGLTools.DrawRectangle(Color.Red, new Position2D(ent.Pattern.Location.X * BoxSize + BoxSize - m_PositionX, ent.Pattern.Location.Y * BoxSize + BoxSize - m_PositionY), new Dimension2D(BoxSize, BoxSize));
        }
Exemplo n.º 7
0
 public void Add(int layer, OGLTexture tex)
 {
     createLayer(layer);
     textureList[layer].Add(tex);
 }
Exemplo n.º 8
0
        public static void Load()
        {
            for (int i = 0; i < texturePacks.Length; i++)
            {
                texturePacks[i] = OGLTextureSheet.LoadTextureFromBitmap(ResourceAccessor.GetTexturePack(i), 80, 8);
            }

            block_textures     = OGLReferenceTextureSheet.LoadTextureFromReference(texturePacks[Program.TEXTUREPACK], 80, 8);
            doubleblock_sheet  = OGLReferenceTextureSheet.LoadTextureFromReference(block_textures, 40, 4);
            doubleheight_sheet = OGLReferenceTextureSheet.LoadTextureFromReference(block_textures, 80, 4);

            number_sheet = OGLTextureSheet.LoadTextureFromBitmap(Resources.number_raster, 16, 4);

            mario_small_sheet = OGLTextureSheet.LoadTextureFromBitmap(Resources.mario_small, 16, 2);
            mario_big_sheet   = OGLTextureSheet.LoadTextureFromBitmap(Resources.mario_big, 16, 2);
            mario_fire_sheet  = OGLTextureSheet.LoadTextureFromBitmap(Resources.mario_fire, 16, 2);

            texture_logo = new OGLTexture[15, 5];
            for (int x = 0; x < 15; x++)
            {
                for (int y = 0; y < 5; y++)
                {
                    texture_logo[x, y] = block_textures.GetTextureWrapper(65 + x, 7 - y);
                }
            }

            texture_ground            = block_textures.GetTextureWrapper(35);
            texture_air               = block_textures.GetTextureWrapper(0);
            texture_ground_air        = block_textures.GetTextureWrapper(7);
            texture_coinblock_full    = block_textures.GetTextureWrapper(88);
            texture_coinblock_empty   = block_textures.GetTextureWrapper(79);
            texture_hill              = block_textures.GetTextureWrapper(77);
            texture_pipe              = block_textures.GetTextureWrapper(72);
            texture_castle            = block_textures.GetTextureWrapper(177);
            texture_ceiling           = block_textures.GetTextureWrapper(256);
            texture_pillar            = block_textures.GetTextureWrapper(176);
            texture_mshroomplatform   = block_textures.GetTextureWrapper(84);
            texture_castleGround      = block_textures.GetTextureWrapper(206);
            texture_lava              = block_textures.GetTextureWrapper(94);
            texture_solidcloud        = block_textures.GetTextureWrapper(1);
            texture_underwater_water  = block_textures.GetTextureWrapper(263);
            texture_underwater_ground = block_textures.GetTextureWrapper(262);
            texture_darkGround        = block_textures.GetTextureWrapper(178);
            texture_darkCeiling       = block_textures.GetTextureWrapper(4);
            texture_darkHill          = block_textures.GetTextureWrapper(255);
            texture_billblaster       = block_textures.GetTextureWrapper(220);

            texture_flag            = block_textures.GetTextureWrapper(179);
            texture_bridge          = block_textures.GetTextureWrapper(205);
            texture_lever           = block_textures.GetTextureWrapper(11);
            texture_beanstalk       = block_textures.GetTextureWrapper(21);
            texture_trampoline      = block_textures.GetTextureWrapper(23);
            texture_largetrampoline = doubleheight_sheet.GetTextureWrapper(24);

            texture_coin_0    = block_textures.GetTextureWrapper(40);
            texture_coin_1    = block_textures.GetTextureWrapper(48);
            texture_coin_2    = block_textures.GetTextureWrapper(41);
            texture_coin_3    = block_textures.GetTextureWrapper(124);
            texture_mariohead = block_textures.GetTextureWrapper(261);

            texture_mushroom = block_textures.GetTextureWrapper(6);
            texture_flower   = block_textures.GetTextureWrapper(12);

            texture_fireball  = block_textures.GetTextureWrapper(248);
            texture_lavaball  = block_textures.GetTextureWrapper(264);
            texture_hammer    = block_textures.GetTextureWrapper(15);
            texture_spikeball = block_textures.GetTextureWrapper(265);

            texture_goomba           = block_textures.GetTextureWrapper(110);
            texture_goomba_dead      = block_textures.GetTextureWrapper(95);
            texture_koopa            = block_textures.GetTextureWrapper(109);
            texture_koopashell       = block_textures.GetTextureWrapper(127);
            texture_paratroopa       = block_textures.GetTextureWrapper(257);
            texture_toad             = block_textures.GetTextureWrapper(258);
            texture_bowser           = block_textures.GetCombinedTextureWrapper(19, 3, 2, 1);
            texture_cheepcheep       = block_textures.GetTextureWrapper(29);
            texture_blooper          = block_textures.GetTextureWrapper(30);
            texture_hammerbro        = block_textures.GetTextureWrapper(190);
            texture_lakitu           = block_textures.GetTextureWrapper(167);
            texture_buzzybeetle      = block_textures.GetTextureWrapper(266);
            texture_buzzybeetleshell = block_textures.GetTextureWrapper(267);
            texture_bulletbill       = block_textures.GetTextureWrapper(61);

            array_coin = new OGLTexture[] { texture_coin_0, texture_coin_1, texture_coin_2, texture_coin_3 };
        }