diff --git a/Makefile.linux b/Makefile.linux index 5a0fbc247..aa0cb0336 100644 --- a/Makefile.linux +++ b/Makefile.linux @@ -16,7 +16,7 @@ endif #endif CFLAGS += -MMD -DHAVE_FILELENGTH -D__forceinline=inline `sdl-config --cflags` `pkg-config gtk+-2.0 --cflags` 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 += -lz -ljpeg -lfmodex `sdl-config --libs` `pkg-config gtk+-2.0 --libs` 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/ xlat/) @@ -69,7 +69,7 @@ all: $(ZDOOMBIN) toolsandpk3 zdoom.pk3 $(ZDOOMBIN): ccdv updaterev $(OBJDIR) $(OBJS) snes_spc/libsnes_spc.a $(CCDV) $(CXX) $(LDFLAGS) $(OBJDIR)/autostart.o \ $(filter-out %/autostart.o %/autozend.o,$(OBJS)) \ - $(OBJDIR)/autozend.o -o $(ZDOOMBIN) + snes_spc/libsnes_spc.a $(OBJDIR)/autozend.o -o $(ZDOOMBIN) $(OBJDIR)/%.o: %.cpp $(CCDV) $(CXX) $(CXXFLAGS) -o $@ -c $< @@ -88,7 +88,7 @@ $(OBJDIR)/nodebuild_classify_sse2.o: nodebuild_classify_sse2.cpp $(OBJDIR)/fmopl.o: src/oplsynth/fmopl.cpp $(CCDV) $(CXX) $(CXXFLAGS) -fno-tree-dominator-opts -fno-tree-fre -c -o $@ $< -src/xlat/xlat_parser.c: tools/lemon/lemon src/xlat/xlat_parser.y +src/xlat/xlat_parser.h src/xlat/xlat_parser.c: tools/lemon/lemon src/xlat/xlat_parser.y $(CCDV) tools/lemon/lemon -s src/xlat/xlat_parser.y $(OBJDIR): diff --git a/docs/rh-log.txt b/docs/rh-log.txt index 46053a434..fc5917152 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,3 +1,7 @@ +March 26, 2008 (Changes by Graf Zahl) +- Added Jim' Linux fix. +- Added MartinHowe's fix for mugshot display in status bars. + March 25, 2008 - The garbage collector is now run one last time just before exiting the game. - Removed movie volume from the sound menu and renamed some of the other diff --git a/src/c_console.cpp b/src/c_console.cpp index 9ea68023f..7b0a9d5ee 100644 --- a/src/c_console.cpp +++ b/src/c_console.cpp @@ -865,7 +865,7 @@ int VPrintf (int printlevel, const char *format, va_list parms) FString outline; outline.VFormat (format, parms); - return PrintString (printlevel, outline); + return PrintString (printlevel, outline.GetChars()); } int STACK_ARGS Printf (int printlevel, const char *format, ...) diff --git a/src/g_doom/doom_sbar.cpp b/src/g_doom/doom_sbar.cpp index c97b39613..d5c852e72 100644 --- a/src/g_doom/doom_sbar.cpp +++ b/src/g_doom/doom_sbar.cpp @@ -125,6 +125,11 @@ public: OldFaceIndex = -1; } + void AddFaceToImageCollection (void *skn, FImageCollection *images) + { + AddFaceToImageCollectionActual (skn, images, true); + } + void MultiplayerChanged () { DBaseStatusBar::MultiplayerChanged (); @@ -989,24 +994,6 @@ private: NUM_DOOMSB_IMAGES }; - enum - { - ST_NUMPAINFACES = 5, - ST_NUMSTRAIGHTFACES = 3, - ST_NUMTURNFACES = 2, - ST_NUMSPECIALFACES = 3, - ST_NUMEXTRAFACES = 2, - ST_FACESTRIDE = ST_NUMSTRAIGHTFACES+ST_NUMTURNFACES+ST_NUMSPECIALFACES, - ST_NUMFACES = ST_FACESTRIDE*ST_NUMPAINFACES+ST_NUMEXTRAFACES, - - ST_TURNOFFSET = ST_NUMSTRAIGHTFACES, - ST_OUCHOFFSET = ST_TURNOFFSET + ST_NUMTURNFACES, - ST_EVILGRINOFFSET = ST_OUCHOFFSET + 1, - ST_RAMPAGEOFFSET = ST_EVILGRINOFFSET + 1, - ST_GODFACE = ST_NUMPAINFACES*ST_FACESTRIDE, - ST_DEADFACE = ST_GODFACE + 1 - }; - FImageCollection Images; FImageCollection Faces; diff --git a/src/g_shared/sbar.h b/src/g_shared/sbar.h index f7101d974..58d18189e 100644 --- a/src/g_shared/sbar.h +++ b/src/g_shared/sbar.h @@ -165,6 +165,25 @@ public: POP_Status }; + // Status face stuff + enum + { + ST_NUMPAINFACES = 5, + ST_NUMSTRAIGHTFACES = 3, + ST_NUMTURNFACES = 2, + ST_NUMSPECIALFACES = 3, + ST_NUMEXTRAFACES = 2, + ST_FACESTRIDE = ST_NUMSTRAIGHTFACES+ST_NUMTURNFACES+ST_NUMSPECIALFACES, + ST_NUMFACES = ST_FACESTRIDE*ST_NUMPAINFACES+ST_NUMEXTRAFACES, + + ST_TURNOFFSET = ST_NUMSTRAIGHTFACES, + ST_OUCHOFFSET = ST_TURNOFFSET + ST_NUMTURNFACES, + ST_EVILGRINOFFSET = ST_OUCHOFFSET + 1, + ST_RAMPAGEOFFSET = ST_EVILGRINOFFSET + 1, + ST_GODFACE = ST_NUMPAINFACES*ST_FACESTRIDE, + ST_DEADFACE = ST_GODFACE + 1 + }; + DBaseStatusBar (int reltop); void Destroy (); @@ -190,7 +209,8 @@ public: virtual void AttachToPlayer (player_s *player); virtual void FlashCrosshair (); virtual void BlendView (float blend[4]); - virtual void SetFace (void *); // Takes a FPlayerSkin as input + virtual void SetFace (void *skn); // Takes a FPlayerSkin as input + virtual void AddFaceToImageCollection (void *skn, FImageCollection *images); // Takes a FPlayerSkin as input virtual void NewGame (); virtual void ScreenSizeChanged (); virtual void MultiplayerChanged (); @@ -222,6 +242,8 @@ protected: void GetCurrentAmmo (AAmmo *&ammo1, AAmmo *&ammo2, int &ammocount1, int &ammocount2) const; + void AddFaceToImageCollectionActual (void *skn, FImageCollection *images, bool isDoom); + public: AInventory *ValidateInvFirst (int numVisible) const; void DrawCrosshair (); diff --git a/src/g_shared/sbarinfo_display.cpp b/src/g_shared/sbarinfo_display.cpp index f98482a03..5b2fe7c27 100644 --- a/src/g_shared/sbarinfo_display.cpp +++ b/src/g_shared/sbarinfo_display.cpp @@ -249,6 +249,10 @@ DSBarInfo::DSBarInfo () : DBaseStatusBar (SBarInfoScript->height), { patchnames[i+SBarInfoScript->Images.Size()] = InventoryBarLumps[i]; } + for (i = 0;i < numskins;i++) + { + AddFaceToImageCollection (&skins[i], &Images); + } invBarOffset = SBarInfoScript->Images.Size(); Images.Init(&patchnames[0], patchnames.Size()); drawingFont = V_GetFont("ConFont"); diff --git a/src/g_shared/shared_sbar.cpp b/src/g_shared/shared_sbar.cpp index c8209eb4b..74e5a0e04 100644 --- a/src/g_shared/shared_sbar.cpp +++ b/src/g_shared/shared_sbar.cpp @@ -1536,9 +1536,14 @@ void DBaseStatusBar::FlashItem (const PClass *itemtype) { } -void DBaseStatusBar::SetFace (void *) +void DBaseStatusBar::SetFace (void *skn) { } + +void DBaseStatusBar::AddFaceToImageCollection (void *skn, FImageCollection *images) +{ + AddFaceToImageCollectionActual (skn, images, false); +} void DBaseStatusBar::NewGame () { @@ -1575,6 +1580,72 @@ void DBaseStatusBar::ScreenSizeChanged () } } +//--------------------------------------------------------------------------- +// +// AddFaceToImageCollectionActual +// +// Adds face graphics for specified skin to the specified image collection. +// If not in DOOM statusbar and no face in current skin, do NOT default STF* +// +//--------------------------------------------------------------------------- + +void DBaseStatusBar::AddFaceToImageCollectionActual (void *skn, FImageCollection *images, bool isDoom) +{ + const char *nameptrs[ST_NUMFACES]; + char names[ST_NUMFACES][9]; + char prefix[4]; + int i, j; + int namespc; + int facenum; + FPlayerSkin *skin = (FPlayerSkin *)skn; + + if ((skin->face[0] == 0) && !isDoom) + { + return; + } + + for (i = 0; i < ST_NUMFACES; i++) + { + nameptrs[i] = names[i]; + } + + if (skin->face[0] != 0) + { + prefix[0] = skin->face[0]; + prefix[1] = skin->face[1]; + prefix[2] = skin->face[2]; + prefix[3] = 0; + namespc = skin->namespc; + } + else + { + prefix[0] = 'S'; + prefix[1] = 'T'; + prefix[2] = 'F'; + prefix[3] = 0; + namespc = ns_global; + } + + facenum = 0; + + for (i = 0; i < ST_NUMPAINFACES; i++) + { + for (j = 0; j < ST_NUMSTRAIGHTFACES; j++) + { + sprintf (names[facenum++], "%sST%d%d", prefix, i, j); + } + sprintf (names[facenum++], "%sTR%d0", prefix, i); // turn right + sprintf (names[facenum++], "%sTL%d0", prefix, i); // turn left + sprintf (names[facenum++], "%sOUCH%d", prefix, i); // ouch! + sprintf (names[facenum++], "%sEVL%d", prefix, i); // evil grin ;) + sprintf (names[facenum++], "%sKILL%d", prefix, i); // pissed off + } + sprintf (names[facenum++], "%sGOD0", prefix); + sprintf (names[facenum++], "%sDEAD0", prefix); + + images->Add (nameptrs, ST_NUMFACES, namespc); +} + //--------------------------------------------------------------------------- // // ValidateInvFirst diff --git a/src/sound/music_midi_base.cpp b/src/sound/music_midi_base.cpp index 8d52d9762..f168e53cf 100644 --- a/src/sound/music_midi_base.cpp +++ b/src/sound/music_midi_base.cpp @@ -1,4 +1,3 @@ -#ifdef _WIN32 #include "i_musicinterns.h" #include "c_dispatch.h" #include "i_music.h" @@ -10,6 +9,7 @@ static DWORD nummididevices; static bool nummididevicesset; +#ifdef _WIN32 UINT mididevice; CVAR (Bool, snd_midiprecache, true, CVAR_ARCHIVE|CVAR_GLOBALCONFIG); diff --git a/src/v_collection.cpp b/src/v_collection.cpp index 55bac6093..bc61cd867 100644 --- a/src/v_collection.cpp +++ b/src/v_collection.cpp @@ -70,6 +70,30 @@ void FImageCollection::Init (const char **patchNames, int numPatches, int namesp } } +// [MH] Mainly for mugshots with skins and SBARINFO +void FImageCollection::Add (const char **patchNames, int numPatches, int namespc) +{ + int NewNumImages = NumImages + numPatches; + int *NewImageMap = new int[NewNumImages]; + + memcpy(NewImageMap, ImageMap, (NumImages * sizeof(int))); + + for (int i = 0; i < numPatches; ++i) + { + int picnum = TexMan.AddPatch (patchNames[i], namespc, true); + + if (picnum == -1 && namespc != ns_sprites) + { + picnum = TexMan.AddPatch (patchNames[i], ns_sprites); + } + NewImageMap[NumImages + i] = picnum; + } + + delete[] ImageMap; + ImageMap = NewImageMap; + NumImages = NewNumImages; +} + void FImageCollection::Uninit () { if (ImageMap != NULL) diff --git a/src/v_collection.h b/src/v_collection.h index be6eed119..1a7898ebd 100644 --- a/src/v_collection.h +++ b/src/v_collection.h @@ -45,6 +45,7 @@ public: ~FImageCollection (); void Init (const char **patchnames, int numPatches, int namespc=0); + void Add (const char **patchnames, int numPatches, int namespc=0); void Uninit (); FTexture *operator[] (int index) const;