author | unc0rr |
Sun, 24 Dec 2017 00:44:16 +0100 | |
branch | qmlfrontend |
changeset 12863 | 0c6fb706f747 |
parent 11465 | 9f2fb0031ef0 |
permissions | -rw-r--r-- |
11439 | 1 |
unit uFLRunQueue; |
2 |
interface |
|
3 |
uses uFLTypes; |
|
4 |
||
5 |
procedure queueExecution(var config: TGameConfig); |
|
6 |
||
7 |
implementation |
|
12863
0c6fb706f747
More refactoring in attempt to move away from frontlib
unc0rr
parents:
11465
diff
changeset
|
8 |
uses hwengine, uFLUICallback, uFLIPC; |
11439 | 9 |
|
10 |
var runQueue: PGameConfig = nil; |
|
11 |
||
12 |
procedure nextRun; |
|
13 |
begin |
|
14 |
if runQueue <> nil then |
|
15 |
begin |
|
16 |
if runQueue^.gameType = gtPreview then |
|
17 |
sendUI(mtRenderingPreview, nil, 0); |
|
18 |
||
11457
78860824b5a5
Introduce barriers between messages to different engine instances
unc0rr
parents:
11456
diff
changeset
|
19 |
ipcRemoveBarrierFromEngineQueue(); |
11439 | 20 |
RunEngine(runQueue^.argumentsNumber, @runQueue^.argv); |
21 |
end |
|
22 |
end; |
|
23 |
||
24 |
procedure cleanupConfig; |
|
25 |
var t: PGameConfig; |
|
26 |
begin |
|
27 |
t:= runQueue; |
|
28 |
runQueue:= t^.nextConfig; |
|
29 |
dispose(t) |
|
30 |
end; |
|
31 |
||
32 |
procedure queueExecution(var config: TGameConfig); |
|
33 |
var pConfig, t, tt: PGameConfig; |
|
34 |
i: Longword; |
|
35 |
begin |
|
36 |
new(pConfig); |
|
37 |
pConfig^:= config; |
|
38 |
||
39 |
with pConfig^ do |
|
40 |
begin |
|
41 |
nextConfig:= nil; |
|
42 |
||
43 |
for i:= 0 to Pred(MAXARGS) do |
|
44 |
begin |
|
45 |
if arguments[i][0] = #255 then |
|
46 |
arguments[i][255]:= #0 |
|
47 |
else |
|
48 |
arguments[i][byte(arguments[i][0]) + 1]:= #0; |
|
49 |
argv[i]:= @arguments[i][1] |
|
50 |
end; |
|
51 |
end; |
|
52 |
||
53 |
if runQueue = nil then |
|
54 |
begin |
|
55 |
runQueue:= pConfig; |
|
56 |
||
11464
30397f91571c
Fix a ton of bugs in engine instances queue and ipc
unc0rr
parents:
11461
diff
changeset
|
57 |
ipcSetEngineBarrier(); |
12863
0c6fb706f747
More refactoring in attempt to move away from frontlib
unc0rr
parents:
11465
diff
changeset
|
58 |
//sendConfig(pConfig); |
11439 | 59 |
nextRun |
60 |
end else |
|
61 |
begin |
|
62 |
t:= runQueue; |
|
63 |
while t^.nextConfig <> nil do |
|
64 |
begin |
|
11464
30397f91571c
Fix a ton of bugs in engine instances queue and ipc
unc0rr
parents:
11461
diff
changeset
|
65 |
if false and (pConfig^.gameType = gtPreview) and (t^.nextConfig^.gameType = gtPreview) and (t <> runQueue) then |
11439 | 66 |
begin |
67 |
tt:= t^.nextConfig; |
|
68 |
pConfig^.nextConfig:= tt^.nextConfig; |
|
69 |
t^.nextConfig:= pConfig; |
|
70 |
dispose(tt); |
|
71 |
exit // boo |
|
72 |
end; |
|
73 |
t:= t^.nextConfig; |
|
74 |
end; |
|
11464
30397f91571c
Fix a ton of bugs in engine instances queue and ipc
unc0rr
parents:
11461
diff
changeset
|
75 |
|
30397f91571c
Fix a ton of bugs in engine instances queue and ipc
unc0rr
parents:
11461
diff
changeset
|
76 |
ipcSetEngineBarrier(); |
12863
0c6fb706f747
More refactoring in attempt to move away from frontlib
unc0rr
parents:
11465
diff
changeset
|
77 |
//sendConfig(pConfig); |
11439 | 78 |
t^.nextConfig:= pConfig |
79 |
end; |
|
80 |
end; |
|
81 |
||
82 |
end. |