Opened 17 years ago

Closed 17 years ago

Last modified 2 years ago

#8332 closed patch

Change remaining random function calls to use RandomSource

Reported by: SF/damienguard Owned by: fingolfin
Priority: low Component: --Other--
Keywords: Cc:
Game:

Description

As per the TODO I have replaced the two calls that use random numbers that do not currently use RandomSource with calls to RandomSource.

This is in the ADLIB and FMOPL code. As neither of these modules have any reference to the main vm instance of RandomSource I have given them each their own static instance of it. Given the compact nature of RandomSource this should fine.

The white noise code gen in fmopl that used the rand() function specified no upper value so would be up to RAND_MAX which is at least 32767. Given that it is going into an unsigned int, I made it 32767.

I have tested a few games in adlib mode, seems to work fine although I'm not sure how to fully regression test this.

Ticket imported from: #902111. Ticket imported from: patches/437.

Attachments (3)

adlib.cpp.diff (1.7 KB ) - added by SF/damienguard 17 years ago.
fmopl.cpp.diff (590 bytes ) - added by SF/damienguard 17 years ago.
fmopl.h.diff (897 bytes ) - added by SF/damienguard 17 years ago.

Download all attachments as: .zip

Change History (8)

by SF/damienguard, 17 years ago

Attachment: adlib.cpp.diff added

by SF/damienguard, 17 years ago

Attachment: fmopl.cpp.diff added

by SF/damienguard, 17 years ago

Attachment: fmopl.h.diff added

comment:1 by SF/damienguard, 17 years ago

A search for rand and rnd found no other instances to be changed beyond those mentioned in the TODO.

comment:2 by SF/damienguard, 17 years ago

Priority: normallow

comment:3 by fingolfin, 17 years ago

In CVS now.

comment:4 by fingolfin, 17 years ago

Owner: set to fingolfin
Status: newclosed

comment:5 by digitall, 2 years ago

Component: --Other--
Note: See TracTickets for help on using tickets.