Mirage Source
Blitting Vis Inv? - Printable Version

+- Mirage Source (https://mirage-engine.uk/forums)
+-- Forum: Mirage Source (Nostalgia) (https://mirage-engine.uk/forums/forumdisplay.php?fid=61)
+--- Forum: Archive (2006-2011) (https://mirage-engine.uk/forums/forumdisplay.php?fid=18)
+---- Forum: General (https://mirage-engine.uk/forums/forumdisplay.php?fid=17)
+---- Thread: Blitting Vis Inv? (/showthread.php?tid=581)

Pages: 1 2


Blitting Vis Inv? - Tony - 05-01-2007

Well I need advice on blitting vis inv to the screen. Guidance basically.


- halla - 05-01-2007

for visual inv or to get it on screen?


- Tony - 05-01-2007

Read carefully, friend.

Quote:vis inv to the screen



- halla - 05-01-2007

Fine then I wont help


- Tony - 05-01-2007

Doesn't matter to me :] Sooner or later I'll grasp my needs concerning none of your help.


- Gilgamesch - 05-01-2007

Pando Wrote:Doesn't matter to me :] Sooner or later I'll grasp my needs concerning none of your help.


wtf is going on here guys? are you doing that because you are friends or dont you like each other?..anyway



so, the current code tells the vis inv to blit into the differnt icon boxes, you need to make a variable so that it checks how many items there are in the inventroy so blit it lets say 10 pixels away and then 32x32 pixels...then you need to change the blitting code to do that, i guess thats basicly it

add me in msn if you need help with that ^^


- Tony - 05-01-2007

Nvm. This isn't what I actually needed to know. But I thought about it and Kite told me a way he did it. Yes Kite


- Gilgamesch - 05-01-2007

[quote="Pando"]Nvm. This isn't what I actually needed to know. But I thought about it and Kite told me a way he did it. Yes Kiteblitting vis inv to the screen


- Tony - 05-01-2007

Ahh sorry, thanks Gilgamesch :]


- Gilgamesch - 05-01-2007

Kuja Wrote:Ahh sorry, thanks Gilgamesch :]


well, its ok ^^


- Tony - 06-01-2007

oh btw. Would I use bitblt in gamelogic?


- Tony - 06-01-2007

Fuck you. Retard ass bitch. Get a life and stop being retarded.


- halla - 06-01-2007

Kuja Wrote:Fuck you. Retard ass bitch. Get a life and stop being retarded.

ummm who are you even saying this too? lol

Anyways you would want it to blt it out in GameLoop when everything else is being blted Im sure. I would make it the last thing blted.


- Misunderstood - 06-01-2007

halla Wrote:
Kuja Wrote:Fuck you. Retard ass bitch. Get a life and stop being retarded.

ummm who are you even saying this too? lol

Anyways you would want it to blt it out in GameLoop when everything else is being blted Im sure. I would make it the last thing blted.

Obviously he was talking about himself, since that is now the last post Smile

Also, obviously Tongue you would use bltfast and blt things just like everything else is blt if its blting to the screen where the map is, if its blting to a picturebox, you could either use bitblt or use blttohdc with dx.


- Xlithan - 06-01-2007

Do I sense lack of moderation here?

I didn't know we had so many girls on the forum (Only the smart people will get this joke)


- Tony - 06-01-2007

didn't someone see the guy saying "I EAT SHIT" T___T

with the big o avatar... ? And someone deleted his post making all think I'm name calling myself? okay.


- Gilgamesch - 06-01-2007

Kuja Wrote:didn't someone see the guy saying "I EAT SHIT" T___T

with the big o avatar... ? And someone deleted his post making all think I'm name calling myself? okay.

ok...who is it then ??


- Tony - 06-01-2007

Yasin -_________-


- Robin - 06-01-2007

Just do it my way for now.

It's not the greatest, but it works.

It also allows you to expand your Inventory size later on, with only adding one more line of code (or you could optimise the entire thing and have only three lines of code for it!)

This is how I did it here (but with alphablending for the background thingy):

[Image: untitled.jpg]


- Tony - 06-01-2007

What way is that? Oh the way you told me?

Also, tell me whats up with my code. Its buggy and doesn't blit the correct item.

Code:
Sub BltInvItems(ByVal ItemNum As Long)
Dim X As Long, Y As Long, I As Long

    rec.top = Item(ItemNum).Pic * PIC_Y
    rec.Bottom = rec.top + PIC_Y
    rec.Left = 0
    rec.Right = rec.Left + PIC_X
    
    X = 108 - 35
    Y = 78
    'Call DD_BackBuffer.Blt(rec_pos, DD_ItemSurf, rec, DDBLT_WAIT Or DDBLT_KEYSRC)
    Call DD_BackBuffer.BltFast(X + (ItemNum * 35), Y, DD_ItemSurf, rec, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY)
End Sub

Note ( 35 is used because the spacing in the bitmap file )

Nvm. fixed it, Now for the new embarks!


- Misunderstood - 06-01-2007

Kuja Wrote:didn't someone see the guy saying "I EAT SHIT" T___T

with the big o avatar... ? And someone deleted his post making all think I'm name calling myself? okay.

I didn't, but I figured you were talking to one of the spammers.
I just felt like joking with you Tongue


- Rian - 06-01-2007

I deleted them. I must have missed deleting some of your responses to his posts.


- Tony - 06-01-2007

oi Kite! I tried the thing you told me but didn't work. When I do it, nothing shows. (Items)

Heres my regular code that works, for the first 5 items.
( now blits correct items )

Code:
Sub BltInvItems(ByVal ItemNum As Long)
Dim IX As Long, IY As Long

    rec.top = Item(GetPlayerInvItemNum(MyIndex, ItemNum)).Pic * PIC_Y
    rec.Bottom = rec.top + PIC_Y
    rec.Left = 0
    rec.Right = rec.Left + PIC_X
    
    IX = 108 - 35
    IY = 78
    
    'Call DD_BackBuffer.Blt(rec_pos, DD_ItemSurf, rec, DDBLT_WAIT Or DDBLT_KEYSRC)
    Call DD_BackBuffer.BltFast(IX + (ItemNum * 35), IY, DD_ItemSurf, rec, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY)
End Sub

-35 for spacing. etc.

[ e d i t ] Thanks to sensei's help (


- Robin - 07-01-2007

Sorry I didn't reply, I've haven't been online for a few days.

Dave, I get 3-5fps using normal Mirage on the PC I took the screenshot on. There is a 2-6 fps drop when the lighting comes on.

Also, that is a very old engine I used, and it could be done a lot better!

Kuja, did you manage to get it to work?


- Tony - 07-01-2007

Yeah, It works properly. The fps isn't too slow. I've also got alpha blending with sprites and it seems to get faster when in alpha blending mode 0.o The fps doesn't drop for sprites though :p