diff --git a/src/game/g_holmes.pas b/src/game/g_holmes.pas
index 3b630ab674faa7c70df292c70143bdf6f30a0bde..53b7c7343e62d83c48356e5f88cc634d35a94521 100644 (file)
--- a/src/game/g_holmes.pas
+++ b/src/game/g_holmes.pas
interface
uses
interface
uses
- mempool, geom,
+ {$IFDEF USE_MEMPOOL}mempool,{$ENDIF} geom,
e_log, e_input,
g_textures, g_basic, e_graphics, g_phys, g_grid, g_player, g_monsters,
g_window, g_map, g_triggers, g_items, g_game, g_panel, g_console, g_gfx,
e_log, e_input,
g_textures, g_basic, e_graphics, g_phys, g_grid, g_player, g_monsters,
g_window, g_map, g_triggers, g_items, g_game, g_panel, g_console, g_gfx,
end;
if g_ol_fill_walls then
begin
end;
if g_ol_fill_walls then
begin
- fillRect(pan.X, pan.Y, pan.Width, pan.Height, r, g, b);
+ fillRect(pan.X, pan.Y, pan.Width, pan.Height, TGxRGBA.Create(r, g, b));
end
else if not g_ol_nice then
begin
end
else if not g_ol_nice then
begin
- drawRect(pan.X, pan.Y, pan.Width, pan.Height, r, g, b);
+ drawRect(pan.X, pan.Y, pan.Width, pan.Height, TGxRGBA.Create(r, g, b));
end;
end;
if g_ol_nice then
end;
end;
if g_ol_nice then
begin
for y := 0 to (mapGrid.gridHeight div mapGrid.tileSize) do
begin
begin
for y := 0 to (mapGrid.gridHeight div mapGrid.tileSize) do
begin
- drawLine(mapGrid.gridX0, mapGrid.gridY0+y*mapGrid.tileSize, mapGrid.gridX0+mapGrid.gridWidth, mapGrid.gridY0+y*mapGrid.tileSize, 96, 96, 96, 255);
+ drawLine(mapGrid.gridX0, mapGrid.gridY0+y*mapGrid.tileSize, mapGrid.gridX0+mapGrid.gridWidth, mapGrid.gridY0+y*mapGrid.tileSize, TGxRGBA.Create(96, 96, 96));
end;
for x := 0 to (mapGrid.gridWidth div mapGrid.tileSize) do
begin
end;
for x := 0 to (mapGrid.gridWidth div mapGrid.tileSize) do
begin
- drawLine(mapGrid.gridX0+x*mapGrid.tileSize, mapGrid.gridY0, mapGrid.gridX0+x*mapGrid.tileSize, mapGrid.gridY0+y*mapGrid.gridHeight, 96, 96, 96, 255);
+ drawLine(mapGrid.gridX0+x*mapGrid.tileSize, mapGrid.gridY0, mapGrid.gridX0+x*mapGrid.tileSize, mapGrid.gridY0+y*mapGrid.gridHeight, TGxRGBA.Create(96, 96, 96));
end;
end;
end;
end;
begin
if awmIsSetHolmes(x*mapGrid.tileSize+mapGrid.gridX0+1, y*mapGrid.tileSize++mapGrid.gridY0+1) then
begin
begin
if awmIsSetHolmes(x*mapGrid.tileSize+mapGrid.gridX0+1, y*mapGrid.tileSize++mapGrid.gridY0+1) then
begin
- fillRect(x*mapGrid.tileSize++mapGrid.gridX0, y*mapGrid.tileSize++mapGrid.gridY0, monsGrid.tileSize, monsGrid.tileSize, 128, 0, 128, 64);
+ fillRect(x*mapGrid.tileSize++mapGrid.gridX0, y*mapGrid.tileSize++mapGrid.gridY0, monsGrid.tileSize, monsGrid.tileSize, TGxRGBA.Create(128, 0, 128, 64));
end;
end;
end;
end;
end;
end;
plr := gPlayers[0];
if (plr = nil) then exit;
plr.getMapBox(px, py, pw, ph);
plr := gPlayers[0];
if (plr = nil) then exit;
plr.getMapBox(px, py, pw, ph);
- drawRect(px, py, pw, ph, 255, 0, 255, 200);
+ drawRect(px, py, pw, ph, TGxRGBA.Create(255, 0, 255, 200));
pdx := pmsCurMapX-(px+pw div 2);
pdy := pmsCurMapY-(py+ph div 2);
pdx := pmsCurMapX-(px+pw div 2);
pdy := pmsCurMapY-(py+ph div 2);
- drawLine(px+pw div 2, py+ph div 2, px+pw div 2+pdx, py+ph div 2+pdy, 255, 0, 255, 200);
+ drawLine(px+pw div 2, py+ph div 2, px+pw div 2+pdx, py+ph div 2+pdy, TGxRGBA.Create(255, 0, 255, 200));
pan := mapGrid.traceBox(ex, ey, px, py, pw, ph, pdx, pdy, nil, GridTagObstacle);
if (pan = nil) then
begin
pan := mapGrid.traceBox(ex, ey, px, py, pw, ph, pdx, pdy, nil, GridTagObstacle);
if (pan = nil) then
begin
- drawRect(px+pdx, py+pdy, pw, ph, 255, 255, 255, 180);
+ drawRect(px+pdx, py+pdy, pw, ph, TGxRGBA.Create(255, 255, 255, 180));
end
else
begin
end
else
begin
- drawRect(px+pdx, py+pdy, pw, ph, 255, 255, 0, 180);
+ drawRect(px+pdx, py+pdy, pw, ph, TGxRGBA.Create(255, 255, 0, 180));
end;
end;
- drawRect(ex, ey, pw, ph, 255, 127, 0, 180);
+ drawRect(ex, ey, pw, ph, TGxRGBA.Create(255, 127, 0, 180));
end;
procedure hilightCell (cx, cy: Integer);
begin
end;
procedure hilightCell (cx, cy: Integer);
begin
- fillRect(cx, cy, monsGrid.tileSize, monsGrid.tileSize, 0, 128, 0, 64);
+ fillRect(cx, cy, monsGrid.tileSize, monsGrid.tileSize, TGxRGBA.Create(0, 128, 0, 64));
end;
procedure hilightCell1 (cx, cy: Integer);
end;
procedure hilightCell1 (cx, cy: Integer);
//e_WriteLog(Format('h1: (%d,%d)', [cx, cy]), MSG_NOTIFY);
cx := cx and (not (monsGrid.tileSize-1));
cy := cy and (not (monsGrid.tileSize-1));
//e_WriteLog(Format('h1: (%d,%d)', [cx, cy]), MSG_NOTIFY);
cx := cx and (not (monsGrid.tileSize-1));
cy := cy and (not (monsGrid.tileSize-1));
- fillRect(cx, cy, monsGrid.tileSize, monsGrid.tileSize, 255, 255, 0, 92);
+ fillRect(cx, cy, monsGrid.tileSize, monsGrid.tileSize, TGxRGBA.Create(255, 255, 0, 92));
end;
function hilightWallTrc (pan: TPanel; tag: Integer; x, y, prevx, prevy: Integer): Boolean;
end;
function hilightWallTrc (pan: TPanel; tag: Integer; x, y, prevx, prevy: Integer): Boolean;
result := false; // don't stop
if (pan = nil) then exit; // cell completion, ignore
//e_WriteLog(Format('h1: (%d,%d)', [cx, cy]), MSG_NOTIFY);
result := false; // don't stop
if (pan = nil) then exit; // cell completion, ignore
//e_WriteLog(Format('h1: (%d,%d)', [cx, cy]), MSG_NOTIFY);
- fillRect(pan.X, pan.Y, pan.Width, pan.Height, 0, 128, 128, 64);
+ fillRect(pan.X, pan.Y, pan.Width, pan.Height, TGxRGBA.Create(0, 128, 128, 64));
end;
function monsCollector (mon: TMonster; tag: Integer): Boolean;
end;
function monsCollector (mon: TMonster; tag: Integer): Boolean;
exit;
end;
mon.getMapBox(mx, my, mw, mh);
exit;
end;
mon.getMapBox(mx, my, mw, mh);
- drawLine(mx+mw div 2, my+mh div 2, emx+emw div 2, emy+emh div 2, 255, 0, 0, 255);
+ drawLine(mx+mw div 2, my+mh div 2, emx+emw div 2, emy+emh div 2, TGxRGBA.Create(255, 0, 0));
if (g_Map_traceToNearestWall(mx+mw div 2, my+mh div 2, emx+emw div 2, emy+emh div 2, @ex, @ey) <> nil) then
begin
if (g_Map_traceToNearestWall(mx+mw div 2, my+mh div 2, emx+emw div 2, emy+emh div 2, @ex, @ey) <> nil) then
begin
- drawLine(mx+mw div 2, my+mh div 2, ex, ey, 0, 255, 0, 255);
+ drawLine(mx+mw div 2, my+mh div 2, ex, ey, TGxRGBA.Create(0, 255, 0));
end;
end;
end;
end;
if (eplr = nil) then exit;
eplr.getMapBox(emx, emy, emw, emh);
mon.getMapBox(mx, my, mw, mh);
if (eplr = nil) then exit;
eplr.getMapBox(emx, emy, emw, emh);
mon.getMapBox(mx, my, mw, mh);
- drawLine(mx+mw div 2, my+mh div 2, emx+emw div 2, emy+emh div 2, 255, 0, 0, 255);
+ drawLine(mx+mw div 2, my+mh div 2, emx+emw div 2, emy+emh div 2, TGxRGBA.Create(255, 0, 0));
{$IF DEFINED(D2F_DEBUG)}
mapGrid.dbgRayTraceTileHitCB := hilightCell1;
{$ENDIF}
if (g_Map_traceToNearestWall(mx+mw div 2, my+mh div 2, emx+emw div 2, emy+emh div 2, @ex, @ey) <> nil) then
//if (mapGrid.traceRay(ex, ey, mx+mw div 2, my+mh div 2, emx+emw div 2, emy+emh div 2, hilightWallTrc, (GridTagWall or GridTagDoor)) <> nil) then
begin
{$IF DEFINED(D2F_DEBUG)}
mapGrid.dbgRayTraceTileHitCB := hilightCell1;
{$ENDIF}
if (g_Map_traceToNearestWall(mx+mw div 2, my+mh div 2, emx+emw div 2, emy+emh div 2, @ex, @ey) <> nil) then
//if (mapGrid.traceRay(ex, ey, mx+mw div 2, my+mh div 2, emx+emw div 2, emy+emh div 2, hilightWallTrc, (GridTagWall or GridTagDoor)) <> nil) then
begin
- drawLine(mx+mw div 2, my+mh div 2, ex, ey, 0, 255, 0, 255);
+ drawLine(mx+mw div 2, my+mh div 2, ex, ey, TGxRGBA.Create(0, 255, 0));
end;
{$IF DEFINED(D2F_DEBUG)}
mapGrid.dbgRayTraceTileHitCB := nil;
end;
{$IF DEFINED(D2F_DEBUG)}
mapGrid.dbgRayTraceTileHitCB := nil;
my -= 2;
// type
my -= 2;
// type
- drawText6(mx, my, Format('%s(U:%u)', [monsTypeToString(mon.MonsterType), mon.UID]), 255, 127, 0); my -= 8;
+ drawText6(mx, my, Format('%s(U:%u)', [monsTypeToString(mon.MonsterType), mon.UID]), TGxRGBA.Create(255, 127, 0)); my -= 8;
// beh
// beh
- drawText6(mx, my, Format('Beh: %s', [monsBehToString(mon.MonsterBehaviour)]), 255, 127, 0); my -= 8;
+ drawText6(mx, my, Format('Beh: %s', [monsBehToString(mon.MonsterBehaviour)]), TGxRGBA.Create(255, 127, 0)); my -= 8;
// state
// state
- drawText6(mx, my, Format('State:%s (%d)', [monsStateToString(mon.MonsterState), mon.MonsterSleep]), 255, 127, 0); my -= 8;
+ drawText6(mx, my, Format('State:%s (%d)', [monsStateToString(mon.MonsterState), mon.MonsterSleep]), TGxRGBA.Create(255, 127, 0)); my -= 8;
// health
// health
- drawText6(mx, my, Format('Health:%d', [mon.MonsterHealth]), 255, 127, 0); my -= 8;
+ drawText6(mx, my, Format('Health:%d', [mon.MonsterHealth]), TGxRGBA.Create(255, 127, 0)); my -= 8;
// ammo
// ammo
- drawText6(mx, my, Format('Ammo:%d', [mon.MonsterAmmo]), 255, 127, 0); my -= 8;
+ drawText6(mx, my, Format('Ammo:%d', [mon.MonsterAmmo]), TGxRGBA.Create(255, 127, 0)); my -= 8;
// target
// target
- drawText6(mx, my, Format('TgtUID:%u', [mon.MonsterTargetUID]), 255, 127, 0); my -= 8;
- drawText6(mx, my, Format('TgtTime:%d', [mon.MonsterTargetTime]), 255, 127, 0); my -= 8;
+ drawText6(mx, my, Format('TgtUID:%u', [mon.MonsterTargetUID]), TGxRGBA.Create(255, 127, 0)); my -= 8;
+ drawText6(mx, my, Format('TgtTime:%d', [mon.MonsterTargetTime]), TGxRGBA.Create(255, 127, 0)); my -= 8;
end;
drawMonsterTargetLine();
end;
drawMonsterTargetLine();
pan := g_Map_PanelByGUID(platMarkedGUID);
if (pan = nil) then exit;
mapGrid.forEachBodyCell(pan.proxyId, hilightCell);
pan := g_Map_PanelByGUID(platMarkedGUID);
if (pan = nil) then exit;
mapGrid.forEachBodyCell(pan.proxyId, hilightCell);
- drawRect(pan.x, pan.y, pan.width, pan.height, 0, 200, 0, 200);
+ drawRect(pan.x, pan.y, pan.width, pan.height, TGxRGBA.Create(0, 200, 0, 200));
end;
procedure drawTrigger (var trig: TTrigger);
end;
procedure drawTrigger (var trig: TTrigger);
drawLine(
trig.trigCenter.x, trig.trigCenter.y,
pan.x+pan.width div 2, pan.y+pan.height div 2,
drawLine(
trig.trigCenter.x, trig.trigCenter.y,
pan.x+pan.width div 2, pan.y+pan.height div 2,
- 255, 0, 255, 220);
+ TGxRGBA.Create(255, 0, 255, 220));
end;
var
tts: AnsiString;
tx: Integer;
begin
end;
var
tts: AnsiString;
tx: Integer;
begin
- fillRect(trig.x, trig.y, trig.width, trig.height, 255, 0, 255, 96);
+ fillRect(trig.x, trig.y, trig.width, trig.height, TGxRGBA.Create(255, 0, 255, 96));
tts := trigType2Str(trig.TriggerType);
tx := trig.x+(trig.width-Length(tts)*6) div 2;
darkenRect(tx-2, trig.y-10, Length(tts)*6+4, 10, 64);
tts := trigType2Str(trig.TriggerType);
tx := trig.x+(trig.width-Length(tts)*6) div 2;
darkenRect(tx-2, trig.y-10, Length(tts)*6+4, 10, 64);
- drawText6(tx, trig.y-9, tts, 255, 127, 0);
+ drawText6(tx, trig.y-9, tts, TGxRGBA.Create(255, 127, 0));
tx := trig.x+(trig.width-Length(trig.mapId)*6) div 2;
darkenRect(tx-2, trig.y-20, Length(trig.mapId)*6+4, 10, 64);
tx := trig.x+(trig.width-Length(trig.mapId)*6) div 2;
darkenRect(tx-2, trig.y-20, Length(trig.mapId)*6+4, 10, 64);
- drawText6(tx, trig.y-19, trig.mapId, 255, 255, 0);
+ drawText6(tx, trig.y-19, trig.mapId, TGxRGBA.Create(255, 255, 0));
drawPanelDest(trig.trigPanelGUID);
case trig.TriggerType of
TRIGGER_NONE: begin end;
drawPanelDest(trig.trigPanelGUID);
case trig.TriggerType of
TRIGGER_NONE: begin end;
fillRect(
trig.trigDataRec.trigTX, trig.trigDataRec.trigTY,
trig.trigDataRec.trigTWidth, trig.trigDataRec.trigTHeight,
fillRect(
trig.trigDataRec.trigTX, trig.trigDataRec.trigTY,
trig.trigDataRec.trigTWidth, trig.trigDataRec.trigTHeight,
- 0, 255, 255, 42);
+ TGxRGBA.Create(0, 255, 255, 42));
drawLine(
trig.trigCenter.x, trig.trigCenter.y,
trig.trigDataRec.trigTX+trig.trigDataRec.trigTWidth div 2,
trig.trigDataRec.trigTY+trig.trigDataRec.trigTHeight div 2,
drawLine(
trig.trigCenter.x, trig.trigCenter.y,
trig.trigDataRec.trigTX+trig.trigDataRec.trigTWidth div 2,
trig.trigDataRec.trigTY+trig.trigDataRec.trigTHeight div 2,
- 255, 0, 255, 220);
+ TGxRGBA.Create(255, 0, 255, 220));
end;
end;
TRIGGER_SOUND: begin end;
end;
end;
TRIGGER_SOUND: begin end;
if gib.alive then
begin
gib.getMapBox(px, py, pw, ph);
if gib.alive then
begin
gib.getMapBox(px, py, pw, ph);
- drawRect(px, py, pw, ph, 255, 0, 255);
+ drawRect(px, py, pw, ph, TGxRGBA.Create(255, 0, 255));
end;
end;
end;
end;
end;
end;
scisave.restore();
end;
scisave.restore();
end;
- if showMapCurPos then drawText8(4, gWinSizeY-10, Format('mappos:(%d,%d)', [pmsCurMapX, pmsCurMapY]), 255, 255, 0);
+ if showMapCurPos then drawText8(4, gWinSizeY-10, Format('mappos:(%d,%d)', [pmsCurMapX, pmsCurMapY]), TGxRGBA.Create(255, 255, 0));
end;
end;