GF4J 0.9.4 Beta

gameframe.engines.msjava4x
Class CBitmapBase

java.lang.Object
  |
  +--gameframe.engines.msjava4x.CBitmapBase
Direct Known Subclasses:
CDDAlphaBitmap, CDDBitmap

abstract class CBitmapBase
extends java.lang.Object

Baseclass for all Microsoft Java DirectX bitmap implementations.

Since:
GameFrame for Java 0.9
Version:
GameFrame for Java 0.9.4

Field Summary
protected  int m_backBufferHeight
          Height of the backbuffer DirectDraw surface.
protected  int m_backBufferWidth
          Width of the backbuffer DirectDraw surface.
protected  IBitmapStorage m_bitmapStorage
          The bitmap storage that stores all the bitmaps created by this bitmap.
protected  gameframe.engines.msjava4x.DirectDraw m_dd
          Reference to the DirectDraw object that can create new bitmaps.
protected  gameframe.engines.msjava4x.DirectDrawSurface m_ddBackBuffer
          The DirectDraw surface to where this bitmap is blitted.
protected  gameframe.engines.msjava4x.DirectDrawSurface m_ddSurface
          The DirectDraw surface this bitmap class represents.
protected  boolean m_fInVideoMem
          Flag that indicates if the bitmap is in video memory or not.
protected  int m_height
          Height of the DirectDraw surface this bitmap class represents.
protected  gameframe.engines.msjava4x.Rect m_srcRectangle
          The rectangle that covers the DirectDraw surfaces part this bitmap class represents.
protected  gameframe.engines.msjava4x.Rect m_srcRectFromOriginBitmap
          The rectangle that this bitmap represents from the originating bitmap.
protected  java.lang.String m_strOriginBitmapFilename
          Name of the originating bitmap file.
protected  CBitmapBase m_superBitmap
          The superbitmap whose subbitmap this bitmap is or null if this is not a subbitmap.
protected  int m_width
          Width of the DirectDraw surface this bitmap class represents.
protected static gameframe.engines.msjava4x.Rect mStatic_dstRectangle
          The rectangle that covers the destination are of the blit.
protected static java.util.Vector mStatic_tempFiles
          All created temporary files.
 
Constructor Summary
(package private) CBitmapBase(gameframe.engines.msjava4x.DirectDraw dd, gameframe.engines.msjava4x.DirectDrawSurface ddBackBuffer, gameframe.engines.msjava4x.DirectDrawSurface ddSurface, int width, int height, IBitmapStorage bitmapStorage, java.lang.String strOriginFile)
          Constructs a bitmap from the given paramters.
(package private) CBitmapBase(gameframe.engines.msjava4x.DirectDraw dd, gameframe.engines.msjava4x.DirectDrawSurface ddBackBuffer, gameframe.engines.msjava4x.DirectDrawSurface ddSurface, int width, int height, IBitmapStorage bitmapStorage, java.lang.String strOriginFile, gameframe.engines.msjava4x.Rect originRect)
          Constructs a bitmap from the given paramters.
 
Method Summary
 void finalize()
          Deletes all temporary files.
(package private)  BitmapData getData(gameframe.engines.msjava4x.DirectDrawSurface ddSurface, gameframe.engines.msjava4x.Rect srcRect)
          Returns the bitmap data from the given rectangle in the given surface.
protected  gameframe.engines.msjava4x.DirectDrawSurface getEffectSurface(BitmapEffect effect)
          Returns an effect processed DirectDraw surface.
protected  gameframe.engines.msjava4x.DirectDrawSurface getSurfaceFromData(BitmapData bitmapData)
          Returns a DirectDraw surface that has the given bitmap data.
(package private)  void restore()
          Restores the DirectDraw surface if it is lost.
protected  void setDataToSurface(gameframe.engines.msjava4x.DirectDrawSurface targetSurface, gameframe.engines.msjava4x.Rect dstRect, BitmapData bitmapData)
          Sets the bitmap data to the given DirectDraw surface.
 
Methods inherited from class java.lang.Object
, clone, equals, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

mStatic_tempFiles

protected static java.util.Vector mStatic_tempFiles
All created temporary files.

m_ddSurface

protected gameframe.engines.msjava4x.DirectDrawSurface m_ddSurface
The DirectDraw surface this bitmap class represents.

m_ddBackBuffer

protected gameframe.engines.msjava4x.DirectDrawSurface m_ddBackBuffer
The DirectDraw surface to where this bitmap is blitted.

m_width

protected int m_width
Width of the DirectDraw surface this bitmap class represents.

m_height

protected int m_height
Height of the DirectDraw surface this bitmap class represents.

m_backBufferWidth

protected int m_backBufferWidth
Width of the backbuffer DirectDraw surface.

m_backBufferHeight

protected int m_backBufferHeight
Height of the backbuffer DirectDraw surface.

m_fInVideoMem

protected boolean m_fInVideoMem
Flag that indicates if the bitmap is in video memory or not.

m_srcRectangle

protected gameframe.engines.msjava4x.Rect m_srcRectangle
The rectangle that covers the DirectDraw surfaces part this bitmap class represents.

mStatic_dstRectangle

protected static gameframe.engines.msjava4x.Rect mStatic_dstRectangle
The rectangle that covers the destination are of the blit.

m_dd

protected gameframe.engines.msjava4x.DirectDraw m_dd
Reference to the DirectDraw object that can create new bitmaps.

m_bitmapStorage

protected IBitmapStorage m_bitmapStorage
The bitmap storage that stores all the bitmaps created by this bitmap.

m_superBitmap

protected CBitmapBase m_superBitmap
The superbitmap whose subbitmap this bitmap is or null if this is not a subbitmap. The subbitmap clones are not counted as subbitmaps in this case.

m_strOriginBitmapFilename

protected java.lang.String m_strOriginBitmapFilename
Name of the originating bitmap file.

m_srcRectFromOriginBitmap

protected gameframe.engines.msjava4x.Rect m_srcRectFromOriginBitmap
The rectangle that this bitmap represents from the originating bitmap.
Constructor Detail

CBitmapBase

CBitmapBase(gameframe.engines.msjava4x.DirectDraw dd,
            gameframe.engines.msjava4x.DirectDrawSurface ddBackBuffer,
            gameframe.engines.msjava4x.DirectDrawSurface ddSurface,
            int width,
            int height,
            IBitmapStorage bitmapStorage,
            java.lang.String strOriginFile)
Constructs a bitmap from the given paramters.
Parameters:
dd - The DirectDraw object that can create new DD surfaces.
ddSurface - The DirectDraw surface this bitmap class represents.
width - Width of the DirectDraw surface this bitmap class represents.
height - Height of the DirectDraw surface this bitmap class represents.
bitmapStorage - The storage that stores all bitmaps created by this bitmap.

CBitmapBase

CBitmapBase(gameframe.engines.msjava4x.DirectDraw dd,
            gameframe.engines.msjava4x.DirectDrawSurface ddBackBuffer,
            gameframe.engines.msjava4x.DirectDrawSurface ddSurface,
            int width,
            int height,
            IBitmapStorage bitmapStorage,
            java.lang.String strOriginFile,
            gameframe.engines.msjava4x.Rect originRect)
Constructs a bitmap from the given paramters.
Parameters:
dd - The DirectDraw object that can create new DD surfaces.
ddSurface - The DirectDraw surface this bitmap class represents.
width - Width of the DirectDraw surface this bitmap class represents.
height - Height of the DirectDraw surface this bitmap class represents.
bitmapStorage - The storage that stores all bitmaps created by this bitmap.
strOriginFile - The originating bitmap file.
originRect - The originating bitmaps rectangle that is this bitmap.
Method Detail

finalize

public void finalize()
Deletes all temporary files.
Overrides:
finalize in class java.lang.Object

restore

void restore()
Restores the DirectDraw surface if it is lost. Cannot restore subbitmap clones or created bitmaps correctly!

getEffectSurface

protected gameframe.engines.msjava4x.DirectDrawSurface getEffectSurface(BitmapEffect effect)
                                                                 throws GameFrameException
Returns an effect processed DirectDraw surface.
Parameters:
effect - The effect that is applied.
Returns:
The processed DirectDraw surface.

getSurfaceFromData

protected gameframe.engines.msjava4x.DirectDrawSurface getSurfaceFromData(BitmapData bitmapData)
                                                                   throws GameFrameException
Returns a DirectDraw surface that has the given bitmap data.
Parameters:
bitmapData - The bitmap data that is to be turned into DirectDraw surface.
Returns:
DirectDraw surface that has the given bitmap data.

getData

BitmapData getData(gameframe.engines.msjava4x.DirectDrawSurface ddSurface,
                   gameframe.engines.msjava4x.Rect srcRect)
             throws GameFrameException
Returns the bitmap data from the given rectangle in the given surface.
Parameters:
ddSurface - The DirectDraw surface where the pixels are gotten from.
srcRect - The source rectangle.
Returns:
The bitmap data.

setDataToSurface

protected void setDataToSurface(gameframe.engines.msjava4x.DirectDrawSurface targetSurface,
                                gameframe.engines.msjava4x.Rect dstRect,
                                BitmapData bitmapData)
                         throws GameFrameException
Sets the bitmap data to the given DirectDraw surface.
Parameters:
ddSurface - The DirectDraw surface whose data is to be set.
srcRect - The rectangle area of the surface or null if whole surface is to be set.
Returns:
Bitmap data from the given DirectDraw surface

GF4J 0.9.4 Beta