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.

Newcomers DBPro Corner / Memblock from Bitmap - Bitmap from memblock question

Author
Message
Daryn Alsup
16
Years of Service
User Offline
Joined: 5th Jul 2008
Location: In your head... dun dun DUN!!!!!!!!
Posted: 7th Sep 2008 08:28
I've been working on a tid-bit of code from a game I am calling "Deity." Upon selecting "New game," the user is then taken to the darkness of space where he/she can create a sun, planet(s) and moon(s). The bit of trouble I run into is designing the climate aspect of each planet.
Currently the process I am trying to use goes as follows: I first design my planet (bitmaps, width, height and so on) then I design the climate maps. (Climate maps are basically gray scale height maps in color) Climate maps are constantly changing based on the suns location from the planet, the current time of day and time of year AND the # of and size of land masses.
I then make a new bitmap and color it black. It is the same size as the climate map. I then make a memblock from the climate map. I call the BYTE value for the RED color. If RED is greater then 128 then that particular pixel is colored RGB 255, 255, 255 on the secondary bitmap. if it is lower then 128 it is painted black. The blue value is also called. and the same is done to it. The trouble is I cannot figure out how to do the entire bitmap. I can only color one pixel. Can some one please show me how this would be done?

Jack and Jill went up a hill to fetch a pale of water... but Jill got tired of his s#%& so she shot him.
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 7th Sep 2008 10:46
Take a look at the 2 memblock tutorials linked from this page:

http://members.thegamecreators.com/tutorialcity/html/newsletter.html

Daryn Alsup
16
Years of Service
User Offline
Joined: 5th Jul 2008
Location: In your head... dun dun DUN!!!!!!!!
Posted: 7th Sep 2008 12:18 Edited at: 7th Sep 2008 13:30
I got it!!! or atleast a simple version of what I want but thank you for the links it is greatly appreciated. And since I know there will be many others who will want to use it... here you go

(Note that a small picture with as many pixels as there are segments w/in your sphere object takes a bit of time... five or six seconds)



-Daryn

[Please remember to use code tags - IanM]

Jack and Jill went up a hill to fetch a pale of water... but Jill got tired of his s#%& so she shot him.
Daryn Alsup
16
Years of Service
User Offline
Joined: 5th Jul 2008
Location: In your head... dun dun DUN!!!!!!!!
Posted: 9th Sep 2008 13:00
Okay, now I have another question: Is there a way to use the file commands to store the location of pixels? The reason I ask comes from applying the make memblock from image - make image from memblock commands (in the above post) and then loading the image as a texture for a ghosted object. It takes SOOOOOO much time to process even the smallest image and then apply it as a texture when using memblocks that I need to know. Is there such a way to use files? For example:



Now I suppose your wondering about how we'll address the issue of the storms movement. By adding and subtracting values from the width and height (A and B in the above code), movement is achieved. Still, I need to know the correct way to use the file commands... as the above illustration does not work when correctly imputed into DBPro

Jack and Jill went up a hill to fetch a pale of water... but Jill got tired of his s#%& so she shot him.

Login to post a reply

Server time is: 2024-11-24 23:11:51
Your offset time is: 2024-11-24 23:11:51