comparison mm7_data.h @ 1657:51a74615d956

DamagePlayerFromMonster continuing cleanup, part 3
author Grumpy7
date Wed, 18 Sep 2013 10:22:16 +0200
parents b0a2b8525483
children 55bdb9b043e3
comparison
equal deleted inserted replaced
1656:56847118d50c 1657:51a74615d956
1 #pragma once 1 #pragma once
2 #include <string> 2 #include <string>
3 #include "VectorTypes.h" 3 #include "VectorTypes.h"
4 #include "OSAPI.h" 4 #include "OSAPI.h"
5 #include <array> 5 #include <array>
6 #include <assert.h>
6 7
7 typedef char _UNKNOWN; 8 typedef char _UNKNOWN;
8 typedef unsigned int uint; 9 typedef unsigned int uint;
9 10
10 11
280 if ( size == 4 ) 281 if ( size == 4 )
281 return uint32(x) > uint32(x+y); 282 return uint32(x) > uint32(x+y);
282 return uint64(x) > uint64(x+y); 283 return uint64(x) > uint64(x+y);
283 } 284 }
284 285
285 286 template<class _Ty,
287 size_t _Size>
288 class NZIArray : std::array<_Ty, _Size>
289 {
290 public:
291 reference ZerothIndex()
292 {
293 return std::array<_Ty, _Size>::operator [](0);
294 }
295
296 reference operator[](size_type _Pos)
297 { // subscript nonmutable sequence
298 #if _ITERATOR_DEBUG_LEVEL == 2
299 assert(_Pos != 0 && "not allowed to access zeroth element");
300
301 #elif _ITERATOR_DEBUG_LEVEL == 1
302 _SCL_SECURE_VALIDATE_RANGE(_Pos != 0);
303 #endif /* _ITERATOR_DEBUG_LEVEL */
304
305 __analysis_assume(_Pos != 0);
306
307 return std::array<_Ty, _Size>::operator [](_Pos);
308 }
309
310 const_reference operator[](size_type _Pos) const
311 { // subscript nonmutable sequence
312 #if _ITERATOR_DEBUG_LEVEL == 2
313 assert(_Pos != 0 && "not allowed to access zeroth element");
314
315 #elif _ITERATOR_DEBUG_LEVEL == 1
316 _SCL_SECURE_VALIDATE_RANGE(_Pos != 0);
317 #endif /* _ITERATOR_DEBUG_LEVEL */
318
319 __analysis_assume(_Pos != 0);
320
321 return std::array<_Ty, _Size>::operator [](_Pos);
322 }
323 };
286 324
287 //------------------------------------------------------------------------- 325 //-------------------------------------------------------------------------
288 // Data declarations 326 // Data declarations
289 327
290 extern int game_starting_year; 328 extern int game_starting_year;
973 extern struct Texture *pTexture_PlayerFaceMask; 1011 extern struct Texture *pTexture_PlayerFaceMask;
974 extern struct Texture *pTexture_PlayerFaceEradicated; 1012 extern struct Texture *pTexture_PlayerFaceEradicated;
975 extern struct Texture *pTexture_PlayerFaceDead; 1013 extern struct Texture *pTexture_PlayerFaceDead;
976 extern std::array< std::array<struct Texture *, 56>, 4> pTextures_PlayerFaces; 1014 extern std::array< std::array<struct Texture *, 56>, 4> pTextures_PlayerFaces;
977 extern int dword_A75070; // weak 1015 extern int dword_A75070; // weak
978 extern std::array<struct Player *, 5> pPlayers; 1016 extern NZIArray<struct Player *, 5> pPlayers;
979 extern __int64 qword_A750D8; // weak 1017 extern __int64 qword_A750D8; // weak
980 extern enum PlayerSpeech PlayerSpeechID; 1018 extern enum PlayerSpeech PlayerSpeechID;
981 extern int uSpeakingCharacter; // weak 1019 extern int uSpeakingCharacter; // weak
982 extern std::array<char *, 36> pClassNames; 1020 extern std::array<char *, 36> pClassNames;
983 extern std::array<char *, 19> aCharacterConditionNames; 1021 extern std::array<char *, 19> aCharacterConditionNames;