[m-rev.] for review: fixing extras/graphics/ examples
Sebastian Godelet
sebastian.godelet+github at gmail.com
Wed Feb 26 10:06:05 AEDT 2014
For review by anyone
branch: master, 14.01
extras/graphics/easyx/samples/bounce.m:
extras/graphics/mercury_allegro/examples/exspline.m:
extras/graphics/mercury_allegro/samples/demo/aster.m:
extras/graphics/mercury_allegro/samples/speed/view.m:
in all files: s/index0_det/det_index0/g
So that these examples are compiling with the recent version
of the compiler.
---
extras/graphics/easyx/samples/bounce.m | 6 +++---
extras/graphics/mercury_allegro/examples/exspline.m | 4 ++--
extras/graphics/mercury_allegro/samples/demo/aster.m | 4 ++--
extras/graphics/mercury_allegro/samples/speed/view.m | 2 +-
4 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/extras/graphics/easyx/samples/bounce.m
b/extras/graphics/easyx/samples/bounce.m
index 5dbb6c2..f73f3dc 100644
--- a/extras/graphics/easyx/samples/bounce.m
+++ b/extras/graphics/easyx/samples/bounce.m
@@ -221,7 +221,7 @@ add_new_ball(Colours, Objects, [Ball | Objects], !Rnd)
:-
VX = 0.001 + float(VX0 mod 100) / 10000.0,
VY = 0.0,
R = 0.025 + float(R0 mod 25) / 1000.0,
- C = index0_det(Colours, 2 + (N0 / 1000) mod (length(Colours) - 2)),
+ C = det_index0(Colours, 2 + (N0 / 1000) mod (length(Colours) - 2)),
Ball = ball(X, Y, VX, VY, R, C).
%-----------------------------------------------------------------------------%
@@ -252,8 +252,8 @@ main(!IO) :-
play(Window, Colours, !Paddle, !Objects, !Rnd, !IO) :-
- Black = index0_det(Colours, 0),
- White = index0_det(Colours, 1),
+ Black = det_index0(Colours, 0),
+ White = det_index0(Colours, 1),
easyx.set_colour(Window, Black, !IO),
easyx.clear_window(Window, !IO),
diff --git a/extras/graphics/mercury_allegro/examples/exspline.m
b/extras/graphics/mercury_allegro/examples/exspline.m
index 57e5239..265c6df 100644
--- a/extras/graphics/mercury_allegro/examples/exspline.m
+++ b/extras/graphics/mercury_allegro/examples/exspline.m
@@ -198,8 +198,8 @@ input_nodes_2(Nodes0, Nodes, !IO) :-
calc_tangents(Nodes0, Tangents) :-
Len = length(Nodes0),
- Head = dummy_node(index0_det(Nodes0, 0), index0_det(Nodes0, 1)),
- Tail = dummy_node(index0_det(Nodes0, Len-1), index0_det(Nodes0,
Len-2)),
+ Head = dummy_node(det_index0(Nodes0, 0), det_index0(Nodes0, 1)),
+ Tail = dummy_node(det_index0(Nodes0, Len-1), det_index0(Nodes0,
Len-2)),
( list.take(Len-1, Nodes0, ButLast) ->
Tangents = list.map_corresponding(calc_tangent,
[Head | ButLast], det_tail(Nodes0) ++ [Tail])
diff --git a/extras/graphics/mercury_allegro/samples/demo/aster.m
b/extras/graphics/mercury_allegro/samples/demo/aster.m
index 7ff3f59..4c83a95 100644
--- a/extras/graphics/mercury_allegro/samples/demo/aster.m
+++ b/extras/graphics/mercury_allegro/samples/demo/aster.m
@@ -272,10 +272,10 @@ get_asteroid_sprite(Data, normal, look(Type, C),
RetraceCount, Sprite) :-
),
J = (RetraceCount / (6 - (C /\ 3)) + C) mod 15,
Frame = (if even(C) then 14 - J else J),
- Sprite = list.index0_det(Anim, Frame).
+ Sprite = list.det_index0(Anim, Frame).
get_asteroid_sprite(Data, exploding(Frame), _, _, Sprite) :-
- Sprite = list.index0_det(Data ^ explosions, Frame).
+ Sprite = list.det_index0(Data ^ explosions, Frame).
%-----------------------------------------------------------------------------%
diff --git a/extras/graphics/mercury_allegro/samples/speed/view.m
b/extras/graphics/mercury_allegro/samples/speed/view.m
index a4f42cb..dea03a0 100644
--- a/extras/graphics/mercury_allegro/samples/speed/view.m
+++ b/extras/graphics/mercury_allegro/samples/speed/view.m
@@ -185,7 +185,7 @@ advance_view(view(ViewNum0, ViewInfos), view(ViewNum,
ViewInfos), Cycled) :-
).
update_view(view(ViewNum, {A0, B0, C0, D0}), view(ViewNum, {A, B, C, D}))
:-
- list.index0_det(view_configurations, ViewNum, {PosA, PosB, PosC,
PosD}),
+ list.det_index0(view_configurations, ViewNum, {PosA, PosB, PosC,
PosD}),
update_viewinfo(PosA, A0, A),
update_viewinfo(PosB, B0, B),
update_viewinfo(PosC, C0, C),
--
1.8.3.2
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurylang.org/archives/reviews/attachments/20140226/3a1edf19/attachment.html>
More information about the reviews
mailing list