|
Sending a BMP or a TGA file
#116262
03/10/07 09:50
03/10/07 09:50
|
Joined: Jun 2006
Posts: 2,640 Earth
Germanunkol
OP
Expert
|
OP
Expert
Joined: Jun 2006
Posts: 2,640
Earth
|
Hi! I would like all the players to have the option creating their own logo, and use this logo in a multiplayer game.
If you've played X˛ - the Thread, you might remember the logo that is attached to the ship. You can create your own logo and save it into a folder, and then choose this logo to be displayed on your ship. We'll worry about putting the ship logo on the ship later on, maybe by manipulating the skins or just using a sprite.
For now, we're trying to figure out how to send the image - automatically - over the net, so that when I make my own logo on my computer, it can be displayed on all other computers as well. Also, is there a way to make things safer? I certainly don't want any viruses to be send over the net...
I don't know too much about sending files/network outside 3dgs...
Thanks, Micha
P.S. we're using populace. Shouldn't really matter... but just in case you need to know. I also have the GSHTTP.dll, which should be able to download the file...?
~"I never let school interfere with my education"~ -Mark Twain
|
|
|
Re: Sending a BMP or a TGA file
[Re: fastlane69]
#116265
03/11/07 12:33
03/11/07 12:33
|
Joined: Aug 2005
Posts: 343 Germany
HPW
Senior Member
|
Senior Member
Joined: Aug 2005
Posts: 343
Germany
|
You could try to open the images with file_open_read and read the content into a String, then send the string to a 3DGS Server application and save it as a file with str_open_write. If clients connects to the server than you could send the image in the same way to the clients. Viruses are really a problem, but without a implementet virus search engine in 3DGS you can't really be sure to avoid them.
Evil Blood (v. 0.52) RPG Commport.de (Social Network Community)
|
|
|
Re: Sending a BMP or a TGA file
[Re: Leonardo]
#116267
03/11/07 13:20
03/11/07 13:20
|
Joined: Aug 2005
Posts: 343 Germany
HPW
Senior Member
|
Senior Member
Joined: Aug 2005
Posts: 343
Germany
|
If you can import an bitmap into the "pixel-editor" like Leonardo wrote, than you can also be more sure to avoid viruses. You only send then 3 or 4 arrays to the server and the clients, like array_red[512], array_green[512], array_blue[512], array_alpha[512].
Last edited by HPW; 03/11/07 13:21.
Evil Blood (v. 0.52) RPG Commport.de (Social Network Community)
|
|
|
Re: Sending a BMP or a TGA file
[Re: Leonardo]
#116268
03/11/07 13:23
03/11/07 13:23
|
Joined: Jan 2006
Posts: 1,829 Neustadt, Germany
TWO
Serious User
|
Serious User
Joined: Jan 2006
Posts: 1,829
Neustadt, Germany
|
Reading and sending the file in C-Script should not work, because C-Script uses formatet reading afaik. But it's possible in C++ via the ios::binary flag, search in good for fstream.
If it's not like a said and C-Script gets the bits unchanged, this should easly be possible. Just do like HPW told you, open the file, read it into a string and send the string. At the other clients, create a black bitmap and write the data to it.
|
|
|
Re: Sending a BMP or a TGA file
[Re: TWO]
#116269
03/11/07 13:32
03/11/07 13:32
|
Joined: Aug 2005
Posts: 343 Germany
HPW
Senior Member
|
Senior Member
Joined: Aug 2005
Posts: 343
Germany
|
It is also possible with sending the arrays (red, green, blue and alpha) and use the draw or bitmap methods of 3DGS. You could use draw_line with only 1 pixel length of the line for each pixel or use pixel_to_bmap for this.
Evil Blood (v. 0.52) RPG Commport.de (Social Network Community)
|
|
|
Re: Sending a BMP or a TGA file
[Re: Nagashi]
#116271
03/12/07 12:33
03/12/07 12:33
|
Joined: Jun 2006
Posts: 2,640 Earth
Germanunkol
OP
Expert
|
OP
Expert
Joined: Jun 2006
Posts: 2,640
Earth
|
you guys rule. Thanks for every single answer I'll fiddle around with this, and maybe host the code afterwards, if I get something working. Thanks!! Micha
~"I never let school interfere with my education"~ -Mark Twain
|
|
|
|