View previous topic - View next topic |
Author |
Message |
Mandrake elementry school minded asshole
Joined: 28 May 2002 Posts: 1341 Location: GNARR!
|
Posted: Fri May 13, 2005 7:11 pm Post subject: |
[quote] |
|
Question on the Tiled format-
Let's say I use a compress gzip'd format, when I uncompress it how will the data look? In other words- once I uncompress and un-base64 it, how do I read the data into a 2d array? _________________ "Well, last time I flicked on a lighter, I'm pretty sure I didn't create a black hole."-
Xmark
http://pauljessup.com
|
|
Back to top |
|
|
biggerUniverse Mage
Joined: 18 Nov 2003 Posts: 326 Location: A small, b/g planet in the unfashionable arm of the galaxy
|
Posted: Fri May 13, 2005 7:21 pm Post subject: |
[quote] |
|
It's 32-bit integers, row-major. So read it in widths back-to-back. _________________ We are on the outer reaches of someone else's universe.
|
|
Back to top |
|
|
Mandrake elementry school minded asshole
Joined: 28 May 2002 Posts: 1341 Location: GNARR!
|
Posted: Fri May 13, 2005 7:38 pm Post subject: |
[quote] |
|
Mehua? Row major? Read it widths back to back?
I take you mean that I could read it in like this (psuedo code):
for(y=0; y!=ytotl; y++)
{
for (x=0;x!=xtotl; x++)
{
map[x][y]=nextun;
}
}
I'm asking cause I'm thinking about writing a Python/PyGame lib to bring in Maps built with Tiled. Python has built in support for gzip compression, base 64 encoding and XML so it shouldn't be too complicated. The only problem (I can see) is how Python handles types (ie: implicit types created upon creation of a varaible...rather than the way I'm used too in Lua which is the type of a varaible is only created when the varaible is used, and then it's made to fit that type). _________________ "Well, last time I flicked on a lighter, I'm pretty sure I didn't create a black hole."-
Xmark
http://pauljessup.com
|
|
Back to top |
|
|
BigManJones Scholar
Joined: 22 Mar 2003 Posts: 196
|
Posted: Sat May 14, 2005 12:10 am Post subject: |
[quote] |
|
I stopped visiting these forums for two reasons;
1. General loss of interest in rpg developement
2. These forums seem to harbor overly agressive people (Mandrake, happy, that one guy I can't remember his name) and hence alot of flame wars.
Plus, I wasn't learning anything here so I only check in rarely.
|
|
Back to top |
|
|
biggerUniverse Mage
Joined: 18 Nov 2003 Posts: 326 Location: A small, b/g planet in the unfashionable arm of the galaxy
|
Posted: Sat May 14, 2005 6:28 am Post subject: |
[quote] |
|
Why did you post that here? Anyway, Mandrake, your psuedocode is correct. Good luck with that, hope to see some nifty screenies. ;)
EDIT: should probably be map[y][x] _________________ We are on the outer reaches of someone else's universe.
|
|
Back to top |
|
|
janus Mage
Joined: 29 Jun 2002 Posts: 464 Location: Issaquah, WA
|
Posted: Sat May 14, 2005 8:41 am Post subject: |
[quote] |
|
BigManJones wrote: | I stopped visiting these forums for two reasons;
1. General loss of interest in rpg developement
2. These forums seem to harbor overly agressive people (Mandrake, happy, that one guy I can't remember his name) and hence alot of flame wars.
Plus, I wasn't learning anything here so I only check in rarely. | I am bewildered that you would group Happy and Mandrake in the same category when it comes to being aggressive. I mean... wow.
|
|
Back to top |
|
|
Bjorn Demon Hunter
Joined: 29 May 2002 Posts: 1425 Location: Germany
|
Posted: Sat May 14, 2005 9:08 am Post subject: |
[quote] |
|
Mandrake wrote: | Question on the Tiled format-
Let's say I use a compress gzip'd format, when I uncompress it how will the data look? In other words- once I uncompress and un-base64 it, how do I read the data into a 2d array? |
Here's the piece of code that does this in The Mana World:
Code: | int binLen;
unsigned char *binData =
php_base64_decode(charData, strlen((char*)charData),
&binLen);
delete[] charData;
if (binData) {
for (int i = 0; i < binLen - 3; i += 4) {
int gid = binData[i] |
binData[i + 1] << 8 |
binData[i + 2] << 16 |
binData[i + 3] << 24;
setTileWithGid(map, x, y, layer, gid);
x++;
if (x == w) {x = 0; y++;}
}
free(binData);
} |
|
|
Back to top |
|
|
PhyrFox Tenshi's Bitch (Peach says "Suck it!")
Joined: 19 Nov 2004 Posts: 64 Location: New York, USA
|
Posted: Sun May 15, 2005 1:32 am Post subject: |
[quote] |
|
I got caught up in other projects that led me away from here, but I just couldn't stay away. I think I'll go back to my normal interactions-- so you might expect at least one post to be replied to that was already long dead-- I'll be adding in my usual two cents.
~= phyrfox =~
... not dead, just resting ...
|
|
Back to top |
|
|
Mandrake elementry school minded asshole
Joined: 28 May 2002 Posts: 1341 Location: GNARR!
|
Posted: Mon May 16, 2005 11:54 am Post subject: |
[quote] |
|
Bjorn- BiggerUniverse- that helps a ton. I probably won't be able to post screenies here until sometime next year. I might also be contacting you in a few months about *something*. Can't say what though. _________________ "Well, last time I flicked on a lighter, I'm pretty sure I didn't create a black hole."-
Xmark
http://pauljessup.com
|
|
Back to top |
|
|
Tenshi Everyone's Peachy Lil' Bitch
Joined: 31 May 2002 Posts: 386 Location: Newport News
|
Posted: Sun May 22, 2005 6:40 pm Post subject: |
[quote] |
|
- I fell off the face of the Coding Internet for a while but I'm in summer session and getting back into things. _________________ - Jaeda
|
|
Back to top |
|
|
DarkDread Wraith Lord
Joined: 28 May 2002 Posts: 422 Location: behind your bushes
|
Posted: Tue Aug 09, 2005 3:34 pm Post subject: |
[quote] |
|
This is my yearly post (whenever these threads come up) to say that yes, I still have a pulse, and yes, I still lurk in here from time to time, and no, I don't code anymore.
...and yes, I'm sure most of you don't even know who I am. :P _________________ "Goth is a way for ugly people to be interesting."
|
|
Back to top |
|
|
DrunkenCoder Demon Hunter
Joined: 29 May 2002 Posts: 559
|
Posted: Tue Aug 09, 2005 3:53 pm Post subject: |
[quote] |
|
DarkDread wrote: | This is my yearly post (whenever these threads come up) to say that yes, I still have a pulse, and yes, I still lurk in here from time to time, and no, I don't code anymore.
...and yes, I'm sure most of you don't even know who I am. :P |
Always nice to see you DD.
What are you up to then theese days? _________________ If there's life after death there is no death, if there's no death we never live. | ENTP
|
|
Back to top |
|
|
Ren Wandering Minstrel
Joined: 07 Aug 2004 Posts: 130 Location: turn around...
|
Posted: Wed Aug 10, 2005 11:13 am Post subject: |
[quote] |
|
DarkDread wrote: | ...and yes, I'm sure most of you don't even know who I am. :P |
Liar. So what's shaking? _________________ Previous nicks: MidnightDreamer, The_Anarchist, Shroomasta.
ren-tek.net : BGC games and more!
|
|
Back to top |
|
|
tcaudilllg Dragonmaster
Joined: 20 Jun 2002 Posts: 1731 Location: Cedar Bluff, VA
|
Posted: Thu Aug 11, 2005 10:50 pm Post subject: |
[quote] |
|
DD: did you ever start with that game you were considering as an episodic sell?
|
|
Back to top |
|
|
bay Wandering Minstrel
Joined: 17 Mar 2004 Posts: 138 Location: new jersey, usa
|
Posted: Mon Aug 15, 2005 4:26 am Post subject: |
[quote] |
|
after a bit of a haitus i think i'm back.
.02$
|
|
Back to top |
|
|