00001
00002
00003
00004
00005 #include <OVgaBuf.h>
00006
00007
00008 #include <ODefTile.h>
00009 #include <OFirm.h>
00010 #include <OFirmA.h>
00011
00012 #include "OLoc.h"
00013
00014
00015 #include <OFirmRes.h>
00016
00017
00018
00019
00020
00021 Firm *Location::selected_object=0;
00022
00023
00028
00029 object = 0;
00030
00031 is_selected = false;
00032 }
00033
00034
00035
00036
00038
00039
00040 }
00041
00042
00043
00044
00046
00047 }
00048
00049
00050
00051
00053
00054 }
00055
00056
00057
00058
00061
00062 #ifdef DEBUG_SELECT_MAP
00063 if ( is_selected && tileType == 1 )
00064 Firm::firm_res.get_bitmap(DefTile::MARK_BMP)->paint(tileType, x+4,y+2,clip,vgaBuf);
00065 #endif
00066
00067 if ( object )
00068 object->paint(tileType, x,y,clip,vgaBuf);
00069 }
00070
00071
00072
00073
00076
00077
00078 firm_res.get_bitmap(DefTile::GRASS_BMP)->paint(tileType, x,y,clip,vgaBuf);
00079 }
00080
00081
00082
00083
00086
00087 object = f;
00088 }
00089
00090
00091
00092
00095
00096 return object != NULL;
00097 }
00098
00099
00100
00101
00104
00105 if (object && object->select_me(tileType, locx, locy, mx, my) ) {
00106 if ( selected_object != object ) {
00107 if( selected_object )
00108 selected_object->is_selected = false;
00109 selected_object = object;
00110 }
00111 else {
00112 selected_object = NULL;
00113 }
00114 return true;
00115 }
00116 return false;
00117
00118 #ifdef DEBUG_SELECT_MAP
00119
00120 is_selected = !is_selected;
00121 #endif
00122 }
00123
00124