gosu 0.13.3 → 0.14.0.pre2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (80) hide show
  1. checksums.yaml +4 -4
  2. data/Gosu/Audio.hpp +15 -11
  3. data/Gosu/Font.hpp +24 -20
  4. data/Gosu/Fwd.hpp +1 -1
  5. data/Gosu/Graphics.hpp +8 -9
  6. data/Gosu/ImageData.hpp +1 -1
  7. data/Gosu/Input.hpp +1 -1
  8. data/Gosu/Math.hpp +0 -18
  9. data/Gosu/Text.hpp +22 -30
  10. data/Gosu/TextInput.hpp +13 -0
  11. data/Gosu/Utility.hpp +2 -0
  12. data/Gosu/Window.hpp +3 -3
  13. data/README.md +3 -4
  14. data/ext/gosu/extconf.rb +7 -9
  15. data/lib/gosu/swig_patches.rb +1 -4
  16. data/rdoc/gosu.rb +34 -9
  17. data/src/Audio.cpp +6 -6
  18. data/src/AudioImpl.cpp +2 -2
  19. data/src/Bitmap.cpp +1 -2
  20. data/src/BitmapIO.cpp +21 -2
  21. data/src/BlockAllocator.cpp +1 -1
  22. data/src/Channel.cpp +7 -1
  23. data/src/ClipRectStack.hpp +4 -1
  24. data/src/Color.cpp +2 -1
  25. data/src/DirectoriesWin.cpp +1 -1
  26. data/src/DrawOp.hpp +8 -4
  27. data/src/DrawOpQueue.hpp +13 -24
  28. data/src/FileUnix.cpp +3 -1
  29. data/src/Font.cpp +92 -96
  30. data/src/GosuGLView.cpp +59 -31
  31. data/src/GosuGLView.hpp +14 -0
  32. data/src/GosuViewController.cpp +21 -21
  33. data/src/{GosuViewController.h → GosuViewController.hpp} +2 -4
  34. data/src/Graphics.cpp +71 -38
  35. data/src/GraphicsImpl.hpp +12 -29
  36. data/src/Image.cpp +5 -7
  37. data/src/Input.cpp +7 -5
  38. data/src/InputUIKit.cpp +19 -37
  39. data/src/Macro.cpp +10 -2
  40. data/src/MarkupParser.cpp +241 -0
  41. data/src/MarkupParser.hpp +61 -0
  42. data/src/Math.cpp +1 -1
  43. data/src/OffScreenTarget.cpp +99 -0
  44. data/src/OffScreenTarget.hpp +23 -0
  45. data/src/OggFile.hpp +10 -0
  46. data/src/RenderState.hpp +0 -2
  47. data/src/Resolution.cpp +2 -2
  48. data/src/RubyGosu.cxx +457 -244
  49. data/src/TexChunk.cpp +8 -6
  50. data/src/Text.cpp +58 -345
  51. data/src/TextBuilder.cpp +138 -0
  52. data/src/TextBuilder.hpp +55 -0
  53. data/src/TextInput.cpp +27 -10
  54. data/src/Texture.cpp +22 -17
  55. data/src/Texture.hpp +19 -20
  56. data/src/TimingApple.cpp +5 -7
  57. data/src/TimingUnix.cpp +1 -4
  58. data/src/TimingWin.cpp +4 -1
  59. data/src/TrueTypeFont.cpp +282 -0
  60. data/src/TrueTypeFont.hpp +66 -0
  61. data/src/TrueTypeFontApple.cpp +65 -0
  62. data/src/TrueTypeFontUnix.cpp +91 -0
  63. data/src/TrueTypeFontWin.cpp +82 -0
  64. data/src/Utility.cpp +40 -0
  65. data/src/Window.cpp +7 -6
  66. data/src/WindowUIKit.cpp +9 -4
  67. data/src/stb_truetype.h +4589 -0
  68. data/src/utf8proc.c +755 -0
  69. data/src/utf8proc.h +699 -0
  70. data/src/utf8proc_data.h +14386 -0
  71. metadata +23 -16
  72. data/src/FormattedString.cpp +0 -237
  73. data/src/FormattedString.hpp +0 -47
  74. data/src/GosuAppDelegate.cpp +0 -30
  75. data/src/GosuAppDelegate.h +0 -8
  76. data/src/GosuGLView.h +0 -8
  77. data/src/TextApple.cpp +0 -212
  78. data/src/TextTTFWin.cpp +0 -197
  79. data/src/TextUnix.cpp +0 -280
  80. data/src/TextWin.cpp +0 -191
@@ -1,7 +1,9 @@
1
1
  #include <Gosu/Platform.hpp>
2
2
  #if defined(GOSU_IS_IPHONE)
3
3
 
4
- #import "GosuGLView.h"
4
+ #import "GosuGLView.hpp"
5
+ #import <Gosu/Input.hpp>
6
+ #import <Gosu/TextInput.hpp>
5
7
 
6
8
  #import <OpenGLES/EAGL.h>
7
9
  #import <OpenGLES/EAGLDrawable.h>
@@ -9,6 +11,7 @@
9
11
  #import <OpenGLES/ES1/glext.h>
10
12
  #import <QuartzCore/QuartzCore.h>
11
13
 
14
+
12
15
  static EAGLContext __weak* globalContext;
13
16
 
14
17
  namespace Gosu
@@ -28,7 +31,7 @@ namespace Gosu
28
31
  @implementation GosuGLView
29
32
  {
30
33
  EAGLContext* _context;
31
-
34
+
32
35
  GLint _backingWidth;
33
36
  GLint _backingHeight;
34
37
 
@@ -36,41 +39,22 @@ namespace Gosu
36
39
  GLuint _viewFramebuffer;
37
40
  }
38
41
 
39
- + (Class)layerClass
40
- {
41
- return [CAEAGLLayer class];
42
- }
43
-
44
- - (id)initWithFrame:(CGRect)frame
45
- {
46
- if ((self = [super initWithFrame:frame])) {
47
- [self initializeGosuGLView];
48
- }
49
-
50
- return self;
51
- }
52
-
53
- - (id)initWithCoder:(NSCoder*)aDecoder
42
+ - (instancetype)initWithFrame:(CGRect)frame
54
43
  {
55
- if ((self = [super initWithCoder:aDecoder])) {
56
- [self initializeGosuGLView];
44
+ if (self = [super initWithFrame:frame]) {
45
+ CAEAGLLayer* layer = (CAEAGLLayer*)self.layer;
46
+ layer.opaque = YES;
47
+
48
+ globalContext = _context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES1];
49
+ [EAGLContext setCurrentContext:_context];
50
+
51
+ self.exclusiveTouch = YES;
52
+ self.multipleTouchEnabled = YES;
57
53
  }
58
54
 
59
55
  return self;
60
56
  }
61
57
 
62
- - (void)initializeGosuGLView
63
- {
64
- CAEAGLLayer* layer = (CAEAGLLayer*)self.layer;
65
- layer.opaque = YES;
66
-
67
- globalContext = _context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES1];
68
- [EAGLContext setCurrentContext:_context];
69
-
70
- self.exclusiveTouch = YES;
71
- self.multipleTouchEnabled = YES;
72
- }
73
-
74
58
  - (void)dealloc
75
59
  {
76
60
  [EAGLContext setCurrentContext:nil];
@@ -93,6 +77,13 @@ namespace Gosu
93
77
  [_context presentRenderbuffer:GL_RENDERBUFFER_OES];
94
78
  }
95
79
 
80
+ #pragma mark - UIView
81
+
82
+ + (Class)layerClass
83
+ {
84
+ return [CAEAGLLayer class];
85
+ }
86
+
96
87
  - (void)layoutSubviews
97
88
  {
98
89
  [EAGLContext setCurrentContext:_context];
@@ -128,6 +119,43 @@ namespace Gosu
128
119
  _viewRenderbuffer = 0;
129
120
  }
130
121
 
122
+ #pragma mark - NSResponder / UIKeyInput / UITextInputTraits
123
+
124
+ - (BOOL)canBecomeFirstResponder
125
+ {
126
+ return _input && _input->text_input();
127
+ }
128
+
129
+ - (BOOL)hasText
130
+ {
131
+ return _input && _input->text_input() && !_input->text_input()->text().empty();
132
+ }
133
+
134
+ - (void)insertText:(NSString*)text
135
+ {
136
+ if (_input && _input->text_input()) {
137
+ auto filtered_text = _input->text_input()->filter(text.UTF8String ?: "");
138
+ _input->text_input()->insert_text(filtered_text);
139
+ }
140
+ }
141
+
142
+ - (void)deleteBackward
143
+ {
144
+ if (_input && _input->text_input()) {
145
+ _input->text_input()->delete_backward();
146
+ }
147
+ }
148
+
149
+ - (UITextAutocapitalizationType)autocapitalizationType
150
+ {
151
+ return UITextAutocapitalizationTypeNone;
152
+ }
153
+
154
+ - (UITextAutocorrectionType)autocorrectionType
155
+ {
156
+ return UITextAutocorrectionTypeNo;
157
+ }
158
+
131
159
  @end
132
160
 
133
161
  #endif
@@ -0,0 +1,14 @@
1
+ #import <UIKit/UIKit.h>
2
+ #import <Gosu/Fwd.hpp>
3
+
4
+ @interface GosuGLView : UIView <UIKeyInput>
5
+
6
+ - (instancetype)initWithFrame:(CGRect)frame NS_DESIGNATED_INITIALIZER;
7
+ - (instancetype)initWithCoder:(NSCoder*)aDecoder NS_UNAVAILABLE;
8
+
9
+ - (void)redrawGL:(void (^)())code;
10
+
11
+ // This property must be set in order for TextInput handling to work.
12
+ @property (nonatomic, assign) Gosu::Input* input;
13
+
14
+ @end
@@ -1,8 +1,8 @@
1
1
  #include <Gosu/Platform.hpp>
2
2
  #if defined(GOSU_IS_IPHONE)
3
3
 
4
- #import "GosuGLView.h"
5
- #import "GosuViewController.h"
4
+ #import "GosuGLView.hpp"
5
+ #import "GosuViewController.hpp"
6
6
  #import "GraphicsImpl.hpp"
7
7
  #import "AudioImpl.hpp"
8
8
  #import <Gosu/Gosu.hpp>
@@ -52,21 +52,11 @@ static void handle_audio_interruption(void* unused, UInt32 inInterruptionState)
52
52
  return YES;
53
53
  }
54
54
 
55
- - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
56
- {
57
- return UIInterfaceOrientationIsLandscape(interfaceOrientation);
58
- }
59
-
60
55
  - (NSUInteger)supportedInterfaceOrientations
61
56
  {
62
57
  return UIInterfaceOrientationMaskLandscape;
63
58
  }
64
59
 
65
- - (GosuGLView*)GLView
66
- {
67
- return (GosuGLView*)self.view;
68
- }
69
-
70
60
  - (Gosu::Window&)gosuWindowReference
71
61
  {
72
62
  NSAssert(self.gosuWindow, @"gosuWindow needs to be set before showing GosuViewController");
@@ -80,6 +70,7 @@ static void handle_audio_interruption(void* unused, UInt32 inInterruptionState)
80
70
  {
81
71
  [super viewDidLoad];
82
72
 
73
+ // TODO - replace with AVAudioSession https://stackoverflow.com/q/19710046
83
74
  AudioSessionInitialize(nullptr, nullptr, handle_audio_interruption, nullptr);
84
75
 
85
76
  [[NSNotificationCenter defaultCenter] addObserver:self
@@ -151,15 +142,13 @@ static void handle_audio_interruption(void* unused, UInt32 inInterruptionState)
151
142
 
152
143
  - (void)setupTimerOrDisplayLink
153
144
  {
154
- if (_timerOrDisplayLink) {
155
- return;
156
- }
145
+ if (_timerOrDisplayLink) return;
157
146
 
158
147
  NSInteger targetFPS = round(1000.0 / self.gosuWindowReference.update_interval());
159
148
 
160
149
  if (60 % targetFPS != 0) {
161
150
  NSTimeInterval interval = self.gosuWindowReference.update_interval() / 1000.0;
162
- NSTimer* timer = [NSTimer scheduledTimerWithTimeInterval:interval
151
+ NSTimer* timer = [NSTimer scheduledTimerWithTimeInterval:interval
163
152
  target:self
164
153
  selector:@selector(updateAndDraw:)
165
154
  userInfo:nil
@@ -188,7 +177,7 @@ static void handle_audio_interruption(void* unused, UInt32 inInterruptionState)
188
177
  }
189
178
 
190
179
  if (window.needs_redraw()) {
191
- [self.GLView redrawGL:^{
180
+ [(GosuGLView*)self.view redrawGL:^{
192
181
  window.graphics().frame([&window] {
193
182
  window.draw();
194
183
  Gosu::FPS::register_frame();
@@ -199,26 +188,37 @@ static void handle_audio_interruption(void* unused, UInt32 inInterruptionState)
199
188
  Gosu::Song::update();
200
189
  }
201
190
 
191
+ #pragma mark - Input setup
192
+
193
+ - (void)trackTextInput:(Gosu::Input&)input
194
+ {
195
+ ((GosuGLView*)self.view).input = &input;
196
+ }
197
+
202
198
  #pragma mark - Touch forwarding
203
199
 
204
200
  - (void)touchesBegan:(NSSet*)touches withEvent:(UIEvent*)event
205
201
  {
206
- self.gosuWindowReference.input().feed_touch_event(0, (__bridge void*) touches);
202
+ auto& input = self.gosuWindowReference.input();
203
+ input.feed_touch_event(input.on_touch_began, (__bridge void*)touches);
207
204
  }
208
205
 
209
206
  - (void)touchesMoved:(NSSet*)touches withEvent:(UIEvent*)event
210
207
  {
211
- self.gosuWindowReference.input().feed_touch_event(1, (__bridge void*) touches);
208
+ auto& input = self.gosuWindowReference.input();
209
+ input.feed_touch_event(input.on_touch_moved, (__bridge void*)touches);
212
210
  }
213
211
 
214
212
  - (void)touchesEnded:(NSSet*)touches withEvent:(UIEvent*)event
215
213
  {
216
- self.gosuWindowReference.input().feed_touch_event(2, (__bridge void*) touches);
214
+ auto& input = self.gosuWindowReference.input();
215
+ input.feed_touch_event(input.on_touch_ended, (__bridge void*)touches);
217
216
  }
218
217
 
219
218
  - (void)touchesCancelled:(NSSet*)touches withEvent:(UIEvent*)event
220
219
  {
221
- self.gosuWindowReference.input().feed_touch_event(3, (__bridge void*) touches);
220
+ auto& input = self.gosuWindowReference.input();
221
+ input.feed_touch_event(input.on_touch_cancelled, (__bridge void*)touches);
222
222
  }
223
223
 
224
224
  @end
@@ -1,12 +1,10 @@
1
1
  #import <UIKit/UIKit.h>
2
-
3
-
4
- @class GosuGLView;
2
+ #import <Gosu/Fwd.hpp>
5
3
 
6
4
 
7
5
  @interface GosuViewController : UIViewController
8
6
 
9
- - (GosuGLView *)GLView;
7
+ - (void)trackTextInput:(Gosu::Input&)input;
10
8
 
11
9
  @property (nonatomic, assign) void *gosuWindow;
12
10
 
@@ -4,7 +4,7 @@
4
4
  #include "GraphicsImpl.hpp"
5
5
  #include "LargeImageData.hpp"
6
6
  #include "Macro.hpp"
7
- #include "TexChunk.hpp"
7
+ #include "OffScreenTarget.hpp"
8
8
  #include "Texture.hpp"
9
9
  #include <Gosu/Bitmap.hpp>
10
10
  #include <Gosu/Image.hpp>
@@ -26,7 +26,6 @@ namespace Gosu
26
26
  if (current_graphics_pointer == nullptr) {
27
27
  throw logic_error("Gosu::Graphics can only be drawn to while rendering");
28
28
  }
29
-
30
29
  return *current_graphics_pointer;
31
30
  }
32
31
 
@@ -160,45 +159,44 @@ void Gosu::Graphics::frame(const function<void ()>& f)
160
159
  }
161
160
  else {
162
161
  // Create default draw-op queue.
163
- queues.resize(1);
162
+ queues.emplace_back(QM_RENDER_TO_SCREEN);
164
163
  }
165
164
 
166
165
  queues.back().set_base_transform(pimpl->base_transform);
167
166
 
167
+ ensure_current_context();
168
168
  glClearColor(0, 0, 0, 1);
169
- glClear(GL_COLOR_BUFFER_BIT);
170
-
169
+ glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
170
+
171
171
  current_graphics_pointer = this;
172
172
 
173
173
  f();
174
174
 
175
- // If recording is in process, cancel it.
176
- while (current_queue().recording()) {
177
- queues.pop_back();
178
- }
175
+ // Cancel all intermediate queues that have not been cleaned up.
176
+ while (queues.size() > 1) queues.pop_back();
179
177
 
180
178
  flush();
181
179
 
182
180
  if (pimpl->black_height || pimpl->black_width) {
183
181
  if (pimpl->black_height) {
184
182
  draw_quad(0, -pimpl->black_height, Color::BLACK,
185
- width(), -pimpl->black_height, Color::BLACK,
186
- 0, 0, Color::BLACK,
187
- width(), 0, Color::BLACK, 0);
183
+ width(), -pimpl->black_height, Color::BLACK,
184
+ 0, 0, Color::BLACK,
185
+ width(), 0, Color::BLACK, 0);
188
186
  draw_quad(0, height(), Color::BLACK,
189
- width(), height(), Color::BLACK,
190
- 0, height() + pimpl->black_height, Color::BLACK,
191
- width(), height() + pimpl->black_height, Color::BLACK, 0);
187
+ width(), height(), Color::BLACK,
188
+ 0, height() + pimpl->black_height, Color::BLACK,
189
+ width(), height() + pimpl->black_height, Color::BLACK, 0);
192
190
  }
193
191
  if (pimpl->black_width) {
194
192
  draw_quad(-pimpl->black_width, 0, Color::BLACK,
195
- 0, 0, Color::BLACK,
196
- -pimpl->black_width, height(), Color::BLACK,
197
- 0, height(), Color::BLACK, 0);
193
+ 0, 0, Color::BLACK,
194
+ -pimpl->black_width, height(), Color::BLACK,
195
+ 0, height(), Color::BLACK, 0);
198
196
  draw_quad(width(), 0, Color::BLACK,
199
- width() + pimpl->black_width, 0, Color::BLACK,
200
- width(), height(), Color::BLACK,
201
- width() + pimpl->black_width, height(), Color::BLACK, 0);
197
+ width() + pimpl->black_width, 0, Color::BLACK,
198
+ width(), height(), Color::BLACK,
199
+ width() + pimpl->black_width, height(), Color::BLACK, 0);
202
200
  }
203
201
  flush();
204
202
  }
@@ -219,13 +217,13 @@ void Gosu::Graphics::frame(const function<void ()>& f)
219
217
 
220
218
  void Gosu::Graphics::flush()
221
219
  {
222
- current_queue().perform_draw_ops_andCode();
220
+ current_queue().perform_draw_ops_and_code();
223
221
  current_queue().clear_queue();
224
222
  }
225
223
 
226
224
  void Gosu::Graphics::gl(const function<void ()>& f)
227
225
  {
228
- if (current_queue().recording()) {
226
+ if (current_queue().mode() == QM_RECORD_MACRO) {
229
227
  throw logic_error("Custom OpenGL is not allowed while creating a macro");
230
228
  }
231
229
 
@@ -267,17 +265,53 @@ void Gosu::Graphics::clip_to(double x, double y, double width, double height,
267
265
  current_queue().end_clipping();
268
266
  }
269
267
 
270
- unique_ptr<Gosu::ImageData> Gosu::Graphics::record(int width, int height,
271
- const function<void ()>& f)
268
+ Gosu::Image Gosu::Graphics::render(int width, int height, const function<void ()>& f)
269
+ {
270
+ ensure_current_context();
271
+
272
+ // Prepare for rendering at the requested size, but save the previous matrix and viewport.
273
+ glMatrixMode(GL_PROJECTION);
274
+ glPushMatrix();
275
+ glLoadIdentity();
276
+ GLint prev_viewport[4];
277
+ glGetIntegerv(GL_VIEWPORT, prev_viewport);
278
+ glViewport(0, 0, width, height);
279
+ // Note the flipped vertical axis in the glOrtho call - this is so we don't have to vertically
280
+ // flip the texture afterwards.
281
+ #ifdef GOSU_IS_OPENGLES
282
+ glOrthof(0, width, 0, height, -1, 1);
283
+ #else
284
+ glOrtho(0, width, 0, height, -1, 1);
285
+ #endif
286
+
287
+ // This is the actual render-to-texture step.
288
+ Image result = OffScreenTarget(width, height).render([&] {
289
+ glClearColor(0, 0, 0, 0);
290
+ glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
291
+ queues.emplace_back(QM_RENDER_TO_SCREEN);
292
+ f();
293
+ queues.back().perform_draw_ops_and_code();
294
+ queues.pop_back();
295
+ glFlush();
296
+ });
297
+
298
+ // Restore previous matrix and glViewport.
299
+ glMatrixMode(GL_PROJECTION);
300
+ glPopMatrix();
301
+ glViewport(prev_viewport[0], prev_viewport[1], prev_viewport[2], prev_viewport[3]);
302
+
303
+ return result;
304
+ }
305
+
306
+ Gosu::Image Gosu::Graphics::record(int width, int height, const function<void ()>& f)
272
307
  {
273
- queues.resize(queues.size() + 1);
274
- current_queue().set_recording();
308
+ queues.emplace_back(QM_RECORD_MACRO);
275
309
 
276
310
  f();
277
311
 
278
312
  unique_ptr<ImageData> result(new Macro(current_queue(), width, height));
279
313
  queues.pop_back();
280
- return result;
314
+ return Image(move(result));
281
315
  }
282
316
 
283
317
  void Gosu::Graphics::transform(const Gosu::Transform& transform, const function<void ()>& f)
@@ -386,21 +420,21 @@ unique_ptr<Gosu::ImageData> Gosu::Graphics::create_image(const Bitmap& src,
386
420
  src_width == src_height &&
387
421
  (src_width & (src_width - 1)) == 0 &&
388
422
  src_width >= 64 && src_width <= max_size) {
389
- shared_ptr<Texture> texture(new Texture(src_width, wants_retro));
423
+ shared_ptr<Texture> texture(new Texture(src_width, src_height, wants_retro));
390
424
  unique_ptr<ImageData> data;
391
425
 
392
426
  // Use the source bitmap directly if the source area completely covers
393
427
  // it.
394
428
  if (src_x == 0 && src_width == src.width() && src_y == 0 && src_height == src.height()) {
395
- data = texture->try_alloc(texture, src, 0);
429
+ data = texture->try_alloc(src, 0);
396
430
  }
397
431
  else {
398
432
  Bitmap bmp(src_width, src_height);
399
433
  bmp.insert(src, 0, 0, src_x, src_y, src_width, src_height);
400
- data = texture->try_alloc(texture, bmp, 0);
434
+ data = texture->try_alloc(bmp, 0);
401
435
  }
402
436
 
403
- if (!data.get()) throw logic_error("Internal texture block allocation error");
437
+ if (!data) throw logic_error("Internal texture block allocation error");
404
438
  return data;
405
439
  }
406
440
 
@@ -417,22 +451,21 @@ unique_ptr<Gosu::ImageData> Gosu::Graphics::create_image(const Bitmap& src,
417
451
  apply_border_flags(bmp, src, src_x, src_y, src_width, src_height, flags);
418
452
 
419
453
  // Try to put the bitmap into one of the already allocated textures.
420
- for (auto texture : textures) {
454
+ for (const auto& texture : textures) {
421
455
  if (texture->retro() != wants_retro) continue;
422
456
 
423
- unique_ptr<ImageData> data;
424
- data = texture->try_alloc(texture, bmp, 1);
425
- if (data.get()) return data;
457
+ unique_ptr<ImageData> data = texture->try_alloc(bmp, 1);
458
+ if (data) return data;
426
459
  }
427
460
 
428
461
  // All textures are full: Create a new one.
429
462
 
430
463
  shared_ptr<Texture> texture;
431
- texture.reset(new Texture(max_size, wants_retro));
464
+ texture.reset(new Texture(max_size, max_size, wants_retro));
432
465
  textures.push_back(texture);
433
466
 
434
467
  unique_ptr<ImageData> data;
435
- data = texture->try_alloc(texture, bmp, 1);
468
+ data = texture->try_alloc(bmp, 1);
436
469
  if (!data.get()) throw logic_error("Internal texture block allocation error");
437
470
  return data;
438
471
  }