mirror of
https://github.com/ZDoom/qzdoom-gpl.git
synced 2024-11-24 04:41:53 +00:00
Merge branch 'master' of https://github.com/rheit/zdoom
This commit is contained in:
commit
37e8221067
18 changed files with 75 additions and 341 deletions
|
@ -39,7 +39,6 @@ add_library( dumb
|
|||
src/helpers/memfile.c
|
||||
src/helpers/clickrem.c
|
||||
src/helpers/barray.c
|
||||
src/helpers/tarray.c
|
||||
src/it/xmeffect.c
|
||||
src/it/readxm2.c
|
||||
src/it/readxm.c
|
||||
|
|
|
@ -36,24 +36,24 @@
|
|||
#endif
|
||||
|
||||
|
||||
#define DUMB_MAJOR_VERSION 0
|
||||
#define DUMB_MINOR_VERSION 9
|
||||
#define DUMB_REVISION_VERSION 3
|
||||
#define DUMB_MAJOR_VERSION 1
|
||||
#define DUMB_MINOR_VERSION 0
|
||||
#define DUMB_REVISION_VERSION 0
|
||||
|
||||
#define DUMB_VERSION (DUMB_MAJOR_VERSION*10000 + DUMB_MINOR_VERSION*100 + DUMB_REVISION_VERSION)
|
||||
|
||||
#define DUMB_VERSION_STR "0.9.3"
|
||||
#define DUMB_VERSION_STR "1.0.0"
|
||||
|
||||
#define DUMB_NAME "DUMB v" DUMB_VERSION_STR
|
||||
|
||||
#define DUMB_YEAR 2005
|
||||
#define DUMB_MONTH 8
|
||||
#define DUMB_DAY 7
|
||||
#define DUMB_YEAR 2015
|
||||
#define DUMB_MONTH 1
|
||||
#define DUMB_DAY 17
|
||||
|
||||
#define DUMB_YEAR_STR2 "05"
|
||||
#define DUMB_YEAR_STR4 "2005"
|
||||
#define DUMB_MONTH_STR1 "8"
|
||||
#define DUMB_DAY_STR1 "7"
|
||||
#define DUMB_YEAR_STR2 "15"
|
||||
#define DUMB_YEAR_STR4 "2015"
|
||||
#define DUMB_MONTH_STR1 "1"
|
||||
#define DUMB_DAY_STR1 "17"
|
||||
|
||||
#if DUMB_MONTH < 10
|
||||
#define DUMB_MONTH_STR2 "0" DUMB_MONTH_STR1
|
||||
|
@ -606,10 +606,6 @@ typedef void (*DUH_SIGRENDERER_GET_CURRENT_SAMPLE)(
|
|||
sample_t *samples
|
||||
);
|
||||
|
||||
typedef int32 (*DUH_SIGRENDERER_GET_POSITION)(
|
||||
sigrenderer_t *sigrenderer
|
||||
);
|
||||
|
||||
typedef void (*DUH_END_SIGRENDERER)(sigrenderer_t *sigrenderer);
|
||||
|
||||
typedef void (*DUH_UNLOAD_SIGDATA)(sigdata_t *sigdata);
|
||||
|
@ -625,7 +621,6 @@ typedef struct DUH_SIGTYPE_DESC
|
|||
DUH_SIGRENDERER_SET_SIGPARAM sigrenderer_set_sigparam;
|
||||
DUH_SIGRENDERER_GENERATE_SAMPLES sigrenderer_generate_samples;
|
||||
DUH_SIGRENDERER_GET_CURRENT_SAMPLE sigrenderer_get_current_sample;
|
||||
DUH_SIGRENDERER_GET_POSITION sigrenderer_get_position;
|
||||
DUH_END_SIGRENDERER end_sigrenderer;
|
||||
DUH_UNLOAD_SIGDATA unload_sigdata;
|
||||
}
|
||||
|
|
|
@ -33,7 +33,6 @@
|
|||
#include <stddef.h>
|
||||
|
||||
#include "barray.h"
|
||||
#include "tarray.h"
|
||||
|
||||
|
||||
/** TO DO: THINK ABOUT THE FOLLOWING:
|
||||
|
@ -724,21 +723,6 @@ struct DUMB_IT_SIGRENDERER
|
|||
#ifdef BIT_ARRAY_BULLSHIT
|
||||
/* bit array, which rows are played, only checked by pattern break or loop commands */
|
||||
void * played;
|
||||
|
||||
/*
|
||||
Loop indicator for internal processes, may also be useful for external processes
|
||||
0 - Not looped
|
||||
1 - Looped
|
||||
-1 - Continued past loop
|
||||
*/
|
||||
int looped;
|
||||
|
||||
/*
|
||||
Kept until looped
|
||||
*/
|
||||
LONG_LONG time_played;
|
||||
|
||||
void * row_timekeeper;
|
||||
#endif
|
||||
|
||||
int32 gvz_time;
|
||||
|
|
|
@ -1,31 +0,0 @@
|
|||
#ifndef _T_ARRAY_H_
|
||||
#define _T_ARRAY_H_
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#ifndef LONG_LONG
|
||||
#if defined __GNUC__ || defined __INTEL_COMPILER || defined __MWERKS__
|
||||
#define LONG_LONG long long
|
||||
#elif defined _MSC_VER || defined __WATCOMC__
|
||||
#define LONG_LONG __int64
|
||||
#elif defined __sgi
|
||||
#define LONG_LONG long long
|
||||
#else
|
||||
#error 64-bit integer type unknown
|
||||
#endif
|
||||
#endif
|
||||
|
||||
void * timekeeping_array_create(size_t size);
|
||||
void timekeeping_array_destroy(void * array);
|
||||
void * timekeeping_array_dup(void * array);
|
||||
|
||||
void timekeeping_array_reset(void * array, size_t loop_start);
|
||||
|
||||
void timekeeping_array_push(void * array, size_t index, LONG_LONG time);
|
||||
void timekeeping_array_bump(void * array, size_t index);
|
||||
|
||||
unsigned int timekeeping_array_get_count(void * array, size_t index);
|
||||
|
||||
LONG_LONG timekeeping_array_get_item(void * array, size_t index);
|
||||
|
||||
#endif
|
|
@ -37,7 +37,6 @@ SOURCES += \
|
|||
../../src/helpers/memfile.c \
|
||||
../../src/helpers/clickrem.c \
|
||||
../../src/helpers/barray.c \
|
||||
../../src/helpers/tarray.c \
|
||||
../../src/it/xmeffect.c \
|
||||
../../src/it/readxm2.c \
|
||||
../../src/it/readxm.c \
|
||||
|
@ -109,7 +108,6 @@ HEADERS += \
|
|||
../../include/internal/it.h \
|
||||
../../include/internal/dumb.h \
|
||||
../../include/internal/barray.h \
|
||||
../../include/internal/tarray.h \
|
||||
../../include/internal/aldumb.h \
|
||||
../../include/internal/sinc_resampler.h \
|
||||
../../include/internal/stack_alloc.h \
|
||||
|
|
|
@ -147,15 +147,7 @@ int DUMBEXPORT duh_sigrenderer_get_n_channels(DUH_SIGRENDERER *sigrenderer)
|
|||
|
||||
int32 DUMBEXPORT duh_sigrenderer_get_position(DUH_SIGRENDERER *sigrenderer)
|
||||
{
|
||||
DUH_SIGRENDERER_GET_POSITION proc;
|
||||
|
||||
if (!sigrenderer) return -1;
|
||||
|
||||
proc = sigrenderer->desc->sigrenderer_get_position;
|
||||
if (proc)
|
||||
return (*proc)(sigrenderer->sigrenderer);
|
||||
else
|
||||
return sigrenderer->pos;
|
||||
return sigrenderer ? sigrenderer->pos : -1;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1,175 +0,0 @@
|
|||
#include "internal/tarray.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
/*
|
||||
Structures which contain the play times of each pattern and row combination in the song,
|
||||
not guaranteed to be valid for the whole song until the loop status is no longer zero.
|
||||
The initial count and restart count will both be zero on song start, then both will be
|
||||
incremented until the song loops. Restart count will be reset to zero on loop for all
|
||||
rows which have a time equal to or greater than the loop start point, so time keeping
|
||||
functions will know which timestamp the song is currently located at.
|
||||
|
||||
Timestamp lists are guaranteed to be allocated in blocks of 16 timestamps at a time.
|
||||
*/
|
||||
|
||||
/*
|
||||
We don't need full timekeeping because the player loop only wants the first play time
|
||||
of the loop start order/row. We also don't really want full timekeeping because it
|
||||
involves a lot of memory allocations, which is also slow.
|
||||
*/
|
||||
|
||||
#undef FULL_TIMEKEEPING
|
||||
|
||||
typedef struct DUMB_IT_ROW_TIME
|
||||
{
|
||||
unsigned int count, restart_count;
|
||||
#ifndef FULL_TIMEKEEPING
|
||||
LONG_LONG first_time;
|
||||
#else
|
||||
LONG_LONG * times;
|
||||
#endif
|
||||
} DUMB_IT_ROW_TIME;
|
||||
|
||||
void * timekeeping_array_create(size_t size)
|
||||
{
|
||||
size_t * _size = (size_t *) calloc( 1, sizeof(size_t) + sizeof(DUMB_IT_ROW_TIME) * size );
|
||||
if ( _size ) {
|
||||
*_size = size;
|
||||
}
|
||||
return _size;
|
||||
}
|
||||
|
||||
void timekeeping_array_destroy(void * array)
|
||||
{
|
||||
#ifdef FULL_TIMEKEEPING
|
||||
size_t i;
|
||||
size_t * size = (size_t *) array;
|
||||
DUMB_IT_ROW_TIME * s = (DUMB_IT_ROW_TIME *)(size + 1);
|
||||
|
||||
for (i = 0; i < *size; i++) {
|
||||
if (s[i].times) free(s[i].times);
|
||||
}
|
||||
#endif
|
||||
|
||||
free(array);
|
||||
}
|
||||
|
||||
void * timekeeping_array_dup(void * array)
|
||||
{
|
||||
size_t i;
|
||||
size_t * size = (size_t *) array;
|
||||
DUMB_IT_ROW_TIME * s = (DUMB_IT_ROW_TIME *)(size + 1);
|
||||
size_t * new_size = (size_t *) calloc( 1, sizeof(size_t) + sizeof(DUMB_IT_ROW_TIME) * *size );
|
||||
if ( new_size ) {
|
||||
DUMB_IT_ROW_TIME * new_s = (DUMB_IT_ROW_TIME *)(new_size + 1);
|
||||
|
||||
*new_size = *size;
|
||||
|
||||
for (i = 0; i < *size; i++) {
|
||||
new_s[i].count = s[i].count;
|
||||
new_s[i].restart_count = s[i].restart_count;
|
||||
|
||||
#ifndef FULL_TIMEKEEPING
|
||||
new_s[i].first_time = s[i].first_time;
|
||||
#else
|
||||
if ( s[i].times ) {
|
||||
size_t time_count = ( s[i].count + 15 ) & ~15;
|
||||
new_s[i].times = (LONG_LONG *) malloc( sizeof(LONG_LONG) * time_count );
|
||||
if ( new_s[i].times == (void *)0 ) {
|
||||
timekeeping_array_destroy( new_size );
|
||||
return (void *) 0;
|
||||
}
|
||||
memcpy( new_s[i].times, s[i].times, sizeof(LONG_LONG) * s[i].count );
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
return new_size;
|
||||
}
|
||||
|
||||
void timekeeping_array_reset(void * array, size_t loop_start)
|
||||
{
|
||||
size_t i;
|
||||
size_t * size = (size_t *) array;
|
||||
DUMB_IT_ROW_TIME * s = (DUMB_IT_ROW_TIME *)(size + 1);
|
||||
|
||||
DUMB_IT_ROW_TIME * s_loop_start = s + loop_start;
|
||||
LONG_LONG loop_start_time;
|
||||
|
||||
if ( loop_start >= *size || s_loop_start->count < 1 ) return;
|
||||
|
||||
#ifndef FULL_TIMEKEEPING
|
||||
loop_start_time = s_loop_start->first_time;
|
||||
#else
|
||||
loop_start_time = s_loop_start->times[0];
|
||||
#endif
|
||||
|
||||
for ( i = 0; i < *size; i++ ) {
|
||||
#ifndef FULL_TIMEKEEPING
|
||||
if ( s[i].count && s[i].first_time >= loop_start_time ) {
|
||||
#else
|
||||
if ( s[i].count && s[i].times[0] >= loop_start_time ) {
|
||||
#endif
|
||||
s[i].restart_count = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void timekeeping_array_push(void * array, size_t index, LONG_LONG time)
|
||||
{
|
||||
#ifdef FULL_TIMEKEEPING
|
||||
size_t i;
|
||||
size_t time_count;
|
||||
#endif
|
||||
size_t * size = (size_t *) array;
|
||||
DUMB_IT_ROW_TIME * s = (DUMB_IT_ROW_TIME *)(size + 1);
|
||||
|
||||
if (index >= *size) return;
|
||||
|
||||
#ifndef FULL_TIMEKEEPING
|
||||
if ( !s[index].count++ )
|
||||
s[index].first_time = time;
|
||||
#else
|
||||
time_count = ( s[index].count + 16 ) & ~15;
|
||||
|
||||
s[index].times = (LONG_LONG *) realloc( s[index].times, sizeof(LONG_LONG) * time_count );
|
||||
|
||||
s[index].times[s[index].count++] = time;
|
||||
#endif
|
||||
}
|
||||
|
||||
void timekeeping_array_bump(void * array, size_t index)
|
||||
{
|
||||
size_t * size = (size_t *) array;
|
||||
DUMB_IT_ROW_TIME * s = (DUMB_IT_ROW_TIME *)(size + 1);
|
||||
|
||||
if (index >= *size) return;
|
||||
|
||||
s[index].restart_count++;
|
||||
}
|
||||
|
||||
unsigned int timekeeping_array_get_count(void * array, size_t index)
|
||||
{
|
||||
size_t * size = (size_t *) array;
|
||||
DUMB_IT_ROW_TIME * s = (DUMB_IT_ROW_TIME *)(size + 1);
|
||||
|
||||
if (index >= *size) return 0;
|
||||
|
||||
return s[index].count;
|
||||
}
|
||||
|
||||
LONG_LONG timekeeping_array_get_item(void * array, size_t index)
|
||||
{
|
||||
size_t * size = (size_t *) array;
|
||||
DUMB_IT_ROW_TIME * s = (DUMB_IT_ROW_TIME *)(size + 1);
|
||||
|
||||
if (index >= *size || s[index].restart_count >= s[index].count) return 0;
|
||||
|
||||
#ifndef FULL_TIMEKEEPING
|
||||
return s[index].first_time;
|
||||
#else
|
||||
return s[index].times[s[index].restart_count];
|
||||
#endif
|
||||
}
|
|
@ -290,12 +290,15 @@ static int it_read_envelope(IT_ENVELOPE *envelope, DUMBFILE *f)
|
|||
|
||||
envelope->flags = dumbfile_getc(f);
|
||||
envelope->n_nodes = dumbfile_getc(f);
|
||||
if(envelope->n_nodes > 25) {
|
||||
TRACE("IT error: wrong number of envelope nodes (%d)\n", envelope->n_nodes);
|
||||
envelope->n_nodes = 0;
|
||||
return -1;
|
||||
}
|
||||
envelope->loop_start = dumbfile_getc(f);
|
||||
envelope->loop_end = dumbfile_getc(f);
|
||||
envelope->sus_loop_start = dumbfile_getc(f);
|
||||
envelope->sus_loop_end = dumbfile_getc(f);
|
||||
if (envelope->n_nodes > 25)
|
||||
envelope->n_nodes = 25;
|
||||
for (n = 0; n < envelope->n_nodes; n++) {
|
||||
envelope->node_y[n] = dumbfile_getc(f);
|
||||
envelope->node_t[n] = dumbfile_igetw(f);
|
||||
|
|
|
@ -352,10 +352,6 @@ static DUMB_IT_SIGRENDERER *dup_sigrenderer(DUMB_IT_SIGRENDERER *src, int n_chan
|
|||
|
||||
#ifdef BIT_ARRAY_BULLSHIT
|
||||
dst->played = bit_array_dup(src->played);
|
||||
|
||||
dst->looped = src->looped;
|
||||
dst->time_played = src->time_played;
|
||||
dst->row_timekeeper = timekeeping_array_dup(src->row_timekeeper);
|
||||
#endif
|
||||
|
||||
dst->gvz_time = src->gvz_time;
|
||||
|
@ -2221,9 +2217,6 @@ Yxy This uses a table 4 times larger (hence 4 times slower) than
|
|||
bit_array_set(sigrenderer->played, sigrenderer->order * 256 + sigrenderer->row);
|
||||
#endif
|
||||
sigrenderer->speed = 0;
|
||||
#ifdef BIT_ARRAY_BULLSHIT
|
||||
sigrenderer->looped = 1;
|
||||
#endif
|
||||
if (sigrenderer->callbacks->xm_speed_zero && (*sigrenderer->callbacks->xm_speed_zero)(sigrenderer->callbacks->xm_speed_zero_data))
|
||||
return 1;
|
||||
}
|
||||
|
@ -4341,8 +4334,6 @@ static int process_tick(DUMB_IT_SIGRENDERER *sigrenderer)
|
|||
/* Fix play tracking and timekeeping for orders containing skip commands */
|
||||
for (n = 0; n < 256; n++) {
|
||||
bit_array_set(sigrenderer->played, sigrenderer->processorder * 256 + n);
|
||||
timekeeping_array_push(sigrenderer->row_timekeeper, sigrenderer->processorder * 256 + n, sigrenderer->time_played);
|
||||
timekeeping_array_bump(sigrenderer->row_timekeeper, sigrenderer->processorder * 256 + n);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
@ -4367,9 +4358,6 @@ static int process_tick(DUMB_IT_SIGRENDERER *sigrenderer)
|
|||
&& bit_array_test(sigrenderer->played, sigrenderer->processorder * 256 + sigrenderer->processrow)
|
||||
#endif
|
||||
) {
|
||||
#ifdef BIT_ARRAY_BULLSHIT
|
||||
sigrenderer->looped = 1;
|
||||
#endif
|
||||
if (sigrenderer->callbacks->loop) {
|
||||
if ((*sigrenderer->callbacks->loop)(sigrenderer->callbacks->loop_data))
|
||||
return 1;
|
||||
|
@ -4413,13 +4401,6 @@ static int process_tick(DUMB_IT_SIGRENDERER *sigrenderer)
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef BIT_ARRAY_BULLSHIT
|
||||
if (sigrenderer->looped == 0) {
|
||||
timekeeping_array_push(sigrenderer->row_timekeeper, sigrenderer->order * 256 + sigrenderer->row, sigrenderer->time_played);
|
||||
}
|
||||
timekeeping_array_bump(sigrenderer->row_timekeeper, sigrenderer->order * 256 + sigrenderer->row);
|
||||
#endif
|
||||
|
||||
if (!(sigdata->flags & IT_WAS_A_669))
|
||||
reset_effects(sigrenderer);
|
||||
|
||||
|
@ -4471,9 +4452,6 @@ static int process_tick(DUMB_IT_SIGRENDERER *sigrenderer)
|
|||
sigrenderer->gvz_time += (int)(t >> 16);
|
||||
sigrenderer->gvz_sub_time = (int)t & 65535;
|
||||
if (sigrenderer->gvz_time >= 65536 * 12) {
|
||||
#ifdef BIT_ARRAY_BULLSHIT
|
||||
sigrenderer->looped = 1;
|
||||
#endif
|
||||
if ((*sigrenderer->callbacks->global_volume_zero)(sigrenderer->callbacks->global_volume_zero_data))
|
||||
return 1;
|
||||
}
|
||||
|
@ -5288,10 +5266,6 @@ static DUMB_IT_SIGRENDERER *init_sigrenderer(DUMB_IT_SIGDATA *sigdata, int n_cha
|
|||
|
||||
#ifdef BIT_ARRAY_BULLSHIT
|
||||
sigrenderer->played = bit_array_create(sigdata->n_orders * 256);
|
||||
|
||||
sigrenderer->looped = 0;
|
||||
sigrenderer->time_played = 0;
|
||||
sigrenderer->row_timekeeper = timekeeping_array_create(sigdata->n_orders * 256);
|
||||
#endif
|
||||
|
||||
{
|
||||
|
@ -5310,8 +5284,6 @@ static DUMB_IT_SIGRENDERER *init_sigrenderer(DUMB_IT_SIGDATA *sigdata, int n_cha
|
|||
/* Fix for played order detection for songs which have skips at the start of the orders list */
|
||||
for (n = 0; n < 256; n++) {
|
||||
bit_array_set(sigrenderer->played, order * 256 + n);
|
||||
timekeeping_array_push(sigrenderer->row_timekeeper, order * 256 + n, 0);
|
||||
timekeeping_array_bump(sigrenderer->row_timekeeper, order * 256 + n);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
@ -5324,6 +5296,10 @@ static DUMB_IT_SIGRENDERER *init_sigrenderer(DUMB_IT_SIGDATA *sigdata, int n_cha
|
|||
sigrenderer->time_left = 0;
|
||||
sigrenderer->sub_time_left = 0;
|
||||
|
||||
#ifdef BIT_ARRAY_BULLSHIT
|
||||
sigrenderer->played = bit_array_create(sigdata->n_orders * 256);
|
||||
#endif
|
||||
|
||||
sigrenderer->gvz_time = 0;
|
||||
sigrenderer->gvz_sub_time = 0;
|
||||
|
||||
|
@ -5482,10 +5458,6 @@ static sigrenderer_t *it_start_sigrenderer(DUH *duh, sigdata_t *vsigdata, int n_
|
|||
while (pos > 0 && pos >= sigrenderer->time_left) {
|
||||
render(sigrenderer, 0, 1.0f, 0, sigrenderer->time_left, NULL);
|
||||
|
||||
#ifdef BIT_ARRAY_BULLSHIT
|
||||
sigrenderer->time_played += (LONG_LONG)sigrenderer->time_left << 16;
|
||||
#endif
|
||||
|
||||
pos -= sigrenderer->time_left;
|
||||
sigrenderer->time_left = 0;
|
||||
|
||||
|
@ -5498,10 +5470,6 @@ static sigrenderer_t *it_start_sigrenderer(DUH *duh, sigdata_t *vsigdata, int n_
|
|||
render(sigrenderer, 0, 1.0f, 0, pos, NULL);
|
||||
sigrenderer->time_left -= pos;
|
||||
|
||||
#ifdef BIT_ARRAY_BULLSHIT
|
||||
sigrenderer->time_played += (LONG_LONG)pos << 16;
|
||||
#endif
|
||||
|
||||
return sigrenderer;
|
||||
}
|
||||
|
||||
|
@ -5517,7 +5485,6 @@ static int32 it_sigrenderer_get_samples(
|
|||
int32 pos;
|
||||
int dt;
|
||||
int32 todo;
|
||||
int ret;
|
||||
LONG_LONG t;
|
||||
|
||||
if (sigrenderer->order < 0) return 0; // problematic
|
||||
|
@ -5531,7 +5498,7 @@ static int32 it_sigrenderer_get_samples(
|
|||
if (!samples) volume = 0;
|
||||
|
||||
for (;;) {
|
||||
todo = (int32)((((LONG_LONG)sigrenderer->time_left << 16) | sigrenderer->sub_time_left) / dt);
|
||||
todo = (long)((((LONG_LONG)sigrenderer->time_left << 16) | sigrenderer->sub_time_left) / dt);
|
||||
|
||||
if (todo >= size)
|
||||
break;
|
||||
|
@ -5545,28 +5512,9 @@ static int32 it_sigrenderer_get_samples(
|
|||
sigrenderer->sub_time_left = (int32)t & 65535;
|
||||
sigrenderer->time_left += (int32)(t >> 16);
|
||||
|
||||
#ifdef BIT_ARRAY_BULLSHIT
|
||||
sigrenderer->time_played += (LONG_LONG)todo * dt;
|
||||
#endif
|
||||
|
||||
ret = process_tick(sigrenderer);
|
||||
|
||||
if (ret) {
|
||||
if (process_tick(sigrenderer)) {
|
||||
sigrenderer->order = -1;
|
||||
sigrenderer->row = -1;
|
||||
}
|
||||
|
||||
#ifdef BIT_ARRAY_BULLSHIT
|
||||
if (sigrenderer->looped == 1) {
|
||||
sigrenderer->looped = -1;
|
||||
size = 0;
|
||||
timekeeping_array_reset(sigrenderer->row_timekeeper, sigrenderer->order * 256 + sigrenderer->row);
|
||||
sigrenderer->time_played = timekeeping_array_get_item(sigrenderer->row_timekeeper, sigrenderer->order * 256 + sigrenderer->row);
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (ret) {
|
||||
return pos;
|
||||
}
|
||||
}
|
||||
|
@ -5579,10 +5527,6 @@ static int32 it_sigrenderer_get_samples(
|
|||
sigrenderer->sub_time_left = (int32)t & 65535;
|
||||
sigrenderer->time_left += (int32)(t >> 16);
|
||||
|
||||
#ifdef BIT_ARRAY_BULLSHIT
|
||||
sigrenderer->time_played += (LONG_LONG)size * dt;
|
||||
#endif
|
||||
|
||||
if (samples)
|
||||
dumb_remove_clicks_array(sigrenderer->n_channels, sigrenderer->click_remover, samples, pos, 512.0f / delta);
|
||||
|
||||
|
@ -5634,8 +5578,6 @@ void _dumb_it_end_sigrenderer(sigrenderer_t *vsigrenderer)
|
|||
|
||||
#ifdef BIT_ARRAY_BULLSHIT
|
||||
bit_array_destroy(sigrenderer->played);
|
||||
|
||||
timekeeping_array_destroy(sigrenderer->row_timekeeper);
|
||||
#endif
|
||||
|
||||
free(vsigrenderer);
|
||||
|
@ -5644,17 +5586,6 @@ void _dumb_it_end_sigrenderer(sigrenderer_t *vsigrenderer)
|
|||
|
||||
|
||||
|
||||
#ifdef BIT_ARRAY_BULLSHIT
|
||||
static int32 it_sigrenderer_get_position(sigrenderer_t *vsigrenderer)
|
||||
{
|
||||
DUMB_IT_SIGRENDERER *sigrenderer = vsigrenderer;
|
||||
|
||||
return (int32)(sigrenderer->time_played >> 16);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
DUH_SIGTYPE_DESC _dumb_sigtype_it = {
|
||||
SIGTYPE_IT,
|
||||
NULL,
|
||||
|
@ -5662,11 +5593,6 @@ DUH_SIGTYPE_DESC _dumb_sigtype_it = {
|
|||
NULL,
|
||||
&it_sigrenderer_get_samples,
|
||||
&it_sigrenderer_get_current_sample,
|
||||
#ifdef BIT_ARRAY_BULLSHIT
|
||||
&it_sigrenderer_get_position,
|
||||
#else
|
||||
NULL,
|
||||
#endif
|
||||
&_dumb_it_end_sigrenderer,
|
||||
&_dumb_it_unload_sigdata
|
||||
};
|
||||
|
|
|
@ -320,6 +320,8 @@ static DUMB_IT_SIGDATA *it_amf_load_sigdata(DUMBFILE *f, int * version)
|
|||
free( sigdata );
|
||||
return NULL;
|
||||
}
|
||||
|
||||
sigdata->n_pchannels = nchannels;
|
||||
|
||||
memset( sigdata->channel_volume, 64, DUMB_IT_N_CHANNELS );
|
||||
|
||||
|
|
|
@ -439,6 +439,7 @@ static DUMB_IT_SIGDATA *it_ptm_load_sigdata(DUMBFILE *f)
|
|||
}
|
||||
|
||||
if (dumbfile_seek(f, 352, DFS_SEEK_SET)) {
|
||||
free(component);
|
||||
_dumb_it_unload_sigdata(sigdata);
|
||||
return NULL;
|
||||
}
|
||||
|
@ -451,12 +452,14 @@ static DUMB_IT_SIGDATA *it_ptm_load_sigdata(DUMBFILE *f)
|
|||
}
|
||||
|
||||
if (dumbfile_seek(f, 608, DFS_SEEK_SET)) {
|
||||
free(component);
|
||||
_dumb_it_unload_sigdata(sigdata);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
for (n = 0; n < sigdata->n_samples; n++) {
|
||||
if (it_ptm_read_sample_header(&sigdata->sample[n], &component[n_components].offset, f)) {
|
||||
free(component);
|
||||
_dumb_it_unload_sigdata(sigdata);
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
@ -1197,6 +1197,7 @@ static DUMB_IT_SIGDATA *it_xm_load_sigdata(DUMBFILE *f, int * version)
|
|||
|
||||
sigdata->instrument = malloc(sigdata->n_instruments * sizeof(*sigdata->instrument));
|
||||
if (!sigdata->instrument) {
|
||||
free(roguebytes);
|
||||
_dumb_it_unload_sigdata(sigdata);
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
@ -118,7 +118,6 @@
|
|||
<ClCompile Include="..\..\src\helpers\sampbuf.c" />
|
||||
<ClCompile Include="..\..\src\helpers\silence.c" />
|
||||
<ClCompile Include="..\..\src\helpers\stdfile.c" />
|
||||
<ClCompile Include="..\..\src\helpers\tarray.c" />
|
||||
<ClCompile Include="..\..\src\it\itmisc.c" />
|
||||
<ClCompile Include="..\..\src\it\itorder.c" />
|
||||
<ClCompile Include="..\..\src\it\itrender.c" />
|
||||
|
@ -210,7 +209,6 @@
|
|||
<ClInclude Include="..\..\include\internal\lpc.h" />
|
||||
<ClInclude Include="..\..\include\internal\riff.h" />
|
||||
<ClInclude Include="..\..\include\internal\stack_alloc.h" />
|
||||
<ClInclude Include="..\..\include\internal\tarray.h" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
|
|
|
@ -279,9 +279,6 @@
|
|||
<ClCompile Include="..\..\src\helpers\resampler.c">
|
||||
<Filter>src\helpers</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\helpers\tarray.c">
|
||||
<Filter>src\helpers</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\include\dumb.h">
|
||||
|
@ -314,9 +311,6 @@
|
|||
<ClInclude Include="..\..\include\internal\resampler.h">
|
||||
<Filter>include\internal</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\include\internal\tarray.h">
|
||||
<Filter>include\internal</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<CustomBuild Include="..\..\src\helpers\resamp3.inc">
|
||||
|
|
|
@ -44,7 +44,7 @@ extern HWND Window;
|
|||
#define FALSE 0
|
||||
#define TRUE 1
|
||||
#endif
|
||||
#ifdef __APPLE__
|
||||
#if defined(__FreeBSD__) || defined(__APPLE__)
|
||||
#include <stdlib.h>
|
||||
#elif __sun
|
||||
#include <alloca.h>
|
||||
|
|
|
@ -184,6 +184,7 @@ void FWadCollection::InitMultipleFiles (TArray<FString> &filenames)
|
|||
}
|
||||
RenameNerve();
|
||||
RenameSprites();
|
||||
FixMacHexen();
|
||||
|
||||
// [RH] Set up hash table
|
||||
FirstLumpIndex = new DWORD[NumLumps];
|
||||
|
@ -956,6 +957,41 @@ void FWadCollection::RenameNerve ()
|
|||
}
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// FixMacHexen
|
||||
//
|
||||
// Rename unused high resolution font lumps because they are incorrectly
|
||||
// treated as extended characters
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
void FWadCollection::FixMacHexen()
|
||||
{
|
||||
if (GAME_Hexen != gameinfo.gametype)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for (int i = GetFirstLump(IWAD_FILENUM), last = GetLastLump(IWAD_FILENUM); i <= last; ++i)
|
||||
{
|
||||
assert(IWAD_FILENUM == LumpInfo[i].wadnum);
|
||||
|
||||
FResourceLump* const lump = LumpInfo[i].lump;
|
||||
char* const name = lump->Name;
|
||||
|
||||
// Unwanted lumps are named like FONTA??1
|
||||
|
||||
if (8 == strlen(name)
|
||||
&& MAKE_ID('F', 'O', 'N', 'T') == lump->dwName
|
||||
&& 'A' == name[4] && '1' == name[7]
|
||||
&& isdigit(name[5]) && isdigit(name[6]))
|
||||
{
|
||||
name[0] = '\0';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// W_FindLump
|
||||
|
|
|
@ -238,6 +238,7 @@ protected:
|
|||
private:
|
||||
void RenameSprites();
|
||||
void RenameNerve();
|
||||
void FixMacHexen();
|
||||
void DeleteAll();
|
||||
};
|
||||
|
||||
|
|
|
@ -56,4 +56,12 @@ gameinfo
|
|||
statscreen_enteringpatch = "WIENTER"
|
||||
}
|
||||
|
||||
DoomEdNums
|
||||
{
|
||||
4001 = "$Player5Start"
|
||||
4002 = "$Player6Start"
|
||||
4003 = "$Player7Start"
|
||||
4004 = "$Player8Start"
|
||||
}
|
||||
|
||||
include "mapinfo/common.txt"
|
||||
|
|
Loading…
Reference in a new issue