Commit e33d4b1b authored by argon.sun's avatar argon.sun

fix

parent 3eda8ed1
......@@ -703,20 +703,17 @@ void Game::WaitFrameSignal(int frame) {
frameSignal.Wait();
}
void Game::DrawThumb(code_pointer cp, position2di pos, std::unordered_map<int, int>* lflist) {
const int width = 44; //standard pic size, maybe it should be defined in game.h
const int height = 64;
const int width = 44; //standard pic size, maybe it should be defined in game.h
const int height = 64;
int code = cp->first;
int lcode = cp->second.alias;
if(lcode == 0)
lcode = code;
irr::video::ITexture* img = imageManager.GetTextureThumb(code);
if(img == NULL)
return; //NULL->getSize() will cause a crash
dimension2d<u32> size = img->getSize();
if(size.Width == width and size.Height == height)
driver->draw2DImage(img, pos);
else
driver->draw2DImage(img, rect<s32>(pos.X, pos.Y,pos.X+width,pos.Y+height), rect<s32>(0,0,size.Width,size.Height));
irr::video::ITexture* img = imageManager.GetTextureThumb(code);
if(img == NULL)
return; //NULL->getSize() will cause a crash
dimension2d<u32> size = img->getOriginalSize();
driver->draw2DImage(img, rect<s32>(pos.X, pos.Y, pos.X + width, pos.Y + height), rect<s32>(0, 0, size.Width, size.Height));
if(lflist->count(lcode)) {
switch((*lflist)[lcode]) {
......
......@@ -270,6 +270,12 @@ public:
irr::gui::IGUIButton* btnRepos;
irr::gui::IGUIButton* btnAttack;
irr::gui::IGUIButton* btnShowList;
//chat window
irr::gui::IGUIWindow* wChat;
irr::gui::IGUIListBox* lstChatLog;
irr::gui::IGUIEditBox* ebChatInput;
irr::gui::IGUICheckBox* chkIgnore1;
irr::gui::IGUICheckBox* chkIgnore2;
//phase button
irr::gui::IGUIStaticText* wPhase;
irr::gui::IGUIButton* btnDP;
......
......@@ -42,7 +42,7 @@ void ImageManager::ClearTexture() {
}
void ImageManager::RemoveTexture(int code) {
auto tit = tMap.find(code);
if(tit != tMap.end() and tThumb.find(code)->second != tit->second) { //if member of tThumb point to this; don't remove
if(tit != tMap.end()) {
if(tit->second)
driver->removeTexture(tit->second);
tMap.erase(tit);
......@@ -56,14 +56,17 @@ irr::video::ITexture* ImageManager::GetTexture(int code) {
char file[256];
sprintf(file, "pics/%d.jpg", code); //suggest that define the path in game.h
irr::video::ITexture* img = driver->getTexture(file);
if(img == NULL){
sprintf(file, "pics/thumbnail/%d.jpg", code);
img = driver->getTexture(file);
if(img)
tThumb[code] = img;
if(img == NULL) {
sprintf(file, "pics/thumbnail/%d.jpg", code);
img = driver->getTexture(file);
}
if(img == NULL) {
tMap[code] = tUnknown;
return tUnknown;
} else {
tMap[code] = img;
return img;
}
tMap[code] = img;
return img;
}
if(tit->second)
return tit->second;
......@@ -78,16 +81,19 @@ irr::video::ITexture* ImageManager::GetTextureThumb(int code) {
char file[32];
sprintf(file, "pics/thumbnail/%d.jpg", code);
irr::video::ITexture* img = driver->getTexture(file);
if(img == NULL){
sprintf(file, "pics/%d.jpg", code);
img = driver->getTexture(file);
if(img)
tMap[code] = img;
if(img == NULL) {
sprintf(file, "pics/%d.jpg", code);
img = driver->getTexture(file);
}
if(img == NULL) {
tThumb[code] = tUnknown;
return tUnknown;
} else {
tThumb[code] = img;
return img;
}
tThumb[code] = img;
return img;
}
if(tit->second)
if(tit->second)
return tit->second;
else
return tUnknown;
......
......@@ -16,7 +16,7 @@
int32 field::field_used_count[32] = {0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4, 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5};
bool chain::chain_operation_sort(chain c1, chain c2) {
return c1.triggering_effect->id > c2.triggering_effect->id;
return c1.triggering_effect->id < c2.triggering_effect->id;
}
field::field(duel* pduel) {
this->pduel = pduel;
......
......@@ -1235,6 +1235,7 @@ int32 field::process_phase_event(int16 step, int32 phase) {
peffect = pr.first->second;
if(!peffect->is_activateable(check_player, nil_event))
continue;
peffect->id = infos.effect_id++;
newchain.triggering_effect = peffect;
core.select_chains.push_back(newchain);
to_count++;
......@@ -1252,6 +1253,7 @@ int32 field::process_phase_event(int16 step, int32 phase) {
peffect = pr.first->second;
if(!peffect->is_chainable(check_player) || !peffect->is_activateable(check_player, nil_event))
continue;
peffect->id = infos.effect_id++;
newchain.triggering_effect = peffect;
if(check_hint_timing(peffect))
core.spe_effect[check_player]++;
......@@ -1263,6 +1265,7 @@ int32 field::process_phase_event(int16 step, int32 phase) {
peffect = pr.first->second;
if(!peffect->is_chainable(check_player) || !peffect->is_activateable(check_player, nil_event))
continue;
peffect->id = infos.effect_id++;
newchain.triggering_effect = peffect;
if(check_hint_timing(peffect))
core.spe_effect[check_player]++;
......@@ -1362,6 +1365,7 @@ int32 field::process_phase_event(int16 step, int32 phase) {
peffect = pr.first->second;
if(!peffect->is_activateable(check_player, nil_event))
continue;
peffect->id = infos.effect_id++;
newchain.triggering_effect = peffect;
core.select_chains.push_back(newchain);
to_count++;
......@@ -1379,6 +1383,7 @@ int32 field::process_phase_event(int16 step, int32 phase) {
peffect = pr.first->second;
if(!peffect->is_chainable(check_player) || !peffect->is_activateable(check_player, nil_event))
continue;
peffect->id = infos.effect_id++;
newchain.triggering_effect = peffect;
if(check_hint_timing(peffect))
core.spe_effect[check_player]++;
......@@ -1390,6 +1395,7 @@ int32 field::process_phase_event(int16 step, int32 phase) {
peffect = pr.first->second;
if(!peffect->is_chainable(check_player) || !peffect->is_activateable(check_player, nil_event))
continue;
peffect->id = infos.effect_id++;
newchain.triggering_effect = peffect;
if(check_hint_timing(peffect))
core.spe_effect[check_player]++;
......
......@@ -62,7 +62,8 @@ function c18096222.eqlimit(e,c)
return c:GetControler()==e:GetOwnerPlayer() and c:IsType(TYPE_DUAL)
end
function c18096222.dacon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsLocation(LOCATION_GRAVE) and e:GetHandler():GetEquipTarget()~=nil
return e:GetHandler():IsLocation(LOCATION_GRAVE) and e:GetHandler():IsReason(REASON_DESTROY)
and e:GetHandler():GetEquipTarget()~=nil
end
function c18096222.dafilter(c)
return c:IsFaceup() and c:IsType(TYPE_DUAL) and not c:IsDualState()
......
......@@ -4,5 +4,5 @@ function c8198712.initial_effect(c)
end
function c8198712.ritual_filter(c)
local code=c:GetCode()
return c==72426662 or c==46427957
return code==72426662 or code==46427957
end
......@@ -3,9 +3,9 @@
antialias = 2
nickname = Player
gamename = Game
lastdeck = sixsamurai
lastdeck = test
textfont = c:/windows/fonts/simsun.ttc 14
numfont = c:/windows/fonts/arialbd.ttf
serverport = 7911
lastip = 192.168.2.100
lastip = 192.168.3.235
lastport = 7911
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