Android Open Source - abstract-art Hack Module






From Project

Back to project page abstract-art.

License

The source code is released under:

GNU General Public License

If you think the Android project abstract-art listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package net.starmen.pkhack;
/*from  ww  w . ja  v a 2  s .c  o m*/
// Original code by AnyoneEB
// Code released under the GPL - http://www.gnu.org/licenses/gpl.txt

public class HackModule {
  /**
     * Reads a two bit per pixel (2BPP) area from <code>source</code> to the
     * given byte array. This area represents a 8x8 four color image. Note that
     * the size of a 2BPP image is 16 bytes.
     * 
     * @param target byte array to write to
     * @param source reading buffer
     * @param off index to start reading from
     * @param x x-offset on image to write to
     * @param y y-offset on image to write to
     * @param bitOffset number of bits to left-shift <code>target</code>
     * @return number of bytes read
     */
    public static int read2BPPArea(byte[] target, byte[] source, int off,
        int x, int y, int stride, int bitOffset)
    {
        if (bitOffset < 0)
            bitOffset = 0;
        int offset = off;
        for (int i = 0; i < 8; i++)
        {
            for (int k = 0; k < 2; k++)
            {
                byte b = source[offset++];
                for (int j = 0; j < 8; j++)
                {
                    // target[(7 - j) + x][i + y] |= (byte) (((b & (1 << j)) >> j) << (k + bitOffset));
                  // changed to just write to a flat array
                    target[(7 - j) + x + (i + y) * stride] |= (byte) (((b & (1 << j)) >> j) << (k + bitOffset));
                }
            }
        }
        return offset - off;
    }
    
    /**
     * Reads a four bit per pixel (4BPP) area from <code>source</code> to the
     * given byte array. This area represents a 8x8 four color image. Note that
     * the size of a 4BPP image is 32 bytes.
     * 
     * @param target byte array to write to
     * @param source reading buffer
     * @param off index to start reading from
     * @param x x-offset on image to write to
     * @param y y-offset on image to write to
     * @param bitOffset number of bits to left-shift <code>target</code>
     * @return number of bytes read
     */
    public static int read4BPPArea(byte[] target, byte[] source, int off,
        int x, int y, int stride, int bitOffset)
    {
        if (bitOffset < 0)
            bitOffset = 0;
        read2BPPArea(target, source, off, x, y, stride, bitOffset);
        read2BPPArea(target, source, off + 16, x, y, stride, bitOffset + 2);
        return 32;
    }
}




Java Source Code List

net.georgewhiteside.android.abstractart.AbstractArt.java
net.georgewhiteside.android.abstractart.BattleBackground.java
net.georgewhiteside.android.abstractart.BattleGroup.java
net.georgewhiteside.android.abstractart.Cache.java
net.georgewhiteside.android.abstractart.Distortion.java
net.georgewhiteside.android.abstractart.Enemy.java
net.georgewhiteside.android.abstractart.FPSCounter.java
net.georgewhiteside.android.abstractart.GLOffscreenSurface.java
net.georgewhiteside.android.abstractart.ImageLoader.java
net.georgewhiteside.android.abstractart.Layer.java
net.georgewhiteside.android.abstractart.Renderer.java
net.georgewhiteside.android.abstractart.RomUtil.java
net.georgewhiteside.android.abstractart.ServiceDialog.java
net.georgewhiteside.android.abstractart.Settings.java
net.georgewhiteside.android.abstractart.ShaderFactory.java
net.georgewhiteside.android.abstractart.Translation.java
net.georgewhiteside.android.abstractart.UniformGridView.java
net.georgewhiteside.android.abstractart.Wallpaper.java
net.georgewhiteside.android.abstractart.settings.BackgroundSelector.java
net.georgewhiteside.android.abstractart.settings.ClearCachePreference.java
net.georgewhiteside.android.abstractart.settings.CreateImageCachePreference.java
net.georgewhiteside.android.abstractart.settings.FrameRatePreference.java
net.georgewhiteside.android.abstractart.settings.ThumbnailAdapter.java
net.georgewhiteside.utility.Dimension.java
net.starmen.pkhack.HackModule.java
org.jf.GLWallpaper.GLWallpaperService.java
sheetrock.panda.changelog.ChangeLog.java