Browse Source

Implement video playback via libsmacker

pull/25/head
Anders Jenbo 7 years ago
parent
commit
447cec8355
  1. 64
      3rdParty/libsmacker/COPYING
  2. 57
      3rdParty/libsmacker/README
  3. 1423
      3rdParty/libsmacker/smacker.c
  4. 110
      3rdParty/libsmacker/smacker.h
  5. 119
      3rdParty/libsmacker/smk_bitstream.c
  6. 50
      3rdParty/libsmacker/smk_bitstream.h
  7. 425
      3rdParty/libsmacker/smk_hufftree.c
  8. 88
      3rdParty/libsmacker/smk_hufftree.h
  9. 77
      3rdParty/libsmacker/smk_malloc.h
  10. 1
      CMake/32bit.cmake
  11. 4
      CMakeLists.txt
  12. 3
      Stub/DiabloUI/diabloui.cpp
  13. 2
      Stub/init.cpp
  14. 117
      Stub/movie.cpp
  15. 8
      Stub/sound.cpp
  16. 1
      Stub/sound.h
  17. 1
      types.h

64
3rdParty/libsmacker/COPYING vendored

@ -0,0 +1,64 @@
Attribution-NonCommercial 2.0
CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE LEGAL SERVICES. DISTRIBUTION OF THIS LICENSE DOES NOT CREATE AN ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES REGARDING THE INFORMATION PROVIDED, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM ITS USE.
License
THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED.
BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS.
1. Definitions
"Collective Work" means a work, such as a periodical issue, anthology or encyclopedia, in which the Work in its entirety in unmodified form, along with a number of other contributions, constituting separate and independent works in themselves, are assembled into a collective whole. A work that constitutes a Collective Work will not be considered a Derivative Work (as defined below) for the purposes of this License.
"Derivative Work" means a work based upon the Work or upon the Work and other pre-existing works, such as a translation, musical arrangement, dramatization, fictionalization, motion picture version, sound recording, art reproduction, abridgment, condensation, or any other form in which the Work may be recast, transformed, or adapted, except that a work that constitutes a Collective Work will not be considered a Derivative Work for the purpose of this License. For the avoidance of doubt, where the Work is a musical composition or sound recording, the synchronization of the Work in timed-relation with a moving image ("synching") will be considered a Derivative Work for the purpose of this License.
"Licensor" means the individual or entity that offers the Work under the terms of this License.
"Original Author" means the individual or entity who created the Work.
"Work" means the copyrightable work of authorship offered under the terms of this License.
"You" means an individual or entity exercising rights under this License who has not previously violated the terms of this License with respect to the Work, or who has received express permission from the Licensor to exercise rights under this License despite a previous violation.
2. Fair Use Rights. Nothing in this license is intended to reduce, limit, or restrict any rights arising from fair use, first sale or other limitations on the exclusive rights of the copyright owner under copyright law or other applicable laws.
3. License Grant. Subject to the terms and conditions of this License, Licensor hereby grants You a worldwide, royalty-free, non-exclusive, perpetual (for the duration of the applicable copyright) license to exercise the rights in the Work as stated below:
to reproduce the Work, to incorporate the Work into one or more Collective Works, and to reproduce the Work as incorporated in the Collective Works;
to create and reproduce Derivative Works;
to distribute copies or phonorecords of, display publicly, perform publicly, and perform publicly by means of a digital audio transmission the Work including as incorporated in Collective Works;
to distribute copies or phonorecords of, display publicly, perform publicly, and perform publicly by means of a digital audio transmission Derivative Works;
The above rights may be exercised in all media and formats whether now known or hereafter devised. The above rights include the right to make such modifications as are technically necessary to exercise the rights in other media and formats. All rights not expressly granted by Licensor are hereby reserved, including but not limited to the rights set forth in Sections 4(d) and 4(e).
4. Restrictions. The license granted in Section 3 above is expressly made subject to and limited by the following restrictions:
You may distribute, publicly display, publicly perform, or publicly digitally perform the Work only under the terms of this License, and You must include a copy of, or the Uniform Resource Identifier for, this License with every copy or phonorecord of the Work You distribute, publicly display, publicly perform, or publicly digitally perform. You may not offer or impose any terms on the Work that alter or restrict the terms of this License or the recipients' exercise of the rights granted hereunder. You may not sublicense the Work. You must keep intact all notices that refer to this License and to the disclaimer of warranties. You may not distribute, publicly display, publicly perform, or publicly digitally perform the Work with any technological measures that control access or use of the Work in a manner inconsistent with the terms of this License Agreement. The above applies to the Work as incorporated in a Collective Work, but this does not require the Collective Work apart from the Work itself to be made subject to the terms of this License. If You create a Collective Work, upon notice from any Licensor You must, to the extent practicable, remove from the Collective Work any reference to such Licensor or the Original Author, as requested. If You create a Derivative Work, upon notice from any Licensor You must, to the extent practicable, remove from the Derivative Work any reference to such Licensor or the Original Author, as requested.
You may not exercise any of the rights granted to You in Section 3 above in any manner that is primarily intended for or directed toward commercial advantage or private monetary compensation. The exchange of the Work for other copyrighted works by means of digital file-sharing or otherwise shall not be considered to be intended for or directed toward commercial advantage or private monetary compensation, provided there is no payment of any monetary compensation in connection with the exchange of copyrighted works.
If you distribute, publicly display, publicly perform, or publicly digitally perform the Work or any Derivative Works or Collective Works, You must keep intact all copyright notices for the Work and give the Original Author credit reasonable to the medium or means You are utilizing by conveying the name (or pseudonym if applicable) of the Original Author if supplied; the title of the Work if supplied; to the extent reasonably practicable, the Uniform Resource Identifier, if any, that Licensor specifies to be associated with the Work, unless such URI does not refer to the copyright notice or licensing information for the Work; and in the case of a Derivative Work, a credit identifying the use of the Work in the Derivative Work (e.g., "French translation of the Work by Original Author," or "Screenplay based on original Work by Original Author"). Such credit may be implemented in any reasonable manner; provided, however, that in the case of a Derivative Work or Collective Work, at a minimum such credit will appear where any other comparable authorship credit appears and in a manner at least as prominent as such other comparable authorship credit.
For the avoidance of doubt, where the Work is a musical composition:
Performance Royalties Under Blanket Licenses. Licensor reserves the exclusive right to collect, whether individually or via a performance rights society (e.g. ASCAP, BMI, SESAC), royalties for the public performance or public digital performance (e.g. webcast) of the Work if that performance is primarily intended for or directed toward commercial advantage or private monetary compensation.
Mechanical Rights and Statutory Royalties. Licensor reserves the exclusive right to collect, whether individually or via a music rights agency or designated agent (e.g. Harry Fox Agency), royalties for any phonorecord You create from the Work ("cover version") and distribute, subject to the compulsory license created by 17 USC Section 115 of the US Copyright Act (or the equivalent in other jurisdictions), if Your distribution of such cover version is primarily intended for or directed toward commercial advantage or private monetary compensation.
Webcasting Rights and Statutory Royalties. For the avoidance of doubt, where the Work is a sound recording, Licensor reserves the exclusive right to collect, whether individually or via a performance-rights society (e.g. SoundExchange), royalties for the public digital performance (e.g. webcast) of the Work, subject to the compulsory license created by 17 USC Section 114 of the US Copyright Act (or the equivalent in other jurisdictions), if Your public digital performance is primarily intended for or directed toward commercial advantage or private monetary compensation.
5. Representations, Warranties and Disclaimer
UNLESS OTHERWISE MUTUALLY AGREED TO BY THE PARTIES IN WRITING, LICENSOR OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE WORK, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS, WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU.
6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
7. Termination
This License and the rights granted hereunder will terminate automatically upon any breach by You of the terms of this License. Individuals or entities who have received Derivative Works or Collective Works from You under this License, however, will not have their licenses terminated provided such individuals or entities remain in full compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will survive any termination of this License.
Subject to the above terms and conditions, the license granted here is perpetual (for the duration of the applicable copyright in the Work). Notwithstanding the above, Licensor reserves the right to release the Work under different license terms or to stop distributing the Work at any time; provided, however that any such election will not serve to withdraw this License (or any other license that has been, or is required to be, granted under the terms of this License), and this License will continue in full force and effect unless terminated as stated above.
8. Miscellaneous
Each time You distribute or publicly digitally perform the Work or a Collective Work, the Licensor offers to the recipient a license to the Work on the same terms and conditions as the license granted to You under this License.
Each time You distribute or publicly digitally perform a Derivative Work, Licensor offers to the recipient a license to the original Work on the same terms and conditions as the license granted to You under this License.
If any provision of this License is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this License, and without further action by the parties to this agreement, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
No term or provision of this License shall be deemed waived and no breach consented to unless such waiver or consent shall be in writing and signed by the party to be charged with such waiver or consent.
This License constitutes the entire agreement between the parties with respect to the Work licensed here. There are no understandings, agreements or representations with respect to the Work not specified here. Licensor shall not be bound by any additional provisions that may appear in any communication from You. This License may not be modified without the mutual written agreement of the Licensor and You.
Creative Commons is not a party to this License, and makes no warranty whatsoever in connection with the Work. Creative Commons will not be liable to You or any party on any legal theory for any damages whatsoever, including without limitation any general, special, incidental or consequential damages arising in connection to this license. Notwithstanding the foregoing two (2) sentences, if Creative Commons has expressly identified itself as the Licensor hereunder, it shall have all rights and obligations of Licensor.
Except for the limited purpose of indicating to the public that the Work is licensed under the CCPL, neither party will use the trademark "Creative Commons" or any related trademark or logo of Creative Commons without the prior written consent of Creative Commons. Any permitted use will be in compliance with Creative Commons' then-current trademark usage guidelines, as may be published on its website or otherwise made available upon request from time to time.
Creative Commons may be contacted at https://creativecommons.org/.

57
3rdParty/libsmacker/README vendored

@ -0,0 +1,57 @@
libsmacker
A C library for decoding .smk Smacker Video files
version 1.1
2017-01-27
(c) Greg Kennedy 2013-2017
http://libsmacker.sourceforge.net
----
---
Introduction
---
libsmacker is a cross-platform C library which can be used for decoding Smacker Video files produced by RAD Game Tools. Smacker Video was the king of video middleware in the 1990s, and its 256-color compressed video format was used in over 2600 software titles.
libsmacker implements the minimum feature set required from smackw32.dll to get an smk off a disk and the frames / audio into a buffer in the correct order.
---
License
---
libsmacker is released under a Creative Commons Attribution Non-Commercial License V2.0. This means, first, that projects using libsmacker must indicate somewhere that they use libsmacker in the code. Also: the Non-Commercial tag means exactly what it suggests: LIBSMACKER MAY NOT BE USED IN ANY COMMERCIAL PROJECT. PERIOD. Non-commercial DOES NOT mean simply "non-profit": commercial includes for-profit, but may also encompass other non-profit activites as well.
Static- or dynamic-linking against unmodified libsmacker does not automatically re-license your code. If you alter the library code (.c, .h files), your changes become a Derivative Work and are subject to the conditions outlined in the license. Unmodified redistributions of binary libsmacker in your own projects must meet the conditions of this license.
A human-readable summary of the license is available online:
http://creativecommons.org/licenses/by-nc/2.0/
The complete license text is here:
http://creativecommons.org/licenses/by-nc/2.0/legalcode
---
Usage
---
See the webpage for sample code and function documentation. The source package additionally includes a pair of driver programs:
* driver.c - dumps all frames of a file to a bmp/ subdirectory, and all audio as raw streams to out_*.raw files in CWD
* smk2avi.c - converts smk file(s) to AVI files - uncompressed 24-bit color and PCM audio stream.
Though the libraries are "bulletproofed" the sample apps are not: be cautious if you plan to implement in some critical environment.
---
Changelog
---
1.1
* Switch to autotools-based build
* Incorporates patches from Dalerank Slim, Gennady Trafimenkov, and Bianca van Schaik
* Performance improvements and code cleanup / safety.
1.0
* Initial revision
---
Contact
---
Questions/comments:
* by email: kennedy.greg@gmail.com
* by website: http://libsmacker.sourceforge.net
Enjoy!

1423
3rdParty/libsmacker/smacker.c vendored

File diff suppressed because it is too large Load Diff

110
3rdParty/libsmacker/smacker.h vendored

@ -0,0 +1,110 @@
/**
libsmacker - A C library for decoding .smk Smacker Video files
Copyright (C) 2012-2017 Greg Kennedy
libsmacker is a cross-platform C library which can be used for
decoding Smacker Video files produced by RAD Game Tools.
This software is released under the following license:
Creative Commons Attribution-NonCommercial 2.0 (CC BY-NC 2.0)
You are free:
* to Share - to copy, distribute and transmit the work
* to Remix - to adapt the work
Under the following conditions:
* Attribution - You must attribute the work in the manner specified by
the author or licensor (but not in any way that suggests that
they endorse you or your use of the work).
* Noncommercial - You may not use this work for commercial purposes.
This is a human-readable summary of the Legal Code (the full license).
You should have received a copy of the full license
along with libsmacker. If not, see
<http://creativecommons.org/licenses/by-nc/2.0>.
*/
#ifndef SMACKER_H
#define SMACKER_H
/* includes - needed for FILE* here */
#include <stdio.h>
/** forward-declaration for an struct */
typedef struct smk_t* smk;
/** a few defines as return codes from smk_next() */
#define SMK_DONE 0x00
#define SMK_MORE 0x01
#define SMK_LAST 0x02
#define SMK_ERROR -1
/** file-processing mode, pass to smk_open_file */
#define SMK_MODE_DISK 0x00
#define SMK_MODE_MEMORY 0x01
/** Y-scale meanings */
#define SMK_FLAG_Y_NONE 0x00
#define SMK_FLAG_Y_INTERLACE 0x01
#define SMK_FLAG_Y_DOUBLE 0x02
/** track mask and enable bits */
#define SMK_AUDIO_TRACK_0 0x01
#define SMK_AUDIO_TRACK_1 0x02
#define SMK_AUDIO_TRACK_2 0x04
#define SMK_AUDIO_TRACK_3 0x08
#define SMK_AUDIO_TRACK_4 0x10
#define SMK_AUDIO_TRACK_5 0x20
#define SMK_AUDIO_TRACK_6 0x40
#define SMK_VIDEO_TRACK 0x80
/* PUBLIC FUNCTIONS */
#ifdef __cplusplus
extern "C" {
#endif
/* OPEN OPERATIONS */
/** open an smk (from a file) */
smk smk_open_file(const char* filename, unsigned char mode);
/** open an smk (from a file pointer) */
smk smk_open_filepointer(FILE* file, unsigned char mode);
/** read an smk (from a memory buffer) */
smk smk_open_memory(const unsigned char* buffer, unsigned long size);
/* CLOSE OPERATIONS */
/** close out an smk file and clean up memory */
void smk_close(smk object);
/* GET FILE INFO OPERATIONS */
char smk_info_all(const smk object, unsigned long* frame, unsigned long* frame_count, double* usf);
char smk_info_video(const smk object, unsigned long* w, unsigned long* h, unsigned char* y_scale_mode);
char smk_info_audio(const smk object, unsigned char* track_mask, unsigned char channels[7], unsigned char bitdepth[7], unsigned long audio_rate[7]);
/* ENABLE/DISABLE Switches */
char smk_enable_all(smk object, unsigned char mask);
char smk_enable_video(smk object, unsigned char enable);
char smk_enable_audio(smk object, unsigned char track, unsigned char enable);
/** Retrieve palette */
const unsigned char* smk_get_palette(const smk object);
/** Retrieve video frame, as a buffer of size w*h */
const unsigned char* smk_get_video(const smk object);
/** Retrieve decoded audio chunk, track N */
const unsigned char* smk_get_audio(const smk object, unsigned char track);
/** Get size of currently pointed decoded audio chunk, track N */
unsigned long smk_get_audio_size(const smk object, unsigned char track);
/** rewind to first frame and unpack */
char smk_first(smk object);
/** advance to next frame and unpack */
char smk_next(smk object);
/** seek to first keyframe before/at N in an smk */
char smk_seek_keyframe(smk object, unsigned long frame);
#ifdef __cplusplus
}
#endif
#endif

119
3rdParty/libsmacker/smk_bitstream.c vendored

@ -0,0 +1,119 @@
/**
libsmacker - A C library for decoding .smk Smacker Video files
Copyright (C) 2012-2017 Greg Kennedy
See smacker.h for more information.
smk_bitstream.c
Implements a bitstream structure, which can extract and
return a bit at a time from a raw block of bytes.
*/
#include "smk_bitstream.h"
/* malloc and friends */
#include "smk_malloc.h"
/*
Bitstream structure
Pointer to raw block of data and a size limit.
Maintains internal pointers to byte_num and bit_number.
*/
struct smk_bit_t
{
const unsigned char* buffer;
unsigned long size;
unsigned long byte_num;
char bit_num;
};
/* BITSTREAM Functions */
struct smk_bit_t* smk_bs_init(const unsigned char* b, const unsigned long size)
{
struct smk_bit_t* ret = NULL;
/* sanity check */
smk_assert(b);
/* allocate a bitstream struct */
smk_malloc(ret, sizeof(struct smk_bit_t));
/* set up the pointer to bitstream, and the size counter */
ret->buffer = b;
ret->size = size;
/* point to initial byte: note, smk_malloc already sets these to 0 */
/* ret->byte_num = 0;
ret->bit_num = 0; */
/* return ret or NULL if error : ) */
error:
return ret;
}
/* Reads a bit
Returns -1 if error encountered */
char _smk_bs_read_1(struct smk_bit_t* bs)
{
unsigned char ret = -1;
/* sanity check */
smk_assert(bs);
/* don't die when running out of bits, but signal */
if (bs->byte_num >= bs->size)
{
fprintf(stderr, "libsmacker::_smk_bs_read_1(bs): ERROR: bitstream (length=%lu) exhausted.\n", bs->size);
goto error;
}
/* get next bit and return */
ret = (((bs->buffer[bs->byte_num]) & (1 << bs->bit_num)) != 0);
/* advance to next bit */
bs->bit_num ++;
/* Out of bits in this byte: next! */
if (bs->bit_num > 7)
{
bs->byte_num ++;
bs->bit_num = 0;
}
/* return ret, or (default) -1 if error */
error:
return ret;
}
/* Reads a byte
Returns -1 if error. */
short _smk_bs_read_8(struct smk_bit_t* bs)
{
unsigned char ret = -1;
/* sanity check */
smk_assert(bs);
/* don't die when running out of bits, but signal */
if (bs->byte_num + (bs->bit_num > 0) >= bs->size)
{
fprintf(stderr, "libsmacker::_smk_bs_read_8(bs): ERROR: bitstream (length=%lu) exhausted.\n", bs->size);
goto error;
}
if (bs->bit_num)
{
/* unaligned read */
ret = bs->buffer[bs->byte_num] >> bs->bit_num;
bs->byte_num ++;
ret |= (bs->buffer[bs->byte_num] << (8 - bs->bit_num));
} else {
/* aligned read */
ret = bs->buffer[bs->byte_num ++];
}
/* return ret, or (default) -1 if error */
error:
return ret;
}

50
3rdParty/libsmacker/smk_bitstream.h vendored

@ -0,0 +1,50 @@
/**
libsmacker - A C library for decoding .smk Smacker Video files
Copyright (C) 2012-2017 Greg Kennedy
See smacker.h for more information.
smk_bitstream.h
SMK bitstream structure. Presents a block of raw bytes one
bit at a time, and protects against over-read.
*/
#ifndef SMK_BITSTREAM_H
#define SMK_BITSTREAM_H
/** Bitstream structure, Forward declaration */
struct smk_bit_t;
/* BITSTREAM Functions */
/** Initialize a bitstream */
struct smk_bit_t* smk_bs_init(const unsigned char* b, unsigned long size);
/** This macro checks return code from _smk_bs_read_1 and
jumps to error label if problems occur. */
#define smk_bs_read_1(t,uc) \
{ \
if ((char)(uc = _smk_bs_read_1(t)) < 0) \
{ \
fprintf(stderr, "libsmacker::smk_bs_read_1(" #t ", " #uc ") - ERROR (file: %s, line: %lu)\n", __FILE__, (unsigned long)__LINE__); \
goto error; \
} \
}
/** Read a single bit from the bitstream, and advance.
Returns -1 on error. */
char _smk_bs_read_1(struct smk_bit_t* bs);
/** This macro checks return code from _smk_bs_read_8 and
jumps to error label if problems occur. */
#define smk_bs_read_8(t,s) \
{ \
if ((short)(s = _smk_bs_read_8(t)) < 0) \
{ \
fprintf(stderr, "libsmacker::smk_bs_read_8(" #t ", " #s ") - ERROR (file: %s, line: %lu)\n", __FILE__, (unsigned long)__LINE__); \
goto error; \
} \
}
/** Read eight bits from the bitstream (one byte), and advance.
Returns -1 on error. */
short _smk_bs_read_8(struct smk_bit_t* bs);
#endif

425
3rdParty/libsmacker/smk_hufftree.c vendored

@ -0,0 +1,425 @@
/**
libsmacker - A C library for decoding .smk Smacker Video files
Copyright (C) 2012-2017 Greg Kennedy
See smacker.h for more information.
smk_hufftree.c
Implementation of Smacker Huffman coding trees.
*/
#include "smk_hufftree.h"
/* malloc and friends */
#include "smk_malloc.h"
/**
8-bit Tree node structure.
If b0 is non-null, this is a branch, and b1 from the union should be used.
If b0 is null, this is a leaf, and val / escape code from union should be used.
*/
struct smk_huff8_t
{
struct smk_huff8_t* b0;
union
{
struct smk_huff8_t* b1;
struct
{
unsigned short value;
unsigned char escapecode;
} leaf;
} u;
};
/**
16-bit Tree root struct: holds a huff8_t structure,
as well as a cache of three 16-bit values.
*/
struct smk_huff16_t
{
struct smk_huff8_t* t;
unsigned short cache[3];
};
/*********************** 8-BIT HUFF-TREE FUNCTIONS ***********************/
/** safe build with built-in error jump */
#define smk_huff8_build_rec(bs,p) \
{ \
if (!(p = _smk_huff8_build_rec(bs))) \
{ \
fprintf(stderr, "libsmacker::smk_huff8_build_rec(" #bs ", " #p ") - ERROR (file: %s, line: %lu)\n", __FILE__, (unsigned long)__LINE__); \
goto error; \
} \
}
/** Recursive tree-building function. */
static struct smk_huff8_t* _smk_huff8_build_rec(struct smk_bit_t* bs)
{
struct smk_huff8_t* ret = NULL;
char bit;
/* sanity check - removed: bs cannot be null, because it was checked at smk_huff8_build below */
/* smk_assert(bs); */
/* Read the bit */
smk_bs_read_1(bs, bit);
/* Malloc a structure. */
smk_malloc(ret, sizeof(struct smk_huff8_t));
if (bit)
{
/* Bit set: this forms a Branch node. */
/* Recursively attempt to build the Left branch. */
smk_huff8_build_rec(bs, ret->b0);
/* Everything is still OK: attempt to build the Right branch. */
smk_huff8_build_rec(bs, ret->u.b1);
/* return branch pointer here */
return ret;
}
/* Bit unset signifies a Leaf node. */
/* Attempt to read value */
smk_bs_read_8(bs, ret->u.leaf.value);
/* smk_malloc sets entries to 0 by default */
/* ret->b0 = NULL; */
ret->u.leaf.escapecode = 0xFF;
return ret;
error:
/* In case of error, undo the subtree we were building, and return NULL. */
smk_huff8_free(ret);
return NULL;
}
/* Look up an 8-bit value from a basic huff tree.
Return -1 on error. */
short _smk_huff8_lookup(struct smk_bit_t* bs, const struct smk_huff8_t* t)
{
char bit;
/* sanity check */
smk_assert(bs);
smk_assert(t);
if (!t->b0)
{
/* Reached a Leaf node. Return its value. */
return t->u.leaf.value;
}
/* Read the next bit from bitstream to determine path */
smk_bs_read_1(bs, bit);
if (bit)
{
/* get_bit returned Set, follow Right branch. */
return _smk_huff8_lookup(bs, t->u.b1);
}
/* follow Left branch */
return _smk_huff8_lookup(bs, t->b0);
error:
return -1;
}
/**
Entry point for huff8 build. Basically just checks the start/end tags
and calls smk_huff8_build_rec recursive function.
*/
struct smk_huff8_t* _smk_huff8_build(struct smk_bit_t* bs)
{
struct smk_huff8_t* ret = NULL;
char bit;
/* sanity check */
smk_assert(bs);
/* Smacker huff trees begin with a set-bit. */
smk_bs_read_1(bs, bit);
if (!bit)
{
/* Got a bit, but it was not 1. In theory, there could be a smk file
without this particular tree. */
fputs("libsmacker::_smk_huff8_build(bs) - Warning: initial get_bit returned 0\n", stderr);
goto error;
}
/* Begin parsing the tree data. */
smk_huff8_build_rec(bs, ret);
/* huff trees end with an unset-bit */
smk_bs_read_1(bs, bit);
if (bit)
{
fputs("libsmacker::_smk_huff8_build(bs) - ERROR: final get_bit returned 1\n", stderr);
goto error;
}
return ret;
error:
smk_huff8_free(ret);
return NULL;
}
/* function to recursively delete a huffman tree */
void smk_huff8_free(struct smk_huff8_t* t)
{
/* Sanity check: do not double-free */
smk_assert(t);
/* If this is not a leaf node, free child trees first */
if (t->b0)
{
smk_huff8_free(t->b0);
smk_huff8_free(t->u.b1);
}
/* Safe-delete tree node. */
smk_free(t);
error: ;
}
/*********************** 16-BIT HUFF-TREE FUNCTIONS ***********************/
/* safe bigtree build with built-in error jump */
#define smk_huff16_build_rec(bs,cache,low8,hi8,p) \
{ \
if (!(p = _smk_huff16_build_rec(bs, cache, low8, hi8))) \
{ \
fprintf(stderr, "libsmacker::smk_huff16_build_rec(" #bs ", " #cache ", " #low8 ", " #hi8 ", " #p ") - ERROR (file: %s, line: %lu)\n", __FILE__, (unsigned long)__LINE__); \
goto error; \
} \
}
/* Recursively builds a Big tree. */
static struct smk_huff8_t* _smk_huff16_build_rec(struct smk_bit_t* bs, const unsigned short cache[3], const struct smk_huff8_t* low8, const struct smk_huff8_t* hi8)
{
struct smk_huff8_t* ret = NULL;
char bit;
short lowval;
/* sanity check - removed: these cannot be null, because they were checked at smk_huff16_build below */
/* smk_assert(bs);
smk_assert(cache);
smk_assert(low8);
smk_assert(hi8); */
/* Get the first bit */
smk_bs_read_1(bs, bit);
/* Malloc a structure. */
smk_malloc(ret, sizeof(struct smk_huff8_t));
if (bit)
{
/* Recursively attempt to build the Left branch. */
smk_huff16_build_rec(bs, cache, low8, hi8, ret->b0);
/* Recursively attempt to build the Left branch. */
smk_huff16_build_rec(bs, cache, low8, hi8, ret->u.b1);
/* return branch pointer here */
return ret;
}
/* Bit unset signifies a Leaf node. */
smk_huff8_lookup(bs, low8, lowval);
smk_huff8_lookup(bs, hi8, ret->u.leaf.value);
/* Looks OK: we got low and hi values. Return a new LEAF */
/* ret->b0 = NULL; */
ret->u.leaf.value = lowval | (ret->u.leaf.value << 8);
/* Last: when building the tree, some Values may correspond to cache positions.
Identify these values and set the Escape code byte accordingly. */
if (ret->u.leaf.value == cache[0])
{
ret->u.leaf.escapecode = 0;
}
else if (ret->u.leaf.value == cache[1])
{
ret->u.leaf.escapecode = 1;
}
else if (ret->u.leaf.value == cache[2])
{
ret->u.leaf.escapecode = 2;
}
else
{
ret->u.leaf.escapecode = 0xFF;
}
return ret;
error:
smk_huff8_free(ret);
return NULL;
}
/* Entry point for building a big 16-bit tree. */
struct smk_huff16_t* _smk_huff16_build(struct smk_bit_t* bs)
{
struct smk_huff16_t* big = NULL;
struct smk_huff8_t* low8 = NULL;
struct smk_huff8_t* hi8 = NULL;
short lowval;
char bit;
unsigned char i;
/* sanity check */
smk_assert(bs);
/* Smacker huff trees begin with a set-bit. */
smk_bs_read_1(bs, bit);
if (!bit)
{
fputs("libsmacker::smk_huff16_build(bs) - ERROR: initial get_bit returned 0\n", stderr);
goto error;
}
/* build low-8-bits tree */
smk_huff8_build(bs, low8);
/* build hi-8-bits tree */
smk_huff8_build(bs, hi8);
/* Everything looks OK so far. Time to malloc structure. */
smk_malloc(big, sizeof(struct smk_huff16_t));
/* Init the escape code cache. */
for (i = 0; i < 3; i ++)
{
smk_bs_read_8(bs, lowval);
smk_bs_read_8(bs, big->cache[i]);
big->cache[i] = lowval | (big->cache[i] << 8);
}
/* Finally, call recursive function to retrieve the Bigtree. */
smk_huff16_build_rec(bs, big->cache, low8, hi8, big->t);
/* Done with 8-bit hufftrees, free them. */
smk_huff8_free(hi8);
smk_huff8_free(low8);
/* Check final end tag. */
smk_bs_read_1(bs, bit);
if (bit)
{
fputs("libsmacker::smk_huff16_build(bs) - ERROR: final get_bit returned 1\n", stderr);
goto error;
}
return big;
error:
smk_huff16_free(big);
smk_huff8_free(hi8);
smk_huff8_free(low8);
return NULL;
}
static int _smk_huff16_lookup_rec(struct smk_bit_t* bs, unsigned short cache[3], const struct smk_huff8_t* t)
{
unsigned short val;
char bit;
/* sanity check */
/* smk_assert(bs);
smk_assert(cache);
smk_assert(t); */
/* Reached a Leaf node */
if (!t->b0)
{
if (t->u.leaf.escapecode != 0xFF)
{
/* Found escape code. Retrieve value from Cache. */
val = cache[t->u.leaf.escapecode];
}
else
{
/* Use value directly. */
val = t->u.leaf.value;
}
if (cache[0] != val)
{
/* Update the cache, by moving val to the front of the queue,
if it isn't already there. */
cache[2] = cache[1];
cache[1] = cache[0];
cache[0] = val;
}
return val;
}
/* Read the next bit from bitstream to determine path */
smk_bs_read_1(bs, bit);
if (bit)
{
/* get_bit returned Set, follow Right branch. */
return _smk_huff16_lookup_rec(bs, cache, t->u.b1);
}
return _smk_huff16_lookup_rec(bs, cache, t->b0);
error:
return -1;
}
/* Convenience call-out for recursive bigtree lookup function */
long _smk_huff16_lookup(struct smk_bit_t* bs, struct smk_huff16_t* big)
{
/* sanity check */
smk_assert(bs);
smk_assert(big);
return _smk_huff16_lookup_rec(bs, big->cache, big->t);
error:
return -1;
}
/* Resets a Big hufftree cache */
void smk_huff16_reset(struct smk_huff16_t* big)
{
/* sanity check */
smk_assert(big);
big->cache[0] = 0;
big->cache[1] = 0;
big->cache[2] = 0;
error: ;
}
/* delete a (big) huffman tree */
void smk_huff16_free(struct smk_huff16_t* big)
{
/* Sanity check: do not double-free */
smk_assert(big);
/* free the subtree */
if (big->t)
smk_huff8_free(big->t);
/* free the bigtree */
smk_free(big);
error: ;
};

88
3rdParty/libsmacker/smk_hufftree.h vendored

@ -0,0 +1,88 @@
/**
libsmacker - A C library for decoding .smk Smacker Video files
Copyright (C) 2012-2017 Greg Kennedy
See smacker.h for more information.
smk_hufftree.h
SMK huffmann trees. There are two types:
- a basic 8-bit tree, and
- a "big" 16-bit tree which includes a cache for recently
searched values.
*/
#ifndef SMK_HUFFTREE_H
#define SMK_HUFFTREE_H
#include "smk_bitstream.h"
/** Tree node structures - Forward declaration */
struct smk_huff8_t;
struct smk_huff16_t;
/*********************** 8-BIT HUFF-TREE FUNCTIONS ***********************/
/** This macro checks return code from _smk_huff8_build and
jumps to error label if problems occur. */
#define smk_huff8_build(bs,t) \
{ \
if (!(t = _smk_huff8_build(bs))) \
{ \
fprintf(stderr, "libsmacker::smk_huff8_build(" #bs ", " #t ") - ERROR (file: %s, line: %lu)\n", __FILE__, (unsigned long)__LINE__); \
goto error; \
} \
}
/** Build an 8-bit tree from a bitstream */
struct smk_huff8_t* _smk_huff8_build(struct smk_bit_t* bs);
/** This macro checks return code from _smk_huff8_lookup and
jumps to error label if problems occur. */
#define smk_huff8_lookup(bs,t,s) \
{ \
if ((short)(s = _smk_huff8_lookup(bs, t)) < 0) \
{ \
fprintf(stderr, "libsmacker::smk_huff8_lookup(" #bs ", " #t ", " #s ") - ERROR (file: %s, line: %lu)\n", __FILE__, (unsigned long)__LINE__); \
goto error; \
} \
}
/** Look up an 8-bit value in the referenced tree by following a bitstream
returns -1 on error */
short _smk_huff8_lookup(struct smk_bit_t* bs, const struct smk_huff8_t* t);
/** function to recursively delete an 8-bit huffman tree */
void smk_huff8_free(struct smk_huff8_t* t);
/************************ 16-BIT HUFF-TREE FUNCTIONS ************************/
/** This macro checks return code from _smk_huff16_build and
jumps to error label if problems occur. */
#define smk_huff16_build(bs,t) \
{ \
if (!(t = _smk_huff16_build(bs))) \
{ \
fprintf(stderr, "libsmacker::smk_huff16_build(" #bs ", " #t ") - ERROR (file: %s, line: %lu)\n", __FILE__, (unsigned long)__LINE__); \
goto error; \
} \
}
/** Build a 16-bit tree from a bitstream */
struct smk_huff16_t* _smk_huff16_build(struct smk_bit_t* bs);
/** This macro checks return code from smk_huff16_lookup and
jumps to error label if problems occur. */
#define smk_huff16_lookup(bs,t,s) \
{ \
if ((s = _smk_huff16_lookup(bs, t)) < 0) \
{ \
fprintf(stderr, "libsmacker::smk_huff16_lookup(" #bs ", " #t ", " #s ") - ERROR (file: %s, line: %lu)\n", __FILE__, (unsigned long)__LINE__); \
goto error; \
} \
}
/** Look up a 16-bit value in the bigtree by following a bitstream
returns -1 on error */
long _smk_huff16_lookup(struct smk_bit_t* bs, struct smk_huff16_t* big);
/** Reset the cache in a 16-bit tree */
void smk_huff16_reset(struct smk_huff16_t* big);
/** function to recursively delete a 16-bit huffman tree */
void smk_huff16_free(struct smk_huff16_t* big);
#endif

77
3rdParty/libsmacker/smk_malloc.h vendored

@ -0,0 +1,77 @@
/**
libsmacker - A C library for decoding .smk Smacker Video files
Copyright (C) 2012-2017 Greg Kennedy
See smacker.h for more information.
smk_malloc.h
"Safe" implementations of malloc and free.
Verbose implementation of assert.
*/
#ifndef SMK_MALLOC_H
#define SMK_MALLOC_H
/* calloc */
#include <stdlib.h>
/* fprintf */
#include <stdio.h>
/* Error messages from calloc */
#include <errno.h>
#include <string.h>
/**
Verbose assert:
branches to an error block if pointer is null
*/
#define smk_assert(p) \
{ \
if (!p) \
{ \
fprintf(stderr, "libsmacker::smk_assert(" #p "): ERROR: NULL POINTER at line %lu, file %s\n", (unsigned long)__LINE__, __FILE__); \
goto error; \
} \
}
/**
Safe free: attempts to prevent double-free by setting pointer to NULL.
Optionally warns on attempts to free a NULL pointer.
*/
#define smk_free(p) \
{ \
if (p) \
{ \
free(p); \
p = NULL; \
} \
/* else \
{ \
fprintf(stderr, "libsmacker::smk_free(" #p ") - Warning: attempt to free NULL pointer (file: %s, line: %lu)\n", __FILE__, (unsigned long)__LINE__); \
} */ \
}
/**
Safe malloc: exits if calloc() returns NULL.
Also initializes blocks to 0.
Optionally warns on attempts to malloc over an existing pointer.
Ideally, one should not exit() in a library. However, if you cannot
calloc(), you probably have bigger problems.
*/
#define smk_malloc(p, x) \
{ \
/* if (p) \
{ \
fprintf(stderr, "libsmacker::smk_malloc(" #p ", %lu) - Warning: freeing non-NULL pointer before calloc (file: %s, line: %lu)\n", (unsigned long) (x), __FILE__, (unsigned long)__LINE__); \
free(p); \
} */ \
p = calloc(1, x); \
if (!p) \
{ \
fprintf(stderr, "libsmacker::smk_malloc(" #p ", %lu) - ERROR: calloc() returned NULL (file: %s, line: %lu)\n\tReason: [%d] %s\n", \
(unsigned long) (x), __FILE__, (unsigned long)__LINE__, errno, strerror(errno)); \
exit(EXIT_FAILURE); \
} \
}
#endif

1
CMake/32bit.cmake

@ -1,6 +1,7 @@
message(STATUS "Using 32-bit toolchain") message(STATUS "Using 32-bit toolchain")
set(CMAKE_CXX_FLAGS -m32 CACHE STRING "") set(CMAKE_CXX_FLAGS -m32 CACHE STRING "")
set(CMAKE_C_FLAGS -m32 CACHE STRING "")
# Affects pkg-config # Affects pkg-config
set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB32_PATHS TRUE) set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB32_PATHS TRUE)

4
CMakeLists.txt

@ -156,6 +156,10 @@ set(STUB_SOURCES
Stub/DiabloUI/selhero.cpp Stub/DiabloUI/selhero.cpp
Stub/DiabloUI/title.cpp Stub/DiabloUI/title.cpp
3rdParty/libsmacker/smk_bitstream.c
3rdParty/libsmacker/smk_hufftree.c
3rdParty/libsmacker/smacker.c
3rdParty/StormLib/src/FileStream.cpp 3rdParty/StormLib/src/FileStream.cpp
3rdParty/StormLib/src/SBaseCommon.cpp 3rdParty/StormLib/src/SBaseCommon.cpp
3rdParty/StormLib/src/SBaseFileTable.cpp 3rdParty/StormLib/src/SBaseFileTable.cpp

3
Stub/DiabloUI/diabloui.cpp

@ -664,7 +664,6 @@ void LoadBackgroundArt(char *pszFile)
{ {
PALETTEENTRY pPal[256]; PALETTEENTRY pPal[256];
fadeValue = 0;
LoadArt(pszFile, &ArtBackground, 1, pPal); LoadArt(pszFile, &ArtBackground, 1, pPal);
LoadPalInMem(pPal); LoadPalInMem(pPal);
ApplyGamma(logical_palette, orig_palette, 256); ApplyGamma(logical_palette, orig_palette, 256);
@ -720,8 +719,6 @@ void DrawEditBox(UI_Item item)
DrawArtStr(&item); DrawArtStr(&item);
} }
float freq = SDL_GetPerformanceFrequency();
void UiRender() void UiRender()
{ {
SDL_Event event; SDL_Event event;

2
Stub/init.cpp

@ -95,7 +95,7 @@ void __fastcall init_create_window(int nCmdShow)
atexit(TTF_Quit); atexit(TTF_Quit);
SDL_Init(SDL_INIT_EVERYTHING); SDL_Init(SDL_INIT_EVERYTHING);
int flags = SDL_WINDOW_FULLSCREEN_DESKTOP; int flags = SDL_WINDOW_FULLSCREEN_DESKTOP | SDL_WINDOW_INPUT_GRABBED;
if (!fullscreen) { if (!fullscreen) {
flags = SDL_WINDOW_RESIZABLE; flags = SDL_WINDOW_RESIZABLE;
} }

117
Stub/movie.cpp

@ -1,8 +1,123 @@
#include "../3rdParty/libsmacker/smacker.h"
#include "../3rdParty/libsmackerdec/include/SmackerDecoder.h"
#include "../types.h" #include "../types.h"
BOOL loop_movie; BYTE movie_playing;
BOOL loop_movie; // TODO
void __fastcall play_movie(char *pszMovie, BOOL user_can_close) void __fastcall play_movie(char *pszMovie, BOOL user_can_close)
{ {
DUMMY_PRINT("%s", pszMovie); DUMMY_PRINT("%s", pszMovie);
SDL_DestroyTexture(texture);
texture = SDL_CreateTexture(renderer, SDL_PIXELFORMAT_RGBA8888, SDL_TEXTUREACCESS_STREAMING, 320, 156);
SDL_RenderSetLogicalSize(renderer, 320, 156);
void *video_stream;
movie_playing = TRUE;
//sound_disable_music(TRUE);
sfx_stop();
effects_play_sound("Sfx\\Misc\\blank.wav");
HANDLE directsound;
SFileOpenFile(pszMovie, &directsound);
char *fileBuffer;
int bytestoread = SFileGetFileSize(directsound, 0);
fileBuffer = DiabloAllocPtr(bytestoread);
SFileReadFile(directsound, fileBuffer, bytestoread, NULL, 0);
if (Mix_OpenAudio(22050, AUDIO_S16LSB, 1, 512) < 0) {
printf("SDL_mixer could not initialize! SDL_mixer Error: %s\n", Mix_GetError());
}
/* file meta-info */
unsigned int width, height, nFrames;
/* arrays for audio track metadata */
unsigned char a_trackmask, a_channels[7], a_depth[7];
unsigned long a_rate[7];
unsigned char *palette_data;
smk smacker;
smacker = smk_open_memory(fileBuffer, bytestoread);
if (smacker != NULL) {
int now;
double usPerFrame;
smk_enable_all(smacker, -1);
smk_info_all(smacker, NULL, &nFrames, &usPerFrame);
smk_info_video(smacker, &width, &height, NULL);
smk_info_audio(smacker, &a_trackmask, a_channels, a_depth, a_rate);
printf("Audio info for track 0: bit-depth %u, channels %u, rate %u\n", a_depth[0], a_channels[0], a_rate[0]);
smk_first(smacker);
SDL_Event event;
double frameEnd = SDL_GetTicks() * 1000 + usPerFrame;
for (int f = 0; f < nFrames && movie_playing; f++) {
while (SDL_PollEvent(&event)) {
switch (event.type) {
case SDL_KEYDOWN:
case SDL_MOUSEBUTTONDOWN:
movie_playing = false;
break;
case SDL_QUIT:
exit(0);
}
}
now = SDL_GetTicks() * 1000;
if (now >= frameEnd) {
continue; // Skip audio and video if the system is to slow
}
Mix_Chunk *Song = Mix_QuickLoad_RAW(smk_get_audio(smacker, 0), smk_get_audio_size(smacker, 0));
Mix_PlayChannel(-1, Song, 0);
now = SDL_GetTicks() * 1000;
if (now >= frameEnd) {
continue; // Skip video if system is to slow
}
/* Retrieve the palette and image */
palette_data = smk_get_palette(smacker);
for (int i = 0; i < 256; i++) {
orig_palette[i].peFlags = 0;
orig_palette[i].peRed = palette_data[i * 3 + 0];
orig_palette[i].peGreen = palette_data[i * 3 + 1];
orig_palette[i].peBlue = palette_data[i * 3 + 2];
}
ApplyGamma(logical_palette, orig_palette, 256);
// Copy frame to buffer
BYTE *src = (BYTE *)smk_get_video(smacker);
BYTE *dst = (BYTE *)&gpBuffer->row[0].pixels[0];
for (int i = 0; i < height && i < SCREEN_HEIGHT; i++, src += width, dst += ROW_PITCH) {
for (int j = 0; j < width && j < SCREEN_WIDTH; j++) {
dst[j] = src[j];
}
}
SetFadeLevel(256); // present frame
smk_next(smacker); // Decode next frame
now = SDL_GetTicks() * 1000;
if (now < frameEnd) {
usleep(frameEnd - now); // wait with next frame if the system is to fast
}
frameEnd += usPerFrame;
}
smk_close(smacker);
}
Mix_CloseAudio();
if (Mix_OpenAudio(44100, AUDIO_S16LSB, 2, 1024) < 0) {
printf("SDL_mixer could not initialize! SDL_mixer Error: %s\n", Mix_GetError());
}
SDL_DestroyTexture(texture);
texture = SDL_CreateTexture(renderer, SDL_PIXELFORMAT_RGBA8888, SDL_TEXTUREACCESS_STREAMING, SCREEN_WIDTH, SCREEN_HEIGHT);
SDL_RenderSetLogicalSize(renderer, SCREEN_WIDTH, SCREEN_HEIGHT);
} }

8
Stub/sound.cpp

@ -6,9 +6,6 @@ BYTE gbDupSounds;
unsigned char channels = 8; // defines how many channels, respectively how many *.wav files can be played at the same time unsigned char channels = 8; // defines how many channels, respectively how many *.wav files can be played at the same time
UCHAR gbMusicOn; UCHAR gbMusicOn;
UCHAR gbSoundOn; UCHAR gbSoundOn;
Mix_Music *gMusic = NULL;
Mix_Chunk *sample;
Mix_Music *music;
char *sgszMusicTracks[6] = { "Music\\DTowne.wav", "Music\\DLvlA.wav", "Music\\DLvlB.wav", char *sgszMusicTracks[6] = { "Music\\DTowne.wav", "Music\\DLvlA.wav", "Music\\DLvlB.wav",
"Music\\DLvlC.wav", "Music\\DLvlD.wav", "Music\\Dintro.wav" }; "Music\\DLvlC.wav", "Music\\DLvlD.wav", "Music\\Dintro.wav" };
@ -16,12 +13,7 @@ char *sgszMusicTracks[6] = { "Music\\DTowne.wav", "Music\\DLvlA.wav", "Music\\DL
void __fastcall snd_init(HWND hWnd) void __fastcall snd_init(HWND hWnd)
{ {
DUMMY(); DUMMY();
/* for some reason function __fastcall snd_init seems to be used twice at this time*/
printf("\nSND INIT\n"); printf("\nSND INIT\n");
// Initialize SDL.
if (SDL_Init(SDL_INIT_AUDIO) < 0) {
printf("ERROR : %s\n\n", SDL_GetError());
}
/* following function Mix_AllocateChannels allocates the number of channels of simultaneously played sounds.*/ /* following function Mix_AllocateChannels allocates the number of channels of simultaneously played sounds.*/
printf("Opened %i sound channels\n\n", Mix_AllocateChannels(channels)); printf("Opened %i sound channels\n\n", Mix_AllocateChannels(channels));

1
Stub/sound.h

@ -1 +0,0 @@
extern void IsPlayMusic();

1
types.h

@ -46,7 +46,6 @@
#include "miniwin_sdl.h" #include "miniwin_sdl.h"
#include "stubs.h" #include "stubs.h"
#include "DiabloUI/sdlrender.h" #include "DiabloUI/sdlrender.h"
#include "sound.h"
#endif #endif
#include "defs.h" #include "defs.h"

Loading…
Cancel
Save