Descent3/ui/UIObject.cpp

85 lines
1.8 KiB
C++
Raw Normal View History

/*
* Descent 3
* Copyright (C) 2024 Parallax Software
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
2024-04-16 03:43:29 +00:00
/*
* $Logfile: /DescentIII/Main/ui/UIObject.cpp $
* $Revision: 3 $
* $Date: 4/14/99 1:53a $
* $Author: Jeff $
*
* Generic object code
*
* $Log: /DescentIII/Main/ui/UIObject.cpp $
2024-04-16 18:56:40 +00:00
*
2024-04-16 03:43:29 +00:00
* 3 4/14/99 1:53a Jeff
* fixed case mismatched #includes
2024-04-16 18:56:40 +00:00
*
2024-04-16 03:43:29 +00:00
* 2 5/08/98 3:58p Samir
* added ability to move a UI object.
2024-04-16 18:56:40 +00:00
*
2024-04-16 03:43:29 +00:00
* 1 12/30/97 4:36p Samir
* Initial revision
2024-04-16 18:56:40 +00:00
*
2024-04-16 03:43:29 +00:00
* $NoKeywords: $
*/
#include "UIlib.h"
2024-04-16 18:56:40 +00:00
UIObject::UIObject() {
m_X = m_Y = 0;
m_W = m_H = 0;
m_Created = false;
2024-04-16 03:43:29 +00:00
}
2024-04-16 18:56:40 +00:00
UIObject::~UIObject() {}
2024-04-16 03:43:29 +00:00
// obj = NULL, then this object has no parent: it is an independent entity.
2024-04-16 18:56:40 +00:00
void UIObject::Create(int x, int y, int w, int h) {
ASSERT(!m_Created);
2024-04-16 03:43:29 +00:00
2024-04-16 18:56:40 +00:00
m_X = x;
m_Y = y;
m_W = w;
m_H = h;
m_Created = true;
2024-04-16 03:43:29 +00:00
}
// moves the object.
2024-04-16 18:56:40 +00:00
void UIObject::Move(int x, int y, int w, int h) {
m_X = x;
m_Y = y;
m_W = w;
m_H = h;
mprintf((0, "new [%d,%d]\n", m_X, m_Y));
2024-04-16 03:43:29 +00:00
}
//@@
//@@// enables ui draw commands.
//@@void UIObject::StartDraw()
//@@{
//@@ m_OwnerVP->set_clipping_rect(m_X,m_Y,m_X+m_W-1,m_Y+m_H-1);
2024-04-16 18:56:40 +00:00
//@@ ui_StartDraw(m_OwnerVP);
2024-04-16 03:43:29 +00:00
//@@}
//@@
//@@
//@@// disables ui draw commands.
//@@void UIObject::EndDraw()
//@@{
2024-04-16 18:56:40 +00:00
//@@ ui_EndDraw();
2024-04-16 03:43:29 +00:00
//@@}