Refactored Math::Point in CPhysics, CDisplayInfo, CFileDialog, CMainDialog, CMainMap, CMainShort and CStudio
parent
c659e060c1
commit
dc99e19ed9
|
@ -1746,7 +1746,7 @@ void CPhysics::WaterFrame(float aTime, float rTime)
|
||||||
{
|
{
|
||||||
ObjectType type;
|
ObjectType type;
|
||||||
Math::Vector pos, speed;
|
Math::Vector pos, speed;
|
||||||
Math::Point dim;
|
glm::vec2 dim;
|
||||||
float level;
|
float level;
|
||||||
|
|
||||||
level = m_water->GetLevel();
|
level = m_water->GetLevel();
|
||||||
|
@ -1962,7 +1962,7 @@ void CPhysics::SoundMotorSlow(float rTime, ObjectType type)
|
||||||
{
|
{
|
||||||
Math::Matrix* mat;
|
Math::Matrix* mat;
|
||||||
Math::Vector pos, speed;
|
Math::Vector pos, speed;
|
||||||
Math::Point dim;
|
glm::vec2 dim;
|
||||||
SoundType sound;
|
SoundType sound;
|
||||||
float amplitude;
|
float amplitude;
|
||||||
int i, max;
|
int i, max;
|
||||||
|
@ -2128,7 +2128,7 @@ void CPhysics::SoundReactorFull(float rTime, ObjectType type)
|
||||||
SoundType sound;
|
SoundType sound;
|
||||||
Math::Matrix* mat;
|
Math::Matrix* mat;
|
||||||
Math::Vector pos, speed;
|
Math::Vector pos, speed;
|
||||||
Math::Point dim;
|
glm::vec2 dim;
|
||||||
float freq;
|
float freq;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
@ -2963,7 +2963,7 @@ void CPhysics::PowerParticle(float factor, bool bBreak)
|
||||||
{
|
{
|
||||||
Math::Matrix* mat;
|
Math::Matrix* mat;
|
||||||
Math::Vector pos, ppos, eye, speed;
|
Math::Vector pos, ppos, eye, speed;
|
||||||
Math::Point dim;
|
glm::vec2 dim;
|
||||||
bool bCarryPower;
|
bool bCarryPower;
|
||||||
|
|
||||||
bCarryPower = false;
|
bCarryPower = false;
|
||||||
|
@ -3024,7 +3024,7 @@ void CPhysics::PowerParticle(float factor, bool bBreak)
|
||||||
void CPhysics::CrashParticle(float crash)
|
void CPhysics::CrashParticle(float crash)
|
||||||
{
|
{
|
||||||
Math::Vector pos, ppos, speed;
|
Math::Vector pos, ppos, speed;
|
||||||
Math::Point dim;
|
glm::vec2 dim;
|
||||||
float len;
|
float len;
|
||||||
int i, max;
|
int i, max;
|
||||||
|
|
||||||
|
@ -3058,9 +3058,9 @@ void CPhysics::MotorParticle(float aTime, float rTime)
|
||||||
{
|
{
|
||||||
Math::Matrix* mat;
|
Math::Matrix* mat;
|
||||||
Math::Vector pos, speed;
|
Math::Vector pos, speed;
|
||||||
Math::Point dim;
|
glm::vec2 dim;
|
||||||
ObjectType type;
|
ObjectType type;
|
||||||
Math::Point c, p;
|
glm::vec2 c, p;
|
||||||
float h, a, delay, level;
|
float h, a, delay, level;
|
||||||
int r, i, nb;
|
int r, i, nb;
|
||||||
|
|
||||||
|
@ -3582,7 +3582,7 @@ void CPhysics::WaterParticle(float aTime, Math::Vector pos, ObjectType type,
|
||||||
float floor, float advance, float turn)
|
float floor, float advance, float turn)
|
||||||
{
|
{
|
||||||
Math::Vector ppos, speed;
|
Math::Vector ppos, speed;
|
||||||
Math::Point dim;
|
glm::vec2 dim;
|
||||||
float delay, level, min, max, force, volume, diam;
|
float delay, level, min, max, force, volume, diam;
|
||||||
int i, nb;
|
int i, nb;
|
||||||
|
|
||||||
|
|
|
@ -73,8 +73,8 @@ CDisplayInfo::CDisplayInfo()
|
||||||
m_bInfoMaximized = true;
|
m_bInfoMaximized = true;
|
||||||
m_bInfoMinimized = false;
|
m_bInfoMinimized = false;
|
||||||
|
|
||||||
m_infoFinalPos = m_infoActualPos = m_infoNormalPos = Math::Point(0.00f, 0.00f);
|
m_infoFinalPos = m_infoActualPos = m_infoNormalPos = { 0.00f, 0.00f };
|
||||||
m_infoFinalDim = m_infoActualPos = m_infoNormalDim = Math::Point(1.00f, 1.00f);
|
m_infoFinalDim = m_infoActualPos = m_infoNormalDim = { 1.00f, 1.00f };
|
||||||
|
|
||||||
m_lightSuppl = -1;
|
m_lightSuppl = -1;
|
||||||
m_toto = nullptr;
|
m_toto = nullptr;
|
||||||
|
@ -340,7 +340,7 @@ void CDisplayInfo::HyperUpdate()
|
||||||
void CDisplayInfo::StartDisplayInfo(std::string filename, int index, bool bSoluce)
|
void CDisplayInfo::StartDisplayInfo(std::string filename, int index, bool bSoluce)
|
||||||
{
|
{
|
||||||
Gfx::Light light;
|
Gfx::Light light;
|
||||||
Math::Point pos, dim;
|
glm::vec2 pos, dim;
|
||||||
Ui::CWindow* pw;
|
Ui::CWindow* pw;
|
||||||
Ui::CEdit* edit;
|
Ui::CEdit* edit;
|
||||||
Ui::CButton* button;
|
Ui::CButton* button;
|
||||||
|
@ -373,7 +373,7 @@ void CDisplayInfo::StartDisplayInfo(std::string filename, int index, bool bSoluc
|
||||||
//? pw->SetClosable(true);
|
//? pw->SetClosable(true);
|
||||||
//? GetResource(RES_TEXT, RT_DISINFO_TITLE, res);
|
//? GetResource(RES_TEXT, RT_DISINFO_TITLE, res);
|
||||||
//? pw->SetName(res);
|
//? pw->SetName(res);
|
||||||
//? pw->SetMinDim(Math::Point(0.56f, 0.40f));
|
//? pw->SetMinDim(glm::vec2(0.56f, 0.40f));
|
||||||
//? pw->SetMaximized(m_bInfoMaximized);
|
//? pw->SetMaximized(m_bInfoMaximized);
|
||||||
//? pw->SetMinimized(m_bInfoMinimized);
|
//? pw->SetMinimized(m_bInfoMinimized);
|
||||||
//? m_main->SetEditFull(m_bInfoMaximized);
|
//? m_main->SetEditFull(m_bInfoMaximized);
|
||||||
|
@ -466,14 +466,14 @@ void CDisplayInfo::StartDisplayInfo(std::string filename, int index, bool bSoluc
|
||||||
|
|
||||||
// Repositions all controls editing.
|
// Repositions all controls editing.
|
||||||
|
|
||||||
void CDisplayInfo::AdjustDisplayInfo(Math::Point wpos, Math::Point wdim)
|
void CDisplayInfo::AdjustDisplayInfo(glm::vec2 wpos, glm::vec2 wdim)
|
||||||
{
|
{
|
||||||
CWindow* pw;
|
CWindow* pw;
|
||||||
CEdit* edit;
|
CEdit* edit;
|
||||||
CButton* button;
|
CButton* button;
|
||||||
CSlider* slider;
|
CSlider* slider;
|
||||||
CGroup* group;
|
CGroup* group;
|
||||||
Math::Point pos, dim;
|
glm::vec2 pos, dim;
|
||||||
|
|
||||||
wpos.x = 50.0f / 640.0f;
|
wpos.x = 50.0f / 640.0f;
|
||||||
wpos.y = 30.0f / 480.0f;
|
wpos.y = 30.0f / 480.0f;
|
||||||
|
@ -682,7 +682,7 @@ void CDisplayInfo::UpdateIndexButton()
|
||||||
Ui::CButton* button;
|
Ui::CButton* button;
|
||||||
Ui::CGroup* group;
|
Ui::CGroup* group;
|
||||||
Ui::CEdit* edit;
|
Ui::CEdit* edit;
|
||||||
Math::Point pos, dim;
|
glm::vec2 pos, dim;
|
||||||
char* filename;
|
char* filename;
|
||||||
|
|
||||||
static int table[SATCOM_MAX] =
|
static int table[SATCOM_MAX] =
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "math/point.h"
|
#include <glm/glm.hpp>
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
|
@ -60,7 +60,7 @@ public:
|
||||||
protected:
|
protected:
|
||||||
bool EventFrame(const Event &event);
|
bool EventFrame(const Event &event);
|
||||||
void HyperUpdate();
|
void HyperUpdate();
|
||||||
void AdjustDisplayInfo(Math::Point wpos, Math::Point wdim);
|
void AdjustDisplayInfo(glm::vec2 wpos, glm::vec2 wdim);
|
||||||
void ChangeIndexButton(int index);
|
void ChangeIndexButton(int index);
|
||||||
void UpdateIndexButton();
|
void UpdateIndexButton();
|
||||||
void UpdateCopyButton();
|
void UpdateCopyButton();
|
||||||
|
@ -81,12 +81,12 @@ protected:
|
||||||
bool m_bInfoMinimized;
|
bool m_bInfoMinimized;
|
||||||
|
|
||||||
int m_index;
|
int m_index;
|
||||||
Math::Point m_infoNormalPos;
|
glm::vec2 m_infoNormalPos;
|
||||||
Math::Point m_infoNormalDim;
|
glm::vec2 m_infoNormalDim;
|
||||||
Math::Point m_infoActualPos;
|
glm::vec2 m_infoActualPos;
|
||||||
Math::Point m_infoActualDim;
|
glm::vec2 m_infoActualDim;
|
||||||
Math::Point m_infoFinalPos;
|
glm::vec2 m_infoFinalPos;
|
||||||
Math::Point m_infoFinalDim;
|
glm::vec2 m_infoFinalDim;
|
||||||
int m_lightSuppl;
|
int m_lightSuppl;
|
||||||
bool m_bEditLock;
|
bool m_bEditLock;
|
||||||
ActivePause* m_satcomPause = nullptr;
|
ActivePause* m_satcomPause = nullptr;
|
||||||
|
|
|
@ -201,8 +201,8 @@ std::string CFileDialog::GetFilename()
|
||||||
void CFileDialog::StartFileDialog()
|
void CFileDialog::StartFileDialog()
|
||||||
{
|
{
|
||||||
m_captureClick = false;
|
m_captureClick = false;
|
||||||
Math::Point pos = m_windowPos;
|
glm::vec2 pos = m_windowPos;
|
||||||
Math::Point dim = m_windowDim;
|
glm::vec2 dim = m_windowDim;
|
||||||
int icon = (m_dialogtype == CFileDialog::Type::Open) ? 14 : 13 ;
|
int icon = (m_dialogtype == CFileDialog::Type::Open) ? 14 : 13 ;
|
||||||
|
|
||||||
CWindow* pw = m_interface->CreateWindows(pos, dim, icon, m_windowEvent);
|
CWindow* pw = m_interface->CreateWindows(pos, dim, icon, m_windowEvent);
|
||||||
|
@ -216,7 +216,7 @@ void CFileDialog::StartFileDialog()
|
||||||
pw->SetState(STATE_SHADOW);
|
pw->SetState(STATE_SHADOW);
|
||||||
pw->SetMovable(true);
|
pw->SetMovable(true);
|
||||||
pw->SetClosable(true);
|
pw->SetClosable(true);
|
||||||
pw->SetMinDim(Math::Point(320.0f/640.0f, (121.0f+18.0f*4)/480.0f));
|
pw->SetMinDim({ 320.0f / 640.0f, (121.0f + 18.0f * 4) / 480.0f });
|
||||||
|
|
||||||
if ( m_title.empty() )
|
if ( m_title.empty() )
|
||||||
{
|
{
|
||||||
|
@ -232,8 +232,8 @@ void CFileDialog::StartFileDialog()
|
||||||
pw->SetName(m_title);
|
pw->SetName(m_title);
|
||||||
|
|
||||||
std::string name;
|
std::string name;
|
||||||
pos = Math::Point(0.0f, 0.0f);
|
pos = { 0.0f, 0.0f };
|
||||||
dim = Math::Point(0.0f, 0.0f);
|
dim = { 0.0f, 0.0f };
|
||||||
|
|
||||||
GetResource(RES_TEXT, RT_IO_LIST, name);
|
GetResource(RES_TEXT, RT_IO_LIST, name);
|
||||||
CLabel* pla = pw->CreateLabel(pos, dim, 0, EVENT_DIALOG_LABEL1, name); // path label
|
CLabel* pla = pw->CreateLabel(pos, dim, 0, EVENT_DIALOG_LABEL1, name); // path label
|
||||||
|
@ -355,14 +355,14 @@ void CFileDialog::AdjustDialog()
|
||||||
CWindow* pw = static_cast< CWindow* >(m_interface->SearchControl(m_windowEvent));
|
CWindow* pw = static_cast< CWindow* >(m_interface->SearchControl(m_windowEvent));
|
||||||
if ( pw == nullptr ) return;
|
if ( pw == nullptr ) return;
|
||||||
|
|
||||||
Math::Point wpos = m_windowPos = pw->GetPos();
|
glm::vec2 wpos = m_windowPos = pw->GetPos();
|
||||||
Math::Point wdim = m_windowDim = pw->GetDim();
|
glm::vec2 wdim = m_windowDim = pw->GetDim();
|
||||||
|
|
||||||
pw->SetPos(wpos); // to move the buttons on the titlebar
|
pw->SetPos(wpos); // to move the buttons on the titlebar
|
||||||
pw->SetDim(wdim);
|
pw->SetDim(wdim);
|
||||||
|
|
||||||
Math::Point ppos(wpos.x+10.0f/640.0f, wpos.y+wdim.y-55.0f/480.0f);
|
glm::vec2 ppos(wpos.x+10.0f/640.0f, wpos.y+wdim.y-55.0f/480.0f);
|
||||||
Math::Point ddim(wdim.x-150.0f/640.0f, 20.0f/480.0f);
|
glm::vec2 ddim(wdim.x-150.0f/640.0f, 20.0f/480.0f);
|
||||||
|
|
||||||
CLabel* pla = static_cast< CLabel* >(pw->SearchControl(EVENT_DIALOG_LABEL1)); // path label
|
CLabel* pla = static_cast< CLabel* >(pw->SearchControl(EVENT_DIALOG_LABEL1)); // path label
|
||||||
if ( pla != nullptr )
|
if ( pla != nullptr )
|
||||||
|
@ -692,13 +692,13 @@ bool CFileDialog::StartNewFolderMode()
|
||||||
|
|
||||||
CList* pli = static_cast< CList* >(pw->SearchControl(EVENT_DIALOG_LIST)); // file list
|
CList* pli = static_cast< CList* >(pw->SearchControl(EVENT_DIALOG_LIST)); // file list
|
||||||
if ( pli == nullptr ) return false;
|
if ( pli == nullptr ) return false;
|
||||||
Math::Point dim = pli->GetDim();
|
glm::vec2 dim = pli->GetDim();
|
||||||
dim.y -= 17.5f/480.0f;
|
dim.y -= 17.5f/480.0f;
|
||||||
pli->SetDim(dim);
|
pli->SetDim(dim);
|
||||||
pli->SetSelect(-1);
|
pli->SetSelect(-1);
|
||||||
pli->ShowSelect(false);
|
pli->ShowSelect(false);
|
||||||
|
|
||||||
Math::Point pos = pli->GetPos();
|
glm::vec2 pos = pli->GetPos();
|
||||||
|
|
||||||
pos.y += dim.y-3.0f/480.0f;
|
pos.y += dim.y-3.0f/480.0f;
|
||||||
dim.y = 20.0f/480.0f;
|
dim.y = 20.0f/480.0f;
|
||||||
|
@ -1025,7 +1025,7 @@ void CFileDialog::UpdatePathLabel()
|
||||||
CLabel* pl = static_cast< CLabel* >(pw->SearchControl(EVENT_DIALOG_LABEL1));
|
CLabel* pl = static_cast< CLabel* >(pw->SearchControl(EVENT_DIALOG_LABEL1));
|
||||||
if ( pl != nullptr )
|
if ( pl != nullptr )
|
||||||
{
|
{
|
||||||
Math::Point dim = pl->GetDim();
|
glm::vec2 dim = pl->GetDim();
|
||||||
size_t nch = static_cast< size_t >((dim.x*640.0f)/5.75f);
|
size_t nch = static_cast< size_t >((dim.x*640.0f)/5.75f);
|
||||||
std::string text = SearchDirectory(false);
|
std::string text = SearchDirectory(false);
|
||||||
if (text.length() > nch)
|
if (text.length() > nch)
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
|
|
||||||
#include "common/event.h"
|
#include "common/event.h"
|
||||||
|
|
||||||
#include "math/point.h"
|
#include <glm/glm.hpp>
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
@ -148,22 +148,22 @@ public:
|
||||||
/**
|
/**
|
||||||
* \brief Set the initial position of the window.
|
* \brief Set the initial position of the window.
|
||||||
*/
|
*/
|
||||||
void SetWindowPos(Math::Point pos) { m_windowPos = pos; }
|
void SetWindowPos(const glm::vec2& pos) { m_windowPos = pos; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Get the position of the window.
|
* \brief Get the position of the window.
|
||||||
*/
|
*/
|
||||||
Math::Point GetWindowPos() { return m_windowPos; }
|
glm::vec2 GetWindowPos() { return m_windowPos; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Set the initial size of the window.
|
* \brief Set the initial size of the window.
|
||||||
*/
|
*/
|
||||||
void SetWindowDim(Math::Point dim) { m_windowDim = dim; }
|
void SetWindowDim(const glm::vec2& dim) { m_windowDim = dim; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Get the size of the window.
|
* \brief Get the size of the window.
|
||||||
*/
|
*/
|
||||||
Math::Point GetWindowDim() { return m_windowDim; }
|
glm::vec2 GetWindowDim() { return m_windowDim; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Set the text for the title bar of the dialog.
|
* \brief Set the text for the title bar of the dialog.
|
||||||
|
@ -332,8 +332,8 @@ private:
|
||||||
// With EVENT_NULL, a unique EventType will be used.
|
// With EVENT_NULL, a unique EventType will be used.
|
||||||
EventType m_windowEvent = EVENT_NULL;
|
EventType m_windowEvent = EVENT_NULL;
|
||||||
|
|
||||||
Math::Point m_windowPos;
|
glm::vec2 m_windowPos;
|
||||||
Math::Point m_windowDim;
|
glm::vec2 m_windowDim;
|
||||||
std::string m_title = "";
|
std::string m_title = "";
|
||||||
|
|
||||||
float m_time;
|
float m_time;
|
||||||
|
|
|
@ -169,10 +169,10 @@ void CMainDialog::StartPauseMenu()
|
||||||
{
|
{
|
||||||
CWindow* pw;
|
CWindow* pw;
|
||||||
CButton* pb;
|
CButton* pb;
|
||||||
Math::Point pos, dim;
|
glm::vec2 pos, dim;
|
||||||
std::string name;
|
std::string name;
|
||||||
|
|
||||||
StartDialog(Math::Point(0.3f, 0.8f), true);
|
StartDialog({ 0.3f, 0.8f }, true);
|
||||||
m_dialogType = DialogType::PauseMenu;
|
m_dialogType = DialogType::PauseMenu;
|
||||||
|
|
||||||
pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW9));
|
pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW9));
|
||||||
|
@ -244,7 +244,7 @@ void CMainDialog::StartQuestion(const std::string& text, bool warningYes, bool w
|
||||||
{
|
{
|
||||||
CWindow* pw;
|
CWindow* pw;
|
||||||
CButton* pb;
|
CButton* pb;
|
||||||
Math::Point pos, dim, ddim;
|
glm::vec2 pos, dim, ddim;
|
||||||
std::string name;
|
std::string name;
|
||||||
|
|
||||||
dim.x = 0.7f;
|
dim.x = 0.7f;
|
||||||
|
@ -303,7 +303,7 @@ void CMainDialog::StartInformation(const std::string& title, const std::string&
|
||||||
CWindow* pw;
|
CWindow* pw;
|
||||||
CButton* pb;
|
CButton* pb;
|
||||||
CLabel* pl;
|
CLabel* pl;
|
||||||
Math::Point pos, dim, ddim;
|
glm::vec2 pos, dim, ddim;
|
||||||
std::string name;
|
std::string name;
|
||||||
|
|
||||||
dim.x = 0.7f;
|
dim.x = 0.7f;
|
||||||
|
@ -346,10 +346,10 @@ void CMainDialog::StartInformation(const std::string& title, const std::string&
|
||||||
|
|
||||||
// Beginning of displaying a dialog.
|
// Beginning of displaying a dialog.
|
||||||
|
|
||||||
void CMainDialog::StartDialog(Math::Point dim, bool fireParticles)
|
void CMainDialog::StartDialog(const glm::vec2& dim, bool fireParticles)
|
||||||
{
|
{
|
||||||
CWindow* pw;
|
CWindow* pw;
|
||||||
Math::Point pos, ddim;
|
glm::vec2 pos, ddim;
|
||||||
|
|
||||||
m_main->StartSuspend();
|
m_main->StartSuspend();
|
||||||
|
|
||||||
|
@ -405,7 +405,7 @@ void CMainDialog::FrameDialog(float rTime)
|
||||||
{
|
{
|
||||||
CWindow* pw;
|
CWindow* pw;
|
||||||
Math::Vector pos, speed;
|
Math::Vector pos, speed;
|
||||||
Math::Point dim, dpos, ddim;
|
glm::vec2 dim, dpos, ddim;
|
||||||
float zoom;
|
float zoom;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
|
|
||||||
#include "common/restext.h"
|
#include "common/restext.h"
|
||||||
|
|
||||||
#include "math/point.h"
|
#include <glm/glm.hpp>
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
|
@ -72,7 +72,7 @@ public:
|
||||||
bool IsDialog();
|
bool IsDialog();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void StartDialog(Math::Point dim, bool fireParticles);
|
void StartDialog(const glm::vec2& dim, bool fireParticles);
|
||||||
void FrameDialog(float rTime);
|
void FrameDialog(float rTime);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
@ -92,8 +92,8 @@ protected:
|
||||||
bool m_dialogOpen;
|
bool m_dialogOpen;
|
||||||
DialogType m_dialogType;
|
DialogType m_dialogType;
|
||||||
bool m_dialogFireParticles;
|
bool m_dialogFireParticles;
|
||||||
Math::Point m_dialogPos;
|
glm::vec2 m_dialogPos;
|
||||||
Math::Point m_dialogDim;
|
glm::vec2 m_dialogDim;
|
||||||
float m_dialogTime;
|
float m_dialogTime;
|
||||||
float m_dialogParti;
|
float m_dialogParti;
|
||||||
|
|
||||||
|
|
|
@ -62,7 +62,7 @@ CMainMap::~CMainMap()
|
||||||
void CMainMap::CreateMap()
|
void CMainMap::CreateMap()
|
||||||
{
|
{
|
||||||
CWindow* pw;
|
CWindow* pw;
|
||||||
Math::Point pos, dim;
|
glm::vec2 pos, dim;
|
||||||
|
|
||||||
pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW1));
|
pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW1));
|
||||||
if (pw == nullptr)
|
if (pw == nullptr)
|
||||||
|
@ -158,7 +158,7 @@ void CMainMap::DimMap()
|
||||||
CWindow* pw;
|
CWindow* pw;
|
||||||
CMap* pm;
|
CMap* pm;
|
||||||
CSlider* ps;
|
CSlider* ps;
|
||||||
Math::Point pos, dim;
|
glm::vec2 pos, dim;
|
||||||
float value;
|
float value;
|
||||||
|
|
||||||
pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW1));
|
pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW1));
|
||||||
|
@ -361,7 +361,7 @@ bool CMainMap::GetFixImage()
|
||||||
|
|
||||||
// The object is detected in the mini-map.
|
// The object is detected in the mini-map.
|
||||||
|
|
||||||
CObject* CMainMap::DetectMap(Math::Point pos, bool &bInMap)
|
CObject* CMainMap::DetectMap(const glm::vec2& pos, bool &bInMap)
|
||||||
{
|
{
|
||||||
CWindow* pw;
|
CWindow* pw;
|
||||||
CMap* pm;
|
CMap* pm;
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
|
|
||||||
#include "graphics/core/color.h"
|
#include "graphics/core/color.h"
|
||||||
|
|
||||||
#include "math/point.h"
|
#include <glm/glm.hpp>
|
||||||
|
|
||||||
class CObject;
|
class CObject;
|
||||||
class CEventQueue;
|
class CEventQueue;
|
||||||
|
@ -53,7 +53,7 @@ public:
|
||||||
void ZoomMap();
|
void ZoomMap();
|
||||||
void MapEnable(bool bEnable);
|
void MapEnable(bool bEnable);
|
||||||
bool GetFixImage();
|
bool GetFixImage();
|
||||||
CObject* DetectMap(Math::Point pos, bool &bInMap);
|
CObject* DetectMap(const glm::vec2& pos, bool &bInMap);
|
||||||
void SetHighlight(CObject* pObj);
|
void SetHighlight(CObject* pObj);
|
||||||
void SetToy(bool bToy);
|
void SetToy(bool bToy);
|
||||||
void SetFixParam(float zoom, float ox, float oy, float angle, int mode, bool bDebug);
|
void SetFixParam(float zoom, float ox, float oy, float angle, int mode, bool bDebug);
|
||||||
|
|
|
@ -73,7 +73,7 @@ void CMainShort::SetMode(bool bBuilding)
|
||||||
|
|
||||||
bool CMainShort::CreateShortcuts()
|
bool CMainShort::CreateShortcuts()
|
||||||
{
|
{
|
||||||
Math::Point pos, dim;
|
glm::vec2 pos, dim;
|
||||||
|
|
||||||
if ( m_main->GetFixScene() ) return false;
|
if ( m_main->GetFixScene() ) return false;
|
||||||
|
|
||||||
|
@ -139,7 +139,7 @@ bool CMainShort::CreateShortcuts()
|
||||||
}
|
}
|
||||||
std::sort(teams.begin(), teams.end());
|
std::sort(teams.begin(), teams.end());
|
||||||
|
|
||||||
std::vector<Math::Point> positions;
|
std::vector<glm::vec2> positions;
|
||||||
for(unsigned int i = 0; i < teams.size(); i++)
|
for(unsigned int i = 0; i < teams.size(); i++)
|
||||||
{
|
{
|
||||||
positions.push_back(pos);
|
positions.push_back(pos);
|
||||||
|
@ -336,15 +336,15 @@ void CMainShort::SelectNext()
|
||||||
|
|
||||||
// The object detected by the mouse hovers over.
|
// The object detected by the mouse hovers over.
|
||||||
|
|
||||||
CObject* CMainShort::DetectShort(Math::Point pos)
|
CObject* CMainShort::DetectShort(const glm::vec2& pos)
|
||||||
{
|
{
|
||||||
for (unsigned int i = 0; i < m_shortcuts.size(); i++)
|
for (unsigned int i = 0; i < m_shortcuts.size(); i++)
|
||||||
{
|
{
|
||||||
CControl* pc = m_interface->SearchControl(static_cast<EventType>(EVENT_OBJECT_SHORTCUT+i));
|
CControl* pc = m_interface->SearchControl(static_cast<EventType>(EVENT_OBJECT_SHORTCUT+i));
|
||||||
if ( pc != nullptr )
|
if ( pc != nullptr )
|
||||||
{
|
{
|
||||||
Math::Point cpos = pc->GetPos();
|
glm::vec2 cpos = pc->GetPos();
|
||||||
Math::Point cdim = pc->GetDim();
|
glm::vec2 cdim = pc->GetDim();
|
||||||
|
|
||||||
if ( pos.x >= cpos.x &&
|
if ( pos.x >= cpos.x &&
|
||||||
pos.x <= cpos.x+cdim.x &&
|
pos.x <= cpos.x+cdim.x &&
|
||||||
|
|
|
@ -21,10 +21,10 @@
|
||||||
|
|
||||||
#include "common/event.h"
|
#include "common/event.h"
|
||||||
|
|
||||||
#include "math/point.h"
|
|
||||||
|
|
||||||
#include "object/object_type.h"
|
#include "object/object_type.h"
|
||||||
|
|
||||||
|
#include <glm/glm.hpp>
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
class CRobotMain;
|
class CRobotMain;
|
||||||
|
@ -51,7 +51,7 @@ public:
|
||||||
bool UpdateShortcuts();
|
bool UpdateShortcuts();
|
||||||
void SelectShortcut(EventType event);
|
void SelectShortcut(EventType event);
|
||||||
void SelectNext();
|
void SelectNext();
|
||||||
CObject* DetectShort(Math::Point pos);
|
CObject* DetectShort(const glm::vec2& pos);
|
||||||
void SetHighlight(CObject* pObj);
|
void SetHighlight(CObject* pObj);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
|
@ -557,7 +557,7 @@ void CStudio::ColorizeScript(CEdit* edit)
|
||||||
|
|
||||||
void CStudio::StartEditScript(CScript *script, std::string name, Program* program)
|
void CStudio::StartEditScript(CScript *script, std::string name, Program* program)
|
||||||
{
|
{
|
||||||
Math::Point pos, dim;
|
glm::vec2 pos, dim;
|
||||||
CWindow* pw;
|
CWindow* pw;
|
||||||
CEdit* edit;
|
CEdit* edit;
|
||||||
CButton* button;
|
CButton* button;
|
||||||
|
@ -615,7 +615,7 @@ void CStudio::StartEditScript(CScript *script, std::string name, Program* progra
|
||||||
GetResource(RES_TEXT, RT_STUDIO_TITLE, res);
|
GetResource(RES_TEXT, RT_STUDIO_TITLE, res);
|
||||||
pw->SetName(res);
|
pw->SetName(res);
|
||||||
|
|
||||||
pw->SetMinDim(Math::Point(0.49f, 0.50f));
|
pw->SetMinDim({ 0.49f, 0.50f });
|
||||||
pw->SetMaximized(m_bEditMaximized);
|
pw->SetMaximized(m_bEditMaximized);
|
||||||
pw->SetMinimized(m_bEditMinimized);
|
pw->SetMinimized(m_bEditMinimized);
|
||||||
|
|
||||||
|
@ -710,7 +710,7 @@ void CStudio::AdjustEditScript()
|
||||||
CGroup* group;
|
CGroup* group;
|
||||||
CSlider* slider;
|
CSlider* slider;
|
||||||
CList* list;
|
CList* list;
|
||||||
Math::Point wpos, wdim, pos, dim, ppos, ddim;
|
glm::vec2 wpos, wdim, pos, dim, ppos, ddim;
|
||||||
float hList;
|
float hList;
|
||||||
|
|
||||||
wpos = m_editActualPos;
|
wpos = m_editActualPos;
|
||||||
|
|
|
@ -84,14 +84,14 @@ protected:
|
||||||
bool m_bEditMaximized;
|
bool m_bEditMaximized;
|
||||||
bool m_bEditMinimized;
|
bool m_bEditMinimized;
|
||||||
|
|
||||||
Math::Point m_editActualPos;
|
glm::vec2 m_editActualPos;
|
||||||
Math::Point m_editActualDim;
|
glm::vec2 m_editActualDim;
|
||||||
Math::Point m_editFinalPos;
|
glm::vec2 m_editFinalPos;
|
||||||
Math::Point m_editFinalDim;
|
glm::vec2 m_editFinalDim;
|
||||||
Math::Point m_windowPos;
|
glm::vec2 m_windowPos;
|
||||||
Math::Point m_windowDim;
|
glm::vec2 m_windowDim;
|
||||||
Math::Point m_dialogPos;
|
glm::vec2 m_dialogPos;
|
||||||
Math::Point m_dialogDim;
|
glm::vec2 m_dialogDim;
|
||||||
|
|
||||||
float m_time;
|
float m_time;
|
||||||
float m_fixInfoTextTime;
|
float m_fixInfoTextTime;
|
||||||
|
|
Loading…
Reference in New Issue