SCRLSURF.CPP
资源名称:tc3d.zip [点击查看]
上传用户:abcdshs
上传日期:2007-01-07
资源大小:1858k
文件大小:3k
源码类别:
游戏
开发平台:
Visual C++
- // (C) Copyright 1996-1998 by Anthony J. Carin. All Rights Reserved.
- #include "stdafx.h"
- #include "scrlsurf.h"
- scrollsurf::scrollsurf()
- {
- m_bmps = m_curr = NULL;
- }
- scrollsurf::~scrollsurf()
- {
- bmpsurfholder *tmp = m_bmps;
- while (tmp)
- {
- m_curr = tmp->m_next;
- delete tmp;
- tmp = m_curr;
- }
- }
- void scrollsurf::draw()
- {
- if (m_curr)
- {
- m_curr->m_bmp.draw();
- m_curr = m_curr->m_next;
- if (m_curr == NULL)
- m_curr = m_bmps;
- }
- }
- void scrollsurf::ExemptFromIntersect()
- {
- bmpsurfholder *tmp = m_bmps;
- while (tmp)
- {
- tmp->m_bmp.ExemptFromIntersect();
- tmp = tmp->m_next;
- }
- }
- void scrollsurf::OKToIntersect()
- {
- bmpsurfholder *tmp = m_bmps;
- while (tmp)
- {
- tmp->m_bmp.OKToIntersect();
- tmp = tmp->m_next;
- }
- }
- char scrollsurf::intersects(coordinate &a, coordinate &b)
- {
- if (m_curr)
- return m_curr->m_bmp.intersects(a, b);
- return FALSE;
- }
- void scrollsurf::xrotate(direction& d)
- {
- bmpsurfholder *tmp = m_bmps;
- while (tmp)
- {
- tmp->m_bmp.xrotate(d);
- tmp = tmp->m_next;
- }
- }
- void scrollsurf::yrotate(direction& d)
- {
- bmpsurfholder *tmp = m_bmps;
- while (tmp)
- {
- tmp->m_bmp.yrotate(d);
- tmp = tmp->m_next;
- }
- }
- void scrollsurf::zrotate(direction& d)
- {
- bmpsurfholder *tmp = m_bmps;
- while (tmp)
- {
- tmp->m_bmp.zrotate(d);
- tmp = tmp->m_next;
- }
- }
- scrollsurf::scrollsurf(surfs& s) : surfs(s)
- {
- bmpsurfholder *tmp = m_bmps;
- while (tmp)
- {
- tmp->m_bmp = s;
- tmp = tmp->m_next;
- }
- }
- void scrollsurf::CalcNormals()
- {
- bmpsurfholder *tmp = m_bmps;
- while (tmp)
- {
- tmp->m_bmp.CalcNormals();
- tmp = tmp->m_next;
- }
- }
- coordinate& scrollsurf::intersectingpoint()
- {
- static coordinate c;
- if (m_curr)
- c = m_curr->m_bmp.intersectingpoint();
- return c;
- }
- char scrollsurf::iswithin(coordinate& c)
- {
- if (m_curr)
- return m_curr->m_bmp.iswithin(c);
- return FALSE;
- }
- void scrollsurf::addsurf(CString& filename)
- {
- m_curr = new bmpsurfholder(filename);
- m_curr->m_next = m_bmps;
- m_bmps = m_curr;
- }
- void scrollsurf::setto(coordinate& a, coordinate& b, coordinate& c, coordinate& d)
- {
- bmpsurfholder *tmp = m_bmps;
- while (tmp)
- {
- tmp->m_bmp.setto(a, b, c, d);
- tmp = tmp->m_next;
- }
- }
- void scrollsurf::operator =(surfs& s)
- {
- bmpsurfholder *tmp = m_bmps;
- while (tmp)
- {
- tmp->m_bmp = s;
- tmp = tmp->m_next;
- }
- }
- void scrollsurf::operator +=(coordinate& c)
- {
- bmpsurfholder *tmp = m_bmps;
- while (tmp)
- {
- tmp->m_bmp += c;
- tmp = tmp->m_next;
- }
- }