LosaDev source snapshot 2019
No files matched your search
@@ -0,0 +1,42 @@
|
||||
# Build output (Visual Studio 2010, v100)
|
||||
[Dd]ebug/
|
||||
[Rr]elease/
|
||||
[Ss]hipping*/
|
||||
Ship_*/
|
||||
LOCAL_DBG/
|
||||
LSWC/
|
||||
ipch/
|
||||
.vs/
|
||||
*.obj
|
||||
*.pch
|
||||
*.ipch
|
||||
*.pdb
|
||||
*.ilk
|
||||
*.idb
|
||||
*.sbr
|
||||
*.bsc
|
||||
*.cod
|
||||
*.tlog
|
||||
*.lastbuildstate
|
||||
*.unsuccessfulbuild
|
||||
*.sdf
|
||||
*.opensdf
|
||||
*.suo
|
||||
*.user
|
||||
*.ncb
|
||||
*.aps
|
||||
*.VC.db
|
||||
*.VC.opendb
|
||||
*.iobj
|
||||
*.ipdb
|
||||
|
||||
# Generated by the TortoiseSVN pre-build step or by hand (see the wiki)
|
||||
Version.h
|
||||
|
||||
# Server output folders created by the post-build steps (one level above the repository)
|
||||
/build/
|
||||
|
||||
# Local files
|
||||
Thumbs.db
|
||||
desktop.ini
|
||||
*.dmp
|
||||
@@ -0,0 +1,66 @@
|
||||
USE [LosaGame]
|
||||
GO
|
||||
|
||||
/****** Object: StoredProcedure [dbo].[game_game_get_data] Script Date: 2017-12-07 오후 6:59:20 ******/
|
||||
DROP PROCEDURE [dbo].[game_game_get_data]
|
||||
GO
|
||||
|
||||
/****** Object: StoredProcedure [dbo].[game_game_get_data] Script Date: 2017-12-07 오후 6:59:20 ******/
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
|
||||
SET QUOTED_IDENTIFIER ON
|
||||
GO
|
||||
|
||||
|
||||
|
||||
--IF OBJECT_ID('dbo.game_practice_get_list','P') IS NOT NULL
|
||||
--
|
||||
-- DROP PROC dbo.game_practice_get_list
|
||||
--
|
||||
--GO
|
||||
|
||||
-- =============================================
|
||||
-- Subject : dbo.game_practice_get_list
|
||||
-- DBA :
|
||||
-- DATE : 2014-03-03
|
||||
-- Description : 훈련하기 데이터
|
||||
-- =============================================
|
||||
|
||||
Create PROCEDURE [dbo].[game_game_get_data]
|
||||
(
|
||||
@userID varchar(12)
|
||||
)
|
||||
As
|
||||
|
||||
SET NOCOUNT ON
|
||||
|
||||
|
||||
DECLARE @CURRENTDATE DATETIME
|
||||
DECLARE @CONNECTDATE DATETIME
|
||||
|
||||
SET @CURRENTDATE = GETDATE();
|
||||
SET @CONNECTDATE = ( SELECT conndate FROM dbo.userGameDB WHERE accountIDX IN ( SELECT accountIDX FROM dbo.userMemberDB WHERE userID = @userID ))
|
||||
|
||||
BEGIN
|
||||
IF( @CURRENTDATE < @CONNECTDATE )
|
||||
SET @CONNECTDATE = @CURRENTDATE
|
||||
END
|
||||
|
||||
SELECT a.accountIDX, b.userID, b.nickName, a.userState, a.gameMoney
|
||||
, a.conn_count, @CONNECTDATE, a.userLevel, a.userEXP--, a.relateLevel
|
||||
, b.eventType, isNull(c.class,0) as 'class', b.joinType, b.regDate, a.regionType
|
||||
, a.rencpoint, a.renspoint, isNull(c.region,0) as 'region', b.cpType, ISNULL(d.cpID, '') AS 'cpID'
|
||||
, ISNULL(d.note, '') AS 'cpUNIQ', b.limitType, b.limitDate, a.userFishingLevel, a.userFishingEXP
|
||||
, a.refillData, a.userExcavationLevel, a.userExcavationEXP, a.userHerocEXP, a.userHerosEXP, a.practice
|
||||
FROM userGameDB a WITH( NOLOCK )
|
||||
JOIN userMemberDB b WITH( NOLOCK )
|
||||
ON a.accountIDX = b.accountIDX
|
||||
LEFT JOIN userRankingDB c WITH( NOLOCK )
|
||||
ON a.accountIDX = c.accountIDX
|
||||
LEFT JOIN userCooperationDB d WITH( NOLOCK )
|
||||
ON a.accountIDX=d.accountIDX WHERE b.userID = @userID
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,123 @@
|
||||
USE [LosaGame]
|
||||
GO
|
||||
|
||||
/****** Object: StoredProcedure [dbo].[game_game_save] Script Date: 2017-12-07 오후 6:59:20 ******/
|
||||
DROP PROCEDURE [dbo].[game_game_save]
|
||||
GO
|
||||
|
||||
/****** Object: StoredProcedure [dbo].[game_game_save] Script Date: 2017-12-07 오후 6:59:20 ******/
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
|
||||
SET QUOTED_IDENTIFIER ON
|
||||
GO
|
||||
|
||||
|
||||
|
||||
--IF OBJECT_ID('dbo.game_practice_get_list','P') IS NOT NULL
|
||||
--
|
||||
-- DROP PROC dbo.game_practice_get_list
|
||||
--
|
||||
--GO
|
||||
|
||||
-- =============================================
|
||||
-- Subject : dbo.game_practice_get_list
|
||||
-- DBA :
|
||||
-- DATE : 2014-03-03
|
||||
-- Description : 훈련하기 데이터
|
||||
-- =============================================
|
||||
|
||||
Create PROCEDURE [dbo].[game_game_save]
|
||||
(
|
||||
@accountIDX int
|
||||
, @userState int
|
||||
, @gameMoney bigint
|
||||
, @conn_count int
|
||||
, @connDate datetime
|
||||
, @userLevel int
|
||||
, @userEXP int
|
||||
, @playTime int
|
||||
, @regionType int
|
||||
, @userFishingLevel int
|
||||
, @userFishingEXP int
|
||||
, @refillData int
|
||||
, @userExcavationLevel int
|
||||
, @userExcavationEXP int
|
||||
, @init_time int
|
||||
)
|
||||
As
|
||||
|
||||
SET NOCOUNT ON
|
||||
|
||||
IF @userLevel < 50
|
||||
BEGIN
|
||||
-- 기존 루틴 그대로
|
||||
UPDATE dbo.userGameDB
|
||||
SET gameMoney = @gameMoney
|
||||
, userState = @userState
|
||||
, playTime = playTime + Round((@playTime/1000)/60,0)
|
||||
, conn_count = @conn_count
|
||||
, userLevel = @userLevel
|
||||
, userEXP = @userEXP
|
||||
, userFishingLevel = @userFishingLevel
|
||||
, userFishingEXP = @userFishingEXP
|
||||
, regionType = @regionType
|
||||
, connDate = @connDate
|
||||
, refillData = @refillData
|
||||
, userExcavationLevel = @userExcavationLevel
|
||||
, userExcavationEXP = @userExcavationEXP
|
||||
, Practice = 0
|
||||
WHERE accountIDX = @accountIDX
|
||||
|
||||
END
|
||||
ELSE
|
||||
BEGIN
|
||||
--
|
||||
IF( EXISTS( SELECT * FROM dbo.userRelativeLevelDB WITH( NOLOCK )
|
||||
WHERE accountIDX = @accountIDX ) )
|
||||
BEGIN
|
||||
|
||||
UPDATE dbo.userGameDB
|
||||
SET gameMoney = @gameMoney
|
||||
, userState = @userState
|
||||
, playTime = playTime + Round((@playTime/1000)/60,0)
|
||||
, conn_count = @conn_count
|
||||
--, userLevel = @userLevel
|
||||
, userEXP = @userEXP
|
||||
, userFishingLevel = @userFishingLevel
|
||||
, userFishingEXP = @userFishingEXP
|
||||
, regionType = @regionType
|
||||
, connDate = @connDate
|
||||
, refillData = @refillData
|
||||
, userExcavationLevel = @userExcavationLevel
|
||||
, userExcavationEXP = @userExcavationEXP
|
||||
, Practice = 0
|
||||
WHERE accountIDX = @accountIDX
|
||||
|
||||
UPDATE dbo.userRelativeLevelDB
|
||||
SET init_time = @init_time
|
||||
WHERE accountIDX = @accountIDX
|
||||
|
||||
END
|
||||
ELSE
|
||||
BEGIN
|
||||
-- 기존 루틴 그대로 : 혹시나 ?
|
||||
UPDATE dbo.userGameDB
|
||||
SET gameMoney = @gameMoney
|
||||
, userState = @userState
|
||||
, playTime = playTime + Round((@playTime/1000)/60,0)
|
||||
, conn_count = @conn_count
|
||||
, userLevel = @userLevel
|
||||
, userEXP = @userEXP
|
||||
, userFishingLevel = @userFishingLevel
|
||||
, userFishingEXP = @userFishingEXP
|
||||
, regionType = @regionType
|
||||
, connDate = @connDate
|
||||
, refillData = @refillData
|
||||
, userExcavationLevel = @userExcavationLevel
|
||||
, userExcavationEXP = @userExcavationEXP
|
||||
, Practice = 0
|
||||
WHERE accountIDX = @accountIDX
|
||||
END
|
||||
END
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
USE [LosaGame]
|
||||
GO
|
||||
|
||||
/****** Object: StoredProcedure [dbo].[game_practice_BlockList] Script Date: 01/11/2018 11:59:29 ******/
|
||||
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[game_practice_BlockList]') AND type in (N'P', N'PC'))
|
||||
DROP PROCEDURE [dbo].[game_practice_BlockList]
|
||||
GO
|
||||
|
||||
USE [LosaGame]
|
||||
GO
|
||||
|
||||
/****** Object: StoredProcedure [dbo].[game_practice_BlockList] Script Date: 01/11/2018 11:59:29 ******/
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
|
||||
SET QUOTED_IDENTIFIER ON
|
||||
GO
|
||||
|
||||
|
||||
|
||||
--IF OBJECT_ID('dbo.game_practice_BlockList','P') IS NOT NULL
|
||||
--
|
||||
-- DROP PROC dbo.game_practice_BlockList
|
||||
--
|
||||
--GO
|
||||
|
||||
-- =============================================
|
||||
-- Subject : dbo.game_practice_BlockList
|
||||
-- DBA :
|
||||
-- DATE : 2015-06-17
|
||||
-- Description : ÈÆ·Ã µ¥ÀÌÅÍ »ý¼º
|
||||
-- =============================================
|
||||
|
||||
|
||||
CREATE PROCEDURE [dbo].[game_practice_BlockList]
|
||||
@KickID varchar(20)
|
||||
AS
|
||||
|
||||
SET NOCOUNT ON;
|
||||
SET LOCK_TIMEOUT 10000;
|
||||
|
||||
SELECT accountIDX FROM LosaGame.dbo.userMemberDB WHERE limitType = 100 AND limitDate > Getdate() - 3 AND userID = @KickID
|
||||
|
||||
GO
|
||||
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
USE [LosaGame]
|
||||
GO
|
||||
|
||||
/****** Object: StoredProcedure [dbo].[game_practice_Init_count] Script Date: 2017-12-07 오후 6:59:20 ******/
|
||||
DROP PROCEDURE [dbo].[game_practice_Init_count]
|
||||
GO
|
||||
|
||||
/****** Object: StoredProcedure [dbo].[game_practice_Init_count] Script Date: 2017-12-07 오후 6:59:20 ******/
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
|
||||
SET QUOTED_IDENTIFIER ON
|
||||
GO
|
||||
|
||||
|
||||
|
||||
--IF OBJECT_ID('dbo.game_practice_get_list','P') IS NOT NULL
|
||||
--
|
||||
-- DROP PROC dbo.game_practice_get_list
|
||||
--
|
||||
--GO
|
||||
|
||||
-- =============================================
|
||||
-- Subject : dbo.game_practice_get_list
|
||||
-- DBA :
|
||||
-- DATE : 2014-03-03
|
||||
-- Description : 훈련하기 데이터
|
||||
-- =============================================
|
||||
|
||||
Create PROCEDURE [dbo].[game_practice_Init_count]
|
||||
|
||||
@ACCOUNT_IDX INT,
|
||||
@PRACTICE_IDX INT, -- 연습 인덱스
|
||||
@PRACTICE_COUNT INT -- 수련장 입장횟수
|
||||
|
||||
AS
|
||||
|
||||
SET NOCOUNT ON;
|
||||
SET LOCK_TIMEOUT 10000;
|
||||
|
||||
SELECT COUNT(*) FROM dbo.userPracticeDB WHERE AccountIDX = @ACCOUNT_IDX AND PracticeIDX = @PRACTICE_IDX
|
||||
IF(@@ROWCOUNT = 0)
|
||||
BEGIN
|
||||
SELECT -1;
|
||||
RETURN ;
|
||||
END
|
||||
|
||||
BEGIN TRAN
|
||||
|
||||
UPDATE dbo.userPracticeDB
|
||||
SET PracticeCount = @PRACTICE_COUNT
|
||||
WHERE AccountIDX = @ACCOUNT_IDX AND PracticeIDX = @PRACTICE_IDX
|
||||
|
||||
IF (@@ROWCOUNT = 0) or (@@ERROR <> 0)
|
||||
BEGIN
|
||||
ROLLBACK TRAN
|
||||
SELECT -1;
|
||||
RETURN;
|
||||
END
|
||||
|
||||
COMMIT TRAN
|
||||
|
||||
SELECT 1;
|
||||
RETURN;
|
||||
|
||||
GO
|
||||
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
USE [LosaGame]
|
||||
GO
|
||||
|
||||
/****** Object: StoredProcedure [dbo].[game_practice_get_list] Script Date: 11/18/2017 17:09:36 ******/
|
||||
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[game_practice_get_list]') AND type in (N'P', N'PC'))
|
||||
DROP PROCEDURE [dbo].[game_practice_get_list]
|
||||
GO
|
||||
|
||||
USE [LosaGame]
|
||||
GO
|
||||
|
||||
/****** Object: StoredProcedure [dbo].[game_practice_get_list] Script Date: 11/18/2017 17:09:36 ******/
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
|
||||
SET QUOTED_IDENTIFIER ON
|
||||
GO
|
||||
|
||||
|
||||
|
||||
|
||||
--IF OBJECT_ID('dbo.game_practice_get_list','P') IS NOT NULL
|
||||
--
|
||||
-- DROP PROC dbo.game_practice_get_list
|
||||
--
|
||||
--GO
|
||||
|
||||
-- =============================================
|
||||
-- Subject : dbo.game_practice_get_list
|
||||
-- DBA :
|
||||
-- DATE : 2014-03-03
|
||||
-- Description : ÈÆ·ÃÇϱ⠵¥ÀÌÅÍ
|
||||
-- =============================================
|
||||
|
||||
CREATE PROCEDURE [dbo].[game_practice_get_list]
|
||||
|
||||
@topn INT,
|
||||
@ACCOUNT_IDX INT,
|
||||
@PRACTICE_IDX INT
|
||||
|
||||
AS
|
||||
|
||||
SET NOCOUNT ON;
|
||||
SET LOCK_TIMEOUT 10000;
|
||||
|
||||
SELECT TOP (@topn) practiceIDX, UPD.AccountIDX, UMD.NickName, PracticeTime, UpdateDate
|
||||
FROM dbo.userPracticeDB AS UPD WITH (READUNCOMMITTED)
|
||||
JOIN dbo.userMemberDB AS UMD on UPD.AccountIDX = UMD.accountIDX
|
||||
WHERE UPD.AccountIDX <= @ACCOUNT_IDX AND UMD.limitDate < GETDATE()
|
||||
ORDER by UPD.AccountIDX DESC
|
||||
|
||||
|
||||
GO
|
||||
@@ -0,0 +1,44 @@
|
||||
USE [LosaGame]
|
||||
GO
|
||||
|
||||
/****** Object: StoredProcedure [dbo].[game_practice_get_my_Ranking_list] Script Date: 2017-12-07 오후 6:59:20 ******/
|
||||
DROP PROCEDURE [dbo].[game_practice_get_my_Ranking_list]
|
||||
GO
|
||||
|
||||
/****** Object: StoredProcedure [dbo].[game_practice_get_my_Ranking_list] Script Date: 2017-12-07 오후 6:59:20 ******/
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
|
||||
SET QUOTED_IDENTIFIER ON
|
||||
GO
|
||||
|
||||
|
||||
|
||||
--IF OBJECT_ID('dbo.game_practice_get_list','P') IS NOT NULL
|
||||
--
|
||||
-- DROP PROC dbo.game_practice_get_list
|
||||
--
|
||||
--GO
|
||||
|
||||
-- =============================================
|
||||
-- Subject : dbo.game_practice_get_list
|
||||
-- DBA :
|
||||
-- DATE : 2014-03-03
|
||||
-- Description : 훈련하기 데이터
|
||||
-- =============================================
|
||||
|
||||
Create PROCEDURE [dbo].[game_practice_get_my_Ranking_list]
|
||||
|
||||
@ACCOUNT_IDX INT
|
||||
|
||||
AS
|
||||
|
||||
SET NOCOUNT ON;
|
||||
SET LOCK_TIMEOUT 10000;
|
||||
|
||||
SELECT StartDate, EndDate, PracticeIDX, PracticeRank, PresentType1, Code1, Value1, PresentType2, Code2, Value2, PresentType3, Code3, Value3, PresentType4, Code4, Value4, PresentType5, Code5, Value5
|
||||
FROM dbo.userPracticeDB_Ranking AS UPR WITH (READUNCOMMITTED)
|
||||
INNER JOIN dbo.userPracticeDB_Present AS UPP ON UPR.value = UPP.PresentValue
|
||||
WHERE AccountIDX = @ACCOUNT_IDX
|
||||
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
USE [LosaGame]
|
||||
GO
|
||||
|
||||
/****** Object: StoredProcedure [dbo].[game_practice_get_my_list] Script Date: 2017-12-07 오후 6:59:20 ******/
|
||||
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[game_practice_get_my_list]') AND type in (N'P', N'PC'))
|
||||
DROP PROCEDURE [dbo].[game_practice_get_my_list]
|
||||
GO
|
||||
|
||||
USE [LosaGame]
|
||||
GO
|
||||
|
||||
/****** Object: StoredProcedure [dbo].[game_practice_get_my_list] Script Date: 2017-12-07 오후 6:59:20 ******/
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
|
||||
SET QUOTED_IDENTIFIER ON
|
||||
GO
|
||||
|
||||
|
||||
|
||||
--IF OBJECT_ID('dbo.game_practice_get_my_list','P') IS NOT NULL
|
||||
--
|
||||
-- DROP PROC dbo.game_practice_get_my_list
|
||||
--
|
||||
--GO
|
||||
|
||||
-- =============================================
|
||||
-- Subject dbo.game_practice_get_my_list
|
||||
-- DBA
|
||||
-- DATE 2014-03-03
|
||||
-- Description 훈련하기 데이터
|
||||
-- =============================================
|
||||
|
||||
CREATE PROCEDURE [dbo].[game_practice_get_my_list]
|
||||
|
||||
@ACCOUNT_IDX INT
|
||||
|
||||
AS
|
||||
|
||||
SET NOCOUNT ON;
|
||||
SET LOCK_TIMEOUT 10000;
|
||||
|
||||
SELECT practiceIDX, PracticeGrade, PracticeCount, PracticeTime, PracticeRank
|
||||
FROM dbo.userPracticeDB WITH (READUNCOMMITTED)
|
||||
WHERE AccountIDX = @ACCOUNT_IDX
|
||||
|
||||
|
||||
GO
|
||||
|
||||
|
||||
@@ -0,0 +1,110 @@
|
||||
USE [LosaGame]
|
||||
GO
|
||||
|
||||
/****** Object: StoredProcedure [dbo].[game_practice_rank_Reward_Cursor] Script Date: 11/23/2017 12:48:42 ******/
|
||||
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[game_practice_rank_Reward_Cursor]') AND type in (N'P', N'PC'))
|
||||
DROP PROCEDURE [dbo].[game_practice_rank_Reward_Cursor]
|
||||
GO
|
||||
|
||||
USE [LosaGame]
|
||||
GO
|
||||
|
||||
/****** Object: StoredProcedure [dbo].[game_practice_rank_Reward_Cursor] Script Date: 11/23/2017 12:48:42 ******/
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
|
||||
SET QUOTED_IDENTIFIER ON
|
||||
GO
|
||||
|
||||
|
||||
|
||||
--IF OBJECT_ID('dbo.game_practice_rank_Reward_Cursor','P') IS NOT NULL
|
||||
--
|
||||
-- DROP PROC dbo.game_practice_rank_Reward_Cursor
|
||||
--
|
||||
--GO
|
||||
|
||||
-- =============================================
|
||||
-- Subject : dbo.game_practice_rank_Reward_Cursor
|
||||
-- DBA :
|
||||
-- DATE : 2015-06-17
|
||||
-- Description : ÈÆ·Ã µ¥ÀÌÅÍ »ý¼º
|
||||
-- =============================================
|
||||
|
||||
|
||||
CREATE PROCEDURE [dbo].[game_practice_rank_Reward_Cursor]
|
||||
@RankAStart Int, @RankAEnd Int, @RankAType Int, @RankACode Int, @RankAMent Int, @RankAPeriad Int,
|
||||
@RankBStart Int, @RankBEnd Int, @RankBType Int, @RankBCode Int, @RankBMent Int, @RankBPeriad Int,
|
||||
@RankCStart Int, @RankCEnd Int, @RankCType Int, @RankCCode Int, @RankCMent Int, @RankCPeriad Int,
|
||||
@RankDStart Int, @RankDEnd Int, @RankDType Int, @RankDCode Int, @RankDMent Int, @RankDPeriad Int,
|
||||
@RankDID varchar(20)
|
||||
AS
|
||||
BEGIN
|
||||
/*
|
||||
SET @RankAStart Int = 1, @RankAEnd Int = 2, @RankAType Int = 3, @RankACode Int = 1000039, @RankAMent Int = 1128, @RankAPeriad Int = 28
|
||||
SET @RankBStart Int = 3, @RankBEnd Int = 5, @RankBType Int = 3, @RankBCode Int = 1000039, @RankBMent Int = 1128, @RankBPeriad Int = 28
|
||||
SET @RankCStart Int = 6, @RankCEnd Int = 10, @RankCType Int = 3, @RankCCode Int = 1000039, @RankCMent Int = 1128, @RankCPeriad Int = 28
|
||||
SET @RankDStart Int = 11, @RankDEnd Int =999999999, @RankDType Int = 3, @RankDCode Int = 1000039, @RankDMent Int = 1128, @RankDPeriad Int = 28
|
||||
SET @RankDID varchar(20) = 'DeveloperK'
|
||||
*/
|
||||
|
||||
DECLARE @sendIDX int, @receiveIDX int
|
||||
SET @sendIDX = (
|
||||
SELECT accountIDX
|
||||
FROM [LosaGame].dbo.userMemberDB WITH(NOLOCK)
|
||||
WHERE nickName=@RankDID
|
||||
)
|
||||
|
||||
IF (@sendIDX IS NULL)
|
||||
BEGIN
|
||||
SET @sendIDX = (
|
||||
SELECT accountIDX
|
||||
FROM [LosaGame].dbo.userMemberDB WITH(NOLOCK)
|
||||
WHERE nickName='DeveloperK'
|
||||
)
|
||||
END
|
||||
|
||||
DECLARE @AccountIDX INT = 0, @Ranking INT = 0
|
||||
DECLARE RankingRewardCursor CURSOR FAST_FORWARD FOR
|
||||
SELECT [AccountIDX], RANK()over(PARTITION BY PracticeIDX ORDER BY PracticeTime, UpdateDate) AS PracticeRank
|
||||
FROM [LosaGame].[dbo].[userPracticeDB]
|
||||
|
||||
OPEN RankingRewardCursor
|
||||
FETCH NEXT FROM RankingRewardCursor
|
||||
INTO @AccountIDX, @Ranking
|
||||
|
||||
WHILE @@FETCH_STATUS = 0
|
||||
BEGIN
|
||||
|
||||
IF @RankAStart <= @Ranking AND @Ranking <= @RankAEnd
|
||||
BEGIN
|
||||
-- exec game_present_add_idx @sendIDX, @AccountIDX, @RankAType, @RankACode, 1, 0, 0, @RankAMent, GetDate() + @RankAPeriad, 0, 0
|
||||
SELECT 1111, @sendIDX, @AccountIDX, @RankAType, @RankACode, 1, 0, 0, @RankAMent, GetDate() + @RankAPeriad, 0, 0
|
||||
END
|
||||
ELSE IF @RankBStart <= @Ranking AND @Ranking <= @RankBEnd
|
||||
BEGIN
|
||||
-- exec game_present_add_idx @sendIDX, @AccountIDX, @RankBType, @RankBCode, 1, 0, 0, @RankBMent, GetDate() + @RankBPeriad, 0, 0
|
||||
SELECT 2222, @sendIDX, @AccountIDX, @RankBType, @RankBCode, 1, 0, 0, @RankBMent, GetDate() + @RankBPeriad, 0, 0
|
||||
END
|
||||
ELSE IF @RankCStart <= @Ranking AND @Ranking <= @RankCEnd
|
||||
BEGIN
|
||||
-- exec game_present_add_idx @sendIDX, @AccountIDX, @RankCType, @RankCCode, 1, 0, 0, @RankCMent, GetDate() + @RankCPeriad, 0, 0
|
||||
SELECT 3333, @sendIDX, @AccountIDX, @RankCType, @RankCCode, 1, 0, 0, @RankCMent, GetDate() + @RankCPeriad, 0, 0
|
||||
END
|
||||
ELSE IF @RankDStart <= @Ranking AND @Ranking <= @RankDEnd
|
||||
BEGIN
|
||||
-- exec game_present_add_idx @sendIDX, @AccountIDX, @RankDType, @RankDCode, 1, 0, 0, @RankDMent, GetDate() + @RankDPeriad, 0, 0
|
||||
SELECT 4444, @sendIDX, @AccountIDX, @RankDType, @RankDCode, 1, 0, 0, @RankDMent, GetDate() + @RankDPeriad, 0, 0
|
||||
END
|
||||
FETCH NEXT FROM RankingRewardCursor INTO @AccountIDX, @Ranking
|
||||
END
|
||||
CLOSE RankingRewardCursor
|
||||
DEALLOCATE RankingRewardCursor
|
||||
GO
|
||||
|
||||
--if OBJECT_ID('userPracticeDB_Backup') is not null
|
||||
--DROP TABLE [LosaGame].[dbo].[userPracticeDB_Backup]
|
||||
--SELECT * INTO [LosaGame].[dbo].[userPracticeDB_Backup]
|
||||
--FROM [LosaGame].[dbo].[userPracticeDB]
|
||||
--TRUNCATE TABLE [LosaGame].[dbo].[userPracticeDB]
|
||||
END
|
||||
@@ -0,0 +1,197 @@
|
||||
USE [LosaGame]
|
||||
GO
|
||||
|
||||
/****** Object: StoredProcedure [dbo].[game_practice_rank_reward] Script Date: 11/08/2017 10:09:35 ******/
|
||||
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[game_practice_rank_reward]') AND type in (N'P', N'PC'))
|
||||
DROP PROCEDURE [dbo].[game_practice_rank_reward]
|
||||
GO
|
||||
|
||||
USE [LosaGame]
|
||||
GO
|
||||
|
||||
/****** Object: StoredProcedure [dbo].[game_practice_rank_reward] Script Date: 11/08/2017 10:09:35 ******/
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
|
||||
SET QUOTED_IDENTIFIER ON
|
||||
GO
|
||||
|
||||
|
||||
--IF OBJECT_ID('dbo.game_practice_rank_reward','P') IS NOT NULL
|
||||
--
|
||||
-- DROP PROC dbo.game_practice_rank_reward
|
||||
--
|
||||
--GO
|
||||
|
||||
-- =============================================
|
||||
-- Subject : dbo.game_practice_rank_reward
|
||||
-- DBA :
|
||||
-- DATE : 2015-06-17
|
||||
-- Description : 훈련 데이터 생성
|
||||
-- =============================================
|
||||
|
||||
|
||||
CREATE PROCEDURE [dbo].[game_practice_rank_reward]
|
||||
@RankAStart Int, @RankAEnd Int, @RankAMent Int, @RankAPeriad Int,
|
||||
@RankAType01 Int, @RankACode01 Int, @RankACount01 Int,
|
||||
@RankAType02 Int, @RankACode02 Int, @RankACount02 Int,
|
||||
@RankAType03 Int, @RankACode03 Int, @RankACount03 Int,
|
||||
@RankAType04 Int, @RankACode04 Int, @RankACount04 Int,
|
||||
@RankAType05 Int, @RankACode05 Int, @RankACount05 Int,
|
||||
@RankBStart Int, @RankBEnd Int, @RankBMent Int, @RankBPeriad Int,
|
||||
@RankBType01 Int, @RankBCode01 Int, @RankBCount01 Int,
|
||||
@RankBType02 Int, @RankBCode02 Int, @RankBCount02 Int,
|
||||
@RankBType03 Int, @RankBCode03 Int, @RankBCount03 Int,
|
||||
@RankBType04 Int, @RankBCode04 Int, @RankBCount04 Int,
|
||||
@RankBType05 Int, @RankBCode05 Int, @RankBCount05 Int,
|
||||
@RankCStart Int, @RankCEnd Int, @RankCMent Int, @RankCPeriad Int,
|
||||
@RankCType01 Int, @RankCCode01 Int, @RankCCount01 Int,
|
||||
@RankCType02 Int, @RankCCode02 Int, @RankCCount02 Int,
|
||||
@RankCType03 Int, @RankCCode03 Int, @RankCCount03 Int,
|
||||
@RankCType04 Int, @RankCCode04 Int, @RankCCount04 Int,
|
||||
@RankCType05 Int, @RankCCode05 Int, @RankCCount05 Int,
|
||||
@RankDStart Int, @RankDEnd Int, @RankDMent Int, @RankDPeriad Int,
|
||||
@RankDType01 Int, @RankDCode01 Int, @RankDCount01 Int,
|
||||
@RankDType02 Int, @RankDCode02 Int, @RankDCount02 Int,
|
||||
@RankDType03 Int, @RankDCode03 Int, @RankDCount03 Int,
|
||||
@RankDType04 Int, @RankDCode04 Int, @RankDCount04 Int,
|
||||
@RankDType05 Int, @RankDCode05 Int, @RankDCount05 Int,
|
||||
@RankDID varchar(20)
|
||||
AS
|
||||
BEGIN
|
||||
|
||||
DECLARE @sendIDX int, @receiveIDX int
|
||||
SET @sendIDX = (
|
||||
SELECT accountIDX
|
||||
FROM [LosaGame].dbo.userMemberDB WITH(NOLOCK)
|
||||
WHERE nickName=@RankDID
|
||||
)
|
||||
|
||||
IF (@sendIDX IS NULL)
|
||||
BEGIN
|
||||
SET @sendIDX = (
|
||||
SELECT accountIDX
|
||||
FROM [LosaGame].dbo.userMemberDB WITH(NOLOCK)
|
||||
WHERE nickName='DeveloperK'
|
||||
)
|
||||
END
|
||||
|
||||
|
||||
BEGIN TRAN
|
||||
|
||||
TRUNCATE TABLE [LosaGame].[dbo].[userPracticeDB_Ranking]
|
||||
TRUNCATE TABLE [LosaGame].[dbo].[userPracticeDB_Present]
|
||||
|
||||
Declare @CurrentDate DateTime
|
||||
declare @StartDate NVARCHAR(10), @EndDate NVARCHAR(10), @TableDate NVARCHAR(10)
|
||||
SET @CurrentDate = GetDate()
|
||||
SET @StartDate = CONVERT(NVARCHAR(10), @CurrentDate - 7, 23)
|
||||
SET @EndDate = CONVERT(NVARCHAR(10), @CurrentDate, 23)
|
||||
SET @TableDate = CONVERT(NVARCHAR(10), @CurrentDate , 112)
|
||||
|
||||
INSERT INTO [LosaGame].[dbo].[userPracticeDB_Present]
|
||||
(
|
||||
PresentValue, PresentType1, Code1 , Value1, PresentType2, Code2 , Value2, PresentType3, Code3 , Value3, PresentType4, Code4 , Value4, PresentType5, Code5 , Value5
|
||||
)
|
||||
VALUES
|
||||
( 1, @RankAType01, @RankACode01, @RankACount01, @RankAType02, @RankACode02, @RankACount02, @RankAType03, @RankACode03, @RankACount03, @RankAType04, @RankACode04, @RankACount04, @RankAType05, @RankACode05, @RankACount05 ),
|
||||
( 2, @RankBType01, @RankBCode01, @RankBCount01, @RankBType02, @RankBCode02, @RankBCount02, @RankBType03, @RankBCode03, @RankBCount03, @RankBType04, @RankBCode04, @RankBCount04, @RankBType05, @RankBCode05, @RankBCount05 ),
|
||||
( 3, @RankCType01, @RankCCode01, @RankCCount01, @RankCType02, @RankCCode02, @RankCCount02, @RankCType03, @RankCCode03, @RankCCount03, @RankCType04, @RankCCode04, @RankCCount04, @RankCType05, @RankCCode05, @RankCCount05 ),
|
||||
( 4, @RankDType01, @RankDCode01, @RankDCount01, @RankDType02, @RankDCode02, @RankDCount02, @RankDType03, @RankDCode03, @RankDCount03, @RankDType04, @RankDCode04, @RankDCount04, @RankDType05, @RankDCode05, @RankDCount05 )
|
||||
|
||||
|
||||
INSERT INTO [LosaGame].[dbo].[userPracticeDB_Ranking]
|
||||
(
|
||||
StartDate, EndDate, AccountIDX, PracticeIDX, PracticeRank, sendIDX, value, msgType, limitDate
|
||||
)
|
||||
SELECT @StartDate, @EndDate, AccountIDX as AccountIDX, PracticeIDX AS PracticeIDX, PracticeRank AS PracticeRank, @sendIDX AS sendIDX
|
||||
, CASE WHEN @RankAStart <= PracticeRank AND PracticeRank <= @RankAEnd THEN 1
|
||||
WHEN @RankBStart <= PracticeRank AND PracticeRank <= @RankBEnd THEN 2
|
||||
WHEN @RankCStart <= PracticeRank AND PracticeRank <= @RankCEnd THEN 3
|
||||
WHEN @RankDStart <= PracticeRank AND PracticeRank <= @RankDEnd THEN 4
|
||||
ELSE 0
|
||||
END AS presentType
|
||||
, CASE WHEN @RankAStart <= PracticeRank AND PracticeRank <= @RankAEnd THEN @RankAMent
|
||||
WHEN @RankBStart <= PracticeRank AND PracticeRank <= @RankBEnd THEN @RankBMent
|
||||
WHEN @RankCStart <= PracticeRank AND PracticeRank <= @RankCEnd THEN @RankCMent
|
||||
WHEN @RankDStart <= PracticeRank AND PracticeRank <= @RankDEnd THEN @RankDMent
|
||||
END AS msgType
|
||||
, CASE WHEN @RankAStart <= PracticeRank AND PracticeRank <= @RankAEnd THEN GETDATE() + @RankAPeriad
|
||||
WHEN @RankBStart <= PracticeRank AND PracticeRank <= @RankBEnd THEN GETDATE() + @RankBPeriad
|
||||
WHEN @RankCStart <= PracticeRank AND PracticeRank <= @RankCEnd THEN GETDATE() + @RankCPeriad
|
||||
WHEN @RankDStart <= PracticeRank AND PracticeRank <= @RankDEnd THEN GETDATE() + @RankDPeriad
|
||||
END AS limitDate
|
||||
FROM
|
||||
(
|
||||
SELECT [AccountIDX], RANK()over(PARTITION BY PracticeIDX ORDER BY PracticeTime, UpdateDate) AS PracticeRank, PracticeIDX, PracticeTime
|
||||
FROM [LosaGame].[dbo].[userPracticeDB]
|
||||
WHERE AccountIDX NOT IN (SELECT AccountIDX FROM [LosaGame].[dbo].[userMemberDB] WHERE limitType = 100 AND limitDate > Getdate())
|
||||
AND AccountIDX IN (SELECT AccountIDX FROM [LosaGame].[dbo].[userMemberDB])
|
||||
) PracticeDB
|
||||
IF (@@ROWCOUNT = 0) OR (@@ERROR <> 0)
|
||||
BEGIN
|
||||
ROLLBACK TRAN
|
||||
RETURN;
|
||||
END
|
||||
|
||||
INSERT INTO dbo.userPresentDB
|
||||
(
|
||||
sendIDX, receiveIDX, presentType, value1, value2, value3, value4, msgType, flag, limitDate, regDate
|
||||
)
|
||||
SELECT sendIDX, AccountIDX, PresentType1, Code1, Value1, 0, 0, msgType, 0, limitDate, @CurrentDate FROM [LosaGame].[dbo].[userPracticeDB_Ranking] AS UPR
|
||||
INNER JOIN [LosaGame].[dbo].[userPracticeDB_Present] AS UPP ON UPR.value = UPP.PresentValue
|
||||
WHERE Code1 > 0
|
||||
|
||||
INSERT INTO dbo.userPresentDB
|
||||
(
|
||||
sendIDX, receiveIDX, presentType, value1, value2, value3, value4, msgType, flag, limitDate, regDate
|
||||
)
|
||||
SELECT sendIDX, AccountIDX, PresentType2, Code2, Value2, 0, 0, msgType, 0, limitDate, @CurrentDate FROM [LosaGame].[dbo].[userPracticeDB_Ranking] AS UPR
|
||||
INNER JOIN [LosaGame].[dbo].[userPracticeDB_Present] AS UPP ON UPR.value = UPP.PresentValue
|
||||
WHERE Code2 > 0
|
||||
|
||||
INSERT INTO dbo.userPresentDB
|
||||
(
|
||||
sendIDX, receiveIDX, presentType, value1, value2, value3, value4, msgType, flag, limitDate, regDate
|
||||
)
|
||||
SELECT sendIDX, AccountIDX, PresentType3, Code3, Value3, 0, 0, msgType, 0, limitDate, @CurrentDate FROM [LosaGame].[dbo].[userPracticeDB_Ranking] AS UPR
|
||||
INNER JOIN [LosaGame].[dbo].[userPracticeDB_Present] AS UPP ON UPR.value = UPP.PresentValue
|
||||
WHERE Code3 > 0
|
||||
|
||||
INSERT INTO dbo.userPresentDB
|
||||
(
|
||||
sendIDX, receiveIDX, presentType, value1, value2, value3, value4, msgType, flag, limitDate, regDate
|
||||
)
|
||||
SELECT sendIDX, AccountIDX, PresentType4, Code4, Value4, 0, 0, msgType, 0, limitDate, @CurrentDate FROM [LosaGame].[dbo].[userPracticeDB_Ranking] AS UPR
|
||||
INNER JOIN [LosaGame].[dbo].[userPracticeDB_Present] AS UPP ON UPR.value = UPP.PresentValue
|
||||
WHERE Code4 > 0
|
||||
|
||||
INSERT INTO dbo.userPresentDB
|
||||
(
|
||||
sendIDX, receiveIDX, presentType, value1, value2, value3, value4, msgType, flag, limitDate, regDate
|
||||
)
|
||||
SELECT sendIDX, AccountIDX, PresentType5, Code5, Value5, 0, 0, msgType, 0, limitDate, @CurrentDate FROM [LosaGame].[dbo].[userPracticeDB_Ranking] AS UPR
|
||||
INNER JOIN [LosaGame].[dbo].[userPracticeDB_Present] AS UPP ON UPR.value = UPP.PresentValue
|
||||
WHERE Code5 > 0
|
||||
|
||||
UPDATE dbo.userGameDB SET practice = 1
|
||||
|
||||
--------------------------------------------------------------------
|
||||
-- 0. 프로시져 시작 할때 userGameDB 백업 하자.
|
||||
--------------------------------------------------------------------
|
||||
DECLARE @tblName varchar(256), @sql varchar(256)
|
||||
SET @tblName = '[Backup].dbo.LosaGame_' + @TableDate + '_userPracticeDB_Ranking'
|
||||
SET @sql = 'SELECT * INTO ' + @tblName + ' FROM [LosaGame].[dbo].[userPracticeDB_Ranking] AS UPR
|
||||
INNER JOIN [LosaGame].[dbo].[userPracticeDB_Present] AS UPP ON UPR.value = UPP.PresentValue'
|
||||
execute (@sql)
|
||||
|
||||
DECLARE @tblName1 varchar(256), @sqlo varchar(256)
|
||||
SET @tblName1 = '[Backup].dbo.LosaGame_' + @TableDate + '_userPracticeDB'
|
||||
SET @sqlo = 'SELECT * INTO ' + @tblName1 + ' FROM [LosaGame].[dbo].[userPracticeDB]'
|
||||
execute (@sqlo)
|
||||
|
||||
TRUNCATE TABLE [LosaGame].[dbo].[userPracticeDB]
|
||||
|
||||
COMMIT TRAN
|
||||
|
||||
END
|
||||
@@ -0,0 +1,80 @@
|
||||
USE [LosaGame]
|
||||
GO
|
||||
|
||||
/****** Object: StoredProcedure [dbo].[game_practice_set_data] Script Date: 11/08/2017 10:09:35 ******/
|
||||
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[game_practice_set_data]') AND type in (N'P', N'PC'))
|
||||
DROP PROCEDURE [dbo].[game_practice_set_data]
|
||||
GO
|
||||
|
||||
USE [LosaGame]
|
||||
GO
|
||||
|
||||
/****** Object: StoredProcedure [dbo].[game_practice_set_data] Script Date: 11/08/2017 10:09:35 ******/
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
|
||||
SET QUOTED_IDENTIFIER ON
|
||||
GO
|
||||
|
||||
|
||||
--IF OBJECT_ID('dbo.game_practice_set_data','P') IS NOT NULL
|
||||
--
|
||||
-- DROP PROC dbo.game_practice_set_data
|
||||
--
|
||||
--GO
|
||||
|
||||
-- =============================================
|
||||
-- Subject : dbo.game_practice_set_data
|
||||
-- DBA :
|
||||
-- DATE : 2015-06-17
|
||||
-- Description : 훈련 데이터 생성
|
||||
-- =============================================
|
||||
|
||||
|
||||
CREATE PROCEDURE [dbo].[game_practice_set_data]
|
||||
|
||||
|
||||
@ACCOUNT_IDX INT, -- 유저 인덱스
|
||||
@PRACTICE_IDX INT, -- 연습 인덱스
|
||||
@PRACTICE_GRADE INT, -- 수련장 등급
|
||||
@PRACTICE_COUNT INT, -- 수련장 입장횟수
|
||||
@PRACTICE_TIME INT, -- 수련장 시간
|
||||
@PRACTICE_RANK INT -- 수련장 랭크
|
||||
|
||||
AS
|
||||
|
||||
SET NOCOUNT ON;
|
||||
SET LOCK_TIMEOUT 10000;
|
||||
|
||||
DECLARE @nReturn INT
|
||||
SET @nReturn=0 -- True
|
||||
|
||||
BEGIN TRAN
|
||||
|
||||
IF (EXISTS(SELECT * FROM dbo.userPracticeDB WITH (NOLOCK) WHERE AccountIDX = @ACCOUNT_IDX AND PracticeIDX = @PRACTICE_IDX))
|
||||
BEGIN
|
||||
UPDATE dbo.userPracticeDB
|
||||
SET PracticeGrade = @PRACTICE_GRADE, PracticeCount=@PRACTICE_COUNT
|
||||
, PracticeTime=@PRACTICE_TIME, PracticeRank=@PRACTICE_RANK
|
||||
WHERE AccountIDX = @ACCOUNT_IDX
|
||||
AND PracticeIDX = @PRACTICE_IDX;
|
||||
END
|
||||
ELSE
|
||||
BEGIN
|
||||
INSERT INTO dbo.userPracticeDB (AccountIDX, PracticeIDX, PracticeCount, PracticeGrade, PracticeTime, PracticeRank, UpdateDate, regDate)
|
||||
VALUES ( @ACCOUNT_IDX, @PRACTICE_IDX, @PRACTICE_COUNT, @PRACTICE_GRADE, @PRACTICE_TIME, @PRACTICE_RANK, GETDATE(), GETDATE());
|
||||
END
|
||||
|
||||
|
||||
IF (@@ROWCOUNT = 0) or (@@ERROR <> 0)
|
||||
BEGIN
|
||||
ROLLBACK TRAN
|
||||
SELECT -1;
|
||||
RETURN;
|
||||
END
|
||||
|
||||
COMMIT TRAN
|
||||
|
||||
SELECT @nReturn;
|
||||
RETURN;
|
||||
|
||||
@@ -0,0 +1,85 @@
|
||||
USE [LosaGame]
|
||||
GO
|
||||
|
||||
/****** Object: StoredProcedure [dbo].[game_practice_set_Time] Script Date: 11/08/2017 10:09:35 ******/
|
||||
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[game_practice_set_Time]') AND type in (N'P', N'PC'))
|
||||
DROP PROCEDURE [dbo].[game_practice_set_Time]
|
||||
GO
|
||||
|
||||
USE [LosaGame]
|
||||
GO
|
||||
|
||||
/****** Object: StoredProcedure [dbo].[game_practice_set_Time] Script Date: 11/08/2017 10:09:35 ******/
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
|
||||
SET QUOTED_IDENTIFIER ON
|
||||
GO
|
||||
|
||||
|
||||
--IF OBJECT_ID('dbo.game_practice_set_Time','P') IS NOT NULL
|
||||
--
|
||||
-- DROP PROC dbo.game_practice_set_Time
|
||||
--
|
||||
--GO
|
||||
|
||||
-- =============================================
|
||||
-- Subject : dbo.game_practice_set_Time
|
||||
-- DBA :
|
||||
-- DATE : 2015-06-17
|
||||
-- Description : 훈련 데이터 생성
|
||||
-- =============================================
|
||||
|
||||
|
||||
CREATE PROCEDURE [dbo].[game_practice_set_Time]
|
||||
|
||||
|
||||
@ACCOUNT_IDX INT, -- 유저 인덱스
|
||||
@PRACTICE_IDX INT, -- 연습 인덱스
|
||||
@PRACTICE_GRADE INT, -- 수련장 등급
|
||||
@PRACTICE_COUNT INT, -- 수련장 입장횟수
|
||||
@PRACTICE_TIME INT, -- 수련장 시간
|
||||
@PRACTICE_RANK INT -- 수련장 랭크
|
||||
|
||||
AS
|
||||
|
||||
SET NOCOUNT ON;
|
||||
SET LOCK_TIMEOUT 10000;
|
||||
|
||||
DECLARE @nReturn INT
|
||||
SET @nReturn=0 -- True
|
||||
|
||||
BEGIN TRAN
|
||||
|
||||
IF (EXISTS(SELECT * FROM dbo.userPracticeDB WITH (NOLOCK) WHERE AccountIDX = @ACCOUNT_IDX AND PracticeIDX = @PRACTICE_IDX))
|
||||
BEGIN
|
||||
UPDATE dbo.userPracticeDB
|
||||
SET PracticeGrade = @PRACTICE_GRADE, PracticeCount=@PRACTICE_COUNT
|
||||
, PracticeTime=@PRACTICE_TIME, PracticeRank=@PRACTICE_RANK
|
||||
, UpdateDate = GETDATE()
|
||||
WHERE AccountIDX = @ACCOUNT_IDX
|
||||
AND PracticeIDX = @PRACTICE_IDX;
|
||||
END
|
||||
ELSE
|
||||
BEGIN
|
||||
INSERT INTO dbo.userPracticeDB (AccountIDX, PracticeIDX, PracticeCount, PracticeGrade, PracticeTime, PracticeRank, UpdateDate, regDate)
|
||||
VALUES ( @ACCOUNT_IDX, @PRACTICE_IDX, @PRACTICE_COUNT, @PRACTICE_GRADE, @PRACTICE_TIME, @PRACTICE_RANK, GETDATE(), GETDATE());
|
||||
END
|
||||
|
||||
|
||||
IF (@@ROWCOUNT = 0) or (@@ERROR <> 0)
|
||||
BEGIN
|
||||
ROLLBACK TRAN
|
||||
SELECT -1;
|
||||
RETURN;
|
||||
END
|
||||
|
||||
COMMIT TRAN
|
||||
|
||||
SELECT @nReturn;
|
||||
RETURN;
|
||||
|
||||
|
||||
GO
|
||||
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
ALTER TABLE [LosaGame].[dbo].[userGameDB] ADD Practice SMALLINT NOT NULL CONSTRAINT DF_Practice DEFAULT 1;
|
||||
@@ -0,0 +1,54 @@
|
||||
USE [LosaGame]
|
||||
GO
|
||||
|
||||
/****** Object: Table [dbo].[userPracticeDB] Script Date: 2017-11-13 ¿ÀÀü 10:16:55 ******/
|
||||
DROP TABLE [dbo].[userPracticeDB]
|
||||
GO
|
||||
|
||||
/****** Object: Table [dbo].[userPracticeDB] Script Date: 2017-11-13 ¿ÀÀü 10:16:55 ******/
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
|
||||
SET QUOTED_IDENTIFIER ON
|
||||
GO
|
||||
|
||||
CREATE TABLE [dbo].[userPracticeDB](
|
||||
[AccountIDX] [int] NOT NULL,
|
||||
[PracticeIDX] [int] NOT NULL,
|
||||
[PracticeCount] [int] NOT NULL,
|
||||
[PracticeGrade] [int] NOT NULL,
|
||||
[PracticeTime] [int] NOT NULL,
|
||||
[PracticeRank] [int] NOT NULL,
|
||||
[UpdateDate][datetime] NOT NULL,
|
||||
[regDate] [datetime] NOT NULL,
|
||||
CONSTRAINT [PK_userPracticeDB] PRIMARY KEY CLUSTERED
|
||||
(
|
||||
[AccountIDX] ASC,
|
||||
[PracticeIDX] ASC
|
||||
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
|
||||
) ON [PRIMARY]
|
||||
|
||||
GO
|
||||
|
||||
ALTER TABLE [dbo].[userPracticeDB] ADD CONSTRAINT [DF__userPract__Pract__4AE30379] DEFAULT ((0)) FOR [PracticeIDX]
|
||||
GO
|
||||
|
||||
ALTER TABLE [dbo].[userPracticeDB] ADD CONSTRAINT [DF__userPract__Grade__4BD727B2] DEFAULT ((0)) FOR [PracticeGrade]
|
||||
GO
|
||||
|
||||
ALTER TABLE [dbo].[userPracticeDB] ADD CONSTRAINT [DF__userPract__Count__4BD727B2] DEFAULT ((0)) FOR [PracticeCount]
|
||||
GO
|
||||
|
||||
ALTER TABLE [dbo].[userPracticeDB] ADD CONSTRAINT [DF__userPract__time__4BD727B2] DEFAULT ((999999999)) FOR [PracticeTime]
|
||||
GO
|
||||
|
||||
ALTER TABLE [dbo].[userPracticeDB] ADD CONSTRAINT [DF__userPract__Rank__4BD727B2] DEFAULT ((99999999)) FOR [PracticeRank]
|
||||
GO
|
||||
|
||||
ALTER TABLE [dbo].[userPracticeDB] ADD CONSTRAINT [DF__userPract__UpdateDate__4DBF7024] DEFAULT (getdate()) FOR [UpdateDate]
|
||||
GO
|
||||
|
||||
ALTER TABLE [dbo].[userPracticeDB] ADD CONSTRAINT [DF__userPract__regDa__4DBF7024] DEFAULT (getdate()) FOR [regDate]
|
||||
GO
|
||||
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
USE [LosaGame]
|
||||
GO
|
||||
|
||||
/****** Object: Table [dbo].[userPracticeDB_Present] Script Date: 2017-12-19 ¿ÀÀü 10:16:23 ******/
|
||||
DROP TABLE [dbo].[userPracticeDB_Present]
|
||||
GO
|
||||
|
||||
/****** Object: Table [dbo].[userPracticeDB_Present] Script Date: 2017-12-19 ¿ÀÀü 10:16:23 ******/
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
|
||||
SET QUOTED_IDENTIFIER ON
|
||||
GO
|
||||
|
||||
CREATE TABLE [dbo].[userPracticeDB_Present]
|
||||
(
|
||||
[PresentValue] [int] NOT NULL,
|
||||
[PresentType1] [int] NOT NULL,
|
||||
[Code1] [int] NOT NULL,
|
||||
[Value1] [int] NOT NULL,
|
||||
[PresentType2] [int] NOT NULL,
|
||||
[Code2] [int] NOT NULL,
|
||||
[Value2] [int] NOT NULL,
|
||||
[PresentType3] [int] NOT NULL,
|
||||
[Code3] [int] NOT NULL,
|
||||
[Value3] [int] NOT NULL,
|
||||
[PresentType4] [int] NOT NULL,
|
||||
[Code4] [int] NOT NULL,
|
||||
[Value4] [int] NOT NULL,
|
||||
[PresentType5] [int] NOT NULL,
|
||||
[Code5] [int] NOT NULL,
|
||||
[Value5] [int] NOT NULL,
|
||||
CONSTRAINT [PK_userPracticeDB_Present] PRIMARY KEY CLUSTERED
|
||||
(
|
||||
[PresentValue] ASC
|
||||
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
|
||||
) ON [PRIMARY]
|
||||
|
||||
GO
|
||||
@@ -0,0 +1,36 @@
|
||||
USE [LosaGame]
|
||||
GO
|
||||
|
||||
/****** Object: Table [dbo].[userPracticeDB_Ranking] Script Date: 2017-12-19 ¿ÀÀü 10:16:23 ******/
|
||||
DROP TABLE [dbo].[userPracticeDB_Ranking]
|
||||
GO
|
||||
|
||||
/****** Object: Table [dbo].[userPracticeDB_Ranking] Script Date: 2017-12-19 ¿ÀÀü 10:16:23 ******/
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
|
||||
SET QUOTED_IDENTIFIER ON
|
||||
GO
|
||||
|
||||
CREATE TABLE [dbo].[userPracticeDB_Ranking]
|
||||
(
|
||||
[StartDate] [NVARCHAR](10) NOT NULL,
|
||||
[EndDate] [NVARCHAR](10) NOT NULL,
|
||||
[AccountIDX] [int] NOT NULL,
|
||||
[PracticeIDX] [int] NOT NULL CONSTRAINT [DF__userPractRanking__Pract__4AE30379] DEFAULT ((0)),
|
||||
[PracticeRank] [int] NOT NULL CONSTRAINT [DF__userPractRanking__Rank__4BD727B2] DEFAULT ((999999999)),
|
||||
[sendIDX] [int] NOT NULL,
|
||||
[value] [int] NOT NULL,
|
||||
[msgType] [int] NULL,
|
||||
[limitDate] [datetime] NULL,
|
||||
) ON [PRIMARY]
|
||||
|
||||
GO
|
||||
|
||||
|
||||
/****** Object: Index [NCI_T_World_Enthrone_WorldID] Script Date: 2017-06-16 ¿ÀÈÄ 3:55:17 ******/
|
||||
CREATE NONCLUSTERED INDEX [NCI_userPracticeDB_Ranking] ON [dbo].[userPracticeDB_Ranking]
|
||||
(
|
||||
[AccountIDX] ASC,
|
||||
[PracticeIDX] ASC
|
||||
)
|
||||
@@ -0,0 +1,69 @@
|
||||
USE [msdb]
|
||||
GO
|
||||
|
||||
/****** Object: Job [05:00_game_pcbang_playtime] Script Date: 01/20/2018 11:54:28 ******/
|
||||
BEGIN TRANSACTION
|
||||
DECLARE @ReturnCode INT
|
||||
SELECT @ReturnCode = 0
|
||||
/****** Object: JobCategory [[Uncategorized (Local)]]] Script Date: 01/20/2018 11:54:28 ******/
|
||||
IF NOT EXISTS (SELECT name FROM msdb.dbo.syscategories WHERE name=N'[Uncategorized (Local)]' AND category_class=1)
|
||||
BEGIN
|
||||
EXEC @ReturnCode = msdb.dbo.sp_add_category @class=N'JOB', @type=N'LOCAL', @name=N'[Uncategorized (Local)]'
|
||||
IF (@@ERROR <> 0 OR @ReturnCode <> 0) GOTO QuitWithRollback
|
||||
|
||||
END
|
||||
|
||||
DECLARE @jobId BINARY(16)
|
||||
EXEC @ReturnCode = msdb.dbo.sp_add_job @job_name=N'05:00_game_pcbang_playtime',
|
||||
@enabled=1,
|
||||
@notify_level_eventlog=0,
|
||||
@notify_level_email=0,
|
||||
@notify_level_netsend=0,
|
||||
@notify_level_page=0,
|
||||
@delete_level=0,
|
||||
@description=N'하루전 PC방 플레이시간과 참여유저수에 따른 보너스 캐쉬 지급',
|
||||
@category_name=N'[Uncategorized (Local)]',
|
||||
@owner_login_name=N'lstggame', @job_id = @jobId OUTPUT
|
||||
IF (@@ERROR <> 0 OR @ReturnCode <> 0) GOTO QuitWithRollback
|
||||
/****** Object: Step [하루전 PC방플레이 캐쉬지급] Script Date: 01/20/2018 11:54:28 ******/
|
||||
EXEC @ReturnCode = msdb.dbo.sp_add_jobstep @job_id=@jobId, @step_name=N'하루전 PC방플레이 캐쉬지급',
|
||||
@step_id=1,
|
||||
@cmdexec_success_code=0,
|
||||
@on_success_action=1,
|
||||
@on_success_step_id=0,
|
||||
@on_fail_action=2,
|
||||
@on_fail_step_id=0,
|
||||
@retry_attempts=0,
|
||||
@retry_interval=0,
|
||||
@os_run_priority=0, @subsystem=N'TSQL',
|
||||
@command=N'EXEC game_PCBangPlayTime_Reward',
|
||||
@database_name=N'LosaGame',
|
||||
@flags=4
|
||||
IF (@@ERROR <> 0 OR @ReturnCode <> 0) GOTO QuitWithRollback
|
||||
EXEC @ReturnCode = msdb.dbo.sp_update_job @job_id = @jobId, @start_step_id = 1
|
||||
IF (@@ERROR <> 0 OR @ReturnCode <> 0) GOTO QuitWithRollback
|
||||
EXEC @ReturnCode = msdb.dbo.sp_add_jobschedule @job_id=@jobId, @name=N'PC방 플레이실행',
|
||||
@enabled=1,
|
||||
@freq_type=4,
|
||||
@freq_interval=1,
|
||||
@freq_subday_type=1,
|
||||
@freq_subday_interval=0,
|
||||
@freq_relative_interval=0,
|
||||
@freq_recurrence_factor=0,
|
||||
@active_start_date=20180124,
|
||||
@active_end_date=99991231,
|
||||
@active_start_time=50000,
|
||||
@active_end_time=235959,
|
||||
@schedule_uid=N'53272898-f46a-4e97-8cfe-c19ffa90cec6'
|
||||
IF (@@ERROR <> 0 OR @ReturnCode <> 0) GOTO QuitWithRollback
|
||||
EXEC @ReturnCode = msdb.dbo.sp_add_jobserver @job_id = @jobId, @server_name = N'(local)'
|
||||
IF (@@ERROR <> 0 OR @ReturnCode <> 0) GOTO QuitWithRollback
|
||||
COMMIT TRANSACTION
|
||||
GOTO EndSave
|
||||
QuitWithRollback:
|
||||
IF (@@TRANCOUNT > 0) ROLLBACK TRANSACTION
|
||||
EndSave:
|
||||
|
||||
GO
|
||||
|
||||
|
||||
@@ -0,0 +1,76 @@
|
||||
USE [LosaGame]
|
||||
GO
|
||||
|
||||
/****** Object: StoredProcedure [dbo].[game_PCBangPlayTime_ADD] Script Date: 11/08/2017 10:09:35 ******/
|
||||
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[game_PCBangPlayTime_ADD]') AND type in (N'P', N'PC'))
|
||||
DROP PROCEDURE [dbo].[game_PCBangPlayTime_ADD]
|
||||
GO
|
||||
|
||||
USE [LosaGame]
|
||||
GO
|
||||
|
||||
/****** Object: StoredProcedure [dbo].[game_PCBangPlayTime_ADD] Script Date: 11/08/2017 10:09:35 ******/
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
|
||||
SET QUOTED_IDENTIFIER ON
|
||||
GO
|
||||
|
||||
|
||||
--IF OBJECT_ID('dbo.game_PCBangPlayTime_ADD','P') IS NOT NULL
|
||||
--
|
||||
-- DROP PROC dbo.game_PCBangPlayTime_ADD
|
||||
--
|
||||
--GO
|
||||
|
||||
-- =============================================
|
||||
-- Subject : dbo.game_PCBangPlayTime_ADD
|
||||
-- DBA :
|
||||
-- DATE : 2015-06-17
|
||||
-- Description : PCBang 플레이 타임
|
||||
-- =============================================
|
||||
|
||||
|
||||
CREATE PROCEDURE [dbo].[game_PCBangPlayTime_ADD]
|
||||
@ACCOUNT_IDX INT, -- 유저 인덱스
|
||||
@PCBangIndex INT -- PC방 인덱스
|
||||
AS
|
||||
SET NOCOUNT ON;
|
||||
SET LOCK_TIMEOUT 10000;
|
||||
|
||||
DECLARE @nReturn INT
|
||||
SET @nReturn=0 -- True
|
||||
|
||||
declare @CurrentDate NVARCHAR(10)
|
||||
SET @CurrentDate = CONVERT(NVARCHAR(10), GetDate(), 112)
|
||||
|
||||
BEGIN TRAN
|
||||
|
||||
IF (EXISTS(SELECT * FROM dbo.userPCBangPlayTimeDB WITH (NOLOCK) WHERE AccountIDX = @ACCOUNT_IDX ANd PCBangDate = @CurrentDate))
|
||||
BEGIN
|
||||
IF (EXISTS(SELECT * FROM dbo.userPCBangPlayTimeDB WITH (NOLOCK) WHERE AccountIDX = @ACCOUNT_IDX AND PCBangIndex = @PCBangIndex ANd PCBangDate = @CurrentDate))
|
||||
BEGIN
|
||||
UPDATE dbo.userPCBangPlayTimeDB
|
||||
SET PCBangPlayTime = PCBangPlayTime + 1
|
||||
WHERE AccountIDX = @ACCOUNT_IDX AND PCBangIndex = @PCBangIndex ANd PCBangDate = @CurrentDate
|
||||
END
|
||||
END
|
||||
ELSE
|
||||
BEGIN
|
||||
INSERT INTO dbo.userPCBangPlayTimeDB (AccountIDX, PCBangIndex, PCBangDate, PCBangPlayTime)
|
||||
VALUES ( @ACCOUNT_IDX, @PCBangIndex, @CurrentDate, 1);
|
||||
END
|
||||
|
||||
IF (@@ROWCOUNT = 0) or (@@ERROR <> 0)
|
||||
BEGIN
|
||||
SELECT -1;
|
||||
ROLLBACK TRAN
|
||||
RETURN;
|
||||
END
|
||||
|
||||
COMMIT TRAN
|
||||
|
||||
SELECT 1;
|
||||
RETURN;
|
||||
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
USE [LosaGame]
|
||||
GO
|
||||
|
||||
/****** Object: StoredProcedure [dbo].[game_PCBangPlayTime_My_RewardList] Script Date: 01/18/2018 12:57:10 ******/
|
||||
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[game_PCBangPlayTime_My_RewardList]') AND type in (N'P', N'PC'))
|
||||
DROP PROCEDURE [dbo].[game_PCBangPlayTime_My_RewardList]
|
||||
GO
|
||||
|
||||
USE [LosaGame]
|
||||
GO
|
||||
|
||||
/****** Object: StoredProcedure [dbo].[game_PCBangPlayTime_My_RewardList] Script Date: 01/18/2018 12:57:10 ******/
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
|
||||
SET QUOTED_IDENTIFIER ON
|
||||
GO
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
--IF OBJECT_ID('dbo.game_PCBangPlayTime_My_RewardList','P') IS NOT NULL
|
||||
--
|
||||
-- DROP PROC dbo.game_PCBangPlayTime_My_RewardList
|
||||
--
|
||||
--GO
|
||||
|
||||
-- =============================================
|
||||
-- Subject : dbo.game_PCBangPlayTime_My_RewardList
|
||||
-- DBA :
|
||||
-- DATE : 2015-06-17
|
||||
-- Description : ÈÆ·Ã µ¥ÀÌÅÍ »ý¼º
|
||||
-- =============================================
|
||||
|
||||
|
||||
CREATE PROCEDURE [dbo].[game_PCBangPlayTime_My_RewardList]
|
||||
|
||||
@ACCOUNT_IDX INT
|
||||
|
||||
AS
|
||||
|
||||
SET NOCOUNT ON;
|
||||
SET LOCK_TIMEOUT 10000;
|
||||
|
||||
SELECT PCBangDate
|
||||
, AccountIDX
|
||||
, PCBangCount
|
||||
, PCBangBonusCash
|
||||
FROM LosaGame.dbo.userPCBangPregentDB WITH (READUNCOMMITTED)
|
||||
WHERE AccountIDX = @ACCOUNT_IDX
|
||||
|
||||
|
||||
GO
|
||||
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
USE [LosaGame]
|
||||
GO
|
||||
|
||||
/****** Object: StoredProcedure [dbo].[game_PCBangPlayTime_PCBangList] Script Date: 01/23/2018 16:51:50 ******/
|
||||
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[game_PCBangPlayTime_PCBangList]') AND type in (N'P', N'PC'))
|
||||
DROP PROCEDURE [dbo].[game_PCBangPlayTime_PCBangList]
|
||||
GO
|
||||
|
||||
USE [LosaGame]
|
||||
GO
|
||||
|
||||
/****** Object: StoredProcedure [dbo].[game_PCBangPlayTime_PCBangList] Script Date: 01/23/2018 16:51:50 ******/
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
|
||||
SET QUOTED_IDENTIFIER ON
|
||||
GO
|
||||
|
||||
|
||||
|
||||
|
||||
--IF OBJECT_ID('dbo.game_PCBangPlayTime_PCBangList','P') IS NOT NULL
|
||||
--
|
||||
-- DROP PROC dbo.game_PCBangPlayTime_PCBangList
|
||||
--
|
||||
--GO
|
||||
|
||||
-- =============================================
|
||||
-- Subject dbo.game_PCBangPlayTime_PCBangList
|
||||
-- DBA
|
||||
-- DATE 2014-03-03
|
||||
-- Description PC¹æÇ÷¹ÀÌŸÀÓ¸®½ºÆ®
|
||||
-- =============================================
|
||||
|
||||
CREATE PROCEDURE [dbo].[game_PCBangPlayTime_PCBangList]
|
||||
|
||||
@PCBangIDX INT,
|
||||
@SearchDate NVARCHAR(16)
|
||||
AS
|
||||
|
||||
SET NOCOUNT ON;
|
||||
SET LOCK_TIMEOUT 10000;
|
||||
|
||||
DECLARE @Date NVARCHAR(10)
|
||||
SET @Date = replace(@SearchDate, '-', '')
|
||||
|
||||
SELECT PCBangDate
|
||||
,PCBangIndex
|
||||
,AccountIDX
|
||||
,PCBangPlayTime
|
||||
FROM LosaGame.dbo.userPCBangPlayTimeDB WITH (READUNCOMMITTED)
|
||||
WHERE PCBangIndex = @PCBangIDX AND PCBangDate = @Date AND PCBangPlayTime >= 60
|
||||
|
||||
GO
|
||||
|
||||
|
||||
@@ -0,0 +1,85 @@
|
||||
USE [LosaGame]
|
||||
GO
|
||||
|
||||
/****** Object: StoredProcedure [dbo].[game_PCBangPlayTime_Reward] Script Date: 2018-01-12 오전 10:31:38 ******/
|
||||
DROP PROCEDURE [dbo].[game_PCBangPlayTime_Reward]
|
||||
GO
|
||||
|
||||
/****** Object: StoredProcedure [dbo].[game_PCBangPlayTime_Reward] Script Date: 2018-01-12 오전 10:31:38 ******/
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
|
||||
SET QUOTED_IDENTIFIER ON
|
||||
GO
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
--IF OBJECT_ID('dbo.game_PCBangPlayTime_Reward','P') IS NOT NULL
|
||||
--
|
||||
-- DROP PROC dbo.game_PCBangPlayTime_Reward
|
||||
--
|
||||
--GO
|
||||
|
||||
-- =============================================
|
||||
-- Subject : dbo.game_PCBangPlayTime_Reward
|
||||
-- DBA :
|
||||
-- DATE : 2015-06-17
|
||||
-- Description : 훈련 데이터 생성
|
||||
-- =============================================
|
||||
|
||||
|
||||
CREATE PROCEDURE [dbo].[game_PCBangPlayTime_Reward]
|
||||
AS
|
||||
BEGIN
|
||||
|
||||
DECLARE @LimitTime INT = 30
|
||||
DECLARE @DateTime NVARCHAR(10) = CONVERT(NVARCHAR(10), GetDate()-1, 112)
|
||||
|
||||
DECLARE @sendIDX int, @receiveIDX int
|
||||
SET @sendIDX = (
|
||||
SELECT accountIDX
|
||||
FROM [LosaGame].dbo.userMemberDB WITH(NOLOCK)
|
||||
WHERE nickName='개발자K'
|
||||
)
|
||||
|
||||
IF (@sendIDX IS NULL)
|
||||
BEGIN
|
||||
SET @sendIDX = (
|
||||
SELECT accountIDX
|
||||
FROM [LosaGame].dbo.userMemberDB WITH(NOLOCK)
|
||||
WHERE nickName='DeveloperK'
|
||||
)
|
||||
END
|
||||
|
||||
INSERT INTO LosaGame.dbo.userPCBangPregentDB(PCBangDate, AccountIDX, PCBangCount, PCBangBonusCash)
|
||||
SELECT PCBangDate, AccountIDX, max(PCBangIndexCount.PCBangCount), max(presentGold)
|
||||
FROM LosaGame.dbo.userPCBangPlayTimeDB AS PPT
|
||||
INNER JOIN ( SELECT PCBangIndex, count(PCBangIndex) AS PCBangCount, CASE WHEN count(PCBangIndex) >= 5 THEN 1250
|
||||
WHEN count(PCBangIndex) >= 4 THEN 750
|
||||
WHEN count(PCBangIndex) >= 3 THEN 450
|
||||
WHEN count(PCBangIndex) >= 2 THEN 250
|
||||
ELSE 100
|
||||
END AS presentGold FROM LosaGame.dbo.userPCBangPlayTimeDB
|
||||
WHERE AccountIDX NOT IN (SELECT AccountIDX FROM [LosaGame].[dbo].[userMemberDB] WHERE limitType = 100 AND limitDate > Getdate())
|
||||
AND PCBangPlayTime >= 60 AND PCBangDate = @DateTime
|
||||
GROUP by PCBangDate, PCBangIndex) AS PCBangIndexCount
|
||||
ON PCBangIndexCount.PCBangIndex = PPT.PCBangIndex
|
||||
WHERE PCBangDate = @DateTime
|
||||
Group By PCBangDate, PPT.AccountIDX
|
||||
|
||||
INSERT INTO LosaGame.dbo.userPresentDB
|
||||
(
|
||||
sendIDX, receiveIDX, presentType, value1, value2, value3, value4, msgType, flag, limitDate, regDate
|
||||
)
|
||||
SELECT @sendIDX, AccountIDX, 13, PCBangBonusCash, 72, 0, 0, 1132, 0, GETDATE() + 3, Getdate()
|
||||
FROM LosaGame.dbo.userPCBangPregentDB
|
||||
WHERE PCBangDate = @DateTime
|
||||
|
||||
|
||||
END
|
||||
|
||||
GO
|
||||
|
||||
|
||||
@@ -0,0 +1,118 @@
|
||||
USE [LosaGame]
|
||||
GO
|
||||
|
||||
/****** Object: StoredProcedure [dbo].[game_PCBangPlayTime_Reward] Script Date: 2018-01-12 오전 10:31:38 ******/
|
||||
DROP PROCEDURE [dbo].[game_PCBangPlayTime_Reward]
|
||||
GO
|
||||
|
||||
/****** Object: StoredProcedure [dbo].[game_PCBangPlayTime_Reward] Script Date: 2018-01-12 오전 10:31:38 ******/
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
|
||||
SET QUOTED_IDENTIFIER ON
|
||||
GO
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
--IF OBJECT_ID('dbo.game_PCBangPlayTime_Reward','P') IS NOT NULL
|
||||
--
|
||||
-- DROP PROC dbo.game_PCBangPlayTime_Reward
|
||||
--
|
||||
--GO
|
||||
|
||||
-- =============================================
|
||||
-- Subject : dbo.game_PCBangPlayTime_Reward
|
||||
-- DBA :
|
||||
-- DATE : 2015-06-17
|
||||
-- Description : 훈련 데이터 생성
|
||||
-- =============================================
|
||||
|
||||
|
||||
CREATE PROCEDURE [dbo].[game_PCBangPlayTime_Reward]
|
||||
AS
|
||||
BEGIN
|
||||
|
||||
DECLARE @LimitTime INT = 30
|
||||
DECLARE @DateTime NVARCHAR(10) = CONVERT(NVARCHAR(10), GetDate(), 112)
|
||||
|
||||
DECLARE @sendIDX int, @receiveIDX int
|
||||
SET @sendIDX = (
|
||||
SELECT accountIDX
|
||||
FROM [LosaGame].dbo.userMemberDB WITH(NOLOCK)
|
||||
WHERE nickName='개발자K'
|
||||
)
|
||||
|
||||
IF (@sendIDX IS NULL)
|
||||
BEGIN
|
||||
SET @sendIDX = (
|
||||
SELECT accountIDX
|
||||
FROM [LosaGame].dbo.userMemberDB WITH(NOLOCK)
|
||||
WHERE nickName='DeveloperK'
|
||||
)
|
||||
END
|
||||
|
||||
DECLARE @PCbangIndex int = 0, @PCBangCount int = 0
|
||||
DECLARE PCBangPlayTime CURSOR FOR
|
||||
|
||||
SELECT PCBangIndex, count(PCBangIndex) AS PCBangCount FROM LosaGame.dbo.userPCBangPlayTimeDB
|
||||
WHERE AccountIDX NOT IN (SELECT AccountIDX FROM [LosaGame].[dbo].[userMemberDB] WHERE limitType = 100 AND limitDate > Getdate())
|
||||
AND PCBangPlayTime >= 30 AND PCBangDate = @DateTime
|
||||
GROUP by PCBangDate, PCBangIndex ORDER BY PCBangDate, PCBangIndex
|
||||
OPEN PCBangPlayTime
|
||||
|
||||
FETCH NEXT FROM PCBangPlayTime INTO @PCbangIndex , @PCBangCount
|
||||
WHILE @@FETCH_STATUS = 0
|
||||
BEGIN
|
||||
|
||||
SELECT PCBangDate, AccountIDX, @PCBangCount AS PCBangcount,
|
||||
CASE WHEN @PCBangCount >= 5 THEN 500
|
||||
WHEN @PCBangCount >= 4 THEN 300
|
||||
WHEN @PCBangCount >= 3 THEN 200
|
||||
WHEN @PCBangCount >= 2 THEN 150
|
||||
ELSE 100
|
||||
END AS presentGold
|
||||
FROM LosaGame.dbo.userPCBangPlayTimeDB
|
||||
WHERE AccountIDX NOT IN (SELECT AccountIDX FROM [LosaGame].[dbo].[userMemberDB] WHERE limitType = 100 AND limitDate > Getdate())
|
||||
AND PCBangPlayTime >= 30 AND PCBangDate = @DateTime AND PCBangIndex = @PCbangIndex
|
||||
|
||||
MERGE LosaGame.dbo.userPCBangPregentDB AS Target
|
||||
USING (SELECT PCBangDate, AccountIDX, @PCBangCount AS PCBangcount,
|
||||
CASE WHEN @PCBangCount >= 5 THEN 500
|
||||
WHEN @PCBangCount >= 4 THEN 300
|
||||
WHEN @PCBangCount >= 3 THEN 200
|
||||
WHEN @PCBangCount >= 2 THEN 150
|
||||
ELSE 100
|
||||
END AS presentGold
|
||||
FROM LosaGame.dbo.userPCBangPlayTimeDB
|
||||
WHERE AccountIDX NOT IN (SELECT AccountIDX FROM [LosaGame].[dbo].[userMemberDB] WHERE limitType = 100 AND limitDate > Getdate())
|
||||
AND PCBangPlayTime >= 30 AND PCBangDate = @DateTime AND PCBangIndex = @PCbangIndex) AS Source
|
||||
ON (Target.AccountIDX = Source.AccountIDX AND Target.PCBangDate = Source.PCBangDate)
|
||||
WHEN MATCHED AND Target.PCBangcount < Source.PCBangcount THEN
|
||||
UPDATE SET Target.PCBangCount = Source.PCBangcount, Target.PCBangBonusCash = Source.presentGold
|
||||
WHEN NOT MATCHED BY TARGET THEN
|
||||
INSERT (PCBangDate, AccountIDX, PCBangCount, PCBangBonusCash)
|
||||
VALUES (Source.PCBangDate, Source.AccountIDX, Source.PCBangcount, Source.presentGold)
|
||||
OUTPUT $action, Inserted.*, Deleted.*;
|
||||
|
||||
-- 커서를다음칸으로이동시킨다.
|
||||
FETCH NEXT FROM PCBangPlayTime INTO @PCbangIndex , @PCBangCount
|
||||
END
|
||||
CLOSE PCBangPlayTime
|
||||
DEALLOCATE PCBangPlayTime
|
||||
|
||||
INSERT INTO LosaGame.dbo.userPresentDB
|
||||
(
|
||||
sendIDX, receiveIDX, presentType, value1, value2, value3, value4, msgType, flag, limitDate, regDate
|
||||
)
|
||||
SELECT @sendIDX, AccountIDX, 13, PCBangBonusCash, 7, 0, 0, 1132, 0, GETDATE() + 7, Getdate()
|
||||
FROM LosaGame.dbo.userPCBangPregentDB
|
||||
WHERE PCBangDate = @DateTime
|
||||
|
||||
|
||||
END
|
||||
|
||||
GO
|
||||
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
USE [LosaGame]
|
||||
GO
|
||||
|
||||
/****** Object: StoredProcedure [dbo].[game_PCBangPlayTime_mylist] Script Date: 2017-12-07 오후 6:59:20 ******/
|
||||
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[game_PCBangPlayTime_mylist]') AND type in (N'P', N'PC'))
|
||||
DROP PROCEDURE [dbo].[game_PCBangPlayTime_mylist]
|
||||
GO
|
||||
|
||||
USE [LosaGame]
|
||||
GO
|
||||
|
||||
/****** Object: StoredProcedure [dbo].[game_PCBangPlayTime_mylist] Script Date: 2017-12-07 오후 6:59:20 ******/
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
|
||||
SET QUOTED_IDENTIFIER ON
|
||||
GO
|
||||
|
||||
|
||||
|
||||
--IF OBJECT_ID('dbo.game_PCBangPlayTime_mylist','P') IS NOT NULL
|
||||
--
|
||||
-- DROP PROC dbo.game_PCBangPlayTime_mylist
|
||||
--
|
||||
--GO
|
||||
|
||||
-- =============================================
|
||||
-- Subject dbo.game_PCBangPlayTime_mylist
|
||||
-- DBA
|
||||
-- DATE 2014-03-03
|
||||
-- Description PC방플레이타임리스트
|
||||
-- =============================================
|
||||
|
||||
CREATE PROCEDURE [dbo].[game_PCBangPlayTime_mylist]
|
||||
|
||||
@ACCOUNT_IDX INT
|
||||
|
||||
AS
|
||||
|
||||
SET NOCOUNT ON;
|
||||
SET LOCK_TIMEOUT 10000;
|
||||
|
||||
SELECT PCBangDate
|
||||
,PCBangIndex
|
||||
,AccountIDX
|
||||
,PCBangPlayTime
|
||||
FROM LosaGame.dbo.userPCBangPlayTimeDB WITH (READUNCOMMITTED)
|
||||
WHERE AccountIDX = @ACCOUNT_IDX AND PCBangPlayTime >= 60
|
||||
|
||||
GO
|
||||
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
USE [LosaGame]
|
||||
GO
|
||||
|
||||
/****** Object: Table [dbo].[userPCBangPlayTimeDB] Script Date: 2017-11-13 ¿ÀÀü 10:16:55 ******/
|
||||
DROP TABLE [dbo].[userPCBangPlayTimeDB]
|
||||
GO
|
||||
|
||||
/****** Object: Table [dbo].[userPCBangPlayTimeDB] Script Date: 2017-11-13 ¿ÀÀü 10:16:55 ******/
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
|
||||
SET QUOTED_IDENTIFIER ON
|
||||
GO
|
||||
|
||||
CREATE TABLE [dbo].[userPCBangPlayTimeDB](
|
||||
[PCBangDate][NVARCHAR](10) NOT NULL,
|
||||
[PCBangIndex] [int] NOT NULL,
|
||||
[AccountIDX] [int] NOT NULL,
|
||||
[PCBangPlayTime] [int] NOT NULL,
|
||||
CONSTRAINT [PK_userPCBangPlayTimeDB] PRIMARY KEY CLUSTERED
|
||||
(
|
||||
[PCBangDate] ASC,
|
||||
[AccountIDX] ASC
|
||||
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
|
||||
) ON [PRIMARY]
|
||||
|
||||
GO
|
||||
|
||||
ALTER TABLE [dbo].[userPCBangPlayTimeDB] ADD CONSTRAINT [DF__userPCBangDate__4AE30379] DEFAULT (('')) FOR [PCBangDate]
|
||||
GO
|
||||
|
||||
ALTER TABLE [dbo].[userPCBangPlayTimeDB] ADD CONSTRAINT [DF__userPCBangIndex__4BD727B2] DEFAULT ((0)) FOR [PCBangIndex]
|
||||
GO
|
||||
|
||||
ALTER TABLE [dbo].[userPCBangPlayTimeDB] ADD CONSTRAINT [DF__userAccountIDX__4BD727B2] DEFAULT ((0)) FOR [AccountIDX]
|
||||
GO
|
||||
|
||||
ALTER TABLE [dbo].[userPCBangPlayTimeDB] ADD CONSTRAINT [DF__userPCBangPlayTime__4BD727B2] DEFAULT ((0)) FOR [PCBangPlayTime]
|
||||
GO
|
||||
@@ -0,0 +1,39 @@
|
||||
USE [LosaGame]
|
||||
GO
|
||||
|
||||
/****** Object: Table [dbo].[userPCBangPregentDB] Script Date: 2017-11-13 ¿ÀÀü 10:16:55 ******/
|
||||
DROP TABLE [dbo].[userPCBangPregentDB]
|
||||
GO
|
||||
|
||||
/****** Object: Table [dbo].[userPCBangPregentDB] Script Date: 2017-11-13 ¿ÀÀü 10:16:55 ******/
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
|
||||
SET QUOTED_IDENTIFIER ON
|
||||
GO
|
||||
|
||||
CREATE TABLE [dbo].[userPCBangPregentDB](
|
||||
[PCBangDate][NVARCHAR](10) NOT NULL,
|
||||
[AccountIDX] [int] NOT NULL,
|
||||
[PCBangCount] [int] NOT NULL,
|
||||
[PCBangBonusCash] [int] NOT NULL,
|
||||
CONSTRAINT [PK_userPCBangPregentDB] PRIMARY KEY CLUSTERED
|
||||
(
|
||||
[PCBangDate] ASC,
|
||||
[AccountIDX] ASC
|
||||
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
|
||||
) ON [PRIMARY]
|
||||
|
||||
GO
|
||||
|
||||
ALTER TABLE [dbo].[userPCBangPregentDB] ADD CONSTRAINT [DF__userPCBangPgtDate__4AE30379] DEFAULT (('')) FOR [PCBangDate]
|
||||
GO
|
||||
|
||||
ALTER TABLE [dbo].[userPCBangPregentDB] ADD CONSTRAINT [DF__userrPCBangPgtAccountIDX__4BD727B2] DEFAULT ((0)) FOR [AccountIDX]
|
||||
GO
|
||||
|
||||
ALTER TABLE [dbo].[userPCBangPregentDB] ADD CONSTRAINT [DF__userPCBangPgtIndex__4BD727B2] DEFAULT ((0)) FOR [PCBangCount]
|
||||
GO
|
||||
|
||||
ALTER TABLE [dbo].[userPCBangPregentDB] ADD CONSTRAINT [DF__userPCBangBonusCash__4BD727B2] DEFAULT ((0)) FOR [PCBangBonusCash]
|
||||
GO
|
||||
@@ -0,0 +1,144 @@
|
||||
USE [LosaLogData]
|
||||
GO
|
||||
|
||||
|
||||
---------------------------------------------------------------------------------------------------------
|
||||
---------------------------------------------------------------------------------------------------------
|
||||
-- 로그 저장 테이블 생성 2018-01-15 by bckim,
|
||||
---------------------------------------------------------------------------------------------------------
|
||||
---------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
|
||||
SET QUOTED_IDENTIFIER ON
|
||||
GO
|
||||
|
||||
SET ANSI_PADDING ON
|
||||
GO
|
||||
|
||||
CREATE TABLE [dbo].[log_data_excavating_new](
|
||||
[RegDate] [datetime] NOT NULL,
|
||||
[LogIDX] [bigint] IDENTITY(1,1) NOT NULL,
|
||||
[LogType] [int] NOT NULL,
|
||||
[AccountIDX] [int] NOT NULL,
|
||||
[UserID] [varchar](20) NOT NULL,
|
||||
[UserName] [varchar](20) NOT NULL,
|
||||
[ExLevel] [int] NOT NULL,
|
||||
[ExEXP] [int] NOT NULL,
|
||||
[CType] [int] NOT NULL,
|
||||
[CLevel] [int] NOT NULL,
|
||||
[CExpert] [int] NOT NULL,
|
||||
[RCount] [tinyint] NOT NULL,
|
||||
[MapID] [int] NOT NULL,
|
||||
[X] [int] NOT NULL,
|
||||
[Y] [int] NOT NULL,
|
||||
[Z] [int] NOT NULL,
|
||||
[RewardType] [int] NOT NULL,
|
||||
[Index] [int] NOT NULL,
|
||||
[Price] [int] NOT NULL,
|
||||
[Mutiple] [int] NOT NULL,
|
||||
[ResultMoney] [int] NOT NULL,
|
||||
[UserIP] [varchar](15) NOT NULL,
|
||||
|
||||
CONSTRAINT [PK_log_data_excavating_new_idx] PRIMARY KEY CLUSTERED
|
||||
(
|
||||
RegDate ASC,
|
||||
LogIDX ASC
|
||||
)
|
||||
) ON [PRIMARY]
|
||||
|
||||
GO
|
||||
|
||||
CREATE NONCLUSTERED INDEX [NC_log_data_excavating_new_AccountIDX] ON [dbo].[log_data_excavating_new]
|
||||
(
|
||||
AccountIDX ASC
|
||||
)
|
||||
GO
|
||||
|
||||
|
||||
SET ANSI_PADDING OFF
|
||||
GO
|
||||
|
||||
|
||||
---------------------------------------------------------------------------------------------------------
|
||||
---------------------------------------------------------------------------------------------------------
|
||||
-- 로그 저장 프로시저 2018-01-15 by bckim,
|
||||
--
|
||||
-- 탐사 확장
|
||||
-- 2122=log_Excavating_log_add INT INT STR STR INT INT INT INT INT INT INT INT INT INT INT INT INT INT INT64 STR
|
||||
---------------------------------------------------------------------------------------------------------
|
||||
---------------------------------------------------------------------------------------------------------
|
||||
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
|
||||
SET QUOTED_IDENTIFIER ON
|
||||
GO
|
||||
|
||||
|
||||
CREATE PROCEDURE [dbo].[log_Excavating_log_add]
|
||||
|
||||
@LOG_TYPE INT,
|
||||
@ACCOUNT_IDX INT,
|
||||
@USER_ID VARCHAR(20),
|
||||
@USER_NAME VARCHAR(20),
|
||||
@USER_EX_LEVEL INT,
|
||||
|
||||
@USER_EX_EXP INT,
|
||||
@CLASS_TYPE INT,
|
||||
@CLASS_LEVEL INT,
|
||||
@CLASS_EXPERT INT,
|
||||
@REMAIN_COUNT INT,
|
||||
|
||||
@MAP_ID INT,
|
||||
@X INT,
|
||||
@Y INT,
|
||||
@Z INT,
|
||||
@REWARD_TYPE INT,
|
||||
|
||||
@INDEX INT,
|
||||
@PRICE INT,
|
||||
@MULIPLE INT,
|
||||
@RESULT_MONEY BIGINT,
|
||||
@USER_IP VARCHAR(15)
|
||||
AS
|
||||
|
||||
SET NOCOUNT ON
|
||||
SET LOCK_TIMEOUT 10000
|
||||
|
||||
DECLARE @REG_DATE DATETIME
|
||||
SET @REG_DATE=GETDATE()
|
||||
|
||||
BEGIN TRY
|
||||
|
||||
BEGIN TRAN
|
||||
INSERT dbo.log_data_excavating_new WITH (XLOCK, ROWLOCK) ([RegDate],
|
||||
[LogType],[AccountIDX],[UserID],[UserName],[ExLevel],
|
||||
[ExEXP],[CType],[CLevel],[CExpert],[RCount],
|
||||
[MapID],[X],[Y],[Z],[RewardType],
|
||||
[Index],[Price],[Mutiple],[ResultMoney],[UserIP] )
|
||||
VALUES (@REG_DATE,
|
||||
@LOG_TYPE,@ACCOUNT_IDX,@USER_ID, @USER_NAME,@USER_EX_LEVEL,
|
||||
@USER_EX_EXP,@CLASS_TYPE,@CLASS_LEVEL,@CLASS_EXPERT,@REMAIN_COUNT,
|
||||
@MAP_ID,@X,@Y,@Z,@REWARD_TYPE,
|
||||
@INDEX,@PRICE,@MULIPLE,@RESULT_MONEY,@USER_IP
|
||||
)
|
||||
COMMIT TRAN
|
||||
|
||||
END TRY
|
||||
BEGIN CATCH
|
||||
|
||||
ROLLBACK TRAN
|
||||
EXEC dbo.log_errorLog_set_log @ACCOUNT_IDX
|
||||
RETURN -1
|
||||
|
||||
END CATCH
|
||||
|
||||
RETURN 0;
|
||||
|
||||
GO
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,269 @@
|
||||
|
||||
---------------------------------------------------------
|
||||
------------- CREATE TABLE -----------------
|
||||
---------------------------------------------------------
|
||||
|
||||
USE [LosaGame]
|
||||
GO
|
||||
|
||||
/****** Object: Table [dbo].[userCardMatchingDB] Script Date: 07/11/2018 10:38:07 ******/
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
|
||||
SET QUOTED_IDENTIFIER ON
|
||||
GO
|
||||
|
||||
CREATE TABLE [dbo].[userCardMatchingDB](
|
||||
[AccountIDX] [int] NOT NULL,
|
||||
[MissionCount] [int] NOT NULL,
|
||||
[MissionType] [tinyint] NOT NULL,
|
||||
[MissionMark1] [tinyint] NOT NULL,
|
||||
[MissionMark2] [tinyint] NOT NULL,
|
||||
[Mark1] [tinyint] NOT NULL,
|
||||
[Mark2] [tinyint] NOT NULL,
|
||||
[UpdateTime] [datetime] NOT NULL,
|
||||
[RegDate] [datetime] NOT NULL
|
||||
) ON [PRIMARY]
|
||||
|
||||
GO
|
||||
|
||||
ALTER TABLE [dbo].[userCardMatchingDB] ADD DEFAULT ((0)) FOR [MissionCount]
|
||||
GO
|
||||
|
||||
ALTER TABLE [dbo].[userCardMatchingDB] ADD DEFAULT ((0)) FOR [MissionType]
|
||||
GO
|
||||
|
||||
ALTER TABLE [dbo].[userCardMatchingDB] ADD DEFAULT ((0)) FOR [MissionMark1]
|
||||
GO
|
||||
|
||||
ALTER TABLE [dbo].[userCardMatchingDB] ADD DEFAULT ((0)) FOR [MissionMark2]
|
||||
GO
|
||||
|
||||
ALTER TABLE [dbo].[userCardMatchingDB] ADD DEFAULT ((0)) FOR [Mark1]
|
||||
GO
|
||||
|
||||
ALTER TABLE [dbo].[userCardMatchingDB] ADD DEFAULT ((0)) FOR [Mark2]
|
||||
GO
|
||||
|
||||
---------------------------------------------------------
|
||||
------------- CREATE PROC_1 -----------------
|
||||
---------------------------------------------------------
|
||||
USE [LosaGame]
|
||||
GO
|
||||
/****** Object: StoredProcedure [dbo].[game_cardmatching_update_data] Script Date: 07/11/2018 10:52:08 ******/
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
SET QUOTED_IDENTIFIER ON
|
||||
GO
|
||||
|
||||
|
||||
-- =============================================
|
||||
-- Subject : dbo.game_cardmatching_update_data
|
||||
-- Author : bckim
|
||||
-- DATE : 2018-06-18
|
||||
-- Description : 카드 매칭 미션 및 데이터 업데이트
|
||||
-- =============================================
|
||||
|
||||
CREATE PROCEDURE [dbo].[game_cardmatching_update_data]
|
||||
|
||||
@ACCOUNT_IDX INT,
|
||||
@UpdateType TINYINT,
|
||||
@MissionType TINYINT,
|
||||
@MissionMark1 TINYINT,
|
||||
@MissionMark2 TINYINT,
|
||||
@Mark1 TINYINT,
|
||||
@Mark2 TINYINT
|
||||
AS
|
||||
|
||||
SET NOCOUNT ON;
|
||||
SET LOCK_TIMEOUT 10000;
|
||||
|
||||
BEGIN TRAN
|
||||
IF( @UpdateType = 0 )
|
||||
BEGIN
|
||||
UPDATE [dbo].[userCardMatchingDB] WITH (XLOCK, ROWLOCK) SET [MissionCount] = [MissionCount] +1 ,[MissionType] = @MissionType,
|
||||
[MissionMark1] = @MissionMark1,[MissionMark2] = @MissionMark2,[Mark1] = @Mark1,[Mark2] = @Mark2, [UpdateTime] = GETDATE(), [RegDate] = GETDATE() WHERE AccountIDX = @ACCOUNT_IDX;
|
||||
END
|
||||
ELSE
|
||||
BEGIN
|
||||
UPDATE [dbo].[userCardMatchingDB] WITH (XLOCK, ROWLOCK) SET [MissionType] = @MissionType,[MissionMark1] = @MissionMark1,[MissionMark2] = @MissionMark2,
|
||||
[Mark1] = @Mark1,[Mark2] = @Mark2, [UpdateTime] = GETDATE() WHERE AccountIDX = @ACCOUNT_IDX;
|
||||
END
|
||||
|
||||
IF(@@ROWCOUNT=0)
|
||||
BEGIN
|
||||
INSERT INTO [dbo].[userCardMatchingDB] WITH(XLOCK, ROWLOCK) ([MissionCount], [AccountIDX],[MissionType],[MissionMark1],[MissionMark2],[Mark1],[Mark2],[UpdateTime],[RegDate])
|
||||
VALUES ( 0, @ACCOUNT_IDX, @MissionType, @MissionMark1, @MissionMark2, @Mark1, @Mark2, GETDATE(),GETDATE())
|
||||
END
|
||||
COMMIT TRAN
|
||||
|
||||
GO
|
||||
|
||||
---------------------------------------------------------
|
||||
------------- CREATE PROC_2 -----------------
|
||||
---------------------------------------------------------
|
||||
|
||||
USE [LosaGame]
|
||||
GO
|
||||
|
||||
/****** Object: StoredProcedure [dbo].[game_cardmatching_get_data] Script Date: 07/11/2018 11:43:03 ******/
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
|
||||
SET QUOTED_IDENTIFIER ON
|
||||
GO
|
||||
|
||||
|
||||
|
||||
-- =============================================
|
||||
-- Subject : dbo.game_cardmatching_get_data
|
||||
-- Author : bckim
|
||||
-- DATE : 2018-06-18
|
||||
-- Description : 카드 매칭 미션 및 상태 조회
|
||||
-- =============================================
|
||||
|
||||
CREATE PROCEDURE [dbo].[game_cardmatching_get_data]
|
||||
|
||||
@ACCOUNT_IDX INT
|
||||
|
||||
AS
|
||||
|
||||
SET NOCOUNT ON;
|
||||
SET LOCK_TIMEOUT 10000;
|
||||
|
||||
SELECT [MissionType],[MissionMark1],[MissionMark2],[Mark1],[Mark2],[UpdateTime]
|
||||
FROM [dbo].[userCardMatchingDB] WITH (NOLOCK)
|
||||
WHERE [AccountIDX] = @ACCOUNT_IDX
|
||||
|
||||
GO
|
||||
|
||||
|
||||
---------------------------------------------------------
|
||||
------------- CREATE TABLE -----------------
|
||||
---------------------------------------------------------
|
||||
USE [LosaLogData]
|
||||
GO
|
||||
|
||||
/****** Object: Table [dbo].[log_data_cardmatching] Script Date: 07/11/2018 11:44:48 ******/
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
|
||||
SET QUOTED_IDENTIFIER ON
|
||||
GO
|
||||
|
||||
CREATE TABLE [dbo].[log_data_cardmatching](
|
||||
[idx] [int] IDENTITY(1,1) NOT NULL,
|
||||
[AccountIDX] [int] NOT NULL,
|
||||
[NickName] [nvarchar](20) NOT NULL,
|
||||
[UserLevel] [int] NOT NULL,
|
||||
[LogType] [int] NOT NULL,
|
||||
[MissionType] [int] NOT NULL,
|
||||
[MissionMark1] [int] NOT NULL,
|
||||
[MissionMark2] [int] NOT NULL,
|
||||
[UserMark1] [int] NOT NULL,
|
||||
[UserMark2] [int] NOT NULL,
|
||||
[RewardStep] [int] NOT NULL,
|
||||
[ItemType] [int] NOT NULL,
|
||||
[ItemCode] [int] NOT NULL,
|
||||
[ItemValue] [int] NOT NULL,
|
||||
[RegDate] [datetime] NOT NULL,
|
||||
CONSTRAINT [PK_log_data_cardmatching] PRIMARY KEY CLUSTERED
|
||||
(
|
||||
[RegDate] ASC,
|
||||
[idx] ASC
|
||||
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
|
||||
) ON [PRIMARY]
|
||||
|
||||
GO
|
||||
|
||||
ALTER TABLE [dbo].[log_data_cardmatching] ADD DEFAULT ((0)) FOR [LogType]
|
||||
GO
|
||||
|
||||
ALTER TABLE [dbo].[log_data_cardmatching] ADD DEFAULT ((0)) FOR [MissionType]
|
||||
GO
|
||||
|
||||
ALTER TABLE [dbo].[log_data_cardmatching] ADD DEFAULT ((0)) FOR [MissionMark1]
|
||||
GO
|
||||
|
||||
ALTER TABLE [dbo].[log_data_cardmatching] ADD DEFAULT ((0)) FOR [MissionMark2]
|
||||
GO
|
||||
|
||||
ALTER TABLE [dbo].[log_data_cardmatching] ADD DEFAULT ((0)) FOR [UserMark1]
|
||||
GO
|
||||
|
||||
ALTER TABLE [dbo].[log_data_cardmatching] ADD DEFAULT ((0)) FOR [UserMark2]
|
||||
GO
|
||||
|
||||
ALTER TABLE [dbo].[log_data_cardmatching] ADD DEFAULT ((0)) FOR [RewardStep]
|
||||
GO
|
||||
|
||||
ALTER TABLE [dbo].[log_data_cardmatching] ADD DEFAULT ((0)) FOR [ItemType]
|
||||
GO
|
||||
|
||||
ALTER TABLE [dbo].[log_data_cardmatching] ADD DEFAULT ((0)) FOR [ItemCode]
|
||||
GO
|
||||
|
||||
ALTER TABLE [dbo].[log_data_cardmatching] ADD DEFAULT ((0)) FOR [ItemValue]
|
||||
GO
|
||||
|
||||
ALTER TABLE [dbo].[log_data_cardmatching] ADD DEFAULT (getdate()) FOR [RegDate]
|
||||
GO
|
||||
|
||||
|
||||
|
||||
---------------------------------------------------------
|
||||
------------- CREATE PROC_2 -----------------
|
||||
---------------------------------------------------------
|
||||
USE [LosaLogData]
|
||||
GO
|
||||
|
||||
/****** Object: StoredProcedure [dbo].[log_data_cardmatching_add] Script Date: 07/11/2018 11:45:23 ******/
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
|
||||
SET QUOTED_IDENTIFIER ON
|
||||
GO
|
||||
|
||||
|
||||
|
||||
-- =============================================
|
||||
-- Subject : log_data_cardmatching_add
|
||||
-- Author : bckim
|
||||
-- Date : 2018-07-01
|
||||
-- Description : 카드 매칭 로그
|
||||
-- // 2018-06-18 by bckim, 카드 짝 마추기 이벤트 추가
|
||||
-- =============================================
|
||||
|
||||
CREATE PROCEDURE [dbo].[log_data_cardmatching_add]
|
||||
|
||||
@ACCOUNT_IDX INT,
|
||||
@NICK_NAME NVARCHAR(20),
|
||||
@USER_LEVEL INT,
|
||||
@LOG_TYPE INT,
|
||||
|
||||
@MISSION_TYPE INT,
|
||||
@MISSION_MARK1 INT,
|
||||
@MISSION_MARK2 INT,
|
||||
@USER_MARK1 INT,
|
||||
@USER_MARK2 INT,
|
||||
|
||||
@REWARD_STEP INT,
|
||||
@ITEM_TYPE INT,
|
||||
@ITEM_CODE INT,
|
||||
@ITEM_VALUE INT
|
||||
AS
|
||||
|
||||
SET NOCOUNT ON;
|
||||
SET LOCK_TIMEOUT 10000;
|
||||
|
||||
INSERT INTO log_data_cardmatching (AccountIDX, NickName,UserLevel,LogType,MissionType,MissionMark1,MissionMark2,UserMark1,UserMark2,RewardStep,ItemType,ItemCode, ItemValue,RegDate)
|
||||
VALUES (@ACCOUNT_IDX, @NICK_NAME, @USER_LEVEL, @LOG_TYPE, @MISSION_TYPE,@MISSION_MARK1,@MISSION_MARK2,@USER_MARK1,@USER_MARK2,@REWARD_STEP, @ITEM_TYPE, @ITEM_CODE, @ITEM_VALUE, GETDATE())
|
||||
|
||||
|
||||
GO
|
||||
|
||||
---------------------------------------------------------
|
||||
------------- END -----------------
|
||||
---------------------------------------------------------
|
||||
|
||||
|
||||
@@ -0,0 +1,146 @@
|
||||
USE [LosaGame]
|
||||
GO
|
||||
|
||||
/****** Object: Table [dbo].[userDiceGameDB] Script Date: 10/11/2018 17:38:09 ******/
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
|
||||
SET QUOTED_IDENTIFIER ON
|
||||
GO
|
||||
|
||||
CREATE TABLE [dbo].[userDiceGameDB](
|
||||
[AccountIDX] [int] NOT NULL,
|
||||
[Position] [int] NOT NULL,
|
||||
[Trace01] [int] NOT NULL,
|
||||
[Trace02] [int] NOT NULL,
|
||||
[Trace03] [int] NOT NULL,
|
||||
[Trace04] [int] NOT NULL,
|
||||
[Trace05] [int] NOT NULL,
|
||||
[Trace06] [int] NOT NULL,
|
||||
[Board] [tinyint] NOT NULL,
|
||||
[RewardStep01] [int] NOT NULL,
|
||||
[RewardStep02] [int] NOT NULL,
|
||||
[RewardStep03] [int] NOT NULL,
|
||||
[RewardStep04] [int] NOT NULL,
|
||||
[RewardStep05] [int] NOT NULL,
|
||||
[RewardStep06] [int] NOT NULL,
|
||||
[RewardStep07] [int] NOT NULL,
|
||||
[RewardStep08] [int] NOT NULL,
|
||||
[RewardStep09] [int] NOT NULL,
|
||||
[RewardStep10] [int] NOT NULL,
|
||||
[UpdateTime] [datetime] NULL,
|
||||
[RegDate] [datetime] NULL
|
||||
) ON [PRIMARY]
|
||||
|
||||
GO
|
||||
|
||||
|
||||
|
||||
-------------------------------------------------------------------------------------------
|
||||
-------------------------------------------------------------------------------------------
|
||||
USE [LosaGame]
|
||||
GO
|
||||
|
||||
/****** Object: StoredProcedure [dbo].[game_dice_game_data_update] Script Date: 10/11/2018 17:40:00 ******/
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
|
||||
SET QUOTED_IDENTIFIER ON
|
||||
GO
|
||||
|
||||
|
||||
|
||||
-- =============================================
|
||||
-- Subject : dbo.game_dice_game_data_update
|
||||
-- Author : bckim
|
||||
-- DATE : 2018-08-30
|
||||
-- Description : // 2018-08-30 by bckim, 주사위 이벤트 추가
|
||||
-- =============================================
|
||||
|
||||
CREATE PROCEDURE [dbo].[game_dice_game_data_update]
|
||||
|
||||
@ACCOUNT_IDX INT,
|
||||
@Position INT,
|
||||
@Trace01 INT,
|
||||
@Trace02 INT,
|
||||
@Trace03 INT,
|
||||
@Trace04 INT,
|
||||
@Trace05 INT,
|
||||
@Trace06 INT,
|
||||
@Board TINYINT,
|
||||
@Reward01 INT,
|
||||
@Reward02 INT,
|
||||
@Reward03 INT,
|
||||
@Reward04 INT,
|
||||
@Reward05 INT,
|
||||
@Reward06 INT,
|
||||
@Reward07 INT,
|
||||
@Reward08 INT,
|
||||
@Reward09 INT,
|
||||
@Reward10 INT
|
||||
AS
|
||||
SET NOCOUNT ON;
|
||||
SET LOCK_TIMEOUT 10000;
|
||||
|
||||
BEGIN TRAN
|
||||
UPDATE [dbo].[userDiceGameDB] WITH (XLOCK, ROWLOCK)
|
||||
SET [AccountIDX] = @ACCOUNT_IDX,[Position] = @Position,[Trace01] = @Trace01,[Trace02] = @Trace02,[Trace03] = @Trace03,[Trace04] = @Trace04,[Trace05] = @Trace05,[Trace06] = @Trace06,[Board] = @Board,
|
||||
[RewardStep01] = @Reward01,[RewardStep02] = @Reward02,[RewardStep03] = @Reward03,[RewardStep04] = @Reward04,[RewardStep05] = @Reward05,
|
||||
[RewardStep06] = @Reward06,[RewardStep07] = @Reward07,[RewardStep08] = @Reward08,[RewardStep09] = @Reward09,[RewardStep10] = @Reward10, [UpdateTime] = GETDATE()
|
||||
WHERE AccountIDX = @ACCOUNT_IDX;
|
||||
|
||||
IF(@@ROWCOUNT=0)
|
||||
BEGIN
|
||||
INSERT INTO [dbo].[userDiceGameDB] WITH(XLOCK, ROWLOCK) ([AccountIDX],[Position],[Trace01],[Trace02],[Trace03],[Trace04],[Trace05],[Trace06],[Board],
|
||||
[RewardStep01],[RewardStep02],[RewardStep03],[RewardStep04],[RewardStep05],[RewardStep06],[RewardStep07],[RewardStep08],[RewardStep09],[RewardStep10],[UpdateTime],[RegDate] )
|
||||
VALUES ( @ACCOUNT_IDX,@Position,@Trace01,@Trace02,@Trace03,@Trace04,@Trace05,@Trace06,@Board,
|
||||
@Reward01,@Reward02,@Reward03,@Reward04,@Reward05,@Reward06,@Reward07,@Reward08,@Reward09,@Reward10, GETDATE(),GETDATE())
|
||||
END
|
||||
COMMIT TRAN
|
||||
|
||||
|
||||
GO
|
||||
|
||||
|
||||
|
||||
-------------------------------------------------------------------------------------------
|
||||
-------------------------------------------------------------------------------------------
|
||||
|
||||
USE [LosaGame]
|
||||
GO
|
||||
|
||||
/****** Object: StoredProcedure [dbo].[game_dice_game_get_data] Script Date: 10/11/2018 17:40:32 ******/
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
|
||||
SET QUOTED_IDENTIFIER ON
|
||||
GO
|
||||
|
||||
|
||||
|
||||
-- =============================================
|
||||
-- Subject : dbo.game_dice_game_get_data
|
||||
-- Author : bckim
|
||||
-- DATE : 2018-08-30
|
||||
-- Description : // 2018-08-30 by bckim, 주사위 이벤트 추가
|
||||
-- =============================================
|
||||
|
||||
CREATE PROCEDURE [dbo].[game_dice_game_get_data]
|
||||
|
||||
@ACCOUNT_IDX INT
|
||||
|
||||
AS
|
||||
|
||||
SET NOCOUNT ON;
|
||||
SET LOCK_TIMEOUT 10000;
|
||||
|
||||
SELECT [Position],[Trace01],[Trace02],[Trace03],[Trace04],[Trace05],[Trace06],[Board],
|
||||
[RewardStep01],[RewardStep02],[RewardStep03],[RewardStep04],[RewardStep05],
|
||||
[RewardStep06],[RewardStep07],[RewardStep08],[RewardStep09],[RewardStep10]
|
||||
FROM [dbo].[userDiceGameDB] WITH (NOLOCK)
|
||||
WHERE [AccountIDX] = @ACCOUNT_IDX
|
||||
|
||||
|
||||
GO
|
||||
|
||||
|
||||
@@ -0,0 +1,118 @@
|
||||
USE [LosaLogData]
|
||||
GO
|
||||
|
||||
/****** Object: Table [dbo].[log_data_DiceGame] Script Date: 10/11/2018 17:41:09 ******/
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
|
||||
SET QUOTED_IDENTIFIER ON
|
||||
GO
|
||||
|
||||
CREATE TABLE [dbo].[log_data_DiceGame](
|
||||
[AccountIDX] [int] NOT NULL,
|
||||
[GameState] [int] NOT NULL,
|
||||
[DiceCountUsed] [int] NOT NULL,
|
||||
[BoardCountUsed] [int] NOT NULL,
|
||||
[RewardCountUsed] [int] NOT NULL,
|
||||
[Position] [int] NOT NULL,
|
||||
[Trace01] [int] NOT NULL,
|
||||
[Trace02] [int] NOT NULL,
|
||||
[Trace03] [int] NOT NULL,
|
||||
[Trace04] [int] NOT NULL,
|
||||
[Trace05] [int] NOT NULL,
|
||||
[Trace06] [int] NOT NULL,
|
||||
[Board] [tinyint] NOT NULL,
|
||||
[RewardStep01] [int] NOT NULL,
|
||||
[RewardStep02] [int] NOT NULL,
|
||||
[RewardStep03] [int] NOT NULL,
|
||||
[RewardStep04] [int] NOT NULL,
|
||||
[RewardStep05] [int] NOT NULL,
|
||||
[RewardStep06] [int] NOT NULL,
|
||||
[RewardStep07] [int] NOT NULL,
|
||||
[RewardStep08] [int] NOT NULL,
|
||||
[RewardStep09] [int] NOT NULL,
|
||||
[RewardStep10] [int] NOT NULL,
|
||||
[StartTime] [datetime] NULL,
|
||||
[EndTime] [datetime] NULL
|
||||
) ON [PRIMARY]
|
||||
|
||||
GO
|
||||
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
----------------------------------------------------------------------------
|
||||
|
||||
|
||||
USE [LosaLogData]
|
||||
GO
|
||||
|
||||
/****** Object: StoredProcedure [dbo].[log_data_DiceGame_update] Script Date: 10/11/2018 17:41:55 ******/
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
|
||||
SET QUOTED_IDENTIFIER ON
|
||||
GO
|
||||
|
||||
|
||||
|
||||
-- =============================================
|
||||
-- Subject : dbo.log_data_DiceGame_update
|
||||
-- Author : bckim
|
||||
-- DATE : 2018-08-30
|
||||
-- Description : // 2018-08-30 by bckim, ÁÖ»çÀ§ À̺¥Æ® Ãß°¡_ ·Î±×
|
||||
-- =============================================
|
||||
|
||||
CREATE PROCEDURE [dbo].[log_data_DiceGame_update]
|
||||
|
||||
@ACCOUNT_IDX INT,
|
||||
@Game_State INT,
|
||||
@DiceCountUsed INT,
|
||||
@BoardCountUsed INT,
|
||||
@RewardCountUsed INT,
|
||||
@Position INT,
|
||||
@Trace01 INT,
|
||||
@Trace02 INT,
|
||||
@Trace03 INT,
|
||||
@Trace04 INT,
|
||||
@Trace05 INT,
|
||||
@Trace06 INT,
|
||||
@Board TINYINT,
|
||||
@Reward01 INT,
|
||||
@Reward02 INT,
|
||||
@Reward03 INT,
|
||||
@Reward04 INT,
|
||||
@Reward05 INT,
|
||||
@Reward06 INT,
|
||||
@Reward07 INT,
|
||||
@Reward08 INT,
|
||||
@Reward09 INT,
|
||||
@Reward10 INT
|
||||
AS
|
||||
SET NOCOUNT ON;
|
||||
SET LOCK_TIMEOUT 10000;
|
||||
|
||||
BEGIN TRAN
|
||||
IF EXISTS( SELECT * FROM [dbo].[log_data_DiceGame] WHERE @ACCOUNT_IDX = [AccountIDX] AND [GameState] = 0 )
|
||||
BEGIN
|
||||
UPDATE [dbo].[log_data_DiceGame] WITH (XLOCK, ROWLOCK)
|
||||
SET [GameState] = @Game_State,[DiceCountUsed] = [DiceCountUsed] + @DiceCountUsed,[BoardCountUsed] = [BoardCountUsed] + @BoardCountUsed, [RewardCountUsed] = [RewardCountUsed] + @RewardCountUsed,
|
||||
[Position] = @Position,[Trace01] = @Trace01,[Trace02] = @Trace02,[Trace03] = @Trace03,[Trace04] = @Trace04,[Trace05] = @Trace05,[Trace06] = @Trace06,[Board] = @Board,
|
||||
[RewardStep01] = @Reward01,[RewardStep02] = @Reward02,[RewardStep03] = @Reward03,[RewardStep04] = @Reward04,[RewardStep05] = @Reward05,
|
||||
[RewardStep06] = @Reward06,[RewardStep07] = @Reward07,[RewardStep08] = @Reward08,[RewardStep09] = @Reward09,[RewardStep10] = @Reward10, [EndTime] = GETDATE()
|
||||
WHERE @ACCOUNT_IDX = [AccountIDX] AND [GameState] = 0
|
||||
END
|
||||
ELSE
|
||||
BEGIN
|
||||
INSERT INTO [dbo].[log_data_DiceGame] WITH(XLOCK, ROWLOCK)
|
||||
([AccountIDX],[GameState],[DiceCountUsed],[BoardCountUsed],[RewardCountUsed],[Position],[Trace01],[Trace02],[Trace03],[Trace04],[Trace05],[Trace06],[Board],
|
||||
[RewardStep01],[RewardStep02],[RewardStep03],[RewardStep04],[RewardStep05],[RewardStep06],[RewardStep07],[RewardStep08],[RewardStep09],[RewardStep10],[StartTime],[EndTime] )
|
||||
VALUES ( @ACCOUNT_IDX,@Game_State,@DiceCountUsed,@BoardCountUsed,@RewardCountUsed,@Position,@Trace01,@Trace02,@Trace03,@Trace04,@Trace05,@Trace06,@Board,
|
||||
@Reward01,@Reward02,@Reward03,@Reward04,@Reward05,@Reward06,@Reward07,@Reward08,@Reward09,@Reward10, GETDATE(),GETDATE())
|
||||
END
|
||||
COMMIT TRAN
|
||||
|
||||
GO
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
USE [LosaGame]
|
||||
GO
|
||||
/****** Object: StoredProcedure [dbo].[game_login_get_data] Script Date: 10/19/2018 11:14:27 ******/
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
SET QUOTED_IDENTIFIER ON
|
||||
GO
|
||||
|
||||
ALTER PROCEDURE [dbo].[game_login_get_data]
|
||||
(
|
||||
@userID varchar(12)
|
||||
)
|
||||
As
|
||||
SELECT b.userID, a.encodeKey, a.gameServerID, connDate, a.UserIP FROM userLoginDB a WITH(NOLOCK) INNER JOIN userMemberDB b WITH(NOLOCK) ON a.accountIDX = b.accountIDX WHERE b.userID=@userID
|
||||
@@ -0,0 +1,234 @@
|
||||
<% OPTION EXPLICIT %>
|
||||
|
||||
<!-- #include file = "createKey.asp" -->
|
||||
|
||||
<%
|
||||
|
||||
Response.Expires = 0
|
||||
Response.AddHeader "Pragma", "no-cache"
|
||||
Response.AddHeader "Cache-Control", "no-cache, no-store, must-revalidate"
|
||||
Response.AddHeader "Expires", "-1"
|
||||
|
||||
|
||||
Dim db, dbcon, sql, rs
|
||||
Dim userID, accountIDX, zoneType, zoneName, gameServerID, userIP
|
||||
Dim useKey, fixKey
|
||||
Dim oEncryptor, encodeID, encodeKey, encodeIP, encodeIPKey, sendKeyString, prevKey, exeTime, chgKeyTime
|
||||
|
||||
userID = session("userID")
|
||||
zoneType = Request.Form("zoneType")
|
||||
useKey = ""
|
||||
chgKeyTime = 5
|
||||
userIP = Request.Servervariables("REMOTE_HOST")
|
||||
|
||||
Select Case zoneType
|
||||
Case 1 :
|
||||
zoneName = "QA_ZONE"
|
||||
%><!-- #include file = "cnn_game_qa.asp" --><%
|
||||
Case 3 :
|
||||
zoneName = "DEV_ZONE"
|
||||
%><!-- #include file = "cnn_game_dev.asp" --><%
|
||||
Case Else
|
||||
zoneName = "DEV_ZONE"
|
||||
%><!-- #include file = "cnn_game_dev.asp" --><%
|
||||
End Select
|
||||
|
||||
If userID = "" or isNull(userID) or Len(userID) = 0 Then
|
||||
db.close
|
||||
Set db=Nothing
|
||||
%>
|
||||
<SCRIPT LANGUAGE="JavaScript">
|
||||
<!--
|
||||
alert("You can play after login.");
|
||||
top.location.replace("/default.asp");
|
||||
//-->
|
||||
</SCRIPT>
|
||||
<%
|
||||
Response.End
|
||||
End If
|
||||
|
||||
|
||||
'세션 accountIDX 값이 싱글존으로 되어 있어서 다른존과 accountIDX 불일치. 때문에 accountIDX 가져오는 구문 추가
|
||||
sql = "EXEC web_get_accountIDX '" & userID & "'"
|
||||
Set rs = db.Execute(sql)
|
||||
|
||||
|
||||
If rs.eof and rs.bof Then
|
||||
rs.close
|
||||
Set rs=Nothing
|
||||
db.close
|
||||
Set db=Nothing
|
||||
%>
|
||||
<SCRIPT LANGUAGE="JavaScript">
|
||||
<!--
|
||||
alert("Membership was not successful.");
|
||||
history.back();
|
||||
//-->
|
||||
</SCRIPT>
|
||||
<%
|
||||
Response.End
|
||||
End If
|
||||
|
||||
|
||||
accountIDX = rs("accountIDX")
|
||||
|
||||
|
||||
|
||||
sql = "EXEC web_game_server_get_data_top1"
|
||||
Set rs = db.Execute(sql)
|
||||
|
||||
|
||||
If rs.eof and rs.bof Then
|
||||
rs.close
|
||||
Set rs=Nothing
|
||||
db.close
|
||||
Set db=Nothing
|
||||
%>
|
||||
<SCRIPT LANGUAGE="JavaScript">
|
||||
<!--
|
||||
alert("No servers are running.");
|
||||
history.back();
|
||||
//-->
|
||||
</SCRIPT>
|
||||
<%
|
||||
Response.End
|
||||
Else
|
||||
gameServerID = rs("serverID")
|
||||
End If
|
||||
|
||||
|
||||
useKey = CreateEncodeKey()
|
||||
|
||||
sql = "EXEC web_user_login_count '" & userID & "'"
|
||||
Set rs=db.Execute(sql)
|
||||
|
||||
|
||||
If rs(0) = 0 Then
|
||||
rs.close
|
||||
Set rs=Nothing
|
||||
db.close
|
||||
Set db=Nothing
|
||||
%>
|
||||
<SCRIPT LANGUAGE="JavaScript">
|
||||
<!--
|
||||
alert("No sign in information. \ N \ nPlease contact your administrator.");
|
||||
top.location.replace("/default.asp");
|
||||
//-->
|
||||
</SCRIPT>
|
||||
<%
|
||||
Response.End
|
||||
End If
|
||||
|
||||
sql = "EXEC web_user_login_enkey_get_data '" & accountIDX & "'"
|
||||
Set rs = db.Execute(sql)
|
||||
|
||||
|
||||
|
||||
|
||||
If rs.eof and rs.bof Then
|
||||
rs.close
|
||||
Set rs=Nothing
|
||||
db.close
|
||||
Set db=Nothing
|
||||
%>
|
||||
<SCRIPT LANGUAGE="JavaScript">
|
||||
<!--
|
||||
alert("존별로 유저인덱스가 틀려 접속 <%=zoneName%>에는 접속할 수 없습니다");
|
||||
history.back();
|
||||
//-->
|
||||
</SCRIPT>
|
||||
<%
|
||||
Response.End
|
||||
End If
|
||||
|
||||
|
||||
|
||||
prevKey = rs("encodeKey")
|
||||
exeTime = rs("connDate")
|
||||
|
||||
|
||||
If DateDiff("n",exeTime,Now()) < chgKeyTime Then
|
||||
useKey = prevKey
|
||||
Else
|
||||
sql = "EXEC web_user_login_enkey_update '" & userID & "', '" & useKey & "', '" & userIP & "'"
|
||||
db.Execute(sql)
|
||||
End If
|
||||
|
||||
sql = "EXEC web_fixkey_get_data"
|
||||
Set rs=db.Execute(sql)
|
||||
|
||||
fixKey = rs(0)
|
||||
|
||||
Set oEncryptor = Server.CreateObject("IoEncrypt.Encrypt")
|
||||
encodeID = oEncryptor.Encode15 (userID,fixKey)
|
||||
encodeKey = oEncryptor.Encode15 (useKey,useKey)
|
||||
encodeIP = oEncryptor.Encode15 (userIP,fixKey)
|
||||
encodeIPKey = oEncryptor.Encode15 (useKey,fixKey)
|
||||
Set oEncryptor = Nothing
|
||||
Dim strSenKeyString
|
||||
strSenKeyString = encodeKey & encodeID
|
||||
|
||||
Dim strSenIPKeyString
|
||||
strSenIPKeyString = encodeIPKey & encodeIP
|
||||
|
||||
rs.close
|
||||
Set rs=Nothing
|
||||
db.close
|
||||
Set db=Nothing
|
||||
|
||||
|
||||
'response.write(zoneName)
|
||||
'response.end
|
||||
|
||||
'------------------------------------------------------------------------------------------------------------
|
||||
' 프로토콜 설정
|
||||
'------------------------------------------------------------------------------------------------------------
|
||||
Dim strProtocol
|
||||
strProtocol = "LostSagaQA"
|
||||
%><!DOCTYPE>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ko" lang="ko">
|
||||
<head>
|
||||
<title>로스트사가 게임 실행 중입니다. | 로스트사가</title>
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||
<meta http-equiv="imagetoolbar" content="no">
|
||||
<meta http-equiv="expires" content="-1">
|
||||
<meta http-equiv="pragma" content="no-cache">
|
||||
<meta http-equiv="cache-control" content="no-cache">
|
||||
<script type="text/javascript" src="jquery-1.8.3.min.js"></script>
|
||||
<script type="text/javascript" src="util.js"></script>
|
||||
<script type="text/javascript" src="protocolcheck.js"></script>
|
||||
<script type="text/javascript">
|
||||
$(function ()
|
||||
{
|
||||
protocolCheck($("#playgame").attr("href"),
|
||||
function () {
|
||||
goUrl("webmanager.asp");
|
||||
},
|
||||
function () {
|
||||
goUrl("default.asp");
|
||||
}
|
||||
);
|
||||
});
|
||||
</script>
|
||||
|
||||
</head>
|
||||
|
||||
<body class="playing">
|
||||
<a id="playgame" style="display:;" href="<%=strProtocol%>://<%=strSenKeyString%>,<%=strSenIPKeyString%>,<%=gameServerID%>"></a>
|
||||
<input type="hidden" id="loginKey" value="<%=strSenKeyString%>" />
|
||||
|
||||
<h2 class="blind">게임 실행</h2>
|
||||
<div class="btnArea">
|
||||
<button type="button" class="btnImg btnGameRe" title="게임 재실행하기" onclick="goUrl('playUrl.asp')">게임 재실행하기</button>
|
||||
</div>
|
||||
<div class="loadingPop">
|
||||
<div class="loading">
|
||||
<p>로딩중입니다. 잠시만 기다려주세요. 최초 실행 시 로스트사가 웹매니저 설치 페이지로 이동합니다</p>
|
||||
</div>
|
||||
<div id="bgDark"></div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
USE [LosaGame]
|
||||
GO
|
||||
|
||||
/****** Object: StoredProcedure [dbo].[game_quest_delete] Script Date: 11/21/2018 11:09:44 ******/
|
||||
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[game_quest_delete]') AND type in (N'P', N'PC'))
|
||||
DROP PROCEDURE [dbo].[game_quest_delete]
|
||||
GO
|
||||
|
||||
USE [LosaGame]
|
||||
GO
|
||||
|
||||
/****** Object: StoredProcedure [dbo].[game_quest_delete] Script Date: 11/21/2018 11:09:44 ******/
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
|
||||
SET QUOTED_IDENTIFIER ON
|
||||
GO
|
||||
|
||||
CREATE PROCEDURE [dbo].[game_quest_delete]
|
||||
(
|
||||
@accountIDX int
|
||||
)
|
||||
AS
|
||||
|
||||
DELETE FROM userQuestDB WHERE accountIDX = @accountIDX
|
||||
DELETE FROM userQuestCompleteDB WHERE accountIDX = @accountIDX
|
||||
|
||||
|
||||
GO
|
||||
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
USE [LosaGame]
|
||||
GO
|
||||
/****** Object: StoredProcedure [dbo].[game_login_get_data_by_check] Script Date: 02/01/2019 14:07:36 ******/
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
SET QUOTED_IDENTIFIER ON
|
||||
GO
|
||||
|
||||
CREATE PROCEDURE [dbo].[game_login_get_data_by_dual_login]
|
||||
(
|
||||
@userID varchar(12)
|
||||
)
|
||||
As
|
||||
SELECT b.userID, a.encodeKey, a.gameServerID, connDate -- , a.UserIP
|
||||
FROM userLoginDB a WITH(NOLOCK) INNER JOIN userMemberDB b WITH(NOLOCK) ON a.accountIDX = b.accountIDX
|
||||
WHERE b.userID=@userID
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
-- LosaDev 2019: procedures the 2019 server calls (ls_query.ini ids 1, 136, 137, 139)
|
||||
-- that no released DB script contains. Written for the testbed from the server code (DBClient.cpp).
|
||||
-- Still missing on purpose: 197 game_item_extra_get_list_dev, 1500 SC_ERROR_LOG_ADD,
|
||||
-- 2108 log_item_bonus_gold_set_add, 2207 game_block_hdd_serial_check (dev/log/anti-cheat only).
|
||||
USE [LosaGame]
|
||||
GO
|
||||
IF OBJECT_ID(N'dbo.game_pingpong', N'P') IS NOT NULL DROP PROCEDURE dbo.game_pingpong
|
||||
GO
|
||||
-- id 1: DB agent keep-alive; the code says "a query that does not really exist"
|
||||
CREATE PROCEDURE dbo.game_pingpong
|
||||
AS
|
||||
SET NOCOUNT ON
|
||||
GO
|
||||
IF OBJECT_ID(N'dbo.game_member_count', N'P') IS NOT NULL DROP PROCEDURE dbo.game_member_count
|
||||
GO
|
||||
-- id 136: OnSelectMemberConut - one LONG back, 0 = new account (the server then calls game_member_add)
|
||||
CREATE PROCEDURE dbo.game_member_count
|
||||
@userID varchar(12)
|
||||
AS
|
||||
SET NOCOUNT ON
|
||||
SELECT COUNT(*) FROM dbo.userMemberDB WITH(NOLOCK) WHERE userID = @userID
|
||||
GO
|
||||
IF OBJECT_ID(N'dbo.game_member_add', N'P') IS NOT NULL DROP PROCEDURE dbo.game_member_add
|
||||
GO
|
||||
-- id 137: OnInsertMember(privateID, publicID) - first login of a publisher account creates the game account
|
||||
CREATE PROCEDURE dbo.game_member_add
|
||||
@userID varchar(12),
|
||||
@nickName varchar(20)
|
||||
AS
|
||||
SET NOCOUNT ON
|
||||
IF EXISTS (SELECT 1 FROM dbo.userMemberDB WITH(NOLOCK) WHERE userID = @userID) RETURN
|
||||
DECLARE @ret int
|
||||
EXEC dbo.web_member_add @userID, @nickName, '', '', 0, 0, 0, 0, '127.0.0.1', @ret OUTPUT
|
||||
GO
|
||||
IF OBJECT_ID(N'dbo.game_create_nickname', N'P') IS NOT NULL DROP PROCEDURE dbo.game_create_nickname
|
||||
GO
|
||||
-- id 139: OnUpdateFirstPublicID(accountIDX, newNick)
|
||||
CREATE PROCEDURE dbo.game_create_nickname
|
||||
@accountIDX int,
|
||||
@nickName varchar(20)
|
||||
AS
|
||||
SET NOCOUNT ON
|
||||
UPDATE dbo.userMemberDB SET nickName = @nickName WHERE accountIDX = @accountIDX
|
||||
GO
|
||||
-- id 11 game_game_get_data: the released script returns cpID/cpUNIQ (channeling columns), but the game server only
|
||||
-- reads them when the locale uses channeling IDs (Korea). The Indonesia locale expects the same row without them.
|
||||
ALTER PROCEDURE [dbo].[game_game_get_data]
|
||||
(
|
||||
@userID varchar(12)
|
||||
)
|
||||
As
|
||||
SET NOCOUNT ON
|
||||
DECLARE @CURRENTDATE DATETIME
|
||||
DECLARE @CONNECTDATE DATETIME
|
||||
SET @CURRENTDATE = GETDATE();
|
||||
SET @CONNECTDATE = ( SELECT conndate FROM dbo.userGameDB WHERE accountIDX IN ( SELECT accountIDX FROM dbo.userMemberDB WHERE userID = @userID ))
|
||||
IF( @CURRENTDATE < @CONNECTDATE )
|
||||
SET @CONNECTDATE = @CURRENTDATE
|
||||
SELECT a.accountIDX, b.userID, b.nickName, a.userState, a.gameMoney
|
||||
, a.conn_count, @CONNECTDATE, a.userLevel, a.userEXP
|
||||
, b.eventType, isNull(c.class,0) as 'class', b.joinType, b.regDate, a.regionType
|
||||
, a.rencpoint, a.renspoint, isNull(c.region,0) as 'region', b.cpType
|
||||
, b.limitType, b.limitDate, a.userFishingLevel, a.userFishingEXP
|
||||
, a.refillData, a.userExcavationLevel, a.userExcavationEXP, a.userHerocEXP, a.userHerosEXP, a.practice
|
||||
FROM userGameDB a WITH( NOLOCK )
|
||||
JOIN userMemberDB b WITH( NOLOCK ) ON a.accountIDX = b.accountIDX
|
||||
LEFT JOIN userRankingDB c WITH( NOLOCK ) ON a.accountIDX = c.accountIDX
|
||||
WHERE b.userID = @userID
|
||||
GO
|
||||
@@ -0,0 +1,21 @@
|
||||
-- First regular tournament (Faction War / LS Cup panel). The main server only continues a row that exists;
|
||||
-- nothing creates the first one. leagueType 1 = TYPE_REGULAR, leagueState 1 = STATE_TEAM_APP, accountIDX 0 = no owner.
|
||||
-- Dates are YYMMDDHHMM in a DWORD (Help::ConvertCTimeToDate). Since 2022 that is above the int range, so the
|
||||
-- int columns hold the wrapped value; the server reads the same bits back as a DWORD.
|
||||
-- Starts on the last Monday 03:00 and runs next_tournament_hour (336) hours, like sp2_tournament_regular.ini.
|
||||
USE [LosaGame]
|
||||
GO
|
||||
IF NOT EXISTS (SELECT 1 FROM dbo.userLeagueListDB WHERE leagueType = 1)
|
||||
BEGIN
|
||||
DECLARE @s datetime, @e datetime, @a bigint, @b bigint
|
||||
SET @s = DATEADD(hour, 3, DATEADD(day, -(DATEDIFF(day, 0, GETDATE()) % 7), DATEDIFF(day, 0, GETDATE())))
|
||||
SET @e = DATEADD(hour, 336, @s)
|
||||
SET @a = CAST(YEAR(@s) % 100 AS bigint) * 100000000 + MONTH(@s) * 1000000 + DAY(@s) * 10000 + DATEPART(hour, @s) * 100
|
||||
SET @b = CAST(YEAR(@e) % 100 AS bigint) * 100000000 + MONTH(@e) * 1000000 + DAY(@e) * 10000 + DATEPART(hour, @e) * 100
|
||||
IF @a > 2147483647 SET @a = @a - 4294967296
|
||||
IF @b > 2147483647 SET @b = @b - 4294967296
|
||||
INSERT INTO dbo.userLeagueListDB (accountIDX, startDate, endDate, leagueType, leagueState, regDate)
|
||||
VALUES (0, @a, @b, 1, 1, GETDATE())
|
||||
END
|
||||
SELECT idx, startDate, endDate, leagueType, leagueState FROM dbo.userLeagueListDB
|
||||
GO
|
||||
@@ -0,0 +1,212 @@
|
||||
# LosaDev changes to the 2019 source
|
||||
|
||||
This snapshot is a copy of the 2019 source (213 heroes, `213LSK`). Every change against the original tree is listed here. All edits were made byte-safe (the sources are CP949): only the listed text was replaced, line endings were kept, and every other file is byte-identical to the original (checked by SHA-256 on 2026-11-07: 20 269 identical, 327 changed (including the new `.gitignore` and the host-name pass below), 0 added apart from the LosaDev files at the root).
|
||||
|
||||
## 1. What was left out of the copy
|
||||
|
||||
- Build output: `Debug\`, `Release\`, `x64\`, `Shipping*\`, `ipch\`, and `*.obj`, `*.pch`, `*.ipch`, `*.sdf`, `*.opensdf`, `*.suo`, `*.user`, `*.ncb`, `*.aps`, `*.tlog`, `*.pdb`, `*.ilk`, `*.idb`, `*.sbr`, `*.bsc`, `*.cod`, `*.lastbuildstate`, `*.unsuccessfulbuild`.
|
||||
- IDE and VCS folders: `.vs\`, `.git\` (the old repository history, 450 MB), and the previous owner's `.gitignore` (it ignored every `bin\` folder, which holds needed libraries). A new `.gitignore` is at the root.
|
||||
|
||||
Third-party libraries (`lib\`, `extra\lib\`, `extra\include\`, `etc\Library\`, wxWidgets, Bullet, gperftools, ziparchive, the anti-cheat SDKs) are kept as they were. Exception: the vendor SDK binaries listed under "Vendor SDK binaries removed" below.
|
||||
|
||||
## 2. Build fixes
|
||||
|
||||
| File | Change | Why |
|
||||
|---|---|---|
|
||||
| `src\ls_relaysvr\Manager.cpp` | `g_UDPNode()->InitMemory(3000,16384*2,6000,6000,1000);` became `InitMemory(3000,16384*2,6000/*,6000,1000*/);` | `C2661`: `UDPNode` (source in `src\iocpSocketDLL` and the prebuilt `lib\iocpSocketDLL.lib`) only has 3- and 7-argument overloads; no 5-argument version exists anywhere in the tree. The 2014 relay server has exactly this line, so the 3-argument call (`packetCount = 6000`) is the original developers' own fix. |
|
||||
| `win\projects\LogDLL.vcxproj`, `win\projects\FrameTimerDLL.vcxproj` | Each post-build `copy ... ..\..\build\zone_office\<server>\` line now starts with `if exist "<that folder>\"` | The copy failed when the `zone_office` folders did not exist, which failed the build. The DLL itself was always fine. |
|
||||
| `src\ioFreeType\StdAfx.h` | `#pragma comment(lib, "../LSLog/bin/LSLog.lib")` (and `LSLogd.lib`) now point at `../../lib/` | `LNK1104`: `LSLog` builds into `lib\`; `src\LSLog\bin\` does not exist in this release. |
|
||||
|
||||
## 3. Secrets and personal data replaced
|
||||
|
||||
Placeholders: `127.0.0.1` for addresses the code connects to, `192.0.2.1` (a reserved documentation address that never matches a real host) where the code compares the server's own IP against a fixed list, and `CHANGE_ME` for keys, passwords, tokens and account names. Private network addresses (`10.x`, `172.16-31.x`, `192.168.x`) were left as they are.
|
||||
|
||||
| File | Replaced |
|
||||
|---|---|
|
||||
| `extra/LS_Monitor/LS_Monitor/config.ini` | 10 public IP(s) |
|
||||
| `extra/LS_MonitorClient/Bin/config.ini` | 4 public IP(s) |
|
||||
| `extra/LS_MonitorClient/LS_MonitorClient/config.ini` | 10 public IP(s) |
|
||||
| `extra/LS_Service/bin/server.txt` | 1 public IP(s) |
|
||||
| `extra/testNXShop/testCode/cTestThread.cpp` | 1 public IP(s) |
|
||||
| `extra/testNXShop/testCode/testCode.cpp` | 1 public IP(s) |
|
||||
| `sql/20120504/lostsaga_sp.sql` | 1 public IP(s) |
|
||||
| `src/BillingRelayServer/billingrelayserverinfo.ini` | 1 public IP(s) |
|
||||
| `src/BillingRelayServer/Channeling/ioChannelingNodeDaum.cpp` | 1 public IP(s) |
|
||||
| `src/BillingRelayServer/Channeling/ioChannelingNodeWemadeBuy.cpp` | 1 public IP(s), billing session value |
|
||||
| `src/BillingRelayServer/ipg/sample/asp/ipg_cli_input.asp` | e-mail address |
|
||||
| `src/BillingRelayServer/Local/ioLocalIndonesia.cpp` | 2 public IP(s) |
|
||||
| `src/BillingRelayServer/Local/ioLocalTaiwan.cpp` | player account id |
|
||||
| `src/BillingRelayServer/Local/ioLocalThailand.cpp` | 10 public IP(s) |
|
||||
| `src/ErrorDlg/ErrorDlg/ErrorDlg.vcxproj` | developer user folder (post-build now copies `$(TargetPath)`) |
|
||||
| `src/ErrorDlg/ErrorDlg/HackShield/ioHackShield.cpp` | 1 public IP(s) |
|
||||
| `src/ls_billingsvr/Channeling/ioChannelingNodeDaum.cpp` | 1 public IP(s) |
|
||||
| `src/ls_billingsvr/Channeling/ioChannelingNodeWemadeBuy.cpp` | 1 public IP(s), billing session value |
|
||||
| `src/ls_billingsvr/Channeling/ioChannelingNodeWemadeCashLink.cpp` | 1 public IP(s), billing session value |
|
||||
| `src/ls_billingsvr/Local/ioLocalBrazil.cpp` | publisher hash key |
|
||||
| `src/ls_billingsvr/Local/ioLocalEU.cpp` | 1 public IP(s) |
|
||||
| `src/ls_billingsvr/Local/ioLocalIndonesia.cpp` | 2 public IP(s) |
|
||||
| `src/ls_billingsvr/Local/ioLocalLatin.cpp` | 2 public IP(s) |
|
||||
| `src/ls_billingsvr/Local/ioLocalSA.cpp` | 6 public IP(s) |
|
||||
| `src/ls_billingsvr/Local/ioLocalThailand.cpp` | 10 public IP(s) |
|
||||
| `src/ls_billingsvr/Local/ioLocalUS.cpp` | publisher app id, test account + password, publisher hash key |
|
||||
| `src/ls_gamesvr/MainProcess.cpp` | 2 public IP(s) (2 in address comparisons -> 192.0.2.1) |
|
||||
| `src/ls_gamesvr/NodeInfo/LicenseManager.h` | 1 public IP(s) |
|
||||
| `src/ls_gamesvr/Xtrap/XTrap4Server.cpp` | 3 public IP(s) (1 in address comparisons -> 192.0.2.1) |
|
||||
| `src/ls_mainsvr/MainProcess.cpp` | 2 public IP(s) (2 in address comparisons -> 192.0.2.1) |
|
||||
| `src/LSAutoUpgrade/_참고/ls.asp` | SQL connection string (host, login, password) |
|
||||
| `src/LSAutoUpgrade/AutoUpgradeDlg.cpp` | login token |
|
||||
| `src/LSAutoUpgrade/ioLoginDlg.cpp` | 1 public IP(s) |
|
||||
| `src/LSAutoUpgrade/Xtrap/ioXtrap.cpp` | XTrap license id(s) |
|
||||
| `src/LSClient/config/debug_connect.ini` | login token |
|
||||
| `src/LSClient/Login.cpp` | login token |
|
||||
| `src/LSClient/XignCode/ioXignCode.cpp` | XignCode license key |
|
||||
| `src/LSClient/Xtrap/ioXtrap.cpp` | XTrap license id(s) |
|
||||
| `src/LSClientMT/config/debug_connect.ini` | login token |
|
||||
| `src/LSClientMT/Login.cpp` | login token |
|
||||
| `src/LSClientMT/XignCode/ioXignCode.cpp` | XignCode license key |
|
||||
| `src/LSClientMT/Xtrap/ioXtrap.cpp` | XTrap license id(s) |
|
||||
| `src/LSMonitor/LSMonitorDlg.cpp` | LSMonitor login password |
|
||||
| `src/LSWebBroker/_CMD.txt` | login token |
|
||||
| `src/LSWebBroker/Local/ioLocalBrazil.cpp` | login token |
|
||||
| `src/LSWebBroker/Local/ioLocalEU.cpp` | login token |
|
||||
| `src/LSWebBroker/Local/ioLocalLatin.cpp` | login token |
|
||||
| `src/LSWebBroker/Local/ioLocalUS.cpp` | login token |
|
||||
| `src/MainServer/Window.cpp` | 2 public IP(s) (2 in address comparisons -> 192.0.2.1) |
|
||||
| `src/PatchManager/PatchManager.cpp` | 1 public IP(s) |
|
||||
| `src/SP2LostSagaGameServer/NodeInfo/LicenseManager.h` | 1 public IP(s) |
|
||||
| `src/SP2LostSagaGameServer/Window.cpp` | 1 public IP(s) (1 in address comparisons -> 192.0.2.1) |
|
||||
|
||||
The anti-cheat license strings (XTrap, XignCode) are only used by the Shipping configurations with those SDKs; Debug and Release do not use them.
|
||||
|
||||
## 4. Left in place on purpose
|
||||
|
||||
These are part of the game itself and are needed to read its data or talk to the client:
|
||||
|
||||
- Pack (`.iop`) passwords per country in `src\io3DEngine\ioLocalManagerParent.cpp` (stored encoded, with the plain text in comments), repeated in the `PatchManager`, `PatchManagerOld`, `LSAutoUpgrade` and `ErrorDlg` copies of the local managers.
|
||||
- `WEB_UDP_KEY_VALUE` in `src\ls_gamesvr\NodeInfo\UserNodeManager.h` and the check key `EDEW3940FVDP4950` in the launcher command-line notes.
|
||||
- Packet and DB password encoding in `iocpSocketDLL` and `ls_dbagent` (`ls_dbagent.exe -x`).
|
||||
- Copyright and author e-mail addresses in third-party code and `.rc` version blocks.
|
||||
|
||||
## 5. Build test
|
||||
|
||||
Copied to a scratch folder and built on 2026-11-07 in **Release|Win32** with the v100 toolset (VS2010, via VS2022 MSBuild), `Version.h` created next to every `TSvnVersion.tmpl`, the TortoiseSVN pre-build step disabled and static-runtime Boost:
|
||||
|
||||
| Solution | Result |
|
||||
|---|---|
|
||||
| `ioINILoader`, `Log`, `LogDLL`, `FrameTimerDLL`, `iocpSocketDLL`, `LSLog`, `SharedContainer`, `PerfMon`, `TownPortal`, `ioFreeType` | Build |
|
||||
| `io3DEngine` | Builds |
|
||||
| `ls_dbagent`, `ls_mainsvr`, `ls_billingsvr`, `ls_gamesvr`, `ls_relaysvr`, `ls_loginsvr`, `ls_filewritesvr` | Build |
|
||||
| `LSClient` | Builds `LostSaga.exe` |
|
||||
| `ioPac` | Builds (Release, 0 errors) after the BigPac fix in "ioPac BigPac fix" below. Before the fix `BigPac.cpp` used members that `BigPac.h` did not declare. |
|
||||
|
||||
## Publisher and operator host names (added 2026-11-07)
|
||||
|
||||
Owner decision: no real publisher, operator or game-service host names in the repository. Every such host was replaced in text files (same byte-safe method as above, CP949 as Latin-1, UTF-16 `.sql` only when lossless, line endings kept):
|
||||
|
||||
- a URL `scheme://host[:port]/path` became `http://127.0.0.1/path` (the path is kept, the port dropped);
|
||||
- a bare host name became `example.invalid`;
|
||||
- e-mail addresses at the developer's and publisher's own domains (`@ioenter.com`, `@nexon.co.kr`) became `@example.invalid` (the part before `@` is kept). Files: `src/BillingRelayServer/Local/ioLocalTaiwan.cpp` (10), `src/BillingRelayServer/Local/ioLocalUS.cpp` (10), `src/ls_billingsvr/Local/ioLocalEU.cpp` (9), `src/ls_billingsvr/Local/ioLocalUS.cpp` (9), `src/ls_gamesvr/Channeling/ioChannelingNodeNexonBuy.cpp` (1).
|
||||
|
||||
2313 replacements in 279 files, 74 hosts. Hosts (number of replacements): `nxsoap.nexon.com` (1421), `testsoap.nexon.com` (703), `www.lostsaga.com` (13), `lostsaga.com` (12), `billingws.gamon.net` (12), `forum.gemscool.com` (7), `lostsaga.ogplanet.com` (7), `nxpay.nexon.com` (7), `billlosatest.wemade.com` (6), `secure3.asiasoft.co.th` (5), `www.lostsaga.jp` (5), `www.gemscool.com` (4), `cdn.lostsaga.z8games.com` (4), `www.playone.asia` (4), `www.lostsaga.in.th` (4), `www.gamon.net` (4), `images.z8games.com` (4), `ls.garena.in.th` (4), `lostsaga.gamon.net` (4), `profile.playcybergames.com` (4), `www.z8games.com` (3), `lostsaga.z8games.com` (3), `games.playpark.com` (3), `www.gameclub.ph` (3), `platform.garena.tw` (2), `cabinet.ogplanet.com` (2), `patch.lostsaga.com.tw` (2), `lostsaga.gemscool.com` (2), `na-qa.launcher.z8games.com` (2), `en.lostsaga.nexoneu.com` (2), `passport.nexoneu.com` (2), `test.bill.daum.net` (2), `losa.nexon.com` (2), `www.daum.net` (2), `authen.playpark.net` (2), `cdn.lostsaga.com` (2), `www.nxcreative.co.kr` (2), `support.z8games.com` (2), `download.lostsaga.com` (2), `search.daum.net` (2), `qa-happycode.mangot5.com` (2), `ripay.nexon.com` (1), `ripay-test.nexon.com` (1), `api.z8games.com` (1), `doc.valofe.com` (1), `app.z8games.com` (1), `alpha.lostsaga-tw.valofe.com` (1), `beta.lostsaga-tw.valofe.com` (1), `lostsaga.nefficient.co.kr` (1), `lostsaga-tw.valofe.com` (1), `network.adsmarket.com` (1), `aspdll.xonda.net` (1), `www.lostsaga.ph` (1), `beta.www.lostsaga.com` (1), `start.tiara.daum.net` (1), `citystat.playone.asia` (1), `game.playpark.com` (1), `my.playpark.com` (1), `www.playpark.com` (1), `billing.ogplanet.com` (1), `apis-test.nexon.com` (1), `api.ogplanet.com` (1), `lostsaga.wemadeusa.com` (1), `alpha.api.bill.naver.com` (1), `www.softnyx.com` (1), `tr.lostsaga.nexoneu.com` (1), `ls.gameclub.ph` (1), `lostsaga.garena.tw` (1), `vfun.valofe.com` (1), `de.lostsaga.nexoneu.com` (1), `support.lostsaga.nexoneu.com` (1), `fr.lostsaga.nexoneu.com` (1), `pl.lostsaga.nexoneu.com` (1), `it.lostsaga.nexoneu.com` (1).
|
||||
|
||||
| Folder | Files | Replacements | Hosts |
|
||||
|---|---|---|---|
|
||||
| `extra/LS_NXSoap/LS_NXSoap/` | 66 | 657 | nxsoap.nexon.com |
|
||||
| `extra/LS_NXSoap/NEXON_live/` | 72 | 764 | nxsoap.nexon.com |
|
||||
| `extra/LS_NXSoap/NEXON_testnx/` | 66 | 703 | testsoap.nexon.com |
|
||||
| `extra/testHTTP/testCode/` | 1 | 1 | apis-test.nexon.com |
|
||||
| `src/BillingRelayServer/` | 1 | 3 | alpha.api.bill.naver.com, api.ogplanet.com, billing.ogplanet.com |
|
||||
| `src/BillingRelayServer/Channeling/` | 2 | 3 | billlosatest.wemade.com, test.bill.daum.net |
|
||||
| `src/BillingRelayServer/Local/` | 1 | 16 | billingws.gamon.net, www.gamon.net |
|
||||
| `src/ErrorDlg/ErrorDlg/` | 7 | 8 | forum.gemscool.com, games.playpark.com, lostsaga.gamon.net, lostsaga.wemadeusa.com, www.lostsaga.com, www.lostsaga.in.th, www.lostsaga.jp |
|
||||
| `src/ls_billingsvr/Channeling/` | 4 | 7 | billlosatest.wemade.com, qa-happycode.mangot5.com, test.bill.daum.net |
|
||||
| `src/ls_billingsvr/Local/` | 2 | 3 | api.z8games.com, app.z8games.com, network.adsmarket.com |
|
||||
| `src/ls_gamesvr/Channeling/` | 3 | 8 | doc.valofe.com, losa.nexon.com, nxpay.nexon.com, ripay.nexon.com, ripay-test.nexon.com |
|
||||
| `src/LSAutoUpgrade/` | 4 | 25 | authen.playpark.net, cdn.lostsaga.com, cdn.lostsaga.z8games.com, citystat.playone.asia, game.playpark.com, my.playpark.com, profile.playcybergames.com, search.daum.net, secure3.asiasoft.co.th, start.tiara.daum.net, www.daum.net, www.nxcreative.co.kr, www.playpark.com |
|
||||
| `src/LSAutoUpgrade/_참고/` | 2 | 4 | cabinet.ogplanet.com, patch.lostsaga.com.tw |
|
||||
| `src/LSAutoUpgrade/Local/` | 12 | 50 | cdn.lostsaga.z8games.com, de.lostsaga.nexoneu.com, en.lostsaga.nexoneu.com, forum.gemscool.com, fr.lostsaga.nexoneu.com, images.z8games.com, it.lostsaga.nexoneu.com, lostsaga.garena.tw, lostsaga.gemscool.com, lostsaga.z8games.com, ls.gameclub.ph, ls.garena.in.th, passport.nexoneu.com, pl.lostsaga.nexoneu.com, platform.garena.tw, support.lostsaga.nexoneu.com, support.z8games.com, tr.lostsaga.nexoneu.com, vfun.valofe.com, www.gameclub.ph, www.gemscool.com, www.lostsaga.com, www.lostsaga.jp, www.playone.asia, www.softnyx.com, www.z8games.com |
|
||||
| `src/LSClient/` | 3 | 13 | lostsaga.com, nxpay.nexon.com |
|
||||
| `src/LSClient/Local/` | 7 | 8 | forum.gemscool.com, games.playpark.com, lostsaga.gamon.net, lostsaga.ogplanet.com, www.lostsaga.com, www.lostsaga.in.th, www.lostsaga.jp |
|
||||
| `src/LSClientMT/` | 2 | 2 | nxpay.nexon.com |
|
||||
| `src/LSClientMT/Local/` | 7 | 8 | forum.gemscool.com, games.playpark.com, lostsaga.gamon.net, lostsaga.ogplanet.com, www.lostsaga.com, www.lostsaga.in.th, www.lostsaga.jp |
|
||||
| `src/LSMonitor/Sms/` | 2 | 2 | aspdll.xonda.net, lostsaga.com |
|
||||
| `src/LSWebBroker/` | 3 | 7 | download.lostsaga.com, lostsaga.nefficient.co.kr, www.lostsaga.com |
|
||||
| `src/LSWebBroker/Local/` | 12 | 21 | alpha.lostsaga-tw.valofe.com, beta.lostsaga-tw.valofe.com, beta.www.lostsaga.com, cdn.lostsaga.z8games.com, forum.gemscool.com, lostsaga.gamon.net, lostsaga.ogplanet.com, lostsaga-tw.valofe.com, na-qa.launcher.z8games.com, www.lostsaga.com, www.lostsaga.in.th, www.lostsaga.jp, www.lostsaga.ph |
|
||||
|
||||
Binary files, patched only with same-length replacements (`nxsoap.nexon.com` -> `xexample.invalid`, `testsoap.nexon.com` -> `xxxexample.invalid`, and so on, so sizes and offsets do not change):
|
||||
|
||||
- `extra\lib\`: `LS_NXSoap.lib`, `LS_NXSoapD.lib`, `LS_NXSoapTEST.lib`, `LS_NXSoapTESTD.lib`. The SOAP namespace and endpoint strings inside the libraries now use the padded `.invalid` names.
|
||||
- Vendor documents `src\BillingRelayServer\OGPDocument\1. IOEntertainment.doc`, `4. installer package components.doc` (OGPlanet hosts) and `src\LSMonitor\Sms\Xonda_net_SMSWS_v1.0.doc` (SMS service host).
|
||||
|
||||
Left on purpose (not publisher or game-service hosts): standards and XML namespaces (`www.w3.org`, `schemas.microsoft.com`, `schemas.xmlsoap.org`), homepages and documentation links of third-party libraries and their authors (Bullet, ZipArchive, OPCODE, Lua, TinyXML, Ogg Vorbis, wxWidgets, gperftools, OpenSSL, libcurl and others), copyright lines that name a company without a host (Wellbia, INCA, Bandisoft), `api.ipify.org` (public IP lookup used by the launcher), `www.google-analytics.com` (the analytics collector; the tracking id comes from config), the Steam SDK headers (`store.steampowered.com`, `www.steamgames.com`), and the vendor addresses inside third-party binaries listed above in section "Left in place on purpose".
|
||||
|
||||
## Local run fixes (added 2026-11-07)
|
||||
|
||||
Found while running this source on one local PC. Byte patches, line endings kept.
|
||||
|
||||
| File | Change | Why |
|
||||
|---|---|---|
|
||||
| `src\ls_gamesvr\Local\ioLocalParent.cpp`, `src\LSClient\Local\ioLocalParent.cpp` | `IsRightLicense()` no longer compares the date (`if( iDate >= GetLicenseDate() ) return false;` replaced by `(void)iDate;`) | The Indonesia license dates (server 2013-12-31, client 2012-11-30) have passed: the game server exited with "This program has expired", the client showed "Your license has com up for renewal.". |
|
||||
| `src\ls_billingsvr\LoginManager\LoginManager.cpp` | In `CheckLogin()`, the Indonesia `TestMode` success branch moved before the `pInfo == NULL` check | Without the launcher nobody fills the login list, so every TestMode login failed. |
|
||||
| `src\ls_gamesvr\NodeInfo\UserNodeManager.cpp` | The two `__OHTG_LOGIN_IP_CHECK__` comparisons in `OnResultSelectUserLoginInfo()` are skipped when `szTestIP` is empty | The Indonesia locale never decrypts an IP key, so the check always failed (`USER IP NOT2`). |
|
||||
| `src\ls_mainsvr\MainProcess.cpp` | The `MessageBox` "Local IP Error." became a log line | A server started without a window would wait on the dialog for ever. |
|
||||
|
||||
## Client text (added 2026-11-07)
|
||||
|
||||
`SafeSprintf` and the printers built on it have two paths. Korea uses `printf` (`%s %d`), every other locale uses `FormatMessage` (`%1 %2`). This repository is set up for the Indonesia client:
|
||||
|
||||
| Files | Change | Why |
|
||||
|---|---|---|
|
||||
| 193 `.cpp` files in `src\LSClient` | 841 literal formats of `AddTextPiece`, `PrintText`, `PrintTextWidthCut`, `SetMsgBox`, `SafeSprintf` and related calls changed from `%s %d %u %I64d` to `%1 %2` | They printed as raw text outside Korea. |
|
||||
| The same files | 2 556 Korean literals inside functions became `STR(n)` | Text belongs in the text tables. The rows are added to `resource/text/text_id.txt` in the client download, in Korean until translated. Left as they are: string comparisons, `_e` macros and literals outside functions. |
|
||||
| `src\io3DEngine\Safesprintf.cpp` | New `FormatPrintfStyle()` | `%02d` and `%.2f` cannot be written as `%1`; they are formatted from the argument strings. |
|
||||
| `src\io3DEngine\ioXMLElement.cpp` | Child elements inherit the text table setting | `STR(n)` in nested XML, such as `TextBlock`, printed as raw text. |
|
||||
| `src\LSClient\GUI\EtcItemSlotWnd.cpp`, `GrowthDownSelectWnd.cpp` | Array initializers changed for `STR(n)` | `STR` returns a pointer. |
|
||||
|
||||
**Side effect:** in the Korea locale these literals now print `%1`. To run Korea, use the original format strings or add a table for that locale.
|
||||
## Bug fixes (added 2026-11-07)
|
||||
|
||||
| File | Change | Why |
|
||||
|---|---|---|
|
||||
| `src\LSClient\Setting.cpp` | `LOW_SPEC` and `MINIMUM_SPEC` presets set `m_bUse16bitFrameBuffer = false` | These presets asked for a 16-bit full screen device, which current Windows refuses; the client exited without a window. |
|
||||
| `db\losadev\losadev-2019-procs.sql` | Procedures the 2019 server calls (`ls_query.ini` ids 1, 136, 137, 139) that no released DB script contains | Login and the DB agent keep-alive failed. |
|
||||
| `db\losadev\losadev-first-tournament.sql` | First `userLeagueListDB` row | Faction War / LS Cup showed no dates. |
|
||||
| `server-config\ls_gamesvr\config\` (10 files) | The client's `sp2_deco_*`, `sp2_extraitem_info`, `sp2_gashapon_present`, `sp2_item_price`, `sp2_item_recharge`, `sp2_leader_item`, `sp2_medalitem_info`, `sp2_new_alchemic_info`, `sp2_setitem_info` copied over the server's (same keys) | Shop and gacha lists did not match the client. Copy them over the release's server config. |
|
||||
| Client download: `xml/myinventoryinfownd.xml` in `rs.iop` | Window IDs changed to the ones in `MyInventoryInfoWnd.h` | My Item buttons were on top of each other. || `src\LSClient\GUI\CostumeCustomWnd.cpp` | The costume skin delete check compares the typed word with `CostumeSkinHapus` instead of the Korean literal | The window asks the player to type `CostumeSkinHapus` (text table), but the code compared a Korean word nobody can type on this client. |
|
||||
| `server-config\ls_gamesvr\config\sp2_mode_select.ini` | Shuffle Bonus subs 30-32 and Factory subs 2-3 set to `active = 0`, `map_cnt = 0` | The client has no maps for them (black screen). |
|
||||
|
||||
## Vendor SDK binaries removed (added 2026-11-07)
|
||||
|
||||
No vendor SDK binaries are shared in any LosaDev tier. The source code that uses them stays.
|
||||
|
||||
Deleted XTrap libraries/DLLs (13): `src\LSAutoUpgrade\Xtrap\XTrap4Launcher_mt.lib`, `src\LSClient\Xtrap\XTrap4ClientExt1_mtdll.lib`, `src\LSClient\Xtrap\XTrap4Client_ClientPart_mtDll.lib`, `src\LSClient\Xtrap\XTrap4Client_ServerPart_mtDll.lib`, `src\LSClient\Xtrap\XTrap4Client_mtDll.lib`, `src\LSClient\Xtrap\XTrap_Unipher_mtDll.lib`, `src\LSClientMT\Xtrap\XTrap4ClientExt1_mtdll.lib`, `src\LSClientMT\Xtrap\XTrap4Client_ClientPart_mtDll.lib`, `src\LSClientMT\Xtrap\XTrap4Client_ServerPart_mtDll.lib`, `src\LSClientMT\Xtrap\XTrap4Client_mtDll.lib`, `src\LSClientMT\Xtrap\XTrap_Unipher_mtDll.lib`, `src\SP2LostSagaGameServer\Xtrap\XTrap4Server.dll`, `src\ls_gamesvr\Xtrap\XTrap4Server.dll`.
|
||||
|
||||
Deleted `bxIPGClient.dll` copies (7): `lib\bxIPGClient.dll`, `src\BillingRelayServer\JapanDLL\bxIPGClient.dll`, `src\BillingRelayServer\bxIPGClient.dll`, `src\BillingRelayServer\ipg\bin\bxIPGClient.dll`, `src\ls_billingsvr\Adbill\bxIPGClient.dll`, `src\ls_billingsvr\JapanDLL\bxIPGClient.dll`, `src\ls_billingsvr\ipg\bin\bxIPGClient.dll`.
|
||||
|
||||
`#import "...bxIPGClient.dll" no_namespace` needs the DLL at compile time, so it was replaced by `#include "...bxIPGClient_stub.h"` in:
|
||||
|
||||
- `src\BillingRelayServer\Local\ioLocalJapan.cpp`
|
||||
- `src\ls_billingsvr\Channeling\ioChannelingNodeHappyTuk.cpp`
|
||||
- `src\ls_billingsvr\Channeling\ioChannelingNodeValofe.cpp`
|
||||
- `src\ls_billingsvr\Local\ioLocalJapan.cpp`
|
||||
|
||||
New stand-in headers: `src\BillingRelayServer\JapanDLL\bxIPGClient_stub.h`, `src\ls_billingsvr\Adbill\bxIPGClient_stub.h`, `src\ls_billingsvr\JapanDLL\bxIPGClient_stub.h`. They declare only what the code calls (`IIPGClient` with `GetCash`, `Output`, `OutputCancel`, `OutputIPG`, and the `IIPGClientPtr` smart pointer). The COM class is never registered, so `CreateInstance` fails, the pointer stays empty and the existing `catch( _com_error )` paths run: the Japan IPG and Adbill billing calls report an error, nothing else changes.
|
||||
|
||||
Verified 2026-11-07: `ls_billingsvr` Release|Win32 builds with 0 errors with no `bxIPGClient.dll` present. `BillingRelayServer` gets the same header but was not build-tested.
|
||||
|
||||
The XTrap code is only compiled in Shipping configurations with `XTRAP` defined. Those configurations no longer link without the vendor SDK; build Debug or Release.
|
||||
|
||||
Script: `vendor-strip.js` (latin1 byte-safe, CRLF kept).
|
||||
|
||||
## ioPac BigPac fix (added 2026-11-07)
|
||||
|
||||
`src\ioPac\BigPac.cpp` is newer than `BigPac.h` (the header is the 2014 one, byte-identical), so ioPac did not build and the release only worked with the prebuilt `lib\iopac.dll`.
|
||||
|
||||
| File | Change |
|
||||
|---|---|
|
||||
| `src\ioPac\BigPac.h` | Added `vFileInfo m_vecFileInfo;` next to `m_setFileInfo`, and declarations for the functions the .cpp defines: `OpenBigPacAll`, `GetFileIndexVec`, `AddFile`, `DeleteFiles` (public), `BuildFileInfo`, `ClearFileInfo` (private). Each addition is marked `LosaDev`. |
|
||||
| `src\ioPac\BigPac.cpp` | `CBigPac::OpenBigPacAll` (IOP Manager only) wrapped in `#ifdef STATIC_PAC_API`, because it calls `BuildFileInfo()`, which is only defined in that block. Without it the DLL build fails to link. |
|
||||
|
||||
Verified 2026-11-07: Release|Win32 builds with 0 errors. The new `iopac.dll` (279 040 bytes) exports 71 functions, a superset of the 66 in the prebuilt DLL (none missing). The LosaDev client package ships this rebuilt DLL.
|
||||
|
||||
Scripts: `bigpac-header.js`, `bigpac-cpp.js` (latin1 byte-safe, CRLF kept).
|
||||
@@ -0,0 +1,29 @@
|
||||
# Lost Saga source, 2019 (213 heroes)
|
||||
|
||||
Developer snapshot of the 2019 Lost Saga source (`213LSK`), shared by the LosaDev community for study and private-server development. Access tier: Public.
|
||||
|
||||
- Servers, client, engine, launcher (`LSAutoUpgrade`), `LSWebBroker` and tools, with the prebuilt libraries needed to build them.
|
||||
- Database: base scripts from 2012 in `sql\20120504\` plus dated feature patches (2017 to 2019) in `DB\`.
|
||||
- No server config set and no `ls_query.ini` yet (see the wiki for a starting point).
|
||||
- The matching game client (a modified Gemscool Indonesia client, 2019) is a separate download, not in Git.
|
||||
|
||||
Layout: solutions in `win\` (server and library projects in `win\projects\`), code in `src\`, libraries in `lib\`, billing-server extras in `extra\`, video/audio SDKs in `etc\Library\`.
|
||||
|
||||
## Build
|
||||
|
||||
1. Install Visual Studio 2010 SP1 (Professional or higher, toolset v100), the DirectX SDK (June 2010) and Boost 1.47 and 1.50 with static-runtime libraries (`-mt-s`, `-mt-sgd`).
|
||||
2. Create `Version.h` next to every `TSvnVersion.tmpl` and disable the TortoiseSVN pre-build step, for example:
|
||||
```bat
|
||||
MSBuild win\ls_gamesvr.sln /p:Configuration=Release /p:Platform=Win32 /p:PreBuildEventUseInBuild=false
|
||||
```
|
||||
3. Build in this order: base libraries, `ioFreeType`/`io3DEngine`, the `ls_*` servers, then `LSClient`. Use **Debug** or **Release**.
|
||||
|
||||
Server output goes to `build\zone_dev\` or `build\zone_dist\`, one level above this folder.
|
||||
|
||||
Full guide: https://losadev.wiki/guides/before-you-start/ and https://losadev.wiki/guides/source-2019/
|
||||
|
||||
## Changes in this snapshot
|
||||
|
||||
`PATCHES-LosaDev.md` lists every change against the original tree: the local run fixes (license date off, TestMode login, empty IP key, no modal dialog in the main server), three small build fixes (relay server `InitMemory`, tolerant post-build copies, `ioFreeType` library path) and the secrets that were replaced with placeholders (`CHANGE_ME`, `127.0.0.1`, `192.0.2.1`).
|
||||
|
||||
Lost Saga is the property of its original developers and publishers. This snapshot is fan-made, not affiliated with them, and meant for research and learning.
|
||||
|
After Width: | Height: | Size: 65 KiB |
|
After Width: | Height: | Size: 384 KiB |
|
After Width: | Height: | Size: 192 KiB |
|
After Width: | Height: | Size: 192 KiB |
@@ -0,0 +1,187 @@
|
||||
xof 0303txt 0032
|
||||
template VertexDuplicationIndices {
|
||||
<b8d65549-d7c9-4995-89cf-53a9a8b031e3>
|
||||
DWORD nIndices;
|
||||
DWORD nOriginalVertices;
|
||||
array DWORD indices[nIndices];
|
||||
}
|
||||
|
||||
template FVFData {
|
||||
<b6e70a0e-8ef9-4e83-94ad-ecc8b0c04897>
|
||||
DWORD dwFVF;
|
||||
DWORD nDWords;
|
||||
array DWORD data[nDWords];
|
||||
}
|
||||
|
||||
template VertexElement {
|
||||
<f752461c-1e23-48f6-b9f8-8350850f336f>
|
||||
DWORD Type;
|
||||
DWORD Method;
|
||||
DWORD Usage;
|
||||
DWORD UsageIndex;
|
||||
}
|
||||
|
||||
template DeclData {
|
||||
<bf22e553-292c-4781-9fea-62bd554bdd93>
|
||||
DWORD nElements;
|
||||
array VertexElement Elements[nElements];
|
||||
DWORD nDWords;
|
||||
array DWORD data[nDWords];
|
||||
}
|
||||
|
||||
template EffectParamFloats {
|
||||
<3014b9a0-62f5-478c-9b86-e4ac9f4e418b>
|
||||
STRING ParamName;
|
||||
DWORD nFloats;
|
||||
array FLOAT Floats[nFloats];
|
||||
}
|
||||
|
||||
template EffectParamString {
|
||||
<1dbc4c88-94c1-46ee-9076-2c28818c9481>
|
||||
STRING ParamName;
|
||||
STRING Value;
|
||||
}
|
||||
|
||||
template EffectParamDWord {
|
||||
<e13963bc-ae51-4c5d-b00f-cfa3a9d97ce5>
|
||||
STRING ParamName;
|
||||
DWORD Value;
|
||||
}
|
||||
|
||||
template EffectInstance {
|
||||
<e331f7e4-0559-4cc2-8e99-1cec1657928f>
|
||||
STRING EffectFilename;
|
||||
[...]
|
||||
}
|
||||
|
||||
|
||||
Mesh {
|
||||
24;
|
||||
-0.800000;-0.500000;-0.100000;,
|
||||
-0.800000;-0.500000;0.100000;,
|
||||
-0.800000;0.500000;0.100000;,
|
||||
-0.800000;0.500000;-0.100000;,
|
||||
-0.800000;0.500000;-0.100000;,
|
||||
-0.800000;0.500000;0.100000;,
|
||||
0.800000;0.500000;0.100000;,
|
||||
0.800000;0.500000;-0.100000;,
|
||||
0.800000;0.500000;-0.100000;,
|
||||
0.800000;0.500000;0.100000;,
|
||||
0.800000;-0.500000;0.100000;,
|
||||
0.800000;-0.500000;-0.100000;,
|
||||
-0.800000;-0.500000;0.100000;,
|
||||
-0.800000;-0.500000;-0.100000;,
|
||||
0.800000;-0.500000;-0.100000;,
|
||||
0.800000;-0.500000;0.100000;,
|
||||
-0.800000;-0.500000;0.100000;,
|
||||
0.800000;-0.500000;0.100000;,
|
||||
0.800000;0.500000;0.100000;,
|
||||
-0.800000;0.500000;0.100000;,
|
||||
-0.800000;-0.500000;-0.100000;,
|
||||
-0.800000;0.500000;-0.100000;,
|
||||
0.800000;0.500000;-0.100000;,
|
||||
0.800000;-0.500000;-0.100000;;
|
||||
12;
|
||||
3;0,1,2;,
|
||||
3;2,3,0;,
|
||||
3;4,5,6;,
|
||||
3;6,7,4;,
|
||||
3;8,9,10;,
|
||||
3;10,11,8;,
|
||||
3;12,13,14;,
|
||||
3;14,15,12;,
|
||||
3;16,17,18;,
|
||||
3;18,19,16;,
|
||||
3;20,21,22;,
|
||||
3;22,23,20;;
|
||||
|
||||
MeshTextureCoords {
|
||||
24;
|
||||
0.000000;1.000000;,
|
||||
0.000000;0.000000;,
|
||||
1.000000;0.000000;,
|
||||
1.000000;1.000000;,
|
||||
0.000000;1.000000;,
|
||||
0.000000;0.000000;,
|
||||
1.000000;0.000000;,
|
||||
1.000000;1.000000;,
|
||||
0.000000;1.000000;,
|
||||
0.000000;0.000000;,
|
||||
1.000000;0.000000;,
|
||||
1.000000;1.000000;,
|
||||
0.000000;1.000000;,
|
||||
0.000000;0.000000;,
|
||||
1.000000;0.000000;,
|
||||
1.000000;1.000000;,
|
||||
0.000000;1.000000;,
|
||||
0.000000;0.000000;,
|
||||
1.000000;0.000000;,
|
||||
1.000000;1.000000;,
|
||||
0.000000;1.000000;,
|
||||
0.000000;0.000000;,
|
||||
1.000000;0.000000;,
|
||||
1.000000;1.000000;;
|
||||
}
|
||||
|
||||
MeshMaterialList {
|
||||
4;
|
||||
12;
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
2,
|
||||
2;
|
||||
|
||||
Material {
|
||||
1.000000;1.000000;1.000000;1.000000;;
|
||||
1.000000;
|
||||
1.000000;1.000000;1.000000;;
|
||||
0.000000;0.000000;0.000000;;
|
||||
|
||||
TextureFilename {
|
||||
"ground2.bmp";
|
||||
}
|
||||
}
|
||||
|
||||
Material {
|
||||
1.000000;1.000000;1.000000;1.000000;;
|
||||
1.000000;
|
||||
1.000000;1.000000;1.000000;;
|
||||
0.000000;0.000000;0.000000;;
|
||||
|
||||
TextureFilename {
|
||||
"env2.bmp";
|
||||
}
|
||||
}
|
||||
|
||||
Material {
|
||||
1.000000;1.000000;1.000000;1.000000;;
|
||||
1.000000;
|
||||
1.000000;1.000000;1.000000;;
|
||||
0.000000;0.000000;0.000000;;
|
||||
|
||||
TextureFilename {
|
||||
"ground2.bmp";
|
||||
}
|
||||
}
|
||||
Material {
|
||||
1.000000;1.000000;1.000000;1.000000;;
|
||||
1.000000;
|
||||
1.000000;1.000000;1.000000;;
|
||||
0.000000;0.000000;0.000000;;
|
||||
|
||||
TextureFilename {
|
||||
"env2.bmp";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,282 @@
|
||||
xof 0303txt 0032
|
||||
template VertexDuplicationIndices {
|
||||
<b8d65549-d7c9-4995-89cf-53a9a8b031e3>
|
||||
DWORD nIndices;
|
||||
DWORD nOriginalVertices;
|
||||
array DWORD indices[nIndices];
|
||||
}
|
||||
|
||||
template FVFData {
|
||||
<b6e70a0e-8ef9-4e83-94ad-ecc8b0c04897>
|
||||
DWORD dwFVF;
|
||||
DWORD nDWords;
|
||||
array DWORD data[nDWords];
|
||||
}
|
||||
|
||||
template VertexElement {
|
||||
<f752461c-1e23-48f6-b9f8-8350850f336f>
|
||||
DWORD Type;
|
||||
DWORD Method;
|
||||
DWORD Usage;
|
||||
DWORD UsageIndex;
|
||||
}
|
||||
|
||||
template DeclData {
|
||||
<bf22e553-292c-4781-9fea-62bd554bdd93>
|
||||
DWORD nElements;
|
||||
array VertexElement Elements[nElements];
|
||||
DWORD nDWords;
|
||||
array DWORD data[nDWords];
|
||||
}
|
||||
|
||||
template EffectParamFloats {
|
||||
<3014b9a0-62f5-478c-9b86-e4ac9f4e418b>
|
||||
STRING ParamName;
|
||||
DWORD nFloats;
|
||||
array FLOAT Floats[nFloats];
|
||||
}
|
||||
|
||||
template EffectParamString {
|
||||
<1dbc4c88-94c1-46ee-9076-2c28818c9481>
|
||||
STRING ParamName;
|
||||
STRING Value;
|
||||
}
|
||||
|
||||
template EffectParamDWord {
|
||||
<e13963bc-ae51-4c5d-b00f-cfa3a9d97ce5>
|
||||
STRING ParamName;
|
||||
DWORD Value;
|
||||
}
|
||||
|
||||
template EffectInstance {
|
||||
<e331f7e4-0559-4cc2-8e99-1cec1657928f>
|
||||
STRING EffectFilename;
|
||||
[...]
|
||||
}
|
||||
|
||||
|
||||
Mesh {
|
||||
34;
|
||||
-6.000000;-3.000000;-6.000000;,
|
||||
6.000000;-3.000000;-6.000000;,
|
||||
-6.000000;-3.000000;6.000000;,
|
||||
6.000000;-3.000000;6.000000;,
|
||||
-6.000000;-3.000000;-6.000000;,
|
||||
6.000000;-3.000000;-6.000000;,
|
||||
-6.000000;2.500000;-6.000000;,
|
||||
-4.000000;2.500000;-6.000000;,
|
||||
4.000000;2.500000;-6.000000;,
|
||||
6.000000;2.500000;-6.000000;,
|
||||
-4.000000;3.000000;-6.000000;,
|
||||
4.000000;3.000000;-6.000000;,
|
||||
-6.000000;-3.000000;6.000000;,
|
||||
6.000000;-3.000000;6.000000;,
|
||||
-6.000000;2.500000;6.000000;,
|
||||
-4.000000;2.500000;6.000000;,
|
||||
4.000000;2.500000;6.000000;,
|
||||
6.000000;2.500000;6.000000;,
|
||||
-4.000000;3.000000;6.000000;,
|
||||
4.000000;3.000000;6.000000;,
|
||||
-6.000000;-3.000000;-6.000000;,
|
||||
-6.000000;2.500000;-6.000000;,
|
||||
-6.000000;2.500000;-6.000000;,
|
||||
-4.000000;2.500000;-6.000000;,
|
||||
4.000000;2.500000;-6.000000;,
|
||||
6.000000;2.500000;-6.000000;,
|
||||
-4.000000;3.000000;-6.000000;,
|
||||
4.000000;3.000000;-6.000000;,
|
||||
-6.000000;2.500000;6.000000;,
|
||||
-4.000000;2.500000;6.000000;,
|
||||
4.000000;2.500000;6.000000;,
|
||||
6.000000;2.500000;6.000000;,
|
||||
-4.000000;3.000000;6.000000;,
|
||||
4.000000;3.000000;6.000000;;
|
||||
24;
|
||||
3;0,2,1;,
|
||||
3;1,2,3;,
|
||||
3;20,5,21;,
|
||||
3;21,5,9;,
|
||||
3;7,8,10;,
|
||||
3;10,8,11;,
|
||||
3;4,6,12;,
|
||||
3;12,6,14;,
|
||||
3;12,14,13;,
|
||||
3;13,14,17;,
|
||||
3;15,18,16;,
|
||||
3;16,18,19;,
|
||||
3;13,17,5;,
|
||||
3;5,17,9;,
|
||||
3;22,23,28;,
|
||||
3;28,23,29;,
|
||||
3;23,26,29;,
|
||||
3;29,26,32;,
|
||||
3;26,27,32;,
|
||||
3;32,27,33;,
|
||||
3;27,24,33;,
|
||||
3;33,24,30;,
|
||||
3;24,25,30;,
|
||||
3;30,25,31;;
|
||||
|
||||
MeshNormals {
|
||||
34;
|
||||
0.000000;1.000000;0.000000;,
|
||||
0.000000;1.000000;0.000000;,
|
||||
0.000000;1.000000;0.000000;,
|
||||
0.000000;1.000000;0.000000;,
|
||||
1.000000;0.000000;0.000000;,
|
||||
-0.707107;0.000000;0.707107;,
|
||||
1.000000;0.000000;0.000000;,
|
||||
0.000000;0.000000;1.000000;,
|
||||
0.000000;0.000000;1.000000;,
|
||||
-0.707107;0.000000;0.707107;,
|
||||
0.000000;0.000000;1.000000;,
|
||||
0.000000;0.000000;1.000000;,
|
||||
0.894427;0.000000;-0.447214;,
|
||||
-0.447214;0.000000;-0.894427;,
|
||||
0.447214;0.000000;-0.894427;,
|
||||
0.000000;0.000000;-1.000000;,
|
||||
0.000000;0.000000;-1.000000;,
|
||||
-0.894427;0.000000;-0.447214;,
|
||||
0.000000;0.000000;-1.000000;,
|
||||
0.000000;0.000000;-1.000000;,
|
||||
0.000000;0.000000;1.000000;,
|
||||
0.000000;0.000000;1.000000;,
|
||||
0.000000;-1.000000;0.000000;,
|
||||
0.124035;-0.992278;0.000000;,
|
||||
-0.447214;-0.894427;0.000000;,
|
||||
0.000000;-1.000000;0.000000;,
|
||||
0.124035;-0.992278;0.000000;,
|
||||
-0.031235;-0.999512;0.000000;,
|
||||
0.000000;-1.000000;0.000000;,
|
||||
0.447214;-0.894427;0.000000;,
|
||||
-0.124035;-0.992278;0.000000;,
|
||||
0.000000;-1.000000;0.000000;,
|
||||
0.031235;-0.999512;0.000000;,
|
||||
-0.124035;-0.992278;0.000000;;
|
||||
24;
|
||||
3;0,2,1;,
|
||||
3;1,2,3;,
|
||||
3;20,5,21;,
|
||||
3;21,5,9;,
|
||||
3;7,8,10;,
|
||||
3;10,8,11;,
|
||||
3;4,6,12;,
|
||||
3;12,6,14;,
|
||||
3;12,14,13;,
|
||||
3;13,14,17;,
|
||||
3;15,18,16;,
|
||||
3;16,18,19;,
|
||||
3;13,17,5;,
|
||||
3;5,17,9;,
|
||||
3;22,23,28;,
|
||||
3;28,23,29;,
|
||||
3;23,26,29;,
|
||||
3;29,26,32;,
|
||||
3;26,27,32;,
|
||||
3;32,27,33;,
|
||||
3;27,24,33;,
|
||||
3;33,24,30;,
|
||||
3;24,25,30;,
|
||||
3;30,25,31;;
|
||||
}
|
||||
|
||||
MeshTextureCoords {
|
||||
34;
|
||||
0.000000;0.000000;,
|
||||
0.000000;2.000000;,
|
||||
2.000000;0.000000;,
|
||||
2.000000;2.000000;,
|
||||
0.000000;1.000000;,
|
||||
6.000000;1.000000;,
|
||||
0.000000;0.083333;,
|
||||
7.666667;0.083333;,
|
||||
6.333333;0.083333;,
|
||||
6.000000;0.083333;,
|
||||
7.666667;0.000000;,
|
||||
6.333333;0.000000;,
|
||||
2.000000;1.000000;,
|
||||
4.000000;1.000000;,
|
||||
2.000000;0.083333;,
|
||||
2.333333;0.083333;,
|
||||
3.666667;0.083333;,
|
||||
4.000000;0.083333;,
|
||||
2.333333;0.000000;,
|
||||
3.666667;0.000000;,
|
||||
8.000000;1.000000;,
|
||||
8.000000;0.083333;,
|
||||
0.000000;0.000000;,
|
||||
0.333333;0.000000;,
|
||||
1.833333;0.000000;,
|
||||
2.166667;0.000000;,
|
||||
0.416667;0.000000;,
|
||||
1.750000;0.000000;,
|
||||
0.000000;2.000000;,
|
||||
0.333333;2.000000;,
|
||||
1.833333;2.000000;,
|
||||
2.166667;2.000000;,
|
||||
0.416667;2.000000;,
|
||||
1.750000;2.000000;;
|
||||
}
|
||||
|
||||
MeshMaterialList {
|
||||
3;
|
||||
24;
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
2,
|
||||
2,
|
||||
2,
|
||||
2,
|
||||
2,
|
||||
2,
|
||||
2,
|
||||
2,
|
||||
2,
|
||||
2;
|
||||
|
||||
Material {
|
||||
1.000000;1.000000;1.000000;1.000000;;
|
||||
1.000000;
|
||||
1.000000;1.000000;1.000000;;
|
||||
0.000000;0.000000;0.000000;;
|
||||
|
||||
TextureFilename {
|
||||
"ground2.bmp";
|
||||
}
|
||||
}
|
||||
|
||||
Material {
|
||||
1.000000;1.000000;1.000000;1.000000;;
|
||||
1.000000;
|
||||
1.000000;1.000000;1.000000;;
|
||||
0.000000;0.000000;0.000000;;
|
||||
|
||||
TextureFilename {
|
||||
"env2.bmp";
|
||||
}
|
||||
}
|
||||
|
||||
Material {
|
||||
1.000000;1.000000;1.000000;1.000000;;
|
||||
1.000000;
|
||||
1.000000;1.000000;1.000000;;
|
||||
0.000000;0.000000;0.000000;;
|
||||
|
||||
TextureFilename {
|
||||
"seafloor.bmp";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 65 KiB |
@@ -0,0 +1,280 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// File: ShadowMap.fx
|
||||
//
|
||||
// Desc: Effect file for high dynamic range cube mapping sample.
|
||||
//
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
|
||||
#define SMAP_SIZE 512
|
||||
|
||||
|
||||
#define SHADOW_EPSILON 0.00005f
|
||||
|
||||
|
||||
float4x4 g_mWorldView;
|
||||
float4x4 g_mProj;
|
||||
float4x4 g_mViewToLightProj; // Transform from view space to light projection space
|
||||
float4 g_vMaterial;
|
||||
texture g_txScene;
|
||||
texture g_txShadow;
|
||||
float3 g_vLightPos; // Light position in view space
|
||||
float3 g_vLightDir; // Light direction in view space
|
||||
float4 g_vLightDiffuse = float4( 1.0f, 1.0f, 1.0f, 1.0f ); // Light diffuse color
|
||||
float4 g_vLightAmbient = float4( 0.3f, 0.3f, 0.3f, 1.0f ); // Use an ambient light of 0.3
|
||||
float g_fCosTheta; // Cosine of theta of the spot light
|
||||
|
||||
|
||||
|
||||
sampler2D g_samScene =
|
||||
sampler_state
|
||||
{
|
||||
Texture = <g_txScene>;
|
||||
MinFilter = Point;
|
||||
MagFilter = Linear;
|
||||
MipFilter = Linear;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
sampler2D g_samShadow =
|
||||
sampler_state
|
||||
{
|
||||
Texture = <g_txShadow>;
|
||||
MinFilter = Point;
|
||||
MagFilter = Point;
|
||||
MipFilter = Point;
|
||||
AddressU = Clamp;
|
||||
AddressV = Clamp;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Vertex Shader: VertScene
|
||||
// Desc: Process vertex for scene
|
||||
//-----------------------------------------------------------------------------
|
||||
void VertScene( float4 iPos : POSITION,
|
||||
float3 iNormal : NORMAL,
|
||||
float2 iTex : TEXCOORD0,
|
||||
out float4 oPos : POSITION,
|
||||
out float2 Tex : TEXCOORD0,
|
||||
out float4 vPos : TEXCOORD1,
|
||||
out float3 vNormal : TEXCOORD2,
|
||||
out float4 vPosLight : TEXCOORD3 )
|
||||
{
|
||||
//
|
||||
// Transform position to view space
|
||||
//
|
||||
vPos = mul( iPos, g_mWorldView );
|
||||
|
||||
//
|
||||
// Transform to screen coord
|
||||
//
|
||||
oPos = mul( vPos, g_mProj );
|
||||
|
||||
//
|
||||
// Compute view space normal
|
||||
//
|
||||
vNormal = mul( iNormal, (float3x3)g_mWorldView );
|
||||
|
||||
//
|
||||
// Propagate texture coord
|
||||
//
|
||||
Tex = iTex;
|
||||
|
||||
//
|
||||
// Transform the position to light projection space, or the
|
||||
// projection space as if the camera is looking out from
|
||||
// the spotlight.
|
||||
//
|
||||
vPosLight = mul( vPos, g_mViewToLightProj );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Pixel Shader: PixScene
|
||||
// Desc: Process pixel (do per-pixel lighting) for enabled scene
|
||||
//-----------------------------------------------------------------------------
|
||||
float4 PixScene( float2 Tex : TEXCOORD0,
|
||||
float4 vPos : TEXCOORD1,
|
||||
float3 vNormal : TEXCOORD2,
|
||||
float4 vPosLight : TEXCOORD3 ) : COLOR
|
||||
{
|
||||
float4 Diffuse;
|
||||
|
||||
// vLight is the unit vector from the light to this pixel
|
||||
float3 vLight = normalize( float3( vPos - g_vLightPos ) );
|
||||
|
||||
// Compute diffuse from the light
|
||||
if( dot( vLight, g_vLightDir ) > g_fCosTheta ) // Light must face the pixel (within Theta)
|
||||
{
|
||||
// Pixel is in lit area. Find out if it's
|
||||
// in shadow using 2x2 percentage closest filtering
|
||||
|
||||
//transform from RT space to texture space.
|
||||
float2 ShadowTexC = 0.5 * vPosLight.xy / vPosLight.w + float2( 0.5, 0.5 );
|
||||
ShadowTexC.y = 1.0f - ShadowTexC.y;
|
||||
|
||||
// transform to texel space
|
||||
float2 texelpos = SMAP_SIZE * ShadowTexC;
|
||||
|
||||
// Determine the lerp amounts
|
||||
float2 lerps = frac( texelpos );
|
||||
|
||||
//read in bilerp stamp, doing the shadow checks
|
||||
float sourcevals[4];
|
||||
sourcevals[0] = (tex2D( g_samShadow, ShadowTexC ) + SHADOW_EPSILON < vPosLight.z / vPosLight.w)? 0.0f: 1.0f;
|
||||
sourcevals[1] = (tex2D( g_samShadow, ShadowTexC + float2(1.0/SMAP_SIZE, 0) ) + SHADOW_EPSILON < vPosLight.z / vPosLight.w)? 0.0f: 1.0f;
|
||||
sourcevals[2] = (tex2D( g_samShadow, ShadowTexC + float2(0, 1.0/SMAP_SIZE) ) + SHADOW_EPSILON < vPosLight.z / vPosLight.w)? 0.0f: 1.0f;
|
||||
sourcevals[3] = (tex2D( g_samShadow, ShadowTexC + float2(1.0/SMAP_SIZE, 1.0/SMAP_SIZE) ) + SHADOW_EPSILON < vPosLight.z / vPosLight.w)? 0.0f: 1.0f;
|
||||
|
||||
// lerp between the shadow values to calculate our light amount
|
||||
float LightAmount = lerp( lerp( sourcevals[0], sourcevals[1], lerps.x ),
|
||||
lerp( sourcevals[2], sourcevals[3], lerps.x ),
|
||||
lerps.y );
|
||||
// Light it
|
||||
Diffuse = ( saturate( dot( -vLight, normalize( vNormal ) ) ) * LightAmount * ( 1 - g_vLightAmbient ) + g_vLightAmbient )
|
||||
* g_vMaterial;
|
||||
} else
|
||||
{
|
||||
Diffuse = g_vLightAmbient * g_vMaterial;
|
||||
}
|
||||
|
||||
return tex2D( g_samScene, Tex ) * Diffuse;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Vertex Shader: VertLight
|
||||
// Desc: Process vertex for the light object
|
||||
//-----------------------------------------------------------------------------
|
||||
void VertLight( float4 iPos : POSITION,
|
||||
float3 iNormal : NORMAL,
|
||||
float2 iTex : TEXCOORD0,
|
||||
out float4 oPos : POSITION,
|
||||
out float2 Tex : TEXCOORD0 )
|
||||
{
|
||||
//
|
||||
// Transform position to view space
|
||||
//
|
||||
oPos = mul( iPos, g_mWorldView );
|
||||
|
||||
//
|
||||
// Transform to screen coord
|
||||
//
|
||||
oPos = mul( oPos, g_mProj );
|
||||
|
||||
//
|
||||
// Propagate texture coord
|
||||
//
|
||||
Tex = iTex;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Pixel Shader: PixLight
|
||||
// Desc: Process pixel for the light object
|
||||
//-----------------------------------------------------------------------------
|
||||
float4 PixLight( float2 Tex : TEXCOORD0,
|
||||
float4 vPos : TEXCOORD1 ) : COLOR
|
||||
{
|
||||
return tex2D( g_samScene, Tex );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Vertex Shader: VertShadow
|
||||
// Desc: Process vertex for the shadow map
|
||||
//-----------------------------------------------------------------------------
|
||||
void VertShadow( float4 Pos : POSITION,
|
||||
float3 Normal : NORMAL,
|
||||
out float4 oPos : POSITION,
|
||||
out float2 Depth : TEXCOORD0 )
|
||||
{
|
||||
//
|
||||
// Compute the projected coordinates
|
||||
//
|
||||
oPos = mul( Pos, g_mWorldView );
|
||||
oPos = mul( oPos, g_mProj );
|
||||
|
||||
//
|
||||
// Store z and w in our spare texcoord
|
||||
//
|
||||
Depth.xy = oPos.zw;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Pixel Shader: PixShadow
|
||||
// Desc: Process pixel for the shadow map
|
||||
//-----------------------------------------------------------------------------
|
||||
void PixShadow( float2 Depth : TEXCOORD0,
|
||||
out float4 Color : COLOR )
|
||||
{
|
||||
//
|
||||
// Depth is z / w
|
||||
//
|
||||
Color = Depth.x / Depth.y;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Technique: RenderScene
|
||||
// Desc: Renders scene objects
|
||||
//-----------------------------------------------------------------------------
|
||||
technique RenderScene
|
||||
{
|
||||
pass p0
|
||||
{
|
||||
VertexShader = compile vs_1_1 VertScene();
|
||||
PixelShader = compile ps_2_0 PixScene();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Technique: RenderLight
|
||||
// Desc: Renders the light object
|
||||
//-----------------------------------------------------------------------------
|
||||
technique RenderLight
|
||||
{
|
||||
pass p0
|
||||
{
|
||||
VertexShader = compile vs_1_1 VertLight();
|
||||
PixelShader = compile ps_1_1 PixLight();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Technique: RenderShadow
|
||||
// Desc: Renders the shadow map
|
||||
//-----------------------------------------------------------------------------
|
||||
technique RenderShadow
|
||||
{
|
||||
pass p0
|
||||
{
|
||||
VertexShader = compile vs_1_1 VertShadow();
|
||||
PixelShader = compile ps_2_0 PixShadow();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,280 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// File: ShadowMap.fx
|
||||
//
|
||||
// Desc: Effect file for high dynamic range cube mapping sample.
|
||||
//
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
|
||||
#define SMAP_SIZE 512
|
||||
|
||||
|
||||
#define SHADOW_EPSILON 0.00005f
|
||||
|
||||
|
||||
float4x4 g_mWorldView;
|
||||
float4x4 g_mProj;
|
||||
float4x4 g_mViewToLightProj; // Transform from view space to light projection space
|
||||
float4 g_vMaterial;
|
||||
texture g_txScene;
|
||||
texture g_txShadow;
|
||||
float3 g_vLightPos; // Light position in view space
|
||||
float3 g_vLightDir; // Light direction in view space
|
||||
float4 g_vLightDiffuse = float4( 1.0f, 1.0f, 1.0f, 1.0f ); // Light diffuse color
|
||||
float4 g_vLightAmbient = float4( 0.3f, 0.3f, 0.3f, 1.0f ); // Use an ambient light of 0.3
|
||||
float g_fCosTheta; // Cosine of theta of the spot light
|
||||
|
||||
|
||||
|
||||
sampler2D g_samScene =
|
||||
sampler_state
|
||||
{
|
||||
Texture = <g_txScene>;
|
||||
MinFilter = Point;
|
||||
MagFilter = Linear;
|
||||
MipFilter = Linear;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
sampler2D g_samShadow =
|
||||
sampler_state
|
||||
{
|
||||
Texture = <g_txShadow>;
|
||||
MinFilter = Point;
|
||||
MagFilter = Point;
|
||||
MipFilter = Point;
|
||||
AddressU = Clamp;
|
||||
AddressV = Clamp;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Vertex Shader: VertScene
|
||||
// Desc: Process vertex for scene
|
||||
//-----------------------------------------------------------------------------
|
||||
void VertScene( float4 iPos : POSITION,
|
||||
float3 iNormal : NORMAL,
|
||||
float2 iTex : TEXCOORD0,
|
||||
out float4 oPos : POSITION,
|
||||
out float2 Tex : TEXCOORD0,
|
||||
out float4 vPos : TEXCOORD1,
|
||||
out float3 vNormal : TEXCOORD2,
|
||||
out float4 vPosLight : TEXCOORD3 )
|
||||
{
|
||||
//
|
||||
// Transform position to view space
|
||||
//
|
||||
vPos = mul( iPos, g_mWorldView );
|
||||
|
||||
//
|
||||
// Transform to screen coord
|
||||
//
|
||||
oPos = mul( vPos, g_mProj );
|
||||
|
||||
//
|
||||
// Compute view space normal
|
||||
//
|
||||
vNormal = mul( iNormal, (float3x3)g_mWorldView );
|
||||
|
||||
//
|
||||
// Propagate texture coord
|
||||
//
|
||||
Tex = iTex;
|
||||
|
||||
//
|
||||
// Transform the position to light projection space, or the
|
||||
// projection space as if the camera is looking out from
|
||||
// the spotlight.
|
||||
//
|
||||
vPosLight = mul( vPos, g_mViewToLightProj );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Pixel Shader: PixScene
|
||||
// Desc: Process pixel (do per-pixel lighting) for enabled scene
|
||||
//-----------------------------------------------------------------------------
|
||||
float4 PixScene( float2 Tex : TEXCOORD0,
|
||||
float4 vPos : TEXCOORD1,
|
||||
float3 vNormal : TEXCOORD2,
|
||||
float4 vPosLight : TEXCOORD3 ) : COLOR
|
||||
{
|
||||
float4 Diffuse;
|
||||
|
||||
// vLight is the unit vector from the light to this pixel
|
||||
float3 vLight = normalize( float3( vPos - g_vLightPos ) );
|
||||
|
||||
// Compute diffuse from the light
|
||||
if( dot( vLight, g_vLightDir ) > g_fCosTheta ) // Light must face the pixel (within Theta)
|
||||
{
|
||||
// Pixel is in lit area. Find out if it's
|
||||
// in shadow using 2x2 percentage closest filtering
|
||||
|
||||
//transform from RT space to texture space.
|
||||
float2 ShadowTexC = 0.5 * vPosLight.xy / vPosLight.w + float2( 0.5, 0.5 );
|
||||
ShadowTexC.y = 1.0f - ShadowTexC.y;
|
||||
|
||||
// transform to texel space
|
||||
float2 texelpos = SMAP_SIZE * ShadowTexC;
|
||||
|
||||
// Determine the lerp amounts
|
||||
float2 lerps = frac( texelpos );
|
||||
|
||||
//read in bilerp stamp, doing the shadow checks
|
||||
float sourcevals[4];
|
||||
sourcevals[0] = (tex2D( g_samShadow, ShadowTexC ) + SHADOW_EPSILON < vPosLight.z / vPosLight.w)? 0.0f: 1.0f;
|
||||
sourcevals[1] = (tex2D( g_samShadow, ShadowTexC + float2(1.0/SMAP_SIZE, 0) ) + SHADOW_EPSILON < vPosLight.z / vPosLight.w)? 0.0f: 1.0f;
|
||||
sourcevals[2] = (tex2D( g_samShadow, ShadowTexC + float2(0, 1.0/SMAP_SIZE) ) + SHADOW_EPSILON < vPosLight.z / vPosLight.w)? 0.0f: 1.0f;
|
||||
sourcevals[3] = (tex2D( g_samShadow, ShadowTexC + float2(1.0/SMAP_SIZE, 1.0/SMAP_SIZE) ) + SHADOW_EPSILON < vPosLight.z / vPosLight.w)? 0.0f: 1.0f;
|
||||
|
||||
// lerp between the shadow values to calculate our light amount
|
||||
float LightAmount = lerp( lerp( sourcevals[0], sourcevals[1], lerps.x ),
|
||||
lerp( sourcevals[2], sourcevals[3], lerps.x ),
|
||||
lerps.y );
|
||||
// Light it
|
||||
Diffuse = ( saturate( dot( -vLight, normalize( vNormal ) ) ) * LightAmount * ( 1 - g_vLightAmbient ) + g_vLightAmbient )
|
||||
* g_vMaterial;
|
||||
} else
|
||||
{
|
||||
Diffuse = g_vLightAmbient * g_vMaterial;
|
||||
}
|
||||
|
||||
return tex2D( g_samScene, Tex ) * Diffuse;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Vertex Shader: VertLight
|
||||
// Desc: Process vertex for the light object
|
||||
//-----------------------------------------------------------------------------
|
||||
void VertLight( float4 iPos : POSITION,
|
||||
float3 iNormal : NORMAL,
|
||||
float2 iTex : TEXCOORD0,
|
||||
out float4 oPos : POSITION,
|
||||
out float2 Tex : TEXCOORD0 )
|
||||
{
|
||||
//
|
||||
// Transform position to view space
|
||||
//
|
||||
oPos = mul( iPos, g_mWorldView );
|
||||
|
||||
//
|
||||
// Transform to screen coord
|
||||
//
|
||||
oPos = mul( oPos, g_mProj );
|
||||
|
||||
//
|
||||
// Propagate texture coord
|
||||
//
|
||||
Tex = iTex;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Pixel Shader: PixLight
|
||||
// Desc: Process pixel for the light object
|
||||
//-----------------------------------------------------------------------------
|
||||
float4 PixLight( float2 Tex : TEXCOORD0,
|
||||
float4 vPos : TEXCOORD1 ) : COLOR
|
||||
{
|
||||
return tex2D( g_samScene, Tex );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Vertex Shader: VertShadow
|
||||
// Desc: Process vertex for the shadow map
|
||||
//-----------------------------------------------------------------------------
|
||||
void VertShadow( float4 Pos : POSITION,
|
||||
float3 Normal : NORMAL,
|
||||
out float4 oPos : POSITION,
|
||||
out float2 Depth : TEXCOORD0 )
|
||||
{
|
||||
//
|
||||
// Compute the projected coordinates
|
||||
//
|
||||
oPos = mul( Pos, g_mWorldView );
|
||||
oPos = mul( oPos, g_mProj );
|
||||
|
||||
//
|
||||
// Store z and w in our spare texcoord
|
||||
//
|
||||
Depth.xy = oPos.zw;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Pixel Shader: PixShadow
|
||||
// Desc: Process pixel for the shadow map
|
||||
//-----------------------------------------------------------------------------
|
||||
void PixShadow( float2 Depth : TEXCOORD0,
|
||||
out float4 Color : COLOR )
|
||||
{
|
||||
//
|
||||
// Depth is z / w
|
||||
//
|
||||
Color = Depth.x / Depth.y;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Technique: RenderScene
|
||||
// Desc: Renders scene objects
|
||||
//-----------------------------------------------------------------------------
|
||||
technique RenderScene
|
||||
{
|
||||
pass p0
|
||||
{
|
||||
VertexShader = compile vs_2_0 VertScene();
|
||||
PixelShader = compile ps_2_0 PixScene();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Technique: RenderLight
|
||||
// Desc: Renders the light object
|
||||
//-----------------------------------------------------------------------------
|
||||
technique RenderLight
|
||||
{
|
||||
pass p0
|
||||
{
|
||||
VertexShader = compile vs_2_0 VertLight();
|
||||
PixelShader = compile ps_2_0 PixLight();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Technique: RenderShadow
|
||||
// Desc: Renders the shadow map
|
||||
//-----------------------------------------------------------------------------
|
||||
technique RenderShadow
|
||||
{
|
||||
pass p0
|
||||
{
|
||||
VertexShader = compile vs_2_0 VertShadow();
|
||||
PixelShader = compile ps_2_0 PixShadow();
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 161 KiB |
@@ -0,0 +1,437 @@
|
||||
xof 0303txt 0032
|
||||
template VertexDuplicationIndices {
|
||||
<b8d65549-d7c9-4995-89cf-53a9a8b031e3>
|
||||
DWORD nIndices;
|
||||
DWORD nOriginalVertices;
|
||||
array DWORD indices[nIndices];
|
||||
}
|
||||
|
||||
template FVFData {
|
||||
<b6e70a0e-8ef9-4e83-94ad-ecc8b0c04897>
|
||||
DWORD dwFVF;
|
||||
DWORD nDWords;
|
||||
array DWORD data[nDWords];
|
||||
}
|
||||
|
||||
template VertexElement {
|
||||
<f752461c-1e23-48f6-b9f8-8350850f336f>
|
||||
DWORD Type;
|
||||
DWORD Method;
|
||||
DWORD Usage;
|
||||
DWORD UsageIndex;
|
||||
}
|
||||
|
||||
template DeclData {
|
||||
<bf22e553-292c-4781-9fea-62bd554bdd93>
|
||||
DWORD nElements;
|
||||
array VertexElement Elements[nElements];
|
||||
DWORD nDWords;
|
||||
array DWORD data[nDWords];
|
||||
}
|
||||
|
||||
template EffectParamFloats {
|
||||
<3014b9a0-62f5-478c-9b86-e4ac9f4e418b>
|
||||
STRING ParamName;
|
||||
DWORD nFloats;
|
||||
array FLOAT Floats[nFloats];
|
||||
}
|
||||
|
||||
template EffectParamString {
|
||||
<1dbc4c88-94c1-46ee-9076-2c28818c9481>
|
||||
STRING ParamName;
|
||||
STRING Value;
|
||||
}
|
||||
|
||||
template EffectParamDWord {
|
||||
<e13963bc-ae51-4c5d-b00f-cfa3a9d97ce5>
|
||||
STRING ParamName;
|
||||
DWORD Value;
|
||||
}
|
||||
|
||||
template EffectInstance {
|
||||
<e331f7e4-0559-4cc2-8e99-1cec1657928f>
|
||||
STRING EffectFilename;
|
||||
[...]
|
||||
}
|
||||
|
||||
|
||||
Mesh {
|
||||
53;
|
||||
0.000000;0.000000;-0.500000;,
|
||||
0.000000;0.200000;-0.500000;,
|
||||
0.076537;0.184776;-0.500000;,
|
||||
0.141421;0.141421;-0.500000;,
|
||||
0.184776;0.076537;-0.500000;,
|
||||
0.200000;-0.000000;-0.500000;,
|
||||
0.184776;-0.076537;-0.500000;,
|
||||
0.141421;-0.141421;-0.500000;,
|
||||
0.076537;-0.184776;-0.500000;,
|
||||
-0.000000;-0.200000;-0.500000;,
|
||||
-0.076537;-0.184776;-0.500000;,
|
||||
-0.141421;-0.141421;-0.500000;,
|
||||
-0.184776;-0.076537;-0.500000;,
|
||||
-0.200000;0.000000;-0.500000;,
|
||||
-0.184776;0.076537;-0.500000;,
|
||||
-0.141421;0.141421;-0.500000;,
|
||||
-0.076537;0.184776;-0.500000;,
|
||||
0.000000;0.200000;-0.500000;,
|
||||
0.097545;0.490393;0.500000;,
|
||||
0.277785;0.415735;0.500000;,
|
||||
0.415735;0.277785;0.500000;,
|
||||
0.490393;0.097545;0.500000;,
|
||||
0.490393;-0.097545;0.500000;,
|
||||
0.415735;-0.277785;0.500000;,
|
||||
0.277785;-0.415735;0.500000;,
|
||||
0.097545;-0.490393;0.500000;,
|
||||
-0.097545;-0.490393;0.500000;,
|
||||
-0.277785;-0.415735;0.500000;,
|
||||
-0.415735;-0.277785;0.500000;,
|
||||
-0.490393;-0.097545;0.500000;,
|
||||
-0.490393;0.097545;0.500000;,
|
||||
-0.415735;0.277785;0.500000;,
|
||||
-0.277785;0.415735;0.500000;,
|
||||
-0.097545;0.490393;0.500000;,
|
||||
0.097545;0.490393;0.500000;,
|
||||
0.097545;0.490393;0.500000;,
|
||||
0.277785;0.415735;0.500000;,
|
||||
0.415735;0.277785;0.500000;,
|
||||
0.490393;0.097545;0.500000;,
|
||||
0.490393;-0.097545;0.500000;,
|
||||
0.415735;-0.277785;0.500000;,
|
||||
0.277785;-0.415735;0.500000;,
|
||||
0.097545;-0.490393;0.500000;,
|
||||
-0.097545;-0.490393;0.500000;,
|
||||
-0.277785;-0.415735;0.500000;,
|
||||
-0.415735;-0.277785;0.500000;,
|
||||
-0.490393;-0.097545;0.500000;,
|
||||
-0.490393;0.097545;0.500000;,
|
||||
-0.415735;0.277785;0.500000;,
|
||||
-0.277785;0.415735;0.500000;,
|
||||
-0.097545;0.490393;0.500000;,
|
||||
0.097545;0.490393;0.500000;,
|
||||
0.000000;0.000000;0.500000;;
|
||||
64;
|
||||
3;0,1,2;,
|
||||
3;0,2,3;,
|
||||
3;0,3,4;,
|
||||
3;0,4,5;,
|
||||
3;0,5,6;,
|
||||
3;0,6,7;,
|
||||
3;0,7,8;,
|
||||
3;0,8,9;,
|
||||
3;0,9,10;,
|
||||
3;0,10,11;,
|
||||
3;0,11,12;,
|
||||
3;0,12,13;,
|
||||
3;0,13,14;,
|
||||
3;0,14,15;,
|
||||
3;0,15,16;,
|
||||
3;0,16,17;,
|
||||
3;1,18,2;,
|
||||
3;2,18,19;,
|
||||
3;2,19,3;,
|
||||
3;3,19,20;,
|
||||
3;3,20,4;,
|
||||
3;4,20,21;,
|
||||
3;4,21,5;,
|
||||
3;5,21,22;,
|
||||
3;5,22,6;,
|
||||
3;6,22,23;,
|
||||
3;6,23,7;,
|
||||
3;7,23,24;,
|
||||
3;7,24,8;,
|
||||
3;8,24,25;,
|
||||
3;8,25,9;,
|
||||
3;9,25,26;,
|
||||
3;9,26,10;,
|
||||
3;10,26,27;,
|
||||
3;10,27,11;,
|
||||
3;11,27,28;,
|
||||
3;11,28,12;,
|
||||
3;12,28,29;,
|
||||
3;12,29,13;,
|
||||
3;13,29,30;,
|
||||
3;13,30,14;,
|
||||
3;14,30,31;,
|
||||
3;14,31,15;,
|
||||
3;15,31,32;,
|
||||
3;15,32,16;,
|
||||
3;16,32,33;,
|
||||
3;16,33,17;,
|
||||
3;17,33,34;,
|
||||
3;52,36,35;,
|
||||
3;52,37,36;,
|
||||
3;52,38,37;,
|
||||
3;52,39,38;,
|
||||
3;52,40,39;,
|
||||
3;52,41,40;,
|
||||
3;52,42,41;,
|
||||
3;52,43,42;,
|
||||
3;52,44,43;,
|
||||
3;52,45,44;,
|
||||
3;52,46,45;,
|
||||
3;52,47,46;,
|
||||
3;52,48,47;,
|
||||
3;52,49,48;,
|
||||
3;52,50,49;,
|
||||
3;52,51,50;;
|
||||
|
||||
MeshNormals {
|
||||
53;
|
||||
0.000000;0.000000;-1.000000;,
|
||||
0.174494;0.877241;-0.447214;,
|
||||
0.356907;0.861651;-0.360798;,
|
||||
0.659479;0.659479;-0.360798;,
|
||||
0.861651;0.356907;-0.360798;,
|
||||
0.932644;0.000000;-0.360798;,
|
||||
0.861651;-0.356907;-0.360798;,
|
||||
0.659479;-0.659479;-0.360798;,
|
||||
0.356907;-0.861651;-0.360798;,
|
||||
-0.000000;-0.932644;-0.360798;,
|
||||
-0.356908;-0.861651;-0.360798;,
|
||||
-0.659479;-0.659479;-0.360798;,
|
||||
-0.861651;-0.356907;-0.360798;,
|
||||
-0.932644;0.000000;-0.360798;,
|
||||
-0.861651;0.356908;-0.360798;,
|
||||
-0.659479;0.659479;-0.360798;,
|
||||
-0.356907;0.861651;-0.360798;,
|
||||
-0.052791;0.941890;-0.331747;,
|
||||
0.316849;0.905180;-0.283295;,
|
||||
0.532520;0.796972;-0.285057;,
|
||||
0.796972;0.532520;-0.285057;,
|
||||
0.940093;0.186996;-0.285058;,
|
||||
0.940093;-0.186996;-0.285057;,
|
||||
0.796972;-0.532520;-0.285058;,
|
||||
0.532520;-0.796972;-0.285057;,
|
||||
0.186996;-0.940093;-0.285057;,
|
||||
-0.186996;-0.940093;-0.285057;,
|
||||
-0.532520;-0.796972;-0.285057;,
|
||||
-0.796972;-0.532520;-0.285057;,
|
||||
-0.940093;-0.186996;-0.285057;,
|
||||
-0.940093;0.186996;-0.285058;,
|
||||
-0.796972;0.532520;-0.285057;,
|
||||
-0.532520;0.796972;-0.285057;,
|
||||
-0.186996;0.940093;-0.285057;,
|
||||
0.000000;0.960328;-0.278872;,
|
||||
0.000000;0.000000;1.000000;,
|
||||
0.000000;0.000000;1.000000;,
|
||||
0.000000;0.000000;1.000000;,
|
||||
0.000000;0.000000;1.000000;,
|
||||
0.000000;0.000000;1.000000;,
|
||||
0.000000;0.000000;1.000000;,
|
||||
0.000000;0.000000;1.000000;,
|
||||
0.000000;0.000000;1.000000;,
|
||||
0.000000;0.000000;1.000000;,
|
||||
0.000000;0.000000;1.000000;,
|
||||
0.000000;0.000000;1.000000;,
|
||||
0.000000;0.000000;1.000000;,
|
||||
0.000000;0.000000;1.000000;,
|
||||
0.000000;0.000000;1.000000;,
|
||||
0.000000;0.000000;1.000000;,
|
||||
0.000000;0.000000;1.000000;,
|
||||
0.000000;0.000000;1.000000;,
|
||||
0.000000;0.000000;1.000000;;
|
||||
64;
|
||||
3;0,1,2;,
|
||||
3;0,2,3;,
|
||||
3;0,3,4;,
|
||||
3;0,4,5;,
|
||||
3;0,5,6;,
|
||||
3;0,6,7;,
|
||||
3;0,7,8;,
|
||||
3;0,8,9;,
|
||||
3;0,9,10;,
|
||||
3;0,10,11;,
|
||||
3;0,11,12;,
|
||||
3;0,12,13;,
|
||||
3;0,13,14;,
|
||||
3;0,14,15;,
|
||||
3;0,15,16;,
|
||||
3;0,16,17;,
|
||||
3;1,18,2;,
|
||||
3;2,18,19;,
|
||||
3;2,19,3;,
|
||||
3;3,19,20;,
|
||||
3;3,20,4;,
|
||||
3;4,20,21;,
|
||||
3;4,21,5;,
|
||||
3;5,21,22;,
|
||||
3;5,22,6;,
|
||||
3;6,22,23;,
|
||||
3;6,23,7;,
|
||||
3;7,23,24;,
|
||||
3;7,24,8;,
|
||||
3;8,24,25;,
|
||||
3;8,25,9;,
|
||||
3;9,25,26;,
|
||||
3;9,26,10;,
|
||||
3;10,26,27;,
|
||||
3;10,27,11;,
|
||||
3;11,27,28;,
|
||||
3;11,28,12;,
|
||||
3;12,28,29;,
|
||||
3;12,29,13;,
|
||||
3;13,29,30;,
|
||||
3;13,30,14;,
|
||||
3;14,30,31;,
|
||||
3;14,31,15;,
|
||||
3;15,31,32;,
|
||||
3;15,32,16;,
|
||||
3;16,32,33;,
|
||||
3;16,33,17;,
|
||||
3;17,33,34;,
|
||||
3;52,36,35;,
|
||||
3;52,37,36;,
|
||||
3;52,38,37;,
|
||||
3;52,39,38;,
|
||||
3;52,40,39;,
|
||||
3;52,41,40;,
|
||||
3;52,42,41;,
|
||||
3;52,43,42;,
|
||||
3;52,44,43;,
|
||||
3;52,45,44;,
|
||||
3;52,46,45;,
|
||||
3;52,47,46;,
|
||||
3;52,48,47;,
|
||||
3;52,49,48;,
|
||||
3;52,50,49;,
|
||||
3;52,51,50;;
|
||||
}
|
||||
|
||||
MeshTextureCoords {
|
||||
53;
|
||||
0.500000;0.000000;,
|
||||
0.000000;0.300000;,
|
||||
0.062500;0.300000;,
|
||||
0.125000;0.300000;,
|
||||
0.187500;0.300000;,
|
||||
0.250000;0.300000;,
|
||||
0.312500;0.300000;,
|
||||
0.375000;0.300000;,
|
||||
0.437500;0.300000;,
|
||||
0.500000;0.300000;,
|
||||
0.562500;0.300000;,
|
||||
0.625000;0.300000;,
|
||||
0.687500;0.300000;,
|
||||
0.750000;0.300000;,
|
||||
0.812500;0.300000;,
|
||||
0.875000;0.300000;,
|
||||
0.937500;0.300000;,
|
||||
1.000000;0.300000;,
|
||||
0.000000;0.992990;,
|
||||
0.062500;0.992990;,
|
||||
0.125000;0.992990;,
|
||||
0.187500;0.992990;,
|
||||
0.250000;0.992990;,
|
||||
0.312500;0.992990;,
|
||||
0.375000;0.992990;,
|
||||
0.437500;0.992990;,
|
||||
0.500000;0.992990;,
|
||||
0.562500;0.992990;,
|
||||
0.625000;0.992990;,
|
||||
0.687500;0.992990;,
|
||||
0.750000;0.992990;,
|
||||
0.812500;0.992990;,
|
||||
0.875000;0.992990;,
|
||||
0.937500;0.992990;,
|
||||
1.000000;0.992990;,
|
||||
0.000000;0.992990;,
|
||||
0.000000;0.992990;,
|
||||
0.000000;0.992990;,
|
||||
0.000000;0.992990;,
|
||||
0.000000;0.992990;,
|
||||
0.000000;0.992990;,
|
||||
0.000000;0.992990;,
|
||||
0.000000;0.992990;,
|
||||
0.000000;0.992990;,
|
||||
0.000000;0.992990;,
|
||||
0.000000;0.992990;,
|
||||
0.000000;0.992990;,
|
||||
0.000000;0.992990;,
|
||||
0.000000;0.992990;,
|
||||
0.000000;0.992990;,
|
||||
0.000000;0.992990;,
|
||||
0.000000;0.992990;,
|
||||
0.000000;0.992990;;
|
||||
}
|
||||
|
||||
MeshMaterialList {
|
||||
1;
|
||||
64;
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0;
|
||||
|
||||
Material {
|
||||
1.000000;1.000000;1.000000;1.000000;;
|
||||
1.000000;
|
||||
1.000000;1.000000;1.000000;;
|
||||
1.000000;1.000000;1.000000;;
|
||||
|
||||
TextureFilename {
|
||||
"spotlight.bmp";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 17 KiB |
@@ -0,0 +1,195 @@
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
///
|
||||
/// BandiVideoLibrary 2.1
|
||||
///
|
||||
/// Copyright(C) 2008-2012 BandiSoft.com All rights reserved.
|
||||
///
|
||||
/// Author: denny
|
||||
///
|
||||
/// Visit http://www.bandisoft.com for more information.
|
||||
///
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _BANDIVID_H
|
||||
#define _BANDIVID_H
|
||||
|
||||
#include <windows.h>
|
||||
#include <unknwn.h>
|
||||
|
||||
#ifndef ASSERT
|
||||
# include "assert.h"
|
||||
# define ASSERT(x) assert(x)
|
||||
#endif
|
||||
|
||||
#ifndef _INC_TCHAR
|
||||
# ifdef _UNICODE
|
||||
# define _T(x) L##x
|
||||
# define _stprintf swprintf
|
||||
# define _stprintf_s swprintf_s
|
||||
# else
|
||||
# define _T(x) x
|
||||
# define _stprintf sprintf
|
||||
# define _stprintf_s sprintf_s
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#define _BVL_MAKE_VER(a,b,c,d) ((a<<24)+(b<<16)+(c<<8)+d)
|
||||
#define BVL_VERSION _BVL_MAKE_VER(2,1,5,20) // 2.1.4.17
|
||||
|
||||
|
||||
// 이미지의 픽셀 포맷(타입)
|
||||
enum BVL_PIXEL_FORMAT
|
||||
{
|
||||
BVLPF_NULL,
|
||||
BVLPF_X8R8G8B8, // D3DFMT_X8R8G8B8 사용
|
||||
BVLPF_R8G8B8, // D3DFMT_R8G8B8 사용
|
||||
BVLPF_R5G6B5, // D3DFMT_R5G6B5 사용
|
||||
BVLPF_R5G5B5, // D3DFMT_X1R5G5B5 사용
|
||||
|
||||
BVLPF_A8R8G8B8, // D3DFMT_A8R8G8B8 사용
|
||||
};
|
||||
|
||||
|
||||
// Seeking flags
|
||||
enum BVL_SEEK_FLAG
|
||||
{
|
||||
BVL_SEEK_TIME, // time in 100-nanosecond
|
||||
BVL_SEEK_FRAME, // video frame number
|
||||
};
|
||||
|
||||
|
||||
// 비디오의 현재 상태
|
||||
enum BVL_STATUS
|
||||
{
|
||||
BVL_STATUS_ERROR = -1,
|
||||
BVL_STATUS_CLOSED = 0,
|
||||
BVL_STATUS_OPENING,
|
||||
BVL_STATUS_READY,
|
||||
BVL_STATUS_PLAYING,
|
||||
BVL_STATUS_PAUSED,
|
||||
BVL_STATUS_PLAYEND
|
||||
};
|
||||
|
||||
|
||||
// 프레임 데이터 구조체
|
||||
struct BVL_FRAME
|
||||
{
|
||||
void* frame_buf; // Pointer to the frame buffer
|
||||
INT frame_buf_size; // Number of bytes in a frame
|
||||
INT pitch; // Number of bytes in one row of the surface.
|
||||
INT width; // Frame width
|
||||
INT height; // Frame height
|
||||
BVL_PIXEL_FORMAT pixel_format; // Pixel format
|
||||
|
||||
INT64 frame_time; // 100nsec
|
||||
INT64 frame_number;
|
||||
};
|
||||
|
||||
|
||||
// 비디오 정보 구조체
|
||||
struct BVL_VIDEO_INFO
|
||||
{
|
||||
INT width;
|
||||
INT height;
|
||||
INT fps_rate;
|
||||
INT fps_scale;
|
||||
|
||||
INT samplerate;
|
||||
INT channels;
|
||||
|
||||
INT64 total_time; // 100nsec
|
||||
INT64 total_frames;
|
||||
};
|
||||
|
||||
|
||||
// IBandiVideoFileReader 인터페이스
|
||||
struct IBandiVideoFileReader : public IUnknown
|
||||
{
|
||||
virtual HRESULT Open(LPCWSTR path_name) PURE;
|
||||
virtual void Close() PURE;
|
||||
virtual INT Read(BYTE* buf, INT bytes_to_read) PURE;
|
||||
virtual INT64 SetPosition(INT64 pos) PURE;
|
||||
virtual INT64 GetPosition() PURE;
|
||||
virtual INT64 GetFileSize() PURE;
|
||||
};
|
||||
|
||||
|
||||
// IBandiVideoSoundCB 인터페이스
|
||||
struct IBandiVideoSoundCB : public IUnknown
|
||||
{
|
||||
virtual INT GetPcmData(INT16* pcm_buf, INT req_samples) PURE;
|
||||
};
|
||||
|
||||
|
||||
// IBandiVideoSound 인터페이스
|
||||
struct IBandiVideoSound : public IUnknown
|
||||
{
|
||||
virtual HRESULT Open(INT channels, INT samplerate, IBandiVideoSoundCB *callback) PURE;
|
||||
virtual void Close() PURE;
|
||||
|
||||
virtual HRESULT Start() PURE;
|
||||
virtual HRESULT Stop() PURE;
|
||||
virtual HRESULT Pause(BOOL pause) PURE;
|
||||
|
||||
virtual HRESULT GetTime(INT64 &time) PURE;
|
||||
virtual HRESULT SetVolume(INT volume) PURE; // 0 ~ 255
|
||||
};
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// IBandiVideo2 인터페이스
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
struct IBandiVideo2 : public IUnknown
|
||||
{
|
||||
virtual HRESULT Verify(LPCSTR id, LPCSTR key) PURE; // 인증하기
|
||||
|
||||
virtual INT GetVersion() PURE; // 버전 정보
|
||||
|
||||
// playback
|
||||
virtual HRESULT Open(LPCWSTR path_name, BOOL async) PURE;
|
||||
virtual HRESULT Close() PURE;
|
||||
virtual HRESULT Play() PURE;
|
||||
virtual HRESULT Stop() PURE;
|
||||
virtual HRESULT Seek(INT64 value, BVL_SEEK_FLAG seek_flag) PURE;
|
||||
virtual HRESULT Pause(BOOL pause) PURE;
|
||||
|
||||
virtual BOOL IsNextFrame() PURE;
|
||||
virtual HRESULT GetFrame(BVL_FRAME &frame, BOOL can_skip) PURE;
|
||||
|
||||
virtual HRESULT GetVideoInfo(BVL_VIDEO_INFO &info) PURE;
|
||||
virtual HRESULT GetStatus(BVL_STATUS &status) PURE;
|
||||
|
||||
virtual HRESULT SetVolume(INT volume) PURE; // 0 ~ 255
|
||||
};
|
||||
|
||||
|
||||
// IBandiVideo2 인터페이스 생성 함수
|
||||
typedef HRESULT (*LPCREATEBANDIVIDEO2)(UINT sdk_version, void** pp, IBandiVideoFileReader* reader, IBandiVideoSound *sound);
|
||||
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// 반디비디오 에러 코드
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
#define _FACBV 0x586
|
||||
#define MAKE_BVHRESULT( code ) MAKE_HRESULT( 1, _FACBV, code )
|
||||
#define MAKE_BVSTATUS( code ) MAKE_HRESULT( 0, _FACBV, code )
|
||||
|
||||
#define BV_OK S_OK
|
||||
#define BV_FALSE S_FALSE
|
||||
|
||||
#define BVERR_FAIL E_FAIL // 함수의 정해진 명령을 처리하는데 실패하였음
|
||||
|
||||
#define BVERR_LOAD_LIBRARY_FAIL MAKE_BVHRESULT(0x1020) // LoadLibrary 함수 실행중 에러
|
||||
#define BVERR_ALREADY_CREATED MAKE_BVHRESULT(0x1021) // 비디오 라이브러리의 인스턴스가 이미 생성되었음
|
||||
#define BVERR_GET_PROC_ADDRESS_FAIL MAKE_BVHRESULT(0x1022) // 비디오 라이브러리의 CreateBandiVideo 함수의 주소를 얻는데 실패하였음
|
||||
#define BVERR_LIBRARY_NOT_LOADED MAKE_BVHRESULT(0x1023) // 라이브러리가 로드되지 않았음
|
||||
#define BVERR_UNSUPPORTED_OS MAKE_BVHRESULT(0x1024) // 지원되지 않는 운영체제임
|
||||
|
||||
#define BVERR_INVALID_VERSION MAKE_BVHRESULT(0x1030) // 비디오 라이브러리의 헤더와 DLL 의 버젼이 안맞음
|
||||
#define BVERR_OUT_OF_MEMORY MAKE_BVHRESULT(0x1031) // 메모리가 부족하여 비디오라이브러리의 인스턴스를 생성할수 없음
|
||||
|
||||
#define BVERR_OPEN_FAILED MAKE_BVHRESULT(0x1040) // 파일이 없거나 지원되지 않는 컨테이너 형식임
|
||||
#define BVERR_NOT_OPENED MAKE_BVHRESULT(0x1041) // Open 되지 않은 파일에서 재생시도
|
||||
|
||||
#endif // _BANDIVID_H
|
||||
@@ -0,0 +1,247 @@
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
///
|
||||
/// BandiVideoLibrary 2.1 Sample
|
||||
///
|
||||
/// Copyright(C) 2008-2011 BandiSoft.com All rights reserved.
|
||||
///
|
||||
/// Visit http://www.bandisoft.com for more information.
|
||||
///
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
#include <windows.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "BandiVideoLibrary.h"
|
||||
#include "BandiVideoTexture_DX9.h"
|
||||
|
||||
#pragma warning (disable:4996)
|
||||
|
||||
#define WINDOW_TEXT "BandiVideo Async Playback"
|
||||
|
||||
#define MV_WIDTH 1024
|
||||
#define MV_HEIGHT 768
|
||||
|
||||
LRESULT WINAPI WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
switch(uMsg)
|
||||
{
|
||||
case WM_PAINT:
|
||||
{
|
||||
// 검은색으로 배경 칠하기
|
||||
PAINTSTRUCT ps;
|
||||
HDC dc;
|
||||
dc = BeginPaint(hwnd, &ps);
|
||||
PatBlt(dc, 0, 0, 4096, 4096, BLACKNESS);
|
||||
EndPaint(hwnd, &ps);
|
||||
}
|
||||
return 0;
|
||||
|
||||
case WM_ERASEBKGND:
|
||||
return 1;
|
||||
|
||||
case WM_DESTROY:
|
||||
PostQuitMessage(0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
return DefWindowProc(hwnd, uMsg, wParam, lParam);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 윈도우 생성
|
||||
static HWND CreatePlayerWindow(HINSTANCE hInstance, HINSTANCE hPrevInstance)
|
||||
{
|
||||
if(!hPrevInstance)
|
||||
{
|
||||
WNDCLASS wc;
|
||||
|
||||
wc.style = 0;
|
||||
wc.lpfnWndProc = WindowProc;
|
||||
wc.cbClsExtra = 0;
|
||||
wc.cbWndExtra = 0;
|
||||
wc.hInstance = hInstance;
|
||||
wc.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(101));
|
||||
wc.hCursor = LoadCursor(0, IDC_ARROW);;
|
||||
wc.hbrBackground = 0;
|
||||
wc.lpszMenuName = 0;
|
||||
wc.lpszClassName = "AsyncPlayback";
|
||||
|
||||
if(!RegisterClass(&wc))
|
||||
{
|
||||
return( 0 );
|
||||
}
|
||||
}
|
||||
|
||||
return CreateWindow("AsyncPlayback", WINDOW_TEXT,
|
||||
WS_CAPTION | WS_POPUP| WS_CLIPCHILDREN |
|
||||
WS_SYSMENU | WS_MINIMIZEBOX | WS_SIZEBOX,
|
||||
64, 64,
|
||||
64, 64,
|
||||
0, 0, hInstance,0);
|
||||
}
|
||||
|
||||
|
||||
// 윈도우 보더 크기 계산
|
||||
static void CalcWindowBorder(HWND hwnd, int &extra_width, int &extra_height)
|
||||
{
|
||||
RECT r, c;
|
||||
|
||||
GetWindowRect(hwnd, &r);
|
||||
GetClientRect(hwnd, &c);
|
||||
|
||||
extra_width = ( r.right - r.left ) - ( c.right - c.left );
|
||||
extra_height = ( r.bottom - r.top ) - ( c.bottom - c.top );
|
||||
}
|
||||
|
||||
|
||||
|
||||
int PASCAL WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
|
||||
{
|
||||
HWND hwnd;
|
||||
MSG msg;
|
||||
int extra_width, extra_height;
|
||||
|
||||
// 재생창 생성하기
|
||||
hwnd = CreatePlayerWindow(hInstance, hPrevInstance);
|
||||
if(!hwnd)
|
||||
{
|
||||
MessageBox(NULL, "Error creating window.", WINDOW_TEXT, MB_OK | MB_ICONSTOP);
|
||||
return 1;
|
||||
}
|
||||
|
||||
CalcWindowBorder(hwnd, extra_width, extra_height);
|
||||
|
||||
CBandiVideoLibrary bvl;
|
||||
CBandiVideoDevice* bvd = NULL;
|
||||
CBandiVideoTexture* bvt = NULL;
|
||||
BVL_VIDEO_INFO info;
|
||||
|
||||
if(FAILED(bvl.Create(BANDIVIDEO_DLL_FILE_NAME, NULL, NULL)))
|
||||
{
|
||||
MessageBox(NULL, "Error creating BandiVideoLibrary.", WINDOW_TEXT, MB_OK | MB_ICONSTOP);
|
||||
DestroyWindow(hwnd);
|
||||
return 2;
|
||||
}
|
||||
|
||||
/* // verify
|
||||
if(FAILED(bvl.Verify("BANDISOFT-TRIAL-200909", "ea92bc5b")))
|
||||
{
|
||||
// trial expired!!
|
||||
ASSERT(0);
|
||||
}*/
|
||||
|
||||
if(FAILED(bvl.Open(lpCmdLine, TRUE)))
|
||||
{
|
||||
MessageBox(NULL, "Error opening file....", WINDOW_TEXT, MB_OK | MB_ICONSTOP);
|
||||
DestroyWindow(hwnd);
|
||||
return 3;
|
||||
}
|
||||
|
||||
// 비디오 크기에 맞춰 창크기 변경
|
||||
SetWindowPos(hwnd, 0, 0, 0, MV_WIDTH+extra_width, MV_HEIGHT+extra_height, SWP_NOMOVE);
|
||||
|
||||
bvd = new CBandiVideoDevice_DX9();
|
||||
if(!bvd || FAILED(bvd->Open(hwnd)))
|
||||
{
|
||||
MessageBox(NULL, "Error opening device...", WINDOW_TEXT, MB_OK | MB_ICONSTOP);
|
||||
DestroyWindow(hwnd);
|
||||
if(bvd) delete bvd;
|
||||
return -1;
|
||||
}
|
||||
|
||||
ShowWindow(hwnd, nCmdShow);
|
||||
|
||||
do
|
||||
{
|
||||
if(PeekMessage(&msg, 0, 0, 0, PM_REMOVE))
|
||||
{
|
||||
if(msg.message == WM_QUIT)
|
||||
break;
|
||||
|
||||
TranslateMessage(&msg);
|
||||
DispatchMessage(&msg);
|
||||
}
|
||||
else
|
||||
{
|
||||
BVL_STATUS status;
|
||||
bvl.GetStatus(status);
|
||||
|
||||
if(status == BVL_STATUS_READY)
|
||||
{
|
||||
// 재생할 준비가 완료되었다면, 재생 시작
|
||||
bvl.GetVideoInfo(info);
|
||||
bvl.Play();
|
||||
|
||||
if(bvt == NULL)
|
||||
{
|
||||
bvt = new CBandiVideoTexture_DX9((CBandiVideoDevice_DX9*)bvd);
|
||||
if(!bvt || FAILED(bvt->Open(info.width , info.height)))
|
||||
{
|
||||
if(bvt) delete bvt;
|
||||
bvt = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(status == BVL_STATUS_PLAYEND)
|
||||
{
|
||||
// 끝까지 재생이 완료되었으면, 다시 열기
|
||||
bvl.Close();
|
||||
bvl.Open(lpCmdLine, TRUE);
|
||||
}
|
||||
else if(status == BVL_STATUS_ERROR)
|
||||
{
|
||||
MessageBox(NULL, "Error playing file...", WINDOW_TEXT, MB_OK | MB_ICONSTOP);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
// 새 프레임을 출력할 시간인가?
|
||||
if(bvl.IsNextFrame())
|
||||
{
|
||||
INT pitch;
|
||||
BYTE* buf = bvt->Lock(pitch);
|
||||
if(buf)
|
||||
{
|
||||
// Get frame
|
||||
BVL_FRAME frame;
|
||||
frame.frame_buf = buf;
|
||||
frame.frame_buf_size = info.height*pitch;
|
||||
frame.pitch = pitch;
|
||||
frame.width = info.width;
|
||||
frame.height = info.height;
|
||||
frame.pixel_format = bvt->GetFormat();
|
||||
|
||||
bvl.GetFrame(frame, TRUE);
|
||||
|
||||
bvt->Unlock();
|
||||
|
||||
// Show frame
|
||||
bvd->StartFrame();
|
||||
bvt->Draw(0, 0, MV_WIDTH, MV_HEIGHT);
|
||||
bvd->EndFrame();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Sleep(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
while(1);
|
||||
|
||||
bvl.Destroy();
|
||||
|
||||
if(bvd)
|
||||
{
|
||||
bvd->Close();
|
||||
delete bvd;
|
||||
}
|
||||
|
||||
if(bvt)
|
||||
{
|
||||
bvt->Close();
|
||||
delete bvt;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,365 @@
|
||||
<?xml version="1.0" encoding="ks_c_5601-1987"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="9.00"
|
||||
Name="AsyncPlayback"
|
||||
ProjectGUID="{9905918E-5CD9-4698-B0C3-8CA1FD84CC13}"
|
||||
RootNamespace="AsyncPlayback"
|
||||
Keyword="Win32Proj"
|
||||
TargetFrameworkVersion="196613"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
<Platform
|
||||
Name="x64"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
||||
IntermediateDirectory="$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="../../include, ../../source"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="4"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="d3d9.lib dsound.lib"
|
||||
OutputFile="..\..\bin\$(ProjectName)_d.exe"
|
||||
LinkIncremental="2"
|
||||
GenerateDebugInformation="true"
|
||||
SubSystem="2"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Debug|x64"
|
||||
OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
|
||||
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TargetEnvironment="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="../../include, ../../source"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="d3d9.lib dsound.lib"
|
||||
OutputFile="..\..\bin\$(ProjectName)64_d.exe"
|
||||
LinkIncremental="2"
|
||||
GenerateDebugInformation="true"
|
||||
SubSystem="2"
|
||||
TargetMachine="17"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
||||
IntermediateDirectory="$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="2"
|
||||
WholeProgramOptimization="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
EnableIntrinsicFunctions="true"
|
||||
AdditionalIncludeDirectories="../../include, ../../source"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
|
||||
RuntimeLibrary="0"
|
||||
EnableFunctionLevelLinking="true"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="d3d9.lib dsound.lib"
|
||||
OutputFile="..\..\bin\$(ProjectName).exe"
|
||||
LinkIncremental="1"
|
||||
GenerateDebugInformation="true"
|
||||
SubSystem="2"
|
||||
OptimizeReferences="2"
|
||||
EnableCOMDATFolding="2"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|x64"
|
||||
OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
|
||||
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="2"
|
||||
WholeProgramOptimization="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TargetEnvironment="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
EnableIntrinsicFunctions="true"
|
||||
AdditionalIncludeDirectories="../../include, ../../source"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
|
||||
RuntimeLibrary="0"
|
||||
EnableFunctionLevelLinking="true"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="d3d9.lib dsound.lib"
|
||||
OutputFile="..\..\bin\$(ProjectName)64.exe"
|
||||
LinkIncremental="1"
|
||||
GenerateDebugInformation="true"
|
||||
SubSystem="2"
|
||||
OptimizeReferences="2"
|
||||
EnableCOMDATFolding="2"
|
||||
TargetMachine="17"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="main"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\AsyncPlayback.cpp"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="bvl"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\..\source\BandiVideoLibrary.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\source\BandiVideoLibrary.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\source\BandiVideoTexture.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\source\BandiVideoTexture_DX9.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\source\BandiVideoTexture_DX9.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
||||
@@ -0,0 +1,183 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{9905918E-5CD9-4698-B0C3-8CA1FD84CC13}</ProjectGuid>
|
||||
<RootNamespace>AsyncPlayback</RootNamespace>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>../../include; ../../source;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>true</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>d3d9.lib;dsound.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>..\..\bin\$(ProjectName)_d.exe</OutputFile>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Midl>
|
||||
<TargetEnvironment>X64</TargetEnvironment>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>../../include; ../../source;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>true</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>d3d9.lib;dsound.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>..\..\bin\$(ProjectName)64_d.exe</OutputFile>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<TargetMachine>MachineX64</TargetMachine>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<AdditionalIncludeDirectories>../../include; ../../source;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>d3d9.lib;dsound.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>..\..\bin\$(ProjectName).exe</OutputFile>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Midl>
|
||||
<TargetEnvironment>X64</TargetEnvironment>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<AdditionalIncludeDirectories>../../include; ../../source;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>d3d9.lib;dsound.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>..\..\bin\$(ProjectName)64.exe</OutputFile>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<TargetMachine>MachineX64</TargetMachine>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="AsyncPlayback.cpp" />
|
||||
<ClCompile Include="..\..\source\BandiVideoLibrary.cpp" />
|
||||
<ClCompile Include="..\..\source\BandiVideoTexture_DX9.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\source\BandiVideoLibrary.h" />
|
||||
<ClInclude Include="..\..\source\BandiVideoTexture.h" />
|
||||
<ClInclude Include="..\..\source\BandiVideoTexture_DX9.h" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,33 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="main">
|
||||
<UniqueIdentifier>{79a6d450-f470-40a4-aacb-dab5f073d9fe}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="bvl">
|
||||
<UniqueIdentifier>{171483cd-ad35-4957-af45-d2505e55cc64}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="AsyncPlayback.cpp">
|
||||
<Filter>main</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\source\BandiVideoLibrary.cpp">
|
||||
<Filter>bvl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\source\BandiVideoTexture_DX9.cpp">
|
||||
<Filter>bvl</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\source\BandiVideoLibrary.h">
|
||||
<Filter>bvl</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\source\BandiVideoTexture.h">
|
||||
<Filter>bvl</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\source\BandiVideoTexture_DX9.h">
|
||||
<Filter>bvl</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,365 @@
|
||||
<?xml version="1.0" encoding="ks_c_5601-1987"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="8.00"
|
||||
Name="AsyncPlayback"
|
||||
ProjectGUID="{9905918E-5CD9-4698-B0C3-8CA1FD84CC13}"
|
||||
RootNamespace="AsyncPlayback"
|
||||
Keyword="Win32Proj"
|
||||
TargetFrameworkVersion="196613"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
<Platform
|
||||
Name="x64"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
||||
IntermediateDirectory="$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="../../include, ../../source"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="4"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="d3d9.lib dsound.lib"
|
||||
OutputFile="..\..\bin\$(ProjectName)_d.exe"
|
||||
LinkIncremental="2"
|
||||
GenerateDebugInformation="true"
|
||||
SubSystem="2"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Debug|x64"
|
||||
OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
|
||||
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TargetEnvironment="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="../../include, ../../source"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="d3d9.lib dsound.lib"
|
||||
OutputFile="..\..\bin\$(ProjectName)64_d.exe"
|
||||
LinkIncremental="2"
|
||||
GenerateDebugInformation="true"
|
||||
SubSystem="2"
|
||||
TargetMachine="17"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
||||
IntermediateDirectory="$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="2"
|
||||
WholeProgramOptimization="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
EnableIntrinsicFunctions="true"
|
||||
AdditionalIncludeDirectories="../../include, ../../source"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
|
||||
RuntimeLibrary="0"
|
||||
EnableFunctionLevelLinking="true"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="d3d9.lib dsound.lib"
|
||||
OutputFile="..\..\bin\$(ProjectName).exe"
|
||||
LinkIncremental="1"
|
||||
GenerateDebugInformation="true"
|
||||
SubSystem="2"
|
||||
OptimizeReferences="2"
|
||||
EnableCOMDATFolding="2"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|x64"
|
||||
OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
|
||||
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="2"
|
||||
WholeProgramOptimization="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TargetEnvironment="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
EnableIntrinsicFunctions="true"
|
||||
AdditionalIncludeDirectories="../../include, ../../source"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
|
||||
RuntimeLibrary="0"
|
||||
EnableFunctionLevelLinking="true"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="d3d9.lib dsound.lib"
|
||||
OutputFile="..\..\bin\$(ProjectName)64.exe"
|
||||
LinkIncremental="1"
|
||||
GenerateDebugInformation="true"
|
||||
SubSystem="2"
|
||||
OptimizeReferences="2"
|
||||
EnableCOMDATFolding="2"
|
||||
TargetMachine="17"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="main"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\AsyncPlayback.cpp"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="bvl"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\..\source\BandiVideoLibrary.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\source\BandiVideoLibrary.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\source\BandiVideoTexture.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\source\BandiVideoTexture_DX9.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\source\BandiVideoTexture_DX9.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
||||
|
After Width: | Height: | Size: 23 KiB |
@@ -0,0 +1,150 @@
|
||||
//Microsoft Visual C++ generated resource script.
|
||||
//
|
||||
#include "resource.h"
|
||||
|
||||
#define APSTUDIO_READONLY_SYMBOLS
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 2 resource.
|
||||
//
|
||||
#ifndef APSTUDIO_INVOKED
|
||||
#include "targetver.h"
|
||||
#endif
|
||||
#define APSTUDIO_HIDDEN_SYMBOLS
|
||||
#include "windows.h"
|
||||
#undef APSTUDIO_HIDDEN_SYMBOLS
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#undef APSTUDIO_READONLY_SYMBOLS
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
|
||||
LANGUAGE 9, 1
|
||||
#pragma code_page(949)
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Icon
|
||||
//
|
||||
|
||||
// Icon with lowest ID value placed first to ensure application icon
|
||||
// remains consistent on all systems.
|
||||
|
||||
IDI_BANDIVIDSAMPLE ICON "BandiVidSample.ico"
|
||||
IDI_SMALL ICON "small.ico"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Menu
|
||||
//
|
||||
|
||||
IDC_BANDIVIDSAMPLE MENU
|
||||
BEGIN
|
||||
POPUP "&File"
|
||||
BEGIN
|
||||
MENUITEM "E&xit", IDM_EXIT
|
||||
END
|
||||
POPUP "&Help"
|
||||
BEGIN
|
||||
MENUITEM "&About ...", IDM_ABOUT
|
||||
END
|
||||
END
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Accelerator
|
||||
//
|
||||
|
||||
IDC_BANDIVIDSAMPLE ACCELERATORS
|
||||
BEGIN
|
||||
"?", IDM_ABOUT, ASCII, ALT
|
||||
"/", IDM_ABOUT, ASCII, ALT
|
||||
END
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Dialog
|
||||
//
|
||||
|
||||
IDD_ABOUTBOX DIALOGEX 0, 0, 170, 62
|
||||
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "About BandiVidSample"
|
||||
FONT 8, "MS Shell Dlg"
|
||||
BEGIN
|
||||
ICON IDR_MAINFRAME,IDC_STATIC,14,14,21,20
|
||||
LTEXT "BandiVidSample, Version 1.0",IDC_STATIC,42,14,114,8,SS_NOPREFIX
|
||||
LTEXT "Copyright (C) 2009",IDC_STATIC,42,26,114,8
|
||||
DEFPUSHBUTTON "OK",IDOK,113,41,50,14,WS_GROUP
|
||||
END
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// DESIGNINFO
|
||||
//
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
GUIDELINES DESIGNINFO
|
||||
BEGIN
|
||||
IDD_ABOUTBOX, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 7
|
||||
RIGHTMARGIN, 163
|
||||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 55
|
||||
END
|
||||
END
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// TEXTINCLUDE
|
||||
//
|
||||
1 TEXTINCLUDE
|
||||
BEGIN
|
||||
"resource.h\0"
|
||||
END
|
||||
|
||||
2 TEXTINCLUDE
|
||||
BEGIN
|
||||
"#ifndef APSTUDIO_INVOKED\r\n"
|
||||
"#include ""targetver.h""\r\n"
|
||||
"#endif\r\n"
|
||||
"#define APSTUDIO_HIDDEN_SYMBOLS\r\n"
|
||||
"#include ""windows.h""\r\n"
|
||||
"#undef APSTUDIO_HIDDEN_SYMBOLS\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
3 TEXTINCLUDE
|
||||
BEGIN
|
||||
"\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// String Table
|
||||
//
|
||||
|
||||
STRINGTABLE
|
||||
BEGIN
|
||||
IDC_BANDIVIDSAMPLE "BANDIVIDSAMPLE"
|
||||
IDS_APP_TITLE "BandiVidSample"
|
||||
END
|
||||
|
||||
#endif
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
#ifndef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 3 resource.
|
||||
//
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#endif // not APSTUDIO_INVOKED
|
||||
@@ -0,0 +1,26 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 11.00
|
||||
# Visual Studio 2010
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BandiVidSample", "BandiVidSample.vcxproj", "{4E71EE8D-57F4-4400-9109-E0C4A1F273D0}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
Debug|x64 = Debug|x64
|
||||
Release|Win32 = Release|Win32
|
||||
Release|x64 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{4E71EE8D-57F4-4400-9109-E0C4A1F273D0}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{4E71EE8D-57F4-4400-9109-E0C4A1F273D0}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{4E71EE8D-57F4-4400-9109-E0C4A1F273D0}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{4E71EE8D-57F4-4400-9109-E0C4A1F273D0}.Debug|x64.Build.0 = Debug|x64
|
||||
{4E71EE8D-57F4-4400-9109-E0C4A1F273D0}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{4E71EE8D-57F4-4400-9109-E0C4A1F273D0}.Release|Win32.Build.0 = Release|Win32
|
||||
{4E71EE8D-57F4-4400-9109-E0C4A1F273D0}.Release|x64.ActiveCfg = Release|x64
|
||||
{4E71EE8D-57F4-4400-9109-E0C4A1F273D0}.Release|x64.Build.0 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@@ -0,0 +1,599 @@
|
||||
<?xml version="1.0" encoding="ks_c_5601-1987"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="9.00"
|
||||
Name="BandiVidSample"
|
||||
ProjectGUID="{4E71EE8D-57F4-4400-9109-E0C4A1F273D0}"
|
||||
RootNamespace="BandiVidSample"
|
||||
Keyword="Win32Proj"
|
||||
TargetFrameworkVersion="196613"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
<Platform
|
||||
Name="x64"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
||||
IntermediateDirectory="$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
UseOfATL="1"
|
||||
CharacterSet="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=".;./dxut;../../include,../../source"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
UsePrecompiledHeader="2"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="4"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="..\..\bin\$(ProjectName)_d.exe"
|
||||
LinkIncremental="2"
|
||||
AdditionalLibraryDirectories=""
|
||||
GenerateDebugInformation="true"
|
||||
SubSystem="2"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Debug|x64"
|
||||
OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
|
||||
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
UseOfATL="1"
|
||||
CharacterSet="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TargetEnvironment="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=".;./dxut;../../include,../../source"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
UsePrecompiledHeader="2"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="..\..\bin\$(ProjectName)64_d.exe"
|
||||
LinkIncremental="2"
|
||||
AdditionalLibraryDirectories=""
|
||||
GenerateDebugInformation="true"
|
||||
SubSystem="2"
|
||||
TargetMachine="17"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
||||
IntermediateDirectory="$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
UseOfATL="1"
|
||||
CharacterSet="1"
|
||||
WholeProgramOptimization="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
EnableIntrinsicFunctions="true"
|
||||
AdditionalIncludeDirectories=".;./dxut;../../include,../../source"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
|
||||
RuntimeLibrary="0"
|
||||
EnableFunctionLevelLinking="true"
|
||||
UsePrecompiledHeader="2"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="..\..\bin\$(ProjectName).exe"
|
||||
LinkIncremental="1"
|
||||
AdditionalLibraryDirectories=""
|
||||
GenerateDebugInformation="true"
|
||||
SubSystem="2"
|
||||
OptimizeReferences="2"
|
||||
EnableCOMDATFolding="2"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|x64"
|
||||
OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
|
||||
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
UseOfATL="1"
|
||||
CharacterSet="1"
|
||||
WholeProgramOptimization="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TargetEnvironment="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
EnableIntrinsicFunctions="true"
|
||||
AdditionalIncludeDirectories=".;./dxut;../../include,../../source"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
|
||||
RuntimeLibrary="0"
|
||||
EnableFunctionLevelLinking="true"
|
||||
UsePrecompiledHeader="2"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="..\..\bin\$(ProjectName)64.exe"
|
||||
LinkIncremental="1"
|
||||
AdditionalLibraryDirectories=""
|
||||
GenerateDebugInformation="true"
|
||||
SubSystem="2"
|
||||
OptimizeReferences="2"
|
||||
EnableCOMDATFolding="2"
|
||||
TargetMachine="17"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Resource Files"
|
||||
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
|
||||
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\BandiVidSample.ico"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\BandiVidSample.rc"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Resource.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\small.ico"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="default"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\stdafx.cpp"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
UsePrecompiledHeader="1"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|x64"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
UsePrecompiledHeader="1"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
UsePrecompiledHeader="1"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|x64"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
UsePrecompiledHeader="1"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\stdafx.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\targetver.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="main"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\BandiVidSample.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\VideoTest.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\VideoTest.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="DXUT"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\DXUT\dxstdafx.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\DXUT\dxstdafx.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\DXUT\DXUT.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\DXUT\DXUT.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\DXUT\DXUTEffectMap.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\DXUT\DXUTEffectMap.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\DXUT\DXUTenum.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\DXUT\DXUTenum.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\DXUT\DXUTgui.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\DXUT\DXUTgui.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\DXUT\DXUTMesh.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\DXUT\DXUTMesh.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\DXUT\DXUTmisc.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\DXUT\DXUTmisc.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\DXUT\DXUTsettingsdlg.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\DXUT\DXUTsettingsdlg.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\DXUT\DXUTsound.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\DXUT\DXUTsound.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\DXUT\SDKmesh.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\DXUT\SDKmesh.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="bvl"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\..\source\BandiVideoLibrary.cpp"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
UsePrecompiledHeader="0"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|x64"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
UsePrecompiledHeader="0"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
UsePrecompiledHeader="0"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|x64"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
UsePrecompiledHeader="0"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\source\BandiVideoLibrary.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\source\BandiVideoTexture.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\source\BandiVideoTexture_DX9.cpp"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
UsePrecompiledHeader="0"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|x64"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
UsePrecompiledHeader="0"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
UsePrecompiledHeader="0"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|x64"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
UsePrecompiledHeader="0"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\source\BandiVideoTexture_DX9.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<File
|
||||
RelativePath=".\ReadMe.txt"
|
||||
>
|
||||
</File>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
||||
@@ -0,0 +1,241 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{4E71EE8D-57F4-4400-9109-E0C4A1F273D0}</ProjectGuid>
|
||||
<RootNamespace>BandiVidSample</RootNamespace>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseOfAtl>Static</UseOfAtl>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseOfAtl>Static</UseOfAtl>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseOfAtl>Static</UseOfAtl>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseOfAtl>Static</UseOfAtl>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
|
||||
<IncludePath Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(WindowsSdkDir)include;$(DXSDK_DIR)include;$(IncludePath)</IncludePath>
|
||||
<LibraryPath Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(DXSDK_DIR)Lib\x86;$(LibraryPath)</LibraryPath>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>.;./dxut;../../include;../../source;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>true</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<OutputFile>..\..\bin\$(ProjectName)_d.exe</OutputFile>
|
||||
<AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Midl>
|
||||
<TargetEnvironment>X64</TargetEnvironment>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>.;./dxut;../../include;../../source;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>true</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<OutputFile>..\..\bin\$(ProjectName)64_d.exe</OutputFile>
|
||||
<AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<TargetMachine>MachineX64</TargetMachine>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<AdditionalIncludeDirectories>.;./dxut;../../include;../../source;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<OutputFile>$(SolutionDir)$(Configuration)\BandiVidSample.exe</OutputFile>
|
||||
<AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Midl>
|
||||
<TargetEnvironment>X64</TargetEnvironment>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<AdditionalIncludeDirectories>.;./dxut;../../include;../../source;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<OutputFile>..\..\bin\$(ProjectName)64.exe</OutputFile>
|
||||
<AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<TargetMachine>MachineX64</TargetMachine>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<None Include="BandiVidSample.ico" />
|
||||
<None Include="small.ico" />
|
||||
<None Include="ReadMe.txt" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="BandiVidSample.rc" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="Resource.h" />
|
||||
<ClInclude Include="stdafx.h" />
|
||||
<ClInclude Include="targetver.h" />
|
||||
<ClInclude Include="VideoTest.h" />
|
||||
<ClInclude Include="DXUT\dxstdafx.h" />
|
||||
<ClInclude Include="DXUT\DXUT.h" />
|
||||
<ClInclude Include="DXUT\DXUTEffectMap.h" />
|
||||
<ClInclude Include="DXUT\DXUTenum.h" />
|
||||
<ClInclude Include="DXUT\DXUTgui.h" />
|
||||
<ClInclude Include="DXUT\DXUTMesh.h" />
|
||||
<ClInclude Include="DXUT\DXUTmisc.h" />
|
||||
<ClInclude Include="DXUT\DXUTsettingsdlg.h" />
|
||||
<ClInclude Include="DXUT\DXUTsound.h" />
|
||||
<ClInclude Include="DXUT\SDKmesh.h" />
|
||||
<ClInclude Include="..\..\source\BandiVideoLibrary.h" />
|
||||
<ClInclude Include="..\..\source\BandiVideoTexture.h" />
|
||||
<ClInclude Include="..\..\source\BandiVideoTexture_DX9.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="stdafx.cpp">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="BandiVidSample.cpp" />
|
||||
<ClCompile Include="VideoTest.cpp" />
|
||||
<ClCompile Include="DXUT\dxstdafx.cpp" />
|
||||
<ClCompile Include="DXUT\DXUT.cpp" />
|
||||
<ClCompile Include="DXUT\DXUTEffectMap.cpp" />
|
||||
<ClCompile Include="DXUT\DXUTenum.cpp" />
|
||||
<ClCompile Include="DXUT\DXUTgui.cpp" />
|
||||
<ClCompile Include="DXUT\DXUTMesh.cpp" />
|
||||
<ClCompile Include="DXUT\DXUTmisc.cpp" />
|
||||
<ClCompile Include="DXUT\DXUTsettingsdlg.cpp" />
|
||||
<ClCompile Include="DXUT\DXUTsound.cpp" />
|
||||
<ClCompile Include="DXUT\SDKmesh.cpp" />
|
||||
<ClCompile Include="..\..\source\BandiVideoLibrary.cpp">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\source\BandiVideoTexture_DX9.cpp">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,135 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Resource Files">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="default">
|
||||
<UniqueIdentifier>{1a09e89f-b061-4f8e-a9c2-2d81e029087c}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="main">
|
||||
<UniqueIdentifier>{5b234827-d2df-40d3-828d-da21b4183520}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="DXUT">
|
||||
<UniqueIdentifier>{e8a2c620-9eab-4ae3-9d4c-f8df5e0d7760}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="bvl">
|
||||
<UniqueIdentifier>{def60c92-5f53-40f4-acd7-841c8812cf96}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="BandiVidSample.ico">
|
||||
<Filter>Resource Files</Filter>
|
||||
</None>
|
||||
<None Include="small.ico">
|
||||
<Filter>Resource Files</Filter>
|
||||
</None>
|
||||
<None Include="ReadMe.txt" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="BandiVidSample.rc">
|
||||
<Filter>Resource Files</Filter>
|
||||
</ResourceCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="Resource.h">
|
||||
<Filter>Resource Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="stdafx.h">
|
||||
<Filter>default</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="targetver.h">
|
||||
<Filter>default</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="VideoTest.h">
|
||||
<Filter>main</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="DXUT\dxstdafx.h">
|
||||
<Filter>DXUT</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="DXUT\DXUT.h">
|
||||
<Filter>DXUT</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="DXUT\DXUTEffectMap.h">
|
||||
<Filter>DXUT</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="DXUT\DXUTenum.h">
|
||||
<Filter>DXUT</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="DXUT\DXUTgui.h">
|
||||
<Filter>DXUT</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="DXUT\DXUTMesh.h">
|
||||
<Filter>DXUT</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="DXUT\DXUTmisc.h">
|
||||
<Filter>DXUT</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="DXUT\DXUTsettingsdlg.h">
|
||||
<Filter>DXUT</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="DXUT\DXUTsound.h">
|
||||
<Filter>DXUT</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="DXUT\SDKmesh.h">
|
||||
<Filter>DXUT</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\source\BandiVideoLibrary.h">
|
||||
<Filter>bvl</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\source\BandiVideoTexture.h">
|
||||
<Filter>bvl</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\source\BandiVideoTexture_DX9.h">
|
||||
<Filter>bvl</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="stdafx.cpp">
|
||||
<Filter>default</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="BandiVidSample.cpp">
|
||||
<Filter>main</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="VideoTest.cpp">
|
||||
<Filter>main</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="DXUT\dxstdafx.cpp">
|
||||
<Filter>DXUT</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="DXUT\DXUT.cpp">
|
||||
<Filter>DXUT</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="DXUT\DXUTEffectMap.cpp">
|
||||
<Filter>DXUT</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="DXUT\DXUTenum.cpp">
|
||||
<Filter>DXUT</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="DXUT\DXUTgui.cpp">
|
||||
<Filter>DXUT</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="DXUT\DXUTMesh.cpp">
|
||||
<Filter>DXUT</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="DXUT\DXUTmisc.cpp">
|
||||
<Filter>DXUT</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="DXUT\DXUTsettingsdlg.cpp">
|
||||
<Filter>DXUT</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="DXUT\DXUTsound.cpp">
|
||||
<Filter>DXUT</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="DXUT\SDKmesh.cpp">
|
||||
<Filter>DXUT</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\source\BandiVideoLibrary.cpp">
|
||||
<Filter>bvl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\source\BandiVideoTexture_DX9.cpp">
|
||||
<Filter>bvl</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,599 @@
|
||||
<?xml version="1.0" encoding="ks_c_5601-1987"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="8.00"
|
||||
Name="BandiVidSample"
|
||||
ProjectGUID="{4E71EE8D-57F4-4400-9109-E0C4A1F273D0}"
|
||||
RootNamespace="BandiVidSample"
|
||||
Keyword="Win32Proj"
|
||||
TargetFrameworkVersion="196613"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
<Platform
|
||||
Name="x64"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
||||
IntermediateDirectory="$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
UseOfATL="1"
|
||||
CharacterSet="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=".;./dxut;../../include,../../source"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
UsePrecompiledHeader="2"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="4"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="..\..\bin\$(ProjectName)_d.exe"
|
||||
LinkIncremental="2"
|
||||
AdditionalLibraryDirectories=""
|
||||
GenerateDebugInformation="true"
|
||||
SubSystem="2"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Debug|x64"
|
||||
OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
|
||||
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
UseOfATL="1"
|
||||
CharacterSet="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TargetEnvironment="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=".;./dxut;../../include,../../source"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
UsePrecompiledHeader="2"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="..\..\bin\$(ProjectName)64_d.exe"
|
||||
LinkIncremental="2"
|
||||
AdditionalLibraryDirectories=""
|
||||
GenerateDebugInformation="true"
|
||||
SubSystem="2"
|
||||
TargetMachine="17"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
||||
IntermediateDirectory="$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
UseOfATL="1"
|
||||
CharacterSet="1"
|
||||
WholeProgramOptimization="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
EnableIntrinsicFunctions="true"
|
||||
AdditionalIncludeDirectories=".;./dxut;../../include,../../source"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
|
||||
RuntimeLibrary="0"
|
||||
EnableFunctionLevelLinking="true"
|
||||
UsePrecompiledHeader="2"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="..\..\bin\$(ProjectName).exe"
|
||||
LinkIncremental="1"
|
||||
AdditionalLibraryDirectories=""
|
||||
GenerateDebugInformation="true"
|
||||
SubSystem="2"
|
||||
OptimizeReferences="2"
|
||||
EnableCOMDATFolding="2"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|x64"
|
||||
OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
|
||||
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
UseOfATL="1"
|
||||
CharacterSet="1"
|
||||
WholeProgramOptimization="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TargetEnvironment="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
EnableIntrinsicFunctions="true"
|
||||
AdditionalIncludeDirectories=".;./dxut;../../include,../../source"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
|
||||
RuntimeLibrary="0"
|
||||
EnableFunctionLevelLinking="true"
|
||||
UsePrecompiledHeader="2"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="..\..\bin\$(ProjectName)64.exe"
|
||||
LinkIncremental="1"
|
||||
AdditionalLibraryDirectories=""
|
||||
GenerateDebugInformation="true"
|
||||
SubSystem="2"
|
||||
OptimizeReferences="2"
|
||||
EnableCOMDATFolding="2"
|
||||
TargetMachine="17"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Resource Files"
|
||||
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
|
||||
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\BandiVidSample.ico"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\BandiVidSample.rc"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Resource.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\small.ico"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="default"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\stdafx.cpp"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
UsePrecompiledHeader="1"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|x64"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
UsePrecompiledHeader="1"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
UsePrecompiledHeader="1"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|x64"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
UsePrecompiledHeader="1"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\stdafx.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\targetver.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="main"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\BandiVidSample.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\VideoTest.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\VideoTest.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="DXUT"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\DXUT\dxstdafx.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\DXUT\dxstdafx.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\DXUT\DXUT.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\DXUT\DXUT.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\DXUT\DXUTEffectMap.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\DXUT\DXUTEffectMap.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\DXUT\DXUTenum.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\DXUT\DXUTenum.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\DXUT\DXUTgui.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\DXUT\DXUTgui.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\DXUT\DXUTMesh.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\DXUT\DXUTMesh.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\DXUT\DXUTmisc.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\DXUT\DXUTmisc.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\DXUT\DXUTsettingsdlg.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\DXUT\DXUTsettingsdlg.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\DXUT\DXUTsound.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\DXUT\DXUTsound.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\DXUT\SDKmesh.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\DXUT\SDKmesh.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="bvl"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\..\source\BandiVideoLibrary.cpp"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
UsePrecompiledHeader="0"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|x64"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
UsePrecompiledHeader="0"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
UsePrecompiledHeader="0"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|x64"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
UsePrecompiledHeader="0"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\source\BandiVideoLibrary.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\source\BandiVideoTexture.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\source\BandiVideoTexture_DX9.cpp"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
UsePrecompiledHeader="0"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|x64"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
UsePrecompiledHeader="0"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
UsePrecompiledHeader="0"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|x64"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
UsePrecompiledHeader="0"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\source\BandiVideoTexture_DX9.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<File
|
||||
RelativePath=".\ReadMe.txt"
|
||||
>
|
||||
</File>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
||||
@@ -0,0 +1,189 @@
|
||||
//--------------------------------------------------------------------------------------
|
||||
// File: DXUT.h
|
||||
//
|
||||
// DirectX SDK Direct3D sample framework
|
||||
//
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//--------------------------------------------------------------------------------------
|
||||
#pragma once
|
||||
#ifndef DXUT_H
|
||||
#define DXUT_H
|
||||
|
||||
#ifndef UNICODE
|
||||
#error "The sample framework requires a Unicode build. If you are using Microsoft Visual C++ .NET, under the General tab of the project properties change the Character Set to 'Use Unicode Character Set'."
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
// Structs
|
||||
//--------------------------------------------------------------------------------------
|
||||
class CD3DEnumeration;
|
||||
class CD3DSettingsDlg;
|
||||
|
||||
struct DXUTDeviceSettings
|
||||
{
|
||||
UINT AdapterOrdinal;
|
||||
D3DDEVTYPE DeviceType;
|
||||
D3DFORMAT AdapterFormat;
|
||||
DWORD BehaviorFlags;
|
||||
D3DPRESENT_PARAMETERS pp;
|
||||
};
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
// Error codes
|
||||
//--------------------------------------------------------------------------------------
|
||||
#define DXUTERR_NODIRECT3D MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x0901)
|
||||
#define DXUTERR_NOCOMPATIBLEDEVICES MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x0902)
|
||||
#define DXUTERR_MEDIANOTFOUND MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x0903)
|
||||
#define DXUTERR_NONZEROREFCOUNT MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x0904)
|
||||
#define DXUTERR_CREATINGDEVICE MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x0905)
|
||||
#define DXUTERR_RESETTINGDEVICE MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x0906)
|
||||
#define DXUTERR_CREATINGDEVICEOBJECTS MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x0907)
|
||||
#define DXUTERR_RESETTINGDEVICEOBJECTS MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x0908)
|
||||
#define DXUTERR_INCORRECTVERSION MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x0909)
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
// Callback registration
|
||||
//--------------------------------------------------------------------------------------
|
||||
typedef bool (CALLBACK *LPDXUTCALLBACKISDEVICEACCEPTABLE)( D3DCAPS9* pCaps, D3DFORMAT AdapterFormat, D3DFORMAT BackBufferFormat, bool bWindowed );
|
||||
typedef void (CALLBACK *LPDXUTCALLBACKMODIFYDEVICESETTINGS)( DXUTDeviceSettings* pDeviceSettings, const D3DCAPS9* pCaps );
|
||||
typedef HRESULT (CALLBACK *LPDXUTCALLBACKDEVICECREATED)( IDirect3DDevice9* pd3dDevice, const D3DSURFACE_DESC* pBackBufferSurfaceDesc );
|
||||
typedef HRESULT (CALLBACK *LPDXUTCALLBACKDEVICERESET)( IDirect3DDevice9* pd3dDevice, const D3DSURFACE_DESC* pBackBufferSurfaceDesc );
|
||||
typedef void (CALLBACK *LPDXUTCALLBACKDEVICEDESTROYED)();
|
||||
typedef void (CALLBACK *LPDXUTCALLBACKDEVICELOST)();
|
||||
typedef void (CALLBACK *LPDXUTCALLBACKFRAMEMOVE)( IDirect3DDevice9* pd3dDevice, double fTime, float fElapsedTime );
|
||||
typedef void (CALLBACK *LPDXUTCALLBACKFRAMERENDER)( IDirect3DDevice9* pd3dDevice, double fTime, float fElapsedTime );
|
||||
typedef void (CALLBACK *LPDXUTCALLBACKKEYBOARD)( UINT nChar, bool bKeyDown, bool bAltDown );
|
||||
typedef void (CALLBACK *LPDXUTCALLBACKMOUSE)( bool bLeftButtonDown, bool bRightButtonDown, bool bMiddleButtonDown, bool bSideButton1Down, bool bSideButton2Down, int nMouseWheelDelta, int xPos, int yPos );
|
||||
typedef LRESULT (CALLBACK *LPDXUTCALLBACKMSGPROC)( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, bool* pbNoFurtherProcessing );
|
||||
typedef void (CALLBACK *LPDXUTCALLBACKTIMER)( UINT idEvent );
|
||||
|
||||
// Device callbacks
|
||||
void DXUTSetCallbackDeviceCreated( LPDXUTCALLBACKDEVICECREATED pCallbackDeviceCreated );
|
||||
void DXUTSetCallbackDeviceReset( LPDXUTCALLBACKDEVICERESET pCallbackDeviceReset );
|
||||
void DXUTSetCallbackDeviceLost( LPDXUTCALLBACKDEVICELOST pCallbackDeviceLost );
|
||||
void DXUTSetCallbackDeviceDestroyed( LPDXUTCALLBACKDEVICEDESTROYED pCallbackDeviceDestroyed );
|
||||
|
||||
// Frame callbacks
|
||||
void DXUTSetCallbackFrameMove( LPDXUTCALLBACKFRAMEMOVE pCallbackFrameMove );
|
||||
void DXUTSetCallbackFrameRender( LPDXUTCALLBACKFRAMERENDER pCallbackFrameRender );
|
||||
|
||||
// Message callbacks
|
||||
void DXUTSetCallbackKeyboard( LPDXUTCALLBACKKEYBOARD pCallbackKeyboard );
|
||||
void DXUTSetCallbackMouse( LPDXUTCALLBACKMOUSE pCallbackMouse, bool bIncludeMouseMove = false );
|
||||
void DXUTSetCallbackMsgProc( LPDXUTCALLBACKMSGPROC pCallbackMsgProc );
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
// Initialization
|
||||
//--------------------------------------------------------------------------------------
|
||||
HRESULT DXUTInit( bool bParseCommandLine = true, bool bHandleDefaultHotkeys = true, bool bShowMsgBoxOnError = true );
|
||||
|
||||
// Choose either DXUTCreateWindow or DXUTSetWindow. If using DXUTSetWindow, consider using DXUTStaticWndProc
|
||||
HRESULT DXUTCreateWindow( const WCHAR* strWindowTitle = L"Direct3D Window",
|
||||
HINSTANCE hInstance = NULL, HICON hIcon = NULL, HMENU hMenu = NULL,
|
||||
int x = CW_USEDEFAULT, int y = CW_USEDEFAULT );
|
||||
HRESULT DXUTSetWindow( HWND hWndFocus, HWND hWndDeviceFullScreen, HWND hWndDeviceWindowed, bool bHandleMessages = true );
|
||||
LRESULT CALLBACK DXUTStaticWndProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam );
|
||||
|
||||
// Choose either DXUTCreateDevice or DXUTSetDevice or DXUTCreateDeviceFromSettings
|
||||
HRESULT DXUTCreateDevice( UINT AdapterOrdinal = D3DADAPTER_DEFAULT, bool bWindowed = true,
|
||||
int nSuggestedWidth = 640, int nSuggestedHeight = 480,
|
||||
LPDXUTCALLBACKISDEVICEACCEPTABLE pCallbackIsDeviceAcceptable = NULL,
|
||||
LPDXUTCALLBACKMODIFYDEVICESETTINGS pCallbackModifyDeviceSettings = NULL );
|
||||
HRESULT DXUTCreateDeviceFromSettings( DXUTDeviceSettings* pDeviceSettings, bool bPreserveInput = false );
|
||||
HRESULT DXUTSetDevice( IDirect3DDevice9* pd3dDevice );
|
||||
|
||||
// Choose either DXUTMainLoop or implement your own main loop
|
||||
HRESULT DXUTMainLoop( HACCEL hAccel = NULL );
|
||||
|
||||
// If not using DXUTMainLoop consider using DXUTRender3DEnvironment
|
||||
void DXUTRender3DEnvironment();
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
// Finding valid device settings
|
||||
//--------------------------------------------------------------------------------------
|
||||
enum DXUT_MATCH_TYPE
|
||||
{
|
||||
DXUTMT_IGNORE_INPUT = 0, // Use the closest valid value to a default
|
||||
DXUTMT_PRESERVE_INPUT, // Use input without change, but may cause no valid device to be found
|
||||
DXUTMT_CLOSEST_TO_INPUT // Use the closest valid value to the input
|
||||
};
|
||||
|
||||
struct DXUTMatchOptions
|
||||
{
|
||||
DXUT_MATCH_TYPE eAdapterOrdinal;
|
||||
DXUT_MATCH_TYPE eDeviceType;
|
||||
DXUT_MATCH_TYPE eWindowed;
|
||||
DXUT_MATCH_TYPE eAdapterFormat;
|
||||
DXUT_MATCH_TYPE eVertexProcessing;
|
||||
DXUT_MATCH_TYPE eResolution;
|
||||
DXUT_MATCH_TYPE eBackBufferFormat;
|
||||
DXUT_MATCH_TYPE eBackBufferCount;
|
||||
DXUT_MATCH_TYPE eMultiSample;
|
||||
DXUT_MATCH_TYPE eSwapEffect;
|
||||
DXUT_MATCH_TYPE eDepthFormat;
|
||||
DXUT_MATCH_TYPE eStencilFormat;
|
||||
DXUT_MATCH_TYPE ePresentFlags;
|
||||
DXUT_MATCH_TYPE eRefreshRate;
|
||||
DXUT_MATCH_TYPE ePresentInterval;
|
||||
};
|
||||
|
||||
HRESULT DXUTFindValidDeviceSettings( DXUTDeviceSettings* pOut, DXUTDeviceSettings* pIn = NULL, DXUTMatchOptions* pMatchOptions = NULL );
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
// Common Tasks
|
||||
//--------------------------------------------------------------------------------------
|
||||
void DXUTSetCursorSettings( bool bShowCursorWhenFullScreen, bool bClipCursorWhenFullScreen );
|
||||
void DXUTSetMultimonSettings( bool bAutoChangeAdapter );
|
||||
void DXUTSetShortcutKeySettings( bool bAllowWhenFullscreen = false, bool bAllowWhenWindowed = true ); // Controls the Windows key, and accessibility shortcut keys
|
||||
void DXUTSetConstantFrameTime( bool bConstantFrameTime, float fTimePerFrame = 0.0333f );
|
||||
void DXUTSetShowSettingsDialog( bool bShow );
|
||||
HRESULT DXUTSetTimer( LPDXUTCALLBACKTIMER pCallbackTimer, float fTimeoutInSecs = 1.0f, UINT* pnIDEvent = NULL );
|
||||
HRESULT DXUTKillTimer( UINT nIDEvent );
|
||||
HRESULT DXUTToggleFullScreen();
|
||||
HRESULT DXUTToggleREF();
|
||||
void DXUTPause( bool bPauseTime, bool bPauseRendering );
|
||||
void DXUTResetFrameworkState();
|
||||
void DXUTShutdown();
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
// State Retrieval
|
||||
//--------------------------------------------------------------------------------------
|
||||
IDirect3D9* DXUTGetD3DObject(); // Does not addref unlike typical Get* APIs
|
||||
IDirect3DDevice9* DXUTGetD3DDevice(); // Does not addref unlike typical Get* APIs
|
||||
DXUTDeviceSettings DXUTGetDeviceSettings();
|
||||
D3DPRESENT_PARAMETERS DXUTGetPresentParameters();
|
||||
const D3DSURFACE_DESC* DXUTGetBackBufferSurfaceDesc();
|
||||
const D3DCAPS9* DXUTGetDeviceCaps();
|
||||
HWND DXUTGetHWND();
|
||||
HWND DXUTGetHWNDFocus();
|
||||
HWND DXUTGetHWNDDeviceFullScreen();
|
||||
HWND DXUTGetHWNDDeviceWindowed();
|
||||
const RECT& DXUTGetWindowClientRect();
|
||||
double DXUTGetTime();
|
||||
float DXUTGetElapsedTime();
|
||||
bool DXUTIsWindowed();
|
||||
float DXUTGetFPS();
|
||||
LPCWSTR DXUTGetWindowTitle();
|
||||
LPCWSTR DXUTGetFrameStats();
|
||||
LPCWSTR DXUTGetDeviceStats();
|
||||
bool DXUTGetShowSettingsDialog();
|
||||
bool DXUTIsRenderingPaused();
|
||||
bool DXUTIsTimePaused();
|
||||
int DXUTGetExitCode();
|
||||
bool DXUTIsKeyDown( BYTE vKey ); // Pass a virtual-key code, ex. VK_F1, 'A', VK_RETURN, VK_LSHIFT, etc
|
||||
bool DXUTIsMouseButtonDown( BYTE vButton ); // Pass a virtual-key code: VK_LBUTTON, VK_RBUTTON, VK_MBUTTON, VK_XBUTTON1, VK_XBUTTON2
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,544 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// File: DXUTEffectMap.cpp
|
||||
//
|
||||
// Desc: Maps the set of standard semantics and annotations to a collection
|
||||
// of ID3DXEffect objects.
|
||||
//
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//-----------------------------------------------------------------------------
|
||||
#include "stdafx.h"
|
||||
#include "dxstdafx.h"
|
||||
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------------------
|
||||
DXUT_SEMANTIC CDXUTEffectMap::StringToSemantic( const char* cstrSemantic )
|
||||
{
|
||||
char strSemantic[MAX_PATH+1] = {0};
|
||||
RemoveTrailingNumber( strSemantic, MAX_PATH, cstrSemantic );
|
||||
|
||||
if( StringEquals( strSemantic, "Diffuse" ) ) return DXUT_Diffuse;
|
||||
if( StringEquals( strSemantic, "Specular" ) ) return DXUT_Specular;
|
||||
if( StringEquals( strSemantic, "Ambient" ) ) return DXUT_Ambient;
|
||||
if( StringEquals( strSemantic, "SpecularPower" ) ) return DXUT_SpecularPower;
|
||||
if( StringEquals( strSemantic, "Emissive" ) ) return DXUT_Emissive;
|
||||
if( StringEquals( strSemantic, "Normal" ) ) return DXUT_Normal;
|
||||
if( StringEquals( strSemantic, "Height" ) ) return DXUT_Height;
|
||||
if( StringEquals( strSemantic, "Refraction" ) ) return DXUT_Refraction;
|
||||
if( StringEquals( strSemantic, "Opacity" ) ) return DXUT_Opacity;
|
||||
if( StringEquals( strSemantic, "Environment" ) ) return DXUT_Environment;
|
||||
if( StringEquals( strSemantic, "EnvironmentNormal" ) ) return DXUT_EnvironmentNormal;
|
||||
if( StringEquals( strSemantic, "Fresnel" ) ) return DXUT_Fresnel;
|
||||
|
||||
if( StringEquals( strSemantic, "World" ) ) return DXUT_World;
|
||||
if( StringEquals( strSemantic, "WorldInverse" ) ) return DXUT_WorldInverse;
|
||||
if( StringEquals( strSemantic, "WorldInverseTranspose" ) ) return DXUT_WorldInverseTranspose;
|
||||
if( StringEquals( strSemantic, "WorldView" ) ) return DXUT_WorldView;
|
||||
if( StringEquals( strSemantic, "WorldViewInverse" ) ) return DXUT_WorldViewInverse;
|
||||
if( StringEquals( strSemantic, "WorldViewInverseTranspose" ) ) return DXUT_WorldViewInverseTranspose;
|
||||
if( StringEquals( strSemantic, "WorldViewProjection" ) ) return DXUT_WorldViewProjection;
|
||||
if( StringEquals( strSemantic, "WorldViewProjectionInverse" ) ) return DXUT_WorldViewProjectionInverse;
|
||||
if( StringEquals( strSemantic, "WorldViewProjectionInverseTranspose" ) ) return DXUT_WorldViewProjectionInverseTranspose;
|
||||
if( StringEquals( strSemantic, "View" ) ) return DXUT_View;
|
||||
if( StringEquals( strSemantic, "ViewInverse" ) ) return DXUT_ViewInverse;
|
||||
if( StringEquals( strSemantic, "ViewInverseTranspose" ) ) return DXUT_ViewInverseTranspose;
|
||||
if( StringEquals( strSemantic, "ViewProjection" ) ) return DXUT_ViewProjection;
|
||||
if( StringEquals( strSemantic, "ViewProjectionInverse" ) ) return DXUT_ViewProjectionInverse;
|
||||
if( StringEquals( strSemantic, "ViewProjectionInverseTranspose" ) ) return DXUT_ViewProjectionInverseTranspose;
|
||||
if( StringEquals( strSemantic, "Projection" ) ) return DXUT_Projection;
|
||||
if( StringEquals( strSemantic, "ProjectionInverse" ) ) return DXUT_ProjectionInverse;
|
||||
if( StringEquals( strSemantic, "ProjectionInverseTranspose" ) ) return DXUT_ProjectionInverseTranspose;
|
||||
|
||||
if( StringEquals( strSemantic, "RenderTargetDimensions" ) ) return DXUT_RenderTargetDimensions;
|
||||
if( StringEquals( strSemantic, "RenderTargetClipping" ) ) return DXUT_RenderTargetClipping;
|
||||
if( StringEquals( strSemantic, "Time" ) ) return DXUT_Time;
|
||||
if( StringEquals( strSemantic, "LastTime" ) ) return DXUT_LastTime;
|
||||
if( StringEquals( strSemantic, "ElapsedTime" ) ) return DXUT_ElapsedTime;
|
||||
if( StringEquals( strSemantic, "Position" ) ) return DXUT_Position;
|
||||
if( StringEquals( strSemantic, "Direction" ) ) return DXUT_Direction;
|
||||
if( StringEquals( strSemantic, "BoundingCenter" ) ) return DXUT_BoundingCenter;
|
||||
if( StringEquals( strSemantic, "BoundingSphereSize" ) ) return DXUT_BoundingSphereSize;
|
||||
if( StringEquals( strSemantic, "BoundingSphereMin" ) ) return DXUT_BoundingSphereMin;
|
||||
if( StringEquals( strSemantic, "BoundingSphereMax" ) ) return DXUT_BoundingSphereMax;
|
||||
if( StringEquals( strSemantic, "BoundingBoxSize" ) ) return DXUT_BoundingBoxSize;
|
||||
if( StringEquals( strSemantic, "BoundingBoxMin" ) ) return DXUT_BoundingBoxMin;
|
||||
if( StringEquals( strSemantic, "BoundingBoxMax" ) ) return DXUT_BoundingBoxMax;
|
||||
if( StringEquals( strSemantic, "Attenuation" ) ) return DXUT_Attenuation;
|
||||
if( StringEquals( strSemantic, "RenderColorTarget" ) ) return DXUT_RenderColorTarget;
|
||||
if( StringEquals( strSemantic, "RenderDepthStencilTarget" ) ) return DXUT_RenderDepthStencilTarget;
|
||||
if( StringEquals( strSemantic, "UnitsScale" ) ) return DXUT_UnitsScale;
|
||||
if( StringEquals( strSemantic, "StandardsGlobal" ) ) return DXUT_StandardsGlobal;
|
||||
|
||||
return DXUT_UNKNOWN_SEMANTIC;
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------------------
|
||||
DXUT_SEMANTIC CDXUTEffectMap::StringToSemantic( const WCHAR* strSemantic )
|
||||
{
|
||||
char cstr[MAX_PATH+1] = {0};
|
||||
WideCharToMultiByte( CP_ACP, 0, strSemantic, -1, cstr, MAX_PATH, NULL, NULL );
|
||||
return StringToSemantic( cstr );
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------------------
|
||||
DXUT_OBJECT CDXUTEffectMap::StringToObject( const char* cstrObject )
|
||||
{
|
||||
char strObject[MAX_PATH+1] = {0};
|
||||
RemoveTrailingNumber( strObject, MAX_PATH, cstrObject );
|
||||
|
||||
if( StringEquals( strObject, "Geometry" ) ) return DXUT_Geometry;
|
||||
if( StringEquals( strObject, "Light" ) ) return DXUT_Light;
|
||||
if( StringEquals( strObject, "Camera" ) ) return DXUT_Camera;
|
||||
if( StringEquals( strObject, "Frame" ) ) return DXUT_Frame;
|
||||
|
||||
return DXUT_UNKNOWN_OBJECT;
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------------------
|
||||
DXUT_OBJECT CDXUTEffectMap::StringToObject( const WCHAR* strObject )
|
||||
{
|
||||
char cstr[MAX_PATH+1] = {0};
|
||||
WideCharToMultiByte( CP_ACP, 0, strObject, -1, cstr, MAX_PATH, NULL, NULL );
|
||||
return StringToObject( cstr );
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------------------
|
||||
VOID CDXUTEffectMap::Reset()
|
||||
{
|
||||
D3DXMatrixIdentity( &m_matWorld );
|
||||
D3DXMatrixIdentity( &m_matView );
|
||||
D3DXMatrixIdentity( &m_matProjection );
|
||||
|
||||
// Reset all the stored parameter lists
|
||||
for( UINT iSemantic = 0; iSemantic < NUM_DXUT_SEMANTICS; iSemantic++ )
|
||||
{
|
||||
for( UINT iObject = 0; iObject < NUM_DXUT_OBJECTS; iObject++ )
|
||||
{
|
||||
for( UINT iIndex = 0; iIndex < MAX_INDEX; iIndex++ )
|
||||
{
|
||||
CGrowableArray<ParamList>* pBinding = &m_Bindings[ iSemantic ][ iObject ][ iIndex ];
|
||||
|
||||
// Clear nested arrays first
|
||||
for( int iParamList = 0; iParamList < pBinding->GetSize(); iParamList++ )
|
||||
{
|
||||
pBinding->GetAt( iParamList ).Reset();
|
||||
}
|
||||
|
||||
// Remove all the bound parameter lists
|
||||
pBinding->RemoveAll();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------------------
|
||||
HRESULT CDXUTEffectMap::SetStandardParameter( const WCHAR* strSemantic,
|
||||
const WCHAR* strObject,
|
||||
DWORD dwObjectIndex,
|
||||
float* pData,
|
||||
DWORD dwDataLen,
|
||||
const WCHAR* strType,
|
||||
const WCHAR* strUnits,
|
||||
const WCHAR* strSpace )
|
||||
{
|
||||
// Map the semantic to the standard set
|
||||
DXUT_SEMANTIC eSemantic = StringToSemantic( strSemantic );
|
||||
if( eSemantic == DXUT_UNKNOWN_SEMANTIC )
|
||||
return E_FAIL;
|
||||
|
||||
// Map the object to the standard set
|
||||
DXUT_OBJECT eObject = StringToObject( strObject );
|
||||
if( eObject == DXUT_UNKNOWN_OBJECT )
|
||||
return E_FAIL;
|
||||
|
||||
return SetStandardParameter( eSemantic, eObject, dwObjectIndex, pData, dwDataLen, strType, strUnits, strSpace );
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------------------
|
||||
HRESULT CDXUTEffectMap::SetStandardParameter( DXUT_SEMANTIC eSemantic,
|
||||
DXUT_OBJECT eObject,
|
||||
DWORD dwObjectIndex,
|
||||
float* pData,
|
||||
DWORD dwDataLen,
|
||||
const WCHAR* strType,
|
||||
const WCHAR* strUnits,
|
||||
const WCHAR* strSpace )
|
||||
{
|
||||
HRESULT hr;
|
||||
|
||||
// TODO: remove index limits
|
||||
if( dwObjectIndex >= MAX_INDEX )
|
||||
return E_INVALIDARG;
|
||||
|
||||
// TODO: handle unit and space conversions
|
||||
|
||||
// Retrieve the interested handles
|
||||
CGrowableArray<ParamList>* pBindings = &m_Bindings[ eSemantic ][ eObject ][ dwObjectIndex ];
|
||||
|
||||
for( int iList=0; iList < pBindings->GetSize(); iList++ )
|
||||
{
|
||||
ParamList& paramList = pBindings->GetAt(iList);
|
||||
|
||||
for( int iParam=0; iParam < paramList.ahParameters.GetSize(); iParam++ )
|
||||
{
|
||||
V_RETURN( paramList.pEffect->SetFloatArray( paramList.ahParameters[iParam], pData, dwDataLen ) );
|
||||
}
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void ParamList::Reset()
|
||||
{
|
||||
SAFE_RELEASE(pEffect);
|
||||
ahParameters.RemoveAll();
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------------------
|
||||
// Investigates all the parameters, looking at semantics and annotations and placing
|
||||
// handles to these parameters within the internal database.
|
||||
//-------------------------------------------------------------------------------------
|
||||
HRESULT CDXUTEffectMap::AddEffect( ID3DXEffect* pEffect )
|
||||
{
|
||||
HRESULT hr;
|
||||
|
||||
if( pEffect == NULL )
|
||||
return E_INVALIDARG;
|
||||
|
||||
// Get the number of parameters
|
||||
D3DXEFFECT_DESC descEffect;
|
||||
V_RETURN( pEffect->GetDesc( &descEffect ) );
|
||||
|
||||
// Enumerate the parameters
|
||||
for( UINT iParam=0; iParam < descEffect.Parameters; iParam++ )
|
||||
{
|
||||
// Retrieve param
|
||||
D3DXHANDLE hParameter = pEffect->GetParameter( NULL, iParam );
|
||||
if( NULL == hParameter )
|
||||
return E_FAIL;
|
||||
|
||||
// Grab description
|
||||
D3DXPARAMETER_DESC desc;
|
||||
V_RETURN( pEffect->GetParameterDesc( hParameter, &desc ) );
|
||||
|
||||
// If this parameter doesn't have a semantic, skip to the next parameter
|
||||
if( desc.Semantic == NULL )
|
||||
continue;
|
||||
|
||||
// Map the semantic to the standard set
|
||||
DXUT_SEMANTIC eSemantic = StringToSemantic( desc.Semantic );
|
||||
if( eSemantic == DXUT_UNKNOWN_SEMANTIC )
|
||||
continue;
|
||||
|
||||
// Get the object annotation
|
||||
const char* cstrObject = "Geometry";
|
||||
D3DXHANDLE hAnnotation = pEffect->GetAnnotationByName( hParameter, "Object" );
|
||||
if( hAnnotation )
|
||||
{
|
||||
V_RETURN( pEffect->GetString( hAnnotation, &cstrObject ) );
|
||||
}
|
||||
|
||||
// Map the object to the standard set
|
||||
DXUT_OBJECT eObject = StringToObject( cstrObject );
|
||||
if( eObject == DXUT_UNKNOWN_OBJECT )
|
||||
continue;
|
||||
|
||||
// Extract the index from the semantic
|
||||
int index = 0;
|
||||
const char* strIndex = desc.Semantic + strlen(desc.Semantic)-1;
|
||||
|
||||
// If there is a digit at the end of the semantic, locate the beginning of the index
|
||||
// and convert to an integer
|
||||
if( isdigit( (BYTE) (*strIndex) ) )
|
||||
{
|
||||
while( isdigit( (BYTE) (*(strIndex-1)) ) )
|
||||
{
|
||||
--strIndex;
|
||||
}
|
||||
|
||||
index = atoi( strIndex );
|
||||
}
|
||||
|
||||
// Check whether index is out of bounds
|
||||
if( index < 0 || index >= MAX_INDEX )
|
||||
continue;
|
||||
|
||||
// Store the handle
|
||||
CGrowableArray<ParamList>* pBindings = &m_Bindings[ eSemantic ][ eObject ][ index ];
|
||||
|
||||
bool bBound = false;
|
||||
for( int i=0; i < pBindings->GetSize(); i++ )
|
||||
{
|
||||
if( pBindings->GetAt(i).pEffect == pEffect )
|
||||
{
|
||||
// Found the containing effect for this parameter in the list, add the new handle
|
||||
pBindings->GetAt(i).ahParameters.Add( hParameter );
|
||||
bBound = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if( !bBound )
|
||||
{
|
||||
// This parameter belongs to a new effect
|
||||
ParamList newParamList;
|
||||
newParamList.pEffect = pEffect;
|
||||
pEffect->AddRef();
|
||||
newParamList.ahParameters.Add( hParameter );
|
||||
pBindings->Add( newParamList );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------------------
|
||||
// Removes all instances of this effect from the binding list
|
||||
//-------------------------------------------------------------------------------------
|
||||
HRESULT CDXUTEffectMap::RemoveEffect( ID3DXEffect* pEffect )
|
||||
{
|
||||
if( pEffect == NULL )
|
||||
return E_INVALIDARG;
|
||||
|
||||
// Search through the list of registered semantics and remove all items
|
||||
// assigned to the given effect
|
||||
for( UINT iSemantic = 0; iSemantic < NUM_DXUT_SEMANTICS; iSemantic++ )
|
||||
{
|
||||
for( UINT iObject = 0; iObject < NUM_DXUT_OBJECTS; iObject++ )
|
||||
{
|
||||
for( UINT iIndex = 0; iIndex < MAX_INDEX; iIndex++ )
|
||||
{
|
||||
CGrowableArray<ParamList>* pBinding = &m_Bindings[ iSemantic ][ iObject ][ iIndex ];
|
||||
|
||||
// Clear nested arrays first
|
||||
for( int iParamList = 0; iParamList < pBinding->GetSize(); iParamList++ )
|
||||
{
|
||||
ParamList& rParamList = pBinding->GetAt( iParamList );
|
||||
|
||||
if( rParamList.pEffect == pEffect )
|
||||
rParamList.Reset();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------------------
|
||||
HRESULT CDXUTEffectMap::SetWorldMatrix( D3DXMATRIXA16* pWorldMatrix, const WCHAR* strUnits )
|
||||
{
|
||||
m_matWorld = *pWorldMatrix;
|
||||
return UpdateTransforms( DXUT_World );
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------------------
|
||||
HRESULT CDXUTEffectMap::SetViewMatrix( D3DXMATRIXA16* pViewMatrix, const WCHAR* strUnits )
|
||||
{
|
||||
m_matView = *pViewMatrix;
|
||||
return UpdateTransforms( DXUT_View );
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------------------
|
||||
HRESULT CDXUTEffectMap::SetProjectionMatrix( D3DXMATRIXA16* pProjectionMatrix )
|
||||
{
|
||||
m_matProjection = *pProjectionMatrix;
|
||||
return UpdateTransforms( DXUT_Projection );
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------------------
|
||||
HRESULT CDXUTEffectMap::UpdateTransforms( DXUT_SEMANTIC eSemantic, const WCHAR* strUnits )
|
||||
{
|
||||
HRESULT hr;
|
||||
|
||||
// Determine which transforms are required by the effect
|
||||
bool bEffectContains[ NUM_DXUT_SEMANTICS ] = {0};
|
||||
for( int iTransform = DXUT_World; iTransform <= DXUT_ProjectionInverseTranspose; iTransform++ )
|
||||
{
|
||||
bEffectContains[iTransform] = ( m_Bindings[ iTransform ][ DXUT_Geometry ][ 0 ].GetSize() > 0 );
|
||||
}
|
||||
|
||||
if( eSemantic == DXUT_World )
|
||||
{
|
||||
// World matrix permutations
|
||||
if( bEffectContains[ DXUT_World ] ||
|
||||
bEffectContains[ DXUT_WorldInverse ] ||
|
||||
bEffectContains[ DXUT_WorldInverseTranspose ] )
|
||||
{
|
||||
V_RETURN( SetStandardParameter( DXUT_World, DXUT_Geometry, 0, (float*)&m_matWorld, 16, L"", strUnits, L"World" ) );
|
||||
|
||||
if( bEffectContains[ DXUT_WorldInverse ] ||
|
||||
bEffectContains[ DXUT_WorldInverseTranspose ] )
|
||||
{
|
||||
D3DXMATRIXA16 matWorldInverse;
|
||||
D3DXMatrixInverse( &matWorldInverse, NULL, &m_matWorld );
|
||||
V_RETURN( SetStandardParameter( DXUT_WorldInverse, DXUT_Geometry, 0, (float*)&matWorldInverse, 16, L"", strUnits, L"World" ) );
|
||||
|
||||
if( bEffectContains[ DXUT_WorldInverseTranspose ] )
|
||||
{
|
||||
D3DXMATRIXA16 matWorldInverseTranspose;
|
||||
D3DXMatrixTranspose( &matWorldInverseTranspose, &matWorldInverse );
|
||||
V_RETURN( SetStandardParameter( DXUT_WorldInverseTranspose, DXUT_Geometry, 0, (float*)&matWorldInverseTranspose, 16, L"", strUnits, L"World" ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if( eSemantic == DXUT_World ||
|
||||
eSemantic == DXUT_View )
|
||||
{
|
||||
// WorldView matrix permutations
|
||||
if( bEffectContains[ DXUT_WorldView ] ||
|
||||
bEffectContains[ DXUT_WorldViewInverse ] ||
|
||||
bEffectContains[ DXUT_WorldViewInverseTranspose ] )
|
||||
{
|
||||
D3DXMATRIXA16 matWorldView;
|
||||
D3DXMatrixMultiply( &matWorldView, &m_matWorld, &m_matView );
|
||||
V_RETURN( SetStandardParameter( DXUT_WorldView, DXUT_Geometry, 0, (float*)&matWorldView, 16, L"", strUnits, L"World" ) );
|
||||
|
||||
if( bEffectContains[ DXUT_WorldViewInverse ] ||
|
||||
bEffectContains[ DXUT_WorldViewInverseTranspose ] )
|
||||
{
|
||||
D3DXMATRIXA16 matWorldViewInverse;
|
||||
D3DXMatrixInverse( &matWorldViewInverse, NULL, &matWorldView );
|
||||
V_RETURN( SetStandardParameter( DXUT_WorldViewInverse, DXUT_Geometry, 0, (float*)&matWorldViewInverse, 16, L"", strUnits, L"World" ) );
|
||||
|
||||
if( bEffectContains[ DXUT_WorldViewInverseTranspose ] )
|
||||
{
|
||||
D3DXMATRIXA16 matWorldViewInverseTranspose;
|
||||
D3DXMatrixTranspose( &matWorldViewInverseTranspose, &matWorldViewInverse );
|
||||
V_RETURN( SetStandardParameter( DXUT_WorldViewInverseTranspose, DXUT_Geometry, 0, (float*)&matWorldViewInverseTranspose, 16, L"", strUnits, L"World" ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if( eSemantic == DXUT_World ||
|
||||
eSemantic == DXUT_View ||
|
||||
eSemantic == DXUT_Projection )
|
||||
{
|
||||
// WorldViewProjection matrix permutations
|
||||
if( bEffectContains[ DXUT_WorldViewProjection ] ||
|
||||
bEffectContains[ DXUT_WorldViewProjectionInverse ] ||
|
||||
bEffectContains[ DXUT_WorldViewProjectionInverseTranspose ] )
|
||||
{
|
||||
D3DXMATRIXA16 matWorldViewProjection;
|
||||
D3DXMatrixMultiply( &matWorldViewProjection, &m_matWorld, &m_matView );
|
||||
D3DXMatrixMultiply( &matWorldViewProjection, &matWorldViewProjection, &m_matProjection );
|
||||
|
||||
V_RETURN( SetStandardParameter( DXUT_WorldViewProjection, DXUT_Geometry, 0, (float*)&matWorldViewProjection, 16, L"", strUnits, L"World" ) );
|
||||
|
||||
if( bEffectContains[ DXUT_WorldViewProjectionInverse ] ||
|
||||
bEffectContains[ DXUT_WorldViewProjectionInverseTranspose ] )
|
||||
{
|
||||
D3DXMATRIXA16 matWorldViewProjectionInverse;
|
||||
D3DXMatrixInverse( &matWorldViewProjectionInverse, NULL, &matWorldViewProjection );
|
||||
V_RETURN( SetStandardParameter( DXUT_WorldViewProjectionInverse, DXUT_Geometry, 0, (float*)&matWorldViewProjectionInverse, 16, L"", strUnits, L"World" ) );
|
||||
|
||||
if( bEffectContains[ DXUT_WorldViewProjectionInverseTranspose ] )
|
||||
{
|
||||
D3DXMATRIXA16 matWorldViewProjectionInverseTranspose;
|
||||
D3DXMatrixTranspose( &matWorldViewProjectionInverseTranspose, &matWorldViewProjectionInverse );
|
||||
V_RETURN( SetStandardParameter( DXUT_WorldViewProjectionInverseTranspose, DXUT_Geometry, 0, (float*)&matWorldViewProjectionInverseTranspose, 16, L"", strUnits, L"World" ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if( eSemantic == DXUT_View )
|
||||
{
|
||||
// View matrix permutations
|
||||
if( bEffectContains[ DXUT_View ] ||
|
||||
bEffectContains[ DXUT_ViewInverse ] ||
|
||||
bEffectContains[ DXUT_ViewInverseTranspose ] )
|
||||
{
|
||||
V_RETURN( SetStandardParameter( DXUT_View, DXUT_Geometry, 0, (float*)&m_matView, 16, L"", strUnits, L"World" ) );
|
||||
|
||||
if( bEffectContains[ DXUT_ViewInverse ] ||
|
||||
bEffectContains[ DXUT_ViewInverseTranspose ] )
|
||||
{
|
||||
D3DXMATRIXA16 matViewInverse;
|
||||
D3DXMatrixInverse( &matViewInverse, NULL, &m_matView );
|
||||
V_RETURN( SetStandardParameter( DXUT_ViewInverse, DXUT_Geometry, 0, (float*)&matViewInverse, 16, L"", strUnits, L"World" ) );
|
||||
|
||||
if( bEffectContains[ DXUT_ViewInverseTranspose ] )
|
||||
{
|
||||
D3DXMATRIXA16 matViewInverseTranspose;
|
||||
D3DXMatrixTranspose( &matViewInverseTranspose, &matViewInverse );
|
||||
V_RETURN( SetStandardParameter( DXUT_ViewInverseTranspose, DXUT_Geometry, 0, (float*)&matViewInverseTranspose, 16, L"", strUnits, L"World" ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if( eSemantic == DXUT_View ||
|
||||
eSemantic == DXUT_Projection )
|
||||
{
|
||||
// ViewProjection matrix permutations
|
||||
if( bEffectContains[ DXUT_ViewProjection ] ||
|
||||
bEffectContains[ DXUT_ViewProjectionInverse ] ||
|
||||
bEffectContains[ DXUT_ViewProjectionInverseTranspose ] )
|
||||
{
|
||||
D3DXMATRIXA16 matViewProjection;
|
||||
D3DXMatrixMultiply( &matViewProjection, &m_matView, &m_matProjection );
|
||||
V_RETURN( SetStandardParameter( DXUT_ViewProjection, DXUT_Geometry, 0, (float*)&matViewProjection, 16, L"", strUnits, L"World" ) );
|
||||
|
||||
if( bEffectContains[ DXUT_ViewProjectionInverse ] ||
|
||||
bEffectContains[ DXUT_ViewProjectionInverseTranspose ] )
|
||||
{
|
||||
D3DXMATRIXA16 matViewProjectionInverse;
|
||||
D3DXMatrixInverse( &matViewProjectionInverse, NULL, &matViewProjection );
|
||||
V_RETURN( SetStandardParameter( DXUT_ViewProjectionInverse, DXUT_Geometry, 0, (float*)&matViewProjectionInverse, 16, L"", strUnits, L"World" ) );
|
||||
|
||||
if( bEffectContains[ DXUT_ViewProjectionInverseTranspose ] )
|
||||
{
|
||||
D3DXMATRIXA16 matViewProjectionInverseTranspose;
|
||||
D3DXMatrixTranspose( &matViewProjectionInverseTranspose, &matViewProjectionInverse );
|
||||
V_RETURN( SetStandardParameter( DXUT_ViewProjectionInverseTranspose, DXUT_Geometry, 0, (float*)&matViewProjectionInverseTranspose, 16, L"", strUnits, L"World" ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if( eSemantic == DXUT_Projection )
|
||||
{
|
||||
// Projection matrix permutations
|
||||
if( bEffectContains[ DXUT_Projection ] ||
|
||||
bEffectContains[ DXUT_ProjectionInverse ] ||
|
||||
bEffectContains[ DXUT_ProjectionInverseTranspose ] )
|
||||
{
|
||||
V_RETURN( SetStandardParameter( DXUT_Projection, DXUT_Geometry, 0, (float*)&m_matProjection, 16, L"", strUnits, L"World" ) );
|
||||
|
||||
if( bEffectContains[ DXUT_ProjectionInverse ] ||
|
||||
bEffectContains[ DXUT_ProjectionInverseTranspose ] )
|
||||
{
|
||||
D3DXMATRIXA16 matProjectionInverse;
|
||||
D3DXMatrixInverse( &matProjectionInverse, NULL, &m_matProjection );
|
||||
V_RETURN( SetStandardParameter( DXUT_ProjectionInverse, DXUT_Geometry, 0, (float*)&matProjectionInverse, 16, L"", strUnits, L"World" ) );
|
||||
|
||||
if( bEffectContains[ DXUT_ProjectionInverseTranspose ] )
|
||||
{
|
||||
D3DXMATRIXA16 matProjectionInverseTranspose;
|
||||
D3DXMatrixTranspose( &matProjectionInverseTranspose, &matProjectionInverse );
|
||||
V_RETURN( SetStandardParameter( DXUT_ProjectionInverseTranspose, DXUT_Geometry, 0, (float*)&matProjectionInverseTranspose, 16, L"", strUnits, L"World" ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,164 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// File: DXUTEffectMap.h
|
||||
//
|
||||
// Desc: Maps the set of standard semantics and annotations to a collection
|
||||
// of ID3DXEffect objects.
|
||||
//
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//-----------------------------------------------------------------------------
|
||||
#pragma once
|
||||
#ifndef DXUT_EFFECTMAP_H
|
||||
#define DXUT_EFFECTMAP_H
|
||||
|
||||
const int MAX_INDEX = 5;
|
||||
|
||||
enum DXUT_SEMANTIC
|
||||
{
|
||||
DXUT_UNKNOWN_SEMANTIC,
|
||||
|
||||
DXUT_Diffuse,
|
||||
DXUT_Specular,
|
||||
DXUT_Ambient,
|
||||
DXUT_SpecularPower,
|
||||
DXUT_Emissive,
|
||||
DXUT_Normal,
|
||||
DXUT_Height,
|
||||
DXUT_Refraction,
|
||||
DXUT_Opacity,
|
||||
DXUT_Environment,
|
||||
DXUT_EnvironmentNormal,
|
||||
DXUT_Fresnel,
|
||||
|
||||
DXUT_World,
|
||||
DXUT_WorldInverse,
|
||||
DXUT_WorldInverseTranspose,
|
||||
DXUT_WorldView,
|
||||
DXUT_WorldViewInverse,
|
||||
DXUT_WorldViewInverseTranspose,
|
||||
DXUT_WorldViewProjection,
|
||||
DXUT_WorldViewProjectionInverse,
|
||||
DXUT_WorldViewProjectionInverseTranspose,
|
||||
DXUT_View,
|
||||
DXUT_ViewInverse,
|
||||
DXUT_ViewInverseTranspose,
|
||||
DXUT_ViewProjection,
|
||||
DXUT_ViewProjectionInverse,
|
||||
DXUT_ViewProjectionInverseTranspose,
|
||||
DXUT_Projection,
|
||||
DXUT_ProjectionInverse,
|
||||
DXUT_ProjectionInverseTranspose,
|
||||
|
||||
DXUT_RenderTargetDimensions,
|
||||
DXUT_RenderTargetClipping,
|
||||
DXUT_Time,
|
||||
DXUT_LastTime,
|
||||
DXUT_ElapsedTime,
|
||||
DXUT_Position,
|
||||
DXUT_Direction,
|
||||
DXUT_BoundingCenter,
|
||||
DXUT_BoundingSphereSize,
|
||||
DXUT_BoundingSphereMin,
|
||||
DXUT_BoundingSphereMax,
|
||||
DXUT_BoundingBoxSize,
|
||||
DXUT_BoundingBoxMin,
|
||||
DXUT_BoundingBoxMax,
|
||||
DXUT_Attenuation,
|
||||
DXUT_RenderColorTarget,
|
||||
DXUT_RenderDepthStencilTarget,
|
||||
DXUT_UnitsScale,
|
||||
DXUT_StandardsGlobal,
|
||||
|
||||
NUM_DXUT_SEMANTICS
|
||||
};
|
||||
|
||||
enum DXUT_OBJECT
|
||||
{
|
||||
DXUT_UNKNOWN_OBJECT,
|
||||
|
||||
DXUT_Geometry,
|
||||
DXUT_Light,
|
||||
DXUT_Camera,
|
||||
DXUT_Frame,
|
||||
|
||||
NUM_DXUT_OBJECTS
|
||||
};
|
||||
|
||||
|
||||
struct ParamList
|
||||
{
|
||||
ID3DXEffect* pEffect;
|
||||
CGrowableArray< D3DXHANDLE > ahParameters;
|
||||
|
||||
void Reset();
|
||||
};
|
||||
|
||||
|
||||
class CDXUTEffectMap
|
||||
{
|
||||
public:
|
||||
CDXUTEffectMap() { Reset(); }
|
||||
~CDXUTEffectMap() { Reset(); }
|
||||
|
||||
VOID Reset();
|
||||
|
||||
HRESULT AddEffect( ID3DXEffect* pEffect );
|
||||
HRESULT RemoveEffect( ID3DXEffect* pEffect );
|
||||
|
||||
HRESULT SetStandardParameter( const WCHAR* strSemantic, const WCHAR* strObject, DWORD dwObjectIndex, float* pData, DWORD dwDataLen, const WCHAR* strType = NULL, const WCHAR* strUnits = NULL, const WCHAR* strSpace = NULL );
|
||||
HRESULT SetStandardParameter( DXUT_SEMANTIC eSemantic, DXUT_OBJECT eObject, DWORD dwObjectIndex, float* pData, DWORD dwDataLen, const WCHAR* strType = NULL, const WCHAR* strUnits = NULL, const WCHAR* strSpace = NULL );
|
||||
|
||||
HRESULT SetWorldMatrix( D3DXMATRIXA16* pWorldMatrix, const WCHAR* strUnits = NULL );
|
||||
HRESULT SetViewMatrix( D3DXMATRIXA16* pViewMatrix, const WCHAR* strUnits = NULL );
|
||||
HRESULT SetProjectionMatrix( D3DXMATRIXA16* pProjectionMatrix );
|
||||
|
||||
static DXUT_SEMANTIC StringToSemantic( const char* cstrSemantic );
|
||||
static DXUT_SEMANTIC StringToSemantic( const WCHAR* strSemantic );
|
||||
static DXUT_OBJECT StringToObject( const char* cstrObject );
|
||||
static DXUT_OBJECT StringToObject( const WCHAR* strObject );
|
||||
|
||||
private:
|
||||
HRESULT UpdateTransforms( DXUT_SEMANTIC eSemantic, const WCHAR* strUnits = L"m" );
|
||||
|
||||
D3DXMATRIXA16 m_matWorld;
|
||||
D3DXMATRIXA16 m_matView;
|
||||
D3DXMATRIXA16 m_matProjection;
|
||||
|
||||
// Database of DXUTEffect object parameter handles which are indexed accoring to
|
||||
// Semantic, Object annotation, index, and containing mesh pointer
|
||||
CGrowableArray<ParamList> m_Bindings[ NUM_DXUT_SEMANTICS ][ NUM_DXUT_OBJECTS ][ MAX_INDEX ];
|
||||
};
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------------------
|
||||
inline bool StringBegins( const char* strTest, const char* strStartsWith )
|
||||
{
|
||||
return ( 0 == _strnicmp( strTest, strStartsWith, strlen(strStartsWith) ) );
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------------------
|
||||
inline bool StringEquals( const char* strTest, const char* strEquals )
|
||||
{
|
||||
return( 0 == _stricmp( strTest, strEquals ) );
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------------------
|
||||
inline void RemoveTrailingNumber( char* strWithoutNumber, DWORD dwBufLen, const char* str )
|
||||
{
|
||||
StringCchCopyA( strWithoutNumber, dwBufLen, str );
|
||||
|
||||
char* strIndex = strWithoutNumber + strlen(strWithoutNumber);
|
||||
|
||||
// If there is a digit at the end of the semantic discard it
|
||||
while( isdigit( (BYTE) (*(strIndex-1)) ) )
|
||||
{
|
||||
--strIndex;
|
||||
}
|
||||
|
||||
*strIndex = 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endif //DXUT_EFFECTMAP_H
|
||||
@@ -0,0 +1,138 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// File: DXUTMesh.h
|
||||
//
|
||||
// Desc: Support code for loading DirectX .X files.
|
||||
//
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//-----------------------------------------------------------------------------
|
||||
#pragma once
|
||||
#ifndef DXUTMESH_H
|
||||
#define DXUTMESH_H
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Name: class CDXUTMesh
|
||||
// Desc: Class for loading and rendering file-based meshes
|
||||
//-----------------------------------------------------------------------------
|
||||
class CDXUTMesh
|
||||
{
|
||||
public:
|
||||
WCHAR m_strName[512];
|
||||
|
||||
LPD3DXMESH m_pSysMemMesh; // SysMem mesh, lives through resize
|
||||
LPD3DXMESH m_pLocalMesh; // Local mesh, rebuilt on resize
|
||||
|
||||
DWORD m_dwNumMaterials; // Materials for the mesh
|
||||
D3DMATERIAL9* m_pMaterials;
|
||||
IDirect3DBaseTexture9** m_pTextures;
|
||||
bool m_bUseMaterials;
|
||||
|
||||
public:
|
||||
// Rendering
|
||||
HRESULT Render( LPDIRECT3DDEVICE9 pd3dDevice,
|
||||
bool bDrawOpaqueSubsets = true,
|
||||
bool bDrawAlphaSubsets = true );
|
||||
HRESULT Render( ID3DXEffect *pEffect,
|
||||
D3DXHANDLE hTexture = NULL,
|
||||
D3DXHANDLE hDiffuse = NULL,
|
||||
D3DXHANDLE hAmbient = NULL,
|
||||
D3DXHANDLE hSpecular = NULL,
|
||||
D3DXHANDLE hEmissive = NULL,
|
||||
D3DXHANDLE hPower = NULL,
|
||||
bool bDrawOpaqueSubsets = true,
|
||||
bool bDrawAlphaSubsets = true );
|
||||
|
||||
// Mesh access
|
||||
LPD3DXMESH GetSysMemMesh() { return m_pSysMemMesh; }
|
||||
LPD3DXMESH GetLocalMesh() { return m_pLocalMesh; }
|
||||
|
||||
// Rendering options
|
||||
void UseMeshMaterials( bool bFlag ) { m_bUseMaterials = bFlag; }
|
||||
HRESULT SetFVF( LPDIRECT3DDEVICE9 pd3dDevice, DWORD dwFVF );
|
||||
HRESULT SetVertexDecl( LPDIRECT3DDEVICE9 pd3dDevice, const D3DVERTEXELEMENT9 *pDecl );
|
||||
|
||||
// Initializing
|
||||
HRESULT RestoreDeviceObjects( LPDIRECT3DDEVICE9 pd3dDevice );
|
||||
HRESULT InvalidateDeviceObjects();
|
||||
|
||||
// Creation/destruction
|
||||
HRESULT Create( LPDIRECT3DDEVICE9 pd3dDevice, LPCWSTR strFilename );
|
||||
HRESULT Create( LPDIRECT3DDEVICE9 pd3dDevice, LPD3DXFILEDATA pFileData );
|
||||
HRESULT CreateMaterials( LPCWSTR strPath, IDirect3DDevice9 *pd3dDevice, ID3DXBuffer *pAdjacencyBuffer, ID3DXBuffer *pMtrlBuffer );
|
||||
HRESULT Destroy();
|
||||
|
||||
CDXUTMesh( LPCWSTR strName = L"CDXUTMeshFile_Mesh" );
|
||||
virtual ~CDXUTMesh();
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Name: class CDXUTMeshFrame
|
||||
// Desc: Class for loading and rendering file-based meshes
|
||||
//-----------------------------------------------------------------------------
|
||||
class CDXUTMeshFrame
|
||||
{
|
||||
public:
|
||||
WCHAR m_strName[512];
|
||||
D3DXMATRIX m_mat;
|
||||
CDXUTMesh* m_pMesh;
|
||||
|
||||
CDXUTMeshFrame* m_pNext;
|
||||
CDXUTMeshFrame* m_pChild;
|
||||
|
||||
public:
|
||||
// Matrix access
|
||||
void SetMatrix( D3DXMATRIX* pmat ) { m_mat = *pmat; }
|
||||
D3DXMATRIX* GetMatrix() { return &m_mat; }
|
||||
|
||||
CDXUTMesh* FindMesh( LPCWSTR strMeshName );
|
||||
CDXUTMeshFrame* FindFrame( LPCWSTR strFrameName );
|
||||
bool EnumMeshes( bool (*EnumMeshCB)(CDXUTMesh*,void*),
|
||||
void* pContext );
|
||||
|
||||
HRESULT Destroy();
|
||||
HRESULT RestoreDeviceObjects( LPDIRECT3DDEVICE9 pd3dDevice );
|
||||
HRESULT InvalidateDeviceObjects();
|
||||
HRESULT Render( LPDIRECT3DDEVICE9 pd3dDevice,
|
||||
bool bDrawOpaqueSubsets = true,
|
||||
bool bDrawAlphaSubsets = true,
|
||||
D3DXMATRIX* pmatWorldMatrix = NULL);
|
||||
|
||||
CDXUTMeshFrame( LPCWSTR strName = L"CDXUTMeshFile_Frame" );
|
||||
virtual ~CDXUTMeshFrame();
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Name: class CDXUTMeshFile
|
||||
// Desc: Class for loading and rendering file-based meshes
|
||||
//-----------------------------------------------------------------------------
|
||||
class CDXUTMeshFile : public CDXUTMeshFrame
|
||||
{
|
||||
HRESULT LoadMesh( LPDIRECT3DDEVICE9 pd3dDevice, LPD3DXFILEDATA pFileData,
|
||||
CDXUTMeshFrame* pParentFrame );
|
||||
HRESULT LoadFrame( LPDIRECT3DDEVICE9 pd3dDevice, LPD3DXFILEDATA pFileData,
|
||||
CDXUTMeshFrame* pParentFrame );
|
||||
public:
|
||||
HRESULT Create( LPDIRECT3DDEVICE9 pd3dDevice, LPCWSTR strFilename );
|
||||
HRESULT CreateFromResource( LPDIRECT3DDEVICE9 pd3dDevice, LPCWSTR strResource, LPCWSTR strType );
|
||||
// For pure devices, specify the world transform. If the world transform is not
|
||||
// specified on pure devices, this function will fail.
|
||||
HRESULT Render( LPDIRECT3DDEVICE9 pd3dDevice, D3DXMATRIX* pmatWorldMatrix = NULL );
|
||||
|
||||
CDXUTMeshFile() : CDXUTMeshFrame( L"CDXUTMeshFile_Root" ) {}
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,870 @@
|
||||
//--------------------------------------------------------------------------------------
|
||||
// File: DXUTEnum.cpp
|
||||
//
|
||||
// Enumerates D3D adapters, devices, modes, etc.
|
||||
//
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//--------------------------------------------------------------------------------------
|
||||
#include "stdafx.h"
|
||||
#include "dxstdafx.h"
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
// Forward declarations
|
||||
//--------------------------------------------------------------------------------------
|
||||
static int __cdecl SortModesCallback( const void* arg1, const void* arg2 );
|
||||
UINT DXUTStencilBits( D3DFORMAT fmt );
|
||||
UINT DXUTDepthBits( D3DFORMAT fmt );
|
||||
UINT DXUTAlphaChannelBits( D3DFORMAT fmt );
|
||||
UINT DXUTColorChannelBits( D3DFORMAT fmt );
|
||||
CD3DEnumeration* DXUTGetEnumeration()
|
||||
{
|
||||
// Using an accessor function gives control of the construction order
|
||||
static CD3DEnumeration d3denum;
|
||||
return &d3denum;
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
CD3DEnumeration::CD3DEnumeration()
|
||||
{
|
||||
m_pD3D = NULL;
|
||||
m_IsDeviceAcceptableFunc = NULL;
|
||||
m_bRequirePostPixelShaderBlending = true;
|
||||
|
||||
m_nMinWidth = 0;
|
||||
m_nMinHeight = 0;
|
||||
m_nMaxWidth = UINT_MAX;
|
||||
m_nMaxHeight = UINT_MAX;
|
||||
|
||||
m_nRefreshMin = 0;
|
||||
m_nRefreshMax = UINT_MAX;
|
||||
|
||||
m_nMultisampleQualityMax = 0xFFFF;
|
||||
|
||||
ResetPossibleDepthStencilFormats();
|
||||
ResetPossibleMultisampleTypeList();
|
||||
ResetPossiblePresentIntervalList();
|
||||
SetPossibleVertexProcessingList( true, true, true, false );
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
CD3DEnumeration::~CD3DEnumeration()
|
||||
{
|
||||
ClearAdapterInfoList();
|
||||
}
|
||||
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
// Enumerates available D3D adapters, devices, modes, etc.
|
||||
//--------------------------------------------------------------------------------------
|
||||
HRESULT CD3DEnumeration::Enumerate( IDirect3D9* pD3D,
|
||||
LPDXUTCALLBACKISDEVICEACCEPTABLE IsDeviceAcceptableFunc )
|
||||
{
|
||||
if( pD3D == NULL )
|
||||
{
|
||||
pD3D = DXUTGetD3DObject();
|
||||
if( pD3D == NULL )
|
||||
return DXUTERR_NODIRECT3D;
|
||||
}
|
||||
|
||||
m_pD3D = pD3D;
|
||||
m_IsDeviceAcceptableFunc = IsDeviceAcceptableFunc;
|
||||
|
||||
HRESULT hr;
|
||||
ClearAdapterInfoList();
|
||||
CGrowableArray<D3DFORMAT> adapterFormatList;
|
||||
|
||||
const D3DFORMAT allowedAdapterFormatArray[] =
|
||||
{
|
||||
D3DFMT_X8R8G8B8,
|
||||
D3DFMT_X1R5G5B5,
|
||||
D3DFMT_R5G6B5,
|
||||
D3DFMT_A2R10G10B10
|
||||
};
|
||||
const UINT allowedAdapterFormatArrayCount = sizeof(allowedAdapterFormatArray) / sizeof(allowedAdapterFormatArray[0]);
|
||||
|
||||
UINT numAdapters = pD3D->GetAdapterCount();
|
||||
for (UINT adapterOrdinal = 0; adapterOrdinal < numAdapters; adapterOrdinal++)
|
||||
{
|
||||
CD3DEnumAdapterInfo* pAdapterInfo = new CD3DEnumAdapterInfo;
|
||||
if( pAdapterInfo == NULL )
|
||||
return E_OUTOFMEMORY;
|
||||
|
||||
pAdapterInfo->AdapterOrdinal = adapterOrdinal;
|
||||
pD3D->GetAdapterIdentifier(adapterOrdinal, 0, &pAdapterInfo->AdapterIdentifier);
|
||||
|
||||
// Get list of all display modes on this adapter.
|
||||
// Also build a temporary list of all display adapter formats.
|
||||
adapterFormatList.RemoveAll();
|
||||
|
||||
for( UINT iFormatList = 0; iFormatList < allowedAdapterFormatArrayCount; iFormatList++ )
|
||||
{
|
||||
D3DFORMAT allowedAdapterFormat = allowedAdapterFormatArray[iFormatList];
|
||||
UINT numAdapterModes = pD3D->GetAdapterModeCount( adapterOrdinal, allowedAdapterFormat );
|
||||
for (UINT mode = 0; mode < numAdapterModes; mode++)
|
||||
{
|
||||
D3DDISPLAYMODE displayMode;
|
||||
pD3D->EnumAdapterModes( adapterOrdinal, allowedAdapterFormat, mode, &displayMode );
|
||||
|
||||
if( displayMode.Width < m_nMinWidth ||
|
||||
displayMode.Height < m_nMinHeight ||
|
||||
displayMode.Width > m_nMaxWidth ||
|
||||
displayMode.Height > m_nMaxHeight ||
|
||||
displayMode.RefreshRate < m_nRefreshMin ||
|
||||
displayMode.RefreshRate > m_nRefreshMax )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
pAdapterInfo->displayModeList.Add( displayMode );
|
||||
|
||||
if( !adapterFormatList.Contains(displayMode.Format) )
|
||||
adapterFormatList.Add( displayMode.Format );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
D3DDISPLAYMODE displayMode;
|
||||
pD3D->GetAdapterDisplayMode( adapterOrdinal, &displayMode );
|
||||
if( !adapterFormatList.Contains(displayMode.Format) )
|
||||
adapterFormatList.Add( displayMode.Format );
|
||||
|
||||
// Sort displaymode list
|
||||
qsort( pAdapterInfo->displayModeList.GetData(),
|
||||
pAdapterInfo->displayModeList.GetSize(), sizeof( D3DDISPLAYMODE ),
|
||||
SortModesCallback );
|
||||
|
||||
// Get info for each device on this adapter
|
||||
if( FAILED( EnumerateDevices( pAdapterInfo, &adapterFormatList ) ) )
|
||||
{
|
||||
delete pAdapterInfo;
|
||||
continue;
|
||||
}
|
||||
|
||||
// If at least one device on this adapter is available and compatible
|
||||
// with the app, add the adapterInfo to the list
|
||||
if( pAdapterInfo->deviceInfoList.GetSize() > 0 )
|
||||
{
|
||||
hr = m_AdapterInfoList.Add( pAdapterInfo );
|
||||
if( FAILED(hr) )
|
||||
return hr;
|
||||
} else
|
||||
delete pAdapterInfo;
|
||||
}
|
||||
|
||||
bool bUniqueDesc = true;
|
||||
CD3DEnumAdapterInfo* pAdapterInfo;
|
||||
int i;
|
||||
for( i=0; i<m_AdapterInfoList.GetSize(); i++ )
|
||||
{
|
||||
CD3DEnumAdapterInfo* pAdapterInfo1 = m_AdapterInfoList.GetAt(i);
|
||||
|
||||
for( int j=i+1; j<m_AdapterInfoList.GetSize(); j++ )
|
||||
{
|
||||
CD3DEnumAdapterInfo* pAdapterInfo2 = m_AdapterInfoList.GetAt(j);
|
||||
if( _stricmp( pAdapterInfo1->AdapterIdentifier.Description,
|
||||
pAdapterInfo2->AdapterIdentifier.Description ) == 0 )
|
||||
{
|
||||
bUniqueDesc = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if( !bUniqueDesc )
|
||||
break;
|
||||
}
|
||||
|
||||
for( i=0; i<m_AdapterInfoList.GetSize(); i++ )
|
||||
{
|
||||
pAdapterInfo = m_AdapterInfoList.GetAt(i);
|
||||
|
||||
MultiByteToWideChar( CP_ACP, 0,
|
||||
pAdapterInfo->AdapterIdentifier.Description, -1,
|
||||
pAdapterInfo->szUniqueDescription, 100 );
|
||||
pAdapterInfo->szUniqueDescription[100] = 0;
|
||||
|
||||
if( !bUniqueDesc )
|
||||
{
|
||||
WCHAR sz[100];
|
||||
StringCchPrintf( sz, 100, L" (#%d)", pAdapterInfo->AdapterOrdinal );
|
||||
StringCchCat( pAdapterInfo->szUniqueDescription, 256, sz );
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
// Enumerates D3D devices for a particular adapter.
|
||||
//--------------------------------------------------------------------------------------
|
||||
HRESULT CD3DEnumeration::EnumerateDevices( CD3DEnumAdapterInfo* pAdapterInfo, CGrowableArray<D3DFORMAT>* pAdapterFormatList )
|
||||
{
|
||||
HRESULT hr;
|
||||
|
||||
const D3DDEVTYPE devTypeArray[] =
|
||||
{
|
||||
D3DDEVTYPE_HAL,
|
||||
D3DDEVTYPE_SW,
|
||||
D3DDEVTYPE_REF
|
||||
};
|
||||
const UINT devTypeArrayCount = sizeof(devTypeArray) / sizeof(devTypeArray[0]);
|
||||
|
||||
// Enumerate each Direct3D device type
|
||||
for( UINT iDeviceType = 0; iDeviceType < devTypeArrayCount; iDeviceType++ )
|
||||
{
|
||||
CD3DEnumDeviceInfo* pDeviceInfo = new CD3DEnumDeviceInfo;
|
||||
if( pDeviceInfo == NULL )
|
||||
return E_OUTOFMEMORY;
|
||||
|
||||
// Fill struct w/ AdapterOrdinal and D3DDEVTYPE
|
||||
pDeviceInfo->DeviceType = devTypeArray[iDeviceType];
|
||||
|
||||
// Store device caps
|
||||
if( FAILED( hr = m_pD3D->GetDeviceCaps( pAdapterInfo->AdapterOrdinal, pDeviceInfo->DeviceType,
|
||||
&pDeviceInfo->Caps ) ) )
|
||||
{
|
||||
delete pDeviceInfo;
|
||||
continue;
|
||||
}
|
||||
|
||||
// Get info for each devicecombo on this device
|
||||
if( FAILED( hr = EnumerateDeviceCombos( pAdapterInfo, pDeviceInfo, pAdapterFormatList ) ) )
|
||||
{
|
||||
delete pDeviceInfo;
|
||||
continue;
|
||||
}
|
||||
|
||||
// If at least one devicecombo for this device is found,
|
||||
// add the deviceInfo to the list
|
||||
if (pDeviceInfo->deviceSettingsComboList.GetSize() > 0 )
|
||||
pAdapterInfo->deviceInfoList.Add( pDeviceInfo );
|
||||
else
|
||||
delete pDeviceInfo;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
// Enumerates DeviceCombos for a particular device.
|
||||
//--------------------------------------------------------------------------------------
|
||||
HRESULT CD3DEnumeration::EnumerateDeviceCombos( CD3DEnumAdapterInfo* pAdapterInfo, CD3DEnumDeviceInfo* pDeviceInfo, CGrowableArray<D3DFORMAT>* pAdapterFormatList )
|
||||
{
|
||||
const D3DFORMAT backBufferFormatArray[] =
|
||||
{
|
||||
D3DFMT_A8R8G8B8,
|
||||
D3DFMT_X8R8G8B8,
|
||||
D3DFMT_A2R10G10B10,
|
||||
D3DFMT_R5G6B5,
|
||||
D3DFMT_A1R5G5B5,
|
||||
D3DFMT_X1R5G5B5
|
||||
};
|
||||
const UINT backBufferFormatArrayCount = sizeof(backBufferFormatArray) / sizeof(backBufferFormatArray[0]);
|
||||
|
||||
// See which adapter formats are supported by this device
|
||||
for( int iFormat=0; iFormat<pAdapterFormatList->GetSize(); iFormat++ )
|
||||
{
|
||||
D3DFORMAT adapterFormat = pAdapterFormatList->GetAt(iFormat);
|
||||
|
||||
for( UINT iBackBufferFormat = 0; iBackBufferFormat < backBufferFormatArrayCount; iBackBufferFormat++ )
|
||||
{
|
||||
D3DFORMAT backBufferFormat = backBufferFormatArray[iBackBufferFormat];
|
||||
|
||||
for( int nWindowed = 0; nWindowed < 2; nWindowed++)
|
||||
{
|
||||
if( !nWindowed && pAdapterInfo->displayModeList.GetSize() == 0 )
|
||||
continue;
|
||||
|
||||
if (FAILED( m_pD3D->CheckDeviceType( pAdapterInfo->AdapterOrdinal, pDeviceInfo->DeviceType,
|
||||
adapterFormat, backBufferFormat, nWindowed )))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if( m_bRequirePostPixelShaderBlending )
|
||||
{
|
||||
// If the backbuffer format doesn't support D3DUSAGE_QUERY_POSTPIXELSHADER_BLENDING
|
||||
// then alpha test, pixel fog, render-target blending, color write enable, and dithering.
|
||||
// are not supported.
|
||||
if( FAILED( m_pD3D->CheckDeviceFormat( pAdapterInfo->AdapterOrdinal, pDeviceInfo->DeviceType,
|
||||
adapterFormat, D3DUSAGE_QUERY_POSTPIXELSHADER_BLENDING,
|
||||
D3DRTYPE_TEXTURE, backBufferFormat ) ) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// If an application callback function has been provided, make sure this device
|
||||
// is acceptable to the app.
|
||||
if( m_IsDeviceAcceptableFunc != NULL )
|
||||
{
|
||||
if( !m_IsDeviceAcceptableFunc( &pDeviceInfo->Caps, adapterFormat, backBufferFormat, FALSE != nWindowed ) )
|
||||
continue;
|
||||
}
|
||||
|
||||
// At this point, we have an adapter/device/adapterformat/backbufferformat/iswindowed
|
||||
// DeviceCombo that is supported by the system and acceptable to the app. We still
|
||||
// need to find one or more suitable depth/stencil buffer format,
|
||||
// multisample type, and present interval.
|
||||
CD3DEnumDeviceSettingsCombo* pDeviceCombo = new CD3DEnumDeviceSettingsCombo;
|
||||
if( pDeviceCombo == NULL )
|
||||
return E_OUTOFMEMORY;
|
||||
|
||||
pDeviceCombo->AdapterOrdinal = pAdapterInfo->AdapterOrdinal;
|
||||
pDeviceCombo->DeviceType = pDeviceInfo->DeviceType;
|
||||
pDeviceCombo->AdapterFormat = adapterFormat;
|
||||
pDeviceCombo->BackBufferFormat = backBufferFormat;
|
||||
pDeviceCombo->Windowed = (nWindowed != 0);
|
||||
|
||||
BuildDepthStencilFormatList( pDeviceCombo );
|
||||
BuildMultiSampleTypeList( pDeviceCombo );
|
||||
if (pDeviceCombo->multiSampleTypeList.GetSize() == 0)
|
||||
{
|
||||
delete pDeviceCombo;
|
||||
continue;
|
||||
}
|
||||
BuildDSMSConflictList( pDeviceCombo );
|
||||
BuildPresentIntervalList(pDeviceInfo, pDeviceCombo );
|
||||
pDeviceCombo->pAdapterInfo = pAdapterInfo;
|
||||
pDeviceCombo->pDeviceInfo = pDeviceInfo;
|
||||
|
||||
pDeviceInfo->deviceSettingsComboList.Add( pDeviceCombo );
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
// Adds all depth/stencil formats that are compatible with the device
|
||||
// and app to the given D3DDeviceCombo.
|
||||
//--------------------------------------------------------------------------------------
|
||||
void CD3DEnumeration::BuildDepthStencilFormatList( CD3DEnumDeviceSettingsCombo* pDeviceCombo )
|
||||
{
|
||||
D3DFORMAT depthStencilFmt;
|
||||
for( int idsf = 0; idsf < m_DepthStecilPossibleList.GetSize(); idsf++ )
|
||||
{
|
||||
depthStencilFmt = m_DepthStecilPossibleList.GetAt(idsf);
|
||||
if (SUCCEEDED(m_pD3D->CheckDeviceFormat(pDeviceCombo->AdapterOrdinal,
|
||||
pDeviceCombo->DeviceType, pDeviceCombo->AdapterFormat,
|
||||
D3DUSAGE_DEPTHSTENCIL, D3DRTYPE_SURFACE, depthStencilFmt)))
|
||||
{
|
||||
if (SUCCEEDED(m_pD3D->CheckDepthStencilMatch(pDeviceCombo->AdapterOrdinal,
|
||||
pDeviceCombo->DeviceType, pDeviceCombo->AdapterFormat,
|
||||
pDeviceCombo->BackBufferFormat, depthStencilFmt)))
|
||||
{
|
||||
pDeviceCombo->depthStencilFormatList.Add( depthStencilFmt );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
// Adds all multisample types that are compatible with the device and app to
|
||||
// the given D3DDeviceCombo.
|
||||
//--------------------------------------------------------------------------------------
|
||||
void CD3DEnumeration::BuildMultiSampleTypeList( CD3DEnumDeviceSettingsCombo* pDeviceCombo )
|
||||
{
|
||||
D3DMULTISAMPLE_TYPE msType;
|
||||
DWORD msQuality;
|
||||
for( int imst = 0; imst < m_MultiSampleTypeList.GetSize(); imst++ )
|
||||
{
|
||||
msType = m_MultiSampleTypeList.GetAt(imst);
|
||||
if( SUCCEEDED( m_pD3D->CheckDeviceMultiSampleType( pDeviceCombo->AdapterOrdinal,
|
||||
pDeviceCombo->DeviceType, pDeviceCombo->BackBufferFormat,
|
||||
pDeviceCombo->Windowed, msType, &msQuality ) ) )
|
||||
{
|
||||
pDeviceCombo->multiSampleTypeList.Add( msType );
|
||||
if( msQuality > m_nMultisampleQualityMax+1 )
|
||||
msQuality = m_nMultisampleQualityMax+1;
|
||||
pDeviceCombo->multiSampleQualityList.Add( msQuality );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
// Find any conflicts between the available depth/stencil formats and
|
||||
// multisample types.
|
||||
//--------------------------------------------------------------------------------------
|
||||
void CD3DEnumeration::BuildDSMSConflictList( CD3DEnumDeviceSettingsCombo* pDeviceCombo )
|
||||
{
|
||||
CD3DEnumDSMSConflict DSMSConflict;
|
||||
|
||||
for( int iDS=0; iDS<pDeviceCombo->depthStencilFormatList.GetSize(); iDS++ )
|
||||
{
|
||||
D3DFORMAT dsFmt = pDeviceCombo->depthStencilFormatList.GetAt(iDS);
|
||||
|
||||
for( int iMS=0; iMS<pDeviceCombo->multiSampleTypeList.GetSize(); iMS++ )
|
||||
{
|
||||
D3DMULTISAMPLE_TYPE msType = pDeviceCombo->multiSampleTypeList.GetAt(iMS);
|
||||
|
||||
if( FAILED( m_pD3D->CheckDeviceMultiSampleType( pDeviceCombo->AdapterOrdinal, pDeviceCombo->DeviceType,
|
||||
dsFmt, pDeviceCombo->Windowed, msType, NULL ) ) )
|
||||
{
|
||||
DSMSConflict.DSFormat = dsFmt;
|
||||
DSMSConflict.MSType = msType;
|
||||
pDeviceCombo->DSMSConflictList.Add( DSMSConflict );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
// Adds all present intervals that are compatible with the device and app
|
||||
// to the given D3DDeviceCombo.
|
||||
//--------------------------------------------------------------------------------------
|
||||
void CD3DEnumeration::BuildPresentIntervalList( CD3DEnumDeviceInfo* pDeviceInfo,
|
||||
CD3DEnumDeviceSettingsCombo* pDeviceCombo )
|
||||
{
|
||||
UINT pi;
|
||||
for( int ipi = 0; ipi < m_PresentIntervalList.GetSize(); ipi++ )
|
||||
{
|
||||
pi = m_PresentIntervalList.GetAt(ipi);
|
||||
if( pDeviceCombo->Windowed )
|
||||
{
|
||||
if( pi == D3DPRESENT_INTERVAL_TWO ||
|
||||
pi == D3DPRESENT_INTERVAL_THREE ||
|
||||
pi == D3DPRESENT_INTERVAL_FOUR )
|
||||
{
|
||||
// These intervals are not supported in windowed mode.
|
||||
continue;
|
||||
}
|
||||
}
|
||||
// Note that D3DPRESENT_INTERVAL_DEFAULT is zero, so you
|
||||
// can't do a caps check for it -- it is always available.
|
||||
if( pi == D3DPRESENT_INTERVAL_DEFAULT ||
|
||||
(pDeviceInfo->Caps.PresentationIntervals & pi) )
|
||||
{
|
||||
pDeviceCombo->presentIntervalList.Add( pi );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
// Release all the allocated CD3DEnumAdapterInfo objects and empty the list
|
||||
//--------------------------------------------------------------------------------------
|
||||
void CD3DEnumeration::ClearAdapterInfoList()
|
||||
{
|
||||
CD3DEnumAdapterInfo* pAdapterInfo;
|
||||
for( int i=0; i<m_AdapterInfoList.GetSize(); i++ )
|
||||
{
|
||||
pAdapterInfo = m_AdapterInfoList.GetAt(i);
|
||||
delete pAdapterInfo;
|
||||
}
|
||||
|
||||
m_AdapterInfoList.RemoveAll();
|
||||
}
|
||||
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
// Call GetAdapterInfoList() after Enumerate() to get a STL vector of
|
||||
// CD3DEnumAdapterInfo*
|
||||
//--------------------------------------------------------------------------------------
|
||||
CGrowableArray<CD3DEnumAdapterInfo*>* CD3DEnumeration::GetAdapterInfoList()
|
||||
{
|
||||
return &m_AdapterInfoList;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
CD3DEnumAdapterInfo* CD3DEnumeration::GetAdapterInfo( UINT AdapterOrdinal )
|
||||
{
|
||||
for( int iAdapter=0; iAdapter<m_AdapterInfoList.GetSize(); iAdapter++ )
|
||||
{
|
||||
CD3DEnumAdapterInfo* pAdapterInfo = m_AdapterInfoList.GetAt(iAdapter);
|
||||
if( pAdapterInfo->AdapterOrdinal == AdapterOrdinal )
|
||||
return pAdapterInfo;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
CD3DEnumDeviceInfo* CD3DEnumeration::GetDeviceInfo( UINT AdapterOrdinal, D3DDEVTYPE DeviceType )
|
||||
{
|
||||
CD3DEnumAdapterInfo* pAdapterInfo = GetAdapterInfo( AdapterOrdinal );
|
||||
if( pAdapterInfo )
|
||||
{
|
||||
for( int iDeviceInfo=0; iDeviceInfo<pAdapterInfo->deviceInfoList.GetSize(); iDeviceInfo++ )
|
||||
{
|
||||
CD3DEnumDeviceInfo* pDeviceInfo = pAdapterInfo->deviceInfoList.GetAt(iDeviceInfo);
|
||||
if( pDeviceInfo->DeviceType == DeviceType )
|
||||
return pDeviceInfo;
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
//
|
||||
//--------------------------------------------------------------------------------------
|
||||
CD3DEnumDeviceSettingsCombo* CD3DEnumeration::GetDeviceSettingsCombo( UINT AdapterOrdinal, D3DDEVTYPE DeviceType, D3DFORMAT AdapterFormat, D3DFORMAT BackBufferFormat, BOOL bWindowed )
|
||||
{
|
||||
CD3DEnumDeviceInfo* pDeviceInfo = GetDeviceInfo( AdapterOrdinal, DeviceType );
|
||||
if( pDeviceInfo )
|
||||
{
|
||||
for( int iDeviceCombo=0; iDeviceCombo<pDeviceInfo->deviceSettingsComboList.GetSize(); iDeviceCombo++ )
|
||||
{
|
||||
CD3DEnumDeviceSettingsCombo* pDeviceSettingsCombo = pDeviceInfo->deviceSettingsComboList.GetAt(iDeviceCombo);
|
||||
if( pDeviceSettingsCombo->AdapterFormat == AdapterFormat &&
|
||||
pDeviceSettingsCombo->BackBufferFormat == BackBufferFormat &&
|
||||
pDeviceSettingsCombo->Windowed == bWindowed )
|
||||
return pDeviceSettingsCombo;
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
// Returns the number of color channel bits in the specified D3DFORMAT
|
||||
//--------------------------------------------------------------------------------------
|
||||
UINT DXUTColorChannelBits( D3DFORMAT fmt )
|
||||
{
|
||||
switch( fmt )
|
||||
{
|
||||
case D3DFMT_R8G8B8:
|
||||
return 8;
|
||||
case D3DFMT_A8R8G8B8:
|
||||
return 8;
|
||||
case D3DFMT_X8R8G8B8:
|
||||
return 8;
|
||||
case D3DFMT_R5G6B5:
|
||||
return 5;
|
||||
case D3DFMT_X1R5G5B5:
|
||||
return 5;
|
||||
case D3DFMT_A1R5G5B5:
|
||||
return 5;
|
||||
case D3DFMT_A4R4G4B4:
|
||||
return 4;
|
||||
case D3DFMT_R3G3B2:
|
||||
return 2;
|
||||
case D3DFMT_A8R3G3B2:
|
||||
return 2;
|
||||
case D3DFMT_X4R4G4B4:
|
||||
return 4;
|
||||
case D3DFMT_A2B10G10R10:
|
||||
return 10;
|
||||
case D3DFMT_A8B8G8R8:
|
||||
return 8;
|
||||
case D3DFMT_A2R10G10B10:
|
||||
return 10;
|
||||
case D3DFMT_A16B16G16R16:
|
||||
return 16;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
// Returns the number of alpha channel bits in the specified D3DFORMAT
|
||||
//--------------------------------------------------------------------------------------
|
||||
UINT DXUTAlphaChannelBits( D3DFORMAT fmt )
|
||||
{
|
||||
switch( fmt )
|
||||
{
|
||||
case D3DFMT_R8G8B8:
|
||||
return 0;
|
||||
case D3DFMT_A8R8G8B8:
|
||||
return 8;
|
||||
case D3DFMT_X8R8G8B8:
|
||||
return 0;
|
||||
case D3DFMT_R5G6B5:
|
||||
return 0;
|
||||
case D3DFMT_X1R5G5B5:
|
||||
return 0;
|
||||
case D3DFMT_A1R5G5B5:
|
||||
return 1;
|
||||
case D3DFMT_A4R4G4B4:
|
||||
return 4;
|
||||
case D3DFMT_R3G3B2:
|
||||
return 0;
|
||||
case D3DFMT_A8R3G3B2:
|
||||
return 8;
|
||||
case D3DFMT_X4R4G4B4:
|
||||
return 0;
|
||||
case D3DFMT_A2B10G10R10:
|
||||
return 2;
|
||||
case D3DFMT_A8B8G8R8:
|
||||
return 8;
|
||||
case D3DFMT_A2R10G10B10:
|
||||
return 2;
|
||||
case D3DFMT_A16B16G16R16:
|
||||
return 16;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
// Returns the number of depth bits in the specified D3DFORMAT
|
||||
//--------------------------------------------------------------------------------------
|
||||
UINT DXUTDepthBits( D3DFORMAT fmt )
|
||||
{
|
||||
switch( fmt )
|
||||
{
|
||||
case D3DFMT_D32F_LOCKABLE:
|
||||
case D3DFMT_D32:
|
||||
return 32;
|
||||
|
||||
case D3DFMT_D24X8:
|
||||
case D3DFMT_D24S8:
|
||||
case D3DFMT_D24X4S4:
|
||||
case D3DFMT_D24FS8:
|
||||
return 24;
|
||||
|
||||
case D3DFMT_D16_LOCKABLE:
|
||||
case D3DFMT_D16:
|
||||
return 16;
|
||||
|
||||
case D3DFMT_D15S1:
|
||||
return 15;
|
||||
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
// Returns the number of stencil bits in the specified D3DFORMAT
|
||||
//--------------------------------------------------------------------------------------
|
||||
UINT DXUTStencilBits( D3DFORMAT fmt )
|
||||
{
|
||||
switch( fmt )
|
||||
{
|
||||
case D3DFMT_D16_LOCKABLE:
|
||||
case D3DFMT_D16:
|
||||
case D3DFMT_D32F_LOCKABLE:
|
||||
case D3DFMT_D32:
|
||||
case D3DFMT_D24X8:
|
||||
return 0;
|
||||
|
||||
case D3DFMT_D15S1:
|
||||
return 1;
|
||||
|
||||
case D3DFMT_D24X4S4:
|
||||
return 4;
|
||||
|
||||
case D3DFMT_D24S8:
|
||||
case D3DFMT_D24FS8:
|
||||
return 8;
|
||||
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
// Used to sort D3DDISPLAYMODEs
|
||||
//--------------------------------------------------------------------------------------
|
||||
static int __cdecl SortModesCallback( const void* arg1, const void* arg2 )
|
||||
{
|
||||
D3DDISPLAYMODE* pdm1 = (D3DDISPLAYMODE*)arg1;
|
||||
D3DDISPLAYMODE* pdm2 = (D3DDISPLAYMODE*)arg2;
|
||||
|
||||
if (pdm1->Width > pdm2->Width)
|
||||
return 1;
|
||||
if (pdm1->Width < pdm2->Width)
|
||||
return -1;
|
||||
if (pdm1->Height > pdm2->Height)
|
||||
return 1;
|
||||
if (pdm1->Height < pdm2->Height)
|
||||
return -1;
|
||||
if (pdm1->Format > pdm2->Format)
|
||||
return 1;
|
||||
if (pdm1->Format < pdm2->Format)
|
||||
return -1;
|
||||
if (pdm1->RefreshRate > pdm2->RefreshRate)
|
||||
return 1;
|
||||
if (pdm1->RefreshRate < pdm2->RefreshRate)
|
||||
return -1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
CD3DEnumAdapterInfo::~CD3DEnumAdapterInfo( void )
|
||||
{
|
||||
CD3DEnumDeviceInfo* pDeviceInfo;
|
||||
for( int i=0; i<deviceInfoList.GetSize(); i++ )
|
||||
{
|
||||
pDeviceInfo = deviceInfoList.GetAt(i);
|
||||
delete pDeviceInfo;
|
||||
}
|
||||
deviceInfoList.RemoveAll();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
CD3DEnumDeviceInfo::~CD3DEnumDeviceInfo( void )
|
||||
{
|
||||
CD3DEnumDeviceSettingsCombo* pDeviceCombo;
|
||||
for( int i=0; i<deviceSettingsComboList.GetSize(); i++ )
|
||||
{
|
||||
pDeviceCombo = deviceSettingsComboList.GetAt(i);
|
||||
delete pDeviceCombo;
|
||||
}
|
||||
deviceSettingsComboList.RemoveAll();
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
void CD3DEnumeration::ResetPossibleDepthStencilFormats()
|
||||
{
|
||||
m_DepthStecilPossibleList.RemoveAll();
|
||||
m_DepthStecilPossibleList.Add( D3DFMT_D16 );
|
||||
m_DepthStecilPossibleList.Add( D3DFMT_D15S1 );
|
||||
m_DepthStecilPossibleList.Add( D3DFMT_D24X8 );
|
||||
m_DepthStecilPossibleList.Add( D3DFMT_D24S8 );
|
||||
m_DepthStecilPossibleList.Add( D3DFMT_D24X4S4 );
|
||||
m_DepthStecilPossibleList.Add( D3DFMT_D32 );
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
CGrowableArray<D3DFORMAT>* CD3DEnumeration::GetPossibleDepthStencilFormatList()
|
||||
{
|
||||
return &m_DepthStecilPossibleList;
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
CGrowableArray<D3DMULTISAMPLE_TYPE>* CD3DEnumeration::GetPossibleMultisampleTypeList()
|
||||
{
|
||||
return &m_MultiSampleTypeList;
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
void CD3DEnumeration::ResetPossibleMultisampleTypeList()
|
||||
{
|
||||
m_MultiSampleTypeList.RemoveAll();
|
||||
m_MultiSampleTypeList.Add( D3DMULTISAMPLE_NONE );
|
||||
m_MultiSampleTypeList.Add( D3DMULTISAMPLE_NONMASKABLE );
|
||||
m_MultiSampleTypeList.Add( D3DMULTISAMPLE_2_SAMPLES );
|
||||
m_MultiSampleTypeList.Add( D3DMULTISAMPLE_3_SAMPLES );
|
||||
m_MultiSampleTypeList.Add( D3DMULTISAMPLE_4_SAMPLES );
|
||||
m_MultiSampleTypeList.Add( D3DMULTISAMPLE_5_SAMPLES );
|
||||
m_MultiSampleTypeList.Add( D3DMULTISAMPLE_6_SAMPLES );
|
||||
m_MultiSampleTypeList.Add( D3DMULTISAMPLE_7_SAMPLES );
|
||||
m_MultiSampleTypeList.Add( D3DMULTISAMPLE_8_SAMPLES );
|
||||
m_MultiSampleTypeList.Add( D3DMULTISAMPLE_9_SAMPLES );
|
||||
m_MultiSampleTypeList.Add( D3DMULTISAMPLE_10_SAMPLES );
|
||||
m_MultiSampleTypeList.Add( D3DMULTISAMPLE_11_SAMPLES );
|
||||
m_MultiSampleTypeList.Add( D3DMULTISAMPLE_12_SAMPLES );
|
||||
m_MultiSampleTypeList.Add( D3DMULTISAMPLE_13_SAMPLES );
|
||||
m_MultiSampleTypeList.Add( D3DMULTISAMPLE_14_SAMPLES );
|
||||
m_MultiSampleTypeList.Add( D3DMULTISAMPLE_15_SAMPLES );
|
||||
m_MultiSampleTypeList.Add( D3DMULTISAMPLE_16_SAMPLES );
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
void CD3DEnumeration::GetPossibleVertexProcessingList( bool* pbSoftwareVP, bool* pbHardwareVP, bool* pbPureHarewareVP, bool* pbMixedVP )
|
||||
{
|
||||
*pbSoftwareVP = m_bSoftwareVP;
|
||||
*pbHardwareVP = m_bHardwareVP;
|
||||
*pbPureHarewareVP = m_bPureHarewareVP;
|
||||
*pbMixedVP = m_bMixedVP;
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
void CD3DEnumeration::SetPossibleVertexProcessingList( bool bSoftwareVP, bool bHardwareVP, bool bPureHarewareVP, bool bMixedVP )
|
||||
{
|
||||
m_bSoftwareVP = bSoftwareVP;
|
||||
m_bHardwareVP = bHardwareVP;
|
||||
m_bPureHarewareVP = bPureHarewareVP;
|
||||
m_bMixedVP = bMixedVP;
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
CGrowableArray<UINT>* CD3DEnumeration::GetPossiblePresentIntervalList()
|
||||
{
|
||||
return &m_PresentIntervalList;
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
void CD3DEnumeration::ResetPossiblePresentIntervalList()
|
||||
{
|
||||
m_PresentIntervalList.RemoveAll();
|
||||
m_PresentIntervalList.Add( D3DPRESENT_INTERVAL_IMMEDIATE );
|
||||
m_PresentIntervalList.Add( D3DPRESENT_INTERVAL_DEFAULT );
|
||||
m_PresentIntervalList.Add( D3DPRESENT_INTERVAL_ONE );
|
||||
m_PresentIntervalList.Add( D3DPRESENT_INTERVAL_TWO );
|
||||
m_PresentIntervalList.Add( D3DPRESENT_INTERVAL_THREE );
|
||||
m_PresentIntervalList.Add( D3DPRESENT_INTERVAL_FOUR );
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
void CD3DEnumeration::SetResolutionMinMax( UINT nMinWidth, UINT nMinHeight,
|
||||
UINT nMaxWidth, UINT nMaxHeight )
|
||||
{
|
||||
m_nMinWidth = nMinWidth;
|
||||
m_nMinHeight = nMinHeight;
|
||||
m_nMaxWidth = nMaxWidth;
|
||||
m_nMaxHeight = nMaxHeight;
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
void CD3DEnumeration::SetRefreshMinMax( UINT nMin, UINT nMax )
|
||||
{
|
||||
m_nRefreshMin = nMin;
|
||||
m_nRefreshMax = nMax;
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
void CD3DEnumeration::SetMultisampleQualityMax( UINT nMax )
|
||||
{
|
||||
if( nMax > 0xFFFF )
|
||||
nMax = 0xFFFF;
|
||||
m_nMultisampleQualityMax = nMax;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,171 @@
|
||||
//--------------------------------------------------------------------------------------
|
||||
// File: DXUTEnum.h
|
||||
//
|
||||
// Enumerates D3D adapters, devices, modes, etc.
|
||||
//
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//--------------------------------------------------------------------------------------
|
||||
#pragma once
|
||||
#ifndef DXUT_ENUM_H
|
||||
#define DXUT_ENUM_H
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
// Forward declarations
|
||||
//--------------------------------------------------------------------------------------
|
||||
class CD3DEnumAdapterInfo;
|
||||
class CD3DEnumDeviceInfo;
|
||||
struct CD3DEnumDeviceSettingsCombo;
|
||||
struct CD3DEnumDSMSConflict;
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
// Enumerates available Direct3D adapters, devices, modes, etc.
|
||||
// Use DXUTGetEnumeration() to access global instance
|
||||
//--------------------------------------------------------------------------------------
|
||||
class CD3DEnumeration
|
||||
{
|
||||
public:
|
||||
// These should be called before Enumerate().
|
||||
//
|
||||
// Use these calls and the IsDeviceAcceptable to control the contents of
|
||||
// the enumeration object, which affects the device selection and the device settings dialog.
|
||||
void SetRequirePostPixelShaderBlending( bool bRequire ) { m_bRequirePostPixelShaderBlending = bRequire; }
|
||||
void SetResolutionMinMax( UINT nMinWidth, UINT nMinHeight, UINT nMaxWidth, UINT nMaxHeight );
|
||||
void SetRefreshMinMax( UINT nMin, UINT nMax );
|
||||
void SetMultisampleQualityMax( UINT nMax );
|
||||
void GetPossibleVertexProcessingList( bool* pbSoftwareVP, bool* pbHardwareVP, bool* pbPureHarewareVP, bool* pbMixedVP );
|
||||
void SetPossibleVertexProcessingList( bool bSoftwareVP, bool bHardwareVP, bool bPureHarewareVP, bool bMixedVP );
|
||||
CGrowableArray<D3DFORMAT>* GetPossibleDepthStencilFormatList();
|
||||
CGrowableArray<D3DMULTISAMPLE_TYPE>* GetPossibleMultisampleTypeList();
|
||||
CGrowableArray<UINT>* GetPossiblePresentIntervalList();
|
||||
void ResetPossibleDepthStencilFormats();
|
||||
void ResetPossibleMultisampleTypeList();
|
||||
void ResetPossiblePresentIntervalList();
|
||||
|
||||
// Call Enumerate() to enumerate available D3D adapters, devices, modes, etc.
|
||||
HRESULT Enumerate( IDirect3D9* pD3D = NULL,
|
||||
LPDXUTCALLBACKISDEVICEACCEPTABLE IsDeviceAcceptableFunc = NULL );
|
||||
|
||||
// These should be called after Enumerate() is called
|
||||
CGrowableArray<CD3DEnumAdapterInfo*>* GetAdapterInfoList();
|
||||
CD3DEnumAdapterInfo* GetAdapterInfo( UINT AdapterOrdinal );
|
||||
CD3DEnumDeviceInfo* GetDeviceInfo( UINT AdapterOrdinal, D3DDEVTYPE DeviceType );
|
||||
CD3DEnumDeviceSettingsCombo* GetDeviceSettingsCombo( DXUTDeviceSettings* pDeviceSettings ) { return GetDeviceSettingsCombo( pDeviceSettings->AdapterOrdinal, pDeviceSettings->DeviceType, pDeviceSettings->AdapterFormat, pDeviceSettings->pp.BackBufferFormat, pDeviceSettings->pp.Windowed ); }
|
||||
CD3DEnumDeviceSettingsCombo* GetDeviceSettingsCombo( UINT AdapterOrdinal, D3DDEVTYPE DeviceType, D3DFORMAT AdapterFormat, D3DFORMAT BackBufferFormat, BOOL Windowed );
|
||||
|
||||
~CD3DEnumeration();
|
||||
|
||||
private:
|
||||
friend CD3DEnumeration* DXUTGetEnumeration();
|
||||
|
||||
// Use DXUTGetEnumeration() to access global instance
|
||||
CD3DEnumeration();
|
||||
|
||||
IDirect3D9* m_pD3D;
|
||||
LPDXUTCALLBACKISDEVICEACCEPTABLE m_IsDeviceAcceptableFunc;
|
||||
bool m_bRequirePostPixelShaderBlending;
|
||||
CGrowableArray<D3DFORMAT> m_DepthStecilPossibleList;
|
||||
CGrowableArray<D3DMULTISAMPLE_TYPE> m_MultiSampleTypeList;
|
||||
CGrowableArray<UINT> m_PresentIntervalList;
|
||||
|
||||
bool m_bSoftwareVP;
|
||||
bool m_bHardwareVP;
|
||||
bool m_bPureHarewareVP;
|
||||
bool m_bMixedVP;
|
||||
|
||||
UINT m_nMinWidth;
|
||||
UINT m_nMaxWidth;
|
||||
UINT m_nMinHeight;
|
||||
UINT m_nMaxHeight;
|
||||
UINT m_nRefreshMin;
|
||||
UINT m_nRefreshMax;
|
||||
UINT m_nMultisampleQualityMax;
|
||||
|
||||
// Array of CD3DEnumAdapterInfo* with unique AdapterOrdinals
|
||||
CGrowableArray<CD3DEnumAdapterInfo*> m_AdapterInfoList;
|
||||
|
||||
HRESULT EnumerateDevices( CD3DEnumAdapterInfo* pAdapterInfo, CGrowableArray<D3DFORMAT>* pAdapterFormatList );
|
||||
HRESULT EnumerateDeviceCombos( CD3DEnumAdapterInfo* pAdapterInfo, CD3DEnumDeviceInfo* pDeviceInfo, CGrowableArray<D3DFORMAT>* pAdapterFormatList );
|
||||
void BuildDepthStencilFormatList( CD3DEnumDeviceSettingsCombo* pDeviceCombo );
|
||||
void BuildMultiSampleTypeList( CD3DEnumDeviceSettingsCombo* pDeviceCombo );
|
||||
void BuildDSMSConflictList( CD3DEnumDeviceSettingsCombo* pDeviceCombo );
|
||||
void BuildPresentIntervalList( CD3DEnumDeviceInfo* pDeviceInfo, CD3DEnumDeviceSettingsCombo* pDeviceCombo );
|
||||
void ClearAdapterInfoList();
|
||||
};
|
||||
|
||||
CD3DEnumeration* DXUTGetEnumeration();
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
// A class describing an adapter which contains a unique adapter ordinal
|
||||
// that is installed on the system
|
||||
//--------------------------------------------------------------------------------------
|
||||
class CD3DEnumAdapterInfo
|
||||
{
|
||||
public:
|
||||
~CD3DEnumAdapterInfo();
|
||||
|
||||
UINT AdapterOrdinal;
|
||||
D3DADAPTER_IDENTIFIER9 AdapterIdentifier;
|
||||
WCHAR szUniqueDescription[256];
|
||||
|
||||
CGrowableArray<D3DDISPLAYMODE> displayModeList; // Array of supported D3DDISPLAYMODEs
|
||||
CGrowableArray<CD3DEnumDeviceInfo*> deviceInfoList; // Array of CD3DEnumDeviceInfo* with unique supported DeviceTypes
|
||||
};
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
// A class describing a Direct3D device that contains a
|
||||
// unique supported device type
|
||||
//--------------------------------------------------------------------------------------
|
||||
class CD3DEnumDeviceInfo
|
||||
{
|
||||
public:
|
||||
~CD3DEnumDeviceInfo();
|
||||
|
||||
UINT AdapterOrdinal;
|
||||
D3DDEVTYPE DeviceType;
|
||||
D3DCAPS9 Caps;
|
||||
|
||||
// List of CD3DEnumDeviceSettingsCombo* with a unique set
|
||||
// of AdapterFormat, BackBufferFormat, and Windowed
|
||||
CGrowableArray<CD3DEnumDeviceSettingsCombo*> deviceSettingsComboList;
|
||||
};
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
// A struct describing device settings that contains a unique combination of
|
||||
// adapter format, back buffer format, and windowed that is compatible with a
|
||||
// particular Direct3D device and the app.
|
||||
//--------------------------------------------------------------------------------------
|
||||
struct CD3DEnumDeviceSettingsCombo
|
||||
{
|
||||
UINT AdapterOrdinal;
|
||||
D3DDEVTYPE DeviceType;
|
||||
D3DFORMAT AdapterFormat;
|
||||
D3DFORMAT BackBufferFormat;
|
||||
BOOL Windowed;
|
||||
|
||||
CGrowableArray<D3DFORMAT> depthStencilFormatList; // List of D3DFORMATs
|
||||
CGrowableArray<D3DMULTISAMPLE_TYPE> multiSampleTypeList; // List of D3DMULTISAMPLE_TYPEs
|
||||
CGrowableArray<DWORD> multiSampleQualityList; // List of number of quality levels for each multisample type
|
||||
CGrowableArray<UINT> presentIntervalList; // List of D3DPRESENT flags
|
||||
CGrowableArray<CD3DEnumDSMSConflict> DSMSConflictList; // List of CD3DEnumDSMSConflict
|
||||
|
||||
CD3DEnumAdapterInfo* pAdapterInfo;
|
||||
CD3DEnumDeviceInfo* pDeviceInfo;
|
||||
};
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
// A depth/stencil buffer format that is incompatible with a
|
||||
// multisample type.
|
||||
//--------------------------------------------------------------------------------------
|
||||
struct CD3DEnumDSMSConflict
|
||||
{
|
||||
D3DFORMAT DSFormat;
|
||||
D3DMULTISAMPLE_TYPE MSType;
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,889 @@
|
||||
//--------------------------------------------------------------------------------------
|
||||
// File: DXUTMisc.h
|
||||
//
|
||||
// Helper functions for Direct3D programming.
|
||||
//
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved
|
||||
//--------------------------------------------------------------------------------------
|
||||
#pragma once
|
||||
#ifndef DXUT_MISC_H
|
||||
#define DXUT_MISC_H
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
// A growable array
|
||||
//--------------------------------------------------------------------------------------
|
||||
template< typename TYPE >
|
||||
class CGrowableArray
|
||||
{
|
||||
public:
|
||||
CGrowableArray() { m_pData = NULL; m_nSize = 0; m_nMaxSize = 0; }
|
||||
CGrowableArray( const CGrowableArray<TYPE>& a ) { for( int i=0; i < a.m_nSize; i++ ) Add( a.m_pData[i] ); }
|
||||
~CGrowableArray() { RemoveAll(); }
|
||||
|
||||
const TYPE& operator[]( int nIndex ) const { return GetAt( nIndex ); }
|
||||
TYPE& operator[]( int nIndex ) { return GetAt( nIndex ); }
|
||||
|
||||
CGrowableArray& operator=( const CGrowableArray<TYPE>& a ) { if( this == &a ) return *this; RemoveAll(); for( int i=0; i < a.m_nSize; i++ ) Add( a.m_pData[i] ); return *this; }
|
||||
|
||||
HRESULT SetSize( int nNewMaxSize );
|
||||
HRESULT Add( const TYPE& value );
|
||||
HRESULT Insert( int nIndex, const TYPE& value );
|
||||
HRESULT SetAt( int nIndex, const TYPE& value );
|
||||
TYPE& GetAt( int nIndex ) { assert( nIndex >= 0 && nIndex < m_nSize ); return m_pData[nIndex]; }
|
||||
int GetSize() const { return m_nSize; }
|
||||
TYPE* GetData() { return m_pData; }
|
||||
bool Contains( const TYPE& value ){ return ( -1 != IndexOf( value ) ); }
|
||||
|
||||
int IndexOf( const TYPE& value ) { return ( m_nSize > 0 ) ? IndexOf( value, 0, m_nSize ) : -1; }
|
||||
int IndexOf( const TYPE& value, int iStart ) { return IndexOf( value, iStart, m_nSize - iStart ); }
|
||||
int IndexOf( const TYPE& value, int nIndex, int nNumElements );
|
||||
|
||||
int LastIndexOf( const TYPE& value ) { return ( m_nSize > 0 ) ? LastIndexOf( value, m_nSize-1, m_nSize ) : -1; }
|
||||
int LastIndexOf( const TYPE& value, int nIndex ) { return LastIndexOf( value, nIndex, nIndex+1 ); }
|
||||
int LastIndexOf( const TYPE& value, int nIndex, int nNumElements );
|
||||
|
||||
HRESULT Remove( int nIndex );
|
||||
void RemoveAll() { SetSize(0); }
|
||||
|
||||
protected:
|
||||
TYPE* m_pData; // the actual array of data
|
||||
int m_nSize; // # of elements (upperBound - 1)
|
||||
int m_nMaxSize; // max allocated
|
||||
|
||||
HRESULT SetSizeInternal( int nNewMaxSize ); // This version doesn't call ctor or dtor.
|
||||
};
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
// Performs timer operations
|
||||
// Use DXUTGetGlobalTimer() to get the global instance
|
||||
//--------------------------------------------------------------------------------------
|
||||
class CDXUTTimer
|
||||
{
|
||||
public:
|
||||
CDXUTTimer();
|
||||
|
||||
void Reset(); // resets the timer
|
||||
void Start(); // starts the timer
|
||||
void Stop(); // stop (or pause) the timer
|
||||
void Advance(); // advance the timer by 0.1 seconds
|
||||
double GetAbsoluteTime(); // get the absolute system time
|
||||
double GetTime(); // get the current time
|
||||
double GetElapsedTime(); // get the time that elapsed between GetElapsedTime() calls
|
||||
bool IsStopped(); // returns true if timer stopped
|
||||
|
||||
protected:
|
||||
bool m_bUsingQPF;
|
||||
bool m_bTimerStopped;
|
||||
LONGLONG m_llQPFTicksPerSec;
|
||||
|
||||
LONGLONG m_llStopTime;
|
||||
LONGLONG m_llLastElapsedTime;
|
||||
LONGLONG m_llBaseTime;
|
||||
};
|
||||
|
||||
CDXUTTimer* DXUTGetGlobalTimer();
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Resource cache for textures, fonts, meshs, and effects.
|
||||
// Use DXUTGetGlobalResourceCache() to access the global cache
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
enum DXUTCACHE_SOURCELOCATION { DXUTCACHE_LOCATION_FILE, DXUTCACHE_LOCATION_RESOURCE };
|
||||
|
||||
struct DXUTCache_Texture
|
||||
{
|
||||
DXUTCACHE_SOURCELOCATION Location;
|
||||
WCHAR wszSource[MAX_PATH];
|
||||
HMODULE hSrcModule;
|
||||
UINT Width;
|
||||
UINT Height;
|
||||
UINT Depth;
|
||||
UINT MipLevels;
|
||||
DWORD Usage;
|
||||
D3DFORMAT Format;
|
||||
D3DPOOL Pool;
|
||||
D3DRESOURCETYPE Type;
|
||||
IDirect3DBaseTexture9 *pTexture;
|
||||
};
|
||||
|
||||
struct DXUTCache_Font : public D3DXFONT_DESC
|
||||
{
|
||||
ID3DXFont *pFont;
|
||||
};
|
||||
|
||||
struct DXUTCache_Effect
|
||||
{
|
||||
DXUTCACHE_SOURCELOCATION Location;
|
||||
WCHAR wszSource[MAX_PATH];
|
||||
HMODULE hSrcModule;
|
||||
DWORD dwFlags;
|
||||
ID3DXEffect *pEffect;
|
||||
};
|
||||
|
||||
|
||||
class CDXUTResourceCache
|
||||
{
|
||||
public:
|
||||
~CDXUTResourceCache();
|
||||
|
||||
HRESULT CreateTextureFromFile( LPDIRECT3DDEVICE9 pDevice, LPCTSTR pSrcFile, LPDIRECT3DTEXTURE9 *ppTexture );
|
||||
HRESULT CreateTextureFromFileEx( LPDIRECT3DDEVICE9 pDevice, LPCTSTR pSrcFile, UINT Width, UINT Height, UINT MipLevels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, DWORD Filter, DWORD MipFilter, D3DCOLOR ColorKey, D3DXIMAGE_INFO *pSrcInfo, PALETTEENTRY *pPalette, LPDIRECT3DTEXTURE9 *ppTexture );
|
||||
HRESULT CreateTextureFromResource( LPDIRECT3DDEVICE9 pDevice, HMODULE hSrcModule, LPCTSTR pSrcResource, LPDIRECT3DTEXTURE9 *ppTexture );
|
||||
HRESULT CreateTextureFromResourceEx( LPDIRECT3DDEVICE9 pDevice, HMODULE hSrcModule, LPCTSTR pSrcResource, UINT Width, UINT Height, UINT MipLevels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, DWORD Filter, DWORD MipFilter, D3DCOLOR ColorKey, D3DXIMAGE_INFO *pSrcInfo, PALETTEENTRY *pPalette, LPDIRECT3DTEXTURE9 *ppTexture );
|
||||
HRESULT CreateCubeTextureFromFile( LPDIRECT3DDEVICE9 pDevice, LPCTSTR pSrcFile, LPDIRECT3DCUBETEXTURE9 *ppCubeTexture );
|
||||
HRESULT CreateCubeTextureFromFileEx( LPDIRECT3DDEVICE9 pDevice, LPCTSTR pSrcFile, UINT Size, UINT MipLevels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, DWORD Filter, DWORD MipFilter, D3DCOLOR ColorKey, D3DXIMAGE_INFO *pSrcInfo, PALETTEENTRY *pPalette, LPDIRECT3DCUBETEXTURE9 *ppCubeTexture );
|
||||
HRESULT CreateCubeTextureFromResource( LPDIRECT3DDEVICE9 pDevice, HMODULE hSrcModule, LPCTSTR pSrcResource, LPDIRECT3DCUBETEXTURE9 *ppCubeTexture );
|
||||
HRESULT CreateCubeTextureFromResourceEx( LPDIRECT3DDEVICE9 pDevice, HMODULE hSrcModule, LPCTSTR pSrcResource, UINT Size, UINT MipLevels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, DWORD Filter, DWORD MipFilter, D3DCOLOR ColorKey, D3DXIMAGE_INFO *pSrcInfo, PALETTEENTRY *pPalette, LPDIRECT3DCUBETEXTURE9 *ppCubeTexture );
|
||||
HRESULT CreateVolumeTextureFromFile( LPDIRECT3DDEVICE9 pDevice, LPCTSTR pSrcFile, LPDIRECT3DVOLUMETEXTURE9 *ppVolumeTexture );
|
||||
HRESULT CreateVolumeTextureFromFileEx( LPDIRECT3DDEVICE9 pDevice, LPCTSTR pSrcFile, UINT Width, UINT Height, UINT Depth, UINT MipLevels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, DWORD Filter, DWORD MipFilter, D3DCOLOR ColorKey, D3DXIMAGE_INFO *pSrcInfo, PALETTEENTRY *pPalette, LPDIRECT3DVOLUMETEXTURE9 *ppTexture );
|
||||
HRESULT CreateVolumeTextureFromResource( LPDIRECT3DDEVICE9 pDevice, HMODULE hSrcModule, LPCTSTR pSrcResource, LPDIRECT3DVOLUMETEXTURE9 *ppVolumeTexture );
|
||||
HRESULT CreateVolumeTextureFromResourceEx( LPDIRECT3DDEVICE9 pDevice, HMODULE hSrcModule, LPCTSTR pSrcResource, UINT Width, UINT Height, UINT Depth, UINT MipLevels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, DWORD Filter, DWORD MipFilter, D3DCOLOR ColorKey, D3DXIMAGE_INFO *pSrcInfo, PALETTEENTRY *pPalette, LPDIRECT3DVOLUMETEXTURE9 *ppVolumeTexture );
|
||||
HRESULT CreateFont( LPDIRECT3DDEVICE9 pDevice, UINT Height, UINT Width, UINT Weight, UINT MipLevels, BOOL Italic, DWORD CharSet, DWORD OutputPrecision, DWORD Quality, DWORD PitchAndFamily, LPCTSTR pFacename, LPD3DXFONT *ppFont );
|
||||
HRESULT CreateFontIndirect( LPDIRECT3DDEVICE9 pDevice, CONST D3DXFONT_DESC *pDesc, LPD3DXFONT *ppFont );
|
||||
HRESULT CreateEffectFromFile( LPDIRECT3DDEVICE9 pDevice, LPCTSTR pSrcFile, const D3DXMACRO *pDefines, LPD3DXINCLUDE pInclude, DWORD Flags, LPD3DXEFFECTPOOL pPool, LPD3DXEFFECT *ppEffect, LPD3DXBUFFER *ppCompilationErrors );
|
||||
HRESULT CreateEffectFromResource( LPDIRECT3DDEVICE9 pDevice, HMODULE hSrcModule, LPCTSTR pSrcResource, const D3DXMACRO *pDefines, LPD3DXINCLUDE pInclude, DWORD Flags, LPD3DXEFFECTPOOL pPool, LPD3DXEFFECT *ppEffect, LPD3DXBUFFER *ppCompilationErrors );
|
||||
|
||||
public:
|
||||
HRESULT OnCreateDevice( IDirect3DDevice9 *pd3dDevice );
|
||||
HRESULT OnResetDevice( IDirect3DDevice9 *pd3dDevice );
|
||||
HRESULT OnLostDevice();
|
||||
HRESULT OnDestroyDevice();
|
||||
|
||||
protected:
|
||||
friend CDXUTResourceCache& DXUTGetGlobalResourceCache();
|
||||
friend HRESULT DXUTInitialize3DEnvironment();
|
||||
friend HRESULT DXUTReset3DEnvironment();
|
||||
friend void DXUTCleanup3DEnvironment( bool bReleaseSettings );
|
||||
|
||||
CDXUTResourceCache() { }
|
||||
|
||||
CGrowableArray< DXUTCache_Texture > m_TextureCache;
|
||||
CGrowableArray< DXUTCache_Effect > m_EffectCache;
|
||||
CGrowableArray< DXUTCache_Font > m_FontCache;
|
||||
};
|
||||
|
||||
CDXUTResourceCache& DXUTGetGlobalResourceCache();
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
class CD3DArcBall
|
||||
{
|
||||
public:
|
||||
CD3DArcBall();
|
||||
|
||||
// Functions to change behavior
|
||||
void Reset();
|
||||
void SetTranslationRadius( FLOAT fRadiusTranslation ) { m_fRadiusTranslation = fRadiusTranslation; }
|
||||
void SetWindow( INT nWidth, INT nHeight, FLOAT fRadius = 0.9f ) { m_nWidth = nWidth; m_nHeight = nHeight; m_fRadius = fRadius; m_vCenter = D3DXVECTOR2(m_nWidth/2.0f,m_nHeight/2.0f); }
|
||||
void SetOffset( INT nX, INT nY ) { m_Offset.x = nX; m_Offset.y = nY; }
|
||||
|
||||
// Call these from client and use GetRotationMatrix() to read new rotation matrix
|
||||
void OnBegin( int nX, int nY ); // start the rotation (pass current mouse position)
|
||||
void OnMove( int nX, int nY ); // continue the rotation (pass current mouse position)
|
||||
void OnEnd(); // end the rotation
|
||||
|
||||
// Or call this to automatically handle left, middle, right buttons
|
||||
LRESULT HandleMessages( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam );
|
||||
|
||||
// Functions to get/set state
|
||||
D3DXMATRIX* GetRotationMatrix() { return D3DXMatrixRotationQuaternion(&m_mRotation, &m_qNow); };
|
||||
D3DXMATRIX* GetTranslationMatrix() { return &m_mTranslation; }
|
||||
D3DXMATRIX* GetTranslationDeltaMatrix() { return &m_mTranslationDelta; }
|
||||
bool IsBeingDragged() { return m_bDrag; }
|
||||
D3DXQUATERNION GetQuatNow() { return m_qNow; }
|
||||
void SetQuatNow( D3DXQUATERNION q ) { m_qNow = q; }
|
||||
|
||||
static D3DXQUATERNION QuatFromBallPoints( const D3DXVECTOR3 &vFrom, const D3DXVECTOR3 &vTo );
|
||||
|
||||
|
||||
protected:
|
||||
D3DXMATRIXA16 m_mRotation; // Matrix for arc ball's orientation
|
||||
D3DXMATRIXA16 m_mTranslation; // Matrix for arc ball's position
|
||||
D3DXMATRIXA16 m_mTranslationDelta; // Matrix for arc ball's position
|
||||
|
||||
POINT m_Offset; // window offset, or upper-left corner of window
|
||||
INT m_nWidth; // arc ball's window width
|
||||
INT m_nHeight; // arc ball's window height
|
||||
D3DXVECTOR2 m_vCenter; // center of arc ball
|
||||
FLOAT m_fRadius; // arc ball's radius in screen coords
|
||||
FLOAT m_fRadiusTranslation; // arc ball's radius for translating the target
|
||||
|
||||
D3DXQUATERNION m_qDown; // Quaternion before button down
|
||||
D3DXQUATERNION m_qNow; // Composite quaternion for current drag
|
||||
bool m_bDrag; // Whether user is dragging arc ball
|
||||
|
||||
POINT m_ptLastMouse; // position of last mouse point
|
||||
D3DXVECTOR3 m_vDownPt; // starting point of rotation arc
|
||||
D3DXVECTOR3 m_vCurrentPt; // current point of rotation arc
|
||||
|
||||
D3DXVECTOR3 ScreenToVector( float fScreenPtX, float fScreenPtY );
|
||||
};
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
// used by CCamera to map WM_KEYDOWN keys
|
||||
//--------------------------------------------------------------------------------------
|
||||
enum D3DUtil_CameraKeys
|
||||
{
|
||||
CAM_STRAFE_LEFT = 0,
|
||||
CAM_STRAFE_RIGHT,
|
||||
CAM_MOVE_FORWARD,
|
||||
CAM_MOVE_BACKWARD,
|
||||
CAM_MOVE_UP,
|
||||
CAM_MOVE_DOWN,
|
||||
CAM_RESET,
|
||||
CAM_CONTROLDOWN,
|
||||
CAM_MAX_KEYS,
|
||||
CAM_UNKNOWN = 0xFF
|
||||
};
|
||||
|
||||
#define KEY_WAS_DOWN_MASK 0x80
|
||||
#define KEY_IS_DOWN_MASK 0x01
|
||||
|
||||
#define MOUSE_LEFT_BUTTON 0x01
|
||||
#define MOUSE_MIDDLE_BUTTON 0x02
|
||||
#define MOUSE_RIGHT_BUTTON 0x04
|
||||
#define MOUSE_WHEEL 0x08
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
// Simple base camera class that moves and rotates. The base class
|
||||
// records mouse and keyboard input for use by a derived class, and
|
||||
// keeps common state.
|
||||
//--------------------------------------------------------------------------------------
|
||||
class CBaseCamera
|
||||
{
|
||||
public:
|
||||
CBaseCamera();
|
||||
|
||||
// Call these from client and use Get*Matrix() to read new matrices
|
||||
virtual LRESULT HandleMessages( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam );
|
||||
virtual void FrameMove( FLOAT fElapsedTime ) = 0;
|
||||
|
||||
// Functions to change camera matrices
|
||||
virtual void Reset();
|
||||
virtual void SetViewParams( D3DXVECTOR3* pvEyePt, D3DXVECTOR3* pvLookatPt );
|
||||
virtual void SetProjParams( FLOAT fFOV, FLOAT fAspect, FLOAT fNearPlane, FLOAT fFarPlane );
|
||||
|
||||
// Functions to change behavior
|
||||
virtual void SetDragRect( RECT &rc ) { m_rcDrag = rc; }
|
||||
void SetInvertPitch( bool bInvertPitch ) { m_bInvertPitch = bInvertPitch; }
|
||||
void SetDrag( bool bMovementDrag, FLOAT fTotalDragTimeToZero = 0.25f ) { m_bMovementDrag = bMovementDrag; m_fTotalDragTimeToZero = fTotalDragTimeToZero; }
|
||||
void SetEnableYAxisMovement( bool bEnableYAxisMovement ) { m_bEnableYAxisMovement = bEnableYAxisMovement; }
|
||||
void SetEnablePositionMovement( bool bEnablePositionMovement ) { m_bEnablePositionMovement = bEnablePositionMovement; }
|
||||
void SetClipToBoundary( bool bClipToBoundary, D3DXVECTOR3* pvMinBoundary, D3DXVECTOR3* pvMaxBoundary ) { m_bClipToBoundary = bClipToBoundary; if( pvMinBoundary ) m_vMinBoundary = *pvMinBoundary; if( pvMaxBoundary ) m_vMaxBoundary = *pvMaxBoundary; }
|
||||
void SetScalers( FLOAT fRotationScaler = 0.01f, FLOAT fMoveScaler = 5.0f ) { m_fRotationScaler = fRotationScaler; m_fMoveScaler = fMoveScaler; }
|
||||
void SetNumberOfFramesToSmoothMouseData( int nFrames ) { if( nFrames > 0 ) m_fFramesToSmoothMouseData = (float)nFrames; }
|
||||
void SetResetCursorAfterMove( bool bResetCursorAfterMove ) { m_bResetCursorAfterMove = bResetCursorAfterMove; }
|
||||
|
||||
// Functions to get state
|
||||
const D3DXMATRIX* GetViewMatrix() const { return &m_mView; }
|
||||
const D3DXMATRIX* GetProjMatrix() const { return &m_mProj; }
|
||||
const D3DXVECTOR3* GetEyePt() const { return &m_vEye; }
|
||||
const D3DXVECTOR3* GetLookAtPt() const { return &m_vLookAt; }
|
||||
|
||||
bool IsBeingDragged() { return (m_bMouseLButtonDown || m_bMouseMButtonDown || m_bMouseRButtonDown); }
|
||||
bool IsMouseLButtonDown() { return m_bMouseLButtonDown; }
|
||||
bool IsMouseMButtonDown() { return m_bMouseMButtonDown; }
|
||||
bool IsMouseRButtonDown() { return m_bMouseRButtonDown; }
|
||||
|
||||
protected:
|
||||
// Functions to map a WM_KEYDOWN key to a D3DUtil_CameraKeys enum
|
||||
virtual D3DUtil_CameraKeys MapKey( UINT nKey );
|
||||
bool IsKeyDown( BYTE key ) { return( (key & KEY_IS_DOWN_MASK) == KEY_IS_DOWN_MASK ); }
|
||||
bool WasKeyDown( BYTE key ) { return( (key & KEY_WAS_DOWN_MASK) == KEY_WAS_DOWN_MASK ); }
|
||||
|
||||
void ConstrainToBoundary( D3DXVECTOR3* pV );
|
||||
void UpdateMouseDelta( float fElapsedTime );
|
||||
void UpdateVelocity( float fElapsedTime );
|
||||
|
||||
D3DXMATRIX m_mView; // View matrix
|
||||
D3DXMATRIX m_mProj; // Projection matrix
|
||||
|
||||
BYTE m_aKeys[CAM_MAX_KEYS]; // State of input - KEY_WAS_DOWN_MASK|KEY_IS_DOWN_MASK
|
||||
POINT m_ptLastMousePosition; // Last absolute position of mouse cursor
|
||||
bool m_bMouseLButtonDown; // True if left button is down
|
||||
bool m_bMouseMButtonDown; // True if middle button is down
|
||||
bool m_bMouseRButtonDown; // True if right button is down
|
||||
int m_nCurrentButtonMask; // mask of which buttons are down
|
||||
int m_nMouseWheelDelta; // Amount of middle wheel scroll (+/-)
|
||||
D3DXVECTOR2 m_vMouseDelta; // Mouse relative delta smoothed over a few frames
|
||||
float m_fFramesToSmoothMouseData; // Number of frames to smooth mouse data over
|
||||
|
||||
D3DXVECTOR3 m_vDefaultEye; // Default camera eye position
|
||||
D3DXVECTOR3 m_vDefaultLookAt; // Default LookAt position
|
||||
D3DXVECTOR3 m_vEye; // Camera eye position
|
||||
D3DXVECTOR3 m_vLookAt; // LookAt position
|
||||
float m_fCameraYawAngle; // Yaw angle of camera
|
||||
float m_fCameraPitchAngle; // Pitch angle of camera
|
||||
|
||||
RECT m_rcDrag; // Rectangle within which a drag can be initiated.
|
||||
D3DXVECTOR3 m_vVelocity; // Velocity of camera
|
||||
bool m_bMovementDrag; // If true, then camera movement will slow to a stop otherwise movement is instant
|
||||
D3DXVECTOR3 m_vVelocityDrag; // Velocity drag force
|
||||
FLOAT m_fDragTimer; // Countdown timer to apply drag
|
||||
FLOAT m_fTotalDragTimeToZero; // Time it takes for velocity to go from full to 0
|
||||
D3DXVECTOR2 m_vRotVelocity; // Velocity of camera
|
||||
|
||||
float m_fFOV; // Field of view
|
||||
float m_fAspect; // Aspect ratio
|
||||
float m_fNearPlane; // Near plane
|
||||
float m_fFarPlane; // Far plane
|
||||
|
||||
float m_fRotationScaler; // Scaler for rotation
|
||||
float m_fMoveScaler; // Scaler for movement
|
||||
|
||||
bool m_bInvertPitch; // Invert the pitch axis
|
||||
bool m_bEnablePositionMovement; // If true, then the user can translate the camera/model
|
||||
bool m_bEnableYAxisMovement; // If true, then camera can move in the y-axis
|
||||
|
||||
bool m_bClipToBoundary; // If true, then the camera will be clipped to the boundary
|
||||
D3DXVECTOR3 m_vMinBoundary; // Min point in clip boundary
|
||||
D3DXVECTOR3 m_vMaxBoundary; // Max point in clip boundary
|
||||
|
||||
bool m_bResetCursorAfterMove;// If true, the class will reset the cursor position so that the cursor always has space to move
|
||||
};
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
// Simple first person camera class that moves and rotates.
|
||||
// It allows yaw and pitch but not roll. It uses WM_KEYDOWN and
|
||||
// GetCursorPos() to respond to keyboard and mouse input and updates the
|
||||
// view matrix based on input.
|
||||
//--------------------------------------------------------------------------------------
|
||||
class CFirstPersonCamera : public CBaseCamera
|
||||
{
|
||||
public:
|
||||
CFirstPersonCamera();
|
||||
|
||||
// Call these from client and use Get*Matrix() to read new matrices
|
||||
virtual void FrameMove( FLOAT fElapsedTime );
|
||||
|
||||
// Functions to change behavior
|
||||
void SetRotateButtons( bool bLeft, bool bMiddle, bool bRight );
|
||||
|
||||
// Functions to get state
|
||||
D3DXMATRIX* GetWorldMatrix() { return &m_mCameraWorld; }
|
||||
|
||||
const D3DXVECTOR3* GetWorldRight() const { return (D3DXVECTOR3*)&m_mCameraWorld._11; }
|
||||
const D3DXVECTOR3* GetWorldUp() const { return (D3DXVECTOR3*)&m_mCameraWorld._21; }
|
||||
const D3DXVECTOR3* GetWorldAhead() const { return (D3DXVECTOR3*)&m_mCameraWorld._31; }
|
||||
const D3DXVECTOR3* GetEyePt() const { return (D3DXVECTOR3*)&m_mCameraWorld._41; }
|
||||
|
||||
protected:
|
||||
D3DXMATRIX m_mCameraWorld; // World matrix of the camera (inverse of the view matrix)
|
||||
|
||||
int m_nActiveButtonMask; // Mask to determine which button to enable for rotation
|
||||
};
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
// Simple model viewing camera class that rotates around the object.
|
||||
//--------------------------------------------------------------------------------------
|
||||
class CModelViewerCamera : public CBaseCamera
|
||||
{
|
||||
public:
|
||||
CModelViewerCamera();
|
||||
|
||||
// Call these from client and use Get*Matrix() to read new matrices
|
||||
virtual LRESULT HandleMessages( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam );
|
||||
virtual void FrameMove( FLOAT fElapsedTime );
|
||||
|
||||
|
||||
// Functions to change behavior
|
||||
virtual void SetDragRect( RECT &rc );
|
||||
void Reset();
|
||||
void SetViewParams( D3DXVECTOR3* pvEyePt, D3DXVECTOR3* pvLookatPt );
|
||||
void SetButtonMasks( int nRotateModelButtonMask = MOUSE_LEFT_BUTTON, int nZoomButtonMask = MOUSE_WHEEL, int nRotateCameraButtonMask = MOUSE_RIGHT_BUTTON ) { m_nRotateModelButtonMask = nRotateModelButtonMask, m_nZoomButtonMask = nZoomButtonMask; m_nRotateCameraButtonMask = nRotateCameraButtonMask; }
|
||||
void SetAttachCameraToModel( bool bEnable = false ) { m_bAttachCameraToModel = bEnable; }
|
||||
void SetWindow( int nWidth, int nHeight, float fArcballRadius=0.9f ) { m_WorldArcBall.SetWindow( nWidth, nHeight, fArcballRadius ); m_ViewArcBall.SetWindow( nWidth, nHeight, fArcballRadius ); }
|
||||
void SetRadius( float fDefaultRadius=5.0f, float fMinRadius=1.0f, float fMaxRadius=FLT_MAX ) { m_fDefaultRadius = m_fRadius = fDefaultRadius; m_fMinRadius = fMinRadius; m_fMaxRadius = fMaxRadius; }
|
||||
void SetModelCenter( D3DXVECTOR3 vModelCenter ) { m_vModelCenter = vModelCenter; }
|
||||
void SetLimitPitch( bool bLimitPitch ) { m_bLimitPitch = bLimitPitch; }
|
||||
void SetViewQuat( D3DXQUATERNION q ) { m_ViewArcBall.SetQuatNow( q ); m_bDragSinceLastUpdate = true; }
|
||||
void SetWorldQuat( D3DXQUATERNION q ) { m_WorldArcBall.SetQuatNow( q ); m_bDragSinceLastUpdate = true; }
|
||||
|
||||
// Functions to get state
|
||||
D3DXMATRIX* GetWorldMatrix() { return &m_mWorld; }
|
||||
|
||||
protected:
|
||||
CD3DArcBall m_WorldArcBall;
|
||||
CD3DArcBall m_ViewArcBall;
|
||||
D3DXVECTOR3 m_vModelCenter;
|
||||
D3DXMATRIX m_mModelLastRot; // Last arcball rotation matrix for model
|
||||
D3DXMATRIX m_mModelRot; // Rotation matrix of model
|
||||
D3DXMATRIX m_mWorld; // World matrix of model
|
||||
|
||||
int m_nRotateModelButtonMask;
|
||||
int m_nZoomButtonMask;
|
||||
int m_nRotateCameraButtonMask;
|
||||
|
||||
bool m_bAttachCameraToModel;
|
||||
bool m_bLimitPitch;
|
||||
float m_fRadius; // Distance from the camera to model
|
||||
float m_fDefaultRadius; // Distance from the camera to model
|
||||
float m_fMinRadius; // Min radius
|
||||
float m_fMaxRadius; // Max radius
|
||||
bool m_bDragSinceLastUpdate; // True if mouse drag has happened since last time FrameMove is called.
|
||||
|
||||
D3DXMATRIX m_mCameraRotLast;
|
||||
|
||||
};
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
// Manages the intertion point when drawing text
|
||||
//--------------------------------------------------------------------------------------
|
||||
class CDXUTTextHelper
|
||||
{
|
||||
public:
|
||||
CDXUTTextHelper( ID3DXFont* pFont, ID3DXSprite* pSprite, int nLineHeight );
|
||||
|
||||
void SetInsertionPos( int x, int y ) { m_pt.x = x; m_pt.y = y; }
|
||||
void SetForegroundColor( D3DXCOLOR clr ) { m_clr = clr; }
|
||||
|
||||
void Begin();
|
||||
HRESULT DrawFormattedTextLine( const WCHAR* strMsg, ... );
|
||||
HRESULT DrawTextLine( const WCHAR* strMsg );
|
||||
HRESULT DrawFormattedTextLine( RECT &rc, DWORD dwFlags, const WCHAR* strMsg, ... );
|
||||
HRESULT DrawTextLine( RECT &rc, DWORD dwFlags, const WCHAR* strMsg );
|
||||
void End();
|
||||
|
||||
protected:
|
||||
ID3DXFont* m_pFont;
|
||||
ID3DXSprite* m_pSprite;
|
||||
D3DXCOLOR m_clr;
|
||||
POINT m_pt;
|
||||
int m_nLineHeight;
|
||||
};
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
// Manages a persistent list of lines and draws them using ID3DXLine
|
||||
//--------------------------------------------------------------------------------------
|
||||
class CDXUTLineManager
|
||||
{
|
||||
public:
|
||||
CDXUTLineManager();
|
||||
~CDXUTLineManager();
|
||||
|
||||
HRESULT OnCreatedDevice( IDirect3DDevice9* pd3dDevice );
|
||||
HRESULT OnResetDevice();
|
||||
HRESULT OnRender();
|
||||
HRESULT OnLostDevice();
|
||||
HRESULT OnDeletedDevice();
|
||||
|
||||
HRESULT AddLine( int* pnLineID, D3DXVECTOR2* pVertexList, DWORD dwVertexListCount, D3DCOLOR Color, float fWidth, float fScaleRatio, bool bAntiAlias );
|
||||
HRESULT AddRect( int* pnLineID, RECT rc, D3DCOLOR Color, float fWidth, float fScaleRatio, bool bAntiAlias );
|
||||
HRESULT RemoveLine( int nLineID );
|
||||
HRESULT RemoveAllLines();
|
||||
|
||||
protected:
|
||||
struct LINE_NODE
|
||||
{
|
||||
int nLineID;
|
||||
D3DCOLOR Color;
|
||||
float fWidth;
|
||||
bool bAntiAlias;
|
||||
float fScaleRatio;
|
||||
D3DXVECTOR2* pVertexList;
|
||||
DWORD dwVertexListCount;
|
||||
};
|
||||
|
||||
CGrowableArray<LINE_NODE*> m_LinesList;
|
||||
IDirect3DDevice9* m_pd3dDevice;
|
||||
ID3DXLine* m_pD3DXLine;
|
||||
};
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
// Manages the mesh, direction, mouse events of a directional arrow that
|
||||
// rotates around a radius controlled by an arcball
|
||||
//--------------------------------------------------------------------------------------
|
||||
class CDXUTDirectionWidget
|
||||
{
|
||||
public:
|
||||
CDXUTDirectionWidget();
|
||||
|
||||
static HRESULT StaticOnCreateDevice( IDirect3DDevice9* pd3dDevice );
|
||||
HRESULT OnResetDevice( const D3DSURFACE_DESC* pBackBufferSurfaceDesc );
|
||||
HRESULT OnRender( D3DXCOLOR color, const D3DXMATRIX* pmView, const D3DXMATRIX* pmProj, const D3DXVECTOR3* pEyePt );
|
||||
LRESULT HandleMessages( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam );
|
||||
static void StaticOnLostDevice();
|
||||
static void StaticOnDestroyDevice();
|
||||
|
||||
D3DXVECTOR3 GetLightDirection() { return m_vCurrentDir; };
|
||||
void SetLightDirection( D3DXVECTOR3 vDir ) { m_vDefaultDir = m_vCurrentDir = vDir; };
|
||||
void SetButtonMask( int nRotate = MOUSE_RIGHT_BUTTON ) { m_nRotateMask = nRotate; }
|
||||
|
||||
float GetRadius() { return m_fRadius; };
|
||||
void SetRadius( float fRadius ) { m_fRadius = fRadius; };
|
||||
|
||||
bool IsBeingDragged() { return m_ArcBall.IsBeingDragged(); };
|
||||
|
||||
protected:
|
||||
HRESULT UpdateLightDir();
|
||||
|
||||
static IDirect3DDevice9* s_pd3dDevice;
|
||||
static ID3DXEffect* s_pEffect;
|
||||
static ID3DXMesh* s_pMesh;
|
||||
|
||||
float m_fRadius;
|
||||
int m_nRotateMask;
|
||||
CD3DArcBall m_ArcBall;
|
||||
D3DXVECTOR3 m_vDefaultDir;
|
||||
D3DXVECTOR3 m_vCurrentDir;
|
||||
D3DXMATRIX m_mView;
|
||||
D3DXMATRIXA16 m_mRot;
|
||||
D3DXMATRIXA16 m_mRotSnapshot;
|
||||
};
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
// Tries to finds a media file by searching in common locations
|
||||
//--------------------------------------------------------------------------------------
|
||||
HRESULT DXUTFindDXSDKMediaFileCch( WCHAR* strDestPath, int cchDest, LPCWSTR strFilename );
|
||||
HRESULT DXUTSetMediaSearchPath( LPCWSTR strPath );
|
||||
LPCWSTR DXUTGetMediaSearchPath();
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
// Returns the string for the given D3DFORMAT.
|
||||
// bWithPrefix determines whether the string should include the "D3DFMT_"
|
||||
//--------------------------------------------------------------------------------------
|
||||
LPCWSTR DXUTD3DFormatToString( D3DFORMAT format, bool bWithPrefix );
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
// Builds and sets a cursor for the D3D device based on hCursor.
|
||||
//--------------------------------------------------------------------------------------
|
||||
HRESULT DXUTSetDeviceCursor( IDirect3DDevice9* pd3dDevice, HCURSOR hCursor, bool bAddWatermark );
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
// Returns a view matrix for rendering to a face of a cubemap.
|
||||
//--------------------------------------------------------------------------------------
|
||||
D3DXMATRIX DXUTGetCubeMapViewMatrix( DWORD dwFace );
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
// Debug printing support
|
||||
// See dxerr9.h for more debug printing support
|
||||
//--------------------------------------------------------------------------------------
|
||||
void DXUTOutputDebugStringW( LPCWSTR strMsg, ... );
|
||||
void DXUTOutputDebugStringA( LPCSTR strMsg, ... );
|
||||
HRESULT WINAPI DXUTTrace( const CHAR* strFile, DWORD dwLine, HRESULT hr, const WCHAR* strMsg, bool bPopMsgBox );
|
||||
|
||||
#ifdef UNICODE
|
||||
#define DXUTOutputDebugString DXUTOutputDebugStringW
|
||||
#else
|
||||
#define DXUTOutputDebugString DXUTOutputDebugStringA
|
||||
#endif
|
||||
|
||||
// These macros are very similar to dxerr9's but it special cases the HRESULT defined
|
||||
// by the sample framework pop better message boxes.
|
||||
#if defined(DEBUG) | defined(_DEBUG)
|
||||
#define DXUT_ERR(str,hr) DXUTTrace( __FILE__, (DWORD)__LINE__, hr, str, false )
|
||||
#define DXUT_ERR_MSGBOX(str,hr) DXUTTrace( __FILE__, (DWORD)__LINE__, hr, str, true )
|
||||
#define DXUTTRACE DXUTOutputDebugString
|
||||
#else
|
||||
#define DXUT_ERR(str,hr) (hr)
|
||||
#define DXUT_ERR_MSGBOX(str,hr) (hr)
|
||||
#define DXUTTRACE (__noop)
|
||||
#endif
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
// Direct3D9 dynamic linking support -- calls top-level D3D9 APIs with graceful
|
||||
// failure if APIs are not present.
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
IDirect3D9 * WINAPI DXUT_Dynamic_Direct3DCreate9(UINT SDKVersion);
|
||||
int WINAPI DXUT_Dynamic_D3DPERF_BeginEvent( D3DCOLOR col, LPCWSTR wszName );
|
||||
int WINAPI DXUT_Dynamic_D3DPERF_EndEvent( void );
|
||||
void WINAPI DXUT_Dynamic_D3DPERF_SetMarker( D3DCOLOR col, LPCWSTR wszName );
|
||||
void WINAPI DXUT_Dynamic_D3DPERF_SetRegion( D3DCOLOR col, LPCWSTR wszName );
|
||||
BOOL WINAPI DXUT_Dynamic_D3DPERF_QueryRepeatFrame( void );
|
||||
void WINAPI DXUT_Dynamic_D3DPERF_SetOptions( DWORD dwOptions );
|
||||
DWORD WINAPI DXUT_Dynamic_D3DPERF_GetStatus( void );
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
// Profiling/instrumentation support
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
// Some D3DPERF APIs take a color that can be used when displaying user events in
|
||||
// performance analysis tools. The following constants are provided for your
|
||||
// convenience, but you can use any colors you like.
|
||||
//--------------------------------------------------------------------------------------
|
||||
const D3DCOLOR DXUT_PERFEVENTCOLOR = D3DCOLOR_XRGB(200,100,100);
|
||||
const D3DCOLOR DXUT_PERFEVENTCOLOR2 = D3DCOLOR_XRGB(100,200,100);
|
||||
const D3DCOLOR DXUT_PERFEVENTCOLOR3 = D3DCOLOR_XRGB(100,100,200);
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
// The following macros provide a convenient way for your code to call the D3DPERF
|
||||
// functions only when PROFILE is defined. If PROFILE is not defined (as for the final
|
||||
// release version of a program), these macros evaluate to nothing, so no detailed event
|
||||
// information is embedded in your shipping program. It is recommended that you create
|
||||
// and use three build configurations for your projects:
|
||||
// Debug (nonoptimized code, asserts active, PROFILE defined to assist debugging)
|
||||
// Profile (optimized code, asserts disabled, PROFILE defined to assist optimization)
|
||||
// Release (optimized code, asserts disabled, PROFILE not defined)
|
||||
//--------------------------------------------------------------------------------------
|
||||
#ifdef PROFILE
|
||||
// PROFILE is defined, so these macros call the D3DPERF functions
|
||||
#define DXUT_BeginPerfEvent( color, pstrMessage ) DXUT_Dynamic_D3DPERF_BeginEvent( color, pstrMessage )
|
||||
#define DXUT_EndPerfEvent() DXUT_Dynamic_D3DPERF_EndEvent()
|
||||
#define DXUT_SetPerfMarker( color, pstrMessage ) DXUT_Dynamic_D3DPERF_SetMarker( color, pstrMessage )
|
||||
#else
|
||||
// PROFILE is not defined, so these macros do nothing
|
||||
#define DXUT_BeginPerfEvent( color, pstrMessage ) (__noop)
|
||||
#define DXUT_EndPerfEvent() (__noop)
|
||||
#define DXUT_SetPerfMarker( color, pstrMessage ) (__noop)
|
||||
#endif
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
// CDXUTPerfEventGenerator is a helper class that makes it easy to attach begin and end
|
||||
// events to a block of code. Simply define a CDXUTPerfEventGenerator variable anywhere
|
||||
// in a block of code, and the class's constructor will call DXUT_BeginPerfEvent when
|
||||
// the block of code begins, and the class's destructor will call DXUT_EndPerfEvent when
|
||||
// the block ends.
|
||||
//--------------------------------------------------------------------------------------
|
||||
class CDXUTPerfEventGenerator
|
||||
{
|
||||
public:
|
||||
CDXUTPerfEventGenerator( D3DCOLOR color, LPCWSTR pstrMessage ) { DXUT_BeginPerfEvent( color, pstrMessage ); }
|
||||
~CDXUTPerfEventGenerator( void ) { DXUT_EndPerfEvent(); }
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
// Implementation of CGrowableArray
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
// This version doesn't call ctor or dtor.
|
||||
template< typename TYPE >
|
||||
HRESULT CGrowableArray<TYPE>::SetSizeInternal( int nNewMaxSize )
|
||||
{
|
||||
if( nNewMaxSize < 0 )
|
||||
{
|
||||
assert( false );
|
||||
return E_INVALIDARG;
|
||||
}
|
||||
|
||||
if( nNewMaxSize == 0 )
|
||||
{
|
||||
// Shrink to 0 size & cleanup
|
||||
if( m_pData )
|
||||
{
|
||||
free( m_pData );
|
||||
m_pData = NULL;
|
||||
}
|
||||
|
||||
m_nMaxSize = 0;
|
||||
m_nSize = 0;
|
||||
}
|
||||
else if( m_pData == NULL || nNewMaxSize > m_nMaxSize )
|
||||
{
|
||||
// Grow array
|
||||
int nGrowBy = ( m_nMaxSize == 0 ) ? 16 : m_nMaxSize;
|
||||
nNewMaxSize = max( nNewMaxSize, m_nMaxSize + nGrowBy );
|
||||
|
||||
TYPE* pDataNew = (TYPE*) realloc( m_pData, nNewMaxSize * sizeof(TYPE) );
|
||||
if( pDataNew == NULL )
|
||||
return E_OUTOFMEMORY;
|
||||
|
||||
m_pData = pDataNew;
|
||||
m_nMaxSize = nNewMaxSize;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
template< typename TYPE >
|
||||
HRESULT CGrowableArray<TYPE>::SetSize( int nNewMaxSize )
|
||||
{
|
||||
int nOldSize = m_nSize;
|
||||
|
||||
if( nOldSize > nNewMaxSize )
|
||||
{
|
||||
// Removing elements. Call dtor.
|
||||
|
||||
for( int i = nNewMaxSize; i < nOldSize; ++i )
|
||||
m_pData[i].~TYPE();
|
||||
}
|
||||
|
||||
// Adjust buffer. Note that there's no need to check for error
|
||||
// since if it happens, nOldSize == nNewMaxSize will be true.)
|
||||
HRESULT hr = SetSizeInternal( nNewMaxSize );
|
||||
|
||||
if( nOldSize < nNewMaxSize )
|
||||
{
|
||||
// Adding elements. Call ctor.
|
||||
|
||||
for( int i = nOldSize; i < nNewMaxSize; ++i )
|
||||
::new (&m_pData[i]) TYPE;
|
||||
}
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
template< typename TYPE >
|
||||
HRESULT CGrowableArray<TYPE>::Add( const TYPE& value )
|
||||
{
|
||||
HRESULT hr;
|
||||
if( FAILED( hr = SetSizeInternal( m_nSize + 1 ) ) )
|
||||
return hr;
|
||||
|
||||
// Construct the new element
|
||||
::new (&m_pData[m_nSize]) TYPE;
|
||||
|
||||
// Assign
|
||||
m_pData[m_nSize] = value;
|
||||
++m_nSize;
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
template< typename TYPE >
|
||||
HRESULT CGrowableArray<TYPE>::Insert( int nIndex, const TYPE& value )
|
||||
{
|
||||
HRESULT hr;
|
||||
|
||||
// Validate index
|
||||
if( nIndex < 0 ||
|
||||
nIndex > m_nSize )
|
||||
{
|
||||
assert( false );
|
||||
return E_INVALIDARG;
|
||||
}
|
||||
|
||||
// Prepare the buffer
|
||||
if( FAILED( hr = SetSizeInternal( m_nSize + 1 ) ) )
|
||||
return hr;
|
||||
|
||||
// Shift the array
|
||||
MoveMemory( &m_pData[nIndex+1], &m_pData[nIndex], sizeof(TYPE) * (m_nSize - nIndex) );
|
||||
|
||||
// Construct the new element
|
||||
::new (&m_pData[nIndex]) TYPE;
|
||||
|
||||
// Set the value and increase the size
|
||||
m_pData[nIndex] = value;
|
||||
++m_nSize;
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
template< typename TYPE >
|
||||
HRESULT CGrowableArray<TYPE>::SetAt( int nIndex, const TYPE& value )
|
||||
{
|
||||
// Validate arguments
|
||||
if( nIndex < 0 ||
|
||||
nIndex >= m_nSize )
|
||||
{
|
||||
assert( false );
|
||||
return E_INVALIDARG;
|
||||
}
|
||||
|
||||
m_pData[nIndex] = value;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
// Searches for the specified value and returns the index of the first occurrence
|
||||
// within the section of the data array that extends from iStart and contains the
|
||||
// specified number of elements. Returns -1 if value is not found within the given
|
||||
// section.
|
||||
//--------------------------------------------------------------------------------------
|
||||
template< typename TYPE >
|
||||
int CGrowableArray<TYPE>::IndexOf( const TYPE& value, int iStart, int nNumElements )
|
||||
{
|
||||
// Validate arguments
|
||||
if( iStart < 0 ||
|
||||
iStart >= m_nSize ||
|
||||
nNumElements < 0 ||
|
||||
iStart + nNumElements > m_nSize )
|
||||
{
|
||||
assert( false );
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Search
|
||||
for( int i = iStart; i < (iStart + nNumElements); i++ )
|
||||
{
|
||||
if( value == m_pData[i] )
|
||||
return i;
|
||||
}
|
||||
|
||||
// Not found
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
// Searches for the specified value and returns the index of the last occurrence
|
||||
// within the section of the data array that contains the specified number of elements
|
||||
// and ends at iEnd. Returns -1 if value is not found within the given section.
|
||||
//--------------------------------------------------------------------------------------
|
||||
template< typename TYPE >
|
||||
int CGrowableArray<TYPE>::LastIndexOf( const TYPE& value, int iEnd, int nNumElements )
|
||||
{
|
||||
// Validate arguments
|
||||
if( iEnd < 0 ||
|
||||
iEnd >= m_nSize ||
|
||||
nNumElements < 0 ||
|
||||
iEnd - nNumElements < 0 )
|
||||
{
|
||||
assert( false );
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Search
|
||||
for( int i = iEnd; i > (iEnd - nNumElements); i-- )
|
||||
{
|
||||
if( value == m_pData[i] )
|
||||
return i;
|
||||
}
|
||||
|
||||
// Not found
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
template< typename TYPE >
|
||||
HRESULT CGrowableArray<TYPE>::Remove( int nIndex )
|
||||
{
|
||||
if( nIndex < 0 ||
|
||||
nIndex >= m_nSize )
|
||||
{
|
||||
assert( false );
|
||||
return E_INVALIDARG;
|
||||
}
|
||||
|
||||
// Destruct the element to be removed
|
||||
m_pData[nIndex].~TYPE();
|
||||
|
||||
// Compact the array and decrease the size
|
||||
MoveMemory( &m_pData[nIndex], &m_pData[nIndex+1], sizeof(TYPE) * (m_nSize - (nIndex+1)) );
|
||||
--m_nSize;
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||