ref: 925fec1d9998e8d9eb9553bf26cccd877bac577c
parent: 8f98f6ba0fb009ffe70c7c6d9be4e3fd9e80d72a
parent: 6d33503bc87e3923c54227b89ead1200130c5cf6
author: Christopher Snowhill <kode54@gmail.com>
date: Thu Sep 14 00:15:15 EDT 2017
Merge branch 'master' of github.com:kode54/dumb
--- a/COMPILING.md
+++ b/COMPILING.md
@@ -8,7 +8,7 @@
```
mkdir -p build
cd build
-cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local -DBUILD_SHARED_LIBS:BOOL=ON ..
+cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local -DBUILD_SHARED_LIBS:BOOL=ON -DBUILD_ALLEGRO4:BOOL=ON ..
make
make install
```
@@ -22,10 +22,11 @@
### 1.3. Flags
-* CMAKE_INSTALL_PREFIX sets the installation path prefix
-* CMAKE_BUILD_TYPE sets the build type (eg. Release, Debug, RelWithDebInfo, MinSizeRel). Debug libraries will be named libdumbd, release libraries libdumb.
-* BUILD_SHARED_LIBS selects whether cmake should build dynamic or static library. On by default. (On=shared, OFF=static)
-* BUILD_EXAMPLES selects example binaries. Note that example binaries require argtable2 and SDL2 libraries. On by default.
+* `CMAKE_INSTALL_PREFIX` sets the installation path prefix.
+* `CMAKE_BUILD_TYPE` chooses the build type: `Release`, `Debug`, `RelWithDebInfo`, or `MinSizeRel`. Debug libraries will be named `libdumbd`, release libraries `libdumb`. Default is `Release`.
+* `BUILD_SHARED_LIBS` selects whether cmake should build a dynamic (`ON`) or static (`OFF`) library. Default is `OFF`.
+* `BUILD_ALLEGRO4` enables (`ON`) or disables (`OFF`) the optional Allegro 4 support. This requires Allegro 4 installed on the system. Default is `ON`.
+* `BUILD_EXAMPLES` selects example binaries. These example binaries require argtable2 and SDL2 libraries. Default is `ON`.
* You may also need to tell cmake what kind of makefiles to create with the "-G" flag. Eg. for MSYS one would say something like `cmake -G "MSYS Makefiles" .`.
## 2. Visual Studio
--- a/src/it/itread.c
+++ b/src/it/itread.c
@@ -623,8 +623,8 @@
long n, len, delta;
signed char * ptr, * end;
signed char compression_table[16];
- if (dumbfile_getnc((char *)compression_table, 16, f) != 16)
- return -1;
+ if (dumbfile_getnc((char *)compression_table, 16, f) != 16)
+ return -1;
ptr = (signed char *) sample->data;
delta = 0;
--- a/src/it/readmod.c
+++ b/src/it/readmod.c
@@ -283,15 +283,15 @@
int i;
unsigned long fft;
- if ( dumbfile_seek(f, MOD_FFT_OFFSET, DFS_SEEK_SET) )
- return NULL;
+ if ( dumbfile_seek(f, MOD_FFT_OFFSET, DFS_SEEK_SET) )
+ return NULL;
- fft = dumbfile_mgetl(f);
- if (dumbfile_error(f))
- return NULL;
+ fft = dumbfile_mgetl(f);
+ if (dumbfile_error(f))
+ return NULL;
- if ( dumbfile_seek(f, 0, DFS_SEEK_SET) )
- return NULL;
+ if ( dumbfile_seek(f, 0, DFS_SEEK_SET) )
+ return NULL;
sigdata = malloc(sizeof(*sigdata));
if (!sigdata) {
--- a/src/it/readxm.c
+++ b/src/it/readxm.c
@@ -899,15 +899,15 @@
if (sigdata->speed == 0) sigdata->speed = 6; // Should we? What about tempo?
sigdata->tempo = dumbfile_igetw(f);
- // FT2 always clips restart position against the song length
- if (sigdata->restart_position > sigdata->n_orders)
- sigdata->restart_position = sigdata->n_orders;
- // And FT2 starts playback on order 0, regardless of length,
- // and only checks if the next order is greater than or equal
- // to this, not the current pattern. Work around this with
- // DUMB's playback core by overriding a zero length with one.
- if (sigdata->n_orders == 0)
- sigdata->n_orders = 1;
+ // FT2 always clips restart position against the song length
+ if (sigdata->restart_position > sigdata->n_orders)
+ sigdata->restart_position = sigdata->n_orders;
+ // And FT2 starts playback on order 0, regardless of length,
+ // and only checks if the next order is greater than or equal
+ // to this, not the current pattern. Work around this with
+ // DUMB's playback core by overriding a zero length with one.
+ if (sigdata->n_orders == 0)
+ sigdata->n_orders = 1;
/* sanity checks */
// XXX