Ejemplo n.º 1
0
bool TeenAgentEngine::showCDLogo() {
	Common::File cdlogo;
	if (!cdlogo.exists("cdlogo.res") || !cdlogo.open("cdlogo.res"))
		return true;

	byte bg[0xfa00];
	byte palette[3*256];

	cdlogo.read(bg, sizeof(bg));
	cdlogo.read(palette, sizeof(palette));
	for (uint c = 0; c < 3*256; ++c)
		palette[c] *= 4;
	_system->getPaletteManager()->setPalette(palette, 0, 0x100);
	_system->copyRectToScreen(bg, 320, 0, 0, 320, 200);
	_system->updateScreen();

	for(uint i = 0; i < 20; ++i) {
		int r = skipEvents();
		if (r != 0)
			return r > 0? true: false;
		_system->delayMillis(100);
	}
	cdlogo.close();

	return true;
}
Ejemplo n.º 2
0
bool TeenAgentEngine::showCDLogo() {
	Common::File cdlogo;
	if (!cdlogo.exists("cdlogo.res") || !cdlogo.open("cdlogo.res"))
		return true;

	byte bg[0xfa00];
	byte palette[0x400];

	cdlogo.read(bg, sizeof(bg));
	memset(palette, 0, sizeof(palette));

	for(uint c = 0; c < 0x100; ++c) {
		uint idx = c * 4;
		cdlogo.read(palette + idx, 3);
		palette[idx] *= 4;
		palette[idx + 1] *= 4;
		palette[idx + 2] *= 4;
	}
	_system->setPalette(palette, 0, 0x100);
	_system->copyRectToScreen(bg, 320, 0, 0, 320, 200);
	_system->updateScreen();

	for(uint i = 0; i < 20; ++i) {
		int r = skipEvents();
		if (r != 0)
			return r > 0? true: false;
		_system->delayMillis(100);
	}
	cdlogo.close();

	return true;
}
Ejemplo n.º 3
0
bool TeenAgentEngine::showLogo() {
	FilePack logo;
	if (!logo.open("unlogic.res"))
		return true;

	byte bg[0xfa00];
	byte palette[0x400];

	Common::ScopedPtr<Common::SeekableReadStream> frame(logo.getStream(1));
	if (!frame)
		return true;

	frame->read(bg, sizeof(bg));
	memset(palette, 0, sizeof(palette));

	for(uint c = 0; c < 0x100; ++c) {
		uint idx = c * 4;
		frame->read(palette + idx, 3);
		palette[idx] *= 4;
		palette[idx + 1] *= 4;
		palette[idx + 2] *= 4;
	}
	_system->setPalette(palette, 0, 0x100);

	uint n = logo.fileCount();
	for(uint f = 0; f < 4; ++f)
		for(uint i = 2; i <= n; ++i) {
			{
				int r = skipEvents();
				if (r != 0)
					return r > 0? true: false;
			}
			_system->copyRectToScreen(bg, 320, 0, 0, 320, 200);

			frame.reset(logo.getStream(i));
			if (!frame)
				return true;

			Surface s;
			s.load(frame, Surface::kTypeOns);
			if (s.empty())
				return true;

			_system->copyRectToScreen((const byte *)s.pixels, s.w, s.x, s.y, s.w, s.h);
			_system->updateScreen();

			_system->delayMillis(100);
		}
	return true;
}
Ejemplo n.º 4
0
void BookmarkView::onTreeSelect( wxTreeEvent& event ) {

    if (skipEvents()) {
        return;
    }

    wxTreeItemId itm = event.GetItem();
    TreeViewItem* tvi = dynamic_cast<TreeViewItem*>(m_treeView->GetItemData(itm));

    if (!tvi) {
        
        if (itm == bookmarkBranch) {
            bookmarkBranchSelection();
        } else if (itm == activeBranch) {
            activeBranchSelection();
        } else if (itm == recentBranch) {
            recentBranchSelection();
        } else if (itm == rangeBranch) {
            rangeBranchSelection();
        } else {
            hideProps();
            this->Layout();
        }
        
        return;
    }
                                                    
    if (tvi->type == TreeViewItem::TREEVIEW_ITEM_TYPE_ACTIVE) {
        activeSelection(tvi->demod);
        if (tvi->demod->isActive()) {
            wxGetApp().getDemodMgr().setActiveDemodulator(nullptr, true);
            wxGetApp().getDemodMgr().setActiveDemodulator(tvi->demod, false);
            tvi->demod->setTracking(true);
        }
    } else if (tvi->type == TreeViewItem::TREEVIEW_ITEM_TYPE_RECENT) {
        recentSelection(tvi->bookmarkEnt);
    } else if (tvi->type == TreeViewItem::TREEVIEW_ITEM_TYPE_BOOKMARK) {
        bookmarkSelection(tvi->bookmarkEnt);
    } else if (tvi->type == TreeViewItem::TREEVIEW_ITEM_TYPE_GROUP) {
        groupSelection(tvi->groupName);
    } else if (tvi->type == TreeViewItem::TREEVIEW_ITEM_TYPE_RANGE) {
        rangeSelection(tvi->rangeEnt);
    } else {
        hideProps();
        this->Layout();
    }
}
Ejemplo n.º 5
0
bool TeenAgentEngine::showMetropolis() {
	_system->fillScreen(0);
	_system->updateScreen();

	FilePack varia;
	varia.open("varia.res");

	byte palette[0x400];
	memset(palette, 0, sizeof(palette));
	{
		Common::ScopedPtr<Common::SeekableReadStream> s(varia.getStream(5));
		for(uint c = 0; c < 0x400; c += 4) {
			s->read(palette + c, 3);
			palette[c] *= 4;
			palette[c + 1] *= 4;
			palette[c + 2] *= 4;
		}
	}

	_system->setPalette(palette, 0, 0x100);

	byte varia_6[21760], varia_9[18302];
	varia.read(6, varia_6, sizeof(varia_6));
	varia.read(9, varia_9, sizeof(varia_9));

	byte colors[56 * 160 * 2];
	memset(colors, 0, sizeof(colors));

	int logo_y = -56;
	for(uint f = 0; f < 300; ++f) {
		{
			int r = skipEvents();
			if (r != 0)
				return r > 0? true: false;
		}

		Graphics::Surface *surface = _system->lockScreen();
		if (logo_y > 0) {
			surface->fillRect(Common::Rect(0, 0, 320, logo_y), 0);
		}

		{
			//generate colors matrix
			memmove(colors + 320, colors + 480, 8480);
			for(uint c = 0; c < 17; ++c) {
				byte x = (random.getRandomNumber(184) + 5) & 0xff;
				uint offset = 8800 + random.getRandomNumber(158);
				colors[offset++] = x;
				colors[offset++] = x;
			}
			for(uint y = 1; y < 56; ++y) {
				for(uint x = 1; x < 160; ++x) {
					uint offset = y * 160 + x;
					uint v =
						(uint)colors[offset - 161] + colors[offset - 160] + colors[offset - 159] +
						(uint)colors[offset - 1] + colors[offset + 1] +
						(uint)colors[offset + 161] + colors[offset + 160] + colors[offset + 159];
					v >>= 3;
					colors[offset + 8960] = v;
				}
			}
			memmove(colors, colors + 8960, 8960);
		}

		byte *dst = (byte *)surface->getBasePtr(0, 131);
		byte *src = varia_6;
		for(uint y = 0; y < 68; ++y) {
			for(uint x = 0; x < 320; ++x) {
				if (*src++ == 1) {
					*dst++ = colors[19 * 160 + y / 2 * 160 + x / 2];
				} else
					++dst;
			}
		}
		_system->unlockScreen();

		_system->copyRectToScreen(
			varia_9 + (logo_y < 0? -logo_y * 320: 0), 320,
			0, logo_y >= 0? logo_y: 0,
			320, logo_y >= 0? 57: 57 + logo_y);

		if (logo_y < 82 - 57)
			++logo_y;


		_system->updateScreen();
		_system->delayMillis(100);
	}
	return true;
}