From 6f0db4a3ad381bbbe6e37320d96f727a3951f35d Mon Sep 17 00:00:00 2001 From: Tom Hicks Date: Sun, 26 Oct 2003 00:18:37 -0400 Subject: [PATCH] Readded Binary files --- OpenArena/oa/maps/oamap1.map | 217 ++++++++++++++++++++++- include/list.cpp | 246 --------------------------- include/list.h | 179 +++++++++++-------- lib/{.#bass.removed.lib => bass.lib} | Bin 4 files changed, 318 insertions(+), 324 deletions(-) delete mode 100644 include/list.cpp rename lib/{.#bass.removed.lib => bass.lib} (100%) diff --git a/OpenArena/oa/maps/oamap1.map b/OpenArena/oa/maps/oamap1.map index eafdf11..1e797c6 100644 --- a/OpenArena/oa/maps/oamap1.map +++ b/OpenArena/oa/maps/oamap1.map @@ -1,12 +1,223 @@ 1 +36 + 1 +-10.0 -1.0 -10.0 0.0 0.0 +-10.0 -1.0 10.0 2 0.0 +-10.0 10.0 10.0 2 1.1 +1.0 0.0 0.0 + +1 +-10.0 -1.0 -10.0 0.0 0.0 +-10.0 10.0 -10.0 0.0 1.1 +-10.0 10.0 10.0 2 1.1 +1.0 0.0 0.0 + +1 + 10.0 -1.0 -10.0 0.0 0.0 + 10.0 -1.0 10.0 2 0.0 + 10.0 10.0 10.0 2 1.1 +-1.0 0.0 0.0 + +1 + 10.0 -1.0 -10.0 0.0 0.0 + 10.0 10.0 -10.0 0.0 1.1 + 10.0 10.0 10.0 2 1.1 +-1.0 0.0 0.0 + +1 +-10.0 -1.0 -10.0 0.0 0.0 +-10.0 10.0 -10.0 0.0 1.1 + -5.0 10.0 -10.0 .5 1.1 +0.0 0.0 1.0 + +1 +-10.0 -1.0 -10.0 0.0 0.0 + -5.0 -1.0 -10.0 .5 0.0 + -5.0 10.0 -10.0 .5 1.1 +0.0 0.0 1.0 + +1 + 5.0 -1.0 -10.0 1.5 0.0 + 5.0 10.0 -10.0 1.5 1.1 + 10.0 10.0 -10.0 2 1.1 +0.0 0.0 1.0 + +1 + 5.0 -1.0 -10.0 1.5 0.0 + 10.0 -1.0 -10.0 2 0.0 + 10.0 10.0 -10.0 2 1.1 +0.0 0.0 1.0 + +1 +-10.0 -1.0 10.0 0.0 0.0 +-10.0 10.0 10.0 0.0 1.1 + 10.0 10.0 10.0 2 1.1 +0.0 0.0 -1.0 + +1 +-10.0 -1.0 10.0 0.0 0.0 + 10.0 -1.0 10.0 2 0.0 + 10.0 10.0 10.0 2 1.1 +0.0 0.0 -1.0 + +2 +-10.0 10.0 -10.0 0.0 32.0 + 10.0 10.0 -10.0 32.0 32.0 +-10.0 10.0 10.0 0.0 0.0 +0.0 -1.0 0.0 + +2 +-10.0 10.0 10.0 0.0 0.0 + 10.0 10.0 10.0 32.0 0.0 + 10.0 10.0 -10.0 32.0 32.0 +0.0 -1.0 0.0 0 --10 -10 -5 0 0 --10 10 -5 0 1 -10 -10 -5 1 0 +-10.0 -1.0 -10.0 0.0 4.0 + 10.0 -1.0 -10.0 4.0 4.0 +-10.0 -1.0 10.0 0.0 0.0 +0.0 1.0 0.0 + +0 +-10.0 -1.0 10.0 0.0 0.0 + 10.0 -1.0 10.0 4.0 0.0 + 10.0 -1.0 -10.0 4.0 4.0 +0.0 1.0 0.0 + +0 +-5 -1 -10 1 0 +-5 -1 -20 1 2 + 5 -1 -10 3 0 +0 1 0 + +0 + 5 -1 -10 3 0 +-5 -1 -20 1 2 + 5 -1 -20 3 2 +0 1 0 + +1 +-5 -1 -10 0 0 +-5 10 -10 0 1.1 +-5 -1 -20 1 0 +1 0 0 + +1 +-5 10 -10 0 1.1 +-5 10 -20 1 1.1 +-5 -1 -20 1 0 +1 0 0 + +1 + 5 -1 -10 0 0 + 5 10 -10 0 1.1 + 5 -1 -20 1 0 +-1 0 0 + +1 + 5 10 -10 0 1.1 + 5 10 -20 1 1.1 + 5 -1 -20 1 0 +-1 0 0 + +2 +-5 10 -10 8 0 +-5 10 -20 8 16 + 5 10 -10 24 0 +0 -1 0 + +2 + 5 10 -10 24 0 +-5 10 -20 8 16 + 5 10 -20 24 16 +0 -1 0 + +0 +-10 -1 -20 0 2 + 10 -1 -20 4 2 +-10 -1 -40 0 6 +0 1 0 + +0 +-10 -1 -40 0 6 + 10 -1 -40 4 6 + 10 -1 -20 4 2 +0 1 0 + +1 +-10 -1 -20 0 0 +-10 -1 -40 2 0 +-10 10 -20 0 1.1 +1 0 0 + +1 +-10 10 -20 0 1.1 +-10 10 -40 2 1.1 +-10 -1 -40 2 0 +1 0 0 + +1 +10 -1 -20 0 0 +10 -1 -40 2 0 +10 10 -20 0 1.1 +-1 0 0 + +1 +10 10 -20 0 1.1 +10 10 -40 2 1.1 +10 -1 -40 2 0 +-1 0 0 + +1 +-10 -1 -40 0 0 +-10 10 -40 0 1.1 + 10 -1 -40 2 0 0 0 1 +1 +-10 10 -40 0 1.1 +10 10 -40 2 1.1 +10 -1 -40 2 0 +0 0 1 + +2 +-10 10 -20 0 0 + 10 10 -20 32 0 +-10 10 -40 0 32 +0 -1 0 + +2 +-10 10 -40 0 32 + 10 10 -40 32 32 + 10 10 -20 32 0 +0 -1 0 + +1 +-10 -1 -20 0 0 + -5 -1 -20 .5 0 +-10 10 -20 0 1.1 +0 0 -1 + +1 +-10 10 -20 0 1.1 + -5 -1 -20 .5 0 + -5 10 -20 .5 1.1 +0 0 -1 + +1 +5 -1 -20 1.5 0 +10 -1 -20 2 0 +5 10 -20 1.5 1.1 +0 0 -1 + +1 +5 10 -20 1.5 1.1 +10 -1 -20 2 0 +10 10 -20 2 1.1 +0 0 -1 + + 3 groundc.tga moonc.tga diff --git a/include/list.cpp b/include/list.cpp deleted file mode 100644 index 7a6d787..0000000 --- a/include/list.cpp +++ /dev/null @@ -1,246 +0,0 @@ -/* -template -listNode::listNode() -{ - next = NULL; -} - -template -list::list() -{ - head = NULL; - tail = NULL; - currPos = NULL; -} - -template -list::~list() -{ - currPos = NULL; - while(head != NULL) - { - tail = head; - head = head->next; - delete tail; - tail = NULL; - } -} - -template -list::list(const list& rtOp) -{ - head = NULL; - tail = NULL - currPos = NULL; - - operator=(rtOp); -} - -template -void list::Clear() -{ - while(head) - Remove(head->data); -} - -template -void list::operator=(const list& rtOp) -{ - Clear(); - - listNode temp = rtOp.head->next; - listNode temp2 = NULL; - - if(temp != NULL) - { - head = new listNode; - head->data = rtOp.head->data; - tail = head; - temp2 = head; - } - - while (temp != NULL) - { - temp2->next = new listNode; - temp2 = temp2->next; - temp2->data = temp->data; - temp = temp->next; - } - - tail = temp2; -} - -template -bool list::IsEmpty() -{ - return head == NULL; -} - -template -bool list::IsFull() -{ - return false; -} - -template -void list::Insert(ItemType newItem) -{ - listNode* temp = head; - if(head != NULL) - { - - while(temp->next!= NULL && temp->data < newItem) - { - temp = temp->next; - } - - if(temp == head) - { - tail->next = head; - head = new listNode; - head->next = tail->next; - tail->next = NULL; - temp = head; - } - else if(temp->data != newItem) - { - if(temp == tail) - { - tail->next = new listNode; - tail = tail->next; - temp = tail; - } - else - { - tail->next = temp->next; - temp = temp->next = new listNode; - temp->next = tail->next; - tail->next = NULL; - } - } - } - else - { - temp = tail = head = new listNode; - tail->next = NULL; - } - - temp->data = newItem; -} - -template -void list::Remove(ItemType target) -{ - if(head != NULL) - { - listNode* temp = head; - tail->next = head; - - while(temp->next != NULL && temp->data != target) - { - tail->next = temp; - temp = temp->next; - } - - if(temp->data == target) - { - if(tail->next != head) - { - tail->next->next = temp->next; - delete temp; - } - else - { - head = head->next; - delete tail->next; - } - } - tail->next = NULL; - } -} - -template -bool list::PrevPosition() -{ - if(currPos != head) - { - tail->next = currPos; - currPos = head; - - if(currPos != tail->next) - { - while(currPos->next != tail->next) - { - currPos = currPos->next; - } - } - - tail->next = NULL; - - return true; - } - else - { - return false; - } -} - -template -bool list::NextPosition() -{ - if(currPos != tail) - { - currPos = currPos->next; - return true; - } - else - { - return false; - } -} - -template -void list::Remove() -{ - if(currPos != NULL) - { - tail->next = currPos; - currPos = currPos->next; - delete tail->next; - tail->next = NULL; - } - -} - -template -ItemType list::Retrieve() -{ - if(currPos != NULL) - return currPos->data; -} - -template -bool list::IsFirstPosition() -{ - return currPos == head; -} - -template -bool list::IsLastPosition() -{ - return currPos == tail; -} - -template -void list::FirstPosition() -{ - currPos = head; -} - -template -void list::LastPosition() -{ - currPos = tail; -} - -*/ \ No newline at end of file diff --git a/include/list.h b/include/list.h index f06a6c5..27ad933 100644 --- a/include/list.h +++ b/include/list.h @@ -5,13 +5,15 @@ #pragma warning(disable:4715) +typedef unsigned int LIST_ARRAY_INDEX_TYPE; + template class listNode { public: listNode(); - listNode* next; ItemType data; + listNode* next; }; template @@ -22,21 +24,22 @@ public: ~list(); list(const list&); - bool IsEmpty(); - bool IsFull(); + bool IsEmpty() const; + bool IsFull() const; void Insert(ItemType newItem); void Remove(ItemType target); void Remove(); - ItemType Retrieve(); + ItemType Retrieve() const; bool PrevPosition(); bool NextPosition(); - bool IsFirstPosition(); - bool IsLastPosition(); + bool IsFirstPosition() const; + bool IsLastPosition() const; void FirstPosition(); void LastPosition(); void Clear(); void operator=(const list&); - ItemType operator[](unsigned int); + ItemType operator[](LIST_ARRAY_INDEX_TYPE) const; + ItemType& operator[](LIST_ARRAY_INDEX_TYPE); private: listNode* head; @@ -75,7 +78,7 @@ template list::list(const list& rtOp) { head = NULL; - tail = NULL + tail = NULL; currPos = NULL; operator=(rtOp); @@ -93,36 +96,39 @@ void list::operator=(const list& rtOp) { Clear(); - listNode temp = rtOp.head->next; - listNode temp2 = NULL; - - if(temp != NULL) + if(!rtOp.IsEmpty()) { - head = new listNode; - head->data = rtOp.head->data; - tail = head; - temp2 = head; - } + listNode* temp = rtOp.head->next; + listNode* temp2 = NULL; - while (temp != NULL) - { - temp2->next = new listNode; - temp2 = temp2->next; - temp2->data = temp->data; - temp = temp->next; - } + if(temp != NULL) + { + head = new listNode; + head->data = rtOp.head->data; + tail = head; + temp2 = head; + } - tail = temp2; + while (temp != NULL) + { + temp2->next = new listNode; + temp2 = temp2->next; + temp2->data = temp->data; + temp = temp->next; + } + + tail = temp2; + } } template -bool list::IsEmpty() +bool list::IsEmpty() const { return head == NULL; } template -bool list::IsFull() +bool list::IsFull() const { return false; } @@ -131,46 +137,41 @@ template void list::Insert(ItemType newItem) { listNode* temp = head; - if(head != NULL) + listNode* temp2 = NULL; + + if(head == NULL) { - - while(temp->next!= NULL && temp->data < newItem) - { - temp = temp->next; - } - - if(temp == head) - { - tail->next = head; - head = new listNode; - head->next = tail->next; - tail->next = NULL; - temp = head; - } - else if(temp->data != newItem) - { - if(temp == tail) - { - tail->next = new listNode; - tail = tail->next; - temp = tail; - } - else - { - tail->next = temp->next; - temp = temp->next = new listNode; - temp->next = tail->next; - tail->next = NULL; - } - } + temp = tail = head = new listNode; } else { - temp = tail = head = new listNode; - tail->next = NULL; + if(newItem < head->data) + { + temp2 = head; + temp = head = new listNode; + head->next = temp2; + temp2 = NULL; + } + else + { + //temp = head; + while(temp->next != NULL && newItem > temp->next->data) + { + temp = temp->next; + } + temp2 = temp->next; + temp = temp->next = new listNode; + temp->next = temp2; + temp2 = NULL; + } } - + temp->data = newItem; + + if(temp->next == NULL) + { + tail = temp; + } } template @@ -259,20 +260,20 @@ void list::Remove() } template -ItemType list::Retrieve() +ItemType list::Retrieve() const { if(currPos != NULL) return currPos->data; } template -bool list::IsFirstPosition() +bool list::IsFirstPosition() const { return currPos == head; } template -bool list::IsLastPosition() +bool list::IsLastPosition() const { return currPos == tail; } @@ -290,24 +291,52 @@ void list::LastPosition() } template -ItemType list::operator[](unsigned int index) +ItemType list::operator[](LIST_ARRAY_INDEX_TYPE index) const { - if(head != NULL) + if(head == NULL) { - listNode* temp = head; - while(index > 0 && temp != NULL) - { - temp = temp->next; - --index; + //We should throw an exception here but instead I'll just return shit guess for now if somebody does this they're just fucked. } - if(temp != NULL) + else { + listNode* temp = head; + LIST_ARRAY_INDEX_TYPE current; + + for(current=0;current next == NULL) + { + temp->next = new listNode; + } + temp = temp->next; + } return temp->data; } - } } +template +ItemType& list::operator[](LIST_ARRAY_INDEX_TYPE index) +{ + if(head == NULL) + { + tail = currPos = head = new listNode; + return (ItemType&)(head->data); + } + else + { + listNode* temp = head; + LIST_ARRAY_INDEX_TYPE current; -#include "list.cpp" + for(current=0;current next == NULL) + { + temp->next = new listNode; + } + temp = temp->next; + } + return (ItemType&)(temp->data); + } +} -#endif \ No newline at end of file +#endif diff --git a/lib/.#bass.removed.lib b/lib/bass.lib similarity index 100% rename from lib/.#bass.removed.lib rename to lib/bass.lib