OSDN Git Service

最初のコミット
[shooting3/s2001.git] / project / sfglib / AbstractSprite.cpp
1 /**
2  * @file
3  * @brief Sprite\83C\83\93\83^\81[\83t\83F\81[\83X\82Ì\8b¤\92Ê\8eÀ\91\95\82ð\8ds\82¤.
4  * 
5  * \94h\90\83N\83\89\83X\82Å\8b¤\92Ê\82Å\8eg\97p\82Å\82«\82»\82¤\82È\83\81\83\\83b\83h\81A\83\81\83\93\83o\82ð\82±\82±\82Å\8bL\8fq\82µ\82Ü\82·\81B
6  * @author S.F.
7  * @version $Id:
8  *
9  * Copyright (C) 2000-2002 Satoshi Fujiwara. All Rights Reserved.
10  */
11
12 #pragma warning( disable : 4786 )       //STL\82Ì\8cx\8d\90\8aO\82µ
13
14 // \83\81\83\82\83\8a\81[\83\8a\81[\83N\8c\9f\8fo\97p
15 #include "sfdebug.h"
16
17 // SYSTEM INCLUDES
18 //
19 #include <stdio.h>
20 #include <queue>
21 #include "windows.h"
22 #include "windowsx.h"
23
24 #include "d3d11.h"
25 #include "d3dx11.h"
26 #include "dxerr8sf.h"
27
28 // PROJECT INCLUDES
29 //
30
31
32 #include "exception.h"
33 #include "sound.h"
34 #include "System.h"
35 #include "console.h"
36
37 #ifdef _DEBUG
38 #define new DEBUG_NEW
39 #endif
40
41 #include "Obj.h"
42 #include "Obj2D.h"
43 #include "ObjRectangle.h"
44 #include "ObjQuadrangle.h"
45 #include "Obj3D.h"
46 #include "Obj3DL.h"
47 #include "input.h"
48 #include "AbstractSprite.h"
49 #include "ConsoleImpl.h"
50 #include "Main.h"
51
52 //template class SFDLL std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >;
53
54 using namespace sf::system::console;
55 using namespace sf::system::console::sprite;
56
57 //////////////////////////////////////////////////////////////////////
58 // \8d\\92z/\8fÁ\96Å
59 //////////////////////////////////////////////////////////////////////
60
61 AbstractSprite::AbstractSprite()
62 {
63 //      mpSpriteVtBuf = NULL;
64 //      mpSpriteTexture = NULL;
65 //      mpSprite3DVtBuf = NULL;
66         mpD3DDevice = NULL;
67         mbUse = false;
68         mCenterX = mCenterY = 0.0f;
69         mWidth = mHeight = 0.0f;
70 //      mpMeshMaterials = NULL;
71 //      mpMeshTextures = NULL;
72 //      mNumMaterials = 0L; 
73 //      mpMesh = NULL;
74 //      mCellWidth = 0.0f;
75 //      mCellHeight = 0.0f;
76 //      mCellCount = 0;
77 }
78
79 AbstractSprite::~AbstractSprite()
80 {
81
82 }
83
84 // \95`\89æ\97p\83\8c\83\93\83_\83\8a\83\93\83O\83X\83e\81[\83g\82Ì\90Ý\92è --------------------------------------------
85 void AbstractSprite::setRenderState(const DrawMode value)
86 {
87                 switch (value)
88                 {
89                 case DRAW_TRANS:
90                         mpD3DDevice->SetRenderState(D3DRS_SRCBLEND,D3DBLEND_SRCALPHA);
91                         mpD3DDevice->SetRenderState(D3DRS_DESTBLEND,D3DBLEND_INVSRCALPHA);
92                         break;
93                 case DRAW_ADD:
94                         mpD3DDevice->SetRenderState(D3DRS_SRCBLEND,D3DBLEND_ONE);
95                         mpD3DDevice->SetRenderState(D3DRS_DESTBLEND,D3DBLEND_ONE);
96                         break;
97                 case DRAW_ADD1:
98                         mpD3DDevice->SetRenderState(D3DRS_SRCBLEND,D3DBLEND_ONE);
99                         mpD3DDevice->SetRenderState(D3DRS_DESTBLEND,D3DBLEND_INVSRCALPHA);
100                         break;
101                 case DRAW_SHADOW:
102                         mpD3DDevice->SetRenderState(D3DRS_SRCBLEND,D3DBLEND_ZERO);
103                         mpD3DDevice->SetRenderState(D3DRS_DESTBLEND,D3DBLEND_INVSRCALPHA);
104                         break;
105                 case DRAW_INV:
106                         mpD3DDevice->SetRenderState(D3DRS_SRCBLEND,D3DBLEND_INVSRCCOLOR);
107                         mpD3DDevice->SetRenderState(D3DRS_DESTBLEND,D3DBLEND_ZERO);
108                         break;
109                 case DRAW_MUL:
110                         mpD3DDevice->SetRenderState(D3DRS_SRCBLEND,D3DBLEND_ZERO);
111                         mpD3DDevice->SetRenderState(D3DRS_DESTBLEND,D3DBLEND_SRCCOLOR);
112                         break;
113                 }
114
115 }// setRenderState