Project

General

Profile

« Previous | Next » 

Revision ada90d33

Added by Leszek Koltunski almost 8 years ago

Make deep copying DistortedObjects (needed in DistortedNode) standard.

View differences:

src/main/java/org/distorted/library/DistortedObjectList.java
10 10
final class DistortedObjectList 
11 11
  {
12 12
  private static long id =0;  
13
  private static HashMap<Long,DistortedObject> mBitmaps = new HashMap<>();
13
  private static HashMap<Long,DistortedObject> mObjects = new HashMap<>();
14 14
  
15 15
///////////////////////////////////////////////////////////////////////////////////////////////////
16 16

  
17
  static synchronized long add(DistortedObject dBmp)
17
  static synchronized long add(DistortedObject obj)
18 18
    {
19 19
    long ret = id++;  
20
    mBitmaps.put(ret,dBmp);
20
    mObjects.put(ret,obj);
21 21
    return ret;
22 22
    }
23 23

  
24 24
///////////////////////////////////////////////////////////////////////////////////////////////////
25 25

  
26
  static synchronized void remove(DistortedObject dBmp)
26
  static synchronized void remove(DistortedObject obj)
27 27
    {
28
    mBitmaps.remove(dBmp);
28
    mObjects.remove(obj);
29 29
    }
30 30
  
31 31
///////////////////////////////////////////////////////////////////////////////////////////////////
32 32

  
33 33
  static DistortedObject get(long id)
34 34
    {
35
    return mBitmaps.get(id);  
35
    return mObjects.get(id);
36 36
    }
37 37
  
38 38
///////////////////////////////////////////////////////////////////////////////////////////////////
39 39
  
40 40
  static synchronized void reset()
41 41
    {
42
    for(long id: mBitmaps.keySet()) 
42
    for(long id: mObjects.keySet())
43 43
      {
44 44
      get(id).resetTexture();  
45 45
      }
......
49 49

  
50 50
  static synchronized void release()
51 51
    {
52
    for(long id: mBitmaps.keySet()) 
52
    for(long id: mObjects.keySet())
53 53
      {
54 54
      get(id).releasePriv();  
55 55
      }
56 56
   
57
    mBitmaps.clear();
57
    mObjects.clear();
58 58
    id = 0;
59 59
    }
60 60
  

Also available in: Unified diff