Jump to content

prospeed


jpam
 Share

Recommended Posts

  • Replies 511
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

Two questions about sprites with prospeed:

1) I want to put an updated sprite over an old one. Same dimensions, only different GIF or BMP content. Now when I just assign a new Sprite() return value to an old variable, everything works except for that the graphical contents of the first variable remain on screen, and kind of become the background of the new content. So I thought I'd just DeleteSprite() the old sprite first. But... The drawn sprite doesn't go away!

So, how to remove a written sprite, or to overwrite an old sprite with a new one and including the background so it yields the same visible result?

/edit: just realized that my question would probably also be solved if I knew how to draw a non-transparent sprite.

Solved - problem described was caused by an incredibly stupid error in my array handling. Leaves 2 though:

2) Reading through ProSpeed.au3 functions to accomplish aforementioned goal, I thought it might be necessary to set the background mode. But Func ChangeSpritePara($S_Alias, $Parameter, $new_value) is a bit unclear to me. I can't seem to find out what different values for 'Background_mode' do. How to use this? Or is it only for the 'real' background that was set by Background()?

I do feel the need to compliment JPAM and Frank for creating such beautiful and ridiculously useful stuff.

Edited by SadBunny

Roses are FF0000, violets are 0000FF... All my base are belong to you.

Link to comment
Share on other sites

here's a better explanation of ChangeSpritePara

i am working on a huge prospeed demo that is using all function's in the udf

and combining different function's

it will take some weeks to complete it, but it come's with source code

so you can look how different effect''s are done.

#cs 
    $Spritebitmap              = 0    sets new sprite bitmap
    $Offset_X                  = 4    change X offset in sprite bitmap 
    $Offset_Y                  = 8    change Y offset in sprite bitmap
    $HDC_window                = 56   change Hdc
    $Buffer_copie1             = 68   change screen buffer for sprite
    $Buffer_copie2             = 84   change screen buffer for sprite
    $Background_mode           = 92   0= background not scrolling / 1= background is scrolling
    $Background_scroll_X       = 96   sets how many pixels the background must scroll on X axis
    $Background_scroll_Y       = 100  sets how many pixels the background must scroll on Y axis
    $sprite_markNR             = 156  change sprite mark
    $Start_MoveSpriteWithTable = 312  startpoint for spritemove with table mode
#CE
Link to comment
Share on other sites

Right! Thanks for the info. Seems I have no use for the BackgroundMode option at this time, but at least I now know what I am missing out on :)

Good luck on your demo! Nice to see you're so committed to completing your UDF and making it really usable.

For practising basic ProSpeed usage I am making a clock. I like making clocks. If you want to, I'll post it here when I'm done.

Roses are FF0000, violets are 0000FF... All my base are belong to you.

Link to comment
Share on other sites

if you want to change the background with sprites in it

change the background picture with Background($S_FILE, $S_POSX, $S_POSY, $N_WIDTH, $N_HEIGHT) and set

ChangeSpritePara($sprite1, 68, $S_fensterkopie1[0])

ChangeSpritePara($sprite1, 84, $S_fensterkopie2[0])

then $sprite1 has the new background buffer

$S_fensterkopie1[0] = a temporary solution to change the background buffer

when you load a new background the $S_fensterkopie1[0] will automatic get a copy of the new background

when i have the demo ready this will be fixed

Link to comment
Share on other sites

Well, I've finished the best alarm clock in the WORLD thanks to you :)

Check it out! (I credited you and Frank in my background pic...) I have only used a small portion of all options you provide though; I'm planning on improving my script to be able to set the alarm time and turn on/shut off the alarm using the joypad, because I have this wireless rumblepad thingy that I can use from bed!

Zip file contains ProSpeed.dll, psclock.au3 (my clock script) and a bunch of pictures. Just keep everything in the same folder :)

All pictures were created from scratch by myself.

psclock.zip

/edit: 04-02-2008 new version - fixed a major AM/PM conversion bug, and some minor bugs (forgotten test code, some window handling and error checking/prevention)

Edited by SadBunny

Roses are FF0000, violets are 0000FF... All my base are belong to you.

Link to comment
Share on other sites

Thanks peter123!

Hey JPAM I have a question... Why are there global variables used, for instance for GetBackgroundInfos? Why not let it return a variable or an array with information, like most other udf's and built-in info gathering functions? That would be cleaner, wouldn't it?

Thanks again.

Roses are FF0000, violets are 0000FF... All my base are belong to you.

Link to comment
Share on other sites

@ peter123

demo is allmost done

lots of changes in udf

frank has updated the prospeed.dll with new function bitblitarrays (very fast array's copying with tranparant masks)

properly bug in dll with FreeExtFX function , frank is looking at it

@ Sadbunny

i don't use Global's in the udf

GetBackgroundInfos use Struct's

mybe in an old version :)

btw ,Your clock look's good

but i am open for improments

give me an example how thing's could be better

Edited by jpam
Link to comment
Share on other sites

Thanks!

But... In the last version of prospeed.au3 that I downloaded, a couple of days ago from your first post in this thread (which you say to have updated - I guess that contains the latest version), I see the following:

(..)

Dim $S_WIDTH[1], $S_HEIGHT[1], $Window_Width, $Window_height, $Offset_X, $Offset_Y 

(..)

Func GetBackgroundInfos() 
    $B_BackgroundInfos = DllStructCreate("long;long;long;long;long;long;long")
    DllCall($S_DLL, "long", "GetBackgroundInfos", "long", DllStructGetPtr($B_BackgroundInfos))
    $Scrollmodus   = DllStructGetData($B_BackgroundInfos, 1)
    $Window_Width  = DllStructGetData($B_BackgroundInfos, 2)
    $Window_height = DllStructGetData($B_BackgroundInfos, 3)
    $Offset_X      = DllStructGetData($B_BackgroundInfos, 4)
    $Offset_Y      = DllStructGetData($B_BackgroundInfos, 5)
    $Speed_X       = DllStructGetData($B_BackgroundInfos, 6)
    $Speed_Y       = DllStructGetData($B_BackgroundInfos, 7)
EndFuncoÝ÷ ØÚ0P*Ø^)¨ºÛ"uêiû§rf¤zËazö«¦åzÈ%¡¶¥jwHq©÷öÛ¬yú+{-jw*0MúZ)Ý£Ûa¶¶«Â+a¦º,¥çjíÍ£    ²²è zËb¢|(ºW[y«­¢+ÙÕ¹Ñ ­É½Õ¹%¹½Ì ¤($ÀÌØí  }   ­É½Õ¹%¹½Ìô±±MÑÉÕÑ
ÉÑ ÅÕ½Ðí±½¹í±½¹í±½¹í±½¹í±½¹í±½¹í±½¹ÅÕ½Ðì¤(%±±
±° ÀÌØíM}10°ÅÕ½Ðí±½¹ÅÕ½Ðì°ÅÕ½ÐíÑ ­É½Õ¹%¹½ÌÅÕ½Ðì°ÅÕ½Ðí±½¹ÅÕ½Ðì°±±MÑÉÕÑÑAÑÈ ÀÌØí  }   ­É½Õ¹%¹½Ì¤¤(%¥´ÀÌØíÉÍÕ±ÑlÝt($ÀÌØíÉÍÕ±ÑlÁtôm±±MÑÉÕÑÑÑ ÀÌØí  }   ­É½Õ¹%¹½Ì°Ä¤($ÀÌØíÉÍÕ±ÑlÅtôm±±MÑÉÕÑÑÑ ÀÌØí    }   ­É½Õ¹%¹½Ì°È¤($ÀÌØíÉÍÕ±ÑlÉtôm±±MÑÉÕÑÑÑ ÀÌØí    }   ­É½Õ¹%¹½Ì°Ì¤($ÀÌØíÉÍÕ±ÑlÍtôm±±MÑÉÕÑÑÑ ÀÌØí    }   ­É½Õ¹%¹½Ì°Ð¤($ÀÌØíÉÍÕ±ÑlÑtôm±±MÑÉÕÑÑÑ ÀÌØí    }   ­É½Õ¹%¹½Ì°Ô¤($ÀÌØíÉÍÕ±ÑlÕtôm±±MÑÉÕÑÑÑ ÀÌØí    }   ­É½Õ¹%¹½Ì°Ø¤($ÀÌØíÉÍÕ±ÑlÙtôm±±MÑÉÕÑÑÑ ÀÌØí    }   ­É½Õ¹%¹½Ì°Ü¤(%IÑÕɸÀÌØíÉÍÕ±Ð)¹Õ¹ìôôÐíÑ ­É½Õ¹%¹½Ì

... or something along those lines. Perhaps make an 8-element array with the first element containing the number 7 (for indicating that there are 7 values returned, like for instance the StringSplit() behaviour).

Now since you use the return to feed back information from some other functions, I wonder why not in all functions? IMHO these global variables are a less than perfect solution, and returning values in the manner I described here is way cleaner (since then I can put the result array in an array variable of my own choosing). But probably I misunderstand the situation, presuming you have a reason for it, and that was what I was asking about... :)

Roses are FF0000, violets are 0000FF... All my base are belong to you.

Link to comment
Share on other sites

ImageDemo released !

http://prospeed-jan.xprofan.com/

Its a huge 7 MB

makes full use of the udf !

exe contains all the graphics , sound and newest Prospeed.dll

Brandnew functions are BitBlitArray ExchangeRGB and PNG alpha transperancy incl Invert PNG

newest udf ;

http://prospeed-jan.xprofan.com/

source demo (does not run without graphics and sound !)

but its for seeing how effects are done

http://prospeed-jan.xprofan.com/

Please Let me know if you guys like it !

Edited by jpam
Link to comment
Share on other sites

I have seen my share of demos, but this ROCKS. I watched it breathlessly.

The soundtrack is also AWESOME, especially the voice. Too bad she's married :)

I can't decide whether to explore your code, open the .XM files in fasttracker for old-times sake (probably requires a Dos 6.22 vpc since DosBox doesn't seem to be up to the task :)), or just watch the demo again.

Roses are FF0000, violets are 0000FF... All my base are belong to you.

Link to comment
Share on other sites

I am becoming a fan... :) I am very much into trackers, composed many songs myself between 1994-2000... After that I started using fruityloops.

Since I wouldn't have the slightest idea where to start building a mod player, I would love to take a look at yours!

Roses are FF0000, violets are 0000FF... All my base are belong to you.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...