├── README
├── PisteEngine
├── temp.cpp
├── Game.cpp
├── PDtemp.txt
├── WORMZ.bmp
├── Asennus.txt
├── GameIcon.ico
├── PisteDraw.cpp
├── PisteDraw.h
├── PisteFont.cpp
├── PisteInput.h
├── PisteSound.h
├── Resource.aps
├── cursor1.cur
├── PisteEngine.opt
├── PisteInput.cpp
├── PisteSound.cpp
├── PisteLog.h
├── resource.h
├── PisteWait.h
├── PisteEngine.dsw
├── PisteWait.cpp
├── PisteSFX.h
├── PisteLog.cpp
├── PisteFont.h
├── PisteEngine.plg
├── Resource.rc
├── PisteEngine.dsp
└── PisteSFX.cpp
├── PK2LevelEditor
├── LevelEditor.h
├── GameIcon.ico
├── Resource.aps
├── cursor1.cur
├── LevelEditor.cpp
├── PK2LevelEditor.opt
├── resource.h
├── PK2LevelEditor.dsw
├── PK2LevelEditor.dep
├── PK2LevelEditor.plg
├── Resource.rc
├── PK2LevelEditor.mak
└── PK2LevelEditor.dsp
├── Pekka Kana 2
├── PK2.cpp
├── PEKKA.bmp
├── PK2Map.h
├── SETUP.bmp
├── icon1.ico
├── PEKKA32.bmp
├── PK2Map.cpp
├── PK2Sprite.h
├── Resource.aps
├── cursor1.cur
├── pspbrwse.jbf
├── PK2Sprite.cpp
├── Pekka Kana 2.opt
├── PK2SpriteCreator
│ ├── PK2SpriteCreator.cpp
│ ├── PK2SpriteCreator.plg
│ └── PK2SpriteCreator.dsp
├── Pekka Kana 2.plg
├── CMakeLists.txt
├── resource.h
├── Pekka Kana 2.dsw
├── Resource.rc
├── Resource_temp.rc
├── Pekka Kana 2.dsp
└── pk2_sprite.txt
├── .gitignore
├── PisteEngineSDL
├── Game.cpp
├── PisteDraw.h
├── PisteInput.h
├── PisteSound.h
├── PisteDraw.cpp
├── PisteFont.cpp
├── PisteSound.cpp
├── PisteLog.h
├── PisteWait.h
├── CMakeLists.txt
├── PisteSFX.h
├── PisteLog.cpp
├── PisteWait.cpp
├── PisteFont.h
├── test.cpp
├── PisteSFX.cpp
└── PisteInput.cpp
├── PisteLanguage
├── Kieli.cpp
├── suomi.lng
├── PisteLanguage.h
├── PisteLanguage.opt
├── PisteLanguage.plg
├── PisteLanguage.dsw
├── PisteLanguage.cpp
└── PisteLanguage.dsp
└── license.txt
/README:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/PisteEngine/temp.cpp:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/PK2LevelEditor/LevelEditor.h:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/Pekka Kana 2/PK2.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/stt/pk2/HEAD/Pekka Kana 2/PK2.cpp
--------------------------------------------------------------------------------
/PisteEngine/Game.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/stt/pk2/HEAD/PisteEngine/Game.cpp
--------------------------------------------------------------------------------
/Pekka Kana 2/PEKKA.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/stt/pk2/HEAD/Pekka Kana 2/PEKKA.bmp
--------------------------------------------------------------------------------
/Pekka Kana 2/PK2Map.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/stt/pk2/HEAD/Pekka Kana 2/PK2Map.h
--------------------------------------------------------------------------------
/Pekka Kana 2/SETUP.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/stt/pk2/HEAD/Pekka Kana 2/SETUP.bmp
--------------------------------------------------------------------------------
/Pekka Kana 2/icon1.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/stt/pk2/HEAD/Pekka Kana 2/icon1.ico
--------------------------------------------------------------------------------
/PisteEngine/PDtemp.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/stt/pk2/HEAD/PisteEngine/PDtemp.txt
--------------------------------------------------------------------------------
/PisteEngine/WORMZ.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/stt/pk2/HEAD/PisteEngine/WORMZ.bmp
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | CMakeCache.txt
2 | CMakeFiles/
3 | Makefile
4 | cmake_install.cmake
5 | .*.swp
6 |
--------------------------------------------------------------------------------
/Pekka Kana 2/PEKKA32.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/stt/pk2/HEAD/Pekka Kana 2/PEKKA32.bmp
--------------------------------------------------------------------------------
/Pekka Kana 2/PK2Map.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/stt/pk2/HEAD/Pekka Kana 2/PK2Map.cpp
--------------------------------------------------------------------------------
/Pekka Kana 2/PK2Sprite.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/stt/pk2/HEAD/Pekka Kana 2/PK2Sprite.h
--------------------------------------------------------------------------------
/Pekka Kana 2/Resource.aps:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/stt/pk2/HEAD/Pekka Kana 2/Resource.aps
--------------------------------------------------------------------------------
/Pekka Kana 2/cursor1.cur:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/stt/pk2/HEAD/Pekka Kana 2/cursor1.cur
--------------------------------------------------------------------------------
/Pekka Kana 2/pspbrwse.jbf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/stt/pk2/HEAD/Pekka Kana 2/pspbrwse.jbf
--------------------------------------------------------------------------------
/PisteEngine/Asennus.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/stt/pk2/HEAD/PisteEngine/Asennus.txt
--------------------------------------------------------------------------------
/PisteEngine/GameIcon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/stt/pk2/HEAD/PisteEngine/GameIcon.ico
--------------------------------------------------------------------------------
/PisteEngine/PisteDraw.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/stt/pk2/HEAD/PisteEngine/PisteDraw.cpp
--------------------------------------------------------------------------------
/PisteEngine/PisteDraw.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/stt/pk2/HEAD/PisteEngine/PisteDraw.h
--------------------------------------------------------------------------------
/PisteEngine/PisteFont.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/stt/pk2/HEAD/PisteEngine/PisteFont.cpp
--------------------------------------------------------------------------------
/PisteEngine/PisteInput.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/stt/pk2/HEAD/PisteEngine/PisteInput.h
--------------------------------------------------------------------------------
/PisteEngine/PisteSound.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/stt/pk2/HEAD/PisteEngine/PisteSound.h
--------------------------------------------------------------------------------
/PisteEngine/Resource.aps:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/stt/pk2/HEAD/PisteEngine/Resource.aps
--------------------------------------------------------------------------------
/PisteEngine/cursor1.cur:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/stt/pk2/HEAD/PisteEngine/cursor1.cur
--------------------------------------------------------------------------------
/PisteEngineSDL/Game.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/stt/pk2/HEAD/PisteEngineSDL/Game.cpp
--------------------------------------------------------------------------------
/PisteLanguage/Kieli.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/stt/pk2/HEAD/PisteLanguage/Kieli.cpp
--------------------------------------------------------------------------------
/PisteLanguage/suomi.lng:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/stt/pk2/HEAD/PisteLanguage/suomi.lng
--------------------------------------------------------------------------------
/PK2LevelEditor/GameIcon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/stt/pk2/HEAD/PK2LevelEditor/GameIcon.ico
--------------------------------------------------------------------------------
/PK2LevelEditor/Resource.aps:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/stt/pk2/HEAD/PK2LevelEditor/Resource.aps
--------------------------------------------------------------------------------
/PK2LevelEditor/cursor1.cur:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/stt/pk2/HEAD/PK2LevelEditor/cursor1.cur
--------------------------------------------------------------------------------
/Pekka Kana 2/PK2Sprite.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/stt/pk2/HEAD/Pekka Kana 2/PK2Sprite.cpp
--------------------------------------------------------------------------------
/PisteEngine/PisteEngine.opt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/stt/pk2/HEAD/PisteEngine/PisteEngine.opt
--------------------------------------------------------------------------------
/PisteEngine/PisteInput.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/stt/pk2/HEAD/PisteEngine/PisteInput.cpp
--------------------------------------------------------------------------------
/PisteEngine/PisteSound.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/stt/pk2/HEAD/PisteEngine/PisteSound.cpp
--------------------------------------------------------------------------------
/PisteEngineSDL/PisteDraw.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/stt/pk2/HEAD/PisteEngineSDL/PisteDraw.h
--------------------------------------------------------------------------------
/PisteEngineSDL/PisteInput.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/stt/pk2/HEAD/PisteEngineSDL/PisteInput.h
--------------------------------------------------------------------------------
/PisteEngineSDL/PisteSound.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/stt/pk2/HEAD/PisteEngineSDL/PisteSound.h
--------------------------------------------------------------------------------
/PK2LevelEditor/LevelEditor.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/stt/pk2/HEAD/PK2LevelEditor/LevelEditor.cpp
--------------------------------------------------------------------------------
/Pekka Kana 2/Pekka Kana 2.opt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/stt/pk2/HEAD/Pekka Kana 2/Pekka Kana 2.opt
--------------------------------------------------------------------------------
/PisteEngineSDL/PisteDraw.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/stt/pk2/HEAD/PisteEngineSDL/PisteDraw.cpp
--------------------------------------------------------------------------------
/PisteEngineSDL/PisteFont.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/stt/pk2/HEAD/PisteEngineSDL/PisteFont.cpp
--------------------------------------------------------------------------------
/PisteEngineSDL/PisteSound.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/stt/pk2/HEAD/PisteEngineSDL/PisteSound.cpp
--------------------------------------------------------------------------------
/PisteLanguage/PisteLanguage.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/stt/pk2/HEAD/PisteLanguage/PisteLanguage.h
--------------------------------------------------------------------------------
/PisteLanguage/PisteLanguage.opt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/stt/pk2/HEAD/PisteLanguage/PisteLanguage.opt
--------------------------------------------------------------------------------
/PK2LevelEditor/PK2LevelEditor.opt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/stt/pk2/HEAD/PK2LevelEditor/PK2LevelEditor.opt
--------------------------------------------------------------------------------
/Pekka Kana 2/PK2SpriteCreator/PK2SpriteCreator.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/stt/pk2/HEAD/Pekka Kana 2/PK2SpriteCreator/PK2SpriteCreator.cpp
--------------------------------------------------------------------------------
/license.txt:
--------------------------------------------------------------------------------
1 | This package contains the source codes for the game Pekka Kana 2, written by Janne Kivilahti.
2 | The game and it's code are copyrighted by Janne Kivilahti, but you can modify and use the code freely
3 | as long as the original author is mentioned.
--------------------------------------------------------------------------------
/PisteEngine/PisteLog.h:
--------------------------------------------------------------------------------
1 | #ifndef P_LOG
2 | #define P_LOG
3 |
4 | /* PROTOTYPES --------------------------------------------------------------------------------*/
5 |
6 | void PisteLog_Salli_Kirjoitus();
7 |
8 | int PisteLog_Kirjoita(char *viesti);
9 |
10 | #endif
--------------------------------------------------------------------------------
/PisteEngineSDL/PisteLog.h:
--------------------------------------------------------------------------------
1 | #ifndef P_LOG
2 | #define P_LOG
3 |
4 | /* PROTOTYPES --------------------------------------------------------------------------------*/
5 |
6 | void PisteLog_Salli_Kirjoitus();
7 |
8 | int PisteLog_Kirjoita(char *viesti);
9 |
10 | #endif
--------------------------------------------------------------------------------
/Pekka Kana 2/Pekka Kana 2.plg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Build Log
5 |
6 | --------------------Configuration: Pekka Kana 2 - Win32 Debug--------------------
7 |
8 | Command Lines
9 |
10 |
11 |
12 | Results
13 | PK2.exe - 0 error(s), 0 warning(s)
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/PisteLanguage/PisteLanguage.plg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Build Log
5 |
6 | --------------------Configuration: PisteLanguage - Win32 Debug--------------------
7 |
8 | Command Lines
9 |
10 |
11 |
12 | Results
13 | PisteLanguage.exe - 0 error(s), 0 warning(s)
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/PK2LevelEditor/resource.h:
--------------------------------------------------------------------------------
1 | //{{NO_DEPENDENCIES}}
2 | // Microsoft Developer Studio generated include file.
3 | // Used by Resource.rc
4 | //
5 | #define IDI_ICON1 101
6 | #define IDC_CURSOR1 102
7 |
8 | // Next default values for new objects
9 | //
10 | #ifdef APSTUDIO_INVOKED
11 | #ifndef APSTUDIO_READONLY_SYMBOLS
12 | #define _APS_NEXT_RESOURCE_VALUE 103
13 | #define _APS_NEXT_COMMAND_VALUE 40001
14 | #define _APS_NEXT_CONTROL_VALUE 1000
15 | #define _APS_NEXT_SYMED_VALUE 101
16 | #endif
17 | #endif
18 |
--------------------------------------------------------------------------------
/PisteEngine/resource.h:
--------------------------------------------------------------------------------
1 | //{{NO_DEPENDENCIES}}
2 | // Microsoft Developer Studio generated include file.
3 | // Used by Resource.rc
4 | //
5 | #define IDI_ICON1 101
6 | #define IDC_CURSOR1 102
7 |
8 | // Next default values for new objects
9 | //
10 | #ifdef APSTUDIO_INVOKED
11 | #ifndef APSTUDIO_READONLY_SYMBOLS
12 | #define _APS_NEXT_RESOURCE_VALUE 103
13 | #define _APS_NEXT_COMMAND_VALUE 40001
14 | #define _APS_NEXT_CONTROL_VALUE 1000
15 | #define _APS_NEXT_SYMED_VALUE 101
16 | #endif
17 | #endif
18 |
--------------------------------------------------------------------------------
/PisteEngine/PisteWait.h:
--------------------------------------------------------------------------------
1 | #ifndef P_WAIT
2 | #define P_WAIT
3 |
4 | /* INCLUDES ----------------------------------------------------------------------------------*/
5 |
6 | #include
7 |
8 | /* DEFINES -----------------------------------------------------------------------------------*/
9 |
10 | /* PROTOTYPES --------------------------------------------------------------------------------*/
11 |
12 | DWORD PisteWait_Get(void);
13 |
14 | DWORD PisteWait_Start(void);
15 |
16 | DWORD PisteWait_Wait(DWORD count);
17 |
18 | DWORD PisteWait_Laske_Aika(DWORD count);
19 |
20 | #endif
--------------------------------------------------------------------------------
/Pekka Kana 2/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 2.6)
2 |
3 | project(PK2)
4 |
5 | add_definitions("-Wno-write-strings -g")
6 | include_directories(../PisteEngineSDL/ ../PisteLanguage/)
7 | link_directories(../PisteEngineSDL/)
8 |
9 | set(SOURCES
10 | PK2.cpp
11 | PK2Map.cpp
12 | PK2Sprite.cpp
13 | )
14 | find_package(SDL REQUIRED)
15 | find_package(SDL_image REQUIRED)
16 | find_package(SDL_mixer REQUIRED)
17 |
18 | link_libraries (
19 | ${SDL_LIBRARY}
20 | ${SDLIMAGE_LIBRARY}
21 | ${SDLMIXER_LIBRARY}
22 | SDL_gfx
23 | )
24 |
25 | add_executable(PK2 ${SOURCES})
26 | target_link_libraries(PK2 piste)
27 |
28 |
--------------------------------------------------------------------------------
/PisteEngineSDL/PisteWait.h:
--------------------------------------------------------------------------------
1 | #ifndef P_WAIT
2 | #define P_WAIT
3 |
4 | /* INCLUDES ----------------------------------------------------------------------------------*/
5 |
6 |
7 | /* DEFINES -----------------------------------------------------------------------------------*/
8 |
9 | typedef unsigned short WORD;
10 | typedef unsigned long DWORD;
11 |
12 | /* PROTOTYPES --------------------------------------------------------------------------------*/
13 |
14 | DWORD PisteWait_Get(void);
15 |
16 | DWORD PisteWait_Start(void);
17 |
18 | DWORD PisteWait_Wait(DWORD count);
19 |
20 | DWORD PisteWait_Laske_Aika(DWORD count);
21 |
22 | #endif
23 |
--------------------------------------------------------------------------------
/PisteEngine/PisteEngine.dsw:
--------------------------------------------------------------------------------
1 | Microsoft Developer Studio Workspace File, Format Version 6.00
2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
3 |
4 | ###############################################################################
5 |
6 | Project: "PisteEngine"=".\PisteEngine.dsp" - Package Owner=<4>
7 |
8 | Package=<5>
9 | {{{
10 | }}}
11 |
12 | Package=<4>
13 | {{{
14 | }}}
15 |
16 | ###############################################################################
17 |
18 | Global:
19 |
20 | Package=<5>
21 | {{{
22 | }}}
23 |
24 | Package=<3>
25 | {{{
26 | }}}
27 |
28 | ###############################################################################
29 |
30 |
--------------------------------------------------------------------------------
/PisteLanguage/PisteLanguage.dsw:
--------------------------------------------------------------------------------
1 | Microsoft Developer Studio Workspace File, Format Version 6.00
2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
3 |
4 | ###############################################################################
5 |
6 | Project: "PisteLanguage"=".\PisteLanguage.dsp" - Package Owner=<4>
7 |
8 | Package=<5>
9 | {{{
10 | }}}
11 |
12 | Package=<4>
13 | {{{
14 | }}}
15 |
16 | ###############################################################################
17 |
18 | Global:
19 |
20 | Package=<5>
21 | {{{
22 | }}}
23 |
24 | Package=<3>
25 | {{{
26 | }}}
27 |
28 | ###############################################################################
29 |
30 |
--------------------------------------------------------------------------------
/PK2LevelEditor/PK2LevelEditor.dsw:
--------------------------------------------------------------------------------
1 | Microsoft Developer Studio Workspace File, Format Version 6.00
2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
3 |
4 | ###############################################################################
5 |
6 | Project: "PK2LevelEditor"=".\PK2LevelEditor.dsp" - Package Owner=<4>
7 |
8 | Package=<5>
9 | {{{
10 | }}}
11 |
12 | Package=<4>
13 | {{{
14 | }}}
15 |
16 | ###############################################################################
17 |
18 | Global:
19 |
20 | Package=<5>
21 | {{{
22 | }}}
23 |
24 | Package=<3>
25 | {{{
26 | }}}
27 |
28 | ###############################################################################
29 |
30 |
--------------------------------------------------------------------------------
/Pekka Kana 2/resource.h:
--------------------------------------------------------------------------------
1 | //{{NO_DEPENDENCIES}}
2 | // Microsoft Developer Studio generated include file.
3 | // Used by Resource.rc
4 | //
5 | #define IDI_ICON1 101
6 | #define IDC_CURSOR1 102
7 | //#define SETUPBMP 103
8 | #define IDB_BITMAP1 106
9 |
10 | // Next default values for new objects
11 | //
12 | #ifdef APSTUDIO_INVOKED
13 | #ifndef APSTUDIO_READONLY_SYMBOLS
14 | #define _APS_NO_MFC 1
15 | #define _APS_NEXT_RESOURCE_VALUE 107
16 | #define _APS_NEXT_COMMAND_VALUE 40001
17 | #define _APS_NEXT_CONTROL_VALUE 1000
18 | #define _APS_NEXT_SYMED_VALUE 101
19 | #endif
20 | #endif
21 |
--------------------------------------------------------------------------------
/PisteEngineSDL/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 2.6)
2 |
3 | project(PisteEngineSDL)
4 |
5 | add_definitions("-Wno-write-strings -g")
6 | include_directories("../PisteLanguage/")
7 |
8 | set(SOURCES
9 | Game.cpp
10 | PisteDraw.cpp
11 | PisteFont.cpp
12 | PisteSFX.cpp
13 | PisteSound.cpp
14 | PisteInput.cpp
15 | PisteLog.cpp
16 | PisteWait.cpp
17 | ../PisteLanguage/PisteLanguage.cpp
18 | )
19 |
20 | find_package(SDL REQUIRED)
21 | find_package(SDL_image REQUIRED)
22 | find_package(SDL_mixer REQUIRED)
23 |
24 | add_library(piste STATIC ${SOURCES})
25 |
26 | link_libraries (
27 | ${SDL_LIBRARY}
28 | ${SDLIMAGE_LIBRARY}
29 | ${SDLMIXER_LIBRARY}
30 | SDL_gfx
31 | )
32 |
33 | add_executable(Game Game.cpp)
34 | target_link_libraries(Game piste)
35 |
36 |
--------------------------------------------------------------------------------
/Pekka Kana 2/Pekka Kana 2.dsw:
--------------------------------------------------------------------------------
1 | Microsoft Developer Studio Workspace File, Format Version 6.00
2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
3 |
4 | ###############################################################################
5 |
6 | Project: "PK2SpriteCreator"=".\PK2SpriteCreator\PK2SpriteCreator.dsp" - Package Owner=<4>
7 |
8 | Package=<5>
9 | {{{
10 | }}}
11 |
12 | Package=<4>
13 | {{{
14 | }}}
15 |
16 | ###############################################################################
17 |
18 | Project: "Pekka Kana 2"=".\Pekka Kana 2.dsp" - Package Owner=<4>
19 |
20 | Package=<5>
21 | {{{
22 | }}}
23 |
24 | Package=<4>
25 | {{{
26 | }}}
27 |
28 | ###############################################################################
29 |
30 | Global:
31 |
32 | Package=<5>
33 | {{{
34 | }}}
35 |
36 | Package=<3>
37 | {{{
38 | }}}
39 |
40 | ###############################################################################
41 |
42 |
--------------------------------------------------------------------------------
/PisteEngineSDL/PisteSFX.h:
--------------------------------------------------------------------------------
1 | #ifndef P_SFX
2 | #define P_SFX
3 |
4 | #include "PisteSound.h"
5 |
6 | #include
7 |
8 | typedef unsigned short USHORT;
9 | typedef unsigned short WORD;
10 | typedef unsigned long DWORD;
11 | typedef unsigned char UCHAR;
12 | typedef unsigned char BYTE;
13 |
14 | #define _MAX_PATH 128 //TODO: real value
15 |
16 | class PisteSFX
17 | {
18 | private:
19 |
20 | int Lataa_Wav(char *filename, int control_flags);
21 |
22 | public:
23 | Mix_Chunk *sound;
24 | char tiedosto[_MAX_PATH];
25 | UCHAR kanavia;
26 | DWORD samplerate;
27 | UCHAR bitrate;
28 |
29 | PisteSFX();
30 | PisteSFX(UCHAR kanavia, DWORD samplerate, UCHAR bitrate);
31 | virtual ~PisteSFX();
32 |
33 | void Tuhoa();
34 | int Soita();
35 | int Soita(int volume);
36 | int Soita(int volume, int pan, int freq);
37 | int Lataa(char *filename, int control_flags);
38 | };
39 |
40 | int PisteSFX_Set_Sfx(bool play);
41 | bool PisteSFX_Get_Sfx(void);
42 |
43 | int PisteSFX_Lataa_WAV(PisteSFX *soundi, char *filename, int control_flags);
44 |
45 | #endif
46 |
--------------------------------------------------------------------------------
/PK2LevelEditor/PK2LevelEditor.dep:
--------------------------------------------------------------------------------
1 | # Microsoft Developer Studio Generated Dependency File, included by PK2LevelEditor.mak
2 |
3 | .\LevelEditor.cpp : \
4 | "..\..\vc98\include\basetsd.h"\
5 | "..\PisteEngine\PisteDraw.h"\
6 | "..\PisteEngine\PisteInput.h"\
7 | "..\PisteEngine\PisteWait.h"\
8 | "..\Pk2\PK2Map.h"\
9 | "..\pk2\pk2sprite.h"\
10 |
11 |
12 | ..\PisteEngine\PisteDraw.cpp : \
13 | "..\..\vc98\include\basetsd.h"\
14 | "..\PisteEngine\PisteDraw.h"\
15 | "..\PisteEngine\PisteFont.h"\
16 |
17 |
18 | ..\PisteEngine\PisteFont.cpp : \
19 | "..\..\vc98\include\basetsd.h"\
20 | "..\PisteEngine\PisteFont.h"\
21 |
22 |
23 | ..\PisteEngine\PisteInput.cpp : \
24 | "..\..\vc98\include\basetsd.h"\
25 | "..\PisteEngine\PisteInput.h"\
26 |
27 |
28 | ..\PisteEngine\PisteWait.cpp : \
29 | "..\..\vc98\include\basetsd.h"\
30 | "..\PisteEngine\PisteWait.h"\
31 |
32 |
33 | ..\Pk2\PK2Map.cpp : \
34 | "..\..\vc98\include\basetsd.h"\
35 | "..\PisteEngine\PisteDraw.h"\
36 | "..\Pk2\PK2Map.h"\
37 |
38 |
39 | .\Resource.rc : \
40 | ".\cursor1.cur"\
41 | ".\GameIcon.ico"\
42 |
43 |
--------------------------------------------------------------------------------
/PisteEngineSDL/PisteLog.cpp:
--------------------------------------------------------------------------------
1 | /* INCLUDES ----------------------------------------------------------------------------------*/
2 |
3 | #include
4 | #include
5 | #include
6 | //#include
7 | #include
8 | #include
9 | #include
10 | #include "PisteLog.h"
11 |
12 | /* VARIABLES ---------------------------------------------------------------------------------*/
13 |
14 | bool kirjoita_pisteloki = false;
15 |
16 | /* METHODS ----------------------------------------------------------------------------------*/
17 |
18 | void PisteLog_Salli_Kirjoitus() {
19 | kirjoita_pisteloki = true;
20 | }
21 |
22 | int PisteLog_Kirjoita(char *viesti) {
23 |
24 | if (kirjoita_pisteloki) {
25 |
26 | int virhe = 0;
27 |
28 | char *filename = "log.txt";
29 |
30 | FILE *tiedosto;
31 |
32 | if ((tiedosto = fopen(filename, "a")) == NULL)
33 | {
34 | return(1);
35 | }
36 |
37 | char mjono[255];
38 |
39 | strcpy(mjono,viesti);
40 |
41 | fwrite(mjono, sizeof(char), strlen(mjono), tiedosto);
42 |
43 | fclose(tiedosto);
44 | }
45 |
46 | return(0);
47 | }
48 |
--------------------------------------------------------------------------------
/PisteEngine/PisteWait.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | PisteEngine - PisteWait 1.0
3 | 09.12.2001 Janne Kivilahti / Piste Gamez
4 | */
5 |
6 | /* INCLUDES ----------------------------------------------------------------------------------*/
7 |
8 | #include "PisteWait.h"
9 | #include
10 | /* DEFINES -----------------------------------------------------------------------------------*/
11 |
12 |
13 | /* TYPE DEFINITIONS --------------------------------------------------------------------------*/
14 |
15 |
16 | /* VARIABLES ---------------------------------------------------------------------------------*/
17 |
18 | DWORD PW_laskuri = 0;
19 |
20 | /* METHODS -----------------------------------------------------------------------------------*/
21 |
22 | DWORD PisteWait_Get(void)
23 | {
24 | return(GetTickCount());
25 | }
26 |
27 | DWORD PisteWait_Start(void)
28 | {
29 | PW_laskuri = PisteWait_Get();
30 | return(PW_laskuri);
31 | }
32 |
33 | DWORD PisteWait_Wait(DWORD count)
34 | {
35 | while ((PisteWait_Get() - PW_laskuri) < count);
36 | return (PisteWait_Get());
37 | }
38 |
39 | DWORD PisteWait_Laske_Aika(DWORD count)
40 | {
41 | return(PisteWait_Get() - PW_laskuri);
42 | }
--------------------------------------------------------------------------------
/PisteEngine/PisteSFX.h:
--------------------------------------------------------------------------------
1 | #ifndef P_SFX
2 | #define P_SFX
3 |
4 | #include "D:\Visual Studio\MyProjects\PisteEngine\PisteSound.h"
5 | #include
6 | class PisteSFX
7 | {
8 | private:
9 |
10 | int Lataa_Wav(char *filename, int control_flags, LPDIRECTSOUND lpds,
11 | WAVEFORMATEX pcmwf, DSBUFFERDESC dsbd);
12 |
13 | public:
14 | LPDIRECTSOUNDBUFFER dsbuffer[MAX_POLY_PER_FX];
15 | int state[MAX_POLY_PER_FX];
16 | int rate;
17 | int size;
18 | int id;
19 | int buffer_index;
20 | char tiedosto[_MAX_PATH];
21 | UCHAR kanavia;
22 | DWORD samplerate;
23 | UCHAR bitrate;
24 |
25 | PisteSFX();
26 | PisteSFX(UCHAR kanavia, DWORD samplerate, UCHAR bitrate);
27 | virtual ~PisteSFX();
28 |
29 | void Tuhoa();
30 | int Soita();
31 | int Soita(int volume);
32 | int Soita(int volume, int pan, int freq);
33 | int Lataa(char *filename, int control_flags, LPDIRECTSOUND lpds,
34 | WAVEFORMATEX pcmwf, DSBUFFERDESC dsbd);
35 | };
36 |
37 | int PisteSFX_Set_Sfx(bool play);
38 | bool PisteSFX_Get_Sfx(void);
39 |
40 | int PisteSFX_Lataa_WAV(PisteSFX *soundi, char *filename, int control_flags, LPDIRECTSOUND lpds,
41 | WAVEFORMATEX pcmwf, DSBUFFERDESC dsbd);
42 |
43 | #endif
--------------------------------------------------------------------------------
/PisteEngine/PisteLog.cpp:
--------------------------------------------------------------------------------
1 | /* INCLUDES ----------------------------------------------------------------------------------*/
2 |
3 | #include
4 | #include
5 | #include
6 | #include
7 | #include
8 | #include
9 | #include
10 | #include
11 | #include
12 | #include
13 | #include
14 | #include "PisteLog.h"
15 |
16 | /* VARIABLES ---------------------------------------------------------------------------------*/
17 |
18 | bool kirjoita_pisteloki = false;
19 |
20 | /* METHODS ----------------------------------------------------------------------------------*/
21 |
22 | void PisteLog_Salli_Kirjoitus() {
23 | kirjoita_pisteloki = true;
24 | }
25 |
26 | int PisteLog_Kirjoita(char *viesti) {
27 |
28 | if (kirjoita_pisteloki) {
29 |
30 | int virhe = 0;
31 |
32 | char *filename = "log.txt";
33 |
34 | FILE *tiedosto;
35 |
36 | if ((tiedosto = fopen(filename, "a")) == NULL)
37 | {
38 | return(1);
39 | }
40 |
41 | char mjono[255];
42 |
43 | strcpy(mjono,viesti);
44 |
45 | fwrite(mjono, sizeof(CHAR), strlen(mjono), tiedosto);
46 |
47 | fclose(tiedosto);
48 | }
49 |
50 | return(0);
51 | }
--------------------------------------------------------------------------------
/Pekka Kana 2/PK2SpriteCreator/PK2SpriteCreator.plg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Build Log
5 |
6 | --------------------Configuration: PK2SpriteCreator - Win32 Debug--------------------
7 |
8 | Command Lines
9 | Creating temporary file "C:\DOCUME~1\Janne\LOCALS~1\Temp\RSP30.tmp" with contents
10 | [
11 | kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /incremental:yes /pdb:"Debug/PK2SpriteCreator.pdb" /debug /machine:I386 /out:"Debug/PK2SpriteCreator.exe" /pdbtype:sept
12 | ".\Debug\PisteDraw.obj"
13 | ".\Debug\PisteFont.obj"
14 | ".\Debug\PisteLanguage.obj"
15 | ".\Debug\PisteLog.obj"
16 | ".\Debug\PisteSFX.obj"
17 | ".\Debug\PisteSound.obj"
18 | ".\Debug\PK2Sprite.obj"
19 | ".\Debug\PK2SpriteCreator.obj"
20 | "..\..\..\..\Dxsdk\Lib\ddraw.lib"
21 | "..\..\..\..\Dxsdk\Lib\dsound.lib"
22 | "..\..\..\Vc98\Lib\Winmm.lib"
23 | ]
24 | Creating command line "link.exe @C:\DOCUME~1\Janne\LOCALS~1\Temp\RSP30.tmp"
25 | Output Window
26 | Linking...
27 |
28 |
29 |
30 | Results
31 | PK2SpriteCreator.exe - 0 error(s), 0 warning(s)
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/PisteEngineSDL/PisteWait.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | PisteEngineSDL - PisteWait
3 |
4 | */
5 |
6 | /* INCLUDES ----------------------------------------------------------------------------------*/
7 |
8 | #include "PisteWait.h"
9 | #include
10 | #include
11 | /* DEFINES -----------------------------------------------------------------------------------*/
12 |
13 | #define FPS 70
14 |
15 | /* TYPE DEFINITIONS --------------------------------------------------------------------------*/
16 |
17 |
18 | /* VARIABLES ---------------------------------------------------------------------------------*/
19 |
20 | DWORD PW_laskuri = 0;
21 |
22 | /* METHODS -----------------------------------------------------------------------------------*/
23 |
24 | DWORD PisteWait_Get(void)
25 | {
26 | return(SDL_GetTicks());
27 | }
28 |
29 | DWORD PisteWait_Start(void)
30 | {
31 | PW_laskuri = PisteWait_Get();
32 | return(PW_laskuri);
33 | }
34 |
35 | DWORD PisteWait_Wait(DWORD count)
36 | {
37 | //while ((PisteWait_Get() - PW_laskuri) < count);
38 | Uint32 last_time = PisteWait_Get();
39 |
40 | if (last_time < PW_laskuri + (1000 / FPS))
41 | SDL_Delay(PW_laskuri + (1000 / FPS) - last_time);
42 |
43 | return (PisteWait_Get());
44 | }
45 |
46 | DWORD PisteWait_Laske_Aika(DWORD count)
47 | {
48 | return(PisteWait_Get() - PW_laskuri);
49 | }
50 |
--------------------------------------------------------------------------------
/PisteEngine/PisteFont.h:
--------------------------------------------------------------------------------
1 | #ifndef P_FONT
2 | #define P_FONT
3 |
4 | #include "D:\Visual Studio\MyProjects\PisteEngine\PisteDraw.h"
5 | #include "D:\Visual Studio\MyProjects\PisteLanguage\PisteLanguage.h"
6 |
7 | class PisteFont
8 | {
9 | private:
10 | int font_table[256];
11 | int font_korkeus, font_leveys, font_lkm;
12 | PisteLanguage *tiedosto;
13 |
14 | public:
15 | UCHAR *font_bitmap;
16 | int font_buffer;
17 |
18 | int Init_fonts(void);
19 | int Init_fonts_tiedosto(void);
20 | int Get_bitmap(int buffer_x, int buffer_y, int ruudun_leveys,UCHAR *buffer);
21 |
22 | int Piirra_merkkijono(char *merkkijono, int font_x, int font_y, int kohde_buffer);
23 |
24 | int Piirra_merkkijono(int font_x, int font_y, int lPitch, char *merkkijono,
25 | UCHAR *back_buffer, bool loop);
26 | int Piirra_merkkijono_led(int font_x, int font_y, int lPitch, char *merkkijono,
27 | UCHAR *back_buffer);
28 | int Piirra_merkkijono_lapinakyva(int font_x, int font_y, int lPitch, RECT klipperi, char *merkkijono,
29 | UCHAR *back_buffer, bool loop, int pros);
30 | int Piirra_merkkijono_varillinen(int font_x, int font_y, int lPitch, char *merkkijono,
31 | UCHAR *back_buffer, bool loop, UCHAR color2);
32 | int Korkeus(void){return font_korkeus;};
33 |
34 | int LataaTiedostosta(char *polku, char *file);
35 |
36 | PisteFont(int korkeus, int leveys, int lkm);
37 | PisteFont();
38 | ~PisteFont();
39 |
40 |
41 | };
42 |
43 | #endif
--------------------------------------------------------------------------------
/PisteEngineSDL/PisteFont.h:
--------------------------------------------------------------------------------
1 | #ifndef P_FONT
2 | #define P_FONT
3 |
4 | #include "PisteDraw.h"
5 | #include "PisteLanguage.h"
6 |
7 | class PisteFont
8 | {
9 | private:
10 | int font_table[256];
11 | int font_korkeus, font_leveys, font_lkm;
12 | PisteLanguage *tiedosto;
13 |
14 | public:
15 | UCHAR *font_bitmap;
16 | int font_buffer;
17 |
18 | int Init_fonts(void);
19 | int Init_fonts_tiedosto(void);
20 | int Get_bitmap(int buffer_x, int buffer_y, int ruudun_leveys, int buffer_index);
21 | int Get_bitmap(int buffer_x, int buffer_y, int ruudun_leveys,UCHAR *buffer);
22 |
23 | int Piirra_merkkijono(char *merkkijono, int font_x, int font_y, int kohde_buffer);
24 |
25 | int Piirra_merkkijono(int font_x, int font_y, int lPitch, char *merkkijono,
26 | UCHAR *back_buffer, bool loop);
27 | int Piirra_merkkijono_led(int font_x, int font_y, int lPitch, char *merkkijono,
28 | UCHAR *back_buffer);
29 | int Piirra_merkkijono_lapinakyva(int font_x, int font_y, int lPitch, SDL_Rect klipperi, char *merkkijono,
30 | UCHAR *back_buffer, bool loop, int pros);
31 | int Piirra_merkkijono_varillinen(int font_x, int font_y, int lPitch, char *merkkijono,
32 | UCHAR *back_buffer, bool loop, UCHAR color2);
33 | int Korkeus(void){return font_korkeus;};
34 |
35 | int LataaTiedostosta(char *polku, char *file);
36 |
37 | PisteFont(int korkeus, int leveys, int lkm);
38 | PisteFont();
39 | ~PisteFont();
40 |
41 |
42 | };
43 |
44 | #endif
45 |
--------------------------------------------------------------------------------
/PisteEngineSDL/test.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | c++ test.cpp -o test -lSDLmain -lSDL -lpthread -lSDL_image
3 | */
4 | #include
5 | #include
6 | #define PD_TAUSTABUFFER 0
7 |
8 | const int SCREEN_WIDTH = 800;
9 | const int SCREEN_HEIGHT = 600;
10 | bool Running = false;// jos tämä muuttuu todeksi niin ohjelma lopetetaan
11 | SDL_Surface *PD_buffers[2];
12 |
13 | void Game_Init() {
14 | PD_buffers[PD_TAUSTABUFFER] = SDL_SetVideoMode(SCREEN_WIDTH, SCREEN_HEIGHT, 32, SDL_SWSURFACE|SDL_DOUBLEBUF);
15 | if(PD_buffers[PD_TAUSTABUFFER] == NULL) {
16 | fprintf(stderr, "CreateRGBSurface failed: %s\n", SDL_GetError());
17 | exit(1);
18 | }
19 | PD_buffers[1] = IMG_Load("wormz2.bmp");
20 | Running = true;
21 | }
22 |
23 | int map_x = 0;
24 | int Game_Main(void)
25 | {
26 | map_x = 1 + map_x%640;
27 | SDL_FillRect(PD_buffers[PD_TAUSTABUFFER], NULL, rand()%60);
28 | SDL_Rect src = {map_x, 0, 0, 0};
29 | SDL_BlitSurface(PD_buffers[1], NULL, PD_buffers[PD_TAUSTABUFFER], &src);
30 | SDL_Flip(PD_buffers[PD_TAUSTABUFFER]);
31 | }
32 |
33 | int main(int argc, char *argv[])
34 | {
35 |
36 | if ( SDL_Init(SDL_INIT_AUDIO|SDL_INIT_VIDEO) < 0 )
37 | {
38 | printf("Unable to init SDL: %s\n", SDL_GetError());
39 | exit(1);
40 | }
41 | atexit(SDL_Quit);
42 |
43 | Game_Init();
44 |
45 | SDL_Event event;
46 | while(Running) {
47 | SDL_PollEvent(&event);
48 | switch(event.type){
49 | case SDL_QUIT:
50 | Running = false;
51 | break;
52 | }
53 | Game_Main();
54 | }
55 |
56 | }
57 |
58 |
--------------------------------------------------------------------------------
/PisteEngine/PisteEngine.plg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Build Log
5 |
6 | --------------------Configuration: PisteEngine - Win32 Release--------------------
7 |
8 | Command Lines
9 | Creating temporary file "C:\WINDOWS\TEMP\RSPB1C4.TMP" with contents
10 | [
11 | /nologo /ML /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /Fp"Release/PisteEngine.pch" /YX /Fo"Release/" /Fd"Release/" /FD /c
12 | "G:\Microsoft Visual Studio\MyProjects\PisteEngine\Game.cpp"
13 | ]
14 | Creating command line "cl.exe @C:\WINDOWS\TEMP\RSPB1C4.TMP"
15 | Creating temporary file "C:\WINDOWS\TEMP\RSPB1C5.TMP" with contents
16 | [
17 | kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /incremental:no /pdb:"Release/PisteEngine.pdb" /machine:I386 /out:"Release/PisteEngine.exe"
18 | ".\Release\Game.obj"
19 | ".\Release\PisteDraw.obj"
20 | ".\Release\PisteFont.obj"
21 | ".\Release\PisteInput.obj"
22 | ".\Release\PisteSFX.obj"
23 | ".\Release\PisteSound.obj"
24 | ".\Release\PisteWait.obj"
25 | ".\Release\Resource.res"
26 | "..\..\..\mssdk\DirectX7\lib\dsound.lib"
27 | "..\..\..\mssdk\DirectX7\lib\dinput.lib"
28 | "..\..\..\mssdk\DirectX7\lib\ddraw.lib"
29 | "..\..\Vc98\Lib\Winmm.lib"
30 | ]
31 | Creating command line "link.exe @C:\WINDOWS\TEMP\RSPB1C5.TMP"
32 | Output Window
33 | Compiling...
34 | Game.cpp
35 | Linking...
36 |
37 |
38 |
39 | Results
40 | PisteEngine.exe - 0 error(s), 0 warning(s)
41 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/PK2LevelEditor/PK2LevelEditor.plg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Build Log
5 |
6 | --------------------Configuration: PK2LevelEditor - Win32 Debug--------------------
7 |
8 | Command Lines
9 | Creating temporary file "C:\WINDOWS\TEMP\RSP10D2.TMP" with contents
10 | [
11 | /nologo /MLd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /Fp"Debug/PK2LevelEditor.pch" /YX /Fo"Debug/" /Fd"Debug/" /FD /GZ /c
12 | "G:\Microsoft Visual Studio\MyProjects\PK2LevelEditor\LevelEditor.cpp"
13 | ]
14 | Creating command line "cl.exe @C:\WINDOWS\TEMP\RSP10D2.TMP"
15 | Creating temporary file "C:\WINDOWS\TEMP\RSP10D3.TMP" with contents
16 | [
17 | kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /incremental:yes /pdb:"Debug/PK2LevelEditor.pdb" /debug /machine:I386 /out:"Debug/PK2LevelEditor.exe" /pdbtype:sept
18 | ".\Debug\LevelEditor.obj"
19 | ".\Debug\PisteDraw.obj"
20 | ".\Debug\PisteFont.obj"
21 | ".\Debug\PisteInput.obj"
22 | ".\Debug\PisteLanguage.obj"
23 | ".\Debug\PisteLog.obj"
24 | ".\Debug\PisteSFX.obj"
25 | ".\Debug\PisteSound.obj"
26 | ".\Debug\PisteWait.obj"
27 | ".\Debug\PK2Map.obj"
28 | ".\Debug\PK2Sprite.obj"
29 | ".\Debug\Resource.res"
30 | "..\..\..\mssdk\DirectX7\lib\ddraw.lib"
31 | "..\..\..\mssdk\DirectX7\lib\dinput.lib"
32 | "..\..\Vc98\Lib\Winmm.lib"
33 | "..\..\..\mssdk\DirectX7\lib\dsound.lib"
34 | ]
35 | Creating command line "link.exe @C:\WINDOWS\TEMP\RSP10D3.TMP"
36 | Output Window
37 | Compiling...
38 | LevelEditor.cpp
39 | Linking...
40 |
41 |
42 |
43 | Results
44 | PK2LevelEditor.exe - 0 error(s), 0 warning(s)
45 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/PisteEngine/Resource.rc:
--------------------------------------------------------------------------------
1 | //Microsoft Developer Studio generated resource script.
2 | //
3 | #include "resource.h"
4 |
5 | #define APSTUDIO_READONLY_SYMBOLS
6 | /////////////////////////////////////////////////////////////////////////////
7 | //
8 | // Generated from the TEXTINCLUDE 2 resource.
9 | //
10 | #include "afxres.h"
11 |
12 | /////////////////////////////////////////////////////////////////////////////
13 | #undef APSTUDIO_READONLY_SYMBOLS
14 |
15 | /////////////////////////////////////////////////////////////////////////////
16 | // English (U.S.) resources
17 |
18 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
19 | #ifdef _WIN32
20 | LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
21 | #pragma code_page(1252)
22 | #endif //_WIN32
23 |
24 | #ifdef APSTUDIO_INVOKED
25 | /////////////////////////////////////////////////////////////////////////////
26 | //
27 | // TEXTINCLUDE
28 | //
29 |
30 | 1 TEXTINCLUDE DISCARDABLE
31 | BEGIN
32 | "resource.h\0"
33 | END
34 |
35 | 2 TEXTINCLUDE DISCARDABLE
36 | BEGIN
37 | "#include ""afxres.h""\r\n"
38 | "\0"
39 | END
40 |
41 | 3 TEXTINCLUDE DISCARDABLE
42 | BEGIN
43 | "\r\n"
44 | "\0"
45 | END
46 |
47 | #endif // APSTUDIO_INVOKED
48 |
49 |
50 | /////////////////////////////////////////////////////////////////////////////
51 | //
52 | // Icon
53 | //
54 |
55 | // Icon with lowest ID value placed first to ensure application icon
56 | // remains consistent on all systems.
57 | IDI_ICON1 ICON DISCARDABLE "GameIcon.ico"
58 |
59 | /////////////////////////////////////////////////////////////////////////////
60 | //
61 | // Cursor
62 | //
63 |
64 | IDC_CURSOR1 CURSOR DISCARDABLE "cursor1.cur"
65 | #endif // English (U.S.) resources
66 | /////////////////////////////////////////////////////////////////////////////
67 |
68 |
69 |
70 | #ifndef APSTUDIO_INVOKED
71 | /////////////////////////////////////////////////////////////////////////////
72 | //
73 | // Generated from the TEXTINCLUDE 3 resource.
74 | //
75 |
76 |
77 | /////////////////////////////////////////////////////////////////////////////
78 | #endif // not APSTUDIO_INVOKED
79 |
80 |
--------------------------------------------------------------------------------
/PK2LevelEditor/Resource.rc:
--------------------------------------------------------------------------------
1 | //Microsoft Developer Studio generated resource script.
2 | //
3 | #include "resource.h"
4 |
5 | #define APSTUDIO_READONLY_SYMBOLS
6 | /////////////////////////////////////////////////////////////////////////////
7 | //
8 | // Generated from the TEXTINCLUDE 2 resource.
9 | //
10 | #include "afxres.h"
11 |
12 | /////////////////////////////////////////////////////////////////////////////
13 | #undef APSTUDIO_READONLY_SYMBOLS
14 |
15 | /////////////////////////////////////////////////////////////////////////////
16 | // English (U.S.) resources
17 |
18 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
19 | #ifdef _WIN32
20 | LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
21 | #pragma code_page(1252)
22 | #endif //_WIN32
23 |
24 | #ifdef APSTUDIO_INVOKED
25 | /////////////////////////////////////////////////////////////////////////////
26 | //
27 | // TEXTINCLUDE
28 | //
29 |
30 | 1 TEXTINCLUDE DISCARDABLE
31 | BEGIN
32 | "resource.h\0"
33 | END
34 |
35 | 2 TEXTINCLUDE DISCARDABLE
36 | BEGIN
37 | "#include ""afxres.h""\r\n"
38 | "\0"
39 | END
40 |
41 | 3 TEXTINCLUDE DISCARDABLE
42 | BEGIN
43 | "\r\n"
44 | "\0"
45 | END
46 |
47 | #endif // APSTUDIO_INVOKED
48 |
49 |
50 | /////////////////////////////////////////////////////////////////////////////
51 | //
52 | // Icon
53 | //
54 |
55 | // Icon with lowest ID value placed first to ensure application icon
56 | // remains consistent on all systems.
57 | IDI_ICON1 ICON DISCARDABLE "GameIcon.ico"
58 |
59 | /////////////////////////////////////////////////////////////////////////////
60 | //
61 | // Cursor
62 | //
63 |
64 | IDC_CURSOR1 CURSOR DISCARDABLE "cursor1.cur"
65 | #endif // English (U.S.) resources
66 | /////////////////////////////////////////////////////////////////////////////
67 |
68 |
69 |
70 | #ifndef APSTUDIO_INVOKED
71 | /////////////////////////////////////////////////////////////////////////////
72 | //
73 | // Generated from the TEXTINCLUDE 3 resource.
74 | //
75 |
76 |
77 | /////////////////////////////////////////////////////////////////////////////
78 | #endif // not APSTUDIO_INVOKED
79 |
80 |
--------------------------------------------------------------------------------
/Pekka Kana 2/Resource.rc:
--------------------------------------------------------------------------------
1 | //Microsoft Developer Studio generated resource script.
2 | //
3 | #include "resource.h"
4 |
5 | #define APSTUDIO_READONLY_SYMBOLS
6 | /////////////////////////////////////////////////////////////////////////////
7 | //
8 | // Generated from the TEXTINCLUDE 2 resource.
9 | //
10 | #include "afxres.h"
11 |
12 | /////////////////////////////////////////////////////////////////////////////
13 | #undef APSTUDIO_READONLY_SYMBOLS
14 |
15 | /////////////////////////////////////////////////////////////////////////////
16 | // Finnish resources
17 |
18 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_FIN)
19 | #ifdef _WIN32
20 | LANGUAGE LANG_FINNISH, SUBLANG_DEFAULT
21 | #pragma code_page(1252)
22 | #endif //_WIN32
23 |
24 | #ifdef APSTUDIO_INVOKED
25 | /////////////////////////////////////////////////////////////////////////////
26 | //
27 | // TEXTINCLUDE
28 | //
29 |
30 | 1 TEXTINCLUDE DISCARDABLE
31 | BEGIN
32 | "resource.h\0"
33 | END
34 |
35 | 2 TEXTINCLUDE DISCARDABLE
36 | BEGIN
37 | "#include ""afxres.h""\r\n"
38 | "\0"
39 | END
40 |
41 | 3 TEXTINCLUDE DISCARDABLE
42 | BEGIN
43 | "\r\n"
44 | "\0"
45 | END
46 |
47 | #endif // APSTUDIO_INVOKED
48 |
49 |
50 | /////////////////////////////////////////////////////////////////////////////
51 | //
52 | // Icon
53 | //
54 |
55 | // Icon with lowest ID value placed first to ensure application icon
56 | // remains consistent on all systems.
57 | IDI_ICON1 ICON DISCARDABLE "icon1.ico"
58 |
59 | /////////////////////////////////////////////////////////////////////////////
60 | //
61 | // Cursor
62 | //
63 |
64 | IDC_CURSOR1 CURSOR DISCARDABLE "cursor1.cur"
65 |
66 | /////////////////////////////////////////////////////////////////////////////
67 | //
68 | // Bitmap
69 | //
70 |
71 | SETUPBMP BITMAP DISCARDABLE "PEKKA.bmp"
72 | #endif // Finnish resources
73 | /////////////////////////////////////////////////////////////////////////////
74 |
75 |
76 |
77 | #ifndef APSTUDIO_INVOKED
78 | /////////////////////////////////////////////////////////////////////////////
79 | //
80 | // Generated from the TEXTINCLUDE 3 resource.
81 | //
82 |
83 |
84 | /////////////////////////////////////////////////////////////////////////////
85 | #endif // not APSTUDIO_INVOKED
86 |
87 |
--------------------------------------------------------------------------------
/Pekka Kana 2/Resource_temp.rc:
--------------------------------------------------------------------------------
1 | //Microsoft Developer Studio generated resource script.
2 | //
3 | #include "resource.h"
4 |
5 | #define APSTUDIO_READONLY_SYMBOLS
6 | /////////////////////////////////////////////////////////////////////////////
7 | //
8 | // Generated from the TEXTINCLUDE 2 resource.
9 | //
10 | #include "afxres.h"
11 |
12 | /////////////////////////////////////////////////////////////////////////////
13 | #undef APSTUDIO_READONLY_SYMBOLS
14 |
15 | /////////////////////////////////////////////////////////////////////////////
16 | // Neutral resources
17 |
18 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_NEU)
19 | #ifdef _WIN32
20 | LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
21 | #pragma code_page(1252)
22 | #endif //_WIN32
23 |
24 | /////////////////////////////////////////////////////////////////////////////
25 | //
26 | // Bitmap
27 | //
28 |
29 | IDB_BITMAP1 BITMAP DISCARDABLE "PEKKA.bmp"
30 | #endif // Neutral resources
31 | /////////////////////////////////////////////////////////////////////////////
32 |
33 |
34 | /////////////////////////////////////////////////////////////////////////////
35 | // Finnish resources
36 |
37 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_FIN)
38 | #ifdef _WIN32
39 | LANGUAGE LANG_FINNISH, SUBLANG_DEFAULT
40 | #pragma code_page(1252)
41 | #endif //_WIN32
42 |
43 | #ifdef APSTUDIO_INVOKED
44 | /////////////////////////////////////////////////////////////////////////////
45 | //
46 | // TEXTINCLUDE
47 | //
48 |
49 | 1 TEXTINCLUDE DISCARDABLE
50 | BEGIN
51 | "resource.h\0"
52 | END
53 |
54 | 2 TEXTINCLUDE DISCARDABLE
55 | BEGIN
56 | "#include ""afxres.h""\r\n"
57 | "\0"
58 | END
59 |
60 | 3 TEXTINCLUDE DISCARDABLE
61 | BEGIN
62 | "\r\n"
63 | "\0"
64 | END
65 |
66 | #endif // APSTUDIO_INVOKED
67 |
68 |
69 | /////////////////////////////////////////////////////////////////////////////
70 | //
71 | // Icon
72 | //
73 |
74 | // Icon with lowest ID value placed first to ensure application icon
75 | // remains consistent on all systems.
76 | IDI_ICON1 ICON DISCARDABLE "icon1.ico"
77 |
78 | /////////////////////////////////////////////////////////////////////////////
79 | //
80 | // Cursor
81 | //
82 |
83 | IDC_CURSOR1 CURSOR DISCARDABLE "cursor1.cur"
84 | #endif // Finnish resources
85 | /////////////////////////////////////////////////////////////////////////////
86 |
87 |
88 |
89 | #ifndef APSTUDIO_INVOKED
90 | /////////////////////////////////////////////////////////////////////////////
91 | //
92 | // Generated from the TEXTINCLUDE 3 resource.
93 | //
94 |
95 |
96 | /////////////////////////////////////////////////////////////////////////////
97 | #endif // not APSTUDIO_INVOKED
98 |
99 |
--------------------------------------------------------------------------------
/PisteEngineSDL/PisteSFX.cpp:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 | #include
4 | #include
5 | #include
6 | #include
7 | #include
8 | #include
9 | #include
10 |
11 | #include "PisteSFX.h"
12 |
13 | #define DSBVOLUME_MAX MIX_MAX_VOLUME
14 | #define DSBVOLUME_MIN 0
15 |
16 | bool play_sfx = true;
17 |
18 | PisteSFX::PisteSFX()
19 | {
20 | strcpy(this->tiedosto," ");
21 | }
22 |
23 | PisteSFX::PisteSFX(UCHAR kanavia, DWORD samplerate, UCHAR bitrate)
24 | {
25 | this->kanavia = kanavia;
26 | this->samplerate = samplerate;
27 | this->bitrate = bitrate;
28 | strcpy(this->tiedosto," ");
29 | }
30 |
31 | PisteSFX::~PisteSFX()
32 | {
33 | Tuhoa();
34 | }
35 |
36 | void PisteSFX::Tuhoa()
37 | {
38 | Mix_FreeChunk(sound);
39 | }
40 |
41 | int PisteSFX::Lataa(char *filename, int control_flags)
42 | {
43 |
44 | if (PisteSFX_Lataa_WAV(this, filename, control_flags) == -1)
45 | return 2;
46 |
47 | strcpy(this->tiedosto,filename);
48 |
49 | return 0;
50 | }
51 |
52 | int PisteSFX::Soita()
53 | {
54 | if (play_sfx)
55 | {
56 | Mix_VolumeChunk(sound, MIX_MAX_VOLUME/2);
57 | if(Mix_PlayChannel(-1, sound, 0)==-1) {
58 | printf("Mix_PlayChannel: %s\n",Mix_GetError());
59 | }
60 | }
61 | return 0;
62 | }
63 |
64 | int PisteSFX::Soita(int volume)
65 | {
66 | if (play_sfx)
67 | {
68 | volume = (100-volume) * -30;//-100
69 |
70 | if (volume < DSBVOLUME_MIN)
71 | volume = DSBVOLUME_MIN;
72 |
73 | if (volume > DSBVOLUME_MAX)
74 | volume = DSBVOLUME_MAX;
75 |
76 | Mix_Volume(1,volume);
77 | if(Mix_PlayChannel(-1, sound, 0)==-1) {
78 | printf("Mix_PlayChannel: %s\n",Mix_GetError());
79 | }
80 | }
81 | return 0;
82 | }
83 |
84 | int PisteSFX::Soita(int volume, int pan, int freq)
85 | {
86 | if (play_sfx)
87 | {
88 | volume = (100-volume) * -30;//-100
89 |
90 | if (volume < DSBVOLUME_MIN)
91 | volume = DSBVOLUME_MIN;
92 |
93 | if (volume > DSBVOLUME_MAX)
94 | volume = DSBVOLUME_MAX;
95 |
96 | if (pan < -10000)
97 | pan = -10000;
98 |
99 | if (pan > 10000)
100 | pan = 10000;
101 |
102 | if (freq < 100)
103 | freq = 100;
104 |
105 | if (freq > 100000)
106 | freq = 100000;
107 | /*
108 | if (FAILED(this->dsbuffer[buffer_index]->SetVolume(volume)))
109 | return 1;
110 |
111 | if (FAILED(this->dsbuffer[buffer_index]->SetPan(pan)))
112 | return 1;
113 |
114 | if (FAILED(this->dsbuffer[buffer_index]->SetFrequency(freq)))
115 | return 1;
116 |
117 | if (FAILED(this->dsbuffer[buffer_index]->Play(0,0,0)))
118 | return 1;
119 | */
120 | Mix_Volume(1,volume);
121 | if(Mix_PlayChannel(-1, sound, 0)==-1) {
122 | printf("Mix_PlayChannel: %s\n",Mix_GetError());
123 | }
124 | }
125 | return 0;
126 | }
127 |
128 | int PisteSFX_Set_Sfx(bool play)
129 | {
130 | play_sfx = play;
131 | return 0;
132 | }
133 |
134 | bool PisteSFX_Get_Sfx(void)
135 | {
136 | return play_sfx;
137 | }
138 |
139 | int PisteSFX_Lataa_WAV(PisteSFX *soundi, char *filename, int control_flags)
140 | {
141 | soundi->sound = Mix_LoadWAV(filename);
142 | if(soundi->sound == NULL) {
143 | fprintf(stderr, "PisteSFX_Lataa_WAV(%s): %s\n", filename, Mix_GetError());
144 | }
145 | return(0);
146 |
147 | } // end DSound_Load_WAV
148 |
--------------------------------------------------------------------------------
/PisteLanguage/PisteLanguage.cpp:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 | #include
4 | #include
5 | #include
6 | #ifdef WIN32
7 | #include
8 | #include
9 | #endif
10 | #include
11 |
12 | #include "PisteLanguage.h"
13 |
14 | using namespace std;
15 |
16 | PisteLanguage::PisteLanguage()
17 | {
18 | lue = LUE_SKIP;
19 |
20 | for (int i=0;ifail())
49 | {
50 | delete (tiedosto);
51 | return false;
52 | }
53 |
54 | for (int i=0;ipeek() != EOF)
68 | {
69 | //tiedosto->read(merkki, sizeof(merkki));
70 |
71 | merkki = tiedosto->get();
72 |
73 | switch (merkki)
74 | {
75 | case EROTIN_1 : if (lue == LUE_SKIP)
76 | {
77 | lue = LUE_OTSIKKO;
78 | mjono_index = 0;
79 | }
80 | else
81 | {
82 | lue = LUE_SKIP;
83 | taulukko_index++;
84 | }
85 | break;
86 |
87 | case EROTIN_2 : if (lue == LUE_OTSIKKO)
88 | {
89 | lue = LUE_TEKSTI;
90 | mjono_index = 0;
91 | break;
92 | }
93 |
94 | if (lue == LUE_TEKSTI)
95 | {
96 | if (mjono_index < MAX_TEKSTIN_PITUUS)
97 | {
98 | tekstit[taulukko_index][mjono_index] = merkki;
99 | tekstit[taulukko_index][mjono_index+1] = '\0';
100 | mjono_index++;
101 | }
102 | }
103 | break;
104 |
105 | case '\r' :
106 | case '\n' : if (lue != LUE_SKIP)
107 | {
108 | lue = LUE_SKIP;
109 | taulukko_index++;
110 | }
111 | break;
112 |
113 | case '\t' : break;
114 | case '\v' : break;
115 |
116 | default : if (lue != LUE_SKIP && !(mjono_index == 0 && merkki == ' '))
117 | {
118 | if (lue == LUE_OTSIKKO)
119 | {
120 | if (mjono_index < MAX_OTSIKON_PITUUS)
121 | {
122 | //strcat(otsikot[taulukko_index],(char *)merkki);
123 | otsikot[taulukko_index][mjono_index] = merkki;
124 | otsikot[taulukko_index][mjono_index+1] = '\0';
125 | mjono_index++;
126 | }
127 | }
128 | if (lue == LUE_TEKSTI)
129 | {
130 | if (mjono_index < MAX_TEKSTIN_PITUUS)
131 | {
132 | //strcat(tekstit[taulukko_index],(char *)merkki);
133 | tekstit[taulukko_index][mjono_index] = merkki;
134 | tekstit[taulukko_index][mjono_index+1] = '\0';
135 | mjono_index++;
136 | }
137 | }
138 | }
139 | break;
140 |
141 | }
142 |
143 | if (taulukko_index >= MAX_TEKSTEJA)
144 | jatka = false;
145 | }
146 |
147 | delete tiedosto;
148 |
149 | return true;
150 | }
151 |
152 | int PisteLanguage::Hae_Indeksi(char *otsikko)
153 | {
154 | int i=0;
155 |
156 | while (i < MAX_TEKSTEJA && strcmp(otsikot[i],otsikko) != 0)
157 | i++;
158 |
159 | if (i == MAX_TEKSTEJA)
160 | return -1;
161 |
162 | return i;
163 |
164 | }
165 |
166 | char *PisteLanguage::Hae_Teksti(int index)
167 | {
168 | //printf("PisteLanguage::Hae_Teksti %i -%s-\n", index, tekstit[index]);
169 | if (index >= 0 && index < MAX_TEKSTEJA)
170 | return tekstit[index];
171 | else
172 | return ".....";
173 | }
174 |
175 | void PisteLanguage::Korvaa_Teksti(int index, char *teksti)
176 | {
177 | if (index >= 0 && index < MAX_TEKSTEJA)
178 | strcpy(tekstit[index],teksti);
179 | }
180 |
--------------------------------------------------------------------------------
/PisteLanguage/PisteLanguage.dsp:
--------------------------------------------------------------------------------
1 | # Microsoft Developer Studio Project File - Name="PisteLanguage" - Package Owner=<4>
2 | # Microsoft Developer Studio Generated Build File, Format Version 6.00
3 | # ** DO NOT EDIT **
4 |
5 | # TARGTYPE "Win32 (x86) Console Application" 0x0103
6 |
7 | CFG=PisteLanguage - Win32 Debug
8 | !MESSAGE This is not a valid makefile. To build this project using NMAKE,
9 | !MESSAGE use the Export Makefile command and run
10 | !MESSAGE
11 | !MESSAGE NMAKE /f "PisteLanguage.mak".
12 | !MESSAGE
13 | !MESSAGE You can specify a configuration when running NMAKE
14 | !MESSAGE by defining the macro CFG on the command line. For example:
15 | !MESSAGE
16 | !MESSAGE NMAKE /f "PisteLanguage.mak" CFG="PisteLanguage - Win32 Debug"
17 | !MESSAGE
18 | !MESSAGE Possible choices for configuration are:
19 | !MESSAGE
20 | !MESSAGE "PisteLanguage - Win32 Release" (based on "Win32 (x86) Console Application")
21 | !MESSAGE "PisteLanguage - Win32 Debug" (based on "Win32 (x86) Console Application")
22 | !MESSAGE
23 |
24 | # Begin Project
25 | # PROP AllowPerConfigDependencies 0
26 | # PROP Scc_ProjName ""
27 | # PROP Scc_LocalPath ""
28 | CPP=cl.exe
29 | RSC=rc.exe
30 |
31 | !IF "$(CFG)" == "PisteLanguage - Win32 Release"
32 |
33 | # PROP BASE Use_MFC 0
34 | # PROP BASE Use_Debug_Libraries 0
35 | # PROP BASE Output_Dir "Release"
36 | # PROP BASE Intermediate_Dir "Release"
37 | # PROP BASE Target_Dir ""
38 | # PROP Use_MFC 0
39 | # PROP Use_Debug_Libraries 0
40 | # PROP Output_Dir "Release"
41 | # PROP Intermediate_Dir "Release"
42 | # PROP Target_Dir ""
43 | # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
44 | # ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
45 | # ADD BASE RSC /l 0x409 /d "NDEBUG"
46 | # ADD RSC /l 0x409 /d "NDEBUG"
47 | BSC32=bscmake.exe
48 | # ADD BASE BSC32 /nologo
49 | # ADD BSC32 /nologo
50 | LINK32=link.exe
51 | # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
52 | # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
53 |
54 | !ELSEIF "$(CFG)" == "PisteLanguage - Win32 Debug"
55 |
56 | # PROP BASE Use_MFC 0
57 | # PROP BASE Use_Debug_Libraries 1
58 | # PROP BASE Output_Dir "Debug"
59 | # PROP BASE Intermediate_Dir "Debug"
60 | # PROP BASE Target_Dir ""
61 | # PROP Use_MFC 0
62 | # PROP Use_Debug_Libraries 1
63 | # PROP Output_Dir "Debug"
64 | # PROP Intermediate_Dir "Debug"
65 | # PROP Target_Dir ""
66 | # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
67 | # ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
68 | # ADD BASE RSC /l 0x409 /d "_DEBUG"
69 | # ADD RSC /l 0x409 /d "_DEBUG"
70 | BSC32=bscmake.exe
71 | # ADD BASE BSC32 /nologo
72 | # ADD BSC32 /nologo
73 | LINK32=link.exe
74 | # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
75 | # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
76 |
77 | !ENDIF
78 |
79 | # Begin Target
80 |
81 | # Name "PisteLanguage - Win32 Release"
82 | # Name "PisteLanguage - Win32 Debug"
83 | # Begin Group "Source Files"
84 |
85 | # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
86 | # Begin Source File
87 |
88 | SOURCE=.\Kieli.cpp
89 | # End Source File
90 | # Begin Source File
91 |
92 | SOURCE=.\PisteLanguage.cpp
93 | # End Source File
94 | # End Group
95 | # Begin Group "Header Files"
96 |
97 | # PROP Default_Filter "h;hpp;hxx;hm;inl"
98 | # Begin Source File
99 |
100 | SOURCE=.\PisteLanguage.h
101 | # End Source File
102 | # End Group
103 | # Begin Group "Resource Files"
104 |
105 | # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
106 | # End Group
107 | # Begin Source File
108 |
109 | SOURCE=.\suomi.lng
110 | # End Source File
111 | # End Target
112 | # End Project
113 |
--------------------------------------------------------------------------------
/PisteEngineSDL/PisteInput.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | PisteEngineSDL - PisteInput
3 |
4 | */
5 |
6 | /* INCLUDES ----------------------------------------------------------------------------------*/
7 |
8 | #include "PisteInput.h"
9 | #include "PisteLog.h"
10 |
11 | #include
12 |
13 | /* DEFINES -----------------------------------------------------------------------------------*/
14 |
15 | /* TYPE DEFINITIONS --------------------------------------------------------------------------*/
16 |
17 | struct PELIOHJAIN
18 | {
19 | SDL_Joystick* dev;
20 | bool available;
21 | char nimi[80];
22 | };
23 |
24 | /* VARIABLES ---------------------------------------------------------------------------------*/
25 |
26 | PELIOHJAIN PI_joysticks[PI_MAX_PELIOHJAIMIA];
27 | int PI_joystick_index = 0;
28 |
29 | bool PI_unload = true;
30 |
31 | Uint8 *m_keymap;
32 |
33 | /* METHODS -----------------------------------------------------------------------------------*/
34 |
35 | bool PisteInput_Alusta_Ohjaimet()
36 | {
37 | /*
38 | SDL_InitSubSystem(SDL_INIT_JOYSTICK);
39 |
40 | // Check for joystick
41 | if(SDL_NumJoysticks()>0){
42 | // Open joystick
43 | joy=SDL_JoystickOpen(0);
44 |
45 | if(joy)
46 | {
47 | printf("Opened Joystick 0\n");
48 | printf("Name: %s\n", SDL_JoystickName(0));
49 | printf("Number of Axes: %d\n", SDL_JoystickNumAxes(joy));
50 | printf("Number of Buttons: %d\n", SDL_JoystickNumButtons(joy));
51 | printf("Number of Balls: %d\n", SDL_JoystickNumBalls(joy));
52 | }
53 | else
54 | printf("Couldn't open Joystick 0\n");
55 |
56 | if(SDL_JoystickOpened(0))
57 | SDL_JoystickClose(joy);
58 | */
59 | return true;
60 | }
61 |
62 | int PisteInput_Alusta(HWND &main_window_handle, HINSTANCE &hinstance_app)
63 | {
64 | if (PI_unload) {
65 | }
66 |
67 | return 0;
68 | }
69 |
70 | bool PisteInput_Keydown(int key)
71 | {
72 | SDL_PumpEvents();
73 | m_keymap = SDL_GetKeyState(NULL);
74 | return m_keymap[key];
75 | //return key == m_event.key.keysym.sym;
76 | }
77 |
78 | bool PisteInput_Hiiri_Vasen()
79 | {
80 | SDL_PumpEvents();
81 | return SDL_GetMouseState(NULL, NULL)&SDL_BUTTON(1);
82 | }
83 |
84 | bool PisteInput_Hiiri_Oikea()
85 | {
86 | SDL_PumpEvents();
87 | return SDL_GetMouseState(NULL, NULL)&SDL_BUTTON(2);
88 | }
89 |
90 | int lastMouseUpdate=0, mx=0, my=0;
91 |
92 | int PisteInput_Hiiri_X(int x)
93 | {
94 | // TODO: a bit hackish just to retain function structure
95 | if(SDL_GetTicks() - lastMouseUpdate > 50) {
96 | lastMouseUpdate = SDL_GetTicks();
97 | SDL_GetRelativeMouseState(&mx, &my);
98 | return x+mx;
99 | }
100 | int r = mx;
101 | mx = 0;
102 | return x+r;
103 | }
104 |
105 | int PisteInput_Hiiri_Y(int y)
106 | {
107 | if(SDL_GetTicks() - lastMouseUpdate > 50) {
108 | lastMouseUpdate = SDL_GetTicks();
109 | SDL_GetRelativeMouseState(&mx, &my);
110 | return y+my;
111 | }
112 | int r = my;
113 | my = 0;
114 | return y+r;
115 | }
116 |
117 | int PisteInput_Ohjain_X(int ohjain)
118 | {
119 | int x = 0;
120 |
121 | if (PI_joysticks[ohjain].available)
122 | x = SDL_JoystickGetAxis(PI_joysticks[ohjain].dev, 0);
123 |
124 | return x;
125 | }
126 |
127 | int PisteInput_Ohjain_Y(int ohjain)
128 | {
129 | int y = 0;
130 |
131 | if (PI_joysticks[ohjain].available)
132 | y = SDL_JoystickGetAxis(PI_joysticks[ohjain].dev, 1);
133 |
134 | return y;
135 | }
136 |
137 | bool PisteInput_Ohjain_Nappi(int ohjain, int index)
138 | {
139 | bool painettu = false;
140 |
141 | if (PI_joysticks[ohjain].available)
142 | painettu = SDL_JoystickGetButton(PI_joysticks[ohjain].dev, index);
143 |
144 | return painettu;
145 | }
146 |
147 | char *PisteInput_Ohjain_Nimi(int ohjain)
148 | {
149 | return PI_joysticks[ohjain].nimi;
150 | }
151 |
152 | bool PisteInput_Hae_Ohjaimet()
153 | {
154 | bool ok = false;
155 |
156 | for(int ohjain=0; ohjain < PI_MAX_PELIOHJAIMIA; ohjain++)
157 | {
158 | /*
159 | if (PI_joysticks[ohjain].available)
160 | {
161 | if (FAILED(PI_joysticks[ohjain].lpdijoy->GetDeviceState(sizeof(DIJOYSTATE),(LPVOID)&PI_joysticks[ohjain].joystick_state)))
162 | {
163 | PisteLog_Kirjoita("[Warning] Piste Input: Lost control of game pad! \n");
164 | PI_joysticks[ohjain].available = false;
165 | }
166 | if (PI_joysticks[ohjain].available)
167 | ok = true;
168 | }
169 | */
170 | }
171 | return ok;
172 | }
173 |
174 |
175 | bool PisteInput_Hae_Nappaimet()
176 | {
177 | bool ok = true;
178 |
179 | return ok;
180 | }
181 |
182 | bool PisteInput_Hae_Hiiri()
183 | {
184 | return true;
185 | }
186 |
187 | char PisteInput_Lue_Nappaimisto(void)
188 | {
189 | SDL_Event event;
190 | while(SDL_PollEvent(&event)) {
191 | if(event.type==SDL_KEYDOWN) return event.key.keysym.sym;
192 | }
193 | return('\0');
194 | }
195 |
196 | UCHAR PisteInput_Lue_Kontrolli()
197 | {
198 | return 0;
199 | }
200 |
201 | bool PisteInput_Lue_Eventti()
202 | {
203 | SDL_PumpEvents();
204 | m_keymap = SDL_GetKeyState(NULL);
205 | /*
206 | m_event.key.keysym.sym = SDLK_UNKNOWN;
207 | while(SDL_PollEvent(&m_event)) {
208 | if(m_event.type == SDL_KEYDOWN) {
209 | printf("presed %i ralt:%i\n", m_event.key.keysym.sym, SDLK_RALT);
210 | return true;
211 | }
212 | }
213 | */
214 | return false;
215 | }
216 |
217 | bool PisteInput_Lue_Kontrolli(int k)
218 | {
219 | /*
220 | bool pressed = false;
221 | for(int i=0; ikeysym.sym )
236 | return " ";
237 | }
238 |
239 | int PisteInput_Lopeta()
240 | {
241 | return 0;
242 | }
243 |
--------------------------------------------------------------------------------
/Pekka Kana 2/PK2SpriteCreator/PK2SpriteCreator.dsp:
--------------------------------------------------------------------------------
1 | # Microsoft Developer Studio Project File - Name="PK2SpriteCreator" - Package Owner=<4>
2 | # Microsoft Developer Studio Generated Build File, Format Version 6.00
3 | # ** DO NOT EDIT **
4 |
5 | # TARGTYPE "Win32 (x86) Console Application" 0x0103
6 |
7 | CFG=PK2SpriteCreator - Win32 Debug
8 | !MESSAGE This is not a valid makefile. To build this project using NMAKE,
9 | !MESSAGE use the Export Makefile command and run
10 | !MESSAGE
11 | !MESSAGE NMAKE /f "PK2SpriteCreator.mak".
12 | !MESSAGE
13 | !MESSAGE You can specify a configuration when running NMAKE
14 | !MESSAGE by defining the macro CFG on the command line. For example:
15 | !MESSAGE
16 | !MESSAGE NMAKE /f "PK2SpriteCreator.mak" CFG="PK2SpriteCreator - Win32 Debug"
17 | !MESSAGE
18 | !MESSAGE Possible choices for configuration are:
19 | !MESSAGE
20 | !MESSAGE "PK2SpriteCreator - Win32 Release" (based on "Win32 (x86) Console Application")
21 | !MESSAGE "PK2SpriteCreator - Win32 Debug" (based on "Win32 (x86) Console Application")
22 | !MESSAGE
23 |
24 | # Begin Project
25 | # PROP AllowPerConfigDependencies 0
26 | # PROP Scc_ProjName ""
27 | # PROP Scc_LocalPath ""
28 | CPP=cl.exe
29 | RSC=rc.exe
30 |
31 | !IF "$(CFG)" == "PK2SpriteCreator - Win32 Release"
32 |
33 | # PROP BASE Use_MFC 0
34 | # PROP BASE Use_Debug_Libraries 0
35 | # PROP BASE Output_Dir "Release"
36 | # PROP BASE Intermediate_Dir "Release"
37 | # PROP BASE Target_Dir ""
38 | # PROP Use_MFC 0
39 | # PROP Use_Debug_Libraries 0
40 | # PROP Output_Dir "Release"
41 | # PROP Intermediate_Dir "Release"
42 | # PROP Target_Dir ""
43 | # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
44 | # ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
45 | # ADD BASE RSC /l 0x40b /d "NDEBUG"
46 | # ADD RSC /l 0x40b /d "NDEBUG"
47 | BSC32=bscmake.exe
48 | # ADD BASE BSC32 /nologo
49 | # ADD BSC32 /nologo
50 | LINK32=link.exe
51 | # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
52 | # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
53 |
54 | !ELSEIF "$(CFG)" == "PK2SpriteCreator - Win32 Debug"
55 |
56 | # PROP BASE Use_MFC 0
57 | # PROP BASE Use_Debug_Libraries 1
58 | # PROP BASE Output_Dir "Debug"
59 | # PROP BASE Intermediate_Dir "Debug"
60 | # PROP BASE Target_Dir ""
61 | # PROP Use_MFC 0
62 | # PROP Use_Debug_Libraries 1
63 | # PROP Output_Dir "Debug"
64 | # PROP Intermediate_Dir "Debug"
65 | # PROP Target_Dir ""
66 | # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
67 | # ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
68 | # ADD BASE RSC /l 0x40b /d "_DEBUG"
69 | # ADD RSC /l 0x40b /d "_DEBUG"
70 | BSC32=bscmake.exe
71 | # ADD BASE BSC32 /nologo
72 | # ADD BSC32 /nologo
73 | LINK32=link.exe
74 | # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
75 | # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
76 |
77 | !ENDIF
78 |
79 | # Begin Target
80 |
81 | # Name "PK2SpriteCreator - Win32 Release"
82 | # Name "PK2SpriteCreator - Win32 Debug"
83 | # Begin Group "Source Files"
84 |
85 | # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
86 | # Begin Source File
87 |
88 | SOURCE=..\..\PisteEngine\PisteDraw.cpp
89 | # End Source File
90 | # Begin Source File
91 |
92 | SOURCE=..\..\PisteEngine\PisteFont.cpp
93 | # End Source File
94 | # Begin Source File
95 |
96 | SOURCE=..\..\PisteLanguage\PisteLanguage.cpp
97 | # End Source File
98 | # Begin Source File
99 |
100 | SOURCE=..\..\PisteEngine\PisteLog.cpp
101 | # End Source File
102 | # Begin Source File
103 |
104 | SOURCE=..\..\PisteEngine\PisteSFX.cpp
105 | # End Source File
106 | # Begin Source File
107 |
108 | SOURCE=..\..\PisteEngine\PisteSound.cpp
109 | # End Source File
110 | # Begin Source File
111 |
112 | SOURCE=..\PK2Sprite.cpp
113 | # End Source File
114 | # Begin Source File
115 |
116 | SOURCE=.\PK2SpriteCreator.cpp
117 | # End Source File
118 | # End Group
119 | # Begin Group "Header Files"
120 |
121 | # PROP Default_Filter "h;hpp;hxx;hm;inl"
122 | # Begin Source File
123 |
124 | SOURCE=..\..\..\..\Dxsdk\Include\ddraw.h
125 | # End Source File
126 | # Begin Source File
127 |
128 | SOURCE=..\..\..\..\Dxsdk\Include\dsound.h
129 | # End Source File
130 | # Begin Source File
131 |
132 | SOURCE=..\..\PisteEngine\PisteDraw.h
133 | # End Source File
134 | # Begin Source File
135 |
136 | SOURCE=..\..\PisteEngine\PisteFont.h
137 | # End Source File
138 | # Begin Source File
139 |
140 | SOURCE=..\..\PisteLanguage\PisteLanguage.h
141 | # End Source File
142 | # Begin Source File
143 |
144 | SOURCE=..\..\PisteEngine\PisteLog.h
145 | # End Source File
146 | # Begin Source File
147 |
148 | SOURCE=..\..\PisteEngine\PisteSFX.h
149 | # End Source File
150 | # Begin Source File
151 |
152 | SOURCE=..\..\PisteEngine\PisteSound.h
153 | # End Source File
154 | # Begin Source File
155 |
156 | SOURCE=..\PK2Sprite.h
157 | # End Source File
158 | # End Group
159 | # Begin Group "Resource Files"
160 |
161 | # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
162 | # Begin Source File
163 |
164 | SOURCE=..\..\..\..\Dxsdk\Lib\ddraw.lib
165 | # End Source File
166 | # Begin Source File
167 |
168 | SOURCE=..\..\..\..\Dxsdk\Lib\dsound.lib
169 | # End Source File
170 | # Begin Source File
171 |
172 | SOURCE=..\..\..\Vc98\Lib\Winmm.lib
173 | # End Source File
174 | # End Group
175 | # End Target
176 | # End Project
177 |
--------------------------------------------------------------------------------
/PisteEngine/PisteEngine.dsp:
--------------------------------------------------------------------------------
1 | # Microsoft Developer Studio Project File - Name="PisteEngine" - Package Owner=<4>
2 | # Microsoft Developer Studio Generated Build File, Format Version 6.00
3 | # ** DO NOT EDIT **
4 |
5 | # TARGTYPE "Win32 (x86) Application" 0x0101
6 |
7 | CFG=PisteEngine - Win32 Debug
8 | !MESSAGE This is not a valid makefile. To build this project using NMAKE,
9 | !MESSAGE use the Export Makefile command and run
10 | !MESSAGE
11 | !MESSAGE NMAKE /f "PisteEngine.mak".
12 | !MESSAGE
13 | !MESSAGE You can specify a configuration when running NMAKE
14 | !MESSAGE by defining the macro CFG on the command line. For example:
15 | !MESSAGE
16 | !MESSAGE NMAKE /f "PisteEngine.mak" CFG="PisteEngine - Win32 Debug"
17 | !MESSAGE
18 | !MESSAGE Possible choices for configuration are:
19 | !MESSAGE
20 | !MESSAGE "PisteEngine - Win32 Release" (based on "Win32 (x86) Application")
21 | !MESSAGE "PisteEngine - Win32 Debug" (based on "Win32 (x86) Application")
22 | !MESSAGE
23 |
24 | # Begin Project
25 | # PROP AllowPerConfigDependencies 0
26 | # PROP Scc_ProjName ""
27 | # PROP Scc_LocalPath ""
28 | CPP=cl.exe
29 | MTL=midl.exe
30 | RSC=rc.exe
31 |
32 | !IF "$(CFG)" == "PisteEngine - Win32 Release"
33 |
34 | # PROP BASE Use_MFC 0
35 | # PROP BASE Use_Debug_Libraries 0
36 | # PROP BASE Output_Dir "Release"
37 | # PROP BASE Intermediate_Dir "Release"
38 | # PROP BASE Target_Dir ""
39 | # PROP Use_MFC 0
40 | # PROP Use_Debug_Libraries 0
41 | # PROP Output_Dir "Release"
42 | # PROP Intermediate_Dir "Release"
43 | # PROP Target_Dir ""
44 | # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c
45 | # ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c
46 | # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
47 | # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
48 | # ADD BASE RSC /l 0x409 /d "NDEBUG"
49 | # ADD RSC /l 0x409 /d "NDEBUG"
50 | BSC32=bscmake.exe
51 | # ADD BASE BSC32 /nologo
52 | # ADD BSC32 /nologo
53 | LINK32=link.exe
54 | # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386
55 | # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386
56 |
57 | !ELSEIF "$(CFG)" == "PisteEngine - Win32 Debug"
58 |
59 | # PROP BASE Use_MFC 0
60 | # PROP BASE Use_Debug_Libraries 1
61 | # PROP BASE Output_Dir "Debug"
62 | # PROP BASE Intermediate_Dir "Debug"
63 | # PROP BASE Target_Dir ""
64 | # PROP Use_MFC 0
65 | # PROP Use_Debug_Libraries 1
66 | # PROP Output_Dir "Debug"
67 | # PROP Intermediate_Dir "Debug"
68 | # PROP Target_Dir ""
69 | # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c
70 | # ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c
71 | # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
72 | # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
73 | # ADD BASE RSC /l 0x409 /d "_DEBUG"
74 | # ADD RSC /l 0x409 /d "_DEBUG"
75 | BSC32=bscmake.exe
76 | # ADD BASE BSC32 /nologo
77 | # ADD BSC32 /nologo
78 | LINK32=link.exe
79 | # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
80 | # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
81 |
82 | !ENDIF
83 |
84 | # Begin Target
85 |
86 | # Name "PisteEngine - Win32 Release"
87 | # Name "PisteEngine - Win32 Debug"
88 | # Begin Group "Source Files"
89 |
90 | # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
91 | # Begin Source File
92 |
93 | SOURCE=.\Game.cpp
94 | # End Source File
95 | # Begin Source File
96 |
97 | SOURCE=.\PisteDraw.cpp
98 | # End Source File
99 | # Begin Source File
100 |
101 | SOURCE=.\PisteFont.cpp
102 | # End Source File
103 | # Begin Source File
104 |
105 | SOURCE=.\PisteInput.cpp
106 | # End Source File
107 | # Begin Source File
108 |
109 | SOURCE=.\PisteSFX.cpp
110 | # End Source File
111 | # Begin Source File
112 |
113 | SOURCE=.\PisteSound.cpp
114 | # End Source File
115 | # Begin Source File
116 |
117 | SOURCE=.\PisteWait.cpp
118 | # End Source File
119 | # Begin Source File
120 |
121 | SOURCE=.\Resource.rc
122 | # End Source File
123 | # End Group
124 | # Begin Group "Header Files"
125 |
126 | # PROP Default_Filter "h;hpp;hxx;hm;inl"
127 | # Begin Source File
128 |
129 | SOURCE=..\..\..\mssdk\DirectX7\include\ddraw.h
130 | # End Source File
131 | # Begin Source File
132 |
133 | SOURCE=..\..\..\mssdk\DirectX7\include\dinput.h
134 | # End Source File
135 | # Begin Source File
136 |
137 | SOURCE=..\..\..\mssdk\DirectX7\include\dsound.h
138 | # End Source File
139 | # Begin Source File
140 |
141 | SOURCE=.\PisteDraw.h
142 | # End Source File
143 | # Begin Source File
144 |
145 | SOURCE=.\PisteFont.h
146 | # End Source File
147 | # Begin Source File
148 |
149 | SOURCE=.\PisteInput.h
150 | # End Source File
151 | # Begin Source File
152 |
153 | SOURCE=.\PisteSFX.h
154 | # End Source File
155 | # Begin Source File
156 |
157 | SOURCE=.\PisteSound.h
158 | # End Source File
159 | # Begin Source File
160 |
161 | SOURCE=.\PisteWait.h
162 | # End Source File
163 | # Begin Source File
164 |
165 | SOURCE=.\resource.h
166 | # End Source File
167 | # End Group
168 | # Begin Group "Resource Files"
169 |
170 | # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
171 | # Begin Source File
172 |
173 | SOURCE=.\cursor1.cur
174 | # End Source File
175 | # Begin Source File
176 |
177 | SOURCE=.\GameIcon.ico
178 | # End Source File
179 | # Begin Source File
180 |
181 | SOURCE=..\..\..\mssdk\DirectX7\lib\dsound.lib
182 | # End Source File
183 | # Begin Source File
184 |
185 | SOURCE=..\..\..\mssdk\DirectX7\lib\dinput.lib
186 | # End Source File
187 | # Begin Source File
188 |
189 | SOURCE=..\..\..\mssdk\DirectX7\lib\ddraw.lib
190 | # End Source File
191 | # Begin Source File
192 |
193 | SOURCE=..\..\Vc98\Lib\Winmm.lib
194 | # End Source File
195 | # End Group
196 | # Begin Source File
197 |
198 | SOURCE=.\Asennus.txt
199 | # End Source File
200 | # Begin Source File
201 |
202 | SOURCE=.\Gametemp.txt
203 | # End Source File
204 | # Begin Source File
205 |
206 | SOURCE=.\PDtemp.txt
207 | # End Source File
208 | # Begin Source File
209 |
210 | SOURCE=.\PItemp.txt
211 | # End Source File
212 | # End Target
213 | # End Project
214 |
--------------------------------------------------------------------------------
/PK2LevelEditor/PK2LevelEditor.mak:
--------------------------------------------------------------------------------
1 | # Microsoft Developer Studio Generated NMAKE File, Based on PK2LevelEditor.dsp
2 | !IF "$(CFG)" == ""
3 | CFG=PK2LevelEditor - Win32 Debug
4 | !MESSAGE No configuration specified. Defaulting to PK2LevelEditor - Win32 Debug.
5 | !ENDIF
6 |
7 | !IF "$(CFG)" != "PK2LevelEditor - Win32 Release" && "$(CFG)" != "PK2LevelEditor - Win32 Debug"
8 | !MESSAGE Invalid configuration "$(CFG)" specified.
9 | !MESSAGE You can specify a configuration when running NMAKE
10 | !MESSAGE by defining the macro CFG on the command line. For example:
11 | !MESSAGE
12 | !MESSAGE NMAKE /f "PK2LevelEditor.mak" CFG="PK2LevelEditor - Win32 Debug"
13 | !MESSAGE
14 | !MESSAGE Possible choices for configuration are:
15 | !MESSAGE
16 | !MESSAGE "PK2LevelEditor - Win32 Release" (based on "Win32 (x86) Application")
17 | !MESSAGE "PK2LevelEditor - Win32 Debug" (based on "Win32 (x86) Application")
18 | !MESSAGE
19 | !ERROR An invalid configuration is specified.
20 | !ENDIF
21 |
22 | !IF "$(OS)" == "Windows_NT"
23 | NULL=
24 | !ELSE
25 | NULL=nul
26 | !ENDIF
27 |
28 | CPP=cl.exe
29 | MTL=midl.exe
30 | RSC=rc.exe
31 |
32 | !IF "$(CFG)" == "PK2LevelEditor - Win32 Release"
33 |
34 | OUTDIR=.\Release
35 | INTDIR=.\Release
36 | # Begin Custom Macros
37 | OutDir=.\Release
38 | # End Custom Macros
39 |
40 | ALL : "$(OUTDIR)\PK2LevelEditor.exe"
41 |
42 |
43 | CLEAN :
44 | -@erase "$(INTDIR)\LevelEditor.obj"
45 | -@erase "$(INTDIR)\PisteDraw.obj"
46 | -@erase "$(INTDIR)\PisteFont.obj"
47 | -@erase "$(INTDIR)\PisteInput.obj"
48 | -@erase "$(INTDIR)\PisteWait.obj"
49 | -@erase "$(INTDIR)\PK2Map.obj"
50 | -@erase "$(INTDIR)\Resource.res"
51 | -@erase "$(INTDIR)\vc60.idb"
52 | -@erase "$(OUTDIR)\PK2LevelEditor.exe"
53 |
54 | "$(OUTDIR)" :
55 | if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
56 |
57 | CPP_PROJ=/nologo /ML /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /Fp"$(INTDIR)\PK2LevelEditor.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c
58 | MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /win32
59 | RSC_PROJ=/l 0x409 /fo"$(INTDIR)\Resource.res" /d "NDEBUG"
60 | BSC32=bscmake.exe
61 | BSC32_FLAGS=/nologo /o"$(OUTDIR)\PK2LevelEditor.bsc"
62 | BSC32_SBRS= \
63 |
64 | LINK32=link.exe
65 | LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /incremental:no /pdb:"$(OUTDIR)\PK2LevelEditor.pdb" /machine:I386 /out:"$(OUTDIR)\PK2LevelEditor.exe"
66 | LINK32_OBJS= \
67 | "$(INTDIR)\LevelEditor.obj" \
68 | "$(INTDIR)\PisteDraw.obj" \
69 | "$(INTDIR)\PisteFont.obj" \
70 | "$(INTDIR)\PisteInput.obj" \
71 | "$(INTDIR)\PisteWait.obj" \
72 | "$(INTDIR)\PK2Map.obj" \
73 | "$(INTDIR)\Resource.res" \
74 | "..\..\..\mssdk\DirectX7\lib\ddraw.lib" \
75 | "..\..\..\mssdk\DirectX7\lib\dinput.lib" \
76 | "..\..\Vc98\Lib\Winmm.lib"
77 |
78 | "$(OUTDIR)\PK2LevelEditor.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
79 | $(LINK32) @<<
80 | $(LINK32_FLAGS) $(LINK32_OBJS)
81 | <<
82 |
83 | !ELSEIF "$(CFG)" == "PK2LevelEditor - Win32 Debug"
84 |
85 | OUTDIR=.\Debug
86 | INTDIR=.\Debug
87 | # Begin Custom Macros
88 | OutDir=.\Debug
89 | # End Custom Macros
90 |
91 | ALL : "$(OUTDIR)\PK2LevelEditor.exe"
92 |
93 |
94 | CLEAN :
95 | -@erase "$(INTDIR)\LevelEditor.obj"
96 | -@erase "$(INTDIR)\PisteDraw.obj"
97 | -@erase "$(INTDIR)\PisteFont.obj"
98 | -@erase "$(INTDIR)\PisteInput.obj"
99 | -@erase "$(INTDIR)\PisteWait.obj"
100 | -@erase "$(INTDIR)\PK2Map.obj"
101 | -@erase "$(INTDIR)\Resource.res"
102 | -@erase "$(INTDIR)\vc60.idb"
103 | -@erase "$(INTDIR)\vc60.pdb"
104 | -@erase "$(OUTDIR)\PK2LevelEditor.exe"
105 | -@erase "$(OUTDIR)\PK2LevelEditor.ilk"
106 | -@erase "$(OUTDIR)\PK2LevelEditor.pdb"
107 |
108 | "$(OUTDIR)" :
109 | if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
110 |
111 | CPP_PROJ=/nologo /MLd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /Fp"$(INTDIR)\PK2LevelEditor.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c
112 | MTL_PROJ=/nologo /D "_DEBUG" /mktyplib203 /win32
113 | RSC_PROJ=/l 0x409 /fo"$(INTDIR)\Resource.res" /d "_DEBUG"
114 | BSC32=bscmake.exe
115 | BSC32_FLAGS=/nologo /o"$(OUTDIR)\PK2LevelEditor.bsc"
116 | BSC32_SBRS= \
117 |
118 | LINK32=link.exe
119 | LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /incremental:yes /pdb:"$(OUTDIR)\PK2LevelEditor.pdb" /debug /machine:I386 /out:"$(OUTDIR)\PK2LevelEditor.exe" /pdbtype:sept
120 | LINK32_OBJS= \
121 | "$(INTDIR)\LevelEditor.obj" \
122 | "$(INTDIR)\PisteDraw.obj" \
123 | "$(INTDIR)\PisteFont.obj" \
124 | "$(INTDIR)\PisteInput.obj" \
125 | "$(INTDIR)\PisteWait.obj" \
126 | "$(INTDIR)\PK2Map.obj" \
127 | "$(INTDIR)\Resource.res" \
128 | "..\..\..\mssdk\DirectX7\lib\ddraw.lib" \
129 | "..\..\..\mssdk\DirectX7\lib\dinput.lib" \
130 | "..\..\Vc98\Lib\Winmm.lib"
131 |
132 | "$(OUTDIR)\PK2LevelEditor.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
133 | $(LINK32) @<<
134 | $(LINK32_FLAGS) $(LINK32_OBJS)
135 | <<
136 |
137 | !ENDIF
138 |
139 | .c{$(INTDIR)}.obj::
140 | $(CPP) @<<
141 | $(CPP_PROJ) $<
142 | <<
143 |
144 | .cpp{$(INTDIR)}.obj::
145 | $(CPP) @<<
146 | $(CPP_PROJ) $<
147 | <<
148 |
149 | .cxx{$(INTDIR)}.obj::
150 | $(CPP) @<<
151 | $(CPP_PROJ) $<
152 | <<
153 |
154 | .c{$(INTDIR)}.sbr::
155 | $(CPP) @<<
156 | $(CPP_PROJ) $<
157 | <<
158 |
159 | .cpp{$(INTDIR)}.sbr::
160 | $(CPP) @<<
161 | $(CPP_PROJ) $<
162 | <<
163 |
164 | .cxx{$(INTDIR)}.sbr::
165 | $(CPP) @<<
166 | $(CPP_PROJ) $<
167 | <<
168 |
169 |
170 | !IF "$(NO_EXTERNAL_DEPS)" != "1"
171 | !IF EXISTS("PK2LevelEditor.dep")
172 | !INCLUDE "PK2LevelEditor.dep"
173 | !ELSE
174 | !MESSAGE Warning: cannot find "PK2LevelEditor.dep"
175 | !ENDIF
176 | !ENDIF
177 |
178 |
179 | !IF "$(CFG)" == "PK2LevelEditor - Win32 Release" || "$(CFG)" == "PK2LevelEditor - Win32 Debug"
180 | SOURCE=.\LevelEditor.cpp
181 |
182 | "$(INTDIR)\LevelEditor.obj" : $(SOURCE) "$(INTDIR)"
183 |
184 |
185 | SOURCE=..\PisteEngine\PisteDraw.cpp
186 |
187 | "$(INTDIR)\PisteDraw.obj" : $(SOURCE) "$(INTDIR)"
188 | $(CPP) $(CPP_PROJ) $(SOURCE)
189 |
190 |
191 | SOURCE=..\PisteEngine\PisteFont.cpp
192 |
193 | "$(INTDIR)\PisteFont.obj" : $(SOURCE) "$(INTDIR)"
194 | $(CPP) $(CPP_PROJ) $(SOURCE)
195 |
196 |
197 | SOURCE=..\PisteEngine\PisteInput.cpp
198 |
199 | "$(INTDIR)\PisteInput.obj" : $(SOURCE) "$(INTDIR)"
200 | $(CPP) $(CPP_PROJ) $(SOURCE)
201 |
202 |
203 | SOURCE=..\PisteEngine\PisteWait.cpp
204 |
205 | "$(INTDIR)\PisteWait.obj" : $(SOURCE) "$(INTDIR)"
206 | $(CPP) $(CPP_PROJ) $(SOURCE)
207 |
208 |
209 | SOURCE=..\Pk2\PK2Map.cpp
210 |
211 | "$(INTDIR)\PK2Map.obj" : $(SOURCE) "$(INTDIR)"
212 | $(CPP) $(CPP_PROJ) $(SOURCE)
213 |
214 |
215 | SOURCE=.\Resource.rc
216 |
217 | "$(INTDIR)\Resource.res" : $(SOURCE) "$(INTDIR)"
218 | $(RSC) $(RSC_PROJ) $(SOURCE)
219 |
220 |
221 |
222 | !ENDIF
223 |
224 |
--------------------------------------------------------------------------------
/PK2LevelEditor/PK2LevelEditor.dsp:
--------------------------------------------------------------------------------
1 | # Microsoft Developer Studio Project File - Name="PK2LevelEditor" - Package Owner=<4>
2 | # Microsoft Developer Studio Generated Build File, Format Version 6.00
3 | # ** DO NOT EDIT **
4 |
5 | # TARGTYPE "Win32 (x86) Application" 0x0101
6 |
7 | CFG=PK2LevelEditor - Win32 Debug
8 | !MESSAGE This is not a valid makefile. To build this project using NMAKE,
9 | !MESSAGE use the Export Makefile command and run
10 | !MESSAGE
11 | !MESSAGE NMAKE /f "PK2LevelEditor.mak".
12 | !MESSAGE
13 | !MESSAGE You can specify a configuration when running NMAKE
14 | !MESSAGE by defining the macro CFG on the command line. For example:
15 | !MESSAGE
16 | !MESSAGE NMAKE /f "PK2LevelEditor.mak" CFG="PK2LevelEditor - Win32 Debug"
17 | !MESSAGE
18 | !MESSAGE Possible choices for configuration are:
19 | !MESSAGE
20 | !MESSAGE "PK2LevelEditor - Win32 Release" (based on "Win32 (x86) Application")
21 | !MESSAGE "PK2LevelEditor - Win32 Debug" (based on "Win32 (x86) Application")
22 | !MESSAGE
23 |
24 | # Begin Project
25 | # PROP AllowPerConfigDependencies 0
26 | # PROP Scc_ProjName ""
27 | # PROP Scc_LocalPath ""
28 | CPP=cl.exe
29 | MTL=midl.exe
30 | RSC=rc.exe
31 |
32 | !IF "$(CFG)" == "PK2LevelEditor - Win32 Release"
33 |
34 | # PROP BASE Use_MFC 0
35 | # PROP BASE Use_Debug_Libraries 0
36 | # PROP BASE Output_Dir "Release"
37 | # PROP BASE Intermediate_Dir "Release"
38 | # PROP BASE Target_Dir ""
39 | # PROP Use_MFC 0
40 | # PROP Use_Debug_Libraries 0
41 | # PROP Output_Dir "Release"
42 | # PROP Intermediate_Dir "Release"
43 | # PROP Target_Dir ""
44 | # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c
45 | # ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c
46 | # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
47 | # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
48 | # ADD BASE RSC /l 0x409 /d "NDEBUG"
49 | # ADD RSC /l 0x409 /d "NDEBUG"
50 | BSC32=bscmake.exe
51 | # ADD BASE BSC32 /nologo
52 | # ADD BSC32 /nologo
53 | LINK32=link.exe
54 | # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386
55 | # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386
56 |
57 | !ELSEIF "$(CFG)" == "PK2LevelEditor - Win32 Debug"
58 |
59 | # PROP BASE Use_MFC 0
60 | # PROP BASE Use_Debug_Libraries 1
61 | # PROP BASE Output_Dir "Debug"
62 | # PROP BASE Intermediate_Dir "Debug"
63 | # PROP BASE Target_Dir ""
64 | # PROP Use_MFC 0
65 | # PROP Use_Debug_Libraries 1
66 | # PROP Output_Dir "Debug"
67 | # PROP Intermediate_Dir "Debug"
68 | # PROP Target_Dir ""
69 | # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c
70 | # ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c
71 | # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
72 | # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
73 | # ADD BASE RSC /l 0x409 /d "_DEBUG"
74 | # ADD RSC /l 0x409 /d "_DEBUG"
75 | BSC32=bscmake.exe
76 | # ADD BASE BSC32 /nologo
77 | # ADD BSC32 /nologo
78 | LINK32=link.exe
79 | # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
80 | # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
81 |
82 | !ENDIF
83 |
84 | # Begin Target
85 |
86 | # Name "PK2LevelEditor - Win32 Release"
87 | # Name "PK2LevelEditor - Win32 Debug"
88 | # Begin Group "Source Files"
89 |
90 | # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
91 | # Begin Source File
92 |
93 | SOURCE=.\LevelEditor.cpp
94 | # End Source File
95 | # Begin Source File
96 |
97 | SOURCE=..\PisteEngine\PisteDraw.cpp
98 | # End Source File
99 | # Begin Source File
100 |
101 | SOURCE=..\PisteEngine\PisteFont.cpp
102 | # End Source File
103 | # Begin Source File
104 |
105 | SOURCE=..\PisteEngine\PisteInput.cpp
106 | # End Source File
107 | # Begin Source File
108 |
109 | SOURCE=..\PisteLanguage\PisteLanguage.cpp
110 | # End Source File
111 | # Begin Source File
112 |
113 | SOURCE=..\PisteEngine\PisteLog.cpp
114 | # End Source File
115 | # Begin Source File
116 |
117 | SOURCE=..\PisteEngine\PisteSFX.cpp
118 | # End Source File
119 | # Begin Source File
120 |
121 | SOURCE=..\PisteEngine\PisteSound.cpp
122 | # End Source File
123 | # Begin Source File
124 |
125 | SOURCE=..\PisteEngine\PisteWait.cpp
126 | # End Source File
127 | # Begin Source File
128 |
129 | SOURCE="..\Pekka Kana 2\PK2Map.cpp"
130 | # End Source File
131 | # Begin Source File
132 |
133 | SOURCE="..\Pekka Kana 2\PK2Sprite.cpp"
134 | # End Source File
135 | # Begin Source File
136 |
137 | SOURCE=.\Resource.rc
138 | # End Source File
139 | # End Group
140 | # Begin Group "Header Files"
141 |
142 | # PROP Default_Filter "h;hpp;hxx;hm;inl"
143 | # Begin Source File
144 |
145 | SOURCE=..\..\..\mssdk\DirectX7\include\ddraw.h
146 | # End Source File
147 | # Begin Source File
148 |
149 | SOURCE=..\..\..\mssdk\DirectX7\include\dinput.h
150 | # End Source File
151 | # Begin Source File
152 |
153 | SOURCE=..\..\..\mssdk\DirectX7\include\dsound.h
154 | # End Source File
155 | # Begin Source File
156 |
157 | SOURCE=..\PisteEngine\PisteDraw.h
158 | # End Source File
159 | # Begin Source File
160 |
161 | SOURCE=..\PisteEngine\PisteFont.h
162 | # End Source File
163 | # Begin Source File
164 |
165 | SOURCE=..\PisteEngine\PisteInput.h
166 | # End Source File
167 | # Begin Source File
168 |
169 | SOURCE=..\PisteLanguage\PisteLanguage.h
170 | # End Source File
171 | # Begin Source File
172 |
173 | SOURCE=..\PisteEngine\PisteLog.h
174 | # End Source File
175 | # Begin Source File
176 |
177 | SOURCE=..\PisteEngine\PisteSFX.h
178 | # End Source File
179 | # Begin Source File
180 |
181 | SOURCE=..\PisteEngine\PisteSound.h
182 | # End Source File
183 | # Begin Source File
184 |
185 | SOURCE=..\PisteEngine\PisteWait.h
186 | # End Source File
187 | # Begin Source File
188 |
189 | SOURCE="..\Pekka Kana 2\PK2Map.h"
190 | # End Source File
191 | # Begin Source File
192 |
193 | SOURCE="..\Pekka Kana 2\PK2Sprite.h"
194 | # End Source File
195 | # Begin Source File
196 |
197 | SOURCE=..\..\..\mssdk\DirectX7\lib\ddraw.lib
198 | # End Source File
199 | # Begin Source File
200 |
201 | SOURCE=..\..\..\mssdk\DirectX7\lib\dinput.lib
202 | # End Source File
203 | # Begin Source File
204 |
205 | SOURCE=..\..\Vc98\Lib\Winmm.lib
206 | # End Source File
207 | # Begin Source File
208 |
209 | SOURCE=..\..\..\mssdk\DirectX7\lib\dsound.lib
210 | # End Source File
211 | # End Group
212 | # Begin Group "Resource Files"
213 |
214 | # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
215 | # Begin Source File
216 |
217 | SOURCE=.\cursor1.cur
218 | # End Source File
219 | # Begin Source File
220 |
221 | SOURCE=.\GameIcon.ico
222 | # End Source File
223 | # End Group
224 | # End Target
225 | # End Project
226 |
--------------------------------------------------------------------------------
/Pekka Kana 2/Pekka Kana 2.dsp:
--------------------------------------------------------------------------------
1 | # Microsoft Developer Studio Project File - Name="Pekka Kana 2" - Package Owner=<4>
2 | # Microsoft Developer Studio Generated Build File, Format Version 6.00
3 | # ** DO NOT EDIT **
4 |
5 | # TARGTYPE "Win32 (x86) Application" 0x0101
6 |
7 | CFG=Pekka Kana 2 - Win32 Debug
8 | !MESSAGE This is not a valid makefile. To build this project using NMAKE,
9 | !MESSAGE use the Export Makefile command and run
10 | !MESSAGE
11 | !MESSAGE NMAKE /f "Pekka Kana 2.mak".
12 | !MESSAGE
13 | !MESSAGE You can specify a configuration when running NMAKE
14 | !MESSAGE by defining the macro CFG on the command line. For example:
15 | !MESSAGE
16 | !MESSAGE NMAKE /f "Pekka Kana 2.mak" CFG="Pekka Kana 2 - Win32 Debug"
17 | !MESSAGE
18 | !MESSAGE Possible choices for configuration are:
19 | !MESSAGE
20 | !MESSAGE "Pekka Kana 2 - Win32 Release" (based on "Win32 (x86) Application")
21 | !MESSAGE "Pekka Kana 2 - Win32 Debug" (based on "Win32 (x86) Application")
22 | !MESSAGE
23 |
24 | # Begin Project
25 | # PROP AllowPerConfigDependencies 0
26 | # PROP Scc_ProjName ""
27 | # PROP Scc_LocalPath ""
28 | CPP=cl.exe
29 | MTL=midl.exe
30 | RSC=rc.exe
31 |
32 | !IF "$(CFG)" == "Pekka Kana 2 - Win32 Release"
33 |
34 | # PROP BASE Use_MFC 0
35 | # PROP BASE Use_Debug_Libraries 0
36 | # PROP BASE Output_Dir "Release"
37 | # PROP BASE Intermediate_Dir "Release"
38 | # PROP BASE Target_Dir ""
39 | # PROP Use_MFC 0
40 | # PROP Use_Debug_Libraries 0
41 | # PROP Output_Dir "Release"
42 | # PROP Intermediate_Dir "Release"
43 | # PROP Target_Dir ""
44 | # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c
45 | # ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c
46 | # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
47 | # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
48 | # ADD BASE RSC /l 0x40b /d "NDEBUG"
49 | # ADD RSC /l 0x40b /d "NDEBUG"
50 | BSC32=bscmake.exe
51 | # ADD BASE BSC32 /nologo
52 | # ADD BSC32 /nologo
53 | LINK32=link.exe
54 | # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386
55 | # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386
56 |
57 | !ELSEIF "$(CFG)" == "Pekka Kana 2 - Win32 Debug"
58 |
59 | # PROP BASE Use_MFC 0
60 | # PROP BASE Use_Debug_Libraries 1
61 | # PROP BASE Output_Dir "Debug"
62 | # PROP BASE Intermediate_Dir "Debug"
63 | # PROP BASE Target_Dir ""
64 | # PROP Use_MFC 0
65 | # PROP Use_Debug_Libraries 1
66 | # PROP Output_Dir "Debug"
67 | # PROP Intermediate_Dir "Debug"
68 | # PROP Ignore_Export_Lib 0
69 | # PROP Target_Dir ""
70 | # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c
71 | # ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c
72 | # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
73 | # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
74 | # ADD BASE RSC /l 0x40b /d "_DEBUG"
75 | # ADD RSC /l 0x40b /d "_DEBUG"
76 | BSC32=bscmake.exe
77 | # ADD BASE BSC32 /nologo
78 | # ADD BSC32 /nologo
79 | LINK32=link.exe
80 | # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
81 | # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /out:"Debug/PK2.exe" /pdbtype:sept
82 |
83 | !ENDIF
84 |
85 | # Begin Target
86 |
87 | # Name "Pekka Kana 2 - Win32 Release"
88 | # Name "Pekka Kana 2 - Win32 Debug"
89 | # Begin Group "Source Files"
90 |
91 | # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
92 | # Begin Source File
93 |
94 | SOURCE=..\PisteEngine\PisteDraw.cpp
95 | # End Source File
96 | # Begin Source File
97 |
98 | SOURCE=..\PisteEngine\PisteFont.cpp
99 | # End Source File
100 | # Begin Source File
101 |
102 | SOURCE=..\PisteEngine\PisteInput.cpp
103 | # End Source File
104 | # Begin Source File
105 |
106 | SOURCE=..\PisteLanguage\PisteLanguage.cpp
107 | # End Source File
108 | # Begin Source File
109 |
110 | SOURCE=..\PisteEngine\PisteLog.cpp
111 | # End Source File
112 | # Begin Source File
113 |
114 | SOURCE=..\PisteEngine\PisteSFX.cpp
115 | # End Source File
116 | # Begin Source File
117 |
118 | SOURCE=..\PisteEngine\PisteSound.cpp
119 | # End Source File
120 | # Begin Source File
121 |
122 | SOURCE=..\PisteEngine\PisteWait.cpp
123 | # End Source File
124 | # Begin Source File
125 |
126 | SOURCE=.\PK2.cpp
127 | # End Source File
128 | # Begin Source File
129 |
130 | SOURCE=.\PK2Map.cpp
131 | # End Source File
132 | # Begin Source File
133 |
134 | SOURCE=.\PK2Sprite.cpp
135 | # End Source File
136 | # Begin Source File
137 |
138 | SOURCE=.\Resource.rc
139 | # End Source File
140 | # End Group
141 | # Begin Group "Header Files"
142 |
143 | # PROP Default_Filter "h;hpp;hxx;hm;inl"
144 | # Begin Source File
145 |
146 | SOURCE=..\..\..\Dxsdk\Include\ddraw.h
147 | # End Source File
148 | # Begin Source File
149 |
150 | SOURCE=..\..\..\Dxsdk\Include\dinput.h
151 | # End Source File
152 | # Begin Source File
153 |
154 | SOURCE=..\..\..\Dxsdk\Include\dsound.h
155 | # End Source File
156 | # Begin Source File
157 |
158 | SOURCE=..\..\..\Midas\include\midasdll.h
159 | # End Source File
160 | # Begin Source File
161 |
162 | SOURCE=..\PisteEngine\PisteDraw.h
163 | # End Source File
164 | # Begin Source File
165 |
166 | SOURCE=..\PisteEngine\PisteFont.h
167 | # End Source File
168 | # Begin Source File
169 |
170 | SOURCE=..\PisteEngine\PisteInput.h
171 | # End Source File
172 | # Begin Source File
173 |
174 | SOURCE=..\PisteEngine\PisteLog.h
175 | # End Source File
176 | # Begin Source File
177 |
178 | SOURCE=..\PisteEngine\PisteSFX.h
179 | # End Source File
180 | # Begin Source File
181 |
182 | SOURCE=..\PisteEngine\PisteSound.h
183 | # End Source File
184 | # Begin Source File
185 |
186 | SOURCE=..\PisteEngine\PisteWait.h
187 | # End Source File
188 | # Begin Source File
189 |
190 | SOURCE=.\PK2Map.h
191 | # End Source File
192 | # Begin Source File
193 |
194 | SOURCE=.\PK2Sprite.h
195 | # End Source File
196 | # Begin Source File
197 |
198 | SOURCE=.\resource.h
199 | # End Source File
200 | # End Group
201 | # Begin Group "Resource Files"
202 |
203 | # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
204 | # Begin Source File
205 |
206 | SOURCE=.\cursor1.cur
207 | # End Source File
208 | # Begin Source File
209 |
210 | SOURCE=.\icon1.ico
211 | # End Source File
212 | # Begin Source File
213 |
214 | SOURCE=.\PEKKA.bmp
215 | # End Source File
216 | # Begin Source File
217 |
218 | SOURCE=..\..\Vc98\Lib\Winmm.lib
219 | # End Source File
220 | # Begin Source File
221 |
222 | SOURCE=..\..\..\Dxsdk\Lib\dsound.lib
223 | # End Source File
224 | # Begin Source File
225 |
226 | SOURCE=..\..\..\Dxsdk\Lib\ddraw.lib
227 | # End Source File
228 | # Begin Source File
229 |
230 | SOURCE=..\..\..\Dxsdk\Lib\dinput.lib
231 | # End Source File
232 | # Begin Source File
233 |
234 | SOURCE=..\..\..\C\Midas\lib\win32\vcretail\midasdll.lib
235 | # End Source File
236 | # End Group
237 | # End Target
238 | # End Project
239 |
--------------------------------------------------------------------------------
/PisteEngine/PisteSFX.cpp:
--------------------------------------------------------------------------------
1 | #include
2 | /*
3 | #include
4 | #include
5 | #include
6 | #include
7 | #include
8 | #include
9 | #include
10 | #include
11 | #include
12 | #include
13 | #include
14 | #include
15 | #include
16 | */
17 | #include "PisteSFX.h"
18 |
19 | bool play_sfx = true;
20 |
21 | PisteSFX::PisteSFX()
22 | {
23 | for (int i=0;itiedosto," ");
33 | }
34 |
35 | PisteSFX::PisteSFX(UCHAR kanavia, DWORD samplerate, UCHAR bitrate)
36 | {
37 | for (int i=0;ikanavia = kanavia;
47 | this->samplerate = samplerate;
48 | this->bitrate = bitrate;
49 | strcpy(this->tiedosto," ");
50 | }
51 |
52 | PisteSFX::~PisteSFX()
53 | {
54 | for (int i=0;istate[i] != SOUND_NULL)
56 | {
57 | if (this->state[i] == SOUND_PLAYING)
58 | this->dsbuffer[i]->Stop();
59 | this->dsbuffer[i]->Release();
60 | this->state[i] = SOUND_NULL;
61 | }
62 | }
63 |
64 | void PisteSFX::Tuhoa()
65 | {
66 | for (int i=0;idsbuffer[i])
68 | {
69 | if (this->state[i] == SOUND_PLAYING)
70 | this->dsbuffer[i]->Stop();
71 | this->dsbuffer[i]->Release();
72 | this->state[i] = SOUND_NULL;
73 | strcpy(this->tiedosto," ");
74 | }
75 | }
76 |
77 | int PisteSFX::Lataa(char *filename, int control_flags, LPDIRECTSOUND lpds,
78 | WAVEFORMATEX pcmwf, DSBUFFERDESC dsbd)
79 | {
80 |
81 | if (this->state[0] == SOUND_NULL)
82 | {
83 | if (PisteSFX_Lataa_WAV(this, filename, control_flags, lpds, pcmwf, dsbd) == -1)
84 | return 2;
85 |
86 | strcpy(this->tiedosto,filename);
87 |
88 | this->buffer_index = 0;
89 |
90 | for (int i=1;idsbuffer[i] = this->dsbuffer[0];
93 | this->state[i] = this->state[0];
94 | if (FAILED(lpds->DuplicateSoundBuffer(this->dsbuffer[0],
95 | &this->dsbuffer[i])))
96 | {
97 | this->dsbuffer[i] = NULL;
98 | this->state[i] = SOUND_LOADED;
99 | return 3;
100 | }
101 | }
102 | }
103 | else
104 | return 1;
105 |
106 | return 0;
107 | }
108 |
109 | int PisteSFX::Soita()
110 | {
111 | if (play_sfx)
112 | {
113 | if (FAILED(this->dsbuffer[buffer_index]->SetVolume(0)))
114 | return 1;
115 | if (FAILED(this->dsbuffer[buffer_index]->Play(0,0,0)))
116 | return 1;
117 | this->state[buffer_index] = SOUND_PLAYING;
118 | buffer_index++;
119 | if (buffer_index == MAX_POLY_PER_FX)
120 | buffer_index = 0;
121 | }
122 | return 0;
123 | }
124 |
125 | int PisteSFX::Soita(int volume)
126 | {
127 | if (play_sfx)
128 | {
129 | volume = (100-volume) * -30;//-100
130 |
131 | if (volume < DSBVOLUME_MIN)
132 | volume = DSBVOLUME_MIN;
133 |
134 | if (volume > DSBVOLUME_MAX)
135 | volume = DSBVOLUME_MAX;
136 |
137 | if (FAILED(this->dsbuffer[buffer_index]->SetVolume(volume)))
138 | return 1;
139 |
140 | if (FAILED(this->dsbuffer[buffer_index]->Play(0,0,0)))
141 | return 1;
142 |
143 | this->state[buffer_index] = SOUND_PLAYING;
144 |
145 | buffer_index++;
146 |
147 | if (buffer_index == MAX_POLY_PER_FX)
148 | buffer_index = 0;
149 | }
150 | return 0;
151 | }
152 |
153 | int PisteSFX::Soita(int volume, int pan, int freq)
154 | {
155 | if (play_sfx)
156 | {
157 | volume = (100-volume) * -30;//-100
158 |
159 | if (volume < DSBVOLUME_MIN)
160 | volume = DSBVOLUME_MIN;
161 |
162 | if (volume > DSBVOLUME_MAX)
163 | volume = DSBVOLUME_MAX;
164 |
165 | if (pan < -10000)
166 | pan = -10000;
167 |
168 | if (pan > 10000)
169 | pan = 10000;
170 |
171 | if (freq < 100)
172 | freq = 100;
173 |
174 | if (freq > 100000)
175 | freq = 100000;
176 |
177 | if (FAILED(this->dsbuffer[buffer_index]->SetVolume(volume)))
178 | return 1;
179 |
180 | if (FAILED(this->dsbuffer[buffer_index]->SetPan(pan)))
181 | return 1;
182 |
183 | if (FAILED(this->dsbuffer[buffer_index]->SetFrequency(freq)))
184 | return 1;
185 |
186 | if (FAILED(this->dsbuffer[buffer_index]->Play(0,0,0)))
187 | return 1;
188 |
189 | this->state[buffer_index] = SOUND_PLAYING;
190 |
191 | buffer_index++;
192 |
193 | if (buffer_index == MAX_POLY_PER_FX)
194 | buffer_index = 0;
195 | }
196 | return 0;
197 | }
198 |
199 | int PisteSFX_Set_Sfx(bool play)
200 | {
201 | play_sfx = play;
202 | return 0;
203 | }
204 |
205 | bool PisteSFX_Get_Sfx(void)
206 | {
207 | return play_sfx;
208 | }
209 |
210 | int PisteSFX_Lataa_WAV(PisteSFX *soundi, char *filename, int control_flags, LPDIRECTSOUND lpds,
211 | WAVEFORMATEX pcmwf, DSBUFFERDESC dsbd)
212 | {
213 | HMMIO hwav; // handle to wave file
214 | MMCKINFO parent, // parent chunk
215 | child; // child chunk
216 | WAVEFORMATEX wfmtx; // wave format structure
217 |
218 | int sound_id = -1; // id of sound to be loaded
219 | // looping variable
220 | UCHAR *snd_buffer, // temporary sound buffer to hold voc data
221 | *audio_ptr_1 = NULL, // data ptr to first write buffer
222 | *audio_ptr_2 = NULL; // data ptr to second write buffer
223 |
224 | DWORD audio_length_1 = 0, // length of first write buffer
225 | audio_length_2 = 0; // length of second write buffer
226 |
227 | if (soundi->state[0] != SOUND_NULL)
228 | return(-1);
229 |
230 | // set up chunk info structure
231 | parent.ckid = (FOURCC)0;
232 | parent.cksize = 0;
233 | parent.fccType = (FOURCC)0;
234 | parent.dwDataOffset = 0;
235 | parent.dwFlags = 0;
236 |
237 | // copy data
238 | child = parent;
239 |
240 | // open the WAV file
241 | if ((hwav = mmioOpen(filename, NULL, MMIO_READ | MMIO_ALLOCBUF))==NULL)
242 | return(-1);
243 |
244 | // descend into the RIFF
245 | parent.fccType = mmioFOURCC('W', 'A', 'V', 'E');
246 |
247 | if (mmioDescend(hwav, &parent, NULL, MMIO_FINDRIFF))
248 | {
249 | // close the file
250 | mmioClose(hwav, 0);
251 |
252 | // return error, no wave section
253 | return(-1);
254 | } // end if
255 |
256 | // descend to the WAVEfmt
257 | child.ckid = mmioFOURCC('f', 'm', 't', ' ');
258 |
259 | if (mmioDescend(hwav, &child, &parent, 0))
260 | {
261 | // close the file
262 | mmioClose(hwav, 0);
263 |
264 | // return error, no format section
265 | return(-1);
266 | } // end if
267 |
268 | // now read the wave format information from file
269 | if (mmioRead(hwav, (char *)&wfmtx, sizeof(wfmtx)) != sizeof(wfmtx))
270 | {
271 | // close file
272 | mmioClose(hwav, 0);
273 |
274 | // return error, no wave format data
275 | return(-1);
276 | } // end if
277 |
278 | // make sure that the data format is PCM
279 | if (wfmtx.wFormatTag != WAVE_FORMAT_PCM)
280 | {
281 | // close the file
282 | mmioClose(hwav, 0);
283 |
284 | // return error, not the right data format
285 | return(-1);
286 | } // end if
287 |
288 | // now ascend up one level, so we can access data chunk
289 | if (mmioAscend(hwav, &child, 0))
290 | {
291 | // close file
292 | mmioClose(hwav, 0);
293 |
294 | // return error, couldn't ascend
295 | return(-1);
296 | } // end if
297 |
298 | // descend to the data chunk
299 | child.ckid = mmioFOURCC('d', 'a', 't', 'a');
300 |
301 | if (mmioDescend(hwav, &child, &parent, MMIO_FINDCHUNK))
302 | {
303 | // close file
304 | mmioClose(hwav, 0);
305 |
306 | // return error, no data
307 | return(-1);
308 | } // end if
309 |
310 | // finally!!!! now all we have to do is read the data in and
311 | // set up the directsound buffer
312 |
313 | // allocate the memory to load sound data
314 | snd_buffer = (UCHAR *)malloc(child.cksize);
315 |
316 | // read the wave data
317 | mmioRead(hwav, (char *)snd_buffer, child.cksize);
318 |
319 | // close the file
320 | mmioClose(hwav, 0);
321 |
322 | // set rate and size in data structure
323 | soundi->rate = wfmtx.nSamplesPerSec;
324 | soundi->size = child.cksize;
325 | soundi->state[0] = SOUND_LOADED;
326 |
327 | // set up the format data structure
328 | memset(&pcmwf, 0, sizeof(WAVEFORMATEX));
329 |
330 | pcmwf.wFormatTag = WAVE_FORMAT_PCM; // pulse code modulation
331 | pcmwf.nChannels = soundi->kanavia;
332 | pcmwf.nSamplesPerSec = soundi->samplerate; // always this rate
333 | pcmwf.nBlockAlign = 1;
334 | pcmwf.nAvgBytesPerSec = pcmwf.nSamplesPerSec * pcmwf.nBlockAlign;
335 | pcmwf.wBitsPerSample = soundi->bitrate;
336 | pcmwf.cbSize = 0;
337 |
338 | // prepare to create sounds buffer
339 | dsbd.dwSize = sizeof(DSBUFFERDESC);
340 | dsbd.dwFlags = control_flags | DSBCAPS_STATIC | DSBCAPS_LOCSOFTWARE;
341 | dsbd.dwBufferBytes = child.cksize;
342 | dsbd.lpwfxFormat = &pcmwf;
343 |
344 | // create the sound buffer
345 | if (FAILED(lpds->CreateSoundBuffer(&dsbd,&soundi->dsbuffer[0],NULL)))
346 | {
347 | // release memory
348 | free(snd_buffer);
349 |
350 | // return error
351 | return(-1);
352 | } // end if
353 |
354 | // copy data into sound buffer
355 | if (FAILED(soundi->dsbuffer[0]->Lock(0,
356 | child.cksize,
357 | (void **) &audio_ptr_1,
358 | &audio_length_1,
359 | (void **)&audio_ptr_2,
360 | &audio_length_2,
361 | DSBLOCK_FROMWRITECURSOR)))
362 | return(0);
363 |
364 | // copy first section of circular buffer
365 | memcpy(audio_ptr_1, snd_buffer, audio_length_1);
366 |
367 | // copy last section of circular buffer
368 | memcpy(audio_ptr_2, (snd_buffer+audio_length_1),audio_length_2);
369 |
370 | // unlock the buffer
371 | if (FAILED(soundi->dsbuffer[0]->Unlock(audio_ptr_1,
372 | audio_length_1,
373 | audio_ptr_2,
374 | audio_length_2)))
375 | return(0);
376 |
377 | // release the temp buffer
378 | free(snd_buffer);
379 |
380 | // return id
381 | return(0);
382 |
383 | } // end DSound_Load_WAV
--------------------------------------------------------------------------------
/Pekka Kana 2/pk2_sprite.txt:
--------------------------------------------------------------------------------
1 | SHORT PEKKA KANA 2 SPRITE 1.3 DOCUMENTATION
2 | -------------------------------------------------------------------------------------------------
3 | This is a dummy version of the actual PK2Sprite_Prototype class. It's
4 | used to save sprites in .spr files and to load them.
5 |
6 | class PK2Sprite_Prototype13 {
7 | public:
8 |
9 | /* Sprite's Type */
10 |
11 | int type; // Sprite's type. Check Sprite Type List below.
12 |
13 | /* Bitmap File */
14 |
15 | char image_file[100]; // .BMP or PCX file containing sprite's graphics
16 |
17 | /* Sound Effects */
18 |
19 | char sound_files[7][100]; // sound effects
20 | // Index: Explanation:
21 | // 0 = Damage Sound
22 | // 1 = Knock Out Sound
23 | // 2 = Attack 1 Sound
24 | // 3 = Attack 2 Sound
25 | // 4 = Random Sound
26 | // 5 = Special Sound 1 (not implemented)
27 | // 6 = Special Sound 2 (not implemented)
28 |
29 | int sounds[7]; // not used here
30 |
31 | /* Animation */
32 |
33 | unsigned char frames; // Number of frames
34 |
35 | PK2SPRITE_ANIMATION animations[20]; // Animation sequensses
36 | // Index: Explanation:
37 | // 0 = Still
38 | // 1 = Walking
39 | // 2 = Jump up
40 | // 3 = Jump Down
41 | // 4 = Duck
42 | // 5 = Damage
43 | // 6 = Knock Out
44 | // 7 = Attack 1
45 | // 8 = Attack 2
46 |
47 | unsigned char animations; // Number of animations
48 |
49 | unsigned char frame_rate; // Durations of one animation frame (in game frames)
50 |
51 | int position_x; // X cordinate of first frame in bitmap (left corner)
52 | int position_y; // Y cordinate of first frame in bitmap (top corner)
53 |
54 | int frame_width; // One frame's width
55 | int frame_height; // One frame's height
56 | int frame_distance; // Distance of two frame's in bitmap (in pixels).
57 | // Not actually used.
58 |
59 | /* Sprite information */
60 |
61 | char name[30]; // Sprite's name (visible in level editor)
62 |
63 | int width; // Sprite's width
64 | int height; // Sprite's height
65 | // NOTE: Height and width do not have to mach
66 | // frame width and height.
67 |
68 | double weight; // Sprite's weight
69 | // NOTE: Sprite's weight affects jumping and switches.
70 | // Sprites that weight more than 1 can press switches.
71 | // Weight also increases damage when sprite falls on
72 | // another (hostile) sprite.
73 | // A sprite with negative widt wiil rise up (fast)
74 |
75 | bool enemy; // True if sprite is an enemy. Enemys do damage to
76 | // non enemy sprites and vice versa.
77 |
78 | int energy; // Sprite's energy (both maximum and default).
79 | // If the sprite is a bonus item, energy is the
80 | // amount of energy this bonus returns (e.g. feather).
81 |
82 | int damage; // How much damage sprite causes (positive decreases
83 | // and negative decreases).
84 |
85 | unsigned char damage_type; // Type of sprite's damage (check Damage Type list).
86 | unsigned char immunity; // Type of damage that does not harm the sprite
87 | // (check Damage Type list).
88 |
89 | int score; // If the sprite is a game character, then score is the
90 | // number of points you get when you knock it out.
91 | // If sprite is a bonus item sprite, then score is
92 | // the amount of points you get when you collect the
93 | // bonus item.
94 |
95 | int AI[10]; // Table of sprite's AI modules. Check the AI List.
96 |
97 | unsigned char max_jump; // Duration of sprite's jump. Normal jump around 20-25.
98 |
99 | double max_speed; // Sprite's maximum speed: 0=still 4=normal speed
100 |
101 | int loading_time; // Wait after shooting (in frames).
102 |
103 | unsigned char color; // Sprite's color (see Color List).
104 |
105 | bool obstacle; // True if sprite is a wall.
106 |
107 | int destruction; // Knock out effect.
108 | // See Destruction Style list.
109 |
110 | bool key; // true if sprite is a key or can open locks
111 |
112 | bool shakes; // true if sprite shakes randomly
113 |
114 | unsigned char bonuses; // number of bonuses the sprite drops when ko'ed
115 |
116 | int attack1_duration; // how long the attack 1 animation is displayed (frames)
117 | int attack2_duration; // how long the attack 1 animation is displayed (frames)
118 |
119 | int parallax_factor; // Relation to background image (Background sprite // types).
120 | /* Linked Sprites */
121 |
122 | char transformation_sprite[100]; // Another sprite to which this sprite can
123 | // transform into (e.g. 'r_naked.spr')
124 | // If the sprite is a bonus, the player will
125 | // turn to this sprite when the bonus is
126 | // collected.
127 | char bonus_sprite[100]; // A sprite this sprite drops when ko'ed
128 | // (e.g. 'apple.spr')
129 | // If the sprite itself is a bonus,
130 | // 'bonus_sprite' will appear in the item box.
131 |
132 | char ammo1_sprite[100]; // The sprite this sprite launches in attack 1
133 | char ammo2_sprite[100]; // The sprite this sprite launches in attack 2
134 |
135 | bool tile_check; // True if sprite can't walk/fly through walls.
136 |
137 | unsigned long sound_frq; // Default frequency of sound effects
138 | // (default 22050)
139 | bool random_frq; // true = Play sound effects in random frequency
140 | // related to default frequency
141 |
142 | // If sprite is an obstacle
143 | bool wall_up; // Sprite works as a wall upwards
144 | bool wall_down; // Sprite works as a wall downwards
145 | bool wall_right; // Sprite works as a wall ...
146 | bool wall_left; // Sprite works as a wall ...
147 |
148 | unsigned char transparency; // not implemented
149 | bool glow; // not implemented
150 |
151 | int attack_pause; // If the sprite is an ammunition, this is the loading
152 | // time between two attacks.
153 |
154 | bool glide_ability; // true if sprite can glide down
155 | bool boss; // true if sprite is a boss. If sprite is a boss,
156 | // skull switches will rotate after the sprite is
157 | // ko'ed.
158 |
159 | bool bonus_always; // always drops bonus(es) when ko'ed
160 |
161 | bool can_swim; // if true, gravity doesn't affect in water
162 | };
163 |
164 | Sprite Type List
165 | ================
166 | 1 = Character Sprite
167 | 2 = Bonus Item Sprite
168 | 3 = Ammo Sprite
169 | 4 = Teleport Sprite
170 | 5 = Background Sprite
171 |
172 |
173 |
174 | AI Module List
175 | ==============
176 | (B) = AI affects Bonus Sprites
177 | (P) = AI affects also when sprite is controlled by player
178 |
179 | No AI = 0 Marks the last AI.
180 | Chicken = 1 Sprite jumps randomly and tries to get over
181 | obstacles.
182 | An Egg = 2 Sprite dies, if it hits the floor.
183 | Baby Chicken = 3 Same as Chicken, but it tries to follow the
184 | player.
185 | Bonus (B) = 4
186 | Jumper = 5
187 | Basic AI (B) = 6 Sprite won't get off the map and looks at the
188 | same direction it's walking.
189 | Turn horizontally = 7 Sprite turns horizontally if it hits an
190 | obstacle.
191 | Looks Out for Cliffs = 8 Sprite turns horizontally before it falls down
192 | from a cliff.
193 | Random Horizontal Change of Direction = 9 Sprite turns horizontally at random points.
194 | Random Jumping = 10 Sprite jumps randomly.
195 | Follow the Player = 11 Sprite follows the player even if it doesn't
196 | see it.
197 | Random Horizontal Change of Direction = 12 Sprite turns horizontally at random points.
198 | Follow the Player if Player is in Front = 13 Sprite follows the player only if it
199 | sees it.
200 | Transformation If Energy Below 2 (P) = 14 Sprite changes to Transformation Sprite when
201 | it's energy drops below 2.
202 | Transformation If Energy Below 2 (P) = 15 Sprite changes to Transformation Sprite when
203 | it's energy rises over 1.
204 | Start Directions Towards Player = 16
205 | Ammonition = 17
206 | Non Stop = 18 Sprite is not affected by friction.
207 | Attack 1 If Damaged = 19
208 | Self Destruction = 20
209 | Attack 1 If Player is in Front = 21
210 | Attack 1 If Pleyer is Below = 22
211 | Damaged by Water (P) = 23
212 | Attack 2 If Player is in Front = 24
213 | Kill 'em all = 25 Sprite damages both enemies and friends.
214 | Affected by Friction = 26 Friction slows the sprite down and stops it.
215 | Hide = 27 Sprite ducks if it's behind tile 144.
216 | Return to Start Position X = 28 After nothing better to do the sprite always
217 | tries to return to it's start position.
218 | Return to Start Position Y = 29 After nothing better to do the sprite always
219 | tries to return to it's start position.
220 | Teleport = 30
221 | Throwable Weapon = 35
222 | Falls When Shaken (B) = 36
223 | Change Trap Stones If KO'ed = 37
224 | Change Trap Stones If Damaged = 38
225 | Self Destructs With Mother Sprite = 39
226 | Moves X COS = 41
227 | Moves Y COS = 42
228 | Moves X SIN = 43
229 | Moves Y SIN = 44
230 | Moves X COS Fast = 45
231 | Moves Y SIN Fast = 46
232 | Moves X COS Slow = 47
233 | Moves Y SIN Slow = 48
234 | Moves Y SIN Free = 49
235 | Random Turning = 50
236 | Jump If Player Is Above = 51
237 | Transformation Timer (B) = 52
238 | Falls If Switch 1 Is Pressed (B) = 53
239 | Falls If Switch 2 Is Pressed (B) = 54
240 | Falls If Switch 3 Is Pressed (B) = 55
241 | Moves Down If Switch 1 Is Pressed = 56
242 | Moves Up If Switch 1 Is Pressed = 57
243 | Moves Right If Switch 1 Is Pressed = 58
244 | Moves Left If Switch 1 Is Pressed = 59
245 | Moves Down If Switch 2 Is Pressed = 60
246 | Moves Up If Switch 2 Is Pressed = 61
247 | Moves Right If Switch 2 Is Pressed = 62
248 | Moves Left If Switch 2 Is Pressed = 63
249 | Moves Down If Switch 3 Is Pressed = 64
250 | Moves Up If Switch 3 Is Pressed = 65
251 | Moves Right If Switch 3 Is Pressed = 66
252 | Moves Left If Switch 3 Is Pressed = 67
253 |
254 | THESE WORK ONLY IN PK2 VERSION 1.2 ->
255 |
256 | Turns Vertically From Obstacle = 70
257 | Random Vertical Starting Direction = 71
258 | Starting Direction Towards Player = 72
259 | Climber = 73 Sprite bounces from walls, floor and ceiling
260 | Climber Type 2 = 74 Sprite moves along walls (kind of)
261 | Runs Away From Player If Sees Player = 75
262 | Reborn (B) = 76 A new item appears when sprite is collected
263 |
264 | Arrow Left = 77 These set the direction of the sprite, if
265 | Arrow Right = 78 the sprite has AI 81.
266 | Arrow Up = 79
267 | Arrow Down = 80
268 | Move to Arrows Direction = 81
269 |
270 | <- THESE WORK ONLY IN PK2 VERSION 1.2
271 |
272 |
273 | Background Sprite Moon = 101
274 | Background Sprite Moves to Left = 102
275 | Background Sprite Moves to Right = 103
276 |
277 | Add Time to Clock = 120 Add time from loading_time
278 | Make Player Invisible = 121 Set invicibility time from loading_time
279 | Works only in PK2 version 1.2
280 |
281 | Follow the Player Vertic. and Horiz. = 130 Sprite follows the player even if doesn't
282 | see it.
283 | Follow the Player Vertic. and Horiz.
284 | if Player is in Front = 131 Sprite follows the player only if it
285 | sees it.
286 | Random Move Vertic. and Horiz. = 132
287 | Frog Jump 1 = 133
288 | Frog Jump 2 = 134
289 | Frog Jump 3 = 135
290 | Attack 2 if Damaged = 136
291 | Attack 1 Non Stop = 137
292 | Attack 2 Non Stop = 138
293 | Turn if Damaged = 139
294 | Evil One = 140
295 |
296 | Info 1 = 201 // use doodle attack to knock out enemys.
297 | Info 2 = 202 // use egg attack to knock out enemys.
298 | Info 3 = 203 // collect all keys to open all locks.
299 | Info 4 = 204 // you can activate switches by jumping on them.
300 | Info 5 = 205 // green switches activate green blocks.
301 | Info 6 = 206 // blue switches activate blue blocks.
302 | Info 7 = 207 // orange switches turn off fire.
303 | Info 8 = 208 // collect gifts to obtain useful items.
304 | Info 9 = 209 // if you are hit, feathers will give you energy.
305 | Info 10 = 210 // a drink from a magic bottle will change you...
306 | Info 11 = 211 // drink doodle drinks to and get special doodle attacks.
307 | Info 12 = 212 // drink hatching-booster and get special egg attacks.
308 | Info 13 = 213 // look for hidden bonuses!
309 | Info 14 = 214 // you can stomp on enemys, but you will lose energy.
310 | Info 15 = 215 // look out for traps!
311 | Info 16 = 216 // hurry up! your time is limited!
312 | Info 17 = 217 // be aware that some enemys resist certain attacks.
313 | Info 18 = 218 // a hen is mightier than the sword.
314 | Info 19 = 219 // why did the chicken cross the road?
315 |
316 |
317 |
318 | Color List
319 | ==========
320 | 0 = Grey
321 | 32 = Blue
322 | 64 = Red
323 | 96 = Green
324 | 128 = Orange
325 | 160 = Violet
326 | 192 = Turquoise
327 | 255 = Original
328 |
329 |
330 | Damage Type List
331 | ================
332 | 0 = No damage
333 | 1 = Punch
334 | 2 = Fall (stomp)
335 | 3 = Noise
336 | 4 = Fire
337 | 5 = Water
338 | 6 = Snow
339 | 7 = Bonus
340 | 8 = Electricity (stuns a sprite for a few seconds)
341 | 9 = Self destruction
342 | 10 = Squeeze
343 | 11 = Smell
344 | 12 = All
345 | 13 = Sting
346 |
347 |
348 | Destruction Style List
349 | ======================
350 | Indestructible = 0
351 | Animation = 100
352 | Feathers = 1 (feathers will fly also when damaged)
353 | Grey stars = 2
354 | Blue stars = 3
355 | Red stars = 4
356 | Green stars = 5
357 | Orange stars = 6
358 | Violet stars = 7
359 | Turquoise stars = 8
360 | Grey explotion = 9
361 | Blue explotion = 10
362 | Red explotion = 11
363 | Green explotion = 12
364 | Orange explotion = 13
365 | Violet explotion = 14
366 | Turquoise explotion = 15
367 | Grey smoke = 16
368 | Blue smoke = 17
369 | Red smoke = 18
370 | Green smoke = 19
371 | Orange smoke = 20
372 | Violet smoke = 21
373 | Turquoise smoke = 22
374 | Smoke clouds = 23
375 |
376 | Special effects can also be combined with animation.
377 | Example: Animation + Feathers
378 |
379 |
380 |
381 | -------------------------------------------------------------------------------------------------
382 | This is a help structure used to describe a sequence of frames. Maximum amount of frames is 10.
383 |
384 | A sequence might look like this: 3,4,5,6,0,0,0,0,0,0 (= Rooster sprite's walking animation)
385 |
386 | First frame is 1, second is 2 etc. Zero marks the end of sequence if the sequence is shorter
387 | than 10 frames.
388 |
389 | struct PK2SPRITE_ANIMATION {
390 | UCHAR sequence[10]; // sequence of frames
391 | UCHAR frames; // number of frames
392 | bool loops; // true if animation loops
393 | };
394 |
395 | -------------------------------------------------------------------------------------------------
396 | A method (or a sub program) for loading a version 1.3 sprite from an .SPR file.
397 |
398 |
399 | int PK2Sprite_LoadVersion13(char *file_name) {
400 |
401 | ifstream *file = new ifstream(file_name, ios::binary | ios::nocreate);
402 | char version[4];
403 |
404 | if (file->fail()) {
405 | delete (file);
406 | return 1;
407 | }
408 |
409 | file->read ((char *)version, 4);
410 |
411 | if (strcmp(versio,"1.3") == 0) {
412 | PK2Sprite_Prototype13 sprite;
413 | file->read ((char *)&file, sizeof (sprite));
414 | }
415 |
416 | if (file->fail()) {
417 | delete (file);
418 | return 1;
419 | }
420 |
421 | delete (file);
422 |
423 | return 0;
424 | }
425 | -------------------------------------------------------------------------------------------------
426 | A method (or a sub program) for saving a version 1.3 sprite to an .SPR file.
427 |
428 | void PK2Sprite_SaveVersion13(char *file_name) {
429 |
430 | PK2Sprite_Prototype13 sprite;
431 | ofstream *file = new ofstream(file_name, ios::binary);
432 | file->write ("1.3", 4);
433 | file->write ((char *)&sprite, sizeof(sprite));
434 | delete (file);
435 | }
436 |
437 | -------------------------------------------------------------------------------------------------
438 |
--------------------------------------------------------------------------------