He seemed to fluctuate between bitter sureness of doom and a stupidly optimistic belief that something could be done to avert that doom.
He was only optimistic that something could be done to prevent the doom.