1 /*---------------------------------------------------------------------------* 2 Project: NintendoWare 3 File: gfx_ResVertex.h 4 5 Copyright (C)2009-2011 Nintendo/HAL Laboratory, Inc. All rights reserved. 6 7 These coded instructions, statements, and computer programs contain proprietary 8 information of Nintendo and/or its licensed developers and are protected by 9 national and international copyright laws. They may not be disclosed to third 10 parties or copied or duplicated in any form, in whole or in part, without the 11 prior written consent of Nintendo. 12 13 The content herein is highly confidential and should be handled accordingly. 14 15 $Revision: $ 16 *---------------------------------------------------------------------------*/ 17 18 #ifndef NW_GFX_RESVERTEX_H_ 19 #define NW_GFX_RESVERTEX_H_ 20 21 #include <nw/ut/ut_ResUtil.h> 22 #include <nw/ut/ut_ResDictionary.h> 23 #include <nw/ut/ut_ResDeclMacros.h> 24 #include <nw/ut/ut_ResArrayTypes.h> 25 #include <nw/gfx/res/gfx_ResTypeInfo.h> 26 #include <nw/ut/ut_ResPrimitive.h> 27 28 namespace nw { 29 namespace gfx { 30 namespace res { 31 32 //! @details :private 33 struct ResVertexAttributeData 34 { 35 // TODO: こちらの定義は削除予定。 36 enum VertexType 37 { 38 FLAG_VERTEX_PARAM = 0x1, 39 FLAG_INTERLEAVE = 0x2 40 }; 41 42 nw::ut::ResTypeInfo typeInfo; 43 nw::ut::ResS32 m_Usage; 44 nw::ut::ResU32 m_Flags; 45 }; 46 47 class ResVertexStream; 48 class ResVertexParamAttribute; 49 50 //-------------------------------------------------------------------------- 51 //! @brief 頂点属性を表すバイナリリソースの基底クラスです。 52 //--------------------------------------------------------------------------- 53 class ResVertexAttribute : public nw::ut::ResCommon< ResVertexAttributeData > 54 { 55 public: 56 enum { TYPE_INFO = NW_GFX_RES_TYPE_INFO(ResVertexAttribute) }; 57 enum { SIGNATURE = NW_RES_SIGNATURE32('VATR') }; 58 59 enum VertexType 60 { 61 FLAG_VERTEX_PARAM = 0x1, 62 FLAG_INTERLEAVE = 0x2 63 }; 64 65 enum VertexAttributeUsage 66 { 67 USAGE_POSITION, 68 USAGE_NORMAL, 69 USAGE_TANGENT, 70 USAGE_COLOR, 71 USAGE_TEXTURECOODINATE0, 72 USAGE_TEXTURECOODINATE1, 73 USAGE_TEXTURECOODINATE2, 74 USAGE_BONEINDEX, 75 USAGE_BONEWEIGHT, 76 USAGE_USERATTRIBUTE0, 77 USAGE_USERATTRIBUTE1, 78 USAGE_USERATTRIBUTE2, 79 USAGE_USERATTRIBUTE3, 80 USAGE_USERATTRIBUTE4, 81 USAGE_USERATTRIBUTE5, 82 USAGE_USERATTRIBUTE6, 83 USAGE_USERATTRIBUTE7, 84 USAGE_USERATTRIBUTE8, 85 USAGE_USERATTRIBUTE9, 86 USAGE_USERATTRIBUTE10, 87 USAGE_USERATTRIBUTE11, 88 USAGE_INTERLEAVE, 89 USAGE_QUANTITY, 90 USAGE_NONE 91 }; 92 93 NW_RES_CTOR( ResVertexAttribute ) 94 95 96 //--------------------------------------------------------------------------- 97 //! @fn void SetUsage(s32 value) 98 //! @brief 頂点属性の用途を設定します。 99 //--------------------------------------------------------------------------- 100 //--------------------------------------------------------------------------- 101 //! @fn void SetFlags(u32 value) 102 //! @brief フラグの値を設定します。 103 //! 設定されなかったフラグは無効になります。 104 //--------------------------------------------------------------------------- 105 //--------------------------------------------------------------------------- 106 //! @fn void EnableFlags(u32 value) 107 //! @brief 指定された Flag の値を有効にします。 108 //! 設定されなかったフラグは変更されません。 109 //--------------------------------------------------------------------------- 110 //--------------------------------------------------------------------------- 111 //! @fn void DisableFlags(u32 value) 112 //! @brief 指定された Flag の値を無効にします。 113 //! 設定されなかったフラグは変更されません。 114 //--------------------------------------------------------------------------- 115 //--------------------------------------------------------------------------- 116 //! @fn s32 GetUsage() const 117 //! @brief 頂点属性の用途を取得します。 118 //--------------------------------------------------------------------------- 119 //--------------------------------------------------------------------------- 120 //! @fn u32 GetFlags() const 121 //! @brief フラグの値を取得します。 122 //--------------------------------------------------------------------------- 123 NW_RES_FIELD_PRIMITIVE_DECL( s32, Usage ) // GetUsage(), SetUsage() 124 NW_RES_FIELD_FLAGS_DECL( u32, Flags ) // GetFlags(), SetFlags(), EnableFlags(), DisableFlags() 125 126 //! @brief 頂点属性の初期化処理をおこないます。 127 void Setup(); 128 129 //! @brief 頂点属性の後始末をおこないます。 130 void Cleanup(); 131 132 //! @brief 頂点数を取得します。 133 //! 134 //! ResVertexParamAttribute だった場合は 0 を返します。 135 u32 GetVertexCount(); 136 137 //--------------------------------------------------------------------------- 138 //! @brief インスタンスの型情報を取得します。 139 //! 140 //! @return 型情報です。 141 //--------------------------------------------------------------------------- GetTypeInfo()142 nw::ut::ResTypeInfo GetTypeInfo() const { return ref().typeInfo; } 143 }; 144 typedef nw::ut::ResArrayClass<ResVertexAttribute>::type ResVertexAttributeArray; 145 146 147 //! @details :private 148 struct ResVertexParamAttributeData : public ResVertexAttributeData 149 { 150 nw::ut::ResU32 m_FormatType; 151 nw::ut::ResU8 m_Dimension; 152 u8 _padding_0[3]; 153 nw::ut::ResF32 m_Scale; 154 nw::ut::Offset m_AttributeTableCount; 155 nw::ut::Offset toAttributeTable; 156 }; 157 158 //-------------------------------------------------------------------------- 159 //! @brief パラメータによる頂点属性を表すバイナリリソースクラスです。 160 //--------------------------------------------------------------------------- 161 class ResVertexParamAttribute : public ResVertexAttribute 162 { 163 public: 164 enum { TYPE_INFO = NW_GFX_RES_TYPE_INFO(ResVertexParamAttribute) }; 165 enum { SIGNATURE = NW_RES_SIGNATURE32('VAPM') }; 166 167 NW_RES_CTOR_INHERIT( ResVertexParamAttribute, ResVertexAttribute ) 168 169 //--------------------------------------------------------------------------- 170 //! @fn void SetScale(f32 value) 171 //! @brief スケール値を設定します。 172 //--------------------------------------------------------------------------- 173 //--------------------------------------------------------------------------- 174 //! @fn void SetFormatType(u32 value) 175 //! @brief フォーマットの種類を設定します。 176 //--------------------------------------------------------------------------- 177 //--------------------------------------------------------------------------- 178 //! @fn void SetDimension(u8 value) 179 //! @brief 次元数を設定します。 180 //--------------------------------------------------------------------------- 181 //--------------------------------------------------------------------------- 182 //! @fn void SetAttribute(int idx, f32 value) 183 //! @brief 属性のリストに要素を設定します。 184 //--------------------------------------------------------------------------- 185 //--------------------------------------------------------------------------- 186 //! @fn f32 GetScale() const 187 //! @brief スケール値を取得します。 188 //--------------------------------------------------------------------------- 189 //--------------------------------------------------------------------------- 190 //! @fn u32 GetFormatType() const 191 //! @brief フォーマットの種類を取得します。 192 //--------------------------------------------------------------------------- 193 //--------------------------------------------------------------------------- 194 //! @fn u8 GetDimension() const 195 //! @brief 次元数を取得します。 196 //--------------------------------------------------------------------------- 197 //--------------------------------------------------------------------------- 198 //! @fn s32 GetAttributeCount() const 199 //! @brief 属性の要素数を取得します。 200 //--------------------------------------------------------------------------- 201 //--------------------------------------------------------------------------- 202 //! @fn f32 GetAttribute(int idx) const 203 //! @brief 属性を取得します。 204 //--------------------------------------------------------------------------- 205 NW_RES_FIELD_PRIMITIVE_DECL( u32, FormatType ) // GetFormatType(), SetFormatType() 206 NW_RES_FIELD_PRIMITIVE_DECL( u8, Dimension ) // GetDimension(), SetDimension() 207 NW_RES_FIELD_PRIMITIVE_DECL( f32, Scale ) // GetScale(), SetScale() 208 NW_RES_FIELD_PRIMITIVE_LIST_DECL( f32, Attribute ) // GetAttribute(), GetAttribute(int idx), GetAttributeCount() 209 210 //! @brief 頂点属性の初期化処理をおこないます。 211 void Setup(); 212 213 //! @brief 頂点属性の後始末をおこないます。 214 void Cleanup(); 215 }; 216 typedef nw::ut::ResArrayClass<ResVertexParamAttribute>::type ResVertexParamAttributeArray; 217 218 219 struct ResVertexStreamBaseData : public ResVertexAttributeData 220 { 221 enum 222 { 223 AREA_NO_MALLOC = 0, 224 AREA_FCRAM = NN_GX_MEM_FCRAM, 225 AREA_VRAMA = NN_GX_MEM_VRAMA, 226 AREA_VRAMB = NN_GX_MEM_VRAMB 227 }; 228 229 nw::ut::ResU32 m_BufferObject; 230 nw::ut::ResU32 m_LocationFlag; 231 nw::ut::ResS32 m_StreamTableCount; 232 nw::ut::Offset toStreamTable; 233 u32 m_LocationAddress; 234 u32 m_MemoryArea; 235 }; 236 237 //! @details :private 238 struct ResVertexStreamData : public ResVertexStreamBaseData 239 { 240 nw::ut::ResU32 m_FormatType; 241 nw::ut::ResU8 m_Dimension; 242 u8 _padding_0[3]; 243 nw::ut::ResF32 m_Scale; 244 nw::ut::ResU32 m_Offset; 245 }; 246 247 struct ResInterleavedVertexStreamData : public ResVertexStreamBaseData 248 { 249 nw::ut::ResU32 m_Stride; 250 nw::ut::ResS32 m_VertexStreamsTableCount; 251 nw::ut::Offset toVertexStreamsTable; 252 }; 253 254 255 //-------------------------------------------------------------------------- 256 //! @brief 頂点ストリームによる頂点属性を表すバイナリのベースクラスです。 257 //--------------------------------------------------------------------------- 258 class ResVertexStreamBase : public ResVertexAttribute 259 { 260 public: 261 enum { TYPE_INFO = NW_GFX_RES_TYPE_INFO(ResVertexStreamBase) }; 262 enum { SIGNATURE = NW_RES_SIGNATURE32('VSTB') }; 263 NW_RES_CTOR_INHERIT(ResVertexStreamBase,ResVertexAttribute)264 NW_RES_CTOR_INHERIT( ResVertexStreamBase, ResVertexAttribute ) 265 266 //--------------------------------------------------------------------------- 267 //! @fn void SetBufferObject(u32 value) 268 //! @brief バッファオブジェクトを設定します。 269 //--------------------------------------------------------------------------- 270 //--------------------------------------------------------------------------- 271 //! @fn u32 GetBufferObject() const 272 //! @brief バッファオブジェクトを取得します。 273 //--------------------------------------------------------------------------- 274 NW_RES_FIELD_PRIMITIVE_DECL( u32, BufferObject ) // GetBufferObject(), SetBufferObject() 275 276 //--------------------------------------------------------------------------- 277 //! @fn u32 GetLocationFlag() const 278 //! @brief ロケーションフラグを取得します。 279 //--------------------------------------------------------------------------- 280 //--------------------------------------------------------------------------- 281 //! @fn void SetLocationFlag(u32 value) 282 //! @brief ロケーションフラグを設定します。 283 //--------------------------------------------------------------------------- 284 NW_RES_FIELD_PRIMITIVE_DECL( u32, LocationFlag ) // GetLocationFlag(), SetLocationFlag() 285 286 //--------------------------------------------------------------------------- 287 //! @fn s32 GetStreamCount() const 288 //! @brief ストリームのバイト数を取得します。 289 //--------------------------------------------------------------------------- 290 //--------------------------------------------------------------------------- 291 //! @fn const u8* GetStream() const 292 //! @brief ストリームを取得します。 293 //--------------------------------------------------------------------------- 294 NW_RES_FIELD_PRIMITIVE_LIST_DECL( u8, Stream ) // GetStream(), GetStream(int idx), GetStreamCount() 295 296 //--------------------------------------------------------------------------- 297 //! @brief コピーされた頂点バッファのアドレスを取得します。 298 //! 299 //! @return コピーされた頂点バッファの論理アドレスです。 300 //--------------------------------------------------------------------------- 301 u32 GetLocationAddress() const { return ref().m_LocationAddress; } 302 303 //--------------------------------------------------------------------------- 304 //! @brief コピーされた頂点バッファのアドレスを設定します。 305 //! 306 //! @param[in] address コピーされた頂点バッファの論理アドレスです。 307 //--------------------------------------------------------------------------- SetLocationAddress(u32 address)308 void SetLocationAddress(u32 address) { ref().m_LocationAddress = address; } SetLocationAddress(const void * address)309 void SetLocationAddress(const void* address) { ref().m_LocationAddress = reinterpret_cast<u32>(address); } 310 311 //--------------------------------------------------------------------------- 312 //! @brief GPU から参照されるイメージのアドレスを取得します。 313 //! 314 //! @details LocationAddess が設定されている場合はそのアドレスを使用し、 315 //! LocationAddess が NULL の場合には、Stream のアドレスを直接 GPU から参照します。 316 //! 317 //! @return GPU から参照されるイメージのアドレスです。 318 //--------------------------------------------------------------------------- GetImageAddress()319 u32 GetImageAddress() const 320 { 321 u32 locationAddress = this->GetLocationAddress(); 322 323 if ( locationAddress ) 324 { 325 return locationAddress; 326 } 327 else 328 { 329 return reinterpret_cast<u32>( this->GetStream() ); 330 } 331 } 332 }; 333 334 335 //-------------------------------------------------------------------------- 336 //! @brief 頂点ストリームによる頂点属性を表すバイナリリソースクラスです。 337 //--------------------------------------------------------------------------- 338 class ResVertexStream : public ResVertexStreamBase 339 { 340 public: 341 enum { TYPE_INFO = NW_GFX_RES_TYPE_INFO(ResVertexStream) }; 342 enum { SIGNATURE = NW_RES_SIGNATURE32('VSTM') }; 343 344 NW_RES_CTOR_INHERIT( ResVertexStream, ResVertexStreamBase ) 345 346 //--------------------------------------------------------------------------- 347 //! @fn void SetFormatType(u32 value) 348 //! @brief フォーマットの種類を設定します。 349 //--------------------------------------------------------------------------- 350 //--------------------------------------------------------------------------- 351 //! @fn u32 GetFormatType() const 352 //! @brief フォーマットの種類を取得します。 353 //--------------------------------------------------------------------------- 354 NW_RES_FIELD_PRIMITIVE_DECL( u32, FormatType ) // GetFormatType(), SetFormatType() 355 356 //--------------------------------------------------------------------------- 357 //! @fn u8 GetDimension() const 358 //! @brief 次元数を取得します。 359 //--------------------------------------------------------------------------- 360 //--------------------------------------------------------------------------- 361 //! @fn void SetDimension(u8 value) 362 //! @brief 次元数を設定します。 363 //--------------------------------------------------------------------------- 364 NW_RES_FIELD_PRIMITIVE_DECL( u8, Dimension ) // GetDimension(), SetDimension() 365 366 //--------------------------------------------------------------------------- 367 //! @fn void SetScale(f32 value) 368 //! @brief スケール値を設定します。 369 //--------------------------------------------------------------------------- 370 //--------------------------------------------------------------------------- 371 //! @fn f32 GetScale() const 372 //! @brief スケール値を取得します。 373 //--------------------------------------------------------------------------- 374 NW_RES_FIELD_PRIMITIVE_DECL( f32, Scale ) // GetScale(), SetScale() 375 376 //--------------------------------------------------------------------------- 377 //! @fn void SetOffset(u32 value) 378 //! @brief インターリーブ形式の場合のオフセット情報を設定します。 379 //--------------------------------------------------------------------------- 380 //--------------------------------------------------------------------------- 381 //! @fn u32 GetOffset() const 382 //! @brief インターリーブ形式の場合のオフセット情報を取得します。 383 //--------------------------------------------------------------------------- 384 NW_RES_FIELD_PRIMITIVE_DECL( u32, Offset ) 385 386 //! @brief 頂点ストリームの初期化処理をおこないます。 387 void Setup(); 388 389 //! @brief 頂点属性の後始末をおこないます。 390 void Cleanup(); 391 }; 392 typedef nw::ut::ResArrayClass<ResVertexStream>::type ResVertexStreamArray; 393 394 //-------------------------------------------------------------------------- 395 //! @brief インターリーブ形式の頂点ストリームを表すバイナリリソースクラスです。 396 //--------------------------------------------------------------------------- 397 class ResInterleavedVertexStream : public ResVertexStreamBase 398 { 399 public: 400 NW_RES_CTOR_INHERIT( ResInterleavedVertexStream, ResVertexStreamBase ) 401 402 //--------------------------------------------------------------------------- 403 //! @fn u32 GetStride() const 404 //! @brief インターリーブ形式の1頂点あたりの頂点サイズを取得します。 405 //--------------------------------------------------------------------------- 406 //--------------------------------------------------------------------------- 407 //! @fn void SetStride(u32 value) 408 //! @brief インターリーブ形式の1頂点あたりの頂点サイズを設定します。 409 //--------------------------------------------------------------------------- 410 NW_RES_FIELD_PRIMITIVE_DECL( u32, Stride ) 411 412 //--------------------------------------------------------------------------- 413 //! @fn s32 GetVertexStreamsCount() const 414 //! @brief インターリーブを構成する頂点属性の集合の要素数を取得します。 415 //--------------------------------------------------------------------------- 416 //--------------------------------------------------------------------------- 417 //! @fn ResVertexStream GetVertexStreams(int idx) 418 //! @brief インターリーブを構成する頂点属性の集合を取得します。 419 //--------------------------------------------------------------------------- 420 NW_RES_FIELD_CLASS_LIST_DECL( ResVertexStream, VertexStreams ) 421 422 //! @brief 頂点ストリームの初期化処理をおこないます。 423 void Setup(); 424 425 //! @brief 頂点属性の後始末をおこないます。 426 void Cleanup(); 427 }; 428 429 430 //! @details :private 431 struct ResIndexStreamData 432 { 433 enum 434 { 435 AREA_NO_MALLOC = 0, 436 AREA_FCRAM = NN_GX_MEM_FCRAM, 437 AREA_VRAMA = NN_GX_MEM_VRAMA, 438 AREA_VRAMB = NN_GX_MEM_VRAMB 439 }; 440 441 nw::ut::ResU32 m_FormatType; 442 nw::ut::ResU8 m_PrimitiveMode; 443 bool m_IsVisible; 444 u8 _padding_0[2]; 445 nw::ut::ResS32 m_StreamTableCount; 446 nw::ut::Offset toStreamTable; 447 nw::ut::ResU32 m_BufferObject; 448 nw::ut::ResU32 m_LocationFlag; 449 450 void* m_CommandCache; 451 s32 m_CommandCacheSize; 452 u32 m_LocationAddress; 453 u32 m_MemoryArea; 454 455 nw::ut::Offset toBoundingVolume; 456 }; 457 458 //-------------------------------------------------------------------------- 459 //! @brief 頂点インデックスストリームを表すバイナリリソースクラスです。 460 //--------------------------------------------------------------------------- 461 class ResIndexStream : public nw::ut::ResCommon< ResIndexStreamData > 462 { 463 public: NW_RES_CTOR(ResIndexStream)464 NW_RES_CTOR( ResIndexStream ) 465 466 //--------------------------------------------------------------------------- 467 //! @fn u32 GetFormatType() const 468 //! @brief フォーマットの種類を取得します。 469 //--------------------------------------------------------------------------- 470 //--------------------------------------------------------------------------- 471 //! @fn void SetFormatType(u32 value) 472 //! @brief フォーマットの種類を設定します。 473 //--------------------------------------------------------------------------- 474 NW_RES_FIELD_PRIMITIVE_DECL( u32, FormatType ) // GetFormatType(), SetFormatType() 475 476 //--------------------------------------------------------------------------- 477 //! @fn u8 GetPrimitiveMode() const 478 //! @brief プリミティブのモードを取得します。 479 //--------------------------------------------------------------------------- 480 //--------------------------------------------------------------------------- 481 //! @fn void SetPrimitiveMode(u8 value) 482 //! @brief プリミティブのモードを設定します。 483 //--------------------------------------------------------------------------- 484 NW_RES_FIELD_PRIMITIVE_DECL( u8, PrimitiveMode ) // GetPrimitiveMode(), SetPrimitiveMode() 485 486 //--------------------------------------------------------------------------- 487 //! @fn s32 GetStreamCount() const 488 //! @brief ストリームの要素数を取得します。 489 //--------------------------------------------------------------------------- 490 //--------------------------------------------------------------------------- 491 //! @fn u8 GetStream(int idx) const 492 //! @brief ストリームを取得します。 493 //--------------------------------------------------------------------------- 494 //--------------------------------------------------------------------------- 495 //! @fn void SetStream(int idx, u8 value) 496 //! @brief ストリームのリストに要素を設定します。 497 //--------------------------------------------------------------------------- 498 NW_RES_FIELD_PRIMITIVE_LIST_DECL( u8, Stream ) // GetStream(), GetStream(int idx), GetStreamCount() 499 500 //--------------------------------------------------------------------------- 501 //! @fn u32 GetBufferObject() const 502 //! @brief バッファオブジェクトを取得します。 503 //--------------------------------------------------------------------------- 504 //--------------------------------------------------------------------------- 505 //! @fn void SetBufferObject(u32 value) 506 //! @brief バッファオブジェクトを設定します。 507 //--------------------------------------------------------------------------- 508 NW_RES_FIELD_PRIMITIVE_DECL( u32, BufferObject ) // GetBufferObject(), SetBufferObject() 509 510 //--------------------------------------------------------------------------- 511 //! @fn u32 GetLocationFlag() const 512 //! @brief ロケーションフラグを取得します。 513 //--------------------------------------------------------------------------- 514 //--------------------------------------------------------------------------- 515 //! @fn void SetLocationFlag(u32 value) 516 //! @brief ロケーションフラグを設定します。 517 //--------------------------------------------------------------------------- 518 NW_RES_FIELD_PRIMITIVE_DECL( u32, LocationFlag ) // GetLocationFlag(), SetLocationFlag() 519 520 //--------------------------------------------------------------------------- 521 //! @fn nw::ut::ResBoundingVolume GetBoundingVolume() 522 //! @brief この機能は現状では実験仕様となります。将来的に仕様が変更になる可能性があります。 523 //! 境界情報を取得します。 524 //--------------------------------------------------------------------------- 525 NW_RES_FIELD_CLASS_DECL( nw::ut::ResBoundingVolume, BoundingVolume ) // GetBoundingVolume() 526 527 //--------------------------------------------------------------------------- 528 //! @brief コピーされた頂点バッファのアドレスを取得します。 529 //! 530 //! @return コピーされた頂点バッファの論理アドレスです。 531 //--------------------------------------------------------------------------- 532 u32 GetLocationAddress() const { return ref().m_LocationAddress; } 533 534 //--------------------------------------------------------------------------- 535 //! @brief コピーされた頂点バッファのアドレスを設定します。 536 //! 537 //! @param[in] address コピーされた頂点バッファの論理アドレスです。 538 //--------------------------------------------------------------------------- SetLocationAddress(u32 address)539 void SetLocationAddress(u32 address) { ref().m_LocationAddress = address; } SetLocationAddress(const void * address)540 void SetLocationAddress(const void* address) { ref().m_LocationAddress = reinterpret_cast<u32>(address); } 541 542 //--------------------------------------------------------------------------- 543 //! @brief GPU から参照されるイメージのアドレスを取得します。 544 //! 545 //! @details LocationAddess が設定されている場合はそのアドレスを使用し、 546 //! LocationAddess が NULL の場合には、Stream のアドレスを直接 GPU から参照します。 547 //! 548 //! @return GPU から参照されるイメージのアドレスです。 549 //--------------------------------------------------------------------------- GetImageAddress()550 u32 GetImageAddress() const 551 { 552 u32 locationAddress = this->GetLocationAddress(); 553 554 if ( locationAddress ) 555 { 556 return locationAddress; 557 } 558 else 559 { 560 return reinterpret_cast<u32>( this->GetStream() ); 561 } 562 } 563 564 //--------------------------------------------------------------------------- 565 //! @fn void SetVisible(bool value) 566 //! @brief この機能は現状では実験仕様となります。将来的に仕様が変更になる可能性があります。 567 //! 表示するかどうかのフラグを設定します。 568 //--------------------------------------------------------------------------- 569 //--------------------------------------------------------------------------- 570 //! @fn bool IsVisible() const 571 //! @brief この機能は現状では実験仕様となります。将来的に仕様が変更になる可能性があります。 572 //! 表示するかどうかのフラグを取得します。 573 //--------------------------------------------------------------------------- 574 NW_RES_FIELD_BOOL_PRIMITIVE_DECL( Visible ) // IsVisible(), SetVisible() 575 576 //! @brief 頂点数を取得します。 577 u32 GetVertexCount(); 578 }; 579 typedef nw::ut::ResArrayClass<ResIndexStream>::type ResIndexStreamArray; 580 581 } // namespace res 582 } // namespace gfx 583 } // namespace nw 584 585 #endif // NW_GFX_RESVERTEX_H_ 586