Advertisement
Guest User

Untitled

a guest
Feb 27th, 2015
277
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. string getobj () //if previously unmatched, searches through object map for objects in top left/bottom left memory quarters, finally NO_MATCH is returned
  2. {
  3. objtop = 0;
  4. objbot = 0;
  5. int lastpixel = objval[63];
  6. for (int i = 0; i < 64; i++)
  7. {
  8. if (i < 32) { objtop *= 2; }
  9. else { objbot *= 2; }
  10. if ((objval[i] - lastpixel) >= 0)
  11. {
  12. if (i < 32) { objtop++; }
  13. else { objbot++; }
  14. }
  15. lastpixel = objval[i];
  16. }
  17. it = objmap.find(objtop);
  18. if (it != objmap.end()) { return it->second; }
  19. it = objmap.find(objbot);
  20. if (it != objmap.end()) { return it->second; }
  21. return "NO_MATCH";
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement