Compare commits
No commits in common. "texture" and "master" have entirely different histories.
@ -10,8 +10,6 @@ static bool init = false;
|
|||||||
static unsigned int width;
|
static unsigned int width;
|
||||||
static unsigned int height;
|
static unsigned int height;
|
||||||
|
|
||||||
static sf::Image image;
|
|
||||||
|
|
||||||
int firstperson_init(unsigned int _width, unsigned int _height)
|
int firstperson_init(unsigned int _width, unsigned int _height)
|
||||||
{
|
{
|
||||||
printf("firstperson_init()\n");
|
printf("firstperson_init()\n");
|
||||||
@ -19,9 +17,6 @@ int firstperson_init(unsigned int _width, unsigned int _height)
|
|||||||
width = _width;
|
width = _width;
|
||||||
height = _height;
|
height = _height;
|
||||||
init = true;
|
init = true;
|
||||||
|
|
||||||
if (!image.loadFromFile("xd.bmp")) return 0;
|
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -75,17 +70,11 @@ void firstperson_update(sf::RenderTarget* renderTarget, Camera* camera)
|
|||||||
renderTexture.draw(rectangle);
|
renderTexture.draw(rectangle);
|
||||||
}
|
}
|
||||||
|
|
||||||
sf::Texture imageTexture;
|
|
||||||
sf::Sprite imageSprite;
|
|
||||||
imageTexture.loadFromImage(image);
|
|
||||||
imageSprite.setTexture(imageTexture);
|
|
||||||
renderTexture.draw(imageSprite);
|
|
||||||
|
|
||||||
renderTexture.display();
|
renderTexture.display();
|
||||||
sf::Sprite sprite(renderTexture.getTexture());
|
sf::Sprite sprite(renderTexture.getTexture());
|
||||||
sprite.setPosition(renderTexturePosition);
|
sprite.setPosition(renderTexturePosition);
|
||||||
|
|
||||||
renderTarget->draw(sprite);
|
renderTarget->draw(sprite);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void firstperson_setTexturePosition(float x, float y)
|
void firstperson_setTexturePosition(float x, float y)
|
||||||
|
@ -130,7 +130,6 @@ static float castRay(sf::Vector2f point, float direction, TileData* tileData)
|
|||||||
if (gridValue) {
|
if (gridValue) {
|
||||||
tileData->value = gridValue;
|
tileData->value = gridValue;
|
||||||
tileData->side = goingDown? NORTH : SOUTH;
|
tileData->side = goingDown? NORTH : SOUTH;
|
||||||
tileData->horizontalUV = 0.f;
|
|
||||||
return horizontalRayDist;
|
return horizontalRayDist;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -144,7 +143,6 @@ static float castRay(sf::Vector2f point, float direction, TileData* tileData)
|
|||||||
if (gridValue) {
|
if (gridValue) {
|
||||||
tileData->value = gridValue;
|
tileData->value = gridValue;
|
||||||
tileData->side = goingRight? WEST : EAST;
|
tileData->side = goingRight? WEST : EAST;
|
||||||
tileData->horizontalUV = 0.f;
|
|
||||||
return verticalRayDist;
|
return verticalRayDist;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
1
level.h
1
level.h
@ -15,7 +15,6 @@ typedef struct
|
|||||||
{
|
{
|
||||||
unsigned int value;
|
unsigned int value;
|
||||||
level_tileSide side;
|
level_tileSide side;
|
||||||
float horizontalUV;
|
|
||||||
} TileData;
|
} TileData;
|
||||||
|
|
||||||
int level_init();
|
int level_init();
|
||||||
|
Loading…
Reference in New Issue
Block a user