-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
Am 2016-01-02 um 22:57 schrieb Aaryaman Vasishta:
- for (i = 0, j = 0; i < size;)
- {
if (palettized)
{
buffer[i++] = j;
buffer[i++] = j;
buffer[i++] = j++;
j %= 256;
}
You're still initializing 3 pixels here. This will go wrong if size isn't a multiple of 3.
+struct texture_test
+{
- int version;
- int w;
- int h;
- BOOL palettized;
- BOOL upside_down;
+};
upside_down is unused.
You can make this an anonymous structure:
static void test_load_texture(void)
{
static const struct
{
int version;
...
}
tests[] =
{
{ 1, 100, 100, TRUE },
...
};
...
}
No need to have a global struct declaration.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
iQIcBAEBCAAGBQJWiXP7AAoJEN0/YqbEcdMwuhgP/0hLiEmRWbxxxfpe7ndxtq1Z
DdbBsB3Mzd2r062tVeFl5fM2zxTAfD0XIHBEnJiAXgbkvZYfJelc9oWzU+k6dbb3
SnpbxGQo0K9YQQMXMxQwAcd6e72dNysEEEF66wowLoyYuSej5uHm4CKr030s9qAN
14Dkr+3O5yXXHGLewKaFptOnePBEhRNPKo2xxV2QNJRlA4Vl+Cck+89O6yW2iGjS
/ubaZ72wYlZaC14AiYGaUof0oYsyf2GjneyxKWbGxsy9oieB8JayCDaajtNjo7Pi
WpunKlMzbi+mQgJ0lAloFcyuEKfZQBboMWCibkOIAJc4jyT4FMls77cPUme0wKBA
AR7vSupCSTxVKucbppEuI0Wbaaa/t9UycAB+WnTsm0Vvj4/NC+eXDz6GFhk41Els
C5wlSfKCFetPP/ItZKLwI/4nSNRHehfv51T0LwS0DcPe3BGSMaxYcYP6OnHvc/nk
zZzUresWwyUXq4Sk6/XdTjcMQ+SUZeBRCDPDpQivuvY2I3ABz2AeuCgNk0viGJyp
SROL+bpF2YGU+Fr3sD306fIE3nd4q0sUQ71BwAQ49Kj5ZuFfjv9/RvL8JL0Ao0YP
OP3esHNFazQIVMNXwuEVK3YMPnQqN2smHcVPgBPYbC75BB2KciAkKqjCdnsJ2wua
3zutYgIYY7j/HkhfmCgX
=3JVE
-----END PGP SIGNATURE-----