makedist.sh: Include the external/ subdirectory in the distribution.
[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/
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 * GameObject::RemoveListenerListEntry: Ughs, somebody trying to
60   implement a list class within in the GameObject?!
61
62 * add --datadir DIR (data/) and --userdir DIR (~/.supertux/)
63
64 * make gravity constant
65
66 * rename Vector -> Vector2f
67
68 * get rid of global SDL_Screen* screen variable
69
70 * get rid of SCREEN_WIDTH/SCREEN_HEIGHT overuse
71
72 * resolution menu entry moves the wrong way around
73
74 * having dictionary_manager in Lisp is extremely ugly
75
76 * enforce proper naming of files to match their class (SomeClass -> some_class.?pp or so)
77
78 * file naming is inconsistent: some times we use '_' to separate
79   words, sometimes we don't
80
81 * get rid of NDEBUG and conditional compilation, these should be
82   reserved for a few tiny cases, not spread all over the code
83
84 * collect all manager classes into globals.hpp
85
86 * more moving directories around?
87
88 addon/  
89 audio/  
90 control/
91 gui/    
92 lisp/   
93 math/
94 physfs/ 
95 sprite/ 
96 util/
97 video/
98 squirrel/
99   for generic squirrel code
100 supertux/
101   worldmap/
102   trigger/
103   scripting/
104     for scripting wrapper code
105   badguy/
106   object/
107
108 * implement PNG screenshot
109
110 * having hitbox in Sprite is fugly
111
112 * write decal object that doesn't have hitbox
113
114 * implement surface and/or sprite scaling (MipMaps?)
115
116 * add code that compares the last Log line with the current, if they
117   are the same reject them and just output something like:
118
119   * last line has been repeated X times
120
121 * implement: http://standards.freedesktop.org/basedir-spec/basedir-spec-0.6.html
122
123 * workaround for Ubuntu pulseaudio/OpenAL brokeness:
124
125 $ cat ~/.alsoftrc
126 drivers = oss
127
128 * peaking up/down doesn't work properly
129
130 * peaking left/right should make Tux look into that direction (up/down to, needs new sprites)
131
132 * add pipe graphics that makes a 90 degree turn
133
134 * keep possible future SDL1.3 upgrade in mind (what has changed?)
135
136 * cleanup scripting interface
137
138 * replace cloud tiles with decals
139
140 * option menu has text overlap in "aspect ratio"
141
142 * jumping up from an enemy doesn't make a sound?
143
144 * add support for automatic scrolling backgrounds
145
146 * add direct reading of Vector2f to Reader/lisp
147
148 * replace bell with 'reset block', that starts to glow once bumped
149   into (or something different)
150
151 * refactor Camera code, break ugly long functions into pieces and such
152
153 * allow fully custom magnification levels from command line (maybe GUI
154   to if there is a proper/easy way to let the user enter numbers)
155   (--magnification or -g WIDTHxHEIGHT:ASPECTX:ASPECTY@MAGNIFICATION)
156
157 * use AnchorPoint in Background instead of Alignment
158
159 * allow gradients to parallax scroll like Background (make it optional)
160
161 * add multicolored gradients (see Windstille source code, which can deal with Gimp gradients)
162
163 * fix alpha blending in the SDL renderer, currently all sprites (Tux,
164   etc.) appear transparent
165
166 * position of statistics text on the worldmap doesn't scale properly with resolution it seems
167
168 * gluBuild2DMipmaps leads to blurriness, maybe lack of magic offset
169   (0.375f, 0.375f, 0.0f) or something else
170
171 * font system has blending artifacts at non-1x magnifications, need to
172   have an transparent pixel between letters
173
174 * add a (border #t) flag to fonts, that allows to use fonts which have
175   a 1px transparent border around glyphs, which is needed to get rid
176   of blending artifacts in OpenGL
177
178 * mouse cursor has blend artifact on high magnification
179
180 * shadow font glyphs bleed into other glyphs
181
182 * in DrawingRequest "void* request_data;" is only free'ed, but the
183   destructor never gets called
184
185 * sprite/sprite.cpp: frame should never get out of range:
186
187   if((int)frame >= get_frames() || (int)frame < 0)
188     log_warning << "frame out of range: " << (int)frame << "/" << get_frames() << " at " << get_name() << "/" << get_action() << std::endl;
189
190 * Surface::hflip() is used exactly once, should probally be part of the constructor
191 \f
192 Scenegraph and Physics Engine Restructuring
193 ===========================================
194
195 * random idea to restructure engine stuff (might lead to nicer code
196   and easier scriptability (and a need to rewrite lots of stuff...):
197
198 class SomeBadGuy : public PhysicsCallbackListener // or use boost::function
199 {
200 private:
201       PhysicsPtr box;
202       SpritePtr sprite;
203         
204 public:
205       SomeBadGuy(Engine& engine)  
206       {
207          box    = engine.physics().create_box(Rectf(0,0,32,32));
208          box->register_listener(this);
209          sprite = engine.graphics().create_and_add_sprite("Foobar");
210       }
211
212       void update(float delta)
213       {
214          // not much to do, as most stuff is done internally in the engine
215          if (dead)
216          {
217                   sprite->replace_with("Foobar_dead");
218          }
219          else
220          {
221                 sprite->hide();
222                 sprite->set_pos(box->get_pos());
223         }
224       }
225
226       // no more draw(), done by the scene graph
227
228       void on_collision(CollisionData data)
229       {
230         // respond
231       }
232 };
233 \f
234 Subversion->Git/Mercurial/Bzr Move
235 ==================================
236
237 * right now a switch doesn't seem to be worth it
238
239 * core issue right now isn't SVN, but old SVN version on lethargik.org
240   (lacks merge tracking, issues with viewvc)
241
242 * cleanup SVN to make import into other version control systems possible:
243
244  - Should we merge trunk/supertux-milestone1 and trunk/supertux when switching to Git/Hg/...?
245
246 Mistakes: incorrect branch creation: r5201-5207
247
248 tags/start           # unknown
249 tags/supertux        # unknown
250 tags/supertux_0_1_0
251 tags/supertux_0_1_1
252 tags/supertux_0_1_2
253 tags/supertux_0_1_3
254
255 branches/cobble      # unknown
256 branches/milestone1  # unknown
257 branches/new-collision-detection # unknown
258 branches/README      # documentation that will be lost in conversion
259 branches/supertux    # unknown
260 branches/supertux_0_1_1_branch
261 branches/supertux-box2d  # mathnerd (trash)
262 branches/supertux-editor-newdrawing # editor
263 branches/supertux-editor-newdrawing2 # editor
264 branches/supertux-milestone1-olpc    # supertux-milestone1
265 branches/supertux-milestone2-grumbel # supertux
266 branches/supertux-nogl               # supertux(?)
267 branches/supertux-sharp              # another supertux editor
268 branches/unison-video                # ???
269 branches/vendor                      # ??? CVS crap
270
271 trunk/cobble          # some editor?
272 trunk/CVSROOT         # ??? CVS crap
273 trunk/htdocs          # htdocs
274 trunk/jnrcol
275 trunk/media
276 trunk/SDL_tty
277 trunk/setup2x
278 trunk/supertux
279 trunk/supertux-editor
280 trunk/supertux-milestone1
281 trunk/supertux-portable
282 trunk/supertux-sharp
283 trunk/wiz-test
284
285
286 Potential Git Issues
287 ====================
288
289 * lack of sparse/narrow/shallow checkout, this means initial checkout
290   will be 200MB instead of 100MB
291
292 * no free hoster that allow multiple >1GB repositories -> could use lethargik.org
293
294 * git submodule doesn't seem to be quite ready to replace our
295   trunk/supertux, trunk/supertux-editor, trunk/media/, ... layout as
296   it for example doesn't support automatic tracking of HEAD from the
297   remote repositories, it also feels rather hacky and not properly
298   integrated into git
299
300 * lack of metadata versioning, if you delete a branch in git that you
301   haven't merged, then its gone after the next gc/repack (+ two weeks
302   time limit it seems), in SVN on the other side you can checkout the
303   way the tree was at a specific date, its impossible to lose history
304   unless you hack the repository
305
306 svn2bzr.py
307 ==========
308
309 Committed revision 5727
310 Committed revision 5728
311 Committed revision 5729
312 Committed revision 5730
313 Traceback (most recent call last):
314   File "./svn2bzr.py", line 194, in <module>
315     main()
316   File "./svn2bzr.py", line 187, in main
317     log=log)
318   File "./svn2bzr.py", line 88, in svn2bzr
319     creator.run()
320   File "/mnt/bzr/svn2bzr/branchcreator.py", line 622, in run
321     entries = self.filter_entries(entries)
322   File "/mnt/bzr/svn2bzr/branchcreator.py", line 671, in filter_entries
323     entries = self.filter_moves(entries)
324   File "/mnt/bzr/svn2bzr/branchcreator.py", line 727, in filter_moves
325     entries = self.filter_simult_fren_dirmove(entries)
326   File "/mnt/bzr/svn2bzr/branchcreator.py", line 784, in filter_simult_fren_dirmove
327     newfname = svnrelpath(newdpth, newfpth)
328   File "/mnt/bzr/svn2bzr/branchcreator.py", line 60, in svnrelpath
329     raise errors.PathNotChild(path, base)
330 bzrlib.errors.PathNotChild: Path "trunk/media/images/creatures/mr_cherry/cherrybomb.xcf" is not a child of path "trunk/media/images/creatures/mr_bomb"
331 \f
332 Random Notes
333 ============
334
335 * calculate the size of an background image that should fill the screen:
336
337   image_size = (1 - parallax_speed) * screen_size + level_size * parallax_speed
338
339 def calc(parallax, screen, tiles):
340     return (1 - parallax) * screen + parallax * tiles * 32
341
342 \f
343 Supported Resolutions
344 ====================
345
346 SuperTux shall support resolutions from 640x480 to 1280x800 at a magnification of 1x.
347 For resolutions higher, such as 2560x1600, upscaling will be used.
348 For resolutions smaller, like 320x240 downscaling will be used.
349
350 Higher resolution graphics for 2x maginification might be provided.
351 Lower res graphics for 0.5x maginification might be provided as well.
352
353 Resolution and magnification can be freely configured by the user within the given limits.
354
355 In tiles this means we have 40x25 (=1280x800px) tiles per screen.
356
357 # EOF #