Giter Site home page Giter Site logo

utilities's People

Contributors

bunny83 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

utilities's Issues

Where is bmploader?

Looking for bmploader (a) to see if any updates since 2017 (b) report a bug.

Attached file causes an index out of range crash
Blank18.zip
.

Issue with BMPLoader/ReadPalette

There is a bug with ReadPalette, some indexed BMP files are loaded as empty because ReadPalette sets zero alpha.
I've made a workaround:
//byte a = aReader.ReadByte(); Looks like a bug, BMP doesn't support transparency.
byte a = 255;

XorShift64: Range() cast to signed integer causes out-of-range values to be returned

Hi, I'm using some of your code in my program (found it via a Google search). I noticed that in Range() the cast to (int) sometimes causes out-of-range values to be returned, since in C# the modulus operation is sign sensitive (for example -10 % 3 = -1):

public int Range(int aMin, int aMax)
{
  return aMin + (int)Next() % (aMax - aMin);
}

In my own code, I changed it to:

public int Range(int aMin, int aMax)
{
  Debug.Assert(aMax > aMin);

  return aMin + (int)((uint)Next() % (aMax - aMin));
}

(Edit: I don't think this would work when (aMax - aMin) >= 2^31 but I don't need such large ranges in my code)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.