Skip to content

Commit

Permalink
game: initial known entities definitions
Browse files Browse the repository at this point in the history
Add initial version without description and model path for now,
based on QUAKED comment get by grep code.
need to parse fgd files for add real definition and models or
check in code what model used.
  • Loading branch information
0lvin committed Sep 29, 2024
1 parent 473a4f3 commit fa1132e
Show file tree
Hide file tree
Showing 3 changed files with 312 additions and 3 deletions.
12 changes: 9 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -892,10 +892,12 @@ build/ref_vk/%.o: %.c

# The baseq2 game
ifeq ($(YQ2_OSTYPE), Windows)
game:
game: stuff/models/entity.dat
@echo "===> Building baseq2/game.dll"
${Q}mkdir -p release/baseq2
$(MAKE) release/baseq2/game.dll
${Q}mkdir -p release/baseq2/models
${Q}cp stuff/models/entity.dat release/baseq2/models

build/baseq2/%.o: %.c
@echo "===> CC $<"
Expand All @@ -906,10 +908,12 @@ release/baseq2/game.dll : LDFLAGS += -shared

else ifeq ($(YQ2_OSTYPE), Darwin)

game:
game: stuff/models/entity.dat
@echo "===> Building baseq2/game.dylib"
${Q}mkdir -p release/baseq2
$(MAKE) release/baseq2/game.dylib
${Q}mkdir -p release/baseq2/models
${Q}cp stuff/models/entity.dat release/baseq2/models

build/baseq2/%.o: %.c
@echo "===> CC $<"
Expand All @@ -921,10 +925,12 @@ release/baseq2/game.dylib : LDFLAGS += -shared

else # not Windows or Darwin

game:
game: stuff/models/entity.dat
@echo "===> Building baseq2/game.so"
${Q}mkdir -p release/baseq2
$(MAKE) release/baseq2/game.so
${Q}mkdir -p release/baseq2/models
${Q}cp stuff/models/entity.dat release/baseq2/models

build/baseq2/%.o: %.c
@echo "===> CC $<"
Expand Down
4 changes: 4 additions & 0 deletions src/game/g_spawn.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ typedef struct
int no_mip;
char spawn_sequence[MAX_QPATH];
char description[MAX_QPATH];
/* Additional fields */
vec3_t color;
} dynamicentity_t;

static dynamicentity_t *dynamicentities;
Expand Down Expand Up @@ -2056,6 +2058,8 @@ DynamicSpawnInit(void)
line = DynamicIntParse(line, &dynamicentities[curr_pos].no_mip);
line = DynamicStringParse(line, dynamicentities[curr_pos].spawn_sequence, MAX_QPATH, '|');
line = DynamicStringParse(line, dynamicentities[curr_pos].description, MAX_QPATH, '|');
/* Additional field for cover for color from QUAKED */
line = DynamicFloatParse(line, dynamicentities[curr_pos].color, 3, '|');

curr_pos ++;
}
Expand Down
Loading

0 comments on commit fa1132e

Please sign in to comment.