mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-10 23:01:59 +00:00
- Fixed: The serializer for side_t::part never read the texture information
from a savegame. - Fixed: side_t::StopInterpolation called setinterpolation instead of stopinterpolation. Also moved the clearinterpolation call in P_SetupLevel after the P_FreeLevelData to make absolutely sure that nothing in there can leave an interpolator behind by accident. - Applied Linux fixes by Jim. SBARINFO update by Blzut3: - Fixed: the playerclass command needed a null pointer check to prevent crashing on respawn. - Fixed: Mug Shot states were not reset on respawn. - Removed keepoffsets flag since apparently it was keeping the offsets by default. The means that the only thing not affected by the offsets was using nullimage as a background. Since I wasn't able to get a result I liked I'm going to say that if you want a black background with high res positioning you will have to create your own bar image. Maybe I'll fix it some other time. - Added: monospacefonts variable which allows for all of the fonts to be monospaced by a specified character (from their fontset of corse). - Made SBarInfo recognize the bar names for the Strife popups but they don't do anything beyond that. The names are: popuplog, popupkeys, and popupstatus. - Started converting the drawing routine to be more flexable towards high resolution status bars. (Only did one call so far.) SVN r835 (trunk)
This commit is contained in:
parent
84d125cf21
commit
9adf1d4ddc
8 changed files with 238 additions and 73 deletions
|
@ -10,26 +10,26 @@ else
|
||||||
CFLAGS ?= -pipe -Wall -Wno-unused -fno-strict-aliasing -O2 -fomit-frame-pointer
|
CFLAGS ?= -pipe -Wall -Wno-unused -fno-strict-aliasing -O2 -fomit-frame-pointer
|
||||||
CXXFLAGS ?= -fno-rtti
|
CXXFLAGS ?= -fno-rtti
|
||||||
endif
|
endif
|
||||||
ifdef GC
|
#ifdef GC
|
||||||
CFLAGS += -ffunction-sections
|
# CFLAGS += -ffunction-sections
|
||||||
LDFLAGS += -Wl,--gc-sections
|
# LDFLAGS += -Wl,--gc-sections
|
||||||
endif
|
#endif
|
||||||
CFLAGS += -MMD -DHAVE_FILELENGTH -D__forceinline=inline `sdl-config --cflags` `pkg-config gtk+-2.0 --cflags`
|
CFLAGS += -MMD -DHAVE_FILELENGTH -D__forceinline=inline `sdl-config --cflags` `pkg-config gtk+-2.0 --cflags`
|
||||||
CFLAGS += -Dstricmp=strcasecmp -Dstrnicmp=strncasecmp -DNEED_STRUPR
|
CFLAGS += -Dstricmp=strcasecmp -Dstrnicmp=strncasecmp -DNEED_STRUPR
|
||||||
LDFLAGS += snes_spc/libsnes_spc.a -lz -ljpeg -lfmodex `sdl-config --libs` `pkg-config gtk+-2.0 --libs`
|
LDFLAGS += snes_spc/libsnes_spc.a -lz -ljpeg -lfmodex `sdl-config --libs` `pkg-config gtk+-2.0 --libs`
|
||||||
NASMFLAGS += -f elf -DM_TARGET_LINUX
|
NASMFLAGS += -f elf -DM_TARGET_LINUX
|
||||||
|
|
||||||
SRCDIRS = src/ $(addprefix src/,g_doom/ g_heretic/ g_hexen/ g_raven/ g_shared/ g_strife/ oplsynth/ sound/ sdl/ textures/ thingdef/)
|
SRCDIRS = src/ $(addprefix src/,g_doom/ g_heretic/ g_hexen/ g_raven/ g_shared/ g_strife/ oplsynth/ sound/ sdl/ textures/ thingdef/ xlat/)
|
||||||
VPATH = $(SRCDIRS)
|
VPATH = $(SRCDIRS)
|
||||||
INCLUDES = $(addprefix -I,$(SRCDIRS))
|
INCLUDES = $(addprefix -I,$(SRCDIRS))
|
||||||
INCLUDES += snes_spc/snes_spc/ /usr/local/include/fmodex/
|
INCLUDES += -Isnes_spc/snes_spc/ -I/usr/include/fmodex/
|
||||||
CFLAGS += $(INCLUDES)
|
CFLAGS += $(INCLUDES)
|
||||||
|
|
||||||
RELEASEOBJ ?= releaseobj
|
RELEASEOBJ ?= releaseobj
|
||||||
DEBUGOBJ ?= debugobj
|
DEBUGOBJ ?= debugobj
|
||||||
|
|
||||||
CPPSRCS = $(wildcard $(addsuffix *.cpp,$(SRCDIRS))) src/xlat/parse_xlat.cpp
|
CPPSRCS = $(wildcard $(addsuffix *.cpp,$(SRCDIRS)))
|
||||||
CSRCS = $(wildcard $(addsuffix *.c,$(SRCDIRS)))
|
CSRCS = $(filter-out src/xlat/xlat_parser.c, $(wildcard $(addsuffix *.c,$(SRCDIRS))))
|
||||||
ifdef NOASM
|
ifdef NOASM
|
||||||
CFLAGS += -DNOASM
|
CFLAGS += -DNOASM
|
||||||
else
|
else
|
||||||
|
@ -64,9 +64,9 @@ COBJS = $(addprefix $(OBJDIR)/,$(CPPOBJFILES) $(COBJFILES))
|
||||||
DEPS = $(patsubst %.o,%.d,$(COBJS))
|
DEPS = $(patsubst %.o,%.d,$(COBJS))
|
||||||
OBJS = $(addprefix $(OBJDIR)/,$(AOBJFILES)) $(COBJS)
|
OBJS = $(addprefix $(OBJDIR)/,$(AOBJFILES)) $(COBJS)
|
||||||
|
|
||||||
all: $(ZDOOMBIN) snes_spc/libsnes_spc.a toolsandpk3 zdoom.pk3
|
all: $(ZDOOMBIN) toolsandpk3 zdoom.pk3
|
||||||
|
|
||||||
$(ZDOOMBIN): ccdv updaterev $(OBJDIR) $(OBJS)
|
$(ZDOOMBIN): ccdv updaterev $(OBJDIR) $(OBJS) snes_spc/libsnes_spc.a
|
||||||
$(CCDV) $(CXX) $(LDFLAGS) $(OBJDIR)/autostart.o \
|
$(CCDV) $(CXX) $(LDFLAGS) $(OBJDIR)/autostart.o \
|
||||||
$(filter-out %/autostart.o %/autozend.o,$(OBJS)) \
|
$(filter-out %/autostart.o %/autozend.o,$(OBJS)) \
|
||||||
$(OBJDIR)/autozend.o -o $(ZDOOMBIN)
|
$(OBJDIR)/autozend.o -o $(ZDOOMBIN)
|
||||||
|
@ -88,17 +88,13 @@ $(OBJDIR)/nodebuild_classify_sse2.o: nodebuild_classify_sse2.cpp
|
||||||
$(OBJDIR)/fmopl.o: src/oplsynth/fmopl.cpp
|
$(OBJDIR)/fmopl.o: src/oplsynth/fmopl.cpp
|
||||||
$(CCDV) $(CXX) $(CXXFLAGS) -fno-tree-dominator-opts -fno-tree-fre -c -o $@ $<
|
$(CCDV) $(CXX) $(CXXFLAGS) -fno-tree-dominator-opts -fno-tree-fre -c -o $@ $<
|
||||||
|
|
||||||
src/xlat/xlat_parser.c: src/xlat/xlat_parser.y
|
src/xlat/xlat_parser.c: tools/lemon/lemon src/xlat/xlat_parser.y
|
||||||
$(CCDV) $(LEMON) -s src/xlat/xlat_parser.y
|
$(CCDV) tools/lemon/lemon -s src/xlat/xlat_parser.y
|
||||||
|
|
||||||
# Dunno why make isn't picking this stuff up automatically for this file.
|
|
||||||
$(OBJDIR)/parse_xlat.o: src/xlat/parse_xlat.cpp src/xlat/xlat.h src/xlat/xlat_parser.c src/xlat/xlat_parser.h
|
|
||||||
$(CCDV) $(CXX) $(CXXFLAGS) -o $@ -c $<
|
|
||||||
|
|
||||||
$(OBJDIR):
|
$(OBJDIR):
|
||||||
mkdir $(OBJDIR)
|
mkdir $(OBJDIR)
|
||||||
|
|
||||||
toolsandpk3: ccdv tools/makewad/makewad tools/dehsupp/dehsupp
|
toolsandpk3: ccdv tools/makewad/makewad tools/dehsupp/dehsupp tools/lemon/lemon
|
||||||
$(MAKE) -C wadsrc/
|
$(MAKE) -C wadsrc/
|
||||||
|
|
||||||
zdoom.pk3: toolsandpk3
|
zdoom.pk3: toolsandpk3
|
||||||
|
@ -113,6 +109,8 @@ tools/makewad/makewad:
|
||||||
tools/dehsupp/dehsupp:
|
tools/dehsupp/dehsupp:
|
||||||
$(MAKE) -C tools/dehsupp/
|
$(MAKE) -C tools/dehsupp/
|
||||||
|
|
||||||
|
tools/lemon/lemon:
|
||||||
|
$(MAKE) -C tools/lemon/
|
||||||
|
|
||||||
updaterev: tools/updaterevision/updaterevision
|
updaterev: tools/updaterevision/updaterevision
|
||||||
@tools/updaterevision/updaterevision . src/svnrevision.h
|
@tools/updaterevision/updaterevision . src/svnrevision.h
|
||||||
|
|
|
@ -1,3 +1,28 @@
|
||||||
|
March 22, 2008 (Changes by Graf Zahl)
|
||||||
|
- Fixed: The serializer for side_t::part never read the texture information
|
||||||
|
from a savegame.
|
||||||
|
- Fixed: side_t::StopInterpolation called setinterpolation instead of
|
||||||
|
stopinterpolation. Also moved the clearinterpolation call in
|
||||||
|
P_SetupLevel after the P_FreeLevelData to make absolutely sure that
|
||||||
|
nothing in there can leave an interpolator behind by accident.
|
||||||
|
- Applied Linux fixes by Jim.
|
||||||
|
SBARINFO update by Blzut3:
|
||||||
|
- Fixed: the playerclass command needed a null pointer check to prevent
|
||||||
|
crashing on respawn.
|
||||||
|
- Fixed: Mug Shot states were not reset on respawn.
|
||||||
|
- Removed keepoffsets flag since apparently it was keeping the offsets by
|
||||||
|
default. The means that the only thing not affected by the offsets was using
|
||||||
|
nullimage as a background. Since I wasn't able to get a result I liked I'm
|
||||||
|
going to say that if you want a black background with high res positioning
|
||||||
|
you will have to create your own bar image. Maybe I'll fix it some other
|
||||||
|
time.
|
||||||
|
- Added: monospacefonts variable which allows for all of the fonts to be
|
||||||
|
monospaced by a specified character (from their fontset of corse).
|
||||||
|
- Made SBarInfo recognize the bar names for the Strife popups but they don't
|
||||||
|
do anything beyond that. The names are: popuplog, popupkeys, and popupstatus.
|
||||||
|
- Started converting the drawing routine to be more flexable towards high
|
||||||
|
resolution status bars. (Only did one call so far.)
|
||||||
|
|
||||||
March 21, 2008
|
March 21, 2008
|
||||||
- Fixed: Actor-less sounds that aren't played on CHAN_AUTO should still be
|
- Fixed: Actor-less sounds that aren't played on CHAN_AUTO should still be
|
||||||
subject to channel overriding.
|
subject to channel overriding.
|
||||||
|
|
|
@ -1,9 +1,46 @@
|
||||||
|
/*
|
||||||
|
** sbarinfo.h
|
||||||
|
**
|
||||||
|
** Header for custom status bar definitions.
|
||||||
|
**
|
||||||
|
**---------------------------------------------------------------------------
|
||||||
|
** Copyright 2008 Braden Obrzut
|
||||||
|
** All rights reserved.
|
||||||
|
**
|
||||||
|
** Redistribution and use in source and binary forms, with or without
|
||||||
|
** modification, are permitted provided that the following conditions
|
||||||
|
** are met:
|
||||||
|
**
|
||||||
|
** 1. Redistributions of source code must retain the above copyright
|
||||||
|
** notice, this list of conditions and the following disclaimer.
|
||||||
|
** 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
** notice, this list of conditions and the following disclaimer in the
|
||||||
|
** documentation and/or other materials provided with the distribution.
|
||||||
|
** 3. The name of the author may not be used to endorse or promote products
|
||||||
|
** derived from this software without specific prior written permission.
|
||||||
|
**
|
||||||
|
** THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||||
|
** IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||||
|
** OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||||
|
** IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||||
|
** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||||
|
** NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||||
|
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||||
|
** THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
**---------------------------------------------------------------------------
|
||||||
|
**
|
||||||
|
*/
|
||||||
|
|
||||||
#ifndef __SBarInfo_SBAR_H__
|
#ifndef __SBarInfo_SBAR_H__
|
||||||
#define __SBarInfo_SBAR_H__
|
#define __SBarInfo_SBAR_H__
|
||||||
|
|
||||||
#include "tarray.h"
|
#include "tarray.h"
|
||||||
#include "v_collection.h"
|
#include "v_collection.h"
|
||||||
|
|
||||||
|
#define NUMHUDS 9
|
||||||
|
|
||||||
class FBarTexture;
|
class FBarTexture;
|
||||||
class FScanner;
|
class FScanner;
|
||||||
|
|
||||||
|
@ -44,11 +81,12 @@ struct SBarInfoCommand
|
||||||
struct SBarInfo
|
struct SBarInfo
|
||||||
{
|
{
|
||||||
TArray<FString> Images;
|
TArray<FString> Images;
|
||||||
SBarInfoBlock huds[6];
|
SBarInfoBlock huds[NUMHUDS];
|
||||||
bool automapbar;
|
bool automapbar;
|
||||||
bool interpolateHealth;
|
bool interpolateHealth;
|
||||||
bool interpolateArmor;
|
bool interpolateArmor;
|
||||||
bool completeBorder;
|
bool completeBorder;
|
||||||
|
char spacingCharacter;
|
||||||
int interpolationSpeed;
|
int interpolationSpeed;
|
||||||
int armorInterpolationSpeed;
|
int armorInterpolationSpeed;
|
||||||
int height;
|
int height;
|
||||||
|
@ -71,7 +109,7 @@ struct SBarInfo
|
||||||
|
|
||||||
extern SBarInfo *SBarInfoScript;
|
extern SBarInfo *SBarInfoScript;
|
||||||
|
|
||||||
//Mug Shot scripting structs. All functions are defined in sbarinfo_parser.cpp
|
//Mug Shot scripting structs.
|
||||||
struct MugShotState;
|
struct MugShotState;
|
||||||
|
|
||||||
struct MugShotFrame
|
struct MugShotFrame
|
||||||
|
@ -166,7 +204,6 @@ enum //drawbar flags (will go into special2)
|
||||||
DRAWBAR_HORIZONTAL = 1,
|
DRAWBAR_HORIZONTAL = 1,
|
||||||
DRAWBAR_REVERSE = 2,
|
DRAWBAR_REVERSE = 2,
|
||||||
DRAWBAR_COMPAREDEFAULTS = 4,
|
DRAWBAR_COMPAREDEFAULTS = 4,
|
||||||
DRAWBAR_KEEPOFFSETS = 8,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
enum //drawselectedinventory flags
|
enum //drawselectedinventory flags
|
||||||
|
@ -223,6 +260,7 @@ enum //Key words
|
||||||
SBARINFO_INTERPOLATEHEALTH,
|
SBARINFO_INTERPOLATEHEALTH,
|
||||||
SBARINFO_INTERPOLATEARMOR,
|
SBARINFO_INTERPOLATEARMOR,
|
||||||
SBARINFO_COMPLETEBORDER,
|
SBARINFO_COMPLETEBORDER,
|
||||||
|
SBARINFO_MONOSPACEFONTS,
|
||||||
SBARINFO_STATUSBAR,
|
SBARINFO_STATUSBAR,
|
||||||
SBARINFO_MUGSHOT,
|
SBARINFO_MUGSHOT,
|
||||||
};
|
};
|
||||||
|
@ -235,6 +273,9 @@ enum //Bar types
|
||||||
STBAR_AUTOMAP,
|
STBAR_AUTOMAP,
|
||||||
STBAR_INVENTORY,
|
STBAR_INVENTORY,
|
||||||
STBAR_INVENTORYFULLSCREEN,
|
STBAR_INVENTORYFULLSCREEN,
|
||||||
|
STBAR_POPUPLOG,
|
||||||
|
STBAR_POPUPKEYS,
|
||||||
|
STBAR_POPUPSTATUS,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum //Bar key words
|
enum //Bar key words
|
||||||
|
|
|
@ -1,3 +1,38 @@
|
||||||
|
/*
|
||||||
|
** sbarinfo_display.cpp
|
||||||
|
**
|
||||||
|
** Contains all functions required for the display of custom statusbars.
|
||||||
|
**
|
||||||
|
**---------------------------------------------------------------------------
|
||||||
|
** Copyright 2008 Braden Obrzut
|
||||||
|
** All rights reserved.
|
||||||
|
**
|
||||||
|
** Redistribution and use in source and binary forms, with or without
|
||||||
|
** modification, are permitted provided that the following conditions
|
||||||
|
** are met:
|
||||||
|
**
|
||||||
|
** 1. Redistributions of source code must retain the above copyright
|
||||||
|
** notice, this list of conditions and the following disclaimer.
|
||||||
|
** 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
** notice, this list of conditions and the following disclaimer in the
|
||||||
|
** documentation and/or other materials provided with the distribution.
|
||||||
|
** 3. The name of the author may not be used to endorse or promote products
|
||||||
|
** derived from this software without specific prior written permission.
|
||||||
|
**
|
||||||
|
** THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||||
|
** IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||||
|
** OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||||
|
** IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||||
|
** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||||
|
** NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||||
|
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||||
|
** THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
**---------------------------------------------------------------------------
|
||||||
|
**
|
||||||
|
*/
|
||||||
|
|
||||||
#include "doomtype.h"
|
#include "doomtype.h"
|
||||||
#include "doomstat.h"
|
#include "doomstat.h"
|
||||||
#include "v_font.h"
|
#include "v_font.h"
|
||||||
|
@ -238,7 +273,7 @@ DSBarInfo::~DSBarInfo ()
|
||||||
void DSBarInfo::Draw (EHudState state)
|
void DSBarInfo::Draw (EHudState state)
|
||||||
{
|
{
|
||||||
DBaseStatusBar::Draw(state);
|
DBaseStatusBar::Draw(state);
|
||||||
int hud = 2;
|
int hud = STBAR_NORMAL;
|
||||||
if(state == HUD_StatusBar)
|
if(state == HUD_StatusBar)
|
||||||
{
|
{
|
||||||
if(SBarInfoScript->completeBorder) //Fill the statusbar with the border before we draw.
|
if(SBarInfoScript->completeBorder) //Fill the statusbar with the border before we draw.
|
||||||
|
@ -250,20 +285,20 @@ void DSBarInfo::Draw (EHudState state)
|
||||||
}
|
}
|
||||||
if(SBarInfoScript->automapbar && automapactive)
|
if(SBarInfoScript->automapbar && automapactive)
|
||||||
{
|
{
|
||||||
hud = 3;
|
hud = STBAR_AUTOMAP;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
hud = 2;
|
hud = STBAR_NORMAL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(state == HUD_Fullscreen)
|
else if(state == HUD_Fullscreen)
|
||||||
{
|
{
|
||||||
hud = 1;
|
hud = STBAR_FULLSCREEN;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
hud = 0;
|
hud = STBAR_NONE;
|
||||||
}
|
}
|
||||||
if(SBarInfoScript->huds[hud].forceScaled) //scale the statusbar
|
if(SBarInfoScript->huds[hud].forceScaled) //scale the statusbar
|
||||||
{
|
{
|
||||||
|
@ -274,9 +309,9 @@ void DSBarInfo::Draw (EHudState state)
|
||||||
if(CPlayer->inventorytics > 0 && !(level.flags & LEVEL_NOINVENTORYBAR))
|
if(CPlayer->inventorytics > 0 && !(level.flags & LEVEL_NOINVENTORYBAR))
|
||||||
{
|
{
|
||||||
if(state == HUD_StatusBar)
|
if(state == HUD_StatusBar)
|
||||||
doCommands(SBarInfoScript->huds[4]);
|
doCommands(SBarInfoScript->huds[STBAR_INVENTORY]);
|
||||||
else if(state == HUD_Fullscreen)
|
else if(state == HUD_Fullscreen)
|
||||||
doCommands(SBarInfoScript->huds[5]);
|
doCommands(SBarInfoScript->huds[STBAR_INVENTORYFULLSCREEN]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -291,6 +326,7 @@ void DSBarInfo::NewGame ()
|
||||||
void DSBarInfo::AttachToPlayer (player_t *player)
|
void DSBarInfo::AttachToPlayer (player_t *player)
|
||||||
{
|
{
|
||||||
player_t *oldplayer = CPlayer;
|
player_t *oldplayer = CPlayer;
|
||||||
|
currentState = NULL;
|
||||||
DBaseStatusBar::AttachToPlayer(player);
|
DBaseStatusBar::AttachToPlayer(player);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -823,11 +859,6 @@ void DSBarInfo::doCommands(SBarInfoBlock &block)
|
||||||
{
|
{
|
||||||
screen->VirtualToRealCoordsInt(x, y, w, h, 320, 200, true);
|
screen->VirtualToRealCoordsInt(x, y, w, h, 320, 200, true);
|
||||||
}
|
}
|
||||||
if(cmd.special2 & DRAWBAR_KEEPOFFSETS)
|
|
||||||
{
|
|
||||||
x += fg->LeftOffset;
|
|
||||||
y += fg->TopOffset;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(cmd.special3 != 0)
|
if(cmd.special3 != 0)
|
||||||
{
|
{
|
||||||
|
@ -856,17 +887,13 @@ void DSBarInfo::doCommands(SBarInfoBlock &block)
|
||||||
// Calc clipping rect for background
|
// Calc clipping rect for background
|
||||||
cx = cmd.x + ST_X + cmd.special3;
|
cx = cmd.x + ST_X + cmd.special3;
|
||||||
cy = cmd.y + ST_Y + cmd.special3;
|
cy = cmd.y + ST_Y + cmd.special3;
|
||||||
cw = fg->GetScaledWidth() - cmd.special3 * 2;
|
cw = fg->GetScaledWidth() - fg->GetScaledLeftOffset() - cmd.special3 * 2;
|
||||||
ch = fg->GetScaledHeight() - cmd.special3 * 2;
|
ch = fg->GetScaledHeight() - fg->GetScaledTopOffset() - cmd.special3 * 2;
|
||||||
if (Scaled)
|
if (Scaled)
|
||||||
{
|
{
|
||||||
screen->VirtualToRealCoordsInt(cx, cy, cw, ch, 320, 200, true);
|
screen->VirtualToRealCoordsInt(cx, cy, cw, ch, 320, 200, true);
|
||||||
}
|
}
|
||||||
if(cmd.special2 & DRAWBAR_KEEPOFFSETS)
|
|
||||||
{
|
|
||||||
cx += fg->LeftOffset;
|
|
||||||
cy += fg->TopOffset;
|
|
||||||
}
|
|
||||||
if (horizontal)
|
if (horizontal)
|
||||||
{
|
{
|
||||||
if ((cmd.special3 != 0 && reverse) || (cmd.special3 == 0 && !reverse))
|
if ((cmd.special3 != 0 && reverse) || (cmd.special3 == 0 && !reverse))
|
||||||
|
@ -1011,6 +1038,7 @@ void DSBarInfo::doCommands(SBarInfoBlock &block)
|
||||||
break;
|
break;
|
||||||
case SBARINFO_PLAYERCLASS:
|
case SBARINFO_PLAYERCLASS:
|
||||||
{
|
{
|
||||||
|
if(CPlayer->cls == NULL) break; //No class so we can not continue
|
||||||
int spawnClass = CPlayer->cls->ClassIndex;
|
int spawnClass = CPlayer->cls->ClassIndex;
|
||||||
if(cmd.special == spawnClass || cmd.special2 == spawnClass || cmd.special3 == spawnClass)
|
if(cmd.special == spawnClass || cmd.special2 == spawnClass || cmd.special3 == spawnClass)
|
||||||
{
|
{
|
||||||
|
@ -1077,7 +1105,17 @@ void DSBarInfo::DrawGraphic(FTexture* texture, int x, int y, int flags)
|
||||||
if((flags & DRAWIMAGE_TRANSLATABLE))
|
if((flags & DRAWIMAGE_TRANSLATABLE))
|
||||||
DrawImage(texture, x, y, getTranslation());
|
DrawImage(texture, x, y, getTranslation());
|
||||||
else
|
else
|
||||||
DrawImage(texture, x, y);
|
{
|
||||||
|
x += ST_X;
|
||||||
|
y += ST_Y;
|
||||||
|
int w = texture->GetScaledWidth();
|
||||||
|
int h = texture->GetScaledHeight();
|
||||||
|
screen->VirtualToRealCoordsInt(x, y, w, h, 320, 200, true);
|
||||||
|
screen->DrawTexture(texture, x, y,
|
||||||
|
DTA_DestWidth, w,
|
||||||
|
DTA_DestHeight, h,
|
||||||
|
TAG_DONE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DSBarInfo::DrawString(const char* str, int x, int y, EColorRange translation, int spacing)
|
void DSBarInfo::DrawString(const char* str, int x, int y, EColorRange translation, int spacing)
|
||||||
|
@ -1091,16 +1129,23 @@ void DSBarInfo::DrawString(const char* str, int x, int y, EColorRange translatio
|
||||||
str++;
|
str++;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
int width = drawingFont->GetCharWidth((int) *str);
|
int width;
|
||||||
|
if(SBarInfoScript->spacingCharacter == '\0') //No monospace?
|
||||||
|
width = drawingFont->GetCharWidth((int) *str);
|
||||||
|
else
|
||||||
|
width = drawingFont->GetCharWidth((int) SBarInfoScript->spacingCharacter);
|
||||||
FTexture* character = drawingFont->GetChar((int) *str, &width);
|
FTexture* character = drawingFont->GetChar((int) *str, &width);
|
||||||
if(character == NULL) //missing character.
|
if(character == NULL) //missing character.
|
||||||
{
|
{
|
||||||
str++;
|
str++;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
x += (character->LeftOffset+1); //ignore x offsets since we adapt to character size
|
if(SBarInfoScript->spacingCharacter == '\0') //If we are monospaced lets use the offset
|
||||||
|
x += (character->LeftOffset+1); //ignore x offsets since we adapt to character size
|
||||||
DrawImage(character, x, y, drawingFont->GetColorTranslation(translation));
|
DrawImage(character, x, y, drawingFont->GetColorTranslation(translation));
|
||||||
x += width + spacing - (character->LeftOffset+1);
|
x += width + spacing;
|
||||||
|
if(SBarInfoScript->spacingCharacter == '\0')
|
||||||
|
x -= (character->LeftOffset+1);
|
||||||
str++;
|
str++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1112,7 +1157,10 @@ void DSBarInfo::DrawNumber(int num, int len, int x, int y, EColorRange translati
|
||||||
int maxval = (int) ceil(pow(10., len))-1;
|
int maxval = (int) ceil(pow(10., len))-1;
|
||||||
num = clamp(num, -maxval, maxval);
|
num = clamp(num, -maxval, maxval);
|
||||||
value.Format("%d", num);
|
value.Format("%d", num);
|
||||||
x -= int(drawingFont->StringWidth(value)+(spacing * value.Len()));
|
if(SBarInfoScript->spacingCharacter == '\0')
|
||||||
|
x -= int(drawingFont->StringWidth(value)+(spacing * value.Len()));
|
||||||
|
else //monospaced so just multiplay the character size
|
||||||
|
x -= int((drawingFont->GetCharWidth((int) SBarInfoScript->spacingCharacter) + spacing) * value.Len());
|
||||||
DrawString(value, x, y, translation, spacing);
|
DrawString(value, x, y, translation, spacing);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,38 @@
|
||||||
|
/*
|
||||||
|
** sbarinfo_parser.cpp
|
||||||
|
**
|
||||||
|
** Reads custom status bar definitions.
|
||||||
|
**
|
||||||
|
**---------------------------------------------------------------------------
|
||||||
|
** Copyright 2008 Braden Obrzut
|
||||||
|
** All rights reserved.
|
||||||
|
**
|
||||||
|
** Redistribution and use in source and binary forms, with or without
|
||||||
|
** modification, are permitted provided that the following conditions
|
||||||
|
** are met:
|
||||||
|
**
|
||||||
|
** 1. Redistributions of source code must retain the above copyright
|
||||||
|
** notice, this list of conditions and the following disclaimer.
|
||||||
|
** 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
** notice, this list of conditions and the following disclaimer in the
|
||||||
|
** documentation and/or other materials provided with the distribution.
|
||||||
|
** 3. The name of the author may not be used to endorse or promote products
|
||||||
|
** derived from this software without specific prior written permission.
|
||||||
|
**
|
||||||
|
** THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||||
|
** IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||||
|
** OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||||
|
** IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||||
|
** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||||
|
** NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||||
|
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||||
|
** THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
**---------------------------------------------------------------------------
|
||||||
|
**
|
||||||
|
*/
|
||||||
|
|
||||||
#include "doomtype.h"
|
#include "doomtype.h"
|
||||||
#include "doomstat.h"
|
#include "doomstat.h"
|
||||||
#include "sc_man.h"
|
#include "sc_man.h"
|
||||||
|
@ -21,6 +56,7 @@ static const char *SBarInfoTopLevel[] =
|
||||||
"interpolatehealth",
|
"interpolatehealth",
|
||||||
"interpolatearmor",
|
"interpolatearmor",
|
||||||
"completeborder",
|
"completeborder",
|
||||||
|
"monospacefonts",
|
||||||
"statusbar",
|
"statusbar",
|
||||||
"mugshot",
|
"mugshot",
|
||||||
NULL
|
NULL
|
||||||
|
@ -34,6 +70,9 @@ static const char *StatusBars[] =
|
||||||
"automap",
|
"automap",
|
||||||
"inventory",
|
"inventory",
|
||||||
"inventoryfullscreen",
|
"inventoryfullscreen",
|
||||||
|
"popuplog",
|
||||||
|
"popupkeys",
|
||||||
|
"popupstatus",
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -175,6 +214,22 @@ void SBarInfo::ParseSBarInfo(int lump)
|
||||||
}
|
}
|
||||||
sc.MustGetToken(';');
|
sc.MustGetToken(';');
|
||||||
break;
|
break;
|
||||||
|
case SBARINFO_MONOSPACEFONTS:
|
||||||
|
if(sc.CheckToken(TK_True))
|
||||||
|
{
|
||||||
|
sc.MustGetToken(',');
|
||||||
|
sc.MustGetToken(TK_StringConst);
|
||||||
|
spacingCharacter = sc.String[0];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
sc.MustGetToken(TK_False);
|
||||||
|
spacingCharacter = '\0';
|
||||||
|
sc.MustGetToken(',');
|
||||||
|
sc.MustGetToken(TK_StringConst); //Don't tell anyone we're just ignoring this ;)
|
||||||
|
}
|
||||||
|
sc.MustGetToken(';');
|
||||||
|
break;
|
||||||
case SBARINFO_STATUSBAR:
|
case SBARINFO_STATUSBAR:
|
||||||
{
|
{
|
||||||
if(!baseSet) //If the user didn't explicitly define a base, do so now.
|
if(!baseSet) //If the user didn't explicitly define a base, do so now.
|
||||||
|
@ -699,8 +754,6 @@ void SBarInfo::ParseSBarInfoBlock(FScanner &sc, SBarInfoBlock &block)
|
||||||
{
|
{
|
||||||
if(sc.Compare("reverse"))
|
if(sc.Compare("reverse"))
|
||||||
cmd.special2 += DRAWBAR_REVERSE;
|
cmd.special2 += DRAWBAR_REVERSE;
|
||||||
else if(sc.Compare("keepoffsets"))
|
|
||||||
cmd.special2 += DRAWBAR_KEEPOFFSETS;
|
|
||||||
else
|
else
|
||||||
sc.ScriptError("Unkown flag '%s'.", sc.String);
|
sc.ScriptError("Unkown flag '%s'.", sc.String);
|
||||||
if(!sc.CheckToken('|'))
|
if(!sc.CheckToken('|'))
|
||||||
|
@ -994,11 +1047,12 @@ void SBarInfo::Init()
|
||||||
interpolationSpeed = 8;
|
interpolationSpeed = 8;
|
||||||
armorInterpolationSpeed = 8;
|
armorInterpolationSpeed = 8;
|
||||||
height = 0;
|
height = 0;
|
||||||
|
spacingCharacter = '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
SBarInfo::~SBarInfo()
|
SBarInfo::~SBarInfo()
|
||||||
{
|
{
|
||||||
for (size_t i = 0; i < countof(huds); ++i)
|
for (size_t i = 0; i < NUMHUDS; ++i)
|
||||||
{
|
{
|
||||||
huds[i].commands.Clear();
|
huds[i].commands.Clear();
|
||||||
}
|
}
|
||||||
|
|
|
@ -3520,7 +3520,6 @@ void P_SetupLevel (char *lumpname, int position)
|
||||||
|
|
||||||
wminfo.partime = 180;
|
wminfo.partime = 180;
|
||||||
|
|
||||||
clearinterpolations(); // [RH] Nothing to interpolate on a fresh level.
|
|
||||||
FCanvasTextureInfo::EmptyList ();
|
FCanvasTextureInfo::EmptyList ();
|
||||||
R_FreePastViewers ();
|
R_FreePastViewers ();
|
||||||
|
|
||||||
|
@ -3561,6 +3560,7 @@ void P_SetupLevel (char *lumpname, int position)
|
||||||
|
|
||||||
// Free all level data from the previous map
|
// Free all level data from the previous map
|
||||||
P_FreeLevelData ();
|
P_FreeLevelData ();
|
||||||
|
clearinterpolations(); // [RH] Nothing to interpolate on a fresh level.
|
||||||
|
|
||||||
MapData * map = P_OpenMapData(lumpname);
|
MapData * map = P_OpenMapData(lumpname);
|
||||||
if (map == NULL)
|
if (map == NULL)
|
||||||
|
|
|
@ -526,7 +526,7 @@ struct side_t
|
||||||
}
|
}
|
||||||
void StopInterpolation(int position)
|
void StopInterpolation(int position)
|
||||||
{
|
{
|
||||||
setinterpolation(EInterpType(INTERP_WallPanning_Top+position), this);
|
stopinterpolation(EInterpType(INTERP_WallPanning_Top+position), this);
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -263,21 +263,23 @@ void R_RenderMaskedSegRange (drawseg_t *ds, int x1, int x2)
|
||||||
dc_texturemid = MIN (frontsector->ceilingtexz, backsector->ceilingtexz);
|
dc_texturemid = MIN (frontsector->ceilingtexz, backsector->ceilingtexz);
|
||||||
}
|
}
|
||||||
|
|
||||||
fixed_t rowoffset = curline->sidedef->GetTextureYOffset(side_t::mid);
|
{ // encapsilate the lifetime of rowoffset
|
||||||
if (tex->bWorldPanning)
|
fixed_t rowoffset = curline->sidedef->GetTextureYOffset(side_t::mid);
|
||||||
{
|
if (tex->bWorldPanning)
|
||||||
// rowoffset is added before the MulScale3 so that the masked texture will
|
{
|
||||||
// still be positioned in world units rather than texels.
|
// rowoffset is added before the MulScale3 so that the masked texture will
|
||||||
dc_texturemid += rowoffset - viewz;
|
// still be positioned in world units rather than texels.
|
||||||
textop = dc_texturemid;
|
dc_texturemid += rowoffset - viewz;
|
||||||
dc_texturemid = MulScale16 (dc_texturemid, tex->yScale);
|
textop = dc_texturemid;
|
||||||
}
|
dc_texturemid = MulScale16 (dc_texturemid, tex->yScale);
|
||||||
else
|
}
|
||||||
{
|
else
|
||||||
// rowoffset is added outside the multiply so that it positions the texture
|
{
|
||||||
// by texels instead of world units.
|
// rowoffset is added outside the multiply so that it positions the texture
|
||||||
textop = dc_texturemid - viewz + SafeDivScale16 (rowoffset, tex->yScale);
|
// by texels instead of world units.
|
||||||
dc_texturemid = MulScale16 (dc_texturemid - viewz, tex->yScale) + rowoffset;
|
textop = dc_texturemid - viewz + SafeDivScale16 (rowoffset, tex->yScale);
|
||||||
|
dc_texturemid = MulScale16 (dc_texturemid - viewz, tex->yScale) + rowoffset;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fixedlightlev)
|
if (fixedlightlev)
|
||||||
|
@ -1452,16 +1454,13 @@ int side_t::GetLightLevel (bool foggy, int baselight) const
|
||||||
FArchive &operator<< (FArchive &arc, side_t::part &p)
|
FArchive &operator<< (FArchive &arc, side_t::part &p)
|
||||||
{
|
{
|
||||||
arc << p.xoffset << p.yoffset;// << p.Light;
|
arc << p.xoffset << p.yoffset;// << p.Light;
|
||||||
if (arc.IsStoring())
|
if (arc.IsStoring ())
|
||||||
{
|
{
|
||||||
if (arc.IsStoring ())
|
TexMan.WriteTexture (arc, p.texture);
|
||||||
{
|
}
|
||||||
TexMan.WriteTexture (arc, p.texture);
|
else
|
||||||
}
|
{
|
||||||
else
|
p.texture = TexMan.ReadTexture (arc);
|
||||||
{
|
|
||||||
p.texture = TexMan.ReadTexture (arc);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return arc;
|
return arc;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue