mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-03-30 11:06:43 +00:00
niftool now spits out some useful info
- cleaned up some more old files
This commit is contained in:
parent
a21628d9c5
commit
b4eefb6ca3
9 changed files with 175 additions and 395 deletions
13
nif/extra.h
13
nif/extra.h
|
@ -59,6 +59,14 @@ struct NiVertWeightsExtraData : Extra
|
||||||
|
|
||||||
struct NiTextKeyExtraData : Extra
|
struct NiTextKeyExtraData : Extra
|
||||||
{
|
{
|
||||||
|
struct TextKey
|
||||||
|
{
|
||||||
|
float time;
|
||||||
|
SString text;
|
||||||
|
};
|
||||||
|
|
||||||
|
std::vector<TextKey> list;
|
||||||
|
|
||||||
void read(NIFFile *nif)
|
void read(NIFFile *nif)
|
||||||
{
|
{
|
||||||
Extra::read(nif);
|
Extra::read(nif);
|
||||||
|
@ -66,10 +74,11 @@ struct NiTextKeyExtraData : Extra
|
||||||
nif->getInt(); // 0
|
nif->getInt(); // 0
|
||||||
|
|
||||||
int keynum = nif->getInt();
|
int keynum = nif->getInt();
|
||||||
|
list.resize(keynum);
|
||||||
for(int i=0; i<keynum; i++)
|
for(int i=0; i<keynum; i++)
|
||||||
{
|
{
|
||||||
nif->getFloat(); // time
|
list[i].time = nif->getFloat();
|
||||||
nif->getString(); // key text
|
list[i].text = nif->getString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -93,6 +93,14 @@ class NIFFile
|
||||||
parse();
|
parse();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
~NIFFile()
|
||||||
|
{
|
||||||
|
for(int i=0; i<records.size(); i++)
|
||||||
|
{
|
||||||
|
delete records[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// Get a given record
|
/// Get a given record
|
||||||
Record *getRecord(int index)
|
Record *getRecord(int index)
|
||||||
{
|
{
|
||||||
|
|
|
@ -44,7 +44,7 @@ struct Node : Named
|
||||||
bool hasBounds;
|
bool hasBounds;
|
||||||
const Vector *boundPos;
|
const Vector *boundPos;
|
||||||
const Matrix *boundRot;
|
const Matrix *boundRot;
|
||||||
const Vector *boundXYZ;
|
const Vector *boundXYZ; // Box size
|
||||||
|
|
||||||
void read(NIFFile *nif)
|
void read(NIFFile *nif)
|
||||||
{
|
{
|
||||||
|
|
|
@ -119,6 +119,12 @@ class RecordListT
|
||||||
return !list[index].empty();
|
return !list[index].empty();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int getIndex(int index)
|
||||||
|
{
|
||||||
|
if(has(index)) return list[index].getIndex();
|
||||||
|
else return -1;
|
||||||
|
}
|
||||||
|
|
||||||
int length() { return list.size(); }
|
int length() { return list.size(); }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
1
nif/tests/.gitignore
vendored
1
nif/tests/.gitignore
vendored
|
@ -1,3 +1,4 @@
|
||||||
niftool
|
niftool
|
||||||
*_test
|
*_test
|
||||||
*.nif
|
*.nif
|
||||||
|
*.kf
|
||||||
|
|
|
@ -1,16 +1,132 @@
|
||||||
#include "../nif_file.h"
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Test of the NIFFile class
|
Test of the NIFFile class
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "../nif_file.h"
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
#include <iomanip>
|
||||||
#include "../../mangle/stream/servers/file_stream.h"
|
#include "../../mangle/stream/servers/file_stream.h"
|
||||||
|
#include "../node.h"
|
||||||
|
#include "../controller.h"
|
||||||
|
|
||||||
using namespace Mangle::Stream;
|
using namespace Mangle::Stream;
|
||||||
using namespace std;
|
using namespace std;
|
||||||
using namespace Nif;
|
using namespace Nif;
|
||||||
|
|
||||||
|
void doVector(const Vector *vec)
|
||||||
|
{
|
||||||
|
cout << "["
|
||||||
|
<< vec->array[0] << ","
|
||||||
|
<< vec->array[1] << ","
|
||||||
|
<< vec->array[2] << "]\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
void doMatrix(const Matrix *mat)
|
||||||
|
{
|
||||||
|
cout << "Matrix:\n";
|
||||||
|
for(int i=0; i<3; i++)
|
||||||
|
{
|
||||||
|
cout << " ";
|
||||||
|
doVector(&mat->v[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void doTrafo(const Transformation* trafo)
|
||||||
|
{
|
||||||
|
cout << "--- transformation:\n";
|
||||||
|
cout << "Pos: "; doVector(&trafo->pos);
|
||||||
|
cout << "Rot: "; doMatrix(&trafo->rotation);
|
||||||
|
cout << "Scale: " << trafo->scale << endl;
|
||||||
|
cout << "Vel: "; doVector(&trafo->velocity);
|
||||||
|
cout << "--- end transformation\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
void doExtra(Extra *e)
|
||||||
|
{
|
||||||
|
cout << "Extra: " << e->extra.getIndex() << endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
void doControlled(Controlled *c)
|
||||||
|
{
|
||||||
|
doExtra(c);
|
||||||
|
cout << "Controller: " << c->controller.getIndex() << endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
void doNamed(Named *n)
|
||||||
|
{
|
||||||
|
doControlled(n);
|
||||||
|
cout << "Name: " << n->name.toString() << endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
void doNode(Node *n)
|
||||||
|
{
|
||||||
|
doNamed(n);
|
||||||
|
|
||||||
|
cout << "Flags: 0x" << hex << n->flags << dec << endl;
|
||||||
|
doTrafo(n->trafo);
|
||||||
|
|
||||||
|
cout << "Properties:";
|
||||||
|
for(int i=0; i<n->props.length(); i++)
|
||||||
|
cout << " " << n->props.getIndex(i);
|
||||||
|
cout << endl;
|
||||||
|
|
||||||
|
if(n->hasBounds)
|
||||||
|
{
|
||||||
|
cout << "Bounding box:\n";
|
||||||
|
doVector(n->boundPos);
|
||||||
|
doMatrix(n->boundRot);
|
||||||
|
doVector(n->boundXYZ);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void doNiNode(NiNode *n)
|
||||||
|
{
|
||||||
|
doNode(n);
|
||||||
|
|
||||||
|
cout << "Children:";
|
||||||
|
for(int i=0; i<n->children.length(); i++)
|
||||||
|
cout << " " << n->children.getIndex(i);
|
||||||
|
cout << endl;
|
||||||
|
|
||||||
|
cout << "Effects:";
|
||||||
|
for(int i=0; i<n->effects.length(); i++)
|
||||||
|
cout << " " << n->effects.getIndex(i);
|
||||||
|
cout << endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
void doNiStringExtraData(NiStringExtraData *s)
|
||||||
|
{
|
||||||
|
doExtra(s);
|
||||||
|
cout << "String: " << s->string.toString() << endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
void doNiTextKeyExtraData(NiTextKeyExtraData *t)
|
||||||
|
{
|
||||||
|
doExtra(t);
|
||||||
|
for(int i=0; i<t->list.size(); i++)
|
||||||
|
{
|
||||||
|
cout << "@time " << t->list[i].time << ":\n\""
|
||||||
|
<< t->list[i].text.toString() << "\"" << endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void doController(Controller *r)
|
||||||
|
{
|
||||||
|
cout << "Next controller: " << r->next.getIndex() << endl;
|
||||||
|
cout << "Flags: " << hex << r->flags << dec << endl;
|
||||||
|
cout << "Frequency: " << r->frequency << endl;
|
||||||
|
cout << "Phase: " << r->phase << endl;
|
||||||
|
cout << "Time start: " << r->timeStart << endl;
|
||||||
|
cout << "Time stop: " << r->timeStop << endl;
|
||||||
|
cout << "Target: " << r->target.getIndex() << endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
void doNiKeyframeController(NiKeyframeController *k)
|
||||||
|
{
|
||||||
|
doController(k);
|
||||||
|
cout << "Data: " << k->data.getIndex() << endl;
|
||||||
|
}
|
||||||
|
|
||||||
int main(int argc, char **args)
|
int main(int argc, char **args)
|
||||||
{
|
{
|
||||||
if(argc != 2)
|
if(argc != 2)
|
||||||
|
@ -21,4 +137,23 @@ int main(int argc, char **args)
|
||||||
|
|
||||||
StreamPtr file(new FileStream(args[1]));
|
StreamPtr file(new FileStream(args[1]));
|
||||||
NIFFile nif(file, args[1]);
|
NIFFile nif(file, args[1]);
|
||||||
|
|
||||||
|
int num = nif.numRecords();
|
||||||
|
|
||||||
|
for(int i=0; i<num; i++)
|
||||||
|
{
|
||||||
|
Record *r = nif.getRecord(i);
|
||||||
|
cout << i << ": " << r->recName.toString() << endl;
|
||||||
|
|
||||||
|
switch(r->recType)
|
||||||
|
{
|
||||||
|
case RC_NiNode: doNiNode((NiNode*)r); break;
|
||||||
|
case RC_NiStringExtraData: doNiStringExtraData((NiStringExtraData*)r); break;
|
||||||
|
case RC_NiSequenceStreamHelper: doNamed((Named*)r); break;
|
||||||
|
case RC_NiTextKeyExtraData: doNiTextKeyExtraData((NiTextKeyExtraData*)r); break;
|
||||||
|
case RC_NiKeyframeController: doNiKeyframeController((NiKeyframeController*)r); break;
|
||||||
|
}
|
||||||
|
|
||||||
|
cout << endl;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,7 +10,8 @@ RenderWindow *window;
|
||||||
|
|
||||||
//const char* mesh = "meshes\\a\\towershield_steel.nif";
|
//const char* mesh = "meshes\\a\\towershield_steel.nif";
|
||||||
//const char* mesh = "meshes\\r\\bonelord.nif";
|
//const char* mesh = "meshes\\r\\bonelord.nif";
|
||||||
const char* mesh = "meshes\\m\\text_scroll_open_01.nif";
|
//const char* mesh = "meshes\\m\\text_scroll_open_01.nif";
|
||||||
|
const char* mesh = "meshes\\f\\ex_ashl_a_banner_r.nif";
|
||||||
|
|
||||||
int shot = 0;
|
int shot = 0;
|
||||||
|
|
||||||
|
@ -85,24 +86,28 @@ int main(int argc, char**args)
|
||||||
NIFLoader::load(mesh);
|
NIFLoader::load(mesh);
|
||||||
NIFLoader::load(mesh);
|
NIFLoader::load(mesh);
|
||||||
|
|
||||||
//*
|
/*
|
||||||
SceneNode *node = mgr->getRootSceneNode()->createChildSceneNode("node");
|
SceneNode *node = mgr->getRootSceneNode()->createChildSceneNode("node");
|
||||||
Entity *ent = mgr->createEntity("Mesh1", mesh);
|
Entity *ent = mgr->createEntity("Mesh1", mesh);
|
||||||
node->attachObject(ent);
|
node->attachObject(ent);
|
||||||
|
|
||||||
|
// Works great for the scroll
|
||||||
node->setPosition(0,4,50);
|
node->setPosition(0,4,50);
|
||||||
node->pitch(Degree(20));
|
node->pitch(Degree(20));
|
||||||
node->roll(Degree(10));
|
node->roll(Degree(10));
|
||||||
node->yaw(Degree(-10));
|
node->yaw(Degree(-10));
|
||||||
/*
|
|
||||||
|
/* Bone lord
|
||||||
node->setPosition(0,-70,170);
|
node->setPosition(0,-70,170);
|
||||||
node->pitch(Degree(-90));
|
node->pitch(Degree(-90));
|
||||||
/*
|
*/
|
||||||
// Display it from two different angles
|
|
||||||
|
// Display it from two different angles - shield and banner
|
||||||
const int sep = 45;
|
const int sep = 45;
|
||||||
SceneNode *node = mgr->getRootSceneNode()->createChildSceneNode("node");
|
SceneNode *node = mgr->getRootSceneNode()->createChildSceneNode("node");
|
||||||
Entity *ent = mgr->createEntity("Mesh1", mesh);
|
Entity *ent = mgr->createEntity("Mesh1", mesh);
|
||||||
node->attachObject(ent);
|
node->attachObject(ent);
|
||||||
node->setPosition(sep,0,100);
|
node->setPosition(sep,0,130);
|
||||||
node = node->createChildSceneNode("node2");
|
node = node->createChildSceneNode("node2");
|
||||||
ent = mgr->createEntity("Mesh2", mesh);
|
ent = mgr->createEntity("Mesh2", mesh);
|
||||||
node->attachObject(ent);
|
node->attachObject(ent);
|
||||||
|
|
|
@ -1,269 +0,0 @@
|
||||||
/*
|
|
||||||
OpenMW - The completely unofficial reimplementation of Morrowind
|
|
||||||
Copyright (C) 2008 Nicolay Korslund
|
|
||||||
Email: < korslund@gmail.com >
|
|
||||||
WWW: http://openmw.snaptoad.com/
|
|
||||||
|
|
||||||
This file (al.d) is part of the OpenMW package.
|
|
||||||
|
|
||||||
OpenMW is distributed as free software: you can redistribute it
|
|
||||||
and/or modify it under the terms of the GNU General Public License
|
|
||||||
version 3, as published by the Free Software Foundation.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful, but
|
|
||||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
version 3 along with this program. If not, see
|
|
||||||
http://www.gnu.org/licenses/ .
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
module sound.al;
|
|
||||||
|
|
||||||
extern(C):
|
|
||||||
|
|
||||||
//Defines
|
|
||||||
const int AL_NONE = 0;
|
|
||||||
|
|
||||||
const int AL_FALSE = 0;
|
|
||||||
const int AL_TRUE = 1;
|
|
||||||
|
|
||||||
const int AL_SOURCE_RELATIVE = 0x202;
|
|
||||||
const int AL_CONE_INNER_ANGLE = 0x1001;
|
|
||||||
const int AL_CONE_OUTER_ANGLE = 0x1002;
|
|
||||||
const int AL_PITCH = 0x1003;
|
|
||||||
const int AL_POSITION = 0x1004;
|
|
||||||
const int AL_DIRECTION = 0x1005;
|
|
||||||
const int AL_VELOCITY = 0x1006;
|
|
||||||
const int AL_LOOPING = 0x1007;
|
|
||||||
const int AL_BUFFER = 0x1009;
|
|
||||||
const int AL_GAIN = 0x100A;
|
|
||||||
const int AL_MIN_GAIN = 0x100D;
|
|
||||||
const int AL_MAX_GAIN = 0x100E;
|
|
||||||
const int AL_ORIENTATION = 0x100F;
|
|
||||||
const int AL_SOURCE_STATE = 0x1010;
|
|
||||||
const int AL_INITIAL = 0x1011;
|
|
||||||
const int AL_PLAYING = 0x1012;
|
|
||||||
const int AL_PAUSED = 0x1013;
|
|
||||||
const int AL_STOPPED = 0x1014;
|
|
||||||
const int AL_BUFFERS_QUEUED = 0x1015;
|
|
||||||
const int AL_BUFFERS_PROCESSED = 0x1016;
|
|
||||||
const int AL_SEC_OFFSET = 0x1024;
|
|
||||||
const int AL_SAMPLE_OFFSET = 0x1025;
|
|
||||||
const int AL_BYTE_OFFSET = 0x1026;
|
|
||||||
const int AL_SOURCE_TYPE = 0x1027;
|
|
||||||
const int AL_STATIC = 0x1028;
|
|
||||||
const int AL_STREAMING = 0x1029;
|
|
||||||
const int AL_UNDETERMINED = 0x1030;
|
|
||||||
|
|
||||||
const int AL_FORMAT_MONO8 = 0x1100;
|
|
||||||
const int AL_FORMAT_MONO16 = 0x1101;
|
|
||||||
const int AL_FORMAT_STEREO8 = 0x1102;
|
|
||||||
const int AL_FORMAT_STEREO16 = 0x1103;
|
|
||||||
|
|
||||||
const int AL_REFERENCE_DISTANCE = 0x1020;
|
|
||||||
const int AL_ROLLOFF_FACTOR = 0x1021;
|
|
||||||
const int AL_CONE_OUTER_GAIN = 0x1022;
|
|
||||||
const int AL_MAX_DISTANCE = 0x1023;
|
|
||||||
const int AL_FREQUENCY = 0x2001;
|
|
||||||
const int AL_BITS = 0x2002;
|
|
||||||
const int AL_CHANNELS = 0x2003;
|
|
||||||
const int AL_SIZE = 0x2004;
|
|
||||||
const int AL_UNUSED = 0x2010;
|
|
||||||
const int AL_PENDING = 0x2011;
|
|
||||||
const int AL_PROCESSED = 0x2012;
|
|
||||||
|
|
||||||
const int AL_NO_ERROR = AL_FALSE;
|
|
||||||
const int AL_INVALID_NAME = 0xA001;
|
|
||||||
const int AL_INVALID_ENUM = 0xA002;
|
|
||||||
const int AL_INVALID_VALUE = 0xA003;
|
|
||||||
const int AL_INVALID_OPERATION = 0xA004;
|
|
||||||
const int AL_OUT_OF_MEMORY = 0xA005;
|
|
||||||
|
|
||||||
const int AL_VENDOR = 0xB001;
|
|
||||||
const int AL_VERSION = 0xB002;
|
|
||||||
const int AL_RENDERER = 0xB003;
|
|
||||||
const int AL_EXTENSIONS = 0xB004;
|
|
||||||
|
|
||||||
const int AL_DOPPLER_FACTOR = 0xC000;
|
|
||||||
const int AL_DOPPLER_VELOCITY = 0xC001;
|
|
||||||
const int AL_SPEED_OF_SOUND = 0xC003;
|
|
||||||
|
|
||||||
const int AL_DISTANCE_MODEL = 0xD000;
|
|
||||||
const int AL_INVERSE_DISTANCE = 0xD001;
|
|
||||||
const int AL_INVERSE_DISTANCE_CLAMPED = 0xD002;
|
|
||||||
const int AL_LINEAR_DISTANCE = 0xD003;
|
|
||||||
const int AL_LINEAR_DISTANCE_CLAMPED = 0xD004;
|
|
||||||
const int AL_EXPONENT_DISTANCE = 0xD005;
|
|
||||||
const int AL_EXPONENT_DISTANCE_CLAMPED = 0xD006;
|
|
||||||
|
|
||||||
//Typedefs
|
|
||||||
alias char ALboolean;
|
|
||||||
alias char ALchar;
|
|
||||||
alias char ALbyte;
|
|
||||||
alias ubyte ALubyte;
|
|
||||||
alias short ALshort;
|
|
||||||
alias ushort ALushort;
|
|
||||||
alias int ALint;
|
|
||||||
alias uint ALuint;
|
|
||||||
alias int ALsizei;
|
|
||||||
alias int ALenum;
|
|
||||||
alias float ALfloat;
|
|
||||||
alias double ALdouble;
|
|
||||||
alias void ALvoid;
|
|
||||||
|
|
||||||
//AL Functions
|
|
||||||
void alEnable( ALenum capability );
|
|
||||||
void alDisable( ALenum capability );
|
|
||||||
ALboolean alIsEnabled( ALenum capability );
|
|
||||||
ALchar* alGetString( ALenum param );
|
|
||||||
void alGetBooleanv( ALenum param, ALboolean* data );
|
|
||||||
void alGetIntegerv( ALenum param, ALint* data );
|
|
||||||
void alGetFloatv( ALenum param, ALfloat* data );
|
|
||||||
void alGetDoublev( ALenum param, ALdouble* data );
|
|
||||||
ALboolean alGetBoolean( ALenum param );
|
|
||||||
ALint alGetInteger( ALenum param );
|
|
||||||
ALfloat alGetFloat( ALenum param );
|
|
||||||
ALdouble alGetDouble( ALenum param );
|
|
||||||
ALenum alGetError();
|
|
||||||
ALboolean alIsExtensionPresent( ALchar* extname );
|
|
||||||
void* alGetProcAddress( ALchar* fname );
|
|
||||||
ALenum alGetEnumValue( ALchar* ename );
|
|
||||||
|
|
||||||
void alListenerf( ALenum param, ALfloat value );
|
|
||||||
void alListener3f( ALenum param, ALfloat value1, ALfloat value2, ALfloat value3 );
|
|
||||||
void alListenerfv( ALenum param, ALfloat* values );
|
|
||||||
void alListeneri( ALenum param, ALint value );
|
|
||||||
void alListener3i( ALenum param, ALint value1, ALint value2, ALint value3 );
|
|
||||||
void alListeneriv( ALenum param, ALint* values );
|
|
||||||
|
|
||||||
void alGetListenerf( ALenum param, ALfloat* value );
|
|
||||||
void alGetListener3f( ALenum param, ALfloat *value1, ALfloat *value2, ALfloat *value3 );
|
|
||||||
void alGetListenerfv( ALenum param, ALfloat* values );
|
|
||||||
void alGetListeneri( ALenum param, ALint* value );
|
|
||||||
void alGetListener3i( ALenum param, ALint *value1, ALint *value2, ALint *value3 );
|
|
||||||
void alGetListeneriv( ALenum param, ALint* values );
|
|
||||||
|
|
||||||
void alGenSources( ALsizei n, ALuint* sources );
|
|
||||||
void alDeleteSources( ALsizei n, ALuint* sources );
|
|
||||||
ALboolean alIsSource( ALuint sid );
|
|
||||||
void alSourcef( ALuint sid, ALenum param, ALfloat value );
|
|
||||||
void alSource3f( ALuint sid, ALenum param, ALfloat value1, ALfloat value2, ALfloat value3 );
|
|
||||||
void alSourcefv( ALuint sid, ALenum param, ALfloat* values );
|
|
||||||
void alSourcei( ALuint sid, ALenum param, ALint value );
|
|
||||||
void alSource3i( ALuint sid, ALenum param, ALint value1, ALint value2, ALint value3 );
|
|
||||||
void alSourceiv( ALuint sid, ALenum param, ALint* values );
|
|
||||||
void alGetSourcef( ALuint sid, ALenum param, ALfloat* value );
|
|
||||||
void alGetSource3f( ALuint sid, ALenum param, ALfloat* value1, ALfloat* value2, ALfloat* value3);
|
|
||||||
void alGetSourcefv( ALuint sid, ALenum param, ALfloat* values );
|
|
||||||
void alGetSourcei( ALuint sid, ALenum param, ALint* value );
|
|
||||||
void alGetSource3i( ALuint sid, ALenum param, ALint* value1, ALint* value2, ALint* value3);
|
|
||||||
void alGetSourceiv( ALuint sid, ALenum param, ALint* values );
|
|
||||||
void alSourcePlayv( ALsizei ns, ALuint *sids );
|
|
||||||
void alSourceStopv( ALsizei ns, ALuint *sids );
|
|
||||||
void alSourceRewindv( ALsizei ns, ALuint *sids );
|
|
||||||
void alSourcePausev( ALsizei ns, ALuint *sids );
|
|
||||||
void alSourcePlay( ALuint sid );
|
|
||||||
void alSourceStop( ALuint sid );
|
|
||||||
void alSourceRewind( ALuint sid );
|
|
||||||
void alSourcePause( ALuint sid );
|
|
||||||
void alSourceQueueBuffers( ALuint sid, ALsizei numEntries, ALuint *bids );
|
|
||||||
void alSourceUnqueueBuffers( ALuint sid, ALsizei numEntries, ALuint *bids );
|
|
||||||
|
|
||||||
void alGenBuffers( ALsizei n, ALuint* buffers );
|
|
||||||
void alDeleteBuffers( ALsizei n, ALuint* buffers );
|
|
||||||
ALboolean alIsBuffer( ALuint bid );
|
|
||||||
void alBufferData( ALuint bid, ALenum format, ALvoid* data, ALsizei size, ALsizei freq );
|
|
||||||
void alBufferf( ALuint bid, ALenum param, ALfloat value );
|
|
||||||
void alBuffer3f( ALuint bid, ALenum param, ALfloat value1, ALfloat value2, ALfloat value3 );
|
|
||||||
void alBufferfv( ALuint bid, ALenum param, ALfloat* values );
|
|
||||||
void alBufferi( ALuint bid, ALenum param, ALint value );
|
|
||||||
void alBuffer3i( ALuint bid, ALenum param, ALint value1, ALint value2, ALint value3 );
|
|
||||||
void alBufferiv( ALuint bid, ALenum param, ALint* values );
|
|
||||||
void alGetBufferf( ALuint bid, ALenum param, ALfloat* value );
|
|
||||||
void alGetBuffer3f( ALuint bid, ALenum param, ALfloat* value1, ALfloat* value2, ALfloat* value3);
|
|
||||||
void alGetBufferfv( ALuint bid, ALenum param, ALfloat* values );
|
|
||||||
void alGetBufferi( ALuint bid, ALenum param, ALint* value );
|
|
||||||
void alGetBuffer3i( ALuint bid, ALenum param, ALint* value1, ALint* value2, ALint* value3);
|
|
||||||
void alGetBufferiv( ALuint bid, ALenum param, ALint* values );
|
|
||||||
void alDopplerFactor( ALfloat value );
|
|
||||||
void alDopplerVelocity( ALfloat value );
|
|
||||||
void alSpeedOfSound( ALfloat value );
|
|
||||||
void alDistanceModel( ALenum distanceModel );
|
|
||||||
|
|
||||||
typedef void ( *LPALENABLE)( ALenum capability );
|
|
||||||
typedef void ( *LPALDISABLE)( ALenum capability );
|
|
||||||
typedef ALboolean ( *LPALISENABLED)( ALenum capability );
|
|
||||||
typedef const ALchar* ( *LPALGETSTRING)( ALenum param );
|
|
||||||
typedef void ( *LPALGETBOOLEANV)( ALenum param, ALboolean* data );
|
|
||||||
typedef void ( *LPALGETINTEGERV)( ALenum param, ALint* data );
|
|
||||||
typedef void ( *LPALGETFLOATV)( ALenum param, ALfloat* data );
|
|
||||||
typedef void ( *LPALGETDOUBLEV)( ALenum param, ALdouble* data );
|
|
||||||
typedef ALboolean ( *LPALGETBOOLEAN)( ALenum param );
|
|
||||||
typedef ALint ( *LPALGETINTEGER)( ALenum param );
|
|
||||||
typedef ALfloat ( *LPALGETFLOAT)( ALenum param );
|
|
||||||
typedef ALdouble ( *LPALGETDOUBLE)( ALenum param );
|
|
||||||
typedef ALenum ( *LPALGETERROR)();
|
|
||||||
typedef ALboolean ( *LPALISEXTENSIONPRESENT)(ALchar* extname );
|
|
||||||
typedef void* ( *LPALGETPROCADDRESS)( ALchar* fname );
|
|
||||||
typedef ALenum ( *LPALGETENUMVALUE)( ALchar* ename );
|
|
||||||
typedef void ( *LPALLISTENERF)( ALenum param, ALfloat value );
|
|
||||||
typedef void ( *LPALLISTENER3F)( ALenum param, ALfloat value1, ALfloat value2, ALfloat value3 );
|
|
||||||
typedef void ( *LPALLISTENERFV)( ALenum param, ALfloat* values );
|
|
||||||
typedef void ( *LPALLISTENERI)( ALenum param, ALint value );
|
|
||||||
typedef void ( *LPALLISTENER3I)( ALenum param, ALint value1, ALint value2, ALint value3 );
|
|
||||||
typedef void ( *LPALLISTENERIV)( ALenum param, ALint* values );
|
|
||||||
typedef void ( *LPALGETLISTENERF)( ALenum param, ALfloat* value );
|
|
||||||
typedef void ( *LPALGETLISTENER3F)( ALenum param, ALfloat *value1, ALfloat *value2, ALfloat *value3 );
|
|
||||||
typedef void ( *LPALGETLISTENERFV)( ALenum param, ALfloat* values );
|
|
||||||
typedef void ( *LPALGETLISTENERI)( ALenum param, ALint* value );
|
|
||||||
typedef void ( *LPALGETLISTENER3I)( ALenum param, ALint *value1, ALint *value2, ALint *value3 );
|
|
||||||
typedef void ( *LPALGETLISTENERIV)( ALenum param, ALint* values );
|
|
||||||
typedef void ( *LPALGENSOURCES)( ALsizei n, ALuint* sources );
|
|
||||||
typedef void ( *LPALDELETESOURCES)( ALsizei n, ALuint* sources );
|
|
||||||
typedef ALboolean ( *LPALISSOURCE)( ALuint sid );
|
|
||||||
typedef void ( *LPALSOURCEF)( ALuint sid, ALenum param, ALfloat value);
|
|
||||||
typedef void ( *LPALSOURCE3F)( ALuint sid, ALenum param, ALfloat value1, ALfloat value2, ALfloat value3 );
|
|
||||||
typedef void ( *LPALSOURCEFV)( ALuint sid, ALenum param, ALfloat* values );
|
|
||||||
typedef void ( *LPALSOURCEI)( ALuint sid, ALenum param, ALint value);
|
|
||||||
typedef void ( *LPALSOURCE3I)( ALuint sid, ALenum param, ALint value1, ALint value2, ALint value3 );
|
|
||||||
typedef void ( *LPALSOURCEIV)( ALuint sid, ALenum param, ALint* values );
|
|
||||||
typedef void ( *LPALGETSOURCEF)( ALuint sid, ALenum param, ALfloat* value );
|
|
||||||
typedef void ( *LPALGETSOURCE3F)( ALuint sid, ALenum param, ALfloat* value1, ALfloat* value2, ALfloat* value3);
|
|
||||||
typedef void ( *LPALGETSOURCEFV)( ALuint sid, ALenum param, ALfloat* values );
|
|
||||||
typedef void ( *LPALGETSOURCEI)( ALuint sid, ALenum param, ALint* value );
|
|
||||||
typedef void ( *LPALGETSOURCE3I)( ALuint sid, ALenum param, ALint* value1, ALint* value2, ALint* value3);
|
|
||||||
typedef void ( *LPALGETSOURCEIV)( ALuint sid, ALenum param, ALint* values );
|
|
||||||
typedef void ( *LPALSOURCEPLAYV)( ALsizei ns, ALuint *sids );
|
|
||||||
typedef void ( *LPALSOURCESTOPV)( ALsizei ns, ALuint *sids );
|
|
||||||
typedef void ( *LPALSOURCEREWINDV)( ALsizei ns, ALuint *sids );
|
|
||||||
typedef void ( *LPALSOURCEPAUSEV)( ALsizei ns, ALuint *sids );
|
|
||||||
typedef void ( *LPALSOURCEPLAY)( ALuint sid );
|
|
||||||
typedef void ( *LPALSOURCESTOP)( ALuint sid );
|
|
||||||
typedef void ( *LPALSOURCEREWIND)( ALuint sid );
|
|
||||||
typedef void ( *LPALSOURCEPAUSE)( ALuint sid );
|
|
||||||
typedef void ( *LPALSOURCEQUEUEBUFFERS)(ALuint sid, ALsizei numEntries, ALuint *bids );
|
|
||||||
typedef void ( *LPALSOURCEUNQUEUEBUFFERS)(ALuint sid, ALsizei numEntries, ALuint *bids );
|
|
||||||
typedef void ( *LPALGENBUFFERS)( ALsizei n, ALuint* buffers );
|
|
||||||
typedef void ( *LPALDELETEBUFFERS)( ALsizei n, ALuint* buffers );
|
|
||||||
typedef ALboolean ( *LPALISBUFFER)( ALuint bid );
|
|
||||||
typedef void ( *LPALBUFFERDATA)( ALuint bid, ALenum format, ALvoid* data, ALsizei size, ALsizei freq );
|
|
||||||
typedef void ( *LPALBUFFERF)( ALuint bid, ALenum param, ALfloat value);
|
|
||||||
typedef void ( *LPALBUFFER3F)( ALuint bid, ALenum param, ALfloat value1, ALfloat value2, ALfloat value3 );
|
|
||||||
typedef void ( *LPALBUFFERFV)( ALuint bid, ALenum param, ALfloat* values );
|
|
||||||
typedef void ( *LPALBUFFERI)( ALuint bid, ALenum param, ALint value);
|
|
||||||
typedef void ( *LPALBUFFER3I)( ALuint bid, ALenum param, ALint value1, ALint value2, ALint value3 );
|
|
||||||
typedef void ( *LPALBUFFERIV)( ALuint bid, ALenum param, ALint* values );
|
|
||||||
typedef void ( *LPALGETBUFFERF)( ALuint bid, ALenum param, ALfloat* value );
|
|
||||||
typedef void ( *LPALGETBUFFER3F)( ALuint bid, ALenum param, ALfloat* value1, ALfloat* value2, ALfloat* value3);
|
|
||||||
typedef void ( *LPALGETBUFFERFV)( ALuint bid, ALenum param, ALfloat* values );
|
|
||||||
typedef void ( *LPALGETBUFFERI)( ALuint bid, ALenum param, ALint* value );
|
|
||||||
typedef void ( *LPALGETBUFFER3I)( ALuint bid, ALenum param, ALint* value1, ALint* value2, ALint* value3);
|
|
||||||
typedef void ( *LPALGETBUFFERIV)( ALuint bid, ALenum param, ALint* values );
|
|
||||||
typedef void ( *LPALDOPPLERFACTOR)( ALfloat value );
|
|
||||||
typedef void ( *LPALDOPPLERVELOCITY)( ALfloat value );
|
|
||||||
typedef void ( *LPALSPEEDOFSOUND)( ALfloat value );
|
|
||||||
typedef void ( *LPALDISTANCEMODEL)( ALenum distanceModel );
|
|
|
@ -1,115 +0,0 @@
|
||||||
/*
|
|
||||||
OpenMW - The completely unofficial reimplementation of Morrowind
|
|
||||||
Copyright (C) 2008 Nicolay Korslund
|
|
||||||
Email: < korslund@gmail.com >
|
|
||||||
WWW: http://openmw.snaptoad.com/
|
|
||||||
|
|
||||||
This file (alc.d) is part of the OpenMW package.
|
|
||||||
|
|
||||||
OpenMW is distributed as free software: you can redistribute it
|
|
||||||
and/or modify it under the terms of the GNU General Public License
|
|
||||||
version 3, as published by the Free Software Foundation.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful, but
|
|
||||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
version 3 along with this program. If not, see
|
|
||||||
http://www.gnu.org/licenses/ .
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
module sound.alc;
|
|
||||||
|
|
||||||
extern(C):
|
|
||||||
|
|
||||||
//Definitions
|
|
||||||
const int ALC_FALSE = 0;
|
|
||||||
const int ALC_TRUE = 1;
|
|
||||||
|
|
||||||
const int ALC_FREQUENCY = 0x1007;
|
|
||||||
const int ALC_REFRESH = 0x1008;
|
|
||||||
const int ALC_SYNC = 0x1009;
|
|
||||||
const int ALC_MONO_SOURCES = 0x1010;
|
|
||||||
const int ALC_STEREO_SOURCES = 0x1011;
|
|
||||||
const int ALC_NO_ERROR = ALC_FALSE;
|
|
||||||
const int ALC_INVALID_DEVICE = 0xA001;
|
|
||||||
const int ALC_INVALID_CONTEXT = 0xA002;
|
|
||||||
const int ALC_INVALID_ENUM = 0xA003;
|
|
||||||
const int ALC_INVALID_VALUE = 0xA004;
|
|
||||||
const int ALC_OUT_OF_MEMORY = 0xA005;
|
|
||||||
const int ALC_DEFAULT_DEVICE_SPECIFIER = 0x1004;
|
|
||||||
const int ALC_DEVICE_SPECIFIER = 0x1005;
|
|
||||||
const int ALC_EXTENSIONS = 0x1006;
|
|
||||||
const int ALC_MAJOR_VERSION = 0x1000;
|
|
||||||
const int ALC_MINOR_VERSION = 0x1001;
|
|
||||||
const int ALC_ATTRIBUTES_SIZE = 0x1002;
|
|
||||||
const int ALC_ALL_ATTRIBUTES = 0x1003;
|
|
||||||
|
|
||||||
const int ALC_CAPTURE_DEVICE_SPECIFIER = 0x310;
|
|
||||||
const int ALC_CAPTURE_DEFAULT_DEVICE_SPECIFIER = 0x311;
|
|
||||||
const int ALC_CAPTURE_SAMPLES = 0x312;
|
|
||||||
|
|
||||||
//Device and context structures
|
|
||||||
alias void ALCdevice;
|
|
||||||
alias void ALCcontext;
|
|
||||||
|
|
||||||
//Typedefs
|
|
||||||
alias char ALCboolean;
|
|
||||||
alias char ALCchar;
|
|
||||||
alias char ALCbyte;
|
|
||||||
alias ubyte ALCubyte;
|
|
||||||
alias short ALCshort;
|
|
||||||
alias ushort ALCushort;
|
|
||||||
alias int ALCint;
|
|
||||||
alias uint ALCuint;
|
|
||||||
alias int ALCsizei;
|
|
||||||
alias int ALCenum;
|
|
||||||
alias float ALCfloat;
|
|
||||||
alias double ALCdouble;
|
|
||||||
alias void ALCvoid;
|
|
||||||
|
|
||||||
//Context functions
|
|
||||||
ALCcontext* alcCreateContext( ALCdevice *device, ALCint* attrlist );
|
|
||||||
ALCboolean alcMakeContextCurrent( ALCcontext *context );
|
|
||||||
void alcProcessContext( ALCcontext *context );
|
|
||||||
void alcSuspendContext( ALCcontext *context );
|
|
||||||
void alcDestroyContext( ALCcontext *context );
|
|
||||||
ALCcontext* alcGetCurrentContext();
|
|
||||||
ALCdevice* alcGetContextsDevice( ALCcontext *context );
|
|
||||||
ALCdevice * alcOpenDevice( ALCchar *devicename );
|
|
||||||
ALCboolean alcCloseDevice( ALCdevice *device );
|
|
||||||
ALCenum alcGetError( ALCdevice *device );
|
|
||||||
ALCboolean alcIsExtensionPresent( ALCdevice *device, ALCchar *extname );
|
|
||||||
void* alcGetProcAddress( ALCdevice *device, ALCchar *funcname );
|
|
||||||
ALCenum alcGetEnumValue( ALCdevice *device, ALCchar *enumname );
|
|
||||||
ALCchar* alcGetString( ALCdevice *device, ALCenum param );
|
|
||||||
void alcGetIntegerv( ALCdevice *device, ALCenum param, ALCsizei size, ALCint *data );
|
|
||||||
ALCdevice* alcCaptureOpenDevice( ALCchar *devicename, ALCuint frequency, ALCenum format, ALCsizei buffersize );
|
|
||||||
ALCboolean alcCaptureCloseDevice( ALCdevice *device );
|
|
||||||
void alcCaptureStart( ALCdevice *device );
|
|
||||||
void alcCaptureStop( ALCdevice *device );
|
|
||||||
void alcCaptureSamples( ALCdevice *device, ALCvoid *buffer, ALCsizei samples );
|
|
||||||
|
|
||||||
typedef ALCcontext * ( *LPALCCREATECONTEXT) (ALCdevice *device, ALCint *attrlist);
|
|
||||||
typedef ALCboolean ( *LPALCMAKECONTEXTCURRENT)( ALCcontext *context );
|
|
||||||
typedef void ( *LPALCPROCESSCONTEXT)( ALCcontext *context );
|
|
||||||
typedef void ( *LPALCSUSPENDCONTEXT)( ALCcontext *context );
|
|
||||||
typedef void ( *LPALCDESTROYCONTEXT)( ALCcontext *context );
|
|
||||||
typedef ALCcontext * ( *LPALCGETCURRENTCONTEXT)( );
|
|
||||||
typedef ALCdevice * ( *LPALCGETCONTEXTSDEVICE)( ALCcontext *context );
|
|
||||||
typedef ALCdevice * ( *LPALCOPENDEVICE)( ALCchar *devicename );
|
|
||||||
typedef ALCboolean ( *LPALCCLOSEDEVICE)( ALCdevice *device );
|
|
||||||
typedef ALCenum ( *LPALCGETERROR)( ALCdevice *device );
|
|
||||||
typedef ALCboolean ( *LPALCISEXTENSIONPRESENT)( ALCdevice *device, ALCchar *extname );
|
|
||||||
typedef void * ( *LPALCGETPROCADDRESS)(ALCdevice *device, ALCchar *funcname );
|
|
||||||
typedef ALCenum ( *LPALCGETENUMVALUE)(ALCdevice *device, ALCchar *enumname );
|
|
||||||
typedef const ALCchar* ( *LPALCGETSTRING)( ALCdevice *device, ALCenum param );
|
|
||||||
typedef void ( *LPALCGETINTEGERV)( ALCdevice *device, ALCenum param, ALCsizei size, ALCint *dest );
|
|
||||||
typedef ALCdevice * ( *LPALCCAPTUREOPENDEVICE)( ALCchar *devicename, ALCuint frequency, ALCenum format, ALCsizei buffersize );
|
|
||||||
typedef ALCboolean ( *LPALCCAPTURECLOSEDEVICE)( ALCdevice *device );
|
|
||||||
typedef void ( *LPALCCAPTURESTART)( ALCdevice *device );
|
|
||||||
typedef void ( *LPALCCAPTURESTOP)( ALCdevice *device );
|
|
||||||
typedef void ( *LPALCCAPTURESAMPLES)( ALCdevice *device, ALCvoid *buffer, ALCsizei samples );
|
|
Loading…
Reference in a new issue