You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(44) |
Aug
(36) |
Sep
(5) |
Oct
|
Nov
(6) |
Dec
(2) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(2) |
Sep
|
Oct
|
Nov
|
Dec
(1) |
2008 |
Jan
|
Feb
|
Mar
|
Apr
(87) |
May
(54) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <dv...@us...> - 2008-05-27 21:15:33
|
Revision: 278 http://dunelegacy.svn.sourceforge.net/dunelegacy/?rev=278&view=rev Author: dvalin Date: 2008-05-27 14:15:21 -0700 (Tue, 27 May 2008) Log Message: ----------- update stuff for shai_hulud's preference on windows as well as add libsamplerate Modified Paths: -------------- branches/dunks/config.py.example Modified: branches/dunks/config.py.example =================================================================== --- branches/dunks/config.py.example 2008-05-27 21:09:29 UTC (rev 277) +++ branches/dunks/config.py.example 2008-05-27 21:15:21 UTC (rev 278) @@ -1,6 +1,12 @@ -SDL_INCLUDE_PATH = r"E:\projects\include\SDL\SDL-1.2.11\include" -SDL_LIB_PATH = r"E:\projects\include\SDL\SDL-1.2.11\lib" -ZLIB_INCLUDE_PATH = r"E:\projects\include\zlib123-dll\include" -ZLIB_LIB_PATH = r"E:\projects\include\zlib123-dll\lib" -ZZIP_INCLUDE_PATH = "E:\projects\include\zziplib-0.10.82-msvc6-lib\include" -ZZIP_LIB_PATH = "E:\projects\include\zziplib-0.10.82-msvc6-lib\lib" +SDL_INCLUDE_PATH = r"c:\tmp\SDL-1.2.13\include" +SDL_LIB_PATH = r"c:\tmp\SDL-1.2.13\lib" +SDLNET_INCLUDE_PATH = r"c:\tmp\SDL_net-1.2.7\include" +SDLNET_LIB_PATH = r"c:\tmp\SDL_net-1.2.7\lib" +SDLMIXER_INCLUDE_PATH = r"c:\tmp\SDL_mixer-1.2.8\include" +SDLMIXER_LIB_PATH = r"c:\tmp\SDL_mixer-1.2.8\lib" +SDLTTF_INCLUDE_PATH = r"c:\tmp\SDL_ttf-2.0.9\include" +SDLTTF_LIB_PATH = r"c:\tmp\SDL_ttf-2.0.9\lib" +BOOST_INCLUDE_PATH = r"C:\Program Files\boost\boost_1_35_0" +BOOST_LIB_PATH = r"C:\Program Files\boost\boost_1_35_0\lib" +LIBSAMPLERATE_INCLUDE_PATH = r"C:\tmp\libsamplerate-0.1.3" +LIBSAMPLERATE_LIB_PATH = r"C:\tmp\libsamplerate-0.1.3" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dv...@us...> - 2008-05-27 21:09:32
|
Revision: 277 http://dunelegacy.svn.sourceforge.net/dunelegacy/?rev=277&view=rev Author: dvalin Date: 2008-05-27 14:09:29 -0700 (Tue, 27 May 2008) Log Message: ----------- drop zziplib & zlib stuff Modified Paths: -------------- branches/dunks/SConstruct Modified: branches/dunks/SConstruct =================================================================== --- branches/dunks/SConstruct 2008-05-27 21:00:17 UTC (rev 276) +++ branches/dunks/SConstruct 2008-05-27 21:09:29 UTC (rev 277) @@ -5,10 +5,6 @@ # default to using sdl-config if not on windows opts.Add('SDL_INCLUDE_PATH', 'include path for SDL', '') opts.Add('SDL_LIB_PATH', 'lib path for SDL', '') -opts.Add('ZLIB_INCLUDE_PATH', 'include path for zlib', '') -opts.Add('ZLIB_LIB_PATH', 'lib path for zlib', '') -opts.Add('ZZIP_INCLUDE_PATH', 'include path for zlib', '') -opts.Add('ZZIP_LIB_PATH', 'lib path for zlib', '') opts.Add('BOOST_INCLUDE_PATH', 'include path for boost', '') # need to get two paths as far as i can tell. these can probably be calculated somehow This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dv...@us...> - 2008-05-27 21:00:50
|
Revision: 276 http://dunelegacy.svn.sourceforge.net/dunelegacy/?rev=276&view=rev Author: dvalin Date: 2008-05-27 14:00:17 -0700 (Tue, 27 May 2008) Log Message: ----------- don't bundle libsamplerate, link against external library in stead Modified Paths: -------------- branches/dunks/SConstruct branches/dunks/src/SConscript branches/dunks/src/pakfile/sound/Vocfile.cpp branches/dunks/src/pakfile/sound/adl/adl.cpp Removed Paths: ------------- branches/dunks/include/pakfile/sound/IntegratedLibSampleRate/ branches/dunks/src/pakfile/sound/IntegratedLibSampleRate/ Modified: branches/dunks/SConstruct =================================================================== --- branches/dunks/SConstruct 2008-05-27 16:34:45 UTC (rev 275) +++ branches/dunks/SConstruct 2008-05-27 21:00:17 UTC (rev 276) @@ -23,7 +23,7 @@ env.Append(CPPPATH="#include") if sys.platform != "win32": - env.ParseConfig('sdl-config --cflags --libs') + env.ParseConfig('pkg-config --cflags sdl samplerate') env.Append(CCFLAGS=["-Wall", "-pedantic", "-O0"]) #, "-Werror"]) #env.Append(CCFLAGS=["-Wall", "-Werror", "-O2", "-ffast-math", "-funroll-loops"]) #env.Append(LINKFLAGS = ["-ffast-math"]) @@ -39,6 +39,7 @@ "SDL_mixer", "SDL_net", "SDL_ttf", + "samplerate", ]) Modified: branches/dunks/src/SConscript =================================================================== --- branches/dunks/src/SConscript 2008-05-27 16:34:45 UTC (rev 275) +++ branches/dunks/src/SConscript 2008-05-27 21:00:17 UTC (rev 276) @@ -39,10 +39,6 @@ "pakfile/Animation.cpp", "pakfile/Stringfile.cpp", "pakfile/sound/Vocfile.cpp", - "pakfile/sound/IntegratedLibSampleRate/samplerate.c", - "pakfile/sound/IntegratedLibSampleRate/src_linear.c", - "pakfile/sound/IntegratedLibSampleRate/src_sinc.c", - "pakfile/sound/IntegratedLibSampleRate/src_zoh.c", "pakfile/sound/adl/adl.cpp", "pakfile/sound/adl/emuopl.cpp", "pakfile/sound/adl/fmopl.cpp" @@ -79,11 +75,7 @@ "State.cpp", "TopLevelState.cpp", "SoundPlayerClass.cpp", - "pakfile/Vocfile.cpp", - "pakfile/IntegratedLibSampleRate/samplerate.c", - "pakfile/IntegratedLibSampleRate/src_linear.c", - "pakfile/IntegratedLibSampleRate/src_sinc.c", - "pakfile/IntegratedLibSampleRate/src_zoh.c" + "pakfile/Vocfile.cpp" ] #gamelib = env.StaticLibrary("dune_game", all_sources) Modified: branches/dunks/src/pakfile/sound/Vocfile.cpp =================================================================== --- branches/dunks/src/pakfile/sound/Vocfile.cpp 2008-05-27 16:34:45 UTC (rev 275) +++ branches/dunks/src/pakfile/sound/Vocfile.cpp 2008-05-27 21:00:17 UTC (rev 276) @@ -19,7 +19,7 @@ */ #include "pakfile/sound/Vocfile.h" -#include "pakfile/sound/IntegratedLibSampleRate/samplerate.h" +#include <samplerate.h> #include <string> #include <SDL_mixer.h> #include <math.h> Modified: branches/dunks/src/pakfile/sound/adl/adl.cpp =================================================================== --- branches/dunks/src/pakfile/sound/adl/adl.cpp 2008-05-27 16:34:45 UTC (rev 275) +++ branches/dunks/src/pakfile/sound/adl/adl.cpp 2008-05-27 21:00:17 UTC (rev 276) @@ -57,7 +57,7 @@ #include "pakfile/sound/adl/adl.h" #include "pakfile/sound/adl/emuopl.h" -#include "pakfile/sound/IntegratedLibSampleRate/samplerate.h" +#include <samplerate.h> #define BUFSIZE 65536 // Sound buffer size in samples #define NUM_SAMPLES_OF_SILENCE 10 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dv...@us...> - 2008-05-27 16:35:57
|
Revision: 275 http://dunelegacy.svn.sourceforge.net/dunelegacy/?rev=275&view=rev Author: dvalin Date: 2008-05-27 09:34:45 -0700 (Tue, 27 May 2008) Log Message: ----------- renamed to Stringfile.cpp Removed Paths: ------------- branches/dunks/src/pakfile/StringFile.cpp Deleted: branches/dunks/src/pakfile/StringFile.cpp =================================================================== --- branches/dunks/src/pakfile/StringFile.cpp 2008-05-04 19:26:33 UTC (rev 274) +++ branches/dunks/src/pakfile/StringFile.cpp 2008-05-27 16:34:45 UTC (rev 275) @@ -1,261 +0,0 @@ -#include "pakfile/StringFile.h" -#include "ResMan.h" -#include <SDL_endian.h> -#include <SDL.h> -#include <SDL_rwops.h> -#include <iostream> -#include <string> - -StringFile::StringFile(std::string stringFileName) { - int bufsize; - unsigned char* bufFiledata = ResMan::Instance()->readFile(stringFileName.c_str(), &bufsize); - Uint16* index; - SDL_RWops* RWop = SDL_RWFromMem(bufFiledata, bufsize); - - if(RWop == NULL) { - fprintf(stderr, "StringFile: RWop == NULL!\n"); - exit(EXIT_FAILURE); - } - - if(bufsize <= 0) { - fprintf(stderr,"StringFile: Cannot determine size!\n"); - exit(EXIT_FAILURE); - } - - if(bufsize < 2) { - fprintf(stderr, "StringFile: Invalid string file: File too small!\n"); - exit(EXIT_FAILURE); - } - - if(SDL_RWseek(RWop,0,SEEK_SET) != 0) { - fprintf(stderr,"StringFile: Seeking string file failed!\n"); - exit(EXIT_FAILURE); - } - - if( (bufFiledata = (unsigned char*) malloc(bufsize)) == NULL) { - fprintf(stderr,"StringFile: Allocating memory failed!\n"); - exit(EXIT_FAILURE); - } - - if(SDL_RWread(RWop, bufFiledata, bufsize, 1) != 1) { - fprintf(stderr,"StringFile: Reading string file failed!\n"); - exit(EXIT_FAILURE); - } - - numStrings = ((int)SDL_SwapLE16(((Uint16*) bufFiledata)[0]))/2 - 1; - index = (Uint16*) bufFiledata; - for(int i=0; i <= numStrings; i++) { - index[i] = SDL_SwapLE16(index[i]); - } - - stringArray = new std::string[numStrings]; - - for(int i=0; i < numStrings;i++) { - std::string tmp = (const char*) (bufFiledata+index[i]); - stringArray[i] = decodeString(tmp); - } - - free(bufFiledata); - SDL_RWclose(RWop); -} - -StringFile::~StringFile() { - delete [] stringArray; -} - -/// This methode decodes a string to ANSI Code -/** - The parameter text is decoded to ANSI Code and returned - \param text Text to decode - \return The decoded text -*/ -std::string StringFile::decodeString(std::string text) { - std::string out = ""; - unsigned char databyte; - - for(unsigned int i = 0; i < text.length(); i++) { - databyte = text[i]; - - switch(databyte) { - case 0x00: break; - case 0x0C: out += "\n"; break; - case 0x0D: out += "\n"; break; - - case 0x80: out += " t"; break; - case 0x81: out += " a"; break; - case 0x82: out += " s"; break; - case 0x83: out += " i"; break; - case 0x84: out += " o"; break; - case 0x85: out += " "; break; // maybe something else - case 0x86: out += " w"; break; - case 0x87: out += " b"; break; - case 0x88: out += "e "; break; - case 0x89: out += "er"; break; - case 0x8A: out += "en"; break; - case 0x8B: out += "es"; break; - case 0x8C: out += "ed"; break; - case 0x8D: out += "ea"; break; - case 0x8E: out += "el"; break; - case 0x8F: out += "em"; break; - - case 0x90: out += "th"; break; - case 0x91: out += "t "; break; - case 0x92: out += "ti"; break; - case 0x93: out += "te"; break; - case 0x94: out += "to"; break; - case 0x95: out += "tr"; break; - case 0x96: out += "ta"; break; - case 0x97: out += "ts"; break; - case 0x98: out += "an"; break; - case 0x99: out += "ar"; break; - case 0x9A: out += "at"; break; - case 0x9B: out += "al"; break; - case 0x9C: out += "ac"; break; - case 0x9D: out += "a "; break; - case 0x9E: out += "as"; break; - case 0x9F: out += "ay"; break; - - case 0xA0: out += "in"; break; - case 0xA1: out += "is"; break; - case 0xA2: out += "it"; break; - case 0xA3: out += "ic"; break; - case 0xA4: out += "il"; break; - case 0xA5: out += "io"; break; - case 0xA6: out += "ie"; break; - case 0xA7: out += "ir"; break; - case 0xA8: out += "n "; break; - case 0xA9: out += "nd"; break; - case 0xAA: out += "nt"; break; - case 0xAB: out += "ng"; break; - case 0xAC: out += "ne"; break; - case 0xAD: out += "ns"; break; - case 0xAE: out += "ni"; break; - case 0xAF: out += "no"; break; - - case 0xB0: out += "on"; break; - case 0xB1: out += "or"; break; - case 0xB2: out += "o "; break; - case 0xB3: out += "ou"; break; - case 0xB4: out += "of"; break; - case 0xB5: out += "om"; break; - case 0xB6: out += "os"; break; - case 0xB7: out += "ow"; break; - case 0xB8: out += "s "; break; - case 0xB9: out += "st"; break; - case 0xBA: out += "se"; break; - case 0xBB: out += "sp"; break; - case 0xBC: out += "s."; break; - case 0xBD: out += "si"; break; - case 0xBE: out += "sc"; break; - case 0xBF: out += "sa"; break; - - case 0xC0: out += "re"; break; - case 0xC1: out += "r "; break; - case 0xC2: out += "ro"; break; - case 0xC3: out += "ri"; break; - case 0xC4: out += "ra"; break; - case 0xC5: out += "rd"; break; - case 0xC6: out += "ru"; break; - case 0xC7: out += "rr"; break; - case 0xC8: out += "l "; break; - case 0xC9: out += "ll"; break; - case 0xCA: out += "la"; break; - case 0xCB: out += "le"; break; - case 0xCC: out += "li"; break; - case 0xCD: out += "le"; break; - case 0xCE: out += "lo"; break; - case 0xCF: out += "ld"; break; - - case 0xD0: out += "he"; break; - case 0xD1: out += "hi"; break; - case 0xD2: out += "ha"; break; - case 0xD3: out += "h "; break; - case 0xD4: out += "ho"; break; - case 0xD5: out += "ht"; break; - case 0xD6: out += "hr"; break; - case 0xD7: out += "hu"; break; - case 0xD8: out += "ce"; break; - case 0xD9: out += "ct"; break; - case 0xDA: out += "co"; break; - case 0xDB: out += "ca"; break; - case 0xDC: out += "ck"; break; - case 0xDD: out += "ch"; break; - case 0xDE: out += "cl"; break; - case 0xDF: out += "cr"; break; - - case 0xE0: out += "d "; break; - case 0xE1: out += "de"; break; - case 0xE2: out += "di"; break; - case 0xE3: out += "du"; break; - case 0xE4: out += "d,"; break; - case 0xE5: out += "d."; break; - case 0xE6: out += "do"; break; - case 0xE7: out += "da"; break; - case 0xE8: out += "un"; break; - case 0xE9: out += "us"; break; - case 0xEA: out += "ur"; break; - case 0xEB: out += "uc"; break; - case 0xEC: out += "ut"; break; - case 0xED: out += "ul"; break; - case 0xEE: out += "ua"; break; - case 0xEF: out += "ui"; break; - - case 0xF0: out += "pl"; break; - case 0xF1: out += "pe"; break; - case 0xF2: out += "po"; break; - case 0xF3: out += "pi"; break; - case 0xF4: out += "pr"; break; - case 0xF5: out += "pa"; break; - case 0xF6: out += "pt"; break; - case 0xF7: out += "pp"; break; - case 0xF8: out += "me"; break; - case 0xF9: out += "ma"; break; - case 0xFA: out += "mo"; break; - case 0xFB: out += "mi"; break; - case 0xFC: out += "mp"; break; - case 0xFD: out += "m "; break; - case 0xFE: out += "mb"; break; - case 0xFF: out += "mm"; break; - - case 0x1B: { - // special character - i++; - if(i == text.length()) { - fprintf(stderr,"StringFile:decodeString: Special character escape sequence at end of string!\n"); - exit(EXIT_FAILURE); - } - - unsigned char special = text[i]; - switch(special) { - // e.g. german "umlaute" - case 0x02: out += (unsigned char) 252 /*"ue"*/; break; - case 0x05: out += (unsigned char) 228 /*"ae"*/; break; - case 0x0F: out += (unsigned char) 197 /*"Ae"*/; break; - case 0x15: out += (unsigned char) 246 /*"oe"*/; break; - case 0x1B: out += (unsigned char) 220 /*"Ue"*/; break; - case 0x62: out += (unsigned char) 223 /*"ss"*/; break; - default: { - char tmp[20]; - sprintf(tmp,"---Unknown char:%X---",special); - out += tmp; - } break; - }; - - } break; - - case 0x1F: out += "."; break; - - default: { - if((databyte & 0x80) == 0x80) { - char tmp[20]; - sprintf(tmp,"---Unknown char:%X---",databyte); - out += tmp; - } else { - out += databyte; - } - } break; - } - } - - return out; -} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dv...@us...> - 2008-05-04 19:26:36
|
Revision: 274 http://dunelegacy.svn.sourceforge.net/dunelegacy/?rev=274&view=rev Author: dvalin Date: 2008-05-04 12:26:33 -0700 (Sun, 04 May 2008) Log Message: ----------- remove Window.cpp Modified Paths: -------------- branches/dunks/src/SConscript Modified: branches/dunks/src/SConscript =================================================================== --- branches/dunks/src/SConscript 2008-05-04 19:25:27 UTC (rev 273) +++ branches/dunks/src/SConscript 2008-05-04 19:26:33 UTC (rev 274) @@ -54,7 +54,6 @@ "gui2/Button.cpp", "gui2/VBox.cpp", "gui2/Label.cpp", - "gui2/Window.cpp" ] This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dv...@us...> - 2008-05-04 19:25:33
|
Revision: 273 http://dunelegacy.svn.sourceforge.net/dunelegacy/?rev=273&view=rev Author: dvalin Date: 2008-05-04 12:25:27 -0700 (Sun, 04 May 2008) Log Message: ----------- move... Added Paths: ----------- branches/dunks/include/pakfile/sound/IntegratedLibSampleRate/ Removed Paths: ------------- branches/dunks/include/pakfile/IntegratedLibSampleRate/ branches/dunks/include/pakfile/StringFile.h branches/dunks/include/pakfile/Vocfile.h Deleted: branches/dunks/include/pakfile/StringFile.h =================================================================== --- branches/dunks/include/pakfile/StringFile.h 2008-05-04 19:24:47 UTC (rev 272) +++ branches/dunks/include/pakfile/StringFile.h 2008-05-04 19:25:27 UTC (rev 273) @@ -1,50 +0,0 @@ -#ifndef STRINGFILE_H_INCLUDED -#define STRINGFILE_H_INCLUDED - -#include <string> - - -#define MISSION_DESCRIPTION 0 -#define MISSION_WIN 1 -#define MISSION_LOSE 2 -#define MISSION_ADVICE 3 - - -/// A class for loading a encoded textfiles. -/** - This class can read encoded textfiles and return their content in decoded ANSI Code. -*/ -class StringFile -{ -public: - StringFile(std::string stringFileName); - ~StringFile(); - - /// This method returns the briefing/debriefing text. - /** - This method returns the briefing/debriefing text for the mission specified by the parameter mission. The second - parameter specifies the kind of briefing/debriefing. - \param mission the mission number (0=House description; 1,2,...,9 = mission description). - \param texttype one of MISSION_DESCRIPTION, MISSION_WIN, MISSION_LOSE, MISSION_ADVICE - \return the text for this mission and of this type. - */ - std::string getString(unsigned int mission, unsigned int texttype) { - int index = mission*4+texttype; - - if(index < numStrings) { - return stringArray[index]; - } else { - return "StringFile::getString(): mission number or text type is invalid!\n"; - } - } - std::string getString(int i){ - return stringArray[i]; - } - -private: - std::string decodeString(std::string text); - std::string *stringArray; - int numStrings; -}; - -#endif // STRINGFILE_H_INCLUDED Deleted: branches/dunks/include/pakfile/Vocfile.h =================================================================== --- branches/dunks/include/pakfile/Vocfile.h 2008-05-04 19:24:47 UTC (rev 272) +++ branches/dunks/include/pakfile/Vocfile.h 2008-05-04 19:25:27 UTC (rev 273) @@ -1,19 +0,0 @@ -#ifndef VOCFILE_H_INCLUDED -#define VOCFILE_H_INCLUDED - -#include <SDL.h> -#include <SDL_rwops.h> -#include <SDL_mixer.h> - -/** - Try to load a VOC from the RWop. Returns a pointer to Mix_Chunk. - It is the callers responsibility to deallocate that data again later on - with Mix_FreeChunk()! - \param rwop The source SDL_RWops as a pointer. The sample is loaded from this VOC-File. - \param freesrc A non-zero value mean it will automatically close/free the src for you. - \return a pointer to the sample as a Mix_Chunk. NULL is returned on errors. - */ -extern Mix_Chunk* LoadVOC_RW(SDL_RWops* rwop, int freesrc); - -#endif // VOCFILE_H_INCLUDED - Copied: branches/dunks/include/pakfile/sound/IntegratedLibSampleRate (from rev 272, branches/dunks/include/pakfile/IntegratedLibSampleRate) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dv...@us...> - 2008-05-04 19:19:11
|
Revision: 271 http://dunelegacy.svn.sourceforge.net/dunelegacy/?rev=271&view=rev Author: dvalin Date: 2008-05-04 12:19:07 -0700 (Sun, 04 May 2008) Log Message: ----------- ouch, this one got lost as well :( Added Paths: ----------- branches/dunks/src/pakfile/sound/Vocfile.cpp Added: branches/dunks/src/pakfile/sound/Vocfile.cpp =================================================================== --- branches/dunks/src/pakfile/sound/Vocfile.cpp (rev 0) +++ branches/dunks/src/pakfile/sound/Vocfile.cpp 2008-05-04 19:19:07 UTC (rev 271) @@ -0,0 +1,599 @@ +/* This code is based on code from the ScummVM project + * Copyright (C) 2001 Ludvig Strigeus + * Copyright (C) 2001-2006 The ScummVM project + * + * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "pakfile/sound/Vocfile.h" +#include "pakfile/sound/IntegratedLibSampleRate/samplerate.h" +#include <string> +#include <SDL_mixer.h> +#include <math.h> + +using namespace std; + +#define VOC_CODE_TERM 0 +#define VOC_CODE_DATA 1 +#define VOC_CODE_CONT 2 +#define VOC_CODE_SILENCE 3 +#define VOC_CODE_MARKER 4 +#define VOC_CODE_TEXT 5 +#define VOC_CODE_LOOPBEGIN 6 +#define VOC_CODE_LOOPEND 7 +#define VOC_CODE_EXTENDED 8 +#define VOC_CODE_DATA_16 9 + + +#define NUM_SAMPLES_OF_SILENCE 160 + + +/** + * Take a sample rate parameter as it occurs in a VOC sound header, and + * return the corresponding sample frequency. + * + * This method has special cases for the standard rates of 11025 and 22050 kHz, + * which due to limitations of the format, cannot be encoded exactly in a VOC + * file. As a consequence, many game files have sound data sampled with those + * rates, but the VOC marks them incorrectly as 11111 or 22222 kHz. This code + * works around that and "unrounds" the sampling rates. + */ +Uint32 getSampleRateFromVOCRate(Uint8 vocSR) { + if (vocSR == 0xa5 || vocSR == 0xa6) { + return 11025; + } else if (vocSR == 0xd2 || vocSR == 0xd3) { + return 22050; + } else { + int sr = 1000000L / (256L - vocSR); + // inexact sampling rates occur e.g. in the kitchen in Monkey Island, + // very easy to reach right from the start of the game. + //warning("inexact sample rate used: %i (0x%x)", sr, vocSR); + return sr; + } +} + +/** + This method decodes a voc-file and returns a pointer the decoded data. This memory is + allocated with malloc() and should be freed with free(). The size of the decoded data is + returned through the parameter size and the sampling rate of this voc-file is returned + through the parameter rate. + The kind of voc-files that this function can decode is very restricted. Only voc-files + with 8-bit unsigned sound samples, with no loops, no silence blocks, no extended blocks + and no markers are supported. + \param rwop An SDL_RWop that contains the voc-file + \param size The size of the decoded data in bytes + \param rate The sampling rate of the voc-file + \return A pointer to a memory block that contains the data. (Free it with free() when no longer needed) +*/ +static Uint8 *LoadVOC_RW(SDL_RWops* rwop, Uint32 &size, Uint32 &rate) { + Uint8 description[20]; + Uint16 offset; + Uint16 version; + Uint16 id; + + if(SDL_RWread(rwop,(char*) description,20,1) != 1) { + fprintf(stderr,"loadVOCFromStream: Invalid header!\n"); + return NULL; + } + + if (memcmp(description, "Creative Voice File", 19) != 0) { + fprintf(stderr,"loadVOCFromStream: Invalid header!\n"); + return NULL; + } + + if (description[19] != 0x1A) { + fprintf(stderr,"loadVOCFromStream: Invalid header!\n"); + return NULL; + } + + if(SDL_RWread(rwop,&offset,sizeof(offset),1) != 1) { + fprintf(stderr,"loadVOCFromStream: Invalid header!\n"); + return NULL; + } + offset = SDL_SwapLE16(offset); + + if(SDL_RWread(rwop,&version,sizeof(version),1) != 1) { + fprintf(stderr,"loadVOCFromStream: Invalid header!\n"); + return NULL; + } + version = SDL_SwapLE16(version); + + if(SDL_RWread(rwop,&id,sizeof(id),1) != 1) { + fprintf(stderr,"loadVOCFromStream: Invalid header!\n"); + return NULL; + } + id = SDL_SwapLE16(id); + + if(offset != sizeof(description) + sizeof(offset) + sizeof(version) + sizeof(id)) { + fprintf(stderr,"loadVOCFromStream: Invalid datablock offset in header!\n"); + return NULL; + } + + // 0x100 is an invalid VOC version used by German version of DOTT (Disk) and + // French version of Simon the Sorcerer 2 (CD) + if(!(version == 0x010A || version == 0x0114 || version == 0x0100)) { + fprintf(stderr,"loadVOCFromStream: Invalid version (0x%X) in header!\n",version); + return NULL; + } + + if(id != (~version + 0x1234)) { + fprintf(stderr,"loadVOCFromStream: Invalid id in header!\n"); + return NULL; + } + + int len; + Uint8 *ret_sound = NULL; + size = 0; + + Uint8 code; + rate = 0; + while (SDL_RWread(rwop,&code,sizeof(Uint8),1) == 1) { + if(code == VOC_CODE_TERM) { + return ret_sound; + } + + Uint8 tmp[3]; + if(SDL_RWread(rwop,tmp,1,3) != 3) { + fprintf(stderr,"loadVOCFromStream: Invalid block length!\n"); + return ret_sound; + } + len = tmp[0]; + len |= tmp[1] << 8; + len |= tmp[2] << 16; + + switch (code) { + case VOC_CODE_DATA: { + Uint8 time_constant; + if(SDL_RWread(rwop,&time_constant,sizeof(Uint8),1) != 1) { + fprintf(stderr,"loadVOCFromStream: Cannot read time constant!\n"); + return ret_sound; + } + + Uint8 packing; + if(SDL_RWread(rwop,&packing,sizeof(Uint8),1) != 1) { + fprintf(stderr,"loadVOCFromStream: Cannot read packing!\n"); + return ret_sound; + } + len -= 2; + Uint32 tmp_rate = getSampleRateFromVOCRate(time_constant); + if((rate != 0) && (rate != tmp_rate)) { + fprintf(stderr,"This voc-file contains data blocks with different sampling rates: old rate: %d, new rate: %d\n",rate,tmp_rate); + } + rate = tmp_rate; + + //fprintf(stderr,"VOC Data Block: Rate: %d, Packing: %d, Length: %d\n", rate, packing, len); + + if (packing == 0) { + if (size) { + ret_sound = (Uint8 *)realloc(ret_sound, size + len); + } else { + ret_sound = (Uint8 *)malloc(len); + } + + if(SDL_RWread(rwop,ret_sound + size,1,len) != len) { + fprintf(stderr,"loadVOCFromStream: Cannot read data!\n"); + return ret_sound; + } + + size += len; + } else { + fprintf(stderr,"VOC file packing %d unsupported!\n", packing); + } + } break; + + case VOC_CODE_SILENCE: { + Uint16 SilenceLength; + if(SDL_RWread(rwop,&SilenceLength,sizeof(Uint16),1) != 1) { + fprintf(stderr,"loadVOCFromStream: Cannot read silence length!\n"); + return ret_sound; + } + SilenceLength = SDL_SwapLE16(SilenceLength); + + Uint8 time_constant; + if(SDL_RWread(rwop,&time_constant,sizeof(Uint8),1) != 1) { + fprintf(stderr,"loadVOCFromStream: Cannot read time constant!\n"); + return ret_sound; + } + + Uint32 SilenceRate = getSampleRateFromVOCRate(time_constant); + + + Uint32 length = 0; + if(rate != 0) { + length = (Uint32) ((((double) SilenceRate)/((double) rate)) * SilenceLength) + 1; + } else { + fprintf(stderr,"The silence in this voc-file is right at the beginning. Therefore it is not possible to adjust the silence sample rate to the sample rate of the other sound data in this file!\n"); + length = SilenceLength; + } + + if (size) { + ret_sound = (Uint8 *)realloc(ret_sound, size + length); + } else { + ret_sound = (Uint8 *)malloc(length); + } + + memset(ret_sound + size,0x80,length); + + size += length; + + } break; + + case VOC_CODE_CONT: + case VOC_CODE_MARKER: + case VOC_CODE_TEXT: + case VOC_CODE_LOOPBEGIN: + case VOC_CODE_LOOPEND: + case VOC_CODE_EXTENDED: + case VOC_CODE_DATA_16: + default: + fprintf(stderr,"Unhandled code in VOC file : %d\n", code); + return ret_sound; + } + } + return ret_sound; +} + +inline Uint8 Float2Uint8(float x) { + int val = lround(x*127.0 + 128.0); + if(val < 0) { + val = 0; + } else if (val > 255) { + val = 255; + } + + return (Uint8) val; +} + +inline Sint8 Float2Sint8(float x) { + int val = lround(x*127.0); + if(val < -128) { + val = -128; + } else if (val > 127) { + val = 127; + } + + return (Sint8) val; +} + +inline Uint16 Float2Uint16(float x) { + int val = lround(x*32767.0 + 32768.0); + if(val < 0) { + val = 0; + } else if (val > 65535) { + val = 65535; + } + + return (Uint16) val; +} + +inline Sint16 Float2Sint16(float x) { + int val = lround(x*32767.0); + if(val < -32768) { + val = -32768; + } else if (val > 32767) { + val = 32767; + } + + return (Sint16) val; +} + +Mix_Chunk* LoadVOC_RW(SDL_RWops* rwop, int freesrc) { + + if(rwop == NULL) { + return NULL; + } + + // Read voc file + Uint32 RawData_Frequency; + Uint32 RawData_Samples; + Uint8* RawDataUint8 = LoadVOC_RW(rwop, RawData_Samples, RawData_Frequency); + if(RawDataUint8 == NULL) { + if(freesrc) { + SDL_RWclose(rwop); + } + return NULL; + } + + // Convert to floats + float* RawDataFloat; + if((RawDataFloat = (float*) malloc((RawData_Samples+2*NUM_SAMPLES_OF_SILENCE)*sizeof(float))) == NULL) { + free(RawDataUint8); + if(freesrc) { + SDL_RWclose(rwop); + } + return NULL; + } + + for(Uint32 i=0; i < NUM_SAMPLES_OF_SILENCE; i++) { + RawDataFloat[i] = 0.0; + } + + for(Uint32 i=NUM_SAMPLES_OF_SILENCE; i < RawData_Samples+NUM_SAMPLES_OF_SILENCE; i++) { + RawDataFloat[i] = (((float) RawDataUint8[i-NUM_SAMPLES_OF_SILENCE])/128.0) - 1.0; + } + + for(Uint32 i=RawData_Samples+NUM_SAMPLES_OF_SILENCE; i < RawData_Samples + 2*NUM_SAMPLES_OF_SILENCE; i++) { + RawDataFloat[i] = 0.0; + } + + free(RawDataUint8); + + RawData_Samples += 2*NUM_SAMPLES_OF_SILENCE; + + // To prevent strange invalid read in src_linear + RawData_Samples--; + + // Get audio device specifications + int TargetFrequency, channels; + Uint16 TargetFormat; + if(Mix_QuerySpec(&TargetFrequency, &TargetFormat, &channels) == 0) { + free(RawDataUint8); + free(RawDataFloat); + if(freesrc) { + SDL_RWclose(rwop); + } + return NULL; + } + + // Convert to audio device frequency + float ConversionRatio = ((float) TargetFrequency) / ((float) RawData_Frequency); + Uint32 TargetDataFloat_Samples = (Uint32) ((float) RawData_Samples * ConversionRatio) + 1; + float* TargetDataFloat; + if((TargetDataFloat = (float*) malloc(TargetDataFloat_Samples*sizeof(float))) == NULL) { + free(RawDataFloat); + if(freesrc) { + SDL_RWclose(rwop); + } + return NULL; + } + + SRC_DATA src_data; + src_data.data_in = RawDataFloat; + src_data.input_frames = RawData_Samples; + src_data.src_ratio = ConversionRatio; + src_data.data_out = TargetDataFloat; + src_data.output_frames = TargetDataFloat_Samples; + + if(src_simple(&src_data, SRC_LINEAR, 1) != 0) { + free(RawDataFloat); + free(TargetDataFloat); + if(freesrc) { + SDL_RWclose(rwop); + } + return NULL; + } + + Uint32 TargetData_Samples = src_data.output_frames_gen; + free(RawDataFloat); + + + // Equalize if neccessary + float distance = 0.0; + for(Uint32 i=0; i < TargetData_Samples; i++) { + if(fabs(TargetDataFloat[i]) > distance) { + distance = fabs(TargetDataFloat[i]); + } + } + + if(distance > 1.0) { + //Equalize + for(Uint32 i=0; i < TargetData_Samples; i++) { + TargetDataFloat[i] = TargetDataFloat[i] / distance; + } + } + + + // Convert floats back to integers but leave out 3/4 of silence + int ThreeQuaterSilenceLength = (int) ((NUM_SAMPLES_OF_SILENCE * ConversionRatio)*(3.0/4.0)); + TargetData_Samples -= 2*ThreeQuaterSilenceLength; + + Mix_Chunk* myChunk; + if((myChunk = (Mix_Chunk*) calloc(sizeof(Mix_Chunk),1)) == NULL) { + free(TargetDataFloat); + if(freesrc) { + SDL_RWclose(rwop); + } + return NULL; + } + + myChunk->volume = 128; + myChunk->allocated = 1; + + switch(TargetFormat) { + case AUDIO_U8: + { + Uint8* TargetData; + int SizeOfTargetSample = sizeof(Uint8) * channels; + if((TargetData = (Uint8*) malloc(TargetData_Samples * SizeOfTargetSample)) == NULL) { + free(TargetDataFloat); + free(myChunk); + if(freesrc) { + SDL_RWclose(rwop); + } + return NULL; + } + + for(Uint32 i=0; i < TargetData_Samples*channels; i+=channels) { + TargetData[i] = Float2Uint8(TargetDataFloat[(i/channels)+ThreeQuaterSilenceLength]); + for(int j = 1; j < channels; j++) { + TargetData[i+j] = TargetData[i]; + } + + } + + free(TargetDataFloat); + + myChunk->abuf = (Uint8*) TargetData; + myChunk->alen = TargetData_Samples * SizeOfTargetSample; + + } break; + + case AUDIO_S8: + { + Sint8* TargetData; + int SizeOfTargetSample = sizeof(Sint8) * channels; + if((TargetData = (Sint8*) malloc(TargetData_Samples * SizeOfTargetSample)) == NULL) { + free(TargetDataFloat); + free(myChunk); + if(freesrc) { + SDL_RWclose(rwop); + } + return NULL; + } + + for(Uint32 i=0; i < TargetData_Samples*channels; i+=channels) { + TargetData[i] = Float2Sint8(TargetDataFloat[(i/channels)+ThreeQuaterSilenceLength]); + for(int j = 1; j < channels; j++) { + TargetData[i+j] = TargetData[i]; + } + + } + + free(TargetDataFloat); + + myChunk->abuf = (Uint8*) TargetData; + myChunk->alen = TargetData_Samples * SizeOfTargetSample; + + } break; + + case AUDIO_U16LSB: + { + Uint16* TargetData; + int SizeOfTargetSample = sizeof(Uint16) * channels; + if((TargetData = (Uint16*) malloc(TargetData_Samples * SizeOfTargetSample)) == NULL) { + free(TargetDataFloat); + free(myChunk); + if(freesrc) { + SDL_RWclose(rwop); + } + return NULL; + } + + for(Uint32 i=0; i < TargetData_Samples*channels; i+=channels) { + TargetData[i] = SDL_SwapLE16(Float2Uint16(TargetDataFloat[(i/channels)+ThreeQuaterSilenceLength])); + for(int j = 1; j < channels; j++) { + TargetData[i+j] = TargetData[i]; + } + + } + + free(TargetDataFloat); + + myChunk->abuf = (Uint8*) TargetData; + myChunk->alen = TargetData_Samples * SizeOfTargetSample; + + } break; + + case AUDIO_S16LSB: + { + Sint16* TargetData; + int SizeOfTargetSample = sizeof(Sint16) * channels; + if((TargetData = (Sint16*) malloc(TargetData_Samples * SizeOfTargetSample)) == NULL) { + free(TargetDataFloat); + free(myChunk); + if(freesrc) { + SDL_RWclose(rwop); + } + return NULL; + } + + for(Uint32 i=0; i < TargetData_Samples*channels; i+=channels) { + TargetData[i] = SDL_SwapLE16(Float2Sint16(TargetDataFloat[(i/channels)+ThreeQuaterSilenceLength])); + for(int j = 1; j < channels; j++) { + TargetData[i+j] = TargetData[i]; + } + + } + + free(TargetDataFloat); + + myChunk->abuf = (Uint8*) TargetData; + myChunk->alen = TargetData_Samples * SizeOfTargetSample; + + } break; + + case AUDIO_U16MSB: + { + Uint16* TargetData; + int SizeOfTargetSample = sizeof(Uint16) * channels; + if((TargetData = (Uint16*) malloc(TargetData_Samples * SizeOfTargetSample)) == NULL) { + free(TargetDataFloat); + free(myChunk); + if(freesrc) { + SDL_RWclose(rwop); + } + return NULL; + } + + for(Uint32 i=0; i < TargetData_Samples*channels; i+=channels) { + TargetData[i] = SDL_SwapBE16(Float2Uint16(TargetDataFloat[(i/channels)+ThreeQuaterSilenceLength])); + for(int j = 1; j < channels; j++) { + TargetData[i+j] = TargetData[i]; + } + + } + + free(TargetDataFloat); + + myChunk->abuf = (Uint8*) TargetData; + myChunk->alen = TargetData_Samples * SizeOfTargetSample; + + } break; + + case AUDIO_S16MSB: + { + Sint16* TargetData; + int SizeOfTargetSample = sizeof(Sint16) * channels; + if((TargetData = (Sint16*) malloc(TargetData_Samples * SizeOfTargetSample)) == NULL) { + free(TargetDataFloat); + free(myChunk); + if(freesrc) { + SDL_RWclose(rwop); + } + return NULL; + } + + for(Uint32 i=0; i < TargetData_Samples*channels; i+=channels) { + TargetData[i] = SDL_SwapBE16(Float2Sint16(TargetDataFloat[(i/channels)+ThreeQuaterSilenceLength])); + for(int j = 1; j < channels; j++) { + TargetData[i+j] = TargetData[i]; + } + + } + + free(TargetDataFloat); + + myChunk->abuf = (Uint8*) TargetData; + myChunk->alen = TargetData_Samples * SizeOfTargetSample; + + } break; + + default: + { + free(TargetDataFloat); + free(myChunk); + if(freesrc) { + SDL_RWclose(rwop); + } + return NULL; + } break; + } + + if(freesrc) { + SDL_RWclose(rwop); + } + return myChunk; +} Property changes on: branches/dunks/src/pakfile/sound/Vocfile.cpp ___________________________________________________________________ Name: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dv...@us...> - 2008-05-04 19:18:05
|
Revision: 270 http://dunelegacy.svn.sourceforge.net/dunelegacy/?rev=270&view=rev Author: dvalin Date: 2008-05-04 12:18:01 -0700 (Sun, 04 May 2008) Log Message: ----------- yet another forgotten commit Modified Paths: -------------- branches/dunks/include/MenuBase.h branches/dunks/include/SoundPlayerClass.h Modified: branches/dunks/include/MenuBase.h =================================================================== --- branches/dunks/include/MenuBase.h 2008-05-04 19:15:39 UTC (rev 269) +++ branches/dunks/include/MenuBase.h 2008-05-04 19:18:01 UTC (rev 270) @@ -18,7 +18,7 @@ int Execute(float dt); public: - SDL_Surface* m_menuBackground; + ImagePtr m_menuBackground; Container* m_container; }; Modified: branches/dunks/include/SoundPlayerClass.h =================================================================== --- branches/dunks/include/SoundPlayerClass.h 2008-05-04 19:15:39 UTC (rev 269) +++ branches/dunks/include/SoundPlayerClass.h 2008-05-04 19:18:01 UTC (rev 270) @@ -62,7 +62,7 @@ void playVoice(Sound_enum id, HOUSETYPE house); void playSound(Sound_enum soundID); - void playSound(Mix_Chunk* sound, int channel = 0); + void playSound(Mix_Chunk* sound, int channel = -1); inline int GetSfxVolume() { return sfxVolume; }; void SetSfxVolume(int newVolume) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dv...@us...> - 2008-05-04 19:15:42
|
Revision: 269 http://dunelegacy.svn.sourceforge.net/dunelegacy/?rev=269&view=rev Author: dvalin Date: 2008-05-04 12:15:39 -0700 (Sun, 04 May 2008) Log Message: ----------- yet another forgotten commit Modified Paths: -------------- branches/dunks/SConstruct Modified: branches/dunks/SConstruct =================================================================== --- branches/dunks/SConstruct 2008-05-04 19:11:46 UTC (rev 268) +++ branches/dunks/SConstruct 2008-05-04 19:15:39 UTC (rev 269) @@ -63,5 +63,5 @@ Export('env') -#SConscript("src/pakfile/SConscript") +SConscript("src/pakfile/SConscript") SConscript("src/SConscript") This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dv...@us...> - 2008-05-04 19:11:50
|
Revision: 268 http://dunelegacy.svn.sourceforge.net/dunelegacy/?rev=268&view=rev Author: dvalin Date: 2008-05-04 12:11:46 -0700 (Sun, 04 May 2008) Log Message: ----------- forgot to commit some needed function.. Modified Paths: -------------- branches/dunks/include/SingleMenu.h Modified: branches/dunks/include/SingleMenu.h =================================================================== --- branches/dunks/include/SingleMenu.h 2008-05-04 18:53:03 UTC (rev 267) +++ branches/dunks/include/SingleMenu.h 2008-05-04 19:11:46 UTC (rev 268) @@ -14,6 +14,7 @@ SingleMenuState(); ~SingleMenuState(); + void doCampaign(); void doSkirmish(); void doCancel(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dv...@us...> - 2008-05-04 18:53:22
|
Revision: 267 http://dunelegacy.svn.sourceforge.net/dunelegacy/?rev=267&view=rev Author: dvalin Date: 2008-05-04 11:53:03 -0700 (Sun, 04 May 2008) Log Message: ----------- commit some soundplayer code that never made it in, thus breaking build.. Modified Paths: -------------- branches/dunks/include/Application.h branches/dunks/src/Application.cpp Modified: branches/dunks/include/Application.h =================================================================== --- branches/dunks/include/Application.h 2008-05-04 04:31:10 UTC (rev 266) +++ branches/dunks/include/Application.h 2008-05-04 18:53:03 UTC (rev 267) @@ -13,7 +13,11 @@ #include <pthread.h> extern "C" void *dataCacheThread(void * arg); #endif +//#include "SoundPlayerClass.h" +class SoundPlayerClass; +class Mix_Chunk; + typedef enum { CURSOR_NORMAL, @@ -59,8 +63,11 @@ void UpdateVideoMode(bool fullscreen); void UpdateVideoMode(Uint16 w, Uint16 h); void UpdateVideoMode(Uint16 w, Uint16 h, bool fullscreen); +// SoundPlayerClass* soundPlayer; + void playSound(Mix_Chunk* chunk, int channel = 0); private: + SoundPlayerClass* soundPlayer; // void *testis(void * arg); void InitSettings(); void InitAudio(); Modified: branches/dunks/src/Application.cpp =================================================================== --- branches/dunks/src/Application.cpp 2008-05-04 04:31:10 UTC (rev 266) +++ branches/dunks/src/Application.cpp 2008-05-04 18:53:03 UTC (rev 267) @@ -108,7 +108,7 @@ SDL_EnableUNICODE(1); // replace NULL with a path to a 32x32 icon - SDL_WM_SetCaption("Dune Legacy", NULL); + SDL_WM_SetCaption("Dune Legacy", "paks/DUNE2.ICO"); InitAudio(); //InitNet(); @@ -276,22 +276,9 @@ void Application::LoadData() { printf("loading resources\n"); - ResMan::Instance()->addRes("ATRE"); - ResMan::Instance()->addRes("DUNE"); - ResMan::Instance()->addRes("ENGLISH"); - ResMan::Instance()->addRes("GERMAN"); - ResMan::Instance()->addRes("FINALE"); - ResMan::Instance()->addRes("HARK"); - ResMan::Instance()->addRes("HERC"); ResMan::Instance()->addRes("INTRO"); - ResMan::Instance()->addRes("INTROVOC"); - ResMan::Instance()->addRes("MENTAT"); - ResMan::Instance()->addRes("MERC"); - ResMan::Instance()->addRes("ORDOS"); - ResMan::Instance()->addRes("SCENARIO"); - ResMan::Instance()->addRes("SOUND"); - ResMan::Instance()->addRes("VOC"); - ResMan::Instance()->addRes("XTRE"); + + printf("done loading resources\n"); #ifdef __linux__ pthread_t threads[1]; @@ -306,12 +293,16 @@ m_cursor.reset(DataCache::Instance()->getGuiPic(UI_MouseCursor).get()); //mouse.getPicture(0)); fprintf(stdout, "starting sound...\n"); - SoundPlayerClass* soundPlayer = new SoundPlayerClass(); + soundPlayer = new SoundPlayerClass(); - Mix_Chunk* myChunk = DataCache::Instance()->getMusic(MUSIC_INTRO, 0); - soundPlayer->playSound(myChunk); +/* Mix_Chunk* myChunk = DataCache::Instance()->getMusic(MUSIC_INTRO, 0); + soundPlayer->playSound(myChunk);*/ } +void Application::playSound(Mix_Chunk* chunk, int channel) +{ + soundPlayer->playSound(chunk, channel); +} void Application::Die() { FontManager::Destroy(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dv...@us...> - 2008-05-04 04:31:12
|
Revision: 266 http://dunelegacy.svn.sourceforge.net/dunelegacy/?rev=266&view=rev Author: dvalin Date: 2008-05-03 21:31:10 -0700 (Sat, 03 May 2008) Log Message: ----------- fix multiple transitions per scene Modified Paths: -------------- branches/dunks/src/IntroState.cpp Modified: branches/dunks/src/IntroState.cpp =================================================================== --- branches/dunks/src/IntroState.cpp 2008-05-04 04:20:19 UTC (rev 265) +++ branches/dunks/src/IntroState.cpp 2008-05-04 04:31:10 UTC (rev 266) @@ -352,7 +352,8 @@ return; } - if (m_transitionPalette == NULL) setupTransitionOut(img); + //if (m_transitionPalette == NULL) // We want new one created to handle several transitions per cutscene + setupTransitionOut(img); SDL_Surface* screen = img->getSurface(); SDL_Color* col = m_transitionPalette; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dv...@us...> - 2008-05-04 04:20:21
|
Revision: 265 http://dunelegacy.svn.sourceforge.net/dunelegacy/?rev=265&view=rev Author: dvalin Date: 2008-05-03 21:20:19 -0700 (Sat, 03 May 2008) Log Message: ----------- draw VIRGIN.CPS in Frame class in stead.. Modified Paths: -------------- branches/dunks/include/IntroState.h branches/dunks/src/IntroState.cpp Modified: branches/dunks/include/IntroState.h =================================================================== --- branches/dunks/include/IntroState.h 2008-05-04 03:44:05 UTC (rev 264) +++ branches/dunks/include/IntroState.h 2008-05-04 04:20:19 UTC (rev 265) @@ -96,7 +96,7 @@ void setupTransitionIn(); - void setupTransitionOut(); + void setupTransitionOut(ImagePtr img); void cleanupTransitionIn(); void cleanupTransitionOut(); Modified: branches/dunks/src/IntroState.cpp =================================================================== --- branches/dunks/src/IntroState.cpp 2008-05-04 03:44:05 UTC (rev 264) +++ branches/dunks/src/IntroState.cpp 2008-05-04 04:20:19 UTC (rev 265) @@ -137,6 +137,7 @@ bool isWsa = m_filename.size() > 3 && wsaSuffix == m_filename.size() - 4; bool isCps = m_filename.size() > 3 && cpsSuffix == m_filename.size() - 4; + CpsfilePtr tmp; if(isWsa || isCps){ int len; uint8_t * data = ResMan::Instance()->readFile(m_filename, &len); @@ -152,12 +153,15 @@ { m_wsa.reset(new Wsafile(data, len, NULL, m_fps)); } - }else if(isCps){ - m_wsa.reset(new Wsafile(new Cpsfile(data, len, m_palette))); + }else{ + if(isCps){ + tmp.reset(new Cpsfile(data, len)); + m_wsa.reset(new Wsafile()); + } } - } - else + }else m_wsa.reset(new Wsafile()); + m_frametime = 0; m_currentFrame = 0; @@ -169,8 +173,14 @@ loopFrames += (m_loops[i].first - m_loops[i].second) * m_loops[i+1].first + m_loops[i+1].second; } m_totalFrames = m_wsa->getNumFrames() + m_endWait + loopFrames; - - m_animSurface.reset(m_wsa->getPicture(m_currentFrame, m_palette)); + if(isCps){ + // A bit retarded, needs to be cleaned up later.. + m_animSurface.reset(tmp->getPicture()); + m_palette = m_animSurface->getSurface()->format->palette; + m_textSurface = m_animSurface->getResized(2); + setTextLocation(SPoint(0,-200)); + } + m_animSurface.reset(m_wsa->getPicture(m_currentFrame, m_palette)); m_scaledSurface = m_animSurface->getResized(2.0); if(m_endWait) addLoop(m_wsa->getNumFrames(), m_wsa->getNumFrames(), 1, m_endWait); @@ -310,17 +320,16 @@ { if(m_song != -1){ Application::Instance()->playSound(DataCache::Instance()->getMusic(MUSIC_INTRO, m_song)); - std::cout << "play!" << std::endl; } if (m_transition_in == NO_TRANSITION) m_state = PLAYING; } -void IntroState::Frame::setupTransitionOut() +void IntroState::Frame::setupTransitionOut(ImagePtr img) { m_transitionPalette = new SDL_Color[256]; memcpy((unsigned char*)m_transitionPalette, - m_palette->colors, + img->getSurface()->format->palette->colors, sizeof(SDL_Color) * 256); } @@ -343,7 +352,7 @@ return; } - if (m_transitionPalette == NULL) setupTransitionOut(); + if (m_transitionPalette == NULL) setupTransitionOut(img); SDL_Surface* screen = img->getSurface(); SDL_Color* col = m_transitionPalette; @@ -405,7 +414,6 @@ frame->setTextLocation(SPoint(-25,0)); enque(frame); - // VIRGIN.CPS has it's own palette, handling of this needs to be implemented.. frame = new Frame("INTRO:VIRGIN.CPS", Frame::NO_TRANSITION, Frame::FADE_OUT, @@ -428,7 +436,7 @@ frame->setFps(0.07); frame->addLoop(1,1,0,20); frame->setSong(1); - frame->concatSound(30, Intro_Dune); + frame->addSound(30, Intro_Dune); frame->concatSound(70, Intro_TheBuilding); frame->concatSound(70, Intro_OfADynasty); frame->addText(70, DataCache::Instance()->getIntroString(2)); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dv...@us...> - 2008-05-04 03:44:08
|
Revision: 264 http://dunelegacy.svn.sourceforge.net/dunelegacy/?rev=264&view=rev Author: dvalin Date: 2008-05-03 20:44:05 -0700 (Sat, 03 May 2008) Log Message: ----------- drop creation of wsa based on cps picture (1x1 wsa should be removed eventually as well) Modified Paths: -------------- branches/dunks/include/pakfile/Wsafile.h branches/dunks/src/pakfile/Wsafile.cpp Modified: branches/dunks/include/pakfile/Wsafile.h =================================================================== --- branches/dunks/include/pakfile/Wsafile.h 2008-05-04 03:17:23 UTC (rev 263) +++ branches/dunks/include/pakfile/Wsafile.h 2008-05-04 03:44:05 UTC (rev 264) @@ -19,7 +19,6 @@ public: Wsafile(uint8_t * bufFiledata, int bufsize, SDL_Surface* lastframe = NULL, float setFps = 0 ); - Wsafile(Cpsfile* cpsFile); Wsafile(); ~Wsafile(); Modified: branches/dunks/src/pakfile/Wsafile.cpp =================================================================== --- branches/dunks/src/pakfile/Wsafile.cpp 2008-05-04 03:17:23 UTC (rev 263) +++ branches/dunks/src/pakfile/Wsafile.cpp 2008-05-04 03:44:05 UTC (rev 264) @@ -68,21 +68,6 @@ decodeFrames(); } -Wsafile::Wsafile(Cpsfile* cpsFile) : Decode() -{ - WsaFilesize = -2; - - printf("loading cps file as wsa...\n"); - - NumFrames = 1; - fps = 0.1; - - printf("FramesPer1024ms = %d\n", FramesPer1024ms); - printf("FPS = %.3f\n", fps); - decodedFrames = NULL; - m_cpsFile = cpsFile; -} - Wsafile::Wsafile() : Decode() { WsaFilesize = -1; @@ -110,10 +95,6 @@ return img; } - if(WsaFilesize == -2){ - return m_cpsFile->getPicture(); - } - if(FrameNumber >= NumFrames) { return NULL; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dv...@us...> - 2008-05-04 03:17:28
|
Revision: 263 http://dunelegacy.svn.sourceforge.net/dunelegacy/?rev=263&view=rev Author: dvalin Date: 2008-05-03 20:17:23 -0700 (Sat, 03 May 2008) Log Message: ----------- remove commented out test code Modified Paths: -------------- branches/dunks/src/pakfile/Cpsfile.cpp Modified: branches/dunks/src/pakfile/Cpsfile.cpp =================================================================== --- branches/dunks/src/pakfile/Cpsfile.cpp 2008-05-04 03:16:07 UTC (rev 262) +++ branches/dunks/src/pakfile/Cpsfile.cpp 2008-05-04 03:17:23 UTC (rev 263) @@ -66,13 +66,6 @@ return NULL; } -/* for (int i = 0; i < 256; i++){ - m_palette->colors[i].r = *Filedata++ << 2; - m_palette->colors[i].g = *Filedata++ << 2; - m_palette->colors[i].b = *Filedata++ << 2; - m_palette->colors[i].reserved = 0; - } -*/ SDL_SetColors(pic, m_palette->colors, 0, m_palette->ncolors); SDL_LockSurface(pic); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dv...@us...> - 2008-05-04 03:16:11
|
Revision: 262 http://dunelegacy.svn.sourceforge.net/dunelegacy/?rev=262&view=rev Author: dvalin Date: 2008-05-03 20:16:07 -0700 (Sat, 03 May 2008) Log Message: ----------- fix handling of pictures with embedded palette (ie. VIRGIN.CPS) Modified Paths: -------------- branches/dunks/src/pakfile/Cpsfile.cpp Modified: branches/dunks/src/pakfile/Cpsfile.cpp =================================================================== --- branches/dunks/src/pakfile/Cpsfile.cpp 2008-05-03 23:28:32 UTC (rev 261) +++ branches/dunks/src/pakfile/Cpsfile.cpp 2008-05-04 03:16:07 UTC (rev 262) @@ -1,8 +1,8 @@ #include "pakfile/Cpsfile.h" #include <SDL_endian.h> #include "DataCache.h" -#include <stdlib.h> -#include <string.h> +#include <iostream> +#include <string> #define SIZE_X 320 #define SIZE_Y 240 @@ -11,10 +11,25 @@ { Filedata = bufFiledata; CpsFilesize = bufsize; - if (palette == NULL) - m_palette = DataCache::Instance()->getPalette(IBM_PAL); - else - m_palette = palette; + if(*(unsigned char *)(bufFiledata + 10 + 9) != 3){ + std::cout << "CPS has embedded palette, loading..." << std::endl; + m_palette = new SDL_Palette; + m_palette->ncolors = bufsize / 3; + m_palette->colors = new SDL_Color[m_palette->ncolors]; + + bufFiledata += 10; + for (int i = 0; i < m_palette->ncolors; i++){ + m_palette->colors[i].r = *bufFiledata++ <<2; + m_palette->colors[i].g = *bufFiledata++ <<2; + m_palette->colors[i].b = *bufFiledata++ <<2; + m_palette->colors[i].unused = 0; + } + }else{ + if (palette == NULL) + m_palette = DataCache::Instance()->getPalette(IBM_PAL); + else + m_palette = palette; + } } Cpsfile::~Cpsfile() @@ -43,15 +58,21 @@ } if(decode80(Filedata + 10 + PaletteSize,ImageOut,0) == -2) { - fprintf(stderr,"Error: Cannot decode Cps-File\n"); + std::cerr << "Error: Cannot decode Cps-File" << std::endl; } // create new picture surface if((pic = SDL_CreateRGBSurface(SDL_SWSURFACE,SIZE_X,SIZE_Y,8,0,0,0,0))== NULL) { return NULL; } - - + +/* for (int i = 0; i < 256; i++){ + m_palette->colors[i].r = *Filedata++ << 2; + m_palette->colors[i].g = *Filedata++ << 2; + m_palette->colors[i].b = *Filedata++ << 2; + m_palette->colors[i].reserved = 0; + } +*/ SDL_SetColors(pic, m_palette->colors, 0, m_palette->ncolors); SDL_LockSurface(pic); @@ -85,7 +106,7 @@ // create new picture surface if((returnPic = SDL_CreateRGBSurface(SDL_HWSURFACE,width,height,8,0,0,0,0))== NULL) { - fprintf(stderr,"GetSubPicture: Cannot create new Picture!\n"); + std::cerr << "GetSubPicture: Cannot create new Picture!" << std::endl; exit(EXIT_FAILURE); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dv...@us...> - 2008-05-03 23:28:34
|
Revision: 261 http://dunelegacy.svn.sourceforge.net/dunelegacy/?rev=261&view=rev Author: dvalin Date: 2008-05-03 16:28:32 -0700 (Sat, 03 May 2008) Log Message: ----------- fix sound vs text fade issues.. Modified Paths: -------------- branches/dunks/src/IntroState.cpp Modified: branches/dunks/src/IntroState.cpp =================================================================== --- branches/dunks/src/IntroState.cpp 2008-05-03 23:27:32 UTC (rev 260) +++ branches/dunks/src/IntroState.cpp 2008-05-03 23:28:32 UTC (rev 261) @@ -33,6 +33,7 @@ m_textSize = 1.7; m_textLocation = SPoint(20,20); m_textTransition = 0; + m_textFade = true; font = FontManager::Instance()->getFont("INTRO:INTRO.FNT"); } @@ -121,6 +122,12 @@ { m_textSize = textSize; } + +void IntroState::Frame::setTextFade(bool textFade) +{ + m_textFade = textFade; +} + void IntroState::Frame::Load(Frame* lastframe) { printf("intro loading %s\n", m_filename.c_str()); @@ -201,7 +208,7 @@ void IntroState::Frame::doPlaying(float dt) { - if(!m_textTransition && !Mix_Playing(10)){ + if(m_textFade && !m_textTransition && !Mix_Playing(10)){ m_textTransition = m_framesPlayed + 2; } if(m_introStrings.size() > 0){ @@ -303,6 +310,7 @@ { if(m_song != -1){ Application::Instance()->playSound(DataCache::Instance()->getMusic(MUSIC_INTRO, m_song)); + std::cout << "play!" << std::endl; } if (m_transition_in == NO_TRANSITION) m_state = PLAYING; @@ -379,7 +387,7 @@ // m_introStrings.push_back(introText(0, "")); // credits.eng isn't properly decoded yet.. // DataCache::Instance()->getCreditsString(20))); - /*frame = new Frame("INTRO:WESTWOOD.WSA", + frame = new Frame("INTRO:WESTWOOD.WSA", Frame::NO_TRANSITION, Frame::FADE_OUT, false, 20); @@ -391,7 +399,7 @@ frame = new Frame("", Frame::NO_TRANSITION, Frame::FADE_OUT, - false, 4); + false, 10); frame->addText(0, "and"); frame->setTextSize(2.0); frame->setTextLocation(SPoint(-25,0)); @@ -407,7 +415,7 @@ frame = new Frame("", Frame::NO_TRANSITION, Frame::FADE_OUT, - false, 4); + false, 10); frame->addText(0,DataCache::Instance()->getIntroString(1)); frame->setTextLocation(SPoint(-25,0)); frame->setTextSize(2.0); @@ -420,12 +428,13 @@ frame->setFps(0.07); frame->addLoop(1,1,0,20); frame->setSong(1); - frame->addSound(30, Intro_Dune); + frame->concatSound(30, Intro_Dune); frame->concatSound(70, Intro_TheBuilding); frame->concatSound(70, Intro_OfADynasty); frame->addText(70, DataCache::Instance()->getIntroString(2)); frame->setTextLocation(SPoint(-13,-35)); frame->setTextSize(2.0); + frame->setTextFade(false); enque(frame); frame = new Frame("INTRO:INTRO2.WSA", @@ -434,21 +443,21 @@ false, 5); frame->concatSound(10, Intro_ThePlanetArrakis); frame->concatSound(10, Intro_KnownAsDune); - frame->addText(5, DataCache::Instance()->getIntroString(3)); + frame->addText(10, DataCache::Instance()->getIntroString(3)); enque(frame); frame = new Frame("INTRO:INTRO3.WSA", Frame::NO_TRANSITION, Frame::FADE_OUT, false, 25); - frame->addSound(0, Intro_LandOfSand); + frame->concatSound(0, Intro_LandOfSand); frame->addText(0, DataCache::Instance()->getIntroString(4)); frame->concatSound(33, Intro_Home); frame->concatSound(33, Intro_OfTheSpice); frame->concatSound(33, Intro_Melange); frame->addText(33, DataCache::Instance()->getIntroString(5)); enque(frame); -*/ + frame = new Frame("INTRO:INTRO9.WSA", Frame::NO_TRANSITION, Frame::FADE_OUT, @@ -510,10 +519,11 @@ frame = new Frame("", Frame::NO_TRANSITION, Frame::FADE_OUT, - false, 28); + false, 38); frame->addText(0,DataCache::Instance()->getIntroString(13)); frame->setTextLocation(SPoint(-25,0)); - frame->setTextSize(2.0); + frame->setTextSize(2.0); + frame->setTextFade(false); frame->concatSound(0, Intro_AndNow); frame->concatSound(0, Intro_3Houses); frame->concatSound(0, Intro_ForControl); @@ -601,6 +611,7 @@ frame->addText(0, DataCache::Instance()->getIntroString(18)); frame->setTextLocation(SPoint(-20,0)); frame->setTextSize(2.0); + frame->setTextFade(false); frame->concatSound(0, Intro_Your); frame->concatSound(0, Intro_BattleForDune); frame->concatSound(0, Intro_Begins); @@ -614,6 +625,7 @@ frame->addText(0, DataCache::Instance()->getIntroString(19)); frame->setTextLocation(SPoint(-20,0)); frame->setTextSize(2.0); + frame->setTextFade(false); frame->addSound(0, Intro_Now); enque(frame); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dv...@us...> - 2008-05-03 23:27:35
|
Revision: 260 http://dunelegacy.svn.sourceforge.net/dunelegacy/?rev=260&view=rev Author: dvalin Date: 2008-05-03 16:27:32 -0700 (Sat, 03 May 2008) Log Message: ----------- default channel should be -1, not 0 Modified Paths: -------------- branches/dunks/include/IntroState.h Modified: branches/dunks/include/IntroState.h =================================================================== --- branches/dunks/include/IntroState.h 2008-05-03 23:03:52 UTC (rev 259) +++ branches/dunks/include/IntroState.h 2008-05-03 23:27:32 UTC (rev 260) @@ -59,11 +59,12 @@ void setTextColor(uint8_t textColor); void setTextLocation(SPoint textLocation); void setTextSize(float setTextSize); + void setTextFade(bool textFade); private: std::string m_filename; - bool m_continuation; + bool m_continuation, m_textFade; float m_hold; TransitionState m_state; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dv...@us...> - 2008-05-03 23:03:59
|
Revision: 259 http://dunelegacy.svn.sourceforge.net/dunelegacy/?rev=259&view=rev Author: dvalin Date: 2008-05-03 16:03:52 -0700 (Sat, 03 May 2008) Log Message: ----------- fade when sound is done playing rather than guessing by length of text Modified Paths: -------------- branches/dunks/src/IntroState.cpp Modified: branches/dunks/src/IntroState.cpp =================================================================== --- branches/dunks/src/IntroState.cpp 2008-05-03 23:00:38 UTC (rev 258) +++ branches/dunks/src/IntroState.cpp 2008-05-03 23:03:52 UTC (rev 259) @@ -201,18 +201,17 @@ void IntroState::Frame::doPlaying(float dt) { + if(!m_textTransition && !Mix_Playing(10)){ + m_textTransition = m_framesPlayed + 2; + } if(m_introStrings.size() > 0){ if(m_framesPlayed == m_introStrings[0].first){ ImagePtr tmp(new Image(UPoint(360,50))); std::string text = m_introStrings[0].second; - // Here we try to figure out how long the text should be displayed - // relative to it's length. Room for improval.. - m_textTransition = m_framesPlayed + (text.length()/m_wsa->getFPS()/100*9); uint8_t numLines = 0; int linebreak = text.find("\n",0)+ 1; std::string thisLine; // This is a bit hairy and needs to be cleaned up a bit.. - Uint16 textw, texth; while(text.substr(0, linebreak-1).length() > 0){ @@ -230,15 +229,11 @@ } m_textSurface = tmp->getResized(m_textSize); m_introStrings.erase(m_introStrings.begin()); - // Something wrong happens here that prevents the fading and only removes the text - if(m_introStrings.size() > 0) - if(m_textTransition > m_introStrings[0].first - 4) - m_textTransition = m_introStrings[0].first - 4; - else if(m_textTransition > m_totalFrames - 2) - m_textTransition = m_totalFrames - 2; + m_textTransition = 0; } } - if(m_framesPlayed >= m_textTransition){ + + if(m_textTransition && m_framesPlayed >= m_textTransition){ doTransitionOut(m_textSurface, false, true, 6); } @@ -253,7 +248,7 @@ if(m_soundChunks.size() > 0){ if(m_framesPlayed == m_soundChunks[0].first){ Mix_Chunk* sound = m_soundChunks[0].second; - Application::Instance()->playSound(sound); + Application::Instance()->playSound(sound, 10); // delete(m_soundChunks[0].second); m_soundChunks.erase(m_soundChunks.begin()); } @@ -384,7 +379,7 @@ // m_introStrings.push_back(introText(0, "")); // credits.eng isn't properly decoded yet.. // DataCache::Instance()->getCreditsString(20))); - frame = new Frame("INTRO:WESTWOOD.WSA", + /*frame = new Frame("INTRO:WESTWOOD.WSA", Frame::NO_TRANSITION, Frame::FADE_OUT, false, 20); @@ -453,7 +448,7 @@ frame->concatSound(33, Intro_Melange); frame->addText(33, DataCache::Instance()->getIntroString(5)); enque(frame); - +*/ frame = new Frame("INTRO:INTRO9.WSA", Frame::NO_TRANSITION, Frame::FADE_OUT, @@ -494,13 +489,13 @@ frame->concatSound(0, Intro_TheMostSpice); frame->concatSound(0, Intro_WillControlDune); frame->addLoop(45, 0, 1, 14); + frame->addText(61, DataCache::Instance()->getIntroString(10)); frame->concatSound(61, Intro_ThereAreNoSet); frame->concatSound(61, Intro_Territories); - frame->concatSound(61, Intro_AndNo); - frame->concatSound(61, Intro_RulesOfEngagement); - - frame->addText(61, DataCache::Instance()->getIntroString(10)); frame->addText(83, DataCache::Instance()->getIntroString(11)); + frame->concatSound(83, Intro_AndNo); + frame->concatSound(83, Intro_RulesOfEngagement); + enque(frame); frame = new Frame("INTRO:INTRO4.WSA", This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dv...@us...> - 2008-05-03 23:00:40
|
Revision: 258 http://dunelegacy.svn.sourceforge.net/dunelegacy/?rev=258&view=rev Author: dvalin Date: 2008-05-03 16:00:38 -0700 (Sat, 03 May 2008) Log Message: ----------- make it possible to define channel for sound to playmake it possible to define channel for sound to playmake it possible to define channel for sound to playmake it possible to define channel for sound to playmake it possible to define channel for sound to playmake it possible to define channel for sound to playmake it possible to define channel for sound to playmake it possible to define channel for sound to playmake it possible to define channel for sound to play Modified Paths: -------------- branches/dunks/include/SoundPlayerClass.h branches/dunks/src/SoundPlayerClass.cpp Modified: branches/dunks/include/SoundPlayerClass.h =================================================================== --- branches/dunks/include/SoundPlayerClass.h 2008-05-03 20:50:04 UTC (rev 257) +++ branches/dunks/include/SoundPlayerClass.h 2008-05-03 23:00:38 UTC (rev 258) @@ -8,6 +8,7 @@ #include "dMath.h" #include "SDL_mixer.h" +#if 0 //! \enum MUSICTYPE /*! Types of music available in the game*/ typedef enum { MUSIC_ATTACK, /*!<Played when at least one of player's units was hit. */ @@ -17,7 +18,7 @@ MUSIC_WIN, /*!<Victory screen background music.. */ MUSIC_RANDOM /*!<Player used key combination to change current music. */ } MUSICTYPE; - +#endif /*! Class that handles sounds and music. */ @@ -61,7 +62,7 @@ void playVoice(Sound_enum id, HOUSETYPE house); void playSound(Sound_enum soundID); - void playSound(Mix_Chunk* sound); + void playSound(Mix_Chunk* sound, int channel = 0); inline int GetSfxVolume() { return sfxVolume; }; void SetSfxVolume(int newVolume) { Modified: branches/dunks/src/SoundPlayerClass.cpp =================================================================== --- branches/dunks/src/SoundPlayerClass.cpp 2008-05-03 20:50:04 UTC (rev 257) +++ branches/dunks/src/SoundPlayerClass.cpp 2008-05-03 23:00:38 UTC (rev 258) @@ -304,10 +304,10 @@ } } -void SoundPlayerClass::playSound(Mix_Chunk* sound) { +void SoundPlayerClass::playSound(Mix_Chunk* sound, int channel) { if (soundOn) { - Mix_PlayChannel(-1, sound, 0); + Mix_PlayChannel(channel, sound, 0); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dv...@us...> - 2008-05-03 20:50:07
|
Revision: 257 http://dunelegacy.svn.sourceforge.net/dunelegacy/?rev=257&view=rev Author: dvalin Date: 2008-05-03 13:50:04 -0700 (Sat, 03 May 2008) Log Message: ----------- add fading of text Modified Paths: -------------- branches/dunks/include/IntroState.h branches/dunks/src/IntroState.cpp Modified: branches/dunks/include/IntroState.h =================================================================== --- branches/dunks/include/IntroState.h 2008-05-03 06:13:45 UTC (rev 256) +++ branches/dunks/include/IntroState.h 2008-05-03 20:50:04 UTC (rev 257) @@ -76,7 +76,8 @@ float m_frametime, m_textSize; int8_t m_song; - uint8_t m_endWait, m_textColor; + uint8_t m_endWait, m_textColor, m_textTransition; + uint16_t m_totalFrames; SPoint m_textLocation; float m_fps; @@ -100,6 +101,7 @@ void doTransitionIn(float dt); void doTransitionOut(float dt); + void doTransitionOut(ImagePtr img, bool done = false, bool forceTransition = false, const int fadeAmt = 4); void doPlaying(float dt); void doHolding(float dt); }; Modified: branches/dunks/src/IntroState.cpp =================================================================== --- branches/dunks/src/IntroState.cpp 2008-05-03 06:13:45 UTC (rev 256) +++ branches/dunks/src/IntroState.cpp 2008-05-03 20:50:04 UTC (rev 257) @@ -32,6 +32,7 @@ m_textSurface.reset(new Image(UPoint(320,40))); m_textSize = 1.7; m_textLocation = SPoint(20,20); + m_textTransition = 0; font = FontManager::Instance()->getFont("INTRO:INTRO.FNT"); } @@ -155,6 +156,12 @@ m_currentFrame = 0; m_framesPlayed = 0; mb_finished = false; + uint8_t loopFrames = 0; + for(uint8_t i = 0; i < m_loops.size(); i = i+2) + { + loopFrames += (m_loops[i].first - m_loops[i].second) * m_loops[i+1].first + m_loops[i+1].second; + } + m_totalFrames = m_wsa->getNumFrames() + m_endWait + loopFrames; m_animSurface.reset(m_wsa->getPicture(m_currentFrame, m_palette)); m_scaledSurface = m_animSurface->getResized(2.0); @@ -198,7 +205,9 @@ if(m_framesPlayed == m_introStrings[0].first){ ImagePtr tmp(new Image(UPoint(360,50))); std::string text = m_introStrings[0].second; - + // Here we try to figure out how long the text should be displayed + // relative to it's length. Room for improval.. + m_textTransition = m_framesPlayed + (text.length()/m_wsa->getFPS()/100*9); uint8_t numLines = 0; int linebreak = text.find("\n",0)+ 1; std::string thisLine; @@ -220,10 +229,18 @@ linebreak = text.find("\n",0); } m_textSurface = tmp->getResized(m_textSize); - m_introStrings.erase(m_introStrings.begin()); + // Something wrong happens here that prevents the fading and only removes the text + if(m_introStrings.size() > 0) + if(m_textTransition > m_introStrings[0].first - 4) + m_textTransition = m_introStrings[0].first - 4; + else if(m_textTransition > m_totalFrames - 2) + m_textTransition = m_totalFrames - 2; } } + if(m_framesPlayed >= m_textTransition){ + doTransitionOut(m_textSurface, false, true, 6); + } if(m_introSounds.size() > 0){ if(m_framesPlayed == m_introSounds[0].first){ @@ -232,6 +249,7 @@ m_introSounds.erase(m_introSounds.begin()); } } + if(m_soundChunks.size() > 0){ if(m_framesPlayed == m_soundChunks[0].first){ Mix_Chunk* sound = m_soundChunks[0].second; @@ -308,10 +326,15 @@ delete m_transitionPalette; } -void IntroState::Frame::doTransitionOut(float dt) +void IntroState::Frame::doTransitionOut(float dt) { + doTransitionOut(m_scaledSurface, true); + doTransitionOut(m_textSurface, true, true); +} - if (m_transition_out == NO_TRANSITION) +void IntroState::Frame::doTransitionOut(ImagePtr img, bool done, bool forceTransition, const int fadeAmt) +{ + if (m_transition_out == NO_TRANSITION && !forceTransition) { mb_finished = true; return; @@ -319,12 +342,9 @@ if (m_transitionPalette == NULL) setupTransitionOut(); - bool done = true; - SDL_Surface* screen = m_scaledSurface->getSurface(); - SDL_Surface* text = m_textSurface->getSurface(); + SDL_Surface* screen = img->getSurface(); SDL_Color* col = m_transitionPalette; - const int fadeAmt = 4; for (int i=0; i!=256; i++, col++) { @@ -339,7 +359,6 @@ }; SDL_SetPalette(screen, SDL_LOGPAL, m_transitionPalette, 0, 256); - SDL_SetPalette(text, SDL_LOGPAL, m_transitionPalette, 0, 256); if (done) { @@ -377,7 +396,7 @@ frame = new Frame("", Frame::NO_TRANSITION, Frame::FADE_OUT, - false, 3); + false, 4); frame->addText(0, "and"); frame->setTextSize(2.0); frame->setTextLocation(SPoint(-25,0)); @@ -393,7 +412,7 @@ frame = new Frame("", Frame::NO_TRANSITION, Frame::FADE_OUT, - false, 2); + false, 4); frame->addText(0,DataCache::Instance()->getIntroString(1)); frame->setTextLocation(SPoint(-25,0)); frame->setTextSize(2.0); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dv...@us...> - 2008-05-03 06:13:47
|
Revision: 256 http://dunelegacy.svn.sourceforge.net/dunelegacy/?rev=256&view=rev Author: dvalin Date: 2008-05-02 23:13:45 -0700 (Fri, 02 May 2008) Log Message: ----------- * make it possible to add multiple loops per scene * more timing fixes.. Modified Paths: -------------- branches/dunks/include/IntroState.h branches/dunks/src/IntroState.cpp Modified: branches/dunks/include/IntroState.h =================================================================== --- branches/dunks/include/IntroState.h 2008-05-03 01:45:51 UTC (rev 255) +++ branches/dunks/include/IntroState.h 2008-05-03 06:13:45 UTC (rev 256) @@ -54,7 +54,7 @@ void setSong(uint8_t song); void setPalette(Palette_enum palette); void setFps(float fps); - void setLoop(uint8_t loopAt, uint8_t rewindTo, uint8_t numLoops, uint8_t wait); + void addLoop(uint8_t loopAt, uint8_t rewindTo, uint8_t numLoops, uint8_t wait); void addText(uint16_t playAt, std::string introText); void setTextColor(uint8_t textColor); void setTextLocation(SPoint textLocation); @@ -84,7 +84,8 @@ ImagePtr m_animSurface, m_scaledSurface, m_textSurface; SDL_Color* m_transitionPalette; - Font* font; + Font* font; + std::vector<videoLoop> m_loops; std::vector<introText> m_introStrings; std::vector<introSound> m_introSounds; std::vector<soundChunk> m_soundChunks; Modified: branches/dunks/src/IntroState.cpp =================================================================== --- branches/dunks/src/IntroState.cpp 2008-05-03 01:45:51 UTC (rev 255) +++ branches/dunks/src/IntroState.cpp 2008-05-03 06:13:45 UTC (rev 256) @@ -28,8 +28,6 @@ m_song = -1; m_fps = 0; m_endWait = endWait; - m_loop = videoLoop(0,0); - m_loopTime = videoLoop(0,0); m_textColor = 49; m_textSurface.reset(new Image(UPoint(320,40))); m_textSize = 1.7; @@ -102,10 +100,10 @@ m_fps = fps; } -void IntroState::Frame::setLoop(uint8_t loopAt, uint8_t rewindTo, uint8_t numLoops, uint8_t wait) +void IntroState::Frame::addLoop(uint8_t loopAt, uint8_t rewindTo, uint8_t numLoops, uint8_t wait) { - m_loop = videoLoop(loopAt, rewindTo); - m_loopTime = videoLoop(numLoops, wait); + m_loops.push_back(videoLoop(loopAt, rewindTo)); + m_loops.push_back(videoLoop(numLoops, wait)); } void IntroState::Frame::setTextColor(uint8_t textColor) @@ -160,8 +158,8 @@ m_animSurface.reset(m_wsa->getPicture(m_currentFrame, m_palette)); m_scaledSurface = m_animSurface->getResized(2.0); - if(m_endWait && !m_loop.first) - setLoop(m_wsa->getNumFrames(), m_wsa->getNumFrames(), 1, m_endWait); + if(m_endWait) + addLoop(m_wsa->getNumFrames(), m_wsa->getNumFrames(), 1, m_endWait); } bool IntroState::Frame::Execute(float dt) @@ -196,8 +194,6 @@ void IntroState::Frame::doPlaying(float dt) { - Font* font = FontManager::Instance()->getFont("INTRO:INTRO.FNT"); - if(m_introStrings.size() > 0){ if(m_framesPlayed == m_introStrings[0].first){ ImagePtr tmp(new Image(UPoint(360,50))); @@ -249,16 +245,25 @@ if (m_frametime > m_wsa->getFPS()) { - if(!(m_currentFrame == m_loop.first - 1 && m_framesPlayed < m_loop.first + m_loopTime.second)) + if(m_loops.size() > 0) + { + if(!(m_currentFrame == m_loops[0].first - 1 && m_framesPlayed < m_loops[0].first + m_loops[1].second)) + m_currentFrame++; + if(m_loops[1].first != 0 && m_currentFrame == m_loops[0].first) + { + m_currentFrame = m_loops[0].second; + m_loops[1].first--; + } + if(m_loops[1].first == 0){ + m_loops.erase(m_loops.begin()); + m_loops.erase(m_loops.begin()); + } + }else m_currentFrame++; - if(m_loopTime.first != 0 && m_currentFrame == m_loop.first) - { - m_currentFrame = m_loop.second; - m_loopTime.first--; - } m_framesPlayed++; + m_frametime = 0.0f; if (m_currentFrame >= m_wsa->getNumFrames()) { @@ -397,13 +402,14 @@ frame = new Frame("INTRO:INTRO1.WSA", Frame::NO_TRANSITION, Frame::FADE_OUT, - false, 50); - frame->setFps(0.05); + false, 65); + frame->setFps(0.07); + frame->addLoop(1,1,0,20); frame->setSong(1); - frame->addSound(46, Intro_Dune); - frame->concatSound(66, Intro_TheBuilding); - frame->concatSound(66, Intro_OfADynasty); - frame->addText(66, DataCache::Instance()->getIntroString(2)); + frame->addSound(30, Intro_Dune); + frame->concatSound(70, Intro_TheBuilding); + frame->concatSound(70, Intro_OfADynasty); + frame->addText(70, DataCache::Instance()->getIntroString(2)); frame->setTextLocation(SPoint(-13,-35)); frame->setTextSize(2.0); enque(frame); @@ -412,8 +418,8 @@ Frame::NO_TRANSITION, Frame::FADE_OUT, false, 5); - frame->concatSound(5, Intro_ThePlanetArrakis); - frame->concatSound(5, Intro_KnownAsDune); + frame->concatSound(10, Intro_ThePlanetArrakis); + frame->concatSound(10, Intro_KnownAsDune); frame->addText(5, DataCache::Instance()->getIntroString(3)); enque(frame); @@ -468,7 +474,7 @@ frame->concatSound(0, Intro_ThatProduces); frame->concatSound(0, Intro_TheMostSpice); frame->concatSound(0, Intro_WillControlDune); - frame->setLoop(45, 0, 1, 14); + frame->addLoop(45, 0, 1, 14); frame->concatSound(61, Intro_ThereAreNoSet); frame->concatSound(61, Intro_Territories); frame->concatSound(61, Intro_AndNo); @@ -490,7 +496,7 @@ frame = new Frame("", Frame::NO_TRANSITION, Frame::FADE_OUT, - false, 23); + false, 28); frame->addText(0,DataCache::Instance()->getIntroString(13)); frame->setTextLocation(SPoint(-25,0)); frame->setTextSize(2.0); @@ -567,7 +573,7 @@ Frame::FADE_OUT, false); frame->setFps(0.2); - frame->setLoop(3, 0, 5, 0); + frame->addLoop(3, 0, 10, 0); frame->addText(0, DataCache::Instance()->getIntroString(17)); frame->concatSound(0, Intro_OnlyOneHouse); frame->concatSound(0, Intro_WillPrevail); @@ -577,7 +583,7 @@ frame = new Frame("", Frame::NO_TRANSITION, Frame::FADE_OUT, - false, 19); + false, 22); frame->addText(0, DataCache::Instance()->getIntroString(18)); frame->setTextLocation(SPoint(-20,0)); frame->setTextSize(2.0); @@ -590,7 +596,7 @@ frame = new Frame("", Frame::NO_TRANSITION, Frame::FADE_OUT, - false, 15); + false, 20); frame->addText(0, DataCache::Instance()->getIntroString(19)); frame->setTextLocation(SPoint(-20,0)); frame->setTextSize(2.0); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dv...@us...> - 2008-05-03 01:45:55
|
Revision: 255 http://dunelegacy.svn.sourceforge.net/dunelegacy/?rev=255&view=rev Author: dvalin Date: 2008-05-02 18:45:51 -0700 (Fri, 02 May 2008) Log Message: ----------- oops, fading out became a bit too fast, make it a bit slower again Modified Paths: -------------- branches/dunks/src/IntroState.cpp Modified: branches/dunks/src/IntroState.cpp =================================================================== --- branches/dunks/src/IntroState.cpp 2008-05-03 01:31:03 UTC (rev 254) +++ branches/dunks/src/IntroState.cpp 2008-05-03 01:45:51 UTC (rev 255) @@ -186,7 +186,8 @@ break; }; - m_scaledSurface->blitToScreenCentered(); +// m_scaledSurface->blitToScreen(SPoint(0, Application::Instance()->Screen()->getSurface()->h/2 - m_scaledSurface->getSurface()->h/2 - 55)); + m_scaledSurface->blitToScreenCentered(); m_textSurface->blitToScreen(SPoint(0 + m_textLocation.x,Application::Instance()->Screen()->getSurface()->h/2 + m_scaledSurface->getSurface()->h/2 + m_textLocation.y)); return mb_finished; @@ -318,7 +319,7 @@ SDL_Surface* text = m_textSurface->getSurface(); SDL_Color* col = m_transitionPalette; - const int fadeAmt = 8; + const int fadeAmt = 4; for (int i=0; i!=256; i++, col++) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dv...@us...> - 2008-05-03 01:31:08
|
Revision: 254 http://dunelegacy.svn.sourceforge.net/dunelegacy/?rev=254&view=rev Author: dvalin Date: 2008-05-02 18:31:03 -0700 (Fri, 02 May 2008) Log Message: ----------- * fade faster * some more timing fixes Modified Paths: -------------- branches/dunks/src/IntroState.cpp Modified: branches/dunks/src/IntroState.cpp =================================================================== --- branches/dunks/src/IntroState.cpp 2008-05-03 01:28:14 UTC (rev 253) +++ branches/dunks/src/IntroState.cpp 2008-05-03 01:31:03 UTC (rev 254) @@ -318,7 +318,7 @@ SDL_Surface* text = m_textSurface->getSurface(); SDL_Color* col = m_transitionPalette; - const int fadeAmt = 3; + const int fadeAmt = 8; for (int i=0; i!=256; i++, col++) { @@ -387,7 +387,7 @@ frame = new Frame("", Frame::NO_TRANSITION, Frame::FADE_OUT, - false, 1); + false, 2); frame->addText(0,DataCache::Instance()->getIntroString(1)); frame->setTextLocation(SPoint(-25,0)); frame->setTextSize(2.0); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dv...@us...> - 2008-05-03 01:28:16
|
Revision: 253 http://dunelegacy.svn.sourceforge.net/dunelegacy/?rev=253&view=rev Author: dvalin Date: 2008-05-02 18:28:14 -0700 (Fri, 02 May 2008) Log Message: ----------- * fix proper size and drawing of text * more timing fixes Modified Paths: -------------- branches/dunks/include/IntroState.h branches/dunks/src/IntroState.cpp Modified: branches/dunks/include/IntroState.h =================================================================== --- branches/dunks/include/IntroState.h 2008-05-03 00:16:51 UTC (rev 252) +++ branches/dunks/include/IntroState.h 2008-05-03 01:28:14 UTC (rev 253) @@ -49,15 +49,16 @@ bool Execute(float ft); void Load(Frame* lastframe); - void addText(uint16_t playAt, std::string introText); void addSound(uint16_t playAt, Sound_enum sound); void concatSound(uint16_t playAt, Sound_enum sound); + void setSong(uint8_t song); void setPalette(Palette_enum palette); - void setSong(uint8_t song); void setFps(float fps); void setLoop(uint8_t loopAt, uint8_t rewindTo, uint8_t numLoops, uint8_t wait); + void addText(uint16_t playAt, std::string introText); void setTextColor(uint8_t textColor); void setTextLocation(SPoint textLocation); + void setTextSize(float setTextSize); private: std::string m_filename; @@ -73,7 +74,7 @@ WsafilePtr m_wsa; uint8_t m_currentFrame, m_framesPlayed; - float m_frametime; + float m_frametime, m_textSize; int8_t m_song; uint8_t m_endWait, m_textColor; SPoint m_textLocation; Modified: branches/dunks/src/IntroState.cpp =================================================================== --- branches/dunks/src/IntroState.cpp 2008-05-03 00:16:51 UTC (rev 252) +++ branches/dunks/src/IntroState.cpp 2008-05-03 01:28:14 UTC (rev 253) @@ -32,7 +32,8 @@ m_loopTime = videoLoop(0,0); m_textColor = 49; m_textSurface.reset(new Image(UPoint(320,40))); - m_textLocation = SPoint(0,0); + m_textSize = 1.7; + m_textLocation = SPoint(20,20); font = FontManager::Instance()->getFont("INTRO:INTRO.FNT"); } @@ -117,6 +118,10 @@ m_textLocation = textLocation; } +void IntroState::Frame::setTextSize(float textSize) +{ + m_textSize = textSize; +} void IntroState::Frame::Load(Frame* lastframe) { printf("intro loading %s\n", m_filename.c_str()); @@ -182,6 +187,7 @@ }; m_scaledSurface->blitToScreenCentered(); + m_textSurface->blitToScreen(SPoint(0 + m_textLocation.x,Application::Instance()->Screen()->getSurface()->h/2 + m_scaledSurface->getSurface()->h/2 + m_textLocation.y)); return mb_finished; } @@ -193,7 +199,7 @@ if(m_introStrings.size() > 0){ if(m_framesPlayed == m_introStrings[0].first){ - ImagePtr tmp(new Image(UPoint(320,40))); + ImagePtr tmp(new Image(UPoint(360,50))); std::string text = m_introStrings[0].second; uint8_t numLines = 0; @@ -216,7 +222,7 @@ text = text.substr(linebreak, text.length()-linebreak); linebreak = text.find("\n",0); } - m_textSurface = tmp->getResized(2); + m_textSurface = tmp->getResized(m_textSize); m_introStrings.erase(m_introStrings.begin()); } @@ -264,9 +270,6 @@ }; }; - m_textSurface->blitToScreen(SPoint(0 + m_textLocation.x,Application::Instance()->Screen()->getSurface()->h/2 + m_scaledSurface->getSurface()->h/2 + 20 + m_textLocation.y)); - - } void IntroState::Frame::setupTransitionIn() @@ -312,6 +315,7 @@ bool done = true; SDL_Surface* screen = m_scaledSurface->getSurface(); + SDL_Surface* text = m_textSurface->getSurface(); SDL_Color* col = m_transitionPalette; const int fadeAmt = 3; @@ -329,6 +333,7 @@ }; SDL_SetPalette(screen, SDL_LOGPAL, m_transitionPalette, 0, 256); + SDL_SetPalette(text, SDL_LOGPAL, m_transitionPalette, 0, 256); if (done) { @@ -354,47 +359,52 @@ // m_introStrings.push_back(introText(0, "")); // credits.eng isn't properly decoded yet.. // DataCache::Instance()->getCreditsString(20))); - /*frame = new Frame("INTRO:WESTWOOD.WSA", + frame = new Frame("INTRO:WESTWOOD.WSA", Frame::NO_TRANSITION, Frame::FADE_OUT, - false, 30); + false, 20); frame->setSong(0); + frame->setFps(0.15); frame->setPalette(WESTWOOD_PAL); enque(frame); frame = new Frame("", Frame::NO_TRANSITION, Frame::FADE_OUT, - false, 30); + false, 3); frame->addText(0, "and"); + frame->setTextSize(2.0); + frame->setTextLocation(SPoint(-25,0)); enque(frame); // VIRGIN.CPS has it's own palette, handling of this needs to be implemented.. frame = new Frame("INTRO:VIRGIN.CPS", Frame::NO_TRANSITION, Frame::FADE_OUT, - false, 30); + false, 12); enque(frame); frame = new Frame("", Frame::NO_TRANSITION, Frame::FADE_OUT, - false, 20); + false, 1); frame->addText(0,DataCache::Instance()->getIntroString(1)); + frame->setTextLocation(SPoint(-25,0)); + frame->setTextSize(2.0); enque(frame); -*/ - + frame = new Frame("INTRO:INTRO1.WSA", Frame::NO_TRANSITION, Frame::FADE_OUT, false, 50); frame->setFps(0.05); frame->setSong(1); - frame->concatSound(66, Intro_Dune); + frame->addSound(46, Intro_Dune); frame->concatSound(66, Intro_TheBuilding); frame->concatSound(66, Intro_OfADynasty); frame->addText(66, DataCache::Instance()->getIntroString(2)); - frame->setTextLocation(SPoint(25,-20)); + frame->setTextLocation(SPoint(-13,-35)); + frame->setTextSize(2.0); enque(frame); frame = new Frame("INTRO:INTRO2.WSA", @@ -409,7 +419,7 @@ frame = new Frame("INTRO:INTRO3.WSA", Frame::NO_TRANSITION, Frame::FADE_OUT, - false, 30); + false, 25); frame->addSound(0, Intro_LandOfSand); frame->addText(0, DataCache::Instance()->getIntroString(4)); frame->concatSound(33, Intro_Home); @@ -422,7 +432,7 @@ Frame::NO_TRANSITION, Frame::FADE_OUT, false, 2); - frame->setFps(0.18); + frame->setFps(0.16); frame->addText(0, DataCache::Instance()->getIntroString(6)); frame->concatSound(0, Intro_TheSpice); frame->concatSound(0, Intro_Controls); @@ -438,7 +448,7 @@ frame = new Frame("INTRO:INTRO10.WSA", Frame::NO_TRANSITION, - Frame::FADE_OUT, + Frame::NO_TRANSITION, false, 25); frame->addText(0, DataCache::Instance()->getIntroString(8)); frame->concatSound(0, Intro_TheEmperor); @@ -457,7 +467,7 @@ frame->concatSound(0, Intro_ThatProduces); frame->concatSound(0, Intro_TheMostSpice); frame->concatSound(0, Intro_WillControlDune); - frame->setLoop(45, 0, 1, 15); + frame->setLoop(45, 0, 1, 14); frame->concatSound(61, Intro_ThereAreNoSet); frame->concatSound(61, Intro_Territories); frame->concatSound(61, Intro_AndNo); @@ -470,16 +480,19 @@ frame = new Frame("INTRO:INTRO4.WSA", Frame::NO_TRANSITION, Frame::FADE_OUT, - false, 5); + false); frame->addText(11, DataCache::Instance()->getIntroString(12)); frame->concatSound(11, Intro_VastArmies); frame->concatSound(11, Intro_HasArrived); enque(frame); - frame = new Frame(DataCache::Instance()->getIntroString(13), + frame = new Frame("", Frame::NO_TRANSITION, Frame::FADE_OUT, - false, 50); + false, 23); + frame->addText(0,DataCache::Instance()->getIntroString(13)); + frame->setTextLocation(SPoint(-25,0)); + frame->setTextSize(2.0); frame->concatSound(0, Intro_AndNow); frame->concatSound(0, Intro_3Houses); frame->concatSound(0, Intro_ForControl); @@ -491,7 +504,7 @@ Frame::NO_TRANSITION, Frame::FADE_OUT, false); - frame->setFps(0.1); + frame->setFps(0.08); frame->addText(0, DataCache::Instance()->getIntroString(14)); frame->addSound(0, Intro_TheNobleAtreides); frame->addSound(31, Intro_Glass); @@ -553,7 +566,7 @@ Frame::FADE_OUT, false); frame->setFps(0.2); - frame->setLoop(3, 0, 10, 0); + frame->setLoop(3, 0, 5, 0); frame->addText(0, DataCache::Instance()->getIntroString(17)); frame->concatSound(0, Intro_OnlyOneHouse); frame->concatSound(0, Intro_WillPrevail); @@ -563,8 +576,10 @@ frame = new Frame("", Frame::NO_TRANSITION, Frame::FADE_OUT, - false, 20); + false, 19); frame->addText(0, DataCache::Instance()->getIntroString(18)); + frame->setTextLocation(SPoint(-20,0)); + frame->setTextSize(2.0); frame->concatSound(0, Intro_Your); frame->concatSound(0, Intro_BattleForDune); frame->concatSound(0, Intro_Begins); @@ -576,6 +591,8 @@ Frame::FADE_OUT, false, 15); frame->addText(0, DataCache::Instance()->getIntroString(19)); + frame->setTextLocation(SPoint(-20,0)); + frame->setTextSize(2.0); frame->addSound(0, Intro_Now); enque(frame); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |