the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
at main 205 lines 9.1 kB view raw
1#pragma once 2 3#include <stddef.h> 4//#include <string> 5#include "Tile_SPU.h" 6#include "Icon_SPU.h" 7#include "ChunkRebuildData.h" 8 9class Level; 10class LevelSource; 11class Tile_SPU; 12class RailTile_SPU; 13class Material; 14class TileEntity; 15class ThinFenceTile; 16class FenceTile_SPU; 17class FenceGateTile_SPU; 18class BrewingStandTile_SPU; 19class CauldronTile_SPU; 20class EggTile_SPU; 21class TheEndPortalFrameTile; 22class DiodeTile_SPU; 23class FireTile_SPU; 24class StemTile_SPU; 25class WaterlilyTile_SPU; 26class StairTile_SPU; 27class CocoaTile_SPU; 28class AnvilTile_SPU; 29class FlowerPotTile_SPU; 30class WallTile_SPU; 31 32class Icon; 33class Minecraft; 34 35class TileRenderer_SPU 36{ 37 friend class FallingTileRenderer_SPU; 38 private: 39 ChunkRebuildData* level; 40 Icon_SPU *fixedTexture; 41 bool xFlipTexture; 42 bool noCulling; 43 public : 44 static bool fancy; 45 bool setColor; 46 47 float tileShapeX0; 48 float tileShapeX1; 49 float tileShapeY0; 50 float tileShapeY1; 51 float tileShapeZ0; 52 float tileShapeZ1; 53 bool fixedShape; 54 bool smoothShapeLighting; 55// Minecraft *minecraft; 56 57 void _init(); 58 59public: 60 TileRenderer_SPU( ChunkRebuildData* level ); 61 TileRenderer_SPU(); 62 Tesselator_SPU* getTesselator(); 63 64 bool hasRenderer(Tile_SPU* tt); 65 void setFixedTexture( Icon_SPU *fixedTexture ); 66 void clearFixedTexture(); 67 bool hasFixedTexture(); 68 void setShape(float x0, float y0, float z0, float x1, float y1, float z1); 69 void setShape(Tile_SPU *tt); 70 void setFixedShape(float x0, float y0, float z0, float x1, float y1, float z1); 71 void clearFixedShape(); 72 73 void tesselateInWorldFixedTexture( Tile_SPU* tile, int x, int y, int z, Icon_SPU *fixedTexture ); // 4J renamed to differentiate from tesselateInWorld 74 void tesselateInWorldNoCulling( Tile_SPU* tile, int x, int y, int z, int forceData = -1, 75 TileEntity* forceEntity = NULL ); // 4J added forceData, forceEntity param 76 bool tesselateInWorld( Tile_SPU* tt, int x, int y, int z, int forceData = -1, TileEntity* forceEntity = NULL ); // 4J added forceData, forceEntity param 77 78 private: 79 bool tesselateAirPortalFrameInWorld(TheEndPortalFrameTile *tt, int x, int y, int z); 80 bool tesselateBedInWorld( Tile_SPU* tt, int x, int y, int z ); 81 bool tesselateBrewingStandInWorld(BrewingStandTile_SPU *tt, int x, int y, int z); 82 bool tesselateCauldronInWorld(CauldronTile_SPU *tt, int x, int y, int z); 83 bool tesselateFlowerPotInWorld(FlowerPotTile_SPU *tt, int x, int y, int z); 84 bool tesselateAnvilInWorld(AnvilTile_SPU *tt, int x, int y, int z); 85 86public: 87 bool tesselateAnvilInWorld(AnvilTile_SPU *tt, int x, int y, int z, int data); 88 89private: 90 bool tesselateAnvilInWorld(AnvilTile_SPU *tt, int x, int y, int z, int data, bool render); 91 float tesselateAnvilPiece(AnvilTile_SPU *tt, int x, int y, int z, int part, float bottom, float width, float height, float length, bool rotate, bool render, int data); 92 93 94 public: 95 bool tesselateTorchInWorld( Tile_SPU* tt, int x, int y, int z ); 96 private: 97 bool tesselateDiodeInWorld(DiodeTile_SPU *tt, int x, int y, int z); 98 void tesselateDiodeInWorld( DiodeTile_SPU* tt, int x, int y, int z, int dir ); 99 static const int FLIP_NONE = 0, FLIP_CW = 1, FLIP_CCW = 2, FLIP_180 = 3; 100 101 int northFlip; 102 int southFlip; 103 int eastFlip; 104 int westFlip; 105 int upFlip; 106 int downFlip; 107 public: 108 void tesselatePistonBaseForceExtended( Tile_SPU* tile, int x, int y, int z, int forceData = -1 ); // 4J added data param 109 private: 110 bool tesselatePistonBaseInWorld( Tile_SPU* tt, int x, int y, int z, bool forceExtended, int forceData = -1 ); // 4J added data param 111 void renderPistonArmUpDown( float x0, float x1, float y0, float y1, float z0, float z1, float br, float armLengthPixels ); 112 void renderPistonArmNorthSouth( float x0, float x1, float y0, float y1, float z0, float z1, float br, float armLengthPixels ); 113 void renderPistonArmEastWest( float x0, float x1, float y0, float y1, float z0, float z1, float br, float armLengthPixels ); 114 public: 115 void tesselatePistonArmNoCulling( Tile_SPU* tile, int x, int y, int z, bool fullArm, int forceData = -1 ); // 4J added data param 116 private: 117 bool tesselatePistonExtensionInWorld( Tile_SPU* tt, int x, int y, int z, bool fullArm, int forceData = -1 ); // 4J added data param 118 public: 119 bool tesselateLeverInWorld( Tile_SPU* tt, int x, int y, int z ); 120 bool tesselateTripwireSourceInWorld(Tile_SPU *tt, int x, int y, int z); 121 bool tesselateTripwireInWorld(Tile_SPU *tt, int x, int y, int z); 122 bool tesselateFireInWorld( FireTile_SPU* tt, int x, int y, int z ); 123 bool tesselateDustInWorld( Tile_SPU* tt, int x, int y, int z ); 124 bool tesselateRailInWorld( RailTile_SPU* tt, int x, int y, int z ); 125 bool tesselateLadderInWorld( Tile_SPU* tt, int x, int y, int z ); 126 bool tesselateVineInWorld( Tile_SPU* tt, int x, int y, int z ); 127 bool tesselateThinFenceInWorld( ThinFenceTile* tt, int x, int y, int z ); 128 bool tesselateCrossInWorld( Tile_SPU* tt, int x, int y, int z ); 129 bool tesselateStemInWorld( Tile_SPU* _tt, int x, int y, int z ); 130 bool tesselateRowInWorld( Tile_SPU* tt, int x, int y, int z ); 131 void tesselateTorch( Tile_SPU* tt, float x, float y, float z, float xxa, float zza, int data ); 132 void tesselateCrossTexture( Tile_SPU* tt, int data, float x, float y, float z, float scale ); 133 void tesselateStemTexture( Tile_SPU* tt, int data, float h, float x, float y, float z ); 134 bool tesselateLilypadInWorld(WaterlilyTile_SPU *tt, int x, int y, int z); 135 void tesselateStemDirTexture( StemTile_SPU* tt, int data, int dir, float h, float x, float y, float z ); 136 137 void tesselateRowTexture( Tile_SPU* tt, int data, float x, float y, float z ); 138 bool tesselateWaterInWorld( Tile_SPU* tt, int x, int y, int z ); 139 private: 140 float getWaterHeight( int x, int y, int z, Material_SPU* m ); 141 public: 142 void renderBlock( Tile_SPU* tt, ChunkRebuildData* level, int x, int y, int z ); 143 void renderBlock(Tile_SPU *tt, ChunkRebuildData *level, int x, int y, int z, int data); 144 bool tesselateBlockInWorld( Tile_SPU* tt, int x, int y, int z ); 145 bool tesselateTreeInWorld(Tile_SPU *tt, int x, int y, int z); 146 bool tesselateQuartzInWorld(Tile_SPU *tt, int x, int y, int z); 147 bool tesselateCocoaInWorld(CocoaTile_SPU *tt, int x, int y, int z); 148 149 private: 150 bool applyAmbienceOcclusion; 151 float ll000, llx00, ll0y0, ll00z, llX00, ll0Y0, ll00Z; 152 float llxyz, llxy0, llxyZ, ll0yz, ll0yZ, llXyz, llXy0; 153 float llXyZ, llxYz, llxY0, llxYZ, ll0Yz, llXYz, llXY0; 154 float ll0YZ, llXYZ, llx0z, llX0z, llx0Z, llX0Z; 155 // 4J - brought forward changes from 1.8.2 156 int ccx00, cc00z, cc0Y0, cc00Z; 157 int ccxyz, ccxy0, ccxyZ, cc0yz, cc0yZ, ccXyz, ccXy0; 158 int ccXyZ, ccxYz, ccxY0, ccxYZ, cc0Yz, ccXYz, ccXY0; 159 int cc0YZ, ccXYZ, ccx0z, ccX0z, ccx0Z, ccX0Z; 160 int blsmooth; 161 int tc1, tc2, tc3, tc4; // 4J - brought forward changes from 1.8.2 162 float c1r, c2r, c3r, c4r; 163 float c1g, c2g, c3g, c4g; 164 float c1b, c2b, c3b, c4b; 165 bool llTrans0Yz, llTransXY0, llTransxY0, llTrans0YZ; 166 bool llTransx0z, llTransX0Z, llTransx0Z, llTransX0z; 167 bool llTrans0yz, llTransXy0, llTransxy0, llTrans0yZ; 168 169 public: 170 // 4J - brought forward changes from 1.8.2 171 bool tesselateBlockInWorldWithAmbienceOcclusionTexLighting( Tile_SPU* tt, int pX, int pY, int pZ, float pBaseRed, 172 float pBaseGreen, float pBaseBlue ); 173 bool tesselateBlockInWorldWithAmbienceOcclusionOldLighting( Tile_SPU* tt, int pX, int pY, int pZ, float pBaseRed, 174 float pBaseGreen, float pBaseBlue ); 175 private: 176 int blend( int a, int b, int c, int def ); 177 int blend(int a, int b, int c, int d, float fa, float fb, float fc, float fd); 178 public: 179 bool tesselateBlockInWorld( Tile_SPU* tt, int x, int y, int z, float r, float g, float b ); 180 bool tesselateCactusInWorld( Tile_SPU* tt, int x, int y, int z ); 181 bool tesselateCactusInWorld( Tile_SPU* tt, int x, int y, int z, float r, float g, float b ); 182 bool tesselateFenceInWorld( FenceTile_SPU* tt, int x, int y, int z ); 183 bool tesselateWallInWorld(WallTile_SPU *tt, int x, int y, int z); 184 bool tesselateEggInWorld(EggTile_SPU *tt, int x, int y, int z); 185 bool tesselateFenceGateInWorld(FenceGateTile_SPU *tt, int x, int y, int z); 186 bool tesselateStairsInWorld( StairTile_SPU* tt, int x, int y, int z ); 187 bool tesselateDoorInWorld( Tile_SPU* tt, int x, int y, int z ); 188 void renderFaceUp( Tile_SPU* tt, float x, float y, float z, Icon_SPU *tex ); 189 void renderFaceDown( Tile_SPU* tt, float x, float y, float z, Icon_SPU *tex ); 190 void renderNorth( Tile_SPU* tt, float x, float y, float z, Icon_SPU *tex ); 191 void renderSouth( Tile_SPU* tt, float x, float y, float z, Icon_SPU *tex ); 192 void renderWest( Tile_SPU* tt, float x, float y, float z, Icon_SPU *tex ); 193 void renderEast( Tile_SPU* tt, float x, float y, float z, Icon_SPU *tex ); 194// void renderCube( Tile_SPU* tile, float alpha ); 195// void renderTile( Tile_SPU* tile, int data, float brightness, float fAlpha = 1.0f ); 196 static bool canRender( int renderShape ); 197 Icon_SPU *getTexture(Tile_SPU *tile, ChunkRebuildData *level, int x, int y, int z, int face); 198 199 Icon_SPU *getTexture(Tile_SPU *tile, int face, int data); 200 Icon_SPU *getTexture(Tile_SPU *tile, int face); 201 Icon_SPU *getTexture(Tile_SPU *tile); 202 Icon_SPU *getTextureOrMissing(Icon_SPU *icon); 203 204 bool isAnaglyph3d() { return false; } //GameRenderer::anaglyph3d 205};