質問編集履歴
2
ソースコード提示
test
CHANGED
File without changes
|
test
CHANGED
@@ -11,3 +11,79 @@
|
|
11
11
|
|
12
12
|
|
13
13
|
![](02613e010e4ee2834af095a81b5f876a.png)
|
14
|
+
|
15
|
+
|
16
|
+
|
17
|
+
```C++
|
18
|
+
|
19
|
+
//SakuraLogGraphics.cpp
|
20
|
+
|
21
|
+
#include "SakuraLogGraphics.h"
|
22
|
+
|
23
|
+
|
24
|
+
|
25
|
+
SakuraLogGraphics::SakuraLogGraphics(const std::string& par1) : BlockGraphics(par1) {
|
26
|
+
|
27
|
+
setSoundType(BlockSoundType::WOOD);
|
28
|
+
|
29
|
+
|
30
|
+
|
31
|
+
topsakuralog = getTextureUVCoordinateSet("sakuralog_t", 0);
|
32
|
+
|
33
|
+
sidesakuralog = getTextureUVCoordinateSet("sakuralog_s", 0);
|
34
|
+
|
35
|
+
}
|
36
|
+
|
37
|
+
|
38
|
+
|
39
|
+
const TextureUVCoordinateSet& SakuraLogGraphics::getTexture(signed char side, int data) const
|
40
|
+
|
41
|
+
{
|
42
|
+
|
43
|
+
return side == 0?(data != 0 && data != 1?sidesakuralog:topsakuralog):(data == 4?(side != 4 && side != 5?sidesakuralog:topsakuralog):(side != 2 && data != 3?sidesakuralog:topsakuralog));
|
44
|
+
|
45
|
+
```
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
```C++
|
50
|
+
|
51
|
+
//SakuraLogGraphics.h
|
52
|
+
|
53
|
+
#pragma once
|
54
|
+
|
55
|
+
|
56
|
+
|
57
|
+
#include <string>
|
58
|
+
|
59
|
+
|
60
|
+
|
61
|
+
#include "mcpe/block/BlockGraphics.h"
|
62
|
+
|
63
|
+
#include "mcpe/client/renderer/texture/TextureUVCoordinateSet.h"
|
64
|
+
|
65
|
+
|
66
|
+
|
67
|
+
class SakuraLogGraphics : public BlockGraphics
|
68
|
+
|
69
|
+
{
|
70
|
+
|
71
|
+
public:
|
72
|
+
|
73
|
+
SakuraLogGraphics(const std::string&);
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
const TextureUVCoordinateSet& getTexture(signed char, int) const;
|
78
|
+
|
79
|
+
private:
|
80
|
+
|
81
|
+
TextureUVCoordinateSet topsakuralog;
|
82
|
+
|
83
|
+
TextureUVCoordinateSet sidesakuralog;
|
84
|
+
|
85
|
+
};
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
```
|
1
語彙力の足りなさ
test
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
関数の中でBlockGraphics::mBlocks[sakuralogblock]にBlockGraphicsのgetTextureを渡して色々したいです
|
test
CHANGED
@@ -2,4 +2,12 @@
|
|
2
2
|
|
3
3
|
|
4
4
|
|
5
|
+
###追記
|
6
|
+
|
7
|
+
BlockGraphics::initBlocksという関数の中で、BlockGraphics::mBlocks[sakuralogblock]にBlockGraphicsのgetTextureを渡して引数の中のものを色々と返したいいのですが、初心者なのでどうすればいいのかわかりません・・・。
|
8
|
+
|
9
|
+
わからないことがあればコメントお願いいたします。
|
10
|
+
|
11
|
+
|
12
|
+
|
5
13
|
![](02613e010e4ee2834af095a81b5f876a.png)
|