Mirage Source http://www.miragesource.net/forums/ |
|
[Feature] Dynamic sprite sizes! http://www.miragesource.net/forums/viewtopic.php?f=183&t=5047 |
Page 3 of 63 |
Author: | Labmonkey [ Tue Apr 14, 2009 1:20 am ] |
Post subject: | Re: [Feature] Dynamic sprite sizes! |
init the surface before you run the code. Also change all of the ddsd_sprite to dds_sprite.surfdescription. Thats what I did and it worked fine. |
Author: | Doomy [ Tue Apr 14, 2009 1:26 am ] |
Post subject: | Re: [Feature] Dynamic sprite sizes! |
How would i init the surface ? |
Author: | GIAKEN [ Tue Apr 14, 2009 3:12 am ] |
Post subject: | Re: [Feature] Dynamic sprite sizes! |
Here's my clipper code (Dugor helped with it a long time ago, makes surfaces not disappear when off screen): Code: If Y < 0 Then rec.Top = rec.Top - Y Y = 0 End If If X < 0 Then rec.Left = rec.Left - X X = 0 End If If X + Anim_Size(AnimNum).SizeX > DDSD_BackBuffer.lWidth Then rec.Right = rec.Right - (X + Anim_Size(AnimNum).SizeX - DDSD_BackBuffer.lWidth) End If If Y + Anim_Size(AnimNum).SizeY > DDSD_BackBuffer.lHeight Then rec.Bottom = rec.Bottom - (Y + Anim_Size(AnimNum).SizeY - DDSD_BackBuffer.lHeight) End If Just change the Anim_Size stuff to whatever the size of the surface is. |
Author: | Robin [ Mon Jun 01, 2009 5:57 pm ] |
Post subject: | Re: [Feature] Dynamic sprite sizes! |
Updated to work with the latest MS4. Basically, the lHeight and lWidth were being stored in the .SurfDescription when the sprite ready-ing code was called, which came after all the calculations were passed. I changed it so this was called before the calculations. |
Author: | Kousaten [ Sat Sep 05, 2009 2:17 am ] |
Post subject: | Re: [Feature] Dynamic sprite sizes! |
Using Giaken's clipping code, I'm trying to modify it a bit to work with Advocate/Matt's dynamic maps version of MS4. The X clipping works fine as: Code: ' Is player's X more than max map values..? If X + (DDSD_Sprite(Sprite).lWidth / 12) > MAX_MAPX * 32 + 32 Then With rec .Right = .Right - ((Map.MaxX / 2) - 24) End With End If I know the formula should be similar for the Y clipping, but I can't seem to get it to work properly. Any ideas? |
Author: | GIAKEN [ Sat Sep 05, 2009 11:50 pm ] |
Post subject: | Re: [Feature] Dynamic sprite sizes! |
An easy way to fix clipping problems is to convert map drawing to using Blt instead of BltFast. The way DirectX 7 works is BltFast takes out clipping, resizing, and whatever other things and just simply draws it to the screen, which makes it faster. Clipping code is already set up with like DD_Clipper I think...but it only works with Blt. |
Author: | wanai [ Sat Jan 01, 2022 8:54 pm ] |
Post subject: | Re: [Feature] Dynamic sprite sizes! |
Econ |
Author: | wanai [ Sat Jan 01, 2022 8:55 pm ] |
Post subject: | Re: [Feature] Dynamic sprite sizes! |
77.4 |
Author: | wanai [ Sat Jan 01, 2022 8:56 pm ] |
Post subject: | Re: [Feature] Dynamic sprite sizes! |
Bett |
Author: | wanai [ Sat Jan 01, 2022 8:57 pm ] |
Post subject: | Re: [Feature] Dynamic sprite sizes! |
Bett |
Author: | wanai [ Sat Jan 01, 2022 8:58 pm ] |
Post subject: | Re: [Feature] Dynamic sprite sizes! |
Erle |
Author: | wanai [ Sat Jan 01, 2022 8:59 pm ] |
Post subject: | Re: [Feature] Dynamic sprite sizes! |
Dune |
Author: | wanai [ Sat Jan 01, 2022 9:01 pm ] |
Post subject: | Re: [Feature] Dynamic sprite sizes! |
feat |
Author: | wanai [ Sat Jan 01, 2022 9:02 pm ] |
Post subject: | Re: [Feature] Dynamic sprite sizes! |
Thom |
Author: | wanai [ Sat Jan 01, 2022 9:03 pm ] |
Post subject: | Re: [Feature] Dynamic sprite sizes! |
Hans |
Author: | wanai [ Sat Jan 01, 2022 9:04 pm ] |
Post subject: | Re: [Feature] Dynamic sprite sizes! |
Snoo |
Author: | wanai [ Sat Jan 01, 2022 9:05 pm ] |
Post subject: | Re: [Feature] Dynamic sprite sizes! |
Thes |
Author: | wanai [ Sat Jan 01, 2022 9:06 pm ] |
Post subject: | Re: [Feature] Dynamic sprite sizes! |
YORK |
Author: | wanai [ Sat Jan 01, 2022 9:07 pm ] |
Post subject: | Re: [Feature] Dynamic sprite sizes! |
Tesc |
Author: | wanai [ Sat Jan 01, 2022 9:08 pm ] |
Post subject: | Re: [Feature] Dynamic sprite sizes! |
Duns |
Author: | wanai [ Sat Jan 01, 2022 9:10 pm ] |
Post subject: | Re: [Feature] Dynamic sprite sizes! |
Clas |
Author: | wanai [ Sat Jan 01, 2022 9:11 pm ] |
Post subject: | Re: [Feature] Dynamic sprite sizes! |
Blac |
Author: | wanai [ Sat Jan 01, 2022 9:12 pm ] |
Post subject: | Re: [Feature] Dynamic sprite sizes! |
Ever |
Author: | wanai [ Sat Jan 01, 2022 9:13 pm ] |
Post subject: | Re: [Feature] Dynamic sprite sizes! |
Dorm |
Page 3 of 63 | All times are UTC |
Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |