Problems sending a BMAP

Posted By: annonymie

Problems sending a BMAP - 02/25/12 10:50

Hello,

i try to send a PANEL.bmap to a client when he joined the game. Unfortunaly it don't work with send_var_id, send_data_id. Also when I try to send pixel for pixel... Error or no change on client... I don't know, what's wrong, sending normal vars works very well.

Please help smile
Posted By: Dark_samurai

Re: Problems sending a BMAP - 02/25/12 12:03

.bmap of a panel is a pointer. Pointers aren't globally valid. This means that the pointer will point on something different on a different pc. Thus sending a pointer won't work. What you could do is that you create your own unique identification:

Code:
BAMP* bmap1 = "testimg.bmp";
BAMP* bmap2 = "testimt2.bmp";

//send a variable with value 1 or 2. On the client check which number was sent and use either bmap1 or bmap2



Sending the bmap pixle by pixel works for sure:

Code:
COLOR image[128]; //store a 64x64 image 

int i=0;
for(;i < 128; i++)
{
//copy the color of every pixel into the array
}

//send the content of the whole array to the client



On the client create an empty 64x64 bmap and fill it with the colors you received by the array.

Please note that the code I posted is only shematic, because I was too lazy to look for the according functions ^^
© 2024 lite-C Forums