HIGHAREA.CPP
资源名称:tc3d.zip [点击查看]
上传用户:abcdshs
上传日期:2007-01-07
资源大小:1858k
文件大小:1k
源码类别:
游戏
开发平台:
Visual C++
- // (C) Copyright 1996 by Anthony J. Carin. All Rights Reserved.
- #include "stdafx.h"
- #include "higharea.h"
- higharea::higharea(surfs& area)
- {
- *((surfs*)this) = area;
- prev = 0;
- next = Game->HighAreas()->m_First;
- if (Game->HighAreas()->m_First)
- Game->HighAreas()->m_First->prev = this;
- Game->HighAreas()->m_First = this;
- }
- higharea::~higharea()
- {
- if (prev)
- {
- prev->next = next;
- if (next)
- next->prev = prev;
- if (Game->HighAreas()->m_Curr == this)
- Game->HighAreas()->m_Curr = Game->HighAreas()->m_First;
- }
- else
- {
- Game->HighAreas()->m_First = next;
- if (Game->HighAreas()->m_Curr == this)
- Game->HighAreas()->m_Curr = Game->HighAreas()->m_First;
- if (next)
- next->prev = 0;
- }
- }
- void highlist::Purge()
- {
- higharea *TmpFirst = m_First;
- higharea *TmpCurr;
- while (TmpFirst)
- {
- TmpCurr = TmpFirst;
- TmpFirst = TmpFirst->next;
- delete m_Curr;
- }
- m_First = m_Curr = 0;
- }