Beispiel #1
0
void DeviceAudioDX11::setNumberOfChannels (const DTint num_channels)
{
#if DT2_MULTITHREADED_AUDIO
    AutoSpinLockRecursive lock(&_lock);
#endif

	PROFILER(PROFILER_SOUND);

    clearChannels();
	
    _channels.resize(num_channels); 

    for (DTuint c = 0; c < _channels.size(); ++c) {
		DeviceAudioDX11Channel &channel = _channels[c];

        channel._x_voice = NULL;

        // Initialize channel
        ::memset(&channel._x_format, 0, sizeof(WAVEFORMATEX));
        initializeChannel(channel, 44100, 16, 1);

        // Initialize 3D emitter
        ::memset(&channel._x3_emitter,0,sizeof(X3DAUDIO_EMITTER));
        channel._x3_emitter.ChannelCount = 1;
        channel._x3_emitter.CurveDistanceScaler = FLT_MIN;

        channel._current_packet = 0;
        channel._source = NULL;
		channel._ready_to_start = false;
        channel._needs_priming = false;

        channel._is_playing = false;
    }
}
Beispiel #2
0
Screen::Screen(MadeEngine *vm) : _vm(vm) {

	_palette = new byte[768];
	_newPalette = new byte[768];

	_backgroundScreen = new Graphics::Surface();
	_backgroundScreen->create(320, 200, Graphics::PixelFormat::createFormatCLUT8());

	_workScreen = new Graphics::Surface();
	_workScreen->create(320, 200, Graphics::PixelFormat::createFormatCLUT8());

	_backgroundScreenDrawCtx.clipRect = Common::Rect(320, 200);
	_workScreenDrawCtx.clipRect = Common::Rect(320, 200);

	_backgroundScreenDrawCtx.destSurface = _backgroundScreen;
	_workScreenDrawCtx.destSurface = _workScreen;
	_clipArea.destSurface = _workScreen;

	// Screen mask is only needed in v2 games
	if (_vm->getGameID() != GID_RTZ) {
		_screenMask = new Graphics::Surface();
		_screenMask->create(320, 200, Graphics::PixelFormat::createFormatCLUT8());
		_maskDrawCtx.clipRect = Common::Rect(320, 200);
		_maskDrawCtx.destSurface = _screenMask;
	}

	for (int i = 0; i <= 3; i++)
		_excludeClipAreaEnabled[i] = false;

	_screenLock = false;
	_paletteLock = false;

	_paletteInitialized = false;
	_needPalette = false;
	_oldPaletteColorCount = 256;
	_paletteColorCount = 256;
	memset(_newPalette, 0, 768);
	memset(_palette, 0, 768);

	_ground = 1;
	_clip = 0;
	_exclude = 0;
	_mask = 0;

	_visualEffectNum = 0;
	_fx = new ScreenEffects(this);

	_textX = 0;
	_textY = 0;
	_textColor = 0;
	_textRect.left = 0;
	_textRect.top = 0;
	_textRect.right = 320;
	_textRect.bottom = 200;
	_font = NULL;
	_currentFontNum = 0;
	_fontDrawCtx.clipRect = Common::Rect(320, 200);
	_fontDrawCtx.destSurface = _backgroundScreen;

	clearChannels();
}