Esempio n. 1
0
void RenderManager::renderMenuToScreen() {
	if (!_menuSurfaceDirtyRect.isEmpty()) {
		_menuSurfaceDirtyRect.clip(Common::Rect(_menuSurface.w, _menuSurface.h));
		if (!_menuSurfaceDirtyRect.isEmpty()) {
			Common::Rect rect(
				_menuSurfaceDirtyRect.left + _menuArea.left,
				_menuSurfaceDirtyRect.top + _menuArea.top,
				_menuSurfaceDirtyRect.left + _menuArea.left + _menuSurfaceDirtyRect.width(),
				_menuSurfaceDirtyRect.top + _menuArea.top + _menuSurfaceDirtyRect.height()
			);
			copyToScreen(_menuSurface, rect, _menuSurfaceDirtyRect.left, _menuSurfaceDirtyRect.top);
		}
		_menuSurfaceDirtyRect = Common::Rect();
	}
}
Esempio n. 2
0
void RenderManager::processSubs(uint16 deltatime) {
	bool redraw = false;
	for (SubtitleMap::iterator it = _subsList.begin(); it != _subsList.end(); it++) {
		if (it->_value.timer != -1) {
			it->_value.timer -= deltatime;
			if (it->_value.timer <= 0)
				it->_value.todelete = true;
		}
		if (it->_value.todelete) {
			_subsList.erase(it);
			redraw = true;
		} else if (it->_value.redraw) {
			redraw = true;
		}
	}

	if (redraw) {
		_subtitleSurface.fillRect(Common::Rect(_subtitleSurface.w, _subtitleSurface.h), 0);

		for (SubtitleMap::iterator it = _subsList.begin(); it != _subsList.end(); it++) {
			OneSubtitle *sub = &it->_value;
			if (sub->txt.size()) {
				Graphics::Surface *rndr = new Graphics::Surface();
				rndr->create(sub->r.width(), sub->r.height(), _engine->_resourcePixelFormat);
				_engine->getTextRenderer()->drawTxtInOneLine(sub->txt, *rndr);
				Common::Rect empty;
				blitSurfaceToSurface(*rndr, empty, _subtitleSurface, sub->r.left - _subtitleArea.left + _workingWindow.left, sub->r.top - _subtitleArea.top + _workingWindow.top);
				rndr->free();
				delete rndr;
			}
			sub->redraw = false;
		}

		Common::Rect rect(
			_subtitleArea.left,
			_subtitleArea.top,
			_subtitleArea.left + _subtitleSurface.w,
			_subtitleArea.top + _subtitleSurface.h
		);
		copyToScreen(_subtitleSurface, rect, 0, 0);
	}
}
Esempio n. 3
0
void mainDraw(int mode) {
#ifdef USE_GL
	if(mode == 2)
		g_driver->CopyBlockPhys((unsigned char *)screen, 0, 0, 320, 200);
#endif


	if(mode == 0) {
		//restoreDirtyRects();
	} else {
		genVar5 = 0;
		copyToScreen(aux2, screen);
	}

#ifdef USE_GL
	g_driver->startFrame();
#endif

	setClipSize(0, 0, 319, 199);
	genVar6 = 0;

#ifdef USE_GL
	g_driver->cleanScreenKeepZBuffer();
#endif

#ifdef INTERNAL_DEBUGGER
	if(backgroundMode == backgroundModeEnum_3D) {
		for(int i = 0; i < getNumberOfRoom(); i++) {
			drawHardCol(i);
			drawSceZone(i);
		}

		drawConverZones();
	}
#endif



#ifdef USE_GL
	g_driver->startModelRender();
#endif

	for(int i = 0; i < numActorInList; i++) {
		int currentDrawActor = sortedActorTable[i];
		actorStruct *actorPtr;

		actorPtr = &actorTable[currentDrawActor];

		//if(actorPtr->flags & 0x25)
		{
			actorPtr->flags &= 0xFFFB;

			if(actorPtr->flags & 0x20) {
				mainDrawSub2(currentDrawActor);
			} else {
				char *bodyPtr = listBody->get(actorPtr->bodyNum);

				if(listBody->getVar1()) {
					//          initAnimInBody(actorPtr->FRAME, HQR_Get(listAnim, actorPtr->ANIM), bodyPtr);
				}

				renderModel(actorPtr->worldX + actorPtr->modX, actorPtr->worldY + actorPtr->modY, actorPtr->worldZ + actorPtr->modZ,
				            actorPtr->alpha, actorPtr->beta, actorPtr->gamma, bodyPtr);


				if(actorPtr->animActionType && actorPtr->field_98 != -1) {
					getHotPoint(actorPtr->field_98, bodyPtr, &actorPtr->hotPoint);
				}

				///////////////////////////////////// DEBUG
#ifdef INTERNAL_DEBUGGER
				//  if(debuggerVar_drawModelZv)
				{
					if(backgroundMode == backgroundModeEnum_3D) {
						drawZv(actorPtr);
					}
				}
#endif
				/////////////////////////////////////
			}

			if(BBox3D1 < 0)
				BBox3D1 = 0;
			if(BBox3D3 > 319)
				BBox3D3 = 319;
			if(BBox3D2 < 0)
				BBox3D2 = 0;
			if(BBox3D4 > 199)
				BBox3D4 = 199;

			if(BBox3D1 <= 319 && BBox3D2 <= 199 && BBox3D3 >= 0 && BBox3D4 >= 0) { // is the character on screen ?
				if(g_fitd->getGameType() == GType_AITD1) {
					if(actorPtr->field_0 == CVars[getCVarsIdx(LIGHT_OBJECT)]) {
						mainVar3 = (BBox3D3 + BBox3D1) / 2;
						mainVar2 = (BBox3D4 + BBox3D2) / 2;
					}
				}

#ifdef INTERNAL_DEBUGGER
				if(backgroundMode == backgroundModeEnum_2D)
#endif
				{
					if(g_fitd->getGameType() == GType_AITD1)
						drawBgOverlay(actorPtr);
				}
				//addToRedrawBox();
			} else {
				actorPtr->field_1A = -1;
				actorPtr->field_18 = -1;
				actorPtr->field_16 = -1;
				actorPtr->field_14 = -1;
			}
		}
	}

#ifdef USE_GL
	g_driver->stopModelRender();
#endif

	if(drawTextOverlay()) {
		//addToRedrawBox();
	}

	if(!lightVar1) {
		if(mode) {
			if(mode != 2 || lightVar2) {
				//makeBlackPalette();
				flipScreen();
				make3dTatouUnk1(0x10, 0);
				lightVar2 = 0;
			} else {
				//flipScreen();
			}
		} else {
			//mainDrawSub1();
		}
	} else {
	}

#ifdef INTERNAL_DEBUGGER
	debugger_draw();
#endif

#ifdef USE_GL
	g_driver->stopFrame();
#endif

	flipScreen();
}
Esempio n. 4
0
 */uchar usbFunctionWrite(uchar *data, uchar len) {
	static uchar myAdres;

	if (len > bytesRemaining) // if this is the last incomplete chunk
		len = bytesRemaining; // limit to the amount we can store
	bytesRemaining -= len;

	if (lineNo == 0) {
		lineNo = data[0];
		myAdres = 1;
		return bytesRemaining;
	}

	switch (lineNo) {
	case 1: { //Screen left line 1
		if (myAdres == 1) { //left part of string
			copyToScreen(data, len, screenLeft[0], myAdres);
			myAdres = 2;
			return bytesRemaining;
		}
		if (myAdres == 2) {
			copyToScreen(data, len, screenLeft[0], myAdres);
			myAdres = 0;
			lineNo = 0;
			return bytesRemaining;
		}
	}
		break;
	case 2: { //Screen left line 2
		if (myAdres == 1) { //left part of string
			copyToScreen(data, len, screenLeft[1], myAdres);
			myAdres = 2;
			return bytesRemaining;
		}
		if (myAdres == 2) {
			copyToScreen(data, len, screenLeft[1], myAdres);
			myAdres = 0;
			lineNo = 0;
			return bytesRemaining;
		}
	}
		break;
	case 3: { //Screen left line 3
		if (myAdres == 1) { //left part of string
			copyToScreen(data, len, screenLeft[2], myAdres);
			myAdres = 2;
			return bytesRemaining;
		}
		if (myAdres == 2) {
			copyToScreen(data, len, screenLeft[2], myAdres);
			myAdres = 0;
			lineNo = 0;
			return bytesRemaining;
		}
	}
		break;
	case 4: { //Screen left line 4
		if (myAdres == 1) { //left part of string
			copyToScreen(data, len, screenLeft[3], myAdres);
			myAdres = 2;
			return bytesRemaining;
		}
		if (myAdres == 2) {
			copyToScreen(data, len, screenLeft[3], myAdres);
			myAdres = 0;
			lineNo = 0;
			return bytesRemaining;
		}
	}
		break;

	case 5: { //Screen right line 1
		if (myAdres == 1) { //left part of string
			copyToScreen(data, len, screenRight[0], myAdres);
			myAdres = 2;
			return bytesRemaining;
		}
		if (myAdres == 2) {
			copyToScreen(data, len, screenRight[0], myAdres);
			myAdres = 0;
			lineNo = 0;
			return bytesRemaining;
		}
	}
		break;
	case 6: { //Screen right line 2
		if (myAdres == 1) { //left part of string
			copyToScreen(data, len, screenRight[1], myAdres);
			myAdres = 2;
			return bytesRemaining;
		}
		if (myAdres == 2) {
			copyToScreen(data, len, screenRight[1], myAdres);
			myAdres = 0;
			lineNo = 0;
			return bytesRemaining;
		}
	}
		break;
	case 7: { //Screen right line 3
		if (myAdres == 1) { //left part of string
			copyToScreen(data, len, screenRight[2], myAdres);
			myAdres = 2;
			return bytesRemaining;
		}
		if (myAdres == 2) {
			copyToScreen(data, len, screenRight[2], myAdres);
			myAdres = 0;
			lineNo = 0;
			return bytesRemaining;
		}
	}
		break;
	case 8: { //Screen right line 4
		if (myAdres == 1) { //left part of string
			copyToScreen(data, len, screenRight[3], myAdres);
			myAdres = 2;
			return bytesRemaining;
		}
		if (myAdres == 2) {
			copyToScreen(data, len, screenRight[3], myAdres);
			myAdres = 0;
			lineNo = 0;
			return bytesRemaining;
		}
	}
		break;
	default:
		break;
	}
	return bytesRemaining == 0; // return 1 if we have all data
}
Esempio n. 5
0
void setupCameraSub4(void) {
	copyToScreen(aux, aux2);

	//TODO: implementer la suite
}