From d0ac316652da142f8f42008577faf9c640a14e9d Mon Sep 17 00:00:00 2001 From: tTh Date: Sat, 26 Nov 2022 13:01:37 +0100 Subject: [PATCH] use size option of gneplot2, and more --- GrafAnim/essai.f90 | 4 ++-- GrafAnim/go.sh | 2 +- GrafAnim/usegenplot.f90 | 29 +++++++++++++++++++++++++---- 3 files changed, 28 insertions(+), 7 deletions(-) diff --git a/GrafAnim/essai.f90 b/GrafAnim/essai.f90 index 3fc1050..d761c4f 100644 --- a/GrafAnim/essai.f90 +++ b/GrafAnim/essai.f90 @@ -5,7 +5,7 @@ program essai integer :: foo, bar integer :: nbarg integer :: numframe = 0 - character(len=32) :: arg + character(len=256) :: arg ! write(0, *) "------------ essai graf anim ---------------" @@ -16,7 +16,7 @@ program essai read (arg, *) numframe endif - ! write(0, '(A20, I5)') "frame number =", numframe + write(0, '(A20, I5)') "frame number =", numframe call init_genplot("essai.genplot") call do_frame(7) diff --git a/GrafAnim/go.sh b/GrafAnim/go.sh index d998bc8..a9c0672 100755 --- a/GrafAnim/go.sh +++ b/GrafAnim/go.sh @@ -9,7 +9,7 @@ do ./essai $foo > a.scratch fname=$(printf "F/%04d.tga" $foo) echo $fname - genplot2 a.scratch $fname + genplot2 -s 640x480 a.scratch $fname done diff --git a/GrafAnim/usegenplot.f90 b/GrafAnim/usegenplot.f90 index 18fdfe4..1d5760f 100644 --- a/GrafAnim/usegenplot.f90 +++ b/GrafAnim/usegenplot.f90 @@ -26,6 +26,19 @@ subroutine end_genplot(message) end subroutine ! ------------------------------------------------------------------- + +subroutine do_initialise_once(motif) + + character(*), intent(in) :: motif + + write(0, *) '--> do initialise once "', motif, '", flag is ', initialised + + call init_genplot('a.scratch') + +end subroutine + +! ------------------------------------------------------------------- + subroutine gplt_setcol(col) integer, intent(in) :: col color = col @@ -37,15 +50,23 @@ end function ! ------------------------------------------------------------------- subroutine gplt_move(x, y) - integer, intent(in) :: x, y - print *, x, y, 0 + integer, intent(in) :: x, y + + if (.NOT. initialised) then + call do_initialise_once('in gplt_move') + endif + + print *, x, y, 0 end subroutine ! ------------------------------------------------------------------- subroutine gplt_draw(x, y) - integer, intent(in) :: x, y - print *, x, y, color + integer, intent(in) :: x, y + if (.NOT. initialised) then + call do_initialise_once('in gplt_draw') + endif + print *, x, y, color end subroutine ! -------------------------------------------------------------------