Пример #1
0
/*----------------------------------------------------------------------------*/
static void
worldmapRedraw()
{
    WorldCoord x;
    WorldCoord y;
    float ang;
    float dist;
    
    GlSurface_clear(map_surf, map_color[0]);
    for (y = 0; y < rct_src.h; y++)
    {
        for (x = 0; x < rct_src.w; x++)
        {
            GlSurface_drawPixel(map_surf, rct_dest.x + x, rct_dest.y + y, getCol(map_plot[(rct_src.y + y) * map_w + (rct_src.x + x)]));
        }
    }
    
    /*TODO: maybe store ang and dist*/
    ang = angle2d((float)(camlookx - camposx), (float)(camlooky - camposy));
    dist = dist2d((float)camlookx, (float)camlooky, (float)camposx, (float)camposy);
    GlSurface_drawLineCut(map_surf, camposx - rct_src.x + rct_dest.x, camposy - rct_src.y + rct_dest.y, camposx + cos(ang + M_PI_4) * dist - rct_src.x + rct_dest.x, camposy + sin(ang + M_PI_4) * dist - rct_src.y + rct_dest.y, map_color[6]);
    GlSurface_drawLineCut(map_surf, camposx - rct_src.x + rct_dest.x, camposy - rct_src.y + rct_dest.y, camposx + cos(ang - M_PI_4) * dist - rct_src.x + rct_dest.x, camposy + sin(ang - M_PI_4) * dist - rct_src.y + rct_dest.y, map_color[6]);
    
    GuiWidget_redraw(_widget);
}
void
GamePlaying::onTouchMoved(Touch* t,Event* ev){
	if(_slushLimit==0){
		return;
	}
	auto stigma = getChildByName("stigma");
	auto pos = t->getLocation();
	auto v=(pos-_touchedPos);
	stigma->setScaleX(v.length()/512.0f);
	stigma->setRotation(angle2d(v,Vec2(1,0))*180.0f/3.14159265358979);
	
	//auto streak = getChildByName("streak");
	//streak->setPosition(t->getLocation());

}