├── Hearthstone_Skipper.sln
├── Hearthstone_Skipper
├── Hearthstone_Skipper.aps
├── Hearthstone_Skipper.rc
├── Hearthstone_Skipper.vcxproj
├── Hearthstone_Skipper.vcxproj.filters
├── Hearthstone_Skipper.vcxproj.user
├── PainterEngine_Application.c
├── PainterEngine_Application.h
├── PainterEngine_Startup.c
├── PainterEngine_Startup.h
├── Resource
│ ├── chs.pxf
│ └── hs.traw
├── __main.c
├── fox.ico
└── resource.h
└── Untitled Diagram.drawio
/Hearthstone_Skipper.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 11.00
3 | # Visual Studio 2010
4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Hearthstone_Skipper", "Hearthstone_Skipper\Hearthstone_Skipper.vcxproj", "{E059C07A-0EF3-44A7-B43C-5DB3384AC3D6}"
5 | EndProject
6 | Global
7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
8 | Debug|Win32 = Debug|Win32
9 | Release|Win32 = Release|Win32
10 | EndGlobalSection
11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
12 | {E059C07A-0EF3-44A7-B43C-5DB3384AC3D6}.Debug|Win32.ActiveCfg = Debug|Win32
13 | {E059C07A-0EF3-44A7-B43C-5DB3384AC3D6}.Debug|Win32.Build.0 = Debug|Win32
14 | {E059C07A-0EF3-44A7-B43C-5DB3384AC3D6}.Release|Win32.ActiveCfg = Release|Win32
15 | {E059C07A-0EF3-44A7-B43C-5DB3384AC3D6}.Release|Win32.Build.0 = Release|Win32
16 | EndGlobalSection
17 | GlobalSection(SolutionProperties) = preSolution
18 | HideSolutionNode = FALSE
19 | EndGlobalSection
20 | EndGlobal
21 |
--------------------------------------------------------------------------------
/Hearthstone_Skipper/Hearthstone_Skipper.aps:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/matrixcascade/HS_Skipper/df314d5f0d0d87f03e34e3d522fb2c5a3e2bfc2e/Hearthstone_Skipper/Hearthstone_Skipper.aps
--------------------------------------------------------------------------------
/Hearthstone_Skipper/Hearthstone_Skipper.rc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/matrixcascade/HS_Skipper/df314d5f0d0d87f03e34e3d522fb2c5a3e2bfc2e/Hearthstone_Skipper/Hearthstone_Skipper.rc
--------------------------------------------------------------------------------
/Hearthstone_Skipper/Hearthstone_Skipper.vcxproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | Win32
7 |
8 |
9 | Release
10 | Win32
11 |
12 |
13 |
14 | {E059C07A-0EF3-44A7-B43C-5DB3384AC3D6}
15 | Hearthstone_Skipper
16 |
17 |
18 |
19 | Application
20 | true
21 | MultiByte
22 |
23 |
24 | Application
25 | false
26 | true
27 | MultiByte
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 | Level3
43 | Disabled
44 |
45 |
46 | true
47 | RequireAdministrator
48 |
49 |
50 |
51 |
52 | Level3
53 | MaxSpeed
54 | true
55 | true
56 |
57 |
58 | true
59 | true
60 | true
61 | RequireAdministrator
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 |
193 |
194 |
195 |
196 |
197 |
198 |
199 |
200 |
--------------------------------------------------------------------------------
/Hearthstone_Skipper/Hearthstone_Skipper.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx
7 |
8 |
9 | {93995380-89BD-4b04-88EB-625FBE52EBFB}
10 | h;hpp;hxx;hm;inl;inc;xsd
11 |
12 |
13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms
15 |
16 |
17 | {c4484f6b-1d50-4222-bf66-a39ea4573a49}
18 |
19 |
20 |
21 |
22 | PainterEngine
23 |
24 |
25 | PainterEngine
26 |
27 |
28 | PainterEngine
29 |
30 |
31 | PainterEngine
32 |
33 |
34 | PainterEngine
35 |
36 |
37 | PainterEngine
38 |
39 |
40 | PainterEngine
41 |
42 |
43 | PainterEngine
44 |
45 |
46 | PainterEngine
47 |
48 |
49 | PainterEngine
50 |
51 |
52 | PainterEngine
53 |
54 |
55 | PainterEngine
56 |
57 |
58 | PainterEngine
59 |
60 |
61 | PainterEngine
62 |
63 |
64 | PainterEngine
65 |
66 |
67 | PainterEngine
68 |
69 |
70 | PainterEngine
71 |
72 |
73 | PainterEngine
74 |
75 |
76 | PainterEngine
77 |
78 |
79 | PainterEngine
80 |
81 |
82 | PainterEngine
83 |
84 |
85 | PainterEngine
86 |
87 |
88 | PainterEngine
89 |
90 |
91 | PainterEngine
92 |
93 |
94 | PainterEngine
95 |
96 |
97 | PainterEngine
98 |
99 |
100 | PainterEngine
101 |
102 |
103 | PainterEngine
104 |
105 |
106 | PainterEngine
107 |
108 |
109 | PainterEngine
110 |
111 |
112 | PainterEngine
113 |
114 |
115 | PainterEngine
116 |
117 |
118 | PainterEngine
119 |
120 |
121 | PainterEngine
122 |
123 |
124 | PainterEngine
125 |
126 |
127 | PainterEngine
128 |
129 |
130 | PainterEngine
131 |
132 |
133 | PainterEngine
134 |
135 |
136 | PainterEngine
137 |
138 |
139 | PainterEngine
140 |
141 |
142 | PainterEngine
143 |
144 |
145 | PainterEngine
146 |
147 |
148 | PainterEngine
149 |
150 |
151 | PainterEngine
152 |
153 |
154 | PainterEngine
155 |
156 |
157 | PainterEngine
158 |
159 |
160 | PainterEngine
161 |
162 |
163 | PainterEngine
164 |
165 |
166 | PainterEngine
167 |
168 |
169 | PainterEngine
170 |
171 |
172 | PainterEngine
173 |
174 |
175 | PainterEngine
176 |
177 |
178 | PainterEngine
179 |
180 |
181 | PainterEngine
182 |
183 |
184 | PainterEngine
185 |
186 |
187 | PainterEngine
188 |
189 |
190 | 源文件
191 |
192 |
193 | 源文件
194 |
195 |
196 | 源文件
197 |
198 |
199 |
200 |
201 | PainterEngine
202 |
203 |
204 | PainterEngine
205 |
206 |
207 | PainterEngine
208 |
209 |
210 | PainterEngine
211 |
212 |
213 | PainterEngine
214 |
215 |
216 | PainterEngine
217 |
218 |
219 | PainterEngine
220 |
221 |
222 | PainterEngine
223 |
224 |
225 | PainterEngine
226 |
227 |
228 | PainterEngine
229 |
230 |
231 | PainterEngine
232 |
233 |
234 | PainterEngine
235 |
236 |
237 | PainterEngine
238 |
239 |
240 | PainterEngine
241 |
242 |
243 | PainterEngine
244 |
245 |
246 | PainterEngine
247 |
248 |
249 | PainterEngine
250 |
251 |
252 | PainterEngine
253 |
254 |
255 | PainterEngine
256 |
257 |
258 | PainterEngine
259 |
260 |
261 | PainterEngine
262 |
263 |
264 | PainterEngine
265 |
266 |
267 | PainterEngine
268 |
269 |
270 | PainterEngine
271 |
272 |
273 | PainterEngine
274 |
275 |
276 | PainterEngine
277 |
278 |
279 | PainterEngine
280 |
281 |
282 | PainterEngine
283 |
284 |
285 | PainterEngine
286 |
287 |
288 | PainterEngine
289 |
290 |
291 | PainterEngine
292 |
293 |
294 | PainterEngine
295 |
296 |
297 | PainterEngine
298 |
299 |
300 | PainterEngine
301 |
302 |
303 | PainterEngine
304 |
305 |
306 | PainterEngine
307 |
308 |
309 | PainterEngine
310 |
311 |
312 | PainterEngine
313 |
314 |
315 | PainterEngine
316 |
317 |
318 | PainterEngine
319 |
320 |
321 | PainterEngine
322 |
323 |
324 | PainterEngine
325 |
326 |
327 | PainterEngine
328 |
329 |
330 | PainterEngine
331 |
332 |
333 | PainterEngine
334 |
335 |
336 | PainterEngine
337 |
338 |
339 | PainterEngine
340 |
341 |
342 | PainterEngine
343 |
344 |
345 | PainterEngine
346 |
347 |
348 | PainterEngine
349 |
350 |
351 | PainterEngine
352 |
353 |
354 | PainterEngine
355 |
356 |
357 | PainterEngine
358 |
359 |
360 | PainterEngine
361 |
362 |
363 | PainterEngine
364 |
365 |
366 | PainterEngine
367 |
368 |
369 | PainterEngine
370 |
371 |
372 | PainterEngine
373 |
374 |
375 | PainterEngine
376 |
377 |
378 | PainterEngine
379 |
380 |
381 | PainterEngine
382 |
383 |
384 | 头文件
385 |
386 |
387 | 头文件
388 |
389 |
390 | 头文件
391 |
392 |
393 |
394 |
395 | 资源文件
396 |
397 |
398 |
399 |
400 | 资源文件
401 |
402 |
403 |
--------------------------------------------------------------------------------
/Hearthstone_Skipper/Hearthstone_Skipper.vcxproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/Hearthstone_Skipper/PainterEngine_Application.c:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/matrixcascade/HS_Skipper/df314d5f0d0d87f03e34e3d522fb2c5a3e2bfc2e/Hearthstone_Skipper/PainterEngine_Application.c
--------------------------------------------------------------------------------
/Hearthstone_Skipper/PainterEngine_Application.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/matrixcascade/HS_Skipper/df314d5f0d0d87f03e34e3d522fb2c5a3e2bfc2e/Hearthstone_Skipper/PainterEngine_Application.h
--------------------------------------------------------------------------------
/Hearthstone_Skipper/PainterEngine_Startup.c:
--------------------------------------------------------------------------------
1 | #include "PainterEngine_Startup.h"
2 |
3 |
4 | //////////////////////////////////////////////////////////////////////////
5 | //Functions
6 |
7 | px_bool PX_InstanceInitialize(PX_Instance *Instance,px_char *name,px_int width,px_int height,px_uint ui_size,px_uint resource_size,px_uint game_size)
8 | {
9 | px_int allocSize;
10 |
11 | PX_srand(timeGetTime());
12 |
13 | if (!PX_CreateWindow(width,height,name,PX_FALSE))
14 | {
15 | return 0;
16 | }
17 |
18 | allocSize=ui_size+resource_size+game_size+1024*1024*16;
19 |
20 | if (!PX_RuntimeInitialize(&Instance->runtime,width,height,malloc(allocSize),allocSize,ui_size,resource_size,game_size))
21 | return PX_FALSE;
22 |
23 | if (!PX_ConsoleInitialize(&Instance->runtime,&Instance->console))
24 | return PX_FALSE;
25 |
26 | return PX_TRUE;
27 | }
28 |
29 |
30 |
31 |
32 | PX_IO_Data PX_LoadFileToIOData(px_char *path)
33 | {
34 | PX_IO_Data io;
35 | px_int fileoft=0;
36 | FILE *pf=fopen(path,"rb");
37 | px_int filesize;
38 | if (!pf)
39 | {
40 | goto _ERROR;
41 | }
42 | fseek(pf,0,SEEK_END);
43 | filesize=ftell(pf);
44 | fseek(pf,0,SEEK_SET);
45 |
46 | io.buffer=(px_byte *)malloc(filesize+1);
47 | if (!io.buffer)
48 | {
49 | goto _ERROR;
50 | }
51 |
52 | while (!feof(pf))
53 | {
54 | fileoft+=(px_int)fread(io.buffer+fileoft,1,1024,pf);
55 | }
56 | fclose(pf);
57 |
58 | io.buffer[filesize]='\0';
59 | io.size=filesize;
60 | return io;
61 | _ERROR:
62 | io.buffer=PX_NULL;
63 | io.size=0;
64 | return io;
65 | }
66 |
67 | px_void PX_FreeIOData(PX_IO_Data *io)
68 | {
69 | if (io->size&&io->buffer)
70 | {
71 | free(io->buffer);
72 | io->size=0;
73 | io->buffer=PX_NULL;
74 | }
75 | }
76 |
77 | px_bool PX_LoadTextureFromFile(px_memorypool *mp,px_texture *tex,px_char *path)
78 | {
79 | PX_IO_Data io;
80 |
81 | #ifdef PAINTERENGINE_IMAGEDECODER_H
82 | if (PX_TextureCreateFromPngFile(mp,tex,path))
83 | {
84 | return PX_TRUE;
85 | }
86 | if (PX_TextureCreateFromJpegFile(mp,tex,path))
87 | {
88 | return PX_TRUE;
89 | }
90 | #endif
91 |
92 | io=PX_LoadFileToIOData(path);
93 | if (!io.size)
94 | {
95 | return PX_FALSE;
96 | }
97 | if (PX_TextureCreateFromMemory(mp,io.buffer,io.size,tex))
98 | {
99 | PX_FreeIOData(&io);
100 | return PX_TRUE;
101 | }
102 | PX_FreeIOData(&io);
103 | return PX_FALSE;
104 | }
105 |
106 | px_bool PX_LoadFontModuleFromFile(PX_FontModule *fm,px_char *path)
107 | {
108 | PX_IO_Data io;
109 |
110 | io=PX_LoadFileToIOData(path);
111 | if (!io.size)
112 | {
113 | return PX_FALSE;
114 | }
115 | if (PX_FontModuleLoad(fm,io.buffer,io.size))
116 | {
117 | PX_FreeIOData(&io);
118 | return PX_TRUE;
119 | }
120 | PX_FreeIOData(&io);
121 | return PX_FALSE;
122 | }
123 |
124 |
125 |
126 |
127 | px_bool PX_LoadShapeFromFile(px_memorypool *mp,px_shape *shape,px_char *path)
128 | {
129 | PX_IO_Data io=PX_LoadFileToIOData(path);
130 | if (!io.size)
131 | {
132 | return PX_FALSE;
133 | }
134 | if (PX_ShapeCreateFromMemory(mp,io.buffer,io.size,shape))
135 | {
136 | PX_FreeIOData(&io);
137 | return PX_TRUE;
138 | }
139 | PX_FreeIOData(&io);
140 | return PX_FALSE;
141 |
142 | }
143 |
144 |
145 | px_bool PX_LoadSoundFromFile(px_memorypool *mp,px_shape *shape,px_char *path)
146 | {
147 | PX_IO_Data io=PX_LoadFileToIOData(path);
148 | if (!io.size)
149 | {
150 | return PX_FALSE;
151 | }
152 | if (PX_ShapeCreateFromMemory(mp,io.buffer,io.size,shape))
153 | {
154 | PX_FreeIOData(&io);
155 | return PX_TRUE;
156 | }
157 | PX_FreeIOData(&io);
158 | return PX_FALSE;
159 | }
160 |
161 |
162 | px_bool PX_LoadAnimationLibraryFromFile(px_memorypool *mp,px_animationlibrary *lib,px_char *path)
163 | {
164 | PX_IO_Data io;
165 | io=PX_LoadFileToIOData(path);
166 | if (!io.size)
167 | {
168 | return PX_FALSE;
169 | }
170 | if (PX_AnimationLibraryCreateFromMemory(mp,lib,io.buffer,io.size))
171 | {
172 | PX_FreeIOData(&io);
173 | return PX_TRUE;
174 | }
175 | PX_FreeIOData(&io);
176 | return PX_FALSE;
177 |
178 | }
179 |
180 | px_bool PX_LoadScriptFromFile(px_memory *code,px_char *path)
181 | {
182 | PX_IO_Data io=PX_LoadFileToIOData(path);
183 | if (!io.size)
184 | {
185 | return PX_FALSE;
186 | }
187 | if(!PX_MemoryCopy(code,io.buffer,0,io.size))
188 | goto _ERROR;
189 |
190 | PX_FreeIOData(&io);
191 | return PX_TRUE;
192 | _ERROR:
193 | PX_FreeIOData(&io);
194 | return PX_FALSE;
195 |
196 | }
197 |
198 |
199 | px_bool PX_LoadScriptInstanceFromFile(px_memorypool *mp,PX_ScriptVM_Instance *ins,px_char *path)
200 | {
201 | PX_IO_Data io=PX_LoadFileToIOData(path);
202 | if (!io.size)
203 | {
204 | return PX_FALSE;
205 | }
206 | if(!PX_ScriptVM_InstanceInit(ins,mp,io.buffer,io.size))
207 | goto _ERROR;
208 |
209 | PX_FreeIOData(&io);
210 | return PX_TRUE;
211 | _ERROR:
212 | PX_FreeIOData(&io);
213 | return PX_FALSE;
214 | }
215 |
216 | px_bool PX_LoadTextureToResource(PX_Runtime *runtime,px_char Path[],px_char key[])
217 | {
218 | PX_IO_Data io;
219 | io=PX_LoadFileToIOData(Path);
220 | if (!io.size)goto _ERROR;
221 | if(!PX_ResourceLibraryLoad(&runtime->ResourceLibrary,PX_RESOURCE_TYPE_TEXTURE,io.buffer,io.size,key)) goto _ERROR;
222 | PX_FreeIOData(&io);
223 | return PX_TRUE;
224 | _ERROR:
225 | PX_FreeIOData(&io);
226 | return PX_FALSE;
227 | }
228 |
229 | px_bool PX_LoadShapeToResource(PX_Runtime *runtime,px_char Path[],px_char key[])
230 | {
231 | PX_IO_Data io;
232 | io=PX_LoadFileToIOData(Path);
233 | if (!io.size)goto _ERROR;
234 | if(!PX_ResourceLibraryLoad(&runtime->ResourceLibrary,PX_RESOURCE_TYPE_SHAPE,io.buffer,io.size,key)) goto _ERROR;
235 | PX_FreeIOData(&io);
236 | return PX_TRUE;
237 | _ERROR:
238 | PX_FreeIOData(&io);
239 | return PX_FALSE;
240 | }
241 |
242 | px_bool PX_LoadAnimationToResource(PX_Runtime *runtime,px_char Path[],px_char key[])
243 | {
244 | PX_IO_Data io;
245 | io=PX_LoadFileToIOData(Path);
246 | if (!io.size)goto _ERROR;
247 | if(!PX_ResourceLibraryLoad(&runtime->ResourceLibrary,PX_RESOURCE_TYPE_ANIMATIONLIBRARY,io.buffer,io.size,key)) goto _ERROR;
248 | PX_FreeIOData(&io);
249 | return PX_TRUE;
250 | _ERROR:
251 | PX_FreeIOData(&io);
252 | return PX_FALSE;
253 | }
254 |
255 | px_bool PX_LoadScriptToResource(PX_Runtime *runtime,px_char Path[],px_char key[])
256 | {
257 | PX_IO_Data io;
258 | io=PX_LoadFileToIOData(Path);
259 | if (!io.size)goto _ERROR;
260 | if(!PX_ResourceLibraryLoad(&runtime->ResourceLibrary,PX_RESOURCE_TYPE_SCRIPT,io.buffer,io.size,key)) goto _ERROR;
261 | PX_FreeIOData(&io);
262 | return PX_TRUE;
263 | _ERROR:
264 | PX_FreeIOData(&io);
265 | return PX_FALSE;
266 | }
267 |
268 |
269 | px_bool PX_LoadSoundToResource(PX_Runtime *runtime,px_char Path[],px_char key[])
270 | {
271 | PX_IO_Data io;
272 | io=PX_LoadFileToIOData(Path);
273 | if (!io.size)goto _ERROR;
274 | if(!PX_ResourceLibraryLoad(&runtime->ResourceLibrary,PX_RESOURCE_TYPE_SOUND,io.buffer,io.size,key)) goto _ERROR;
275 | PX_FreeIOData(&io);
276 | return PX_TRUE;
277 | _ERROR:
278 | PX_FreeIOData(&io);
279 | return PX_FALSE;
280 | }
281 |
--------------------------------------------------------------------------------
/Hearthstone_Skipper/PainterEngine_Startup.h:
--------------------------------------------------------------------------------
1 | #ifndef PAINTERENGINE_STARTUP_H
2 | #define PAINTERENGINE_STARTUP_H
3 |
4 | #include "../../../PainterEngine/platform/windows/Platform_Windows_D2D.h"
5 | #include "../../../PainterEngine/Architecture/PainterEngine_Console.h"
6 | #include "../../../PainterEngine/Architecture/PainterEngine_MessageBox.h"
7 |
8 | typedef struct
9 | {
10 | PX_Runtime runtime;
11 | PX_Console console;
12 | PX_SoundPlay soundplay;
13 | }PX_Instance;
14 |
15 |
16 | //////////////////////////////////////////////////////////////////////////
17 |
18 | typedef struct
19 | {
20 | px_byte *buffer;
21 | px_uint size;
22 | }PX_IO_Data;
23 |
24 | px_bool PX_InstanceInitialize(PX_Instance *Instance,px_char *name,px_int width,px_int height,px_uint ui_size,px_uint resource_size,px_uint game_size);
25 | PX_IO_Data PX_LoadFileToIOData(px_char *path);
26 | px_void PX_FreeIOData(PX_IO_Data *io);
27 | px_bool PX_LoadFontModuleFromFile(PX_FontModule *fm,px_char *path);
28 | px_bool PX_LoadTextureFromFile(px_memorypool *mp,px_texture *tex,px_char *path);
29 | px_bool PX_LoadShapeFromFile(px_memorypool *mp,px_shape *shape,px_char *path);
30 | px_bool PX_LoadSoundFromFile(px_memorypool *mp,px_shape *shape,px_char *path);
31 | px_bool PX_LoadAnimationLibraryFromFile(px_memorypool *mp,px_animationlibrary *lib,px_char *path);
32 | px_bool PX_LoadScriptFromFile(px_memory *code,px_char *path);
33 | px_bool PX_LoadScriptInstanceFromFile(px_memorypool *mp,PX_ScriptVM_Instance *ins,px_char *path);
34 | px_bool PX_LoadTextureToResource(PX_Runtime *runtime,px_char Path[],px_char key[]);
35 | px_bool PX_LoadShapeToResource(PX_Runtime *runtime,px_char Path[],px_char key[]);
36 | px_bool PX_LoadAnimationToResource(PX_Runtime *runtime,px_char Path[],px_char key[]);
37 | px_bool PX_LoadScriptToResource(PX_Runtime *runtime,px_char Path[],px_char key[]);
38 | px_bool PX_LoadSoundToResource(PX_Runtime *runtime,px_char Path[],px_char key[]);
39 |
40 |
41 | #endif
42 |
--------------------------------------------------------------------------------
/Hearthstone_Skipper/Resource/chs.pxf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/matrixcascade/HS_Skipper/df314d5f0d0d87f03e34e3d522fb2c5a3e2bfc2e/Hearthstone_Skipper/Resource/chs.pxf
--------------------------------------------------------------------------------
/Hearthstone_Skipper/Resource/hs.traw:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/matrixcascade/HS_Skipper/df314d5f0d0d87f03e34e3d522fb2c5a3e2bfc2e/Hearthstone_Skipper/Resource/hs.traw
--------------------------------------------------------------------------------
/Hearthstone_Skipper/__main.c:
--------------------------------------------------------------------------------
1 | #include "PainterEngine_Application.h"
2 |
3 | //mouse informations
4 | POINT main_zoomPoint;
5 | px_int main_ZoomRegion;
6 | //////////////////////////////////////////////////////////////////////////
7 | DWORD WINAPI DEMO_RenderThreadFunc(LPVOID p)
8 | {
9 | DWORD time,elpased;
10 | PX_Object_Event e;
11 | WM_MESSAGE msg;
12 | static POINT LastDownPoint;
13 | LastDownPoint.x=-1;
14 | LastDownPoint.y=-1;
15 | /* px_char *keyBoardString;*/
16 | //////////////////////////////////////////////////////////////////////////
17 | //CreateWindow
18 |
19 | time=timeGetTime();
20 |
21 | while(1)
22 | {
23 |
24 | PX_SystemReadDeviceState();
25 |
26 | elpased=timeGetTime()-time;
27 | time=timeGetTime();
28 |
29 |
30 | while (PX_GetWinMessage(&msg))
31 | {
32 | px_char text[2]={0};
33 | e.Event=PX_OBJECT_EVENT_ANY;
34 | switch(msg.uMsg)
35 | {
36 | case WM_MOUSEMOVE:
37 | {
38 | if (msg.wparam&MK_LBUTTON)
39 | {
40 | e.Event=PX_OBJECT_EVENT_CURSORDRAG;
41 | }
42 | else
43 | {
44 | e.Event=PX_OBJECT_EVENT_CURSORMOVE;
45 | }
46 |
47 | e.Param_uint[0]=((msg.lparam)&0xffff);
48 | e.Param_uint[1]=((msg.lparam>>16)&0xffff);
49 | }
50 | break;
51 | case WM_LBUTTONDOWN:
52 | {
53 | e.Event=PX_OBJECT_EVENT_CURSORDOWN;
54 | e.Param_uint[0]=((msg.lparam)&0xffff);
55 | e.Param_uint[1]=((msg.lparam>>16)&0xffff);
56 | LastDownPoint.x=((msg.lparam)&0xffff);
57 | LastDownPoint.y=((msg.lparam>>16)&0xffff);
58 | }
59 | break;
60 | case WM_LBUTTONUP:
61 | {
62 | if (((msg.lparam)&0xffff)==LastDownPoint.x&&((msg.lparam>>16)&0xffff)==LastDownPoint.y)
63 | {
64 | e.Event=PX_OBJECT_EVENT_CURSORCLICK;
65 | e.Param_uint[0]=((msg.lparam)&0xffff);
66 | e.Param_uint[1]=((msg.lparam>>16)&0xffff);
67 | LastDownPoint.x=-1;
68 | LastDownPoint.y=-1;
69 | PX_ApplicationPostEvent(&App,e);
70 | PX_ConsolePostEvent(&App.Instance.console,e);
71 | }
72 | e.Event=PX_OBJECT_EVENT_CURSORUP;
73 | e.Param_uint[0]=((msg.lparam)&0xffff);
74 | e.Param_uint[1]=((msg.lparam>>16)&0xffff);
75 |
76 | }
77 | break;
78 | case WM_RBUTTONDOWN:
79 | {
80 | e.Event=PX_OBJECT_EVENT_CURSORRDOWN;
81 | e.Param_uint[0]=((msg.lparam)&0xffff);
82 | e.Param_uint[1]=((msg.lparam>>16)&0xffff);
83 | }
84 | break;
85 | case WM_RBUTTONUP:
86 | {
87 | e.Event=PX_OBJECT_EVENT_CURSORRUP;
88 | e.Param_uint[0]=((msg.lparam)&0xffff);
89 | e.Param_uint[1]=((msg.lparam>>16)&0xffff);
90 | }
91 | break;
92 |
93 | case WM_KEYDOWN:
94 | {
95 | e.Event=PX_OBJECT_EVENT_KEYDOWN;
96 | e.Param_uint[0]=msg.wparam;
97 | }
98 | break;
99 | case WM_MOUSEWHEEL:
100 | {
101 | RECT rect,crect;
102 | GetClientRect(PX_GetWindowHwnd(),&crect);
103 | GetWindowRect(PX_GetWindowHwnd(),&rect);
104 | e.Event=PX_OBJECT_EVENT_CURSORWHEEL;
105 | e.Param_int[0]=((msg.lparam)&0xffff)-rect.left;
106 | e.Param_int[1]=((msg.lparam>>16)&0xffff)-rect.top-((rect.bottom-rect.top)-crect.bottom)+2;
107 | e.Param_int[2]=(short)((msg.wparam>>16)&0xffff);
108 |
109 | }
110 | break;
111 | case WM_CHAR:
112 | {
113 |
114 | text[0]=(px_char)msg.wparam;
115 | e.Event=PX_OBJECT_EVENT_STRING;
116 | e.Param_ptr[0]=text;
117 | }
118 | break;
119 | case WM_GESTURE:
120 | {
121 | GESTUREINFO gi;
122 | BOOL bHandled;
123 | BOOL bResult;
124 | ZeroMemory(&gi, sizeof(GESTUREINFO));
125 |
126 | gi.cbSize = sizeof(GESTUREINFO);
127 |
128 | bResult = GetGestureInfo((HGESTUREINFO)msg.lparam, &gi);
129 | bHandled = FALSE;
130 |
131 | if (bResult){
132 | // now interpret the gesture
133 | switch (gi.dwID){
134 | case GID_ZOOM:
135 | // Code for zooming goes here
136 |
137 | if (25>(main_zoomPoint.x-gi.ptsLocation.x)*(main_zoomPoint.x-gi.ptsLocation.x)+(main_zoomPoint.y-gi.ptsLocation.y)*(main_zoomPoint.y-gi.ptsLocation.y))
138 | {
139 | e.Event=PX_OBJECT_EVENT_SCALE;
140 | e.Param_int[0]=gi.ptsLocation.x;
141 | e.Param_int[1]=gi.ptsLocation.y;
142 | e.Param_int[2]=(px_int)gi.ullArguments-main_ZoomRegion;
143 | }
144 |
145 | main_zoomPoint.x=gi.ptsLocation.x;
146 | main_zoomPoint.y=gi.ptsLocation.y;
147 | main_ZoomRegion=(px_int)gi.ullArguments;
148 |
149 | bHandled = TRUE;
150 | break;
151 | case GID_PAN:
152 | // Code for panning goes here
153 | bHandled = TRUE;
154 | break;
155 | case GID_ROTATE:
156 | // Code for rotation goes here
157 | bHandled = TRUE;
158 | break;
159 | case GID_TWOFINGERTAP:
160 | // Code for two-finger tap goes here
161 | bHandled = TRUE;
162 | break;
163 | case GID_PRESSANDTAP:
164 | // Code for roll over goes here
165 | bHandled = TRUE;
166 | break;
167 | default:
168 | // A gesture was not recognized
169 | break;
170 | }
171 | CloseGestureInfoHandle((HGESTUREINFO)msg.lparam);
172 | }else{
173 | DWORD dwErr = GetLastError();
174 | if (dwErr > 0){
175 | //MessageBoxW(hWnd, L"Error!", L"Could not retrieve a GESTUREINFO structure.", MB_OK);
176 | }
177 | }
178 | }
179 | break;
180 | default:
181 | continue;
182 | }
183 |
184 | if(e.Event!=PX_OBJECT_EVENT_ANY)
185 | {
186 | PX_ApplicationPostEvent(&App,e);
187 | PX_ConsolePostEvent(&App.Instance.console,e);
188 | }
189 |
190 | }
191 | PX_ApplicationUpdate(&App,elpased);
192 | PX_ApplicationRender(&App,elpased);
193 | PX_SystemRender(App.Instance.runtime.RenderSurface.surfaceBuffer,PX_WINDOW_WIDTH,PX_WINDOW_HEIGHT);
194 | Sleep(0);
195 | }
196 | return 0;
197 | }
198 | //int main()
199 | int WINAPI WinMain( __in HINSTANCE hInstance, __in_opt HINSTANCE hPrevInstance, __in LPSTR lpCmdLine, __in int nShowCmd )
200 | {
201 | HANDLE hThread;
202 | DWORD threadId;
203 | PX_srand(314159);
204 | if(!PX_InstanceInitialize(&App.Instance,PX_WINDOW_NAME,PX_WINDOW_WIDTH,PX_WINDOW_HEIGHT,PX_MEMORY_UI_SIZE,PX_MEMORY_RESOURCES_SIZE,PX_MEMORY_GAME_SIZE)) return 0;
205 | if(!PX_ApplicationInitialize(&App))return 0;
206 | //////////////////////////////////////////////////////////////////////////
207 | //CreateThread
208 |
209 | hThread = CreateThread(NULL, 0, DEMO_RenderThreadFunc, 0, 0, &threadId);
210 | //PX_AudioInitialize(PX_GetWindowHwnd(),&App.Instance.soundplay,PX_FALSE);
211 |
212 | while(PX_SystemLoop()){};
213 |
214 | return 0;
215 | }
216 |
217 |
218 |
--------------------------------------------------------------------------------
/Hearthstone_Skipper/fox.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/matrixcascade/HS_Skipper/df314d5f0d0d87f03e34e3d522fb2c5a3e2bfc2e/Hearthstone_Skipper/fox.ico
--------------------------------------------------------------------------------
/Hearthstone_Skipper/resource.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/matrixcascade/HS_Skipper/df314d5f0d0d87f03e34e3d522fb2c5a3e2bfc2e/Hearthstone_Skipper/resource.h
--------------------------------------------------------------------------------
/Untitled Diagram.drawio:
--------------------------------------------------------------------------------
1 | UzV2zq1wL0osyPDNT0nNUTV2VTV2LsrPL4GwciucU3NyVI0MMlNUjV1UjYwMgFjVyA2HrCFY1qAgsSg1rwSLBiADYTaQg2Y1AA==
--------------------------------------------------------------------------------