⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 snd_loc.pas

📁 雷神之锤2(Quake2)Delphi源码
💻 PAS
字号:
{----------------------------------------------------------------------------}
{                                                                            }
{ File(s): snd_loc.h                                                         }
{ Content: Quake2\ref_soft\ sound structures and constants                   }
{                                                                            }
{ Initial conversion by : Massimo Soricetti (max-67@libero.it)               }
{ Initial conversion on : 09-Jan-2002                                        }
{                                                                            }
{ This File contains part of convertion of Quake2 source to ObjectPascal.    }
{ More information about this project can be found at:                       }
{ http://www.sulaco.co.za/quake2/                                            }
{                                                                            }
{ Copyright (C) 1997-2001 Id Software, Inc.                                  }
{                                                                            }
{ 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.                       }
{                                                                            }
{----------------------------------------------------------------------------}
{ Updated on : 16-Feb-2002                                                   }
{ Updated by : Skaljac Bojan                                                 }
{                                                                            }
{ Updated on : 03-Jun-2002                                                   }
{ Updated by : Juha Hartikainen (juha@linearteam.org)                                                 }
{ - Changed to use vec3_t declaration from q_shared.pas                                                                           }
{----------------------------------------------------------------------------}
{ * Still dependent (to compile correctly) on:                               }
{ none                                                                       }
{----------------------------------------------------------------------------}
{ * TODO:                                                                    }
{ none                                                                       }
{----------------------------------------------------------------------------}

unit snd_loc;

interface

uses
  q_shared,
  g_local;

// !!! if this is changed, the asm code must change !!!
type
  portable_samplepair_p = ^portable_samplepair_t;
  portable_samplepair_t = record
    left: Integer;
    right: Integer;
  end;

  sfxcache_p = ^sfxcache_t;
  sfxcache_t = record
    length,
    loopstart,
    speed,			// not needed, because converted on load?
    width,
    stereo: integer;
    data: array[0..0] of byte;	// variable sized
  end;

  sfx_p = ^sfx_t;
  sfx_t = record
    name: array[0..MAX_QPATH - 1] of char;
    registration_sequence: integer;
    cache: sfxcache_p;
    truename: PChar;
  end;

  // a playsound_t will be generated by each call to S_StartSound,
  // when the mixer reaches playsound->begin, the playsound will
  // be assigned to a channel
  playsound_p = ^playsound_t;
  playsound_t = record
    prev, next   : playsound_p;
    sfx          : sfx_p;
    volume,
    attenuation  : Single;
    entnum,
    entchannel   : Integer;
    fixed_origin : qboolean; // use origin field instead of entnum's origin
    origin       : vec3_t;
    _begin       : Cardinal;// begin on this sample
  end;

  dma_p = ^dma_t;
  dma_t = record
    channels,
    samples,		     	 // mono samples in buffer
    submission_chunk,	 // don't mix less than this #
    samplepos,			   // in mono samples
    samplebits,
    speed: integer;
    buffer: PByte;     // on Byte array
  end;

  // !!! if this is changed, the asm code must change !!!
  channel_p = ^channel_t;
  channel_t = record
    sfx: sfx_p;          // sfx number
    leftvol,		         // 0-255 volume
    rightvol,		         // 0-255 volume
    _end,			           // end time in global paintsamples
    pos,			           // sample position in sfx
    looping,		         // where to loop, -1 = no looping OBSOLETE?
    entnum,			         // to allow overriding a specific sound
    entchannel: integer; //
    origin: vec3_t;	     // only use if fixed_origin is set
    dist_mult: vec_t; 	 // distance multiplier (attenuation/clipK)
    master_vol: integer; // 0-255 master volume
    fixed_origin,	       // use origin instead of fetching entnum's origin
    autosound: qboolean; // from an entity->sound, cleared each frame
  end;

  wavinfo_p = ^wavinfo_t;
  wavinfo_t = record
    rate,
    width,
    channels,
    loopstart,
    samples,
    dataofs: integer;		// chunk starts this many bytes from file start
  end;


const
  MAX_CHANNELS = 32;
  MAX_RAW_SAMPLES	= 8192;


implementation

end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -