Skip to content

Commit 3058b6e

Browse files
FIX: output image was left / right mirrowed
1 parent c7fc871 commit 3058b6e

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

miniprojects/Wave_function_collapse/Overlap_model/unit1.pas

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
(******************************************************************************)
22
(* Wave function collapse (Ovelap mode) 23.01.2024 *)
33
(* *)
4-
(* Version : 0.05 *)
4+
(* Version : 0.06 *)
55
(* *)
66
(* Author : Uwe Schächterle (Corpsman) *)
77
(* *)
@@ -29,6 +29,7 @@
2929
(* 0.03 - allow wrap *)
3030
(* 0.04 - ADD: Constraint Editor *)
3131
(* 0.05 - Show pattern infos *)
32+
(* 0.06 - FIX: left right was swapped *)
3233
(* *)
3334
(******************************************************************************)
3435
(*
@@ -334,7 +335,7 @@
334335
Procedure TForm1.FormCreate(Sender: TObject);
335336
Begin
336337
Randomize;
337-
caption := 'Wave function collapse demo ver. 0.05';
338+
caption := 'Wave function collapse demo ver. 0.06';
338339
edit1.text := '3';
339340
edit2.text := '40';
340341
edit3.text := '40';

miniprojects/Wave_function_collapse/Overlap_model/uwfc.pas

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@
430430
// Loop over the height of the image.
431431
For j := 0 To IH - 1 Do Begin
432432
For i := 0 To IW - 1 Do Begin
433-
col := Image.Canvas.Pixels[i, j];
433+
col := Image.Canvas.Pixels[IW - i - 1, j];
434434
If (Not includes(color_table, col)) Then Begin
435435
push(color_frequencies, 0);
436436
push(color_table, col);
@@ -620,3 +620,6 @@
620620

621621
End.
622622

623+
624+
625+

0 commit comments

Comments
 (0)