hop vendredi, mise en prod

This commit is contained in:
tTh
2022-12-16 21:16:02 +01:00
parent e780a79273
commit a1f5030300
4 changed files with 17 additions and 13 deletions

View File

@@ -8,6 +8,7 @@ program animation
use realfield
use spitpgm ! extern module
use pixrgb ! extern module
implicit none
@@ -53,7 +54,7 @@ subroutine la_grande_boucle(start, nbre, moons)
write (filename, "(a, i5.5, a)") 'WS/data/', pass, '.txt'
call save_bodies_to_txt_file (planets, filename)
write (filename, "(a, i5.5, a)") 'WS/colmap/', pass, '.pgm'
write (filename, "(a, i5.5, a)") 'WS/colmap/', pass, '.pnm'
call make_color_map(planets, filename, S_WIDTH, S_HEIGHT)
enddo
@@ -71,7 +72,7 @@ subroutine make_color_map(moons, fname, width, height)
character(len=*), intent(in) :: fname
integer, intent(in) :: width, height
integer, dimension(:,:), allocatable :: map
type(t_pixrgb), dimension(:,:), allocatable :: cmap
integer :: ix, iy, near, ipl
integer :: errcode
real :: curdist, smalldist
@@ -80,10 +81,10 @@ subroutine make_color_map(moons, fname, width, height)
write(0, *) "colmap ", ubound(moons, 1), "moons to ", trim(fname)
! write(0, *) "mapsize ", width, height
allocate (map(width, height), stat=errcode)
allocate (cmap(width, height), stat=errcode)
! write(0, *) "errcode allocate ", errcode
map = -1 ! invalidate colmap
! map = -1 ! invalidate colmap
! DO SOME GOOD STUFF HERE
do ix=1, width
@@ -106,14 +107,16 @@ subroutine make_color_map(moons, fname, width, height)
endif
end do ! loop on all the moons, ipl index
map(ix, iy) = mod(near*13, 255)
cmap(ix, iy)%r = mod(near*13, 255)
cmap(ix, iy)%g = mod(near*14, 255)
cmap(ix, iy)%b = mod(near*15, 255)
enddo
enddo
call spit_as_pgm_8(map, fname)
call rgbpix_spit_as_pnm(cmap, fname)
deallocate(map)
deallocate(cmap)
end subroutine
!-----------------------------------------------------------------------