Skip to content

Commit

Permalink
Refactor audio system a bit:
Browse files Browse the repository at this point in the history
- Use SDL2 api
- Stronger typed sound functions
- Use c++11 features
- Proper locking and logging
- Cleanup
- Fix bugs 101 and (likely) 98
  • Loading branch information
carstene1ns committed Nov 17, 2023
1 parent cc32fd1 commit 1fa7463
Show file tree
Hide file tree
Showing 22 changed files with 431 additions and 374 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ add_executable(OpenJazz
src/player/player.h
src/setup.cpp
src/setup.h
src/types.h
src/util.cpp
src/util.h
src/version.cpp
Expand Down
37 changes: 1 addition & 36 deletions src/OpenJazz.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,31 +37,10 @@
#define EXTERN extern
#endif

#include "types.h"

// Constants

// Numbers in -10 exponent fixed point
#define FE 128
#define FQ 256
#define FH 512
#define F1 1024
#define F2 2048
#define F4 4096
#define F8 8192
#define F10 10240
#define F12 12288
#define F16 16384
#define F20 20480
#define F24 24576
#define F32 32768
#define F36 36864
#define F40 40960
#define F80 81920
#define F64 65536
#define F100 102400
#define F160 163840
#define F192 196608

// Standard string length
#define STRING_LENGTH 32

Expand All @@ -86,18 +65,4 @@

#define MAX_PALETTE_COLORS 256

// Macros

// For fixed-point operations
#define FTOI(x) ((x) >> 10) ///< Fixed to Int
#define ITOF(x) ((x) << 10) ///< Int to Fixed
#define MUL(x, y) (((x) * (y)) >> 10) ///< multiplication
#define DIV(x, y) (((x) << 10) / (y)) ///< division


// Datatype

typedef int fixed; ///< Custom fixed-point data type

#endif

Loading

0 comments on commit 1fa7463

Please sign in to comment.