diff options
author | Roy Marples <uberlord@gentoo.org> | 2006-07-23 00:57:02 +0000 |
---|---|---|
committer | Roy Marples <uberlord@gentoo.org> | 2006-07-23 00:57:02 +0000 |
commit | 3bb7e868925dd1e78fbe4e0508dd47be030da005 (patch) | |
tree | 007c05483690135bce29b3179fe9ad39b605fcd9 /games-rpg/eternal-lands/files | |
parent | Add ~x86-fbsd keyword. (diff) | |
download | gentoo-2-3bb7e868925dd1e78fbe4e0508dd47be030da005.tar.gz gentoo-2-3bb7e868925dd1e78fbe4e0508dd47be030da005.tar.bz2 gentoo-2-3bb7e868925dd1e78fbe4e0508dd47be030da005.zip |
Added patches to fix fonts and clean compile against all portage OpenAL
versions.
(Portage version: 2.1.1_pre3-r3)
Diffstat (limited to 'games-rpg/eternal-lands/files')
3 files changed, 239 insertions, 0 deletions
diff --git a/games-rpg/eternal-lands/files/digest-eternal-lands-1.3.0-r2 b/games-rpg/eternal-lands/files/digest-eternal-lands-1.3.0-r2 new file mode 100644 index 000000000000..2be8e9ed82f7 --- /dev/null +++ b/games-rpg/eternal-lands/files/digest-eternal-lands-1.3.0-r2 @@ -0,0 +1,6 @@ +MD5 f83902ed603926a9611ace5914a3fdc0 elc_130.tar.bz2 849004 +RMD160 e5dc66b2db5203a13707170046874392e1908a06 elc_130.tar.bz2 849004 +SHA256 ffcd5779a0516e5ec3f6c1add718653284689023a92fcb9dfa3917076d8be140 elc_130.tar.bz2 849004 +MD5 059df8128b11b19a76b54e9907072f00 eternal-lands.png 9955 +RMD160 2f9c8acd96214577cf8b8027f0d20fb1fe7574ff eternal-lands.png 9955 +SHA256 dd7d45cd9948fe7875ebd0bfcd1925d9b34e7606a223faf61d37a6dd2cd433fb eternal-lands.png 9955 diff --git a/games-rpg/eternal-lands/files/eternal-lands-1.3.0-font.patch b/games-rpg/eternal-lands/files/eternal-lands-1.3.0-font.patch new file mode 100644 index 000000000000..f8b3e5584545 --- /dev/null +++ b/games-rpg/eternal-lands/files/eternal-lands-1.3.0-font.patch @@ -0,0 +1,36 @@ +=================================================================== +RCS file: /cvsroot/elc/elc/font.c,v +retrieving revision 1.69 +retrieving revision 1.70 +diff -u -r1.69 -r1.70 +--- elc/elc/font.c 2006/05/23 07:25:03 1.69 ++++ elc/elc/font.c 2006/07/19 02:11:23 1.70 +@@ -995,22 +995,25 @@ + poor_man=0; + use_mipmaps=0; + +-#ifndef FONTS_FIX + fonts[0]->texture_id = load_texture_cache ("./textures/font.bmp", 0); ++#ifndef FONTS_FIX + fonts[1]->texture_id = load_texture_cache ("./textures/fontv.bmp", 0); + fonts[2]->texture_id = load_texture_cache ("./textures/font2.bmp", 0); + fonts[3]->texture_id = load_texture_cache ("./textures/font3.bmp", 0); + #else ++ // Force the selection of the base font. ++ add_multi_option("chat_font", "Type 1"); ++ add_multi_option("name_font", "Type 1"); + // Find what font's exist and load them + dp = opendir ("./textures/"); + if (dp == NULL) { + return 0; + } +- i = 0; ++ i = 1; + while ((ep = readdir (dp)) && i < FONTS_ARRAY_SIZE) { + strcpy(file, ""); + strcpy(file, ep->d_name); +- if (!strncasecmp(file, "font", 4) && !strcasecmp(file+strlen(file) - 4, ".bmp") && strncasecmp(file+strlen(file) - 10, "_alpha", 6) && strlen(file) + 11 <= 60) { ++ if (!strncasecmp(file, "font", 4) && !strcasecmp(file+strlen(file) - 4, ".bmp") && strncasecmp(file+strlen(file) - 10, "_alpha", 6) && strlen(file) + 11 <= 60 && strlen(file) > 8) { + // Get the filename, remove the .bmp and add _alpha.bmp to a copy, then replace the .bmp + file[strlen(file) - 4] = 0; + snprintf(str, sizeof(str), "./textures/%s", file); diff --git a/games-rpg/eternal-lands/files/eternal-lands-1.3.0-openal.patch b/games-rpg/eternal-lands/files/eternal-lands-1.3.0-openal.patch new file mode 100644 index 000000000000..f23d12b17b83 --- /dev/null +++ b/games-rpg/eternal-lands/files/eternal-lands-1.3.0-openal.patch @@ -0,0 +1,197 @@ +diff -u -b -B -r1.83 sound.c +--- sound.c 20 Jun 2006 15:05:46 -0000 1.83 ++++ sound.c 24 Jun 2006 14:42:29 -0000 +@@ -308,6 +309,66 @@ + #endif //NO_MUSIC + } + ++int loadWAVfile(char *filename, ALenum *al_format, ALvoid **al_data, ALsizei *al_size, ALuint *al_frequency) { ++ FILE *fp; ++ ++ fp = fopen(filename,"rb"); ++ if (fp) { ++ char id[4]; ++ Uint32 size; ++ Uint16 format_tag, channels, block_align, bits_per_sample; ++ Uint32 format_length, sample_rate, avg_bytes_sec, data_size; ++ fread(id, 1, 4, fp); ++ if (!strncmp(id, "RIFF",4)) { ++ fread(&size, 4, 1, fp); ++ fread(id, 1, 4, fp); ++ if (!strncmp(id,"WAVE",4)) { ++ fread(id, 1, 4, fp); ++ fread(&format_length, 4,1,fp); ++ fread(&format_tag, 2, 1, fp); ++ fread(&channels, 2, 1,fp); //1 mono, 2 stereo ++ channels=SDL_SwapLE16(channels); ++ fread(&sample_rate, 4, 1, fp); //like 44100, 22050, etc... ++ sample_rate=SDL_SwapLE32(sample_rate); ++ fread(&avg_bytes_sec, 4, 1, fp); //unused ++ fread(&block_align, 2, 1, fp); //unused ++ fread(&bits_per_sample, 2, 1, fp); //8 bit or 16 bit ++ bits_per_sample=SDL_SwapLE16(bits_per_sample); ++ fread(id, 1, 4, fp); ++ fread(&data_size, 4, 1, fp); ++ data_size=SDL_SwapLE32(data_size); ++ *al_data = (ALvoid *) malloc (data_size); ++ fread(*al_data, 1, data_size, fp); ++ *al_size = data_size; ++ *al_frequency = sample_rate; ++ if(channels == 1) { ++ if(bits_per_sample == 8) ++ *al_format = AL_FORMAT_MONO8; ++ else ++ *al_format = AL_FORMAT_MONO16; ++ } else { ++ if(bits_per_sample == 8) ++ *al_format = AL_FORMAT_STEREO8; ++ else ++ *al_format = AL_FORMAT_STEREO16; ++ } ++ return 1; ++ } ++ else { ++ LOG_ERROR("LoadWAVFile(%s): RIFF file but not a wave file\n",filename); ++ return 0; ++ } ++ } ++ else { ++ LOG_ERROR("LoadWAVFile(%s): not a RIFF file\n",filename); ++ return 0; ++ } ++ } else { ++ LOG_ERROR("LoadWAVFile(%s): can't open file\n",filename); ++ return 0; ++ } ++} ++ + #ifndef NEW_SOUND + ALuint get_loaded_buffer(int i) + { +@@ -315,26 +376,9 @@ + ALsizei size,freq; + ALenum format; + ALvoid *data; +- ALboolean loop; +- FILE *fin; + + if(!alIsBuffer(sound_buffer[i])) + { +- // XXX FIXME (Grum): You have got to be kidding me... +- // alutLoadWAVFile doesn't provide any way to check if loading +- // a file succeeded. Well, at least, let's check if the file +- // actually exists... +- // Maybe use alutLoadWAV? But that doesn't seem to exist on +- // OS/X... +- fin = fopen (sound_files[i], "r"); +- if (fin == NULL) +- { +- LOG_ERROR(snd_wav_load_error, sound_files[i]); +- return 0; +- } +- // okay, the file exists and is readable, close it +- fclose (fin); +- + alGenBuffers(1, sound_buffer+i); + + if((error=alGetError()) != AL_NO_ERROR) +@@ -344,14 +388,13 @@ + have_music=0; + } + +-#ifdef OSX +- // OS X alutLoadWAVFile doesn't have a loop option... Oh well :-) +- alutLoadWAVFile (sound_files[i], &format, &data, &size, &freq); +-#else +- alutLoadWAVFile (sound_files[i], &format, &data, &size, &freq, &loop); +-#endif ++ if(loadWAVfile(sound_files[i], &format, &data, &size, &freq)) { + alBufferData(sound_buffer[i],format,data,size,freq); +- alutUnloadWAV(format,data,size,freq); ++ free(data); ++ } else { ++ alDeleteBuffers(1,sound_buffer+i); ++ return 0; ++ } + } + return sound_buffer[i]; + } +@@ -372,27 +415,10 @@ + if (!pSample->loaded_status) + {//this file is not currently loaded + +- //try to open the file +-#ifndef OSX +- alutLoadWAVFile(szPath,&pSample->format,&data,&pSample->size,&pSample->freq,&loop); +-#else +- alutLoadWAVFile(szPath,&pSample->format,&data,&pSample->size,&pSample->freq); +-#endif +- if(!data) +- {//couldn't load the file +- #ifdef ELC +- LOG_ERROR("%s: %s",snd_buff_error, "NO SOUND DATA"); +- #else +- printf("ensure_sample_loaded : alutLoadWAVFile(%s) = %s\n", +- szPath, "NO SOUND DATA"); +- #endif +- return 1; +- } +- +- //create a buffer + alGenBuffers(1, pBuffer); ++ + if((error=alGetError()) != AL_NO_ERROR) +- {//couldn't generate a buffer ++ { + #ifdef ELC + LOG_ERROR("%s: %s",snd_buff_error, alGetString(error)); + #else +@@ -401,15 +427,16 @@ + *pBuffer=0; + return 2; + } +- //send this data to the buffer ++ ++ if(loadWAVFile(szPath,&pSample->format,&data,&pSample->size,&pSample->freq)) { + alBufferData(*pBuffer,pSample->format,data,pSample->size,pSample->freq); +- if((error=alGetError()) != AL_NO_ERROR) +- { +- #ifdef ELC ++ //send this data to the buffer ++ if((error=alGetError()) != AL_NO_ERROR) { ++#ifdef ELC + LOG_ERROR("%s: %s",snd_buff_error, alGetString(error)); +- #else ++#else + printf("ensure_sample_loaded ['%s',#d]: alBufferData(%s) = %s\n",szPath, index, alGetString(error)); +- #endif ++#endif + alDeleteBuffers(1, pBuffer); + return 3; + } +@@ -417,13 +444,21 @@ + alGetBufferi(*pBuffer,AL_BITS,&pSample->bits); + alGetBufferi(*pBuffer,AL_CHANNELS,&pSample->channels); + pSample->length = (pSample->size*1000) / ((pSample->bits >> 3)*pSample->channels*pSample->freq); +- +- //get rid of the temporary data +- alutUnloadWAV(pSample->format,data,pSample->size,pSample->freq); +- } ++ free(data); + + pSample->loaded_status = 1; + return 0; ++ } else {//couldn't load the file ++#ifdef ELC ++ LOG_ERROR("%s: %s",snd_buff_error, "NO SOUND DATA"); ++#else ++ printf("ensure_sample_loaded : loadWAVFile(%s) = %s\n", ++ szPath, "NO SOUND DATA"); ++#endif ++ return 1; ++ } ++ ++ } + } + #endif //NEW_SOUND + |