summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 702b2ac)
raw | patch | inline | side by side (parent: 702b2ac)
author | Ketmar Dark <ketmar@ketmar.no-ip.org> | |
Sun, 27 Aug 2017 08:54:21 +0000 (11:54 +0300) | ||
committer | Ketmar Dark <ketmar@ketmar.no-ip.org> | |
Sun, 27 Aug 2017 08:54:53 +0000 (11:54 +0300) |
src/engine/e_graphics.pas | patch | blob | history | |
src/game/g_game.pas | patch | blob | history | |
src/game/g_holmes.inc | patch | blob | history | |
src/game/g_holmes.pas | patch | blob | history |
index 59f848b896aa82a876b4eb129aa8d91c8f3451a1..83664b1c0050562fd35ae231ffcf7567d18273e9 100644 (file)
procedure e_DrawQuad(X1, Y1, X2, Y2: Integer; Red, Green, Blue: Byte; Alpha: Byte = 0);
procedure e_DrawFillQuad(X1, Y1, X2, Y2: Integer; Red, Green, Blue, Alpha: Byte;
Blending: TBlending = B_NONE);
+procedure e_DarkenQuad (x0, y0, x1, y1: Integer; a: Integer);
+procedure e_DarkenQuadWH (x, y, w, h: Integer; a: Integer);
function e_CreateTextureImg (var img: TImageData; var ID: DWORD): Boolean;
function e_CreateTexture(FileName: string; var ID: DWORD): Boolean;
glDisable(GL_BLEND);
end;
+
+// ////////////////////////////////////////////////////////////////////////// //
+procedure e_DarkenQuad (x0, y0, x1, y1: Integer; a: Integer);
+begin
+ if (a < 0) then a := 0;
+ if (a > 255) then a := 255;
+ glEnable(GL_BLEND);
+ glBlendFunc(GL_ZERO, GL_SRC_ALPHA);
+ glDisable(GL_TEXTURE_2D);
+ glColor4ub(0, 0, 0, Byte(255-a));
+ glBegin(GL_QUADS);
+ glVertex2i(x0, y0);
+ glVertex2i(x1, y0);
+ glVertex2i(x1, y1);
+ glVertex2i(x0, y1);
+ glEnd();
+ //glRect(x, y, x+w, y+h);
+ glColor4ub(1, 1, 1, 1);
+ glDisable(GL_BLEND);
+ //glBlendEquation(GL_FUNC_ADD);
+end;
+
+procedure e_DarkenQuadWH (x, y, w, h: Integer; a: Integer);
+begin
+ if (w > 0) and (h > 0) then e_DarkenQuad(x, y, x+w, y+h, a);
+end;
+
+
procedure e_DrawLine(Width: Byte; X1, Y1, X2, Y2: Integer; Red, Green, Blue: Byte; Alpha: Byte = 0);
begin
if e_NoGraphics then Exit;
diff --git a/src/game/g_game.pas b/src/game/g_game.pas
index b198947e145dffab6b26a56ae1591635a59cfb39..cba96c630a3a271f6f533a1a43c916785664fb50 100644 (file)
--- a/src/game/g_game.pas
+++ b/src/game/g_game.pas
if (y < 0) then y := gScreenHeight-(hgt-1)+y;
// background
//e_DrawFillQuad(x, y, x+wdt-1, y+hgt-1, 255, 255, 255, 200, B_BLEND);
- e_DrawFillQuad(x, y, x+wdt-1, y+hgt-1, 20, 20, 20, 0, B_NONE);
+ //e_DrawFillQuad(x, y, x+wdt-1, y+hgt-1, 20, 20, 20, 0, B_NONE);
+ e_DarkenQuadWH(x, y, wdt, hgt, 150);
// title
yy := y+2;
for ii := 0 to High(prof.bars) do
if gPause and gGameOn and (g_ActiveWindow = nil) then
begin
- e_DrawFillQuad(0, 0, gScreenWidth-1, gScreenHeight-1, 48, 48, 48, 180);
+ //e_DrawFillQuad(0, 0, gScreenWidth-1, gScreenHeight-1, 48, 48, 48, 180);
+ e_DarkenQuadWH(0, 0, gScreenWidth, gScreenHeight, 150);
e_CharFont_GetSize(gMenuFont, _lc[I_MENU_PAUSE], w, h);
e_CharFont_Print(gMenuFont, (gScreenWidth div 2)-(w div 2),
else e_Clear(GL_COLOR_BUFFER_BIT, 0, 0, 0);
end;
if g_ActiveWindow <> nil then
- e_DrawFillQuad(0, 0, gScreenWidth-1, gScreenHeight-1, 48, 48, 48, 180);
+ begin
+ //e_DrawFillQuad(0, 0, gScreenWidth-1, gScreenHeight-1, 48, 48, 48, 180);
+ e_DarkenQuadWH(0, 0, gScreenWidth, gScreenHeight, 150);
+ end;
end;
if gState = STATE_FOLD then
+ begin
e_DrawFillQuad(0, 0, gScreenWidth-1, gScreenHeight-1, 0, 0, 0, EndingGameCounter);
+ end;
if gState = STATE_INTERCUSTOM then
begin
DrawCustomStat();
if g_ActiveWindow <> nil then
- e_DrawFillQuad(0, 0, gScreenWidth-1, gScreenHeight-1, 48, 48, 48, 180);
+ begin
+ //e_DrawFillQuad(0, 0, gScreenWidth-1, gScreenHeight-1, 48, 48, 48, 180);
+ e_DarkenQuadWH(0, 0, gScreenWidth, gScreenHeight, 150);
+ end;
end;
if gState = STATE_INTERSINGLE then
begin
if EndingGameCounter > 0 then
- e_DrawFillQuad(0, 0, gScreenWidth-1, gScreenHeight-1, 0, 0, 0, EndingGameCounter)
+ begin
+ e_DrawFillQuad(0, 0, gScreenWidth-1, gScreenHeight-1, 0, 0, 0, EndingGameCounter);
+ end
else
begin
back := 'INTER';
DrawSingleStat();
if g_ActiveWindow <> nil then
- e_DrawFillQuad(0, 0, gScreenWidth-1, gScreenHeight-1, 48, 48, 48, 180);
+ begin
+ //e_DrawFillQuad(0, 0, gScreenWidth-1, gScreenHeight-1, 48, 48, 48, 180);
+ e_DarkenQuadWH(0, 0, gScreenWidth, gScreenHeight, 150);
+ end;
end;
end;
e_Clear(GL_COLOR_BUFFER_BIT, 0, 0, 0);
if g_ActiveWindow <> nil then
- e_DrawFillQuad(0, 0, gScreenWidth-1, gScreenHeight-1, 48, 48, 48, 180);
+ begin
+ //e_DrawFillQuad(0, 0, gScreenWidth-1, gScreenHeight-1, 48, 48, 48, 180);
+ e_DarkenQuadWH(0, 0, gScreenWidth, gScreenHeight, 150);
+ end;
end;
if gState = STATE_SLIST then
if g_Texture_Get('MENU_BACKGROUND', ID) then
begin
e_DrawSize(ID, 0, 0, 0, False, False, gScreenWidth, gScreenHeight);
- e_DrawFillQuad(0, 0, gScreenWidth-1, gScreenHeight-1, 48, 48, 48, 180);
+ //e_DrawFillQuad(0, 0, gScreenWidth-1, gScreenHeight-1, 48, 48, 48, 180);
+ e_DarkenQuadWH(0, 0, gScreenWidth, gScreenHeight, 150);
end;
g_Serverlist_Draw(slCurrent);
end;
if g_ActiveWindow <> nil then
begin
if gGameOn then
- e_DrawFillQuad(0, 0, gScreenWidth-1, gScreenHeight-1, 48, 48, 48, 180);
+ begin
+ //e_DrawFillQuad(0, 0, gScreenWidth-1, gScreenHeight-1, 48, 48, 48, 180);
+ e_DarkenQuadWH(0, 0, gScreenWidth, gScreenHeight, 150);
+ end;
g_ActiveWindow.Draw();
end;
diff --git a/src/game/g_holmes.inc b/src/game/g_holmes.inc
index d1265d06adfb2526d85a776cc8029573a420ec6f..05576256800f8cbda29ca747148baf856279ae69 100644 (file)
--- a/src/game/g_holmes.inc
+++ b/src/game/g_holmes.inc
// ////////////////////////////////////////////////////////////////////////// //
-procedure shadeRect (x, y, w, h: Integer; a: Integer);
+procedure darkenRect (x, y, w, h: Integer; a: Integer);
begin
if (a < 0) then a := 0;
if (a > 255) then a := 255;
glEnable(GL_BLEND);
- glBlendFunc(GL_DST_COLOR, GL_SRC_COLOR);
- //glBlendFunc(GL_ONE, GL_DST_COLOR);
- //glBlendEquation(GL_FUNC_SUBTRACT);
+ glBlendFunc(GL_ZERO, GL_SRC_ALPHA);
glDisable(GL_TEXTURE_2D);
- glColor4f(0.0, 0.0, a/255.0, 1.0);
+ glColor4f(0.0, 0.0, 0.0, a/255.0);
glBegin(GL_QUADS);
glVertex2i(x, y);
glVertex2i(x+w, y);
glVertex2i(x+w, y+h);
glVertex2i(x, y+h);
glEnd();
+ //glRect(x, y, x+w, y+h);
glColor4f(1, 1, 1, 1);
glDisable(GL_BLEND);
//glBlendEquation(GL_FUNC_ADD);
diff --git a/src/game/g_holmes.pas b/src/game/g_holmes.pas
index d96d234503f202420944fdd9c4e7e840fb602745..0567f2c161aa5dcf8764e03c4a0d782330afb8d2 100644 (file)
--- a/src/game/g_holmes.pas
+++ b/src/game/g_holmes.pas
if showMonsInfo then
begin
//fillRect(mx-4, my-7*8-6, 110, 7*8+6, 0, 0, 94, 250);
- shadeRect(mx-4, my-7*8-6, 110, 7*8+6, 128);
+ darkenRect(mx-4, my-7*8-6, 110, 7*8+6, 128);
my -= 8;
my -= 2;