Revert "Project modernization (#630)"
This code was not tested and breaks in Release builds, reverting to restore
functionality of the nightly. All in-game menus do not work and generating
a world crashes.
This reverts commit a9be52c41a.
This commit is contained in:
@@ -26,7 +26,7 @@ StitchedTexture *StitchedTexture::create(const wstring &name)
|
||||
StitchedTexture::StitchedTexture(const wstring &name, const wstring &filename) : name(name)
|
||||
{
|
||||
// 4J Initialisers
|
||||
source = nullptr;
|
||||
source = NULL;
|
||||
rotated = false;
|
||||
x = 0;
|
||||
y = 0;
|
||||
@@ -40,9 +40,9 @@ StitchedTexture::StitchedTexture(const wstring &name, const wstring &filename) :
|
||||
heightTranslation = 0.0f;
|
||||
frame = 0;
|
||||
subFrame = 0;
|
||||
frameOverride = nullptr;
|
||||
frameOverride = NULL;
|
||||
flags = 0;
|
||||
frames = nullptr;
|
||||
frames = NULL;
|
||||
m_fileName = filename;
|
||||
}
|
||||
|
||||
@@ -94,10 +94,10 @@ void StitchedTexture::init(Texture *source, vector<Texture *> *frames, int x, in
|
||||
float marginX = 0.0f; //0.01f / source->getWidth();
|
||||
float marginY = 0.0f; //0.01f / source->getHeight();
|
||||
|
||||
this->u0 = x / static_cast<float>(source->getWidth()) + marginX;
|
||||
this->u1 = (x + width) / static_cast<float>(source->getWidth()) - marginX;
|
||||
this->v0 = y / static_cast<float>(source->getHeight()) + marginY;
|
||||
this->v1 = (y + height) / static_cast<float>(source->getHeight()) - marginY;
|
||||
this->u0 = x / (float) source->getWidth() + marginX;
|
||||
this->u1 = (x + width) / (float) source->getWidth() - marginX;
|
||||
this->v0 = y / (float) source->getHeight() + marginY;
|
||||
this->v1 = (y + height) / (float) source->getHeight() - marginY;
|
||||
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
bool addBreakpoint = false;
|
||||
@@ -112,8 +112,8 @@ void StitchedTexture::init(Texture *source, vector<Texture *> *frames, int x, in
|
||||
}
|
||||
#endif
|
||||
|
||||
this->widthTranslation = width / static_cast<float>(SharedConstants::WORLD_RESOLUTION);
|
||||
this->heightTranslation = height / static_cast<float>(SharedConstants::WORLD_RESOLUTION);
|
||||
this->widthTranslation = width / (float) SharedConstants::WORLD_RESOLUTION;
|
||||
this->heightTranslation = height / (float) SharedConstants::WORLD_RESOLUTION;
|
||||
}
|
||||
|
||||
void StitchedTexture::replaceWith(StitchedTexture *texture)
|
||||
@@ -156,7 +156,7 @@ float StitchedTexture::getU1(bool adjust/*=false*/) const
|
||||
float StitchedTexture::getU(double offset, bool adjust/*=false*/) const
|
||||
{
|
||||
float diff = getU1(adjust) - getU0(adjust);
|
||||
return getU0(adjust) + (diff * (static_cast<float>(offset) / SharedConstants::WORLD_RESOLUTION));
|
||||
return getU0(adjust) + (diff * ((float) offset / SharedConstants::WORLD_RESOLUTION));
|
||||
}
|
||||
|
||||
float StitchedTexture::getV0(bool adjust/*=false*/) const
|
||||
@@ -172,7 +172,7 @@ float StitchedTexture::getV1(bool adjust/*=false*/) const
|
||||
float StitchedTexture::getV(double offset, bool adjust/*=false*/) const
|
||||
{
|
||||
float diff = getV1(adjust) - getV0(adjust);
|
||||
return getV0(adjust) + (diff * (static_cast<float>(offset) / SharedConstants::WORLD_RESOLUTION));
|
||||
return getV0(adjust) + (diff * ((float) offset / SharedConstants::WORLD_RESOLUTION));
|
||||
}
|
||||
|
||||
wstring StitchedTexture::getName() const
|
||||
@@ -192,7 +192,7 @@ int StitchedTexture::getSourceHeight() const
|
||||
|
||||
void StitchedTexture::cycleFrames()
|
||||
{
|
||||
if (frameOverride != nullptr)
|
||||
if (frameOverride != NULL)
|
||||
{
|
||||
pair<int, int> current = frameOverride->at(frame);
|
||||
subFrame++;
|
||||
@@ -250,10 +250,10 @@ int StitchedTexture::getFrames()
|
||||
*/
|
||||
void StitchedTexture::loadAnimationFrames(BufferedReader *bufferedReader)
|
||||
{
|
||||
if(frameOverride != nullptr)
|
||||
if(frameOverride != NULL)
|
||||
{
|
||||
delete frameOverride;
|
||||
frameOverride = nullptr;
|
||||
frameOverride = NULL;
|
||||
}
|
||||
frame = 0;
|
||||
subFrame = 0;
|
||||
@@ -303,10 +303,10 @@ void StitchedTexture::loadAnimationFrames(BufferedReader *bufferedReader)
|
||||
|
||||
void StitchedTexture::loadAnimationFrames(const wstring &string)
|
||||
{
|
||||
if(frameOverride != nullptr)
|
||||
if(frameOverride != NULL)
|
||||
{
|
||||
delete frameOverride;
|
||||
frameOverride = nullptr;
|
||||
frameOverride = NULL;
|
||||
}
|
||||
frame = 0;
|
||||
subFrame = 0;
|
||||
|
||||
Reference in New Issue
Block a user