diff options
Diffstat (limited to 'Plugins/pixels.h')
-rw-r--r-- | Plugins/pixels.h | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/Plugins/pixels.h b/Plugins/pixels.h index 9557ea8..8ea645c 100644 --- a/Plugins/pixels.h +++ b/Plugins/pixels.h @@ -6,11 +6,12 @@ // - dot16() dot24() and dot32() added // - get/put dot() removed, use above -#include "plugin.h" - #ifndef _PIXELSH #define _PIXELSH +#include <vector> +#include "plugin.h" + class pixels { private: @@ -117,4 +118,29 @@ void pixels::updaterowp() p32 = (pixel32 *)p8; } +// +// arguments-class, to make it easier to parse parameters. +// using vector<char *> for this might be a bit overkill (??), +// but I like the ease of it. + +class arguments +{ +private: + std::vector<char *> m_ptrs; +public: + arguments(char *s) + { + char *t = s; + if(!t || !t[0]) return; + if(t[0]) m_ptrs.push_back(t); + while(t = strstr(t+1, " ")) + { + t[0]=0; + m_ptrs.push_back(t+1); + } + } + char *operator[](int i) { return m_ptrs[i]; } + int count() { return m_ptrs.size(); } +}; + #endif // #ifndef _PIXELSH |