Commit Graph

174 Commits

Author SHA1 Message Date
hendricks266 719efefbf0 Wii: Take advantage of libogc features: PNG screenshots (libpng/zlib), Ogg Vorbis audio (libtremor), and high-resolution profiling timers.
FLAC and VPX remain out in the cold.

git-svn-id: https://svn.eduke32.com/eduke32@3497 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-18 08:50:42 +00:00
hendricks266 624841257c Wii: Fix most warnings. Three remain: two are labeled with FIXMEs; the third consists of signed/unsigned comparisons involving LSWAPIB() in kplib.c.
git-svn-id: https://svn.eduke32.com/eduke32@3496 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-18 08:50:08 +00:00
hendricks266 75e5cebfff Wii: Fix build.
git-svn-id: https://svn.eduke32.com/eduke32@3494 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-18 08:48:18 +00:00
hendricks266 05a550c08d Address some macro madness in jaudiolib. (Should fix PowerPC builds.)
git-svn-id: https://svn.eduke32.com/eduke32@3370 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-04 17:29:03 +00:00
hendricks266 bf566e10a8 Rectify.
git-svn-id: https://svn.eduke32.com/eduke32@3340 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-29 11:27:07 +00:00
hendricks266 be03f29484 Clean up and factor jaudiolib.
git-svn-id: https://svn.eduke32.com/eduke32@3338 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-29 10:59:21 +00:00
hendricks266 11e0897def Fix the gap between loops of ambient MUSICANDSFX sounds like BAR_MUSIC.
git-svn-id: https://svn.eduke32.com/eduke32@3336 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-29 10:58:09 +00:00
hendricks266 3933471e4b All kneel, king FLAC is here.
FLAC source from git commit 0920bc1ffb07f038b317e7e8056509fe0e4b680e, patched by me.

Windows libFLAC.a built using i686-MinGW-w64 and x86_64-MinGW-w64.

HUGE thanks to rhoenie for building the Mac fat library (ppc, i686, x86_86).

git-svn-id: https://svn.eduke32.com/eduke32@3335 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-29 10:57:24 +00:00
hendricks266 95dd57154e Clean up some file and directory structure.
* Renamed source/jaudiolib/third-party/mingw32 to source/jaudiolib/third-party/Windows.
* Moved source/jaudiolib/third-party/Windows/include to source/jaudiolib/third-party/common/include to use both on Windows and Apple.
* Deleted Apple/lib/include/{ogg,vorbis}/, see previous point.
* Deleted Apple/lib/libvorbisenc.a, 6MB saved.
* Moved Apple/lib/lib{ogg,vorbis,vorbisfile}.a to source/jaudiolib/third-party/Apple/lib, where they belong.
* Moved source files in Apple/ to source/, where they belong. (SDLMain.[mh] stay.)
* Deleted source/jaudiolib/third-party/{ogg,vorbis}.framework, not used any more.
* Renamed "StartupWinController*" to "startosx*".

git-svn-id: https://svn.eduke32.com/eduke32@3334 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-29 10:54:35 +00:00
terminx 8e61bff6f1 Bump DirectSound version to 8. This shouldn't really affect anything as the API is the same for all of the bits we make use of, but certain sets of DirectX headers/libs seem to be lacking v7 support.
git-svn-id: https://svn.eduke32.com/eduke32@3333 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-29 05:23:28 +00:00
terminx feaf4a7988 Remove FX_ASSVersion and related code since it wasn't used anywhere
git-svn-id: https://svn.eduke32.com/eduke32@3332 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-29 05:23:14 +00:00
terminx 61a8eaf666 Throw a compiler warning when building with only the null sound driver
git-svn-id: https://svn.eduke32.com/eduke32@3331 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-29 05:22:55 +00:00
terminx 0ae2d9ad60 Fix DirectSound in MSVC builds and remove the dependency on the DirectX SDK
git-svn-id: https://svn.eduke32.com/eduke32@3330 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-29 05:22:39 +00:00
terminx ba8d1a5c1e Change a few paths in various MSVC Makefiles to better suit my current dev environment. This doesn't really affect anyone else since these paths need to be customized to fit whatever machine by anyone building with MSVC anyway.
git-svn-id: https://svn.eduke32.com/eduke32@3282 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-14 17:13:17 +00:00
hendricks266 dac94ce284 Win64 support! (Meaning it works, not that we recommend it for everyday use.)
This includes a complete Windows header and library refresh, including the addition of 64-bit compiled libs:
*libogg 1.3.0
*libvorbis 1.3.3
*zlib 1.2.7
*libpng 1.5.13
*libvpx 9a3de881c0e681ba1a79a166a86308bbc84b4acd
*SDL_mixer 1.2.12 (for RENDERTYPE=SDL)
*DirectX import libraries: dsound and dxguid (now included)

To build in 64-bit, you essentially need MinGW's MSYS (but not MinGW itself) and MinGW-w64 at the top of your PATH. The target is automatically detected using `$(CC) -dumpmachine`. The EDukeWiki will get detailed instrucitons.

All compiler and linker warnings when building in 64-bit mode have been fixed.

Remaining 64-bit to-do:
 - The ebacktrace dll does not build under 64-bit. It uses code specific to the format of 32-bit executables and will have to be ported to work with 64-bit executables. A future 64-bit version will be named ebacktrace1-64.dll.
 - RENDERTYPE=SDL crashes in SDL_mixer's Mix_Linked_Version().
 - DirectInput gives an error and does not function. This only affects joysticks, and the error never happens without any plugged in.
 - Port the classic renderer ASM to 64-bit. (Just kidding, this is way out of my league.)

This commit includes a fair bit of Makefile development spanning all platforms, including simplifying the SDLCONFIG code, fixing build on Mac OS X (thanks rhoenie!), globally factoring Apple brew/port inclusion, enforcing that all -L come before all -l, and ensuring that $(shell ) is always :='d.

In addition, I have resurrected the old GCC_MAJOR and GCC_MINOR detection using `$(CC) -dumpversion`, but I have made it failsafe in case the command fails or the version is manually specified. I have applied this new fine-grained detection where applicable, including allowing LTO, and restraining -W's to versions that support them.

git-svn-id: https://svn.eduke32.com/eduke32@3278 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-13 02:37:20 +00:00
hendricks266 9fcba228b1 Build tweaks:
Set up the use of {Windows,Apple}/{include,lib} regardless of feature toggles in Makefile.common using $(abspath ) in reference to the directory Makefile.common is in.
Add the three DirectX headers that are actually used to the repo. (from: http://alleg.sourceforge.net/files/dx9mgw.zip)
Since current MinGW versions include DirectX libs (for dynamic linking), remove "-L$(DXROOT)/lib".
The DirectX headers are no longer a separate dependency for building.
Add $(SDLROOT_OVERRIDE). $(SDLROOT) only functions for Windows and Mac OS X.
Factor handling of $(DXROOT_OVERRIDE) and $(SDLROOT_OVERRIDE) into Makefile.shared using $(abspath ).

git-svn-id: https://svn.eduke32.com/eduke32@3275 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-13 02:34:30 +00:00
hendricks266 a2f585fcfb jaudiolib: Modify OGG looping code to support the LOOP_LENGTH tag (where internally LOOP_START + LOOP_LENGTH = LOOP_END), and all three tags without the underscore.
As a note, libvorbis' vorbis_comment_query() checks for tags case-insensitively.

(This was done to support the output of vgmstream's "test.exe -g".)

git-svn-id: https://svn.eduke32.com/eduke32@3273 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-13 02:33:23 +00:00
hendricks266 be899ba3af For novelty, add support for RENDERTYPE=SDL under Windows.
This needs improvements to bring it up to par with winlayer, but it is functional. In particular, a good amount of code from winlayer could be used for both layers, including the profiling timers, the version printing code, and the hInstance and hModule sharing.

Known problems: the mouse cursor is not trapped, and the game starts before the startup window shows options.

git-svn-id: https://svn.eduke32.com/eduke32@3219 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-24 09:13:29 +00:00
hendricks266 1f0693eca4 Implement OGG looping support; musicians rejoice!
Loops are controlled by two tags in the Vorbis Comment, both in PCM samples.

LOOP_START holds the beginning of the loop, the position to which playback returns at the end of the loop.

LOOP_END is optional; it holds the end of the loop, after which the game seeks to LOOP_START. If undefined, the end of the OGG is the end of the loop. The primary purpose of LOOP_END is if you want to give your file a proper ending for listening outside the game.

To preview a looped OGG you have assembled, give it a ".logg" extension and play it using the vgmstream plugin for Winamp or foobar2000.

git-svn-id: https://svn.eduke32.com/eduke32@3218 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-24 09:12:15 +00:00
helixhorned 61d038f217 Split r3159..r3161, part 11: Add explicit casts, pointer types.
git-svn-id: https://svn.eduke32.com/eduke32@3177 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-15 14:28:36 +00:00
helixhorned 1cd11d06ef Revert "Fix the warnings when building with C++, add MSVC C++ build support."
This reverts r3159..r3161.

Conflicts:
	eduke32/build/include/compat.h
(Handled so that r3163's changes are kept applied.)

git-svn-id: https://svn.eduke32.com/eduke32@3165 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-15 14:27:45 +00:00
terminx 3ff46c02b2 Fix the warnings when building with C++, add MSVC C++ build support. This also changes the internal type of lotags, hitags and cstat type fields to uint16_t instead of int16_t to clean up some dubious behavior wherein the code was using a value of 32768 as a flag in these fields for certain types of things, like invisible sprites (using the value as if it was uint16_t) where it was elsewhere checking if the value was < 0 (using the value as if it was int16_t). This change may break a few specific effects if any part of the relevant code was missed when looking for areas that needed to be addressed.
I think there's also a fix for the CON precache system breakage in here (lost it in my local tree when I started getting the C++ build working in MSVC, sorry!)


git-svn-id: https://svn.eduke32.com/eduke32@3159 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-14 23:32:43 +00:00
Plagman be310c4d00 Fix warning in jaudiolib due to void ptr arith.
git-svn-id: https://svn.eduke32.com/eduke32@3140 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-10 01:53:54 +00:00
hendricks266 a0c6fb9805 Fix linking with CLANG=1 by separating $(INVOCATION) into $(COMPILER) and $(LINKER) and removing "-x" from clang as a linker in Makefile.common. Additionally, the Build tools are now affected by CPLUSPLUS=1, for which small corrections have been made.
git-svn-id: https://svn.eduke32.com/eduke32@3122 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-06 07:49:44 +00:00
hendricks266 fcf9beae6a Work-in-progress adjustment to the C code to compile under C++. It builds for me without errors using Win32 MinGW-GCC, but it still generates warning soup. No guarantees about MSVC or anything using SDL. Enable C++ by building with CPLUSPLUS=1. C remains the default and should compile with no change in setup.
Credit to Plagman for the idea and doing the work on the game side, which is included in this commit.

(Building as C++ will give us features with which we can make improvements and optimizations on the multiplayer code and Polymer.)

git-svn-id: https://svn.eduke32.com/eduke32@3116 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-05 02:49:08 +00:00
hendricks266 f51bdc2faa Slight makefile reorganization and cleanup.
* Centralize optimization strategies in Makefile.common. This required moving detection of $(PLATFORM), which makes sense if we work on the paradigm that Makefile.common is for generic compiler setup and Makefile.shared works with libraries and things closer to the engine and game code itself.
* New Makefile variables OPTOPT (Optimization Options) and CUSTOMOPT (Custom Optimizations). OPTOPT by default contains -march, -mtune, etc. Setting this variable from Make invocation will blank these. CUSTOMOPT (Custom Optimizations) works the same but in an additive fashion, overwriting nothing. Technically CUSTOMOPT could stand for (Custom Options) and include any additional parameters sent to both linker and compiler.
* Factor out literal names of the main executables.
* The build process now prints assembler (if NOASM=0) and linker settings in addition to compiler settings.

git-svn-id: https://svn.eduke32.com/eduke32@3096 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-29 04:26:25 +00:00
hendricks266 9f0824e79f Fix three (probably harmless) maybe-uninitialized warnings.
git-svn-id: https://svn.eduke32.com/eduke32@3017 1a8010ca-5511-0410-912e-c29ae57300e0
2012-09-13 07:07:21 +00:00
terminx 886f2e5a26 Update our prebuilt MinGW libogg/libvorbis/libvorbisfile to the newest versions, courtesy of forum user LeoD
git-svn-id: https://svn.eduke32.com/eduke32@2812 1a8010ca-5511-0410-912e-c29ae57300e0
2012-07-06 18:40:54 +00:00
helixhorned bdedbc6f76 Constify various char* vars, parameters, etc. for more -Wwrite-strings cleanness
-Wwrite-strings is useful to detect code where string literals and e.g. alloc'd
strings are used side-by-side, potentially creating dangerous situations, or to
find uses of old, non-constified APIs.  However, enabling it would still flood
the log with too many warnings.  Also, GCC wrongly warns for initializations of
char arrays.

git-svn-id: https://svn.eduke32.com/eduke32@2796 1a8010ca-5511-0410-912e-c29ae57300e0
2012-07-01 22:11:33 +00:00
helixhorned ed5e5b5881 Add prototypical SDL 2.X support.
Doesn't work: indexed-color modes, gamma (at least for X11), mouse wheel,
special keys like ENTER or BACKSPACE in the OSD, probably more...

In build/Makefile.shared, we now have logic to autodetect an SDL2 installed
in /usr/local, however OS X and Wii builds follow other Makefile code paths,
it seems.  Note that the matching SDL2_mixer must be used then, too.
In source/jaudiolib/src/driver_sdl.c, change the #includes from <SDL/SDL_xxx.h>
to "SDL_xxx.h".  SDL wiki says this is the most portable way, hopefully this
doesn't break builds for anyone.

git-svn-id: https://svn.eduke32.com/eduke32@2777 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-22 21:39:53 +00:00
terminx cbbaec7694 Replace a few "#ifdef GEKKO" statements added for the Wii port with "#ifdef HAVE_VORBIS" like they should have been in the first place. Allows jaudiolib to build without Ogg support on platforms other than the Wii if desired.
git-svn-id: https://svn.eduke32.com/eduke32@2719 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-02 00:01:36 +00:00
terminx 4ba6da5007 Addition of 3 events:
EVENT_SOUND: triggered upon playback of any sound, this allows the "hard coded" sounds to be altered in a context-aware fashion instead of having to resort to clunky hacks like replacing them with a blank sound effect.  RETURN var
iable is set to the sound effect # of the sound to be played, or -1 to cancel playback.

EVENT_CHECKTOUCHDAMAGE: triggered in P_CheckTouchDamage() whenever the player collides with anything.  Value of RET
URN is set to the result provided by clipmove() and so can be decoded in the same way.  Value of RETURN when the event is over can also be manipulated to control some of the hard coded damage effects.

EVENT_CHECKFLOORDAMAGE: triggered in P_CheckFloorDamage(), RETURN is simply the picnum of the floor of the sector t
he player is in.  Can be used to cancel hard coded floor damage effects or to make other tiles exhibit the same eff
ects

Other misc fixes and cleanups, including a possible workaround for Duke Plus SECTOREFFECTOR light issues wherein all SE49 and SE50 that have a statnum of STAT_EFFECTOR are simply changed to STAT_LIGHT during the STAT_EFFECTOR loop
 now.


git-svn-id: https://svn.eduke32.com/eduke32@2652 1a8010ca-5511-0410-912e-c29ae57300e0
2012-05-14 18:12:27 +00:00
helixhorned 008121cffd Some leftover stuff from the Wii patch.
- in actors.c, make a static array const (the original patch removed the
  staticness)
- remove one comment and change some compiled-out code
- remove commented out pre-Makefile.common stuff

Some changes were not adopted from tueidj's patch:
- whitespace cleanup
- ud.config.UseJoystick = 1 in config.c
- Makefile.common, as mentioned before
- proper read-in of g_numRealPalettes, because it was done with r2503

git-svn-id: https://svn.eduke32.com/eduke32@2632 1a8010ca-5511-0410-912e-c29ae57300e0
2012-05-01 12:41:35 +00:00
helixhorned 68e6141c32 Patch adding Wii support by tueidj, part 10: sound and endianness changes
This part is a mixture of the original patch and my changes.  It seems like
tueidj had some trouble
 1) getting OGG to work, which is why it's conditionally compiled out
 2) struggling with endianness with the mixing routines?  This may be also
    due to him missing to define two others BIGENDIAN macros (our code is
    in need of cleanup there).  Note the change in jaudiolib/src/mix.c!

Because I added my share to this part, I might have actually broken sound
mixing on big-endian platforms.

git-svn-id: https://svn.eduke32.com/eduke32@2630 1a8010ca-5511-0410-912e-c29ae57300e0
2012-05-01 12:40:53 +00:00
helixhorned bd8559f6c3 Patch adding Wii support by tueidj, part 2: Makefile changes
I didn't add Makefile.common, because it needs to be made conditional.

git-svn-id: https://svn.eduke32.com/eduke32@2622 1a8010ca-5511-0410-912e-c29ae57300e0
2012-05-01 12:37:53 +00:00
hendricks266 64595adfb2 Makefiles:
- Properly handle the architecture definition when BUILD32_ON_64=1
 - Add proper $(*LDFLAGS) to which LTO and ARCH are correctly passed.
 - Cleanup of compiler flag variables.

This should fix to some degree building of the Build tools on OS X, and it may possibly fix the crashing of the OS X x86 32-bit build.

git-svn-id: https://svn.eduke32.com/eduke32@2520 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-23 20:22:10 +00:00
hendricks266 c5519e3fe8 More Build tools improvements:
- JFBuild ports: arttool, givedepth, and mkpalette
 - All viable tools are now built when 'make utils' is invoked, not just some
 - Revert "initprintf" hack of previous commit and replace it with "compat_tools.c"
 - Move Bstrtolower from baselayer.c to compat.c
 - Makefiles: Add start and finish messages for the tools
 - Makefiles: To prevent "-Wimplicit" from being passed to the C++ compiler, create $(*CONLYFLAGS)

git-svn-id: https://svn.eduke32.com/eduke32@2458 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-12 04:48:42 +00:00
hendricks266 858746d081 Fix JonoF's email address.
git-svn-id: https://svn.eduke32.com/eduke32@2456 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-12 04:47:04 +00:00
hendricks266 56c002d3a1 Add APPLE_FRAMEWORKS Makefile variable which can be passed to the make invocation.
ex: make APPLE_FRAMEWORKS=~/Library/Frameworks

git-svn-id: https://svn.eduke32.com/eduke32@2398 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-04 09:31:37 +00:00
helixhorned 97ebb029d6 Make compiler happy: remove 'may be used uninitialized' warning in multivoc.c.
I'm not getting this warning (synthesis is) but I think it's justified because
the VOC block parsing code isn't terribly validating...

git-svn-id: https://svn.eduke32.com/eduke32@2364 1a8010ca-5511-0410-912e-c29ae57300e0
2012-02-18 22:15:35 +00:00
helixhorned ebbf4d79ce Clean up VOC in-memory block type parsing.
- Maintain a position relative to the start of the data. VOC doesn't
  mandate an EOF marker (blocktype 0). If we go over the end, fake
  that marker, so as to restart a looping sound or stop a one-shot one.
  This fixes an uninitialized mem access with the corrupt SNAKRM.VOC.
- When encountering the EOF marker, don't read the 3 bytes of block size,
  since they may not be there.
- Read blocksize by ORing and shifting the 3 bytes, not with *(int32_t *)...

git-svn-id: https://svn.eduke32.com/eduke32@2346 1a8010ca-5511-0410-912e-c29ae57300e0
2012-02-16 19:24:28 +00:00
helixhorned 8ab0fbf7f4 Patch up out-of-bounds access (r/w) when mixing 16-bit stereo *source* data.
... by allocating two bytes more for the mixing buffers.

git-svn-id: https://svn.eduke32.com/eduke32@2336 1a8010ca-5511-0410-912e-c29ae57300e0
2012-02-12 13:47:15 +00:00
helixhorned 53ddc89516 triv: comment out FX_PlayLoopedAuto debug message to stdout
git-svn-id: https://svn.eduke32.com/eduke32@2113 1a8010ca-5511-0410-912e-c29ae57300e0
2011-11-17 21:09:26 +00:00
helixhorned a4ba86ee31 Explicitly initialize voice->Playing and voice->Paused members in some sound
playback functions. Without these, there would be an uninitialized access
in line 444 of multivoc.c (if the memory in question was allocated with malloc,
but still...)

git-svn-id: https://svn.eduke32.com/eduke32@2101 1a8010ca-5511-0410-912e-c29ae57300e0
2011-11-01 22:02:54 +00:00
helixhorned fdd84d1870 More beauty tinkering: decorate the 'start' pointer of the mixing functions
and some VoiceNode struct members with a const, commit forgotten vorbis.c
changes.

git-svn-id: https://svn.eduke32.com/eduke32@2100 1a8010ca-5511-0410-912e-c29ae57300e0
2011-11-01 22:02:37 +00:00
helixhorned a9278e1977 trivial stylistic changes continued: upcase all macro constants and make
MV_MaxVolume into one again.

git-svn-id: https://svn.eduke32.com/eduke32@2099 1a8010ca-5511-0410-912e-c29ae57300e0
2011-11-01 22:02:14 +00:00
helixhorned 2da13064c1 multivoc.c: trivial stylistic changes, make some functions static
git-svn-id: https://svn.eduke32.com/eduke32@2098 1a8010ca-5511-0410-912e-c29ae57300e0
2011-11-01 22:01:54 +00:00
helixhorned 6cfdc2b376 Delete maphack lights when changing from Polymer to another renderer.
This fixes a crash when loading a map afterwards.

Tweak a few debugging messages and some whitespace.

git-svn-id: https://svn.eduke32.com/eduke32@2068 1a8010ca-5511-0410-912e-c29ae57300e0
2011-10-03 17:43:16 +00:00
helixhorned 043c756676 A couple more OSX tweaks: pull in 'nibless' SDLMain.m into tree for future hacking, fix backspace ('delete') key in OSD, almost everything to make x86 binaries actually run.
git-svn-id: https://svn.eduke32.com/eduke32@1905 1a8010ca-5511-0410-912e-c29ae57300e0
2011-06-17 11:53:41 +00:00
helixhorned dd355636ff A couple of OSX fixes: one 64-bit cleanup, compilation fix on ppc (is that ever used?), nasm command line fix for x86
git-svn-id: https://svn.eduke32.com/eduke32@1903 1a8010ca-5511-0410-912e-c29ae57300e0
2011-06-15 10:38:12 +00:00