faster collisions

Squashed commit of the following:

commit 053c06ea29702728e2605899a2b47edac647c459
Author: Alvie Rahman <alvierahman90@gmail.com>
Date:   Sat Dec 3 16:09:51 2022 +0000

    begin documentation on codebase: sprite metadata

commit 435f0c62743112818594f4b1a902d90d1f60823a
Author: Alvie Rahman <alvierahman90@gmail.com>
Date:   Sat Dec 3 16:05:37 2022 +0000

    formatting, mostly

commit f338476aaf4c33081969b18b2a6d13a3639571cd
Author: Alvie Rahman <alvierahman90@gmail.com>
Date:   Fri Dec 2 23:18:27 2022 +0000

    way faster collisions
This commit is contained in:
2022-12-03 16:13:44 +00:00
parent ea60bdeede
commit 6e1690ceea
6 changed files with 140 additions and 202 deletions

View File

@@ -16,59 +16,51 @@ Sprite sprites_info[] = {
.bitmap_indexes[SI_UP] = 12, .bitmap_prop[SI_UP] = 0,
.collision_offset[SI_UP] = {
.itl = { .x = 3, .y = 8},
.itr = { .x = 1, .y = 8},
.ibl = { .x = 3, .y = 1},
.ibr = { .x = 1, .y = 1},
3, 8, 1, 7,
255, 255, 255, 255,
255, 255, 255, 255
},
.bitmap_indexes[SI_DOWN] = 12, .bitmap_prop[SI_DOWN] = S_FLIPY,
.collision_offset[SI_DOWN] = {
.itl = { .x = 3, .y = 8},
.itr = { .x = 1, .y = 8},
.ibl = { .x = 3, .y = 1},
.ibr = { .x = 1, .y = 1},
3, 2, 1, 1,
255, 255, 255, 255,
255, 255, 255, 255
},
.bitmap_indexes[SI_LEFT] = 11, .bitmap_prop[SI_LEFT] = 0,
.collision_offset[SI_LEFT] = {
.itl = { .x = 8, .y = 3},
.itr = { .x = 1, .y = 3},
.ibl = { .x = 8, .y = 1},
.ibr = { .x = 1, .y = 1},
8, 3, 7, 1,
255, 255, 255, 255,
255, 255, 255, 255
},
.bitmap_indexes[SI_RIGHT] = 11, .bitmap_prop[SI_RIGHT] = S_FLIPX,
.collision_offset[SI_RIGHT] = {
.itl = { .x = 8, .y = 3},
.itr = { .x = 1, .y = 3},
.ibl = { .x = 8, .y = 1},
.ibr = { .x = 1, .y = 1},
2, 3, 1, 1,
255, 255, 255, 255,
255, 255, 255, 255
},
.bitmap_indexes[SI_UP_RIGHT] = 13, .bitmap_prop[SI_UP_RIGHT] = 0,
.collision_offset[SI_UP_RIGHT] = {
.itl = { .x = 7, .y = 8},
.itr = { .x = 1, .y = 8},
.ibl = { .x = 7, .y = 2},
.ibr = { .x = 1, .y = 2},
2, 8, 1, 7,
255, 255, 255, 255,
255, 255, 255, 255
},
.bitmap_indexes[SI_UP_LEFT] = 13, .bitmap_prop[SI_UP_LEFT] = S_FLIPX,
.collision_offset[SI_UP_LEFT] = {
.itl = { .x = 8, .y = 8},
.itr = { .x = 2, .y = 8},
.ibl = { .x = 8, .y = 2},
.ibr = { .x = 2, .y = 2},
8, 8, 7, 7,
255, 255, 255, 255,
255, 255, 255, 255
},
.bitmap_indexes[SI_DOWN_LEFT] = 13, .bitmap_prop[SI_DOWN_LEFT] = S_FLIPX | S_FLIPY,
.collision_offset[SI_DOWN_LEFT] = {
.itl = { .x = 8, .y = 7},
.itr = { .x = 2, .y = 7},
.ibl = { .x = 8, .y = 1},
.ibr = { .x = 2, .y = 1},
8, 2, 7, 1,
255, 255, 255, 255,
255, 255, 255, 255
},
.bitmap_indexes[SI_DOWN_RIGHT] = 13, .bitmap_prop[SI_DOWN_RIGHT] = S_FLIPY,
.collision_offset[SI_DOWN_RIGHT] = {
.itl = { .x = 7, .y = 7},
.itr = { .x = 1, .y = 7},
.ibl = { .x = 7, .y = 1},
.ibr = { .x = 1, .y = 1},
2, 2, 1, 1,
255, 255, 255, 255,
255, 255, 255, 255
}
},
{
@@ -84,59 +76,51 @@ Sprite sprites_info[] = {
.bitmap_indexes[SI_UP] = 14, .bitmap_prop[SI_UP] = 0,
.collision_offset[SI_UP] = {
.itl = { .x = 8, .y = 8},
.itr = { .x = 1, .y = 8},
.ibl = { .x = 8, .y = 1},
.ibr = { .x = 1, .y = 1},
8,8, 1,1,
255, 255, 255, 255,
255, 255, 255, 255
},
.bitmap_indexes[SI_DOWN] = 15, .bitmap_prop[SI_DOWN] = 0,
.collision_offset[SI_DOWN] = {
.itl = { .x = 8, .y = 8},
.itr = { .x = 1, .y = 8},
.ibl = { .x = 8, .y = 1},
.ibr = { .x = 1, .y = 1},
8,8, 1,1,
255, 255, 255, 255,
255, 255, 255, 255
},
.bitmap_indexes[SI_LEFT] = 14, .bitmap_prop[SI_LEFT] = 0,
.collision_offset[SI_LEFT] = {
.itl = { .x = 8, .y = 8},
.itr = { .x = 1, .y = 8},
.ibl = { .x = 8, .y = 1},
.ibr = { .x = 1, .y = 1},
8,8, 1,1,
255, 255, 255, 255,
255, 255, 255, 255
},
.bitmap_indexes[SI_RIGHT] = 14, .bitmap_prop[SI_RIGHT] = S_FLIPX,
.collision_offset[SI_RIGHT] = {
.itl = { .x = 8, .y = 8},
.itr = { .x = 1, .y = 8},
.ibl = { .x = 8, .y = 1},
.ibr = { .x = 1, .y = 1},
8,8, 1,1,
255, 255, 255, 255,
255, 255, 255, 255
},
.bitmap_indexes[SI_UP_RIGHT] = 14, .bitmap_prop[SI_UP_RIGHT] = 0,
.collision_offset[SI_UP_RIGHT] = {
.itl = { .x = 8, .y = 8},
.itr = { .x = 1, .y = 8},
.ibl = { .x = 8, .y = 1},
.ibr = { .x = 1, .y = 1},
8,8, 1,1,
255, 255, 255, 255,
255, 255, 255, 255
},
.bitmap_indexes[SI_UP_LEFT] = 14, .bitmap_prop[SI_UP_LEFT] = S_FLIPX,
.collision_offset[SI_UP_LEFT] = {
.itl = { .x = 8, .y = 8},
.itr = { .x = 1, .y = 8},
.ibl = { .x = 8, .y = 1},
.ibr = { .x = 1, .y = 1},
8,8, 1,1,
255, 255, 255, 255,
255, 255, 255, 255
},
.bitmap_indexes[SI_DOWN_LEFT] = 15, .bitmap_prop[SI_DOWN_LEFT] = 0,
.collision_offset[SI_DOWN_LEFT] = {
.itl = { .x = 8, .y = 8},
.itr = { .x = 1, .y = 8},
.ibl = { .x = 8, .y = 1},
.ibr = { .x = 1, .y = 1},
8,8, 1,1,
255, 255, 255, 255,
255, 255, 255, 255
},
.bitmap_indexes[SI_DOWN_RIGHT] = 15, .bitmap_prop[SI_DOWN_RIGHT] = S_FLIPX,
.collision_offset[SI_DOWN_RIGHT] = {
.itl = { .x = 8, .y = 8},
.itr = { .x = 1, .y = 8},
.ibl = { .x = 8, .y = 1},
.ibr = { .x = 1, .y = 1},
8,8, 1,1,
255, 255, 255, 255,
255, 255, 255, 255
}
},
{
@@ -152,59 +136,51 @@ Sprite sprites_info[] = {
.bitmap_indexes[SI_UP] = 25, .bitmap_prop[SI_UP] = 0,
.collision_offset[SI_UP] = {
.itl = { .x = 8, .y = 8},
.itr = { .x = 1, .y = 8},
.ibl = { .x = 8, .y = 1},
.ibr = { .x = 1, .y = 1},
8,8, 1,1,
255, 255, 255, 255,
255, 255, 255, 255
},
.bitmap_indexes[SI_DOWN] = 22, .bitmap_prop[SI_DOWN] = 0,
.collision_offset[SI_DOWN] = {
.itl = { .x = 8, .y = 8},
.itr = { .x = 1, .y = 8},
.ibl = { .x = 8, .y = 1},
.ibr = { .x = 1, .y = 1},
8,8, 1,1,
255, 255, 255, 255,
255, 255, 255, 255
},
.bitmap_indexes[SI_LEFT] = 21, .bitmap_prop[SI_LEFT] = 0,
.collision_offset[SI_LEFT] = {
.itl = { .x = 8, .y = 5},
.itr = { .x = 1, .y = 5},
.ibl = { .x = 8, .y = 1},
.ibr = { .x = 1, .y = 1},
8,5, 1,1,
255, 255, 255, 255,
255, 255, 255, 255
},
.bitmap_indexes[SI_RIGHT] = 21, .bitmap_prop[SI_RIGHT] = S_FLIPX,
.collision_offset[SI_RIGHT] = {
.itl = { .x = 8, .y = 5},
.itr = { .x = 1, .y = 5},
.ibl = { .x = 8, .y = 1},
.ibr = { .x = 1, .y = 1},
8,5, 1,1,
255, 255, 255, 255,
255, 255, 255, 255
},
.bitmap_indexes[SI_UP_RIGHT] = 23, .bitmap_prop[SI_UP_RIGHT] = 0,
.collision_offset[SI_UP_RIGHT] = {
.itl = { .x = 8, .y = 8},
.itr = { .x = 1, .y = 8},
.ibl = { .x = 8, .y = 1},
.ibr = { .x = 1, .y = 1},
8,8, 1,1,
255, 255, 255, 255,
255, 255, 255, 255
},
.bitmap_indexes[SI_UP_LEFT] = 23, .bitmap_prop[SI_UP_LEFT] = S_FLIPX,
.collision_offset[SI_UP_LEFT] = {
.itl = { .x = 8, .y = 8},
.itr = { .x = 1, .y = 8},
.ibl = { .x = 8, .y = 1},
.ibr = { .x = 1, .y = 1},
8,8, 1,1,
255, 255, 255, 255,
255, 255, 255, 255
},
.bitmap_indexes[SI_DOWN_LEFT] = 24, .bitmap_prop[SI_DOWN_LEFT] = S_FLIPX,
.collision_offset[SI_DOWN_LEFT] = {
.itl = { .x = 8, .y = 7},
.itr = { .x = 1, .y = 7},
.ibl = { .x = 8, .y = 1},
.ibr = { .x = 1, .y = 1},
8,7, 1,1,
255, 255, 255, 255,
255, 255, 255, 255
},
.bitmap_indexes[SI_DOWN_RIGHT] = 24, .bitmap_prop[SI_DOWN_RIGHT] = 0,
.collision_offset[SI_DOWN_RIGHT] = {
.itl = { .x = 8, .y = 7},
.itr = { .x = 1, .y = 7},
.ibl = { .x = 8, .y = 1},
.ibr = { .x = 1, .y = 1},
8,7, 1,1,
255, 255, 255, 255,
255, 255, 255, 255
}
}
};