diff options
| author | Fuwn <[email protected]> | 2021-05-03 16:38:41 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2021-05-03 16:38:41 -0700 |
| commit | e1e781bb2135ef78592226f1a3eaba4925702f1f (patch) | |
| tree | 8a5b590463ed413e1c6eabb719130e701b95ca63 /NET/worlds/scape/TextureSurface.java | |
| download | worlds.jar-main.tar.xz worlds.jar-main.zip | |
Diffstat (limited to 'NET/worlds/scape/TextureSurface.java')
| -rw-r--r-- | NET/worlds/scape/TextureSurface.java | 104 |
1 files changed, 104 insertions, 0 deletions
diff --git a/NET/worlds/scape/TextureSurface.java b/NET/worlds/scape/TextureSurface.java new file mode 100644 index 0000000..eae6b72 --- /dev/null +++ b/NET/worlds/scape/TextureSurface.java @@ -0,0 +1,104 @@ +/* */ package NET.worlds.scape; +/* */ +/* */ +/* */ public class TextureSurface +/* */ { +/* */ private Texture[] _textures; +/* */ +/* */ private int _hwnd; +/* */ +/* */ private int _oldObject; +/* */ +/* */ private int _offscreen; +/* */ +/* */ private int _texWidth; +/* */ +/* */ private int _texHeight; +/* */ +/* */ private int _width; +/* */ +/* */ private int _height; +/* */ private int _rows; +/* */ private int _cols; +/* */ +/* */ public TextureSurface(Texture[] texList, int rows, int w, int h) +/* */ { +/* 26 */ this._width = w; +/* 27 */ this._height = h; +/* 28 */ this._oldObject = 0; +/* */ +/* 30 */ this._hwnd = nativeInit(w, h); +/* 31 */ this._offscreen = nativeMakeDC(this._hwnd, w, h); +/* */ +/* 33 */ if (texList != null) { +/* 34 */ setTextures(texList, rows); +/* */ } +/* */ } +/* */ +/* */ public void finalize() { +/* 39 */ nativeDestroyDC(this._offscreen); +/* 40 */ this._oldObject = 0; +/* */ } +/* */ +/* */ public void setTextures(Texture[] texList, int rows) +/* */ { +/* 45 */ this._textures = texList; +/* */ +/* */ +/* 48 */ this._rows = rows; +/* 49 */ this._cols = (texList.length / rows); +/* 50 */ this._texWidth = (this._width / this._cols); +/* 51 */ this._texHeight = (this._height / this._rows); +/* */ } +/* */ +/* */ +/* */ public synchronized boolean draw(TextureSurfaceRenderer renderer) +/* */ { +/* 57 */ renderer.renderTo(this._offscreen); +/* */ +/* */ +/* 60 */ int idx = 0; +/* 61 */ for (int row = this._rows - 1; row >= 0; row--) +/* */ { +/* 63 */ for (int col = 0; col < this._cols; col++) +/* */ { +/* 65 */ if (this._textures[idx] != null) +/* */ { +/* 67 */ this._textures[idx].copyFrom(this._offscreen, +/* 68 */ col * this._texWidth, (col + 1) * this._texWidth, +/* 69 */ row * this._texHeight, (row + 1) * this._texHeight); +/* */ } +/* 71 */ idx++; +/* */ } +/* */ } +/* */ +/* 75 */ return false; +/* */ } +/* */ +/* */ public void sendLeftClick(int x, int y) +/* */ { +/* 80 */ nativeLeftClick(this._hwnd, x, y); +/* */ } +/* */ +/* 83 */ public int getHwnd() { return this._hwnd; } +/* 84 */ public int getWidth() { return this._width; } +/* 85 */ public int getHeight() { return this._height; } +/* */ +/* */ private native int nativeInit(int paramInt1, int paramInt2); +/* */ +/* */ private native int nativeMakeDC(int paramInt1, int paramInt2, int paramInt3); +/* */ +/* */ private native int nativeGetDC(int paramInt); +/* */ +/* */ private native void nativeReleaseDC(int paramInt1, int paramInt2); +/* */ +/* */ private native void nativeDestroyDC(int paramInt); +/* */ +/* */ private native void nativeLeftClick(int paramInt1, int paramInt2, int paramInt3); +/* */ } + + +/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\scape\TextureSurface.class + * Java compiler version: 6 (50.0) + * JD-Core Version: 0.7.1 + */
\ No newline at end of file |