Overview
Comment: | More working in sound implementation (still incomplete, and some details are subject to being changed in future) |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
9692a28768646ea5413c37e25177cd42 |
User & Date: | user on 2021-10-10 00:08:25 |
Other Links: | manifest | tags |
Context
2021-10-14
| ||
01:14 | Complete implementation of (Order) block (mostly untested so far) check-in: 602616bb91 user: user tags: trunk | |
2021-10-10
| ||
00:08 | More working in sound implementation (still incomplete, and some details are subject to being changed in future) check-in: 9692a28768 user: user tags: trunk | |
2021-10-08
| ||
04:26 | More (still incomplete) implementation of (Order) block; also make a correction for the user flag blocks. check-in: df0935b0a3 user: user tags: trunk | |
Changes
Modified sound.c from [e89c4e6e03] to [79607a175f].
︙ | |||
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 | + - + + - + | static Uint8 sound_on; static Sint16 mmlvolume=32767; static SDL_AudioSpec spec; static WaveSound*standardsounds; static Uint16 nstandardsounds; static WaveSound*usersounds; static Uint16 nusersounds; static Uint8**user_sound_names; static FILE*l_fp; static long l_offset,l_size; static float wavevolume=1.0; static Uint8 needs_amplify=0; static Uint8*volatile wavesound; static volatile Uint32 wavelen; static void audio_callback(void*userdata,Uint8*stream,int len) { if(wavesound) { |
︙ | |||
89 90 91 92 93 94 95 | 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 | - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | Uint8*buf=0; ws->data=0; ws->len=0; l_fp=fp; l_offset=offset; l_size=size; if(!SDL_LoadWAV_RW(&my_rwops,0,&src,&buf,&len)) { |
︙ | |||
140 141 142 143 144 145 146 | 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 | + + + - + | optionquery[2]=Q_waveVolume; if(v=xrm_get_resource(resourcedb,optionquery,optionquery,3)) { needs_amplify=1; wavevolume=strtod(v,0); } optionquery[2]=Q_mmlVolume; if(v=xrm_get_resource(resourcedb,optionquery,optionquery,3)) mmlvolume=fmin(strtod(v,0)*32767.0,32767.0); if(wavevolume>0.00001) { load_sound_set(0); // Standard sounds load_sound_set(1); // User sounds |
︙ | |||
172 173 174 175 176 177 178 | 231 232 233 234 235 236 237 238 239 240 241 242 243 | + + + + + + | case TY_STRING: case TY_LEVELSTRING: if(!mmlvolume) break; break; } SDL_UnlockAudio(); } Uint16 find_user_sound(const char*name) { int i; for(i=0;i<nusersounds;i++) if(!strcmp(name,user_sound_names[i])) return i+0x0400; return 0x03FF; } |