Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Optimized Surfaces
#51
Use spoiler tags too :|
Quote:Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?
Reply
#52
well, this is ES version 1, and ive been working on my personal project for 2-3 years now and its got so much i dont want to have to redo, id rather redo the game loop than sacrifice my work =/, trust me im wanting to kick myself for starting over there rather than here Tongue
sorry ill move that to the help section Tongue
erm this blows lol
Reply
#53
I don't have anything more to say really.
Reply
#54
I did warn you xD
Quote:Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?
Reply
#55
Anyone have a copy of the source code he had uploaded? Both links are dead..
Reply
#56
I know this is a pretty dead topic, but whatever haha.

I have been messing with this tutorial on and off for a few weeks and finally decided to attempt to get some help. I am using a vanilla MSE and only have tried to add this in. This is what I got.

I have added in the new variables like BigRed said to do, as well as initializing the surfaces and setting the color keys. This is my BltMap sub.

Code:
Dim Ground As Long
Dim Anim1 As Long
Dim Fringe As Long
Dim x As Byte
Dim y As Byte

    With rec
        .top = 0
        .Bottom = ((MAX_MAPX + 1) * PIC_X)
        .Left = 0
        .Right = ((MAX_MAPY + 1) * PIC_Y)
    End With
  
    DD_LowerBuffer.BltColorFill rec, RGB(0, 0, 0)
    DD_UpperBuffer.BltColorFill rec, RGB(0, 0, 0)

    For y = 0 To MAX_MAPY
        For x = 0 To MAX_MAPX

            With Map.Tile(x, y)
                Ground = .Ground
                Anim1 = .Mask
                Fringe = .Fringe
            End With
            
            ' Ground
            With rec
                .top = Int(Ground / 7) * PIC_Y
                .Bottom = .top + PIC_Y
                .Left = (Ground - Int(Ground / 7) * 7) * PIC_X
                .Right = .Left + PIC_X
            End With
            Call DD_LowerBuffer.BltFast(x * PIC_X, y * PIC_Y, DD_TileSurf, rec, DDBLTFAST_WAIT)
            
            ' Mask
            With rec
                 .top = Int(Anim1 / 7) * PIC_Y
                 .Bottom = .top + PIC_Y
                 .Left = (Anim1 - Int(Anim1 / 7) * 7) * PIC_X
                 .Right = .Left + PIC_X
            End With
            Call DD_LowerBuffer.BltFast(x * PIC_X, y * PIC_Y, DD_TileSurf, rec, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY)

            ' Fringe
            If Fringe > 0 Then
                With rec
                    .top = Int(Fringe / 7) * PIC_Y
                    .Bottom = .top + PIC_Y
                    .Left = (Fringe - Int(Fringe / 7) * 7) * PIC_X
                    .Right = .Left + PIC_X
                End With
                Call DD_UpperBuffer.BltFast(x * PIC_X, y * PIC_Y, DD_TileSurf, rec, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY)
            End If
            
        Next x
    Next y

I believe this is correct, I have removed the animation part of it to be replaced with this:

Code:
Sub BltAnimation()
Dim Anim As Long
Dim x As Byte
Dim y As Byte

For y = 0 To MAX_MAPY
        For x = 0 To MAX_MAPX
        
            Anim = Map.Tile(x, y).Anim
            
            If Anim > 0 Then
                With rec
                    .top = Int(Anim / 7) * PIC_Y
                    .Bottom = .top + PIC_Y
                    .Left = (Anim - Int(Anim / 7) * 7) * PIC_X
                    .Right = .Left + PIC_X
                End With
                Call DD_LowerBuffer.BltFast(x * PIC_X, y * PIC_Y, DD_TileSurf, rec, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY)
            End If
            
        Next x
    Next y
End Sub

The other Subs like BltItem, Npc and Player have only been changed from BackBuffer to MiddleBuffer. Umm, in my GameLoop I have this:

Code:
' Clear the back and middle buffers
        DD_BackBuffer.BltColorFill rec, RGB(0, 0, 0)
        DD_MiddleBuffer.BltColorFill rec, RGB(0, 0, 0)

Which is right under the End If for the Clear Surfaces check. Then I have this:

Code:
' Draw all buffers to the back buffer
        With rec
            .top = 0
            .Bottom = ((MAX_MAPX + 1) * PIC_X)
            .Left = 0
            .Right = ((MAX_MAPY + 1) * PIC_Y)
        End With
  
        Call DD_BackBuffer.BltFast(0, 0, DD_LowerBuffer, rec, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY)
        Call DD_BackBuffer.BltFast(0, 0, DD_MiddleBuffer, rec, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY)
        Call DD_BackBuffer.BltFast(0, 0, DD_UpperBuffer, rec, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY)

Right before the back buffer is locked for the text to be drawn. I guess thats all. The Call BltMap is right after the GettingMap boolean in "mapdone" packet and I have added them to the EditorMouseDown and Cancel subs too however the tiles, items, npcs and players are all not being shown and there is no trailing on the map and no errors Tongue. Oh, also I did move the InitDirectX. I cannot seem to figure out where I went wrong and hope somebody can help me Big Grin. Thanks a lot!
Reply
#57
I know how everyone around he reacts to impatience and stuff but there has been 20 more views on the topic and no replies Sad. Sorry for double posting..

I have tried more to figure this out but can't get it. I have read the tutorial a few times over. I know there is one person who can help me out.. Robin :lol:.
Reply
#58
Why is it that when people don't get a reply they always post my name?

What am I? Some sort of public property? Am I here to perform for you? Do you want me to perform!?
Quote:Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?
Reply
#59
Robin Wrote:Why is it that when people don't get a reply they always post my name?

What am I? Some sort of public property? Am I here to perform for you? Do you want me to perform!?

Haha, not really. I just know you have added this to Winds Whisper, and as far as I know, your the only one who has had it working properly.
Reply
#60
DFA got it working.. and he told me the trick to it, something needed to be changed.. or re-ordered or soemthing.


BUT, I forget, I can message him later maybe if I remember.
Reply
#61
this tutorial is to easy, i dont see why you people have so much trouble with it Wink
i could add it to a blank mirage in 10 mins Tongue
Reply
#62
Because as is, it doesn't work.

There's something that needs to be changed.
If you take whats here right now, and add it to a vanilla MSE, it'll display incorrectly.
Reply
#63
I'm sure that's not the case, as I've managed to do it every time I needed it without adding anything.
Quote:Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?
Reply
#64
Alright, well I will take a look at it when I get home. I have DFA on messenger so I will maybe talk to him about it too. Thanks for the replies. I will look over the tutorial again, too.
Reply
#65
This toturial is fine, apart from the map animation. If the map animation stay in the lower and upper buffer, they will not work as you would have to clear the upper & lower buffer every animation frame. If you use the Middle buffer they will work, but you will be able to walk over the fringe animation tiles. If you clear the upper & lower buffer every frame the map will dissapear as you will clear the map. Thats the only problem i can see with this tut.

POST EDIT
Sorry, i've just realised Mirage don't have Fringe animation layers. Sorry don't listen to me i don't know what i'm talking about.
Reply
#66
Tut works fine. I made 2 surfaces, one for ground/mask and one for fringe. Everything in between still is regular. I prefer it that way.
Reply
#67
Mozza Wrote:This toturial is fine, apart from the map animation. If the map animation stay in the lower and upper buffer, they will not work as you would have to clear the upper & lower buffer every animation frame. If you use the Middle buffer they will work, but you will be able to walk over the fringe animation tiles. If you clear the upper & lower buffer every frame the map will dissapear as you will clear the map. Thats the only problem i can see with this tut.

POST EDIT
Sorry, i've just realised Mirage don't have Fringe animation layers. Sorry don't listen to me i don't know what i'm talking about.

You still have difficulty understanding buffers don't you.

The 'layering' effect is still there. If you render the Fringe Animation tiles after the player, even if you render them to the Middle Buffer, it will still appear above the player on the game screen.
Quote:Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)