For good measure, the third screenshot shows the main culprit in the text rendering bottleneck: al_hold_bitmap_drawing(false); This should be ridiculously fast, as fonts are atlased so Allegro can just send all the vertices at once. But apparently not...
Edit: Shame on you for calling malloc and not checking for null! Actually though, I've stopped checking it myself. I figure by the time a malloc returns null there's not much I can do in the way of recovery anyway so may as well just let it crash.
edit: Awesome, 1111 posts!
IlysMylJv
// check that the person didn't mysteriously disappear... if (!does_person_exist(person)) return; // they probably got eaten by a hunger-pig or something.
// check for obstructing persons if (!person->ignore_all_persons) { for (i = 0; i < s_num_persons; ++i) { if (s_persons[i] == person) // these persons aren't going to obstruct themselves! continue; if (s_persons[i]->layer != layer) continue; // ignore persons not on the same layer if (is_person_following(s_persons[i], person)) continue; // ignore own followers if (is_person_ignored(person, s_persons[i])) continue; base = get_person_base(s_persons[i]); if (do_rects_intersect(my_base, base)) { is_obstructed = true; if (out_obstructing_person) *out_obstructing_person = s_persons[i]; break; } } }
for (var i = 0, l = items.length; i < l; ++i) { /**/ }// rather than:Link(items).each(function() { /**/ });
var SubClass = function() { Class.call(this); /* ... */}SubClass.prototype = new Class();// Rather than:var SubClass = Extend(Class, { /**/ });