hop vendredi, mise en prod
This commit is contained in:
@@ -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
|
||||
!-----------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user