mirror of
https://github.com/mmueller41/genode.git
synced 2026-01-21 12:32:56 +01:00
@@ -27,7 +27,7 @@ class Nano3d::Cube_shape
|
||||
|
||||
typedef Nano3d::Vertex_array<NUM_VERTICES> Vertex_array;
|
||||
|
||||
Vertex_array _vertices;
|
||||
Vertex_array _vertices { };
|
||||
|
||||
enum { VERTICES_PER_FACE = 4 };
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@ class Nano3d::Dodecahedron_shape
|
||||
|
||||
typedef Nano3d::Vertex_array<NUM_VERTICES> Vertex_array;
|
||||
|
||||
Vertex_array _vertices;
|
||||
Vertex_array _vertices { };
|
||||
|
||||
Edge _edges[NUM_EDGES];
|
||||
Face _faces[NUM_FACES];
|
||||
|
||||
@@ -35,7 +35,7 @@ namespace Nano3d {
|
||||
}
|
||||
|
||||
|
||||
struct Nano3d::Input_handler
|
||||
struct Nano3d::Input_handler : Genode::Interface
|
||||
{
|
||||
virtual void handle_input(Input::Event const [], unsigned num_events) = 0;
|
||||
};
|
||||
@@ -55,6 +55,12 @@ class Nano3d::Scene
|
||||
|
||||
private:
|
||||
|
||||
/**
|
||||
* Noncopyable
|
||||
*/
|
||||
Scene(Scene const &);
|
||||
Scene &operator = (Scene const &);
|
||||
|
||||
Genode::Env &_env;
|
||||
|
||||
/**
|
||||
@@ -279,9 +285,11 @@ class Nano3d::Scene
|
||||
:
|
||||
_env(env), _pos(pos), _size(size)
|
||||
{
|
||||
typedef Nitpicker::Session::View_handle View_handle;
|
||||
|
||||
Nitpicker::Rect rect(_pos, _size);
|
||||
_nitpicker.enqueue<Command::Geometry>(_view_handle, rect);
|
||||
_nitpicker.enqueue<Command::To_front>(_view_handle);
|
||||
_nitpicker.enqueue<Command::To_front>(_view_handle, View_handle());
|
||||
_nitpicker.execute();
|
||||
|
||||
_nitpicker.input()->sigh(_input_handler);
|
||||
@@ -292,6 +300,8 @@ class Nano3d::Scene
|
||||
_framebuffer.framebuffer.sync_sigh(_sync_handler);
|
||||
}
|
||||
|
||||
virtual ~Scene() { }
|
||||
|
||||
unsigned long elapsed_ms() const { return _timer.elapsed_ms(); }
|
||||
|
||||
void input_handler(Input_handler *input_handler)
|
||||
|
||||
@@ -93,11 +93,11 @@ Nano3d::Sincos_frac16::Sincos_frac16()
|
||||
ny_high = ny_high << 1;
|
||||
|
||||
/* use new sin/cos values for next iteration, preserve sign */
|
||||
x_low = (nx_high & 0x80000000) ? (nx_high | (~0 << 16)) : (nx_high & 0xffff);
|
||||
x_low = (nx_high & 0x80000000) ? (nx_high | (~0U << 16)) : (nx_high & 0xffff);
|
||||
x_low = x_low >> 1;
|
||||
x_mid = nx_high >> 16;
|
||||
|
||||
y_low = (ny_high & 0x80000000) ? (ny_high | (~0 << 16)) : (ny_high & 0xffff);
|
||||
y_low = (ny_high & 0x80000000) ? (ny_high | (~0U << 16)) : (ny_high & 0xffff);
|
||||
y_low = y_low >> 1;
|
||||
y_mid = ny_high >> 16;
|
||||
}
|
||||
|
||||
@@ -52,12 +52,12 @@ struct Polygon::Point_base : Genode::Point<>
|
||||
/**
|
||||
* Return edge attribute by ID
|
||||
*/
|
||||
inline int edge_attr(int id) const { return x(); }
|
||||
inline int edge_attr(int) const { return x(); }
|
||||
|
||||
/**
|
||||
* Assign value to edge attribute with specified ID
|
||||
*/
|
||||
inline void edge_attr(int id, int value) { *this = Point_base(value, y()); }
|
||||
inline void edge_attr(int, int value) { *this = Point_base(value, y()); }
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ struct Line_painter
|
||||
|
||||
Lut()
|
||||
{
|
||||
auto fill_segment = [&] (long x1, long y1, long x2, long y2)
|
||||
auto fill_segment = [&] (long x1, long y1, long x2, long)
|
||||
{
|
||||
for (long i = x1; i < x2; i++) value[i] = y1;
|
||||
};
|
||||
|
||||
@@ -118,6 +118,12 @@ class Polygon::Painter_base
|
||||
|
||||
int * const _edges = (int *)_alloc.alloc(_edges_size());
|
||||
|
||||
/**
|
||||
* Noncopyable
|
||||
*/
|
||||
Edge_buffers(Edge_buffers const &);
|
||||
Edge_buffers &operator = (Edge_buffers const &);
|
||||
|
||||
public:
|
||||
|
||||
Edge_buffers(Genode::Allocator &alloc, unsigned edge_len)
|
||||
|
||||
@@ -39,7 +39,7 @@ class Polygon::Shaded_painter : public Polygon::Painter_base
|
||||
*/
|
||||
struct Point : Point_base
|
||||
{
|
||||
Color color;
|
||||
Color color { };
|
||||
|
||||
Point() { }
|
||||
Point(int x, int y, Color color) : Point_base(x, y), color(color) { }
|
||||
|
||||
Reference in New Issue
Block a user