WIP - le cours d'histoire était long
This commit is contained in:
parent
f75f6b9962
commit
7118cf8ed3
6 changed files with 19 additions and 15 deletions
18
Makefile
18
Makefile
|
@ -20,6 +20,7 @@ BUILD_DIR = build
|
|||
SRC_DIR = src
|
||||
|
||||
OBJS = $(patsubst $(SRC_DIR)/%.c,build-tmp/%.o,$(wildcard $(SRC_DIR)/*.c))
|
||||
OBJS += build-tmp/maps_out.o
|
||||
|
||||
all: | builddir map build builddir2
|
||||
|
||||
|
@ -28,24 +29,25 @@ windef:
|
|||
$(eval BUILD_DIR = build-win)
|
||||
$(eval LDFLAGS = $(LDFLAGS_WIN))
|
||||
|
||||
converter: map/converter.c
|
||||
map/converter: map/converter.c
|
||||
$(CC) map/converter.c -o map/converter $(CFLAGS)
|
||||
|
||||
map: converter
|
||||
map/maps_out.c: map/converter $(wildcard map/*.tmx)
|
||||
./map/converter
|
||||
$(CC) -c map/maps_out.c -o build-tmp/maps_out.o $(CFLAGS)
|
||||
$(eval OBJS += build-tmp/maps_out.o)
|
||||
|
||||
map: map/maps_out.c
|
||||
|
||||
builddir:
|
||||
- mkdir $(BUILD_DIR)
|
||||
mkdir build-tmp
|
||||
- mv $(wildcard $(BUILD_DIR)/*.o) build-tmp/
|
||||
- mv $(wildcard $(BUILD_DIR)/*.o) build-tmp/
|
||||
|
||||
build-tmp/%.o : $(SRC_DIR)/%.c
|
||||
${CC} -c $< -o $@ ${CFLAGS}
|
||||
$(CC) -c $< -o $@ $(CFLAGS)
|
||||
|
||||
build: $(OBJS)
|
||||
${CC} ${CFLAGS} -o ${OUTPUT} $(OBJS) ${LDFLAGS}
|
||||
$(CC) $(CFLAGS) -o $(OUTPUT) $(OBJS) $(LDFLAGS)
|
||||
|
||||
builddir2:
|
||||
mv $(wildcard build-tmp/*.o) $(BUILD_DIR)
|
||||
|
@ -66,5 +68,5 @@ clean:
|
|||
- rm "$(OUTNAME).amd64" "$(OUTNAME).exe"
|
||||
- rm map/maps_out.c map/converter map/converter.exe
|
||||
|
||||
.NOTPARALLEL: builddir builddir2 converter map
|
||||
.PHONY: all test clean win windef builddir builddir2 testwin converter map
|
||||
.NOTPARALLEL: builddir builddir2 map
|
||||
.PHONY: all test clean win windef builddir builddir2 testwin map
|
||||
|
|
BIN
map/converter
BIN
map/converter
Binary file not shown.
|
@ -54,7 +54,7 @@ int import_map(FILE *mapfile, FILE *outfile){
|
|||
fprintf(outfile, "\n};\n");
|
||||
|
||||
fprintf(outfile, "Map %s = {{%s_lyr0, %s_lyr1}, 256, 256,"
|
||||
"{0, 0, {NULL}}, {0, {NULL}}};\n",
|
||||
"{0, 0, NULL}, {0, NULL}};\n",
|
||||
tmpname, tmpname, tmpname);
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
#define VERSION_MAJ 0
|
||||
#define VERSION_MIN 1
|
||||
#define VERSION_PATCH 2
|
||||
#define VERSION_PATCH 3
|
||||
|
||||
// Set in ui.c
|
||||
extern char *VERSION_STR;
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
#include <raymath.h>
|
||||
|
||||
#include "types.h"
|
||||
#include "map.h"
|
||||
#include "game.h"
|
||||
|
||||
MachineDef machine_dict[] = {
|
||||
|
@ -197,14 +198,14 @@ void update_worker(Game *game, Worker *worker){
|
|||
AiInternal *ai = &worker->ai;
|
||||
|
||||
Machine *mach[2] = {0};
|
||||
MachineDef *defs[2];
|
||||
//MachineDef *defs[2];
|
||||
|
||||
if(ai->assigned_machine != MACH_NULL){
|
||||
mach[0] = get_machine_from_id(&game->machines, ai->assigned_machine);
|
||||
if(!mach[0])
|
||||
ai->assigned_machine = MACH_NULL;
|
||||
else{
|
||||
defs[0] = &machine_dict[mach[0]->type];
|
||||
//defs[0] = &machine_dict[mach[0]->type];
|
||||
ai->mtype = mach[0]->type;
|
||||
}
|
||||
}
|
||||
|
@ -212,8 +213,9 @@ void update_worker(Game *game, Worker *worker){
|
|||
mach[1] = get_machine_from_id(&game->machines, ai->assigned_machine1);
|
||||
if(!mach[1])
|
||||
ai->assigned_machine1 = MACH_NULL;
|
||||
else
|
||||
/*else
|
||||
defs[1] = &machine_dict[mach[1]->type];
|
||||
*/
|
||||
}
|
||||
|
||||
if(ai->assigned_machine == MACH_NULL && ai->assigned_machine1 == MACH_NULL)
|
||||
|
|
4
src/ui.c
4
src/ui.c
|
@ -347,9 +347,9 @@ void get_keys(Game *game){
|
|||
if(keydown(KEY_D))
|
||||
game->camera.target.x += 3;
|
||||
if(keydown(KEY_UP))
|
||||
game->camera.zoom *= 1.1;
|
||||
game->camera.zoom *= 1.025;
|
||||
if(keydown(KEY_DOWN))
|
||||
game->camera.zoom *= 1/1.1;
|
||||
game->camera.zoom *= 1/1.025;
|
||||
if(IsKeyPressed(KEY_P))
|
||||
game->paused = !game->paused;
|
||||
if(IsKeyPressed(KEY_ESCAPE))
|
||||
|
|
Loading…
Add table
Reference in a new issue