tutorial 1 and 2
This commit is contained in:
@@ -21,7 +21,8 @@ class Renderer2D {
|
||||
~Renderer2D();
|
||||
|
||||
void init(RendererCore* rendererCore);
|
||||
void render(Sprite* sprite);
|
||||
void render(const Sprite* sprite);
|
||||
void render(const Sprite& sprite);
|
||||
|
||||
private:
|
||||
RendererCore* core;
|
||||
|
||||
@@ -23,7 +23,7 @@ class DynPipColorBag {
|
||||
~DynPipColorBag();
|
||||
|
||||
/** Mandatory */
|
||||
Color* single;
|
||||
const Color* single;
|
||||
};
|
||||
|
||||
} // namespace Tyra
|
||||
|
||||
@@ -45,7 +45,8 @@ class DynamicPipeline : public Renderer3DPipeline {
|
||||
* Render dynamic model.
|
||||
* This render() method is a bridge to core.render() method.
|
||||
*/
|
||||
void render(DynamicMesh* mesh, const DynPipOptions* options = nullptr);
|
||||
void render(const DynamicMesh& mesh, const DynPipOptions* options = nullptr);
|
||||
void render(const DynamicMesh* mesh, const DynPipOptions* options = nullptr);
|
||||
|
||||
private:
|
||||
RendererCore* rendererCore;
|
||||
@@ -57,29 +58,29 @@ class DynamicPipeline : public Renderer3DPipeline {
|
||||
|
||||
void sendRestOfBuffers(DynPipBag* buffers, u16* bufferIndex);
|
||||
|
||||
void addVertices(MeshMaterialFrame* materialFrameFrom,
|
||||
MeshMaterialFrame* materialFrameTo, DynPipBag* bag,
|
||||
void addVertices(const MeshMaterialFrame* materialFrameFrom,
|
||||
const MeshMaterialFrame* materialFrameTo, DynPipBag* bag,
|
||||
const u32& startIndex) const;
|
||||
|
||||
DynPipInfoBag* getInfoBag(DynamicMesh* mesh, const DynPipOptions* options,
|
||||
M4x4* model) const;
|
||||
DynPipInfoBag* getInfoBag(const DynamicMesh* mesh,
|
||||
const DynPipOptions* options, M4x4* model) const;
|
||||
|
||||
DynPipColorBag* getColorBag(MeshMaterial* material) const;
|
||||
DynPipColorBag* getColorBag(const MeshMaterial* material) const;
|
||||
|
||||
DynPipTextureBag* getTextureBag(Texture* texture,
|
||||
MeshMaterialFrame* materialFrameFrom,
|
||||
MeshMaterialFrame* materialFrameTo,
|
||||
const MeshMaterialFrame* materialFrameFrom,
|
||||
const MeshMaterialFrame* materialFrameTo,
|
||||
const u32& startIndex);
|
||||
|
||||
DynPipLightingBag* getLightingBag(MeshMaterialFrame* materialFrameFrom,
|
||||
MeshMaterialFrame* materialFrameTo,
|
||||
DynPipLightingBag* getLightingBag(const MeshMaterialFrame* materialFrameFrom,
|
||||
const MeshMaterialFrame* materialFrameTo,
|
||||
M4x4* model, const DynPipOptions* options,
|
||||
PipelineDirLightsBag* dirLightsBag,
|
||||
const u32& startIndex) const;
|
||||
|
||||
void setLightingColorsCache(PipelineLightingOptions* lightingOptions);
|
||||
void freeBuffer(DynPipBag* bag);
|
||||
void setBuffersDefaultVars(DynPipBag* buffers, DynamicMesh* mesh,
|
||||
void setBuffersDefaultVars(DynPipBag* buffers, const DynamicMesh* mesh,
|
||||
DynPipInfoBag* infoBag);
|
||||
void setBuffersColorBag(DynPipBag* buffers, DynPipColorBag* colorBag);
|
||||
};
|
||||
|
||||
@@ -22,10 +22,10 @@ class StaPipBagPackage {
|
||||
|
||||
StaPipBag* bag;
|
||||
|
||||
Vec4* vertices;
|
||||
Vec4* sts;
|
||||
Vec4* normals;
|
||||
Vec4* colors;
|
||||
const Vec4* vertices;
|
||||
const Vec4* sts;
|
||||
const Vec4* normals;
|
||||
const Vec4* colors;
|
||||
/** maxVertCount is max value, because we decided to put max maxVertCount
|
||||
* verts to single quad buffer in VU1 */
|
||||
u16 size;
|
||||
|
||||
@@ -23,10 +23,10 @@ class StaPipColorBag {
|
||||
~StaPipColorBag();
|
||||
|
||||
/** Optional. Single color for all vertices. */
|
||||
Color* single;
|
||||
const Color* single;
|
||||
|
||||
/** Optional. Color per vertex. */
|
||||
Color* many;
|
||||
const Color* many;
|
||||
};
|
||||
|
||||
} // namespace Tyra
|
||||
|
||||
@@ -45,28 +45,30 @@ class StaticPipeline : public Renderer3DPipeline {
|
||||
* Render static model
|
||||
* This render() method is a bridge to core.render() method.
|
||||
*/
|
||||
void render(StaticMesh* mesh, const StaPipOptions* options = nullptr);
|
||||
void render(const StaticMesh& mesh, const StaPipOptions* options = nullptr);
|
||||
void render(const StaticMesh* mesh, const StaPipOptions* options = nullptr);
|
||||
|
||||
private:
|
||||
RendererCore* rendererCore;
|
||||
Vec4* colorsCache;
|
||||
|
||||
void addVertices(MeshMaterialFrame* materialFrame, StaPipBag* bag) const;
|
||||
void addVertices(const MeshMaterialFrame* materialFrame,
|
||||
StaPipBag* bag) const;
|
||||
|
||||
StaPipInfoBag* getInfoBag(StaticMesh* mesh, const StaPipOptions* options,
|
||||
M4x4* model) const;
|
||||
StaPipInfoBag* getInfoBag(const StaticMesh* mesh,
|
||||
const StaPipOptions* options, M4x4* model) const;
|
||||
|
||||
StaPipColorBag* getColorBag(MeshMaterial* material,
|
||||
MeshMaterialFrame* materialFrame) const;
|
||||
StaPipColorBag* getColorBag(const MeshMaterial* material,
|
||||
const MeshMaterialFrame* materialFrame) const;
|
||||
|
||||
StaPipTextureBag* getTextureBag(MeshMaterial* material,
|
||||
MeshMaterialFrame* materialFrame);
|
||||
StaPipTextureBag* getTextureBag(const MeshMaterial* material,
|
||||
const MeshMaterialFrame* materialFrame);
|
||||
|
||||
StaPipLightingBag* getLightingBag(MeshMaterialFrame* materialFrame,
|
||||
StaPipLightingBag* getLightingBag(const MeshMaterialFrame* materialFrame,
|
||||
M4x4* model,
|
||||
const StaPipOptions* options) const;
|
||||
|
||||
void deallocDrawBags(StaPipBag* bag, MeshMaterial* material) const;
|
||||
void deallocDrawBags(StaPipBag* bag, const MeshMaterial* material) const;
|
||||
|
||||
void setLightingColorsCache(PipelineLightingOptions* lightingOptions);
|
||||
};
|
||||
|
||||
@@ -27,8 +27,8 @@ class RendererCore2D {
|
||||
|
||||
void init(RendererSettings* settings, clutbuffer_t* clutBuffer);
|
||||
|
||||
void render(Sprite* sprite, const RendererCoreTextureBuffers& texBuffers,
|
||||
Texture* texture);
|
||||
void render(const Sprite& sprite,
|
||||
const RendererCoreTextureBuffers& texBuffers, Texture* texture);
|
||||
|
||||
private:
|
||||
void setPrim();
|
||||
|
||||
@@ -108,6 +108,8 @@ class TextureRepository {
|
||||
* Texture IS destructed.
|
||||
*/
|
||||
void free(const u32& t_texId);
|
||||
void free(const Texture* t_tex);
|
||||
void free(const Texture& t_tex);
|
||||
|
||||
private:
|
||||
std::vector<Texture*> textures;
|
||||
|
||||
Reference in New Issue
Block a user