Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.o
5 changes: 5 additions & 0 deletions common/bspfile.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,12 @@

// upper design bounds

#ifdef QUAKE1
#define MAX_MAP_HULLS 4
#else
#define MAX_MAP_HULLS 8
#endif


#define MAX_MAP_MODELS 256
#define MAX_MAP_BRUSHES 4096
Expand Down
2 changes: 2 additions & 0 deletions utils/jsh2color/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/jscolour
/jsh2colour
24 changes: 15 additions & 9 deletions utils/jsh2color/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,14 @@ OSLIBS:=$(UHEXEN2_TOP)/oslibs
include $(UHEXEN2_TOP)/scripts/makefile.inc

# Names of the binaries
BINARY:=jsh2colour$(exe_ext)
BASENAMES:=jsh2colour jscolour
ifeq ($(GAME),quake1)
BASENAME:=jscolour
CFLAGS += -DQUAKE1
else
BASENAME:=jsh2colour
endif
BINARY:=$(BASENAME)$(exe_ext)

# Compiler flags

Expand Down Expand Up @@ -128,11 +135,11 @@ endif
all : $(BINARY)

# Rules for turning source files into .o files
%.o: %.c
out/$(BASENAME)/%.o: %.c
$(CC) -c $(CFLAGS) $(INCLUDES) -o $@ $<
%.o: $(COMMONDIR)/%.c
out/$(BASENAME)/%.o: $(COMMONDIR)/%.c
$(CC) -c $(CFLAGS) $(INCLUDES) -o $@ $<
%.o: $(UHEXEN2_SHARED)/%.c
out/$(BASENAME)/%.o: $(UHEXEN2_SHARED)/%.c
$(CC) -c $(CFLAGS) $(INCLUDES) -o $@ $<

# Objects
Expand All @@ -154,11 +161,10 @@ OBJECTS= qsnprint.o \
jscolor.o \
tyrlite.o

$(BINARY) : $(OBJECTS)
$(LINKER) $(OBJECTS) $(LDFLAGS) $(LDLIBS) -o $@
$(BINARY) : $(patsubst %,out/$(BASENAME)/%,$(OBJECTS))
$(LINKER) $^ $(LDFLAGS) $(LDLIBS) -o $@

clean:
rm -f *.o core
rm -f $(patsubst %,out/%/*.o,$(BASENAMES)) core
distclean: clean
rm -f $(BINARY)

rm -f $(patsubst %,%$(exe_ext),$(BASENAMES))
20 changes: 15 additions & 5 deletions utils/jsh2color/entities.c
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,11 @@ void LoadEntities (void)
entity->formula = atoi(com_token);
else if (!strcmp(key, "mangle"))
{
if (sscanf(com_token, "%lf %lf %lf", &v[0], &v[1], &v[2]) != 3)
COM_Error ("%s: not 3 values for mangle", __thisfunc__);
/* DoE's R1M4 info_intermission has a mangle of just "20":
ED_ParseEpair() zero-fills such short vectors. */
v[0] = v[1] = v[2] = 0;
if (sscanf(com_token, "%lf %lf %lf", &v[0], &v[1], &v[2]) < 1)
COM_Error ("%s: no values for mangle: %s", __thisfunc__, com_token);

/* Precalculate the direction vector */
entity->use_mangle = true;
Expand Down Expand Up @@ -268,10 +271,13 @@ void LoadEntities (void)
if (entity->formula < 0 || entity->formula > 3)
entity->formula = 0;

// set some colors based on hexen2 entity classname
// set some colors based on quake1/hexen2 entity classname
if (!q_strncasecmp(entity->classname, "light_flame", 11) || /* _large_yellow, _small_yellow */
!q_strncasecmp(entity->classname, "light_torch", 11) || /* _castle, _rome, _meso, _egypt, _walltorch */
!q_strcasecmp (entity->classname, "light_gem"))
!q_strcasecmp (entity->classname, "light_gem") ||
!q_strcasecmp (entity->classname, "light_candle") ||
!q_strcasecmp (entity->classname, "light_globe") ||
!q_strcasecmp (entity->classname, "light_lantern"))
{
// make it orange
entity->lightcolor[0] = 255;
Expand Down Expand Up @@ -304,8 +310,13 @@ void LoadEntities (void)
// number entity->message to be read from strings.txt
if (strlen(entity->netname))
printf ("Map name : \"%s\"\n\n", entity->netname);
#ifdef QUAKE1
else if (strlen(entity->message))
printf ("Map name : \"%s\"\n\n", entity->message);
#else
else if (strlen(entity->message) && atoi(entity->message) > 0)
printf ("Map name : at line %d in strings.txt\n\n", atoi(entity->message));
#endif
else
printf ("Map name : -- unknown --\n\n");

Expand Down Expand Up @@ -397,4 +408,3 @@ entity_t *FindEntityWithKeyPair (const char *key, const char *value)
}
return NULL;
}

Loading
Loading