コード例 #1
0
/**
 *  Zeichenmethode.
 *
 *  @return @p true bei Erfolg, @p false bei Fehler
 */
void ctrlPercent::Draw_()
{
    // Wenn der Prozentsatzpointer = 0, dann wird 0 angezeigt und es soll nich abstürzen!
    unsigned short percentage = (this->percentage_ ? *this->percentage_ : 0);

    if(percentage > 100)
        percentage = 100;

    // Farbe wählen je nachdem wie viel Prozent
    unsigned color;
    if(percentage >= 60)
        color = COLOR_60_PERCENT;
    else if(percentage >= 30)
        color = COLOR_30_PERCENT;
    else if(percentage >= 20)
        color = COLOR_20_PERCENT;
    else
        color = COLOR_0_PERCENT;

    // Box zeichnen
    Draw3D(Rect(GetDrawPos(), GetSize()), tc, false);

    // Fortschritt zeichnen
    Extent progSize = GetSize() - Extent(8, 8);
    progSize.x = (progSize.x * percentage) / 100;
    DrawRectangle(Rect(GetDrawPos() + DrawPoint(4, 4), progSize), color);

    // Text zeichnen
    std::string caption = helpers::toString(percentage) + "%";
    font->Draw(GetDrawPos() + DrawPoint(GetSize()) / 2, caption, FontStyle::CENTER | FontStyle::VCENTER, text_color);
}
コード例 #2
0
ファイル: ctrlDeepening.cpp プロジェクト: Flow86/s25client
/**
 *  zeichnet das Fenster.
 */
bool ctrlDeepening::Draw_()
{
    Draw3D(GetDrawPos(), width_, height_, tc, 2);

    font->Draw(GetDrawPos() + DrawPoint(width_, height_) / 2, text, glArchivItem_Font::DF_CENTER | glArchivItem_Font::DF_VCENTER, color_);

    DrawContent();

    return true;
}
コード例 #3
0
ファイル: iwBuilding.cpp プロジェクト: viksuhor/s25client
void iwBuilding::Msg_PaintAfter()
{
    if(building->GetBuildingType() >= BLD_GRANITEMINE && building->GetBuildingType() <= BLD_GOLDMINE)
    {
        // Bei Bergwerken sieht die Nahrungsanzeige ein wenig anders aus (3x 2)

        // "Schwarzer Rahmen"
        DrawRectangle(GetDrawPos() + DrawPoint(40, 60), 144, 24, 0x80000000);
        DrawPoint curPos = GetDrawPos() + DrawPoint(52, 72);
        for(unsigned char i = 0; i < 3; ++i)
        {
            for(unsigned char z = 0; z < 2; ++z)
            {
                glArchivItem_Bitmap* bitmap = LOADER.GetMapImageN(2250 + USUAL_BUILDING_CONSTS[building->GetBuildingType() - 10].wares_needed[i]);
                bitmap->Draw(curPos, 0, 0, 0, 0, 0, 0, (z < building->GetWares(i) ? 0xFFFFFFFF : 0xFF404040) );
                curPos.x += 24;
            }
        }
    }
    else
    {
        DrawPoint curPos = GetDrawPos() + DrawPoint(width_ / 2, 60);
        for(unsigned char i = 0; i < 2; ++i)
        {
            if(USUAL_BUILDING_CONSTS[building->GetBuildingType() - 10].wares_needed[i] == GD_NOTHING)
                break;

            // 6x Waren, je nachdem ob sie da sind, bei Katapult 4!
            unsigned wares_count = (building->GetBuildingType() == BLD_CATAPULT) ? 4 : 6;

            // "Schwarzer Rahmen"
            DrawPoint waresPos = curPos - DrawPoint(24 * wares_count / 2, 0);
            DrawRectangle(waresPos, 24 * wares_count, 24, 0x80000000);
            waresPos += DrawPoint(12, 12);

            for(unsigned char z = 0; z < wares_count; ++z)
            {
                glArchivItem_Bitmap* bitmap = LOADER.GetMapImageN(2250 + USUAL_BUILDING_CONSTS[building->GetBuildingType() - 10].wares_needed[i]);
                bitmap->Draw(waresPos, 0, 0, 0, 0, 0, 0, (z < building->GetWares(i) ? COLOR_WHITE : 0xFF404040) );
                waresPos.x += 24;
            }

            std::stringstream text;
            text << (unsigned int)building->GetWares(i) << "/" << wares_count;
            NormalFont->Draw(curPos + DrawPoint(0, 12), text.str(), glArchivItem_Font::DF_CENTER | glArchivItem_Font::DF_VCENTER);
            curPos.y += 29;
        }
    }
}
コード例 #4
0
ファイル: LayerMap.cpp プロジェクト: psgsgpsg/scrapbookonline
void CLayerMap::DrawChar(PCImg32 pDst, int nDrawY/*-99*/)
{
	int i, nCount, x, y;
	PCInfoCharCli pChar;
	POINT ptTmp;

	nCount = m_pLibInfoChar->GetCount ();
	m_pMgrDraw->LockDibTmp ();
	for (i = 0; i < nCount; i ++) {
		pChar = (PCInfoCharCli)m_pLibInfoChar->GetPtr (i);
		if (nDrawY != -99) {
			if (m_nViewY / 2 + nDrawY != pChar->m_nMapY / 2) {
				continue;
			}
		}
		x = y = 32;

		pChar->GetViewCharPos (ptTmp);
		x -= ptTmp.x;
		y -= ptTmp.y;

		GetDrawPos (pChar, x, y);
		m_pMgrDraw->DrawChar (pDst, x, y, pChar, FALSE);
	}
	m_pMgrDraw->UnLockDibTmp ();
}
コード例 #5
0
void iwBuildingSite::Msg_PaintBefore()
{
    // Schatten des Gebäudes (muss hier gezeichnet werden wegen schwarz und halbdurchsichtig)
    glArchivItem_Bitmap* bitmap = buildingsite->GetBuildingImageShadow();

    if(bitmap)
        bitmap->Draw(GetDrawPos() + DrawPoint(113, 130), 0, 0, 0, 0, 0, 0, COLOR_SHADOW);
}
コード例 #6
0
ファイル: ctrlComboBox.cpp プロジェクト: Flow86/s25client
/**
 *  zeichnet das Fenster.
 */
bool ctrlComboBox::Draw_()
{
    ctrlList* liste = GetCtrl<ctrlList>(0);

    // Box
    Draw3D(GetDrawPos(), width_, height_, tc, 2);

    // Namen des selektierten Strings in der Box anzeigen
    if(liste->GetLineCount() > 0)
        font->Draw(GetDrawPos() + DrawPoint(2, height_ / 2), liste->GetSelItemText(), glArchivItem_Font::DF_VCENTER, COLOR_YELLOW, 0, width_ - 2 - height_, "");

    // Male restliche Controls per Hand, denn ein einfaches DrawControls() würde
    // auch die Liste malen, die bei Msg_PaintAfter() sowieso gemalt wird.
    ctrlImageButton* button = GetCtrl<ctrlImageButton>(1);
    if(button)
        button->Draw();

    return true;
}
コード例 #7
0
ファイル: ctrlMultiline.cpp プロジェクト: viksuhor/s25client
/**
 *  zeichnet das Fenster.
 */
bool ctrlMultiline::Draw_()
{
    if(draw_box)
        Draw3D(GetDrawPos(), width_, height_, tc, 2);

    DrawControls();

    unsigned show_lines = std::min(lines_in_control, unsigned(lines.size()));

    unsigned scrollbarPos = GetCtrl<ctrlScrollBar>(0)->GetPos();
    DrawPoint curPos = GetDrawPos() + DrawPoint(2, 2);
    for(unsigned i = 0; i < show_lines; ++i)
    {
        font->Draw(curPos, lines[i + scrollbarPos].str, format, lines[i + scrollbarPos].color);
        curPos.y += font->getHeight();
    }

    return true;
}
コード例 #8
0
ファイル: LayerMap.cpp プロジェクト: psgsgpsg/scrapbookonline
void CLayerMap::RenewLevel(void)
{
	int i, nCount, x, y, cx, r, nTmp;
	WORD wGrpIDMainBase, wGrpIdNPC;
	PCInfoCharCli pChar;
	POINT ptTmp;
	PCInfoMotion pInfoMotion;
	PCInfoMapBase pMap;

	pMap = m_pMgrData->GetMap ();
	if (pMap == NULL) {
		return;
	}
	if (pMap->m_byLevel == 0) {
		return;
	}

	m_pDibLevel->FillRect (0, 0, m_pDibLevel->Width (), m_pDibLevel->Height (), RGB (100 - pMap->m_byLevel, 0, 0));
	nCount = m_pLibInfoChar->GetCount ();
	for (i = 0; i < nCount; i ++) {
		pChar = (PCInfoCharCli)m_pLibInfoChar->GetPtr (i);
		if (pChar->m_nLightLevel == 0) {
			continue;
		}

		pInfoMotion = pChar->GetMotionInfo ();
		wGrpIDMainBase	= pInfoMotion->m_wGrpIDMainBase;
		wGrpIdNPC		= pChar->m_wGrpIDNPC;
		if (wGrpIdNPC != 0) {
			if (wGrpIdNPC >= 50000) {
				wGrpIdNPC -= 50000;
				if (wGrpIDMainBase == GRPIDMAIN_2X2_CHAR) {
					wGrpIDMainBase = GRPIDMAIN_2X2_NPC;
				} else {
					wGrpIDMainBase = GRPIDMAIN_NPC;
				}
			} else {
				wGrpIDMainBase = GRPIDMAIN_2X2_NPC;
			}
		}

		x = y = 32;
		GetDrawPos (pChar, x, y);
		x += pChar->m_ptMove.x;
		y += pChar->m_ptMove.y;
		pChar->GetViewCharPos (ptTmp);
		y -= (ptTmp.y / 2);
		cx = m_pMgrGrpData->GetGrpSize (wGrpIDMainBase);
		r = cx * 2;
		nTmp = (r - cx / 2);
//		m_pDibLevel->CircleGradation (x - nTmp, y - nTmp, r, cx + cx / 2, RGB (50, 0, 0));
		m_pDibLevel->BltPlus (x - nTmp, y - nTmp, r * 2, r * 2, m_pDibLevelTmp, 0, 0, 100, TRUE);
//		m_pDibLevel->Circle (x - nTmp, y - nTmp, r, RGB (100, 0, 0));
	}
}
コード例 #9
0
ファイル: iwAction.cpp プロジェクト: viksuhor/s25client
void iwAction::Msg_PaintAfter()
{
    ctrlTab* tab = GetCtrl<ctrlTab>(0);
    if(tab)
    {
        // Anzeige Soldaten/mögliche Soldatenanzahl bei Angriffstab
        if(tab->GetCurrentTab() == TAB_ATTACK && available_soldiers_count > 0)
        {
            char str[32];
            sprintf(str, "%u/%u", selected_soldiers_count, available_soldiers_count);
            LargeFont->Draw(GetDrawPos() + DrawPoint(67, 79), str, glArchivItem_Font::DF_CENTER, COLOR_YELLOW);
        }
        else if(tab->GetCurrentTab() == TAB_SEAATTACK && available_soldiers_count_sea > 0)
        {
            char str[32];
            sprintf(str, "%u/%u", selected_soldiers_count_sea, available_soldiers_count_sea);
            LargeFont->Draw(GetDrawPos() + DrawPoint(67, 79), str, glArchivItem_Font::DF_CENTER, COLOR_YELLOW);
        }
    }
}
コード例 #10
0
ファイル: iwDiplomacy.cpp プロジェクト: Flow86/s25client
void iwDiplomacy::Msg_PaintBefore()
{
    // Die farbigen Zeilen malen
    DrawPoint curPos = GetDrawPos() + DrawPoint(LINE_DISTANCE_TO_MARGINS, FIRST_LINE_Y);
    for(unsigned i = 0; i < gwv.GetWorld().GetPlayerCount(); ++i)
    {
        // Rechtecke in Spielerfarbe malen mit entsprechender Transparenz
        DrawRectangle(curPos, width_ - 2 * LINE_DISTANCE_TO_MARGINS, CELL_HEIGHT, SetAlpha(gwv.GetWorld().GetPlayer(i).color, 0x40));
        curPos.y += CELL_HEIGHT + SPACE_HEIGHT;
    }
}
コード例 #11
0
ファイル: iwBuilding.cpp プロジェクト: viksuhor/s25client
void iwBuilding::Msg_PaintBefore()
{
    // Schatten des Gebäudes (muss hier gezeichnet werden wegen schwarz und halbdurchsichtig)
    glArchivItem_Bitmap* bitmap = building->GetBuildingImageShadow();

    if(bitmap)
        bitmap->Draw(GetDrawPos() + DrawPoint(117, 114), 0, 0, 0, 0, 0, 0, COLOR_SHADOW);

    // Haus unbesetzt ggf ausblenden
    GetCtrl<ctrlText>(10)->SetVisible(!building->HasWorker());
}
コード例 #12
0
ファイル: ctrlProgress.cpp プロジェクト: vader1986/s25client
/**
 *  Zeichenmethode.
 *
 *  @return @p true bei Erfolg, @p false bei Fehler
 */
bool ctrlProgress::Draw_()
{
    DrawPoint barPos = GetDrawPos() + padding;
    // Offset by button size
    barPos.x += height_;
    Draw3D(barPos, CalcBarWidth(), height_ - 2 * padding.y, tc, 2);

    // Buttons
    DrawControls();

    const DrawPoint innerPadding(4, 4);
    unsigned int percentage = position * 100 / maximum;
    unsigned int progress = (CalcBarWidth() - innerPadding.x * 2) * position / maximum;

    // Farbe herausfinden
    unsigned int color = 0xFFD70000;

    // Feste Farbe?
    if(force_color)
        color = force_color;
    else
    {
        // Farbe wählen je nachdem wie viel Prozent
        if(percentage >= 60)
            color = 0xFF71B63C;
        else if(percentage >= 30)
            color = 0xFFFFBF33;
        else if(percentage >= 20)
            color = 0xFFDB7428;
    }

    // Leiste
    DrawRectangle(barPos + innerPadding, progress, height_ - 2 * (innerPadding.y + padding.y), color);

    // Prozentzahlen zeichnen
    std::stringstream percent;
    percent << percentage << "%";
    SmallFont->Draw(GetDrawPos() + DrawPoint(width_, height_) / 2, percent.str(), glArchivItem_Font::DF_VCENTER | glArchivItem_Font::DF_CENTER, COLOR_YELLOW);

    return true;
}
コード例 #13
0
void iwDiplomacy::Msg_PaintBefore()
{
    // Farben, die zu den 3 Bündnisstates gesetzt werden (0-kein Bündnis, 1-in Arbeit, 2-Bündnis abgeschlossen)
    const std::array<unsigned, 3> PACT_COLORS = {COLOR_RED, COLOR_YELLOW, COLOR_GREEN};

    IngameWindow::Msg_PaintBefore();
    // Die farbigen Zeilen malen
    DrawPoint curPos = GetDrawPos() + DrawPoint(LINE_DISTANCE_TO_MARGINS, FIRST_LINE_Y);
    Rect curRect(curPos, Extent(GetSize().x - 2 * LINE_DISTANCE_TO_MARGINS, CELL_HEIGHT));
    for(unsigned i = 0; i < gwv.GetWorld().GetNumPlayers(); ++i)
    {
        // Rechtecke in Spielerfarbe malen mit entsprechender Transparenz
        DrawRectangle(curRect, SetAlpha(gwv.GetWorld().GetPlayer(i).color, 0x40));
        curRect.move(DrawPoint(0, CELL_HEIGHT + SPACE_HEIGHT));

        // Farben der Bündnis-Buttons setzen, je nachdem wie der Status ist

        // Existiert der Button auch?
        auto* button = GetCtrl<ctrlImageButton>(300 + i);
        // Bündnisvertrag
        if(button)
            // Farbe je nach Bündnisstatus setzen
            button->SetModulationColor(PACT_COLORS[gwv.GetPlayer().GetPactState(TREATY_OF_ALLIANCE, i)]);
        // Nicht-Angriffspakt
        button = GetCtrl<ctrlImageButton>(400 + i);
        if(button)
            // Farbe je nach Bündnisstatus setzen
            button->SetModulationColor(PACT_COLORS[gwv.GetPlayer().GetPactState(NON_AGGRESSION_PACT, i)]);

        // Ggf. Ping aktualisieren
        if(auto* pingfield = GetCtrl<ctrlTextDeepening>(200 + i))
            pingfield->SetText(helpers::toString(gwv.GetWorld().GetPlayer(i).ping));

        // Verbleibende Zeit der Bündnisse in den Text-Ctrls anzeigen
        if(GetCtrl<ctrlText>(500 + i))
        {
            for(unsigned z = 0; z < 2; ++z)
            {
                unsigned duration = gwv.GetPlayer().GetRemainingPactTime(PactType(z), i);
                // Überhaupt ein Bündnis abgeschlossen und Bündnis nicht für die Ewigkeit?
                if(duration > 0 && duration != 0xFFFFFFFF)
                    // Dann entsprechende Zeit setzen
                    GetCtrl<ctrlText>(500 + z * 100 + i)->SetText(GAMECLIENT.FormatGFTime(duration));
                else
                    // Ansonsten leer
                    GetCtrl<ctrlText>(500 + z * 100 + i)->SetText("");
            }
        }
    }
}
コード例 #14
0
ファイル: ctrlScrollBar.cpp プロジェクト: Flow86/s25client
/**
 *  Zeichenmethode.
 *
 *  @return @p true bei Erfolg, @p false bei Fehler
 */
bool ctrlScrollBar::Draw_()
{
    DrawPoint pos = GetDrawPos();
    // Leiste
    Draw3D(pos + DrawPoint(0, button_height - 2), width_, height_ - button_height * 2 + 4, tc, 2);

    // Buttons
    DrawControls();

    // Scrollbar
    Draw3D(pos + DrawPoint(0, button_height + scrollbar_pos), width_, scrollbar_height, tc, 0);

    return true;
}
コード例 #15
0
bool ctrlImage::Msg_MouseMove(const MouseCoords& mc)
{
    // gültiges Bild?
    if(GetImage())
    {
        // Jeweils Tooltip ein- und ausblenden, wenn die Maus über dem Bild ist
        if(IsPointInRect(mc.GetPos(), Rect::move(GetImageRect(), GetDrawPos())))
            ShowTooltip();
        else
            HideTooltip();
    }

    return false;
}
コード例 #16
0
ファイル: ctrlScrollBar.cpp プロジェクト: vader1986/s25client
/**
 *  Zeichenmethode.
 *
 *  @return @p true bei Erfolg, @p false bei Fehler
 */
bool ctrlScrollBar::Draw_()
{
    RTTR_Assert(scroll_range > pagesize); // Don't show unneccessary scrollbars, otherwise invariants might be violated.
    if(scroll_height == 0)
        return true;
    DrawPoint pos = GetDrawPos();
    // Leiste
    Draw3D(pos + DrawPoint(0, button_height - 2), width_, height_ - button_height * 2 + 4, tc, 2);

    // Buttons
    DrawControls();

    // Scrollbar
    Draw3D(pos + DrawPoint(0, button_height + sliderPos), width_, sliderHeight, tc, 0);

    return true;
}
コード例 #17
0
void iwBuildingSite::Msg_PaintAfter()
{
    // Baukosten zeichnen
    DrawPoint curPos = GetDrawPos() + DrawPoint(width_ / 2, 60);
    for(unsigned char i = 0; i < 2; ++i)
    {
        unsigned int wares_count = 0;
        unsigned int wares_delivered = 0;
        unsigned int wares_used = 0;

        if(i == 0)
        {
            wares_count = BUILDING_COSTS[buildingsite->GetNation()][buildingsite->GetBuildingType()].boards;
            wares_used = buildingsite->getUsedBoards();
            wares_delivered = buildingsite->getBoards() + wares_used;
        }
        else
        {
            wares_count = BUILDING_COSTS[buildingsite->GetNation()][buildingsite->GetBuildingType()].stones;
            wares_used = buildingsite->getUsedStones();
            wares_delivered = buildingsite->getStones() + wares_used;
        }

        if(wares_count == 0)
            break;

        // "Schwarzer Rahmen"
        DrawPoint waresPos = curPos - DrawPoint(24 * wares_count / 2, 0);
        DrawRectangle(waresPos, 24 * wares_count, 24, 0x80000000);
        waresPos += DrawPoint(12, 12);

        // Die Waren
        for(unsigned char z = 0; z < wares_count; ++z)
        {
            glArchivItem_Bitmap* bitmap = LOADER.GetMapImageN(2250 + (i == 0 ? GD_BOARDS : GD_STONES));
            bitmap->Draw(waresPos, 0, 0, 0, 0, 0, 0, (z < wares_delivered ? 0xFFFFFFFF : 0xFF404040) );

            // Hammer wenn Ware verbaut
            if(z < wares_used)
                LOADER.GetMapImageN(2250 + GD_HAMMER)->Draw(waresPos);
            waresPos.x += 24;
        }
        curPos.y += 29;
    }
}
コード例 #18
0
ファイル: iwBuildings.cpp プロジェクト: vader1986/s25client
/// Anzahlen der Gebäude zeichnen
void iwBuildings::Msg_PaintAfter()
{
    // Anzahlen herausfinden
    BuildingCount bc = gwv.GetViewer().GetPlayer().GetBuildingCount();

    // Anzahlen unter die Gebäude schreiben
    DrawPoint rowPos = GetDrawPos() + iconPadding + DrawPoint(0, font_distance_y);
    for(unsigned short y = 0; y < BUILDINGS_COUNT / 4 + (BUILDINGS_COUNT % 4 > 0 ? 1 : 0); ++y)
    {
        DrawPoint curPos = rowPos;
        for(unsigned short x = 0; x < ((y == BUILDINGS_COUNT / 4) ? BUILDINGS_COUNT % 4 : 4); ++x)
        {
            char txt[64];
            sprintf(txt, "%u/%u", bc.buildings[bts[y * 4 + x]], bc.buildingSites[bts[y * 4 + x]]);
            NormalFont->Draw(curPos, txt, glArchivItem_Font::DF_CENTER, COLOR_YELLOW);
            curPos.x += iconSpacing.x;
        }
        rowPos.y += iconSpacing.y;
    }
}
コード例 #19
0
ファイル: LayerMap.cpp プロジェクト: psgsgpsg/scrapbookonline
void CLayerMap::DrawCharText(PCImg32 pDst, int nDrawY/*-1*/)
{
	BOOL bResult, bDraw, bDrawChat;
	int i, j, nCount, nCount2, x, y, xx, yy, cy, nMaxX, nMaxY, nWidth, nHeight, nDrawMode;
	POINT ptViewCharPos;
	PCInfoCharCli pChar;
	PCInfoTextEffect pInfoTextEffect;

	bDraw		= TRUE;
	nMaxX		= SCRSIZEX + 32;
	nMaxY		= SCRSIZEY + 32;
	nDrawMode	= m_pMgrData->GetDrawMode ();
	if (nDrawMode == 0) {
		bDraw = FALSE;
	}
	bDrawChat = m_pMgrData->GetOptionViewChat ();

	nCount = m_pLibInfoChar->GetCount ();
	for (i = nCount - 1; i >= 0; i --) {
		pChar = (PCInfoCharCli)m_pLibInfoChar->GetPtr (i);

		if (pChar->m_nMoveType == CHARMOVETYPE_PUTNPC) {
			if (m_pMgrData->GetAdminLevel () == ADMINLEVEL_NONE) {
				continue;
			}
		}
		bResult = IsInScreen (pChar->m_nMapX, pChar->m_nMapY);
		if (bResult == FALSE) {
			continue;
		}
		x = y = 32;
		GetDrawPos (pChar, x, y);
		x += pChar->m_ptMove.x;
		y += pChar->m_ptMove.y;
		pChar->GetViewCharPos (ptViewCharPos);

		/* 文字エフェクト */
		nCount2 = pChar->GetTextEffectCount ();
		for (j = 0; j < nCount2; j ++) {
			pInfoTextEffect = pChar->GetTextEffect (j);
			m_pMgrDraw->DrawTextEffect (pDst, x + pChar->m_nGrpSize, y - 20 - ptViewCharPos.y, pInfoTextEffect);
		}

		/* 噴出し */
		cy = m_pMgrGrpData->GetGrpSize (GRPIDMAIN_EFCBALLOON);
		m_pMgrDraw->DrawBalloon (pDst, x, y - (cy * 2) - ptViewCharPos.y, pChar->GetBalloonGrpID ());

		/* キャラ名の表示 */
		if (bDraw) {
			nWidth	= pChar->m_pDibName->Width ();
			nHeight	= pChar->m_pDibName->Height ();
			xx = x + pChar->m_nGrpSize - (nWidth / 2);
			xx = (xx < 32) ? 32 : xx;
			xx = (xx + nWidth >= nMaxX) ? nMaxX - nWidth : xx;
			yy = y + nHeight;
			yy = (yy < 32) ? 32 : yy;
			yy = (yy + nHeight >= nMaxY) ? nMaxY - nHeight : yy;
			pDst->Blt (xx, yy, nWidth, nHeight, pChar->m_pDibName, 0, 0, TRUE);
		}

		/* 発言内容の表示 */
		if (bDrawChat && pChar->m_strSpeak.GetLength ()) {
			nWidth	= pChar->m_pDibSpeak->Width ();
			nHeight	= pChar->m_pDibSpeak->Height ();

			xx = x + pChar->m_nGrpSize - (nWidth / 2) + 3;
			xx = (xx < 32) ? 32: xx;
			xx = (xx + nWidth >= nMaxX) ? nMaxX - nWidth: xx;
			yy = y - nHeight;
			yy -= ptViewCharPos.y;
			yy = (yy < 32) ? 32 : yy;
			yy = (yy + nHeight >= nMaxY) ? nMaxY - nHeight : yy;
			pDst->Blt (xx, yy, nWidth, nHeight, pChar->m_pDibSpeak, 0, 0, TRUE);
		}
	}
}
コード例 #20
0
ファイル: ctrlDeepening.cpp プロジェクト: Flow86/s25client
/**
 *  zeichnet das Fenster.
 */
void ctrlColorDeepening::DrawContent() const
{
    DrawRectangle(GetDrawPos() + DrawPoint(3, 3), width_ - 6, height_ - 6, fillColor);
}
コード例 #21
0
void CWindowSKILLMENU::Draw(PCImg32 pDst)
{
	LPCSTR aszTitle[] = {"戦闘(F)", "生活(L)", "能力"};
	int i, nCount, nLevel, x, y, nTmp;
	HDC hDC;
	HFONT hFontOld;
	PCInfoSkillBase pInfoSkill;

	if (m_dwTimeDrawStart) {
		goto Exit;
	}

	m_strName.Empty ();
	DrawFrame (5);

	hDC			= m_pDib->Lock ();
	hFontOld	= (HFONT)SelectObject (hDC, m_hFont12);
	SetBkMode (hDC, TRANSPARENT);
	for (i = 0; i < 3; i ++) {
		int nType = (m_nType == i) ? 7 : 5;
		DrawFrame (7 + 49 * i, 7, 48, 24, nType);
		TextOut2 (hDC, 7 + 5 + 49 * i, 7 + 4, aszTitle[i],
			(m_nType == i) ? RGB (255, 255, 255) : RGB (196, 140, 81));
	}
	SelectObject (hDC, hFontOld);
	m_pDib->Unlock ();

	DrawFrame (4, 23, 200, 248, 6);

	for (y = 0; y < 5; y ++) {
		for (x = 0; x < 5; x ++) {
			DrawIconFrame (12 + 36 * x, 32 + 47 * y);
		}
	}

	nTmp = 0;
	/* スキルを描画 */
	nCount = m_adwSkillID.GetSize ();
	for (i = 0; i < nCount; i ++) {
		pInfoSkill = (PCInfoSkillBase)m_pLibInfoSkill->GetPtr (m_adwSkillID[i]);
		if (pInfoSkill == NULL) {
			continue;
		}
		GetDrawPos (nTmp, x, y);
		m_pMgrDraw->DrawIcon (m_pDib, x, y, pInfoSkill->m_dwIconID);
		if (nTmp == m_nPos) {
			m_strName = (LPCSTR)pInfoSkill->m_strName;
		}
		nTmp ++;
	}

	m_dwTimeDrawStart = timeGetTime ();

Exit:
	nLevel = 100;
	if (m_bActive == FALSE) {
		nLevel = 60;
	}
	pDst->BltLevel (m_ptViewPos.x + 32, m_ptViewPos.y + 32, m_sizeWindow.cx, m_sizeWindow.cy, m_pDib, 0, 0, nLevel, TRUE);
	switch (m_nMode) {
	case 0:
		m_pMgrDraw->DrawCursor (pDst, m_ptViewPos.x + 32 + 49 * m_nType - 16, m_ptViewPos.y + 32 + 4, 0);
		break;
	case 1:
		GetDrawPos (m_nPos, x, y);
		m_pMgrDraw->DrawCursor (pDst, m_ptViewPos.x + 32 + x - 8, m_ptViewPos.y + 32 + y, 2);
		break;
	}

	/* スキル名を表示 */
	if ((m_nMode == 1) && (m_strName.IsEmpty () == FALSE)) {
		hDC			= pDst->Lock ();
		hFontOld	= (HFONT)SelectObject (hDC, m_hFont12);
		SetBkMode (hDC, TRANSPARENT);

		GetDrawPos (m_nPos, x, y);
		x = m_ptViewPos.x + 32 + x - 8;
		y = m_ptViewPos.y + 32 + y - 24;
		DrawFrame2 (x, y, m_strName.GetLength () * 6, 16, 0, pDst, 4);
		TextOut2 (hDC, x, y, (LPCSTR)m_strName, RGB (10, 10, 10), FALSE);

		SelectObject (hDC, hFontOld);
		pDst->Unlock ();
	}
}
コード例 #22
0
/**
 *  zeichnet das Fenster.
 */
void ctrlImage::Draw_()
{
    DrawImage(GetDrawPos());
}