misc/libopenalbridge/openalbridge_t.h
author nemo
Sat, 10 Mar 2012 16:10:38 -0500
changeset 6762 85ba0c55d077
parent 3744 543412536b7b
permissions -rw-r--r--
Set default empty ammo sets. Current mission handling appears to not pass any default ammo set, so script was never getting a chance to set its own.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3744
543412536b7b Convert from dos
nemo
parents: 3695
diff changeset
     1
/*
543412536b7b Convert from dos
nemo
parents: 3695
diff changeset
     2
 * OpenAL Bridge - a simple portable library for OpenAL interface
543412536b7b Convert from dos
nemo
parents: 3695
diff changeset
     3
 * Copyright (c) 2009 Vittorio Giovara <vittorio.giovara@gmail.com>
543412536b7b Convert from dos
nemo
parents: 3695
diff changeset
     4
 *
543412536b7b Convert from dos
nemo
parents: 3695
diff changeset
     5
 * This program is free software; you can redistribute it and/or modify
543412536b7b Convert from dos
nemo
parents: 3695
diff changeset
     6
 * it under the terms of the GNU Lesser General Public License as published by
543412536b7b Convert from dos
nemo
parents: 3695
diff changeset
     7
 * the Free Software Foundation; version 2 of the License
543412536b7b Convert from dos
nemo
parents: 3695
diff changeset
     8
 *
543412536b7b Convert from dos
nemo
parents: 3695
diff changeset
     9
 * This program is distributed in the hope that it will be useful,
543412536b7b Convert from dos
nemo
parents: 3695
diff changeset
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
543412536b7b Convert from dos
nemo
parents: 3695
diff changeset
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
543412536b7b Convert from dos
nemo
parents: 3695
diff changeset
    12
 * GNU Lesser General Public License for more details.
543412536b7b Convert from dos
nemo
parents: 3695
diff changeset
    13
 *
543412536b7b Convert from dos
nemo
parents: 3695
diff changeset
    14
 * You should have received a copy of the GNU Lesser General Public License
543412536b7b Convert from dos
nemo
parents: 3695
diff changeset
    15
 * along with this program; if not, write to the Free Software
543412536b7b Convert from dos
nemo
parents: 3695
diff changeset
    16
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
543412536b7b Convert from dos
nemo
parents: 3695
diff changeset
    17
 */
543412536b7b Convert from dos
nemo
parents: 3695
diff changeset
    18
543412536b7b Convert from dos
nemo
parents: 3695
diff changeset
    19
#include <stdint.h>
543412536b7b Convert from dos
nemo
parents: 3695
diff changeset
    20
#include "al.h"
543412536b7b Convert from dos
nemo
parents: 3695
diff changeset
    21
543412536b7b Convert from dos
nemo
parents: 3695
diff changeset
    22
#ifndef _OALB_INTERFACE_TYPES_H
543412536b7b Convert from dos
nemo
parents: 3695
diff changeset
    23
#define _OALB_INTERFACE_TYPES_H
543412536b7b Convert from dos
nemo
parents: 3695
diff changeset
    24
543412536b7b Convert from dos
nemo
parents: 3695
diff changeset
    25
enum al_fade_enum {AL_FADE_IN, AL_FADE_OUT};
543412536b7b Convert from dos
nemo
parents: 3695
diff changeset
    26
typedef enum al_fade_enum al_fade_t;
543412536b7b Convert from dos
nemo
parents: 3695
diff changeset
    27
543412536b7b Convert from dos
nemo
parents: 3695
diff changeset
    28
543412536b7b Convert from dos
nemo
parents: 3695
diff changeset
    29
// data type to handle which source source is playing what
543412536b7b Convert from dos
nemo
parents: 3695
diff changeset
    30
#pragma pack(1)
543412536b7b Convert from dos
nemo
parents: 3695
diff changeset
    31
typedef struct _al_sound_t {
543412536b7b Convert from dos
nemo
parents: 3695
diff changeset
    32
    const char *filename;       // name of the sound file
543412536b7b Convert from dos
nemo
parents: 3695
diff changeset
    33
    ALuint buffer;              // actual sound content
543412536b7b Convert from dos
nemo
parents: 3695
diff changeset
    34
    uint32_t source_index;      // index of the associated source
543412536b7b Convert from dos
nemo
parents: 3695
diff changeset
    35
    ALboolean is_used;          // tells if the element can be overwritten
543412536b7b Convert from dos
nemo
parents: 3695
diff changeset
    36
} al_sound_t;
543412536b7b Convert from dos
nemo
parents: 3695
diff changeset
    37
#pragma pack()
543412536b7b Convert from dos
nemo
parents: 3695
diff changeset
    38
543412536b7b Convert from dos
nemo
parents: 3695
diff changeset
    39
543412536b7b Convert from dos
nemo
parents: 3695
diff changeset
    40
// data type for passing data between threads
543412536b7b Convert from dos
nemo
parents: 3695
diff changeset
    41
#pragma pack(1)
543412536b7b Convert from dos
nemo
parents: 3695
diff changeset
    42
typedef struct _fade_t {
543412536b7b Convert from dos
nemo
parents: 3695
diff changeset
    43
    uint32_t index;
543412536b7b Convert from dos
nemo
parents: 3695
diff changeset
    44
    uint16_t quantity;
543412536b7b Convert from dos
nemo
parents: 3695
diff changeset
    45
    al_fade_t type;
543412536b7b Convert from dos
nemo
parents: 3695
diff changeset
    46
} fade_t;
543412536b7b Convert from dos
nemo
parents: 3695
diff changeset
    47
#pragma pack()
543412536b7b Convert from dos
nemo
parents: 3695
diff changeset
    48
543412536b7b Convert from dos
nemo
parents: 3695
diff changeset
    49
543412536b7b Convert from dos
nemo
parents: 3695
diff changeset
    50
// data type for WAV header
543412536b7b Convert from dos
nemo
parents: 3695
diff changeset
    51
#pragma pack(1)
543412536b7b Convert from dos
nemo
parents: 3695
diff changeset
    52
typedef struct _WAV_header_t {
543412536b7b Convert from dos
nemo
parents: 3695
diff changeset
    53
    uint32_t ChunkID;
543412536b7b Convert from dos
nemo
parents: 3695
diff changeset
    54
    uint32_t ChunkSize;
543412536b7b Convert from dos
nemo
parents: 3695
diff changeset
    55
    uint32_t Format;
543412536b7b Convert from dos
nemo
parents: 3695
diff changeset
    56
    uint32_t Subchunk1ID;
543412536b7b Convert from dos
nemo
parents: 3695
diff changeset
    57
    uint32_t Subchunk1Size;
543412536b7b Convert from dos
nemo
parents: 3695
diff changeset
    58
    uint16_t AudioFormat;
543412536b7b Convert from dos
nemo
parents: 3695
diff changeset
    59
    uint16_t NumChannels;
543412536b7b Convert from dos
nemo
parents: 3695
diff changeset
    60
    uint32_t SampleRate;
543412536b7b Convert from dos
nemo
parents: 3695
diff changeset
    61
    uint32_t ByteRate;
543412536b7b Convert from dos
nemo
parents: 3695
diff changeset
    62
    uint16_t BlockAlign;
543412536b7b Convert from dos
nemo
parents: 3695
diff changeset
    63
    uint16_t BitsPerSample;
543412536b7b Convert from dos
nemo
parents: 3695
diff changeset
    64
    uint32_t Subchunk2ID;
543412536b7b Convert from dos
nemo
parents: 3695
diff changeset
    65
    uint32_t Subchunk2Size;
543412536b7b Convert from dos
nemo
parents: 3695
diff changeset
    66
} WAV_header_t;
543412536b7b Convert from dos
nemo
parents: 3695
diff changeset
    67
#pragma pack()
543412536b7b Convert from dos
nemo
parents: 3695
diff changeset
    68
543412536b7b Convert from dos
nemo
parents: 3695
diff changeset
    69
543412536b7b Convert from dos
nemo
parents: 3695
diff changeset
    70
#ifdef __CPLUSPLUS
543412536b7b Convert from dos
nemo
parents: 3695
diff changeset
    71
}
543412536b7b Convert from dos
nemo
parents: 3695
diff changeset
    72
#endif
543412536b7b Convert from dos
nemo
parents: 3695
diff changeset
    73
543412536b7b Convert from dos
nemo
parents: 3695
diff changeset
    74
#endif /*_OALB_INTERFACE_TYPES_H*/