hello world

This commit is contained in:
Timothee 'TTimo' Besset
2011-11-22 15:28:15 -06:00
commit fb1609f554
2155 changed files with 1017022 additions and 0 deletions

336
neo/sys/gllog/gl.api Normal file
View File

@@ -0,0 +1,336 @@
void;qgl;Accum;GLenum op, GLfloat value
void;qgl;AlphaFunc;GLenum func, GLclampf ref
GLboolean;qgl;AreTexturesResident;GLsizei n, const GLuint *textures, GLboolean *residences
void;qgl;ArrayElement;GLint i
void;qgl;Begin;GLenum mode
void;qgl;BindTexture;GLenum target, GLuint texture
void;qgl;Bitmap;GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte *bitmap
void;qgl;BlendFunc;GLenum sfactor, GLenum dfactor
void;qgl;CallList;GLuint list
void;qgl;CallLists;GLsizei n, GLenum type, const GLvoid *lists
void;qgl;Clear;GLbitfield mask
void;qgl;ClearAccum;GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha
void;qgl;ClearColor;GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha
void;qgl;ClearDepth;GLclampd depth
void;qgl;ClearIndex;GLfloat c
void;qgl;ClearStencil;GLint s
void;qgl;ClipPlane;GLenum plane, const GLdouble *equation
void;qgl;Color3b;GLbyte red, GLbyte green, GLbyte blue
void;qgl;Color3bv;const GLbyte *v
void;qgl;Color3d;GLdouble red, GLdouble green, GLdouble blue
void;qgl;Color3dv;const GLdouble *v
void;qgl;Color3f;GLfloat red, GLfloat green, GLfloat blue
void;qgl;Color3fv;const GLfloat *v
void;qgl;Color3i;GLint red, GLint green, GLint blue
void;qgl;Color3iv;const GLint *v
void;qgl;Color3s;GLshort red, GLshort green, GLshort blue
void;qgl;Color3sv;const GLshort *v
void;qgl;Color3ub;GLubyte red, GLubyte green, GLubyte blue
void;qgl;Color3ubv;const GLubyte *v
void;qgl;Color3ui;GLuint red, GLuint green, GLuint blue
void;qgl;Color3uiv;const GLuint *v
void;qgl;Color3us;GLushort red, GLushort green, GLushort blue
void;qgl;Color3usv;const GLushort *v
void;qgl;Color4b;GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha
void;qgl;Color4bv;const GLbyte *v
void;qgl;Color4d;GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha
void;qgl;Color4dv;const GLdouble *v
void;qgl;Color4f;GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha
void;qgl;Color4fv;const GLfloat *v
void;qgl;Color4i;GLint red, GLint green, GLint blue, GLint alpha
void;qgl;Color4iv;const GLint *v
void;qgl;Color4s;GLshort red, GLshort green, GLshort blue, GLshort alpha
void;qgl;Color4sv;const GLshort *v
void;qgl;Color4ub;GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha
void;qgl;Color4ubv;const GLubyte *v
void;qgl;Color4ui;GLuint red, GLuint green, GLuint blue, GLuint alpha
void;qgl;Color4uiv;const GLuint *v
void;qgl;Color4us;GLushort red, GLushort green, GLushort blue, GLushort alpha
void;qgl;Color4usv;const GLushort *v
void;qgl;ColorMask;GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha
void;qgl;ColorMaterial;GLenum face, GLenum mode
void;qgl;ColorPointer;GLint size, GLenum type, GLsizei stride, const GLvoid *pointer
void;qgl;CopyPixels;GLint x, GLint y, GLsizei width, GLsizei height, GLenum type
void;qgl;CopyTexImage1D;GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLint border
void;qgl;CopyTexImage2D;GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border
void;qgl;CopyTexSubImage1D;GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width
void;qgl;CopyTexSubImage2D;GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height
void;qgl;CullFace;GLenum mode
void;qgl;DeleteLists;GLuint list, GLsizei range
void;qgl;DeleteTextures;GLsizei n, const GLuint *textures
void;qgl;DepthFunc;GLenum func
void;qgl;DepthMask;GLboolean flag
void;qgl;DepthRange;GLclampd zNear, GLclampd zFar
void;qgl;Disable;GLenum cap
void;qgl;DisableClientState;GLenum array
void;qgl;DrawArrays;GLenum mode, GLint first, GLsizei count
void;qgl;DrawBuffer;GLenum mode
void;qgl;DrawElements;GLenum mode, GLsizei count, GLenum type, const GLvoid *indices
void;qgl;DrawPixels;GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels
void;qgl;EdgeFlag;GLboolean flag
void;qgl;EdgeFlagPointer;GLsizei stride, const GLvoid *pointer
void;qgl;EdgeFlagv;const GLboolean *flag
void;qgl;Enable;GLenum cap
void;qgl;EnableClientState;GLenum array
void;qgl;End;void
void;qgl;EndList;void
void;qgl;EvalCoord1d;GLdouble u
void;qgl;EvalCoord1dv;const GLdouble *u
void;qgl;EvalCoord1f;GLfloat u
void;qgl;EvalCoord1fv;const GLfloat *u
void;qgl;EvalCoord2d;GLdouble u, GLdouble v
void;qgl;EvalCoord2dv;const GLdouble *u
void;qgl;EvalCoord2f;GLfloat u, GLfloat v
void;qgl;EvalCoord2fv;const GLfloat *u
void;qgl;EvalMesh1;GLenum mode, GLint i1, GLint i2
void;qgl;EvalMesh2;GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2
void;qgl;EvalPoint1;GLint i
void;qgl;EvalPoint2;GLint i, GLint j
void;qgl;FeedbackBuffer;GLsizei size, GLenum type, GLfloat *buffer
void;qgl;Finish;void
void;qgl;Flush;void
void;qgl;Fogf;GLenum pname, GLfloat param
void;qgl;Fogfv;GLenum pname, const GLfloat *params
void;qgl;Fogi;GLenum pname, GLint param
void;qgl;Fogiv;GLenum pname, const GLint *params
void;qgl;FrontFace;GLenum mode
void;qgl;Frustum;GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar
GLuint;qgl;GenLists;GLsizei range
void;qgl;GenTextures;GLsizei n, GLuint *textures
void;qgl;GetBooleanv;GLenum pname, GLboolean *params
void;qgl;GetClipPlane;GLenum plane, GLdouble *equation
void;qgl;GetDoublev;GLenum pname, GLdouble *params
GLenum;qgl;GetError;void
void;qgl;GetFloatv;GLenum pname, GLfloat *params
void;qgl;GetIntegerv;GLenum pname, GLint *params
void;qgl;GetLightfv;GLenum light, GLenum pname, GLfloat *params
void;qgl;GetLightiv;GLenum light, GLenum pname, GLint *params
void;qgl;GetMapdv;GLenum target, GLenum query, GLdouble *v
void;qgl;GetMapfv;GLenum target, GLenum query, GLfloat *v
void;qgl;GetMapiv;GLenum target, GLenum query, GLint *v
void;qgl;GetMaterialfv;GLenum face, GLenum pname, GLfloat *params
void;qgl;GetMaterialiv;GLenum face, GLenum pname, GLint *params
void;qgl;GetPixelMapfv;GLenum map, GLfloat *values
void;qgl;GetPixelMapuiv;GLenum map, GLuint *values
void;qgl;GetPixelMapusv;GLenum map, GLushort *values
void;qgl;GetPointerv;GLenum pname, GLvoid* *params
void;qgl;GetPolygonStipple;GLubyte *mask
const GLubyte *;qgl;GetString;GLenum name
void;qgl;GetTexEnvfv;GLenum target, GLenum pname, GLfloat *params
void;qgl;GetTexEnviv;GLenum target, GLenum pname, GLint *params
void;qgl;GetTexGendv;GLenum coord, GLenum pname, GLdouble *params
void;qgl;GetTexGenfv;GLenum coord, GLenum pname, GLfloat *params
void;qgl;GetTexGeniv;GLenum coord, GLenum pname, GLint *params
void;qgl;GetTexImage;GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels
void;qgl;GetTexLevelParameterfv;GLenum target, GLint level, GLenum pname, GLfloat *params
void;qgl;GetTexLevelParameteriv;GLenum target, GLint level, GLenum pname, GLint *params
void;qgl;GetTexParameterfv;GLenum target, GLenum pname, GLfloat *params
void;qgl;GetTexParameteriv;GLenum target, GLenum pname, GLint *params
void;qgl;Hint;GLenum target, GLenum mode
void;qgl;IndexMask;GLuint mask
void;qgl;IndexPointer;GLenum type, GLsizei stride, const GLvoid *pointer
void;qgl;Indexd;GLdouble c
void;qgl;Indexdv;const GLdouble *c
void;qgl;Indexf;GLfloat c
void;qgl;Indexfv;const GLfloat *c
void;qgl;Indexi;GLint c
void;qgl;Indexiv;const GLint *c
void;qgl;Indexs;GLshort c
void;qgl;Indexsv;const GLshort *c
void;qgl;Indexub;GLubyte c
void;qgl;Indexubv;const GLubyte *c
void;qgl;InitNames;void
void;qgl;InterleavedArrays;GLenum format, GLsizei stride, const GLvoid *pointer
GLboolean;qgl;IsEnabled;GLenum cap
GLboolean;qgl;IsList;GLuint list
GLboolean;qgl;IsTexture;GLuint texture
void;qgl;LightModelf;GLenum pname, GLfloat param
void;qgl;LightModelfv;GLenum pname, const GLfloat *params
void;qgl;LightModeli;GLenum pname, GLint param
void;qgl;LightModeliv;GLenum pname, const GLint *params
void;qgl;Lightf;GLenum light, GLenum pname, GLfloat param
void;qgl;Lightfv;GLenum light, GLenum pname, const GLfloat *params
void;qgl;Lighti;GLenum light, GLenum pname, GLint param
void;qgl;Lightiv;GLenum light, GLenum pname, const GLint *params
void;qgl;LineStipple;GLint factor, GLushort pattern
void;qgl;LineWidth;GLfloat width
void;qgl;ListBase;GLuint base
void;qgl;LoadIdentity;void
void;qgl;LoadMatrixd;const GLdouble *m
void;qgl;LoadMatrixf;const GLfloat *m
void;qgl;LoadName;GLuint name
void;qgl;LogicOp;GLenum opcode
void;qgl;Map1d;GLenum target, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *points
void;qgl;Map1f;GLenum target, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat *points
void;qgl;Map2d;GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble *points
void;qgl;Map2f;GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat *points
void;qgl;MapGrid1d;GLint un, GLdouble u1, GLdouble u2
void;qgl;MapGrid1f;GLint un, GLfloat u1, GLfloat u2
void;qgl;MapGrid2d;GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2
void;qgl;MapGrid2f;GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2
void;qgl;Materialf;GLenum face, GLenum pname, GLfloat param
void;qgl;Materialfv;GLenum face, GLenum pname, const GLfloat *params
void;qgl;Materiali;GLenum face, GLenum pname, GLint param
void;qgl;Materialiv;GLenum face, GLenum pname, const GLint *params
void;qgl;MatrixMode;GLenum mode
void;qgl;MultMatrixd;const GLdouble *m
void;qgl;MultMatrixf;const GLfloat *m
void;qgl;NewList;GLuint list, GLenum mode
void;qgl;Normal3b;GLbyte nx, GLbyte ny, GLbyte nz
void;qgl;Normal3bv;const GLbyte *v
void;qgl;Normal3d;GLdouble nx, GLdouble ny, GLdouble nz
void;qgl;Normal3dv;const GLdouble *v
void;qgl;Normal3f;GLfloat nx, GLfloat ny, GLfloat nz
void;qgl;Normal3fv;const GLfloat *v
void;qgl;Normal3i;GLint nx, GLint ny, GLint nz
void;qgl;Normal3iv;const GLint *v
void;qgl;Normal3s;GLshort nx, GLshort ny, GLshort nz
void;qgl;Normal3sv;const GLshort *v
void;qgl;NormalPointer;GLenum type, GLsizei stride, const GLvoid *pointer
void;qgl;Ortho;GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar
void;qgl;PassThrough;GLfloat token
void;qgl;PixelMapfv;GLenum map, GLsizei mapsize, const GLfloat *values
void;qgl;PixelMapuiv;GLenum map, GLsizei mapsize, const GLuint *values
void;qgl;PixelMapusv;GLenum map, GLsizei mapsize, const GLushort *values
void;qgl;PixelStoref;GLenum pname, GLfloat param
void;qgl;PixelStorei;GLenum pname, GLint param
void;qgl;PixelTransferf;GLenum pname, GLfloat param
void;qgl;PixelTransferi;GLenum pname, GLint param
void;qgl;PixelZoom;GLfloat xfactor, GLfloat yfactor
void;qgl;PointSize;GLfloat size
void;qgl;PolygonMode;GLenum face, GLenum mode
void;qgl;PolygonOffset;GLfloat factor, GLfloat units
void;qgl;PolygonStipple;const GLubyte *mask
void;qgl;PopAttrib;void
void;qgl;PopClientAttrib;void
void;qgl;PopMatrix;void
void;qgl;PopName;void
void;qgl;PrioritizeTextures;GLsizei n, const GLuint *textures, const GLclampf *priorities
void;qgl;PushAttrib;GLbitfield mask
void;qgl;PushClientAttrib;GLbitfield mask
void;qgl;PushMatrix;void
void;qgl;PushName;GLuint name
void;qgl;RasterPos2d;GLdouble x, GLdouble y
void;qgl;RasterPos2dv;const GLdouble *v
void;qgl;RasterPos2f;GLfloat x, GLfloat y
void;qgl;RasterPos2fv;const GLfloat *v
void;qgl;RasterPos2i;GLint x, GLint y
void;qgl;RasterPos2iv;const GLint *v
void;qgl;RasterPos2s;GLshort x, GLshort y
void;qgl;RasterPos2sv;const GLshort *v
void;qgl;RasterPos3d;GLdouble x, GLdouble y, GLdouble z
void;qgl;RasterPos3dv;const GLdouble *v
void;qgl;RasterPos3f;GLfloat x, GLfloat y, GLfloat z
void;qgl;RasterPos3fv;const GLfloat *v
void;qgl;RasterPos3i;GLint x, GLint y, GLint z
void;qgl;RasterPos3iv;const GLint *v
void;qgl;RasterPos3s;GLshort x, GLshort y, GLshort z
void;qgl;RasterPos3sv;const GLshort *v
void;qgl;RasterPos4d;GLdouble x, GLdouble y, GLdouble z, GLdouble w
void;qgl;RasterPos4dv;const GLdouble *v
void;qgl;RasterPos4f;GLfloat x, GLfloat y, GLfloat z, GLfloat w
void;qgl;RasterPos4fv;const GLfloat *v
void;qgl;RasterPos4i;GLint x, GLint y, GLint z, GLint w
void;qgl;RasterPos4iv;const GLint *v
void;qgl;RasterPos4s;GLshort x, GLshort y, GLshort z, GLshort w
void;qgl;RasterPos4sv;const GLshort *v
void;qgl;ReadBuffer;GLenum mode
void;qgl;ReadPixels;GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels
void;qgl;Rectd;GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2
void;qgl;Rectdv;const GLdouble *v1, const GLdouble *v2
void;qgl;Rectf;GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2
void;qgl;Rectfv;const GLfloat *v1, const GLfloat *v2
void;qgl;Recti;GLint x1, GLint y1, GLint x2, GLint y2
void;qgl;Rectiv;const GLint *v1, const GLint *v2
void;qgl;Rects;GLshort x1, GLshort y1, GLshort x2, GLshort y2
void;qgl;Rectsv;const GLshort *v1, const GLshort *v2
GLint;qgl;RenderMode;GLenum mode
void;qgl;Rotated;GLdouble angle, GLdouble x, GLdouble y, GLdouble z
void;qgl;Rotatef;GLfloat angle, GLfloat x, GLfloat y, GLfloat z
void;qgl;Scaled;GLdouble x, GLdouble y, GLdouble z
void;qgl;Scalef;GLfloat x, GLfloat y, GLfloat z
void;qgl;Scissor;GLint x, GLint y, GLsizei width, GLsizei height
void;qgl;SelectBuffer;GLsizei size, GLuint *buffer
void;qgl;ShadeModel;GLenum mode
void;qgl;StencilFunc;GLenum func, GLint ref, GLuint mask
void;qgl;StencilMask;GLuint mask
void;qgl;StencilOp;GLenum fail, GLenum zfail, GLenum zpass
void;qgl;TexCoord1d;GLdouble s
void;qgl;TexCoord1dv;const GLdouble *v
void;qgl;TexCoord1f;GLfloat s
void;qgl;TexCoord1fv;const GLfloat *v
void;qgl;TexCoord1i;GLint s
void;qgl;TexCoord1iv;const GLint *v
void;qgl;TexCoord1s;GLshort s
void;qgl;TexCoord1sv;const GLshort *v
void;qgl;TexCoord2d;GLdouble s, GLdouble t
void;qgl;TexCoord2dv;const GLdouble *v
void;qgl;TexCoord2f;GLfloat s, GLfloat t
void;qgl;TexCoord2fv;const GLfloat *v
void;qgl;TexCoord2i;GLint s, GLint t
void;qgl;TexCoord2iv;const GLint *v
void;qgl;TexCoord2s;GLshort s, GLshort t
void;qgl;TexCoord2sv;const GLshort *v
void;qgl;TexCoord3d;GLdouble s, GLdouble t, GLdouble r
void;qgl;TexCoord3dv;const GLdouble *v
void;qgl;TexCoord3f;GLfloat s, GLfloat t, GLfloat r
void;qgl;TexCoord3fv;const GLfloat *v
void;qgl;TexCoord3i;GLint s, GLint t, GLint r
void;qgl;TexCoord3iv;const GLint *v
void;qgl;TexCoord3s;GLshort s, GLshort t, GLshort r
void;qgl;TexCoord3sv;const GLshort *v
void;qgl;TexCoord4d;GLdouble s, GLdouble t, GLdouble r, GLdouble q
void;qgl;TexCoord4dv;const GLdouble *v
void;qgl;TexCoord4f;GLfloat s, GLfloat t, GLfloat r, GLfloat q
void;qgl;TexCoord4fv;const GLfloat *v
void;qgl;TexCoord4i;GLint s, GLint t, GLint r, GLint q
void;qgl;TexCoord4iv;const GLint *v
void;qgl;TexCoord4s;GLshort s, GLshort t, GLshort r, GLshort q
void;qgl;TexCoord4sv;const GLshort *v
void;qgl;TexCoordPointer;GLint size, GLenum type, GLsizei stride, const GLvoid *pointer
void;qgl;TexEnvf;GLenum target, GLenum pname, GLfloat param
void;qgl;TexEnvfv;GLenum target, GLenum pname, const GLfloat *params
void;qgl;TexEnvi;GLenum target, GLenum pname, GLint param
void;qgl;TexEnviv;GLenum target, GLenum pname, const GLint *params
void;qgl;TexGend;GLenum coord, GLenum pname, GLdouble param
void;qgl;TexGendv;GLenum coord, GLenum pname, const GLdouble *params
void;qgl;TexGenf;GLenum coord, GLenum pname, GLfloat param
void;qgl;TexGenfv;GLenum coord, GLenum pname, const GLfloat *params
void;qgl;TexGeni;GLenum coord, GLenum pname, GLint param
void;qgl;TexGeniv;GLenum coord, GLenum pname, const GLint *params
void;qgl;TexImage1D;GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels
void;qgl;TexImage2D;GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels
void;qgl;TexParameterf;GLenum target, GLenum pname, GLfloat param
void;qgl;TexParameterfv;GLenum target, GLenum pname, const GLfloat *params
void;qgl;TexParameteri;GLenum target, GLenum pname, GLint param
void;qgl;TexParameteriv;GLenum target, GLenum pname, const GLint *params
void;qgl;TexSubImage1D;GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels
void;qgl;TexSubImage2D;GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels
void;qgl;Translated;GLdouble x, GLdouble y, GLdouble z
void;qgl;Translatef;GLfloat x, GLfloat y, GLfloat z
void;qgl;Vertex2d;GLdouble x, GLdouble y
void;qgl;Vertex2dv;const GLdouble *v
void;qgl;Vertex2f;GLfloat x, GLfloat y
void;qgl;Vertex2fv;const GLfloat *v
void;qgl;Vertex2i;GLint x, GLint y
void;qgl;Vertex2iv;const GLint *v
void;qgl;Vertex2s;GLshort x, GLshort y
void;qgl;Vertex2sv;const GLshort *v
void;qgl;Vertex3d;GLdouble x, GLdouble y, GLdouble z
void;qgl;Vertex3dv;const GLdouble *v
void;qgl;Vertex3f;GLfloat x, GLfloat y, GLfloat z
void;qgl;Vertex3fv;const GLfloat *v
void;qgl;Vertex3i;GLint x, GLint y, GLint z
void;qgl;Vertex3iv;const GLint *v
void;qgl;Vertex3s;GLshort x, GLshort y, GLshort z
void;qgl;Vertex3sv;const GLshort *v
void;qgl;Vertex4d;GLdouble x, GLdouble y, GLdouble z, GLdouble w
void;qgl;Vertex4dv;const GLdouble *v
void;qgl;Vertex4f;GLfloat x, GLfloat y, GLfloat z, GLfloat w
void;qgl;Vertex4fv;const GLfloat *v
void;qgl;Vertex4i;GLint x, GLint y, GLint z, GLint w
void;qgl;Vertex4iv;const GLint *v
void;qgl;Vertex4s;GLshort x, GLshort y, GLshort z, GLshort w
void;qgl;Vertex4sv;const GLshort *v
void;qgl;VertexPointer;GLint size, GLenum type, GLsizei stride, const GLvoid *pointer
void;qgl;Viewport;GLint x, GLint y, GLsizei width, GLsizei height

6
neo/sys/gllog/glX.api Normal file
View File

@@ -0,0 +1,6 @@
XVisualInfo *;qglX;ChooseVisual;Display *dpy, int screen, int *attribList
GLXContext;qglX;CreateContext;Display *dpy, XVisualInfo *vis, GLXContext shareList, Bool direct
void;qglX;DestroyContext;Display *dpy, GLXContext ctx
Bool;qglX;MakeCurrent;Display *dpy, GLXDrawable drawable, GLXContext ctx
void;qglX;SwapBuffers;Display *dpy, GLXDrawable drawable
GLExtension_t;qglX;GetProcAddressARB;const GLubyte *procName

1099
neo/sys/gllog/gl_def.m4 Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,61 @@
#include "idlib/precompiled.h"
#pragma hdrstop
dnl =====================================================
dnl utils
dnl =====================================================
define(`forloop',
`pushdef(`$1', `$2')_forloop(`$1', `$2', `$3', `$4')popdef(`$1')')
define(`_forloop',
`$4`'ifelse($1, `$3', ,
`define(`$1', incr($1))_forloop(`$1', `$2', `$3', `$4')')')
dnl =====================================================
dnl GL extensions
dnl =====================================================
typedef struct {
const char *ext_name;
} glExtName_t;
glExtName_t glExtNames[] = {
NULL
};
static void StubFunction( void ) { }
GLExtension_t GLimp_ExtensionPointer( const char *name ) {
if ( strstr( name, "wgl" ) == name ) {
common->DPrintf( "WARNING: GLimp_ExtensionPointer for '%s'\n", name );
}
#ifdef ID_DEDICATED
common->Printf("GLimp_ExtensionPointer %s\n", name);
return StubFunction;
#else
#if 0
glExtName_t *n;
for ( n = glExtNames ; n->ext_name ; n++ ) {
if ( !strcmp( name, n->ext_name ) ) {
common->DPrintf("matched GL extension: %s\n", name );
break;
}
}
if ( ! n->ext_name ) {
common->DPrintf("unmatched GL extension name: %s\n", name );
}
#endif
GLExtension_t ret;
#if defined(__linux__)
// for some reason glXGetProcAddressARB doesn't work on RH9?
ret = qglXGetProcAddressARB((const GLubyte *) name);
if ( !ret ) {
common->Printf("glXGetProcAddressARB failed: \"%s\"\n", name);
return StubFunction;
}
#else
#error Need OS define
#endif
return ret;
#endif
}

75
neo/sys/gllog/logfunc.py Normal file
View File

@@ -0,0 +1,75 @@
#!/usr/bin/env python
# generate logging code
# this requires an analysis of the parameters for verbose and do actual call
import sys, string, re
from read import read_gl
def do_logfunc(f_in, f_out):
(gl, wgl, glX) = read_gl(f_in)
for l in (gl, glX):
for t in l:
# process ret type to strip trailing spaces
t[0] = string.strip(t[0])
f_out.write('static %s APIENTRY log%s(%s) {\n' % ( t[0], t[2], t[3] ))
# work on parameters
base_params = string.split(t[3], ',')
#f_out.write('// %s\n' % repr(base_params))
# init format string and parameter list
params = []
format = t[1][1:] + t[2]
# a general help list
types = []
names = []
for i in base_params:
regex = re.compile('([a-zA-Z0-9]*)$')
name = regex.search(i).group(1)
type = string.strip(i[0:len(i)-len(name)])
# catch type with no name
if (len(type) == 0):
type = name
name = ''
#f_out.write('// type: "%s" name: "%s"\n' % (type, name))
types.append(type)
names.append(name)
# verbose the types
if (type == 'GLenum'):
format += ' %s'
params.append( 'EnumString(' + name + ')' )
elif (type == 'GLfloat' or type == 'GLclampf' or type == 'GLdouble'):
format += ' %g'
params.append( name )
elif (type == 'GLint' or type == 'GLuint' or type == 'GLsizei' or type == 'GLbyte' or type == 'GLshort'
or type == 'GLubyte' or type == 'GLushort'):
format += ' %d'
params.append( name )
elif (type == 'GLboolean'):
format += ' %s'
params.append( name + ' ? "Y" : "N"' )
elif (type == 'void'):
pass
else:
f_out.write('// unknown type: "%s" name: "%s"\n' % (type, name))
format += ' \'' + type + ' ' + name + '\''
f_out.write('\tfprintf( tr.logFile, "' + format + '\\n"')
for par in params:
f_out.write(', ' + par)
f_out.write(' );\n')
if (t[0] != 'void'):
f_out.write('\treturn dll%s(' % t[2])
else:
f_out.write('\tdll%s(' % t[2])
started = 0
for i in names:
if (started):
f_out.write(', ')
else:
started = 1
f_out.write(i)
f_out.write(');\n')
f_out.write('}\n\n')
if __name__ == '__main__':
do_logfunc(sys.stdin, sys.stdout)

26
neo/sys/gllog/read.py Normal file
View File

@@ -0,0 +1,26 @@
# utility module to process incoming GL description
import sys, string
def read_gl(f_in):
buffer = f_in.read()
lines = string.split(buffer, '\n')
gl = []
wgl = []
glX = []
for line in lines:
if ( len(line) ): # drop empty lines
tokens = string.split(line, ';')
if ( tokens[1] == 'qgl' ):
gl.append(tokens)
elif ( tokens[1] == 'qwgl' ):
wgl.append(tokens)
elif ( tokens[1] == 'qglX' ):
glX.append(tokens)
else:
sys.stderr.write('ERROR: unknown type %s\n' % tokens[1])
raise "abort"
return (gl, wgl, glX)

22
neo/sys/gllog/wgl.api Normal file
View File

@@ -0,0 +1,22 @@
int ;qwgl;SwapIntervalEXT; int interval
int ;qwgl;ChoosePixelFormat ;HDC, CONST PIXELFORMATDESCRIPTOR *
int ;qwgl;DescribePixelFormat;HDC, int, UINT, LPPIXELFORMATDESCRIPTOR
int ;qwgl;GetPixelFormat;HDC
BOOL ;qwgl;SetPixelFormat;HDC, int, CONST PIXELFORMATDESCRIPTOR *
BOOL ;qwgl;SwapBuffers;HDC
BOOL ;qwgl;CopyContext;HGLRC, HGLRC, UINT
HGLRC ;qwgl;CreateContext;HDC
HGLRC ;qwgl;CreateLayerContext;HDC, int
BOOL ;qwgl;DeleteContext;HGLRC
HGLRC ;qwgl;GetCurrentContext;VOID
HDC ;qwgl;GetCurrentDC;VOID
PROC ;qwgl;GetProcAddress;LPCSTR
BOOL ;qwgl;MakeCurrent;HDC, HGLRC
BOOL ;qwgl;ShareLists;HGLRC, HGLRC
BOOL ;qwgl;UseFontBitmaps;HDC, DWORD, DWORD, DWORD
BOOL ;qwgl;UseFontOutlines;HDC, DWORD, DWORD, DWORD, FLOAT, FLOAT, int, LPGLYPHMETRICSFLOAT
BOOL ;qwgl;DescribeLayerPlane;HDC, int, int, UINT, LPLAYERPLANEDESCRIPTOR
int ;qwgl;SetLayerPaletteEntries;HDC, int, int, int, CONST COLORREF *
int ;qwgl;GetLayerPaletteEntries;HDC, int, int, int, COLORREF *
BOOL ;qwgl;RealizeLayerPalette;HDC, int, BOOL
BOOL ;qwgl;SwapLayerBuffers;HDC, UINT

View File

@@ -0,0 +1,557 @@
378c21cf872ef830445ce18b3d3348f8 *base/animation/mp_greenarmor.md5mesh
7f9b7629c712056e48ceac9dadb16224 *base/animation/mp_jumpsuit.md5mesh
caf59e47ec1988d81fdcc3c8aeb8981f *base/animation/mp_labcoat.md5mesh
3982a493fe0da57c13e96fc8e1d6a795 *base/animation/mp_security.md5mesh
c23ac9aeb96d3ef55595c7d668d948cd *base/animation/mp_soldier.md5mesh
24046a3a459bf42fd1ea555d0b75fdfc *base/animation/mp_suit.md5mesh
6509fbcd1ce02e81bf0f95954405bea4 *base/animation/mp_tshirt.md5mesh
683d3f4c114f803873775a559a43a7c1 *base/def/npcs_as_player.def
20729461e1831236acae7ca5b73b0319 *base/maps/fred/cyberdemon/monster_wakeups.mb
2d7df07f33ffbacaf16c51942524b55c *base/maps/fred/underground/impintro.mb
fce124d3f5d717eee4a7d89ad02eca7a *base/maps/fred/underground/impscurry.mb
b60db9fae92e89f9b5cc25cd0a4253f6 *base/maps/fred/underground/impstairs.mb
185553b6f3ab20b1994f07798cd0a156 *base/models/monsters/imp/animation/cycles/alert_walk.ma
b20bf698a63d5eb0a876f1d41b47aaae *base/models/monsters/imp/animation/cycles/crouched_range1.ma
34c73f22a4a1eeee9bb4eae68688917b *base/models/monsters/imp/animation/cycles/evade_left.ma
76ff5398bcf1aebb08641bc5dfacd716 *base/models/monsters/imp/animation/cycles/evade_left_on4.ma
81203ea3773a820074b2fbc2c2e17e37 *base/models/monsters/imp/animation/cycles/evade_right.ma
a05cba4afb38f709eede99fc8b7fdf83 *base/models/monsters/imp/animation/cycles/evade_right_on4.ma
9ce3fb5c02f00f004c13da995ac8e51f *base/models/monsters/imp/animation/cycles/faster_walk.ma
3d960bbfb56e51ca9735905d49d83c3a *base/models/monsters/imp/animation/cycles/fireball_sight.ma
0779e202728e8b80a48d950bbf74c4e0 *base/models/monsters/imp/animation/cycles/hangonceiling.ma
7fcfc63044c8111485813efe6af5b066 *base/models/monsters/imp/animation/cycles/idle1.ma
110661e6211291d098bace0a26f1a483 *base/models/monsters/imp/animation/cycles/imp.mb
cd0971e695d81001820e9222313a4955 *base/models/monsters/imp/animation/cycles/initial.ma
6ec1b1abe0c585726636149f54f8e9dc *base/models/monsters/imp/animation/cycles/jump_loop.ma
6be7606a2cb7135eed7b583145d0f572 *base/models/monsters/imp/animation/cycles/jump_loop2.ma
e8ae6eb85a5bfe7a9190dbf3279d4ea1 *base/models/monsters/imp/animation/cycles/jump_loop3.ma
6412062ceb0cd3256cc78e49c2e4909a *base/models/monsters/imp/animation/cycles/offwall.ma
ab814d600992f29204655e3415971e3e *base/models/monsters/imp/animation/cycles/on4_idle.ma
b54f250dd00b0b9b24c31c6b14871629 *base/models/monsters/imp/animation/cycles/on4_melee1.ma
64dd04c941a7a7f174583d34d035eebc *base/models/monsters/imp/animation/cycles/on4_melee2.ma
ec39d4020b208de213f56c095c0406d3 *base/models/monsters/imp/animation/cycles/on4_sight.ma
b9133fba76754d0691e31c788d33dcd7 *base/models/monsters/imp/animation/cycles/outofhole.ma
75f00d3a2077f0b9378424fd64cadc1d *base/models/monsters/imp/animation/cycles/pain3.ma
c0cf15bd8e7b331118f3f2a253c8d1a6 *base/models/monsters/imp/animation/cycles/pain_chest.ma
4f3b231d9c0dd5bc144f91aaefa95f9d *base/models/monsters/imp/animation/cycles/pain_chest_on4.ma
a3fda68e30e70c7de009f008832cc849 *base/models/monsters/imp/animation/cycles/pain_head.ma
ebab78e4555f5ce417e7a918b857a299 *base/models/monsters/imp/animation/cycles/pain_head_on4.ma
6a2da31bf0ab40750d93f4f334432271 *base/models/monsters/imp/animation/cycles/pain_luparm.ma
4277b9a5f30f28106f0fd4fadd008d03 *base/models/monsters/imp/animation/cycles/pain_luparm_on4.ma
506a7b9b631f70afcab174b4df6672d2 *base/models/monsters/imp/animation/cycles/pain_ruparm.ma
d72684a507481948165939c762a94d14 *base/models/monsters/imp/animation/cycles/pain_ruparm_on4.ma
2d5f4a7997cfbffd9a9f3aaa93b8cb96 *base/models/monsters/imp/animation/cycles/range1.ma
4a18cb9d675f4fdb20f31bc34d0f126c *base/models/monsters/imp/animation/cycles/range2.ma
e56ceccbeb0b39929e69792e6ca493cd *base/models/monsters/imp/animation/cycles/range3.ma
93d4ee499d9d183e44db78cb49d76128 *base/models/monsters/imp/animation/cycles/run.ma
7d8b78d2414c775e0718857ade6d607c *base/models/monsters/imp/animation/cycles/scurry2.ma
51b92152e848f5df97d37ba1e5ea4937 *base/models/monsters/imp/animation/cycles/scurry_leap2.ma
ef071d4959c55540bf28ec90408537bb *base/models/monsters/imp/animation/cycles/sight.ma
44b4b5bebf62d8a7b5173593dfc2ad9d *base/models/monsters/imp/animation/cycles/sight2.ma
e0eeef3455d1dabcc924c328b24ec236 *base/models/monsters/imp/animation/cycles/slash1.ma
2490f2dab58229e1d37bfe27201c94ac *base/models/monsters/imp/animation/cycles/slash2.ma
7c59693fba6b19053042c65cc8424491 *base/models/monsters/imp/animation/cycles/slash3.ma
db049810b1429fcf53ac482fe1b0fd4c *base/models/monsters/imp/animation/cycles/teleportin.ma
f82822c0fe0b8ddb287af934259d98e9 *base/models/monsters/imp/animation/cycles/turret_attack1.ma
b8828a357c293183b3a6bcec9a8d594e *base/models/monsters/imp/animation/cycles/turret_idle.ma
75b85d1dd46885051553df964e0e8dad *base/models/monsters/imp/fred/imp_setup.mb
fc2e0afe9f6e596709c8635035105697 *base/models/monsters/imp/fred/imp_setup_ik.mb
2645732cd30bfd33309e4b801e74971c *base/models/weapons/machinegun/cycles/empty.ma
162eee06b15fffaabbc267f72f66ad7c *base/models/weapons/machinegun/cycles/fire1.ma
799523e4fb25e9f97e2bc197f1c783b9 *base/models/weapons/machinegun/cycles/fire2.ma
2f8536ac728bb97e163b7fcc3669ba44 *base/models/weapons/machinegun/cycles/fire4.ma
8ccb8b80b363da587015fcce7167f526 *base/models/weapons/machinegun/cycles/idle1.ma
2553b66bdb33e6bd85a1d7bccd936237 *base/models/weapons/machinegun/cycles/pullup1.ma
c703ec87330cdc52d4bad4dd2aac7de7 *base/models/weapons/machinegun/cycles/putaway.ma
4e9a4ba4caa2e209c66761ffe9f6cd8c *base/models/weapons/machinegun/cycles/reload1.ma
6b19b0dbd4bb6554b9b449713d4fd102 *base/models/weapons/machinegun/fred/setup1.mb
326a538229b875b8a9f5506c2bffe4f6 *EULA.Development Kit.rtf
9380e8d182dbf689d65399c090d536b1 *MayaImportx86_Maya45.zip
28fadd7a28667156d79e93c063bf7252 *MayaImportx86_Maya50.zip
ff7e2e1bffcb4283f7333d43e722f02e *MayaImportx86_Maya60.zip
bf55402b75174f2f5a9f4edfea7726ee *src/cm/CollisionModel.h
8f16a997da6fb272f981af6b975b83cc *src/D3Game.sln
6a7b0e721547e7eea469def7bb1020bd *src/D3Game.vcproj
609ef5002dfcd7a4dbbd65fc98985771 *src/d3xp/Actor.cpp
e021ebde2e2c285c1098b47b9c3fd752 *src/d3xp/Actor.h
8ee17110c7f42eecfc7b17d8dce8a896 *src/d3xp/AF.cpp
ec286d2cf851db847021795908d27c12 *src/d3xp/AF.h
be96bde8ab623fba6fed2d7bfef69972 *src/d3xp/AFEntity.cpp
3df4135723036359306ab6f5b70c5b2a *src/d3xp/AFEntity.h
f03ba687f94f1ffb13ac814486de2340 *src/d3xp/ai/AAS.cpp
3ee992286f1b1641cdcfc6d443b99d14 *src/d3xp/ai/AAS.h
8035de9626e57d12c848b77546feccb3 *src/d3xp/ai/AAS_debug.cpp
6c2876fc8190a0d3f3789b1577c45ec1 *src/d3xp/ai/AAS_local.h
b1823e1aad4d2261f9d5d9bc06d5a95f *src/d3xp/ai/AAS_pathing.cpp
62fe990c48174e83fdaeeaf63f58d07a *src/d3xp/ai/AAS_routing.cpp
3a52b74d73d3c7f6075a2c0653a995cb *src/d3xp/ai/AI.cpp
923f30cfee35f577ce6ddb6352c2a395 *src/d3xp/ai/AI.h
642add3259a90045d8c2cf8825ebecc9 *src/d3xp/ai/AI_events.cpp
675d4dbfab5c332c53313d9d9e7ec4d4 *src/d3xp/ai/AI_pathing.cpp
a730df35afccadc7382d140ee28b3aea *src/d3xp/ai/AI_Vagary.cpp
b8bc423a3369d61df9b9b7bc22a7ebd9 *src/d3xp/anim/Anim.cpp
f0d3778c1f07cdd3597dc2e92083e8b2 *src/d3xp/anim/Anim.h
76dc3f6619db3a662c3b48f7cb35a748 *src/d3xp/anim/Anim_Blend.cpp
9e8f6846e171fceb6bbc91a59f8a4b38 *src/d3xp/anim/Anim_Import.cpp
5eaee1875ce7dcf2c00f1f3ed7a46d23 *src/d3xp/anim/Anim_Testmodel.cpp
9e09b5e8640ec36f86761e77dcd855c9 *src/d3xp/anim/Anim_Testmodel.h
373d73b53b5da81ed41c78362529adfd *src/d3xp/BrittleFracture.cpp
dfd92ed51972e5c71a380d7a8dd1d884 *src/d3xp/BrittleFracture.h
feb9a864a3f21e1634d6d4236fe648b4 *src/d3xp/Camera.cpp
302973226944e14dc3a26fed1912d5cf *src/d3xp/Camera.h
d58c6b6f1de81aef4b25abe9b96ed5f9 *src/d3xp/EndLevel.cpp
a44b0e64ba6b4430dbc76363503c8256 *src/d3xp/EndLevel.h
b769dd82e2d36798d36db4c2f4e0b692 *src/d3xp/Entity.cpp
607329b1cb6cfa5ffb84cdf82243c140 *src/d3xp/Entity.h
6d9e2f4eb00479828e8f30316aff738a *src/d3xp/Fx.cpp
a7973abe1874af163b24d9725e60ed0a *src/d3xp/Fx.h
9366293139f568d4f2ed28d9447e7c5e *src/d3xp/Game.def
38a2c8e488554a9be6c131bb0e2da37b *src/d3xp/Game.h
05b14ef43c96a51b4e1fce10cbfb8d2a *src/d3xp/GameEdit.cpp
1d9a0d89c3e2d05fb26c60d68c3e17ad *src/d3xp/GameEdit.h
42cf780f56a4f2c040aac9e81d70b4bb *src/d3xp/gamesys/Callbacks.cpp
d41593aeea150ec1d6440f5ce89a3844 *src/d3xp/gamesys/Class.cpp
e3d5465ac9a9ca711f2ea834e10b5fa6 *src/d3xp/gamesys/Class.h
279bde28025a669dbf47ee435dab52a8 *src/d3xp/gamesys/DebugGraph.cpp
9281bfa4a0c7d44992a5b69acbed0a74 *src/d3xp/gamesys/DebugGraph.h
06dd9ed4044d3730158aabb13f145f61 *src/d3xp/gamesys/Event.cpp
d8bf67cdc20f5d3fce663ac0474cc6ed *src/d3xp/gamesys/Event.h
969aae4b4f3c5a51c342226c5f6b6d66 *src/d3xp/gamesys/NoGameTypeInfo.h
559710b116b86fc5c5acba51b77017b3 *src/d3xp/gamesys/SaveGame.cpp
2f6856143057bf29dcfe38d61b59c863 *src/d3xp/gamesys/SaveGame.h
8d719e9d48a98d06d1989b31445f6888 *src/d3xp/gamesys/SysCmds.cpp
4b62f19c063511dee00c83845ce7f320 *src/d3xp/gamesys/SysCmds.h
7ed932dd12c96aa90512aaf63c72fdb0 *src/d3xp/gamesys/SysCvar.cpp
e31def85db9695c6dd45748a32d8aa27 *src/d3xp/gamesys/SysCvar.h
bff6543d6ab3ebbb7d72aecde1802847 *src/d3xp/gamesys/TypeInfo.cpp
9e29ac4220a128524accb58d587470c2 *src/d3xp/gamesys/TypeInfo.h
4ce41c1583e13dee525c3962599d4344 *src/d3xp/Game_local.cpp
c47b817da63b29e136b1dd15cc6616c5 *src/d3xp/Game_local.h
228d27ea27c967bb957cbe6d79d50628 *src/d3xp/Game_network.cpp
c48750d415082e129b09f411b9d0fbb2 *src/d3xp/Grabber.cpp
406bec75a737035f70b7be3a896fc6d9 *src/d3xp/Grabber.h
24c6f213c515acae0b2ea944ed4f43f7 *src/d3xp/IK.cpp
df74f5d7c6a346ee41a131864ac33a06 *src/d3xp/IK.h
df4cccd9cd3c0c99493ac0f9e47b1dbc *src/d3xp/Item.cpp
5785684b4a10ebf97e10fd0bb41935b9 *src/d3xp/Item.h
25b79617784ac8c64d7bb434e495d165 *src/d3xp/Light.cpp
eccb2ba974b76556f6a4c4ca6eb1dacc *src/d3xp/Light.h
a75990488c6bb8cb16247628284344fa *src/d3xp/Misc.cpp
0ad06a3bd56fe62eba01f5c24f208f75 *src/d3xp/Misc.h
c2824dbb60f8347ececf844948d76b69 *src/d3xp/Moveable.cpp
587639d8691f7d80dece057c17234cb4 *src/d3xp/Moveable.h
8a1385d5eaea984d06a21d97f5e5e048 *src/d3xp/Mover.cpp
26f8c0f67edf54dbd285e13692fcd6d8 *src/d3xp/Mover.h
8e094d0fcfd8f7528550f767467e1071 *src/d3xp/MultiplayerGame.cpp
e95b920500a5362ae56aad165a9c1ea4 *src/d3xp/MultiplayerGame.h
b6fdf3e143262315398b1f6450ee2040 *src/d3xp/physics/Clip.cpp
577044d81536fd081d936705bad6e669 *src/d3xp/physics/Clip.h
db95fc8774df9f0971ffa47db89cd709 *src/d3xp/physics/Force.cpp
9271f887b94b4dd70e8e31582c3cc765 *src/d3xp/physics/Force.h
8891ce4f1b093c485c4838c65d35fa45 *src/d3xp/physics/Force_Constant.cpp
fd9feebfee3a799541f006879eb569c3 *src/d3xp/physics/Force_Constant.h
56187680952cacefb0fb8b689612ec2f *src/d3xp/physics/Force_Drag.cpp
0fb5bef472d8710b8b0c4961ac424309 *src/d3xp/physics/Force_Drag.h
b3805a50b055009e514413935d48eaae *src/d3xp/physics/Force_Field.cpp
39024be5e301ab2949250a90a12e3f1e *src/d3xp/physics/Force_Field.h
9f5f99daf42da885db42e5c4e57bb51b *src/d3xp/physics/Force_Grab.cpp
5e651bd825ca342d7b1aecbc776c347f *src/d3xp/physics/Force_Grab.h
4868787409b28a30fc337721bf52b2d5 *src/d3xp/physics/Force_Spring.cpp
a3079b4e01fa293555d62767e9a75eb5 *src/d3xp/physics/Force_Spring.h
d60b09eced926973a02624fe72c097ad *src/d3xp/physics/Physics.cpp
d2e28cc845e5640d8465214a84c2219c *src/d3xp/physics/Physics.h
03635081f0b4f12746d939b8ae94fc4c *src/d3xp/physics/Physics_Actor.cpp
056e1e0d7f36cac413c78094c63c50e8 *src/d3xp/physics/Physics_Actor.h
cd8c76ad5acbc0fcf7574f24449bdf6b *src/d3xp/physics/Physics_AF.cpp
cb3e0bcb7e1788cfdbdba12d66f9ed00 *src/d3xp/physics/Physics_AF.h
61579ebbcf21ec719e7258d0d1e906c7 *src/d3xp/physics/Physics_Base.cpp
e439ac91101079a93ba687470bbdb713 *src/d3xp/physics/Physics_Base.h
ef50cc527673f51394cf8bf9e823eec6 *src/d3xp/physics/Physics_Monster.cpp
c07dc14cdc28823871ced4cfb834cfc8 *src/d3xp/physics/Physics_Monster.h
280e64fa2d3ee444e26f32305bc3d898 *src/d3xp/physics/Physics_Parametric.cpp
f93bdcc492f50db67878e2274044d7ab *src/d3xp/physics/Physics_Parametric.h
226d608f2cb7d279bad12e84a2558735 *src/d3xp/physics/Physics_Player.cpp
572fe5e12fae49bcd35f264edb765890 *src/d3xp/physics/Physics_Player.h
206f12b48f11aba0d189ba5316171765 *src/d3xp/physics/Physics_RigidBody.cpp
8e3baa7b3e82350a908a3865f6c3a0d3 *src/d3xp/physics/Physics_RigidBody.h
cd1687b82e2361c803bd528e94d393a7 *src/d3xp/physics/Physics_Static.cpp
ca2ae3f0cc147acd3743a97e4184b43d *src/d3xp/physics/Physics_Static.h
e2d822925adc488b22682937303b47f8 *src/d3xp/physics/Physics_StaticMulti.cpp
f6ca48445ad2a16ae42ebd067a3dfc5b *src/d3xp/physics/Physics_StaticMulti.h
39d50cc9f5bb1ceb1beca9c6aab64f68 *src/d3xp/physics/Push.cpp
b1f7b4d666e0d79646aec2c1ada2be19 *src/d3xp/physics/Push.h
76aae671ab2b12cb0022d5859bb2d715 *src/d3xp/Player.cpp
12fe0735c8a24ef83de5f91e13a21887 *src/d3xp/Player.h
6bac787dba83b9aab9d99d037562f0d1 *src/d3xp/PlayerIcon.cpp
e17dd547ff1e2fda1369b05fcb9998b9 *src/d3xp/PlayerIcon.h
1393ea8b429ae7c5e658ea769db5dd3d *src/d3xp/PlayerView.cpp
a9afb5112b1bac6479fef477f22510ac *src/d3xp/PlayerView.h
508628cf9eb4db7770a11977faa4e673 *src/d3xp/Projectile.cpp
2f21b17607d99c6e4abc81b2bc267e33 *src/d3xp/Projectile.h
94b9b826cb3b22efb20214746cc1bf9a *src/d3xp/Pvs.cpp
ffaa9d395efff49ab6ff2a93acdf38b0 *src/d3xp/Pvs.h
729a5e05412a6dd575d6060791ddb182 *src/d3xp/script/Script_Compiler.cpp
91da92aed14ed2748b2016b8bfd13a5b *src/d3xp/script/Script_Compiler.h
9b60efb81c99a2e1c4025a25791c28ba *src/d3xp/script/Script_Interpreter.cpp
edd8ba8f11fce2ad962132e5f5ab8223 *src/d3xp/script/Script_Interpreter.h
c218b13187e3eaea5b9b959b4613b047 *src/d3xp/script/Script_Program.cpp
95a28d256a674129093e3a14f42cea38 *src/d3xp/script/Script_Program.h
946a4187a787ef8120f90e24e3d2dfd8 *src/d3xp/script/Script_Thread.cpp
0df0e56033f991077d9d054b9b18484c *src/d3xp/script/Script_Thread.h
f829cf1a432bb36437a916d7c8597569 *src/d3xp/SecurityCamera.cpp
8ef631e222158b65ee9a4f5c04bff6df *src/d3xp/SecurityCamera.h
99a58d1af9464d796ff4537c072608c8 *src/d3xp/SmokeParticles.cpp
30d41919db27d7600169f5ed886aeb46 *src/d3xp/SmokeParticles.h
7abad18d9f8f26669f7f4bc444a2489c *src/d3xp/Sound.cpp
482b351917af91e26b3c52645674104f *src/d3xp/Sound.h
38c6668315c01520f07dc7f2134ba3c2 *src/d3xp/Target.cpp
079bb3ed19973e52f9944165c8a2cf8c *src/d3xp/Target.h
303efbefe3bee4117e2466a57f56a1d1 *src/d3xp/Trigger.cpp
dd78cff2ac2be9dc7c0beb14aad2a20a *src/d3xp/Trigger.h
e45231d0f27716cdf308fc048c94b7d7 *src/d3xp/Weapon.cpp
c5d570261b1b24b5d90ebad5334e6b59 *src/d3xp/Weapon.h
adba1c884614cd0905abf3cca7ff1fa8 *src/d3xp/WorldSpawn.cpp
ae46f21bfaa3e91ee35f3368971800d1 *src/d3xp/WorldSpawn.h
39efa6ceb0d4a2e49a294abc70e0b16f *src/framework/async/NetworkSystem.h
273611f1a7af9cb6288bea43d2a5ae79 *src/framework/BuildDefines.h
4d0c82a0fc96821e63b2d1d4c7f07f9e *src/framework/BuildVersion.h
644b096ee1860abc9f06bedc06152082 *src/framework/CmdSystem.h
a73c7364daaee253fa2314f720f61948 *src/framework/Common.h
06c73e4fcf5f702cd4bf66f80086cfac *src/framework/CVarSystem.h
52f04ff903d39b681286a1fe2a7ee1c9 *src/framework/DeclAF.h
4f180083323a00d3883dc96883794f2f *src/framework/DeclEntityDef.h
f189f846aed6e295f27010a96b0060f9 *src/framework/DeclFX.h
0125144f1ce930d448dfd34d7f6deb74 *src/framework/DeclManager.h
a6e5cede15b3b172a4aea25033a1ce8a *src/framework/DeclParticle.h
3adfa181f3e77f9d403de8a0a18d0c95 *src/framework/DeclPDA.h
75b9fde04b70378da3bebcfd767b14aa *src/framework/DeclSkin.h
3d69c1de8791eb5c1c48a4ce16386506 *src/framework/DeclTable.h
cde67b0bcd56918e6bf347051cfbb1f2 *src/framework/File.h
2ca611aadf0fc9fc7317b699b94878a3 *src/framework/FileSystem.h
ef0fa4c766607796ae068177cb3c5ed0 *src/framework/Licensee.h
1e732ba0bcceb091e22bd620f875e461 *src/framework/UsercmdGen.h
676dffd79e0e17e643a17c75db07f7eb *src/game/Actor.cpp
87accdd5fdf457551d5853680fafb141 *src/game/Actor.h
8ee17110c7f42eecfc7b17d8dce8a896 *src/game/AF.cpp
ec286d2cf851db847021795908d27c12 *src/game/AF.h
3ab86ad5934be48831b5fdc590a1e0ca *src/game/AFEntity.cpp
7bf66006050beda99b11c8040251b129 *src/game/AFEntity.h
f03ba687f94f1ffb13ac814486de2340 *src/game/ai/AAS.cpp
3ee992286f1b1641cdcfc6d443b99d14 *src/game/ai/AAS.h
8035de9626e57d12c848b77546feccb3 *src/game/ai/AAS_debug.cpp
6c2876fc8190a0d3f3789b1577c45ec1 *src/game/ai/AAS_local.h
b1823e1aad4d2261f9d5d9bc06d5a95f *src/game/ai/AAS_pathing.cpp
62fe990c48174e83fdaeeaf63f58d07a *src/game/ai/AAS_routing.cpp
207d34d5ed57e3d3d79d8d3cbd2d7105 *src/game/ai/AI.cpp
e117ef64f3e28f917ee42d86c71b7738 *src/game/ai/AI.h
e8522f3d8987358fac73f5cb9cd57b23 *src/game/ai/AI_events.cpp
675d4dbfab5c332c53313d9d9e7ec4d4 *src/game/ai/AI_pathing.cpp
a730df35afccadc7382d140ee28b3aea *src/game/ai/AI_Vagary.cpp
b8bc423a3369d61df9b9b7bc22a7ebd9 *src/game/anim/Anim.cpp
b86f393f092421ca83abb354c5b72e91 *src/game/anim/Anim.h
7472f4426325fbaefa626cefd0a3b20d *src/game/anim/Anim_Blend.cpp
40697f546da5b79869176fae43ae032d *src/game/anim/Anim_Import.cpp
435edccefcd102e7fb0b0c80a5eb0245 *src/game/anim/Anim_Testmodel.cpp
9e09b5e8640ec36f86761e77dcd855c9 *src/game/anim/Anim_Testmodel.h
a4b10676ad0e6ee543d3f0b9359cdddd *src/game/BrittleFracture.cpp
a011977466a557e80be87b1556e3c417 *src/game/BrittleFracture.h
f6e5d2601ac1335f82692b61ff1a1db1 *src/game/Camera.cpp
302973226944e14dc3a26fed1912d5cf *src/game/Camera.h
85577e4a1c931b9af59522c7c88f8a84 *src/game/Entity.cpp
b1d0ce6a101bc2eeaa1e94da673c7933 *src/game/Entity.h
502b575f49ac63603fe1edd6fd89745d *src/game/Fx.cpp
a7973abe1874af163b24d9725e60ed0a *src/game/Fx.h
9366293139f568d4f2ed28d9447e7c5e *src/game/Game.def
72d72b2daad9ddbd64e220b55ebe15f1 *src/game/Game.h
05b14ef43c96a51b4e1fce10cbfb8d2a *src/game/GameEdit.cpp
1d9a0d89c3e2d05fb26c60d68c3e17ad *src/game/GameEdit.h
42cf780f56a4f2c040aac9e81d70b4bb *src/game/gamesys/Callbacks.cpp
b514e5d3538868f7eac92c0d0f0c6faf *src/game/gamesys/Class.cpp
e3d5465ac9a9ca711f2ea834e10b5fa6 *src/game/gamesys/Class.h
279bde28025a669dbf47ee435dab52a8 *src/game/gamesys/DebugGraph.cpp
9281bfa4a0c7d44992a5b69acbed0a74 *src/game/gamesys/DebugGraph.h
a36db41f4a68559b7505cad8586dd383 *src/game/gamesys/Event.cpp
2c07d3323c81aed109ef1b1a01f43db7 *src/game/gamesys/Event.h
969aae4b4f3c5a51c342226c5f6b6d66 *src/game/gamesys/NoGameTypeInfo.h
cba93e29ca437d72706091b0a187ab35 *src/game/gamesys/SaveGame.cpp
2f6856143057bf29dcfe38d61b59c863 *src/game/gamesys/SaveGame.h
79e6954325ea82fe62f074e9f9c63740 *src/game/gamesys/SysCmds.cpp
4b62f19c063511dee00c83845ce7f320 *src/game/gamesys/SysCmds.h
45f3407d7c6f51842a57572752d292e5 *src/game/gamesys/SysCvar.cpp
186e41dfe1782ff12375753cb74891db *src/game/gamesys/SysCvar.h
bff6543d6ab3ebbb7d72aecde1802847 *src/game/gamesys/TypeInfo.cpp
9e29ac4220a128524accb58d587470c2 *src/game/gamesys/TypeInfo.h
2773d46ff684e1a598b09942b6cdc476 *src/game/Game_local.cpp
30c65a29b9b4b9e7d45d063716409682 *src/game/Game_local.h
f3f4c7b38f4b934c8b18a1de5ce358ed *src/game/Game_network.cpp
24c6f213c515acae0b2ea944ed4f43f7 *src/game/IK.cpp
df74f5d7c6a346ee41a131864ac33a06 *src/game/IK.h
9a81c3987f89aabad2f17e0b93892203 *src/game/Item.cpp
689d41c13b7503e080d47d1baddf712e *src/game/Item.h
8a425a8d6bb15709fbac61a7fb80c9a7 *src/game/Light.cpp
eccb2ba974b76556f6a4c4ca6eb1dacc *src/game/Light.h
6c83df0e4877006a635a305a59326c32 *src/game/Misc.cpp
a122884d5775ac3043ccd74311ebe5c3 *src/game/Misc.h
a6eda57244d8940f2c07c126f1238b16 *src/game/Moveable.cpp
99be3c44f5831a8d2df4d8c44f81b073 *src/game/Moveable.h
99969c6e999a344d8324bd3a4e19543e *src/game/Mover.cpp
61de1ed47c3c9766db4f0c7741e10e32 *src/game/Mover.h
6a9f69048a0ba6f268c523307b6ee461 *src/game/MultiplayerGame.cpp
cf392661199d7da9fed1bdc7d0247270 *src/game/MultiplayerGame.h
066c3864cf4b5d179e2f9ed4727d89cf *src/game/physics/Clip.cpp
577044d81536fd081d936705bad6e669 *src/game/physics/Clip.h
db95fc8774df9f0971ffa47db89cd709 *src/game/physics/Force.cpp
9271f887b94b4dd70e8e31582c3cc765 *src/game/physics/Force.h
8891ce4f1b093c485c4838c65d35fa45 *src/game/physics/Force_Constant.cpp
fd9feebfee3a799541f006879eb569c3 *src/game/physics/Force_Constant.h
56187680952cacefb0fb8b689612ec2f *src/game/physics/Force_Drag.cpp
0fb5bef472d8710b8b0c4961ac424309 *src/game/physics/Force_Drag.h
b3805a50b055009e514413935d48eaae *src/game/physics/Force_Field.cpp
39024be5e301ab2949250a90a12e3f1e *src/game/physics/Force_Field.h
4868787409b28a30fc337721bf52b2d5 *src/game/physics/Force_Spring.cpp
a3079b4e01fa293555d62767e9a75eb5 *src/game/physics/Force_Spring.h
d60b09eced926973a02624fe72c097ad *src/game/physics/Physics.cpp
d2e28cc845e5640d8465214a84c2219c *src/game/physics/Physics.h
03635081f0b4f12746d939b8ae94fc4c *src/game/physics/Physics_Actor.cpp
056e1e0d7f36cac413c78094c63c50e8 *src/game/physics/Physics_Actor.h
b45998cdb202ebcc3425a0e2f516cf88 *src/game/physics/Physics_AF.cpp
cb3e0bcb7e1788cfdbdba12d66f9ed00 *src/game/physics/Physics_AF.h
61579ebbcf21ec719e7258d0d1e906c7 *src/game/physics/Physics_Base.cpp
e439ac91101079a93ba687470bbdb713 *src/game/physics/Physics_Base.h
ef50cc527673f51394cf8bf9e823eec6 *src/game/physics/Physics_Monster.cpp
c07dc14cdc28823871ced4cfb834cfc8 *src/game/physics/Physics_Monster.h
280e64fa2d3ee444e26f32305bc3d898 *src/game/physics/Physics_Parametric.cpp
f93bdcc492f50db67878e2274044d7ab *src/game/physics/Physics_Parametric.h
226d608f2cb7d279bad12e84a2558735 *src/game/physics/Physics_Player.cpp
572fe5e12fae49bcd35f264edb765890 *src/game/physics/Physics_Player.h
206f12b48f11aba0d189ba5316171765 *src/game/physics/Physics_RigidBody.cpp
8e3baa7b3e82350a908a3865f6c3a0d3 *src/game/physics/Physics_RigidBody.h
cd1687b82e2361c803bd528e94d393a7 *src/game/physics/Physics_Static.cpp
ca2ae3f0cc147acd3743a97e4184b43d *src/game/physics/Physics_Static.h
e2d822925adc488b22682937303b47f8 *src/game/physics/Physics_StaticMulti.cpp
f6ca48445ad2a16ae42ebd067a3dfc5b *src/game/physics/Physics_StaticMulti.h
39d50cc9f5bb1ceb1beca9c6aab64f68 *src/game/physics/Push.cpp
b1f7b4d666e0d79646aec2c1ada2be19 *src/game/physics/Push.h
b157ed4d796ff929e89567c535ad4617 *src/game/Player.cpp
7150bb6badbb3185ded2a63bcd1b2bf3 *src/game/Player.h
fc20717648bbb6ef95f2f4801c1dde00 *src/game/PlayerIcon.cpp
95261c80073066193a603fe646eadced *src/game/PlayerIcon.h
847baf8091ff7bf97908c7367264eb44 *src/game/PlayerView.cpp
db3455c0347cb7bdde4d0339d82f6e1e *src/game/PlayerView.h
e549f11d19ab7c3bfd094ef92a1ab8a3 *src/game/Projectile.cpp
4ec6a4dfc328ecdba3a8f649bbaa7b37 *src/game/Projectile.h
0140739513277028fc53e0e5257b0b97 *src/game/Pvs.cpp
9cffa1c0f5461bd11ccedf27adea899d *src/game/Pvs.h
729a5e05412a6dd575d6060791ddb182 *src/game/script/Script_Compiler.cpp
91da92aed14ed2748b2016b8bfd13a5b *src/game/script/Script_Compiler.h
9b60efb81c99a2e1c4025a25791c28ba *src/game/script/Script_Interpreter.cpp
edd8ba8f11fce2ad962132e5f5ab8223 *src/game/script/Script_Interpreter.h
c218b13187e3eaea5b9b959b4613b047 *src/game/script/Script_Program.cpp
2ff453147489c2b24c1036a321cd8a96 *src/game/script/Script_Program.h
e38cb728413beaf77ab5182398ce274a *src/game/script/Script_Thread.cpp
f64a3e1ea2328fa48cdf5dec04618921 *src/game/script/Script_Thread.h
f829cf1a432bb36437a916d7c8597569 *src/game/SecurityCamera.cpp
8ef631e222158b65ee9a4f5c04bff6df *src/game/SecurityCamera.h
4fa55ba5aa7f92e531b34847f6bee559 *src/game/SmokeParticles.cpp
e964690303add471140f387201c63de0 *src/game/SmokeParticles.h
7abad18d9f8f26669f7f4bc444a2489c *src/game/Sound.cpp
482b351917af91e26b3c52645674104f *src/game/Sound.h
58a53d103ef2f98209d422ecf7df19c3 *src/game/Target.cpp
1c999e2ff6d4bb5c5c409291756e7de5 *src/game/Target.h
7e420d0016eb039561be34a596debd63 *src/game/Trigger.cpp
ea3c3be1c40a32c47e65926082e1566f *src/game/Trigger.h
a8fa6c7f4ef2bec18a4d230d9405aef1 *src/game/Weapon.cpp
4d3ff18f0783184550e4817331da1e8f *src/game/Weapon.h
adba1c884614cd0905abf3cca7ff1fa8 *src/game/WorldSpawn.cpp
ae46f21bfaa3e91ee35f3368971800d1 *src/game/WorldSpawn.h
90cfea89fa17a724b826286d5ffeb269 *src/game-d3xp.vcproj
10bad911c3bdb3eb256a33c8be69265d *src/idlib/Base64.cpp
ea126c0e8ba724d2ac66d4a0d3e2ba04 *src/idlib/Base64.h
8c1312e06abb830cfc2a7f03295eee58 *src/idlib/BitMsg.cpp
28741399100324ca61a779f729f3cd4c *src/idlib/BitMsg.h
d45b2d3d570c176c36b9253925b79230 *src/idlib/bv/Bounds.cpp
14650ac3e9ff1bfb03ba75347819fabd *src/idlib/bv/Bounds.h
5ea635b6c4970372aac953212120efc0 *src/idlib/bv/Box.cpp
cf905028e165369e492bf7d01191a3b2 *src/idlib/bv/Box.h
91404c2190517b252213405d3b5c62a5 *src/idlib/bv/Frustum.cpp
82cd915d980c9283e03c525ac91f9e51 *src/idlib/bv/Frustum.h
0fadc6ec2c20147440bf9f0dc9a4cf43 *src/idlib/bv/Frustum_gcc.cpp
b487fc5a52b3d86eb21428dfd8d9a0e8 *src/idlib/bv/Sphere.cpp
2a1a1452e99fe8c49ee037653b76d216 *src/idlib/bv/Sphere.h
1ea5e9b68ae9d473684bba9af4134b4c *src/idlib/CmdArgs.cpp
bbe225a0932cd8b2f199e6a13e6f479b *src/idlib/CmdArgs.h
5038ebb317e1ae41975aac357d8f302a *src/idlib/containers/BinSearch.h
e1fe7702c576eacb7ae4d2a1bc4af716 *src/idlib/containers/BTree.h
01fd029e4c30f154149cc7a5d10ab851 *src/idlib/containers/HashIndex.cpp
0a55bc9e7c3f19de4c4fd1ee1ece1d6c *src/idlib/containers/HashIndex.h
3ba85097ca7a7a75bef9246a2c649718 *src/idlib/containers/HashTable.h
9f549a7317147b32de8c6938ccf67382 *src/idlib/containers/Hierarchy.h
d2a76dfa43e0648c6c63e521a020bb1e *src/idlib/containers/LinkList.h
3c7564a196935ce1cd79ecb29d448f78 *src/idlib/containers/List.h
6993b764a8b1897dfa095fddedd5dbcc *src/idlib/containers/PlaneSet.h
75f30a0d41cc375f49529f1d4cc90c98 *src/idlib/containers/Queue.h
d39a20aa40b0dee467cd271695923200 *src/idlib/containers/Stack.h
d1d7eca1471555d04d4cb30bef70efbe *src/idlib/containers/StaticList.h
8320894e1a591da60e33602753a1f6fd *src/idlib/containers/StrList.h
14cf4411222c6b09a57ad2e5f6cff3e9 *src/idlib/containers/StrPool.h
a156cd71b2e13828d3d1c6d57570b560 *src/idlib/containers/VectorSet.h
14e6daffa0dd203c281d6e2e6e28307a *src/idlib/Dict.cpp
830f9f2b849215c50794b1e52fe443ab *src/idlib/Dict.h
435819dbcc371bf493ba174162a5cb70 *src/idlib/geometry/DrawVert.cpp
b38ae02207bd99c10c504b5249038c7f *src/idlib/geometry/DrawVert.h
814b29df7f0b5510c467042147f056ea *src/idlib/geometry/JointTransform.cpp
2f5924396160ca6794284dbf0074f007 *src/idlib/geometry/JointTransform.h
5875071c1d9fbf459b0fce95699f705e *src/idlib/geometry/Surface.cpp
3d17b9dc3f2a4c839707ccd0dd505bb6 *src/idlib/geometry/Surface.h
df29ec04b3dd278b835df308786e3052 *src/idlib/geometry/Surface_Patch.cpp
92f08bde7754e5bf04917770b8e0bfe7 *src/idlib/geometry/Surface_Patch.h
cadb910c628a3d4d2425b7216470caa5 *src/idlib/geometry/Surface_Polytope.cpp
fc05791ee6de10600ade4b89a2f7b449 *src/idlib/geometry/Surface_Polytope.h
33325797daff12c12146c93912b43787 *src/idlib/geometry/Surface_SweptSpline.cpp
1524b424da99265d71fa4fe44686d503 *src/idlib/geometry/Surface_SweptSpline.h
8431f682e2a377f7f53e5b9c91786da2 *src/idlib/geometry/TraceModel.cpp
08703ab16c3b26b6dcfbfca5d1f51b59 *src/idlib/geometry/TraceModel.h
e5b52176825082a2c9ea10d7ff9753fe *src/idlib/geometry/Winding.cpp
0e2a2008c99298143f52fed1b6127ceb *src/idlib/geometry/Winding.h
4fd1728745517f10cc970ea0edf3ff72 *src/idlib/geometry/Winding2D.cpp
178f31145e34802391b4af8748fcd21e *src/idlib/geometry/Winding2D.h
43afbaa7210721fa099797ccc2d5c218 *src/idlib/hashing/CRC16.cpp
7fba1646c49bd659758b73406d8549de *src/idlib/hashing/CRC16.h
954899e570a7e1098193dcb3ab32a3aa *src/idlib/hashing/CRC32.cpp
c7d0fb6d29c05419f1034eb980b23039 *src/idlib/hashing/CRC32.h
478a4ed0b8f8c3b8d7ad1f2a4037eac0 *src/idlib/hashing/CRC8.cpp
2e813c1d19c91be6e6b3c3a8a6cdc301 *src/idlib/hashing/CRC8.h
3c6b2ce7c807344cd92caf1d441bca7d *src/idlib/hashing/Honeyman.cpp
c664b62e17653aebbcd04c8701ddd08b *src/idlib/hashing/Honeyman.h
1b907599c03e01614983dea58963757a *src/idlib/hashing/MD4.cpp
d4a497cfc27d4507e53688f19fe8dce0 *src/idlib/hashing/MD4.h
339902d1dbcf1d97208178dc8c98a62e *src/idlib/hashing/MD5.cpp
0a3259f4f2875b733ffbe2708a02dda9 *src/idlib/hashing/MD5.h
5c76357cecac2b6bb7b9764cebfa3035 *src/idlib/Heap.cpp
a20bcd3df1e302a304a152b9e119d0ef *src/idlib/Heap.h
f53750e28c24b851d39b1b2a0a237ac3 *src/idlib/LangDict.cpp
911a3ab827d9a623decbd775ca856c5b *src/idlib/LangDict.h
7ee7ba6a875ed3d3df6dc1ff39e862a5 *src/idlib/Lexer.cpp
295eeb502e21a763627c1bb4f043f8c0 *src/idlib/Lexer.h
bd52dbb10edb077da6fa2621cc853932 *src/idlib/Lib.cpp
f93f32b08697c5f42ba65afcf0a1df21 *src/idlib/Lib.h
17ec37be4bdf61e32d396da844a33325 *src/idlib/MapFile.cpp
77b6b04e39488ea740506c6b359b77c9 *src/idlib/MapFile.h
6847fc795e9b6b842093bc297a694a8f *src/idlib/math/Angles.cpp
5dc4f1e41f7524873cdeadab3f82642b *src/idlib/math/Angles.h
e4f7edaaf05258d9c26007ad7ec5ea24 *src/idlib/math/Complex.cpp
4aafaade6e774171966cc70b7114a8ff *src/idlib/math/Complex.h
42ec8dc549d5552ec15aa378fbb78c69 *src/idlib/math/Curve.h
55e81c917119e99977ed2a9ca019253c *src/idlib/math/Extrapolate.h
a4d0e1c970873a63364f03fb1f4f4b9d *src/idlib/math/Interpolate.h
2364df4b95a02db32a411fd69e63b12a *src/idlib/math/Lcp.cpp
e0bf54026a72d40b686f71525683cb8f *src/idlib/math/Lcp.h
bf2523f0eaa0e1490d43cdb46f44cdd0 *src/idlib/math/Math.cpp
9e8f517806334634081bbc339a26698a *src/idlib/math/Math.h
d9d97ae48dc142a1299ab3d3cde3c353 *src/idlib/math/Matrix.cpp
744fc4a9bf2aeafd18a98c6526b2796f *src/idlib/math/Matrix.h
9e64458de095626b5c552c4fdceb726c *src/idlib/math/Ode.cpp
b2f42b71ebd1b0cb5bd730ca1a23d9dc *src/idlib/math/Ode.h
d3140e8a5fe85ffa1ce556589e23b846 *src/idlib/math/Plane.cpp
e6d9b1b3d596b28ed4098b04389ead00 *src/idlib/math/Plane.h
264260647bb911a1071efbee810d50e8 *src/idlib/math/Pluecker.cpp
e0ce6b004f0005c82abe5cebf38cfe59 *src/idlib/math/Pluecker.h
297af895642ee92c40816decb36e0c4a *src/idlib/math/Polynomial.cpp
e6afdb0c48fcbef5f93165b3af87d303 *src/idlib/math/Polynomial.h
86148234cc2169eb3f5fed753e994539 *src/idlib/math/Quat.cpp
7df4388b58ea67d328ff6107d45f9dbc *src/idlib/math/Quat.h
3a9710abf5882642c09dbddd29a7a08d *src/idlib/math/Random.h
38481abd5916b83422f0f995ae9e1884 *src/idlib/math/Rotation.cpp
cf5b0e0fd91f8499196aee1e616e84a3 *src/idlib/math/Rotation.h
4cd838f1753ec78aae88b71ec05a1896 *src/idlib/math/Simd.cpp
145aed28ff0e099a7982bb659eeebaa2 *src/idlib/math/Simd.h
ba0c6eccbe8bf996a83998eb5d70430d *src/idlib/math/Simd_3DNow.cpp
2d53fb2f5286cec5da2099e0fd1cf290 *src/idlib/math/Simd_3DNow.h
7693decc0682458eb0ad562159d265a8 *src/idlib/math/Simd_AltiVec.cpp
691ec3dede9fa399a434ccd6a7e601de *src/idlib/math/Simd_AltiVec.h
43b93652a8047c9c7bda1f7ba53c12ed *src/idlib/math/Simd_Generic.cpp
d09fb3a0cd76bc807f41398ba1bbc358 *src/idlib/math/Simd_Generic.h
da36ccd911f492f78d8cf6eed7c4ceca *src/idlib/math/Simd_MMX.cpp
f9f3725cbfd4b0eb8b8d0a265c45365d *src/idlib/math/Simd_MMX.h
77d051b2b11c28bfc5e5124d96aaf420 *src/idlib/math/Simd_SSE.cpp
4e6dd9174c46af7a813dac3e308f3de0 *src/idlib/math/Simd_SSE.h
22e7dc426cd3aa25372429a7bd9df059 *src/idlib/math/Simd_SSE2.cpp
fbc4426daca37ebf86f05904f4a5b0bf *src/idlib/math/Simd_SSE2.h
c71ed081a78055ac59244a1df9a7af18 *src/idlib/math/Simd_SSE3.cpp
d93730fba4e34089fbe34e588292cdd4 *src/idlib/math/Simd_SSE3.h
a1483875a16c31f3a50bee0f75dcda33 *src/idlib/math/Vector.cpp
25f68a30acb1e60730b6ff997b897d59 *src/idlib/math/Vector.h
9be71b8af547b601581dda3172c80685 *src/idlib/Parser.cpp
d2e5eb0951c1fd13133cc49d26422c12 *src/idlib/Parser.h
eb50f2476038fafd4ccb7502016381a8 *src/idlib/precompiled.h
7992150d35d20b5451782072c3b08ed6 *src/idlib/Str.cpp
c3729e4773c7ed4df6948321931f96d5 *src/idlib/Str.h
c007a652e5d6f139529853822515cc51 *src/idlib/Timer.cpp
1994f53aee883f68af020e52f1303ded *src/idlib/Timer.h
ac6fb8eafd4616e29a7faeafa032e725 *src/idlib/Token.cpp
20c9b0e0146f5fec26d03bd7948631c0 *src/idlib/Token.h
2e55872065220bf8b65232549f34d261 *src/idlib.vcproj
7a2c051ad61f2f8ddd930130f9c94740 *src/MayaImport/exporter.h
e0e640e984a2398a83122affafd942f5 *src/MayaImport/Maya4.5/maya.h
0c4fa28f8c45eb5c4968cfa07451a640 *src/MayaImport/maya5.0/maya.h
e0e640e984a2398a83122affafd942f5 *src/MayaImport/Maya6.0/maya.h
e95a40bbb2cd5989e74be304b8dfca49 *src/MayaImport/mayaimport.def
d2680e896cc5c2465d25b7b1212855f4 *src/MayaImport/maya_main.cpp
3b1d1d3c06b41cabdf1db20d0c70e799 *src/MayaImport/maya_main.h
e2b87ed822c749ea8fa16283f49fbec3 *src/MayaImport.vcproj
73b268519d1fe463f1cbdc0f629db078 *src/renderer/Cinematic.h
89b029c9dbfb6034c5f333040e986fd2 *src/renderer/glext.h
7dcb19d26a6e770df53bc006777e6476 *src/renderer/Material.h
944070b49e293970d7a0cca123f6d2d9 *src/renderer/Model.h
3ecddb8eabde6caa0c29a0252034da84 *src/renderer/ModelManager.h
df3b6a65299ffcb94b2112fd09454a9d *src/renderer/qgl.h
d7cef91f74111c3f718fbb013f0e89fb *src/renderer/qgl_linked.h
8120ce8cecf1f5c14c9d8fdc51ef76fc *src/renderer/RenderSystem.h
f2dbceca220c1b8aca832dce917b6516 *src/renderer/RenderWorld.h
d53f08c1cd4e79c2d393134c68057d2e *src/SConstruct
58657928eab2a7c4cd3e212f1893433d *src/sound/sound.h
99de5ead06f5526a2bc2e223be36f506 *src/sys/linux/qgl_enforce.h
c097031304dd401e701002d427f79d06 *src/sys/scons/SConscript.game
d41d4564fcaa6da50cdb36482937b827 *src/sys/scons/SConscript.idlib
017d27f219517537234a27a8fe1219f4 *src/sys/scons/scons_utils.py
1956037ab2473b370884ea0639a9e9e0 *src/sys/sys_public.h
125d82621ba140bcbd51b25bc03bf03f *src/tools/compilers/aas/AASFile.h
98b1ef423b759cad4d9fffbc10d4598e *src/tools/compilers/aas/AASFileManager.h
473dc012029bdd1fb49382c43d1904c3 *src/ui/ListGUI.h
7292e8c7c3115150261a9a6f288f2d7c *src/ui/UserInterface.h
80d7d7d37c3dd53790cbf78f31196bc5 *vehicles/af/env_vehicle_simplebuggy.af
9f2394d96b77cc9de7a2e3d7260fb033 *vehicles/def/env_simplevehicle.def
0a02ac09bc92c6e3bf4a97da8e0054ab *vehicles/maps/testmaps/test_vehicle.cm
74fa3ab82f81978e313cb77f07b15efb *vehicles/maps/testmaps/test_vehicle.map
81cb35140c0e38fd7dd86d2235f9eb31 *vehicles/maps/testmaps/test_vehicle.proc
999593e1b407797ddbf0181620670e9a *vehicles/maps/testmaps/test_vehicle.script
c0623dcaea4fbf6ce890a35767be746e *vehicles/maps/testmaps/test_vehicle2.cm
f582d207eabe141349c1c71883bc83e5 *vehicles/maps/testmaps/test_vehicle2.map
281645579d053c47f2f71b9f8661cc44 *vehicles/maps/testmaps/test_vehicle2.proc
341252364d5807e531ba8fc4832983b2 *vehicles/maps/testmaps/test_vehicle2.script
1e39fc8c73c855553ee9f312764f55ca *vehicles/maps/testmaps/test_vehicle_terrain.ase
2375734e8a1eb60f279c780c026cae38 *vehicles/models/md5/vehicles/buggy/buggy.mb
be9227250a5ce53ec365f73526654a93 *vehicles/models/md5/vehicles/buggy/buggy.md5anim
5289507aaf5cc7900d77bd380ae9e0ee *vehicles/models/md5/vehicles/buggy/buggy.md5mesh
180b91d17b3c9341d9dedff4bb34411b *vehicles/models/md5/vehicles/buggy/buggy.tga
39f3a6981658a72625bb8983a962d66f *vehicles/models/md5/vehicles/buggy/buggy_d.tga
147db9b809602de2da99ff5c6b5cb36d *vehicles/models/md5/vehicles/buggy/buggy_local.tga
a97253ee8fff39d798edc7d0536cf9c9 *vehicles/models/md5/vehicles/buggy/buggy_turret_d.tga
966384b9f9373c69781287b5d6079bed *vehicles/models/md5/vehicles/buggy/buggy_turret_local.tga
180b91d17b3c9341d9dedff4bb34411b *vehicles/models/md5/vehicles/buggy/gun.tga
180b91d17b3c9341d9dedff4bb34411b *vehicles/models/md5/vehicles/buggy/turret.tga
180b91d17b3c9341d9dedff4bb34411b *vehicles/models/md5/vehicles/buggy/wheel.tga
6a16211eb7cbbc8a7079a57c4abdf652 *vehicles/models/md5/vehicles/buggy/wheel_d.tga
5e0aac8bfb2ad55cc3b12913c7d8b574 *vehicles/models/md5/vehicles/buggy/wheel_local.tga
e505dce717d443bd61a5b67d7cb12f71 *vehicles/models/md5/vehicles/buggy/wheel_s.tga
07b354a5cb974a8b7ab1f100fe2e264d *vehicles/models/md5/vehicles/locust/initial.md5anim
9e35209909d5299d24007496bff459ca *vehicles/models/md5/vehicles/locust/locust.md5mesh
73bc1d9ae5652b3bf6a1f1b8850ccf42 *vehicles/readme.txt
d329162eec1c3032b09093873cd239ca *vehicles/textures/base_floor/concrete01.tga
be239f082c721c4618a6ea66ee18eaa0 *vehicles/textures/base_floor/concrete01d.tga
640bc8e08c0446019ed832e1c4bf172e *vehicles/textures/base_floor/concrete01s copy.tga
640bc8e08c0446019ed832e1c4bf172e *vehicles/textures/base_floor/concrete01s.tga
b84284d1b85ca5ee877de786531bad54 *vehicles/textures/stone/sand01.tga
508ca81cd2ee9242e41a0b5e8a41cdc7 *vehicles/textures/stone/sand01_d.tga
f666c13e5a5c669c7fed43e00f3a6e94 *vehicles/textures/stone/sand01_s.tga
814bcec5c20cc2658a75fe8f62547692 *vehicles/textures/stone/sand02.tga

416
neo/sys/linux/SDK.list.txt Normal file
View File

@@ -0,0 +1,416 @@
D3 1.1 win32 SDK file list
378c21cf872ef830445ce18b3d3348f8 *base/animation/mp_greenarmor.md5mesh
7f9b7629c712056e48ceac9dadb16224 *base/animation/mp_jumpsuit.md5mesh
caf59e47ec1988d81fdcc3c8aeb8981f *base/animation/mp_labcoat.md5mesh
3982a493fe0da57c13e96fc8e1d6a795 *base/animation/mp_security.md5mesh
c23ac9aeb96d3ef55595c7d668d948cd *base/animation/mp_soldier.md5mesh
24046a3a459bf42fd1ea555d0b75fdfc *base/animation/mp_suit.md5mesh
6509fbcd1ce02e81bf0f95954405bea4 *base/animation/mp_tshirt.md5mesh
683d3f4c114f803873775a559a43a7c1 *base/def/npcs_as_player.def
20729461e1831236acae7ca5b73b0319 *base/maps/fred/cyberdemon/monster_wakeups.mb
2d7df07f33ffbacaf16c51942524b55c *base/maps/fred/underground/impintro.mb
fce124d3f5d717eee4a7d89ad02eca7a *base/maps/fred/underground/impscurry.mb
b60db9fae92e89f9b5cc25cd0a4253f6 *base/maps/fred/underground/impstairs.mb
185553b6f3ab20b1994f07798cd0a156 *base/models/monsters/imp/animation/cycles/alert_walk.ma
b20bf698a63d5eb0a876f1d41b47aaae *base/models/monsters/imp/animation/cycles/crouched_range1.ma
34c73f22a4a1eeee9bb4eae68688917b *base/models/monsters/imp/animation/cycles/evade_left.ma
76ff5398bcf1aebb08641bc5dfacd716 *base/models/monsters/imp/animation/cycles/evade_left_on4.ma
81203ea3773a820074b2fbc2c2e17e37 *base/models/monsters/imp/animation/cycles/evade_right.ma
a05cba4afb38f709eede99fc8b7fdf83 *base/models/monsters/imp/animation/cycles/evade_right_on4.ma
9ce3fb5c02f00f004c13da995ac8e51f *base/models/monsters/imp/animation/cycles/faster_walk.ma
3d960bbfb56e51ca9735905d49d83c3a *base/models/monsters/imp/animation/cycles/fireball_sight.ma
0779e202728e8b80a48d950bbf74c4e0 *base/models/monsters/imp/animation/cycles/hangonceiling.ma
7fcfc63044c8111485813efe6af5b066 *base/models/monsters/imp/animation/cycles/idle1.ma
110661e6211291d098bace0a26f1a483 *base/models/monsters/imp/animation/cycles/imp.mb
cd0971e695d81001820e9222313a4955 *base/models/monsters/imp/animation/cycles/initial.ma
6ec1b1abe0c585726636149f54f8e9dc *base/models/monsters/imp/animation/cycles/jump_loop.ma
6be7606a2cb7135eed7b583145d0f572 *base/models/monsters/imp/animation/cycles/jump_loop2.ma
e8ae6eb85a5bfe7a9190dbf3279d4ea1 *base/models/monsters/imp/animation/cycles/jump_loop3.ma
6412062ceb0cd3256cc78e49c2e4909a *base/models/monsters/imp/animation/cycles/offwall.ma
ab814d600992f29204655e3415971e3e *base/models/monsters/imp/animation/cycles/on4_idle.ma
b54f250dd00b0b9b24c31c6b14871629 *base/models/monsters/imp/animation/cycles/on4_melee1.ma
64dd04c941a7a7f174583d34d035eebc *base/models/monsters/imp/animation/cycles/on4_melee2.ma
ec39d4020b208de213f56c095c0406d3 *base/models/monsters/imp/animation/cycles/on4_sight.ma
b9133fba76754d0691e31c788d33dcd7 *base/models/monsters/imp/animation/cycles/outofhole.ma
75f00d3a2077f0b9378424fd64cadc1d *base/models/monsters/imp/animation/cycles/pain3.ma
c0cf15bd8e7b331118f3f2a253c8d1a6 *base/models/monsters/imp/animation/cycles/pain_chest.ma
4f3b231d9c0dd5bc144f91aaefa95f9d *base/models/monsters/imp/animation/cycles/pain_chest_on4.ma
a3fda68e30e70c7de009f008832cc849 *base/models/monsters/imp/animation/cycles/pain_head.ma
ebab78e4555f5ce417e7a918b857a299 *base/models/monsters/imp/animation/cycles/pain_head_on4.ma
6a2da31bf0ab40750d93f4f334432271 *base/models/monsters/imp/animation/cycles/pain_luparm.ma
4277b9a5f30f28106f0fd4fadd008d03 *base/models/monsters/imp/animation/cycles/pain_luparm_on4.ma
506a7b9b631f70afcab174b4df6672d2 *base/models/monsters/imp/animation/cycles/pain_ruparm.ma
d72684a507481948165939c762a94d14 *base/models/monsters/imp/animation/cycles/pain_ruparm_on4.ma
2d5f4a7997cfbffd9a9f3aaa93b8cb96 *base/models/monsters/imp/animation/cycles/range1.ma
4a18cb9d675f4fdb20f31bc34d0f126c *base/models/monsters/imp/animation/cycles/range2.ma
e56ceccbeb0b39929e69792e6ca493cd *base/models/monsters/imp/animation/cycles/range3.ma
93d4ee499d9d183e44db78cb49d76128 *base/models/monsters/imp/animation/cycles/run.ma
7d8b78d2414c775e0718857ade6d607c *base/models/monsters/imp/animation/cycles/scurry2.ma
51b92152e848f5df97d37ba1e5ea4937 *base/models/monsters/imp/animation/cycles/scurry_leap2.ma
ef071d4959c55540bf28ec90408537bb *base/models/monsters/imp/animation/cycles/sight.ma
44b4b5bebf62d8a7b5173593dfc2ad9d *base/models/monsters/imp/animation/cycles/sight2.ma
e0eeef3455d1dabcc924c328b24ec236 *base/models/monsters/imp/animation/cycles/slash1.ma
2490f2dab58229e1d37bfe27201c94ac *base/models/monsters/imp/animation/cycles/slash2.ma
7c59693fba6b19053042c65cc8424491 *base/models/monsters/imp/animation/cycles/slash3.ma
db049810b1429fcf53ac482fe1b0fd4c *base/models/monsters/imp/animation/cycles/teleportin.ma
f82822c0fe0b8ddb287af934259d98e9 *base/models/monsters/imp/animation/cycles/turret_attack1.ma
b8828a357c293183b3a6bcec9a8d594e *base/models/monsters/imp/animation/cycles/turret_idle.ma
75b85d1dd46885051553df964e0e8dad *base/models/monsters/imp/fred/imp_setup.mb
fc2e0afe9f6e596709c8635035105697 *base/models/monsters/imp/fred/imp_setup_ik.mb
2645732cd30bfd33309e4b801e74971c *base/models/weapons/machinegun/cycles/empty.ma
162eee06b15fffaabbc267f72f66ad7c *base/models/weapons/machinegun/cycles/fire1.ma
799523e4fb25e9f97e2bc197f1c783b9 *base/models/weapons/machinegun/cycles/fire2.ma
2f8536ac728bb97e163b7fcc3669ba44 *base/models/weapons/machinegun/cycles/fire4.ma
8ccb8b80b363da587015fcce7167f526 *base/models/weapons/machinegun/cycles/idle1.ma
2553b66bdb33e6bd85a1d7bccd936237 *base/models/weapons/machinegun/cycles/pullup1.ma
c703ec87330cdc52d4bad4dd2aac7de7 *base/models/weapons/machinegun/cycles/putaway.ma
4e9a4ba4caa2e209c66761ffe9f6cd8c *base/models/weapons/machinegun/cycles/reload1.ma
6b19b0dbd4bb6554b9b449713d4fd102 *base/models/weapons/machinegun/fred/setup1.mb
326a538229b875b8a9f5506c2bffe4f6 *EULA.Development Kit.rtf
9380e8d182dbf689d65399c090d536b1 *MayaImportx86_Maya45.zip
ff7e2e1bffcb4283f7333d43e722f02e *MayaImportx86_Maya60.zip
bf55402b75174f2f5a9f4edfea7726ee *src/cm/CollisionModel.h
b7107e4f8766d32ec0585a42446a574d *src/D3Game.sln
6a7b0e721547e7eea469def7bb1020bd *src/D3Game.vcproj
39efa6ceb0d4a2e49a294abc70e0b16f *src/framework/async/NetworkSystem.h
3dc9117caac77a292cd70aa873a7207a *src/framework/BuildDefines.h
81d91c2104799156ebe83ec8986e7d20 *src/framework/BuildVersion.h
453240a77802d1ab9cf4ab09ba740639 *src/framework/CmdSystem.h
677c025b011385281e25dc993b4a8499 *src/framework/Common.h
deb4de6d9309529bc6a7bd56b2fcaf55 *src/framework/CVarSystem.h
52f04ff903d39b681286a1fe2a7ee1c9 *src/framework/DeclAF.h
4f180083323a00d3883dc96883794f2f *src/framework/DeclEntityDef.h
8808ba9d72dd869fa1bed98a75a66404 *src/framework/DeclFX.h
814651a1587484b9fece7208c51e2d49 *src/framework/DeclManager.h
a6e5cede15b3b172a4aea25033a1ce8a *src/framework/DeclParticle.h
3adfa181f3e77f9d403de8a0a18d0c95 *src/framework/DeclPDA.h
75b9fde04b70378da3bebcfd767b14aa *src/framework/DeclSkin.h
3d69c1de8791eb5c1c48a4ce16386506 *src/framework/DeclTable.h
11ab17b676bda521cd354dc86dfd3f5b *src/framework/File.h
e92aa99dba6f14290bc0a52e804d396e *src/framework/FileSystem.h
7ade28527ea08cc07a948e432f3ec4ba *src/framework/Licensee.h
2e1a7e1beeb04f0544fce5dae5a60fe3 *src/framework/Licensee.h~
b7fe4b168ae34a31d5ca772e8c10f236 *src/framework/UsercmdGen.h
56b975ec4265f4d5f729585dc1201df4 *src/game/Actor.cpp
87accdd5fdf457551d5853680fafb141 *src/game/Actor.h
7d66b9397301033f63b2dfa6537c89c5 *src/game/AF.cpp
ec286d2cf851db847021795908d27c12 *src/game/AF.h
3ab86ad5934be48831b5fdc590a1e0ca *src/game/AFEntity.cpp
7bf66006050beda99b11c8040251b129 *src/game/AFEntity.h
f03ba687f94f1ffb13ac814486de2340 *src/game/ai/AAS.cpp
3ee992286f1b1641cdcfc6d443b99d14 *src/game/ai/AAS.h
8035de9626e57d12c848b77546feccb3 *src/game/ai/AAS_debug.cpp
6c2876fc8190a0d3f3789b1577c45ec1 *src/game/ai/AAS_local.h
b1823e1aad4d2261f9d5d9bc06d5a95f *src/game/ai/AAS_pathing.cpp
62fe990c48174e83fdaeeaf63f58d07a *src/game/ai/AAS_routing.cpp
a84f13a41a98b77c76ae23dc2e0c2ee5 *src/game/ai/AI.cpp
a669a1843a7bbf4407d3c70d062dc408 *src/game/ai/AI.h
0f77e62adfea8c29069bca726478ed7d *src/game/ai/AI_events.cpp
675d4dbfab5c332c53313d9d9e7ec4d4 *src/game/ai/AI_pathing.cpp
a730df35afccadc7382d140ee28b3aea *src/game/ai/AI_Vagary.cpp
b8bc423a3369d61df9b9b7bc22a7ebd9 *src/game/anim/Anim.cpp
b86f393f092421ca83abb354c5b72e91 *src/game/anim/Anim.h
d0bf02c14cfd12eda16b69d75fcda19c *src/game/anim/Anim_Blend.cpp
40697f546da5b79869176fae43ae032d *src/game/anim/Anim_Import.cpp
c2c6a164bce3816f6e75ff8261048be0 *src/game/anim/Anim_Testmodel.cpp
9e09b5e8640ec36f86761e77dcd855c9 *src/game/anim/Anim_Testmodel.h
de34c777c4deff12775dd684d16febf3 *src/game/BrittleFracture.cpp
a011977466a557e80be87b1556e3c417 *src/game/BrittleFracture.h
f6e5d2601ac1335f82692b61ff1a1db1 *src/game/Camera.cpp
302973226944e14dc3a26fed1912d5cf *src/game/Camera.h
d58c6b6f1de81aef4b25abe9b96ed5f9 *src/game/EndLevel.cpp
a44b0e64ba6b4430dbc76363503c8256 *src/game/EndLevel.h
346b38062a46e974415b57e1c498d4a9 *src/game/Entity.cpp
b1d0ce6a101bc2eeaa1e94da673c7933 *src/game/Entity.h
502b575f49ac63603fe1edd6fd89745d *src/game/Fx.cpp
a7973abe1874af163b24d9725e60ed0a *src/game/Fx.h
9366293139f568d4f2ed28d9447e7c5e *src/game/Game.def
972d2ce92401cfc4b65cfc357d3472ea *src/game/Game.h
05b14ef43c96a51b4e1fce10cbfb8d2a *src/game/GameEdit.cpp
1d9a0d89c3e2d05fb26c60d68c3e17ad *src/game/GameEdit.h
42cf780f56a4f2c040aac9e81d70b4bb *src/game/gamesys/Callbacks.cpp
d39a837dd7712bd2ea64735a168508cc *src/game/gamesys/Class.cpp
e3d5465ac9a9ca711f2ea834e10b5fa6 *src/game/gamesys/Class.h
279bde28025a669dbf47ee435dab52a8 *src/game/gamesys/DebugGraph.cpp
9281bfa4a0c7d44992a5b69acbed0a74 *src/game/gamesys/DebugGraph.h
363e6574b6a9ff9ace329daaa7404190 *src/game/gamesys/Event.cpp
ce26aec947d6735d37cacb7e98219ab9 *src/game/gamesys/Event.h
1f292a9218d3292c11323d078bc6b0d6 *src/game/gamesys/GameTypeInfo.h
969aae4b4f3c5a51c342226c5f6b6d66 *src/game/gamesys/NoGameTypeInfo.h
7ad6879f350cdbb92a0910ea1a9a7fd1 *src/game/gamesys/SaveGame.cpp
d7bf2021a698a9c6f4504d17f1a79b0a *src/game/gamesys/SaveGame.h
23ccafd508ee1ae008f79d52c0316513 *src/game/gamesys/SysCmds.cpp
4b62f19c063511dee00c83845ce7f320 *src/game/gamesys/SysCmds.h
5412d6d994d3715ddff6a5e82768695d *src/game/gamesys/SysCvar.cpp
c377c1379e4877e7f8edc5debd4b75e0 *src/game/gamesys/SysCvar.h
96a3281440a7ebd0e44ab72c1e8b9009 *src/game/gamesys/TypeInfo.cpp
9e29ac4220a128524accb58d587470c2 *src/game/gamesys/TypeInfo.h
139f571bdd739efbf46212b787d25232 *src/game/Game_local.cpp
f1600c53c7569c056edda6c4620ccd45 *src/game/Game_local.h
c348767fb44983462b051cad65756fb2 *src/game/Game_network.cpp
8737f8f651bcab2b4bc202a5f50d667e *src/game/IK.cpp
df74f5d7c6a346ee41a131864ac33a06 *src/game/IK.h
9a81c3987f89aabad2f17e0b93892203 *src/game/Item.cpp
689d41c13b7503e080d47d1baddf712e *src/game/Item.h
a3a2b1fe87a8b8804939a472ec8a3e84 *src/game/Light.cpp
eccb2ba974b76556f6a4c4ca6eb1dacc *src/game/Light.h
b8bf206f0c303223042e7328b7f156c2 *src/game/Misc.cpp
45255b27221275d1acf8bc2bca2011cc *src/game/Misc.h
a6eda57244d8940f2c07c126f1238b16 *src/game/Moveable.cpp
99be3c44f5831a8d2df4d8c44f81b073 *src/game/Moveable.h
673b9d6354db859ff8841e51b4d90a74 *src/game/Mover.cpp
7bc54954ca08fba3932a519444017612 *src/game/Mover.h
09b7961342bebf27a825acc7c2ced71c *src/game/MultiplayerGame.cpp
df68626bb9306f9bba0dae46011250f6 *src/game/MultiplayerGame.h
7262d1b194228fa6b186cfc29cffdef8 *src/game/physics/Clip.cpp
577044d81536fd081d936705bad6e669 *src/game/physics/Clip.h
db95fc8774df9f0971ffa47db89cd709 *src/game/physics/Force.cpp
9271f887b94b4dd70e8e31582c3cc765 *src/game/physics/Force.h
8891ce4f1b093c485c4838c65d35fa45 *src/game/physics/Force_Constant.cpp
fd9feebfee3a799541f006879eb569c3 *src/game/physics/Force_Constant.h
56187680952cacefb0fb8b689612ec2f *src/game/physics/Force_Drag.cpp
0fb5bef472d8710b8b0c4961ac424309 *src/game/physics/Force_Drag.h
b3805a50b055009e514413935d48eaae *src/game/physics/Force_Field.cpp
39024be5e301ab2949250a90a12e3f1e *src/game/physics/Force_Field.h
4868787409b28a30fc337721bf52b2d5 *src/game/physics/Force_Spring.cpp
a3079b4e01fa293555d62767e9a75eb5 *src/game/physics/Force_Spring.h
d60b09eced926973a02624fe72c097ad *src/game/physics/Physics.cpp
d2e28cc845e5640d8465214a84c2219c *src/game/physics/Physics.h
03635081f0b4f12746d939b8ae94fc4c *src/game/physics/Physics_Actor.cpp
056e1e0d7f36cac413c78094c63c50e8 *src/game/physics/Physics_Actor.h
548912303ec919606fd571409e0d6b3f *src/game/physics/Physics_AF.cpp
cb3e0bcb7e1788cfdbdba12d66f9ed00 *src/game/physics/Physics_AF.h
61579ebbcf21ec719e7258d0d1e906c7 *src/game/physics/Physics_Base.cpp
e439ac91101079a93ba687470bbdb713 *src/game/physics/Physics_Base.h
ef50cc527673f51394cf8bf9e823eec6 *src/game/physics/Physics_Monster.cpp
c07dc14cdc28823871ced4cfb834cfc8 *src/game/physics/Physics_Monster.h
280e64fa2d3ee444e26f32305bc3d898 *src/game/physics/Physics_Parametric.cpp
f93bdcc492f50db67878e2274044d7ab *src/game/physics/Physics_Parametric.h
c06e587495eed3157e38eafb9585dcfc *src/game/physics/Physics_Player.cpp
572fe5e12fae49bcd35f264edb765890 *src/game/physics/Physics_Player.h
2553326601252426098bdae4296fdabb *src/game/physics/Physics_RigidBody.cpp
5ca7efd2006e2de31ada159f7ba8f7be *src/game/physics/Physics_RigidBody.h
cd1687b82e2361c803bd528e94d393a7 *src/game/physics/Physics_Static.cpp
ca2ae3f0cc147acd3743a97e4184b43d *src/game/physics/Physics_Static.h
e2d822925adc488b22682937303b47f8 *src/game/physics/Physics_StaticMulti.cpp
f6ca48445ad2a16ae42ebd067a3dfc5b *src/game/physics/Physics_StaticMulti.h
39d50cc9f5bb1ceb1beca9c6aab64f68 *src/game/physics/Push.cpp
b1f7b4d666e0d79646aec2c1ada2be19 *src/game/physics/Push.h
010c0c56ca82a1ff81b3b12d5312ffe0 *src/game/Player.cpp
7150bb6badbb3185ded2a63bcd1b2bf3 *src/game/Player.h
490d26cd1169a6e76fef196ae6fa2158 *src/game/PlayerIcon.cpp
95261c80073066193a603fe646eadced *src/game/PlayerIcon.h
1540ddffd03de461ff7a39dfe3c7e0e2 *src/game/PlayerView.cpp
db3455c0347cb7bdde4d0339d82f6e1e *src/game/PlayerView.h
800c3289a5da63eb7ecca9bf99c6ff12 *src/game/Projectile.cpp
8afb029a42a7c4939c004885d84380e4 *src/game/Projectile.h
0140739513277028fc53e0e5257b0b97 *src/game/Pvs.cpp
9cffa1c0f5461bd11ccedf27adea899d *src/game/Pvs.h
f7a48566c9644a3d7863a843ef38e18e *src/game/script/Script_Compiler.cpp
3e61acbaddfd43c61deb72109befc0fb *src/game/script/Script_Compiler.h
9b60efb81c99a2e1c4025a25791c28ba *src/game/script/Script_Interpreter.cpp
2a444b3863bfd1f1d505883250b5188e *src/game/script/Script_Interpreter.h
c218b13187e3eaea5b9b959b4613b047 *src/game/script/Script_Program.cpp
ac855d2669cdff1c615a631aecd27f64 *src/game/script/Script_Program.h
e38cb728413beaf77ab5182398ce274a *src/game/script/Script_Thread.cpp
8aca84be8cdedc909443c84f1c0a208c *src/game/script/Script_Thread.h
a10d18197069f6b27c2d494dd946b9b7 *src/game/SecurityCamera.cpp
8ef631e222158b65ee9a4f5c04bff6df *src/game/SecurityCamera.h
4fa55ba5aa7f92e531b34847f6bee559 *src/game/SmokeParticles.cpp
e964690303add471140f387201c63de0 *src/game/SmokeParticles.h
7abad18d9f8f26669f7f4bc444a2489c *src/game/Sound.cpp
482b351917af91e26b3c52645674104f *src/game/Sound.h
58a53d103ef2f98209d422ecf7df19c3 *src/game/Target.cpp
1c999e2ff6d4bb5c5c409291756e7de5 *src/game/Target.h
7e420d0016eb039561be34a596debd63 *src/game/Trigger.cpp
ea3c3be1c40a32c47e65926082e1566f *src/game/Trigger.h
bb00d8a4533a9cc990983021a1049778 *src/game/Weapon.cpp
79b221f36e61e42a72ab340587f93ca6 *src/game/Weapon.h
adba1c884614cd0905abf3cca7ff1fa8 *src/game/WorldSpawn.cpp
ae46f21bfaa3e91ee35f3368971800d1 *src/game/WorldSpawn.h
10bad911c3bdb3eb256a33c8be69265d *src/idlib/Base64.cpp
ea126c0e8ba724d2ac66d4a0d3e2ba04 *src/idlib/Base64.h
8c1312e06abb830cfc2a7f03295eee58 *src/idlib/BitMsg.cpp
28741399100324ca61a779f729f3cd4c *src/idlib/BitMsg.h
d45b2d3d570c176c36b9253925b79230 *src/idlib/bv/Bounds.cpp
14650ac3e9ff1bfb03ba75347819fabd *src/idlib/bv/Bounds.h
5ea635b6c4970372aac953212120efc0 *src/idlib/bv/Box.cpp
cf905028e165369e492bf7d01191a3b2 *src/idlib/bv/Box.h
0fadc6ec2c20147440bf9f0dc9a4cf43 *src/idlib/bv/Frustum-linux.cpp
d7ffd33ea20af13a549ff1e4030aa441 *src/idlib/bv/Frustum.cpp
82cd915d980c9283e03c525ac91f9e51 *src/idlib/bv/Frustum.h
b487fc5a52b3d86eb21428dfd8d9a0e8 *src/idlib/bv/Sphere.cpp
2a1a1452e99fe8c49ee037653b76d216 *src/idlib/bv/Sphere.h
7d2f35652eb37e02da564128b8739a1b *src/idlib/CmdArgs.cpp
de04ca1dd8b19e0aebc74aeefd93c789 *src/idlib/CmdArgs.h
5038ebb317e1ae41975aac357d8f302a *src/idlib/containers/BinSearch.h
e1fe7702c576eacb7ae4d2a1bc4af716 *src/idlib/containers/BTree.h
01fd029e4c30f154149cc7a5d10ab851 *src/idlib/containers/HashIndex.cpp
0a55bc9e7c3f19de4c4fd1ee1ece1d6c *src/idlib/containers/HashIndex.h
3ba85097ca7a7a75bef9246a2c649718 *src/idlib/containers/HashTable.h
9f549a7317147b32de8c6938ccf67382 *src/idlib/containers/Hierarchy.h
d2a76dfa43e0648c6c63e521a020bb1e *src/idlib/containers/LinkList.h
3c7564a196935ce1cd79ecb29d448f78 *src/idlib/containers/List.h
6993b764a8b1897dfa095fddedd5dbcc *src/idlib/containers/PlaneSet.h
75f30a0d41cc375f49529f1d4cc90c98 *src/idlib/containers/Queue.h
d39a20aa40b0dee467cd271695923200 *src/idlib/containers/Stack.h
d1d7eca1471555d04d4cb30bef70efbe *src/idlib/containers/StaticList.h
8320894e1a591da60e33602753a1f6fd *src/idlib/containers/StrList.h
14cf4411222c6b09a57ad2e5f6cff3e9 *src/idlib/containers/StrPool.h
a156cd71b2e13828d3d1c6d57570b560 *src/idlib/containers/VectorSet.h
6fcacc47c0f1a424bbd2d1fbd79683f9 *src/idlib/Dict.cpp
830f9f2b849215c50794b1e52fe443ab *src/idlib/Dict.h
435819dbcc371bf493ba174162a5cb70 *src/idlib/geometry/DrawVert.cpp
d764c88408677ce409672df1a1c1d36a *src/idlib/geometry/DrawVert.h
814b29df7f0b5510c467042147f056ea *src/idlib/geometry/JointTransform.cpp
2f5924396160ca6794284dbf0074f007 *src/idlib/geometry/JointTransform.h
5875071c1d9fbf459b0fce95699f705e *src/idlib/geometry/Surface.cpp
3d17b9dc3f2a4c839707ccd0dd505bb6 *src/idlib/geometry/Surface.h
df29ec04b3dd278b835df308786e3052 *src/idlib/geometry/Surface_Patch.cpp
92f08bde7754e5bf04917770b8e0bfe7 *src/idlib/geometry/Surface_Patch.h
cadb910c628a3d4d2425b7216470caa5 *src/idlib/geometry/Surface_Polytope.cpp
fc05791ee6de10600ade4b89a2f7b449 *src/idlib/geometry/Surface_Polytope.h
33325797daff12c12146c93912b43787 *src/idlib/geometry/Surface_SweptSpline.cpp
1524b424da99265d71fa4fe44686d503 *src/idlib/geometry/Surface_SweptSpline.h
33f8f19e2c89d7287dac2d0639f67516 *src/idlib/geometry/TraceModel.cpp
08703ab16c3b26b6dcfbfca5d1f51b59 *src/idlib/geometry/TraceModel.h
e5b52176825082a2c9ea10d7ff9753fe *src/idlib/geometry/Winding.cpp
0e2a2008c99298143f52fed1b6127ceb *src/idlib/geometry/Winding.h
4fd1728745517f10cc970ea0edf3ff72 *src/idlib/geometry/Winding2D.cpp
178f31145e34802391b4af8748fcd21e *src/idlib/geometry/Winding2D.h
43afbaa7210721fa099797ccc2d5c218 *src/idlib/hashing/CRC16.cpp
7fba1646c49bd659758b73406d8549de *src/idlib/hashing/CRC16.h
954899e570a7e1098193dcb3ab32a3aa *src/idlib/hashing/CRC32.cpp
c7d0fb6d29c05419f1034eb980b23039 *src/idlib/hashing/CRC32.h
478a4ed0b8f8c3b8d7ad1f2a4037eac0 *src/idlib/hashing/CRC8.cpp
2e813c1d19c91be6e6b3c3a8a6cdc301 *src/idlib/hashing/CRC8.h
3c6b2ce7c807344cd92caf1d441bca7d *src/idlib/hashing/Honeyman.cpp
c664b62e17653aebbcd04c8701ddd08b *src/idlib/hashing/Honeyman.h
1b907599c03e01614983dea58963757a *src/idlib/hashing/MD4.cpp
d4a497cfc27d4507e53688f19fe8dce0 *src/idlib/hashing/MD4.h
339902d1dbcf1d97208178dc8c98a62e *src/idlib/hashing/MD5.cpp
0a3259f4f2875b733ffbe2708a02dda9 *src/idlib/hashing/MD5.h
5c76357cecac2b6bb7b9764cebfa3035 *src/idlib/Heap.cpp
a20bcd3df1e302a304a152b9e119d0ef *src/idlib/Heap.h
9f5f712967a20458d52234fb69104435 *src/idlib/LangDict.cpp
57ff18a40f19fbd475ddec81d5b85e0d *src/idlib/LangDict.h
7ddde694748f232429a4e745f69fc5d2 *src/idlib/Lexer.cpp
fa31f2bf2d78bc0a9025fc917e3ed902 *src/idlib/Lexer.h
fb368b07f9711d1df46e7f7fcf15516d *src/idlib/Lib.cpp
16c1bcf4da0bacaef54d6038956f28b9 *src/idlib/Lib.h
17ec37be4bdf61e32d396da844a33325 *src/idlib/MapFile.cpp
77b6b04e39488ea740506c6b359b77c9 *src/idlib/MapFile.h
6847fc795e9b6b842093bc297a694a8f *src/idlib/math/Angles.cpp
5dc4f1e41f7524873cdeadab3f82642b *src/idlib/math/Angles.h
e4f7edaaf05258d9c26007ad7ec5ea24 *src/idlib/math/Complex.cpp
4aafaade6e774171966cc70b7114a8ff *src/idlib/math/Complex.h
42ec8dc549d5552ec15aa378fbb78c69 *src/idlib/math/Curve.h
55e81c917119e99977ed2a9ca019253c *src/idlib/math/Extrapolate.h
a4d0e1c970873a63364f03fb1f4f4b9d *src/idlib/math/Interpolate.h
2364df4b95a02db32a411fd69e63b12a *src/idlib/math/Lcp.cpp
e0bf54026a72d40b686f71525683cb8f *src/idlib/math/Lcp.h
bf2523f0eaa0e1490d43cdb46f44cdd0 *src/idlib/math/Math.cpp
574b0cf28c3d13218fe24167deff99f0 *src/idlib/math/Math.h
d9d97ae48dc142a1299ab3d3cde3c353 *src/idlib/math/Matrix.cpp
744fc4a9bf2aeafd18a98c6526b2796f *src/idlib/math/Matrix.h
9e64458de095626b5c552c4fdceb726c *src/idlib/math/Ode.cpp
b2f42b71ebd1b0cb5bd730ca1a23d9dc *src/idlib/math/Ode.h
d3140e8a5fe85ffa1ce556589e23b846 *src/idlib/math/Plane.cpp
e6d9b1b3d596b28ed4098b04389ead00 *src/idlib/math/Plane.h
264260647bb911a1071efbee810d50e8 *src/idlib/math/Pluecker.cpp
e0ce6b004f0005c82abe5cebf38cfe59 *src/idlib/math/Pluecker.h
297af895642ee92c40816decb36e0c4a *src/idlib/math/Polynomial.cpp
03bc11f2e3d70ec7d4cd83f731c2e1dd *src/idlib/math/Polynomial.h
86148234cc2169eb3f5fed753e994539 *src/idlib/math/Quat.cpp
7df4388b58ea67d328ff6107d45f9dbc *src/idlib/math/Quat.h
3a9710abf5882642c09dbddd29a7a08d *src/idlib/math/Random.h
38481abd5916b83422f0f995ae9e1884 *src/idlib/math/Rotation.cpp
cf5b0e0fd91f8499196aee1e616e84a3 *src/idlib/math/Rotation.h
de5a618cade4cbff94362e12495d5a34 *src/idlib/math/Simd.cpp
145aed28ff0e099a7982bb659eeebaa2 *src/idlib/math/Simd.h
ba0c6eccbe8bf996a83998eb5d70430d *src/idlib/math/Simd_3DNow.cpp
2d53fb2f5286cec5da2099e0fd1cf290 *src/idlib/math/Simd_3DNow.h
b15bab713795d586b16516348309c097 *src/idlib/math/Simd_AltiVec.cpp
2717c4ae65116371440f140d4f1fc5b1 *src/idlib/math/Simd_AltiVec.h
43b93652a8047c9c7bda1f7ba53c12ed *src/idlib/math/Simd_Generic.cpp
d09fb3a0cd76bc807f41398ba1bbc358 *src/idlib/math/Simd_Generic.h
da36ccd911f492f78d8cf6eed7c4ceca *src/idlib/math/Simd_MMX.cpp
f9f3725cbfd4b0eb8b8d0a265c45365d *src/idlib/math/Simd_MMX.h
77d051b2b11c28bfc5e5124d96aaf420 *src/idlib/math/Simd_SSE.cpp
4e6dd9174c46af7a813dac3e308f3de0 *src/idlib/math/Simd_SSE.h
22e7dc426cd3aa25372429a7bd9df059 *src/idlib/math/Simd_SSE2.cpp
fbc4426daca37ebf86f05904f4a5b0bf *src/idlib/math/Simd_SSE2.h
c71ed081a78055ac59244a1df9a7af18 *src/idlib/math/Simd_SSE3.cpp
d93730fba4e34089fbe34e588292cdd4 *src/idlib/math/Simd_SSE3.h
a1483875a16c31f3a50bee0f75dcda33 *src/idlib/math/Vector.cpp
25f68a30acb1e60730b6ff997b897d59 *src/idlib/math/Vector.h
9be71b8af547b601581dda3172c80685 *src/idlib/Parser.cpp
0386adb078ff1c52c07f4b3ccf8e6a3f *src/idlib/Parser.h
7bc75e24b08006a28710dce9762f1e17 *src/idlib/precompiled.h
e272339ca140e674992d2e831c51abb8 *src/idlib/Str.cpp
4309c740635191d0593407dac24655da *src/idlib/Str.h
c007a652e5d6f139529853822515cc51 *src/idlib/Timer.cpp
bcdf86d0dc26dabd83ac3d5bac5c5a5e *src/idlib/Timer.h
ac6fb8eafd4616e29a7faeafa032e725 *src/idlib/Token.cpp
20c9b0e0146f5fec26d03bd7948631c0 *src/idlib/Token.h
be7fa36da9d1f7f14dd995c0b5b10142 *src/idlib.vcproj
3b1d1d3c06b41cabdf1db20d0c70e799 *src/MayaImport/maya_main.h
e2b87ed822c749ea8fa16283f49fbec3 *src/MayaImport.vcproj
73b268519d1fe463f1cbdc0f629db078 *src/renderer/Cinematic.h
89b029c9dbfb6034c5f333040e986fd2 *src/renderer/glext.h
ee942ae4158802dc2e0321813989451f *src/renderer/Material.h
331d2c34c56160603cc9e62c6c5615e3 *src/renderer/Model.h
69e03fb16f187b96760ae60f6dcb25d5 *src/renderer/ModelManager.h
23c1e21454370196b454df0df265e38a *src/renderer/qgl.h
d7cef91f74111c3f718fbb013f0e89fb *src/renderer/qgl_linked.h
1d39d13fd337296384f235f3d3a57832 *src/renderer/RenderSystem.h
8001ab373ca72f0ccdfee104ce65b669 *src/renderer/RenderWorld.h
1c12d01e216c70fd59c38c82123102bc *src/SConstruct
05ff30469c4d330d65d01947aeb49266 *src/sound/sound.h
99de5ead06f5526a2bc2e223be36f506 *src/sys/linux/qgl_enforce.h
f82d3ff93a079bea354f11a1ab4451b7 *src/sys/scons/SConscript.game
14e8eeee647a88f0e8572b6354484249 *src/sys/scons/SConscript.idlib
62cc545dde9c8990fadcb46d0ef13d4b *src/sys/scons/scons_utils.py
bca08bc9a651ee2a4865e2aa89bc8e36 *src/sys/sys_public.h
125d82621ba140bcbd51b25bc03bf03f *src/tools/compilers/aas/AASFile.h
98b1ef423b759cad4d9fffbc10d4598e *src/tools/compilers/aas/AASFileManager.h
473dc012029bdd1fb49382c43d1904c3 *src/ui/ListGUI.h
613d12903b3a0f979d52f697145715c4 *src/ui/UserInterface.h
80d7d7d37c3dd53790cbf78f31196bc5 *vehicles/af/env_vehicle_simplebuggy.af
9f2394d96b77cc9de7a2e3d7260fb033 *vehicles/def/env_simplevehicle.def
05a8defa084e8e2cffb4e26749575133 *vehicles/game00.pk4
0a02ac09bc92c6e3bf4a97da8e0054ab *vehicles/maps/testmaps/test_vehicle.cm
74fa3ab82f81978e313cb77f07b15efb *vehicles/maps/testmaps/test_vehicle.map
81cb35140c0e38fd7dd86d2235f9eb31 *vehicles/maps/testmaps/test_vehicle.proc
999593e1b407797ddbf0181620670e9a *vehicles/maps/testmaps/test_vehicle.script
c0623dcaea4fbf6ce890a35767be746e *vehicles/maps/testmaps/test_vehicle2.cm
f582d207eabe141349c1c71883bc83e5 *vehicles/maps/testmaps/test_vehicle2.map
281645579d053c47f2f71b9f8661cc44 *vehicles/maps/testmaps/test_vehicle2.proc
341252364d5807e531ba8fc4832983b2 *vehicles/maps/testmaps/test_vehicle2.script
1e39fc8c73c855553ee9f312764f55ca *vehicles/maps/testmaps/test_vehicle_terrain.ase
2375734e8a1eb60f279c780c026cae38 *vehicles/models/md5/vehicles/buggy/buggy.mb
be9227250a5ce53ec365f73526654a93 *vehicles/models/md5/vehicles/buggy/buggy.md5anim
5289507aaf5cc7900d77bd380ae9e0ee *vehicles/models/md5/vehicles/buggy/buggy.md5mesh
180b91d17b3c9341d9dedff4bb34411b *vehicles/models/md5/vehicles/buggy/buggy.tga
39f3a6981658a72625bb8983a962d66f *vehicles/models/md5/vehicles/buggy/buggy_d.tga
147db9b809602de2da99ff5c6b5cb36d *vehicles/models/md5/vehicles/buggy/buggy_local.tga
a97253ee8fff39d798edc7d0536cf9c9 *vehicles/models/md5/vehicles/buggy/buggy_turret_d.tga
966384b9f9373c69781287b5d6079bed *vehicles/models/md5/vehicles/buggy/buggy_turret_local.tga
180b91d17b3c9341d9dedff4bb34411b *vehicles/models/md5/vehicles/buggy/gun.tga
180b91d17b3c9341d9dedff4bb34411b *vehicles/models/md5/vehicles/buggy/turret.tga
180b91d17b3c9341d9dedff4bb34411b *vehicles/models/md5/vehicles/buggy/wheel.tga
6a16211eb7cbbc8a7079a57c4abdf652 *vehicles/models/md5/vehicles/buggy/wheel_d.tga
5e0aac8bfb2ad55cc3b12913c7d8b574 *vehicles/models/md5/vehicles/buggy/wheel_local.tga
e505dce717d443bd61a5b67d7cb12f71 *vehicles/models/md5/vehicles/buggy/wheel_s.tga
07b354a5cb974a8b7ab1f100fe2e264d *vehicles/models/md5/vehicles/locust/initial.md5anim
9e35209909d5299d24007496bff459ca *vehicles/models/md5/vehicles/locust/locust.md5mesh
73bc1d9ae5652b3bf6a1f1b8850ccf42 *vehicles/readme.txt
d329162eec1c3032b09093873cd239ca *vehicles/textures/base_floor/concrete01.tga
be239f082c721c4618a6ea66ee18eaa0 *vehicles/textures/base_floor/concrete01d.tga
640bc8e08c0446019ed832e1c4bf172e *vehicles/textures/base_floor/concrete01s copy.tga
640bc8e08c0446019ed832e1c4bf172e *vehicles/textures/base_floor/concrete01s.tga
b84284d1b85ca5ee877de786531bad54 *vehicles/textures/stone/sand01.tga
508ca81cd2ee9242e41a0b5e8a41cdc7 *vehicles/textures/stone/sand01_d.tga
f666c13e5a5c669c7fed43e00f3a6e94 *vehicles/textures/stone/sand01_s.tga
814bcec5c20cc2658a75fe8f62547692 *vehicles/textures/stone/sand02.tga

213
neo/sys/linux/casedir.patch Normal file
View File

@@ -0,0 +1,213 @@
Index: framework/FileSystem.cpp
===================================================================
--- framework/FileSystem.cpp (revision 528)
+++ framework/FileSystem.cpp (working copy)
@@ -159,7 +159,7 @@
};
// 3 search patch (fs_savepath fs_basepath fs_cdpath)
-// .jpg then .tga for
+// often .jpg and .tga patterns
#define MAX_CACHED_DIRS 6
class idDEntry : public idStrList {
@@ -173,6 +173,11 @@
void Init(const char *directory, const char *extension, const idStrList &list );
};
+typedef struct {
+ idStr path;
+ idStr OSpath;
+} casematch_t;
+
class idFileSystem_local : public idFileSystem {
public:
idFileSystem_local( void );
@@ -227,11 +232,14 @@
int numServerPaks;
int serverPaks[MAX_SEARCH_PATHS];
- idDEntry dir_cache[MAX_CACHED_DIRS]; // fifo
+ idDEntry dir_cache[MAX_CACHED_DIRS]; // fifo
int dir_cache_index;
int dir_cache_count;
+
+ idList<casematch_t> dir_case; // match directories in a case insensitive way
private:
+ const char * CaseSearch(const char *in_dir);
void ReplaceSeparators( idStr &path, char sep = PATHSEPERATOR_CHAR );
long HashFileName( const char *fname ) const;
bool FilenameCompare( const char *s1, const char *s2 );
@@ -1118,6 +1126,89 @@
/*
===============
+idFileSystem_local::CaseSearch
+===============
+*/
+const char* idFileSystem_local::CaseSearch(const char *in_dir) {
+ const char *ret;
+ int i, j;
+ // FIXME: go faster with a hash?
+ for( i=0; i<dir_case.Num(); i++ ) {
+ if ( !dir_case[i].path.Cmp( in_dir ) ) {
+ ret = dir_case[i].OSpath.c_str();
+ Com_Printf("index %d: '%s' matched as '%s'\n", i, in_dir, ret);
+ if ( ret[0] == '\0' ) {
+ return NULL;
+ }
+ return ret;
+ }
+ }
+ casematch_t entry;
+ entry.path = in_dir;
+ Com_Printf("CaseSearch not found: '%s'\n", in_dir);
+ // walk down the directory tree searching for a case insensitive match
+ // use StripFilename to bust out the chunks
+ idStrList dirs;
+ idStrList entries;
+ idStr walk_path = in_dir;
+ idStr current_dir;
+ int list_ret;
+ do {
+ walk_path.ExtractFileName(current_dir);
+ dirs.Append(current_dir);
+ walk_path.StripFilename(); // this is double work
+ Com_Printf("have walk_path: %s, current_dir: %s\n", walk_path.c_str(), current_dir.c_str());
+ } while ( walk_path.Length() && ( list_ret = Sys_ListFiles( walk_path.c_str(), "/", entries ) == -1 ) );
+ // we have walked up to the first directory
+ if ( list_ret == -1 ) {
+ Com_DPrintf("WARNING: didn't find any matching root directory for '%s'\n", in_dir);
+ dir_case.Append(entry);
+ return NULL;
+ }
+ // start walking down and doing matches
+ bool bMatched;
+ entry.OSpath = walk_path;
+ for( i=dirs.Num()-1 ; i>=0; i-- ) {
+ Com_Printf("chunk: %s\n", dirs[i].c_str() );
+ bMatched = false;
+ for( j=0 ; j<entries.Num() ; j++ ) {
+ Com_Printf("match %s and %s\n", dirs[i].c_str(), entries[j].c_str());
+ if ( !dirs[i].Icmp(entries[j]) ) {
+ Com_Printf("we have a match, add this to the path and go down\n");
+ bMatched = true;
+ break; // NOTE: we could keep scanning and detect conflicts?
+ }
+ }
+ // if we didn't match, abort
+ if (!bMatched) {
+ Com_Printf("no match\n");
+ entry.OSpath = "";
+ dir_case.Append(entry);
+ return NULL;
+ }
+ entry.OSpath += PATHSEPERATOR_STR;
+ entry.OSpath += entries[j];
+ // get the directory list
+ if ( Sys_ListFiles( entry.OSpath.c_str(), "/", entries ) == -1 ) {
+ Com_DPrintf("WARNING: didn't find entries in '%s' after successful icase match\n", entry.OSpath.c_str());
+ entry.OSpath = "";
+ dir_case.Append(entry);
+ return NULL;
+ }
+ }
+
+ dir_case.Append(entry);
+ ret = dir_case[ dir_case.Num() - 1 ].OSpath.c_str();
+ Com_Printf("case matched '%s' as '%s'\n", in_dir, ret);
+ if ( ret[0] == '\0' ) {
+ Com_DPrintf("WARNING: unexpected empty entry after successful case walk for '%s'\n", in_dir);
+ return NULL;
+ }
+ return ret;
+}
+
+/*
+===============
idFileSystem_local::ListOSFiles
call to the OS for a listing of files in an OS directory
@@ -1156,10 +1247,19 @@
ret = Sys_ListFiles( directory, extension, list );
if ( ret == -1 ) {
- return -1;
+ // try a case insensitive directory walk
+ const char *cased_dir = CaseSearch(directory);
+ if (!cased_dir) {
+ return -1;
+ }
+ ret = Sys_ListFiles( cased_dir, extension, list );
+ if ( ret == -1 ) {
+ Com_DPrintf("idFileSystem_local::ListOSFiles: unexpected, Sys_ListFiles failed on case matched directory\n");
+ return -1;
+ }
}
- // push a new entry
+ // push a new entry - (if case matched we are caching with the requested directory name)
dir_cache[dir_cache_index].Init( directory, extension, list );
dir_cache_index = (++dir_cache_index) % MAX_CACHED_DIRS;
if ( dir_cache_count < MAX_CACHED_DIRS ) {
@@ -1633,6 +1733,11 @@
dir_cache_index = 0;
dir_cache_count = 0;
+ for ( int i = 0 ; i < MAX_CACHED_DIRS ; i++ ) {
+ dir_cache[i].Clear();
+ }
+
+ dir_case.Clear();
// free everything
for ( sp = searchPaths; sp; sp = next ) {
Index: sys/linux/ChangeLog
===================================================================
--- sys/linux/ChangeLog (revision 528)
+++ sys/linux/ChangeLog (working copy)
@@ -81,6 +81,31 @@
renderer TODO:
- bring up logging capability on *nix (implies non-implicit GL dependency mode)
+case insensitive directory walk - NOTES:
+
+wrote the base stuff. keeps a list of attempted/not found dirs.
+with the case sensitive match if exists
+dumb lookup currently, probably a bit expensive in CPU and mem
+hash table would speed this up
+
+still not sure that's the right way to go with this. I think the client should send
+out warnings when it finds bad cased directory, and in the long run abort
+with an error. That would be the only way to safe keep portability.
+
+trying to find good test case for that stuff
+scary: 300 entries for game/admin?
+design the search tree some other way? binary tree? (yeah why not)
+grep "Couldn't load" run.log | grep -v nin
+
+WARNING: Couldn't load image: models/mapobjects/tables/udesk/udesk_local
+
+timo@slinky:~/Id/DoomBase.ftpfs/base$ ls models/mapobjects/tables/Udesk/
+udesk.lwo udesk2.tga udesk_local.tga work
+udesk.tga udesk_base.lwo udesk_s.tga
+
+Is there an entry point for a directory instead of a file? What happens?
+(i.e. last directory of the path is cased)
+
idBoneController
2003-05-09 TTimo <ttimo@idsoftware.com>
Index: sys/sys_public.h
===================================================================
--- sys/sys_public.h (revision 528)
+++ sys/sys_public.h (working copy)
@@ -137,6 +137,7 @@
// use fs_debug to verbose Sys_ListFiles
// returns -1 if directory was not found (the list is cleared)
+// if there is a / passed as extension, return directories
int Sys_ListFiles( const char *directory, const char *extension, idStrList &list);
// For the mac, we need to explicitly flush vertex buffer areas before using them

View File

@@ -0,0 +1,92 @@
/*
===========================================================================
Doom 3 GPL Source Code
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
This file is part of the Doom 3 GPL Source Code (?Doom 3 Source Code?).
Doom 3 Source Code is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Doom 3 Source Code 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
along with Doom 3 Source Code. If not, see <http://www.gnu.org/licenses/>.
In addition, the Doom 3 Source Code is also subject to certain additional terms. You should have received a copy of these additional terms immediately following the terms and conditions of the GNU General Public License which accompanied the Doom 3 Source Code. If not, please request a copy in writing from id Software at the address below.
If you have questions concerning this license or the applicable additional terms, you may contact in writing id Software LLC, c/o ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA.
===========================================================================
*/
#include "../../idlib/precompiled.h"
#include "../../renderer/tr_local.h"
#include "../posix/posix_public.h"
#include "local.h"
/*
==========
input
==========
*/
void Sys_InitInput( void ) { }
void Sys_ShutdownInput( void ) { }
void Sys_GrabMouseCursor( bool ) { }
int Sys_PollMouseInputEvents( void ) { return 0; }
void Sys_EndMouseInputEvents( void ) { }
int Sys_ReturnMouseInputEvent( const int n, int &action, int &value ) { return 0; }
int Sys_PollKeyboardInputEvents( void ) { return 0; }
void Sys_EndKeyboardInputEvents( void ) { }
int Sys_ReturnKeyboardInputEvent( const int n, int &action, bool &state ) { return 0; }
unsigned char Sys_MapCharForKey( int key ) { return (unsigned char)key; }
/*
================
Sys_GetVideoRam
returns in megabytes
================
*/
int Sys_GetVideoRam( void ) {
return 64;
}
/*
==========
GL
==========
*/
void GLimp_EnableLogging( bool enable ) { }
bool GLimp_Init( glimpParms_t a ) { return true; }
void GLimp_SetGamma( unsigned short red[256],
unsigned short green[256],
unsigned short blue[256] ) { }
void GLimp_Shutdown( void ) { }
void GLimp_SwapBuffers( void ) { }
void GLimp_DeactivateContext( void ) { }
void GLimp_ActivateContext( void ) { }
bool GLimp_SetScreenParms( glimpParms_t parms ) { return true; }

668
neo/sys/linux/glimp.cpp Normal file
View File

@@ -0,0 +1,668 @@
/*
===========================================================================
Doom 3 GPL Source Code
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
This file is part of the Doom 3 GPL Source Code (?Doom 3 Source Code?).
Doom 3 Source Code is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Doom 3 Source Code 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
along with Doom 3 Source Code. If not, see <http://www.gnu.org/licenses/>.
In addition, the Doom 3 Source Code is also subject to certain additional terms. You should have received a copy of these additional terms immediately following the terms and conditions of the GNU General Public License which accompanied the Doom 3 Source Code. If not, please request a copy in writing from id Software at the address below.
If you have questions concerning this license or the applicable additional terms, you may contact in writing id Software LLC, c/o ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA.
===========================================================================
*/
#include "../../idlib/precompiled.h"
#include "../../renderer/tr_local.h"
#include "local.h"
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
extern "C" {
# include "libXNVCtrl/NVCtrlLib.h"
}
idCVar sys_videoRam( "sys_videoRam", "0", CVAR_SYSTEM | CVAR_ARCHIVE | CVAR_INTEGER, "Texture memory on the video card (in megabytes) - 0: autodetect", 0, 512 );
Display *dpy = NULL;
static int scrnum = 0;
Window win = 0;
bool dga_found = false;
static GLXContext ctx = NULL;
static bool vidmode_ext = false;
static int vidmode_MajorVersion = 0, vidmode_MinorVersion = 0; // major and minor of XF86VidExtensions
static XF86VidModeModeInfo **vidmodes;
static int num_vidmodes;
static bool vidmode_active = false;
// backup gamma ramp
static int save_rampsize = 0;
static unsigned short *save_red, *save_green, *save_blue;
void GLimp_WakeBackEnd(void *a) {
common->DPrintf("GLimp_WakeBackEnd stub\n");
}
#ifdef ID_GL_HARDLINK
void GLimp_EnableLogging(bool log) {
static bool logging;
if (log != logging)
{
common->DPrintf("GLimp_EnableLogging - disabled at compile time (ID_GL_HARDLINK)\n");
logging = log;
}
}
#endif
void GLimp_FrontEndSleep() {
common->DPrintf("GLimp_FrontEndSleep stub\n");
}
void *GLimp_BackEndSleep() {
common->DPrintf("GLimp_BackEndSleep stub\n");
return 0;
}
bool GLimp_SpawnRenderThread(void (*a) ()) {
common->DPrintf("GLimp_SpawnRenderThread stub\n");
return false;
}
void GLimp_ActivateContext() {
assert( dpy );
assert( ctx );
qglXMakeCurrent( dpy, win, ctx );
}
void GLimp_DeactivateContext() {
assert( dpy );
qglXMakeCurrent( dpy, None, NULL );
}
/*
=================
GLimp_SaveGamma
save and restore the original gamma of the system
=================
*/
void GLimp_SaveGamma() {
if ( save_rampsize ) {
return;
}
assert( dpy );
XF86VidModeGetGammaRampSize( dpy, scrnum, &save_rampsize);
save_red = (unsigned short *)malloc(save_rampsize*sizeof(unsigned short));
save_green = (unsigned short *)malloc(save_rampsize*sizeof(unsigned short));
save_blue = (unsigned short *)malloc(save_rampsize*sizeof(unsigned short));
XF86VidModeGetGammaRamp( dpy, scrnum, save_rampsize, save_red, save_green, save_blue);
}
/*
=================
GLimp_RestoreGamma
save and restore the original gamma of the system
=================
*/
void GLimp_RestoreGamma() {
if (!save_rampsize)
return;
XF86VidModeSetGammaRamp( dpy, scrnum, save_rampsize, save_red, save_green, save_blue);
free(save_red); free(save_green); free(save_blue);
save_rampsize = 0;
}
/*
=================
GLimp_SetGamma
gamma ramp is generated by the renderer from r_gamma and r_brightness for 256 elements
the size of the gamma ramp can not be changed on X (I need to confirm this)
=================
*/
void GLimp_SetGamma(unsigned short red[256], unsigned short green[256], unsigned short blue[256]) {
if ( dpy ) {
int size;
GLimp_SaveGamma();
XF86VidModeGetGammaRampSize( dpy, scrnum, &size);
common->DPrintf("XF86VidModeGetGammaRampSize: %d\n", size);
if ( size > 256 ) {
// silly generic resample
int i;
unsigned short *l_red, *l_green, *l_blue;
l_red = (unsigned short *)malloc(size*sizeof(unsigned short));
l_green = (unsigned short *)malloc(size*sizeof(unsigned short));
l_blue = (unsigned short *)malloc(size*sizeof(unsigned short));
//int r_size = 256;
int r_i; float r_f;
for(i=0; i<size-1; i++) {
r_f = (float)i*255.0f/(float)(size-1);
r_i = (int)floor(r_f);
r_f -= (float)r_i;
l_red[i] = (int)round((1.0f-r_f)*(float)red[r_i]+r_f*(float)red[r_i+1]);
l_green[i] = (int)round((1.0f-r_f)*(float)green[r_i]+r_f*(float)green[r_i+1]);
l_blue[i] = (int)round((1.0f-r_f)*(float)blue[r_i]+r_f*(float)blue[r_i+1]);
}
l_red[size-1] = red[255]; l_green[size-1] = green[255]; l_blue[size-1] = blue[255];
XF86VidModeSetGammaRamp( dpy, scrnum, size, l_red, l_green, l_blue );
free(l_red); free(l_green); free(l_blue);
} else {
XF86VidModeSetGammaRamp( dpy, scrnum, size, red, green, blue );
}
}
}
void GLimp_Shutdown() {
if ( dpy ) {
Sys_XUninstallGrabs();
GLimp_RestoreGamma();
qglXDestroyContext( dpy, ctx );
#if !defined( ID_GL_HARDLINK )
GLimp_dlclose();
#endif
XDestroyWindow( dpy, win );
if ( vidmode_active ) {
XF86VidModeSwitchToMode( dpy, scrnum, vidmodes[0] );
}
XFlush( dpy );
// FIXME: that's going to crash
//XCloseDisplay( dpy );
vidmode_active = false;
dpy = NULL;
win = 0;
ctx = NULL;
}
}
void GLimp_SwapBuffers() {
assert( dpy );
qglXSwapBuffers( dpy, win );
}
/*
GLX_TestDGA
Check for DGA - update in_dgamouse if needed
*/
void GLX_TestDGA() {
int dga_MajorVersion = 0, dga_MinorVersion = 0;
assert( dpy );
#if defined( ID_ENABLE_DGA )
if ( !XF86DGAQueryVersion( dpy, &dga_MajorVersion, &dga_MinorVersion ) ) {
// unable to query, probalby not supported
common->Printf( "Failed to detect DGA DirectVideo Mouse\n" );
cvarSystem->SetCVarBool( "in_dgamouse", false );
dga_found = false;
} else {
common->Printf( "DGA DirectVideo Mouse (Version %d.%d) initialized\n",
dga_MajorVersion, dga_MinorVersion );
dga_found = true;
}
#else
dga_found = false;
#endif
}
/*
** XErrorHandler
** the default X error handler exits the application
** I found out that on some hosts some operations would raise X errors (GLXUnsupportedPrivateRequest)
** but those don't seem to be fatal .. so the default would be to just ignore them
** our implementation mimics the default handler behaviour (not completely cause I'm lazy)
*/
int idXErrorHandler(Display * l_dpy, XErrorEvent * ev) {
char buf[1024];
common->Printf( "Fatal X Error:\n" );
common->Printf( " Major opcode of failed request: %d\n", ev->request_code );
common->Printf( " Minor opcode of failed request: %d\n", ev->minor_code );
common->Printf( " Serial number of failed request: %lu\n", ev->serial );
XGetErrorText( l_dpy, ev->error_code, buf, 1024 );
common->Printf( "%s\n", buf );
return 0;
}
bool GLimp_OpenDisplay( void ) {
if ( dpy ) {
return true;
}
if ( cvarSystem->GetCVarInteger( "net_serverDedicated" ) == 1 ) {
common->DPrintf( "not opening the display: dedicated server\n" );
return false;
}
common->Printf( "Setup X display connection\n" );
// that should be the first call into X
if ( !XInitThreads() ) {
common->Printf("XInitThreads failed\n");
return false;
}
// set up our custom error handler for X failures
XSetErrorHandler( &idXErrorHandler );
if ( !( dpy = XOpenDisplay(NULL) ) ) {
common->Printf( "Couldn't open the X display\n" );
return false;
}
scrnum = DefaultScreen( dpy );
return true;
}
/*
===============
GLX_Init
===============
*/
int GLX_Init(glimpParms_t a) {
int attrib[] = {
GLX_RGBA, // 0
GLX_RED_SIZE, 8, // 1, 2
GLX_GREEN_SIZE, 8, // 3, 4
GLX_BLUE_SIZE, 8, // 5, 6
GLX_DOUBLEBUFFER, // 7
GLX_DEPTH_SIZE, 24, // 8, 9
GLX_STENCIL_SIZE, 8, // 10, 11
GLX_ALPHA_SIZE, 8, // 12, 13
None
};
// these match in the array
#define ATTR_RED_IDX 2
#define ATTR_GREEN_IDX 4
#define ATTR_BLUE_IDX 6
#define ATTR_DEPTH_IDX 9
#define ATTR_STENCIL_IDX 11
#define ATTR_ALPHA_IDX 13
Window root;
XVisualInfo *visinfo;
XSetWindowAttributes attr;
XSizeHints sizehints;
unsigned long mask;
int colorbits, depthbits, stencilbits;
int tcolorbits, tdepthbits, tstencilbits;
int actualWidth, actualHeight;
int i;
const char *glstring;
if ( !GLimp_OpenDisplay() ) {
return false;
}
common->Printf( "Initializing OpenGL display\n" );
root = RootWindow( dpy, scrnum );
actualWidth = glConfig.vidWidth;
actualHeight = glConfig.vidHeight;
// Get video mode list
if ( !XF86VidModeQueryVersion( dpy, &vidmode_MajorVersion, &vidmode_MinorVersion ) ) {
vidmode_ext = false;
common->Printf("XFree86-VidModeExtension not available\n");
} else {
vidmode_ext = true;
common->Printf("Using XFree86-VidModeExtension Version %d.%d\n",
vidmode_MajorVersion, vidmode_MinorVersion);
}
GLX_TestDGA();
if ( vidmode_ext ) {
int best_fit, best_dist, dist, x, y;
XF86VidModeGetAllModeLines( dpy, scrnum, &num_vidmodes, &vidmodes );
// Are we going fullscreen? If so, let's change video mode
if ( a.fullScreen ) {
best_dist = 9999999;
best_fit = -1;
for (i = 0; i < num_vidmodes; i++) {
if (a.width > vidmodes[i]->hdisplay ||
a.height > vidmodes[i]->vdisplay)
continue;
x = a.width - vidmodes[i]->hdisplay;
y = a.height - vidmodes[i]->vdisplay;
dist = (x * x) + (y * y);
if (dist < best_dist) {
best_dist = dist;
best_fit = i;
}
}
if (best_fit != -1) {
actualWidth = vidmodes[best_fit]->hdisplay;
actualHeight = vidmodes[best_fit]->vdisplay;
// change to the mode
XF86VidModeSwitchToMode(dpy, scrnum, vidmodes[best_fit]);
vidmode_active = true;
// Move the viewport to top left
// FIXME: center?
XF86VidModeSetViewPort(dpy, scrnum, 0, 0);
common->Printf( "Free86-VidModeExtension Activated at %dx%d\n", actualWidth, actualHeight );
} else {
a.fullScreen = false;
common->Printf( "Free86-VidModeExtension: No acceptable modes found\n" );
}
} else {
common->Printf( "XFree86-VidModeExtension: not fullscreen, ignored\n" );
}
}
// color, depth and stencil
colorbits = 24;
depthbits = 24;
stencilbits = 8;
for (i = 0; i < 16; i++) {
// 0 - default
// 1 - minus colorbits
// 2 - minus depthbits
// 3 - minus stencil
if ((i % 4) == 0 && i) {
// one pass, reduce
switch (i / 4) {
case 2:
if (colorbits == 24)
colorbits = 16;
break;
case 1:
if (depthbits == 24)
depthbits = 16;
else if (depthbits == 16)
depthbits = 8;
case 3:
if (stencilbits == 24)
stencilbits = 16;
else if (stencilbits == 16)
stencilbits = 8;
}
}
tcolorbits = colorbits;
tdepthbits = depthbits;
tstencilbits = stencilbits;
if ((i % 4) == 3) { // reduce colorbits
if (tcolorbits == 24)
tcolorbits = 16;
}
if ((i % 4) == 2) { // reduce depthbits
if (tdepthbits == 24)
tdepthbits = 16;
else if (tdepthbits == 16)
tdepthbits = 8;
}
if ((i % 4) == 1) { // reduce stencilbits
if (tstencilbits == 24)
tstencilbits = 16;
else if (tstencilbits == 16)
tstencilbits = 8;
else
tstencilbits = 0;
}
if (tcolorbits == 24) {
attrib[ATTR_RED_IDX] = 8;
attrib[ATTR_GREEN_IDX] = 8;
attrib[ATTR_BLUE_IDX] = 8;
} else {
// must be 16 bit
attrib[ATTR_RED_IDX] = 4;
attrib[ATTR_GREEN_IDX] = 4;
attrib[ATTR_BLUE_IDX] = 4;
}
attrib[ATTR_DEPTH_IDX] = tdepthbits; // default to 24 depth
attrib[ATTR_STENCIL_IDX] = tstencilbits;
visinfo = qglXChooseVisual(dpy, scrnum, attrib);
if (!visinfo) {
continue;
}
common->Printf( "Using %d/%d/%d Color bits, %d Alpha bits, %d depth, %d stencil display.\n",
attrib[ATTR_RED_IDX], attrib[ATTR_GREEN_IDX],
attrib[ATTR_BLUE_IDX], attrib[ATTR_ALPHA_IDX],
attrib[ATTR_DEPTH_IDX],
attrib[ATTR_STENCIL_IDX]);
glConfig.colorBits = tcolorbits;
glConfig.depthBits = tdepthbits;
glConfig.stencilBits = tstencilbits;
break;
}
if (!visinfo) {
common->Printf("Couldn't get a visual\n");
return false;
}
// window attributes
attr.background_pixel = BlackPixel(dpy, scrnum);
attr.border_pixel = 0;
attr.colormap = XCreateColormap(dpy, root, visinfo->visual, AllocNone);
attr.event_mask = X_MASK;
if (vidmode_active) {
mask = CWBackPixel | CWColormap | CWSaveUnder | CWBackingStore |
CWEventMask | CWOverrideRedirect;
attr.override_redirect = True;
attr.backing_store = NotUseful;
attr.save_under = False;
} else {
mask = CWBackPixel | CWBorderPixel | CWColormap | CWEventMask;
}
win = XCreateWindow(dpy, root, 0, 0,
actualWidth, actualHeight,
0, visinfo->depth, InputOutput,
visinfo->visual, mask, &attr);
XStoreName(dpy, win, GAME_NAME);
// don't let the window be resized
// FIXME: allow resize (win32 does)
sizehints.flags = PMinSize | PMaxSize;
sizehints.min_width = sizehints.max_width = actualWidth;
sizehints.min_height = sizehints.max_height = actualHeight;
XSetWMNormalHints(dpy, win, &sizehints);
XMapWindow( dpy, win );
if ( vidmode_active ) {
XMoveWindow( dpy, win, 0, 0 );
}
XFlush(dpy);
XSync(dpy, False);
ctx = qglXCreateContext(dpy, visinfo, NULL, True);
XSync(dpy, False);
// Free the visinfo after we're done with it
XFree(visinfo);
qglXMakeCurrent(dpy, win, ctx);
glstring = (const char *) qglGetString(GL_RENDERER);
common->Printf("GL_RENDERER: %s\n", glstring);
glstring = (const char *) qglGetString(GL_EXTENSIONS);
common->Printf("GL_EXTENSIONS: %s\n", glstring);
// FIXME: here, software GL test
glConfig.isFullscreen = a.fullScreen;
if ( glConfig.isFullscreen ) {
Sys_GrabMouseCursor( true );
}
return true;
}
/*
===================
GLimp_Init
This is the platform specific OpenGL initialization function. It
is responsible for loading OpenGL, initializing it,
creating a window of the appropriate size, doing
fullscreen manipulations, etc. Its overall responsibility is
to make sure that a functional OpenGL subsystem is operating
when it returns to the ref.
If there is any failure, the renderer will revert back to safe
parameters and try again.
===================
*/
bool GLimp_Init( glimpParms_t a ) {
if ( !GLimp_OpenDisplay() ) {
return false;
}
#ifndef ID_GL_HARDLINK
if ( !GLimp_dlopen() ) {
return false;
}
#endif
if (!GLX_Init(a)) {
return false;
}
return true;
}
/*
===================
GLimp_SetScreenParms
===================
*/
bool GLimp_SetScreenParms( glimpParms_t parms ) {
return true;
}
/*
================
Sys_GetVideoRam
returns in megabytes
open your own display connection for the query and close it
using the one shared with GLimp_Init is not stable
================
*/
int Sys_GetVideoRam( void ) {
static int run_once = 0;
int major, minor, value;
Display *l_dpy;
int l_scrnum;
if ( run_once ) {
return run_once;
}
if ( sys_videoRam.GetInteger() ) {
run_once = sys_videoRam.GetInteger();
return sys_videoRam.GetInteger();
}
// try a few strategies to guess the amount of video ram
common->Printf( "guessing video ram ( use +set sys_videoRam to force ) ..\n" );
if ( !GLimp_OpenDisplay( ) ) {
run_once = 64;
return run_once;
}
l_dpy = dpy;
l_scrnum = scrnum;
// go for nvidia ext first
if ( XNVCTRLQueryVersion( l_dpy, &major, &minor ) ) {
common->Printf( "found XNVCtrl extension %d.%d\n", major, minor );
if ( XNVCTRLIsNvScreen( l_dpy, l_scrnum ) ) {
if ( XNVCTRLQueryAttribute( l_dpy, l_scrnum, 0, NV_CTRL_VIDEO_RAM, &value ) ) {
run_once = value / 1024;
return run_once;
} else {
common->Printf( "XNVCtrlQueryAttribute NV_CTRL_VIDEO_RAM failed\n" );
}
} else {
common->Printf( "default screen %d is not controlled by NVIDIA driver\n", l_scrnum );
}
}
// try ATI /proc read ( for the lack of a better option )
int fd;
if ( ( fd = open( "/proc/dri/0/umm", O_RDONLY ) ) != -1 ) {
int len;
char umm_buf[ 1024 ];
char *line;
if ( ( len = read( fd, umm_buf, 1024 ) ) != -1 ) {
// should be way enough to get the full file
// grab "free LFB = " line and "free Inv = " lines
umm_buf[ len-1 ] = '\0';
line = umm_buf;
line = strtok( umm_buf, "\n" );
int total = 0;
while ( line ) {
if ( strlen( line ) >= 13 && strstr( line, "max LFB =" ) == line ) {
total += atoi( line + 12 );
} else if ( strlen( line ) >= 13 && strstr( line, "max Inv =" ) == line ) {
total += atoi( line + 12 );
}
line = strtok( NULL, "\n" );
}
if ( total ) {
run_once = total / 1048576;
// round to the lower 16Mb
run_once &= ~15;
return run_once;
}
} else {
common->Printf( "read /proc/dri/0/umm failed: %s\n", strerror( errno ) );
}
}
common->Printf( "guess failed, return default low-end VRAM setting ( 64MB VRAM )\n" );
run_once = 64;
return run_once;
}

View File

@@ -0,0 +1,135 @@
#include "idlib/precompiled.h"
#include "renderer/tr_local.h"
#include "sys/linux/local.h"
#include "glimp_local.h"
#include <dlfcn.h>
dnl =====================================================
dnl utils
dnl =====================================================
define(`forloop',
`pushdef(`$1', `$2')_forloop(`$1', `$2', `$3', `$4')popdef(`$1')')
define(`_forloop',
`$4`'ifelse($1, `$3', ,
`define(`$1', incr($1))_forloop(`$1', `$2', `$3', `$4')')')
dnl =====================================================
dnl the gl wgl glX definitions
dnl =====================================================
include(../gllog/gl_def.m4)
dnl =====================================================
dnl qgl function ptrs
dnl =====================================================
define(`instance_funcptr', ``$1' ( APIENTRY * qgl`$2' )(`$3');')
forloop(`i', gl_start, gl_end, `instance_funcptr(indir(`f'i`_ret'), indir(`f'i`_name'), indir(`f'i`_params'))
')
dnl =====================================================
dnl glX function ptrs
dnl =====================================================
define(`instance_funcptr', ``$1' ( * qglX`$2' )(`$3');')
forloop(`i', glX_start, glX_end, `instance_funcptr(indir(`f'i`_ret'), indir(`f'i`_name'), indir(`f'i`_params'))
')
dnl =====================================================
dnl dll ptrs
dnl those are the actual dlsym'ed pointers
dnl logging configuration redirects qgl / qglX to either log or dll versions
dnl =====================================================
define(`instance_funcptr', ``$1' ( * dll`$2' )(`$3');')
forloop(`i', gl_start, gl_end, `instance_funcptr(indir(`f'i`_ret'), indir(`f'i`_name'), indir(`f'i`_params'))
')
forloop(`i', glX_start, glX_end, `instance_funcptr(indir(`f'i`_ret'), indir(`f'i`_name'), indir(`f'i`_params'))
')
dnl =====================================================
dnl code
dnl =====================================================
/*
======================
GLimp_BindNative
======================
*/
void GLimp_BindNative() {
define(`assign_funcptr', `qgl`$1' = dll`$1';')
forloop(`i', gl_start, gl_end, `assign_funcptr(indir(`f'i`_name'))
')
define(`assign_funcptr', `qglX`$1' = dll`$1';')
forloop(`i', glX_start, glX_end, `assign_funcptr(indir(`f'i`_name'))
')
}
static void *glHandle = NULL;
/*
======================
GLimp_dlsym_failed
======================
*/
void GLimp_dlsym_failed(const char *name) {
common->DPrintf("dlsym(%s) failed: %s\n", name, dlerror());
}
/*
======================
GLimp_dlopen
======================
*/
bool GLimp_dlopen() {
const char *driverName = r_glDriver.GetString()[0] ? r_glDriver.GetString() : "libGL.so.1";
common->Printf("dlopen(%s)\n", driverName);
if ( !( glHandle = dlopen( driverName, RTLD_NOW | RTLD_GLOBAL ) ) ) {
common->DPrintf("dlopen(%s) failed: %s\n", driverName, dlerror());
return false;
}
// dlsym the symbols
define(`dlsym_funcptr', `dll`$2' = ( `$1' ( APIENTRY *)(`$3') ) dlsym( glHandle, "gl`$2'" );')
define(`safe_dlsym_funcptr', `dlsym_funcptr(`$1', `$2', `$3')
if (!dll`$2') { GLimp_dlsym_failed("gl`$2'"); return false; }')
forloop(`i', gl_start, gl_end, `safe_dlsym_funcptr(indir(`f'i`_ret'), indir(`f'i`_name'), indir(`f'i`_params'))
')
define(`dlsym_funcptr', `dll`$2' = ( `$1' ( APIENTRY *)(`$3') ) dlsym( glHandle, "glX`$2'" );')
define(`safe_dlsym_funcptr', `dlsym_funcptr(`$1', `$2', `$3')
if (!dll`$2') { GLimp_dlsym_failed("glX`$2'"); return false; }')
forloop(`i', glX_start, glX_end, `safe_dlsym_funcptr(indir(`f'i`_ret'), indir(`f'i`_name'), indir(`f'i`_params'))
')
// make the initial binding
GLimp_BindNative();
return true;
}
/*
======================
GLimp_dlclose
======================
*/
void GLimp_dlclose() {
if ( !glHandle ) {
common->DPrintf("dlclose: GL handle is NULL\n");
} else {
dlclose( glHandle );
glHandle = NULL;
}
define(`reset_funcptr', `qgl`$1' = NULL;')
forloop(`i', gl_start, gl_end, `reset_funcptr(indir(`f'i`_name'))
')
define(`reset_funcptr', `qglX`$1' = NULL;')
forloop(`i', glX_start, glX_end, `reset_funcptr(indir(`f'i`_name'))
')
}

View File

@@ -0,0 +1,434 @@
/*
===========================================================================
Doom 3 GPL Source Code
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
This file is part of the Doom 3 GPL Source Code (?Doom 3 Source Code?).
Doom 3 Source Code is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Doom 3 Source Code 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
along with Doom 3 Source Code. If not, see <http://www.gnu.org/licenses/>.
In addition, the Doom 3 Source Code is also subject to certain additional terms. You should have received a copy of these additional terms immediately following the terms and conditions of the GNU General Public License which accompanied the Doom 3 Source Code. If not, please request a copy in writing from id Software at the address below.
If you have questions concerning this license or the applicable additional terms, you may contact in writing id Software LLC, c/o ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA.
===========================================================================
*/
DEF(GL_FALSE)
DEF(GL_TRUE)
DEF(GL_BYTE)
DEF(GL_UNSIGNED_BYTE)
DEF(GL_SHORT)
DEF(GL_UNSIGNED_SHORT)
DEF(GL_INT)
DEF(GL_UNSIGNED_INT)
DEF(GL_FLOAT)
DEF(GL_DOUBLE)
DEF(GL_TEXTURE_CUBE_MAP_EXT)
DEF(GL_TEXTURE_3D)
DEF(GL_TEXTURE_2D)
DEF(GL_BLEND)
DEF(GL_DEPTH_TEST)
DEF(GL_CULL_FACE)
DEF(GL_CLIP_PLANE0)
DEF(GL_COLOR_ARRAY)
DEF(GL_TEXTURE_COORD_ARRAY)
DEF(GL_VERTEX_ARRAY)
DEF(GL_ALPHA_TEST)
DEF(GL_TEXTURE_GEN_S)
DEF(GL_TEXTURE_GEN_T)
DEF(GL_TEXTURE_GEN_R)
DEF(GL_TEXTURE_GEN_Q)
DEF(GL_STENCIL_TEST)
DEF(GL_POLYGON_OFFSET_FILL)
DEF(GL_TRIANGLES)
DEF(GL_TRIANGLE_STRIP)
DEF(GL_TRIANGLE_FAN)
DEF(GL_QUADS)
DEF(GL_QUAD_STRIP)
DEF(GL_POLYGON)
DEF(GL_POINTS)
DEF(GL_LINES)
DEF(GL_LINE_STRIP)
DEF(GL_LINE_LOOP)
DEF(GL_ALWAYS)
DEF(GL_NEVER)
DEF(GL_LEQUAL)
DEF(GL_LESS)
DEF(GL_EQUAL)
DEF(GL_GREATER)
DEF(GL_GEQUAL)
DEF(GL_NOTEQUAL)
DEF(GL_ONE)
DEF(GL_ZERO)
DEF(GL_SRC_ALPHA)
DEF(GL_ONE_MINUS_SRC_ALPHA)
DEF(GL_DST_COLOR)
DEF(GL_ONE_MINUS_DST_COLOR)
DEF(GL_DST_ALPHA)
DEF(GL_MODELVIEW)
DEF(GL_PROJECTION)
DEF(GL_TEXTURE)
DEF(GL_NONE)
DEF(GL_FRONT_LEFT)
DEF(GL_FRONT_RIGHT)
DEF(GL_BACK_LEFT)
DEF(GL_BACK_RIGHT)
DEF(GL_FRONT)
DEF(GL_BACK)
DEF(GL_LEFT)
DEF(GL_RIGHT)
DEF(GL_FRONT_AND_BACK)
DEF(GL_AUX0)
DEF(GL_AUX1)
DEF(GL_AUX2)
DEF(GL_AUX3)
DEF(GL_CURRENT_COLOR)
DEF(GL_CURRENT_INDEX)
DEF(GL_CURRENT_NORMAL)
DEF(GL_CURRENT_TEXTURE_COORDS)
DEF(GL_CURRENT_RASTER_COLOR)
DEF(GL_CURRENT_RASTER_INDEX)
DEF(GL_CURRENT_RASTER_TEXTURE_COORDS)
DEF(GL_CURRENT_RASTER_POSITION)
DEF(GL_CURRENT_RASTER_POSITION_VALID)
DEF(GL_CURRENT_RASTER_DISTANCE)
DEF(GL_POINT_SMOOTH)
DEF(GL_POINT_SIZE)
DEF(GL_POINT_SIZE_RANGE)
DEF(GL_POINT_SIZE_GRANULARITY)
DEF(GL_LINE_SMOOTH)
DEF(GL_LINE_WIDTH)
DEF(GL_LINE_WIDTH_RANGE)
DEF(GL_LINE_WIDTH_GRANULARITY)
DEF(GL_LINE_STIPPLE)
DEF(GL_LINE_STIPPLE_PATTERN)
DEF(GL_LINE_STIPPLE_REPEAT)
DEF(GL_LIST_MODE)
DEF(GL_MAX_LIST_NESTING)
DEF(GL_LIST_BASE)
DEF(GL_LIST_INDEX)
DEF(GL_POLYGON_MODE)
DEF(GL_POLYGON_SMOOTH)
DEF(GL_POLYGON_STIPPLE)
DEF(GL_EDGE_FLAG)
DEF(GL_CULL_FACE)
DEF(GL_CULL_FACE_MODE)
DEF(GL_FRONT_FACE)
DEF(GL_LIGHTING)
DEF(GL_LIGHT_MODEL_LOCAL_VIEWER)
DEF(GL_LIGHT_MODEL_TWO_SIDE)
DEF(GL_LIGHT_MODEL_AMBIENT)
DEF(GL_SHADE_MODEL)
DEF(GL_COLOR_MATERIAL_FACE)
DEF(GL_COLOR_MATERIAL_PARAMETER)
DEF(GL_COLOR_MATERIAL)
DEF(GL_FOG)
DEF(GL_FOG_INDEX)
DEF(GL_FOG_DENSITY)
DEF(GL_FOG_START)
DEF(GL_FOG_END)
DEF(GL_FOG_MODE)
DEF(GL_FOG_COLOR)
DEF(GL_DEPTH_RANGE)
DEF(GL_DEPTH_TEST)
DEF(GL_DEPTH_WRITEMASK)
DEF(GL_DEPTH_CLEAR_VALUE)
DEF(GL_DEPTH_FUNC)
DEF(GL_ACCUM_CLEAR_VALUE)
DEF(GL_STENCIL_TEST)
DEF(GL_STENCIL_CLEAR_VALUE)
DEF(GL_STENCIL_FUNC)
DEF(GL_STENCIL_VALUE_MASK)
DEF(GL_STENCIL_FAIL)
DEF(GL_STENCIL_PASS_DEPTH_FAIL)
DEF(GL_STENCIL_PASS_DEPTH_PASS)
DEF(GL_STENCIL_REF)
DEF(GL_STENCIL_WRITEMASK)
DEF(GL_MATRIX_MODE)
DEF(GL_NORMALIZE)
DEF(GL_VIEWPORT)
DEF(GL_MODELVIEW_STACK_DEPTH)
DEF(GL_PROJECTION_STACK_DEPTH)
DEF(GL_TEXTURE_STACK_DEPTH)
DEF(GL_MODELVIEW_MATRIX)
DEF(GL_PROJECTION_MATRIX)
DEF(GL_TEXTURE_MATRIX)
DEF(GL_ATTRIB_STACK_DEPTH)
DEF(GL_CLIENT_ATTRIB_STACK_DEPTH)
DEF(GL_ALPHA_TEST)
DEF(GL_ALPHA_TEST_FUNC)
DEF(GL_ALPHA_TEST_REF)
DEF(GL_DITHER)
DEF(GL_BLEND_DST)
DEF(GL_BLEND_SRC)
DEF(GL_BLEND)
DEF(GL_LOGIC_OP_MODE)
DEF(GL_INDEX_LOGIC_OP)
DEF(GL_COLOR_LOGIC_OP)
DEF(GL_AUX_BUFFERS)
DEF(GL_DRAW_BUFFER)
DEF(GL_READ_BUFFER)
DEF(GL_SCISSOR_BOX)
DEF(GL_SCISSOR_TEST)
DEF(GL_INDEX_CLEAR_VALUE)
DEF(GL_INDEX_WRITEMASK)
DEF(GL_COLOR_CLEAR_VALUE)
DEF(GL_COLOR_WRITEMASK)
DEF(GL_INDEX_MODE)
DEF(GL_RGBA_MODE)
DEF(GL_DOUBLEBUFFER)
DEF(GL_STEREO)
DEF(GL_RENDER_MODE)
DEF(GL_PERSPECTIVE_CORRECTION_HINT)
DEF(GL_POINT_SMOOTH_HINT)
DEF(GL_LINE_SMOOTH_HINT)
DEF(GL_POLYGON_SMOOTH_HINT)
DEF(GL_FOG_HINT)
DEF(GL_TEXTURE_GEN_S)
DEF(GL_TEXTURE_GEN_T)
DEF(GL_TEXTURE_GEN_R)
DEF(GL_TEXTURE_GEN_Q)
DEF(GL_PIXEL_MAP_I_TO_I)
DEF(GL_PIXEL_MAP_S_TO_S)
DEF(GL_PIXEL_MAP_I_TO_R)
DEF(GL_PIXEL_MAP_I_TO_G)
DEF(GL_PIXEL_MAP_I_TO_B)
DEF(GL_PIXEL_MAP_I_TO_A)
DEF(GL_PIXEL_MAP_R_TO_R)
DEF(GL_PIXEL_MAP_G_TO_G)
DEF(GL_PIXEL_MAP_B_TO_B)
DEF(GL_PIXEL_MAP_A_TO_A)
DEF(GL_PIXEL_MAP_I_TO_I_SIZE)
DEF(GL_PIXEL_MAP_S_TO_S_SIZE)
DEF(GL_PIXEL_MAP_I_TO_R_SIZE)
DEF(GL_PIXEL_MAP_I_TO_G_SIZE)
DEF(GL_PIXEL_MAP_I_TO_B_SIZE)
DEF(GL_PIXEL_MAP_I_TO_A_SIZE)
DEF(GL_PIXEL_MAP_R_TO_R_SIZE)
DEF(GL_PIXEL_MAP_G_TO_G_SIZE)
DEF(GL_PIXEL_MAP_B_TO_B_SIZE)
DEF(GL_PIXEL_MAP_A_TO_A_SIZE)
DEF(GL_UNPACK_SWAP_BYTES)
DEF(GL_UNPACK_LSB_FIRST)
DEF(GL_UNPACK_ROW_LENGTH)
DEF(GL_UNPACK_SKIP_ROWS)
DEF(GL_UNPACK_SKIP_PIXELS)
DEF(GL_UNPACK_ALIGNMENT)
DEF(GL_PACK_SWAP_BYTES)
DEF(GL_PACK_LSB_FIRST)
DEF(GL_PACK_ROW_LENGTH)
DEF(GL_PACK_SKIP_ROWS)
DEF(GL_PACK_SKIP_PIXELS)
DEF(GL_PACK_ALIGNMENT)
DEF(GL_MAP_COLOR)
DEF(GL_MAP_STENCIL)
DEF(GL_INDEX_SHIFT)
DEF(GL_INDEX_OFFSET)
DEF(GL_RED_SCALE)
DEF(GL_RED_BIAS)
DEF(GL_ZOOM_X)
DEF(GL_ZOOM_Y)
DEF(GL_GREEN_SCALE)
DEF(GL_GREEN_BIAS)
DEF(GL_BLUE_SCALE)
DEF(GL_BLUE_BIAS)
DEF(GL_ALPHA_SCALE)
DEF(GL_ALPHA_BIAS)
DEF(GL_DEPTH_SCALE)
DEF(GL_DEPTH_BIAS)
DEF(GL_MAX_EVAL_ORDER)
DEF(GL_MAX_LIGHTS)
DEF(GL_MAX_CLIP_PLANES)
DEF(GL_MAX_TEXTURE_SIZE)
DEF(GL_MAX_PIXEL_MAP_TABLE)
DEF(GL_MAX_ATTRIB_STACK_DEPTH)
DEF(GL_MAX_MODELVIEW_STACK_DEPTH)
DEF(GL_MAX_NAME_STACK_DEPTH)
DEF(GL_MAX_PROJECTION_STACK_DEPTH)
DEF(GL_MAX_TEXTURE_STACK_DEPTH)
DEF(GL_MAX_VIEWPORT_DIMS)
DEF(GL_MAX_CLIENT_ATTRIB_STACK_DEPTH)
DEF(GL_SUBPIXEL_BITS)
DEF(GL_INDEX_BITS)
DEF(GL_RED_BITS)
DEF(GL_GREEN_BITS)
DEF(GL_BLUE_BITS)
DEF(GL_ALPHA_BITS)
DEF(GL_DEPTH_BITS)
DEF(GL_STENCIL_BITS)
DEF(GL_ACCUM_RED_BITS)
DEF(GL_ACCUM_GREEN_BITS)
DEF(GL_ACCUM_BLUE_BITS)
DEF(GL_ACCUM_ALPHA_BITS)
DEF(GL_NAME_STACK_DEPTH)
DEF(GL_AUTO_NORMAL)
DEF(GL_MAP1_COLOR_4)
DEF(GL_MAP1_INDEX)
DEF(GL_MAP1_NORMAL)
DEF(GL_MAP1_TEXTURE_COORD_1)
DEF(GL_MAP1_TEXTURE_COORD_2)
DEF(GL_MAP1_TEXTURE_COORD_3)
DEF(GL_MAP1_TEXTURE_COORD_4)
DEF(GL_MAP1_VERTEX_3)
DEF(GL_MAP1_VERTEX_4)
DEF(GL_MAP2_COLOR_4)
DEF(GL_MAP2_INDEX)
DEF(GL_MAP2_NORMAL)
DEF(GL_MAP2_TEXTURE_COORD_1)
DEF(GL_MAP2_TEXTURE_COORD_2)
DEF(GL_MAP2_TEXTURE_COORD_3)
DEF(GL_MAP2_TEXTURE_COORD_4)
DEF(GL_MAP2_VERTEX_3)
DEF(GL_MAP2_VERTEX_4)
DEF(GL_MAP1_GRID_DOMAIN)
DEF(GL_MAP1_GRID_SEGMENTS)
DEF(GL_MAP2_GRID_DOMAIN)
DEF(GL_MAP2_GRID_SEGMENTS)
DEF(GL_TEXTURE_1D)
DEF(GL_TEXTURE_2D)
DEF(GL_FEEDBACK_BUFFER_POINTER)
DEF(GL_FEEDBACK_BUFFER_SIZE)
DEF(GL_FEEDBACK_BUFFER_TYPE)
DEF(GL_SELECTION_BUFFER_POINTER)
DEF(GL_SELECTION_BUFFER_SIZE)
DEF(GL_COLOR)
DEF(GL_DEPTH)
DEF(GL_STENCIL)
DEF(GL_COLOR_INDEX)
DEF(GL_STENCIL_INDEX)
DEF(GL_DEPTH_COMPONENT)
DEF(GL_RED)
DEF(GL_GREEN)
DEF(GL_BLUE)
DEF(GL_ALPHA)
DEF(GL_RGB)
DEF(GL_RGBA)
DEF(GL_LUMINANCE)
DEF(GL_LUMINANCE_ALPHA)
DEF(GL_PIXEL_MAP_I_TO_I)
DEF(GL_PIXEL_MAP_S_TO_S)
DEF(GL_PIXEL_MAP_I_TO_R)
DEF(GL_PIXEL_MAP_I_TO_G)
DEF(GL_PIXEL_MAP_I_TO_B)
DEF(GL_PIXEL_MAP_I_TO_A)
DEF(GL_PIXEL_MAP_R_TO_R)
DEF(GL_PIXEL_MAP_G_TO_G)
DEF(GL_PIXEL_MAP_B_TO_B)
DEF(GL_PIXEL_MAP_A_TO_A)
DEF(GL_UNPACK_SWAP_BYTES)
DEF(GL_UNPACK_LSB_FIRST)
DEF(GL_UNPACK_ROW_LENGTH)
DEF(GL_UNPACK_SKIP_ROWS)
DEF(GL_UNPACK_SKIP_PIXELS)
DEF(GL_UNPACK_ALIGNMENT)
DEF(GL_PACK_SWAP_BYTES)
DEF(GL_PACK_LSB_FIRST)
DEF(GL_PACK_ROW_LENGTH)
DEF(GL_PACK_SKIP_ROWS)
DEF(GL_PACK_SKIP_PIXELS)
DEF(GL_PACK_ALIGNMENT)
DEF(GL_MAP_COLOR)
DEF(GL_MAP_STENCIL)
DEF(GL_INDEX_SHIFT)
DEF(GL_INDEX_OFFSET)
DEF(GL_RED_SCALE)
DEF(GL_RED_BIAS)
DEF(GL_GREEN_SCALE)
DEF(GL_GREEN_BIAS)
DEF(GL_BLUE_SCALE)
DEF(GL_BLUE_BIAS)
DEF(GL_ALPHA_SCALE)
DEF(GL_ALPHA_BIAS)
DEF(GL_DEPTH_SCALE)
DEF(GL_DEPTH_BIAS)
DEF(GL_BITMAP)
DEF(GL_BYTE)
DEF(GL_UNSIGNED_BYTE)
DEF(GL_SHORT)
DEF(GL_UNSIGNED_SHORT)
DEF(GL_INT)
DEF(GL_UNSIGNED_INT)
DEF(GL_FLOAT)
DEF(GL_POINT)
DEF(GL_LINE)
DEF(GL_FILL)
DEF(GL_RENDER)
DEF(GL_FEEDBACK)
DEF(GL_SELECT)
DEF(GL_FLAT)
DEF(GL_SMOOTH)
DEF(GL_ZERO)
DEF(GL_KEEP)
DEF(GL_REPLACE)
DEF(GL_INCR)
DEF(GL_DECR)
DEF(GL_INVERT)
DEF(GL_VENDOR)
DEF(GL_RENDERER)
DEF(GL_VERSION)
DEF(GL_EXTENSIONS)
DEF(GL_S)
DEF(GL_T)
DEF(GL_R)
DEF(GL_Q)
DEF(GL_SHORT)
DEF(GL_INT)
DEF(GL_FLOAT)
DEF(GL_DOUBLE)
DEF(GL_MODULATE)
DEF(GL_DECAL)
DEF(GL_BLEND)
DEF(GL_REPLACE)
DEF(GL_TEXTURE_ENV_MODE)
DEF(GL_TEXTURE_ENV_COLOR)
DEF(GL_TEXTURE_ENV)
DEF(GL_EYE_LINEAR)
DEF(GL_OBJECT_LINEAR)
DEF(GL_SPHERE_MAP)
DEF(GL_TEXTURE_GEN_MODE)
DEF(GL_OBJECT_PLANE)
DEF(GL_EYE_PLANE)
DEF(GL_NEAREST)
DEF(GL_LINEAR)
DEF(GL_NEAREST)
DEF(GL_LINEAR)
DEF(GL_NEAREST_MIPMAP_NEAREST)
DEF(GL_LINEAR_MIPMAP_NEAREST)
DEF(GL_NEAREST_MIPMAP_LINEAR)
DEF(GL_LINEAR_MIPMAP_LINEAR)
DEF(GL_TEXTURE_MAG_FILTER)
DEF(GL_TEXTURE_MIN_FILTER)
DEF(GL_TEXTURE_WRAP_S)
DEF(GL_TEXTURE_WRAP_T)
DEF(GL_TEXTURE_BORDER_COLOR)
DEF(GL_TEXTURE_PRIORITY)
DEF(GL_TEXTURE_1D)
DEF(GL_TEXTURE_2D)
DEF(GL_PROXY_TEXTURE_1D)
DEF(GL_PROXY_TEXTURE_2D)
DEF(GL_CLAMP)
DEF(GL_REPEAT)
DEF(GL_SHORT)
DEF(GL_INT)
DEF(GL_FLOAT)
DEF(GL_DOUBLE)
DEF(GL_CLIENT_PIXEL_STORE_BIT)
DEF(GL_CLIENT_VERTEX_ARRAY_BIT)
/* DEF(GL_CLIENT_ALL_ATTRIB_BITS) */
DEF(GL_POLYGON_OFFSET_FACTOR)
DEF(GL_POLYGON_OFFSET_UNITS)
DEF(GL_POLYGON_OFFSET_POINT)
DEF(GL_POLYGON_OFFSET_LINE)
DEF(GL_POLYGON_OFFSET_FILL)

View File

@@ -0,0 +1,24 @@
dnl =====================================================
dnl utils
dnl =====================================================
define(`forloop',
`pushdef(`$1', `$2')_forloop(`$1', `$2', `$3', `$4')popdef(`$1')')
define(`_forloop',
`$4`'ifelse($1, `$3', ,
`define(`$1', incr($1))_forloop(`$1', `$2', `$3', `$4')')')
dnl =====================================================
dnl the gl wgl glX definitions
dnl =====================================================
include(../gllog/gl_def.m4)
dnl =====================================================
dnl dll funcs declare
dnl =====================================================
define(`declare_funcptr', `extern `$1' ( * dll`$2' )(`$3');')
forloop(`i', gl_start, gl_end, `declare_funcptr(indir(`f'i`_ret'), indir(`f'i`_name'), indir(`f'i`_params'))
')
forloop(`i', glX_start, glX_end, `declare_funcptr(indir(`f'i`_ret'), indir(`f'i`_name'), indir(`f'i`_params'))
')

View File

@@ -0,0 +1,185 @@
#include "idlib/precompiled.h"
#include "renderer/tr_local.h"
#include "sys/linux/local.h"
#include "glimp_local.h"
#pragma hdrstop
#include <unistd.h>
#define ID_LOG_TO_STDOUT 0
dnl =====================================================
dnl utils
dnl =====================================================
define(`forloop',
`pushdef(`$1', `$2')_forloop(`$1', `$2', `$3', `$4')popdef(`$1')')
define(`_forloop',
`$4`'ifelse($1, `$3', ,
`define(`$1', incr($1))_forloop(`$1', `$2', `$3', `$4')')')
dnl =====================================================
dnl the gl wgl glX definitions
dnl =====================================================
include(../gllog/gl_def.m4)
dnl =====================================================
dnl logging functions
dnl =====================================================
typedef struct {
GLenum e;
const char *name;
} glEnumName_t;
#define DEF(x) { x, #x },
glEnumName_t glEnumNames[] = {
#include "sys/linux/glimp_glenum.h"
{ 0, NULL }
};
/*
======================
EnumString
======================
*/
static const char *EnumString( GLenum t )
{
static char buffer[8][1024];
static int index = 0;
for ( glEnumName_t *n = glEnumNames ; n->name ; n++ ) {
if ( t == n->e ) {
return n->name;
}
}
int oldIndex = index;
index = ( index + 1 ) & 7;
sprintf( buffer[oldIndex], "0x%x", t );
return buffer[oldIndex];
}
/*
======================
FloatData
======================
*/
static const char *FloatData( const GLfloat *v, int count ) {
static char buffer[8][1024];
static int index = 0;
char *name;
name = buffer[index&7];
sprintf( name, "f%i", index );
index++;
fprintf( tr.logFile, "static float %s[%i] = {", name, count );
for( int i = 0 ; i < count ; i++ ) {
if ( i < count - 1 ) {
fprintf( tr.logFile, "%f,", v[i] );
} else {
fprintf( tr.logFile, "%f};\n", v[i] );
}
}
return name;
}
#include "glimp_logfuncs.cpp"
dnl define(`log_func', `static `$1' APIENTRY log`$2'(`$3') {
dnl }')
dnl forloop(`i', gl_start, gl_end, `log_func(indir(`f'i`_ret'), indir(`f'i`_name'), indir(`f'i`_params'))
dnl ')
dnl forloop(`i', glX_start, glX_end, `log_func(indir(`f'i`_ret'), indir(`f'i`_name'), indir(`f'i`_params'))
dnl ')
/*
======================
GLimp_BindLogging
======================
*/
void GLimp_BindLogging() {
define(`assign_funcptr', `qgl`$1' = log`$1';')
forloop(`i', gl_start, gl_end, `assign_funcptr(indir(`f'i`_name'))
')
define(`assign_funcptr', `qglX`$1' = log`$1';')
forloop(`i', glX_start, glX_end, `assign_funcptr(indir(`f'i`_name'))
')
}
/*
======================
GLimp_EnableLogging
======================
*/
void GLimp_EnableLogging(bool enable) {
static bool isEnabled = false;
static idStr ospath;
static int initialFrames;
// return if we're already active
if ( isEnabled && enable ) {
// decrement log counter and stop if it has reached 0
r_logFile.SetInteger( r_logFile.GetInteger() - 1 );
if ( r_logFile.GetInteger() ) {
return;
}
#if ID_LOG_TO_STDOUT
common->Printf( "end stdout GL loggging after %i frames.\n", initialFrames );
#else
common->Printf( "closing GL logfile '%s' after %i frames.\n", ospath.c_str(), initialFrames );
fclose( tr.logFile );
#endif
enable = false;
tr.logFile = NULL;
}
// return if we're already disabled
if ( !enable && !isEnabled ) {
return;
}
isEnabled = enable;
if ( enable ) {
if ( !tr.logFile ) {
struct tm *newtime;
time_t aclock;
idStr qpath;
int i;
initialFrames = r_logFile.GetInteger();
#if ID_LOG_TO_STDOUT
tr.logFile = fdopen( STDOUT_FILENO, "w" );
#else
// scan for an unused filename
for ( i = 0 ; i < 9999 ; i++ ) {
sprintf( qpath, "renderlog_%i.txt", i );
if ( fileSystem->ReadFile( qpath, NULL, NULL ) == -1 ) {
break; // use this name
}
}
ospath = fileSystem->RelativePathToOSPath( qpath );
tr.logFile = fopen( ospath, "wt" );
#endif
// write the time out to the top of the file
time( &aclock );
newtime = localtime( &aclock );
fprintf( tr.logFile, "// %s", asctime( newtime ) );
fprintf( tr.logFile, "// %s\n\n", com_version.GetString() );
}
GLimp_BindLogging();
} else {
GLimp_BindNative();
}
}

View File

@@ -0,0 +1,66 @@
// glimp_stub.cpp.m4
// stub gl/glX APIs
#include "idlib/precompiled.h"
#include "renderer/tr_local.h"
#pragma hdrstop
dnl =====================================================
dnl utils
dnl =====================================================
define(`forloop',
`pushdef(`$1', `$2')_forloop(`$1', `$2', `$3', `$4')popdef(`$1')')
define(`_forloop',
`$4`'ifelse($1, `$3', ,
`define(`$1', incr($1))_forloop(`$1', `$2', `$3', `$4')')')
dnl =====================================================
dnl the gl wgl glX definitions
dnl =====================================================
include(../gllog/gl_def.m4)
dnl =====================================================
dnl qgl stubs
dnl there is a number of functions for which we have special case code
dnl =====================================================
define(`override_GetError', `')
define(`override_GenLists', `')
define(`override_GetIntegerv', `')
define(`override_GetString', `')
define(`instance_funcptr', ``$1' gl`$2'(`$3'){}')
define(`try_instance_funcptr', `ifdef(`override_'$2, ,`instance_funcptr(`$1', `$2', `$3')')')
forloop(`i', gl_start, gl_end, `try_instance_funcptr(indir(`f'i`_ret'), indir(`f'i`_name'), indir(`f'i`_params'))
')
dnl =====================================================
dnl glX stubs
dnl =====================================================
define(`override_GetProcAddressARB', `')
define(`instance_funcptr', ``$1' glX`$2'(`$3'){}')
define(`try_instance_funcptr', `ifdef(`override_'$2, ,`instance_funcptr(`$1', `$2', `$3')')')
forloop(`i', glX_start, glX_end, `try_instance_funcptr(indir(`f'i`_ret'), indir(`f'i`_name'), indir(`f'i`_params'))
')
GLenum glGetError(void){return 0;}
GLuint glGenLists(GLsizei range){return 0;}
void glGetIntegerv(GLenum pname, GLint *params){
switch( pname ) {
case GL_MAX_TEXTURE_SIZE: *params = 1024; break;
case GL_MAX_TEXTURE_UNITS_ARB: *params = 2; break;
default: *params = 0; break;
}
}
const GLubyte * glGetString(GLenum name){
switch( name ) {
case GL_EXTENSIONS: return (GLubyte *)"GL_ARB_multitexture GL_ARB_texture_env_combine GL_ARB_texture_cube_map GL_ARB_texture_env_dot3";
}
return (const GLubyte *)"";
}

562
neo/sys/linux/input.cpp Normal file
View File

@@ -0,0 +1,562 @@
/*
===========================================================================
Doom 3 GPL Source Code
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
This file is part of the Doom 3 GPL Source Code (?Doom 3 Source Code?).
Doom 3 Source Code is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Doom 3 Source Code 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
along with Doom 3 Source Code. If not, see <http://www.gnu.org/licenses/>.
In addition, the Doom 3 Source Code is also subject to certain additional terms. You should have received a copy of these additional terms immediately following the terms and conditions of the GNU General Public License which accompanied the Doom 3 Source Code. If not, please request a copy in writing from id Software at the address below.
If you have questions concerning this license or the applicable additional terms, you may contact in writing id Software LLC, c/o ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA.
===========================================================================
*/
#include "../../idlib/precompiled.h"
#include "../posix/posix_public.h"
#include "local.h"
#include <pthread.h>
idCVar in_mouse( "in_mouse", "1", CVAR_SYSTEM | CVAR_ARCHIVE, "" );
idCVar in_dgamouse( "in_dgamouse", "1", CVAR_SYSTEM | CVAR_ARCHIVE, "" );
idCVar in_nograb( "in_nograb", "0", CVAR_SYSTEM | CVAR_NOCHEAT, "" );
// have a working xkb extension
static bool have_xkb = false;
// toggled by grab calls - decides if we ignore MotionNotify events
static bool mouse_active = false;
// non-DGA pointer-warping mouse input
static int mwx, mwy;
static int mx = 0, my = 0;
// time mouse was last reset, we ignore the first 50ms of the mouse to allow settling of events
static int mouse_reset_time = 0;
#define MOUSE_RESET_DELAY 50
// backup original values for pointer grab/ungrab
static int mouse_accel_numerator;
static int mouse_accel_denominator;
static int mouse_threshold;
static byte s_scantokey[128] = {
/* 0 */ 0, 0, 0, 0, 0, 0, 0, 0,
/* 8 */ 0, 27, '1', '2', '3', '4', '5', '6', // 27 - ESC
/* 10 */ '7', '8', '9', '0', '-', '=', K_BACKSPACE, 9, // 9 - TAB
/* 18 */ 'q', 'w', 'e', 'r', 't', 'y', 'u', 'i',
/* 20 */ 'o', 'p', '[', ']', K_ENTER, K_CTRL, 'a', 's',
/* 28 */ 'd', 'f', 'g', 'h', 'j', 'k', 'l', ';',
/* 30 */ '\'', '`', K_SHIFT, '\\', 'z', 'x', 'c', 'v',
/* 38 */ 'b', 'n', 'm', ',', '.', '/', K_SHIFT, K_KP_STAR,
/* 40 */ K_ALT, ' ', K_CAPSLOCK, K_F1, K_F2, K_F3, K_F4, K_F5,
/* 48 */ K_F6, K_F7, K_F8, K_F9, K_F10, K_PAUSE, 0, K_HOME,
/* 50 */ K_UPARROW, K_PGUP, K_KP_MINUS, K_LEFTARROW, K_KP_5, K_RIGHTARROW, K_KP_PLUS, K_END,
/* 58 */ K_DOWNARROW, K_PGDN, K_INS, K_DEL, 0, 0, '\\', K_F11,
/* 60 */ K_F12, K_HOME, K_UPARROW, K_PGUP, K_LEFTARROW, 0, K_RIGHTARROW, K_END,
/* 68 */ K_DOWNARROW, K_PGDN, K_INS, K_DEL, K_ENTER, K_CTRL, K_PAUSE, 0,
/* 70 */ '/', K_ALT, 0, 0, 0, 0, 0, 0,
/* 78 */ 0, 0, 0, 0, 0, 0, 0, 0
};
/*
=================
IN_Clear_f
=================
*/
void IN_Clear_f( const idCmdArgs &args ) {
idKeyInput::ClearStates();
}
/*
=================
Sys_InitInput
=================
*/
void Sys_InitInput(void) {
int major_in_out, minor_in_out, opcode_rtrn, event_rtrn, error_rtrn;
bool ret;
common->Printf( "\n------- Input Initialization -------\n" );
assert( dpy );
cmdSystem->AddCommand( "in_clear", IN_Clear_f, CMD_FL_SYSTEM, "reset the input keys" );
major_in_out = XkbMajorVersion;
minor_in_out = XkbMinorVersion;
ret = XkbLibraryVersion( &major_in_out, &minor_in_out );
common->Printf( "XKB extension: compile time 0x%x:0x%x, runtime 0x%x:0x%x: %s\n", XkbMajorVersion, XkbMinorVersion, major_in_out, minor_in_out, ret ? "OK" : "Not compatible" );
if ( ret ) {
ret = XkbQueryExtension( dpy, &opcode_rtrn, &event_rtrn, &error_rtrn, &major_in_out, &minor_in_out );
if ( ret ) {
common->Printf( "XKB extension present on server ( 0x%x:0x%x )\n", major_in_out, minor_in_out );
have_xkb = true;
} else {
common->Printf( "XKB extension not present on server\n" );
have_xkb = false;
}
} else {
have_xkb = false;
}
common->Printf( "------------------------------------\n" );
}
//#define XEVT_DBG
//#define XEVT_DBG2
static Cursor Sys_XCreateNullCursor( Display *display, Window root ) {
Pixmap cursormask;
XGCValues xgc;
GC gc;
XColor dummycolour;
Cursor cursor;
cursormask = XCreatePixmap(display, root, 1, 1, 1/*depth*/);
xgc.function = GXclear;
gc = XCreateGC(display, cursormask, GCFunction, &xgc);
XFillRectangle(display, cursormask, gc, 0, 0, 1, 1);
dummycolour.pixel = 0;
dummycolour.red = 0;
dummycolour.flags = 04;
cursor = XCreatePixmapCursor(display, cursormask, cursormask,
&dummycolour,&dummycolour, 0,0);
XFreePixmap(display,cursormask);
XFreeGC(display,gc);
return cursor;
}
static void Sys_XInstallGrabs( void ) {
assert( dpy );
XWarpPointer( dpy, None, win,
0, 0, 0, 0,
glConfig.vidWidth / 2, glConfig.vidHeight / 2 );
XSync( dpy, False );
XDefineCursor( dpy, win, Sys_XCreateNullCursor( dpy, win ) );
XGrabPointer( dpy, win,
False,
MOUSE_MASK,
GrabModeAsync, GrabModeAsync,
win,
None,
CurrentTime );
XGetPointerControl( dpy, &mouse_accel_numerator, &mouse_accel_denominator,
&mouse_threshold );
XChangePointerControl( dpy, True, True, 1, 1, 0 );
XSync( dpy, False );
mouse_reset_time = Sys_Milliseconds ();
if ( in_dgamouse.GetBool() && !dga_found ) {
common->Printf("XF86DGA not available, forcing DGA mouse off\n");
in_dgamouse.SetBool( false );
}
if ( in_dgamouse.GetBool() ) {
#if defined( ID_ENABLE_DGA )
XF86DGADirectVideo( dpy, DefaultScreen( dpy ), XF86DGADirectMouse );
XWarpPointer( dpy, None, win, 0, 0, 0, 0, 0, 0 );
#endif
} else {
mwx = glConfig.vidWidth / 2;
mwy = glConfig.vidHeight / 2;
mx = my = 0;
}
XGrabKeyboard( dpy, win,
False,
GrabModeAsync, GrabModeAsync,
CurrentTime );
XSync( dpy, False );
mouse_active = true;
}
void Sys_XUninstallGrabs(void) {
assert( dpy );
#if defined( ID_ENABLE_DGA )
if ( in_dgamouse.GetBool() ) {
common->DPrintf( "DGA Mouse - Disabling DGA DirectVideo\n" );
XF86DGADirectVideo( dpy, DefaultScreen( dpy ), 0 );
}
#endif
XChangePointerControl( dpy, true, true, mouse_accel_numerator,
mouse_accel_denominator, mouse_threshold );
XUngrabPointer( dpy, CurrentTime );
XUngrabKeyboard( dpy, CurrentTime );
XWarpPointer( dpy, None, win,
0, 0, 0, 0,
glConfig.vidWidth / 2, glConfig.vidHeight / 2);
XUndefineCursor( dpy, win );
mouse_active = false;
}
void Sys_GrabMouseCursor( bool grabIt ) {
#if defined( ID_DEDICATED )
return;
#endif
if ( !dpy ) {
#ifdef XEVT_DBG
common->DPrintf("Sys_GrabMouseCursor: !dpy\n");
#endif
return;
}
if ( glConfig.isFullscreen ) {
if ( !grabIt ) {
return; // never ungrab while fullscreen
}
if ( in_nograb.GetBool() ) {
common->DPrintf("forcing in_nograb 0 while running fullscreen\n");
in_nograb.SetBool( false );
}
}
if ( in_nograb.GetBool() ) {
if ( in_dgamouse.GetBool() ) {
common->DPrintf("in_nograb 1, forcing forcing DGA mouse off\n");
in_dgamouse.SetBool( false );
}
if (grabIt) {
mouse_active = true;
} else {
mouse_active = false;
}
return;
}
if ( grabIt && !mouse_active ) {
Sys_XInstallGrabs();
} else if ( !grabIt && mouse_active ) {
Sys_XUninstallGrabs();
}
}
/**
* XPending() actually performs a blocking read
* if no events available. From Fakk2, by way of
* Heretic2, by way of SDL, original idea GGI project.
* The benefit of this approach over the quite
* badly behaved XAutoRepeatOn/Off is that you get
* focus handling for free, which is a major win
* with debug and windowed mode. It rests on the
* assumption that the X server will use the
* same timestamp on press/release event pairs
* for key repeats.
*/
static bool Sys_XPendingInput( void ) {
// Flush the display connection
// and look to see if events are queued
XFlush( dpy );
if ( XEventsQueued( dpy, QueuedAlready) ) {
return true;
}
// More drastic measures are required -- see if X is ready to talk
static struct timeval zero_time;
int x11_fd;
fd_set fdset;
x11_fd = ConnectionNumber( dpy );
FD_ZERO( &fdset );
FD_SET( x11_fd, &fdset );
if ( select( x11_fd+1, &fdset, NULL, NULL, &zero_time ) == 1 ) {
return XPending( dpy );
}
// Oh well, nothing is ready ..
return false;
}
/**
* Intercept a KeyRelease-KeyPress sequence and ignore
*/
static bool Sys_XRepeatPress( XEvent *event ) {
XEvent peekevent;
bool repeated = false;
int lookupRet;
char buf[5];
KeySym keysym;
if ( Sys_XPendingInput() ) {
XPeekEvent( dpy, &peekevent );
if ((peekevent.type == KeyPress) &&
(peekevent.xkey.keycode == event->xkey.keycode) &&
(peekevent.xkey.time == event->xkey.time)) {
repeated = true;
XNextEvent( dpy, &peekevent );
// emit an SE_CHAR for the repeat
lookupRet = XLookupString( (XKeyEvent*)&peekevent, buf, sizeof(buf), &keysym, NULL );
if (lookupRet > 0) {
Posix_QueEvent( SE_CHAR, buf[ 0 ], 0, 0, NULL);
} else {
// shouldn't we be doing a release/press in this order rather?
// ( doesn't work .. but that's what I would have expected to do though )
Posix_QueEvent( SE_KEY, s_scantokey[peekevent.xkey.keycode], true, 0, NULL);
Posix_QueEvent( SE_KEY, s_scantokey[peekevent.xkey.keycode], false, 0, NULL);
}
}
}
return repeated;
}
/*
==========================
Posix_PollInput
==========================
*/
void Posix_PollInput() {
static char buf[16];
static XEvent event;
static XKeyEvent *key_event = (XKeyEvent*)&event;
int lookupRet;
int b, dx, dy;
KeySym keysym;
if ( !dpy ) {
return;
}
// NOTE: Sys_GetEvent only calls when there are no events left
// but here we pump all X events that have accumulated
// pump one by one? or use threaded input?
while ( XPending( dpy ) ) {
XNextEvent( dpy, &event );
switch (event.type) {
case KeyPress:
#ifdef XEVT_DBG
if (key_event->keycode > 0x7F)
common->DPrintf("WARNING: KeyPress keycode > 0x7F");
#endif
key_event->keycode &= 0x7F;
#ifdef XEVT_DBG2
printf("SE_KEY press %d\n", key_event->keycode);
#endif
Posix_QueEvent( SE_KEY, s_scantokey[key_event->keycode], true, 0, NULL);
lookupRet = XLookupString(key_event, buf, sizeof(buf), &keysym, NULL);
if (lookupRet > 0) {
char s = buf[0];
#ifdef XEVT_DBG
if (buf[1]!=0)
common->DPrintf("WARNING: got XLookupString buffer '%s' (%d)\n", buf, strlen(buf));
#endif
#ifdef XEVT_DBG2
printf("SE_CHAR %s\n", buf);
#endif
Posix_QueEvent( SE_CHAR, s, 0, 0, NULL);
}
if (!Posix_AddKeyboardPollEvent( s_scantokey[key_event->keycode], true ))
return;
break;
case KeyRelease:
if (Sys_XRepeatPress(&event)) {
#ifdef XEVT_DBG2
printf("RepeatPress\n");
#endif
continue;
}
#ifdef XEVT_DBG
if (key_event->keycode > 0x7F)
common->DPrintf("WARNING: KeyRelease keycode > 0x7F");
#endif
key_event->keycode &= 0x7F;
#ifdef XEVT_DBG2
printf("SE_KEY release %d\n", key_event->keycode);
#endif
Posix_QueEvent( SE_KEY, s_scantokey[key_event->keycode], false, 0, NULL);
if (!Posix_AddKeyboardPollEvent( s_scantokey[key_event->keycode], false ))
return;
break;
case ButtonPress:
if (event.xbutton.button == 4) {
Posix_QueEvent( SE_KEY, K_MWHEELUP, true, 0, NULL);
if (!Posix_AddMousePollEvent( M_DELTAZ, 1 ))
return;
} else if (event.xbutton.button == 5) {
Posix_QueEvent( SE_KEY, K_MWHEELDOWN, true, 0, NULL);
if (!Posix_AddMousePollEvent( M_DELTAZ, -1 ))
return;
} else {
b = -1;
if (event.xbutton.button == 1) {
b = 0; // K_MOUSE1
} else if (event.xbutton.button == 2) {
b = 2; // K_MOUSE3
} else if (event.xbutton.button == 3) {
b = 1; // K_MOUSE2
} else if (event.xbutton.button == 6) {
b = 3; // K_MOUSE4
} else if (event.xbutton.button == 7) {
b = 4; // K_MOUSE5
}
if (b == -1 || b > 4) {
common->DPrintf("X ButtonPress %d not supported\n", event.xbutton.button);
} else {
Posix_QueEvent( SE_KEY, K_MOUSE1 + b, true, 0, NULL);
if (!Posix_AddMousePollEvent( M_ACTION1 + b, true ))
return;
}
}
break;
case ButtonRelease:
if (event.xbutton.button == 4) {
Posix_QueEvent( SE_KEY, K_MWHEELUP, false, 0, NULL);
} else if (event.xbutton.button == 5) {
Posix_QueEvent( SE_KEY, K_MWHEELDOWN, false, 0, NULL);
} else {
b = -1;
if (event.xbutton.button == 1) {
b = 0;
} else if (event.xbutton.button == 2) {
b = 2;
} else if (event.xbutton.button == 3) {
b = 1;
} else if (event.xbutton.button == 6) {
b = 3; // K_MOUSE4
} else if (event.xbutton.button == 7) {
b = 4; // K_MOUSE5
}
if (b == -1 || b > 4) {
common->DPrintf("X ButtonRelease %d not supported\n", event.xbutton.button);
} else {
Posix_QueEvent( SE_KEY, K_MOUSE1 + b, false, 0, NULL);
if (!Posix_AddMousePollEvent( M_ACTION1 + b, false ))
return;
}
}
break;
case MotionNotify:
if (!mouse_active)
break;
if (in_dgamouse.GetBool()) {
dx = event.xmotion.x_root;
dy = event.xmotion.y_root;
Posix_QueEvent( SE_MOUSE, dx, dy, 0, NULL);
// if we overflow here, we'll get a warning, but the delta will be completely processed anyway
Posix_AddMousePollEvent( M_DELTAX, dx );
if (!Posix_AddMousePollEvent( M_DELTAY, dy ))
return;
} else {
// if it's a center motion, we've just returned from our warp
// FIXME: we generate mouse delta on wrap return, but that lags us quite a bit from the initial event..
if (event.xmotion.x == glConfig.vidWidth / 2 &&
event.xmotion.y == glConfig.vidHeight / 2) {
mwx = glConfig.vidWidth / 2;
mwy = glConfig.vidHeight / 2;
Posix_QueEvent( SE_MOUSE, mx, my, 0, NULL);
Posix_AddMousePollEvent( M_DELTAX, mx );
if (!Posix_AddMousePollEvent( M_DELTAY, my ))
return;
mx = my = 0;
break;
}
dx = ((int) event.xmotion.x - mwx);
dy = ((int) event.xmotion.y - mwy);
mx += dx;
my += dy;
mwx = event.xmotion.x;
mwy = event.xmotion.y;
XWarpPointer(dpy,None,win,0,0,0,0, (glConfig.vidWidth/2),(glConfig.vidHeight/2));
}
break;
}
}
}
/*
=================
Sys_ShutdownInput
=================
*/
void Sys_ShutdownInput( void ) { }
/*
===============
Sys_MapCharForKey
===============
*/
unsigned char Sys_MapCharForKey( int _key ) {
int key; // scan key ( != doom key )
XkbStateRec kbd_state;
XEvent event;
KeySym keysym;
int lookupRet;
char buf[5];
if ( !have_xkb || !dpy ) {
return (unsigned char)_key;
}
// query the current keyboard group, must be passed as bit 13-14 in the constructed XEvent
// see X Keyboard Extension library specifications
XkbGetState( dpy, XkbUseCoreKbd, &kbd_state );
// lookup scancode from doom key code. unique hits
for ( key = 0; key < 128; key++ ) {
if ( _key == s_scantokey[ key ] ) {
break;
}
}
if ( key == 128 ) {
// it happens. these, we can't convert
common->DPrintf( "Sys_MapCharForKey: doom key %d -> keycode failed\n", _key );
return (unsigned char)_key;
}
memset( &event, 0, sizeof( XEvent ) );
event.xkey.type = KeyPress;
event.xkey.display = dpy;
event.xkey.time = CurrentTime;
event.xkey.keycode = key;
event.xkey.state = kbd_state.group << 13;
lookupRet = XLookupString( (XKeyEvent *)&event, buf, sizeof( buf ), &keysym, NULL );
if ( lookupRet <= 0 ) {
Sys_Printf( "Sys_MapCharForKey: XLookupString key 0x%x failed\n", key );
return (unsigned char)_key;
}
if ( lookupRet > 1 ) {
// only ever expecting 1 char..
Sys_Printf( "Sys_MapCharForKey: XLookupString returned '%s'\n", buf );
}
return buf[ 0 ];
}

View File

@@ -0,0 +1,385 @@
NV-CONTROL X Extension - API specificiation v 1.6
1. INTRODUCTION
The NV-CONTROL X extension provides a mechanism for X clients to
query and set configuration parameters of the NVIDIA X driver.
State set by the NV-CONTROL X extension is assumed to be persistent
only for the current server generation.
Attributes are configurable on a per X screen basis, and some
attributes are also configurable on a per display device basis.
Addtionally, some attributes can only be queried, though most can
be both queried and modified. The NV-CONTROL extension provides
a mechanism to determine what values are valid for an attribute,
if an attribute is read-only, if it can be read and written, if it
requires a display device qualifier, and if the the attribute is
available on the specified X screen.
Finally, NV-CONTROL clients may also request to be notified when an
attribute is changed by any other NV-CONTROL client.
2. DISPLAY DEVICES
A "Display Device" refers to some piece of hardware capable of
displaying an image. Display devices are separated into the three
general categories: analog CRTs, digital flatpanels, and TVs.
Note that analog flatpanels fall under the category of analog CRTs.
The NVIDIA X driver allows multiple display devices to display
portions of the same X screen; this is configured through the
TwinView feature of the NVIDIA X driver. TwinView is described in
the Appendix on TwinView in the NVIDIA Linux driver text README file.
A consequence of TwinView is that an X screen does not necessarily
uniquely identify a display device.
While most attributes controlled by the NV-CONTROL X extension
apply to an entire X screen, some attributes can be controlled per
display device. When querying and assigning such attributes, the
particular display device is specified via a display device mask.
A "display device mask" is an unsigned 32 bit value that identifies
one or more display devices: the first 8 bits each identify a CRT, the
next 8 bits each identify a TV, and the next 8 each identify a DFP.
For example, 0x1 refers to CRT-0, 0x3 refers to CRT-0 and CRT-1,
0x10001 refers to CRT-0 and DFP-0, etc.
3. QUERYING THE EXTENSION
NV-CONTROL clients can query for the existence of the NV-CONTROL X
extension with:
Bool XNVCTRLQueryExtension (Display *dpy,
int *event_basep, int *error_basep);
This function returns True if the extension exists, and returns False
if the extension does not. It also returns the error and event bases.
The arguments are:
dpy - The connection to the X server.
event_basep - The returned event base. Currently, only one
extension specific event is defined.
error_basep - The returned error base. Currently, no extension
specific errors are defined.
The version of the NV-CONTROL extension can be queried with:
Bool XNVCTRLQueryVersion (Display *dpy, int *major, int *minor);
This function returns True if the extension exists, and returns
False if it does not. It also returns the major and minor version
numbers of the extension. The arguments are:
dpy - The connection to the X server.
major - The returned major version number of the extension.
minor - The returned minor version number of the extension.
You can determine if a particular X screen is controlled by the
NVIDIA X driver (and thus supports the NV-CONTROL X extension) with:
Bool XNVCTRLIsNvScreen (Display *dpy, int screen);
This function returns True if the specified screen is controlled by
the NVIDIA driver, and thus supports the NV-CONTROL X extension.
It returns False if the specified screen does not support the
NV-CONTROL X extension. The arguments are:
dpy - The connection to the X server.
screen - the X screen to query.
4. QUERYING VALID ATTRIBUTE VALUES
NV-CONTROL clients can query the valid values for any integer
attribute with:
Bool XNVCTRLQueryValidAttributeValues (Display *dpy,
int screen,
unsigned int display_mask,
unsigned int attribute,
NVCTRLAttributeValidValuesRec
*values);
This function returns True if the attribute exists on the specified
X screen, or False if the attribute is not available on the specified
X screen.
The arguments are:
dpy - The connection to the X server.
screen - the X screen to query.
display_mask - for attributes that can be controlled on a per
display device basis, the display_mask should
uniquely identify a single display device.
This argument is ignored for attributes that
apply to the entire X screen.
attribute - the integer attribute to query
values - the returned NVCTRLAttributeValidValuesRec structure.
The NVCTRLAttributeValidValuesRec structure is defined as:
typedef struct _NVCTRLAttributeValidValues {
int type;
union {
struct {
int min;
int max;
} range;
struct {
unsigned int ints;
} bits;
} u;
unsigned int permissions;
} NVCTRLAttributeValidValuesRec;
Where type can be one of:
#define ATTRIBUTE_TYPE_UNKNOWN 0
#define ATTRIBUTE_TYPE_INTEGER 1
#define ATTRIBUTE_TYPE_BITMASK 2
#define ATTRIBUTE_TYPE_BOOL 3
#define ATTRIBUTE_TYPE_RANGE 4
#define ATTRIBUTE_TYPE_INT_BITS 5
ATTRIBUTE_TYPE_INTEGER indicates that the attribute is an integer
value; any integer may be specified when setting this attribute.
ATTRIBUTE_TYPE_BITMASK indicates that the attribute is an integer
value, interpretted as a bitmask. This is the type, for example,
of the NV_CTRL_CONNECTED_DISPLAYS attribute.
ATTRIBUTE_TYPE_BOOL indicates that the attribute is a boolean;
valid values are 1 (on/true) and 0 (off/false).
ATTRIBUTE_TYPE_RANGE indicates that the attribute can have any
integer value between NVCTRLAttributeValidValues.u.range.min and
NVCTRLAttributeValidValues.u.range.max (inclusive).
ATTRIBUTE_TYPE_INT_BITS indicates that the attribute can
only have certain integer values, indicated by which bits in
NVCTRLAttributeValidValues.u.bits.ints are on (for example: if bit
0 is on, then 0 is a valid value; if bit 5 is on, then 5 is a valid
value, etc). This is the type, for example, of NV_CTRL_FSAA_MODE.
The permissions field in NVCTRLAttributeValidValuesRec is a bitmask
that can contain any of:
#define ATTRIBUTE_TYPE_READ 0x1
#define ATTRIBUTE_TYPE_WRITE 0x2
#define ATTRIBUTE_TYPE_DISPLAY 0x4
ATTRIBUTE_TYPE_READ indicates that the attribute is readable; in
general, all attributes will be readable.
ATTRIBUTE_TYPE_WRITE indicates that the attribute is writable;
attributes may not be writable for various reasons: they represent
static system information, they can only be changed by changing an
XF86Config option, etc.
ATTRIBUTE_TYPE_DISPLAY indicates that the attribute can be
controlled on a per display device basis, and thus
XNVCTRLQueryAttribute() and XNVCTRLSetAttribute() require that a
display device be specified.
The XNVCTRLQueryValidAttributeValues() function can cause the
following X protocol errors:
BadValue - The screen does not exist.
BadMatch - The NVIDIA driver is not present on that screen.
5. QUERYING ATTRIBUTE VALUES
NV-CONTROL clients can query the current value of an integer
attribute with:
Bool XNVCTRLQueryAttribute (Display *dpy,
int screen,
unsigned int display_mask,
unsigned int attribute,
int *value);
This function returns True if the attribute exists, and stores the
current attribute value in the memory pointed to by the value
argument. False is returned if the attribute does not exist on the
specified X screen.
The arguments are:
dpy - The connection to the X server.
screen - the X screen to query.
display_mask - if the attribute requires a display device,
then this indicates the display device to query;
this field is ignored if the attribute is not
display device specific. You can determine
if an attribute is display device specific by
querying the valid values and checking for the
ATTRIBUTE_TYPE_DISPLAY bit in the permissions
field.
attribute - the attribute to query.
value - the returned attribute value.
This function can cause the following X protocol errors:
BadValue - The screen does not exist.
BadMatch - The NVIDIA driver is not present on that screen.
NV-CONTROL clients can query the read-only string attributes with:
Bool XNVCTRLQueryStringAttribute (Display *dpy,
int screen,
unsigned int display_mask,
unsigned int attribute,
char **ptr);
This function returns True if the string attribute exists;
or it returns False if the string attribute does not exist. If
XNVCTRLQueryStringAttribute returns True, *ptr will point to an
allocated string containing the string attribute requested. It is
the caller's responsibility to free the string with XFree().
The arguments are:
dpy - The connection to the X server.
screen - the X screen to query.
display_mask - if the attribute requires a display device,
then this indicates the display device to query;
this field is ignored if the attribute is not
display device specific.
attribute - the string attribute to query
ptr - the returned allocated string
This function can cause the following X protocol errors:
BadValue - The screen does not exist.
BadMatch - The NVIDIA driver is not present on that screen.
BadAlloc - Insufficient resources to fulfill the request.
See NVCtrl.h (distributed in the src/libXNVCtrl/ directory of
the nvidia-settings source package) for a list of possible string
attributes.
6. ASSIGNING ATTRIBUTE VALUES
An integer attribute can be assigned a value with:
void XNVCTRLSetAttribute (Display *dpy,
int screen,
unsigned int display_mask,
unsigned int attribute,
int value);
This function sets the attribute to the given value. This function
does not have a return value. Note that, because it does not
return a value, XNVCTRLSetAttribute() only queues the request in
the X command stream. The command will not actually be sent to
the server until an X command that flushes the X command stream
(such as XFlush(), or any API command that queries a value from the
server) is called.
The arguments are:
dpy - The connection to the X server.
screen - the X screen to query.
display_mask - if the attribute requires a display device,
then this indicates the display device to set;
this field is ignored if the attribute is not
display device specific. You can determine
if an attribute is display device specific by
querying the valid values and checking for the
ATTRIBUTE_TYPE_DISPLAY bit in the permissions
field.
attribute - the attribute to set.
value - the value the attribute should be set to.
See NVCtrl.h (distributed in the src/libXNVCtrl/ directory of
the nvidia-settings source package) for a list of possible integer
attributes.
This function can cause the following X protocol errors:
BadMatch - The NVIDIA driver is not present on that screen.
BadValue - The screen does not exist, or an invalid value is
specified, or the attribute does not exist on the
specified X screen, or the attribute requires a
display device and display_mask does not uniquely
identify a display device.
Before calling XNVCTRLSetAttribute(), an NV-CONTROL client should
use XNVCTRLQueryAttribute() or XNVCTRLQueryValidAttributeValues()
to determine if the attribute exists on the specified X screen;
if the attribute does not exist and XNVCTRLSetAttribute()
is called for that attribute, then a BadValue X protocol error will
be triggered.
7. SELECTING EVENT NOTIFICATION
NV-CONTROL clients can enable NV-CONTROL events with:
Bool XNVCtrlSelectNotify (Display *dpy,
int screen,
int type,
Bool onoff);
This function returns True if the extension exists, or False if the
extension does not exist. The arguments are:
dpy - The connection to the X server.
screen - the X screen on which to enable events.
type - the type of event to enable; currently, the only NV-CONTROL
event type is ATTRIBUTE_CHANGED_EVENT.
onoff - whether to enable (True) or disable (False) receiving
this event type.
This function can cause the following X protocol errors:
BadValue - The screen does not exist.
BadMatch - The NVIDIA driver is not present on that screen.
When an NV-CONTROL client changes an integer attribute value, all
other NV-CONTROL clients with ATTRIBUTE_CHANGED_EVENT notificaion
enabled will receive an XEvent where XEvent.type is equal to:
event_base + ATTRIBUTE_CHANGED_EVENT
where event_base is the event base returned by
XNVCTRLQueryExtension(). The XEvent can then be cast as an
XNVCtrlAttributeChangedEvent structure:
typedef struct {
int type;
unsigned long serial;
Bool send_event; /* always FALSE, we don't allow send_events */
Display *display;
Time time;
int screen;
unsigned int display_mask;
unsigned int attribute;
int value;
} XNVCtrlAttributeChangedEvent;
The screen, display_mask, attribute, and value fields correspond to
the arguments passed to XNVCTRLSetAttribute().
8. NV-CONTROL EXTENSION HISTORY
1.0 - 1.5 NVIDIA Internal development versions
1.6 Initial public version

View File

@@ -0,0 +1,339 @@
#define NEED_EVENTS
#define NEED_REPLIES
#include <X11/Xlibint.h>
#include <X11/Xutil.h>
#include <X11/extensions/Xext.h>
#include "extutil.h"
#include "NVCtrlLib.h"
#include "nv_control.h"
#if !defined(XTRHEADS)
#warning XTRHEADS not defined -- this libXNVCtrl.a will not be thread safe!
#endif
static XExtensionInfo _nvctrl_ext_info_data;
static XExtensionInfo *nvctrl_ext_info = &_nvctrl_ext_info_data;
static /* const */ char *nvctrl_extension_name = NV_CONTROL_NAME;
#define XNVCTRLCheckExtension(dpy,i,val) \
XextCheckExtension (dpy, i, nvctrl_extension_name, val)
#define XNVCTRLSimpleCheckExtension(dpy,i) \
XextSimpleCheckExtension (dpy, i, nvctrl_extension_name)
static int close_display();
static Bool wire_to_event();
static /* const */ XExtensionHooks nvctrl_extension_hooks = {
NULL, /* create_gc */
NULL, /* copy_gc */
NULL, /* flush_gc */
NULL, /* free_gc */
NULL, /* create_font */
NULL, /* free_font */
close_display, /* close_display */
wire_to_event, /* wire_to_event */
NULL, /* event_to_wire */
NULL, /* error */
NULL, /* error_string */
};
static XEXT_GENERATE_FIND_DISPLAY (find_display, nvctrl_ext_info,
nvctrl_extension_name,
&nvctrl_extension_hooks,
NV_CONTROL_EVENTS, NULL)
static XEXT_GENERATE_CLOSE_DISPLAY (close_display, nvctrl_ext_info)
Bool XNVCTRLQueryExtension (
Display *dpy,
int *event_basep,
int *error_basep
){
XExtDisplayInfo *info = find_display (dpy);
if (XextHasExtension(info)) {
if (event_basep) *event_basep = info->codes->first_event;
if (error_basep) *error_basep = info->codes->first_error;
return True;
} else {
return False;
}
}
Bool XNVCTRLQueryVersion (
Display *dpy,
int *major,
int *minor
){
XExtDisplayInfo *info = find_display (dpy);
xnvCtrlQueryExtensionReply rep;
xnvCtrlQueryExtensionReq *req;
if(!XextHasExtension(info))
return False;
XNVCTRLCheckExtension (dpy, info, False);
LockDisplay (dpy);
GetReq (nvCtrlQueryExtension, req);
req->reqType = info->codes->major_opcode;
req->nvReqType = X_nvCtrlQueryExtension;
if (!_XReply (dpy, (xReply *) &rep, 0, xTrue)) {
UnlockDisplay (dpy);
SyncHandle ();
return False;
}
if (major) *major = rep.major;
if (minor) *minor = rep.minor;
UnlockDisplay (dpy);
SyncHandle ();
return True;
}
Bool XNVCTRLIsNvScreen (
Display *dpy,
int screen
){
XExtDisplayInfo *info = find_display (dpy);
xnvCtrlIsNvReply rep;
xnvCtrlIsNvReq *req;
Bool isnv;
if(!XextHasExtension(info))
return False;
XNVCTRLCheckExtension (dpy, info, False);
LockDisplay (dpy);
GetReq (nvCtrlIsNv, req);
req->reqType = info->codes->major_opcode;
req->nvReqType = X_nvCtrlIsNv;
req->screen = screen;
if (!_XReply (dpy, (xReply *) &rep, 0, xTrue)) {
UnlockDisplay (dpy);
SyncHandle ();
return False;
}
isnv = rep.isnv;
UnlockDisplay (dpy);
SyncHandle ();
return isnv;
}
void XNVCTRLSetAttribute (
Display *dpy,
int screen,
unsigned int display_mask,
unsigned int attribute,
int value
){
XExtDisplayInfo *info = find_display (dpy);
xnvCtrlSetAttributeReq *req;
XNVCTRLSimpleCheckExtension (dpy, info);
LockDisplay (dpy);
GetReq (nvCtrlSetAttribute, req);
req->reqType = info->codes->major_opcode;
req->nvReqType = X_nvCtrlSetAttribute;
req->screen = screen;
req->display_mask = display_mask;
req->attribute = attribute;
req->value = value;
UnlockDisplay (dpy);
SyncHandle ();
}
Bool XNVCTRLQueryAttribute (
Display *dpy,
int screen,
unsigned int display_mask,
unsigned int attribute,
int *value
){
XExtDisplayInfo *info = find_display (dpy);
xnvCtrlQueryAttributeReply rep;
xnvCtrlQueryAttributeReq *req;
Bool exists;
if(!XextHasExtension(info))
return False;
XNVCTRLCheckExtension (dpy, info, False);
LockDisplay (dpy);
GetReq (nvCtrlQueryAttribute, req);
req->reqType = info->codes->major_opcode;
req->nvReqType = X_nvCtrlQueryAttribute;
req->screen = screen;
req->display_mask = display_mask;
req->attribute = attribute;
if (!_XReply (dpy, (xReply *) &rep, 0, xTrue)) {
UnlockDisplay (dpy);
SyncHandle ();
return False;
}
if (value) *value = rep.value;
exists = rep.flags;
UnlockDisplay (dpy);
SyncHandle ();
return exists;
}
Bool XNVCTRLQueryStringAttribute (
Display *dpy,
int screen,
unsigned int display_mask,
unsigned int attribute,
char **ptr
){
XExtDisplayInfo *info = find_display (dpy);
xnvCtrlQueryStringAttributeReply rep;
xnvCtrlQueryStringAttributeReq *req;
Bool exists;
int length, numbytes, slop;
if (!ptr) return False;
if(!XextHasExtension(info))
return False;
XNVCTRLCheckExtension (dpy, info, False);
LockDisplay (dpy);
GetReq (nvCtrlQueryStringAttribute, req);
req->reqType = info->codes->major_opcode;
req->nvReqType = X_nvCtrlQueryStringAttribute;
req->screen = screen;
req->display_mask = display_mask;
req->attribute = attribute;
if (!_XReply (dpy, (xReply *) &rep, 0, False)) {
UnlockDisplay (dpy);
SyncHandle ();
return False;
}
length = rep.length;
numbytes = rep.n;
slop = numbytes & 3;
*ptr = (char *) Xmalloc(numbytes);
if (! *ptr) {
_XEatData(dpy, length);
UnlockDisplay (dpy);
SyncHandle ();
return False;
} else {
_XRead(dpy, (char *) *ptr, numbytes);
if (slop) _XEatData(dpy, 4-slop);
}
exists = rep.flags;
UnlockDisplay (dpy);
SyncHandle ();
return exists;
}
Bool XNVCTRLQueryValidAttributeValues (
Display *dpy,
int screen,
unsigned int display_mask,
unsigned int attribute,
NVCTRLAttributeValidValuesRec *values
){
XExtDisplayInfo *info = find_display (dpy);
xnvCtrlQueryValidAttributeValuesReply rep;
xnvCtrlQueryValidAttributeValuesReq *req;
Bool exists;
if (!values) return False;
if(!XextHasExtension(info))
return False;
XNVCTRLCheckExtension (dpy, info, False);
LockDisplay (dpy);
GetReq (nvCtrlQueryValidAttributeValues, req);
req->reqType = info->codes->major_opcode;
req->nvReqType = X_nvCtrlQueryValidAttributeValues;
req->screen = screen;
req->display_mask = display_mask;
req->attribute = attribute;
if (!_XReply (dpy, (xReply *) &rep, 0, xTrue)) {
UnlockDisplay (dpy);
SyncHandle ();
return False;
}
exists = rep.flags;
values->type = rep.attr_type;
if (rep.attr_type == ATTRIBUTE_TYPE_RANGE) {
values->u.range.min = rep.min;
values->u.range.max = rep.max;
}
if (rep.attr_type == ATTRIBUTE_TYPE_INT_BITS) {
values->u.bits.ints = rep.bits;
}
values->permissions = rep.perms;
UnlockDisplay (dpy);
SyncHandle ();
return exists;
}
Bool XNVCtrlSelectNotify (
Display *dpy,
int screen,
int type,
Bool onoff
){
XExtDisplayInfo *info = find_display (dpy);
xnvCtrlSelectNotifyReq *req;
if(!XextHasExtension (info))
return False;
XNVCTRLCheckExtension (dpy, info, False);
LockDisplay (dpy);
GetReq (nvCtrlSelectNotify, req);
req->reqType = info->codes->major_opcode;
req->nvReqType = X_nvCtrlSelectNotify;
req->screen = screen;
req->notifyType = type;
req->onoff = onoff;
UnlockDisplay (dpy);
SyncHandle ();
return True;
}
static Bool wire_to_event (Display *dpy, XEvent *host, xEvent *wire)
{
XExtDisplayInfo *info = find_display (dpy);
XNVCtrlEvent *re = (XNVCtrlEvent *) host;
xnvctrlEvent *event = (xnvctrlEvent *) wire;
XNVCTRLCheckExtension (dpy, info, False);
switch ((event->u.u.type & 0x7F) - info->codes->first_event) {
case ATTRIBUTE_CHANGED_EVENT:
re->attribute_changed.type = event->u.u.type & 0x7F;
re->attribute_changed.serial =
_XSetLastRequestRead(dpy, (xGenericReply*) event);
re->attribute_changed.send_event = ((event->u.u.type & 0x80) != 0);
re->attribute_changed.display = dpy;
re->attribute_changed.time = event->u.attribute_changed.time;
re->attribute_changed.screen = event->u.attribute_changed.screen;
re->attribute_changed.display_mask =
event->u.attribute_changed.display_mask;
re->attribute_changed.attribute = event->u.attribute_changed.attribute;
re->attribute_changed.value = event->u.attribute_changed.value;
break;
default:
return False;
}
return True;
}

View File

@@ -0,0 +1,786 @@
#ifndef __NVCTRL_H
#define __NVCTRL_H
/**************************************************************************/
/*
* Integer attributes; these are settable/gettable via
* XNVCTRLSetAttribute() and XNVCTRLQueryAttribute, respectively.
* Some attributes may only be read; some may require a display_mask
* argument. This information is encoded in the "permission" comment
* after each attribute #define, and can be queried at run time with
* XNVCTRLQueryValidAttributeValues().
*
* Key to Integer Attribute "Permissions":
*
* R: The attribute is readable (in general, all attributes will be
* readable)
*
* W: The attribute is writable (attributes may not be writable for
* various reasons: they represent static system information, they
* can only be changed by changing an XF86Config option, etc).
*
* D: The attribute requires the display mask argument. The
* attributes NV_CTRL_CONNECTED_DISPLAYS and NV_CTRL_ENABLED_DISPLAYS
* will be a bitmask of what display devices are connected and what
* display devices are enabled for use in X, respectively. Each bit
* in the bitmask represents a display device; it is these bits which
* should be used as the display_mask when dealing with attributes
* designated with "D" below. For attributes that do not require the
* display mask, the argument is ignored.
*/
/**************************************************************************/
/*
* NV_CTRL_FLATPANEL_SCALING - the current flatpanel scaling state;
* possible values are:
*
* 0: default (the driver will use whatever state is current)
* 1: native (the driver will use the panel's scaler, if possible)
* 2: scaled (the driver will use the GPU's scaler, if possible)
* 3: centered (the driver will center the image)
* 4: aspect scaled (scale with the GPU's scaler, but keep the aspect
* ratio correct)
*/
#define NV_CTRL_FLATPANEL_SCALING 2 /* RWD */
#define NV_CTRL_FLATPANEL_SCALING_DEFAULT 0
#define NV_CTRL_FLATPANEL_SCALING_NATIVE 1
#define NV_CTRL_FLATPANEL_SCALING_SCALED 2
#define NV_CTRL_FLATPANEL_SCALING_CENTERED 3
#define NV_CTRL_FLATPANEL_SCALING_ASPECT_SCALED 4
/*
* NV_CTRL_FLATPANEL_DITHERING - the current flatpanel dithering
* state; possible values are:
*
* 0: default (the driver will decide when to dither)
* 1: enabled (the driver will always dither when possible)
* 2: disabled (the driver will never dither)
*/
#define NV_CTRL_FLATPANEL_DITHERING 3 /* RWD */
#define NV_CTRL_FLATPANEL_DITHERING_DEFAULT 0
#define NV_CTRL_FLATPANEL_DITHERING_ENABLED 1
#define NV_CTRL_FLATPANEL_DITHERING_DISABLED 2
/*
* NV_CTRL_DIGITAL_VIBRANCE - sets the digital vibrance level for the
* specified display device.
*/
#define NV_CTRL_DIGITAL_VIBRANCE 4 /* RWD */
/*
* NV_CTRL_BUS_TYPE - returns the Bus type through which the GPU
* driving the specified X screen is connected to the computer.
*/
#define NV_CTRL_BUS_TYPE 5 /* R-- */
#define NV_CTRL_BUS_TYPE_AGP 0
#define NV_CTRL_BUS_TYPE_PCI 1
#define NV_CTRL_BUS_TYPE_PCI_EXPRESS 2
/*
* NV_CTRL_VIDEO_RAM - returns the amount of video ram on the GPU
* driving the specified X screen.
*/
#define NV_CTRL_VIDEO_RAM 6 /* R-- */
/*
* NV_CTRL_IRQ - returns the interrupt request line used by the GPU
* driving the specified X screen.
*/
#define NV_CTRL_IRQ 7 /* R-- */
/*
* NV_CTRL_OPERATING_SYSTEM - returns the operating system on which
* the X server is running.
*/
#define NV_CTRL_OPERATING_SYSTEM 8 /* R-- */
#define NV_CTRL_OPERATING_SYSTEM_LINUX 0
#define NV_CTRL_OPERATING_SYSTEM_FREEBSD 1
/*
* NV_CTRL_SYNC_TO_VBLANK - enables sync to vblank for OpenGL clients.
* This setting is only applied to OpenGL clients that are started
* after this setting is applied.
*/
#define NV_CTRL_SYNC_TO_VBLANK 9 /* RW- */
#define NV_CTRL_SYNC_TO_VBLANK_OFF 0
#define NV_CTRL_SYNC_TO_VBLANK_ON 1
/*
* NV_CTRL_LOG_ANISO - enables anisotropic filtering for OpenGL
* clients; on some NVIDIA hardware, this can only be enabled or
* disabled; on other hardware different levels of anisotropic
* filtering can be specified. This setting is only applied to OpenGL
* clients that are started after this setting is applied.
*/
#define NV_CTRL_LOG_ANISO 10 /* RW- */
/*
* NV_CTRL_FSAA_MODE - the FSAA setting for OpenGL clients; possible
* FSAA modes:
*
* NV_CTRL_FSAA_MODE_2x "2x Bilinear Multisampling"
* NV_CTRL_FSAA_MODE_2x_5t "2x Quincunx Multisampling"
* NV_CTRL_FSAA_MODE_15x15 "1.5 x 1.5 Supersampling"
* NV_CTRL_FSAA_MODE_2x2 "2 x 2 Supersampling"
* NV_CTRL_FSAA_MODE_4x "4x Bilinear Multisampling"
* NV_CTRL_FSAA_MODE_4x_9t "4x Gaussian Multisampling"
* NV_CTRL_FSAA_MODE_8x "2x Bilinear Multisampling by 4x Supersampling"
* NV_CTRL_FSAA_MODE_16x "4x Bilinear Multisampling by 4x Supersampling"
*
* This setting is only applied to OpenGL clients that are started
* after this setting is applied.
*/
#define NV_CTRL_FSAA_MODE 11 /* RW- */
#define NV_CTRL_FSAA_MODE_NONE 0
#define NV_CTRL_FSAA_MODE_2x 1
#define NV_CTRL_FSAA_MODE_2x_5t 2
#define NV_CTRL_FSAA_MODE_15x15 3
#define NV_CTRL_FSAA_MODE_2x2 4
#define NV_CTRL_FSAA_MODE_4x 5
#define NV_CTRL_FSAA_MODE_4x_9t 6
#define NV_CTRL_FSAA_MODE_8x 7
#define NV_CTRL_FSAA_MODE_16x 8
/*
* NV_CTRL_TEXTURE_SHARPEN - enables texture sharpening for OpenGL
* clients. This setting is only applied to OpenGL clients that are
* started after this setting is applied.
*/
#define NV_CTRL_TEXTURE_SHARPEN 12 /* RW- */
#define NV_CTRL_TEXTURE_SHARPEN_OFF 0
#define NV_CTRL_TEXTURE_SHARPEN_ON 1
/*
* NV_CTRL_UBB - returns whether UBB is enabled for the specified X
* screen.
*/
#define NV_CTRL_UBB 13 /* R-- */
#define NV_CTRL_UBB_OFF 0
#define NV_CTRL_UBB_ON 1
/*
* NV_CTRL_OVERLAY - returns whether the RGB overlay is enabled for
* the specified X screen.
*/
#define NV_CTRL_OVERLAY 14 /* R-- */
#define NV_CTRL_OVERLAY_OFF 0
#define NV_CTRL_OVERLAY_ON 1
/*
* NV_CTRL_STEREO - returns whether stereo (and what type) is enabled
* for the specified X screen.
*/
#define NV_CTRL_STEREO 16 /* R-- */
#define NV_CTRL_STEREO_OFF 0
#define NV_CTRL_STEREO_DDC 1
#define NV_CTRL_STEREO_BLUELINE 2
#define NV_CTRL_STEREO_DIN 3
#define NV_CTRL_STEREO_TWINVIEW 4
/*
* NV_CTRL_EMULATE - controls OpenGL software emulation of future
* NVIDIA GPUs.
*/
#define NV_CTRL_EMULATE 17 /* RW- */
#define NV_CTRL_EMULATE_NONE 0
/*
* NV_CTRL_TWINVIEW - returns whether TwinView is enabled for the
* specified X screen.
*/
#define NV_CTRL_TWINVIEW 18 /* R-- */
#define NV_CTRL_TWINVIEW_NOT_ENABLED 0
#define NV_CTRL_TWINVIEW_ENABLED 1
/*
* NV_CTRL_CONNECTED_DISPLAYS - returns a display mask indicating what
* display devices are connected to the GPU driving the specified X
* screen.
*/
#define NV_CTRL_CONNECTED_DISPLAYS 19 /* R-- */
/*
* NV_CTRL_ENABLED_DISPLAYS - returns a display mask indicating what
* display devices are enabled for use on the specified X screen.
*/
#define NV_CTRL_ENABLED_DISPLAYS 20 /* R-- */
/**************************************************************************/
/*
* Integer attributes specific to configuring FrameLock on boards that
* support it.
*/
/*
* NV_CTRL_FRAMELOCK - returns whether this X screen supports
* FrameLock. All of the other FrameLock attributes are only
* applicable if NV_CTRL_FRAMELOCK is _SUPPORTED.
*/
#define NV_CTRL_FRAMELOCK 21 /* R-- */
#define NV_CTRL_FRAMELOCK_NOT_SUPPORTED 0
#define NV_CTRL_FRAMELOCK_SUPPORTED 1
/*
* NV_CTRL_FRAMELOCK_MASTER - get/set whether this X screen is the
* FrameLock master for the entire sync group. Note that only one
* node in the sync group should be configured as the master.
*/
#define NV_CTRL_FRAMELOCK_MASTER 22 /* RW- */
#define NV_CTRL_FRAMELOCK_MASTER_FALSE 0
#define NV_CTRL_FRAMELOCK_MASTER_TRUE 1
/*
* NV_CTRL_FRAMELOCK_POLARITY - sync either to the rising edge of the
* framelock pulse, or both the rising and falling edges of the
* framelock pulse.
*/
#define NV_CTRL_FRAMELOCK_POLARITY 23 /* RW- */
#define NV_CTRL_FRAMELOCK_POLARITY_RISING_EDGE 0x1
#define NV_CTRL_FRAMELOCK_POLARITY_BOTH_EDGES 0x3
/*
* NV_CTRL_FRAMELOCK_SYNC_DELAY - delay between the framelock pulse
* and the GPU sync. This is an 11 bit value which is multipled by
* 7.81 to determine the sync delay in microseconds.
*/
#define NV_CTRL_FRAMELOCK_SYNC_DELAY 24 /* RW- */
#define NV_CTRL_FRAMELOCK_SYNC_DELAY_MAX 2047
#define NV_CTRL_FRAMELOCK_SYNC_DELAY_FACTOR 7.81
/*
* NV_CTRL_FRAMELOCK_SYNC_INTERVAL - how many house sync pulses
* between the FrameLock sync generation (0 == sync every house sync);
* this only applies to the master when receiving house sync.
*/
#define NV_CTRL_FRAMELOCK_SYNC_INTERVAL 25 /* RW- */
/*
* NV_CTRL_FRAMELOCK_PORT0_STATUS - status of the rj45 port0.
*/
#define NV_CTRL_FRAMELOCK_PORT0_STATUS 26 /* R-- */
#define NV_CTRL_FRAMELOCK_PORT0_STATUS_INPUT 0
#define NV_CTRL_FRAMELOCK_PORT0_STATUS_OUTPUT 1
/*
* NV_CTRL_FRAMELOCK_PORT1_STATUS - status of the rj45 port1.
*/
#define NV_CTRL_FRAMELOCK_PORT1_STATUS 27 /* R-- */
#define NV_CTRL_FRAMELOCK_PORT1_STATUS_INPUT 0
#define NV_CTRL_FRAMELOCK_PORT1_STATUS_OUTPUT 1
/*
* NV_CTRL_FRAMELOCK_HOUSE_STATUS - status of the house input (the BNC
* connector).
*/
#define NV_CTRL_FRAMELOCK_HOUSE_STATUS 28 /* R-- */
#define NV_CTRL_FRAMELOCK_HOUSE_STATUS_NOT_DETECTED 0
#define NV_CTRL_FRAMELOCK_HOUSE_STATUS_DETECTED 1
/*
* NV_CTRL_FRAMELOCK_SYNC - enable/disable the syncing of the
* specified display devices to the FrameLock pulse.
*/
#define NV_CTRL_FRAMELOCK_SYNC 29 /* RWD */
#define NV_CTRL_FRAMELOCK_SYNC_DISABLE 0
#define NV_CTRL_FRAMELOCK_SYNC_ENABLE 1
/*
* NV_CTRL_FRAMELOCK_SYNC_READY - reports whether a slave FrameLock
* board is receiving sync (regardless of whether or not any display
* devices are using the sync).
*/
#define NV_CTRL_FRAMELOCK_SYNC_READY 30 /* R-- */
#define NV_CTRL_FRAMELOCK_SYNC_READY_FALSE 0
#define NV_CTRL_FRAMELOCK_SYNC_READY_TRUE 1
/*
* NV_CTRL_FRAMELOCK_STEREO_SYNC - this indicates that the GPU stereo
* signal is in sync with the framelock stereo signal.
*/
#define NV_CTRL_FRAMELOCK_STEREO_SYNC 31 /* R-- */
#define NV_CTRL_FRAMELOCK_STEREO_SYNC_FALSE 0
#define NV_CTRL_FRAMELOCK_STEREO_SYNC_TRUE 1
/*
* NV_CTRL_FRAMELOCK_TEST_SIGNAL - to test the connections in the sync
* group, tell the master to enable a test signal, then query port[01]
* status and sync_ready on all slaves. When done, tell the master to
* disable the test signal. Test signal should only be manipulated
* while NV_CTRL_FRAMELOCK_SYNC is enabled.
*
* The TEST_SIGNAL is also used to reset the Universal Frame Count (as
* returned by the glXQueryFrameCountNV() function in the
* GLX_NV_swap_group extension). Note: for best accuracy of the
* Universal Frame Count, it is recommended to toggle the TEST_SIGNAL
* on and off after enabling FrameLock.
*/
#define NV_CTRL_FRAMELOCK_TEST_SIGNAL 32 /* RW- */
#define NV_CTRL_FRAMELOCK_TEST_SIGNAL_DISABLE 0
#define NV_CTRL_FRAMELOCK_TEST_SIGNAL_ENABLE 1
/*
* NV_CTRL_FRAMELOCK_ETHERNET_DETECTED - The FrameLock boards are
* cabled together using regular cat5 cable, connecting to rj45 ports
* on the backplane of the card. There is some concern that users may
* think these are ethernet ports and connect them to a
* router/hub/etc. The hardware can detect this and will shut off to
* prevent damage (either to itself or to the router).
* NV_CTRL_FRAMELOCK_ETHERNET_DETECTED may be called to find out if
* ethernet is connected to one of the rj45 ports. An appropriate
* error message should then be displayed. The _PORT0 and PORT1
* values may be or'ed together.
*/
#define NV_CTRL_FRAMELOCK_ETHERNET_DETECTED 33 /* R-- */
#define NV_CTRL_FRAMELOCK_ETHERNET_DETECTED_NONE 0
#define NV_CTRL_FRAMELOCK_ETHERNET_DETECTED_PORT0 0x1
#define NV_CTRL_FRAMELOCK_ETHERNET_DETECTED_PORT1 0x2
/*
* NV_CTRL_FRAMELOCK_VIDEO_MODE - get/set the video mode of the house
* input.
*/
#define NV_CTRL_FRAMELOCK_VIDEO_MODE 34 /* RW- */
#define NV_CTRL_FRAMELOCK_VIDEO_MODE_NONE 0
#define NV_CTRL_FRAMELOCK_VIDEO_MODE_TTL 1
#define NV_CTRL_FRAMELOCK_VIDEO_MODE_NTSCPALSECAM 2
#define NV_CTRL_FRAMELOCK_VIDEO_MODE_HDTV 3
/*
* During FRAMELOCK bring-up, the above values were redefined to
* these:
*/
#define NV_CTRL_FRAMELOCK_VIDEO_MODE_COMPOSITE_AUTO 0
#define NV_CTRL_FRAMELOCK_VIDEO_MODE_TTL 1
#define NV_CTRL_FRAMELOCK_VIDEO_MODE_COMPOSITE_BI_LEVEL 2
#define NV_CTRL_FRAMELOCK_VIDEO_MODE_COMPOSITE_TRI_LEVEL 3
/*
* NV_CTRL_FRAMELOCK_SYNC_RATE - this is the refresh rate that the
* framelock board is sending to the GPU, in milliHz.
*/
#define NV_CTRL_FRAMELOCK_SYNC_RATE 35 /* R-- */
/**************************************************************************/
/*
* NV_CTRL_FORCE_GENERIC_CPU - inhibit the use of CPU specific
* features such as MMX, SSE, or 3DNOW! for OpenGL clients; this
* option may result in performance loss, but may be useful in
* conjunction with software such as the Valgrind memory debugger.
* This setting is only applied to OpenGL clients that are started
* after this setting is applied.
*/
#define NV_CTRL_FORCE_GENERIC_CPU 37 /* RW- */
#define NV_CTRL_FORCE_GENERIC_CPU_DISABLE 0
#define NV_CTRL_FORCE_GENERIC_CPU_ENABLE 1
/*
* NV_CTRL_OPENGL_AA_LINE_GAMMA - for OpenGL clients, allow
* Gamma-corrected antialiased lines to consider variances in the
* color display capabilities of output devices when rendering smooth
* lines. Only available on recent Quadro GPUs. This setting is only
* applied to OpenGL clients that are started after this setting is
* applied.
*/
#define NV_CTRL_OPENGL_AA_LINE_GAMMA 38 /* RW- */
#define NV_CTRL_OPENGL_AA_LINE_GAMMA_DISABLE 0
#define NV_CTRL_OPENGL_AA_LINE_GAMMA_ENABLE 1
/*
* NV_CTRL_FRAMELOCK_TIMING - this is TRUE when the framelock board is
* receiving timing input.
*/
#define NV_CTRL_FRAMELOCK_TIMING 39 /* RW- */
#define NV_CTRL_FRAMELOCK_TIMING_FALSE 0
#define NV_CTRL_FRAMELOCK_TIMING_TRUE 1
/*
* NV_CTRL_FLIPPING_ALLOWED - when TRUE, OpenGL will swap by flipping
* when possible; when FALSE, OpenGL will alway swap by blitting. XXX
* can this be enabled dynamically?
*/
#define NV_CTRL_FLIPPING_ALLOWED 40 /* RW- */
#define NV_CTRL_FLIPPING_ALLOWED_FALSE 0
#define NV_CTRL_FLIPPING_ALLOWED_TRUE 1
/*
* NV_CTRL_ARCHITECTURE - returns the architecture on which the X server is
* running.
*/
#define NV_CTRL_ARCHITECTURE 41 /* R-- */
#define NV_CTRL_ARCHITECTURE_X86 0
#define NV_CTRL_ARCHITECTURE_X86_64 1
#define NV_CTRL_ARCHITECTURE_IA64 2
/*
* NV_CTRL_TEXTURE_CLAMPING - texture clamping mode in OpenGL. By
* default, NVIDIA's OpenGL implementation uses CLAMP_TO_EDGE, which
* is not strictly conformant, but some applications rely on the
* non-conformant behavior, and not all GPUs support conformant
* texture clamping in hardware. _SPEC forces OpenGL texture clamping
* to be conformant, but may introduce slower performance on older
* GPUS, or incorrect texture clamping in certain applications.
*/
#define NV_CTRL_TEXTURE_CLAMPING 42 /* RW- */
#define NV_CTRL_TEXTURE_CLAMPING_EDGE 0
#define NV_CTRL_TEXTURE_CLAMPING_SPEC 1
#define NV_CTRL_CURSOR_SHADOW 43 /* RW- */
#define NV_CTRL_CURSOR_SHADOW_DISABLE 0
#define NV_CTRL_CURSOR_SHADOW_ENABLE 1
#define NV_CTRL_CURSOR_SHADOW_ALPHA 44 /* RW- */
#define NV_CTRL_CURSOR_SHADOW_RED 45 /* RW- */
#define NV_CTRL_CURSOR_SHADOW_GREEN 46 /* RW- */
#define NV_CTRL_CURSOR_SHADOW_BLUE 47 /* RW- */
#define NV_CTRL_CURSOR_SHADOW_X_OFFSET 48 /* RW- */
#define NV_CTRL_CURSOR_SHADOW_Y_OFFSET 49 /* RW- */
/*
* When Application Control for FSAA is enabled, then what the
* application requests is used, and NV_CTRL_FSAA_MODE is ignored. If
* this is disabled, then any application setting is overridden with
* NV_CTRL_FSAA_MODE
*/
#define NV_CTRL_FSAA_APPLICATION_CONTROLLED 50 /* RW- */
#define NV_CTRL_FSAA_APPLICATION_CONTROLLED_ENABLED 1
#define NV_CTRL_FSAA_APPLICATION_CONTROLLED_DISABLED 0
/*
* When Application Control for LogAniso is enabled, then what the
* application requests is used, and NV_CTRL_LOG_ANISO is ignored. If
* this is disabled, then any application setting is overridden with
* NV_CTRL_LOG_ANISO
*/
#define NV_CTRL_LOG_ANISO_APPLICATION_CONTROLLED 51 /* RW- */
#define NV_CTRL_LOG_ANISO_APPLICATION_CONTROLLED_ENABLED 1
#define NV_CTRL_LOG_ANISO_APPLICATION_CONTROLLED_DISABLED 0
/*
* IMAGE_SHARPENING adjusts the sharpness of the display's image
* quality by amplifying high frequency content. Valid values will
* normally be in the range [0,32). Only available on GeForceFX or
* newer.
*/
#define NV_CTRL_IMAGE_SHARPENING 52 /* RWD */
/*
* NV_CTRL_TV_OVERSCAN adjusts the amount of overscan on the specified
* display device.
*/
#define NV_CTRL_TV_OVERSCAN 53 /* RWD */
/*
* NV_CTRL_TV_FLICKER_FILTER adjusts the amount of flicker filter on
* the specified display device.
*/
#define NV_CTRL_TV_FLICKER_FILTER 54 /* RWD */
/*
* NV_CTRL_TV_BRIGHTNESS adjusts the amount of brightness on the
* specified display device.
*/
#define NV_CTRL_TV_BRIGHTNESS 55 /* RWD */
/*
* NV_CTRL_TV_HUE adjusts the amount of hue on the specified display
* device.
*/
#define NV_CTRL_TV_HUE 56 /* RWD */
/*
* NV_CTRL_TV_CONTRAST adjusts the amount of contrast on the specified
* display device.
*/
#define NV_CTRL_TV_CONTRAST 57 /* RWD */
/*
* NV_CTRL_TV_SATURATION adjusts the amount of saturation on the
* specified display device.
*/
#define NV_CTRL_TV_SATURATION 58 /* RWD */
/*
* NV_CTRL_TV_RESET_SETTINGS - this write-only attribute can be used
* to request that all TV Settings be reset to their default values;
* typical usage would be that this attribute be sent, and then all
* the TV attributes be queried to retrieve their new values.
*/
#define NV_CTRL_TV_RESET_SETTINGS 59 /* -WD */
/*
* NV_CTRL_GPU_CORE_TEMPERATURE reports the current core temperature
* of the GPU driving the X screen.
*/
#define NV_CTRL_GPU_CORE_TEMPERATURE 60 /* R-- */
/*
* NV_CTRL_GPU_CORE_THRESHOLD reports the current GPU core slowdown
* threshold temperature, NV_CTRL_GPU_DEFAULT_CORE_THRESHOLD and
* NV_CTRL_GPU_MAX_CORE_THRESHOLD report the default and MAX core
* slowdown threshold temperatures.
*
* NV_CTRL_GPU_CORE_THRESHOLD reflects the temperature at which the
* GPU is throttled to prevent overheating.
*/
#define NV_CTRL_GPU_CORE_THRESHOLD 61 /* R-- */
#define NV_CTRL_GPU_DEFAULT_CORE_THRESHOLD 62 /* R-- */
#define NV_CTRL_GPU_MAX_CORE_THRESHOLD 63 /* R-- */
/*
* NV_CTRL_AMBIENT_TEMPERATURE reports the current temperature in the
* immediate neighbourhood of the GPU driving the X screen.
*/
#define NV_CTRL_AMBIENT_TEMPERATURE 64 /* R-- */
/*
* NV_CTRL_PBUFFER_SCANOUT_SUPPORTED - returns whether this X screen
* supports scanout of FP pbuffers;
*
* if this screen does not support PBUFFER_SCANOUT, then all other
* PBUFFER_SCANOUT attributes are unavailable.
*/
#define NV_CTRL_PBUFFER_SCANOUT_SUPPORTED 65 /* R-- */
#define NV_CTRL_PBUFFER_SCANOUT_FALSE 0
#define NV_CTRL_PBUFFER_SCANOUT_TRUE 1
/*
* NV_CTRL_PBUFFER_SCANOUT_XID indicates the XID of the pbuffer used for
* scanout.
*/
#define NV_CTRL_PBUFFER_SCANOUT_XID 66 /* RW- */
#define NV_CTRL_LAST_ATTRIBUTE NV_CTRL_PBUFFER_SCANOUT_XID
/**************************************************************************/
/*
* String Attributes:
*/
/*
* NV_CTRL_STRING_PRODUCT_NAME - the GPU product name on which the
* specified X screen is running.
*/
#define NV_CTRL_STRING_PRODUCT_NAME 0 /* R-- */
/*
* NV_CTRL_STRING_VBIOS_VERSION - the video bios version on the GPU on
* which the specified X screen is running.
*/
#define NV_CTRL_STRING_VBIOS_VERSION 1 /* R-- */
/*
* NV_CTRL_STRING_NVIDIA_DRIVER_VERSION - string representation of the
* NVIDIA driver version number for the NVIDIA X driver in use.
*/
#define NV_CTRL_STRING_NVIDIA_DRIVER_VERSION 3 /* R-- */
/*
* NV_CTRL_STRING_DISPLAY_DEVICE_NAME - name of the display device
* specified in the display_mask argument.
*/
#define NV_CTRL_STRING_DISPLAY_DEVICE_NAME 4 /* R-D */
/*
* NV_CTRL_STRING_TV_ENCODER_NAME - name of the TV encoder used by the
* specified display device; only valid if the display device is a TV.
*/
#define NV_CTRL_STRING_TV_ENCODER_NAME 5 /* R-D */
#define NV_CTRL_STRING_LAST_ATTRIBUTE NV_CTRL_STRING_TV_ENCODER_NAME
/**************************************************************************/
/*
* CTRLAttributeValidValuesRec -
*
* structure and related defines used by
* XNVCTRLQueryValidAttributeValues() to describe the valid values of
* a particular attribute. The type field will be one of:
*
* ATTRIBUTE_TYPE_INTEGER : the attribute is an integer value; there
* is no fixed range of valid values.
*
* ATTRIBUTE_TYPE_BITMASK : the attribute is an integer value,
* interpretted as a bitmask.
*
* ATTRIBUTE_TYPE_BOOL : the attribute is a boolean, valid values are
* either 1 (on/true) or 0 (off/false).
*
* ATTRIBUTE_TYPE_RANGE : the attribute can have any integer value
* between NVCTRLAttributeValidValues.u.range.min and
* NVCTRLAttributeValidValues.u.range.max (inclusive).
*
* ATTRIBUTE_TYPE_INT_BITS : the attribute can only have certain
* integer values, indicated by which bits in
* NVCTRLAttributeValidValues.u.bits.ints are on (for example: if bit
* 0 is on, then 0 is a valid value; if bit 5 is on, then 5 is a valid
* value, etc). This is useful for attributes like NV_CTRL_FSAA_MODE,
* which can only have certain values, depending on GPU.
*
*
* The permissions field of NVCTRLAttributeValidValuesRec is a bitmask
* that may contain:
*
* ATTRIBUTE_TYPE_READ
* ATTRIBUTE_TYPE_WRITE
* ATTRIBUTE_TYPE_DISPLAY
*
* See 'Key to Integer Attribute "Permissions"' at the top of this
* file for a description of what these three permission bits mean.
*/
#define ATTRIBUTE_TYPE_UNKNOWN 0
#define ATTRIBUTE_TYPE_INTEGER 1
#define ATTRIBUTE_TYPE_BITMASK 2
#define ATTRIBUTE_TYPE_BOOL 3
#define ATTRIBUTE_TYPE_RANGE 4
#define ATTRIBUTE_TYPE_INT_BITS 5
#define ATTRIBUTE_TYPE_READ 0x1
#define ATTRIBUTE_TYPE_WRITE 0x2
#define ATTRIBUTE_TYPE_DISPLAY 0x4
typedef struct _NVCTRLAttributeValidValues {
int type;
union {
struct {
int min;
int max;
} range;
struct {
unsigned int ints;
} bits;
} u;
unsigned int permissions;
} NVCTRLAttributeValidValuesRec;
#define ATTRIBUTE_CHANGED_EVENT 0
#endif /* __NVCTRL_H */

View File

@@ -0,0 +1,177 @@
#ifndef __NVCTRLLIB_H
#define __NVCTRLLIB_H
#include "NVCtrl.h"
/*
* XNVCTRLQueryExtension -
*
* Returns True if the extension exists, returns False otherwise.
* event_basep and error_basep are the extension event and error
* bases. Currently, no extension specific errors or events are
* defined.
*/
Bool XNVCTRLQueryExtension (
Display *dpy,
int *event_basep,
int *error_basep
);
/*
* XNVCTRLQueryVersion -
*
* Returns True if the extension exists, returns False otherwise.
* major and minor are the extension's major and minor version
* numbers.
*/
Bool XNVCTRLQueryVersion (
Display *dpy,
int *major,
int *minor
);
/*
* XNVCTRLIsNvScreen
*
* Returns True is the specified screen is controlled by the NVIDIA
* driver. Returns False otherwise.
*/
Bool XNVCTRLIsNvScreen (
Display *dpy,
int screen
);
/*
* XNVCTRLSetAttribute -
*
* Sets the attribute to the given value. The attributes and their
* possible values are listed in NVCtrl.h.
*
* Not all attributes require the display_mask parameter; see
* NVCtrl.h for details.
*
* Possible errors:
* BadValue - The screen or attribute doesn't exist.
* BadMatch - The NVIDIA driver is not present on that screen.
*/
void XNVCTRLSetAttribute (
Display *dpy,
int screen,
unsigned int display_mask,
unsigned int attribute,
int value
);
/*
* XNVCTRLQueryAttribute -
*
* Returns True if the attribute exists. Returns False otherwise.
* If XNVCTRLQueryAttribute returns True, value will contain the
* value of the specified attribute.
*
* Not all attributes require the display_mask parameter; see
* NVCtrl.h for details.
*
* Possible errors:
* BadValue - The screen doesn't exist.
* BadMatch - The NVIDIA driver is not present on that screen.
*/
Bool XNVCTRLQueryAttribute (
Display *dpy,
int screen,
unsigned int display_mask,
unsigned int attribute,
int *value
);
/*
* XNVCTRLQueryStringAttribute -
*
* Returns True if the attribute exists. Returns False otherwise.
* If XNVCTRLQueryStringAttribute returns True, *ptr will point to an
* allocated string containing the string attribute requested. It is
* the caller's responsibility to free the string when done.
*
* Possible errors:
* BadValue - The screen doesn't exist.
* BadMatch - The NVIDIA driver is not present on that screen.
* BadAlloc - Insufficient resources to fulfill the request.
*/
Bool XNVCTRLQueryStringAttribute (
Display *dpy,
int screen,
unsigned int display_mask,
unsigned int attribute,
char **ptr
);
/*
* XNVCTRLQueryValidAttributeValues -
*
* Returns True if the attribute exists. Returns False otherwise. If
* XNVCTRLQueryValidAttributeValues returns True, values will indicate
* the valid values for the specified attribute; see the description
* of NVCTRLAttributeValidValues in NVCtrl.h.
*/
Bool XNVCTRLQueryValidAttributeValues (
Display *dpy,
int screen,
unsigned int display_mask,
unsigned int attribute,
NVCTRLAttributeValidValuesRec *values
);
/*
* XNVCtrlSelectNotify -
*
* This enables/disables receiving of NV-CONTROL events. The type
* specifies the type of event to enable (currently, the only type is
* ATTRIBUTE_CHANGED_EVENT); onoff controls whether receiving this
* type of event should be enabled (True) or disabled (False).
*
* Returns True if successful, or False if the screen is not
* controlled by the NVIDIA driver.
*/
Bool XNVCtrlSelectNotify (
Display *dpy,
int screen,
int type,
Bool onoff
);
/*
* XNVCtrlEvent structure
*/
typedef struct {
int type;
unsigned long serial;
Bool send_event; /* always FALSE, we don't allow send_events */
Display *display;
Time time;
int screen;
unsigned int display_mask;
unsigned int attribute;
int value;
} XNVCtrlAttributeChangedEvent;
typedef union {
int type;
XNVCtrlAttributeChangedEvent attribute_changed;
long pad[24];
} XNVCtrlEvent;
#endif /* __NVCTRLLIB_H */

View File

@@ -0,0 +1,224 @@
/*
* $Xorg: extutil.h,v 1.4 2001/02/09 02:03:24 xorgcvs Exp $
*
Copyright 1989, 1998 The Open Group
Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation.
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of The Open Group shall not be
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*
* Author: Jim Fulton, MIT The Open Group
*
* Xlib Extension-Writing Utilities
*
* This package contains utilities for writing the client API for various
* protocol extensions. THESE INTERFACES ARE NOT PART OF THE X STANDARD AND
* ARE SUBJECT TO CHANGE!
*/
/* $XFree86: xc/include/extensions/extutil.h,v 1.9 2001/12/14 19:53:28 dawes Exp $ */
#ifndef _EXTUTIL_H_
#define _EXTUTIL_H_
#include <X11/extensions/Xext.h>
/*
* We need to keep a list of open displays since the Xlib display list isn't
* public. We also have to per-display info in a separate block since it isn't
* stored directly in the Display structure.
*/
typedef struct _XExtDisplayInfo {
struct _XExtDisplayInfo *next; /* keep a linked list */
Display *display; /* which display this is */
XExtCodes *codes; /* the extension protocol codes */
XPointer data; /* extra data for extension to use */
} XExtDisplayInfo;
typedef struct _XExtensionInfo {
XExtDisplayInfo *head; /* start of list */
XExtDisplayInfo *cur; /* most recently used */
int ndisplays; /* number of displays */
} XExtensionInfo;
typedef struct _XExtensionHooks {
int (*create_gc)(
#if NeedNestedPrototypes
Display* /* display */,
GC /* gc */,
XExtCodes* /* codes */
#endif
);
int (*copy_gc)(
#if NeedNestedPrototypes
Display* /* display */,
GC /* gc */,
XExtCodes* /* codes */
#endif
);
int (*flush_gc)(
#if NeedNestedPrototypes
Display* /* display */,
GC /* gc */,
XExtCodes* /* codes */
#endif
);
int (*free_gc)(
#if NeedNestedPrototypes
Display* /* display */,
GC /* gc */,
XExtCodes* /* codes */
#endif
);
int (*create_font)(
#if NeedNestedPrototypes
Display* /* display */,
XFontStruct* /* fs */,
XExtCodes* /* codes */
#endif
);
int (*free_font)(
#if NeedNestedPrototypes
Display* /* display */,
XFontStruct* /* fs */,
XExtCodes* /* codes */
#endif
);
int (*close_display)(
#if NeedNestedPrototypes
Display* /* display */,
XExtCodes* /* codes */
#endif
);
Bool (*wire_to_event)(
#if NeedNestedPrototypes
Display* /* display */,
XEvent* /* re */,
xEvent* /* event */
#endif
);
Status (*event_to_wire)(
#if NeedNestedPrototypes
Display* /* display */,
XEvent* /* re */,
xEvent* /* event */
#endif
);
int (*error)(
#if NeedNestedPrototypes
Display* /* display */,
xError* /* err */,
XExtCodes* /* codes */,
int* /* ret_code */
#endif
);
char *(*error_string)(
#if NeedNestedPrototypes
Display* /* display */,
int /* code */,
XExtCodes* /* codes */,
char* /* buffer */,
int /* nbytes */
#endif
);
} XExtensionHooks;
extern XExtensionInfo *XextCreateExtension(
#if NeedFunctionPrototypes
void
#endif
);
extern void XextDestroyExtension(
#if NeedFunctionPrototypes
XExtensionInfo* /* info */
#endif
);
extern XExtDisplayInfo *XextAddDisplay(
#if NeedFunctionPrototypes
XExtensionInfo* /* extinfo */,
Display* /* dpy */,
char* /* ext_name */,
XExtensionHooks* /* hooks */,
int /* nevents */,
XPointer /* data */
#endif
);
extern int XextRemoveDisplay(
#if NeedFunctionPrototypes
XExtensionInfo* /* extinfo */,
Display* /* dpy */
#endif
);
extern XExtDisplayInfo *XextFindDisplay(
#if NeedFunctionPrototypes
XExtensionInfo* /* extinfo */,
Display* /* dpy */
#endif
);
#define XextHasExtension(i) ((i) && ((i)->codes))
#define XextCheckExtension(dpy,i,name,val) \
if (!XextHasExtension(i)) { XMissingExtension (dpy, name); return val; }
#define XextSimpleCheckExtension(dpy,i,name) \
if (!XextHasExtension(i)) { XMissingExtension (dpy, name); return; }
/*
* helper macros to generate code that is common to all extensions; caller
* should prefix it with static if extension source is in one file; this
* could be a utility function, but have to stack 6 unused arguments for
* something that is called many, many times would be bad.
*/
#define XEXT_GENERATE_FIND_DISPLAY(proc,extinfo,extname,hooks,nev,data) \
XExtDisplayInfo *proc (Display *dpy) \
{ \
XExtDisplayInfo *dpyinfo; \
if (!extinfo) { if (!(extinfo = XextCreateExtension())) return NULL; } \
if (!(dpyinfo = XextFindDisplay (extinfo, dpy))) \
dpyinfo = XextAddDisplay (extinfo,dpy,extname,hooks,nev,data); \
return dpyinfo; \
}
#define XEXT_FIND_DISPLAY_PROTO(proc) \
XExtDisplayInfo *proc(Display *dpy)
#define XEXT_GENERATE_CLOSE_DISPLAY(proc,extinfo) \
int proc (Display *dpy, XExtCodes *codes) \
{ \
return XextRemoveDisplay (extinfo, dpy); \
}
#define XEXT_CLOSE_DISPLAY_PROTO(proc) \
int proc(Display *dpy, XExtCodes *codes)
#define XEXT_GENERATE_ERROR_STRING(proc,extname,nerr,errl) \
char *proc (Display *dpy, int code, XExtCodes *codes, char *buf, int n) \
{ \
code -= codes->first_error; \
if (code >= 0 && code < nerr) { \
char tmp[256]; \
sprintf (tmp, "%s.%d", extname, code); \
XGetErrorDatabaseText (dpy, "XProtoError", tmp, errl[code], buf, n); \
return buf; \
} \
return (char *)0; \
}
#define XEXT_ERROR_STRING_PROTO(proc) \
char *proc(Display *dpy, int code, XExtCodes *codes, char *buf, int n)
#endif

View File

@@ -0,0 +1,184 @@
#ifndef __NVCONTROL_H
#define __NVCONTROL_H
#define NV_CONTROL_ERRORS 0
#define NV_CONTROL_EVENTS 1
#define NV_CONTROL_NAME "NV-CONTROL"
#define NV_CONTROL_MAJOR 1
#define NV_CONTROL_MINOR 6
#define X_nvCtrlQueryExtension 0
#define X_nvCtrlIsNv 1
#define X_nvCtrlQueryAttribute 2
#define X_nvCtrlSetAttribute 3
#define X_nvCtrlQueryStringAttribute 4
#define X_nvCtrlQueryValidAttributeValues 5
#define X_nvCtrlSelectNotify 6
#define X_nvCtrlLastRequest (X_nvCtrlSelectNotify + 1)
typedef struct {
CARD8 reqType;
CARD8 nvReqType;
CARD16 length B16;
} xnvCtrlQueryExtensionReq;
#define sz_xnvCtrlQueryExtensionReq 4
typedef struct {
BYTE type; /* X_Reply */
CARD8 padb1;
CARD16 sequenceNumber B16;
CARD32 length B32;
CARD16 major B16;
CARD16 minor B16;
CARD32 padl4 B32;
CARD32 padl5 B32;
CARD32 padl6 B32;
CARD32 padl7 B32;
CARD32 padl8 B32;
} xnvCtrlQueryExtensionReply;
#define sz_xnvCtrlQueryExtensionReply 32
typedef struct {
CARD8 reqType;
CARD8 nvReqType;
CARD16 length B16;
CARD32 screen B32;
} xnvCtrlIsNvReq;
#define sz_xnvCtrlIsNvReq 8
typedef struct {
BYTE type; /* X_Reply */
CARD8 padb1;
CARD16 sequenceNumber B16;
CARD32 length B32;
CARD32 isnv B32;
CARD32 padl4 B32;
CARD32 padl5 B32;
CARD32 padl6 B32;
CARD32 padl7 B32;
CARD32 padl8 B32;
} xnvCtrlIsNvReply;
#define sz_xnvCtrlIsNvReply 32
typedef struct {
CARD8 reqType;
CARD8 nvReqType;
CARD16 length B16;
CARD32 screen B32;
CARD32 display_mask B32;
CARD32 attribute B32;
} xnvCtrlQueryAttributeReq;
#define sz_xnvCtrlQueryAttributeReq 16
typedef struct {
BYTE type;
BYTE pad0;
CARD16 sequenceNumber B16;
CARD32 length B32;
CARD32 flags B32;
INT32 value B32;
CARD32 pad4 B32;
CARD32 pad5 B32;
CARD32 pad6 B32;
CARD32 pad7 B32;
} xnvCtrlQueryAttributeReply;
#define sz_xnvCtrlQueryAttributeReply 32
typedef struct {
CARD8 reqType;
CARD8 nvReqType;
CARD16 length B16;
CARD32 screen B32;
CARD32 display_mask B32;
CARD32 attribute B32;
INT32 value B32;
} xnvCtrlSetAttributeReq;
#define sz_xnvCtrlSetAttributeReq 20
typedef struct {
CARD8 reqType;
CARD8 nvReqType;
CARD16 length B16;
CARD32 screen B32;
CARD32 display_mask B32;
CARD32 attribute B32;
} xnvCtrlQueryStringAttributeReq;
#define sz_xnvCtrlQueryStringAttributeReq 16
/*
* CtrlQueryStringAttribute reply struct
* n indicates the length of the string.
*/
typedef struct {
BYTE type;
BYTE pad0;
CARD16 sequenceNumber B16;
CARD32 length B32;
CARD32 flags B32;
CARD32 n B32;
CARD32 pad4 B32;
CARD32 pad5 B32;
CARD32 pad6 B32;
CARD32 pad7 B32;
} xnvCtrlQueryStringAttributeReply;
#define sz_xnvCtrlQueryStringAttributeReply 32
typedef struct {
CARD8 reqType;
CARD8 nvReqType;
CARD16 length B16;
CARD32 screen B32;
CARD32 display_mask B32;
CARD32 attribute B32;
} xnvCtrlQueryValidAttributeValuesReq;
#define sz_xnvCtrlQueryValidAttributeValuesReq 16
typedef struct {
BYTE type;
BYTE pad0;
CARD16 sequenceNumber B16;
CARD32 length B32;
CARD32 flags B32;
INT32 attr_type B32;
INT32 min B32;
INT32 max B32;
CARD32 bits B32;
CARD32 perms B32;
} xnvCtrlQueryValidAttributeValuesReply;
#define sz_xnvCtrlQueryValidAttributeValuesReply 32
typedef struct {
CARD8 reqType;
CARD8 nvReqType;
CARD16 length B16;
CARD32 screen B32;
CARD16 notifyType B16;
CARD16 onoff B16;
} xnvCtrlSelectNotifyReq;
#define sz_xnvCtrlSelectNotifyReq 12
typedef struct {
union {
struct {
BYTE type;
BYTE detail;
CARD16 sequenceNumber B16;
} u;
struct {
BYTE type;
BYTE detail;
CARD16 sequenceNumber B16;
Time time B32;
CARD32 screen B32;
CARD32 display_mask B32;
CARD32 attribute B32;
CARD32 value B32;
CARD32 pad0 B32;
CARD32 pad1 B32;
} attribute_changed;
} u;
} xnvctrlEvent;
#endif /* __NVCONTROL_H */

63
neo/sys/linux/local.h Normal file
View File

@@ -0,0 +1,63 @@
/*
===========================================================================
Doom 3 GPL Source Code
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
This file is part of the Doom 3 GPL Source Code (?Doom 3 Source Code?).
Doom 3 Source Code is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Doom 3 Source Code 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
along with Doom 3 Source Code. If not, see <http://www.gnu.org/licenses/>.
In addition, the Doom 3 Source Code is also subject to certain additional terms. You should have received a copy of these additional terms immediately following the terms and conditions of the GNU General Public License which accompanied the Doom 3 Source Code. If not, please request a copy in writing from id Software at the address below.
If you have questions concerning this license or the applicable additional terms, you may contact in writing id Software LLC, c/o ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA.
===========================================================================
*/
#ifndef __LINUX_LOCAL_H__
#define __LINUX_LOCAL_H__
extern glconfig_t glConfig;
// glimp.cpp
//#define ID_ENABLE_DGA
#if defined( ID_ENABLE_DGA )
#include <X11/extensions/xf86dga.h>
#endif
#include <X11/extensions/xf86vmode.h>
#include <X11/XKBlib.h>
extern Display *dpy;
extern Window win;
// input.cpp
extern bool dga_found;
void Sys_XEvents();
void Sys_XUninstallGrabs();
#define KEY_MASK (KeyPressMask | KeyReleaseMask)
#define MOUSE_MASK (ButtonPressMask | ButtonReleaseMask | PointerMotionMask | ButtonMotionMask )
#define X_MASK (KEY_MASK | MOUSE_MASK | VisibilityChangeMask | StructureNotifyMask )
#ifndef ID_GL_HARDLINK
bool GLimp_dlopen();
void GLimp_dlclose();
void GLimp_BindLogging();
void GLimp_BindNative();
#endif
#endif

565
neo/sys/linux/main.cpp Normal file
View File

@@ -0,0 +1,565 @@
/*
===========================================================================
Doom 3 GPL Source Code
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
This file is part of the Doom 3 GPL Source Code (?Doom 3 Source Code?).
Doom 3 Source Code is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Doom 3 Source Code 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
along with Doom 3 Source Code. If not, see <http://www.gnu.org/licenses/>.
In addition, the Doom 3 Source Code is also subject to certain additional terms. You should have received a copy of these additional terms immediately following the terms and conditions of the GNU General Public License which accompanied the Doom 3 Source Code. If not, please request a copy in writing from id Software at the address below.
If you have questions concerning this license or the applicable additional terms, you may contact in writing id Software LLC, c/o ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA.
===========================================================================
*/
#include "../../idlib/precompiled.h"
#include "../posix/posix_public.h"
#include "../sys_local.h"
#include "local.h"
#include <pthread.h>
#include <errno.h>
#include <unistd.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <fcntl.h>
#ifdef ID_MCHECK
#include <mcheck.h>
#endif
static idStr basepath;
static idStr savepath;
/*
===========
Sys_InitScanTable
===========
*/
void Sys_InitScanTable( void ) {
common->DPrintf( "TODO: Sys_InitScanTable\n" );
}
/*
=================
Sys_AsyncThread
=================
*/
void Sys_AsyncThread( void ) {
int now;
int next;
int want_sleep;
// multi tick compensate for poor schedulers (Linux 2.4)
int ticked, to_ticked;
now = Sys_Milliseconds();
ticked = now >> 4;
while (1) {
// sleep
now = Sys_Milliseconds();
next = ( now & 0xFFFFFFF0 ) + 0x10;
want_sleep = ( next-now-1 ) * 1000;
if ( want_sleep > 0 ) {
usleep( want_sleep ); // sleep 1ms less than true target
}
// compensate if we slept too long
now = Sys_Milliseconds();
to_ticked = now >> 4;
// show ticking statistics - every 100 ticks, print a summary
#if 0
#define STAT_BUF 100
static int stats[STAT_BUF];
static int counter = 0;
// how many ticks to play
stats[counter] = to_ticked - ticked;
counter++;
if (counter == STAT_BUF) {
Sys_DebugPrintf("\n");
for( int i = 0; i < STAT_BUF; i++) {
if ( ! (i & 0xf) ) {
Sys_DebugPrintf("\n");
}
Sys_DebugPrintf( "%d ", stats[i] );
}
Sys_DebugPrintf("\n");
counter = 0;
}
#endif
while ( ticked < to_ticked ) {
common->Async();
ticked++;
Sys_TriggerEvent( TRIGGER_EVENT_ONE );
}
// thread exit
pthread_testcancel();
}
}
/*
==============
Sys_DefaultSavePath
==============
*/
const char *Sys_DefaultSavePath(void) {
#if defined( ID_DEMO_BUILD )
sprintf( savepath, "%s/.doom3-demo", getenv( "HOME" ) );
#else
sprintf( savepath, "%s/.doom3", getenv( "HOME" ) );
#endif
return savepath.c_str();
}
/*
==============
Sys_EXEPath
==============
*/
const char *Sys_EXEPath( void ) {
static char buf[ 1024 ];
idStr linkpath;
int len;
buf[ 0 ] = '\0';
sprintf( linkpath, "/proc/%d/exe", getpid() );
len = readlink( linkpath.c_str(), buf, sizeof( buf ) );
if ( len == -1 ) {
Sys_Printf("couldn't stat exe path link %s\n", linkpath.c_str());
buf[ len ] = '\0';
}
return buf;
}
/*
================
Sys_DefaultBasePath
Get the default base path
- binary image path
- current directory
- hardcoded
Try to be intelligent: if there is no BASE_GAMEDIR, try the next path
================
*/
const char *Sys_DefaultBasePath(void) {
struct stat st;
idStr testbase;
basepath = Sys_EXEPath();
if ( basepath.Length() ) {
basepath.StripFilename();
testbase = basepath; testbase += "/"; testbase += BASE_GAMEDIR;
if ( stat( testbase.c_str(), &st ) != -1 && S_ISDIR( st.st_mode ) ) {
return basepath.c_str();
} else {
common->Printf( "no '%s' directory in exe path %s, skipping\n", BASE_GAMEDIR, basepath.c_str() );
}
}
if ( basepath != Posix_Cwd() ) {
basepath = Posix_Cwd();
testbase = basepath; testbase += "/"; testbase += BASE_GAMEDIR;
if ( stat( testbase.c_str(), &st ) != -1 && S_ISDIR( st.st_mode ) ) {
return basepath.c_str();
} else {
common->Printf("no '%s' directory in cwd path %s, skipping\n", BASE_GAMEDIR, basepath.c_str());
}
}
common->Printf( "WARNING: using hardcoded default base path\n" );
return LINUX_DEFAULT_PATH;
}
/*
===============
Sys_GetConsoleKey
===============
*/
unsigned char Sys_GetConsoleKey( bool shifted ) {
return shifted ? '~' : '`';
}
/*
===============
Sys_Shutdown
===============
*/
void Sys_Shutdown( void ) {
basepath.Clear();
savepath.Clear();
Posix_Shutdown();
}
/*
===============
Sys_GetProcessorId
===============
*/
cpuid_t Sys_GetProcessorId( void ) {
return CPUID_GENERIC;
}
/*
===============
Sys_GetProcessorString
===============
*/
const char *Sys_GetProcessorString( void ) {
return "generic";
}
/*
===============
Sys_FPU_EnableExceptions
===============
*/
void Sys_FPU_EnableExceptions( int exceptions ) {
}
/*
===============
Sys_FPE_handler
===============
*/
void Sys_FPE_handler( int signum, siginfo_t *info, void *context ) {
assert( signum == SIGFPE );
Sys_Printf( "FPE\n" );
}
/*
===============
Sys_GetClockticks
===============
*/
double Sys_GetClockTicks( void ) {
#if defined( __i386__ )
unsigned long lo, hi;
__asm__ __volatile__ (
"push %%ebx\n" \
"xor %%eax,%%eax\n" \
"cpuid\n" \
"rdtsc\n" \
"mov %%eax,%0\n" \
"mov %%edx,%1\n" \
"pop %%ebx\n"
: "=r" (lo), "=r" (hi) );
return (double) lo + (double) 0xFFFFFFFF * hi;
#else
#error unsupported CPU
#endif
}
/*
===============
MeasureClockTicks
===============
*/
double MeasureClockTicks( void ) {
double t0, t1;
t0 = Sys_GetClockTicks( );
Sys_Sleep( 1000 );
t1 = Sys_GetClockTicks( );
return t1 - t0;
}
/*
===============
Sys_ClockTicksPerSecond
===============
*/
double Sys_ClockTicksPerSecond(void) {
static bool init = false;
static double ret;
int fd, len, pos, end;
char buf[ 4096 ];
if ( init ) {
return ret;
}
fd = open( "/proc/cpuinfo", O_RDONLY );
if ( fd == -1 ) {
common->Printf( "couldn't read /proc/cpuinfo\n" );
ret = MeasureClockTicks();
init = true;
common->Printf( "measured CPU frequency: %g MHz\n", ret / 1000000.0 );
return ret;
}
len = read( fd, buf, 4096 );
close( fd );
pos = 0;
while ( pos < len ) {
if ( !idStr::Cmpn( buf + pos, "cpu MHz", 7 ) ) {
pos = strchr( buf + pos, ':' ) - buf + 2;
end = strchr( buf + pos, '\n' ) - buf;
if ( pos < len && end < len ) {
buf[end] = '\0';
ret = atof( buf + pos );
} else {
common->Printf( "failed parsing /proc/cpuinfo\n" );
ret = MeasureClockTicks();
init = true;
common->Printf( "measured CPU frequency: %g MHz\n", ret / 1000000.0 );
return ret;
}
common->Printf( "/proc/cpuinfo CPU frequency: %g MHz\n", ret );
ret *= 1000000;
init = true;
return ret;
}
pos = strchr( buf + pos, '\n' ) - buf + 1;
}
common->Printf( "failed parsing /proc/cpuinfo\n" );
ret = MeasureClockTicks();
init = true;
common->Printf( "measured CPU frequency: %g MHz\n", ret / 1000000.0 );
return ret;
}
/*
================
Sys_GetSystemRam
returns in megabytes
================
*/
int Sys_GetSystemRam( void ) {
long count, page_size;
int mb;
count = sysconf( _SC_PHYS_PAGES );
if ( count == -1 ) {
common->Printf( "GetSystemRam: sysconf _SC_PHYS_PAGES failed\n" );
return 512;
}
page_size = sysconf( _SC_PAGE_SIZE );
if ( page_size == -1 ) {
common->Printf( "GetSystemRam: sysconf _SC_PAGE_SIZE failed\n" );
return 512;
}
mb= (int)( (double)count * (double)page_size / ( 1024 * 1024 ) );
// round to the nearest 16Mb
mb = ( mb + 8 ) & ~15;
return mb;
}
/*
==================
Sys_DoStartProcess
if we don't fork, this function never returns
the no-fork lets you keep the terminal when you're about to spawn an installer
if the command contains spaces, system() is used. Otherwise the more straightforward execl ( system() blows though )
==================
*/
void Sys_DoStartProcess( const char *exeName, bool dofork ) {
bool use_system = false;
if ( strchr( exeName, ' ' ) ) {
use_system = true;
} else {
// set exec rights when it's about a single file to execute
struct stat buf;
if ( stat( exeName, &buf ) == -1 ) {
printf( "stat %s failed: %s\n", exeName, strerror( errno ) );
} else {
if ( chmod( exeName, buf.st_mode | S_IXUSR ) == -1 ) {
printf( "cmod +x %s failed: %s\n", exeName, strerror( errno ) );
}
}
}
if ( dofork ) {
switch ( fork() ) {
case -1:
// main thread
break;
case 0:
if ( use_system ) {
printf( "system %s\n", exeName );
system( exeName );
_exit( 0 );
} else {
printf( "execl %s\n", exeName );
execl( exeName, exeName, NULL );
printf( "execl failed: %s\n", strerror( errno ) );
_exit( -1 );
}
break;
}
} else {
if ( use_system ) {
printf( "system %s\n", exeName );
system( exeName );
sleep( 1 ); // on some systems I've seen that starting the new process and exiting this one should not be too close
} else {
printf( "execl %s\n", exeName );
execl( exeName, exeName, NULL );
printf( "execl failed: %s\n", strerror( errno ) );
}
// terminate
_exit( 0 );
}
}
/*
=================
Sys_OpenURL
=================
*/
void idSysLocal::OpenURL( const char *url, bool quit ) {
const char *script_path;
idFile *script_file;
char cmdline[ 1024 ];
static bool quit_spamguard = false;
if ( quit_spamguard ) {
common->DPrintf( "Sys_OpenURL: already in a doexit sequence, ignoring %s\n", url );
return;
}
common->Printf( "Open URL: %s\n", url );
// opening an URL on *nix can mean a lot of things ..
// just spawn a script instead of deciding for the user :-)
// look in the savepath first, then in the basepath
script_path = fileSystem->BuildOSPath( cvarSystem->GetCVarString( "fs_savepath" ), "", "openurl.sh" );
script_file = fileSystem->OpenExplicitFileRead( script_path );
if ( !script_file ) {
script_path = fileSystem->BuildOSPath( cvarSystem->GetCVarString( "fs_basepath" ), "", "openurl.sh" );
script_file = fileSystem->OpenExplicitFileRead( script_path );
}
if ( !script_file ) {
common->Printf( "Can't find URL script 'openurl.sh' in either savepath or basepath\n" );
common->Printf( "OpenURL '%s' failed\n", url );
return;
}
fileSystem->CloseFile( script_file );
// if we are going to quit, only accept a single URL before quitting and spawning the script
if ( quit ) {
quit_spamguard = true;
}
common->Printf( "URL script: %s\n", script_path );
// StartProcess is going to execute a system() call with that - hence the &
idStr::snPrintf( cmdline, 1024, "%s '%s' &", script_path, url );
sys->StartProcess( cmdline, quit );
}
/*
==================
Sys_DoPreferences
==================
*/
void Sys_DoPreferences( void ) { }
/*
================
Sys_FPU_SetDAZ
================
*/
void Sys_FPU_SetDAZ( bool enable ) {
/*
DWORD dwData;
_asm {
movzx ecx, byte ptr enable
and ecx, 1
shl ecx, 6
STMXCSR dword ptr dwData
mov eax, dwData
and eax, ~(1<<6) // clear DAX bit
or eax, ecx // set the DAZ bit
mov dwData, eax
LDMXCSR dword ptr dwData
}
*/
}
/*
================
Sys_FPU_SetFTZ
================
*/
void Sys_FPU_SetFTZ( bool enable ) {
/*
DWORD dwData;
_asm {
movzx ecx, byte ptr enable
and ecx, 1
shl ecx, 15
STMXCSR dword ptr dwData
mov eax, dwData
and eax, ~(1<<15) // clear FTZ bit
or eax, ecx // set the FTZ bit
mov dwData, eax
LDMXCSR dword ptr dwData
}
*/
}
/*
===============
mem consistency stuff
===============
*/
#ifdef ID_MCHECK
const char *mcheckstrings[] = {
"MCHECK_DISABLED",
"MCHECK_OK",
"MCHECK_FREE", // block freed twice
"MCHECK_HEAD", // memory before the block was clobbered
"MCHECK_TAIL" // memory after the block was clobbered
};
void abrt_func( mcheck_status status ) {
Sys_Printf( "memory consistency failure: %s\n", mcheckstrings[ status + 1 ] );
Posix_SetExit( EXIT_FAILURE );
common->Quit();
}
#endif
/*
===============
main
===============
*/
int main(int argc, const char **argv) {
#ifdef ID_MCHECK
// must have -lmcheck linkage
mcheck( abrt_func );
Sys_Printf( "memory consistency checking enabled\n" );
#endif
Posix_EarlyInit( );
if ( argc > 1 ) {
common->Init( argc-1, &argv[1], NULL );
} else {
common->Init( 0, NULL, NULL );
}
Posix_LateInit( );
while (1) {
common->Frame();
}
}

View File

@@ -0,0 +1,310 @@
#ifndef AUDIO_CORE_H
#define AUDIO_CORE_H
/*
* Copyright by 4Front Technologies 1993-2004
*
* All rights reserved.
*/
/*
* IMPORTANT NOTICE!
*
* This file contains internal structures used by Open Sound Systems.
* They will change without any notice between OSS versions. Care must be taken
* to make sure any software using this header gets properly re-compiled before
* use.
*
* 4Front Technologies (or anybody else) takes no responsibility of damages
* caused by use of this file.
*/
/* Max number of audio channels currently supported */
#define OSS_MAX_AUDIO_CHANNELS 8
struct audio_operations;
typedef struct
{
int fmt, speed, channels;
int convert;
}
sample_parms;
typedef struct audio_operations audio_operations, adev_t, *adev_p;
typedef struct dma_buffparms dma_buffparms, *dmap_p;
typedef int (*cnv_func_t) (adev_p adev, dmap_p dmap, void **srcp, int *srcl,
void **tgtp, sample_parms * source,
sample_parms * target);
struct dma_buffparms
{
/*
* Static fields (not to be cleared during open)
*/
#ifndef CONFIGURE_C
oss_mutex mutex;
#endif
sound_os_info *osp;
char *raw_buf;
oss_native_ulong raw_buf_phys;
int buffsize;
unsigned char *tmpbuf1, *tmpbuf2;
int dma; /* DMA channel */
void *driver_use_ptr;
long driver_use_value;
/* Interrupt callback stuff */
void (*audio_callback) (int dev, int parm);
int callback_parm;
#ifdef OS_DMA_PARMS
OS_DMA_PARMS
#endif
/*
* Dynamic fields (will be zeroed during open)
* Don't add anything before flags.
*/
void *srcstate[OSS_MAX_AUDIO_CHANNELS];
oss_native_ulong flags;
#define DMAP_NOTIMEOUT 0x00000001
#define DMAP_POST 0x00000002
#define DMAP_PREPARED 0x00000004
#define DMAP_FRAGFIXED 0x00000008 /* Fragment size fixed */
#define DMAP_STARTED 0x00000010
#define DMAP_COOKED 0x00000020
#define DMAP_ACTIVE 0x00000040 /* ISA DMA is running */
int dma_mode; /* DMODE_INPUT, DMODE_OUTPUT or DMODE_NONE */
#define DMODE_NONE 0
#define DMODE_OUTPUT PCM_ENABLE_OUTPUT
#define DMODE_INPUT PCM_ENABLE_INPUT
/*
* Queue parameters.
*/
int nbufs;
int frag_used;
int fragment_size;
int bytes_in_use;
int data_rate; /* Bytes/second */
int frame_size;
int fragsize_rq;
int low_water;
volatile oss_native_ulonglong byte_counter;
volatile oss_native_ulonglong user_counter;
int write_count;
int interrupt_count;
int fragment_counter;
int expand_factor;
int mapping_flags;
#define DMA_MAP_MAPPED 0x00000001
char neutral_byte;
#ifdef SPARCAUDIO_EMU
#define EOFLIST_SIZE 16
void *devaudio_sigproc; /* A pref to which send a SIGPOLL signal */
int devaudio_sigmask;
int eof_head, eof_tail;
int eof_list[EOFLIST_SIZE], eof_counts[EOFLIST_SIZE];
#endif
int error;
int play_underruns, rec_overruns;
int underrun_flag;
int play_error, num_play_errors;
int rec_error, num_rec_errors;
unsigned char *leftover_buf;
int leftover_bytes;
int tmpbuf_len, tmpbuf_ptr;
cnv_func_t convert_func;
unsigned int convert_mode;
struct audio_buffer *(*user_import) (struct audio_operations * adev,
struct dma_buffparms * dmap,
sample_parms * parms,
unsigned char *cbuf, int len);
int (*user_export) (struct audio_operations * adev,
struct dma_buffparms * dmap, sample_parms * parms,
struct audio_buffer * buf, unsigned char *cbuf,
int maxbytes);
struct audio_buffer *(*device_read) (struct audio_operations * adev,
struct dma_buffparms * dmap,
sample_parms * parms,
unsigned char *cbuf, int len);
int (*device_write) (struct audio_operations * adev,
struct dma_buffparms * dmap,
void *frombuf, void *tobuf,
int maxspace, int *fromlen, int *tolen);
};
extern int dmap_get_qlen (dma_buffparms * dmap);
extern int dmap_get_qhead (dma_buffparms * dmap);
extern int dmap_get_qtail (dma_buffparms * dmap);
struct audio_driver
{
int (*open) (int dev, int mode, int open_flags);
void (*close) (int dev, int mode);
void (*output_block) (int dev, oss_native_ulong buf,
int count, int fragsize, int intrflag);
void (*start_input) (int dev, oss_native_ulong buf,
int count, int fragsize, int intrflag);
int (*ioctl) (int dev, unsigned int cmd, ioctl_arg arg);
int (*prepare_for_input) (int dev, int bufsize, int nbufs);
int (*prepare_for_output) (int dev, int bufsize, int nbufs);
void (*halt_io) (int dev);
int (*local_qlen) (int dev);
int (*copy_user) (int dev, char *localbuf, int localoffs,
WR_BUF_CONST snd_rw_buf * userbuf, int useroffs,
int *len, int max_space);
void (*halt_input) (int dev);
void (*halt_output) (int dev);
void (*trigger) (int dev, int bits);
int (*set_speed) (int dev, int speed);
unsigned int (*set_bits) (int dev, unsigned int bits);
short (*set_channels) (int dev, short channels);
void (*postprocess_write) (int dev); /* Device spesific postprocessing for written data */
void (*preprocess_read) (int dev); /* Device spesific preprocessing for read data */
/* Timeout handlers for input and output */
int (*check_input) (int dev);
int (*check_output) (int dev);
int (*alloc_buffer) (int dev, struct dma_buffparms * dmap, int direction);
int (*free_buffer) (int dev, struct dma_buffparms * dmap, int direction);
void (*lock_buffer) (int dev, int direction);
void *dummy;
int (*get_buffer_pointer) (int dev, struct dma_buffparms * dmap,
int direction);
int (*calibrate_speed) (int dev, int nominal_rate, int true_rate);
#define SYNC_PREPARE 1
#define SYNC_TRIGGER 2
int (*sync_control) (int dev, int event, int mode);
void (*prepare_to_stop) (int dev);
int (*get_input_pointer) (int dev, struct dma_buffparms * dmap,
int direction);
int (*get_output_pointer) (int dev, struct dma_buffparms * dmap,
int direction);
int (*bind) (int dev, unsigned int cmd, ioctl_arg arg);
void (*setup_fragments) (int dev, dmap_p dmap, int direction);
};
struct audio_operations
{
char name[128];
char handle[32];
int dev; /* Device's own index */
int enabled;
struct audio_operations *next; /* Link to the next "shadow" device */
int flags;
int open_flags;
int caps;
int magic; /* Secret low level driver ID */
#define NOTHING_SPECIAL 0x00
#define NEEDS_RESTART 0x01
#define DMA_AUTOMODE 0x02
#define DMA_DUPLEX 0x04
#define DMA_COLD 0x08
#define DMA_UNUSED1 0x10
#define DMA_UNUSED2 0x40
#define DMA_UNUSED3 0x80
#define DMA_ISA 0x100 /* ISA DMA buffer placement restrictions */
#define DMA_VIRTUAL 0x400 /* Virtual audio device */
#define DMA_OPENED 0x800 /* Will be set when the device is open */
#define DMA_NOCONVERT 0x1000 /* No implicit format conversions */
#define DMA_DUALBUF 0x2000 /* Alloc separate bufs for rec and play */
#define DMA_USEPHYSADDR 0x4000 /* Use raw_buf_phys when mmap()ing */
#define DMA_DISABLED 0x8000
#define DMA_NOINPUT 0x10000
#define DMA_NOOUTPUT 0x20000
#define DMA_FIXEDRATE 0x40000 /* Fixed sampling rate */
#define DMA_16BITONLY 0x80000 /* Only 16 bit support */
#define DMA_STEREOONLY 0x100000 /* Only stereo (requires 16BITONLY) */
#define DMA_HUSHOUTPUT 0x200000 /* Do not permit use with O_WRONLY */
#define DMA_SHADOW 0x400000 /* "shadow" device */
#define DMA_ISABUS 0x800000 /* ISA device */
#define DMA_NODMA 0x1000000 /* For ISA devices only */
#define DMA_8BITONLY 0x2000000 /* Only 8 bits */
#define DMA_32BITONLY 0x4000000 /* Only 24 or 32 bits */
#define DMA_NOSOFTOSS 0x8000000 /* Don't install SoftOSS automatically for this device */
#define DMA_NOSRC 0x10000000 /* Don't do any kind of SRC */
#define DMA_SPECIAL 0x20000000 /* Multich or otherwise special dev */
#define DMA_NOMMAP 0x40000000 /* No MMAP capability */
#define DMA_SOFTOSS_DISABLE 0x80000000 /* Not compatible with SoftOSS */
/*
* Sampling parameters
*/
sample_parms user_parms, hw_parms;
int iformat_mask, oformat_mask; /* Bitmasks for supported audio formats */
int min_rate, max_rate; /* Sampling rate limits */
int min_channels, max_channels;
int xformat_mask; /* Format mask for current open mode */
int binding;
void *devc; /* Driver specific info */
struct audio_driver *d;
void *portc, *portc_play, *portc_record; /* Driver specific info */
struct dma_buffparms *dmap_in, *dmap_out;
int mixer_dev;
int open_mode;
int go;
int enable_bits;
int parent_dev; /* 0 -> no parent, 1 to n -> parent=parent_dev+1 */
int max_block; /* Maximum fragment size to be accepted */
int min_block; /* Minimum fragment size */
int max_intrate; /* Another form of min_block */
int fixed_rate;
int vmix_flags; /* special flags sent to virtual mixer */
#define VMIX_MULTIFRAG 0x00000001 /* More than 2 fragments required (causes longer latencies) */
int src_rate;
int src_ratio;
pid_t pid;
char cmd[16];
sound_os_info *osp;
int setfragment_warned;
int riff_warned;
int redirect_in, redirect_out;
int dmask; /* Open dmaps */
#define DMASK_OUT 0x01
#define DMASK_IN 0x02
int nonblock;
int forced_nonblock;
int ossd_registered;
int sync_flags;
#define SYNC_MASTER 0x01
#define SYNC_SLAVE 0x02
int sync_group;
int sync_mode;
struct audio_operations *sync_next; /* Next device in sync group */
int rate_source;
#define MAX_SAMPLE_RATES 20 /* Cannot be changed (see soundcard.h) */
int nrates, rates[MAX_SAMPLE_RATES];
#ifndef CONFIGURE_C
oss_mutex mutex;
#endif
int card_number;
int port_number;
int real_dev;
int cooked_enable;
int timeout_count;
void (*outputintr) (int dev, int xx);
void (*inputintr) (int dev);
};
typedef struct oss_card_desc
{
char shortname[16];
char longname[128];
} oss_card_desc_t, *oss_card_desc_p;
#define UNIT_EXPAND 1024
extern struct audio_operations **audio_devs;
extern int num_audiodevs;
extern oss_card_desc_p *oss_cardlist;
extern const char *oss_version_string;
extern const char *oss_checksum;
#endif

View File

@@ -0,0 +1,66 @@
#ifndef MIDI_CORE_H
#define MIDI_CORE_H
/*
* Copyright by 4Front Technologies 1993-2004
*
* All rights reserved.
*/
/*
* IMPORTANT NOTICE!
*
* This file contains internal structures used by Open Sound Systems.
* They will change without any notice between OSS versions. Care must be taken
* to make sure any software using this header gets properly re-compiled before
* use.
*
* 4Front Technologies (or anybody else) takes no responsibility of damages
* caused by use of this file.
*/
struct midi_input_info
{ /* MIDI input scanner variables */
#define MI_MAX 32
int m_busy;
unsigned char m_buf[MI_MAX];
unsigned char m_prev_status; /* For running status */
int m_ptr;
#define MST_INIT 0
#define MST_DATA 1
#define MST_SYSEX 2
int m_state;
int m_left;
};
typedef struct midi_operations
{
struct midi_info info;
struct synth_operations *converter;
struct midi_input_info in_info;
int (*open) (int dev, int mode,
void (*inputintr) (int dev, unsigned char data),
void (*outputintr) (int dev));
void (*close) (int dev);
int (*ioctl) (int dev, unsigned int cmd, ioctl_arg arg);
int (*outputc) (int dev, unsigned char data);
int (*start_read) (int dev);
int (*end_read) (int dev);
void (*kick) (int dev);
int (*command) (int dev, unsigned char *data);
int (*buffer_status) (int dev);
int (*prefix_cmd) (int dev, unsigned char status);
void (*input_callback) (int dev, unsigned char midich);
struct coproc_operations *coproc;
void *devc;
sound_os_info *osp;
int card_number;
#ifndef CONFIGURE_C
oss_mutex mutex;
#endif
unsigned long flags;
#define MFLAG_NOSEQUENCER 0x00000001 /* Not to be used by the sequencer driver */
} mididev_t, *mididev_p;
extern struct midi_operations **midi_devs;
extern int num_mididevs;
#endif

View File

@@ -0,0 +1,61 @@
#ifndef MIXER_CORE_H
#define MIXER_CORE_H
/*
* Copyright by 4Front Technologies 1993-2004
*
* All rights reserved.
*/
/*
* IMPORTANT NOTICE!
*
* This file contains internal structures used by Open Sound Systems.
* They will change without any notice between OSS versions. Care must be taken
* to make sure any software using this header gets properly re-compiled before
* use.
*
* 4Front Technologies (or anybody else) takes no responsibility of damages
* caused by use of this file.
*/
typedef int (*mixer_ext_fn) (int dev, int ctrl, unsigned int cmd, int value);
typedef int (*mixer_ext_init_fn) (int dev);
typedef struct
{
oss_mixext ext;
mixer_ext_fn handler;
oss_mixer_enuminfo *enum_info;
}
oss_mixext_desc;
struct mixer_operations
{
char id[16];
char name[64];
int (*ioctl) (int dev, int audiodev, unsigned int cmd, ioctl_arg arg);
void *devc;
void *hw_devc;
int modify_counter;
/* Mixer extension interface */
int nr_ext;
int max_ext;
int nr_extra_ext;
int timestamp;
oss_mixext_desc *extensions;
mixer_ext_init_fn ext_init_fn;
int ignore_mask; /* Controls ignored by mixer ext API */
int card_number;
int enabled;
};
typedef struct mixer_operations mixdev_t, *mixdev_p;
extern struct mixer_operations **mixer_devs;
extern int num_mixers;
extern void touch_mixer (int dev);
extern int oss_mixer_ext (int orig_dev, unsigned int cmd, ioctl_arg arg);
extern int mixer_ext_set_enum (oss_mixer_enuminfo * ent);
#endif

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,96 @@
#ifndef _ULTRASOUND_H_
#define _ULTRASOUND_H_
/*
* ultrasound.h - Macros for programming the Gravis Ultrasound
* These macros are extremely device dependent
* and not portable.
*/
#define COPYING2 Copyright (C) Hannu Savolainen and Dev Mazumdar 1997. All rights reserved.
/*
* Private events for Gravis Ultrasound (GUS)
*
* Format:
* byte 0 - SEQ_PRIVATE (0xfe)
* byte 1 - Synthesizer device number (0-N)
* byte 2 - Command (see below)
* byte 3 - Voice number (0-31)
* bytes 4 and 5 - parameter P1 (unsigned short)
* bytes 6 and 7 - parameter P2 (unsigned short)
*
* Commands:
* Each command affects one voice defined in byte 3.
* Unused parameters (P1 and/or P2 *MUST* be initialized to zero).
* _GUS_NUMVOICES - Sets max. number of concurrent voices (P1=14-31, default 16)
* _GUS_VOICESAMPLE- ************ OBSOLETE *************
* _GUS_VOICEON - Starts voice (P1=voice mode)
* _GUS_VOICEOFF - Stops voice (no parameters)
* _GUS_VOICEFADE - Stops the voice smoothly.
* _GUS_VOICEMODE - Alters the voice mode, don't start or stop voice (P1=voice mode)
* _GUS_VOICEBALA - Sets voice balence (P1, 0=left, 7=middle and 15=right, default 7)
* _GUS_VOICEFREQ - Sets voice (sample) playback frequency (P1=Hz)
* _GUS_VOICEVOL - Sets voice volume (P1=volume, 0xfff=max, 0xeff=half, 0x000=off)
* _GUS_VOICEVOL2 - Sets voice volume (P1=volume, 0xfff=max, 0xeff=half, 0x000=off)
* (Like GUS_VOICEVOL but doesn't change the hw
* volume. It just updates volume in the voice table).
*
* _GUS_RAMPRANGE - Sets limits for volume ramping (P1=low volume, P2=high volume)
* _GUS_RAMPRATE - Sets the speed for volume ramping (P1=scale, P2=rate)
* _GUS_RAMPMODE - Sets the volume ramping mode (P1=ramping mode)
* _GUS_RAMPON - Starts volume ramping (no parameters)
* _GUS_RAMPOFF - Stops volume ramping (no parameters)
* _GUS_VOLUME_SCALE - Changes the volume calculation constants
* for all voices.
*/
#define _GUS_NUMVOICES 0x00
#define _GUS_VOICESAMPLE 0x01 /* OBSOLETE */
#define _GUS_VOICEON 0x02
#define _GUS_VOICEOFF 0x03
#define _GUS_VOICEMODE 0x04
#define _GUS_VOICEBALA 0x05
#define _GUS_VOICEFREQ 0x06
#define _GUS_VOICEVOL 0x07
#define _GUS_RAMPRANGE 0x08
#define _GUS_RAMPRATE 0x09
#define _GUS_RAMPMODE 0x0a
#define _GUS_RAMPON 0x0b
#define _GUS_RAMPOFF 0x0c
#define _GUS_VOICEFADE 0x0d
#define _GUS_VOLUME_SCALE 0x0e
#define _GUS_VOICEVOL2 0x0f
#define _GUS_VOICE_POS 0x10
/*
* GUS API macros
*/
#define _GUS_CMD(chn, voice, cmd, p1, p2) \
{_SEQ_NEEDBUF(8); _seqbuf[_seqbufptr] = SEQ_PRIVATE;\
_seqbuf[_seqbufptr+1] = (chn); _seqbuf[_seqbufptr+2] = cmd;\
_seqbuf[_seqbufptr+3] = voice;\
*(unsigned short*)&_seqbuf[_seqbufptr+4] = p1;\
*(unsigned short*)&_seqbuf[_seqbufptr+6] = p2;\
_SEQ_ADVBUF(8);}
#define GUS_NUMVOICES(chn, p1) _GUS_CMD(chn, 0, _GUS_NUMVOICES, (p1), 0)
#define GUS_VOICESAMPLE(chn, voice, p1) _GUS_CMD(chn, voice, _GUS_VOICESAMPLE, (p1), 0) /* OBSOLETE */
#define GUS_VOICEON(chn, voice, p1) _GUS_CMD(chn, voice, _GUS_VOICEON, (p1), 0)
#define GUS_VOICEOFF(chn, voice) _GUS_CMD(chn, voice, _GUS_VOICEOFF, 0, 0)
#define GUS_VOICEFADE(chn, voice) _GUS_CMD(chn, voice, _GUS_VOICEFADE, 0, 0)
#define GUS_VOICEMODE(chn, voice, p1) _GUS_CMD(chn, voice, _GUS_VOICEMODE, (p1), 0)
#define GUS_VOICEBALA(chn, voice, p1) _GUS_CMD(chn, voice, _GUS_VOICEBALA, (p1), 0)
#define GUS_VOICEFREQ(chn, voice, p) _GUS_CMD(chn, voice, _GUS_VOICEFREQ, \
(p) & 0xffff, ((p) >> 16) & 0xffff)
#define GUS_VOICEVOL(chn, voice, p1) _GUS_CMD(chn, voice, _GUS_VOICEVOL, (p1), 0)
#define GUS_VOICEVOL2(chn, voice, p1) _GUS_CMD(chn, voice, _GUS_VOICEVOL2, (p1), 0)
#define GUS_RAMPRANGE(chn, voice, low, high) _GUS_CMD(chn, voice, _GUS_RAMPRANGE, (low), (high))
#define GUS_RAMPRATE(chn, voice, p1, p2) _GUS_CMD(chn, voice, _GUS_RAMPRATE, (p1), (p2))
#define GUS_RAMPMODE(chn, voice, p1) _GUS_CMD(chn, voice, _GUS_RAMPMODE, (p1), 0)
#define GUS_RAMPON(chn, voice, p1) _GUS_CMD(chn, voice, _GUS_RAMPON, (p1), 0)
#define GUS_RAMPOFF(chn, voice) _GUS_CMD(chn, voice, _GUS_RAMPOFF, 0, 0)
#define GUS_VOLUME_SCALE(chn, voice, p1, p2) _GUS_CMD(chn, voice, _GUS_VOLUME_SCALE, (p1), (p2))
#define GUS_VOICE_POS(chn, voice, p) _GUS_CMD(chn, voice, _GUS_VOICE_POS, \
(p) & 0xffff, ((p) >> 16) & 0xffff)
#endif

View File

@@ -0,0 +1,241 @@
# a collection of utility functions to manipulate pak files
import os, zipfile, md5, pdb
# sorts in reverse alphabetical order like doom does for searching
def list_paks( path ):
files = os.listdir( path )
for i in files:
if ( i[-4:] != '.pk4' ):
files.remove( i )
files.sort()
files.reverse()
return files
def list_files_in_pak( pak ):
files = []
zippy = zipfile.ZipFile( pak )
files += zippy.namelist()
files.sort()
return files
# no sorting, blunt list of everything
def list_files_in_paks( path ):
files = []
zippies = list_paks( path )
for fname in zippies:
print fname
zippy = zipfile.ZipFile( os.path.join( path, fname ) )
files += zippy.namelist()
# sort and remove dupes
dico = {}
for f in files:
dico[ f ] = 1
files = dico.keys()
files.sort()
return files
# build a dictionary of names -> ( pak name, md5 ) from a path of pk4s
def md5_in_paks( path ):
ret = {}
zippies = list_paks( path )
for fname in zippies:
print fname
zippy = zipfile.ZipFile( os.path.join( path, fname ) )
for file in zippy.namelist():
if ( ret.has_key( file ) ):
continue
data = zippy.read( file )
m = md5.new()
m.update( data )
ret[ file ] = ( fname, m.hexdigest() )
return ret
# find which files need to be updated in a set of paks from an expanded list
# returns ( updated, not_found, {} )
# ignores directories
# by default, no case match is done
# if case match is set, return ( updated, not_found, { zip case -> FS case } )
# updated will contain the zip case name
def list_updated_files( pak_path, base_path, case_match = False ):
not_found = []
updated = []
case_table = {}
pak_md5 = md5_in_paks( pak_path )
for file in pak_md5.keys():
if ( file[-1] == '/' ):
continue
path = os.path.join( base_path, file )
if ( case_match ):
ret = ifind( base_path, file )
if ( not ret[ 0 ] ):
not_found.append( file )
continue
else:
case_table[ path ] = ret[ 1 ]
path = os.path.join( base_path, ret[ 1 ] )
try:
f = open( path )
data = f.read()
f.close()
except:
if ( case_match ):
raise "internal error: ifind success but later read failed"
not_found.append( file )
else:
m = md5.new()
m.update( data )
if ( m.hexdigest() != pak_md5[ file ][ 1 ] ):
print file
updated.append( file )
return ( updated, not_found, case_table )
# find which files are missing in the expanded path, and extract the directories
# returns ( files, dirs, missing )
def status_files_for_path( path, infiles ):
files = []
dirs = []
missing = []
for i in infiles:
test_path = os.path.join( path, i )
if ( os.path.isfile( test_path ) ):
files.append( i )
elif ( os.path.isdir( test_path ) ):
dirs.append( i )
else:
missing.append( i )
return ( files, dirs, missing )
# build a pak from a base path and a list of files
def build_pak( pak, path, files ):
zippy = zipfile.ZipFile( pak, 'w', zipfile.ZIP_DEFLATED )
for i in files:
source_path = os.path.join( path, i )
print source_path
zippy.write( source_path, i )
zippy.close()
# process the list of files after a run to update media
# dds/ -> verify all the .dds are present in zip ( case insensitive )
# .wav -> verify that all .wav have a .ogg version in zip ( case insensitive )
# .tga not in dds/ -> try to find a .dds for them
# work from a list of files, and a path to the base pak files
# files: text files with files line by line
# pak_path: the path to the pak files to compare against
# returns: ( [ missing ], [ bad ] )
# bad are files the function didn't know what to do about ( bug )
# missing are lowercased of all the files that where not matched in build
# the dds/ ones are all forced to .dds extension
# missing .wav are returned in the missing list both as .wav and .ogg
# ( that's handy when you need to fetch next )
def check_files_against_build( files, pak_path ):
pak_list = list_files_in_paks( pak_path )
# make it lowercase
tmp = []
for i in pak_list:
tmp.append( i.lower() )
pak_list = tmp
# read the files and make them lowercase
f = open( files )
check_files = f.readlines()
f.close()
tmp = []
for i in check_files:
s = i.lower()
s = s.replace( '\n', '' )
s = s.replace( '\r', '' )
tmp.append( s )
check_files = tmp
# start processing
bad = []
missing = []
for i in check_files:
if ( i[ :4 ] == 'dds/' ):
if ( i[ len(i)-4: ] == '.tga' ):
i = i[ :-4 ] + '.dds'
elif ( i[ len(i)-4: ] != '.dds' ):
print 'File not understood: ' + i
bad.append( i )
continue
try:
pak_list.index( i )
except:
print 'Not found: ' + i
missing.append( i )
elif ( i[ len(i)-4: ] == '.wav' ):
i = i[ :-4 ] + '.ogg'
try:
pak_list.index( i )
except:
print 'Not found: ' + i
missing.append( i )
missing.append( i[ :-4 ] + '.wav' )
elif ( i[ len(i)-4: ] == '.tga' ):
# tga, not from dds/
try:
pak_list.index( i )
except:
print 'Not found: ' + i
missing.append( i )
i = 'dds/' + i[ :-4 ] + '.dds'
print 'Add dds : ' + i
missing.append( i )
else:
try:
pak_list.index( i )
except:
print 'Not found: ' + i
missing.append( i )
return ( missing, bad )
# match a path to a file in a case insensitive way
# return ( True/False, 'walked up to' )
def ifind( base, path ):
refpath = path
path = os.path.normpath( path )
path = os.path.normcase( path )
# early out just in case
if ( os.path.exists( path ) ):
return ( True, path )
head = path
components = []
while ( len( head ) ):
( head, chunk ) = os.path.split( head )
components.append( chunk )
#print 'head: %s - components: %s' % ( head, repr( components ) )
components.reverse()
level = 0
for root, dirs, files in os.walk( base, topdown = True ):
if ( level < len( components ) - 1 ):
#print 'filter dirs: %s' % repr( dirs )
dirs_del = []
for i in dirs:
if ( not i.lower() == components[ level ].lower() ):
dirs_del.append( i )
for i in dirs_del:
dirs.remove( i )
level += 1
# we assume there is never going to be 2 dirs with only case difference
if ( len( dirs ) != 1 ):
#print '%s: ifind failed dirs matching at %s - dirs: %s' % ( refpath, root, repr( dirs ) )
return ( False, root[ len( base ) + 1: ] )
else:
# must find the file here
for i in files:
if ( i.lower() == components[-1].lower() ):
return ( True, os.path.join( root, i )[ len( base ) + 1: ] )
return ( False, root[ len( base ) + 1: ] )
# do case insensitive FS search on files list
# return [ cased files, not found (unmodified ) ]
def ifind_list( base, files ):
cased = []
notfound = []
for i in files:
ret = ifind( base, i )
if ( ret[ 0 ] ):
cased.append( ret[ 1 ] )
else:
notfound.append( i )
return [ cased, notfound ]

View File

@@ -0,0 +1,7 @@
#!/bin/sh
rm $1
flip -u $2
mkdir -p `dirname $1`
cd /var/local/Doom/base
cat $2 | zip $1 -@

View File

@@ -0,0 +1,7 @@
#!/bin/sh
rm $1
flip -u $2
mkdir -p `dirname $1`
cd /var/local/Doom/base
cat $2 | while read i ; do find . -ipath "./$i" ; done | cut -b 3- | tee /home/timo/cased.log | zip $1 -@

View File

@@ -0,0 +1,42 @@
#!/bin/sh
base=/home/doom-grp/Doom/base
host=timo@idnet.ua-corp.com
srvscript=/var/local/builds/misc/packup.sh
maindir=$(pwd)
cd $(dirname $1)
source=$(pwd)/$(basename $1)
outdir=$(pwd)
cd $maindir
echo "list of files : $source"
echo "base : $base"
echo "host : $host"
echo "server script : $srvscript"
echo "press enter"
read
flip -u $source
(
cd $base
cat $source | while read i ; do find . -ipath "./$i" | cut -b 3- ; done | tee $outdir/matched.cased.log
)
# find the no match, not even case sensitive
diff -ui $source $outdir/matched.cased.log | grep ^- | cut -b 2- | tee $outdir/missing.log
scp $outdir/missing.log $host:/home/timo/missing.log
ssh $host $srvscript /home/timo/dl.zip /home/timo/missing.log
rm $outdir/dl.zip
scp $host:/home/timo/dl.zip $outdir
scp $host:/home/timo/cased.log $outdir/missing.cased.log
(
cd $base
unzip $outdir/dl.zip
# merge both lists into a single thing
rm $outdir/dl.zip
cat $outdir/missing.cased.log | zip $outdir/dl.zip -@
cat $outdir/matched.cased.log | zip $outdir/dl.zip -@
)

View File

@@ -0,0 +1,27 @@
#!/bin/sh
echo "current pak files: $1"
echo "expanded updated source: $2"
echo "new pak file: $3"
echo "press a key"
read
TMPDIR=`mktemp -d -t`
ls "$1/"*.pk4 | while read i ; do unzip -l $i | cut -b 29- | tee $TMPDIR/`basename $i`.log ; done
ls $TMPDIR/*.log | while read i ; do lines=`cat $i | wc -l` ; tail +4 $i | head -$(( $lines - 5 )) | tee $TMPDIR/`basename $i`.2 ; done
# check cutting off
#ls $TMPDIR/*.log | while read i ; do diff $i $i.2 ; done
cat $TMPDIR/*.log.2 | sort -u | tee $TMPDIR/sorted-unique.log
# now the magical zip command
cd $2
rm $3
cat $TMPDIR/sorted-unique.log | zip -b $TMPDIR $3 -@ 1>/dev/null
md5sum $3
echo "done."

41
neo/sys/linux/process.py Normal file
View File

@@ -0,0 +1,41 @@
#!/usr/bin/env python
# process stdin into an M4 macro definition file
# recognize three keyword qgl qwgl qglX
#
# output
# global macros keep track of the three intervals for function types:
# gl_start gl_end wgl_start wgl_end glX_start glX_end
# NOTE: will we need similar thing for extensions?
#
# each function:
# f<id>_ret: return type
# f<id>_name: function name
# f<id>_params: complete params
#
# ex:
# define(`f1_ret', `void')
# define(`f1_name', `Accum')
# define(`f1_params', ``GLenum op, GLfloat value'')
#
import sys, string
from read import read_gl
(gl, wgl, glX) = read_gl(sys.stdin)
sys.stdout.write('define(`gl_start\', `0\')\n')
sys.stdout.write('define(`gl_end\', `%d\')\n' % int(len(gl)-1))
sys.stdout.write('define(`wgl_start\', `%d\')\n' % int(len(gl)))
sys.stdout.write('define(`wgl_end\', `%d\')\n' % int(len(gl)+len(wgl)-1))
sys.stdout.write('define(`glX_start\', `%d\')\n' % int(len(gl)+len(wgl)))
sys.stdout.write('define(`glX_end\', `%d\')\n' % int(len(gl)+len(wgl)+len(glX)-1))
i = 0
for l in (gl, wgl, glX):
for t in l:
# process ret type to strip trailing spaces
t[0] = string.strip(t[0])
sys.stdout.write('define(`f%d_ret\', `%s\')\n' % (i, t[0]))
sys.stdout.write('define(`f%d_name\', `%s\')\n' % (i, t[2]))
sys.stdout.write('define(`f%d_params\', ``%s\'\')\n' % (i, t[3]))
i += 1

View File

@@ -0,0 +1,20 @@
#!/usr/bin/env perl
# send linker output to stdin
# make 2>&1 | process_undef.pl
my %symbols;
open($list, "cat $ARGV[0] " . '| grep \'undefined reference\' | grep -v \'more undefined\' | sed -e \'s/.*undefined reference to `\(.*\)./\1/\' |');
my $line = <$list>;
do
{
chop($line);
$symbols{$line}++;
} until (!($line = <$list>));
@sorted = sort { $symbols{$b} <=> $symbols{$a} } keys %symbols;
foreach (@sorted)
{
print "$symbols{$_} : $_\n";
};

1478
neo/sys/linux/qgl_enforce.h Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,24 @@
dnl =====================================================
dnl utils
dnl =====================================================
define(`forloop',
`pushdef(`$1', `$2')_forloop(`$1', `$2', `$3', `$4')popdef(`$1')')
define(`_forloop',
`$4`'ifelse($1, `$3', ,
`define(`$1', incr($1))_forloop(`$1', `$2', `$3', `$4')')')
dnl =====================================================
dnl the gl wgl glX definitions
dnl =====================================================
include(../gllog/gl_def.m4)
dnl =====================================================
dnl issue the defines to lock out gl usage
dnl =====================================================
define(`define_out', `#define gl$1 use_qgl$1')
forloop(`i', gl_start, gl_end, `define_out(indir(`f'i`_name'))
')
forloop(`i', glX_start, glX_end, `define_out(indir(`f'i`_name'))
')

View File

@@ -0,0 +1,25 @@
# -*- mode: python -*-
import string
from twisted.application import service, internet
from runner_lib import doomService
maps_file = open( 'maps.list.full' )
multiplayer = 0
# maps_file = open( 'maps.list.mp' )
# multiplayer = 1
# maps_file = open( 'maps.list.game' )
# multiplayer = 0
blank_run = 1
maps = maps_file.readlines()
maps_file.close()
for i in range( 0, len(maps) ):
maps[i] = string.strip( maps[i], '\n' )
application = service.Application( "doomRunner" )
doomService( '/home/timo/runner/doom.x86', '+set r_fullscreen 0 +set in_nograb 1 +set si_pure 0 +set com_makingBuild 1 +set s_forceWav 1 +set s_maxSoundsPerShader 0 +set s_constantAmplitude 1 +set fs_devpath /home/timo/Id/DoomPure +set fs_basepath /home/timo/Id/DoomBase +set fs_cdpath /home/timo/Id/DoomBase.smbfs +set fs_copyfiles 3', maps, sort = 1, multiplayer = multiplayer, blank_run = blank_run ).setServiceParent( application )

View File

@@ -0,0 +1,209 @@
# run doom process on a series of maps
# can be used for regression testing, or to fetch media
# keeps a log of each run ( see getLogfile )
# currently uses a basic stdout activity timeout to decide when to move on
# using a periodic check of /proc/<pid>/status SleepAVG
# when the sleep average is reaching 0, issue a 'quit' to stdout
# keeps serialized run status in runner.pickle
# NOTE: can be used to initiate runs on failed maps only for instance etc.
# TODO: use the serialized and not the logs to sort the run order
# TODO: better logging. Use idLogger?
# TODO: configurable event when the process is found interactive
# instead of emitting a quit, perform some warning action?
import sys, os, commands, string, time, traceback, pickle
from twisted.application import internet, service
from twisted.internet import protocol, reactor, utils, defer
from twisted.internet.task import LoopingCall
class doomClientProtocol( protocol.ProcessProtocol ):
# ProcessProtocol API
def connectionMade( self ):
self.logfile.write( 'connectionMade\n' )
def outReceived( self, data ):
print data
self.logfile.write( data )
def errReceived( self, data ):
print 'stderr: ' + data
self.logfile.write( 'stderr: ' + data )
def inConnectionLost( self ):
self.logfile.write( 'inConnectionLost\n' )
def outConnectionLost( self ):
self.logfile.write( 'outConnectionLost\n' )
def errConnectionLost( self ):
self.logfile.write( 'errConnectionLost\n' )
def processEnded( self, status_object ):
self.logfile.write( 'processEnded %s\n' % repr( status_object ) )
self.logfile.write( time.strftime( '%H:%M:%S', time.localtime( time.time() ) ) + '\n' )
self.logfile.close()
self.deferred.callback( None )
# mac management
def __init__( self, logfilename, deferred ):
self.logfilename = logfilename
self.logfile = open( logfilename, 'a' )
self.logfile.write( time.strftime( '%H:%M:%S', time.localtime( time.time() ) ) + '\n' )
self.deferred = deferred
class doomService( service.Service ):
# current monitoring state
# 0: nothing running
# 1: we have a process running, we're monitoring it's CPU usage
# 2: we issued a 'quit' to the process's stdin
# either going to get a processEnded, or a timeout
# 3: we forced a kill because of error, timeout etc.
state = 0
# load check period
check_period = 10
# pickled status file
pickle_file = 'runner.pickle'
# stores status indexed by filename
# { 'mapname' : ( state, last_update ), .. }
status = {}
# start the maps as multiplayer server
multiplayer = 0
def __init__( self, bin, cmdline, maps, sort = 0, multiplayer = 0, blank_run = 0 ):
self.p_transport = None
self.multiplayer = multiplayer
self.blank_run = blank_run
if ( self.multiplayer ):
print 'Operate in multiplayer mode'
self.bin = os.path.abspath( bin )
if ( type( cmdline ) is type( '' ) ):
self.cmdline = string.split( cmdline, ' ' )
else:
self.cmdline = cmdline
self.maps = maps
if ( os.path.exists( self.pickle_file ) ):
print 'Loading pickled status %s' % self.pickle_file
handle = open( self.pickle_file, 'r' )
self.status = pickle.load( handle )
handle.close()
if ( sort ):
print 'Sorting maps oldest runs first'
maps_sorted = [ ]
for i in self.maps:
i_log = self.getLogfile( i )
if ( os.path.exists( i_log ) ):
maps_sorted.append( ( i, os.path.getmtime( i_log ) ) )
else:
maps_sorted.append( ( i, 0 ) )
maps_sorted.sort( lambda x,y : cmp( x[1], y[1] ) )
self.maps = [ ]
if ( blank_run ):
self.maps.append( 'blankrun' )
for i in maps_sorted:
self.maps.append( i[ 0 ] )
print 'Sorted as: %s\n' % repr( self.maps )
def getLogfile( self, name ):
return 'logs/' + string.translate( name, string.maketrans( '/', '-' ) ) + '.log'
# deferred call when child process dies
def processEnded( self, val ):
print 'child has died - state %d' % self.state
self.status[ self.maps[ self.i_map ] ] = ( self.state, time.time() )
self.i_map += 1
if ( self.i_map >= len( self.maps ) ):
reactor.stop()
else:
self.nextMap()
def processTimeout( self ):
self.p_transport.signalProcess( "KILL" )
def sleepAVGReply( self, val ):
try:
s = val[10:][:-2]
print 'sleepAVGReply %s%%' % s
if ( s == '0' ):
# need twice in a row
if ( self.state == 2 ):
print 'child process is interactive'
self.p_transport.write( 'quit\n' )
else:
self.state = 2
else:
self.state = 1
# else:
# reactor.callLater( self.check_period, self.checkCPU )
except:
print traceback.format_tb( sys.exc_info()[2] )
print sys.exc_info()[0]
print 'exception raised in sleepAVGReply - killing process'
self.state = 3
self.p_transport.signalProcess( 'KILL' )
def sleepAVGTimeout( self ):
print 'sleepAVGTimeout - killing process'
self.state = 3
self.p_transport.signalProcess( 'KILL' )
# called at regular intervals to monitor the sleep average of the child process
# when sleep reaches 0, it means the map is loaded and interactive
def checkCPU( self ):
if ( self.state == 0 or self.p_transport is None or self.p_transport.pid is None ):
print 'checkCPU: no child process atm'
return
defer = utils.getProcessOutput( '/bin/bash', [ '-c', 'cat /proc/%d/status | grep SleepAVG' % self.p_transport.pid ] )
defer.addCallback( self.sleepAVGReply )
defer.setTimeout( 2, self.sleepAVGTimeout )
def nextMap( self ):
self.state = 0
name = self.maps[ self.i_map ]
print 'Starting map: ' + name
logfile = self.getLogfile( name )
print 'Logging to: ' + logfile
if ( self.multiplayer ):
cmdline = [ self.bin ] + self.cmdline + [ '+set', 'si_map', name ]
if ( name != 'blankrun' ):
cmdline.append( '+spawnServer' )
else:
cmdline = [ self.bin ] + self.cmdline
if ( name != 'blankrun' ):
cmdline += [ '+devmap', name ]
print 'Command line: ' + repr( cmdline )
self.deferred = defer.Deferred()
self.deferred.addCallback( self.processEnded )
self.p_transport = reactor.spawnProcess( doomClientProtocol( logfile, self.deferred ), self.bin, cmdline , path = os.path.dirname( self.bin ), env = os.environ )
self.state = 1
# # setup the CPU usage loop
# reactor.callLater( self.check_period, self.checkCPU )
def startService( self ):
print 'doomService startService'
loop = LoopingCall( self.checkCPU )
loop.start( self.check_period )
self.i_map = 0
self.nextMap()
def stopService( self ):
print 'doomService stopService'
if ( not self.p_transport.pid is None ):
self.p_transport.signalProcess( 'KILL' )
# serialize
print 'saving status to %s' % self.pickle_file
handle = open( self.pickle_file, 'w+' )
pickle.dump( self.status, handle )
handle.close()

View File

@@ -0,0 +1 @@
2

View File

@@ -0,0 +1,224 @@
/*-
* Copyright (c) 1996 Søren Schmidt
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer
* in this position and unchanged.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software withough specific prior written permission
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $FreeBSD: src/usr.bin/brandelf/brandelf.c,v 1.16 2000/07/02 03:34:08 imp Exp $
*/
#include <elf.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/errno.h>
#include <err.h>
/* These are defined on FreeBSD, but not on Linux */
#ifndef ELFOSABI_SYSV
#define ELFOSABI_SYSV 0
#endif
#ifndef ELFOSABI_LINUX
#define ELFOSABI_LINUX 3
#endif
#ifndef ELFOSABI_HURD
#define ELFOSABI_HURD 4
#endif
#ifndef ELFOSABI_SOLARIS
#define ELFOSABI_SOLARIS 6
#endif
#ifndef ELFOSABI_FREEBSD
#define ELFOSABI_FREEBSD 9
#endif
static int elftype(const char *);
static const char *iselftype(int);
static void printelftypes(void);
static void usage __P((void));
struct ELFtypes {
const char *str;
int value;
};
/* XXX - any more types? */
static struct ELFtypes elftypes[] = {
{ "FreeBSD", ELFOSABI_FREEBSD },
{ "Linux", ELFOSABI_LINUX },
{ "Solaris", ELFOSABI_SOLARIS },
{ "SVR4", ELFOSABI_SYSV }
};
int
main(int argc, char **argv)
{
const char *strtype = "FreeBSD";
int type = ELFOSABI_FREEBSD;
int retval = 0;
int ch, change = 0, verbose = 0, force = 0, listed = 0;
while ((ch = getopt(argc, argv, "f:lt:v")) != -1)
switch (ch) {
case 'f':
if (change)
errx(1, "f option incompatable with t option");
force = 1;
type = atoi(optarg);
if (errno == ERANGE || type < 0 || type > 255) {
warnx("invalid argument to option f: %s",
optarg);
usage();
}
break;
case 'l':
printelftypes();
listed = 1;
break;
case 'v':
verbose = 1;
break;
case 't':
if (force)
errx(1, "t option incompatable with f option");
change = 1;
strtype = optarg;
break;
default:
usage();
}
argc -= optind;
argv += optind;
if (!argc) {
if (listed)
exit(0);
else {
warnx("no file(s) specified");
usage();
}
}
if (!force && (type = elftype(strtype)) == -1) {
warnx("invalid ELF type '%s'", strtype);
printelftypes();
usage();
}
while (argc) {
int fd;
char buffer[EI_NIDENT];
if ((fd = open(argv[0], change || force ? O_RDWR : O_RDONLY, 0)) < 0) {
warn("error opening file %s", argv[0]);
retval = 1;
goto fail;
}
if (read(fd, buffer, EI_NIDENT) < EI_NIDENT) {
warnx("file '%s' too short", argv[0]);
retval = 1;
goto fail;
}
if (buffer[0] != ELFMAG0 || buffer[1] != ELFMAG1 ||
buffer[2] != ELFMAG2 || buffer[3] != ELFMAG3) {
warnx("file '%s' is not ELF format", argv[0]);
retval = 1;
goto fail;
}
if (!change && !force) {
fprintf(stdout,
"File '%s' is of brand '%s' (%u).\n",
argv[0], iselftype(buffer[EI_OSABI]),
buffer[EI_OSABI]);
if (!iselftype(type)) {
warnx("ELF ABI Brand '%u' is unknown",
type);
printelftypes();
}
}
else {
buffer[EI_OSABI] = type;
lseek(fd, 0, SEEK_SET);
if (write(fd, buffer, EI_NIDENT) != EI_NIDENT) {
warn("error writing %s %d", argv[0], fd);
retval = 1;
goto fail;
}
}
fail:
close(fd);
argc--;
argv++;
}
return retval;
}
static void
usage()
{
fprintf(stderr, "usage: brandelf [-f ELF ABI number] [-v] [-l] [-t string] file ...\n");
exit(1);
}
static const char *
iselftype(int elftype)
{
int elfwalk;
for (elfwalk = 0;
elfwalk < sizeof(elftypes)/sizeof(elftypes[0]);
elfwalk++)
if (elftype == elftypes[elfwalk].value)
return elftypes[elfwalk].str;
return 0;
}
static int
elftype(const char *elfstrtype)
{
int elfwalk;
for (elfwalk = 0;
elfwalk < sizeof(elftypes)/sizeof(elftypes[0]);
elfwalk++)
if (strcmp(elfstrtype, elftypes[elfwalk].str) == 0)
return elftypes[elfwalk].value;
return -1;
}
static void
printelftypes()
{
int elfwalk;
fprintf(stderr, "known ELF types are: ");
for (elfwalk = 0;
elfwalk < sizeof(elftypes)/sizeof(elftypes[0]);
elfwalk++)
fprintf(stderr, "%s(%u) ", elftypes[elfwalk].str,
elftypes[elfwalk].value);
fprintf(stderr, "\n");
}

View File

@@ -0,0 +1,30 @@
#
# Use this script to customize the installer bootstrap script
#
# override some defaults
# try to get root prior to running setup?
# 0: no
# 1: prompt, but run anyway if fails
# 2: require, abort if root fails
# 3: print SU_MESSAGE if not root, don't attempt any privilege upgrade
GET_ROOT=1
FATAL_ERROR="Error running installer. See http://zerowing.idsoftware.com/linux/doom/ for troubleshooting"
#XSU_ICON="-i icon.xpm"
SU_MESSAGE="The recommended install location (/usr/local/games) requires root permissions.\nPlease enter the root password or hit enter to continue install as current user."
XSU_MESSAGE="The recommended install location (/usr/local/games) requires root permissions.^Please enter the root password or hit cancel to continue install as current user."
rm -f /usr/local/games/tmp.$$ > /dev/null 2>&1
touch /usr/local/games/tmp.$$ > /dev/null 2>&1
status="$?"
if [ "$status" -eq 0 ]
then
rm -f /usr/local/games/tmp.$$
GET_ROOT=0
else
GET_ROOT=1
fi

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,290 @@
#! /bin/sh
#
# Product setup script
#
# Go to the proper setup directory (if not already there)
cd `dirname $0`
# defaults
FATAL_ERROR="Fatal error, no tech support email configured in this setup"
# try to get root prior to running setup?
# 0: no
# 1: prompt, but run anyway if fails
# 2: require, abort if root fails
GET_ROOT=0
XSU_ICON=""
# You may want to set USE_XHOST to 1 if you want an X11 application to
# be launched with root privileges right after installation
USE_XHOST=0
# this is the message for su call, printf
SU_MESSAGE="You need to run this installation as the super user.\nPlease enter the root password."
NULL=/dev/null
# See if we have the XPG4 utilities (Solaris)
if test -d /usr/xpg4/bin; then
PATH=/usr/xpg4/bin:$PATH
fi
# Return the appropriate architecture string
DetectARCH()
{
status=1
case `uname -m` in
amd64 | x86_64)
echo "amd64"
status=0;;
i?86 | i86*)
echo "x86"
status=0;;
90*/*)
echo "hppa"
status=0;;
*)
case `uname -s` in
IRIX*)
echo "mips"
status=0;;
AIX*)
echo "ppc"
status=0;;
*)
arch=`uname -p 2> /dev/null || uname -m`
if test "$arch" = powerpc; then
echo "ppc"
else
echo $arch
fi
status=0;;
esac
esac
return $status
}
# Return the appropriate version string
DetectLIBC()
{
status=1
if [ `uname -s` != Linux ]; then
echo "glibc-2.1"
return $status
fi
if [ -f `echo /lib/libc.so.6* | tail -n 1` ]; then
# I'm not using glibc-specific binaries
# this step even fails on amd64 gentoo, only has GLIBC_2.2 2.3 in it's strings
echo "glibc-2.1"
status=0
# if [ fgrep GLIBC_2.1 /lib/libc.so.6* 2> $NULL >> $NULL ]; then
# echo "glibc-2.1"
# status=0
# else
# echo "glibc-2.0"
# status=0
# fi
elif [ -f /lib/libc.so.5 ]; then
echo "libc5"
status=0
else
echo "unknown"
fi
return $status
}
DetectOS()
{
os=`uname -s`
if test "$os" = "OpenUNIX"; then
echo SCO_SV
else
echo $os
fi
return 0
}
# Detect the environment
arch=`DetectARCH`
libc=`DetectLIBC`
os=`DetectOS`
args=""
# Import preferences from a secondary script
if [ -f setup.data/config.sh ]; then
. setup.data/config.sh
elif [ -f SETUP.DAT/CONFIG.SH\;1 ]; then
# HP-UX and other systems unable to get LFN correctly
. SETUP.DAT/CONFIG.SH\;1
fi
# Add some standard paths for compatibility
PATH=$PATH:/usr/ucb
# call setup with -auth when ran through su/xsu
auth=0
if [ "$1" = "-auth" ]
then
auth=1
shift
fi
# Find the installation program
# try_run [-absolute] [-fatal] INSTALLER_NAME [PARAMETERS_PASSED]
# -absolute option: if what you are trying to execute has an absolute path
# NOTE: maybe try_run_absolute would be easier
# -fatal option: if you want verbose messages in case
# - the script could not be found
# - it's execution would fail
# INSTALLER_NAME: setup.gtk or setup
# PARAMETERS_PASSED: additional arguments passed to the setup script
try_run()
{
absolute=0
if [ "$1" = "-absolute" ]; then
absolute=1
shift
fi
fatal=0
# older bash < 2.* don't like == operator, using =
if [ "$1" = "-fatal" ]; then
# got fatal
fatal=1
shift
fi
setup=$1
shift
# First find the binary we want to run
failed=0
if [ "$absolute" -eq 0 ]
then
setup_bin="setup.data/bin/$os/$arch/$libc/$setup"
# trying $setup_bin
if [ ! -f "$setup_bin" ]; then
setup_bin="setup.data/bin/$os/$arch/$setup"
# libc dependant version failed, trying again
if [ ! -f "$setup_bin" ]; then
failed=1
fi
fi
if [ "$failed" -eq 1 ]; then
if [ "$fatal" -eq 1 ]; then
cat <<__EOF__
This installation doesn't support $libc on $os / $arch
(tried to run $setup)
$FATAL_ERROR
__EOF__
fi
return $failed
fi
# Try to run the binary ($setup_bin)
# The executable is here but we can't execute it from CD
# NOTE TTimo: this is dangerous, we also use $setup to store the name of the try_run
setup="$HOME/.setup$$"
rm -f "$setup"
cp "$setup_bin" "$setup"
chmod 700 "$setup"
trap "rm -f $setup" 1 2 3 15
fi
# echo Running "$setup" "$@"
if [ "$fatal" -eq 0 ]; then
"$setup" "$@"
failed="$?"
else
"$setup" "$@" 2>> $NULL
failed="$?"
fi
if [ "$absolute" -eq 0 ]
then
# don't attempt removal when we are passed an absolute path
# no, I don't want to imagine a faulty try_run as root on /bin/su
rm -f "$setup"
fi
return "$failed"
}
if [ "$GET_ROOT" -eq 3 ]
then
GOT_ROOT=`id -u`
if [ "$GOT_ROOT" != "0" ]
then
printf "$SU_MESSAGE\n"
echo "Press Enter to continue or Ctrl-C to abort"
read
fi
GET_ROOT=0
fi
# if we have not been through the auth yet, and if we need to get root, then prompt
if [ "$auth" -eq 0 ] && [ "$GET_ROOT" -ne 0 ]
then
GOT_ROOT=`id -u`
if [ "$GOT_ROOT" != "0" ]
then
if [ "$USE_XHOST" -eq 1 ]; then
xhost +127.0.0.1 2> $NULL > $NULL
fi
if [ "$GET_ROOT" -eq 1 ]
then
try_run xsu -e -a -u root -c "sh `pwd`/setup.sh -auth" $XSU_ICON -m "$XSU_MESSAGE"
else
try_run xsu -e -a -u root -c "sh `pwd`/setup.sh -auth" $XSU_ICON
fi
status="$?"
# echo "got $status"
# if try_run successfully executed xsu, it will return xsu's exit code
# xsu returns 2 if ran and cancelled (i.e. the user 'doesn't want' to auth)
# it will return 0 if the command was executed correctly
# summing up, if we get 1, something failed
if [ "$status" -eq 0 ]
then
# the auth command was properly executed
exit 0
elif [ "$status" -eq 1 ]
then
# xsu wasn't found, or failed to run
# if xsu actually ran and the auth was cancelled, $status is > 1
# try with su
# su will return 1 if auth failed
# we need to distinguish between su auth failed and su working, and still get setup.sh return code
printf "$SU_MESSAGE\n"
try_run -absolute /bin/su root -c "export DISPLAY=$DISPLAY;sh `pwd`/setup.sh -auth"
status="$?"
if [ "$status" -eq 1 ] && [ "$GET_ROOT" -eq 1 ]
then
echo "Running setup as user"
else
exit $status
fi
elif [ "$status" -eq 3 ]
then
if [ "$GET_ROOT" -eq 1 ]
then
echo "Running setup as user"
else
# the auth failed or was canceled
# we don't want to even start the setup if not root
echo "Please run this installation as the super user"
exit 1
fi
fi
# continue running as is
fi
fi
# run the setup program (setup.gtk first, then setup)
# except when trying setup.gtk first then console setup, always exit with 0
# if the setup was cancelled, it is not our problem
try_run setup.gtk $args $*
status="$?"
if [ "$status" -ne 0 ] && [ "$status" -ne 3 ]; then # setup.gtk couldn't connect to X11 server - ignore
try_run setup $args $*
status="$?"
if [ "$auth" -eq 1 ] && [ "$status" -ne 0 ]
then
# distinguish between failed su and failed su'ed setup.sh
exit 2
fi
exit $status
fi

View File

@@ -0,0 +1,86 @@
DOOM 3 LIMITED USE SOFTWARE LICENSE AGREEMENT
This DOOM 3 Limited Use Software License Agreement (this "Agreement") is a legal agreement among you, the end-user, and Id Software, Inc. ("Id Software"), and Activision Publishing, Inc. ("Activision"). BY CONTINUING THE INSTALLATION OF THE FULL VERSION GAME PROGRAM ENTITLED DOOM 3 (THE "SOFTWARE"), BY LOADING OR RUNNING THE SOFTWARE, OR BY PLACING OR COPYING THE SOFTWARE ONTO YOUR COMPUTER HARD DRIVE, COMPUTER RAM OR OTHER STORAGE, YOU ARE AGREEING TO BE BOUND BY THE TERMS OF THIS AGREEMENT.
1. Grant of License. Subject to the terms and provisions of this Agreement and so long as you fully comply at all times with this Agreement, Id Software grants to you the non-exclusive and limited right to use the Software only in executable or object code form. The term "Software" includes all elements of the Software, including, without limitation, data files and screen displays. You are not receiving any ownership or proprietary right, title, or interest in or to the Software or the copyrights, trademarks, or other rights related thereto. For purposes of the first sentence of this section, "use" means loading the Software into RAM and/or onto computer hard drive, as well as installation of the Software on a hard disk or other storage device, and means the uses permitted in sections 2 and 4 hereinbelow. You agree that the Software will not be downloaded, shipped, transferred, exported or re exported into any country in violation of the United States Export Administration Act (or any other law governing such matters) by you or anyone at your direction, and that you will not utilize and will not authorize anyone to utilize the Software in any other manner in violation of any applicable law. The Software shall not be downloaded or otherwise exported or re exported into (or to a national or resident of) any country to which the United States has embargoed goods, or to anyone or into any country who/that are prohibited, by applicable law, from receiving such property. In exercising your limited rights hereunder, you shall comply, at all times, with all applicable laws, regulations, ordinances, and statutes. Id Software reserves all rights not granted in this Agreement, including, without limitation, all rights to Id Software's trademarks.
2. Permitted New Creations. Subject to the terms and provisions of this Agreement and so long as you fully comply at all times with this Agreement, Id Software grants to you the non-exclusive and limited right to create for the Software (except any Software code) your own modifications (the "New Creations") that shall operate only with the Software (but not any demo, test, or other version of the Software). You may include within the New Creations certain textures and other images (the "Software Images") from the Software. You shall not create any New Creations that infringe against any third-party right or that are libelous, defamatory, obscene, false, misleading, or otherwise illegal or unlawful. You agree that the New Creations will not be downloaded, shipped, transferred, exported, or re exported into any country in violation of the United States Export Administration Act (or any other law governing such matters) by you or anyone at your direction, and that you will not utilize and will not authorize anyone to utilize the New Creations in any other manner in violation of any applicable law. The New Creations shall not be downloaded or otherwise exported or re exported into (or to a national or resident of) any country to which the United States has embargoed goods or to anyone or into any country who/that are prohibited, by applicable law, from receiving such property. You shall not rent, sell, lease, lend, offer on a pay-per-play basis, or otherwise commercially exploit or commercially distribute the New Creations. You are permitted to distribute, without any cost or charge, the New Creations only to other end-users so long as such distribution is not infringing against any third-party right and otherwise is not illegal or unlawful. As noted below, in the event you commit any breach of this Agreement, your license and this Agreement automatically shall terminate, without notice.
3. Prohibitions with Regard to the Software. You, whether directly or indirectly, shall not do any of the following acts:
a. rent the Software;
b. sell the Software;
c. lease or lend the Software;
d. offer the Software on a pay-per-play basis;
e. distribute the Software by any means, including, but not limited to, Internet or other electronic distribution, direct mail, retail, mail order, or other means;
f. in any other manner and through any medium whatsoever commercially exploit the Software or use the Software for any commercial purpose;
g. disassemble, reverse engineer, decompile, modify (except as permitted by section 2 hereinabove) or alter the Software;
h. translate the Software;
i. reproduce or copy the Software (except as permitted by section 4 hereinbelow);
j. publicly display the Software;
k. prepare or develop derivative works based upon the Software;
l. remove or alter any notices or other markings or legends, such as trademark or copyright notices, affixed on or within the Software or the Printed Materials (as defined in section 5 hereinbelow); or
m. remove, alter, modify, disable, or reduce any of the anti-piracy measures contained in the Software, including, without limitation, measures relating to multiplayer play.
4. Prohibition against Cheat Programs. Any attempt by you, either directly or indirectly, to circumvent or bypass any element of the Software to gain any advantage in multiplayer play of the Software is a material breach of this Agreement. It is a material breach of this Agreement for you, whether directly or indirectly, to create, develop, copy, reproduce, distribute, or otherwise make any use of any software program or any modification to the Software ("Cheat Program") itself that enables or allows the user thereof to obtain an advantage or otherwise exploit another Software player or user when playing the Software against other players or users on a local area network, any other network, or on the Internet. Hacking into the executable of the Software, modification of the Software, or any other use of the Software in connection with the creation, development, or use of any such unauthorized Cheat Program is a material breach of this Agreement. Cheat Programs include, but are not limited to, programs that allow Software players or users to see through walls or other level geometry; programs that allow Software players or users to change their rate of speed outside the allowable limits of the Software; programs that crash either and/or other Software players, users, PC clients, or network servers; programs that automatically target other Software players or users (commonly referred to as "aimbots") that automatically simulate Software player or user input for the purpose of gaining an advantage over other Software players or users; or any other program or modification that functions in a similar capacity or allows any prohibited conduct.
In the event you breach this section or otherwise breach this Agreement, your license and this Agreement automatically shall terminate, without notice, and you shall have no right to play the Software against other players or make any other use of the Software.
5. Permitted Copying. You may make only the following copies of the Software: (i) you may copy the Software from the CD ROM that you purchase onto your computer hard drive; (ii) you may copy the Software from your computer hard drive into your computer RAM; and (iii) you may make one (1) "back up" or archival copy of the Software on one (1) hard disk.
6. Intellectual Property Rights. Certain printed materials (the "Printed Materials") accompany the Software. The Software, the Printed Materials, and all copyrights, trademarks, and all other conceivable intellectual property rights related to the Software and the Printed Materials are owned by Id Software and are protected by United States copyright laws, international treaty provisions, and all applicable law, such as the Lanham Act. You must treat the Software and the Printed Materials like any other copyrighted material, as required by 17 U.S.C. § 101 et seq. and other applicable law. You agree to use your best efforts to see that any user of the Software licensed hereunder, the Printed Materials or the New Creations complies with this Agreement. You agree that you are receiving a copy of the Software and the Printed Materials by limited license only and not by sale and that the "first sale" doctrine of 17 U.S.C. § 109 does not apply to your receipt or use of the Software or the Printed Materials. This section shall survive the cancellation or termination of this Agreement.
7. NO ID SOFTWARE WARRANTIES. ID SOFTWARE DISCLAIMS ALL WARRANTIES, WHETHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, AND ANY WARRANTY OF NON-INFRINGEMENT, WITH RESPECT TO THE SOFTWARE, THE PRINTED MATERIALS, THE SOFTWARE IMAGES, AND OTHERWISE. THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY. ID SOFTWARE DOES NOT WARRANT THAT THE SOFTWARE OR THE OPERATION OF THE SOFTWARE WILL BE UNINTERRUPTED OR ERROR-FREE OR THAT THE SOFTWARE WILL MEET YOUR SPECIFIC OR SPECIAL REQUIREMENTS. ADDITIONAL STATEMENTS, WHETHER ORAL OR WRITTEN, DO NOT CONSTITUTE WARRANTIES BY ID SOFTWARE AND SHOULD NOT BE RELIED UPON. This section shall survive the cancellation or termination of this Agreement.
8. Limited Activision Warranty. Activision warrants to the original consumer purchaser of the Software that the recording medium on which the Software is recorded will be free from defects in material and workmanship for ninety (90) days from the date of purchase. If the recording medium is found defective within ninety (90) days of original purchase, Activision agrees to replace, free of charge, any Software discovered to be defective within such period upon its receipt of the Software, postage paid, with the proof of the date of purchase, as long as the Software still is being manufactured by Activision. In the event that the Software no longer is available, Activision retains the right to substitute a similar game program of equal or greater value. This warranty is limited to the recording medium containing the Software as originally provided by Activision and is not applicable to normal wear and tear. This warranty shall not be applicable and shall be void if the defect has arisen through abuse, mistreatment, or neglect.
EXCEPT AS SET FORTH ABOVE, THIS WARRANTY IS IN LIEU OF ALL OTHER WARRANTIES, WHETHER ORAL OR WRITTEN, EXPRESS OR IMPLIED, INCLUDING ANY WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT, AND NO OTHER REPRESENTATIONS OR CLAIMS OF ANY KIND SHALL BE BINDING ON OR OBLIGATE ACTIVISION.
When returning the Software for warranty replacement, the original Software disks must be sent only in protective packaging and include: (1) photocopy of your dated sales receipt; (2) your name and return address typed or clearly printed; (3) a brief note describing the defect, the problem(s) you are encountering, and the system on which you are running the Software; and (4) if you are returning the Software after the ninety (90) day warranty period, but within one (1) year after the date of purchase, please include check or money order for $10.00 U.S. (A$19 for Australia, or £10.00 for Europe) currency per CD or floppy disk replacement. Note: Certified mail recommended.
In the United States, send to:
Warranty Replacements
Activision, Inc.
P.O. Box 67713
Los Angeles, California 90067
In Europe, send to:
Warranty Replacements
Activision
Parliament House
St. Laurence Way
Slough, Berkshire SL1 2BW
United Kingdom
In Australia and Asia Pacific territories, send to:
Warranty Replacements
Activision
Level 5, 51 Rawson street
Epping, NSW 2121
Australia
9. Governing Law, Venue, Indemnity, and Liability Limitation. This Agreement shall be construed in accordance with and governed by the applicable laws of the State of Texas (but excluding conflicts of laws principles) and applicable United States federal law. Except as set forth below, exclusive venue for all litigation regarding this Agreement shall be in Dallas County, Texas, and you agree to submit to the jurisdiction of the federal and state courts in Dallas County, Texas, for any such litigation. Exclusive venue for all litigation involving Activision, but not involving Id Software, with regard to this Agreement shall be in Los Angeles County, California, and you agree to submit to the jurisdiction of the courts in Los Angeles, California, for any such litigation. You hereby agree to indemnify, defend and hold harmless Id Software and Activision and Id Software's and Activision's respective officers, employees, directors, agents, licensees (excluding you), sub-licensees (excluding you), successors, and assigns from and against all losses, lawsuits, damages, causes of action, and claims relating to and/or arising from the New Creations or the distribution or other use of the New Creations or relating to and/or arising from your breach of this Agreement. You agree that your unauthorized use of the Software Images, the Printed Materials, or the Software, or any part thereof, immediately and irreparably may damage Id Software such that Id Software could not be adequately compensated solely by a monetary award, and in such event, at Id Software's option, that Id Software shall be entitled to an injunctive order, in addition to all other available remedies, including a monetary award, to prohibit such unauthorized use without the necessity of Id Software posting bond or other security. IN ANY CASE, ID SOFTWARE, ACTIVISION, AND ID SOFTWARE AND ACTIVISION'S RESPECTIVE OFFICERS, EMPLOYEES, DIRECTORS, SHAREHOLDERS, REPRESENTATIVES, AGENTS, LICENSEES (EXCLUDING YOU), SUB-LICENSEES (EXCLUDING YOU), SUCCESSORS, AND ASSIGNS SHALL NOT BE LIABLE FOR LOSS OF DATA, LOSS OF PROFITS, LOST SAVINGS, SPECIAL, INCIDENTAL, CONSEQUENTIAL, INDIRECT OR PUNITIVE DAMAGES, OR ANY OTHER DAMAGES ARISING FROM ANY ALLEGED CLAIM FOR BREACH OF WARRANTY, BREACH OF CONTRACT, NEGLIGENCE, STRICT PRODUCT LIABILITY, OR OTHER LEGAL THEORY EVEN IF ID SOFTWARE, ACTIVISION, OR THEIR RESPECTIVE AGENT(S) HAVE BEEN ADVISED OF THE POSSIBILITY OF ANY SUCH DAMAGES, OR EVEN IF SUCH DAMAGES ARE FORESEEABLE, OR LIABLE FOR ANY CLAIM BY ANY OTHER PARTY. Some jurisdictions do not allow the exclusion or limitation of incidental or consequential damages, so the above limitation or exclusion may not apply to you. This section shall survive the cancellation or termination of this Agreement.
10. United States Government Restricted Rights. To the extent applicable, the United States Government shall have only those rights to use the Software and the Printed Materials as expressly stated and expressly limited and restricted in this Agreement, as provided in 48 C.F.R. §§ 227.7201 through 227.7204, inclusive.
11. General Provisions. Neither this Agreement nor any part or portion hereof shall be assigned or sublicensed by you. Id Software and Activision each may assign its respective rights under this Agreement in the assigning party's sole discretion. Should any provision of this Agreement be held to be void, invalid, unenforceable, or illegal by a court of competent jurisdiction, the validity and enforceability of the other provisions shall not be affected thereby. If any provision is determined to be unenforceable by a court of competent jurisdiction, you agree to a modification of such provision to provide for enforcement of the provision's intent, to the extent permitted by applicable law. Failure of Id Software or Activision to enforce any provision of this Agreement shall not constitute or be construed as a waiver of such provision or of the right to enforce such provision. IMMEDIATELY UPON YOUR FAILURE TO COMPLY WITH, OR YOUR BREACH OF ANY TERM OR PROVISION OF THIS AGREEMENT, YOUR LICENSE GRANTED HEREIN AND THIS AGREEMENT AUTOMATICALLY SHALL TERMINATE, WITHOUT NOTICE, AND ID SOFTWARE AND ACTIVISION MAY PURSUE ALL RELIEF AND REMEDIES AGAINST YOU THAT ARE AVAILABLE UNDER APPLICABLE LAW AND/OR THIS AGREEMENT. Immediately upon termination of this Agreement, any and all rights you are granted hereunder shall terminate, you shall have no right to use the Software, the Printed Materials, or the New Creations, in any manner, you immediately shall destroy all copies of the Software, the Printed Materials, and the New Creations in your possession, custody, or control, and all rights granted hereunder shall revert, without notice, to and be vested in Id Software.
YOU ACKNOWLEDGE THAT YOU HAVE READ THIS AGREEMENT, YOU UNDERSTAND THIS AGREEMENT, AND UNDERSTAND THAT BY CONTINUING THE INSTALLATION OF THE SOFTWARE, BY LOADING OR RUNNING THE SOFTWARE, OR BY PLACING OR COPYING THE SOFTWARE ONTO YOUR COMPUTER HARD DRIVE OR RAM, YOU AGREE TO BE BOUND BY THE TERMS AND CONDITIONS OF THIS AGREEMENT. YOU FURTHER AGREE THAT, EXCEPT FOR WRITTEN SEPARATE AGREEMENTS, IF ANY, AMONG ID SOFTWARE, ACTIVISION, AND YOU, THIS AGREEMENT IS A COMPLETE AND EXCLUSIVE STATEMENT OF THE RIGHTS AND LIABILITIES OF THE PARTIES HERETO, RELATING TO THE SUBJECT MATTER HEREOF. THIS AGREEMENT SUPERSEDES ALL PRIOR ORAL AGREEMENTS, PROPOSALS, OR UNDERSTANDINGS, AND ANY OTHER COMMUNICATIONS, IF ANY, AMONG ID SOFTWARE, ACTIVISION, AND YOU RELATING TO THE SUBJECT MATTER OF THIS AGREEMENT.

View File

@@ -0,0 +1,31 @@
DOOM III Linux Demo
===================
Minimum system requirements:
----------------------------
GNU/Linux system,
Pentium III, 1Ghz
256Mb RAM
Kernel 2.4, 2.6 is recommended
glibc 2.2.4 and up
3D card:
NV10 or R200 minimum hardware
OpenGL hardware acceleration
64 MB VRAM
sound card, OSS or Alsa, stereo sound and 5.1 are supported with both APIs
Alsa version 1.0.6 or above is required
Installation instructions:
--------------------------
By default, the setup will install the files to
/usr/local/games/doom3-demo
Start the demo with the command: doom3-demo
For troubleshooting and help, see:
http://zerowing.idsoftware.com/linux/

View File

@@ -0,0 +1,3 @@
#!/bin/sh
echo "If you read this, then something failed during the setup"
echo "See http://zerowing.idsoftware.com/linux/ for troubleshooting"

View File

@@ -0,0 +1,34 @@
#!/bin/sh
# create the wrapper
create_link()
{
echo "#!/bin/sh
# Needed to make symlinks/shortcuts work.
# the binaries must run with correct working directory
cd \"$1\"
export LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:.
exec ./$BINARY \"\$@\"
" > "$1/$TARGET"
chmod a+x "$1/$TARGET"
# and then we must symlink to this
# can't be done from setup.xml because it would symlink the binary
if [ -n "$SETUP_SYMLINKSPATH" ] && [ -d "$SETUP_SYMLINKSPATH" ]
then
# the symlink might already exists, in case we will remove it
if [ -h "$SETUP_SYMLINKSPATH/$TARGET" ]
then
echo "Removing existing $TARGET symlink"
rm "$SETUP_SYMLINKSPATH/$TARGET"
fi
echo "Installing symlink $SETUP_SYMLINKSPATH/$TARGET -> $1/$TARGET"
ln -s "$1/$TARGET" "$SETUP_SYMLINKSPATH/$TARGET"
fi
}
BINARY=doom.x86
TARGET=doom3-demo
create_link "$1"

View File

@@ -0,0 +1,24 @@
<?xml version="1.0" standalone="yes"?>
<install product="M4_PRODUCT" desc="M4_DESC" version="M4_VERSION" postinstall="sh setup.data/postinstall.sh &quot;$@&quot;" nouninstall="yes">
<eula>
License.txt
</eula>
<readme>
README
</readme>
M4_PRODUCT
<option required="true">
M4_DESC
<binary arch="any" libs="any" symlink="doom3-demo">
doom3-demo
</binary>
<binary arch="any" libs="any">
doom.x86
</binary>
<files>
demo
gamex86.so
M4_LDD
</files>
</option>
</install>

View File

@@ -0,0 +1,55 @@
DOOM 3 SOFTWARE DEVELOPMENT KIT
LIMITED USE LICENSE AGREEMENT
This DOOM 3 Software Development Kit Limited Use License Agreement (this "Agreement") is a legal agreement among you, the end-user, and Id Software, Inc. ("Id Software"). BY CONTINUING THE DOWNLOAD OR INSTALLATION OF THIS SOFTWARE DEVELOPMENT KIT (THE "SOFTWARE") FOR THE GAME PROGRAM ENTITLED DOOM 3, BY LOADING OR RUNNING THE SOFTWARE, OR BY PLACING OR COPYING THE SOFTWARE ONTO YOUR COMPUTER HARD DRIVE, COMPUTER RAM, OR OTHER STORAGE, YOU ARE AGREEING TO BE BOUND BY THE TERMS AND CONDITIONS OF THIS AGREEMENT. YOU ACKNOWLEDGE AND UNDERSTAND THAT IN ORDER TO OPERATE THE SOFTWARE, YOU MUST HAVE THE FULL VERSION OF THE ID SOFTWARE GAME ENTITLED DOOM 3 INSTALLED ON YOUR COMPUTER.
1. Grant of License. Subject to the terms and provisions of this Agreement and so long as you fully comply at all times with this Agreement, Id Software grants to you the non-exclusive and limited right to use the Software only in executable or object code form. The term "Software" includes all elements of the Software, including, without limitation, data files and screen displays. You are not receiving any ownership or proprietary right, title, or interest in or to the Software or the copyrights, trademarks, or other rights related thereto. For purposes of the first sentence of this Section, "use" means loading the Software into RAM and/or onto computer hard drive, as well as installation of the Software on a hard disk or other storage device, and means the uses permitted in Sections 2 and 5 hereinbelow. You agree that the Software will not be downloaded, shipped, transferred, exported or re-exported into any country in violation of the United States Export Administration Act (or any other law governing such matters) by you or anyone at your direction, and that you will not utilize and will not authorize anyone to utilize the Software in any other manner in violation of any applicable law. The Software shall not be downloaded or otherwise exported or re-exported into (or to a national or resident of) any country to which the United States has embargoed goods, or to anyone or into any country who/that are prohibited, by applicable law, from receiving such property. In exercising your limited rights hereunder, you shall comply, at all times, with all applicable laws, regulations, ordinances, and statutes. Id Software reserves all rights not granted in this Agreement, including, without limitation, all rights to Id Software's trademarks.
2. Permitted New Creations. Subject to the terms and provisions of this Agreement and so long as you fully comply at all times with this Agreement, Id Software grants to you the non-exclusive and limited right to use the Software to create for the software game DOOM 3 your own modifications (the "New Creations") that shall operate only with DOOM 3 (but not any demo, test, or other version of DOOM 3). You may include within the New Creations certain textures and other images (the "Software Images") from the Software. You shall not create any New Creations that infringe against any third-party right or that are libelous, defamatory, obscene, false, misleading, or otherwise illegal or unlawful. You agree that the New Creations will not be downloaded, shipped, transferred, exported, or re-exported into any country in violation of the United States Export Administration Act (or any other law governing such matters) by you or anyone at your direction, and that you will not utilize and will not authorize anyone to utilize the New Creations in any other manner in violation of any applicable law. The New Creations shall not be downloaded or otherwise exported or re-exported into (or to a national or resident of) any country to which the United States has embargoed goods or to anyone or into any country who/that are prohibited, by applicable law, from receiving such property. You shall not rent, sell, lease, lend, offer on a pay-per-play basis, or otherwise commercially exploit or commercially distribute the New Creations. You are permitted to distribute, without any cost or charge, the New Creations only to other end-users so long as such distribution is not infringing against any third-party right and otherwise is not illegal or unlawful. As noted below, in the event you commit any breach of this Agreement, your license and this Agreement automatically shall terminate, without notice.
3. Prohibitions with Regard to the Software. You, whether directly or indirectly, shall not do any of the following acts:
a. rent the Software;
b. sell the Software;
c. lease or lend the Software;
d. offer the Software on a pay-per-play basis;
e. distribute the Software (except as permitted under Section 5 hereinbelow);
f. in any other manner and through any medium whatsoever commercially exploit the Software or use the Software for any commercial purpose;
g. disassemble, reverse engineer, decompile, modify (except as permitted under Section 2 hereinabove) or alter the Software;
h. translate the Software;
i. reproduce or copy the Software (except as permitted under Section 5 hereinbelow);
j. publicly display the Software;
k. prepare or develop derivative works based upon the Software;
l. remove or alter any notices or other markings or legends, such as trademark or copyright notices, affixed on or within the Software; or
m. remove, alter, modify, disable, or reduce any of the anti-piracy measures contained in the Software or in DOOM 3, including, without limitation, measures relating to multiplayer play.
4. Prohibition against Cheat Programs. Any attempt by you, either directly or indirectly, to circumvent or bypass any element of the Software to gain any advantage in multiplayer play of the Software is a material breach of this Agreement. It is a material breach of this Agreement for you, whether directly or indirectly, to create, develop, copy, reproduce, distribute, or otherwise make any use of any software program or any modification to the Software ("Cheat Program") itself that enables or allows the user thereof to obtain an advantage or otherwise exploit another Software player or user when playing the Software against other players or users on a local area network, any other network, or on the Internet. Hacking into the executable of the Software, modification of the Software, or any other use of the Software in connection with the creation, development, or use of any such unauthorized Cheat Program is a material breach of this Agreement. Cheat Programs include, but are not limited to, programs that allow Software players or users to see through walls or other level geometry; programs that allow Software players or users to change their rate of speed outside the allowable limits of the Software; programs that crash either and/or other Software players, users, PC clients, or network servers; programs that automatically target other Software players or users (commonly referred to as "aimbots") that automatically simulate Software player or user input for the purpose of gaining an advantage over other Software players or users; or any other program or modification that functions in a similar capacity or allows any prohibited conduct.
In the event you breach this Section or otherwise breach this Agreement, your license and this Agreement automatically shall terminate, without notice, and you shall have no right to play the Software against other players or make any other use of the Software.
5. Permitted Distribution and Copying. So long as this Agreement accompanies each copy you make of the Software, and so long as you comply fully at all times with this Agreement, Id Software grants to you the non-exclusive and limited right to copy the Software and to distribute such copies of the Software free of charge for non-commercial purposes that shall include the free-of-charge distribution of copies of the Software as mounted on the covers of magazines; provided, however, you shall not copy or distribute the Software in any infringing manner or in any manner that violates any law or third-party right, and you shall not distribute the Software together with any material that infringes against any third-party right or that is libelous, defamatory, obscene, false, misleading, or otherwise illegal or unlawful. Subject to the terms and conditions of this Agreement, you also may: (i) download one (1) copy of the Software or copy the Software from the CD ROM on which you received your copy of the Software onto your computer RAM; (ii) copy the Software from your computer RAM onto your computer hard drive; and (iii) make one (1) "backup" or archival copy of the Software on one (1) hard disk. In exercising your limited rights hereunder, you shall comply at all times with all applicable laws, regulations, ordinances, and statutes. Id Software reserves all rights not granted in this Agreement. You shall not distribute the Software commercially unless you first enter into a separate contract with Id Software, on terms and conditions determined in Id Software's sole discretion, and only upon your receipt of a written agreement executed by an authorized officer of Id Software.
6. Intellectual Property Rights. The Software and all copyrights, trademarks, and all other conceivable intellectual property rights related to the Software are owned by Id Software and are protected by United States copyright laws, international treaty provisions, and all applicable law, such as the Lanham Act. You must treat the Software like any other copyrighted material, as required by 17 U.S.C. § 101 et seq. and other applicable law. You agree to use your best efforts to see that any user of the Software licensed hereunder or the New Creations complies with this Agreement. You agree that you are receiving a copy of the Software by limited license only and not by sale and that the "first sale" doctrine of 17 U.S.C. § 109 does not apply to your receipt or use of the Software. This Section shall survive the cancellation or termination of this Agreement.
7. NO ID SOFTWARE WARRANTIES. ID SOFTWARE DISCLAIMS ALL WARRANTIES, WHETHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, AND ANY WARRANTY OF NON-INFRINGEMENT, WITH RESPECT TO THE SOFTWARE, THE SOFTWARE IMAGES, AND OTHERWISE. THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY. ID SOFTWARE DOES NOT WARRANT THAT THE SOFTWARE OR THE OPERATION OF THE SOFTWARE WILL BE UNINTERRUPTED OR ERROR-FREE OR THAT THE SOFTWARE WILL MEET YOUR SPECIFIC OR SPECIAL REQUIREMENTS. ADDITIONAL STATEMENTS, WHETHER ORAL OR WRITTEN, DO NOT CONSTITUTE WARRANTIES BY ID SOFTWARE AND SHOULD NOT BE RELIED UPON. This Section shall survive the cancellation or termination of this Agreement.
8. Governing Law, Venue, Indemnity, and Liability Limitation. This Agreement shall be construed in accordance with and governed by the applicable laws of the State of Texas (but excluding conflicts of laws principles) and applicable United States federal law. Except as set forth below, exclusive venue for all litigation regarding this Agreement shall be in Dallas County, Texas, and you agree to submit to the jurisdiction of the federal and state courts in Dallas County, Texas, for any such litigation. You hereby agree to indemnify, defend and hold harmless Id Software and Id Software's officers, employees, directors, agents, licensees (excluding you), sub-licensees (excluding you), successors, and assigns from and against all losses, lawsuits, damages, causes of action, and claims relating to and/or arising from the New Creations or the distribution or other use of the New Creations or relating to and/or arising from your breach of this Agreement. You agree that your unauthorized use of the Software Images or the Software, or any part thereof, immediately and irreparably may damage Id Software such that Id Software could not be adequately compensated solely by a monetary award, and in such event, at Id Software's option, that Id Software shall be entitled to an injunctive order, in addition to all other available remedies, including a monetary award, to prohibit such unauthorized use without the necessity of Id Software posting bond or other security. IN ANY CASE, ID SOFTWARE AND ID SOFTWARE'S OFFICERS, EMPLOYEES, DIRECTORS, SHAREHOLDERS, REPRESENTATIVES, AGENTS, LICENSEES (EXCLUDING YOU), SUB-LICENSEES (EXCLUDING YOU), SUCCESSORS, AND ASSIGNS SHALL NOT BE LIABLE FOR LOSS OF DATA, LOSS OF PROFITS, LOST SAVINGS, SPECIAL, INCIDENTAL, CONSEQUENTIAL, INDIRECT OR PUNITIVE DAMAGES, OR ANY OTHER DAMAGES ARISING FROM ANY ALLEGED CLAIM FOR BREACH OF WARRANTY, BREACH OF CONTRACT, NEGLIGENCE, STRICT PRODUCT LIABILITY, OR OTHER LEGAL THEORY EVEN IF ID SOFTWARE OR ITS RESPECTIVE AGENT(S) HAVE BEEN ADVISED OF THE POSSIBILITY OF ANY SUCH DAMAGES, OR EVEN IF SUCH DAMAGES ARE FORESEEABLE, OR LIABLE FOR ANY CLAIM BY ANY OTHER PARTY. Some jurisdictions do not allow the exclusion or limitation of incidental or consequential damages, so the above limitation or exclusion may not apply to you. This Section shall survive the cancellation or termination of this Agreement.
9. United States Government Restricted Rights. To the extent applicable, the United States Government shall have only those rights to use the Software as expressly stated and expressly limited and restricted in this Agreement, as provided in 48 C.F.R. §§ 227.7201 through 227.7204, inclusive.
10. General Provisions. Neither this Agreement nor any part or portion hereof shall be assigned or sublicensed by you. Id Software may assign its rights under this Agreement in its sole discretion. Should any provision of this Agreement be held to be void, invalid, unenforceable, or illegal by a court of competent jurisdiction, the validity and enforceability of the other provisions shall not be affected thereby. If any provision is determined to be unenforceable by a court of competent jurisdiction, you agree to a modification of such provision to provide for enforcement of the provision's intent, to the extent permitted by applicable law. Failure of Id Software to enforce any provision of this Agreement shall not constitute or be construed as a waiver of such provision or of the right to enforce such provision. IMMEDIATELY UPON YOUR FAILURE TO COMPLY WITH, OR YOUR BREACH OF ANY TERM OR PROVISION OF THIS AGREEMENT, YOUR LICENSE GRANTED HEREIN AND THIS AGREEMENT AUTOMATICALLY SHALL TERMINATE, WITHOUT NOTICE, AND ID SOFTWARE MAY PURSUE ALL RELIEF AND REMEDIES AGAINST YOU THAT ARE AVAILABLE UNDER APPLICABLE LAW AND/OR THIS AGREEMENT. Immediately upon termination of this Agreement, any and all rights you are granted hereunder shall terminate, you shall have no right to use the Software or the New Creations, in any manner, you immediately shall destroy all copies of the Software and the New Creations in your possession, custody, or control, and all rights granted hereunder shall revert, without notice, to and be vested in Id Software.
YOU ACKNOWLEDGE THAT YOU HAVE READ THIS AGREEMENT, YOU UNDERSTAND THIS AGREEMENT, AND YOU UNDERSTAND THAT, BY CONTINUING THE DOWNLOAD OR INSTALLATION OF THE SOFTWARE, BY LOADING OR RUNNING THE SOFTWARE, OR BY PLACING OR COPYING THE SOFTWARE ONTO YOUR COMPUTER HARD DRIVE, COMPUTER RAM, OR OTHER STORAGE, YOU AGREE TO BE BOUND BY THE TERMS AND CONDITIONS OF THIS AGREEMENT. YOU FURTHER AGREE THAT, EXCEPT FOR WRITTEN, SEPARATE AGREEMENTS, IF ANY, BETWEEN ID AND YOU, THIS AGREEMENT IS A COMPLETE AND EXCLUSIVE STATEMENT OF THE RIGHTS AND LIABILITIES OF THE PARTIES HERETO RELATING TO THE SUBJECT MATTER HEREOF. THIS AGREEMENT SUPERSEDES ALL PRIOR ORAL AGREEMENTS, PROPOSALS, OR UNDERSTANDINGS, AND ANY OTHER COMMUNICATIONS, IF ANY, BETWEEN ID AND YOU RELATING TO THE SUBJECT MATTER OF THIS AGREEMENT.

View File

@@ -0,0 +1,21 @@
DOOM III Linux SDK
==================
The DOOM build system is based on scons ( a make replacement )
http://www.scons.org/
packages are available for most recent distributions
To build, invoke scons from the src/ directory
use 'scons -h' for build configuration options
scons 0.96 or newer is required for build
Release 1.3.1 is compiled with gcc 4.0. Note that you can specify the compiler by setting CC and CXX on the command line. If you use a different gcc release line than 4.x, you may run into ABI issues.
Links
-----
Doom III Linux FAQ:
http://zerowing.idsoftware.com/linux/doom/
Doom III mod developement resources:
http://www.iddevnet.com/

View File

@@ -0,0 +1,17 @@
#
# Use this script to customize the installer bootstrap script
#
# override some defaults
# try to get root prior to running setup?
# 0: no
# 1: prompt, but run anyway if fails
# 2: require, abort if root fails
GET_ROOT=0
FATAL_ERROR="Error running installer. See http://zerowing.idsoftware.com/linux/ for troubleshooting"
#XSU_ICON="-i icon.xpm"
#SU_MESSAGE="It is recommended to run this installation as root.\nPlease enter the root password, or hit return to continue as user"

View File

@@ -0,0 +1,19 @@
<?xml version="1.0" standalone="yes"?>
<install product="doom3-sdk" desc="DOOM III SDK" version="M4_VERSION" nouninstall="yes">
<eula>
License.SDK.txt
</eula>
<readme>
README.SDK.txt
</readme>
doom3-sdk
<option required="true">
DOOM III SDK
<files>
MayaSetupStuff.zip
src
base
vehicles
</files>
</option>
</install>

View File

@@ -0,0 +1,86 @@
DOOM 3 LIMITED USE SOFTWARE LICENSE AGREEMENT
This DOOM 3 Limited Use Software License Agreement (this "Agreement") is a legal agreement among you, the end-user, and Id Software, Inc. ("Id Software"), and Activision Publishing, Inc. ("Activision"). BY CONTINUING THE INSTALLATION OF THE FULL VERSION GAME PROGRAM ENTITLED DOOM 3 (THE "SOFTWARE"), BY LOADING OR RUNNING THE SOFTWARE, OR BY PLACING OR COPYING THE SOFTWARE ONTO YOUR COMPUTER HARD DRIVE, COMPUTER RAM OR OTHER STORAGE, YOU ARE AGREEING TO BE BOUND BY THE TERMS OF THIS AGREEMENT.
1. Grant of License. Subject to the terms and provisions of this Agreement and so long as you fully comply at all times with this Agreement, Id Software grants to you the non-exclusive and limited right to use the Software only in executable or object code form. The term "Software" includes all elements of the Software, including, without limitation, data files and screen displays. You are not receiving any ownership or proprietary right, title, or interest in or to the Software or the copyrights, trademarks, or other rights related thereto. For purposes of the first sentence of this section, "use" means loading the Software into RAM and/or onto computer hard drive, as well as installation of the Software on a hard disk or other storage device, and means the uses permitted in sections 2 and 4 hereinbelow. You agree that the Software will not be downloaded, shipped, transferred, exported or re exported into any country in violation of the United States Export Administration Act (or any other law governing such matters) by you or anyone at your direction, and that you will not utilize and will not authorize anyone to utilize the Software in any other manner in violation of any applicable law. The Software shall not be downloaded or otherwise exported or re exported into (or to a national or resident of) any country to which the United States has embargoed goods, or to anyone or into any country who/that are prohibited, by applicable law, from receiving such property. In exercising your limited rights hereunder, you shall comply, at all times, with all applicable laws, regulations, ordinances, and statutes. Id Software reserves all rights not granted in this Agreement, including, without limitation, all rights to Id Software's trademarks.
2. Permitted New Creations. Subject to the terms and provisions of this Agreement and so long as you fully comply at all times with this Agreement, Id Software grants to you the non-exclusive and limited right to create for the Software (except any Software code) your own modifications (the "New Creations") that shall operate only with the Software (but not any demo, test, or other version of the Software). You may include within the New Creations certain textures and other images (the "Software Images") from the Software. You shall not create any New Creations that infringe against any third-party right or that are libelous, defamatory, obscene, false, misleading, or otherwise illegal or unlawful. You agree that the New Creations will not be downloaded, shipped, transferred, exported, or re exported into any country in violation of the United States Export Administration Act (or any other law governing such matters) by you or anyone at your direction, and that you will not utilize and will not authorize anyone to utilize the New Creations in any other manner in violation of any applicable law. The New Creations shall not be downloaded or otherwise exported or re exported into (or to a national or resident of) any country to which the United States has embargoed goods or to anyone or into any country who/that are prohibited, by applicable law, from receiving such property. You shall not rent, sell, lease, lend, offer on a pay-per-play basis, or otherwise commercially exploit or commercially distribute the New Creations. You are permitted to distribute, without any cost or charge, the New Creations only to other end-users so long as such distribution is not infringing against any third-party right and otherwise is not illegal or unlawful. As noted below, in the event you commit any breach of this Agreement, your license and this Agreement automatically shall terminate, without notice.
3. Prohibitions with Regard to the Software. You, whether directly or indirectly, shall not do any of the following acts:
a. rent the Software;
b. sell the Software;
c. lease or lend the Software;
d. offer the Software on a pay-per-play basis;
e. distribute the Software by any means, including, but not limited to, Internet or other electronic distribution, direct mail, retail, mail order, or other means;
f. in any other manner and through any medium whatsoever commercially exploit the Software or use the Software for any commercial purpose;
g. disassemble, reverse engineer, decompile, modify (except as permitted by section 2 hereinabove) or alter the Software;
h. translate the Software;
i. reproduce or copy the Software (except as permitted by section 4 hereinbelow);
j. publicly display the Software;
k. prepare or develop derivative works based upon the Software;
l. remove or alter any notices or other markings or legends, such as trademark or copyright notices, affixed on or within the Software or the Printed Materials (as defined in section 5 hereinbelow); or
m. remove, alter, modify, disable, or reduce any of the anti-piracy measures contained in the Software, including, without limitation, measures relating to multiplayer play.
4. Prohibition against Cheat Programs. Any attempt by you, either directly or indirectly, to circumvent or bypass any element of the Software to gain any advantage in multiplayer play of the Software is a material breach of this Agreement. It is a material breach of this Agreement for you, whether directly or indirectly, to create, develop, copy, reproduce, distribute, or otherwise make any use of any software program or any modification to the Software ("Cheat Program") itself that enables or allows the user thereof to obtain an advantage or otherwise exploit another Software player or user when playing the Software against other players or users on a local area network, any other network, or on the Internet. Hacking into the executable of the Software, modification of the Software, or any other use of the Software in connection with the creation, development, or use of any such unauthorized Cheat Program is a material breach of this Agreement. Cheat Programs include, but are not limited to, programs that allow Software players or users to see through walls or other level geometry; programs that allow Software players or users to change their rate of speed outside the allowable limits of the Software; programs that crash either and/or other Software players, users, PC clients, or network servers; programs that automatically target other Software players or users (commonly referred to as "aimbots") that automatically simulate Software player or user input for the purpose of gaining an advantage over other Software players or users; or any other program or modification that functions in a similar capacity or allows any prohibited conduct.
In the event you breach this section or otherwise breach this Agreement, your license and this Agreement automatically shall terminate, without notice, and you shall have no right to play the Software against other players or make any other use of the Software.
5. Permitted Copying. You may make only the following copies of the Software: (i) you may copy the Software from the CD ROM that you purchase onto your computer hard drive; (ii) you may copy the Software from your computer hard drive into your computer RAM; and (iii) you may make one (1) "back up" or archival copy of the Software on one (1) hard disk.
6. Intellectual Property Rights. Certain printed materials (the "Printed Materials") accompany the Software. The Software, the Printed Materials, and all copyrights, trademarks, and all other conceivable intellectual property rights related to the Software and the Printed Materials are owned by Id Software and are protected by United States copyright laws, international treaty provisions, and all applicable law, such as the Lanham Act. You must treat the Software and the Printed Materials like any other copyrighted material, as required by 17 U.S.C. § 101 et seq. and other applicable law. You agree to use your best efforts to see that any user of the Software licensed hereunder, the Printed Materials or the New Creations complies with this Agreement. You agree that you are receiving a copy of the Software and the Printed Materials by limited license only and not by sale and that the "first sale" doctrine of 17 U.S.C. § 109 does not apply to your receipt or use of the Software or the Printed Materials. This section shall survive the cancellation or termination of this Agreement.
7. NO ID SOFTWARE WARRANTIES. ID SOFTWARE DISCLAIMS ALL WARRANTIES, WHETHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, AND ANY WARRANTY OF NON-INFRINGEMENT, WITH RESPECT TO THE SOFTWARE, THE PRINTED MATERIALS, THE SOFTWARE IMAGES, AND OTHERWISE. THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY. ID SOFTWARE DOES NOT WARRANT THAT THE SOFTWARE OR THE OPERATION OF THE SOFTWARE WILL BE UNINTERRUPTED OR ERROR-FREE OR THAT THE SOFTWARE WILL MEET YOUR SPECIFIC OR SPECIAL REQUIREMENTS. ADDITIONAL STATEMENTS, WHETHER ORAL OR WRITTEN, DO NOT CONSTITUTE WARRANTIES BY ID SOFTWARE AND SHOULD NOT BE RELIED UPON. This section shall survive the cancellation or termination of this Agreement.
8. Limited Activision Warranty. Activision warrants to the original consumer purchaser of the Software that the recording medium on which the Software is recorded will be free from defects in material and workmanship for ninety (90) days from the date of purchase. If the recording medium is found defective within ninety (90) days of original purchase, Activision agrees to replace, free of charge, any Software discovered to be defective within such period upon its receipt of the Software, postage paid, with the proof of the date of purchase, as long as the Software still is being manufactured by Activision. In the event that the Software no longer is available, Activision retains the right to substitute a similar game program of equal or greater value. This warranty is limited to the recording medium containing the Software as originally provided by Activision and is not applicable to normal wear and tear. This warranty shall not be applicable and shall be void if the defect has arisen through abuse, mistreatment, or neglect.
EXCEPT AS SET FORTH ABOVE, THIS WARRANTY IS IN LIEU OF ALL OTHER WARRANTIES, WHETHER ORAL OR WRITTEN, EXPRESS OR IMPLIED, INCLUDING ANY WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT, AND NO OTHER REPRESENTATIONS OR CLAIMS OF ANY KIND SHALL BE BINDING ON OR OBLIGATE ACTIVISION.
When returning the Software for warranty replacement, the original Software disks must be sent only in protective packaging and include: (1) photocopy of your dated sales receipt; (2) your name and return address typed or clearly printed; (3) a brief note describing the defect, the problem(s) you are encountering, and the system on which you are running the Software; and (4) if you are returning the Software after the ninety (90) day warranty period, but within one (1) year after the date of purchase, please include check or money order for $10.00 U.S. (A$19 for Australia, or £10.00 for Europe) currency per CD or floppy disk replacement. Note: Certified mail recommended.
In the United States, send to:
Warranty Replacements
Activision, Inc.
P.O. Box 67713
Los Angeles, California 90067
In Europe, send to:
Warranty Replacements
Activision
Parliament House
St. Laurence Way
Slough, Berkshire SL1 2BW
United Kingdom
In Australia and Asia Pacific territories, send to:
Warranty Replacements
Activision
Level 5, 51 Rawson street
Epping, NSW 2121
Australia
9. Governing Law, Venue, Indemnity, and Liability Limitation. This Agreement shall be construed in accordance with and governed by the applicable laws of the State of Texas (but excluding conflicts of laws principles) and applicable United States federal law. Except as set forth below, exclusive venue for all litigation regarding this Agreement shall be in Dallas County, Texas, and you agree to submit to the jurisdiction of the federal and state courts in Dallas County, Texas, for any such litigation. Exclusive venue for all litigation involving Activision, but not involving Id Software, with regard to this Agreement shall be in Los Angeles County, California, and you agree to submit to the jurisdiction of the courts in Los Angeles, California, for any such litigation. You hereby agree to indemnify, defend and hold harmless Id Software and Activision and Id Software's and Activision's respective officers, employees, directors, agents, licensees (excluding you), sub-licensees (excluding you), successors, and assigns from and against all losses, lawsuits, damages, causes of action, and claims relating to and/or arising from the New Creations or the distribution or other use of the New Creations or relating to and/or arising from your breach of this Agreement. You agree that your unauthorized use of the Software Images, the Printed Materials, or the Software, or any part thereof, immediately and irreparably may damage Id Software such that Id Software could not be adequately compensated solely by a monetary award, and in such event, at Id Software's option, that Id Software shall be entitled to an injunctive order, in addition to all other available remedies, including a monetary award, to prohibit such unauthorized use without the necessity of Id Software posting bond or other security. IN ANY CASE, ID SOFTWARE, ACTIVISION, AND ID SOFTWARE AND ACTIVISION'S RESPECTIVE OFFICERS, EMPLOYEES, DIRECTORS, SHAREHOLDERS, REPRESENTATIVES, AGENTS, LICENSEES (EXCLUDING YOU), SUB-LICENSEES (EXCLUDING YOU), SUCCESSORS, AND ASSIGNS SHALL NOT BE LIABLE FOR LOSS OF DATA, LOSS OF PROFITS, LOST SAVINGS, SPECIAL, INCIDENTAL, CONSEQUENTIAL, INDIRECT OR PUNITIVE DAMAGES, OR ANY OTHER DAMAGES ARISING FROM ANY ALLEGED CLAIM FOR BREACH OF WARRANTY, BREACH OF CONTRACT, NEGLIGENCE, STRICT PRODUCT LIABILITY, OR OTHER LEGAL THEORY EVEN IF ID SOFTWARE, ACTIVISION, OR THEIR RESPECTIVE AGENT(S) HAVE BEEN ADVISED OF THE POSSIBILITY OF ANY SUCH DAMAGES, OR EVEN IF SUCH DAMAGES ARE FORESEEABLE, OR LIABLE FOR ANY CLAIM BY ANY OTHER PARTY. Some jurisdictions do not allow the exclusion or limitation of incidental or consequential damages, so the above limitation or exclusion may not apply to you. This section shall survive the cancellation or termination of this Agreement.
10. United States Government Restricted Rights. To the extent applicable, the United States Government shall have only those rights to use the Software and the Printed Materials as expressly stated and expressly limited and restricted in this Agreement, as provided in 48 C.F.R. §§ 227.7201 through 227.7204, inclusive.
11. General Provisions. Neither this Agreement nor any part or portion hereof shall be assigned or sublicensed by you. Id Software and Activision each may assign its respective rights under this Agreement in the assigning party's sole discretion. Should any provision of this Agreement be held to be void, invalid, unenforceable, or illegal by a court of competent jurisdiction, the validity and enforceability of the other provisions shall not be affected thereby. If any provision is determined to be unenforceable by a court of competent jurisdiction, you agree to a modification of such provision to provide for enforcement of the provision's intent, to the extent permitted by applicable law. Failure of Id Software or Activision to enforce any provision of this Agreement shall not constitute or be construed as a waiver of such provision or of the right to enforce such provision. IMMEDIATELY UPON YOUR FAILURE TO COMPLY WITH, OR YOUR BREACH OF ANY TERM OR PROVISION OF THIS AGREEMENT, YOUR LICENSE GRANTED HEREIN AND THIS AGREEMENT AUTOMATICALLY SHALL TERMINATE, WITHOUT NOTICE, AND ID SOFTWARE AND ACTIVISION MAY PURSUE ALL RELIEF AND REMEDIES AGAINST YOU THAT ARE AVAILABLE UNDER APPLICABLE LAW AND/OR THIS AGREEMENT. Immediately upon termination of this Agreement, any and all rights you are granted hereunder shall terminate, you shall have no right to use the Software, the Printed Materials, or the New Creations, in any manner, you immediately shall destroy all copies of the Software, the Printed Materials, and the New Creations in your possession, custody, or control, and all rights granted hereunder shall revert, without notice, to and be vested in Id Software.
YOU ACKNOWLEDGE THAT YOU HAVE READ THIS AGREEMENT, YOU UNDERSTAND THIS AGREEMENT, AND UNDERSTAND THAT BY CONTINUING THE INSTALLATION OF THE SOFTWARE, BY LOADING OR RUNNING THE SOFTWARE, OR BY PLACING OR COPYING THE SOFTWARE ONTO YOUR COMPUTER HARD DRIVE OR RAM, YOU AGREE TO BE BOUND BY THE TERMS AND CONDITIONS OF THIS AGREEMENT. YOU FURTHER AGREE THAT, EXCEPT FOR WRITTEN SEPARATE AGREEMENTS, IF ANY, AMONG ID SOFTWARE, ACTIVISION, AND YOU, THIS AGREEMENT IS A COMPLETE AND EXCLUSIVE STATEMENT OF THE RIGHTS AND LIABILITIES OF THE PARTIES HERETO, RELATING TO THE SUBJECT MATTER HEREOF. THIS AGREEMENT SUPERSEDES ALL PRIOR ORAL AGREEMENTS, PROPOSALS, OR UNDERSTANDINGS, AND ANY OTHER COMMUNICATIONS, IF ANY, AMONG ID SOFTWARE, ACTIVISION, AND YOU RELATING TO THE SUBJECT MATTER OF THIS AGREEMENT.

View File

@@ -0,0 +1,53 @@
DOOM III Linux
==============
Minimum system requirements:
----------------------------
GNU/Linux system,
Pentium III, 1Ghz
256Mb RAM
Kernel 2.4, 2.6 is recommended
glibc 2.2.4 and up
3D card:
NV10 or R200 minimum hardware
OpenGL hardware acceleration
64 MB VRAM
sound card, OSS or Alsa, stereo sound and 5.1 are supported with both APIs
Alsa version 1.0.6 or above is required
A licensed copy of Doom III retail for Windows
In order to play the additional Resurrection of Evil Expansion Pack, a licensed copy of the Expansion Pack for Windows
Installation instructions:
--------------------------
The following files need to be copied from the win32 install CDs
to your base/ directory ( md5 sums provided below as reference )
by default, /usr/local/games/doom3/base
71b8d37b2444d3d86a36fd61783844fe base/pak000.pk4
4bc4f3ba04ec2b4f4837be40e840a3c1 base/pak001.pk4
fa84069e9642ad9aa4b49624150cc345 base/pak002.pk4
f22d8464997924e4913e467e7d62d5fe base/pak003.pk4
38561a3c73f93f2e6fd31abf1d4e9102 base/pak004.pk4
If you are also installing the Resurrection of Evil Expansion Pack,
you need to copy the following file to your d3xp/ directory
by default, /usr/local/games/doom3/d3xp
a883fef0fd10aadeb73d34c462ff865d d3xp/pak000.pk4
Localization is not supported on Linux ( only english ), you should not copy over any of the zpak files.
Start the game with the command: doom3
Start the dedicated server with the command: doom3-dedicated
If installed, you can start the Expansion Pack directly from the command line with the command: doom3 +set fs_game d3xp
Or you can select it in the mods menu of the base game.
For troubleshooting and help, see:
http://zerowing.idsoftware.com/linux/

View File

@@ -0,0 +1,3 @@
#!/bin/sh
echo "If you read this, then something failed during the setup"
echo "See http://zerowing.idsoftware.com/linux/ for troubleshooting"

View File

@@ -0,0 +1,3 @@
#!/bin/sh
echo "If you read this, then something failed during the setup"
echo "See http://zerowing.idsoftware.com/linux/ for troubleshooting"

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

View File

@@ -0,0 +1,17 @@
#!/bin/sh
# opening URLs into your favorite web browser
# feel free to tweak this to your needs
if [ x`which firefox` != x ]
then
firefox "$1"
elif [ x`which mozilla` != x ]
then
mozilla "$1"
elif [ x`which opera` != x ]
then
opera "$1"
else
xterm -e lynx "$1"
fi

View File

@@ -0,0 +1,39 @@
#!/bin/sh
# create the wrapper
create_link()
{
echo "#!/bin/sh
# Needed to make symlinks/shortcuts work.
# the binaries must run with correct working directory
cd \"$1\"
export LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:.
exec ./$BINARY \"\$@\"
" > "$1/$TARGET"
chmod a+x "$1/$TARGET"
# and then we must symlink to this
# can't be done from setup.xml because it would symlink the binary
if [ -n "$SETUP_SYMLINKSPATH" ] && [ -d "$SETUP_SYMLINKSPATH" ]
then
# the symlink might already exists, in case we will remove it
if [ -h "$SETUP_SYMLINKSPATH/$TARGET" ]
then
echo "Removing existing $TARGET symlink"
rm "$SETUP_SYMLINKSPATH/$TARGET"
fi
echo "Installing symlink $SETUP_SYMLINKSPATH/$TARGET -> $1/$TARGET"
ln -s "$1/$TARGET" "$SETUP_SYMLINKSPATH/$TARGET"
fi
}
BINARY=doom.x86
TARGET=doom3
create_link "$1"
BINARY=doomded.x86
TARGET=doom3-dedicated
create_link "$1"
chmod +x "$1/openurl.sh"

View File

@@ -0,0 +1,42 @@
<?xml version="1.0" standalone="yes"?>
<install product="M4_PRODUCT" desc="M4_DESC" version="M4_VERSION" postinstall="sh setup.data/postinstall.sh &quot;$@&quot;" nouninstall="yes" nopromptoverwrite="yes">
<eula>
License.txt
</eula>
<readme>
README
</readme>
M4_PRODUCT
<option required="true">
M4_DESC
<binary arch="any" libs="any" symlink="doom3" icon="doom3.png" play="no">
doom3
</binary>
<binary arch="any" libs="any" symlink="doom3-dedicated" icon="doom3.png" play="no">
doom3-dedicated
</binary>
<binary arch="any" libs="any" play="no">
doom.x86
doomded.x86
</binary>
<files>
base
d3xp
pb
M4_LDD
version.info
openurl.sh
doom3.png
CHANGES
</files>
</option>
<option install="true">
PunkBuster client/server files
<eula>
pb/PB_EULA.txt
</eula>
<files>
pb/
</files>
</option>
</install>

View File

@@ -0,0 +1,36 @@
? install
? to
? image/setup.data/bin
Index: Makefile.in
===================================================================
RCS file: /cvs/cvsroot/loki_setup/Makefile.in,v
retrieving revision 1.32
diff -u -r1.32 Makefile.in
--- Makefile.in 4 Aug 2004 03:12:34 -0000 1.32
+++ Makefile.in 9 Aug 2004 10:16:22 -0000
@@ -65,7 +65,8 @@
CARBON_LIBS = $(COMMON_LIBS) @LIBS@ @CARBON_LIBS@
CONSOLE_LIBS = $(LIBS) @CONSOLE_LIBS@
-all: do-plugins @DO_DIALOG@ setup setup.gtk uninstall xsu
+#all: do-plugins @DO_DIALOG@ setup setup.gtk uninstall xsu
+all: do-plugins @DO_DIALOG@ setup
testxml: testxml.o
$(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
@@ -139,6 +140,7 @@
ifeq ($(DYN_PLUGINS),true)
$(MAKE) -C plugins install
endif
+ mkdir -p install to image/setup.data/bin/$(os)/$(arch)/$(libc)
@if [ -d image/setup.data/bin/$(os)/$(arch)/$(libc) ]; then \
cp setup image/setup.data/bin/$(os)/$(arch); \
strip image/setup.data/bin/$(os)/$(arch)/setup; \
@@ -155,6 +157,7 @@
else \
echo No directory to copy the binary files to.; \
fi
+ echo installed to image/setup.data/bin/$(os)/$(arch)/$(libc)
install-image: all
ifeq ($(DYN_PLUGINS),true)

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,170 @@
--- loki_setup/CHANGES 2004-11-20 07:43:42.000000000 -0600
+++ loki_setup.zinx/CHANGES 2005-03-16 16:56:46.400205504 -0600
@@ -1,4 +1,6 @@
Current:
+Christopher Lais (Id Software) - Wed Mar 16 08:09:59 CST 2005
+ * Fix handling of invalid password in xsu
Ryan C. Gordon (icculus.org) - Sat Nov 20 08:42:16 EST 2004
* Minor carbon_ui tweaks and corrections to update function.
Ludwig Nussel - Wed Nov 10 14:21:21 PST 2004
--- loki_setup/xsu.c 2003-07-02 14:40:39.000000000 -0500
+++ loki_setup.zinx/xsu.c 2005-03-16 16:36:17.752988272 -0600
@@ -37,6 +37,7 @@
#include "xsu.h"
static int term = -1;
+static int term_status = 0;
static gint
exec_su_failed (gpointer user_data)
@@ -79,22 +80,25 @@
if ( sig == SIGCHLD && term > 0 ) {
int status;
pid_t pid = wait(&status);
+
+ close(term); term = -1;
+ term_status = status;
+
if ( WIFEXITED(status) ) {
#ifdef DEBUG
fprintf(stderr,"Child %d returned\n", pid);
#endif
- gtk_exit(WEXITSTATUS(status));
+ /* This is handled at the end of xsu_process */
+ return;
} else if ( WIFSIGNALED(status) ) {
#ifdef DEBUG
fprintf(stderr,"Xsu: subprocess %d has died from signal %d\n", pid, WTERMSIG(status));
#endif
gtk_exit(EXIT_ERROR);
+ } else {
+ fprintf(stderr, "Xsu: got SIGCHLD from %d for unknown reason (%08x)\n", pid, status);
+ gtk_exit(EXIT_ERROR);
}
- close(term); term = -1;
-
- while (gtk_events_pending ())
- gtk_main_iteration ();
- gtk_main_quit ();
}
}
@@ -135,22 +139,27 @@
gchar *buffer;
char *argv[6], c;
fd_set fds;
- struct timeval delay = { 0, 10*1000 }; /* 10 ms wait */
+ struct timeval delay;
#ifdef DEBUG
printf("void xsu_perform()\n");
#endif
+ gtk_widget_hide (gtk_xsu_window);
+
+ if (password == NULL)
+ return;
+
/* 0.2.1 *
Minor security fix. Password would remain in memory if we don't
clean the password textbox.
*/
- gtk_entry_set_text(GTK_ENTRY(gtk_password_textbox),"");
- gtk_widget_hide (gtk_xsu_window);
-
- if (password == NULL)
- return;
+ password_return = g_strdup_printf ("%s\n", password);
+ /* Technically, we aren't supposed to modify this, but it should
+ usually be OK because we're explicitly clearing it afterwards. */
+ memset (password, 0, strlen (password));
+ gtk_entry_set_text(GTK_ENTRY(gtk_password_textbox),"");
/* xsu 0.2.1 *
Option to set the DISPLAY environment
@@ -177,6 +186,9 @@
argv[2] = "-c";
argv[3] = buffer;
argv[4] = NULL;
+#ifdef DEBUG
+ fprintf(stderr, "%s %s -c %s\n", su_command, username, buffer);
+#endif
term = exec_program(su_command, argv);
/* We are not a gnome-application anymore but under control of su */
@@ -231,33 +243,65 @@
fprintf(stderr, "Got it!\n");
#endif
- /* Discard any remaining characters on stdin */
- for(;;) {
+ /* Slurp up any extra characters immediately after the password prompt,
+ because su might clear the buffer after we send the password if we
+ don't. */
+ for (;;) {
FD_ZERO(&fds);
FD_SET(term, &fds);
- if ( select(term+1, &fds, NULL, NULL, &delay) ) {
- if ( read(term, &c, 1) <= 0 )
- break;
+
+ delay.tv_sec = 0;
+ delay.tv_usec = 10*1000; /* 10 ms wait */
+
+ if (select(term+1, &fds, NULL, NULL, &delay) > 0) {
+ if (read(term, &c, 1) < 0)
+ break;
} else
break;
}
- password_return = g_strdup_printf ("%s\n", password);
#ifdef DEBUG
fprintf(stderr,"Sending password\n");
#endif
/* 0.2.2 *
Minor security fix, clear the password from memory
*/
- memset (password, 0, strlen (password));
if ( write(term, password_return, strlen(password_return)) < 0 ) {
perror("write");
}
+
memset (password_return, 0, strlen (password_return));
g_free (password_return); password_return = NULL;
- g_free (password); password = NULL;
- //gtk_main();
+ /* Eat up any output, and wait for a SIGCHLD saying su exited */
+ while (term >= 0) {
+ FD_ZERO(&fds);
+ FD_SET(term, &fds);
+
+ delay.tv_sec = 0;
+ delay.tv_usec = 10*1000; /* 10 ms wait */
+
+ if ( select(term+1, &fds, NULL, NULL, &delay) > 0 ) {
+ read(term, &c, 1);
+#ifdef DEBUG
+ fprintf(stderr, "read from pty: %02x\n", c);
+#endif
+ }
+
+ while (gtk_events_pending ())
+ gtk_main_iteration ();
+ }
+
+ if (WIFEXITED(term_status) && WEXITSTATUS(term_status)) {
+ /* su failed, so ask for the password again */
+#ifdef DEBUG
+ fprintf(stderr, "returning control to gtk\n");
+#endif
+ gtk_widget_show (gtk_xsu_window);
+ } else {
+ /* Exit normally */
+ gtk_main_quit();
+ }
}

View File

@@ -0,0 +1,341 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) 19yy <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
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
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) 19yy name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
Public License instead of this License.

View File

@@ -0,0 +1,307 @@
The following was generated from http://www.megastep.org/makeself/
-----------------------
makeself - Make self-extractable archives on Unix
[1]makeself.sh is a small shell script that generates a
self-extractable tar.gz archive from a directory. The resulting file
appears as a shell script (many of those have a .run suffix), and can
be launched as is. The archive will then uncompress itself to a
temporary directory and an optional arbitrary command will be executed
(for example an installation script). This is pretty similar to
archives generated with WinZip Self-Extractor in the Windows world.
Makeself archives also include checksums for integrity self-validation
(CRC and/or MD5 checksums).
The makeself.sh script itself is used only to create the archives from
a directory of files. The resultant archive is actually a compressed
(using gzip, bzip2, or compress) TAR archive, with a small shell
script stub at the beginning. This small stub performs all the steps
of extracting the files, running the embedded command, and removing
the temporary files when it's all over. All what the user has to do to
install the software contained in such an archive is to "run" the
archive, i.e sh nice-software.run. I recommend using the "run" (which
was introduced by some Makeself archives released by Loki Software) or
"sh" suffix for such archives not to confuse the users, since they
know it's actually shell scripts (with quite a lot of binary data
attached to it though!).
I am trying to keep the code of this script as portable as possible,
i.e it's not relying on any bash-specific features and only calls
commands that are installed on any functioning UNIX-compatible system.
This script as well as the archives it generates should run on any
Unix flavor, with any compatible Bourne shell, provided of course that
the compression programs are available.
As of version 2.1, Makeself has been rewritten and tested on the
following platforms :
* Linux (all distributions)
* Sun Solaris (8 tested)
* HP-UX (tested on 11.0 and 11i on HPPA RISC)
* SCO OpenUnix and OpenServer
* IBM AIX 5.1L
* MacOS X (Darwin)
* SGI IRIX 6.5
* FreeBSD
* UnicOS / Cray
If you successfully run Makeself and/or archives created with it on
another system, then [2]let me know!
Examples of publicly available archives made using makeself are :
* Game patches and installers for [3]Id Software games like Quake 3
for Linux or Return To Castle Wolfenstien ;
* All game patches released by [4]Loki Software for the Linux
version of popular games ;
* The [5]nVidia drivers for Linux
* The [6]Makeself distribution itself ;-)
* and countless others...
Important note for Apache users: By default, most Web servers will
think that Makeself archives are regular text files and thus they may
show up as text in a Web browser. The correct way to prevent this is
to add a MIME type for this file format, like so (in httpd.conf) :
AddType application/x-makeself .run
Important note for recent GNU/Linux distributions: Archives created
with Makeself prior to v2.1.2 were using an old syntax for the head
and tail Unix commands that is being progressively obsoleted in their
GNU forms. Therefore you may have problems uncompressing some of these
archives. A workaround for this is to set the environment variable
$_POSIX2_VERSION to enable the old syntax, i.e. :
export _POSIX2_VERSION=199209
Usage
The syntax of makeself is the following:
makeself.sh [args] archive_dir file_name label startup_script
[script_args]
* args are optional options for Makeself. The available ones are :
+ --version : Prints the version number on stdout, then exits
immediately
+ --gzip : Use gzip for compression (is the default on
platforms on which gzip is commonly available, like Linux)
+ --bzip2 : Use bzip2 instead of gzip for better compression.
The bzip2 command must be available in the command path. I
recommend that you set the prefix to something like
'.bz2.run' for the archive, so that potential users know that
they'll need bzip2 to extract it.
+ --compress : Use the UNIX "compress" command to compress the
data. This should be the default on all platforms that don't
have gzip available.
+ --nocomp : Do not use any compression for the archive, which
will then be an uncompressed TAR.
+ --notemp : The generated archive will not extract the files
to a temporary directory, but in a new directory created in
the current directory. This is better to distribute software
packages that may extract and compile by themselves (i.e.
launch the compilation through the embedded script).
+ --current : Files will be extracted to the current directory,
instead of in a subdirectory. This option implies --notemp
above.
+ --follow : Follow the symbolic links inside of the archive
directory, i.e. store the files that are being pointed to
instead of the links themselves.
+ --append (new in 2.1.x): Append data to an existing archive,
instead of creating a new one. In this mode, the settings
from the original archive are reused (compression type,
label, embedded script), and thus don't need to be specified
again on the command line.
+ --header : Makeself 2.0 uses a separate file to store the
header stub, called "makeself-header.sh". By default, it is
assumed that it is stored in the same location as
makeself.sh. This option can be used to specify its actual
location if it is stored someplace else.
+ --copy : Upon extraction, the archive will first extract
itself to a temporary directory. The main application of this
is to allow self-contained installers stored in a Makeself
archive on a CD, when the installer program will later need
to unmount the CD and allow a new one to be inserted. This
prevents "Filesystem busy" errors for installers that span
multiple CDs.
+ --nox11 : Disable the automatic spawning of a new terminal in
X11.
+ --nowait : When executed from a new X11 terminal, disable the
user prompt at the end of the script execution.
+ --nomd5 and --nocrc : Disable the creation of a MD5 / CRC
checksum for the archive. This speeds up the extraction
process if integrity checking is not necessary.
+ --lsm file : Provide and LSM file to makeself, that will be
embedded in the generated archive. LSM files are describing a
software package in a way that is easily parseable. The LSM
entry can then be later retrieved using the '-lsm' argument
to the archive. An exemple of a LSM file is provided with
Makeself.
* archive_dir is the name of the directory that contains the files
to be archived
* file_name is the name of the archive to be created
* label is an arbitrary text string describing the package. It will
be displayed while extracting the files.
* startup_script is the command to be executed from within the
directory of extracted files. Thus, if you wish to execute a
program contain in this directory, you must prefix your command
with "./". For example, ./program will be fine. The script_args
are additionnal arguments for this command.
Here is an example, assuming the user has a package image stored in a
/home/joe/mysoft, and he wants to generate a self-extracting package
named mysoft.sh, which will launch the "setup" script initially stored
in /home/joe/mysoft :
makeself.sh /home/joe/mysoft mysoft.sh "Joe's Nice Software Package"
./setup
Here is also how I created the [7]makeself.run archive which contains
the Makeself distribution :
makeself.sh --notemp makeself makeself.run "Makeself by Stephane
Peter" echo "Makeself has extracted itself"
Archives generated with Makeself 2.1 can be passed the following
arguments:
* --keep : Prevent the files to be extracted in a temporary
directory that will be removed after the embedded script's
execution. The files will then be extracted in the current working
directory and will stay here until you remove them.
* --verbose : Will prompt the user before executing the embedded
command
* --target dir : Allows to extract the archive in an arbitrary
place.
* --nox11 : Do not spawn a X11 terminal.
* --confirm : Prompt the user for confirmation before running the
embedded command.
* --info : Print out general information about the archive (does not
extract).
* --lsm : Print out the LSM entry, if it is present.
* --list : List the files in the archive.
* --check : Check the archive for integrity using the embedded
checksums. Does not extract the archive.
* --nochown : By default, a "chown -R" command is run on the target
directory after extraction, so that all files belong to the
current user. This is mostly needed if you are running as root, as
tar will then try to recreate the initial user ownerships. You may
disable this behavior with this flag.
* --tar : Run the tar command on the contents of the archive, using
the following arguments as parameter for the command.
* --noexec : Do not run the embedded script after extraction.
Any subsequent arguments to the archive will be passed as additional
arguments to the embedded command. You should explicitly use the --
special command-line construct before any such options to make sure
that Makeself will not try to interpret them.
License
Makeself is covered by the [8]GNU General Public License (GPL) version
2 and above. Archives generated by Makeself don't have to be placed
under this license (although I encourage it ;-)), since the archive
itself is merely data for Makeself.
Download
Get the latest official distribution [9]here (version 2.1.3).
The latest development version can be grabbed from the Loki Setup CVS
module, at [10]cvs.icculus.org.
Version history
* v1.0: Initial public release
* v1.1: The archive can be passed parameters that will be passed on
to the embedded script, thanks to John C. Quillan
* v1.2: Cosmetic updates, support for bzip2 compression and
non-temporary archives. Many ideas thanks to Francois Petitjean.
* v1.3: More patches from Bjarni R. Einarsson and Francois
Petitjean: Support for no compression (--nocomp), script is no
longer mandatory, automatic launch in an xterm, optional verbose
output, and -target archive option to indicate where to extract
the files.
* v1.4: Many patches from Francois Petitjean: improved UNIX
compatibility, automatic integrity checking, support of LSM files
to get info on the package at run time..
* v1.5.x: A lot of bugfixes, and many other patches, including
automatic verification through the usage of checksums. Version
1.5.5 was the stable release for a long time, even though the Web
page didn't get updated ;-). Makeself was also officially made a
part of the [11]Loki Setup installer, and its source is being
maintained as part of this package.
* v2.0: Complete internal rewrite of Makeself. The command-line
parsing was vastly improved, the overall maintenance of the
package was greatly improved by separating the stub from
makeself.sh. Also Makeself was ported and tested to a variety of
Unix platforms.
* v2.0.1: First public release of the new 2.0 branch. Prior versions
are officially obsoleted. This release introduced the '--copy'
argument that was introduced in response to a need for the
[12]UT2K3 Linux installer.
* v2.1.0: Big change : Makeself can now support multiple embedded
tarballs, each stored separately with their own checksums. An
existing archive can be updated with the --append flag. Checksums
are also better managed, and the --nochown option for archives
appeared.
* v2.1.1: Fixes related to the Unix compression (compress command).
Some Linux distributions made the insane choice to make it
unavailable, even though gzip is capable of uncompressing these
files, plus some more bugfixes in the extraction and checksum
code.
* v2.1.2: Some bug fixes. Use head -n to avoid problems with POSIX
conformance.
* v2.1.3: Bug fixes with the command line when spawning terminals.
Added --tar, --noexec for archives. Added --nomd5 and --nomd5 to
avoid creating checksums in archives. The embedded script is now
run through "eval". The --info output now includes the command
used to create the archive. A man page was contributed by Bartosz
Fenski.
Links
* Check out the [13]"Loki setup" installer, used to install many
Linux games and other applications, and of which I am the
co-author. Since the demise of Loki, I am now the official
maintainer of the project, and it is now being hosted on
[14]icculus.org, as well as a bunch of other ex-Loki projects (and
a lot of other good stuff!).
* Bjarni R. Einarsson also wrote the setup.sh installer script,
inspired by Makeself. [15]Check it out !
Contact
This script was written by [16]Stéphane Peter (megastep at
megastep.org) I welcome any enhancements and suggestions.
Contributions were included from John C. Quillan, Bjarni R. Einarsson,
Francois Petitjean, and Ryan C. Gordon, thanks to them! If you think I
forgot your name, don't hesitate to contact me.
icculus.org also has a [17]Bugzilla server available that allows bug
reports to be submitted for Loki setup, and since Makeself is a part
of Loki setup, you can submit bug reports from there!
_________________________________________________________________
[18]Stéphane Peter
Last modified: Sun May 2 00:08:49 PDT 2004
References
1. http://www.megastep.org/makeself/makeself.run
2. mailto:megastep@REMOVEME.megastep.org
3. http://www.idsoftware.com/
4. http://www.lokigames.com/products/myth2/updates.php3
5. http://www.nvidia.com/
6. http://www.megastep.org/makeself/makeself.run
7. http://www.megastep.org/makeself/makeself.run
8. http://www.gnu.org/copyleft/gpl.html
9. http://www.megastep.org/makeself/makeself-2.1.3.run
10. http://cvs.icculus.org/
11. http://www.icculus.org/loki_setup/
12. http://www.unrealtournament2003.com/
13. http://www.icculus.org/loki_setup/
14. http://www.icculus.org/
15. http://www.mmedia.is/~bre/programs/setup.sh/
16. mailto:megastep@@megastep.org
17. https://bugzilla.icculus.org/
18. mailto:megastep@@megastep.org

View File

@@ -0,0 +1,6 @@
What needs to be done next :
- Generic compression code (thru a user-defined command)
- Collect names of directories potentially containing md5 program. GUESS_MD5_PATH
Stéphane Peter <megastep@megastep.org>

View File

@@ -0,0 +1,373 @@
cat << EOF > "$archname"
#!/bin/sh
# This script was generated using Makeself $MS_VERSION
CRCsum="$CRCsum"
MD5="$MD5sum"
TMPROOT=\${TMPDIR:=/tmp}
label="$LABEL"
script="$SCRIPT"
scriptargs="$SCRIPTARGS"
targetdir="$archdirname"
filesizes="$filesizes"
keep=$KEEP
print_cmd_arg=""
if type printf > /dev/null; then
print_cmd="printf"
elif test -x /usr/ucb/echo; then
print_cmd="/usr/ucb/echo"
else
print_cmd="echo"
fi
MS_Printf()
{
\$print_cmd \$print_cmd_arg "\$1"
}
MS_Progress()
{
while read a; do
MS_Printf .
done
}
MS_dd()
{
blocks=\`expr \$3 / 1024\`
bytes=\`expr \$3 % 1024\`
dd if="\$1" ibs=\$2 skip=1 obs=1024 conv=sync 2> /dev/null | \\
{ test \$blocks -gt 0 && dd ibs=1024 obs=1024 count=\$blocks ; \\
test \$bytes -gt 0 && dd ibs=1 obs=1024 count=\$bytes ; } 2> /dev/null
}
MS_Help()
{
cat << EOH >&2
Makeself version $MS_VERSION
1) Getting help or info about \$0 :
\$0 --help Print this message
\$0 --info Print embedded info : title, default target directory, embedded script ...
\$0 --lsm Print embedded lsm entry (or no LSM)
\$0 --list Print the list of files in the archive
\$0 --check Checks integrity of the archive
2) Running \$0 :
\$0 [options] [--] [additional arguments to embedded script]
with following options (in that order)
--confirm Ask before running embedded script
--noexec Do not run embedded script
--keep Do not erase target directory after running
the embedded script
--nox11 Do not spawn an xterm
--nochown Do not give the extracted files to the current user
--target NewDirectory Extract in NewDirectory
--tar arg1 [arg2 ...] Access the contents of the archive through the tar command
-- Following arguments will be passed to the embedded script
EOH
}
MS_Check()
{
OLD_PATH=\$PATH
PATH=\${GUESS_MD5_PATH:-"\$OLD_PATH:/bin:/usr/bin:/sbin:/usr/local/ssl/bin:/usr/local/bin:/opt/openssl/bin"}
MD5_PATH=\`exec 2>&-; which md5sum || type md5sum\`
MD5_PATH=\${MD5_PATH:-\`exec 2>&-; which md5 || type md5\`}
PATH=\$OLD_PATH
MS_Printf "Verifying archive integrity..."
offset=\`head -n $SKIP "\$1" | wc -c | tr -d " "\`
verb=\$2
i=1
for s in \$filesizes
do
crc=\`echo \$CRCsum | cut -d" " -f\$i\`
if test -x "\$MD5_PATH"; then
md5=\`echo \$MD5 | cut -d" " -f\$i\`
if test \$md5 = "00000000000000000000000000000000"; then
test x\$verb = xy && echo " \$1 does not contain an embedded MD5 checksum." >&2
else
md5sum=\`MS_dd "\$1" \$offset \$s | "\$MD5_PATH" | cut -b-32\`;
if test "\$md5sum" != "\$md5"; then
echo "Error in MD5 checksums: \$md5sum is different from \$md5" >&2
exit 2
else
test x\$verb = xy && MS_Printf " MD5 checksums are OK." >&2
fi
crc="0000000000"; verb=n
fi
fi
if test \$crc = "0000000000"; then
test x\$verb = xy && echo " \$1 does not contain a CRC checksum." >&2
else
sum1=\`MS_dd "\$1" \$offset \$s | CMD_ENV=xpg4 cksum | awk '{print \$1}'\`
if test "\$sum1" = "\$crc"; then
test x\$verb = xy && MS_Printf " CRC checksums are OK." >&2
else
echo "Error in checksums: \$sum1 is different from \$crc"
exit 2;
fi
fi
i=\`expr \$i + 1\`
offset=\`expr \$offset + \$s\`
done
echo " All good."
}
UnTAR()
{
tar \$1vf - 2>&1 || { echo Extraction failed. > /dev/tty; kill -15 \$$; }
}
finish=true
xterm_loop=
nox11=$NOX11
copy=$COPY
ownership=y
verbose=n
initargs="\$@"
while true
do
case "\$1" in
-h | --help)
MS_Help
exit 0
;;
--info)
echo Identification: "\$label"
echo Target directory: "\$targetdir"
echo Uncompressed size: $USIZE KB
echo Compression: $COMPRESS
echo Date of packaging: $DATE
echo Built with Makeself version $MS_VERSION on $OSTYPE
echo Build command was: "$MS_COMMAND"
if test x\$script != x; then
echo Script run after extraction:
echo " " \$script \$scriptargs
fi
if test x"$copy" = xcopy; then
echo "Archive will copy itself to a temporary location"
fi
if test x"$KEEP" = xy; then
echo "directory \$targetdir is permanent"
else
echo "\$targetdir will be removed after extraction"
fi
exit 0
;;
--dumpconf)
echo LABEL=\"\$label\"
echo SCRIPT=\"\$script\"
echo SCRIPTARGS=\"\$scriptargs\"
echo archdirname=\"$archdirname\"
echo KEEP=$KEEP
echo COMPRESS=$COMPRESS
echo filesizes=\"\$filesizes\"
echo CRCsum=\"\$CRCsum\"
echo MD5sum=\"\$MD5\"
echo OLDUSIZE=$USIZE
echo OLDSKIP=`expr $SKIP + 1`
exit 0
;;
--lsm)
cat << EOLSM
EOF
eval "$LSM_CMD"
cat << EOF >> "$archname"
EOLSM
exit 0
;;
--list)
echo Target directory: \$targetdir
offset=\`head -n $SKIP "\$0" | wc -c | tr -d " "\`
for s in \$filesizes
do
MS_dd "\$0" \$offset \$s | eval "$GUNZIP_CMD" | UnTAR t
offset=\`expr \$offset + \$s\`
done
exit 0
;;
--tar)
offset=\`head -n $SKIP "\$0" | wc -c | tr -d " "\`
arg1="\$2"
shift 2
for s in \$filesizes
do
MS_dd "\$0" \$offset \$s | eval "$GUNZIP_CMD" | tar "\$arg1" - \$*
offset=\`expr \$offset + \$s\`
done
exit 0
;;
--check)
MS_Check "\$0" y
exit 0
;;
--confirm)
verbose=y
shift
;;
--noexec)
script=""
shift
;;
--keep)
keep=y
shift
;;
--target)
keep=y
targetdir=\${2:-.}
shift 2
;;
--nox11)
nox11=y
shift
;;
--nochown)
ownership=n
shift
;;
--xwin)
finish="echo Press Return to close this window...; read junk"
xterm_loop=1
shift
;;
--phase2)
copy=phase2
shift
;;
--)
shift
break ;;
-*)
echo Unrecognized flag : "\$1" >&2
MS_Help
exit 1
;;
*)
break ;;
esac
done
case "\$copy" in
copy)
tmpdir=\$TMPROOT/makeself.\$RANDOM.\`date +"%y%m%d%H%M%S"\`.\$\$
mkdir "\$tmpdir" || {
echo "Could not create temporary directory \$tmpdir" >&2
exit 1
}
SCRIPT_COPY="\$tmpdir/makeself"
echo "Copying to a temporary location..." >&2
cp "\$0" "\$SCRIPT_COPY"
chmod +x "\$SCRIPT_COPY"
cd "\$TMPROOT"
exec "\$SCRIPT_COPY" --phase2
;;
phase2)
finish="\$finish ; rm -rf \`dirname \$0\`"
;;
esac
if test "\$nox11" = "n"; then
if tty -s; then # Do we have a terminal?
:
else
if test x"\$DISPLAY" != x -a x"\$xterm_loop" = x; then # No, but do we have X?
if xset q > /dev/null 2>&1; then # Check for valid DISPLAY variable
GUESS_XTERMS="xterm rxvt dtterm eterm Eterm kvt konsole aterm"
for a in \$GUESS_XTERMS; do
if type \$a >/dev/null 2>&1; then
XTERM=\$a
break
fi
done
chmod a+x \$0 || echo Please add execution rights on \$0
if test \`echo "\$0" | cut -c1\` = "/"; then # Spawn a terminal!
exec \$XTERM -title "\$label" -e "\$0" --xwin "\$initargs"
else
exec \$XTERM -title "\$label" -e "./\$0" --xwin "\$initargs"
fi
fi
fi
fi
fi
if test "\$targetdir" = "."; then
tmpdir="."
else
if test "\$keep" = y; then
echo "Creating directory \$targetdir" >&2
tmpdir="\$targetdir"
dashp="-p"
else
tmpdir="\$TMPROOT/selfgz\$\$\$RANDOM"
dashp=""
fi
mkdir \$dashp \$tmpdir || {
echo 'Cannot create target directory' \$tmpdir >&2
echo 'You should try option --target OtherDirectory' >&2
eval \$finish
exit 1
}
fi
location="\`pwd\`"
if test x\$SETUP_NOCHECK != x1; then
MS_Check "\$0"
fi
offset=\`head -n $SKIP "\$0" | wc -c | tr -d " "\`
if test x"\$verbose" = xy; then
MS_Printf "About to extract $USIZE KB in \$tmpdir ... Proceed ? [Y/n] "
read yn
if test x"\$yn" = xn; then
eval \$finish; exit 1
fi
fi
MS_Printf "Uncompressing \$label"
res=3
if test "\$keep" = n; then
trap 'echo Signal caught, cleaning up >&2; cd \$TMPROOT; /bin/rm -rf \$tmpdir; eval \$finish; exit 15' 1 2 3 15
fi
for s in \$filesizes
do
if MS_dd "\$0" \$offset \$s | eval "$GUNZIP_CMD" | ( cd "\$tmpdir"; UnTAR x ) | MS_Progress; then
if test x"\$ownership" = xy; then
(PATH=/usr/xpg4/bin:\$PATH; cd "\$tmpdir"; chown -R \`id -u\` .; chgrp -R \`id -g\` .)
fi
else
echo
echo "Unable to decompress \$0" >&2
eval \$finish; exit 1
fi
offset=\`expr \$offset + \$s\`
done
echo
cd "\$tmpdir"
res=0
if test x"\$script" != x; then
if test x"\$verbose" = xy; then
MS_Printf "OK to execute: \$script \$scriptargs \$* ? [Y/n] "
read yn
if test x"\$yn" = x -o x"\$yn" = xy -o x"\$yn" = xY; then
eval \$script \$scriptargs \$*; res=\$?;
fi
else
eval \$script \$scriptargs \$*; res=\$?
fi
if test \$res -ne 0; then
test x"\$verbose" = xy && echo "The program '\$script' returned an error code (\$res)" >&2
fi
fi
if test "\$keep" = n; then
cd \$TMPROOT
/bin/rm -rf \$tmpdir
fi
eval \$finish; exit \$res
EOF

View File

@@ -0,0 +1,76 @@
.TH "makeself" "1" "2.1.3"
.SH "NAME"
makeself \- An utility to generate self-extractable archives.
.SH "SYNTAX"
.LP
.B makeself [\fIoptions\fP] archive_dir file_name label
.B [\fIstartup_script\fP] [\fIargs\fP]
.SH "DESCRIPTION"
.LP
This program is a free (GPL) utility designed to create self-extractable
archives from a directory.
.br
.SH "OPTIONS"
.LP
The following options are supported.
.LP
.TP 15
.B -v, --version
Prints out the makeself version number and exits.
.TP
.B -h, --help
Print out help information.
.TP
.B --gzip
Compress using gzip (default if detected).
.TP
.B --bzip2
Compress using bzip2.
.TP
.B --compress
Compress using the UNIX 'compress' command.
.TP
.B --nocomp
Do not compress the data.
.TP
.B --notemp
The archive will create archive_dir in the current directory and
uncompress in ./archive_dir.
.TP
.B --copy
Upon extraction, the archive will first copy itself to a temporary directory.
.TP
.B --append
Append more files to an existing makeself archive.
The label and startup scripts will then be ignored.
.TP
.B --current
Files will be extracted to the current directory. Implies --notemp.
.TP
.B --header file
Specify location of the header script.
.TP
.B --follow
Follow the symlinks in the archive.
.TP
.B --nox11
Disable automatic spawn of an xterm if running in X11.
.TP
.B --nowait
Do not wait for user input after executing embedded program from an xterm.
.TP
.B --nomd5
Do not create a MD5 checksum for the archive.
.TP
.B --nocrc
Do not create a CRC32 checksum for the archive.
.TP
.B --lsm file
LSM file describing the package.
.PD
.SH "AUTHORS"
.LP
Makeself has been written by Stéphane Peter <megastep@megastep.org>.
.BR
This man page was originally written by Bartosz Fenski <fenio@o2.pl> for the
Debian GNU/Linux distribution (but it may be used by others).

View File

@@ -0,0 +1,16 @@
Begin3
Title: makeself.sh
Version: 2.1
Description: makeself.sh is a shell script that generates a self-extractable
tar.gz archive from a directory. The resulting file appears as a shell
script, and can be launched as is. The archive will then uncompress
itself to a temporary directory and an arbitrary command will be
executed (for example an installation script). This is pretty similar
to archives generated with WinZip Self-Extractor in the Windows world.
Keywords: Installation archive tar winzip
Author: Stéphane Peter (megastep@megastep.org)
Maintained-by: Stéphane Peter (megastep@megastep.org)
Original-site: http://www.megastep.org/makeself/
Platform: Unix
Copying-policy: GPL
End

View File

@@ -0,0 +1,374 @@
#!/bin/sh
#
# Makeself version 2.1.x
# by Stephane Peter <megastep@megastep.org>
#
# $Id: makeself.sh,v 1.51 2004/09/07 22:16:53 megastep Exp $
#
# Utility to create self-extracting tar.gz archives.
# The resulting archive is a file holding the tar.gz archive with
# a small Shell script stub that uncompresses the archive to a temporary
# directory and then executes a given script from withing that directory.
#
# Makeself home page: http://www.megastep.org/makeself/
#
# Version 2.0 is a rewrite of version 1.0 to make the code easier to read and maintain.
#
# Version history :
# - 1.0 : Initial public release
# - 1.1 : The archive can be passed parameters that will be passed on to
# the embedded script, thanks to John C. Quillan
# - 1.2 : Package distribution, bzip2 compression, more command line options,
# support for non-temporary archives. Ideas thanks to Francois Petitjean
# - 1.3 : More patches from Bjarni R. Einarsson and Francois Petitjean:
# Support for no compression (--nocomp), script is no longer mandatory,
# automatic launch in an xterm, optional verbose output, and -target
# archive option to indicate where to extract the files.
# - 1.4 : Improved UNIX compatibility (Francois Petitjean)
# Automatic integrity checking, support of LSM files (Francois Petitjean)
# - 1.5 : Many bugfixes. Optionally disable xterm spawning.
# - 1.5.1 : More bugfixes, added archive options -list and -check.
# - 1.5.2 : Cosmetic changes to inform the user of what's going on with big
# archives (Quake III demo)
# - 1.5.3 : Check for validity of the DISPLAY variable before launching an xterm.
# More verbosity in xterms and check for embedded command's return value.
# Bugfix for Debian 2.0 systems that have a different "print" command.
# - 1.5.4 : Many bugfixes. Print out a message if the extraction failed.
# - 1.5.5 : More bugfixes. Added support for SETUP_NOCHECK environment variable to
# bypass checksum verification of archives.
# - 1.6.0 : Compute MD5 checksums with the md5sum command (patch from Ryan Gordon)
# - 2.0 : Brand new rewrite, cleaner architecture, separated header and UNIX ports.
# - 2.0.1 : Added --copy
# - 2.1.0 : Allow multiple tarballs to be stored in one archive, and incremental updates.
# Added --nochown for archives
# Stopped doing redundant checksums when not necesary
# - 2.1.1 : Work around insane behavior from certain Linux distros with no 'uncompress' command
# Cleaned up the code to handle error codes from compress. Simplified the extraction code.
# - 2.1.2 : Some bug fixes. Use head -n to avoid problems.
# - 2.1.3 : Bug fixes with command line when spawning terminals.
# Added --tar for archives, allowing to give arbitrary arguments to tar on the contents of the archive.
# Added --noexec to prevent execution of embedded scripts.
# Added --nomd5 and --nocrc to avoid creating checksums in archives.
# Added command used to create the archive in --info output.
# Run the embedded script through eval.
# - 2.1.4 : Fixed --info output.
# Generate random directory name when extracting files to . to avoid problems. (Jason Trent)
# Better handling of errors with wrong permissions for the directory containing the files. (Jason Trent)
# Avoid some race conditions (Ludwig Nussel)
#
# (C) 1998-2004 by Stéphane Peter <megastep@megastep.org>
#
# This software is released under the terms of the GNU GPL version 2 and above
# Please read the license at http://www.gnu.org/copyleft/gpl.html
#
MS_VERSION=2.1.4
MS_COMMAND="$0"
for f in "${1+"$@"}"; do
MS_COMMAND="$MS_COMMAND \\\\
\\\"$f\\\""
done
# Procedures
MS_Usage()
{
echo "Usage: $0 [params] archive_dir file_name label [startup_script] [args]"
echo "params can be one or more of the following :"
echo " --version | -v : Print out Makeself version number and exit"
echo " --help | -h : Print out this help message"
echo " --gzip : Compress using gzip (default if detected)"
echo " --bzip2 : Compress using bzip2 instead of gzip"
echo " --compress : Compress using the UNIX 'compress' command"
echo " --nocomp : Do not compress the data"
echo " --notemp : The archive will create archive_dir in the"
echo " current directory and uncompress in ./archive_dir"
echo " --copy : Upon extraction, the archive will first copy itself to"
echo " a temporary directory"
echo " --append : Append more files to an existing Makeself archive"
echo " The label and startup scripts will then be ignored"
echo " --current : Files will be extracted to the current directory."
echo " Implies --notemp."
echo " --nomd5 : Don't calculate an MD5 for archive"
echo " --nocrc : Don't calculate a CRC for archive"
echo " --header file : Specify location of the header script"
echo " --follow : Follow the symlinks in the archive"
echo " --nox11 : Disable automatic spawn of a xterm"
echo " --nowait : Do not wait for user input after executing embedded"
echo " program from an xterm"
echo " --lsm file : LSM file describing the package"
echo
echo "Do not forget to give a fully qualified startup script name"
echo "(i.e. with a ./ prefix if inside the archive)."
exit 1
}
# Default settings
if type gzip 2>&1 > /dev/null; then
COMPRESS=gzip
else
COMPRESS=Unix
fi
KEEP=n
CURRENT=n
NOX11=n
APPEND=n
COPY=none
TAR_ARGS=cvf
HEADER=`dirname $0`/makeself-header.sh
# LSM file stuff
LSM_CMD="echo No LSM. >> \"\$archname\""
while true
do
case "$1" in
--version | -v)
echo Makeself version $MS_VERSION
exit 0
;;
--bzip2)
COMPRESS=bzip2
shift
;;
--gzip)
COMPRESS=gzip
shift
;;
--compress)
COMPRESS=Unix
shift
;;
--nocomp)
COMPRESS=none
shift
;;
--notemp)
KEEP=y
shift
;;
--copy)
COPY=copy
shift
;;
--current)
CURRENT=y
KEEP=y
shift
;;
--header)
HEADER="$2"
shift 2
;;
--follow)
TAR_ARGS=cvfh
shift
;;
--nox11)
NOX11=y
shift
;;
--nowait)
shift
;;
--nomd5)
NOMD5=y
shift
;;
--nocrc)
NOCRC=y
shift
;;
--append)
APPEND=y
shift
;;
--lsm)
LSM_CMD="cat \"$2\" >> \"\$archname\""
shift 2
;;
-h | --help)
MS_Usage
;;
-*)
echo Unrecognized flag : "$1"
MS_Usage
;;
*)
break
;;
esac
done
archdir="$1"
archname="$2"
if test "$APPEND" = y; then
if test $# -lt 2; then
MS_Usage
fi
# Gather the info from the original archive
OLDENV=`sh "$archname" --dumpconf`
if test $? -ne 0; then
echo "Unable to update archive: $archname" >&2
exit 1
else
eval "$OLDENV"
fi
else
if test "$KEEP" = n -a $# = 3; then
echo "ERROR: Making a temporary archive with no embedded command does not make sense!" >&2
echo
MS_Usage
fi
# We don't really want to create an absolute directory...
if test "$CURRENT" = y; then
archdirname="."
else
archdirname=`basename "$1"`
fi
if test $# -lt 3; then
MS_Usage
fi
LABEL="$3"
SCRIPT="$4"
test x$SCRIPT = x || shift 1
shift 3
SCRIPTARGS="$*"
fi
if test "$KEEP" = n -a "$CURRENT" = y; then
echo "ERROR: It is A VERY DANGEROUS IDEA to try to combine --notemp and --current." >&2
exit 1
fi
case $COMPRESS in
gzip)
GZIP_CMD="gzip -c9"
GUNZIP_CMD="gzip -cd"
;;
bzip2)
GZIP_CMD="bzip2 -9"
GUNZIP_CMD="bzip2 -d"
;;
Unix)
GZIP_CMD="compress -cf"
GUNZIP_CMD="exec 2>&-; uncompress -c || test \\\$? -eq 2 || gzip -cd"
;;
none)
GZIP_CMD="cat"
GUNZIP_CMD="cat"
;;
esac
tmpfile="${TMPDIR:=/tmp}/mkself$$"
if test -f $HEADER; then
oldarchname="$archname"
archname="$tmpfile"
# Generate a fake header to count its lines
SKIP=0
. $HEADER
SKIP=`cat "$tmpfile" |wc -l`
# Get rid of any spaces
SKIP=`expr $SKIP`
rm -f "$tmpfile"
echo Header is $SKIP lines long >&2
archname="$oldarchname"
else
echo "Unable to open header file: $HEADER" >&2
exit 1
fi
echo
if test "$APPEND" = n; then
if test -f "$archname"; then
echo "WARNING: Overwriting existing file: $archname" >&2
fi
fi
USIZE=`du -ks $archdir | cut -f1`
DATE=`LC_ALL=C date`
if test "." = "$archdirname"; then
if test "$KEEP" = n; then
archdirname="makeself-$$-`date +%Y%m%d%H%M%S`"
fi
fi
echo About to compress $USIZE KB of data...
echo Adding files to archive named \"$archname\"...
(cd "$archdir" && ( tar $TAR_ARGS - * | eval "$GZIP_CMD" ) >> "$tmpfile") || { echo Aborting: Archive directory not found or temporary file: "$tmpfile" could not be created.; rm -f "$tmpfile"; exit 1; }
echo >> "$tmpfile" >&- # try to close the archive
fsize=`cat "$tmpfile" | wc -c | tr -d " "`
# Compute the checksums
md5sum=00000000000000000000000000000000
crcsum=0000000000
if test "$NOCRC" = y; then
echo "skipping crc at user request"
else
crcsum=`cat "$tmpfile" | CMD_ENV=xpg4 cksum | sed -e 's/ /Z/' -e 's/ /Z/' | cut -dZ -f1`
echo "CRC: $crcsum"
fi
# Try to locate a MD5 binary
OLD_PATH=$PATH
PATH=${GUESS_MD5_PATH:-"$OLD_PATH:/bin:/usr/bin:/sbin:/usr/local/ssl/bin:/usr/local/bin:/opt/openssl/bin"}
MD5_PATH=`type -p md5sum`
MD5_PATH=${MD5_PATH:-`type -p md5`}
PATH=$OLD_PATH
if test "$NOMD5" = y; then
echo "skipping md5sum at user request"
else
if test -x "$MD5_PATH"; then
md5sum=`cat "$tmpfile" | "$MD5_PATH" | cut -b-32`;
echo "MD5: $md5sum"
else
echo "MD5: none, md5sum binary not found"
fi
fi
if test "$APPEND" = y; then
mv "$archname" "$archname".bak || exit
# Prepare entry for new archive
filesizes="$filesizes $fsize"
CRCsum="$CRCsum $crcsum"
MD5sum="$MD5sum $md5sum"
USIZE=`expr $USIZE + $OLDUSIZE`
# Generate the header
. $HEADER
# Append the original data
tail -n +$OLDSKIP "$archname".bak >> "$archname"
# Append the new data
cat "$tmpfile" >> "$archname"
chmod +x "$archname"
rm -f "$archname".bak
echo Self-extractible archive \"$archname\" successfully updated.
else
filesizes="$fsize"
CRCsum="$crcsum"
MD5sum="$md5sum"
# Generate the header
. $HEADER
# Append the compressed tar data after the stub
echo
cat "$tmpfile" >> "$archname"
chmod +x "$archname"
echo Self-extractible archive \"$archname\" successfully created.
fi
rm -f "$tmpfile"

View File

@@ -0,0 +1,7 @@
#!/bin/sh
# Grab the Makeself web page
echo The following was generated from http://www.megastep.org/makeself/ > README
echo ----------------------- >> README
echo >> README
lynx -dump http://www.megastep.org/makeself/ >> README

399
neo/sys/linux/sound.cpp Normal file
View File

@@ -0,0 +1,399 @@
/*
===========================================================================
Doom 3 GPL Source Code
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
This file is part of the Doom 3 GPL Source Code (?Doom 3 Source Code?).
Doom 3 Source Code is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Doom 3 Source Code 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
along with Doom 3 Source Code. If not, see <http://www.gnu.org/licenses/>.
In addition, the Doom 3 Source Code is also subject to certain additional terms. You should have received a copy of these additional terms immediately following the terms and conditions of the GNU General Public License which accompanied the Doom 3 Source Code. If not, please request a copy in writing from id Software at the address below.
If you have questions concerning this license or the applicable additional terms, you may contact in writing id Software LLC, c/o ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA.
===========================================================================
*/
#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
#include <malloc.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
// OSS sound interface
// http://www.opensound.com/
#include <sys/soundcard.h>
#include "../../idlib/precompiled.h"
#include "../../sound/snd_local.h"
#include "../posix/posix_public.h"
#include "sound.h"
const char *s_driverArgs[] = { "best", "oss", "alsa", NULL };
#ifndef NO_ALSA
static idCVar s_driver( "s_driver", s_driverArgs[0], CVAR_SYSTEM | CVAR_ARCHIVE, "sound driver. 'best' will attempt to use alsa and fallback to OSS if not available", s_driverArgs, idCmdSystem::ArgCompletion_String<s_driverArgs> );
#else
static idCVar s_driver( "s_driver", "oss", CVAR_SYSTEM | CVAR_ARCHIVE | CVAR_ROM, "sound driver. only OSS is supported in this build" );
#endif
idAudioHardware *idAudioHardware::Alloc() {
#ifndef NO_ALSA
if ( !strcmp( s_driver.GetString(), "best" ) ) {
idAudioHardwareALSA *test = new idAudioHardwareALSA;
if ( test->DLOpen() ) {
common->Printf( "Alsa is available\n" );
return test;
}
common->Printf( "Alsa is not available\n" );
delete test;
return new idAudioHardwareOSS;
}
if ( !strcmp( s_driver.GetString(), "alsa" ) ) {
return new idAudioHardwareALSA;
}
#endif
return new idAudioHardwareOSS;
}
// OSS sound ----------------------------------------------------
/*
===============
idAudioHardware::~idAudioHardware
===============
*/
idAudioHardware::~idAudioHardware() { }
/*
=================
idAudioHardwareOSS::~idAudioHardwareOSS
=================
*/
idAudioHardwareOSS::~idAudioHardwareOSS() {
Release();
}
/*
=================
idAudioHardwareOSS::Release
=================
*/
void idAudioHardwareOSS::Release( bool bSilent ) {
if (m_audio_fd) {
if (!bSilent) {
common->Printf("------ OSS Sound Shutdown ------\n");
}
if (m_buffer) {
free( m_buffer );
m_buffer = NULL;
m_buffer_size = 0;
}
common->Printf("close sound device\n");
if (close(m_audio_fd) == -1) {
common->Warning( "failed to close sound device: %s", strerror(errno) );
}
m_audio_fd = 0;
if (!bSilent) {
common->Printf("--------------------------------\n");
}
}
}
/*
=================
idAudioHardwareOSS::InitFailed
=================
*/
void idAudioHardwareOSS::InitFailed() {
Release( true );
cvarSystem->SetCVarBool( "s_noSound", true );
common->Warning( "sound subsystem disabled" );
common->Printf( "--------------------------------------\n" );
}
/*
=================
idAudioHardwareOSS::ExtractOSSVersion
=================
*/
void idAudioHardwareOSS::ExtractOSSVersion( int version, idStr &str ) const {
sprintf( str, "%d.%d.%d", ( version & 0xFF0000 ) >> 16, ( version & 0xFF00 ) >> 8, version & 0xFF );
}
/*
=================
idAudioHardwareOSS::Initialize
http://www.4front-tech.com/pguide/index.html
though OSS API docs (1.1) advertise AFMT_S32_LE, AFMT_S16_LE is the only output format I've found in kernel emu10k1 headers
BSD NOTE: With the GNU library, you can use free to free the blocks that memalign, posix_memalign, and valloc return.
That does not work in BSD, however--BSD does not provide any way to free such blocks.
=================
*/
idCVar s_device( "s_dsp", "/dev/dsp", CVAR_SYSTEM | CVAR_ARCHIVE, "" );
bool idAudioHardwareOSS::Initialize( ) {
common->Printf("------ OSS Sound Initialization ------\n");
int requested_sample_format, caps, oss_version;
idStr s_compiled_oss_version, s_oss_version;
struct audio_buf_info info;
memset( &info, 0, sizeof( info ) );
if (m_audio_fd) {
Release();
}
// open device ------------------------------------------------
if ((m_audio_fd = open( s_device.GetString(), O_WRONLY | O_NONBLOCK, 0)) == -1) {
m_audio_fd = 0;
common->Warning( "failed to open sound device '%s': %s", s_device.GetString(), strerror(errno) );
InitFailed();
return false;
}
// make it blocking - so write overruns don't fail with 'Resource temporarily unavailable'
int flags;
if ( ( flags = fcntl( m_audio_fd, F_GETFL ) ) == -1 ) {
common->Warning( "failed fcntl F_GETFL on sound device '%s': %s", s_device.GetString(), strerror( errno ) );
InitFailed();
return false;
}
flags &= ~O_NONBLOCK;
if ( fcntl( m_audio_fd, F_SETFL, flags ) == -1 ) {
common->Warning( "failed to clear O_NONBLOCK on sound device '%s': %s", s_device.GetString(), strerror( errno ) );
InitFailed();
return false;
}
common->Printf("opened sound device '%s'\n", s_device.GetString());
// verify capabilities -----------------------------------------
// may only be available starting with OSS API v4.0
// http://www.fi.opensound.com/developer/SNDCTL_SYSINFO.html
// NOTE: at OSS API 4.0 headers, replace OSS_SYSINFO with SNDCTL_SYSINFO
oss_sysinfo si;
if ( ioctl( m_audio_fd, OSS_SYSINFO, &si ) == -1 ) {
common->Printf( "ioctl SNDCTL_SYSINFO failed: %s\nthis ioctl is only available in OSS/Linux implementation. If you run OSS/Free, don't bother.", strerror( errno ) );
} else {
common->Printf( "%s: %s %s\n", s_device.GetString(), si.product, si.version );
}
if ( ioctl( m_audio_fd, SNDCTL_DSP_GETCAPS, &caps ) == -1 ) {
common->Warning( "ioctl SNDCTL_DSP_GETCAPS failed - driver too old?" );
InitFailed();
return false;
}
common->DPrintf("driver rev %d - capabilities %d\n", caps & DSP_CAP_REVISION, caps);
if (ioctl( m_audio_fd, OSS_GETVERSION, &oss_version ) == -1) {
common->Warning( "ioctl OSS_GETVERSION failed" );
InitFailed();
return false;
}
ExtractOSSVersion( oss_version, s_oss_version );
ExtractOSSVersion( SOUND_VERSION, s_compiled_oss_version );
common->DPrintf( "OSS interface version %s - compile time %s\n", s_oss_version.c_str(), s_compiled_oss_version.c_str() );
if (!(caps & DSP_CAP_MMAP)) {
common->Warning( "driver doesn't have DSP_CAP_MMAP capability" );
InitFailed();
return false;
}
if (!(caps & DSP_CAP_TRIGGER)) {
common->Warning( "driver doesn't have DSP_CAP_TRIGGER capability" );
InitFailed();
return false;
}
// sample format -----------------------------------------------
requested_sample_format = AFMT_S16_LE;
m_sample_format = requested_sample_format;
if (ioctl(m_audio_fd, SNDCTL_DSP_SETFMT, &m_sample_format) == -1) {
common->Warning( "ioctl SNDCTL_DSP_SETFMT %d failed: %s", requested_sample_format, strerror(errno) );
InitFailed();
return false;
}
if ( m_sample_format != requested_sample_format ) {
common->Warning( "ioctl SNDCTL_DSP_SETFMT failed to get the requested sample format %d, got %d", requested_sample_format, m_sample_format );
InitFailed();
return false;
}
// channels ----------------------------------------------------
// sanity over number of speakers
if ( idSoundSystemLocal::s_numberOfSpeakers.GetInteger() != 6 && idSoundSystemLocal::s_numberOfSpeakers.GetInteger() != 2 ) {
common->Warning( "invalid value for s_numberOfSpeakers. Use either 2 or 6" );
idSoundSystemLocal::s_numberOfSpeakers.SetInteger( 2 );
}
m_channels = idSoundSystemLocal::s_numberOfSpeakers.GetInteger();
if ( ioctl( m_audio_fd, SNDCTL_DSP_CHANNELS, &m_channels ) == -1 ) {
common->Warning( "ioctl SNDCTL_DSP_CHANNELS %d failed: %s", idSoundSystemLocal::s_numberOfSpeakers.GetInteger(), strerror(errno) );
InitFailed();
return false;
}
if ( m_channels != (unsigned int)idSoundSystemLocal::s_numberOfSpeakers.GetInteger() ) {
common->Warning( "ioctl SNDCTL_DSP_CHANNELS failed to get the %d requested channels, got %d", idSoundSystemLocal::s_numberOfSpeakers.GetInteger(), m_channels );
if ( m_channels != 2 && idSoundSystemLocal::s_numberOfSpeakers.GetInteger() != 2 ) {
// we didn't request 2 channels, some drivers reply 1 channel on error but may still let us still get 2 if properly asked
m_channels = 2;
if ( ioctl( m_audio_fd, SNDCTL_DSP_CHANNELS, &m_channels ) == -1 ) {
common->Warning( "ioctl SNDCTL_DSP_CHANNELS fallback to 2 failed: %s", strerror(errno) );
InitFailed();
return false;
}
}
if ( m_channels == 2 ) {
// tell the system to mix 2 channels
common->Warning( "falling back to stereo" );
idSoundSystemLocal::s_numberOfSpeakers.SetInteger( 2 );
} else {
// disable sound
InitFailed();
return false;
}
}
assert( (int)m_channels == idSoundSystemLocal::s_numberOfSpeakers.GetInteger() );
// sampling rate ------------------------------------------------
m_speed = PRIMARYFREQ;
if ( ioctl( m_audio_fd, SNDCTL_DSP_SPEED, &m_speed ) == -1 ) {
common->Warning( "ioctl SNDCTL_DSP_SPEED %d failed: %s", PRIMARYFREQ, strerror(errno) );
InitFailed();
return false;
}
// instead of an exact match, do a very close to
// there is some horrible Ensonic ES1371 which replies 44101 for a 44100 request
if ( abs( m_speed - PRIMARYFREQ ) > 5 ) {
common->Warning( "ioctl SNDCTL_DSP_SPEED failed to get the requested frequency %d, got %d", PRIMARYFREQ, m_speed );
InitFailed();
return false;
}
common->Printf("%s - bit rate: %d, channels: %d, frequency: %d\n", s_device.GetString(), m_sample_format, m_channels, m_speed);
// output buffer ------------------------------------------------
// allocate a final buffer target, the sound engine locks, writes, and we write back to the device
// we want m_buffer_size ( will have to rename those )
// ROOM_SLICES_IN_BUFFER is fixed ( system default, 10 )
// MIXBUFFER_SAMPLES is the number of samples found in a slice
// each sample is m_channels * sizeof( float ) bytes
// in AsyncUpdate we only write one block at a time, so we'd only need to have a final mix buffer sized of a single block
m_buffer_size = MIXBUFFER_SAMPLES * m_channels * 2;
m_buffer = malloc( m_buffer_size );
common->Printf( "allocated a mix buffer of %d bytes\n", m_buffer_size );
// toggle sound -------------------------------------------------
// toggle off before toggling on. that's what OSS source code samples recommends
int flag = 0;
if (ioctl(m_audio_fd, SNDCTL_DSP_SETTRIGGER, &flag) == -1) {
common->Warning( "ioctl SNDCTL_DSP_SETTRIGGER 0 failed: %s", strerror(errno) );
}
flag = PCM_ENABLE_OUTPUT;
if (ioctl(m_audio_fd, SNDCTL_DSP_SETTRIGGER, &flag) == -1) {
common->Warning( "ioctl SNDCTL_DSP_SETTRIGGER PCM_ENABLE_OUTPUT failed: %s", strerror(errno) );
}
common->Printf("--------------------------------------\n");
return true;
}
/*
===============
idAudioHardwareOSS::Flush
===============
*/
bool idAudioHardwareOSS::Flush( void ) {
audio_buf_info ospace;
if ( ioctl( m_audio_fd, SNDCTL_DSP_GETOSPACE, &ospace ) == -1 ) {
Sys_Printf( "ioctl SNDCTL_DSP_GETOSPACE failed: %s\n", strerror( errno ) );
return false;
}
// how many chunks can we write to the audio device right now
m_freeWriteChunks = ( ospace.bytes * MIXBUFFER_CHUNKS ) / ( MIXBUFFER_SAMPLES * m_channels * 2 );
if ( m_writeChunks ) {
// flush out any remaining chunks we could now
Write( true );
}
return ( m_freeWriteChunks > 0 );
}
/*
=================
idAudioHardwareOSS::GetMixBufferSize
=================
*/
int idAudioHardwareOSS::GetMixBufferSize() {
// return MIXBUFFER_SAMPLES * 2 * m_channels;
return m_buffer_size;
}
/*
=================
idAudioHardwareOSS::GetMixBuffer
=================
*/
short* idAudioHardwareOSS::GetMixBuffer() {
return (short *)m_buffer;
}
/*
===============
idAudioHardwareOSS::Write
rely on m_freeWriteChunks which has been set in Flush() before engine did the mixing for this MIXBUFFER_SAMPLE
===============
*/
void idAudioHardwareOSS::Write( bool flushing ) {
assert( m_audio_fd );
int ret;
if ( !flushing && m_writeChunks ) {
// if we write after a new mixing loop, we should have m_writeChunk == 0
// otherwise that last remaining chunk that was never flushed out to the audio device has just been overwritten
Sys_Printf( "idAudioHardwareOSS::Write: %d samples were overflowed and dropped\n", m_writeChunks * MIXBUFFER_SAMPLES / MIXBUFFER_CHUNKS );
}
if ( !flushing ) {
// if running after the mix loop, then we have a full buffer to write out
m_writeChunks = MIXBUFFER_CHUNKS;
}
if ( m_freeWriteChunks == 0 ) {
return;
}
// what to write and how much
int pos = (int)m_buffer + ( MIXBUFFER_CHUNKS - m_writeChunks ) * m_channels * 2 * MIXBUFFER_SAMPLES / MIXBUFFER_CHUNKS;
int len = Min( m_writeChunks, m_freeWriteChunks ) * m_channels * 2 * MIXBUFFER_SAMPLES / MIXBUFFER_CHUNKS;
assert( len > 0 );
if ( ( ret = write( m_audio_fd, (void*)pos, len ) ) == -1 ) {
Sys_Printf( "write to audio fd failed: %s\n", strerror( errno ) );
return;
}
if ( len != ret ) {
Sys_Printf( "short write to audio fd: wrote %d out of %d\n", ret, m_buffer_size );
return;
}
m_writeChunks -= Min( m_writeChunks, m_freeWriteChunks );
}
/*
===============
Sys_LoadOpenAL
-===============
*/
bool Sys_LoadOpenAL( void ) {
return false;
}

187
neo/sys/linux/sound.h Normal file
View File

@@ -0,0 +1,187 @@
/*
===========================================================================
Doom 3 GPL Source Code
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
This file is part of the Doom 3 GPL Source Code (?Doom 3 Source Code?).
Doom 3 Source Code is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Doom 3 Source Code 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
along with Doom 3 Source Code. If not, see <http://www.gnu.org/licenses/>.
In addition, the Doom 3 Source Code is also subject to certain additional terms. You should have received a copy of these additional terms immediately following the terms and conditions of the GNU General Public License which accompanied the Doom 3 Source Code. If not, please request a copy in writing from id Software at the address below.
If you have questions concerning this license or the applicable additional terms, you may contact in writing id Software LLC, c/o ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA.
===========================================================================
*/
#ifndef ID_SND_BACKENDS
#define ID_SND_BACKENDS
class idAudioHardwareOSS : public idAudioHardware {
// if you can't write MIXBUFFER_SAMPLES all at once to the audio device, split in MIXBUFFER_CHUNKS
static const int MIXBUFFER_CHUNKS = 4;
int m_audio_fd;
int m_sample_format;
unsigned int m_channels;
unsigned int m_speed;
void *m_buffer;
int m_buffer_size;
// counting the loops through the dma buffer
int m_loops;
// how many chunks we have left to write in cases where we need to split
int m_writeChunks;
// how many chunks we can write to the audio device without blocking
int m_freeWriteChunks;
public:
idAudioHardwareOSS() {
m_audio_fd = 0;
m_sample_format = 0;
m_channels = 0;
m_speed = 0;
m_buffer = NULL;
m_buffer_size = 0;
m_loops = 0;
m_writeChunks = 0;
m_freeWriteChunks = 0;
}
virtual ~idAudioHardwareOSS();
bool Initialize( void );
// Linux driver doesn't support memory map API
bool Lock( void **pDSLockedBuffer, ulong *dwDSLockedBufferSize ) { return false; }
bool Unlock( void *pDSLockedBuffer, dword dwDSLockedBufferSize ) { return false; }
bool GetCurrentPosition( ulong *pdwCurrentWriteCursor ) { return false; }
bool Flush();
void Write( bool flushing );
int GetNumberOfSpeakers() { return m_channels; }
int GetMixBufferSize();
short* GetMixBuffer();
private:
void Release( bool bSilent = false );
void InitFailed();
void ExtractOSSVersion( int version, idStr &str ) const;
};
#ifndef NO_ALSA
// libasound2-dev
// the new/old API may be a problem if we are going to dynamically load the asound lib?
#define ALSA_PCM_NEW_HW_PARAMS_API
#define ALSA_PCM_NEW_SW_PARAMS_API
#include <alsa/asoundlib.h>
#define id_snd_pcm_hw_params_alloca(ptr) do { assert(ptr); *ptr = (snd_pcm_hw_params_t *) alloca(id_snd_pcm_hw_params_sizeof()); memset(*ptr, 0, id_snd_pcm_hw_params_sizeof()); } while (0)
typedef const char * ( *pfn_snd_asoundlib_version )( void );
typedef snd_pcm_sframes_t ( *pfn_snd_pcm_avail_update )( snd_pcm_t *pcm );
typedef int ( *pfn_snd_pcm_close )( snd_pcm_t *pcm );
typedef const char * ( *pfn_snd_strerror )( int errnum );
typedef int ( *pfn_snd_pcm_hw_params )( snd_pcm_t *pcm, snd_pcm_hw_params_t *params );
typedef int ( *pfn_snd_pcm_hw_params_any )( snd_pcm_t *pcm, snd_pcm_hw_params_t *params );
typedef int ( *pfn_snd_pcm_hw_params_get_buffer_size )( const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val );
typedef int ( *pfn_snd_pcm_hw_params_set_access )( snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_access_t access );
typedef int ( *pfn_snd_pcm_hw_params_set_buffer_size_min )( snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val );
typedef int ( *pfn_snd_pcm_hw_params_set_channels )( snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val );
typedef int ( *pfn_snd_pcm_hw_params_set_format )( snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_format_t format );
typedef int ( *pfn_snd_pcm_hw_params_set_rate )( snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir );
typedef size_t ( *pfn_snd_pcm_hw_params_sizeof )( void );
typedef int ( *pfn_snd_pcm_open )( snd_pcm_t **pcmp, const char *name, snd_pcm_stream_t stream, int mode );
typedef int ( *pfn_snd_pcm_prepare )( snd_pcm_t *pcm );
typedef snd_pcm_state_t ( *pfn_snd_pcm_state )( snd_pcm_t *pcm );
typedef snd_pcm_sframes_t ( *pfn_snd_pcm_writei )( snd_pcm_t *pcm, const void *buffer, snd_pcm_uframes_t size );
#define ALSA_DLSYM(SYM) id_##SYM = ( pfn_##SYM )dlvsym( m_handle, #SYM, "ALSA_0.9" ); if ( !id_##SYM ) { common->Printf( "dlsym "#SYM" failed: %s\n", dlerror() ); Release(); return false; }
class idAudioHardwareALSA : public idAudioHardware {
private:
// if you can't write MIXBUFFER_SAMPLES all at once to the audio device, split in MIXBUFFER_CHUNKS
static const int MIXBUFFER_CHUNKS = 4;
snd_pcm_t *m_pcm_handle;
unsigned int m_channels;
void *m_buffer;
int m_buffer_size;
// how many frames remaining to be written to the device
int m_remainingFrames;
void *m_handle;
public:
idAudioHardwareALSA() {
m_pcm_handle = NULL;
m_channels = 0;
m_buffer = NULL;
m_buffer_size = 0;
m_remainingFrames = 0;
m_handle = NULL;
}
virtual ~idAudioHardwareALSA();
// dlopen the lib ( check minimum version )
bool DLOpen();
bool Initialize( void );
// Linux driver doesn't support memory map API
bool Lock( void **pDSLockedBuffer, ulong *dwDSLockedBufferSize ) { return false; }
bool Unlock( void *pDSLockedBuffer, dword dwDSLockedBufferSize ) { return false; }
bool GetCurrentPosition( ulong *pdwCurrentWriteCursor ) { return false; }
bool Flush();
void Write( bool flushing );
int GetNumberOfSpeakers( void ) { return m_channels; }
int GetMixBufferSize( void );
short* GetMixBuffer( void );
private:
void Release();
void InitFailed();
void PlayTestPattern();
// may be NULL, outdated alsa versions are missing it and we just ignore
pfn_snd_asoundlib_version id_snd_asoundlib_version;
pfn_snd_pcm_avail_update id_snd_pcm_avail_update;
pfn_snd_pcm_close id_snd_pcm_close;
pfn_snd_strerror id_snd_strerror;
pfn_snd_pcm_hw_params id_snd_pcm_hw_params;
pfn_snd_pcm_hw_params_any id_snd_pcm_hw_params_any;
pfn_snd_pcm_hw_params_get_buffer_size id_snd_pcm_hw_params_get_buffer_size;
pfn_snd_pcm_hw_params_set_access id_snd_pcm_hw_params_set_access;
pfn_snd_pcm_hw_params_set_buffer_size_min id_snd_pcm_hw_params_set_buffer_size_min;
pfn_snd_pcm_hw_params_set_channels id_snd_pcm_hw_params_set_channels;
pfn_snd_pcm_hw_params_set_format id_snd_pcm_hw_params_set_format;
pfn_snd_pcm_hw_params_set_rate id_snd_pcm_hw_params_set_rate;
pfn_snd_pcm_hw_params_sizeof id_snd_pcm_hw_params_sizeof;
pfn_snd_pcm_open id_snd_pcm_open;
pfn_snd_pcm_prepare id_snd_pcm_prepare;
pfn_snd_pcm_state id_snd_pcm_state;
pfn_snd_pcm_writei id_snd_pcm_writei;
};
#endif // NO_ALSA
#endif

View File

@@ -0,0 +1,316 @@
/*
===========================================================================
Doom 3 GPL Source Code
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
This file is part of the Doom 3 GPL Source Code (?Doom 3 Source Code?).
Doom 3 Source Code is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Doom 3 Source Code 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
along with Doom 3 Source Code. If not, see <http://www.gnu.org/licenses/>.
In addition, the Doom 3 Source Code is also subject to certain additional terms. You should have received a copy of these additional terms immediately following the terms and conditions of the GNU General Public License which accompanied the Doom 3 Source Code. If not, please request a copy in writing from id Software at the address below.
If you have questions concerning this license or the applicable additional terms, you may contact in writing id Software LLC, c/o ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA.
===========================================================================
*/
#include "../../idlib/precompiled.h"
#include "../../sound/snd_local.h"
#include "../posix/posix_public.h"
#include "sound.h"
#include <dlfcn.h>
static idCVar s_alsa_pcm( "s_alsa_pcm", "default", CVAR_SYSTEM | CVAR_ARCHIVE, "which alsa pcm device to use. default, hwplug, hw.. see alsa docs" );
static idCVar s_alsa_lib( "s_alsa_lib", "libasound.so.2", CVAR_SYSTEM | CVAR_ARCHIVE, "alsa client sound library" );
/*
===============
idAudioHardwareALSA::DLOpen
===============
*/
bool idAudioHardwareALSA::DLOpen( void ) {
const char *version;
if ( m_handle ) {
return true;
}
common->Printf( "dlopen(%s)\n", s_alsa_lib.GetString() );
if ( !( m_handle = dlopen( s_alsa_lib.GetString(), RTLD_NOW | RTLD_GLOBAL ) ) ) {
common->Printf( "dlopen(%s) failed: %s\n", s_alsa_lib.GetString(), dlerror() );
return false;
}
// print the version if available
id_snd_asoundlib_version = ( pfn_snd_asoundlib_version )dlsym( m_handle, "snd_asoundlib_version" );
if ( !id_snd_asoundlib_version ) {
common->Printf( "dlsym(\"snd_asoundlib_version\") failed: %s\n", dlerror() );
common->Warning( "please consider upgrading alsa to a more recent version." );
} else {
version = id_snd_asoundlib_version();
common->Printf( "asoundlib version: %s\n", version );
}
// dlsym the symbols
ALSA_DLSYM(snd_pcm_avail_update);
ALSA_DLSYM(snd_pcm_close);
ALSA_DLSYM(snd_pcm_hw_params);
ALSA_DLSYM(snd_pcm_hw_params_any);
ALSA_DLSYM(snd_pcm_hw_params_get_buffer_size);
ALSA_DLSYM(snd_pcm_hw_params_set_access);
ALSA_DLSYM(snd_pcm_hw_params_set_buffer_size_min);
ALSA_DLSYM(snd_pcm_hw_params_set_channels);
ALSA_DLSYM(snd_pcm_hw_params_set_format);
ALSA_DLSYM(snd_pcm_hw_params_set_rate);
ALSA_DLSYM(snd_pcm_hw_params_sizeof);
ALSA_DLSYM(snd_pcm_open);
ALSA_DLSYM(snd_pcm_prepare);
ALSA_DLSYM(snd_pcm_state);
ALSA_DLSYM(snd_pcm_writei);
ALSA_DLSYM(snd_strerror);
return true;
}
/*
===============
idAudioHardwareALSA::Release
===============
*/
void idAudioHardwareALSA::Release() {
if ( m_pcm_handle ) {
common->Printf( "close pcm\n" );
id_snd_pcm_close( m_pcm_handle );
m_pcm_handle = NULL;
}
if ( m_buffer ) {
free( m_buffer );
m_buffer = NULL;
}
if ( m_handle ) {
common->Printf( "dlclose\n" );
dlclose( m_handle );
m_handle = NULL;
}
}
/*
=================
idAudioHardwareALSA::InitFailed
=================
*/
void idAudioHardwareALSA::InitFailed() {
Release();
cvarSystem->SetCVarBool( "s_noSound", true );
common->Warning( "sound subsystem disabled\n" );
common->Printf( "--------------------------------------\n" );
}
/*
=====================
idAudioHardwareALSA::Initialize
=====================
*/
bool idAudioHardwareALSA::Initialize( void ) {
int err;
common->Printf( "------ Alsa Sound Initialization -----\n" );
if ( !DLOpen() ) {
InitFailed();
return false;
}
if ( ( err = id_snd_pcm_open( &m_pcm_handle, s_alsa_pcm.GetString(), SND_PCM_STREAM_PLAYBACK, SND_PCM_NONBLOCK ) ) < 0 ) {
common->Printf( "snd_pcm_open SND_PCM_STREAM_PLAYBACK '%s' failed: %s\n", s_alsa_pcm.GetString(), id_snd_strerror( err ) );
InitFailed();
return false;
}
common->Printf( "opened Alsa PCM device %s for playback\n", s_alsa_pcm.GetString() );
// set hardware parameters ----------------------------------------------------------------------
// init hwparams with the full configuration space
snd_pcm_hw_params_t *hwparams;
// this one is a define
id_snd_pcm_hw_params_alloca( &hwparams );
if ( ( err = id_snd_pcm_hw_params_any( m_pcm_handle, hwparams ) ) < 0 ) {
common->Printf( "cannot configure the PCM device: %s\n", id_snd_strerror( err ) );
InitFailed();
return false;
}
if ( ( err = id_snd_pcm_hw_params_set_access( m_pcm_handle, hwparams, SND_PCM_ACCESS_RW_INTERLEAVED ) ) < 0 ) {
common->Printf( "SND_PCM_ACCESS_RW_INTERLEAVED failed: %s\n", id_snd_strerror( err ) );
InitFailed();
return false;
}
if ( ( err = id_snd_pcm_hw_params_set_format( m_pcm_handle, hwparams, SND_PCM_FORMAT_S16_LE ) ) < 0 ) {
common->Printf( "SND_PCM_FORMAT_S16_LE failed: %s\n", id_snd_strerror( err ) );
InitFailed();
return false;
}
// channels
// sanity over number of speakers
if ( idSoundSystemLocal::s_numberOfSpeakers.GetInteger() != 6 && idSoundSystemLocal::s_numberOfSpeakers.GetInteger() != 2 ) {
common->Warning( "invalid value for s_numberOfSpeakers. Use either 2 or 6" );
idSoundSystemLocal::s_numberOfSpeakers.SetInteger( 2 );
}
m_channels = idSoundSystemLocal::s_numberOfSpeakers.GetInteger();
if ( ( err = id_snd_pcm_hw_params_set_channels( m_pcm_handle, hwparams, m_channels ) ) < 0 ) {
common->Printf( "error setting %d channels: %s\n", m_channels, id_snd_strerror( err ) );
if ( idSoundSystemLocal::s_numberOfSpeakers.GetInteger() != 2 ) {
// fallback to stereo if that works
m_channels = 2;
if ( ( err = id_snd_pcm_hw_params_set_channels( m_pcm_handle, hwparams, m_channels ) ) < 0 ) {
common->Printf( "fallback to stereo failed: %s\n", id_snd_strerror( err ) );
InitFailed();
return false;
} else {
common->Printf( "fallback to stereo\n" );
idSoundSystemLocal::s_numberOfSpeakers.SetInteger( 2 );
}
} else {
InitFailed();
return false;
}
}
// set sample rate (frequency)
if ( ( err = id_snd_pcm_hw_params_set_rate( m_pcm_handle, hwparams, PRIMARYFREQ, 0 ) ) < 0 ) {
common->Printf( "failed to set 44.1KHz rate: %s - try ( +set s_alsa_pcm plughw:0 ? )\n", id_snd_strerror( err ) );
InitFailed();
return false;
}
// have enough space in the input buffer for our MIXBUFFER_SAMPLE feedings and async ticks
snd_pcm_uframes_t frames;
frames = MIXBUFFER_SAMPLES + MIXBUFFER_SAMPLES / 3;
if ( ( err = id_snd_pcm_hw_params_set_buffer_size_min( m_pcm_handle, hwparams, &frames ) ) < 0 ) {
common->Printf( "buffer size select failed: %s\n", id_snd_strerror( err ) );
InitFailed();
return false;
}
// apply parameters
if ( ( err = id_snd_pcm_hw_params( m_pcm_handle, hwparams ) ) < 0 ) {
common->Printf( "snd_pcm_hw_params failed: %s\n", id_snd_strerror( err ) );
InitFailed();
return false;
}
// check the buffer size
if ( ( err = id_snd_pcm_hw_params_get_buffer_size( hwparams, &frames ) ) < 0 ) {
common->Printf( "snd_pcm_hw_params_get_buffer_size failed: %s\n", id_snd_strerror( err ) );
} else {
common->Printf( "device buffer size: %lu frames ( %lu bytes )\n", ( long unsigned int )frames, frames * m_channels * 2 );
}
// TODO: can use swparams to setup the device so it doesn't underrun but rather loops over
// snd_pcm_sw_params_set_stop_threshold
// To get alsa to just loop on underruns. set the swparam stop_threshold to equal buffer size. The sound buffer will just loop and never throw an xrun.
// allocate the final mix buffer
m_buffer_size = MIXBUFFER_SAMPLES * m_channels * 2;
m_buffer = malloc( m_buffer_size );
common->Printf( "allocated a mix buffer of %d bytes\n", m_buffer_size );
#ifdef _DEBUG
// verbose the state
snd_pcm_state_t curstate = id_snd_pcm_state( m_pcm_handle );
assert( curstate == SND_PCM_STATE_PREPARED );
#endif
common->Printf( "--------------------------------------\n" );
return true;
}
/*
===============
idAudioHardwareALSA::~idAudioHardwareALSA
===============
*/
idAudioHardwareALSA::~idAudioHardwareALSA() {
common->Printf( "----------- Alsa Shutdown ------------\n" );
Release();
common->Printf( "--------------------------------------\n" );
}
/*
=================
idAudioHardwareALSA::GetMixBufferSize
=================
*/
int idAudioHardwareALSA::GetMixBufferSize() {
return m_buffer_size;
}
/*
=================
idAudioHardwareALSA::GetMixBuffer
=================
*/
short* idAudioHardwareALSA::GetMixBuffer() {
return (short *)m_buffer;
}
/*
===============
idAudioHardwareALSA::Flush
===============
*/
bool idAudioHardwareALSA::Flush( void ) {
int ret;
snd_pcm_state_t state;
state = id_snd_pcm_state( m_pcm_handle );
if ( state != SND_PCM_STATE_RUNNING && state != SND_PCM_STATE_PREPARED ) {
if ( ( ret = id_snd_pcm_prepare( m_pcm_handle ) ) < 0 ) {
Sys_Printf( "failed to recover from SND_PCM_STATE_XRUN: %s\n", id_snd_strerror( ret ) );
cvarSystem->SetCVarBool( "s_noSound", true );
return false;
}
Sys_Printf( "preparing audio device for output\n" );
}
Write( true );
}
/*
===============
idAudioHardwareALSA::Write
rely on m_freeWriteChunks which has been set in Flush() before engine did the mixing for this MIXBUFFER_SAMPLE
===============
*/
void idAudioHardwareALSA::Write( bool flushing ) {
if ( !flushing && m_remainingFrames ) {
// if we write after a new mixing loop, we should have m_writeChunk == 0
// otherwise that last remaining chunk that was never flushed out to the audio device has just been overwritten
Sys_Printf( "idAudioHardwareALSA::Write: %d frames overflowed and dropped\n", m_remainingFrames );
}
if ( !flushing ) {
// if running after the mix loop, then we have a full buffer to write out
m_remainingFrames = MIXBUFFER_SAMPLES;
}
if ( m_remainingFrames == 0 ) {
return;
}
// write the max frames you can in one shot - we need to write it all out in Flush() calls before the next Write() happens
int pos = (int)m_buffer + ( MIXBUFFER_SAMPLES - m_remainingFrames ) * m_channels * 2;
snd_pcm_sframes_t frames = id_snd_pcm_writei( m_pcm_handle, (void*)pos, m_remainingFrames );
if ( frames < 0 ) {
if ( frames != -EAGAIN ) {
Sys_Printf( "snd_pcm_writei %d frames failed: %s\n", m_remainingFrames, id_snd_strerror( frames ) );
}
return;
}
m_remainingFrames -= frames;
}

137
neo/sys/linux/stack.cpp Normal file
View File

@@ -0,0 +1,137 @@
/*
===========================================================================
Doom 3 GPL Source Code
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
This file is part of the Doom 3 GPL Source Code (?Doom 3 Source Code?).
Doom 3 Source Code is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Doom 3 Source Code 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
along with Doom 3 Source Code. If not, see <http://www.gnu.org/licenses/>.
In addition, the Doom 3 Source Code is also subject to certain additional terms. You should have received a copy of these additional terms immediately following the terms and conditions of the GNU General Public License which accompanied the Doom 3 Source Code. If not, please request a copy in writing from id Software at the address below.
If you have questions concerning this license or the applicable additional terms, you may contact in writing id Software LLC, c/o ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA.
===========================================================================
*/
#include "../../idlib/precompiled.h"
/*
==================
Sys_ShutdownSymbols
==================
*/
void Sys_ShutdownSymbols( void ) {
}
#ifdef ID_BT_STUB
/*
==================
Sys_GetCallStack
==================
*/
void Sys_GetCallStack( address_t *callStack, const int callStackSize ) {
for ( int i = 0; i < callStackSize; i++ ) {
callStack[i] = 0;
}
}
/*
==================
Sys_GetCallStackStr
==================
*/
const char * Sys_GetCallStackStr( const address_t *callStack, const int callStackSize ) {
return "";
}
/*
==================
Sys_GetCallStackStr
==================
*/
const char * Sys_GetCallStackCurStr( int depth ) {
return "";
}
/*
==================
Sys_GetCallStackCurAddressStr
==================
*/
const char * Sys_GetCallStackCurAddressStr( int depth ) {
return "";
}
#else
#include <execinfo.h>
/*
==================
Sys_GetCallStack
==================
*/
void Sys_GetCallStack( address_t *callStack, const int callStackSize ) {
int i;
i = backtrace( (void **)callStack, callStackSize );
while( i < callStackSize ) {
callStack[i++] = 0;
}
}
/*
==================
Sys_GetCallStackStr
==================
*/
const char * Sys_GetCallStackStr( const address_t *callStack, int callStackSize ) {
static char string[MAX_STRING_CHARS*2];
char **strings;
int i;
strings = backtrace_symbols( (void **)callStack, callStackSize );
string[ 0 ] = '\0';
for ( i = 0; i < callStackSize; i++ ) {
idStr::snPrintf( string + strlen( string ), MAX_STRING_CHARS*2 - strlen( string ) - 1, "%s\n", strings[ i ] );
}
free( strings );
return string;
}
/*
==================
Sys_GetCallStackStr
==================
*/
const char * Sys_GetCallStackCurStr( int depth ) {
address_t array[ 32 ];
size_t size;
size = backtrace( (void **)array, Min( 32, depth ) );
return Sys_GetCallStackStr( array, (int)size );
}
/*
==================
Sys_GetCallStackCurAddressStr
==================
*/
const char * Sys_GetCallStackCurAddressStr( int depth ) {
return Sys_GetCallStackCurStr( depth );
}
#endif

View File

@@ -0,0 +1,105 @@
/*
===========================================================================
Doom 3 GPL Source Code
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
This file is part of the Doom 3 GPL Source Code (?Doom 3 Source Code?).
Doom 3 Source Code is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Doom 3 Source Code 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
along with Doom 3 Source Code. If not, see <http://www.gnu.org/licenses/>.
In addition, the Doom 3 Source Code is also subject to certain additional terms. You should have received a copy of these additional terms immediately following the terms and conditions of the GNU General Public License which accompanied the Doom 3 Source Code. If not, please request a copy in writing from id Software at the address below.
If you have questions concerning this license or the applicable additional terms, you may contact in writing id Software LLC, c/o ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA.
===========================================================================
*/
#include <stdio.h>
#include <sys/time.h>
#include <sched.h>
#include <errno.h>
/*
================
Sys_Milliseconds
================
*/
/* base time in seconds, that's our origin
timeval:tv_sec is an int:
assuming this wraps every 0x7fffffff - ~68 years since the Epoch (1970) - we're safe till 2038
using unsigned long data type to work right with Sys_XTimeToSysTime */
unsigned long sys_timeBase = 0;
/* current time in ms, using sys_timeBase as origin
NOTE: sys_timeBase*1000 + curtime -> ms since the Epoch
0x7fffffff ms - ~24 days
or is it 48 days? the specs say int, but maybe it's casted from unsigned int?
*/
int Sys_Milliseconds(void)
{
int curtime;
struct timeval tp;
gettimeofday(&tp, NULL);
if (!sys_timeBase) {
sys_timeBase = tp.tv_sec;
return tp.tv_usec / 1000;
}
curtime = (tp.tv_sec - sys_timeBase) * 1000 + tp.tv_usec / 1000;
return curtime;
}
#define STAT_BUF 100
int main(int argc, void *argv[]) {
int start = 30; // start waiting with 30 ms
int dec = 2; // decrement by 2 ms
int min = 4; // min wait test
int i, j, now, next;
int stats[STAT_BUF];
struct sched_param parm;
Sys_Milliseconds(); // init
// set schedule policy to see if that affects usleep
// (root rights required for that)
parm.sched_priority = 99;
if ( sched_setscheduler(0, SCHED_RR, &parm) != 0 ) {
printf("sched_setscheduler SCHED_RR failed: %s\n", strerror(errno) );
} else {
printf("sched_setscheduler SCHED_RR ok\n");
}
// now run the test
for( i = start ; i >= min ; i -= dec ) {
printf( "sleep %d ms", i );
for( j = 0 ; j < STAT_BUF ; j++ ) {
now = Sys_Milliseconds();
usleep(i*1000);
stats[j] = Sys_Milliseconds() - now;
}
for( j = 0; j < STAT_BUF; j++) {
if ( ! (j & 0xf) ) {
printf("\n");
}
printf( "%d ", stats[j] );
}
printf("\n");
}
return 0;
}

Some files were not shown because too many files have changed in this diff Show More