Windows: Set window icon

Ran AStyle, removed an unused variable

git-svn-id: https://svn.code.sf.net/p/extremetuxracer/code/trunk@692 0420edf4-82e4-42fc-9478-35b55e6d67a3
master
pkeus 2017-01-19 13:25:12 +00:00
parent 6d7ea29fb1
commit bb23733009
11 changed files with 69 additions and 65 deletions

View File

@ -154,19 +154,19 @@ void DrawTrees() {
};
const GLfloat vtx[] = {
static_cast<GLfloat>(-itemRadius*normal.z),
0.f,
static_cast<GLfloat>(itemRadius*normal.x),
static_cast<GLfloat>(-itemRadius*normal.z),
0.f,
static_cast<GLfloat>(itemRadius*normal.x),
static_cast<GLfloat>(itemRadius*normal.z),
0.f,
static_cast<GLfloat>(-itemRadius*normal.x),
static_cast<GLfloat>(itemRadius*normal.z),
static_cast<GLfloat>(itemHeight),
static_cast<GLfloat>(-itemRadius*normal.x),
static_cast<GLfloat>(-itemRadius*normal.z),
static_cast<GLfloat>(itemHeight),
static_cast<GLfloat>(itemRadius*normal.x)
static_cast<GLfloat>(itemRadius*normal.z),
0.f,
static_cast<GLfloat>(-itemRadius*normal.x),
static_cast<GLfloat>(itemRadius*normal.z),
static_cast<GLfloat>(itemHeight),
static_cast<GLfloat>(-itemRadius*normal.x),
static_cast<GLfloat>(-itemRadius*normal.z),
static_cast<GLfloat>(itemHeight),
static_cast<GLfloat>(itemRadius*normal.x)
};
glEnableClientState(GL_VERTEX_ARRAY);
glEnableClientState(GL_TEXTURE_COORD_ARRAY);

View File

@ -81,11 +81,11 @@ void CCredits::DrawCreditsText(float time_step) {
if (i->col == 0) {
text.setFillColor(colWhite);
text.setOutlineColor(colWhite);
text.setOutlineColor(colWhite);
} else {
text.setFillColor(colDYell);
text.setOutlineColor(colDYell);
}
text.setOutlineColor(colDYell);
}
text.setCharacterSize(FT.AutoSizeN(i->size)+1);
text.setString(i->text);
text.setPosition((Winsys.resolution.width - text.getLocalBounds().width) / 2, offs);

View File

@ -202,7 +202,7 @@ void CFont::DrawText(float x, float y, const sf::String& text, std::size_t font,
x = (Winsys.resolution.width - temp.getLocalBounds().width) / 2;
temp.setPosition(x, y);
temp.setFillColor(curr_col);
temp.setOutlineColor(curr_col);
temp.setOutlineColor(curr_col);
Winsys.draw(temp);
}

View File

@ -294,7 +294,6 @@ void InitConfig() {
#endif /* 0 */
struct passwd *pwent = getpwuid(getuid());
const char *home;
param.config_dir = pwent->pw_dir;
param.config_dir += SEP;

View File

@ -84,18 +84,18 @@ TLabel::TLabel(const sf::String& string, int x, int y, const sf::Color& color)
else
text.setPosition(x, y);
text.setFillColor(color);
text.setOutlineColor(color);
text.setOutlineColor(color);
}
void TLabel::Focussed(bool masterFocus) {
focus = masterFocus && active;
if (focus) {
text.setFillColor(colDYell);
text.setOutlineColor(colDYell);
} else {
text.setOutlineColor(colDYell);
} else {
text.setFillColor(colWhite);
text.setOutlineColor(colWhite);
}
text.setOutlineColor(colWhite);
}
}
void TLabel::Draw() const {
@ -120,11 +120,11 @@ TFramedText::TFramedText(int x, int y, int width, int height, int line, const sf
text.setPosition(x + line + 20, y + line);
if (!borderFocus) {
text.setFillColor(colWhite);
text.setOutlineColor(colWhite);
text.setOutlineColor(colWhite);
} else {
text.setFillColor(colDYell);
text.setOutlineColor(colDYell);
}
text.setOutlineColor(colDYell);
}
frame.setPosition(x + line, y + line);
frame.setOutlineThickness(line);
frame.setFillColor(backcol);
@ -134,14 +134,14 @@ TFramedText::TFramedText(int x, int y, int width, int height, int line, const sf
void TFramedText::Activated() {
if (!active) {
text.setFillColor(colLGrey);
text.setOutlineColor(colLGrey);
text.setOutlineColor(colLGrey);
} else if (borderFocus || focus) {
text.setFillColor(colDYell);
text.setOutlineColor(colDYell);
text.setOutlineColor(colDYell);
} else {
text.setFillColor(colWhite);
text.setOutlineColor(colWhite);
}
text.setOutlineColor(colWhite);
}
}
void TFramedText::Focussed(bool masterFocus) {
@ -150,14 +150,14 @@ void TFramedText::Focussed(bool masterFocus) {
frame.setOutlineColor(colDYell);
if (!borderFocus) {
text.setFillColor(colDYell);
text.setOutlineColor(colDYell);
}
text.setOutlineColor(colDYell);
}
} else {
frame.setOutlineColor(colWhite);
if (!borderFocus) {
text.setFillColor(colWhite);
text.setOutlineColor(colWhite);
}
text.setOutlineColor(colWhite);
}
}
}
@ -188,11 +188,11 @@ TTextButton::TTextButton(int x, int y, const sf::String& text_, int ftsize)
void TTextButton::Focussed() {
if (focus) {
text.setFillColor(colDYell);
text.setOutlineColor(colDYell);
text.setOutlineColor(colDYell);
} else {
text.setFillColor(colWhite);
text.setOutlineColor(colWhite);
}
text.setOutlineColor(colWhite);
}
}
void TTextButton::Draw() const {
@ -259,11 +259,11 @@ void TTextField::SetCursorPos(std::size_t new_pos) {
void TTextField::Focussed() {
if (focus) {
text.setFillColor(colDYell);
text.setOutlineColor(colDYell);
text.setOutlineColor(colDYell);
frame.setOutlineColor(colDYell);
} else {
text.setFillColor(colWhite);
text.setOutlineColor(colWhite);
text.setOutlineColor(colWhite);
frame.setOutlineColor(colWhite);
}
}
@ -334,11 +334,11 @@ void TCheckbox::SetPosition(int x, int y) {
void TCheckbox::Focussed() {
if (focus) {
text.setFillColor(colDYell);
text.setOutlineColor(colDYell);
text.setOutlineColor(colDYell);
} else {
text.setFillColor(colWhite);
text.setOutlineColor(colWhite);
}
text.setOutlineColor(colWhite);
}
}
void TCheckbox::Draw() const {

View File

@ -291,18 +291,18 @@ void Particle::draw_billboard(const CControl *ctrl, double width, double height,
TVector3d pt3 = pt2 + height * y_vec;
TVector3d pt4 = pt3 + -width * x_vec;
const GLfloat vtx[] = {
static_cast<GLfloat>(pt1.x),
static_cast<GLfloat>(pt1.y),
static_cast<GLfloat>(pt1.z),
static_cast<GLfloat>(pt2.x),
static_cast<GLfloat>(pt2.y),
static_cast<GLfloat>(pt2.z),
static_cast<GLfloat>(pt3.x),
static_cast<GLfloat>(pt3.y),
static_cast<GLfloat>(pt3.z),
static_cast<GLfloat>(pt4.x),
static_cast<GLfloat>(pt4.y),
static_cast<GLfloat>(pt4.z),
static_cast<GLfloat>(pt1.x),
static_cast<GLfloat>(pt1.y),
static_cast<GLfloat>(pt1.z),
static_cast<GLfloat>(pt2.x),
static_cast<GLfloat>(pt2.y),
static_cast<GLfloat>(pt2.z),
static_cast<GLfloat>(pt3.x),
static_cast<GLfloat>(pt3.y),
static_cast<GLfloat>(pt3.z),
static_cast<GLfloat>(pt4.x),
static_cast<GLfloat>(pt4.y),
static_cast<GLfloat>(pt4.z),
};
glEnableClientState(GL_VERTEX_ARRAY);

View File

@ -191,7 +191,7 @@ void CScore::Keyb(sf::Keyboard::Key key, bool release, int x, int y) {
State::manager.RequestEnterState(*State::manager.PreviousState());
break;
default:
break;
break;
}
}

View File

@ -101,7 +101,7 @@ void CSplashScreen::Loop(float timestep) {
int top = AutoYPosN(60);
Failure = new sf::Text(reason, FT.getCurrentFont(), FT.GetSize());
Failure->setFillColor(colDRed);
Failure->setOutlineColor(colDRed);
Failure->setOutlineColor(colDRed);
Failure->setPosition((Winsys.resolution.width - Failure->getLocalBounds().width) / 2, top);
}
}

View File

@ -266,14 +266,14 @@ void CTexture::DrawNumChr(char c, int x, int y, int w, int h) {
texleft, 0
};
const GLfloat vtx[] = {
static_cast<GLfloat>(x),
static_cast<GLfloat>(Winsys.resolution.height - y - h),
static_cast<GLfloat>(x + w * 0.9f),
static_cast<GLfloat>(Winsys.resolution.height - y - h),
static_cast<GLfloat>(x + w * 0.9f),
static_cast<GLfloat>(Winsys.resolution.height - y),
static_cast<GLfloat>(x),
static_cast<GLfloat>(Winsys.resolution.height - y)
static_cast<GLfloat>(x),
static_cast<GLfloat>(Winsys.resolution.height - y - h),
static_cast<GLfloat>(x + w * 0.9f),
static_cast<GLfloat>(Winsys.resolution.height - y - h),
static_cast<GLfloat>(x + w * 0.9f),
static_cast<GLfloat>(Winsys.resolution.height - y),
static_cast<GLfloat>(x),
static_cast<GLfloat>(Winsys.resolution.height - y)
};
glVertexPointer(2, GL_FLOAT, 0, vtx);

View File

@ -105,6 +105,11 @@ void CWinsys::SetupVideoMode(const TScreenRes& resolution_) {
window.create(sf::VideoMode(resolution.width, resolution.height, bpp), WINDOW_TITLE, style, ctx);
if (param.framerate)
window.setFramerateLimit(param.framerate);
#ifdef _WIN32
HICON icon = LoadIcon(GetModuleHandle(NULL), (LPCWSTR)IDI_APPLICATION);
SendMessageW(window.getSystemHandle(), WM_SETICON, ICON_BIG, (LPARAM)icon);
SendMessageW(window.getSystemHandle(), WM_SETICON, ICON_SMALL, (LPARAM)icon);
#endif
scale = CalcScreenScale();
if (param.use_quad_scale) scale = std::sqrt(scale);

View File

@ -22,7 +22,7 @@ BEGIN
VALUE "FileVersion", ETR_VERSION_STRING
VALUE "InternalName", "ExtremeTuxRacer"
VALUE "LegalCopyright", "Copyright (C) 1999-2001 Jasmin F. Patry (Tuxracer)\n"
"Copyright (C) 2010-2016 Extreme Tuxracer Team"
"Copyright (C) 2010-2017 Extreme Tuxracer Team"
VALUE "OriginalFilename", "ExtremeTuxRacer.exe"
VALUE "ProductName", "ExtremeTuxRacer"
VALUE "ProductVersion", ETR_VERSION_STRING
@ -47,4 +47,4 @@ BEGIN
END
END
IDI_ICON1 ICON DISCARDABLE "resources\etracericon.ico"
IDI_APPLICATION ICON DISCARDABLE "resources\etracericon.ico"