瀏覽代碼

Only warnings for deprecated functions remain

Thomas Buck 11 年之前
父節點
當前提交
6b550a18a2
共有 10 個檔案被更改,包括 65 行新增65 行删除
  1. 3
    1
      Makefile
  2. 4
    2
      README.md
  3. 4
    4
      src/Emitter.cpp
  4. 3
    3
      src/Light.h
  5. 1
    1
      src/OpenRaider.cpp
  6. 2
    2
      src/Render.cpp
  7. 1
    1
      src/Render.h
  8. 3
    3
      src/Sound.cpp
  9. 6
    10
      src/TombRaider.cpp
  10. 38
    38
      src/World.cpp

+ 3
- 1
Makefile 查看文件

@@ -264,7 +264,9 @@ endif
264 264
 
265 265
 #################################################################
266 266
 
267
-clean: clean-emacs clean-build clean-test clean-obj clean-dep
267
+clean: clean-small clean-dep
268
+
269
+clean-small: clean-emacs clean-build clean-test clean-obj 
268 270
 	@-rm -rf bin/OpenRaider.app
269 271
 	@-rm -rf bin/OpenRaider.dmg
270 272
 

+ 4
- 2
README.md 查看文件

@@ -2,7 +2,9 @@
2 2
 
3 3
 [OpenRaider](http://openraider.sourceforge.net) is an Open Source implementation of the classic Tomb Raider Game Engine. It was abandoned in 2003.
4 4
 
5
-This project aims to get OpenRaider running in a modern Unix.
5
+This project aims to get OpenRaider in a more usable state.
6
+
7
+If you just want to see OpenRaider doing something, without installing any of the dependencies needed to build OpenRaider, install [XQuartz](http://xquartz.macosforge.org/trac) (if you don't have it already) and grab the Mac App Bundle from the [most recent release](https://github.com/xythobuz/OpenRaider/releases).
6 8
 
7 9
 ## Configuration
8 10
 
@@ -15,7 +17,7 @@ On Mac OS X 10.9 with [XCode](https://developer.apple.com/xcode/) and [MacPorts]
15 17
 
16 18
     sudo port install zlib cmake libsdl libsdl_ttf
17 19
 
18
-You also need the  [XQuartz](http://xquartz.macosforge.org/trac) X11 Server.
20
+You also need the [XQuartz](http://xquartz.macosforge.org/trac) X11 Server.
19 21
 
20 22
 To get Sound, you need [freealut](https://github.com/vancegroup/freealut). Get, compile and install it like this:
21 23
 

+ 4
- 4
src/Emitter.cpp 查看文件

@@ -210,7 +210,7 @@ void Emitter::TextureId(unsigned int particle_start,
210 210
 	unsigned int i;
211 211
 
212 212
 
213
-	if ((particle_start >= 0 && particle_start < _count) &&
213
+	if ((particle_start < _count) &&
214 214
 		 (particle_end > 0 && particle_end <= _count) &&
215 215
 		 (particle_start < particle_end))
216 216
 	{
@@ -226,7 +226,7 @@ void Emitter::Color(unsigned int particle_start, unsigned int particle_end,
226 226
 	unsigned int i;
227 227
 
228 228
 
229
-	if ((particle_start >= 0 && particle_start < _count) &&
229
+	if ((particle_start < _count) &&
230 230
 		 (particle_end > 0 && particle_end <= _count) &&
231 231
 		 (particle_start < particle_end))
232 232
 	{
@@ -242,7 +242,7 @@ void Emitter::Speed(unsigned int particle_start, unsigned int particle_end,
242 242
 	unsigned int i;
243 243
 
244 244
 
245
-	if ((particle_start >= 0 && particle_start < _count) &&
245
+	if ((particle_start < _count) &&
246 246
 		 (particle_end > 0 && particle_end <= _count) &&
247 247
 		 (particle_start < particle_end))
248 248
 	{
@@ -258,7 +258,7 @@ void Emitter::Force(unsigned int particle_start, unsigned int particle_end,
258 258
 	unsigned int i;
259 259
 
260 260
 
261
-	if ((particle_start >= 0 && particle_start < _count) &&
261
+	if ((particle_start < _count) &&
262 262
 		 (particle_end > 0 && particle_end <= _count) &&
263 263
 		 (particle_start < particle_end))
264 264
 	{

+ 3
- 3
src/Light.h 查看文件

@@ -81,11 +81,11 @@ class Light
81 81
 
82 82
  private:
83 83
 
84
-	unsigned int mFlags;        /* Flags for this light */
84
+	//unsigned int mFlags;        /* Flags for this light */
85 85
 
86
-	unsigned int mId;           /* Unique identifier of this light */
86
+	//unsigned int mId;           /* Unique identifier of this light */
87 87
 
88
-	char *mName;                /* Light name */
88
+	//char *mName;                /* Light name */
89 89
 };
90 90
 
91 91
 #endif

+ 1
- 1
src/OpenRaider.cpp 查看文件

@@ -1199,7 +1199,7 @@ void OpenRaider::gameFrame()
1199 1199
 				if (elapsed > mdl->rate)
1200 1200
 				{
1201 1201
 					if (mdl->getAnimation() == 0 &&
1202
-						 mdl->getFrame() == 2 ||  mdl->getFrame() == 10)
1202
+						 (mdl->getFrame() == 2 ||  mdl->getFrame() == 10))
1203 1203
 					{
1204 1204
 						if (m_flags & OpenRaider_EnableSound)
1205 1205
 						{

+ 2
- 2
src/Render.cpp 查看文件

@@ -1901,13 +1901,13 @@ void Render::drawSprite(sprite_t *sprite)
1901 1901
 	// So just draw normal texture, no case 2
1902 1902
 	case Render::modeSolid:
1903 1903
 		glBegin(GL_TRIANGLE_STRIP);
1904
-		glColor3f(sprite->texel[0].st[0], sprite->texel[0].st[2], 0.5);
1904
+		glColor3f(sprite->texel[0].st[0], sprite->texel[0].st[1], 0.5);
1905 1905
 		glVertex3fv(sprite->vertex[0].pos);
1906 1906
 
1907 1907
 		glColor3f(sprite->texel[1].st[0], sprite->texel[1].st[1], 0.5);
1908 1908
 		glVertex3fv(sprite->vertex[1].pos);
1909 1909
 
1910
-		glColor3f(sprite->texel[3].st[0], sprite->texel[3].st[2], 0.5);
1910
+		glColor3f(sprite->texel[3].st[0], sprite->texel[3].st[1], 0.5);
1911 1911
 		glVertex3fv(sprite->vertex[3].pos);
1912 1912
 
1913 1913
 		glColor3f(sprite->texel[2].st[0], sprite->texel[2].st[1], 0.5);

+ 1
- 1
src/Render.h 查看文件

@@ -587,7 +587,7 @@ private:
587 587
 
588 588
 	unsigned int *mNextTextureId;
589 589
 
590
-	float mSplash;
590
+	// float mSplash;
591 591
 
592 592
 	int mLock;
593 593
 

+ 3
- 3
src/Sound.cpp 查看文件

@@ -73,9 +73,9 @@ Sound::~Sound()
73 73
 
74 74
 int Sound::init()
75 75
 {
76
+#ifndef __APPLE__
76 77
 	int fd;
77 78
 
78
-#ifndef __APPLE__
79 79
 	fd = open("/dev/dsp", O_RDWR);
80 80
 
81 81
 	if (fd < 0)
@@ -127,7 +127,7 @@ void Sound::sourceAt(int source, float pos[3])
127 127
 int Sound::add(char *filename, int *source, unsigned int flags)
128 128
 {
129 129
 #ifdef HAVE_OPENAL
130
-   ALsizei size, freq, bits;
130
+   ALsizei size, freq;
131 131
    ALenum format;
132 132
    ALvoid *data;
133 133
    ALboolean err;
@@ -198,7 +198,7 @@ int Sound::add(char *filename, int *source, unsigned int flags)
198 198
 int Sound::add(unsigned char *wav, int *source, unsigned int flags)
199 199
 {
200 200
 #ifdef HAVE_OPENAL
201
-   ALsizei size, freq;
201
+   ALsizei size = 0, freq = 0;
202 202
    ALvoid *data;
203 203
 #endif
204 204
 

+ 6
- 10
src/TombRaider.cpp 查看文件

@@ -148,9 +148,6 @@ int TombRaider::NumAnimations()
148 148
 
149 149
 unsigned int TombRaider::NumFrames()
150 150
 {
151
-	if (_num_frames < 0)
152
-		return 0;
153
-
154 151
 	return _num_frames;
155 152
 }
156 153
 
@@ -257,8 +254,8 @@ int TombRaider::getNumAnimsForMoveable(int moveable_index)
257 254
 	tr2_moveable_t *next_moveable = 0x0;
258 255
 
259 256
 
260
-	if (moveable_index >= 0 &&
261
-		 moveable_index <= (int)_num_moveables || _num_moveables < 1)
257
+	if ((moveable_index >= 0 &&
258
+		 moveable_index <= (int)_num_moveables) || _num_moveables < 1)
262 259
 	{
263 260
 		moveable = &_moveables[moveable_index];
264 261
 	}
@@ -500,9 +497,9 @@ int TombRaider::Load(char *filename, void (*percent)(int))
500 497
 	  l = strlen(filename);
501 498
 
502 499
 	  // Looking for pattern "filename.trc"
503
-	  if (filename[l-1] == 'c' || filename[l-1] == 'C' &&
504
-			filename[l-2] == 'r' || filename[l-2] == 'R' &&
505
-			filename[l-3] == 't' || filename[l-3] == 'T')
500
+	  if ((filename[l-1] == 'c' || filename[l-1] == 'C') &&
501
+			(filename[l-2] == 'r' || filename[l-2] == 'R') &&
502
+			(filename[l-3] == 't' || filename[l-3] == 'T'))
506 503
 	  {
507 504
 		  printDebug("Load", "This is really a TR5 pak");
508 505
 		  mEngineVersion = TR_VERSION_5;
@@ -3193,7 +3190,6 @@ unsigned int TombRaider::getRoomSectorCount(unsigned int roomIndex,
3193 3190
 
3194 3191
 		return (mRoomsTR5[roomIndex].numZSectors *
3195 3192
 				  mRoomsTR5[roomIndex].numXSectors);
3196
-		break;
3197 3193
 	default:
3198 3194
 		// width of sector list
3199 3195
 		*zSectorsCount = _rooms[roomIndex].num_zsectors;
@@ -3203,7 +3199,7 @@ unsigned int TombRaider::getRoomSectorCount(unsigned int roomIndex,
3203 3199
 
3204 3200
 		count = _rooms[roomIndex].num_zsectors * _rooms[roomIndex].num_xsectors;
3205 3201
 
3206
-		return ((count < 0) ? 0 : count);
3202
+		return count;
3207 3203
 	}
3208 3204
 
3209 3205
 	return 0;

+ 38
- 38
src/World.cpp 查看文件

@@ -1,6 +1,6 @@
1 1
 /* -*- Mode: C++; tab-width: 3; indent-tabs-mode: t; c-basic-offset: 3 -*- */
2 2
 /*================================================================
3
- * 
3
+ *
4 4
  * Project : OpenRaider
5 5
  * Author  : Terry 'Mongoose' Hendrix II
6 6
  * Website : http://www.westga.edu/~stu7440/
@@ -10,10 +10,10 @@
10 10
  * Comments: The game world ( model )
11 11
  *
12 12
  *
13
- *           This file was generated using Mongoose's C++ 
13
+ *           This file was generated using Mongoose's C++
14 14
  *           template generator script.  <stu7440@westga.edu>
15
- * 
16
- *-- History ------------------------------------------------- 
15
+ *
16
+ *-- History -------------------------------------------------
17 17
  *
18 18
  * 2002.12.16:
19 19
  * Mongoose - Created
@@ -66,7 +66,7 @@ int World::getRoomByLocation(int index, float x, float y, float z)
66 66
 				return index;
67 67
 		}
68 68
 	}
69
-	
69
+
70 70
 	return getRoomByLocation(x, y, z);
71 71
 }
72 72
 
@@ -80,17 +80,17 @@ int World::getRoomByLocation(float x, float y, float z)
80 80
 	for (mRooms.start(); mRooms.forward(); mRooms.next())
81 81
 	{
82 82
 		room = mRooms.current();
83
-	
83
+
84 84
 		if (!room)
85 85
 			continue;
86 86
 
87 87
 		if (x > room->bbox_min[0] && x < room->bbox_max[0] &&
88 88
 			 z > room->bbox_min[2] && z < room->bbox_max[2])
89
-		{			
89
+		{
90 90
 			// This room contains current position
91 91
 			if (y > room->bbox_min[1] && y < room->bbox_max[1])
92 92
 				return mRooms.getCurrentIndex();
93
-			
93
+
94 94
 			// This room is above or below current position
95 95
 			hop = mRooms.getCurrentIndex();
96 96
 		}
@@ -104,7 +104,7 @@ int World::getRoomByLocation(float x, float y, float z)
104 104
 }
105 105
 
106 106
 
107
-int World::getAdjoiningRoom(int index, 
107
+int World::getAdjoiningRoom(int index,
108 108
 									 float x, float y, float z,
109 109
 									 float x2, float y2, float z2)
110 110
 {
@@ -118,14 +118,14 @@ int World::getAdjoiningRoom(int index,
118 118
 
119 119
 	if (room)
120 120
 	{
121
-		for (room->portals.start(); room->portals.forward(); 
121
+		for (room->portals.start(); room->portals.forward();
122 122
 			  room->portals.next())
123 123
 		{
124 124
 			portal = room->portals.current();
125
-			
125
+
126 126
 			if (!portal)
127 127
 				continue;
128
-			
128
+
129 129
 			if (helIntersectionLineAndPolygon(intersect, p1, p2, 4,
130 130
 														 portal->vertices))
131 131
 			{
@@ -146,11 +146,11 @@ int World::getSector(int room, float x, float z, float *floor, float *ceiling)
146 146
 
147 147
 
148 148
 	r = mRooms[room];
149
-	
149
+
150 150
 	if (!r)
151 151
 		return -1;
152 152
 
153
-	sector = (((((int)x - (int)r->pos[0]) / 1024) * r->numZSectors) + 
153
+	sector = (((((int)x - (int)r->pos[0]) / 1024) * r->numZSectors) +
154 154
 				 (((int)z - (int)r->pos[2]) / 1024));
155 155
 
156 156
 	if (sector > -1)
@@ -169,7 +169,7 @@ int World::getSector(int room, float x, float z, float *floor, float *ceiling)
169 169
 
170 170
 
171 171
 int World::getSector(int room, float x, float z)
172
-{	
172
+{
173 173
 	int sector;
174 174
 	room_mesh_t *r;
175 175
 
@@ -181,7 +181,7 @@ int World::getSector(int room, float x, float z)
181 181
 		return -1;
182 182
 	}
183 183
 
184
-	sector = (((((int)x - (int)r->pos[0]) / 1024) * r->numZSectors) + 
184
+	sector = (((((int)x - (int)r->pos[0]) / 1024) * r->numZSectors) +
185 185
 				 (((int)z - (int)r->pos[2]) / 1024));
186 186
 
187 187
 	if (sector < 0)
@@ -247,7 +247,7 @@ bool World::getHeightAtPosition(int index, float x, float *y, float z)
247 247
 		return false;
248 248
 	}
249 249
 
250
-	// Mongoose 2002.08.14, It's 0302 - give me a fucking break -- 
250
+	// Mongoose 2002.08.14, It's 0302 - give me a fucking break --
251 251
 	//   this works albeit poorly  =)
252 252
 	for (i = 0; (int)i < room->num_boxes; ++i)
253 253
 	{
@@ -467,7 +467,7 @@ void World::moveEntity(entity_t *e, char movement)
467 467
 	{
468 468
 #define ADJ_ROOM_CHECK
469 469
 #ifdef ADJ_ROOM_CHECK
470
-		room = getAdjoiningRoom(e->room,  
470
+		room = getAdjoiningRoom(e->room,
471 471
 										e->pos[0],  e->pos[1], e->pos[2],
472 472
 										x, y, z);
473 473
 #else
@@ -491,7 +491,7 @@ void World::moveEntity(entity_t *e, char movement)
491 491
 	roomFlags = getRoomInfo(room);
492 492
 	sector = getSector(room, x, z, &floor, &ceiling);
493 493
 	wall = isWall(room, sector);
494
-	
494
+
495 495
 	// If you're underwater you may want to swim  =)
496 496
 	// ...if you're worldMoveType_walkNoSwim, you better hope it's shallow
497 497
 	if (roomFlags & roomFlag_underWater && e->moveType == worldMoveType_walk)
@@ -503,14 +503,14 @@ void World::moveEntity(entity_t *e, char movement)
503 503
 	if (!(roomFlags & roomFlag_underWater) && e->moveType == worldMoveType_swim)
504 504
 	{
505 505
 		e->moveType = worldMoveType_walk;
506
-	}	
506
+	}
507 507
 
508
-	// Mongoose 2002.09.02, Add check for room -> room transition 
508
+	// Mongoose 2002.09.02, Add check for room -> room transition
509 509
 	//   ( Only allow by movement between rooms by using portals )
510
-	if ((e->moveType == worldMoveType_noClipping ||
511
-		  e->moveType == worldMoveType_fly ||
512
-		  e->moveType == worldMoveType_swim) ||
513
-		 room > -1 && !wall)
510
+	if (((e->moveType == worldMoveType_noClipping) ||
511
+		  (e->moveType == worldMoveType_fly) ||
512
+		  (e->moveType == worldMoveType_swim)) ||
513
+		 ((room > -1) && (!wall)))
514 514
 	{
515 515
 		e->room = room;
516 516
 
@@ -576,7 +576,7 @@ void World::moveEntity(entity_t *e, char movement)
576 576
 			// This is to force false gravity, by making camera stay on ground
577 577
 			e->pos[1] = h; //roomFloor->bbox_min[1];
578 578
 
579
-			// Check for camera below terrian and correct 
579
+			// Check for camera below terrian and correct
580 580
 			if (e->pos[1] < h - camHeight)
581 581
 			{
582 582
 				e->pos[1] = h - camHeight;
@@ -637,7 +637,7 @@ void World::clear()
637 637
 	for (mRooms.start(); mRooms.forward(); mRooms.next())
638 638
 	{
639 639
 		room = mRooms.current();
640
-	
640
+
641 641
 		if (room)
642 642
 		{
643 643
 			room->portals.erase();
@@ -657,7 +657,7 @@ void World::clear()
657 657
 		if (!mesh)
658 658
 			continue;
659 659
 
660
-		for (mesh->texturedTriangles.start(); 
660
+		for (mesh->texturedTriangles.start();
661 661
 			  mesh->texturedTriangles.forward();
662 662
 			  mesh->texturedTriangles.next())
663 663
 		{
@@ -672,7 +672,7 @@ void World::clear()
672 672
 				delete mesh->coloredTriangles.current();
673 673
 		}
674 674
 
675
-		for (mesh->texturedRectangles.start(); 
675
+		for (mesh->texturedRectangles.start();
676 676
 			  mesh->texturedRectangles.forward();
677 677
 			  mesh->texturedRectangles.next())
678 678
 		{
@@ -704,7 +704,7 @@ void World::clear()
704 704
 	for (mSprites.start(); mSprites.forward(); mSprites.next())
705 705
 	{
706 706
 		sprite = mSprites.current();
707
-	
707
+
708 708
 		if (!sprite)
709 709
 			continue;
710 710
 
@@ -719,12 +719,12 @@ void World::clear()
719 719
 	for (mModels.start(); mModels.forward(); mModels.next())
720 720
 	{
721 721
 		model = mModels.current();
722
-	
722
+
723 723
 		if (!model)
724 724
 			continue;
725 725
 
726 726
 		// No smart pointers, so skip if deleted once  =)
727
-		if (!cache.SearchKey(model) == UINT_MAX)
727
+		if (!cache.SearchKey(model))
728 728
 		{
729 729
 			cache.Add(model);
730 730
 		}
@@ -733,7 +733,7 @@ void World::clear()
733 733
 			continue;
734 734
 		}
735 735
 
736
-		for (model->animation.start(); model->animation.forward(); 
736
+		for (model->animation.start(); model->animation.forward();
737 737
 			  model->animation.next())
738 738
 		{
739 739
 			animation  = model->animation.current();
@@ -741,7 +741,7 @@ void World::clear()
741 741
 			if (!animation)
742 742
 				continue;
743 743
 
744
-			for (animation->frame.start(); animation->frame.forward(); 
744
+			for (animation->frame.start(); animation->frame.forward();
745 745
 				  animation->frame.next())
746 746
 			{
747 747
 				boneframe = animation->frame.current();
@@ -749,20 +749,20 @@ void World::clear()
749 749
 				if (!boneframe)
750 750
 					continue;
751 751
 
752
-				for (boneframe->tag.start(); boneframe->tag.forward(); 
752
+				for (boneframe->tag.start(); boneframe->tag.forward();
753 753
 					  boneframe->tag.next())
754 754
 				{
755 755
 					tag = boneframe->tag.current();
756
-					
756
+
757 757
 					if (!tag)
758 758
 						continue;
759 759
 
760 760
 					delete tag;
761
-				}		
761
+				}
762 762
 
763 763
 				delete boneframe;
764 764
 			}
765
-			
765
+
766 766
 			delete animation;
767 767
 		}
768 768
 

Loading…
取消
儲存