gephex--main--0.4--patch-1873
[email protected] Sat, 2 Apr 2005 12:29:14 +0200 (CEST)
| Newsgroups | gmane.comp.video.gephex.devel |
|---|---|
| Message-ID | <[email protected]> |
Archive: [email protected] New revision: gephex--main--0.4--patch-1873 -- Revision: gephex--main--0.4--patch-1873 Archive: [email protected] Creator: The Gephex Source Archive <[email protected]> Date: Sat Apr 2 12:26:03 CEST 2005 Standard-date: 2005-04-02 10:26:03 GMT Modified-files: modules/src/noisemodule/noisemodule.cpp New-patches: [email protected]/gephex--main--0.4--patch-1873 [email protected]/gephex--martin--0.4--patch-68 Summary: [MERGE-REQUEST] fix for endianess bug in noisemodule (#116) Keywords: Patches applied: * [email protected]/gephex--martin--0.4--patch-68 fix for endianess bug in noisemodule (#116) * added files {arch}/gephex/gephex--main/gephex--main--0.4/[email protected]/patch-log/patch-1873 {arch}/gephex/gephex--martin/gephex--martin--0.4/[email protected]/patch-log/patch-68 * modified files --- orig/modules/src/noisemodule/noisemodule.cpp +++ mod/modules/src/noisemodule/noisemodule.cpp @@ -46,16 +46,23 @@ uint32_t mono_noise() { - uint8_t rd = rnd_lcg1() >> 24; - return rd | rd << 8 | rd << 16; + uint8_t color[4]; + uint8_t tmp = rnd_lcg1() >> 24; + color[0] = tmp; + color[1] = tmp; + color[2] = tmp; + color[3] = 0; + return *reinterpret_cast<uint32_t*>(&color); } uint32_t chroma_noise() { - uint8_t rd_1 = rnd_lcg1() >> 24; - uint8_t rd_2 = rnd_lcg1() >> 24; - uint8_t rd_3 = rnd_lcg1() >> 24; - return rd_1 | rd_2 << 8 | rd_3 << 16; + uint8_t color[4]; + color[0] = rnd_lcg1() >> 24; + color[1] = rnd_lcg1() >> 24; + color[2] = rnd_lcg1() >> 24; + color[3] = 0; + return *reinterpret_cast<uint32_t*>(&color); } void update(void* instance)