Changeset - r21028:e5db3f83cafa
src/blitter/32bpp_anim.hpp
Show inline comments
 
@@ -47,20 +47,20 @@ public:
 
	/**
 
	 * Look up the colour in the current palette.
 
	 */
 
	inline Colour LookupColourInPalette(uint index)
 
	{
 
		return this->palette.palette[index];
 
	}
 

	
 
	template <BlitterMode mode> void Draw(const Blitter::BlitterParams *bp, ZoomLevel zoom);
 
};
 

	
 
/** Factory for the 32bpp blitter with animation. */
 
class FBlitter_32bppAnim: public BlitterFactory<FBlitter_32bppAnim> {
 
class FBlitter_32bppAnim : public BlitterFactory<FBlitter_32bppAnim> {
 
public:
 
	/* virtual */ const char *GetName() { return "32bpp-anim"; }
 
	/* virtual */ const char *GetDescription() { return "32bpp Animation Blitter (palette animation)"; }
 
	/* virtual */ Blitter *CreateInstance() { return new Blitter_32bppAnim(); }
 
};
 

	
 
#endif /* BLITTER_32BPP_ANIM_HPP */
src/blitter/32bpp_optimized.hpp
Show inline comments
 
@@ -23,20 +23,20 @@ public:
 
		byte data[];                      ///< Data, all zoomlevels.
 
	};
 

	
 
	/* virtual */ void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom);
 
	/* virtual */ Sprite *Encode(const SpriteLoader::Sprite *sprite, AllocatorProc *allocator);
 

	
 
	/* virtual */ const char *GetName() { return "32bpp-optimized"; }
 

	
 
	template <BlitterMode mode> void Draw(const Blitter::BlitterParams *bp, ZoomLevel zoom);
 
};
 

	
 
/** Factory for the optimised 32 bpp blitter (without palette animation). */
 
class FBlitter_32bppOptimized: public BlitterFactory<FBlitter_32bppOptimized> {
 
class FBlitter_32bppOptimized : public BlitterFactory<FBlitter_32bppOptimized> {
 
public:
 
	/* virtual */ const char *GetName() { return "32bpp-optimized"; }
 
	/* virtual */ const char *GetDescription() { return "32bpp Optimized Blitter (no palette animation)"; }
 
	/* virtual */ Blitter *CreateInstance() { return new Blitter_32bppOptimized(); }
 
};
 

	
 
#endif /* BLITTER_32BPP_OPTIMIZED_HPP */
src/blitter/32bpp_simple.hpp
Show inline comments
 
@@ -25,20 +25,20 @@ class Blitter_32bppSimple : public Blitt
 
		uint8 m;  ///< Remap-channel
 
		uint8 v;  ///< Brightness-channel
 
	};
 
public:
 
	/* virtual */ void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom);
 
	/* virtual */ void DrawColourMappingRect(void *dst, int width, int height, PaletteID pal);
 
	/* virtual */ Sprite *Encode(const SpriteLoader::Sprite *sprite, AllocatorProc *allocator);
 

	
 
	/* virtual */ const char *GetName() { return "32bpp-simple"; }
 
};
 

	
 
/** Factory for the simple 32 bpp blitter. */
 
class FBlitter_32bppSimple: public BlitterFactory<FBlitter_32bppSimple> {
 
class FBlitter_32bppSimple : public BlitterFactory<FBlitter_32bppSimple> {
 
public:
 
	/* virtual */ const char *GetName() { return "32bpp-simple"; }
 
	/* virtual */ const char *GetDescription() { return "32bpp Simple Blitter (no palette animation)"; }
 
	/* virtual */ Blitter *CreateInstance() { return new Blitter_32bppSimple(); }
 
};
 

	
 
#endif /* BLITTER_32BPP_SIMPLE_HPP */
src/blitter/8bpp_optimized.hpp
Show inline comments
 
@@ -22,20 +22,20 @@ public:
 
	struct SpriteData {
 
		uint32 offset[ZOOM_LVL_COUNT]; ///< Offsets (from .data) to streams for different zoom levels.
 
		byte data[];                   ///< Data, all zoomlevels.
 
	};
 

	
 
	/* virtual */ void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom);
 
	/* virtual */ Sprite *Encode(const SpriteLoader::Sprite *sprite, AllocatorProc *allocator);
 

	
 
	/* virtual */ const char *GetName() { return "8bpp-optimized"; }
 
};
 

	
 
/** Factory for the 8bpp blitter optimised for speed. */
 
class FBlitter_8bppOptimized: public BlitterFactory<FBlitter_8bppOptimized> {
 
class FBlitter_8bppOptimized : public BlitterFactory<FBlitter_8bppOptimized> {
 
public:
 
	/* virtual */ const char *GetName() { return "8bpp-optimized"; }
 
	/* virtual */ const char *GetDescription() { return "8bpp Optimized Blitter (compression + all-ZoomLevel cache)"; }
 
	/* virtual */ Blitter *CreateInstance() { return new Blitter_8bppOptimized(); }
 
};
 

	
 
#endif /* BLITTER_8BPP_OPTIMIZED_HPP */
src/blitter/8bpp_simple.hpp
Show inline comments
 
@@ -16,20 +16,20 @@
 
#include "factory.hpp"
 

	
 
/** Most trivial 8bpp blitter. */
 
class Blitter_8bppSimple FINAL : public Blitter_8bppBase {
 
public:
 
	/* virtual */ void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom);
 
	/* virtual */ Sprite *Encode(const SpriteLoader::Sprite *sprite, AllocatorProc *allocator);
 

	
 
	/* virtual */ const char *GetName() { return "8bpp-simple"; }
 
};
 

	
 
/** Factory for the most trivial 8bpp blitter. */
 
class FBlitter_8bppSimple: public BlitterFactory<FBlitter_8bppSimple> {
 
class FBlitter_8bppSimple : public BlitterFactory<FBlitter_8bppSimple> {
 
public:
 
	/* virtual */ const char *GetName() { return "8bpp-simple"; }
 
	/* virtual */ const char *GetDescription() { return "8bpp Simple Blitter (relative slow, but never wrong)"; }
 
	/* virtual */ Blitter *CreateInstance() { return new Blitter_8bppSimple(); }
 
};
 

	
 
#endif /* BLITTER_8BPP_SIMPLE_HPP */
src/blitter/factory.hpp
Show inline comments
 
@@ -154,25 +154,25 @@ public:
 
	virtual const char *GetDescription() = 0;
 

	
 
	/**
 
	 * Create an instance of this Blitter-class.
 
	 */
 
	virtual Blitter *CreateInstance() = 0;
 
};
 

	
 
/**
 
 * A template factory, so ->GetName() works correctly. This because else some compiler will complain.
 
 */
 
template <class T>
 
class BlitterFactory: public BlitterFactoryBase {
 
class BlitterFactory : public BlitterFactoryBase {
 
public:
 
	BlitterFactory() { this->RegisterBlitter(((T *)this)->GetName()); }
 

	
 
	/**
 
	 * Get the long, human readable, name for the Blitter-class.
 
	 */
 
	const char *GetName();
 
};
 

	
 
extern char *_ini_blitter;
 
extern bool _blitter_autodetected;
 

	
src/blitter/null.hpp
Show inline comments
 
@@ -29,20 +29,20 @@ public:
 
	/* virtual */ void CopyToBuffer(const void *video, void *dst, int width, int height) {};
 
	/* virtual */ void CopyImageToBuffer(const void *video, void *dst, int width, int height, int dst_pitch) {};
 
	/* virtual */ void ScrollBuffer(void *video, int &left, int &top, int &width, int &height, int scroll_x, int scroll_y) {};
 
	/* virtual */ int BufferSize(int width, int height) { return 0; };
 
	/* virtual */ void PaletteAnimate(const Palette &palette) { };
 
	/* virtual */ Blitter::PaletteAnimation UsePaletteAnimation() { return Blitter::PALETTE_ANIMATION_NONE; };
 

	
 
	/* virtual */ const char *GetName() { return "null"; }
 
	/* virtual */ int GetBytesPerPixel() { return 0; }
 
};
 

	
 
/** Factory for the blitter that does nothing. */
 
class FBlitter_Null: public BlitterFactory<FBlitter_Null> {
 
class FBlitter_Null : public BlitterFactory<FBlitter_Null> {
 
public:
 
	/* virtual */ const char *GetName() { return "null"; }
 
	/* virtual */ const char *GetDescription() { return "Null Blitter (does nothing)"; }
 
	/* virtual */ Blitter *CreateInstance() { return new Blitter_Null(); }
 
};
 

	
 
#endif /* BLITTER_NULL_HPP */
src/cargoaction.h
Show inline comments
 
@@ -79,33 +79,33 @@ public:
 

	
 
/** Action of loading cargo from a station onto a vehicle. */
 
class CargoLoad : public CargoMovement<StationCargoList, VehicleCargoList> {
 
protected:
 
	TileIndex load_place; ///< TileIndex to be saved in the packets' loaded_at_xy.
 
public:
 
	CargoLoad(StationCargoList *source, VehicleCargoList *destination, uint max_move, TileIndex load_place) :
 
			CargoMovement<StationCargoList, VehicleCargoList>(source, destination, max_move), load_place(load_place) {}
 
	bool operator()(CargoPacket *cp);
 
};
 

	
 
/** Action of reserving cargo from a station to be loaded onto a vehicle. */
 
class CargoReservation: public CargoLoad {
 
class CargoReservation : public CargoLoad {
 
public:
 
	CargoReservation(StationCargoList *source, VehicleCargoList *destination, uint max_move, TileIndex load_place) :
 
			CargoLoad(source, destination, max_move, load_place) {}
 
	bool operator()(CargoPacket *cp);
 
};
 

	
 
/** Action of returning previously reserved cargo from the vehicle to the station. */
 
class CargoReturn: public CargoMovement<VehicleCargoList, StationCargoList> {
 
class CargoReturn : public CargoMovement<VehicleCargoList, StationCargoList> {
 
	StationID next;
 
public:
 
	CargoReturn(VehicleCargoList *source, StationCargoList *destination, uint max_move, StationID next) :
 
			CargoMovement<VehicleCargoList, StationCargoList>(source, destination, max_move), next(next) {}
 
	bool operator()(CargoPacket *cp);
 
};
 

	
 
/** Action of shifting cargo from one vehicle to another. */
 
class CargoShift : public CargoMovement<VehicleCargoList, VehicleCargoList> {
 
public:
 
	CargoShift(VehicleCargoList *source, VehicleCargoList *destination, uint max_move) :
 
			CargoMovement<VehicleCargoList, VehicleCargoList>(source, destination, max_move) {}
src/driver.h
Show inline comments
 
@@ -50,27 +50,27 @@ public:
 
	 * Get the name of this driver.
 
	 * @return The name of the driver.
 
	 */
 
	virtual const char *GetName() const = 0;
 
};
 

	
 
DECLARE_POSTFIX_INCREMENT(Driver::Type)
 

	
 

	
 
/** Base for all driver factories. */
 
class DriverFactoryBase {
 
private:
 
	Driver::Type type; ///< The type of driver.
 
	Driver::Type type;       ///< The type of driver.
 
	int priority;            ///< The priority of this factory.
 
	const char *name;  ///< The name of the drivers of this factory.
 
	const char *name;        ///< The name of the drivers of this factory.
 
	const char *description; ///< The description of this driver.
 

	
 
	typedef std::map<const char *, DriverFactoryBase *, StringCompare> Drivers; ///< Type for a map of drivers.
 

	
 
	/**
 
	 * Get the map with drivers.
 
	 */
 
	static Drivers &GetDrivers()
 
	{
 
		static Drivers &s_drivers = *new Drivers();
 
		return s_drivers;
 
	}
src/music/allegro_m.h
Show inline comments
 
@@ -6,25 +6,25 @@
 
 * OpenTTD 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 OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
/** @file allegro_m.h Base support for playing music via allegro. */
 

	
 
#ifndef MUSIC_ALLEGRO_H
 
#define MUSIC_ALLEGRO_H
 

	
 
#include "music_driver.hpp"
 

	
 
/** Allegro's music player. */
 
class MusicDriver_Allegro: public MusicDriver {
 
class MusicDriver_Allegro : public MusicDriver {
 
public:
 
	/* virtual */ const char *Start(const char * const *param);
 

	
 
	/* virtual */ void Stop();
 

	
 
	/* virtual */ void PlaySong(const char *filename);
 

	
 
	/* virtual */ void StopSong();
 

	
 
	/* virtual */ bool IsSongPlaying();
 

	
 
	/* virtual */ void SetVolume(byte vol);
src/music/bemidi.h
Show inline comments
 
@@ -6,25 +6,25 @@
 
 * OpenTTD 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 OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
/** @file bemidi.h Base of BeOS Midi support. */
 

	
 
#ifndef MUSIC_BEMIDI_H
 
#define MUSIC_BEMIDI_H
 

	
 
#include "music_driver.hpp"
 

	
 
/** The midi player for BeOS. */
 
class MusicDriver_BeMidi: public MusicDriver {
 
class MusicDriver_BeMidi : public MusicDriver {
 
public:
 
	/* virtual */ const char *Start(const char * const *param);
 

	
 
	/* virtual */ void Stop();
 

	
 
	/* virtual */ void PlaySong(const char *filename);
 

	
 
	/* virtual */ void StopSong();
 

	
 
	/* virtual */ bool IsSongPlaying();
 

	
 
	/* virtual */ void SetVolume(byte vol);
src/music/cocoa_m.h
Show inline comments
 
@@ -5,25 +5,25 @@
 
 * OpenTTD 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, version 2.
 
 * OpenTTD 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 OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
/** @file cocoa_m.h Base of music playback via CoreAudio. */
 

	
 
#ifndef MUSIC_MACOSX_COCOA_H
 
#define MUSIC_MACOSX_COCOA_H
 

	
 
#include "music_driver.hpp"
 

	
 
class MusicDriver_Cocoa: public MusicDriver {
 
class MusicDriver_Cocoa : public MusicDriver {
 
public:
 
	/* virtual */ const char *Start(const char * const *param);
 

	
 
	/* virtual */ void Stop();
 

	
 
	/* virtual */ void PlaySong(const char *filename);
 

	
 
	/* virtual */ void StopSong();
 

	
 
	/* virtual */ bool IsSongPlaying();
 

	
 
	/* virtual */ void SetVolume(byte vol);
src/music/dmusic.h
Show inline comments
 
@@ -6,25 +6,25 @@
 
 * OpenTTD 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 OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
/** @file dmusic.h Base of playing music via DirectMusic. */
 

	
 
#ifndef MUSIC_DMUSIC_H
 
#define MUSIC_DMUSIC_H
 

	
 
#include "music_driver.hpp"
 

	
 
/** Music player making use of DirectX. */
 
class MusicDriver_DMusic: public MusicDriver {
 
class MusicDriver_DMusic : public MusicDriver {
 
public:
 
	virtual ~MusicDriver_DMusic();
 

	
 
	/* virtual */ const char *Start(const char * const *param);
 

	
 
	/* virtual */ void Stop();
 

	
 
	/* virtual */ void PlaySong(const char *filename);
 

	
 
	/* virtual */ void StopSong();
 

	
 
	/* virtual */ bool IsSongPlaying();
src/music/extmidi.h
Show inline comments
 
@@ -5,25 +5,25 @@
 
 * OpenTTD 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, version 2.
 
 * OpenTTD 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 OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
/** @file extmidi.h Base support for playing music via an external application. */
 

	
 
#ifndef MUSIC_EXTERNAL_H
 
#define MUSIC_EXTERNAL_H
 

	
 
#include "music_driver.hpp"
 

	
 
class MusicDriver_ExtMidi: public MusicDriver {
 
class MusicDriver_ExtMidi : public MusicDriver {
 
private:
 
	char *command;
 
	char song[MAX_PATH];
 
	pid_t pid;
 

	
 
	void DoPlay();
 
	void DoStop();
 

	
 
public:
 
	/* virtual */ const char *Start(const char * const *param);
 

	
 
	/* virtual */ void Stop();
src/music/libtimidity.h
Show inline comments
 
@@ -6,25 +6,25 @@
 
 * OpenTTD 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 OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
/** @file libtimidity.h Base for LibTimidity music playback. */
 

	
 
#ifndef MUSIC_LIBTIMIDITY_H
 
#define MUSIC_LIBTIMIDITY_H
 

	
 
#include "music_driver.hpp"
 

	
 
/** Music driver making use of libtimidity. */
 
class MusicDriver_LibTimidity: public MusicDriver {
 
class MusicDriver_LibTimidity : public MusicDriver {
 
public:
 
	/* virtual */ const char *Start(const char * const *param);
 

	
 
	/* virtual */ void Stop();
 

	
 
	/* virtual */ void PlaySong(const char *filename);
 

	
 
	/* virtual */ void StopSong();
 

	
 
	/* virtual */ bool IsSongPlaying();
 

	
 
	/* virtual */ void SetVolume(byte vol);
src/music/music_driver.hpp
Show inline comments
 
@@ -6,25 +6,25 @@
 
 * OpenTTD 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 OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
/** @file music_driver.hpp Base for all music playback. */
 

	
 
#ifndef MUSIC_MUSIC_DRIVER_HPP
 
#define MUSIC_MUSIC_DRIVER_HPP
 

	
 
#include "../driver.h"
 

	
 
/** Driver for all music playback. */
 
class MusicDriver: public Driver {
 
class MusicDriver : public Driver {
 
public:
 
	/**
 
	 * Play a particular song.
 
	 * @param filename The name of file with the song to play.
 
	 */
 
	virtual void PlaySong(const char *filename) = 0;
 

	
 
	/**
 
	 * Stop playing the current song.
 
	 */
 
	virtual void StopSong() = 0;
 

	
src/music/null_m.h
Show inline comments
 
@@ -6,25 +6,25 @@
 
 * OpenTTD 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 OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
/** @file null_m.h Base for the silent music playback. */
 

	
 
#ifndef MUSIC_NULL_H
 
#define MUSIC_NULL_H
 

	
 
#include "music_driver.hpp"
 

	
 
/** The music player that does nothing. */
 
class MusicDriver_Null: public MusicDriver {
 
class MusicDriver_Null : public MusicDriver {
 
public:
 
	/* virtual */ const char *Start(const char * const *param) { return NULL; }
 

	
 
	/* virtual */ void Stop() { }
 

	
 
	/* virtual */ void PlaySong(const char *filename) { }
 

	
 
	/* virtual */ void StopSong() { }
 

	
 
	/* virtual */ bool IsSongPlaying() { return true; }
 

	
 
	/* virtual */ void SetVolume(byte vol) { }
src/music/os2_m.h
Show inline comments
 
@@ -6,25 +6,25 @@
 
 * OpenTTD 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 OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
/** @file os2_m.h Base for OS2 music playback. */
 

	
 
#ifndef MUSIC_OS2_H
 
#define MUSIC_OS2_H
 

	
 
#include "music_driver.hpp"
 

	
 
/** OS/2's music player. */
 
class MusicDriver_OS2: public MusicDriver {
 
class MusicDriver_OS2 : public MusicDriver {
 
public:
 
	/* virtual */ const char *Start(const char * const *param);
 

	
 
	/* virtual */ void Stop();
 

	
 
	/* virtual */ void PlaySong(const char *filename);
 

	
 
	/* virtual */ void StopSong();
 

	
 
	/* virtual */ bool IsSongPlaying();
 

	
 
	/* virtual */ void SetVolume(byte vol);
src/music/qtmidi.h
Show inline comments
 
@@ -5,25 +5,25 @@
 
 * OpenTTD 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, version 2.
 
 * OpenTTD 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 OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
/** @file qtmidi.h Base of music playback via the QuickTime driver. */
 

	
 
#ifndef MUSIC_MACOSX_QUICKTIME_H
 
#define MUSIC_MACOSX_QUICKTIME_H
 

	
 
#include "music_driver.hpp"
 

	
 
class MusicDriver_QtMidi: public MusicDriver {
 
class MusicDriver_QtMidi : public MusicDriver {
 
public:
 
	/* virtual */ const char *Start(const char * const *param);
 

	
 
	/* virtual */ void Stop();
 

	
 
	/* virtual */ void PlaySong(const char *filename);
 

	
 
	/* virtual */ void StopSong();
 

	
 
	/* virtual */ bool IsSongPlaying();
 

	
 
	/* virtual */ void SetVolume(byte vol);
src/music/win32_m.h
Show inline comments
 
@@ -6,25 +6,25 @@
 
 * OpenTTD 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 OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
/** @file win32_m.h Base for Windows music playback. */
 

	
 
#ifndef MUSIC_WIN32_H
 
#define MUSIC_WIN32_H
 

	
 
#include "music_driver.hpp"
 

	
 
/** The Windows music player. */
 
class MusicDriver_Win32: public MusicDriver {
 
class MusicDriver_Win32 : public MusicDriver {
 
public:
 
	/* virtual */ const char *Start(const char * const *param);
 

	
 
	/* virtual */ void Stop();
 

	
 
	/* virtual */ void PlaySong(const char *filename);
 

	
 
	/* virtual */ void StopSong();
 

	
 
	/* virtual */ bool IsSongPlaying();
 

	
 
	/* virtual */ void SetVolume(byte vol);
src/sound/allegro_s.h
Show inline comments
 
@@ -6,25 +6,25 @@
 
 * OpenTTD 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 OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
/** @file allegro_s.h Base fo playing sound via Allegro. */
 

	
 
#ifndef SOUND_ALLEGRO_H
 
#define SOUND_ALLEGRO_H
 

	
 
#include "sound_driver.hpp"
 

	
 
/** Implementation of the allegro sound driver. */
 
class SoundDriver_Allegro: public SoundDriver {
 
class SoundDriver_Allegro : public SoundDriver {
 
public:
 
	/* virtual */ const char *Start(const char * const *param);
 

	
 
	/* virtual */ void Stop();
 

	
 
	/* virtual */ void MainLoop();
 
	/* virtual */ const char *GetName() const { return "allegro"; }
 
};
 

	
 
/** Factory for the allegro sound driver. */
 
class FSoundDriver_Allegro : public DriverFactoryBase {
 
public:
src/sound/cocoa_s.h
Show inline comments
 
@@ -5,25 +5,25 @@
 
 * OpenTTD 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, version 2.
 
 * OpenTTD 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 OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
/** @file cocoa_s.h Base for Cocoa sound handling. */
 

	
 
#ifndef SOUND_COCOA_H
 
#define SOUND_COCOA_H
 

	
 
#include "sound_driver.hpp"
 

	
 
class SoundDriver_Cocoa: public SoundDriver {
 
class SoundDriver_Cocoa : public SoundDriver {
 
public:
 
	/* virtual */ const char *Start(const char * const *param);
 

	
 
	/* virtual */ void Stop();
 
	/* virtual */ const char *GetName() const { return "cocoa"; }
 
};
 

	
 
class FSoundDriver_Cocoa : public DriverFactoryBase {
 
public:
 
	FSoundDriver_Cocoa() : DriverFactoryBase(Driver::DT_SOUND, 10, "cocoa", "Cocoa Sound Driver") {}
 
	/* virtual */ Driver *CreateInstance() const { return new SoundDriver_Cocoa(); }
 
};
src/sound/null_s.h
Show inline comments
 
@@ -6,25 +6,25 @@
 
 * OpenTTD 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 OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
/** @file null_s.h Base for the sound of silence. */
 

	
 
#ifndef SOUND_NULL_H
 
#define SOUND_NULL_H
 

	
 
#include "sound_driver.hpp"
 

	
 
/** Implementation of the null sound driver. */
 
class SoundDriver_Null: public SoundDriver {
 
class SoundDriver_Null : public SoundDriver {
 
public:
 
	/* virtual */ const char *Start(const char * const *param) { return NULL; }
 

	
 
	/* virtual */ void Stop() { }
 
	/* virtual */ const char *GetName() const { return "null"; }
 
};
 

	
 
/** Factory for the null sound driver. */
 
class FSoundDriver_Null : public DriverFactoryBase {
 
public:
 
	FSoundDriver_Null() : DriverFactoryBase(Driver::DT_SOUND, 1, "null", "Null Sound Driver") {}
 
	/* virtual */ Driver *CreateInstance() const { return new SoundDriver_Null(); }
src/sound/sdl_s.h
Show inline comments
 
@@ -6,25 +6,25 @@
 
 * OpenTTD 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 OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
/** @file sdl_s.h Base fo playing sound via SDL. */
 

	
 
#ifndef SOUND_SDL_H
 
#define SOUND_SDL_H
 

	
 
#include "sound_driver.hpp"
 

	
 
/** Implementation of the SDL sound driver. */
 
class SoundDriver_SDL: public SoundDriver {
 
class SoundDriver_SDL : public SoundDriver {
 
public:
 
	/* virtual */ const char *Start(const char * const *param);
 

	
 
	/* virtual */ void Stop();
 
	/* virtual */ const char *GetName() const { return "sdl"; }
 
};
 

	
 
/** Factory for the SDL sound driver. */
 
class FSoundDriver_SDL : public DriverFactoryBase {
 
public:
 
	FSoundDriver_SDL() : DriverFactoryBase(Driver::DT_SOUND, 5, "sdl", "SDL Sound Driver") {}
 
	/* virtual */ Driver *CreateInstance() const { return new SoundDriver_SDL(); }
src/sound/sound_driver.hpp
Show inline comments
 
@@ -6,22 +6,22 @@
 
 * OpenTTD 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 OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
/** @file sound_driver.hpp Base for all sound drivers. */
 

	
 
#ifndef SOUND_SOUND_DRIVER_HPP
 
#define SOUND_SOUND_DRIVER_HPP
 

	
 
#include "../driver.h"
 

	
 
/** Base for all sound drivers. */
 
class SoundDriver: public Driver {
 
class SoundDriver : public Driver {
 
public:
 
	/** Called once every tick */
 
	virtual void MainLoop() {}
 
};
 

	
 
extern SoundDriver *_sound_driver;
 
extern char *_ini_sounddriver;
 

	
 
#endif /* SOUND_SOUND_DRIVER_HPP */
src/sound/win32_s.h
Show inline comments
 
@@ -6,25 +6,25 @@
 
 * OpenTTD 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 OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
/** @file win32_s.h Base for Windows sound handling. */
 

	
 
#ifndef SOUND_WIN32_H
 
#define SOUND_WIN32_H
 

	
 
#include "sound_driver.hpp"
 

	
 
/** Implementation of the sound driver for Windows. */
 
class SoundDriver_Win32: public SoundDriver {
 
class SoundDriver_Win32 : public SoundDriver {
 
public:
 
	/* virtual */ const char *Start(const char * const *param);
 

	
 
	/* virtual */ void Stop();
 
	/* virtual */ const char *GetName() const { return "win32"; }
 
};
 

	
 
/** Factory for the sound driver for Windows. */
 
class FSoundDriver_Win32 : public DriverFactoryBase {
 
public:
 
	FSoundDriver_Win32() : DriverFactoryBase(Driver::DT_SOUND, 10, "win32", "Win32 WaveOut Sound Driver") {}
 
	/* virtual */ Driver *CreateInstance() const { return new SoundDriver_Win32(); }
src/video/allegro_v.h
Show inline comments
 
@@ -6,25 +6,25 @@
 
 * OpenTTD 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 OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
/** @file allegro_v.h Base of the Allegro video driver. */
 

	
 
#ifndef VIDEO_ALLEGRO_H
 
#define VIDEO_ALLEGRO_H
 

	
 
#include "video_driver.hpp"
 

	
 
/** The allegro video driver. */
 
class VideoDriver_Allegro: public VideoDriver {
 
class VideoDriver_Allegro : public VideoDriver {
 
public:
 
	/* virtual */ const char *Start(const char * const *param);
 

	
 
	/* virtual */ void Stop();
 

	
 
	/* virtual */ void MakeDirty(int left, int top, int width, int height);
 

	
 
	/* virtual */ void MainLoop();
 

	
 
	/* virtual */ bool ChangeResolution(int w, int h);
 

	
 
	/* virtual */ bool ToggleFullscreen(bool fullscreen);
src/video/cocoa/cocoa_v.h
Show inline comments
 
@@ -5,25 +5,25 @@
 
 * OpenTTD 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, version 2.
 
 * OpenTTD 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 OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
/** @file cocoa_v.h The Cocoa video driver. */
 

	
 
#ifndef VIDEO_COCOA_H
 
#define VIDEO_COCOA_H
 

	
 
#include "../video_driver.hpp"
 

	
 
class VideoDriver_Cocoa: public VideoDriver {
 
class VideoDriver_Cocoa : public VideoDriver {
 
public:
 
	/* virtual */ const char *Start(const char * const *param);
 

	
 
	/** Stop the video driver */
 
	/* virtual */ void Stop();
 

	
 
	/** Mark dirty a screen region
 
	 * @param left x-coordinate of left border
 
	 * @param top  y-coordinate of top border
 
	 * @param width width or dirty rectangle
 
	 * @param height height of dirty rectangle
 
	 */
src/video/cocoa/fullscreen.mm
Show inline comments
 
@@ -67,25 +67,25 @@ struct OTTD_QuartzGammaTable {
 
@end
 

	
 
@implementation NSScreen (NSScreenAccess)
 
- (void) setFrame:(NSRect)frame
 
{
 
/* The 64 bits libraries don't seem to know about _frame, so this hack won't work. */
 
#if !__LP64__
 
	_frame = frame;
 
#endif
 
}
 
@end
 

	
 
class FullscreenSubdriver: public CocoaSubdriver {
 
class FullscreenSubdriver : public CocoaSubdriver {
 
	CGDirectDisplayID  display_id;         ///< 0 == main display (only support single display)
 
	CFDictionaryRef    cur_mode;           ///< current mode of the display
 
	CFDictionaryRef    save_mode;          ///< original mode of the display
 
	CGDirectPaletteRef palette;            ///< palette of an 8-bit display
 

	
 

	
 
	/* Gamma functions to try to hide the flash from a res switch
 
	 * Fade the display from normal to black
 
	 * Save gamma tables for fade back to normal
 
	 */
 
	uint32 FadeGammaOut(OTTD_QuartzGammaTable *table)
 
	{
src/video/cocoa/wnd_quartz.mm
Show inline comments
 
@@ -48,25 +48,25 @@
 
 * C++ and objective C code can't be joined in all cases (classes stuff).
 
 * Read http://developer.apple.com/releasenotes/Cocoa/Objective-C++.html for more information.
 
 */
 

	
 
class WindowQuartzSubdriver;
 

	
 
/* Subclass of OTTD_CocoaView to fix Quartz rendering */
 
@interface OTTD_QuartzView : OTTD_CocoaView
 
- (void)setDriver:(WindowQuartzSubdriver*)drv;
 
- (void)drawRect:(NSRect)invalidRect;
 
@end
 

	
 
class WindowQuartzSubdriver: public CocoaSubdriver {
 
class WindowQuartzSubdriver : public CocoaSubdriver {
 
private:
 
	/**
 
	 * This function copies 8bpp pixels from the screen buffer in 32bpp windowed mode.
 
	 *
 
	 * @param left The x coord for the left edge of the box to blit.
 
	 * @param top The y coord for the top edge of the box to blit.
 
	 * @param right The x coord for the right edge of the box to blit.
 
	 * @param bottom The y coord for the bottom edge of the box to blit.
 
	 */
 
	void BlitIndexedToView32(int left, int top, int right, int bottom);
 

	
 
	virtual void GetDeviceInfo();
src/video/cocoa/wnd_quickdraw.mm
Show inline comments
 
@@ -36,25 +36,25 @@
 
/**
 
 * Important notice regarding all modifications!!!!!!!
 
 * There are certain limitations because the file is objective C++.
 
 * gdb has limitations.
 
 * C++ and objective C code can't be joined in all cases (classes stuff).
 
 * Read http://developer.apple.com/releasenotes/Cocoa/Objective-C++.html for more information.
 
 */
 

	
 

	
 
class WindowQuickdrawSubdriver;
 

	
 

	
 
class WindowQuickdrawSubdriver: public CocoaSubdriver {
 
class WindowQuickdrawSubdriver : public CocoaSubdriver {
 
private:
 
	/**
 
	 * This function copies 32bpp pixels from the screen buffer in 16bpp windowed mode.
 
	 *
 
	 * @param left The x coord for the left edge of the box to blit.
 
	 * @param top The y coord for the top edge of the box to blit.
 
	 * @param right The x coord for the right edge of the box to blit.
 
	 * @param bottom The y coord for the bottom edge of the box to blit.
 
	 */
 
	void Blit32ToView32(int left, int top, int right, int bottom);
 

	
 
	/**
src/video/dedicated_v.h
Show inline comments
 
@@ -6,25 +6,25 @@
 
 * OpenTTD 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 OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
/** @file dedicated_v.h Base for the dedicated video driver. */
 

	
 
#ifndef VIDEO_DEDICATED_H
 
#define VIDEO_DEDICATED_H
 

	
 
#include "video_driver.hpp"
 

	
 
/** The dedicated server video driver. */
 
class VideoDriver_Dedicated: public VideoDriver {
 
class VideoDriver_Dedicated : public VideoDriver {
 
public:
 
	/* virtual */ const char *Start(const char * const *param);
 

	
 
	/* virtual */ void Stop();
 

	
 
	/* virtual */ void MakeDirty(int left, int top, int width, int height);
 

	
 
	/* virtual */ void MainLoop();
 

	
 
	/* virtual */ bool ChangeResolution(int w, int h);
 

	
 
	/* virtual */ bool ToggleFullscreen(bool fullscreen);
src/video/null_v.h
Show inline comments
 
@@ -6,25 +6,25 @@
 
 * OpenTTD 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 OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
/** @file null_v.h Base of the video driver that doesn't blit. */
 

	
 
#ifndef VIDEO_NULL_H
 
#define VIDEO_NULL_H
 

	
 
#include "video_driver.hpp"
 

	
 
/** The null video driver. */
 
class VideoDriver_Null: public VideoDriver {
 
class VideoDriver_Null : public VideoDriver {
 
private:
 
	uint ticks; ///< Amount of ticks to run.
 

	
 
public:
 
	/* virtual */ const char *Start(const char * const *param);
 

	
 
	/* virtual */ void Stop();
 

	
 
	/* virtual */ void MakeDirty(int left, int top, int width, int height);
 

	
 
	/* virtual */ void MainLoop();
 

	
src/video/sdl_v.h
Show inline comments
 
@@ -6,25 +6,25 @@
 
 * OpenTTD 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 OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
/** @file sdl_v.h Base of the SDL video driver. */
 

	
 
#ifndef VIDEO_SDL_H
 
#define VIDEO_SDL_H
 

	
 
#include "video_driver.hpp"
 

	
 
/** The SDL video driver. */
 
class VideoDriver_SDL: public VideoDriver {
 
class VideoDriver_SDL : public VideoDriver {
 
public:
 
	/* virtual */ const char *Start(const char * const *param);
 

	
 
	/* virtual */ void Stop();
 

	
 
	/* virtual */ void MakeDirty(int left, int top, int width, int height);
 

	
 
	/* virtual */ void MainLoop();
 

	
 
	/* virtual */ bool ChangeResolution(int w, int h);
 

	
 
	/* virtual */ bool ToggleFullscreen(bool fullscreen);
src/video/video_driver.hpp
Show inline comments
 
@@ -7,25 +7,25 @@
 
 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
/** @file video_driver.hpp Base of all video drivers. */
 

	
 
#ifndef VIDEO_VIDEO_DRIVER_HPP
 
#define VIDEO_VIDEO_DRIVER_HPP
 

	
 
#include "../driver.h"
 
#include "../core/geometry_type.hpp"
 

	
 
/** The base of all video drivers. */
 
class VideoDriver: public Driver {
 
class VideoDriver : public Driver {
 
public:
 
	/**
 
	 * Mark a particular area dirty.
 
	 * @param left   The left most line of the dirty area.
 
	 * @param top    The top most line of the dirty area.
 
	 * @param width  The width of the dirty area.
 
	 * @param height The height of the dirty area.
 
	 */
 
	virtual void MakeDirty(int left, int top, int width, int height) = 0;
 

	
 
	/**
 
	 * Perform the actual drawing.
src/video/win32_v.h
Show inline comments
 
@@ -6,25 +6,25 @@
 
 * OpenTTD 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 OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
/** @file win32_v.h Base of the Windows video driver. */
 

	
 
#ifndef VIDEO_WIN32_H
 
#define VIDEO_WIN32_H
 

	
 
#include "video_driver.hpp"
 

	
 
/** The video driver for windows. */
 
class VideoDriver_Win32: public VideoDriver {
 
class VideoDriver_Win32 : public VideoDriver {
 
public:
 
	/* virtual */ const char *Start(const char * const *param);
 

	
 
	/* virtual */ void Stop();
 

	
 
	/* virtual */ void MakeDirty(int left, int top, int width, int height);
 

	
 
	/* virtual */ void MainLoop();
 

	
 
	/* virtual */ bool ChangeResolution(int w, int h);
 

	
 
	/* virtual */ bool ToggleFullscreen(bool fullscreen);
0 comments (0 inline, 0 general)