File include/jrf/scene.h changed (mode: 100644) (index 208616c..f5430c8) |
... |
... |
struct jrf::SceneEntry |
37 |
37 |
goto CANCEL; |
goto CANCEL; |
38 |
38 |
if (not p_io->read_items(&options.shift)) |
if (not p_io->read_items(&options.shift)) |
39 |
39 |
goto CANCEL; |
goto CANCEL; |
40 |
|
if (p_io->read_items(&options.transform)) |
|
|
40 |
|
if (not p_io->read_items(&options.transform)) |
41 |
41 |
goto CANCEL; |
goto CANCEL; |
42 |
42 |
|
|
43 |
43 |
return Result::SUCCESS; |
return Result::SUCCESS; |
|
... |
... |
CANCEL: destroy(); |
68 |
68 |
struct jrf::Scene |
struct jrf::Scene |
69 |
69 |
{ |
{ |
70 |
70 |
struct Options { |
struct Options { |
71 |
|
void set_default_value() { *this = {{}, 1 }; } |
|
72 |
|
jl::array<int32_t, 3> shift; ///< global shift of scene |
|
73 |
|
int32_t shift_scale;///< scale applied to total shift |
|
|
71 |
|
void set_default_value() { *this = {}; } |
|
72 |
|
jl::array<int32_t, 3> shift; ///< global shift of scene |
|
73 |
|
int32_t shift_po2; ///< Power of two |
74 |
74 |
}; |
}; |
75 |
75 |
|
|
76 |
76 |
Options options; |
Options options; |
|
... |
... |
struct jrf::Scene |
84 |
84 |
auto *p_io = jl::io_agent_p_alt_cast(p_mediator); |
auto *p_io = jl::io_agent_p_alt_cast(p_mediator); |
85 |
85 |
if (not p_io->read_items(&options.shift)) |
if (not p_io->read_items(&options.shift)) |
86 |
86 |
return Result::MEDIATOR_ERROR; |
return Result::MEDIATOR_ERROR; |
87 |
|
if (not p_io->read_items(&options.shift_scale)) |
|
|
87 |
|
if (not p_io->read_items(&options.shift_po2)) |
88 |
88 |
return Result::MEDIATOR_ERROR; |
return Result::MEDIATOR_ERROR; |
89 |
89 |
|
|
90 |
90 |
uint64_t entry_count; |
uint64_t entry_count; |
|
... |
... |
struct jrf::Scene |
106 |
106 |
while(i > 0) |
while(i > 0) |
107 |
107 |
entries[--i].destroy(); |
entries[--i].destroy(); |
108 |
108 |
entries.destroy(); |
entries.destroy(); |
109 |
|
break; |
|
|
109 |
|
return res; |
110 |
110 |
} |
} |
111 |
111 |
} |
} |
112 |
112 |
return Result::SUCCESS; |
return Result::SUCCESS; |
|
... |
... |
struct jrf::Scene |
118 |
118 |
auto *p_io = jl::io_agent_p_alt_cast(p_mediator); |
auto *p_io = jl::io_agent_p_alt_cast(p_mediator); |
119 |
119 |
if (not p_io->write_items(&options.shift)) |
if (not p_io->write_items(&options.shift)) |
120 |
120 |
return Result::MEDIATOR_ERROR; |
return Result::MEDIATOR_ERROR; |
121 |
|
if (not p_io->write_items(&options.shift_scale)) |
|
|
121 |
|
if (not p_io->write_items(&options.shift_po2)) |
122 |
122 |
return Result::MEDIATOR_ERROR; |
return Result::MEDIATOR_ERROR; |
123 |
123 |
|
|
124 |
124 |
size_t entry_count = entries.count(); |
size_t entry_count = entries.count(); |