Some more cleanup. DUMB files will be soft excluded when not compiling with -DDUMB

This commit is contained in:
eukos 2015-08-25 03:51:53 +02:00
parent 6a6990bd77
commit 170d0d8c66
42 changed files with 167 additions and 66 deletions

View file

@ -181,6 +181,8 @@ NGUNIX_OBJS = \
$(BUILDDIR)/wad.o \
$(BUILDDIR)/world.o \
$(BUILDDIR)/tracker_fmodex.o \
$(BUILDDIR)/tracker_linux.o \
$(BUILDDIR)/tracker_xmms-ctl.o \
$(BUILDDIR)/tracker_main.o \
$(BUILDDIR)/sys_linux.o \
$(BUILDDIR)/vid_x.o \
@ -534,6 +536,12 @@ $(BUILDDIR)/world.o : $(MOUNT_DIR)/world.c
$(BUILDDIR)/tracker_fmodex.o :$(MOUNT_DIR)/../tracker/tracker_fmodex.c
$(DO_CC)
$(BUILDDIR)/tracker_xmms-ctl.o :$(MOUNT_DIR)/../tracker/tracker_xmms-ctl.c
$(DO_CC)
$(BUILDDIR)/tracker_linux.o :$(MOUNT_DIR)/../tracker/tracker_linux.c
$(DO_CC)
$(BUILDDIR)/tracker_main.o :$(MOUNT_DIR)/../tracker/tracker_main.c
$(DO_CC)

View file

@ -16,7 +16,7 @@
* | ' /
* \__/
*/
#ifdef DUMB
#include <stdlib.h>
#include "dumb.h"
@ -69,3 +69,4 @@ void dumb_exit(void)
dumb_atexit_proc = next;
}
}
#endif

View file

@ -22,21 +22,19 @@
* such as Winamp to stop, and in any good DUH it will allow for any final
* flourish to fade out and be appreciated.
*/
#ifdef DUMB
#include "dumb.h"
#include "internal/dumb.h"
long duh_get_length(DUH *duh)
{
return duh ? duh->length : 0;
}
void duh_set_length(DUH *duh, long length)
{
if (duh)
duh->length = length;
}
#endif

View file

@ -17,13 +17,12 @@
* \__/
*/
#include <string.h>
#ifdef DUMB
#include <string.h>
#include "dumb.h"
#include "internal/dumb.h"
const char *duh_get_tag(DUH *duh, const char *key)
{
int i;
@ -36,3 +35,4 @@ const char *duh_get_tag(DUH *duh, const char *key)
return NULL;
}
#endif

View file

@ -17,12 +17,11 @@
* \__/
*/
#ifdef DUMB
#include <stdlib.h>
#include "dumb.h"
static DUMBFILE_SYSTEM *the_dfs = NULL;
@ -399,3 +398,5 @@ int dumbfile_close(DUMBFILE *f)
return rv;
}
#endif

View file

@ -17,11 +17,11 @@
* \__/
*/
#ifdef DUMB
#include "dumb.h"
#include "internal/dumb.h"
/* load_duh(): loads a .duh file, returning a pointer to a DUH struct.
* When you have finished with it, you must pass the pointer to unload_duh()
* so that the memory can be freed.
@ -40,3 +40,4 @@ DUH *load_duh(const char *filename)
return duh;
}
#endif

View file

@ -17,14 +17,13 @@
* \__/
*/
#ifdef DUMB
#include <stdlib.h>
#include <string.h>
#include "dumb.h"
#include "internal/dumb.h"
static DUH_SIGNAL *make_signal(DUH_SIGTYPE_DESC *desc, sigdata_t *sigdata)
{
DUH_SIGNAL *signal;
@ -130,3 +129,4 @@ DUH *make_duh(
return duh;
}
#endif

View file

@ -16,14 +16,13 @@
* | ' /
* \__/
*/
#ifdef DUMB
#include <stdlib.h>
#include "dumb.h"
#include "internal/dumb.h"
/* You have to specify the type of sigdata, proving you know what to do with
* the pointer. If you get it wrong, you can expect NULL back.
*/
@ -42,3 +41,5 @@ sigdata_t *duh_get_raw_sigdata(DUH *duh, int sig, long type)
return NULL;
}
#endif

View file

@ -17,6 +17,8 @@
* \__/
*/
#ifdef DUMB
#include <stdlib.h>
#include "dumb.h"
@ -105,3 +107,4 @@ DUH *read_duh(DUMBFILE *f)
return duh;
}
#endif

View file

@ -17,13 +17,13 @@
* \__/
*/
#ifdef DUMB
#include <stdlib.h>
#include "dumb.h"
#include "internal/dumb.h"
static DUH_SIGTYPE_DESC_LINK *sigtype_desc = NULL;
static DUH_SIGTYPE_DESC_LINK **sigtype_desc_tail = &sigtype_desc;
@ -102,3 +102,5 @@ DUH_SIGTYPE_DESC *_dumb_get_sigtype_desc(long type)
return desc_link ? desc_link->desc : NULL;
}
#endif

View file

@ -17,6 +17,8 @@
* \__/
*/
#ifdef DUMB
#include <stdlib.h>
#include <limits.h>
@ -182,3 +184,5 @@ DUH_SIGRENDERER *duh_renderer_decompose_to_sigrenderer(DUH_SIGRENDERER *dr)
{
return dr;
}
#endif

View file

@ -17,13 +17,13 @@
* \__/
*/
#ifdef DUMB
#include <stdlib.h>
#include "dumb.h"
#include "internal/dumb.h"
struct DUH_SIGRENDERER
{
DUH_SIGTYPE_DESC *desc;
@ -342,3 +342,5 @@ sigrenderer_t *duh_decompose_to_raw_sigrenderer(DUH_SIGRENDERER *sigrenderer, lo
return NULL;
}
#endif
#endif

View file

@ -17,6 +17,8 @@
* \__/
*/
#ifdef DUMB
#include <stdlib.h>
#include "dumb.h"
@ -62,3 +64,5 @@ void unload_duh(DUH *duh)
free(duh);
}
}
#endif

View file

@ -17,12 +17,12 @@
* \__/
*/
#ifdef DUMB
#include <stdlib.h>
#include <math.h>
#include "dumb.h"
typedef struct DUMB_CLICK DUMB_CLICK;
@ -279,3 +279,5 @@ void dumb_destroy_click_remover_array(int n, DUMB_CLICK_REMOVER **cr)
free(cr);
}
}
#endif

View file

@ -17,6 +17,8 @@
* \__/
*/
#ifdef DUMB
#include <stdlib.h>
#include <string.h>
@ -94,3 +96,5 @@ DUMBFILE *dumbfile_open_memory(const char *data, long size)
return dumbfile_open_ex(m, &memfile_dfs);
}
#endif

View file

@ -42,11 +42,11 @@
* FIXME: these comments are somewhat out of date now.
*/
#ifdef DUMB
#include <math.h>
#include "dumb.h"
/* Compile with -DHEAVYDEBUG if you want to make sure the pick-up function is
* called when it should be. There will be a considerable performance hit,
* since at least one condition has to be tested for every sample generated.
@ -383,3 +383,5 @@ void dumb_end_resampler_n(int n, DUMB_RESAMPLER *resampler)
else
dumb_end_resampler(resampler);
}
#endif

View file

@ -17,11 +17,11 @@
* \__/
*/
#ifdef DUMB
#include <stdlib.h>
#include "dumb.h"
/* DEPRECATED */
sample_t **create_sample_buffer(int n_channels, long length)
{
@ -62,3 +62,5 @@ void destroy_sample_buffer(sample_t **samples)
free(samples);
}
}
#endif

View file

@ -17,13 +17,14 @@
* \__/
*/
#ifdef DUMB
#include <string.h>
#include "dumb.h"
void dumb_silence(sample_t *samples, long length)
{
memset(samples, 0, length * sizeof(*samples));
}
#endif

View file

@ -17,12 +17,12 @@
* \__/
*/
#ifdef DUMB
#include <stdio.h>
#include "dumb.h"
static void *dumb_stdfile_open(const char *filename)
{
return fopen(filename, "rb");
@ -91,3 +91,4 @@ DUMBFILE *dumbfile_open_stdfile(FILE *p)
return d;
}
#endif

View file

@ -17,6 +17,8 @@
* \__/
*/
#ifdef DUMB
#include "dumb.h"
#include "internal/it.h"
@ -40,3 +42,4 @@ DUH *dumb_load_it_quick(const char *filename)
return duh;
}
#endif

View file

@ -17,13 +17,15 @@
* \__/
*/
#ifdef DUMB
#include "dumb.h"
DUH *dumb_load_it(const char *filename)
{
DUH *duh = dumb_load_it_quick(filename);
dumb_it_do_initial_runthrough(duh);
return duh;
}
#endif

View file

@ -17,11 +17,11 @@
* \__/
*/
#ifdef DUMB
#include "dumb.h"
#include "internal/it.h"
DUMB_IT_SIGDATA *duh_get_it_sigdata(DUH *duh)
{
return duh_get_raw_sigdata(duh, 0, SIGTYPE_IT);
@ -245,3 +245,5 @@ int dumb_it_sr_get_channel_muted(DUMB_IT_SIGRENDERER *sr, int channel)
{
return sr ? (sr->channel[channel].flags & IT_CHANNEL_MUTED) != 0 : 0;
}
#endif

View file

@ -17,7 +17,7 @@
* \__/
*/
#ifdef DUMB
#include <stdlib.h>
@ -61,3 +61,4 @@ int _dumb_it_fix_invalid_orders(DUMB_IT_SIGDATA *sigdata)
return 0;
}
#endif

View file

@ -17,6 +17,8 @@
* \__/
*/
#ifdef DUMB
#include <stdlib.h>
#include <string.h>//might not be necessary later; required for memset
@ -1200,3 +1202,4 @@ DUH *dumb_read_it_quick(DUMBFILE *f)
return make_duh(-1, 1, (const char *const (*)[2])tag, 1, &descptr, &sigdata);
}
}
#endif

View file

@ -16,14 +16,14 @@
* | ' /
* \__/
*/
#ifdef DUMB
#include "dumb.h"
DUH *dumb_read_it(DUMBFILE *f)
{
DUH *duh = dumb_read_it_quick(f);
dumb_it_do_initial_runthrough(duh);
return duh;
}
#endif

View file

@ -17,6 +17,8 @@
* \__/
*/
#ifdef DUMB
#include <math.h>
#include <stdlib.h>
@ -3737,3 +3739,4 @@ void dumb_it_do_initial_runthrough(DUH *duh)
duh_set_length(duh, dumb_it_build_checkpoints(sigdata));
}
}
#endif

View file

@ -17,6 +17,8 @@
* \__/
*/
#ifdef DUMB
#include <stdlib.h>
#include "dumb.h"
@ -70,3 +72,5 @@ void _dumb_it_unload_sigdata(sigdata_t *vsigdata)
free(vsigdata);
}
}
#endif

View file

@ -17,11 +17,11 @@
* \__/
*/
#ifdef DUMB
#include "dumb.h"
#include "internal/it.h"
/* dumb_load_mod_quick(): loads a MOD file into a DUH struct, returning a
* pointer to the DUH struct. When you have finished with it, you must
* pass the pointer to unload_duh() so that the memory can be freed.
@ -40,3 +40,5 @@ DUH *dumb_load_mod_quick(const char *filename)
return duh;
}
#endif

View file

@ -17,8 +17,9 @@
* \__/
*/
#include "dumb.h"
#ifdef DUMB
#include "dumb.h"
DUH *dumb_load_mod(const char *filename)
@ -27,3 +28,5 @@ DUH *dumb_load_mod(const char *filename)
dumb_it_do_initial_runthrough(duh);
return duh;
}
#endif

View file

@ -17,11 +17,12 @@
* \__/
*/
#ifdef DUMB
#include "dumb.h"
#include "internal/it.h"
/* dumb_load_s3m_quick(): loads an S3M file into a DUH struct, returning
* a pointer to the DUH struct. When you have finished with it, you must
* pass the pointer to unload_duh() so that the memory can be freed.
@ -40,3 +41,5 @@ DUH *dumb_load_s3m_quick(const char *filename)
return duh;
}
#endif

View file

@ -17,13 +17,15 @@
* \__/
*/
#ifdef DUMB
#include "dumb.h"
DUH *dumb_load_s3m(const char *filename)
{
DUH *duh = dumb_load_s3m_quick(filename);
dumb_it_do_initial_runthrough(duh);
return duh;
}
#endif

View file

@ -17,11 +17,11 @@
* \__/
*/
#ifdef DUMB
#include "dumb.h"
#include "internal/it.h"
/* dumb_load_xm_quick(): loads an XM file into a DUH struct, returning a
* pointer to the DUH struct. When you have finished with it, you must
* pass the pointer to unload_duh() so that the memory can be freed.
@ -40,3 +40,5 @@ DUH *dumb_load_xm_quick(const char *filename)
return duh;
}
#endif

View file

@ -17,13 +17,15 @@
* \__/
*/
#ifdef DUMB
#include "dumb.h"
DUH *dumb_load_xm(const char *filename)
{
DUH *duh = dumb_load_xm_quick(filename);
dumb_it_do_initial_runthrough(duh);
return duh;
}
#endif

View file

@ -17,6 +17,8 @@
* \__/
*/
#ifdef DUMB
#include <stdlib.h>
#include <string.h>
#include <math.h>
@ -24,8 +26,6 @@
#include "dumb.h"
#include "internal/it.h"
static int it_mod_read_pattern(IT_PATTERN *pattern, DUMBFILE *f, int n_channels, unsigned char *buffer)
{
int pos;
@ -602,3 +602,5 @@ DUH *dumb_read_mod_quick(DUMBFILE *f)
return make_duh(-1, 1, (const char *const (*)[2])tag, 1, &descptr, &sigdata);
}
}
#endif

View file

@ -17,13 +17,15 @@
* \__/
*/
#ifdef DUMB
#include "dumb.h"
DUH *dumb_read_mod(DUMBFILE *f)
{
DUH *duh = dumb_read_mod_quick(f);
dumb_it_do_initial_runthrough(duh);
return duh;
}
#endif

View file

@ -17,6 +17,8 @@
* \__/
*/
#ifdef DUMB
// IT_STEREO... :o
#include <stdlib.h>
#include <string.h>
@ -24,8 +26,6 @@
#include "dumb.h"
#include "internal/it.h"
/** WARNING: this is duplicated in itread.c */
static int it_seek(DUMBFILE *f, long offset)
{
@ -668,3 +668,5 @@ DUH *dumb_read_s3m_quick(DUMBFILE *f)
return make_duh(-1, 1, (const char *const (*)[2])tag, 1, &descptr, &sigdata);
}
}
#endif

View file

@ -17,13 +17,15 @@
* \__/
*/
#ifdef DUMB
#include "dumb.h"
DUH *dumb_read_s3m(DUMBFILE *f)
{
DUH *duh = dumb_read_s3m_quick(f);
dumb_it_do_initial_runthrough(duh);
return duh;
}
#endif

View file

@ -17,6 +17,8 @@
* \__/
*/
#ifdef DUMB
#include <stdlib.h>
#include <string.h>
#include <math.h>
@ -1005,3 +1007,5 @@ DUH *dumb_read_xm_quick(DUMBFILE *f)
return make_duh(-1, 1, (const char *const (*)[2])tag, 1, &descptr, &sigdata);
}
}
#endif

View file

@ -17,13 +17,15 @@
* \__/
*/
#ifdef DUMB
#include "dumb.h"
DUH *dumb_read_xm(DUMBFILE *f)
{
DUH *duh = dumb_read_xm_quick(f);
dumb_it_do_initial_runthrough(duh);
return duh;
}
#endif

View file

@ -17,7 +17,7 @@
* \__/
*/
#ifdef DUMB
#include <stdlib.h>
#include <string.h>
@ -240,3 +240,5 @@ if (log) printf(" - %c%02X\n", 'A'+effect-1, value);
entry->effect = effect;
entry->effectvalue = value;
}
#endif

View file

@ -31,16 +31,30 @@ void FmodEx_Play(byte track, qboolean looping)
fmod_loop = looping;
fmod_volume = bgmvolume->value;
sprintf(fmod_file, "%s/music/track%d.ogg", com_gamedir, fmod_track);
sprintf(fmod_file, "%s/music/track%d.flac", com_gamedir, fmod_track);
if(fmod_loop == true)
fmod_result = FMOD_System_CreateSound (fmod_system, fmod_file, FMOD_SOFTWARE | FMOD_2D | FMOD_LOOP_NORMAL | FMOD_CREATESTREAM, 0, &fmod_sound);
fmod_result = FMOD_System_CreateSound (fmod_system, fmod_file,
FMOD_SOFTWARE | FMOD_2D | FMOD_LOOP_NORMAL | FMOD_CREATESTREAM, 0, &fmod_sound);
else
fmod_result = FMOD_System_CreateSound (fmod_system, fmod_file, FMOD_SOFTWARE | FMOD_2D | FMOD_LOOP_OFF | FMOD_CREATESTREAM, 0, &fmod_sound);
fmod_result = FMOD_System_CreateSound (fmod_system, fmod_file,
FMOD_SOFTWARE | FMOD_2D | FMOD_LOOP_OFF | FMOD_CREATESTREAM, 0, &fmod_sound);
if (fmod_result != FMOD_OK)
{
Con_Printf("FmodEx: Can't load %s!\n", fmod_file);
return;
sprintf(fmod_file, "%s/music/track%d.ogg", com_gamedir, fmod_track);
if(fmod_loop == true)
fmod_result = FMOD_System_CreateSound (fmod_system, fmod_file,
FMOD_SOFTWARE | FMOD_2D | FMOD_LOOP_NORMAL | FMOD_CREATESTREAM, 0, &fmod_sound);
else
fmod_result = FMOD_System_CreateSound (fmod_system, fmod_file,
FMOD_SOFTWARE | FMOD_2D | FMOD_LOOP_OFF | FMOD_CREATESTREAM, 0, &fmod_sound);
if (fmod_result != FMOD_OK)
{
Con_Printf("FmodEx: Can't load %s!\n", fmod_file);
return;
}
}
FMOD_System_PlaySound (fmod_system, FMOD_CHANNEL_FREE, fmod_sound, 0, &fmod_channel);

View file

@ -19,6 +19,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifdef DUMB
#include "globaldef.h"
#include "dumb.h"
#include <unistd.h>
@ -225,3 +226,4 @@ void Tracker_Shutdown(void)
dumb_exit(); // Kill DUMB
close(oss_device); // Close the device
}
#endif