Fixes a bunch of lint errors
This commit is contained in:
parent
2aba6c4338
commit
fc6bb50460
11
Makefile
11
Makefile
|
@ -7,12 +7,12 @@ release:
|
||||||
.PHONY: release
|
.PHONY: release
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
@make clean -sC _build/debug
|
@make -sC _build/debug clean
|
||||||
@make clean -sC _build/release
|
@make -sC _build/release clean
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
|
|
||||||
test:
|
test:
|
||||||
@make test -sC _build/debug
|
@make -sC _build/debug test
|
||||||
.PHONY: test
|
.PHONY: test
|
||||||
|
|
||||||
run: $(all)
|
run: $(all)
|
||||||
|
@ -24,11 +24,11 @@ playtest: $(all)
|
||||||
.PHONY: playtest
|
.PHONY: playtest
|
||||||
|
|
||||||
lint:
|
lint:
|
||||||
@make lint -sC _build/debug
|
@make -sC _build/debug lint
|
||||||
.PHONY: lint
|
.PHONY: lint
|
||||||
|
|
||||||
package:
|
package:
|
||||||
@make package -sC _build/release
|
@make -sC _build/release package
|
||||||
.PHONY: package
|
.PHONY: package
|
||||||
|
|
||||||
setup:
|
setup:
|
||||||
|
@ -46,4 +46,5 @@ setup:
|
||||||
|
|
||||||
teardown:
|
teardown:
|
||||||
@rm -rf _build
|
@rm -rf _build
|
||||||
|
@rm compile_commands.json
|
||||||
.PHONY: teardown
|
.PHONY: teardown
|
||||||
|
|
|
@ -47,7 +47,7 @@ actiontext_render(ActionText *t, Camera *cam)
|
||||||
if (t->dead)
|
if (t->dead)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!t->dead && !timer_started(t->timer))
|
if (!timer_started(t->timer))
|
||||||
timer_start(t->timer);
|
timer_start(t->timer);
|
||||||
|
|
||||||
if (timer_get_ticks(t->timer) < 500) {
|
if (timer_get_ticks(t->timer) < 500) {
|
||||||
|
|
|
@ -32,7 +32,7 @@ actiontextbuilder_init(SDL_Renderer *renderer)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
actiontextbuilder_create_text(const char *msg, SDL_Color color, Position *p)
|
actiontextbuilder_create_text(const char *msg, SDL_Color color, const Position *p)
|
||||||
{
|
{
|
||||||
assert (gRenderer != NULL);
|
assert (gRenderer != NULL);
|
||||||
Sprite *sprite = sprite_create();
|
Sprite *sprite = sprite_create();
|
||||||
|
|
|
@ -34,7 +34,7 @@ void
|
||||||
actiontextbuilder_render(Camera*);
|
actiontextbuilder_render(Camera*);
|
||||||
|
|
||||||
void
|
void
|
||||||
actiontextbuilder_create_text(const char *msg, SDL_Color, Position*);
|
actiontextbuilder_create_text(const char *msg, SDL_Color, const Position*);
|
||||||
|
|
||||||
void
|
void
|
||||||
actiontextbuilder_close(void);
|
actiontextbuilder_close(void);
|
||||||
|
|
|
@ -86,7 +86,7 @@ animation_render(Animation *animation, Camera *camera)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
animation_set_frames(Animation *animation, AnimationClip clips[])
|
animation_set_frames(Animation *animation, const AnimationClip clips[])
|
||||||
{
|
{
|
||||||
for (size_t i = 0; i < animation->clipCount; i++) {
|
for (size_t i = 0; i < animation->clipCount; i++) {
|
||||||
animation->clips[i] = clips[i];
|
animation->clips[i] = clips[i];
|
||||||
|
|
|
@ -53,7 +53,7 @@ void
|
||||||
animation_load_texture(Animation *, const char *path, SDL_Renderer*);
|
animation_load_texture(Animation *, const char *path, SDL_Renderer*);
|
||||||
|
|
||||||
void
|
void
|
||||||
animation_set_frames(Animation*, AnimationClip clips[]);
|
animation_set_frames(Animation*, const AnimationClip clips[]);
|
||||||
|
|
||||||
void
|
void
|
||||||
animation_run(Animation*);
|
animation_run(Animation*);
|
||||||
|
|
|
@ -303,7 +303,7 @@ artifact_create(MagicalEffect effect)
|
||||||
}
|
}
|
||||||
|
|
||||||
Artifact *
|
Artifact *
|
||||||
artifact_copy(Artifact *a)
|
artifact_copy(const Artifact *a)
|
||||||
{
|
{
|
||||||
Artifact *new = ec_malloc(sizeof(Artifact));
|
Artifact *new = ec_malloc(sizeof(Artifact));
|
||||||
*new = *a;
|
*new = *a;
|
||||||
|
|
|
@ -66,7 +66,7 @@ Artifact *
|
||||||
artifact_create(MagicalEffect);
|
artifact_create(MagicalEffect);
|
||||||
|
|
||||||
Artifact *
|
Artifact *
|
||||||
artifact_copy(Artifact*);
|
artifact_copy(const Artifact*);
|
||||||
|
|
||||||
void
|
void
|
||||||
artifact_render(Artifact*, Camera*);
|
artifact_render(Artifact*, Camera*);
|
||||||
|
|
|
@ -204,7 +204,6 @@ create_treasure(int current_level)
|
||||||
unsigned int value;
|
unsigned int value;
|
||||||
|
|
||||||
amt = (unsigned int) 1 + get_random(5*current_level) % 40;
|
amt = (unsigned int) 1 + get_random(5*current_level) % 40;
|
||||||
amt = amt == 0 ? 1 : amt;
|
|
||||||
|
|
||||||
if (current_level > 9) {
|
if (current_level > 9) {
|
||||||
highest_treasure = PLATINUM;
|
highest_treasure = PLATINUM;
|
||||||
|
|
|
@ -109,7 +109,7 @@ void* linkedlist_get(LinkedList **head, unsigned int index)
|
||||||
return linkedlist_get(&(*head)->next, --index);
|
return linkedlist_get(&(*head)->next, --index);
|
||||||
}
|
}
|
||||||
|
|
||||||
void linkedlist_each(LinkedList **head, void (*fun)(void*))
|
void linkedlist_each(const LinkedList **head, void (*fun)(void*))
|
||||||
{
|
{
|
||||||
LinkedList *next = *head;
|
LinkedList *next = *head;
|
||||||
|
|
||||||
|
|
|
@ -37,7 +37,7 @@ void* linkedlist_poplast(LinkedList **head);
|
||||||
|
|
||||||
void* linkedlist_get(LinkedList **head, unsigned int index);
|
void* linkedlist_get(LinkedList **head, unsigned int index);
|
||||||
|
|
||||||
void linkedlist_each(LinkedList **head, void (*fun)(void*));
|
void linkedlist_each(const LinkedList **head, void (*fun)(void*));
|
||||||
|
|
||||||
void linkedlist_destroy(LinkedList **head);
|
void linkedlist_destroy(LinkedList **head);
|
||||||
|
|
||||||
|
|
|
@ -110,7 +110,7 @@ menu_create_character_selector(void (*onCharacterSelect)(const char *), Camera *
|
||||||
"Commissions/Mage.png"
|
"Commissions/Mage.png"
|
||||||
};
|
};
|
||||||
|
|
||||||
static char *callbackData[] = {
|
static const char *callbackData[] = {
|
||||||
"warrior",
|
"warrior",
|
||||||
"rogue",
|
"rogue",
|
||||||
"mage"
|
"mage"
|
||||||
|
|
|
@ -114,7 +114,7 @@ mixer_toggle_sound(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
mixer_toggle_music(GameState *state)
|
mixer_toggle_music(const GameState *state)
|
||||||
{
|
{
|
||||||
Settings *settings = settings_get();
|
Settings *settings = settings_get();
|
||||||
settings->music_enabled = !settings->music_enabled;
|
settings->music_enabled = !settings->music_enabled;
|
||||||
|
|
|
@ -79,7 +79,7 @@ bool
|
||||||
mixer_toggle_sound(void);
|
mixer_toggle_sound(void);
|
||||||
|
|
||||||
bool
|
bool
|
||||||
mixer_toggle_music(GameState*);
|
mixer_toggle_music(const GameState*);
|
||||||
|
|
||||||
void
|
void
|
||||||
mixer_play_effect(Fx fx);
|
mixer_play_effect(Fx fx);
|
||||||
|
|
|
@ -474,7 +474,7 @@ monster_coward_walk(Monster *m, RoomMatrix *rm)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
on_monster_move(Monster *m, Position *origPos, Map *map, RoomMatrix *rm)
|
on_monster_move(Monster *m, const Position *origPos, Map *map, RoomMatrix *rm)
|
||||||
{
|
{
|
||||||
Position currentTilePos = position_to_matrix_coords(&m->sprite->pos);
|
Position currentTilePos = position_to_matrix_coords(&m->sprite->pos);
|
||||||
Player *player = rm->spaces[rm->playerRoomPos.x][rm->playerRoomPos.y].player;
|
Player *player = rm->spaces[rm->playerRoomPos.x][rm->playerRoomPos.y].player;
|
||||||
|
|
|
@ -64,7 +64,7 @@ load_texture(SkillBar *bar, const char *path, SDL_Renderer *renderer)
|
||||||
s->dim = (Dimension) { 8, 8 };
|
s->dim = (Dimension) { 8, 8 };
|
||||||
s->fixed = true;
|
s->fixed = true;
|
||||||
sprite_load_text_texture(s, "GUI/SDS_8x8.ttf", 0, 8, 0);
|
sprite_load_text_texture(s, "GUI/SDS_8x8.ttf", 0, 8, 0);
|
||||||
m_sprintf(buffer, 4, "%u", i + 1 < 10 ? i + 1 : 0);
|
m_sprintf(buffer, 4, "%u", i + 1);
|
||||||
texture_load_from_text(s->textures[0], buffer, C_YELLOW, C_BLACK, renderer);
|
texture_load_from_text(s->textures[0], buffer, C_YELLOW, C_BLACK, renderer);
|
||||||
linkedlist_append(&bar->sprites, s);
|
linkedlist_append(&bar->sprites, s);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue