Mercurial > fife-parpg
comparison engine/core/video/cursor.cpp @ 257:f2195628947b
* Cursor will now respect image shift values when drawing the cursor
* Editor now have cursors showing what mode the editor is in
author | cheesesucker@33b003aa-7bff-0310-803a-e67f0ece8222 |
---|---|
date | Mon, 08 Jun 2009 19:56:54 +0000 |
parents | 51cc05d862f2 |
children | 4fa875d06e28 |
comparison
equal
deleted
inserted
replaced
256:e893afb4963b | 257:f2195628947b |
---|---|
134 Animation& anim = m_animpool->getAnimation(m_drag_id); | 134 Animation& anim = m_animpool->getAnimation(m_drag_id); |
135 int animtime = (m_timemanager->getTime() - m_drag_animtime) % anim.getDuration(); | 135 int animtime = (m_timemanager->getTime() - m_drag_animtime) % anim.getDuration(); |
136 img = anim.getFrameByTimestamp(animtime); | 136 img = anim.getFrameByTimestamp(animtime); |
137 } | 137 } |
138 if (img) { | 138 if (img) { |
139 Rect area(mx + m_drag_offset_x, my + m_drag_offset_y, img->getWidth(), img->getHeight()); | 139 Rect area(mx + m_drag_offset_x + img->getXShift(), my + m_drag_offset_y + img->getYShift(), img->getWidth(), img->getHeight()); |
140 m_renderbackend->pushClipArea(area, false); | 140 m_renderbackend->pushClipArea(area, false); |
141 img->render(area); | 141 img->render(area); |
142 m_renderbackend->popClipArea(); | 142 m_renderbackend->popClipArea(); |
143 } | 143 } |
144 | 144 |
150 Animation& anim = m_animpool->getAnimation(m_cursor_id); | 150 Animation& anim = m_animpool->getAnimation(m_cursor_id); |
151 int animtime = (m_timemanager->getTime() - m_animtime) % anim.getDuration(); | 151 int animtime = (m_timemanager->getTime() - m_animtime) % anim.getDuration(); |
152 img = anim.getFrameByTimestamp(animtime); | 152 img = anim.getFrameByTimestamp(animtime); |
153 } | 153 } |
154 if (img) { | 154 if (img) { |
155 Rect area(mx, my, img->getWidth(), img->getHeight()); | 155 Rect area(mx + img->getXShift(), my + img->getYShift(), img->getWidth(), img->getHeight()); |
156 m_renderbackend->pushClipArea(area, false); | 156 m_renderbackend->pushClipArea(area, false); |
157 img->render(area); | 157 img->render(area); |
158 m_renderbackend->popClipArea(); | 158 m_renderbackend->popClipArea(); |
159 } | 159 } |
160 } | 160 } |