[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Wesnoth-cvs-commits] wesnoth/src editor/editor.cpp editor/editor_mai...
From: |
ott |
Subject: |
[Wesnoth-cvs-commits] wesnoth/src editor/editor.cpp editor/editor_mai... |
Date: |
Tue, 06 Sep 2005 10:00:06 -0400 |
CVSROOT: /cvsroot/wesnoth
Module name: wesnoth
Branch:
Changes by: ott <address@hidden> 05/09/06 14:00:06
Modified files:
src/editor : editor.cpp editor_main.cpp scenario_editor.cpp
scenario_editor.hpp
src/sdl_ttf : SDL_ttf.c
src/server : server.cpp
src/widgets : menu.cpp scrollarea.cpp
Log message:
codeclean
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/editor/editor.cpp.diff?tr1=1.113&tr2=1.114&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/editor/editor_main.cpp.diff?tr1=1.37&tr2=1.38&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/editor/scenario_editor.cpp.diff?tr1=1.5&tr2=1.6&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/editor/scenario_editor.hpp.diff?tr1=1.6&tr2=1.7&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/sdl_ttf/SDL_ttf.c.diff?tr1=1.7&tr2=1.8&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/server/server.cpp.diff?tr1=1.86&tr2=1.87&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/widgets/menu.cpp.diff?tr1=1.100&tr2=1.101&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/widgets/scrollarea.cpp.diff?tr1=1.14&tr2=1.15&r1=text&r2=text
Patches:
Index: wesnoth/src/editor/editor.cpp
diff -u wesnoth/src/editor/editor.cpp:1.113 wesnoth/src/editor/editor.cpp:1.114
--- wesnoth/src/editor/editor.cpp:1.113 Sun Aug 21 16:36:56 2005
+++ wesnoth/src/editor/editor.cpp Tue Sep 6 14:00:05 2005
@@ -140,22 +140,22 @@
{
// Clear all previous tooltips
tooltips::clear_tooltips();
-
+
// Add tooltips to all buttons
const theme &t = gui_.get_theme();
const std::vector<theme::menu> &menus = t.menus();
std::vector<theme::menu>::const_iterator it;
for (it = menus.begin(); it != menus.end(); it++) {
-
+
// Get the button's screen location
SDL_Rect screen;
screen.x = 0; screen.y = 0; screen.w = gui_.x(); screen.h =
gui_.y();
-
+
const SDL_Rect tooltip_rect = (*it).location(screen);
std::string text = "";
- const std::vector<std::string> &menu_items = (*it).items();
- if (menu_items.size() == 1) {
+ const std::vector<std::string> &menu_items = (*it).items();
+ if (menu_items.size() == 1) {
if(menu_items.back() == "editdraw")
text = _("Draw tiles");
else if(menu_items.back() == "editfloodfill")
@@ -179,7 +179,7 @@
else if(menu_items.back() == "editflip")
text = _("Flip map");
}
-
+
if(text != "")
tooltips::add_tooltip(tooltip_rect, text);
}
@@ -204,7 +204,7 @@
void map_editor::handle_event(const SDL_Event &event) {
if (event.type == SDL_VIDEORESIZE) {
everything_dirty_ = true;
- }
+ }
int mousex, mousey;
SDL_GetMouseState(&mousex,&mousey);
@@ -363,7 +363,7 @@
get_dir(get_dir(get_user_data_dir() + "/editor") + "/maps/");
std::string input_name = filename_.empty() ? default_dir : filename_;
const std::string old_input_name = input_name;
-
+
int res = 0;
int overwrite = 1;
do {
@@ -375,7 +375,7 @@
if(!verify_filename(input_name, true))
{
input_name = old_input_name;
- continue;
+ continue;
}
else if (file_exists(input_name)) {
overwrite = gui::show_dialog(gui_, NULL, "",
@@ -464,7 +464,7 @@
if(!verify_filename(fn, false)) {
gui::show_dialog(gui_, NULL, "", _("Warning: Illegal
characters found in the map name. You've to save under a different name."),
gui::OK_ONLY);
}
-
+
std::string new_map;
try {
new_map = load_map(fn);
@@ -1106,13 +1106,13 @@
filename_ = filename;
}
- // Check if the filename is correct before saving. We do this
+ // Check if the filename is correct before saving. We do this
// twice (also in the 'save as' routine), because a file might
// already contain illegal characters if loaded.
if(!verify_filename(filename, display_confirmation)) {
return false;
}
-
+
try {
write_file(filename, map_.write());
num_operations_since_save_ = 0;
@@ -1136,7 +1136,7 @@
static const std::string allowed_characters =
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_/\\.";
static const std::string prefix = "\\/";
std::size_t start_pos = filename.find_last_of(prefix);
-
+
if(filename.find_first_not_of(allowed_characters, start_pos) !=
std::string::npos) {
if(show_error) {
gui::show_dialog(gui_, NULL, "", _("Error: Illegal
character in filename."), gui::OK_ONLY);
Index: wesnoth/src/editor/editor_main.cpp
diff -u wesnoth/src/editor/editor_main.cpp:1.37
wesnoth/src/editor/editor_main.cpp:1.38
--- wesnoth/src/editor/editor_main.cpp:1.37 Wed Jul 20 06:51:01 2005
+++ wesnoth/src/editor/editor_main.cpp Tue Sep 6 14:00:05 2005
@@ -216,7 +216,7 @@
#if defined(__APPLE__)
defines_map["APPLE"] = preproc_define();
#endif
-
+
//Set the locale first, then read the configuration, or else WML
//strings are not correctly translated. Does this work on on the win32
//platform?
Index: wesnoth/src/editor/scenario_editor.cpp
diff -u wesnoth/src/editor/scenario_editor.cpp:1.5
wesnoth/src/editor/scenario_editor.cpp:1.6
--- wesnoth/src/editor/scenario_editor.cpp:1.5 Wed Jul 20 08:56:52 2005
+++ wesnoth/src/editor/scenario_editor.cpp Tue Sep 6 14:00:05 2005
@@ -1,4 +1,4 @@
-/* $Id: scenario_editor.cpp,v 1.5 2005/07/20 08:56:52 ott Exp $ */
+/* $Id: scenario_editor.cpp,v 1.6 2005/09/06 14:00:05 ott Exp $ */
/*
Copyright (C) 2003-5 by David White <address@hidden>
Part of the Battle for Wesnoth Project http://www.wesnoth.org/
@@ -91,4 +91,4 @@
void scenario_editor::edit_set_terrain()
{
-}
\ No newline at end of file
+}
Index: wesnoth/src/editor/scenario_editor.hpp
diff -u wesnoth/src/editor/scenario_editor.hpp:1.6
wesnoth/src/editor/scenario_editor.hpp:1.7
--- wesnoth/src/editor/scenario_editor.hpp:1.6 Wed Jul 20 08:56:52 2005
+++ wesnoth/src/editor/scenario_editor.hpp Tue Sep 6 14:00:05 2005
@@ -1,4 +1,4 @@
-/* $Id: scenario_editor.hpp,v 1.6 2005/07/20 08:56:52 ott Exp $ */
+/* $Id: scenario_editor.hpp,v 1.7 2005/09/06 14:00:05 ott Exp $ */
/*
Copyright (C) 2003-5 by David White <address@hidden>
Part of the Battle for Wesnoth Project http://www.wesnoth.org/
@@ -66,4 +66,4 @@
std::vector<team> teams_;
};
-#endif
\ No newline at end of file
+#endif
Index: wesnoth/src/sdl_ttf/SDL_ttf.c
diff -u wesnoth/src/sdl_ttf/SDL_ttf.c:1.7 wesnoth/src/sdl_ttf/SDL_ttf.c:1.8
--- wesnoth/src/sdl_ttf/SDL_ttf.c:1.7 Sat Mar 19 10:26:43 2005
+++ wesnoth/src/sdl_ttf/SDL_ttf.c Tue Sep 6 14:00:05 2005
@@ -20,7 +20,7 @@
address@hidden
*/
-/* $Id: SDL_ttf.c,v 1.7 2005/03/19 10:26:43 gruikya Exp $ */
+/* $Id: SDL_ttf.c,v 1.8 2005/09/06 14:00:05 ott Exp $ */
#include <math.h>
#include <stdio.h>
@@ -304,12 +304,12 @@
/* Make sure that our font face is scalable (global metrics) */
if ( FT_IS_SCALABLE(face) ) {
- /* Set the character size and use default DPI (72) */
- error = FT_Set_Char_Size( font->face, 0, ptsize * 64, 0, 0 );
+ /* Set the character size and use default DPI (72) */
+ error = FT_Set_Char_Size( font->face, 0, ptsize * 64, 0, 0 );
if( error ) {
- TTF_SetFTError( "Couldn't set font size", error );
- TTF_CloseFont( font );
- return NULL;
+ TTF_SetFTError( "Couldn't set font size", error );
+ TTF_CloseFont( font );
+ return NULL;
}
/* Get the scalable font metrics for this font */
@@ -332,17 +332,17 @@
error = FT_Set_Pixel_Sizes( face,
face->available_sizes[ptsize].height,
face->available_sizes[ptsize].width );
- /* With non-scalale fonts, Freetype2 likes to fill many of the
+ /* With non-scalale fonts, Freetype2 likes to fill many of the
* font metrics with the value of 0. The size of the
* non-scalable fonts must be determined differently
* or sometimes cannot be determined.
* */
- font->ascent = face->available_sizes[ptsize].height;
- font->descent = 0;
- font->height = face->available_sizes[ptsize].height;
- font->lineskip = FT_CEIL(font->ascent);
- font->underline_offset = FT_FLOOR(face->underline_position);
- font->underline_height = FT_FLOOR(face->underline_thickness);
+ font->ascent = face->available_sizes[ptsize].height;
+ font->descent = 0;
+ font->height = face->available_sizes[ptsize].height;
+ font->lineskip = FT_CEIL(font->ascent);
+ font->underline_offset = FT_FLOOR(face->underline_position);
+ font->underline_height = FT_FLOOR(face->underline_thickness);
}
if ( font->underline_height < 1 ) {
@@ -403,7 +403,7 @@
}
glyph->cached = 0;
}
-
+
static void Flush_Cache( TTF_Font* font )
{
int i;
@@ -475,7 +475,7 @@
cached->yoffset = 0;
cached->advance = FT_CEIL(metrics->horiAdvance);
}
-
+
/* Adjust for bold and italic text */
if( font->style & TTF_STYLE_BOLD ) {
cached->maxx += font->glyph_overhang;
@@ -577,7 +577,7 @@
* shades of gray. Instead, it
* returns a black and white surface
* and we have to translate it back
- * to a 256 gray shaded surface.
+ * to a 256 gray shaded surface.
* */
unsigned char *srcp = src->buffer +
soffset;
unsigned char *dstp = dst->buffer +
doffset;
@@ -891,8 +891,8 @@
/* handle kerning */
if ( use_kerning && prev_index && glyph->index ) {
- FT_Vector delta;
- FT_Get_Kerning( font->face, prev_index, glyph->index,
ft_kerning_default, &delta );
+ FT_Vector delta;
+ FT_Get_Kerning( font->face, prev_index, glyph->index,
ft_kerning_default, &delta );
x += delta.x >> 6;
}
@@ -912,10 +912,10 @@
* work out correctly.
* */
z -= glyph->minx;
-
+
}
#endif
-
+
z = x + glyph->minx;
if ( minx > z ) {
minx = z;
@@ -1060,7 +1060,7 @@
/* check kerning */
use_kerning = FT_HAS_KERNING( font->face );
-
+
/* Load and render each character */
xstart = 0;
swapped = TTF_byteswapped;
@@ -1099,15 +1099,15 @@
}
/* do kerning, if possible AC-Patch */
if ( use_kerning && prev_index && glyph->index ) {
- FT_Vector delta;
- FT_Get_Kerning( font->face, prev_index, glyph->index,
ft_kerning_default, &delta );
+ FT_Vector delta;
+ FT_Get_Kerning( font->face, prev_index, glyph->index,
ft_kerning_default, &delta );
xstart += delta.x >> 6;
}
/* Compensate for wrap around bug with negative minx's */
if ( (ch == text) && (glyph->minx < 0) ) {
xstart -= glyph->minx;
}
-
+
for( row = 0; row < current->rows; ++row ) {
/* Make sure we don't go either over, or under the
* limit */
@@ -1322,7 +1322,7 @@
/* check kerning */
use_kerning = FT_HAS_KERNING( font->face );
-
+
/* Load and render each character */
xstart = 0;
swapped = TTF_byteswapped;
@@ -1360,15 +1360,15 @@
}
/* do kerning, if possible AC-Patch */
if ( use_kerning && prev_index && glyph->index ) {
- FT_Vector delta;
- FT_Get_Kerning( font->face, prev_index, glyph->index,
ft_kerning_default, &delta );
+ FT_Vector delta;
+ FT_Get_Kerning( font->face, prev_index, glyph->index,
ft_kerning_default, &delta );
xstart += delta.x >> 6;
}
/* Compensate for the wrap around with negative minx's */
if ( (ch == text) && (glyph->minx < 0) ) {
xstart -= glyph->minx;
}
-
+
current = &glyph->pixmap;
for( row = 0; row < current->rows; ++row ) {
/* Make sure we don't go either over, or under the
@@ -1570,7 +1570,7 @@
/* check kerning */
use_kerning = FT_HAS_KERNING( font->face );
-
+
/* Load and render each character */
xstart = 0;
swapped = TTF_byteswapped;
@@ -1609,11 +1609,11 @@
}
/* do kerning, if possible AC-Patch */
if ( use_kerning && prev_index && glyph->index ) {
- FT_Vector delta;
- FT_Get_Kerning( font->face, prev_index, glyph->index,
ft_kerning_default, &delta );
+ FT_Vector delta;
+ FT_Get_Kerning( font->face, prev_index, glyph->index,
ft_kerning_default, &delta );
xstart += delta.x >> 6;
}
-
+
/* Compensate for the wrap around bug with negative minx's */
if ( (ch == text) && (glyph->minx < 0) ) {
xstart -= glyph->minx;
Index: wesnoth/src/server/server.cpp
diff -u wesnoth/src/server/server.cpp:1.86 wesnoth/src/server/server.cpp:1.87
--- wesnoth/src/server/server.cpp:1.86 Mon Jul 25 22:19:57 2005
+++ wesnoth/src/server/server.cpp Tue Sep 6 14:00:05 2005
@@ -1,4 +1,4 @@
-/* $Id: server.cpp,v 1.86 2005/07/25 22:19:57 j_daniel Exp $ */
+/* $Id: server.cpp,v 1.87 2005/09/06 14:00:05 ott Exp $ */
/*
Copyright (C) 2003-5 by David White <address@hidden>
Part of the Battle for Wesnoth Project http://www.wesnoth.org/
@@ -128,7 +128,7 @@
const config& cfg_;
std::set<std::string> accepted_versions_;
- std::map<std::string,config> redirected_versions_;
+ std::map<std::string,config> redirected_versions_;
std::map<std::string,config> proxy_versions_;
bool is_ip_banned(const std::string& ip);
@@ -462,7 +462,7 @@
}
}
}
-
+
return;
}
@@ -765,7 +765,7 @@
g->level().values["mp_fog"] = data["mp_fog"];
g->level().values["mp_shroud"] = data["mp_shroud"];
g->level().values["experience_modifier"] =
data["experience_modifier"];
-
+
//update our config object which describes the
//open games, and notifies the game of where its
description
//is located at
Index: wesnoth/src/widgets/menu.cpp
diff -u wesnoth/src/widgets/menu.cpp:1.100 wesnoth/src/widgets/menu.cpp:1.101
--- wesnoth/src/widgets/menu.cpp:1.100 Sun Aug 21 15:24:36 2005
+++ wesnoth/src/widgets/menu.cpp Tue Sep 6 14:00:05 2005
@@ -1,4 +1,4 @@
-/* $Id: menu.cpp,v 1.100 2005/08/21 15:24:36 gruikya Exp $ */
+/* $Id: menu.cpp,v 1.101 2005/09/06 14:00:05 ott Exp $ */
/*
Copyright (C) 2003-5 by David White <address@hidden>
Part of the Battle for Wesnoth Project http://www.wesnoth.org/
@@ -406,7 +406,7 @@
set_dirty();
}
-void menu::set_max_height(const int new_max_height)
+void menu::set_max_height(const int new_max_height)
{
max_height_ = new_max_height;
itemRects_.clear();
@@ -414,7 +414,7 @@
update_size();
}
-void menu::set_max_width(const int new_max_width)
+void menu::set_max_width(const int new_max_width)
{
max_width_ = new_max_width;
}
Index: wesnoth/src/widgets/scrollarea.cpp
diff -u wesnoth/src/widgets/scrollarea.cpp:1.14
wesnoth/src/widgets/scrollarea.cpp:1.15
--- wesnoth/src/widgets/scrollarea.cpp:1.14 Sun Aug 21 13:11:28 2005
+++ wesnoth/src/widgets/scrollarea.cpp Tue Sep 6 14:00:05 2005
@@ -1,4 +1,4 @@
-/* $Id: scrollarea.cpp,v 1.14 2005/08/21 13:11:28 gruikya Exp $*/
+/* $Id: scrollarea.cpp,v 1.15 2005/09/06 14:00:05 ott Exp $*/
/*
Copyright (C) 2004 by Guillaume Melquiond <address@hidden>
Part of the Battle for Wesnoth Project http://www.wesnoth.org/
@@ -44,7 +44,7 @@
scrollbar_.set_location(r);
r.x -= w;
r.w = w;
- }
+ }
if (!hidden())
scrollbar_.hide(!shown_scrollbar_);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Wesnoth-cvs-commits] wesnoth/src editor/editor.cpp editor/editor_mai...,
ott <=