Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK .NET / Oh to be a newbie...

Author
Message
Tashar
14
Years of Service
User Offline
Joined: 8th Oct 2009
Location:
Posted: 10th Oct 2009 05:49
SO I swung by and picked up DarkGDK.NET but I'm stuck at a point. Yea I know its one of those Tileset questions, but I've never used DBPro and such. I went through the help help and I'm having a hard time understanding most of the functions. It's not that I can read but some of the function could use an example. Well one day I guess.

Anyways my problem: {Source code}



This is what I have and hear are my questions.

The first copyfrom works but the second one does not. Why?
I tried to do a x,y loop (10 each) but the FPS goes down to a crawl.




Why?

Yep I know, newbie 101 questions for you and I'll take all the lashing. but if your going to lash at me, be me with answers



Thanks
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 10th Oct 2009 11:45
From my DBPro knowledge, I hope this translates directly to GDK...

As soon as you do the first copyfrom, the new bitmap becomes the current bitmap. You need to setCurrentBitmap back to the original.

The second issue is down to the speed of copying a bitmap. It's a very slow process, and you would tend to do this kind of operation outside of the time critical game loop, usually as a pre-task to the game. If you really need to do this in-game, you should consider looking into memblocks, which allow you to manipulate the image data manually but much faster.

Tashar
14
Years of Service
User Offline
Joined: 8th Oct 2009
Location:
Posted: 10th Oct 2009 17:48
Thanks for the quick response.

Now I saw some code out there that would do just that for the GDK, Now I just have to find it.
Tashar
14
Years of Service
User Offline
Joined: 8th Oct 2009
Location:
Posted: 10th Oct 2009 19:53
Can anybody shed some light on using the MemoryBlock class and Tiles. I did see a post somewhere (for GDK) that somebody did about the memblock but it eludes me...

Any help will be welcome.
Grayvyn
15
Years of Service
User Offline
Joined: 30th Oct 2008
Location: Southern California
Posted: 14th Oct 2009 00:58
Here is a way to do it with the Image type. This is C# code but you should be able to translate it to VB.Net easily.



Ok, so the above code creates 100 images from the 320x320 tileset.png file. Each image is 32x32.



The above code is similiar to what you were doing with your X and Y loops drawing a portion of a map to screen.

I just copy and pasted this code over from existing, working code. I edited it a little bit to keep it short so it might be buggy or missing some small things. But it gives you an idea.

Of course, if a recent post of mine, I ran into FPS issues when you have a LOT of images created so not sure Image tpye the way to go yet, either!

Tashar
14
Years of Service
User Offline
Joined: 8th Oct 2009
Location:
Posted: 14th Oct 2009 02:45
Thanks for the response!

Wow, after allot of reading I ended up doing the same thing::



Now if i can just figure out out to do some transparency ,fog, funky color changes I'll be set.


As for the FPS Issue: I can get about 3,800 Images (32x32 Images) at 1440x900 Res. (Wide Screen) Not that I'm going to run like that but to support 1024x768 or the Wide Version 1280x7?? will be nice.

Login to post a reply

Server time is: 2024-04-20 11:50:59
Your offset time is: 2024-04-20 11:50:59