ddnet/src/game/editor/map_view.h

35 lines
584 B
C
Raw Normal View History

#ifndef GAME_EDITOR_MAP_VIEW_H
#define GAME_EDITOR_MAP_VIEW_H
#include <base/vmath.h>
#include "component.h"
2023-08-14 06:53:59 +00:00
#include "smooth_value.h"
class CMapView : public CEditorComponent
{
public:
2023-08-14 06:53:59 +00:00
void Init(CEditor *pEditor) override;
2023-08-14 06:53:59 +00:00
/**
* Reset zoom and editor offset.
*/
void ResetZoom();
2023-08-14 06:53:59 +00:00
/**
* Scale length according to zoom value.
*/
float ScaleLength(float Value);
2023-08-14 06:53:59 +00:00
void ZoomMouseTarget(float ZoomFactor);
void UpdateZoom();
2023-08-14 06:53:59 +00:00
vec2 m_WorldOffset;
vec2 m_EditorOffset;
2023-08-14 06:53:59 +00:00
CSmoothValue m_Zoom = CSmoothValue(200.0f, 10.0f, 2000.0f);
float m_WorldZoom = 1.0f;
};
#endif