Skip to content

Commit 719e627

Browse files
committed
alphabetized functions in input.c and moved declarations to input.h
1 parent 5ee0927 commit 719e627

File tree

8 files changed

+41
-15
lines changed

8 files changed

+41
-15
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
src/*.o
55
src/.deps
66
src/.deps/*
7+
src/.*
78
.gitignore
89
*core*
910
src/*core*

ChangeLog

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
for version 0.12
2+
* code refactoring: alphabetized functions in input.c and moved declarations to input.h (kmw, 2017-12-26)
23
* when a non-player creature kills another creature, that creature is properly killed in-game (i.e. via killCreature()) rather than just
34
ignored (kmw, 2018-04-28)
45
* code refactoring: alphabetized functions in game.c and moved declarations to game.h (kmw, 2017-12-26)

src/Makefile.am

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@ lvt_SOURCES = allocator.c \
1414
faction.c \
1515
flooritems.c \
1616
game.c \
17+
input.c \
1718
targeting.c \
1819
leveldisp.c levelgen.c main.c pcg_basic.c random.c map.c screen.c \
19-
move.c input.c stringlookups.c speciesinfo.c \
20+
move.c stringlookups.c speciesinfo.c \
2021
util.c messages.c questions.c name.c \
2122
item.c look.c itemmgmt.c \
2223
inventory.c spawnitem.c throw.c plantgen.c plantlist.c plantmgmt.c plants.c \
@@ -36,6 +37,7 @@ noinst_HEADERS = allocator.h \
3637
faction.h \
3738
flooritems.h \
3839
game.h \
40+
input.h \
3941
levelgen.h \
4042
targeting.h \
4143
lvt.h level.h pcg_basic.h creature.h messages.h types.h move.h stringlookups.h \

src/Makefile.in

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,9 @@ am_lvt_OBJECTS = allocator.$(OBJEXT) attack.$(OBJEXT) \
107107
creatureinventory.$(OBJEXT) creaturelist.$(OBJEXT) \
108108
creaturemgmt.$(OBJEXT) creaturemove.$(OBJEXT) eat.$(OBJEXT) \
109109
faction.$(OBJEXT) flooritems.$(OBJEXT) game.$(OBJEXT) \
110-
targeting.$(OBJEXT) leveldisp.$(OBJEXT) levelgen.$(OBJEXT) \
111-
main.$(OBJEXT) pcg_basic.$(OBJEXT) random.$(OBJEXT) \
112-
map.$(OBJEXT) screen.$(OBJEXT) move.$(OBJEXT) input.$(OBJEXT) \
110+
input.$(OBJEXT) targeting.$(OBJEXT) leveldisp.$(OBJEXT) \
111+
levelgen.$(OBJEXT) main.$(OBJEXT) pcg_basic.$(OBJEXT) \
112+
random.$(OBJEXT) map.$(OBJEXT) screen.$(OBJEXT) move.$(OBJEXT) \
113113
stringlookups.$(OBJEXT) speciesinfo.$(OBJEXT) util.$(OBJEXT) \
114114
messages.$(OBJEXT) questions.$(OBJEXT) name.$(OBJEXT) \
115115
item.$(OBJEXT) look.$(OBJEXT) itemmgmt.$(OBJEXT) \
@@ -279,9 +279,10 @@ lvt_SOURCES = allocator.c \
279279
faction.c \
280280
flooritems.c \
281281
game.c \
282+
input.c \
282283
targeting.c \
283284
leveldisp.c levelgen.c main.c pcg_basic.c random.c map.c screen.c \
284-
move.c input.c stringlookups.c speciesinfo.c \
285+
move.c stringlookups.c speciesinfo.c \
285286
util.c messages.c questions.c name.c \
286287
item.c look.c itemmgmt.c \
287288
inventory.c spawnitem.c throw.c plantgen.c plantlist.c plantmgmt.c plants.c \
@@ -302,6 +303,7 @@ noinst_HEADERS = allocator.h \
302303
faction.h \
303304
flooritems.h \
304305
game.h \
306+
input.h \
305307
levelgen.h \
306308
targeting.h \
307309
lvt.h level.h pcg_basic.h creature.h messages.h types.h move.h stringlookups.h \

src/game.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#include "creaturemgmt.h"
3030
#include "creaturemove.h"
3131
#include "eat.h"
32+
#include "input.h"
3233
#include "messages.h"
3334

3435
bool freeAction = false;

src/input.h

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/* This file is part of Lavender Throne.
2+
* Copyright 2017 by Kurt Weber
3+
*
4+
* Lavender Throne is free software: you can redistribute it and/or modify
5+
* it under the terms of the GNU General Public License as published by
6+
* the Free Software Foundation, either version 3 of the License, or
7+
* (at your option) any later version.
8+
*
9+
* Lavender Throne is distributed in the hope that it will be useful,
10+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
* GNU General Public License for more details.
13+
*
14+
* You should have received a copy of the GNU General Public License
15+
* along with Lavender Throne. If not, see <http://www.gnu.org/licenses/>.
16+
*/
17+
#ifndef _INPUT_H
18+
#define _INPUT_H
19+
20+
#ifndef _INPUT_C
21+
void doMoveKey(unsigned int c);
22+
void doOpenDoor(unsigned int c);
23+
void doSearchDoors(unsigned int c);
24+
void doStairs(unsigned int c);
25+
#else
26+
#endif
27+
28+
#endif

src/item.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ typedef enum armorSlots{
3030
ARMOR_HELMET = 0b000001000,
3131
ARMOR_CLOAK = 0b000010000,
3232
ARMOR_GLOVES = 0b000100000,
33-
ARMOR_LEGGINGS = 0b001000000,
33+
ARMOR_LEGGINGS = 0b001000000,
3434
ARMOR_SHOES = 0b010000000,
3535
ARMOR_SHIELD = 0b100000000,
3636
} armorSlots;

src/lvt.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,6 @@
3636
#define ISODD(a) ((a) % 2 ? true : false)
3737
#define ISEVEN(a) ((a) % 2 ? false : true)
3838

39-
#ifndef _INPUT_C
40-
void doMoveKey(unsigned int c);
41-
void doOpenDoor(unsigned int c);
42-
void doSearchDoors(unsigned int c);
43-
void doStairs(unsigned int c);
44-
void doLook(unsigned int c);
45-
#else
46-
#endif
47-
4839
#ifndef _INVENTORY_C
4940
void doInventory();
5041
void doPickup();

0 commit comments

Comments
 (0)