screenshot.h
author bjarni
Thu, 05 Oct 2006 12:59:28 +0000
changeset 4739 e626ef1b522e
parent 4184 541f819f2125
permissions -rw-r--r--
(svn r6651) -Coding feature: added the windowevent WE_INVALIDATE_DATA
This gives the ability to invalidate some window data and recalculate as needed instead of doing it for each WE_PAINT

This event is called right away when using InvalidateWindowData(), so it may be a good idea to set a bool or similar in the window
or similar and then act on that bool in WE_PAINT instead of doing a lot of stuff in WE_INVALIDATE_DATA as it might be called more than once before WE_PAINT is called

InvalidateWindowData() will not automatically repaint the window, so if you want to repaint it as well, you need to mark it dirty as well.

Made the depot windows use WE_INVALIDATE_DATA to set when to generate the engine and wagon lists instead of at each redraw
It makes no sense to regenerate the list when say using the scrollbar if we know that no vehicle have entered or left the list

NOTE: currently there is a piece of code to generate the list when it's not needed and compare it to the stored list and assert if they mismatch
This check is somewhat slow and kills the whole idea of WE_INVALIDATE_DATA, so it's a short lived one to verify that InvalidateWindowData() is used everywhere where it's needed
2186
db48cf29b983 (svn r2701) Insert Id tags into all source files
tron
parents: 2121
diff changeset
     1
/* $Id$ */
db48cf29b983 (svn r2701) Insert Id tags into all source files
tron
parents: 2121
diff changeset
     2
430
2e9a2e9fcf11 (svn r631) Merge r440, r444, r485, r630 to trunk:
tron
parents:
diff changeset
     3
#ifndef SCREENSHOT_H
2e9a2e9fcf11 (svn r631) Merge r440, r444, r485, r630 to trunk:
tron
parents:
diff changeset
     4
#define SCREENSHOT_H
2e9a2e9fcf11 (svn r631) Merge r440, r444, r485, r630 to trunk:
tron
parents:
diff changeset
     5
2e9a2e9fcf11 (svn r631) Merge r440, r444, r485, r630 to trunk:
tron
parents:
diff changeset
     6
void InitializeScreenshotFormats(void);
2e9a2e9fcf11 (svn r631) Merge r440, r444, r485, r630 to trunk:
tron
parents:
diff changeset
     7
2e9a2e9fcf11 (svn r631) Merge r440, r444, r485, r630 to trunk:
tron
parents:
diff changeset
     8
const char *GetScreenshotFormatDesc(int i);
2e9a2e9fcf11 (svn r631) Merge r440, r444, r485, r630 to trunk:
tron
parents:
diff changeset
     9
void SetScreenshotFormat(int i);
2e9a2e9fcf11 (svn r631) Merge r440, r444, r485, r630 to trunk:
tron
parents:
diff changeset
    10
4184
541f819f2125 (svn r5626) CodeChange : Remove the global _make_screenshot and implement a more flexible mechanism
belugas
parents: 2436
diff changeset
    11
typedef enum ScreenshotType {
541f819f2125 (svn r5626) CodeChange : Remove the global _make_screenshot and implement a more flexible mechanism
belugas
parents: 2436
diff changeset
    12
	SC_NONE,
541f819f2125 (svn r5626) CodeChange : Remove the global _make_screenshot and implement a more flexible mechanism
belugas
parents: 2436
diff changeset
    13
	SC_VIEWPORT,
541f819f2125 (svn r5626) CodeChange : Remove the global _make_screenshot and implement a more flexible mechanism
belugas
parents: 2436
diff changeset
    14
	SC_WORLD
541f819f2125 (svn r5626) CodeChange : Remove the global _make_screenshot and implement a more flexible mechanism
belugas
parents: 2436
diff changeset
    15
} ScreenshotType;
541f819f2125 (svn r5626) CodeChange : Remove the global _make_screenshot and implement a more flexible mechanism
belugas
parents: 2436
diff changeset
    16
430
2e9a2e9fcf11 (svn r631) Merge r440, r444, r485, r630 to trunk:
tron
parents:
diff changeset
    17
bool MakeScreenshot(void);
4184
541f819f2125 (svn r5626) CodeChange : Remove the global _make_screenshot and implement a more flexible mechanism
belugas
parents: 2436
diff changeset
    18
void SetScreenshotType(ScreenshotType t);
541f819f2125 (svn r5626) CodeChange : Remove the global _make_screenshot and implement a more flexible mechanism
belugas
parents: 2436
diff changeset
    19
bool IsScreenshotRequested(void);
430
2e9a2e9fcf11 (svn r631) Merge r440, r444, r485, r630 to trunk:
tron
parents:
diff changeset
    20
2121
267f7d75d036 (svn r2631) Move screenshot related variables from variables.h to screenshot.[ch]
tron
parents: 430
diff changeset
    21
extern char _screenshot_format_name[8];
267f7d75d036 (svn r2631) Move screenshot related variables from variables.h to screenshot.[ch]
tron
parents: 430
diff changeset
    22
extern uint _num_screenshot_formats;
267f7d75d036 (svn r2631) Move screenshot related variables from variables.h to screenshot.[ch]
tron
parents: 430
diff changeset
    23
extern uint _cur_screenshot_format;
267f7d75d036 (svn r2631) Move screenshot related variables from variables.h to screenshot.[ch]
tron
parents: 430
diff changeset
    24
2436
7d5df545bd5d (svn r2962) - const correctness for all Get* functions and most Draw* functions that don't change their pointer parameters
Darkvater
parents: 2186
diff changeset
    25
#endif /* SCREENSHOT_H */