Make it compile with 4.6.1.
[supertux.git] / TODO
1 SuperTux TODO
2 =============
3
4 This is a list of tasks and issues that might be worth to implement or
5 fix. This list is however not an authorative list of things that must
6 be done, its a collection of random things that pop up during
7 development, therefore not everything in here might be well thought
8 out or worth to implement. Use your brain before implementing anything
9 on this list and always think about how useful a new feature would be
10 in the context of the whole game or if a potential performance
11 enhanchment, actually enhanchmes anything at all.
12
13 Coding Standard Stuff
14 =====================
15
16 * make code clean: "-O2", "-g3",
17                      "-ansi",
18                      "-pedantic",
19                      "-Wall",
20                      "-Wextra",
21                      "-Wnon-virtual-dtor",
22                      "-Weffc++",
23                      "-Wconversion",
24                      "-Werror",
25                      "-Wshadow",
26                      "-Wcast-qual",
27                      "-Winit-self", # only works with >= -O1
28                      "-Wno-unused-parameter",
29
30 * remove overuse of multi-inheritance 
31
32 * remove overuse of friend'ship
33
34 * maybe mark interfaces as interfaces (ISerializable or SerializableInterface)
35
36 * split files with multiple classes into multiple files with one class each
37
38 * Decide what to do with magic constants of objects (static vs anonymous namespace vs lisp property)
39
40 * check the code with Valgrind and profilers
41
42 * use Vector in Physics for 'a' and 'v'
43
44 * replace random generator with mersenne twister and/or move to external/ (maybe use boost's random stuff)
45
46 * md5.hpp and random_generator.hpp could go to external/
47
48 * write/finish scripts to automatically:
49
50   - make all includes relative to top level dir
51
52   - sort includes (.hpp file, then system includes, then other project files)
53
54   - include guards proper and of the form HEADER_SUPERTUX_${PATH_TO_FILE}_HPP
55
56 TODO
57 ====
58
59 * implement a system that allows to attach comments to specific regions in a level
60
61 * implement a tool to "screenshot" a complete level
62
63 * carrying an object while running through the exit causes the item to be kicked, falling through the iglo
64
65 * GameObject::RemoveListenerListEntry: Ughs, somebody trying to
66   implement a list class within in the GameObject?!
67
68 * add --datadir DIR (data/) and --userdir DIR (~/.supertux/), allow multiple --datadir's
69
70 * make gravity constant
71
72 * rename Vector -> Vector2f
73
74 * get rid of global SDL_Screen* screen variable
75
76 * get rid of SCREEN_WIDTH/SCREEN_HEIGHT overuse, give them a proper name at least
77
78 * resolution menu entry moves the wrong way around
79
80 * having dictionary_manager in Lisp is extremely ugly
81
82 * enforce proper naming of files to match their class (SomeClass -> some_class.?pp or so)
83
84 * file naming is inconsistent: some times we use '_' to separate
85   words, sometimes we don't
86
87 * collect all manager classes into globals.hpp
88
89 * more moving directories around?
90
91 addon/  
92 audio/  
93 control/
94 gui/    
95 lisp/   
96 math/
97 physfs/ 
98 sprite/ 
99 util/
100 video/
101 squirrel/
102   for generic squirrel code
103 supertux/
104   worldmap/
105   trigger/
106   scripting/
107     for scripting wrapper code
108   badguy/
109   object/
110
111 * implement PNG screenshot
112
113 * having hitbox in Sprite is fugly
114
115 * write decal object that doesn't have hitbox
116
117 * implement surface and/or sprite scaling (MipMaps?)
118
119 * add code that compares the last Log line with the current, if they
120   are the same reject them and just output something like:
121
122   * last line has been repeated X times
123
124 * implement: http://standards.freedesktop.org/basedir-spec/basedir-spec-0.6.html
125
126 * workaround for Ubuntu pulseaudio/OpenAL brokeness:
127
128 $ cat ~/.alsoftrc
129 drivers = oss
130
131 * peaking up/down doesn't work properly
132
133 * peaking left/right should make Tux look into that direction (up/down to, needs new sprites)
134
135 * add pipe graphics that makes a 90 degree turn
136
137 * keep possible future SDL1.3 upgrade in mind (what has changed?)
138
139 * cleanup scripting interface
140
141 * replace cloud tiles with decals
142
143 * option menu has text overlap in "aspect ratio"
144
145 * jumping up from an enemy doesn't make a sound?
146
147 * add support for automatic scrolling backgrounds
148
149 * add direct reading of Vector2f to Reader/lisp
150
151 * replace bell with 'reset block', that starts to glow once bumped
152   into (or something different)
153
154 * refactor Camera code, break ugly long functions into pieces and such
155
156 * allow fully custom magnification levels from command line (maybe GUI
157   to if there is a proper/easy way to let the user enter numbers)
158   (--magnification or -g WIDTHxHEIGHT:ASPECTX:ASPECTY@MAGNIFICATION)
159
160 * use AnchorPoint in Background instead of Alignment
161
162 * allow gradients to parallax scroll like Background (make it optional)
163
164 * add multicolored gradients (see Windstille source code, which can deal with Gimp gradients)
165
166 * fix alpha blending in the SDL renderer, currently all sprites (Tux,
167   etc.) appear transparent
168
169 * position of statistics text on the worldmap doesn't scale properly with resolution it seems
170
171 * gluBuild2DMipmaps leads to blurriness, maybe lack of magic offset
172   (0.375f, 0.375f, 0.0f) or something else
173
174 * font system has blending artifacts at non-1x magnifications, need to
175   have an transparent pixel between letters
176
177 * add a (border #t) flag to fonts, that allows to use fonts which have
178   a 1px transparent border around glyphs, which is needed to get rid
179   of blending artifacts in OpenGL
180
181 * mouse cursor has blend artifact on high magnification
182
183 * shadow font glyphs bleed into other glyphs
184
185 * in DrawingRequest "void* request_data;" is only free'ed, but the
186   destructor never gets called
187
188 * sprite/sprite.cpp: frame should never get out of range:
189
190   if((int)frame >= get_frames() || (int)frame < 0)
191     log_warning << "frame out of range: " << (int)frame << "/" << get_frames() << " at " << get_name() << "/" << get_action() << std::endl;
192
193 * Surface::hflip() is used exactly once, should probally be part of the constructor
194 \f
195 Scenegraph and Physics Engine Restructuring
196 ===========================================
197
198 * random idea to restructure engine stuff (might lead to nicer code
199   and easier scriptability (and a need to rewrite lots of stuff...):
200
201 class SomeBadGuy : public PhysicsCallbackListener // or use boost::function
202 {
203 private:
204       PhysicsPtr box;
205       SpritePtr sprite;
206         
207 public:
208       SomeBadGuy(Engine& engine)  
209       {
210          box    = engine.physics().create_box(Rectf(0,0,32,32));
211          box->register_listener(this);
212          sprite = engine.graphics().create_and_add_sprite("Foobar");
213       }
214
215       void update(float delta)
216       {
217          // not much to do, as most stuff is done internally in the engine
218          if (dead)
219          {
220                   sprite->replace_with("Foobar_dead");
221          }
222          else
223          {
224                 sprite->hide();
225                 sprite->set_pos(box->get_pos());
226         }
227       }
228
229       // no more draw(), done by the scene graph
230
231       void on_collision(CollisionData data)
232       {
233         // respond
234       }
235 };
236 \f
237 Subversion->Git/Mercurial/Bzr Move
238 ==================================
239
240 * right now a switch doesn't seem to be worth it
241
242 * core issue right now isn't SVN, but old SVN version on lethargik.org
243   (lacks merge tracking, issues with viewvc)
244
245 * cleanup SVN to make import into other version control systems possible:
246
247  - Should we merge trunk/supertux-milestone1 and trunk/supertux when switching to Git/Hg/...?
248
249 Mistakes: incorrect branch creation: r5201-5207
250
251 tags/start           # unknown
252 tags/supertux        # unknown
253 tags/supertux_0_1_0
254 tags/supertux_0_1_1
255 tags/supertux_0_1_2
256 tags/supertux_0_1_3
257
258 branches/cobble      # unknown
259 branches/milestone1  # unknown
260 branches/new-collision-detection # unknown
261 branches/README      # documentation that will be lost in conversion
262 branches/supertux    # unknown
263 branches/supertux_0_1_1_branch
264 branches/supertux-box2d  # mathnerd (trash)
265 branches/supertux-editor-newdrawing # editor
266 branches/supertux-editor-newdrawing2 # editor
267 branches/supertux-milestone1-olpc    # supertux-milestone1
268 branches/supertux-milestone2-grumbel # supertux
269 branches/supertux-nogl               # supertux(?)
270 branches/supertux-sharp              # another supertux editor
271 branches/unison-video                # ???
272 branches/vendor                      # ??? CVS crap
273
274 trunk/cobble          # some editor?
275 trunk/CVSROOT         # ??? CVS crap
276 trunk/htdocs          # htdocs
277 trunk/jnrcol
278 trunk/media
279 trunk/SDL_tty
280 trunk/setup2x
281 trunk/supertux
282 trunk/supertux-editor
283 trunk/supertux-milestone1
284 trunk/supertux-portable
285 trunk/supertux-sharp
286 trunk/wiz-test
287
288
289 Potential Git Issues
290 ====================
291
292 * lack of sparse/narrow/shallow checkout, this means initial checkout
293   will be 200MB instead of 100MB
294
295 * no free hoster that allow multiple >1GB repositories -> could use lethargik.org
296
297 * git submodule doesn't seem to be quite ready to replace our
298   trunk/supertux, trunk/supertux-editor, trunk/media/, ... layout as
299   it for example doesn't support automatic tracking of HEAD from the
300   remote repositories, it also feels rather hacky and not properly
301   integrated into git
302
303 * lack of metadata versioning, if you delete a branch in git that you
304   haven't merged, then its gone after the next gc/repack (+ two weeks
305   time limit it seems), in SVN on the other side you can checkout the
306   way the tree was at a specific date, its impossible to lose history
307   unless you hack the repository
308
309 svn2bzr.py
310 ==========
311
312 Committed revision 5727
313 Committed revision 5728
314 Committed revision 5729
315 Committed revision 5730
316 Traceback (most recent call last):
317   File "./svn2bzr.py", line 194, in <module>
318     main()
319   File "./svn2bzr.py", line 187, in main
320     log=log)
321   File "./svn2bzr.py", line 88, in svn2bzr
322     creator.run()
323   File "/mnt/bzr/svn2bzr/branchcreator.py", line 622, in run
324     entries = self.filter_entries(entries)
325   File "/mnt/bzr/svn2bzr/branchcreator.py", line 671, in filter_entries
326     entries = self.filter_moves(entries)
327   File "/mnt/bzr/svn2bzr/branchcreator.py", line 727, in filter_moves
328     entries = self.filter_simult_fren_dirmove(entries)
329   File "/mnt/bzr/svn2bzr/branchcreator.py", line 784, in filter_simult_fren_dirmove
330     newfname = svnrelpath(newdpth, newfpth)
331   File "/mnt/bzr/svn2bzr/branchcreator.py", line 60, in svnrelpath
332     raise errors.PathNotChild(path, base)
333 bzrlib.errors.PathNotChild: Path "trunk/media/images/creatures/mr_cherry/cherrybomb.xcf" is not a child of path "trunk/media/images/creatures/mr_bomb"
334 \f
335 Random Notes
336 ============
337
338 * calculate the size of an background image that should fill the screen:
339
340   image_size = (1 - parallax_speed) * screen_size + level_size * parallax_speed
341
342 def calc(parallax, screen, tiles):
343     return (1 - parallax) * screen + parallax * tiles * 32
344
345 \f
346 Supported Resolutions
347 =====================
348
349 SuperTux shall support resolutions from 640x480 to 1280x800 at a magnification of 1x.
350 For resolutions higher, such as 2560x1600, upscaling will be used.
351 For resolutions smaller, like 320x240 downscaling will be used.
352
353 Higher resolution graphics for 2x maginification might be provided.
354 Lower res graphics for 0.5x maginification might be provided as well.
355
356 Resolution and magnification can be freely configured by the user within the given limits.
357
358 In tiles this means we have 40x25 (=1280x800px) tiles per screen.
359 \f
360 Graphic Tasks
361 =============
362
363 * animate cave background torch: data/images/tiles/background/backgroundtile3.png
364
365 * do parallax tiles
366
367 * remove lightmap tiles
368
369 * redraw/replace data/images/tiles/waterfall/
370 \f
371 Music Recode
372 ============
373
374 Currently the music makes up a large chunk of the total tarball
375 size. Compression could fix this:
376
377   ,-- Size of data/music/*.ogg
378   V
379 40MB - Current quality in SVN
380 24MB - Default oggenc quality (3)
381 14MB - oggenc at 0 quality
382 10MB - oggenc at -1 quality
383
384 No audible difference on my sound setup. -- grumbel
385 \f
386 # EOF #