예제 #1
0
void AreaCombat::setupExtArea(const std::list<uint32_t>& list, uint32_t rows)
{
	if (list.empty()) {
		return;
	}

	hasExtArea = true;
	MatrixArea* area = createArea(list, rows);

	//NORTH-WEST
	areas[NORTHWEST] = area;

	uint32_t maxOutput = std::max<uint32_t>(area->getCols(), area->getRows()) * 2;

	//NORTH-EAST
	MatrixArea* neArea = new MatrixArea(maxOutput, maxOutput);
	copyArea(area, neArea, MATRIXOPERATION_MIRROR);
	areas[NORTHEAST] = neArea;

	//SOUTH-WEST
	MatrixArea* swArea = new MatrixArea(maxOutput, maxOutput);
	copyArea(area, swArea, MATRIXOPERATION_FLIP);
	areas[SOUTHWEST] = swArea;

	//SOUTH-EAST
	MatrixArea* seArea = new MatrixArea(maxOutput, maxOutput);
	copyArea(swArea, seArea, MATRIXOPERATION_MIRROR);
	areas[SOUTHEAST] = seArea;
}
예제 #2
0
void CombatArea::setupExtArea(const std::list<uint32_t>& list, uint32_t rows)
{
	if(list.empty())
		return;

	//NORTH-WEST
	MatrixArea* area = createArea(list, rows);
	areas[Direction::NORTH_WEST] = area;
	uint32_t maxOutput = std::max(area->getCols(), area->getRows()) * 2;

	//NORTH-EAST
	MatrixArea* neArea = new MatrixArea(maxOutput, maxOutput);
	copyArea(area, neArea, MATRIXOPERATION_MIRROR);
	areas[Direction::NORTH_EAST] = neArea;

	//SOUTH-WEST
	MatrixArea* swArea = new MatrixArea(maxOutput, maxOutput);
	copyArea(area, swArea, MATRIXOPERATION_FLIP);
	areas[Direction::SOUTH_WEST] = swArea;

	//SOUTH-EAST
	MatrixArea* seArea = new MatrixArea(maxOutput, maxOutput);
	copyArea(swArea, seArea, MATRIXOPERATION_MIRROR);
	areas[Direction::SOUTH_EAST] = seArea;

	hasExtArea = true;
}
예제 #3
0
파일: area.c 프로젝트: brayc0/nlfetdb
status
unionNormalisedArea(Area a, Area b)
{ int x, y, w, h;

  if ( b->w == ZERO && b->h == ZERO )
    succeed;
  if ( a->w == ZERO && a->h == ZERO )
  { copyArea(a, b);
    return normaliseArea(a);
  }

  { InitAreaA;
    InitAreaB;

    NormaliseArea(bx, by, bw, bh);

    x = (ax < bx ? ax : bx);
    y = (ay < by ? ay : by);
    w = (ax + aw > bx + bw ? ax + aw : bx + bw) - x;
    h = (ay + ah > by + bh ? ay + ah : by + bh) - y;

    assign(a, x, toInt(x));
    assign(a, y, toInt(y));
    assign(a, w, toInt(w));
    assign(a, h, toInt(h));
  }

  succeed;
}
예제 #4
0
파일: combat.cpp 프로젝트: edubart/otserv
void AreaCombat::setupArea(const std::list<uint32_t>& list, const uint32_t& rows)
{
	MatrixArea* area = createArea(list, rows);
	//NORTH
	areas[NORTH] = area;
	uint32_t maxOutput = std::max(area->getCols(), area->getRows()) * 2;
	//SOUTH
	MatrixArea* southArea = new MatrixArea(maxOutput, maxOutput);
	copyArea(area, southArea, MATRIXOPERATION_ROTATE180);
	areas[SOUTH] = southArea;
	//EAST
	MatrixArea* eastArea = new MatrixArea(maxOutput, maxOutput);
	copyArea(area, eastArea, MATRIXOPERATION_ROTATE90);
	areas[EAST] = eastArea;
	//WEST
	MatrixArea* westArea = new MatrixArea(maxOutput, maxOutput);
	copyArea(area, westArea, MATRIXOPERATION_ROTATE270);
	areas[WEST] = westArea;
}
예제 #5
0
void IgorEngine::PART_85() {
	playMusic(2);
	loadRoomData(PAL_SpringRock, IMG_SpringRock, BOX_SpringRock, MSK_SpringRock, TXT_SpringRock);
	memcpy(_screenLayer2, _screenLayer1, 46080);
	loadRoomData(PAL_SpringBridgeIntro, IMG_SpringBridgeIntro, 0, 0, TXT_SpringBridgeIntro);
	static const int anm[] = { ANM_PhilipLauraIntro, AOF_PhilipLauraIntro, ANM_LauraIntro, AOF_LauraIntro, 0 };
	loadAnimData(anm);
	memcpy(_screenVGA, _screenLayer1, 46080);
	_updateDialogue = &IgorEngine::PART_85_UPDATE_DIALOGUE_PHILIP_LAURA;
	_updateRoomBackground = &IgorEngine::PART_85_UPDATE_ROOM_BACKGROUND;
	VAR_WATER_SOUND_PLAYING = true;
	playSound(17, 1);
	decodeAnimFrame(getAnimFrame(0, 0x7480, 1), _screenVGA, true);
	fadeInPalette(768);
	if (_inputVars[kInputEscape]) goto PART_85_EXIT;
	PART_85_HELPER_1(0, 0x7481, 2, 7, 32);
	if (_inputVars[kInputEscape]) goto PART_85_EXIT;
	ADD_DIALOGUE_TEXT(201, 3, 545);
	ADD_DIALOGUE_TEXT(204, 1, 546);
	SET_DIALOGUE_TEXT(1, 2);
	startCutsceneDialogue(89, 56, 63, 63, 0);
	VAR_CURRENT_TALKING_ACTOR = 0;
	waitForEndOfCutsceneDialogue(89, 56, 63, 63, 0);
	if (_inputVars[kInputEscape]) goto PART_85_EXIT;
	ADD_DIALOGUE_TEXT(205, 3, 547);
	SET_DIALOGUE_TEXT(1, 1);
	startCutsceneDialogue(113, 59, 63, 0, 38);
	VAR_CURRENT_TALKING_ACTOR = 1;
	waitForEndOfCutsceneDialogue(113, 59, 63, 0, 38);
	if (_inputVars[kInputEscape]) goto PART_85_EXIT;
	ADD_DIALOGUE_TEXT(208, 1, 548);
	SET_DIALOGUE_TEXT(1, 1);
	startCutsceneDialogue(89, 56, 63, 63, 0);
	VAR_CURRENT_TALKING_ACTOR = 0;
	waitForEndOfCutsceneDialogue(89, 56, 63, 63, 0);
	if (_inputVars[kInputEscape]) goto PART_85_EXIT;
	ADD_DIALOGUE_TEXT(209, 2, 549);
	ADD_DIALOGUE_TEXT(211, 1, 550);
	ADD_DIALOGUE_TEXT(212, 1, 551);
	ADD_DIALOGUE_TEXT(213, 1, 552);
	ADD_DIALOGUE_TEXT(214, 1, 553);
	SET_DIALOGUE_TEXT(1, 5);
	startCutsceneDialogue(113, 59, 63, 0, 38);
	VAR_CURRENT_TALKING_ACTOR = 1;
	waitForEndOfCutsceneDialogue(113, 59, 63, 0, 38);
	if (_inputVars[kInputEscape]) goto PART_85_EXIT;
	PART_85_HELPER_1(0, 0x7481, 2, 7, 32);
	if (_inputVars[kInputEscape]) goto PART_85_EXIT;
	ADD_DIALOGUE_TEXT(215, 1, 554);
	ADD_DIALOGUE_TEXT(216, 2, 555);
	ADD_DIALOGUE_TEXT(218, 1, 556);
	SET_DIALOGUE_TEXT(1, 3);
	startCutsceneDialogue(89, 56, 63, 63, 0);
	VAR_CURRENT_TALKING_ACTOR = 0;
	waitForEndOfCutsceneDialogue(89, 56, 63, 63, 0);
	if (_inputVars[kInputEscape]) goto PART_85_EXIT;
	ADD_DIALOGUE_TEXT(219, 2, 557);
	ADD_DIALOGUE_TEXT(221, 2, 558);
	SET_DIALOGUE_TEXT(1, 2);
	startCutsceneDialogue(113, 59, 63, 0, 38);
	VAR_CURRENT_TALKING_ACTOR = 1;
	waitForEndOfCutsceneDialogue(113, 59, 63, 0, 38);
	if (_inputVars[kInputEscape]) goto PART_85_EXIT;
	decodeAnimFrame(getAnimFrame(0, 0x7480, 1), _screenVGA, true);
	PART_85_HELPER_1(0, 0x7481, 2, 7, 32);
	if (_inputVars[kInputEscape]) goto PART_85_EXIT;
	PART_85_HELPER_1(0, 0x7481, 18, 37, 20);
	if (_inputVars[kInputEscape]) goto PART_85_EXIT;
	PART_85_HELPER_2();
	VAR_WATER_SOUND_PLAYING = false;
	stopSound();
	if (_inputVars[kInputEscape]) goto PART_85_EXIT;
	PART_85_HELPER_1(0x74CA, 0xA6C4, 1, 6, 32);
	if (_inputVars[kInputEscape]) goto PART_85_EXIT;
	for (int i = 0; i <= 200 / kTimerTicksCount; ++i) {
		PART_85_UPDATE_ROOM_BACKGROUND();
		if (_inputVars[kInputEscape]) goto PART_85_EXIT;
		waitForTimer();
	}
	_walkData[0].x = 251;
	_walkData[0].y = 125;
	_walkData[0].scaleWidth = 50;
	_walkDataLastIndex = 1;
	_walkCurrentPos = 4;
	ADD_DIALOGUE_TEXT(223, 2, 559);
	SET_DIALOGUE_TEXT(1, 1);
	startIgorDialogue();
	waitForEndOfIgorDialogue();
	if (_inputVars[kInputEscape]) goto PART_85_EXIT;
	PART_85_HELPER_1(0x74CA, 0xA6C4, 7, 9, 32);
	if (_inputVars[kInputEscape]) goto PART_85_EXIT;
	_walkData[0].x = 250;
	_walkData[0].y = 119;
	_walkCurrentPos = 3;
	ADD_DIALOGUE_TEXT(225, 2, 560);
	ADD_DIALOGUE_TEXT(227, 3, 561);
	SET_DIALOGUE_TEXT(1, 2);
	startIgorDialogue();
	waitForEndOfIgorDialogue();
	if (_inputVars[kInputEscape]) goto PART_85_EXIT;
	PART_85_HELPER_1(0x74CA, 0xA6C4, 10, 24, 16);

PART_85_EXIT:
	stopSound();
	_gameState.dialogueTextRunning = false;
	_inputVars[kInputEscape] = 0;
	_walkData[0].setPos(155, 121, 4, 0);
	_walkData[0].setDefaultScale();
	copyArea(_screenLayer2, 23180, 320, _facingIgorFrames[3], 30, 30, 50, true);
	memcpy(_screenVGA, _screenLayer2, 46080);
	memset(_currentPalette + 0x270, 0, 0x8D);
	setPaletteRange(208, 254);
	_currentPart = 61;
	_updateDialogue = 0;
	_updateRoomBackground = 0;
}
예제 #6
0
void IgorEngine::PART_85_HELPER_6(int frame) {
	const int offset = (_walkCurrentPos == 4) ? 24564 : 22643;
	copyArea(_screenVGA, offset, 320, _screenLayer2 + offset, 320, 14, 8);
	copyArea(_screenVGA, offset, 320, _igorHeadFrames + (_walkCurrentPos - 1) * 924 + frame * 154, 14, 14, 8, true);
}