Code: Select all
Tile **tile;
Code: Select all
Tile tileset[256];
unsigned char tile[WIDTH][HEIGHT];
Here is where the misunderstanding happened. He said it was "prettier' than doing Tile ***tiles. What the fuck datatype is that? Tile. Not a character. Not an index into a list. That is a fucking TILE POINTER.avansc wrote:while i agree that doing something like tile[layers][width][height]; is "prettier" than doing Tile ***tiles;
i prefer doing ***tiles. here is why.
So I was thinking that he was talking about dynamically allocated a 2D array where each element is a POINTER to a Tile. In which case everything that I said was completely, 100% correct. The sizeof(Tile*) is 4/8bytes while character index is 1 byte.
Then MAGICALLY, avansc comes back with 3D array of CHARACTERS. Now the third pointer dimension no longer represents a pointer to a Tile, but DEPTH.
There is a misunderstanding between whether we had a 2D array of Tile pointers or a 3D array of characters. Avansc said one thing, then flopped and showed the code and memory sizes for another.
I'm so fucking done here. Whether you did it on purpose or accident avansc, your original argument no longer matches the case you are trying to present. I'm sick of scouring through code and posts searching for logic and truth through misunderstandings and your inconsistencies.
Everything that I said was completely relevant and true to avansc's original argument of a dynamic 2D array of tile pointers. Now that avansc has changed completely, it's a simple matter of heap versus stack allocation, which is something that I never, ever would have argued about. And no shit, it isn't magically going to take more space on the heap than the stack.
Peace.