mirror of
https://github.com/glest/glest-source.git
synced 2025-08-28 18:29:48 +02:00
Fixed transparency issue
This commit is contained in:
@@ -408,7 +408,6 @@ namespace Shared {
|
||||
menuCustomColor->AppendCheckItem(miColorCyan, wxT("&Cyan\t5"));
|
||||
menuCustomColor->AppendCheckItem(miColorOrange, wxT("&Orange\t6"));
|
||||
menuCustomColor->AppendCheckItem(miColorMagenta, wxT("&Pink\t7"));
|
||||
menuCustomColor->AppendCheckItem(miColorTransparent, wxT("&Transparent\t8"));
|
||||
menu->Append(menuCustomColor, wxT("&Custom Color"));
|
||||
|
||||
menuMode->Check(miModeGrid, true);
|
||||
@@ -1706,7 +1705,6 @@ namespace Shared {
|
||||
menuCustomColor->Check(miColorCyan, false);
|
||||
menuCustomColor->Check(miColorOrange, false);
|
||||
menuCustomColor->Check(miColorMagenta, false);
|
||||
menuCustomColor->Check(miColorTransparent, false);
|
||||
} catch (std::runtime_error &e) {
|
||||
std::cout << e.what() << std::endl;
|
||||
wxMessageDialog(NULL, ToUnicode(e.what()), ToUnicode("Error"), wxOK | wxICON_ERROR).ShowModal();
|
||||
@@ -1724,7 +1722,6 @@ namespace Shared {
|
||||
menuCustomColor->Check(miColorCyan, false);
|
||||
menuCustomColor->Check(miColorOrange, false);
|
||||
menuCustomColor->Check(miColorMagenta, false);
|
||||
menuCustomColor->Check(miColorTransparent, false);
|
||||
} catch (std::runtime_error &e) {
|
||||
std::cout << e.what() << std::endl;
|
||||
wxMessageDialog(NULL, ToUnicode(e.what()), ToUnicode("Error"), wxOK | wxICON_ERROR).ShowModal();
|
||||
@@ -1742,7 +1739,6 @@ namespace Shared {
|
||||
menuCustomColor->Check(miColorCyan, false);
|
||||
menuCustomColor->Check(miColorOrange, false);
|
||||
menuCustomColor->Check(miColorMagenta, false);
|
||||
menuCustomColor->Check(miColorTransparent, false);
|
||||
} catch (std::runtime_error &e) {
|
||||
std::cout << e.what() << std::endl;
|
||||
wxMessageDialog(NULL, ToUnicode(e.what()), ToUnicode("Error"), wxOK | wxICON_ERROR).ShowModal();
|
||||
@@ -1760,7 +1756,6 @@ namespace Shared {
|
||||
menuCustomColor->Check(miColorCyan, false);
|
||||
menuCustomColor->Check(miColorOrange, false);
|
||||
menuCustomColor->Check(miColorMagenta, false);
|
||||
menuCustomColor->Check(miColorTransparent, false);
|
||||
} catch (std::runtime_error &e) {
|
||||
std::cout << e.what() << std::endl;
|
||||
wxMessageDialog(NULL, ToUnicode(e.what()), ToUnicode("Error"), wxOK | wxICON_ERROR).ShowModal();
|
||||
@@ -1778,7 +1773,6 @@ namespace Shared {
|
||||
menuCustomColor->Check(miColorCyan, false);
|
||||
menuCustomColor->Check(miColorOrange, false);
|
||||
menuCustomColor->Check(miColorMagenta, false);
|
||||
menuCustomColor->Check(miColorTransparent, false);
|
||||
} catch (std::runtime_error &e) {
|
||||
std::cout << e.what() << std::endl;
|
||||
wxMessageDialog(NULL, ToUnicode(e.what()), ToUnicode("Error"), wxOK | wxICON_ERROR).ShowModal();
|
||||
@@ -1796,7 +1790,6 @@ namespace Shared {
|
||||
menuCustomColor->Check(miColorCyan, true);
|
||||
menuCustomColor->Check(miColorOrange, false);
|
||||
menuCustomColor->Check(miColorMagenta, false);
|
||||
menuCustomColor->Check(miColorTransparent, false);
|
||||
} catch (std::runtime_error &e) {
|
||||
std::cout << e.what() << std::endl;
|
||||
wxMessageDialog(NULL, ToUnicode(e.what()), ToUnicode("Error"), wxOK | wxICON_ERROR).ShowModal();
|
||||
@@ -1814,7 +1807,6 @@ namespace Shared {
|
||||
menuCustomColor->Check(miColorCyan, false);
|
||||
menuCustomColor->Check(miColorOrange, true);
|
||||
menuCustomColor->Check(miColorMagenta, false);
|
||||
menuCustomColor->Check(miColorTransparent, false);
|
||||
} catch (std::runtime_error &e) {
|
||||
std::cout << e.what() << std::endl;
|
||||
wxMessageDialog(NULL, ToUnicode(e.what()), ToUnicode("Error"), wxOK | wxICON_ERROR).ShowModal();
|
||||
@@ -1832,32 +1824,12 @@ namespace Shared {
|
||||
menuCustomColor->Check(miColorCyan, false);
|
||||
menuCustomColor->Check(miColorOrange, false);
|
||||
menuCustomColor->Check(miColorMagenta, true);
|
||||
menuCustomColor->Check(miColorTransparent, false);
|
||||
} catch (std::runtime_error &e) {
|
||||
std::cout << e.what() << std::endl;
|
||||
wxMessageDialog(NULL, ToUnicode(e.what()), ToUnicode("Error"), wxOK | wxICON_ERROR).ShowModal();
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::onMenuColorTransparent(wxCommandEvent &event) {
|
||||
try {
|
||||
playerColor = Renderer::pcTransparent;
|
||||
menuCustomColor->Check(miColorRed, false);
|
||||
menuCustomColor->Check(miColorBlue, false);
|
||||
menuCustomColor->Check(miColorGreen, false);
|
||||
menuCustomColor->Check(miColorYellow, false);
|
||||
menuCustomColor->Check(miColorWhite, false);
|
||||
menuCustomColor->Check(miColorCyan, false);
|
||||
menuCustomColor->Check(miColorOrange, false);
|
||||
menuCustomColor->Check(miColorMagenta, false);
|
||||
menuCustomColor->Check(miColorTransparent, true);
|
||||
} catch (std::runtime_error &e) {
|
||||
std::cout << e.what() << std::endl;
|
||||
wxMessageDialog(NULL, ToUnicode(e.what()), ToUnicode("Error"), wxOK | wxICON_ERROR).ShowModal();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void MainWindow::onTimer(wxTimerEvent &event) {
|
||||
anim = anim + speed;
|
||||
if (anim > 1.0f) {
|
||||
@@ -2008,7 +1980,6 @@ namespace Shared {
|
||||
EVT_MENU(miColorCyan, MainWindow::onMenuColorCyan)
|
||||
EVT_MENU(miColorOrange, MainWindow::onMenuColorOrange)
|
||||
EVT_MENU(miColorMagenta, MainWindow::onMenuColorMagenta)
|
||||
EVT_MENU(miColorTransparent, MainWindow::onMenuColorTransparent)
|
||||
|
||||
EVT_MENU(miChangeBackgroundColor, MainWindow::OnChangeColor)
|
||||
END_EVENT_TABLE()
|
||||
|
@@ -72,7 +72,6 @@ namespace Shared {
|
||||
miColorCyan,
|
||||
miColorOrange,
|
||||
miColorMagenta,
|
||||
miColorTransparent
|
||||
};
|
||||
|
||||
private:
|
||||
|
@@ -57,7 +57,6 @@ namespace Shared {
|
||||
customTextureCyan = NULL;
|
||||
customTextureOrange = NULL;
|
||||
customTextureMagenta = NULL;
|
||||
customTextureTransparent = NULL;
|
||||
particleManager = NULL;
|
||||
}
|
||||
|
||||
@@ -220,11 +219,6 @@ namespace Shared {
|
||||
customTextureMagenta->getPixmap()->init(1, 1, 4);
|
||||
customTextureMagenta->getPixmap()->setPixel(0, 0, Vec4f(1.f, 0.5f, 1.f, 1.0f));
|
||||
|
||||
//transparent tex
|
||||
customTextureTransparent = textureManager->newTexture2D();
|
||||
customTextureTransparent->getPixmap()->init(1, 1, 4);
|
||||
customTextureTransparent->getPixmap()->setPixel(0, 0, Vec4f(1.0f, 1.0f, 1.0f, 0.0f));
|
||||
|
||||
glClearColor(red, green, blue, alpha); //backgroundcolor constant 0.3
|
||||
//glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||
|
||||
@@ -305,9 +299,6 @@ namespace Shared {
|
||||
case pcMagenta:
|
||||
customTexture = customTextureMagenta;
|
||||
break;
|
||||
case pcTransparent:
|
||||
customTexture = customTextureTransparent;
|
||||
break;
|
||||
default:
|
||||
assert(false);
|
||||
break;
|
||||
@@ -434,9 +425,6 @@ namespace Shared {
|
||||
case pcMagenta:
|
||||
customTexture = customTextureMagenta;
|
||||
break;
|
||||
case pcTransparent:
|
||||
customTexture = customTextureTransparent;
|
||||
break;
|
||||
default:
|
||||
throw megaglest_runtime_error("Unknown playercolor: " + intToStr(playerColor));
|
||||
break;
|
||||
|
@@ -69,7 +69,6 @@ namespace Shared {
|
||||
pcCyan,
|
||||
pcOrange,
|
||||
pcMagenta,
|
||||
pcTransparent
|
||||
};
|
||||
|
||||
private:
|
||||
@@ -95,7 +94,6 @@ namespace Shared {
|
||||
Texture2D *customTextureCyan;
|
||||
Texture2D *customTextureOrange;
|
||||
Texture2D *customTextureMagenta;
|
||||
Texture2D *customTextureTransparent;
|
||||
MeshCallback meshCallback;
|
||||
|
||||
float red;
|
||||
|
Reference in New Issue
Block a user