Skip to content

Commit cdfc5ef

Browse files
committed
Updated geogram to v1.9.3
1 parent 805ac52 commit cdfc5ef

2 files changed

Lines changed: 17 additions & 18 deletions

File tree

src/lib/OGF/skin_imgui/types/icon_repository.cpp

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@
2525
* levy@loria.fr
2626
*
2727
* ISA Project
28-
* LORIA, INRIA Lorraine,
28+
* LORIA, INRIA Lorraine,
2929
* Campus Scientifique, BP 239
30-
* 54506 VANDOEUVRE LES NANCY CEDEX
30+
* 54506 VANDOEUVRE LES NANCY CEDEX
3131
* FRANCE
3232
*
3333
* Note that the GNU General Public License does not permit incorporating
34-
* the Software into proprietary programs.
34+
* the Software into proprietary programs.
3535
*/
36-
36+
3737

3838
#include <OGF/skin_imgui/types/icon_repository.h>
3939
#include <OGF/basic/os/file_manager.h>
@@ -60,7 +60,7 @@ namespace {
6060
return false;
6161
}
6262
Memory::byte* p = image.pixel_base(index_t(x),index_t(y));
63-
return (p[3] == 255);
63+
return (p[3] == 255);
6464
}
6565

6666
/**
@@ -71,7 +71,7 @@ namespace {
7171
if(has_color(image, int(x), int(y))) {
7272
return false;
7373
}
74-
for(int Y=int(y)-1; Y<int(y); ++Y) {
74+
for(int Y=int(y)-1; Y<int(y); ++Y) {
7575
for(int X=int(x)-1; X<int(x); ++X) {
7676
if(has_color(image, X, Y)) {
7777
return true;
@@ -89,7 +89,7 @@ namespace {
8989
FOR(y, image.height()) {
9090
FOR(x, image.width()) {
9191
if(in_gutter(image, x, y)) {
92-
image.pixel_base(x,y)[3]=155;
92+
image.pixel_base(x,y)[3]=155;
9393
}
9494
}
9595
}
@@ -123,14 +123,14 @@ namespace OGF {
123123
const std::string& icon_name, GLuint gl_texture
124124
) {
125125
if(icons_.find(icon_name) != icons_.end()) {
126-
Logger::err("IconRepository")
126+
Logger::err("IconRepository")
127127
<< "Icon \'" << icon_name
128128
<< "\' is already bound"
129129
<< std::endl;
130130
return;
131131
}
132132
Icon icon;
133-
icon.im_texture_id = nullptr;
133+
icon.im_texture_id = 0;
134134
icon.gl_texture_id = gl_texture;
135135
icons_[icon_name] = icon;
136136
}
@@ -149,7 +149,7 @@ namespace OGF {
149149
image = ImageLibrary::instance()->load_image(icon_file_name);
150150
if(!image.is_null()) {
151151
// Dammit, my png is flipped w.r.t. xpm (to be fixed)
152-
image->flip_vertically();
152+
image->flip_vertically();
153153
}
154154
}
155155
if(image.is_null()) {
@@ -160,33 +160,32 @@ namespace OGF {
160160
image = ImageLibrary::instance()->load_image(icon_file_name);
161161
}
162162
}
163-
163+
164164
if(image.is_null()) {
165165
if(not_found_.find(icon_name) == not_found_.end()) {
166-
Logger::err("IconRepository")
166+
Logger::err("IconRepository")
167167
<< "Icon \'" << icon_file_name << "\' :"
168168
<< "File not found"
169169
<< std::endl;
170170
}
171171
not_found_.insert(icon_file_name);
172172
return resolve_icon("no_icon");
173-
}
173+
}
174174

175175
process_background(*image);
176-
176+
177177
Texture texture;
178178
texture.create_from_image(image, mipmap ? GL_LINEAR : GL_NEAREST);
179-
179+
180180
IconRepository* non_const_this = const_cast<IconRepository*>(this);
181181
ogf_assert(non_const_this != nullptr );
182182
non_const_this->bind_icon(icon_name, texture.id());
183183
// Ensure that texture's destructor will not deallocate OpenGL
184184
// texture. Ownership is transferred to this IconRepository.
185185
texture.reset_id();
186-
186+
187187
it = icons_.find(icon_name);
188188
ogf_assert(it != icons_.end());
189189
return it->second.im_texture_id;
190190
}
191191
}
192-

0 commit comments

Comments
 (0)