⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 scrlsurf.cpp

📁 一个三维打斗游戏
💻 CPP
字号:
// (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;
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -