1
Pixel Art / Re: Some help/hints/critique appreciated.
« on: December 31, 2012, 10:19:33 pm »Why are you even posting then? If you just wanted to test the collision, just draw a big potato and test it. Or just get the sprite silently and don't be an asshole everywhere you go, since you don't seem to care anyway.Read OP post: "Can you give me some hints on how to do it better/faster?"
I think it's smart to keep in mind that even if you steal resources up until project completion, you won't be able to really feature it anywhere credibleI'm not doing any commercial work anyway.
copyright rules "may not apply to you in Russia" (which is actually very incorrect)Russia isn't subordinate to US. I.e. Russia still has it's own army and not a NATO country, while USA is considered main enemy of humanity, so Russians have no reason to respect American copyright. And while it is wrong to steal art by russian artist, I can freely rip off americans.
but any major outlet that finds evidence of thievery will turn down your game in a flash -- many minor outlets will, too.PirateBay, rapidshare, etc…
(This just looks like poorly designed code to me.)You're welcome to write shorter code.
Here is it's C/C++/C#/Java (hate this language) version:
C/C++:
Code: [Select]
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
typedef struct chunk {
uint8_t Tag[5];
uint32_t Len;
uint8_t *Data;
struct chunk *Next;
} chunk;
chunk *loadChunks(char *FileName) {
int I, L;
uint8_t *D, *P, *E;
chunk *C=0, *T, *N;
FILE *F = fopen(FileName, "r");
fseek(F, 0, SEEK_END);
L = ftell(F);
D = P = (uint8_t *)malloc(L);
E = P+L;
fseek(F, 0, SEEK_SET);
fread(D, 1, L, F);
fclose(F);
while (P < E) {
T = (chunk *)malloc(sizeof(chunk));
memcpy(T->Tag, P, 4);
T->Tag[4] = 0;
P += 4;
T->Len = *(uint32_t *)P;
P += 4;
T->Data = (uint8_t *)malloc(T->Len);
memcpy(T->Data, P, T->Len);
P += T->Len;
T->Next = C;
C = T;
}
for (T = 0; C; C = N) {
N = C->Next;
C->Next = T;
T = C;
}
free(D);
return T;
}