Commit 26a52ce9 authored by fallenstardust's avatar fallenstardust

replace using namespace in config.h

parent bf35e600
......@@ -52,8 +52,8 @@ void Draw2DImageRotation(video::IVideoDriver* driver, video::ITexture* image, co
material.TextureLayer[0].Texture = image;
#if defined(_IRR_ANDROID_PLATFORM_)
if (!ygo::mainGame->isNPOTSupported) {
material.TextureLayer[0].TextureWrapU = ETC_CLAMP_TO_EDGE;
material.TextureLayer[0].TextureWrapV = ETC_CLAMP_TO_EDGE;
material.TextureLayer[0].TextureWrapU = irr::video::ETC_CLAMP_TO_EDGE;
material.TextureLayer[0].TextureWrapV = irr::video::ETC_CLAMP_TO_EDGE;
}
if (useAlphaChannel)
material.MaterialType = (video::E_MATERIAL_TYPE)ygo::mainGame->ogles2TrasparentAlpha;
......@@ -102,8 +102,8 @@ void Draw2DImageQuad(video::IVideoDriver* driver, video::ITexture* image, core::
material.TextureLayer[0].Texture = image;
#if defined(_IRR_ANDROID_PLATFORM_)
if (!ygo::mainGame->isNPOTSupported) {
material.TextureLayer[0].TextureWrapU = ETC_CLAMP_TO_EDGE;
material.TextureLayer[0].TextureWrapV = ETC_CLAMP_TO_EDGE;
material.TextureLayer[0].TextureWrapU = irr::video::ETC_CLAMP_TO_EDGE;
material.TextureLayer[0].TextureWrapV = irr::video::ETC_CLAMP_TO_EDGE;
}
if (useAlphaChannel)
material.MaterialType = (video::E_MATERIAL_TYPE)ygo::mainGame->ogles2TrasparentAlpha;
......@@ -136,8 +136,8 @@ void CGUIImageButton::draw() {
return;
IGUISkin* skin = Environment->getSkin();
video::IVideoDriver* driver = Environment->getVideoDriver();
core::vector2di center = AbsoluteRect.getCenter();
core::vector2di pos = center;
irr::core::vector2di center = AbsoluteRect.getCenter();
irr::core::vector2di pos = center;
pos.X -= (s32)(ImageRect.getWidth() * imageScale.X * 0.5f);
pos.Y -= (s32)(ImageRect.getHeight() * imageScale.Y * 0.5f);
if(Pressed) {
......
......@@ -561,7 +561,7 @@ void CGUITTFont::drawUstring(const core::ustring& utext, const core::rect<s32>&p
// Determine rendering information.
SGUITTGlyph& glyph = Glyphs[n - 1];
CGUITTGlyphPage* const page = Glyph_Pages[glyph.glyph_page];
page->render_positions.push_back(core::vector2di(offset.X + offx, offset.Y + offy));
page->render_positions.push_back(irr::core::vector2di(offset.X + offx, offset.Y + offy));
page->render_source_rects.push_back(glyph.source_rect);
Render_Map.set(glyph.glyph_page, page);
}
......@@ -832,7 +832,7 @@ video::IImage* CGUITTFont::createTextureFromChar(const uchar32_t& ch) {
// Copy the image data out of the page texture.
core::dimension2du glyph_size(glyph.source_rect.getSize());
video::IImage* image = Driver->createImage(format, glyph_size);
pageholder->copyTo(image, core::vector2di(0, 0), glyph.source_rect);
pageholder->copyTo(image, irr::core::vector2di(0, 0), glyph.source_rect);
tex->unlock();
return image;
......@@ -854,17 +854,14 @@ void CGUITTFont::createSharedPlane() {
0---1
*/
using namespace core;
using namespace video;
using namespace scene;
S3DVertex vertices[4];
video::S3DVertex vertices[4];
u16 indices[6] = {0, 2, 3, 3, 1, 0};
vertices[0] = S3DVertex(vector3df(0, -1, 0), vector3df(0, 0, -1), SColor(255, 255, 255, 255), vector2df(0, 1));
vertices[1] = S3DVertex(vector3df(1, -1, 0), vector3df(0, 0, -1), SColor(255, 255, 255, 255), vector2df(1, 1));
vertices[2] = S3DVertex(vector3df(0, 0, 0), vector3df(0, 0, -1), SColor(255, 255, 255, 255), vector2df(0, 0));
vertices[3] = S3DVertex(vector3df(1, 0, 0), vector3df(0, 0, -1), SColor(255, 255, 255, 255), vector2df(1, 0));
vertices[0] = video::S3DVertex(core::vector3df(0, -1, 0), core::vector3df(0, 0, -1), video::SColor(255, 255, 255, 255), core::vector2df(0, 1));
vertices[1] = video::S3DVertex(core::vector3df(1, -1, 0), core::vector3df(0, 0, -1), video::SColor(255, 255, 255, 255), core::vector2df(1, 1));
vertices[2] = video::S3DVertex(core::vector3df(0, 0, 0), core::vector3df(0, 0, -1), video::SColor(255, 255, 255, 255), core::vector2df(0, 0));
vertices[3] = video::S3DVertex(core::vector3df(1, 0, 0), core::vector3df(0, 0, -1), video::SColor(255, 255, 255, 255), core::vector2df(1, 0));
SMeshBuffer* buf = new SMeshBuffer();
scene::SMeshBuffer* buf = new scene::SMeshBuffer();
buf->append(vertices, 4, indices, 6);
shared_plane_.addMeshBuffer( buf );
......@@ -882,11 +879,7 @@ core::dimension2d<u32> CGUITTFont::getDimensionUntilEndOfLine(const wchar_t* p)
}
core::array<scene::ISceneNode*> CGUITTFont::addTextSceneNode(const wchar_t* text, scene::ISceneManager* smgr, scene::ISceneNode* parent, const video::SColor& color, bool center) {
using namespace core;
using namespace video;
using namespace scene;
array<scene::ISceneNode*> container;
core::array<scene::ISceneNode*> container;
if (!Driver || !smgr) return container;
if (!parent)
......@@ -897,8 +890,8 @@ core::array<scene::ISceneNode*> CGUITTFont::addTextSceneNode(const wchar_t* text
if (!shared_plane_ptr_) //this points to a static mesh that contains the plane
createSharedPlane(); //if it's not initialized, we create one.
dimension2d<s32> text_size(getDimension(text)); //convert from unsigned to signed.
vector3df start_point(0, 0, 0), offset;
core::dimension2d<s32> text_size(getDimension(text)); //convert from unsigned to signed.
core::vector3df start_point(0, 0, 0), offset;
/** NOTICE:
Because we are considering adding texts into 3D world, all Y axis vectors are inverted.
......@@ -912,7 +905,7 @@ core::array<scene::ISceneNode*> CGUITTFont::addTextSceneNode(const wchar_t* text
}
// the default font material
SMaterial mat;
video::SMaterial mat;
mat.setFlag(video::EMF_LIGHTING, true);
mat.setFlag(video::EMF_ZWRITE_ENABLE, false);
mat.setFlag(video::EMF_NORMALIZE_NORMALS, true);
......@@ -924,7 +917,7 @@ core::array<scene::ISceneNode*> CGUITTFont::addTextSceneNode(const wchar_t* text
wchar_t current_char = 0, previous_char = 0;
u32 n = 0;
array<u32> glyph_indices;
core::array<u32> glyph_indices;
while (*text) {
current_char = *text;
......@@ -957,23 +950,23 @@ core::array<scene::ISceneNode*> CGUITTFont::addTextSceneNode(const wchar_t* text
s32 offy = (font_metrics.ascender / 64) - glyph.offset.Y;
// Apply kerning.
vector2di k = getKerning(current_char, previous_char);
core::vector2di k = getKerning(current_char, previous_char);
offset.X += k.X;
offset.Y += k.Y;
vector3df current_pos(offset.X + offx, offset.Y - offy, 0);
dimension2d<u32> letter_size = dimension2d<u32>(texw, texh);
core::vector3df current_pos(offset.X + offx, offset.Y - offy, 0);
core::dimension2d<u32> letter_size = core::dimension2d<u32>(texw, texh);
// Now we copy planes corresponding to the letter size.
IMeshManipulator* mani = smgr->getMeshManipulator();
IMesh* meshcopy = mani->createMeshCopy(shared_plane_ptr_);
mani->scale(meshcopy, vector3df((f32)letter_size.Width, (f32)letter_size.Height, 1));
scene::IMeshManipulator* mani = smgr->getMeshManipulator();
scene::IMesh* meshcopy = mani->createMeshCopy(shared_plane_ptr_);
mani->scale(meshcopy, core::vector3df((f32)letter_size.Width, (f32)letter_size.Height, 1));
ISceneNode* current_node = smgr->addMeshSceneNode(meshcopy, parent, -1, current_pos);
scene::ISceneNode* current_node = smgr->addMeshSceneNode(meshcopy, parent, -1, current_pos);
meshcopy->drop();
current_node->getMaterial(0) = mat;
current_node->setAutomaticCulling(EAC_OFF);
current_node->setAutomaticCulling(scene::EAC_OFF);
current_node->setIsDebugObject(true); //so the picking won't have any effect on individual letter
//current_node->setDebugDataVisible(EDS_BBOX); //de-comment this when debugging
......@@ -991,7 +984,7 @@ core::array<scene::ISceneNode*> CGUITTFont::addTextSceneNode(const wchar_t* text
for (u32 i = 0; i < glyph_indices.size(); ++i) {
u32 n = glyph_indices[i];
SGUITTGlyph const& glyph = Glyphs[n - 1];
ITexture* current_tex = Glyph_Pages[glyph.glyph_page]->texture;
video::ITexture* current_tex = Glyph_Pages[glyph.glyph_page]->texture;
f32 page_texture_size = (f32)current_tex->getSize().Width;
//Now we calculate the UV position according to the texture size and the source rect.
//
......@@ -1007,15 +1000,15 @@ core::array<scene::ISceneNode*> CGUITTFont::addTextSceneNode(const wchar_t* text
f32 v2 = v1 + (glyph.source_rect.getHeight() / page_texture_size);
//we can be quite sure that this is IMeshSceneNode, because we just added them in the above loop.
IMeshSceneNode* node = static_cast<IMeshSceneNode*>(container[i]);
scene::IMeshSceneNode* node = static_cast<scene::IMeshSceneNode*>(container[i]);
S3DVertex* pv = static_cast<S3DVertex*>(node->getMesh()->getMeshBuffer(0)->getVertices());
video::S3DVertex* pv = static_cast<video::S3DVertex*>(node->getMesh()->getMeshBuffer(0)->getVertices());
//pv[0].TCoords.Y = pv[1].TCoords.Y = (letter_size.Height - 1) / static_cast<f32>(letter_size.Height);
//pv[1].TCoords.X = pv[3].TCoords.X = (letter_size.Width - 1) / static_cast<f32>(letter_size.Width);
pv[0].TCoords = vector2df(u1, v2);
pv[1].TCoords = vector2df(u2, v2);
pv[2].TCoords = vector2df(u1, v1);
pv[3].TCoords = vector2df(u2, v1);
pv[0].TCoords = core::vector2df(u1, v2);
pv[1].TCoords = core::vector2df(u2, v2);
pv[2].TCoords = core::vector2df(u1, v1);
pv[3].TCoords = core::vector2df(u2, v1);
container[i]->getMaterial(0).setTexture(0, current_tex);
}
......
......@@ -56,7 +56,7 @@ void ClientCard::UpdateInfo(unsigned char* buf) {
}
if(flag & QUERY_POSITION) {
int pdata = (BufferIO::ReadInt32(buf) >> 24) & 0xff;
if((location & (LOCATION_EXTRA | LOCATION_REMOVED)) && (u8)pdata != position) {
if((location & (LOCATION_EXTRA | LOCATION_REMOVED)) && pdata != position) {
position = pdata;
mainGame->dField.MoveCard(this, 1);
} else
......
......@@ -15,9 +15,9 @@ public:
irr::core::vector3df curRot;
irr::core::vector3df dPos;
irr::core::vector3df dRot;
u32 curAlpha{ 255 };
u32 dAlpha{ 0 };
u32 aniFrame{ 0 };
irr::u32 curAlpha{ 255 };
irr::u32 dAlpha{ 0 };
irr::u32 aniFrame{ 0 };
bool is_moving{ false };
bool is_fading{ false };
bool is_hovered{ false };
......
......@@ -669,14 +669,14 @@ void ClientField::ShowSelectOption(int select_hint) {
mainGame->btnOptionOK->setVisible(false);
for(int i = 0; i < 5; i++)
mainGame->btnOption[i]->setVisible(i < count);
recti pos = mainGame->wOptions->getRelativePosition();
irr::core::recti pos = mainGame->wOptions->getRelativePosition();
int newheight = 50 + 60 * (scrollbar ? 5 : count) * mainGame->yScale;
int oldheight = pos.LowerRightCorner.Y - pos.UpperLeftCorner.Y;
pos.UpperLeftCorner.Y = pos.UpperLeftCorner.Y + (oldheight - newheight) / 2;
pos.LowerRightCorner.X = pos.UpperLeftCorner.X + (scrollbar ? 425 : 390) * mainGame->xScale;
pos.LowerRightCorner.Y = pos.UpperLeftCorner.Y + newheight;
mainGame->wOptions->setRelativePosition(pos);
mainGame->bgOptions->setRelativePosition(rect<s32>(0, 0, (scrollbar ? 425 : 390) * mainGame->xScale, pos.LowerRightCorner.Y - pos.UpperLeftCorner.Y));
mainGame->bgOptions->setRelativePosition(irr::core::rect<irr::s32>(0, 0, (scrollbar ? 425 : 390) * mainGame->xScale, pos.LowerRightCorner.Y - pos.UpperLeftCorner.Y));
} else {
mainGame->SetStaticText(mainGame->stOptions, 350 * mainGame->xScale, mainGame->guiFont, dataManager.GetDesc(select_options[0]));
mainGame->stOptions->setVisible(true);
......@@ -685,10 +685,10 @@ void ClientField::ShowSelectOption(int select_hint) {
mainGame->btnOptionOK->setVisible(true);
for(int i = 0; i < 5; i++)
mainGame->btnOption[i]->setVisible(false);
recti pos = mainGame->wOptions->getRelativePosition();
irr::core::recti pos = mainGame->wOptions->getRelativePosition();
pos.LowerRightCorner.Y = pos.UpperLeftCorner.Y + 180 * mainGame->yScale;
mainGame->wOptions->setRelativePosition(pos);
mainGame->bgOptions->setRelativePosition(pos);
mainGame->bgOptions->setRelativePosition(mainGame->wOptions->getRelativePosition());
}
if(select_hint)
myswprintf(textBuffer, L"%ls", dataManager.GetDesc(select_hint));
......
......@@ -49,7 +49,7 @@
#define mystrncasecmp strncasecmp
#include <cstdio>
#include <stdlib.h>
#include <cstdlib>
#include <iostream>
#include <algorithm>
#include <string>
......@@ -70,13 +70,8 @@ inline FILE* mywfopen(const wchar_t* filename, const char* mode) {
}
#include <irrlicht.h>
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace os;
using namespace irr::io;
using namespace irr::os;
extern const unsigned short PRO_VERSION;
extern unsigned int enable_log;
......
......@@ -87,10 +87,10 @@ bool DataManager::LoadDB(const wchar_t* wfile) {
if(reader == nullptr)
return false;
spmemvfs_db_t db;
spmembuffer_t* mem = (spmembuffer_t*)calloc(sizeof(spmembuffer_t), 1);
spmembuffer_t* mem = (spmembuffer_t*)std::calloc(sizeof(spmembuffer_t), 1);
spmemvfs_env_init();
mem->total = mem->used = reader->getSize();
mem->data = (char*)malloc(mem->total + 1);
mem->data = (char*)std::malloc(mem->total + 1);
reader->read(mem->data, mem->total);
reader->drop();
(mem->data)[mem->total] = '\0';
......@@ -411,7 +411,7 @@ unsigned char* DataManager::ScriptReaderEx(const char* script_path, int* slen) {
return nullptr;
}
unsigned char* DataManager::ReadScriptFromIrrFS(const char* script_name, int* slen) {
IReadFile* reader = FileSystem->createAndOpenFile(script_name);
auto reader = FileSystem->createAndOpenFile(script_name);
if (!reader)
return nullptr;
int size = reader->read(scriptBuffer, sizeof scriptBuffer);
......
......@@ -150,13 +150,13 @@ void DeckBuilder::Terminate() {
if (catesel >= 0)
BufferIO::CopyWideString(mainGame->cbDBCategory->getItem(catesel), mainGame->gameConf.lastcategory);
BufferIO::EncodeUTF8(mainGame->gameConf.lastcategory, linebuf);
android::setLastCategory(mainGame->appMain, linebuf);
irr::android::setLastCategory(mainGame->appMain, linebuf);
//irr:os::Printer::log("setLastCategory", linebuf);
int decksel = mainGame->cbDBDecks->getSelected();
if (decksel >= 0)
BufferIO::CopyWideString(mainGame->cbDBDecks->getItem(decksel), mainGame->gameConf.lastdeck);
BufferIO::EncodeUTF8(mainGame->gameConf.lastdeck, linebuf);
android::setLastDeck(mainGame->appMain, linebuf);
irr::android::setLastDeck(mainGame->appMain, linebuf);
//os::Printer::log("setLastDeck", linebuf);
mainGame->SaveConfig();
if(exit_on_return)
......@@ -173,7 +173,7 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
return false;
switch(event.EventType) {
case irr::EET_GUI_EVENT: {
s32 id = event.GUIEvent.Caller->getID();
irr::s32 id = event.GUIEvent.Caller->getID();
if(((mainGame->wCategories->isVisible() && id != BUTTON_CATEGORY_OK) ||
(mainGame->wQuery->isVisible() && id != BUTTON_YES && id != BUTTON_NO) ||
(mainGame->wLinkMarks->isVisible() && id != BUTTON_MARKERS_OK) ||
......
......@@ -42,8 +42,8 @@ void DeckManager::LoadLFListSingle(const char* path) {
std::fclose(fp);
}
}
void DeckManager::LoadLFList(android::InitOptions *options) {
io::path workingDir = options->getWorkDir();
void DeckManager::LoadLFList(irr::android::InitOptions *options) {
irr::io::path workingDir = options->getWorkDir();
LoadLFListSingle((workingDir + path("/expansions/lflist.conf")).c_str());
LoadLFListSingle((workingDir + path("/lflist.conf")).c_str());
LFList nolimit;
......@@ -197,7 +197,7 @@ int DeckManager::LoadDeck(Deck& deck, std::istringstream& deckStream, bool is_pa
if (linebuf[0] < '0' || linebuf[0] > '9')
continue;
errno = 0;
code = strtol(linebuf.c_str(), nullptr, 10);
code = std::strtol(linebuf.c_str(), nullptr, 10);
if (errno == ERANGE)
continue;
cardlist[ct++] = code;
......@@ -289,7 +289,7 @@ irr::io::IReadFile* DeckManager::OpenDeckReader(const wchar_t* file) {
}
bool DeckManager::LoadCurrentDeck(const wchar_t* file, bool is_packlist) {
current_deck.clear();
IReadFile* reader = OpenDeckReader(file);
auto reader = OpenDeckReader(file);
if(!reader) {
wchar_t localfile[256];
myswprintf(localfile, L"./deck/%ls.ydk", file);
......@@ -315,7 +315,7 @@ bool DeckManager::LoadCurrentDeck(const wchar_t* file, bool is_packlist) {
bool DeckManager::LoadCurrentDeck(irr::gui::IGUIComboBox* cbCategory, irr::gui::IGUIComboBox* cbDeck) {
wchar_t filepath[256];
GetDeckFile(filepath, cbCategory, cbDeck);
bool is_packlist = cbCategory->getSelected() == 0;
bool is_packlist = (cbCategory->getSelected() == 0);
bool res = LoadCurrentDeck(filepath, is_packlist);
if (res && mainGame->is_building)
mainGame->deckBuilder.RefreshPackListScroll();
......
......@@ -44,7 +44,7 @@ public:
static char deckBuffer[0x10000];
void LoadLFListSingle(const char* path);
void LoadLFList(android::InitOptions *options);
void LoadLFList(irr::android::InitOptions *options);
const wchar_t* GetLFListName(unsigned int lfhash);
const LFList* GetLFList(unsigned int lfhash);
unsigned int CheckDeck(Deck& deck, int lfhash, int rule);
......
This diff is collapsed.
......@@ -1948,14 +1948,14 @@ bool DuelClient::ClientAnalyze(unsigned char* msg, int len) {
mainGame->btnPSDD->setVisible(true);
startpos += 178;
} else mainGame->btnPSDD->setVisible(false);
recti pos = mainGame->wPosSelect->getRelativePosition();
s32 oldcenter = pos.getCenter().X;
irr::core::recti pos = mainGame->wPosSelect->getRelativePosition();
irr::s32 oldcenter = pos.getCenter().X;
pos.LowerRightCorner.X = pos.UpperLeftCorner.X + (count * 178 + 50) * mainGame->yScale;
s32 newwidth = pos.getWidth();
irr::s32 newwidth = pos.getWidth();
pos.UpperLeftCorner.X = oldcenter - newwidth / 2;
pos.LowerRightCorner.X = oldcenter + newwidth / 2;
mainGame->wPosSelect->setRelativePosition(pos);
mainGame->bgPosSelect->setRelativePosition(rect<s32>(0, 0, pos.getWidth(), pos.getHeight()));
mainGame->bgPosSelect->setRelativePosition(irr::core::rect<irr::s32>(0, 0, pos.getWidth(), pos.getHeight()));
mainGame->gMutex.lock();
mainGame->PopupElement(mainGame->wPosSelect);
mainGame->gMutex.unlock();
......@@ -3480,11 +3480,11 @@ bool DuelClient::ClientAnalyze(unsigned char* msg, int len) {
float xd = mainGame->dField.attack_target->curPos.X;
float yd = mainGame->dField.attack_target->curPos.Y;
sy = (float)sqrt((xa - xd) * (xa - xd) + (ya - yd) * (ya - yd)) / 2;
mainGame->atk_t = vector3df((xa + xd) / 2, (ya + yd) / 2, 0);
mainGame->atk_t = irr::core::vector3df((xa + xd) / 2, (ya + yd) / 2, 0);
if (ca == 0)
mainGame->atk_r = vector3df(0, 0, -atan((xd - xa) / (yd - ya)));
mainGame->atk_r = irr::core::vector3df(0, 0, -atan((xd - xa) / (yd - ya)));
else
mainGame->atk_r = vector3df(0, 0, 3.1415926 - atan((xd - xa) / (yd - ya)));
mainGame->atk_r = irr::core::vector3df(0, 0, 3.1415926 - atan((xd - xa) / (yd - ya)));
} else {
mainGame->soundManager->PlaySoundEffect(SoundManager::SFX::DIRECT_ATTACK);
myswprintf(event_string, dataManager.GetSysString(1620), dataManager.GetName(mainGame->dField.attacker->code));
......@@ -3495,11 +3495,11 @@ bool DuelClient::ClientAnalyze(unsigned char* msg, int len) {
if (ca == 0)
yd = -3.5f;
sy = (float)sqrt((xa - xd) * (xa - xd) + (ya - yd) * (ya - yd)) / 2;
mainGame->atk_t = vector3df((xa + xd) / 2, (ya + yd) / 2, 0);
mainGame->atk_t = irr::core::vector3df((xa + xd) / 2, (ya + yd) / 2, 0);
if (ca == 0)
mainGame->atk_r = vector3df(0, 0, -atan((xd - xa) / (yd - ya)));
mainGame->atk_r = irr::core::vector3df(0, 0, -atan((xd - xa) / (yd - ya)));
else
mainGame->atk_r = vector3df(0, 0, 3.1415926 - atan((xd - xa) / (yd - ya)));
mainGame->atk_r = irr::core::vector3df(0, 0, 3.1415926 - atan((xd - xa) / (yd - ya)));
}
matManager.GenArrow(sy);
mainGame->attack_sv = 0;
......@@ -4089,7 +4089,7 @@ void DuelClient::BeginRefreshHost() {
event_base* broadev = event_base_new();
#ifdef _IRR_ANDROID_PLATFORM_
//get local ip address in android style
int ipaddr = android::getLocalAddr(mainGame->appMain);
int ipaddr = irr::android::getLocalAddr(mainGame->appMain);
if (ipaddr == -1) {
return;
}
......
This diff is collapsed.
This diff is collapsed.
......@@ -123,11 +123,11 @@ struct DuelInfo {
int card_count[2];
int total_attack[2];
wchar_t str_time_left[2][16];
video::SColor time_color[2];
irr::video::SColor time_color[2];
wchar_t str_card_count[2][16];
wchar_t str_total_attack[2][16];
video::SColor card_count_color[2];
video::SColor total_attack_color[2];
irr::video::SColor card_count_color[2];
irr::video::SColor total_attack_color[2];
};
struct BotInfo {
......@@ -152,19 +152,19 @@ struct FadingUnit {
irr::core::vector2di fadingDiff;
};
class Game :IProcessEventReceiver{
class Game :irr::IProcessEventReceiver{
public:
#ifdef _IRR_ANDROID_PLATFORM_
void stopBGM();
void playBGM();
bool Initialize(ANDROID_APP app, android::InitOptions *options);
bool Initialize(ANDROID_APP app, irr::android::InitOptions *options);
#endif
void MainLoop();
void RefreshTimeDisplay();
void BuildProjectionMatrix(irr::core::matrix4& mProjection, f32 left, f32 right, f32 bottom, f32 top, f32 znear, f32 zfar);
void InitStaticText(irr::gui::IGUIStaticText* pControl, u32 cWidth, u32 cHeight, irr::gui::CGUITTFont* font, const wchar_t* text);
std::wstring SetStaticText(irr::gui::IGUIStaticText* pControl, u32 cWidth, irr::gui::CGUITTFont* font, const wchar_t* text, u32 pos = 0);
void BuildProjectionMatrix(irr::core::matrix4& mProjection, irr::f32 left, irr::f32 right, irr::f32 bottom, irr::f32 top, irr::f32 znear, irr::f32 zfar);
void InitStaticText(irr::gui::IGUIStaticText* pControl, irr::u32 cWidth, irr::u32 cHeight, irr::gui::CGUITTFont* font, const wchar_t* text);
std::wstring SetStaticText(irr::gui::IGUIStaticText* pControl, irr::u32 cWidth, irr::gui::CGUITTFont* font, const wchar_t* text, irr::u32 pos = 0);
void LoadExpansions();
void RefreshCategoryDeck(irr::gui::IGUIComboBox* cbCategory, irr::gui::IGUIComboBox* cbDeck, bool selectlastused = true);
void RefreshDeck(irr::gui::IGUIComboBox* cbCategory, irr::gui::IGUIComboBox* cbDeck);
......@@ -216,7 +216,7 @@ public:
int ChatLocalPlayer(int player);
const wchar_t* LocalName(int local_player);
bool HasFocus(EGUI_ELEMENT_TYPE type) const {
bool HasFocus(irr::gui::EGUI_ELEMENT_TYPE type) const {
irr::gui::IGUIElement* focus = env->getFocus();
return focus && focus->hasType(type);
}
......@@ -228,19 +228,19 @@ public:
}
void ResizeChatInputWindow();
recti Resize(s32 x, s32 y, s32 x2, s32 y2);
recti Resize(s32 x, s32 y, s32 x2, s32 y2, s32 dx, s32 dy, s32 dx2, s32 dy2);
irr::core::vector2di Resize(s32 x, s32 y);
irr::core::vector2di ResizeReverse(s32 x, s32 y);
recti ResizePhaseHint(s32 x, s32 y, s32 x2, s32 y2, s32 width);
recti ResizeWin(s32 x, s32 y, s32 x2, s32 y2);
recti Resize_Y(s32 x, s32 y, s32 x2, s32 y2);
irr::core::vector2di Resize_Y(s32 x, s32 y);
irr::core::recti Resize(irr::s32 x, irr::s32 y, irr::s32 x2, irr::s32 y2);
irr::core::recti Resize(irr::s32 x, irr::s32 y, irr::s32 x2, irr::s32 y2, irr::s32 dx, irr::s32 dy, irr::s32 dx2, irr::s32 dy2);
irr::core::vector2di Resize(irr::s32 x, irr::s32 y);
irr::core::vector2di ResizeReverse(irr::s32 x, irr::s32 y);
irr::core::recti ResizePhaseHint(irr::s32 x, irr::s32 y, irr::s32 x2, irr::s32 y2, irr::s32 width);
irr::core::recti ResizeWin(irr::s32 x, irr::s32 y, irr::s32 x2, irr::s32 y2);
irr::core::recti Resize_Y(irr::s32 x, irr::s32 y, irr::s32 x2, irr::s32 y2);
irr::core::vector2di Resize_Y(irr::s32 x, irr::s32 y);
template<typename T>
static std::vector<T> TokenizeString(T input, const T& token);
template<typename T>
static void DrawShadowText(irr::gui::CGUITTFont* font, const T& text, const core::rect<s32>& position, const core::rect<s32>& padding,
video::SColor color = 0xffffffff, video::SColor shadowcolor = 0xff000000, bool hcenter = false, bool vcenter = false, const core::rect<s32>* clip = nullptr);
static void DrawShadowText(irr::gui::CGUITTFont* font, const T& text, const irr::core::rect<irr::s32>& position, const irr::core::rect<irr::s32>& padding,
irr::video::SColor color = 0xffffffff, irr::video::SColor shadowcolor = 0xff000000, bool hcenter = false, bool vcenter = false, const irr::core::rect<irr::s32>* clip = nullptr);
std::unique_ptr<SoundManager> soundManager;
std::mutex gMutex;
......@@ -258,38 +258,40 @@ public:
std::wstring chatMsg[8];
std::vector<BotInfo> botInfo;
int hideChatTimer;
bool hideChat;
int hideChatTimer{};
bool hideChat{};
int chatTiming[8]{};
int chatType[8]{};
unsigned short linePatternD3D;
unsigned short linePatternGL;
int waitFrame;
int signalFrame;
int actionParam;
const wchar_t* showingtext;
int showcard;
int showcardcode;
int showcarddif;
int showcardp;
int is_attacking;
int attack_sv;
unsigned short linePatternD3D{};
unsigned short linePatternGL{ 0x0f0f };
int waitFrame{};
int signalFrame{};
int actionParam{};
const wchar_t* showingtext{};
int showcard{};
int showcardcode{};
int showcarddif{};
int showcardp{};
int is_attacking{};
int attack_sv{};
irr::core::vector3df atk_r;
irr::core::vector3df atk_t;
float atkdy;
int lpframe;
int lpd;
int lpplayer;
int lpccolor;
float atkdy{};
int lpframe{};
int lpd{};
int lpplayer{};
int lpccolor{};
std::wstring lpcstring;
bool always_chain;
bool ignore_chain;
bool chain_when_avail;
bool always_chain{};
bool ignore_chain{};
bool chain_when_avail{};
bool is_building;
bool is_siding;
bool is_building{};
bool is_siding{};
irr::core::dimension2d<irr::u32> window_size;
float xScale{ 1.0f };
float yScale{ 1.0f };
ClientField dField;
DeckBuilder deckBuilder;
......@@ -524,8 +526,8 @@ public:
irr::gui::IGUIImage* bgCardDisplay;
irr::gui::IGUIStaticText* stCardDisplay;
irr::gui::CGUIImageButton* btnCardDisplay[5];
irr::gui::IGUIStaticText* stDisplayPos[5];
irr::gui::IGUIScrollBar* scrDisplayList;
irr::gui::IGUIStaticText *stDisplayPos[5];
irr::gui::IGUIScrollBar *scrDisplayList;
irr::gui::IGUIButton* btnDisplayOK;
//announce number
irr::gui::IGUIWindow* wANNumber;
......@@ -687,22 +689,19 @@ public:
irr::gui::IGUIButton* btnBigCardZoomIn;
irr::gui::IGUIButton* btnBigCardZoomOut;
irr::gui::IGUIButton* btnBigCardClose;
float xScale;
float yScale;
#ifdef _IRR_ANDROID_PLATFORM_
ANDROID_APP appMain;
int glversion;
bool isPSEnabled;
bool isNPOTSupported;
s32 ogles2Solid;
s32 ogles2TrasparentAlpha;
s32 ogles2BlendTexture;
irr::s32 ogles2Solid;
irr::s32 ogles2TrasparentAlpha;
irr::s32 ogles2BlendTexture;
irr::android::CustomShaderConstantSetCallBack customShadersCallback;
Signal externalSignal;
static void onHandleAndroidCommand(ANDROID_APP app, int32_t cmd);
#endif
void setPositionFix(core::position2di fix){
void setPositionFix(irr::core::position2di fix){
InputFix = fix;
}
float optX(float x) {
......@@ -722,7 +721,7 @@ public:
}
void process(irr::SEvent &event);
private:
core::position2di InputFix;
irr::core::position2di InputFix;
};
extern Game* mainGame;
......
......@@ -2,7 +2,7 @@
#include "game.h"
#include "data_manager.h"
#include <event2/thread.h>
#include <locale.h>
#include <clocale>
#include <memory>
unsigned int enable_log = 0x3;
......@@ -30,7 +30,7 @@ char* sub_string(const char* str, int start, int count = -1){
return tmp;
}
#ifdef _IRR_ANDROID_PLATFORM_
int GetListBoxIndex(IGUIListBox* listbox, const wchar_t * target){
int GetListBoxIndex(irr::gui::IGUIListBox* listbox, const wchar_t * target){
int count = listbox->getItemCount();
for(int i = 0; i < count; i++){
auto item = listbox->getListItem(i);
......@@ -41,7 +41,7 @@ int GetListBoxIndex(IGUIListBox* listbox, const wchar_t * target){
return -1;
}
void android_main(ANDROID_APP app) {
app->inputPollSource.process = android::process_input;
app->inputPollSource.process = irr::android::process_input;
#else
int main(int argc, char* argv[]) {
#endif
......@@ -49,7 +49,7 @@ int main(int argc, char* argv[]) {
ygo::Game _game;
ygo::mainGame = &_game;
#ifdef _IRR_ANDROID_PLATFORM_
android::InitOptions *options = android::getInitOptions(app);
irr::android::InitOptions *options = irr::android::getInitOptions(app);
if(!ygo::mainGame->Initialize(app, options)){
delete options;
return;
......
......@@ -204,7 +204,7 @@ irr::video::ITexture* ImageManager::GetBigPicture(int code, float zoom) {
texture = driver->addTexture(file, srcimg);
} else {
auto origsize = srcimg->getDimension();
video::IImage* destimg = driver->createImage(srcimg->getColorFormat(), irr::core::dimension2d<u32>(origsize.Width * zoom, origsize.Height * zoom));
irr::video::IImage* destimg = driver->createImage(srcimg->getColorFormat(), irr::core::dimension2d<irr::u32>(origsize.Width * zoom, origsize.Height * zoom));
//imageScaleNNAA(srcimg, destimg);
texture = driver->addTexture(file, destimg);
destimg->drop();
......
......@@ -29,7 +29,7 @@ public:
std::unordered_map<int, irr::video::ITexture*> tFields;
irr::IrrlichtDevice* device;
irr::video::IVideoDriver* driver;
irr::video::ITexture* tCover[2];
irr::video::ITexture* tCover[4];
irr::video::ITexture* tBigPicture;
irr::video::ITexture* tUnknown;
irr::video::ITexture* tAct;
......
......@@ -16,11 +16,11 @@ void UpdateDeck() {
char linebuf[256];
BufferIO::CopyWStr(mainGame->cbCategorySelect->getItem(mainGame->cbCategorySelect->getSelected()), mainGame->gameConf.lastcategory, 64);
BufferIO::EncodeUTF8(mainGame->gameConf.lastcategory, linebuf);
android::setLastCategory(mainGame->appMain, linebuf);
irr::android::setLastCategory(mainGame->appMain, linebuf);
BufferIO::CopyWStr(mainGame->cbDeckSelect->getItem(mainGame->cbDeckSelect->getSelected()), mainGame->gameConf.lastdeck, 64);
BufferIO::EncodeUTF8(mainGame->gameConf.lastdeck, linebuf);
android::setLastDeck(mainGame->appMain, linebuf);
irr::android::setLastDeck(mainGame->appMain, linebuf);
unsigned char deckbuf[1024]{};
auto pdeck = deckbuf;
......@@ -103,7 +103,7 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
switch(event.EventType) {
case irr::EET_GUI_EVENT: {
irr::gui::IGUIElement* caller = event.GUIEvent.Caller;
s32 id = caller->getID();
irr::s32 id = caller->getID();
if(mainGame->wQuery->isVisible() && id != BUTTON_YES && id != BUTTON_NO) {
mainGame->wQuery->getParent()->bringToFront(mainGame->wQuery);
break;
......@@ -381,7 +381,7 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
prev_sel = sel;
#ifdef _IRR_ANDROID_PLATFORM_
ALOGD("cc menu_handler: 1share replay file=%s", name);
android::OnShareFile(mainGame->appMain, "yrp", name);
irr::android::OnShareFile(mainGame->appMain, "yrp", name);
ALOGD("cc menu_handler: 2after share replay file:index=%d", sel);
#endif
break;
......@@ -478,7 +478,7 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
char arg3[32];
snprintf(arg3, sizeof arg3, " Port=%d", mainGame->gameConf.serverport);
snprintf(args, sizeof args, "%s%s%s", arg1, arg2, arg3);
android::runWindbot(mainGame->appMain, args);
irr::android::runWindbot(mainGame->appMain, args);
if(!NetServer::StartServer(mainGame->gameConf.serverport)) {
mainGame->soundManager->PlaySoundEffect(SoundManager::SFX::INFO);
mainGame->env->addMessageBox(L"", dataManager.GetSysString(1402));
......
#ifndef REPLAY_MODE_H
#define REPLAY_MODE_H
#include <stdint.h>
#include <cstdint>
#include <vector>
#include "replay.h"
......
#ifndef SINGLE_MODE_H
#define SINGLE_MODE_H
#include <stdint.h>
#include <cstdint>
#include <vector>
#include "replay.h"
......
......@@ -384,7 +384,7 @@ namespace ygo {
auto list = archive->getFileList();
std::vector<path_string> list_full;
folderindexes[TEXT(".")] = { { -1, -1 }, { -1, -1 } };
for(u32 i = 0; i < list->getFileCount(); ++i) {
for(irr::u32 i = 0; i < list->getFileCount(); ++i) {
list_full.push_back(list->getFullFileName(i).c_str());
if(list->isDirectory(i)) {
folderindexes[list->getFullFileName(i).c_str()] = { { -1, -1 }, { -1, -1 } };
......
......@@ -44,7 +44,7 @@ bool TouchEventTransferAndroid::OnTransferDeckEdit(const SEvent& event) {
if (event.TouchInput.Event == ETIE_PRESSED_DOWN) {
if (!(ygo::mainGame->scrFilter->isVisible()
&& ygo::mainGame->scrFilter->isPointInside(position2d<s32>(s_current_x, s_current_y)))) {
&& ygo::mainGame->scrFilter->isPointInside(irr::core::position2d<irr::s32>(s_current_x, s_current_y)))) {
SEvent hoverEvent;
hoverEvent.EventType = EET_MOUSE_INPUT_EVENT;
hoverEvent.MouseInput.Event = EMIE_MOUSE_MOVED;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment